diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js index b707ccbf5..c51ef1e42 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js @@ -38,6 +38,11 @@ this.element.addClass("red-ui-searchBox-input"); this.uiContainer = this.element.wrap("
").parent(); this.uiContainer.addClass("red-ui-searchBox-container"); + + if (this.options.style === "compact") { + this.uiContainer.addClass("red-ui-searchBox-compact"); + } + if (this.element.parents("form").length === 0) { var form = this.element.wrap("
").parent(); form.addClass("red-ui-searchBox-form"); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js index 486eae53b..d6313422a 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js @@ -773,10 +773,12 @@ } }, filter: function(filterFunc,expandResults) { + var totalCount = 0; var filter = function(item) { var matchCount = 0; if (filterFunc && filterFunc(item)) { matchCount++; + totalCount++; } var childCount = 0; if (item.children && typeof item.children !== "function") { @@ -799,11 +801,13 @@ } } if (!filterFunc) { + totalCount++; return true } return matchCount > 0 } - return this._topList.editableList('filter', filter); + this._topList.editableList('filter', filter); + return totalCount; }, get: function(id) { return this._items[id] || null; diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js index eb0caf810..f9064c65b 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js @@ -202,6 +202,7 @@ RED.sidebar.info.outliner = (function() { var toolbar = $("
", {class:"red-ui-sidebar-header red-ui-info-toolbar"}).appendTo(container); searchInput = $('').appendTo(toolbar).searchBox({ + style: "compact", delay: 300, change: function() { var val = $(this).val(); diff --git a/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss b/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss index c98bdb6ad..f51622b89 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss @@ -504,18 +504,6 @@ div.red-ui-info-table { width: calc(100% - 150px); max-width: 250px; background: $palette-header-background; - input.red-ui-searchBox-input { - border: 1px solid $secondary-border-color; - border-radius: 3px; - font-size: 12px; - height: 26px; - } - input:focus.red-ui-searchBox-input { - border: 1px solid $secondary-border-color; - } - i.fa-search, i.fa-times { - top: 7px; - } } } diff --git a/packages/node_modules/@node-red/editor-client/src/sass/ui/common/searchBox.scss b/packages/node_modules/@node-red/editor-client/src/sass/ui/common/searchBox.scss index d0cd631fc..bb51d9969 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/ui/common/searchBox.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/ui/common/searchBox.scss @@ -71,3 +71,18 @@ border-radius: 4px; } } +.red-ui-searchBox-compact { + input.red-ui-searchBox-input,input:focus.red-ui-searchBox-input { + border: 1px solid $secondary-border-color; + border-radius: 3px; + font-size: 12px; + height: 26px; + } + i.fa-times,i.fa-search { + top: 7px; + } + .red-ui-searchBox-resultCount { + top: 3px; + padding: 0 6px; + } +} \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/core/common/24-complete.html b/packages/node_modules/@node-red/nodes/core/common/24-complete.html index e027fe2d7..0919326de 100644 --- a/packages/node_modules/@node-red/nodes/core/common/24-complete.html +++ b/packages/node_modules/@node-red/nodes/core/common/24-complete.html @@ -2,7 +2,8 @@
-
+
+
@@ -45,6 +46,22 @@ var editorRow = $("#dialog-form>div.node-input-target-list-row"); editorRow.css("height",height+"px"); }; + var search = $("#node-input-complete-target-filter").searchBox({ + style: "compact", + delay: 300, + change: function() { + var val = $(this).val().trim(); + if (val === "") { + dirList.treeList("filter", null); + search.searchBox("count",""); + } else { + var count = dirList.treeList("filter", function(item) { + return item.label.indexOf(val) > -1 + }); + search.searchBox("count",count+" / "+candidateNodes.length); + } + } + }); var dirList = $("#node-input-complete-target-container-div").css({width: "100%", height: "100%"}) .treeList({multi:true}).on("treelistitemmouseover", function(e, item) { diff --git a/packages/node_modules/@node-red/nodes/core/common/25-catch.html b/packages/node_modules/@node-red/nodes/core/common/25-catch.html index e25f1b90a..066fb6ee2 100644 --- a/packages/node_modules/@node-red/nodes/core/common/25-catch.html +++ b/packages/node_modules/@node-red/nodes/core/common/25-catch.html @@ -14,7 +14,8 @@
-
+
+
@@ -60,7 +61,22 @@ var editorRow = $("#dialog-form>div.node-input-target-list-row"); editorRow.css("height",height+"px"); }; - + var search = $("#node-input-catch-target-filter").searchBox({ + style: "compact", + delay: 300, + change: function() { + var val = $(this).val().trim(); + if (val === "") { + dirList.treeList("filter", null); + search.searchBox("count",""); + } else { + var count = dirList.treeList("filter", function(item) { + return item.label.indexOf(val) > -1 + }); + search.searchBox("count",count+" / "+candidateNodes.length); + } + } + }); var dirList = $("#node-input-catch-target-container-div").css({width: "100%", height: "100%"}) .treeList({multi:true}).on("treelistitemmouseover", function(e, item) { item.node.highlighted = true; diff --git a/packages/node_modules/@node-red/nodes/core/common/25-status.html b/packages/node_modules/@node-red/nodes/core/common/25-status.html index 0235c3efb..00831330b 100644 --- a/packages/node_modules/@node-red/nodes/core/common/25-status.html +++ b/packages/node_modules/@node-red/nodes/core/common/25-status.html @@ -10,7 +10,8 @@
-
+
+
@@ -48,6 +49,22 @@ var editorRow = $("#dialog-form>div.node-input-target-list-row"); editorRow.css("height",height+"px"); }; + var search = $("#node-input-status-target-filter").searchBox({ + style: "compact", + delay: 300, + change: function() { + var val = $(this).val().trim(); + if (val === "") { + dirList.treeList("filter", null); + search.searchBox("count",""); + } else { + var count = dirList.treeList("filter", function(item) { + return item.label.indexOf(val) > -1 + }); + search.searchBox("count",count+" / "+candidateNodes.length); + } + } + }); var dirList = $("#node-input-status-target-container-div").css({width: "100%", height: "100%"}) .treeList({multi:true}).on("treelistitemmouseover", function(e, item) { diff --git a/packages/node_modules/@node-red/nodes/core/common/60-link.html b/packages/node_modules/@node-red/nodes/core/common/60-link.html index cadf43efa..c3424830e 100644 --- a/packages/node_modules/@node-red/nodes/core/common/60-link.html +++ b/packages/node_modules/@node-red/nodes/core/common/60-link.html @@ -4,6 +4,7 @@
+
@@ -47,6 +49,24 @@ }); var candidateNodes = RED.nodes.filterNodes({type:targetType}); + var search = $("#node-input-link-target-filter").searchBox({ + style: "compact", + delay: 300, + change: function() { + var val = $(this).val().trim(); + if (val === "") { + treeList.treeList("filter", null); + search.searchBox("count",""); + } else { + var count = treeList.treeList("filter", function(item) { + return item.label.indexOf(val) > -1 + }); + search.searchBox("count",count+" / "+candidateNodes.length); + } + } + }); + + var flows = []; var flowMap = {};