@salesforcedevs/dx-components 1.17.6 → 1.17.8-search-alpha2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lwc.config.json CHANGED
@@ -136,6 +136,7 @@
136
136
  "dxUtils/normalizers",
137
137
  "dxUtils/queryCoordinator",
138
138
  "dxUtils/recentSearches",
139
+ "dxUtils/regexps",
139
140
  "dxUtils/withTypedRefs",
140
141
  "dxUtils/wordpress"
141
142
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.17.6",
3
+ "version": "1.17.8-search-alpha2",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,6 +44,5 @@
44
44
  },
45
45
  "volta": {
46
46
  "node": "20.19.0"
47
- },
48
- "gitHead": "a3108bb2342f34377f5ec64b2bd0cb0c67c2c506"
47
+ }
49
48
  }
@@ -58,6 +58,7 @@
58
58
  value={searchText}
59
59
  onchange={onSearchChange}
60
60
  shortcut-key="j"
61
+ clearable
61
62
  ></dx-input>
62
63
  </div>
63
64
  <slot name="version-picker"></slot>
@@ -137,10 +137,32 @@ export default class Sidebar extends SidebarBase {
137
137
  node: TreeNode
138
138
  ): TreeNode | undefined {
139
139
  const isExpanded = node.isChildrenLoading ? false : true;
140
+
141
+ // Check if label matches
140
142
  if (valuePattern.test(node.label.toLowerCase())) {
141
143
  return { ...node, isExpanded };
142
144
  }
143
145
 
146
+ // Check if endpointsName array exists and contains a match
147
+ if (node.endpointNames && Array.isArray(node.endpointNames)) {
148
+ const hasEndpointMatch = node.endpointNames.some((endpointName) => {
149
+ const endpointWords = endpointName.toLowerCase().split(/\s+/);
150
+ const searchWords = valuePattern.source
151
+ .toLowerCase()
152
+ .split(/\s+/);
153
+ return searchWords.some((searchWord) =>
154
+ endpointWords.some(
155
+ (endpointWord) =>
156
+ endpointWord.includes(searchWord) ||
157
+ searchWord.includes(endpointWord)
158
+ )
159
+ );
160
+ });
161
+ if (hasEndpointMatch) {
162
+ return { ...node, isExpanded };
163
+ }
164
+ }
165
+
144
166
  const filteredChildren = this.filterChildren(
145
167
  valuePattern,
146
168
  node.children
@@ -1,5 +1,6 @@
1
1
  import { logCoveoPageView } from "docUtils/utils";
2
2
  import { LightningElement, api } from "lwc";
3
+ import { escapeRegExp } from "dxUtils/regexps";
3
4
 
4
5
  const REDUNDANT_INSTANCE_ERROR_MESSAGE =
5
6
  "Multiple <dx-traffic-labeler>s detected, this should never be the case.";
@@ -36,7 +37,7 @@ export default class TrafficLabeler extends LightningElement {
36
37
  const internalIps = this.internalIps?.split(",");
37
38
 
38
39
  const isInternal = internalIps?.some((value) => {
39
- const regex = new RegExp(value);
40
+ const regex = new RegExp(escapeRegExp(value));
40
41
  return regex.test(result.ip);
41
42
  });
42
43
 
@@ -1,4 +1,4 @@
1
- const escapeRegExp = (text: string) =>
1
+ export const escapeRegExp = (text: string) =>
2
2
  text.replace(/[-[\]{}()*+?.,\\^$|]/g, "\\$&");
3
3
 
4
4
  export const createSearchRegExp = (searchTerm: string): RegExp =>
package/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2020, Salesforce.com, Inc.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.