diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index 9f3934552..e033bec99 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -73,7 +73,7 @@ if(match.post) { els.push($('').text(match.post)); } return els; } - + const msgAutoComplete = function(options) { return function(val) { var matches = []; @@ -230,7 +230,7 @@ contextKnownKeys[scope][store].set(keyPrefix + key, keyInfo) } else { contextKnownKeys[scope][store].set(searchKey + "[\""+key.replace(/"/,"\\\"")+"\"]", keyInfo) - } + } }) done() }) @@ -257,7 +257,7 @@ } const store = (contextStoreOptions.length === 1) ? contextStoreOptions[0].value : that.optionValue const searchKey = keyParts.join('.') - + getContextKeysFromRuntime(scope, store, searchKey, function() { if (contextKnownKeys[scope][store].has(key) || key.endsWith(']')) { getContextKeysFromRuntime(scope, store, key, function() { @@ -424,7 +424,23 @@ }) } }, - re: { value: "re", label: "regular expression", icon: "red/images/typedInput/re.svg" }, + re: { value: "re", label: "regular expression", icon: "red/images/typedInput/re.svg", + expand: function () { + var that = this; + var value = this.value(); + RED.editor.editText({ + value: value, + title: "Regex editor", + stateId: RED.editor.generateViewStateId("typedInput", that, "regex"), + focus: true, + complete: function (v) { + try { new RegExp(v); } + catch(err) { } + that.value(v); + } + }) + } + }, date: { value: "date", label: "timestamp", @@ -668,7 +684,7 @@ const row1Name = $('
').text(def.type) const row2Module = $('
').text(def.set.module) container.append(row1Name, row2Module) - + return { value: def.type, name: def.type, @@ -685,7 +701,7 @@ } }; - + // For a type with options, check value is a valid selection // If !opt.multiple, returns the valid option object // if opt.multiple, returns an array of valid option objects