From b9d21c5d2382f5ba3ed8de232391c9199c051ac8 Mon Sep 17 00:00:00 2001 From: Steve-Mcl Date: Mon, 30 Sep 2024 16:17:07 +0100 Subject: [PATCH 1/9] adjust Node UI to use a typed input for the key --- nodes/widgets/locales/en-US/ui_table.html | 1 + nodes/widgets/locales/en-US/ui_table.json | 3 ++- nodes/widgets/ui_table.html | 26 ++++++++++++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/nodes/widgets/locales/en-US/ui_table.html b/nodes/widgets/locales/en-US/ui_table.html index fc1fe5cab..82a056af4 100644 --- a/nodes/widgets/locales/en-US/ui_table.html +++ b/nodes/widgets/locales/en-US/ui_table.html @@ -7,6 +7,7 @@

Input

The ui-table widget requires an array or an object of data to be sent via msg.payload. If an array is provided, the table will render a row for each object within the array, and, by default, a column for each property in the objects. If an object is provided, the table will render a single row with columns for each property in the object. + The text displayed for a row can be either a key or a string. Selecting key will look up the value of the named key in the object, while a string will display the string as is.

Properties

diff --git a/nodes/widgets/locales/en-US/ui_table.json b/nodes/widgets/locales/en-US/ui_table.json index c41c1cc7c..bf2978df8 100644 --- a/nodes/widgets/locales/en-US/ui_table.json +++ b/nodes/widgets/locales/en-US/ui_table.json @@ -6,7 +6,8 @@ "maxRows": "Max Rows", "columns": "Columns", "autoCalculateColumns": "Auto Calculate Columns", - "key": "Key", + "key": "key:", + "value": "Value", "label": "Label", "type": "Type", "width": "Width", diff --git a/nodes/widgets/ui_table.html b/nodes/widgets/ui_table.html index be08a2db0..8bc4520c7 100644 --- a/nodes/widgets/ui_table.html +++ b/nodes/widgets/ui_table.html @@ -33,7 +33,8 @@ .node-input-column-row-property:not(:first-child) { margin-top: 3px; } - #node-input-column-container .node-input-column-row-property input, + #node-input-column-container .node-input-column-row-property input:not(.red-ui-typedInput-input):not(.red-ui-typedInput), + #node-input-column-container .node-input-column-row-property div.red-ui-typedInput-container, #node-input-column-container .node-input-column-row-property select { flex-grow: 1; width: 50%; @@ -178,14 +179,27 @@ // key const keyRow = $('
', { class: 'node-input-column-row-property' }).appendTo(options) $('