next-helios-fe 1.10.5 → 1.10.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.10.5",
3
+ "version": "1.10.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -93,7 +93,12 @@ export const ModalSelect: React.FC<ModalSelectProps> = ({
93
93
  setMaxData((prev: any) => prev + 20);
94
94
  if (dynamicSelect?.getValue) {
95
95
  dynamicSelect?.getValue({
96
- filter: [{ key: searchBy, value: delayedSearch }],
96
+ filter: [
97
+ {
98
+ ...(data.searchableColumns ? { key: searchBy } : {}),
99
+ value: delayedSearch,
100
+ },
101
+ ],
97
102
  maxRow: maxData + 20,
98
103
  });
99
104
  }
@@ -123,7 +128,12 @@ export const ModalSelect: React.FC<ModalSelectProps> = ({
123
128
  useEffect(() => {
124
129
  if (dynamicSelect?.getValue) {
125
130
  dynamicSelect.getValue({
126
- filter: [{ key: searchBy, value: delayedSearch }],
131
+ filter: [
132
+ {
133
+ ...(data.searchableColumns ? { key: searchBy } : {}),
134
+ value: delayedSearch,
135
+ },
136
+ ],
127
137
  maxRow: maxData,
128
138
  });
129
139
  }
@@ -245,7 +255,9 @@ export const ModalSelect: React.FC<ModalSelectProps> = ({
245
255
  {(dynamicSelect?.getValue
246
256
  ? delayedSearch
247
257
  ? data.menus.filter((optionItem: any) =>
248
- optionItem.label
258
+ optionItem[
259
+ data.searchableColumns && searchBy ? searchBy : "label"
260
+ ]
249
261
  .toLowerCase()
250
262
  .includes(delayedSearch.toLowerCase())
251
263
  )
@@ -259,7 +271,11 @@ export const ModalSelect: React.FC<ModalSelectProps> = ({
259
271
  ),
260
272
  ]
261
273
  : data.menus.filter((optionItem: any) =>
262
- optionItem.label.toLowerCase().includes(search.toLowerCase())
274
+ optionItem[
275
+ data.searchableColumns && searchBy ? searchBy : "label"
276
+ ]
277
+ .toLowerCase()
278
+ .includes(search.toLowerCase())
263
279
  )
264
280
  )?.length === 0 ? (
265
281
  <div className="flex-1 flex justify-center items-center">
@@ -269,7 +285,9 @@ export const ModalSelect: React.FC<ModalSelectProps> = ({
269
285
  (dynamicSelect?.getValue
270
286
  ? delayedSearch
271
287
  ? data.menus.filter((optionItem: any) =>
272
- optionItem.label
288
+ optionItem[
289
+ data.searchableColumns && searchBy ? searchBy : "label"
290
+ ]
273
291
  .toLowerCase()
274
292
  .includes(delayedSearch.toLowerCase())
275
293
  )
@@ -283,7 +301,9 @@ export const ModalSelect: React.FC<ModalSelectProps> = ({
283
301
  ),
284
302
  ]
285
303
  : data.menus.filter((optionItem: any) =>
286
- optionItem.label
304
+ optionItem[
305
+ data.searchableColumns && searchBy ? searchBy : "label"
306
+ ]
287
307
  .toLowerCase()
288
308
  .includes(search.toLowerCase())
289
309
  )