impact-ui 5.0.1-prev.4 → 5.0.1-prev.5
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/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/components/TableV36/AdvanceSearchModalItem.d.ts.map +1 -1
- package/dist/components/TableV36/advanceSearchModal.d.ts.map +1 -1
- package/dist/components/TableV36/filterUtils.d.ts +0 -21
- package/dist/components/TableV36/filterUtils.d.ts.map +1 -1
- package/dist/components/TableV36/filterUtils.js +16 -126
- package/dist/components/TableV36/index.d.ts.map +1 -1
- package/dist/components/TableV36/index.js +4 -5
- package/dist/mcp-component-registry.json +1 -2
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/utils/helper.d.ts +0 -2
- package/dist/utils/helper.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/TableV36/filterUtils.test.d.ts +0 -2
- package/dist/components/TableV36/filterUtils.test.d.ts.map +0 -1
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvanceSearchModalItem.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/AdvanceSearchModalItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AdvanceSearchModalItem.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/AdvanceSearchModalItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAgB5D,QAAA,MAAM,sBAAsB,GAAI;;;;;;;;;;;;;;;;;;;;;;;;CAwB/B,sBAmUA,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanceSearchModal.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/advanceSearchModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"advanceSearchModal.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/advanceSearchModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAoB/C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,eAAe,EACf,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,cAA+D,EAC/D,gCAAgC,EAChC,mCAAmC,EACnC,WAAW,EACX,cAAc,EACd,GAAG,IAAI,EACR;;;;;;;;;;;;;;;;;;CAAA,qBAorBA"}
|
|
@@ -51,12 +51,6 @@ export declare const isColumnDataString: (api: any, columnId: any) => boolean;
|
|
|
51
51
|
* @returns {object|undefined} - Filter model entry or undefined if invalid
|
|
52
52
|
*/
|
|
53
53
|
export declare const buildFilterModelEntry: (parsedValue: any, filterType: any, columnDef: any, operationType?: null) => any;
|
|
54
|
-
/**
|
|
55
|
-
* Resolves an advance-search option value from a filterModel key when
|
|
56
|
-
* `columnFieldsFilterMap` maps advance field → filterModel key.
|
|
57
|
-
* Returns `filterKey` unchanged when no reverse mapping exists.
|
|
58
|
-
*/
|
|
59
|
-
export declare const resolveAdvanceSearchFieldFromFilterKey: (filterKey: any, colDefs: any) => any;
|
|
60
54
|
/**
|
|
61
55
|
* Recursively finds a column definition by field or colId
|
|
62
56
|
* @param {array} colDefs - Array of column definitions
|
|
@@ -141,21 +135,6 @@ export declare const updateOrAddFilter: (existingFilters: any, columnId: any, va
|
|
|
141
135
|
* @param {function} getOptionFromDropdownValue - Function to convert dropdown values
|
|
142
136
|
*/
|
|
143
137
|
export declare const syncFiltersWithModal: (api: any, currentColumnId: any, inputValue: any, columnDef: any, colDefs: any, setValue: any, setInitialFilters: any, getOptionFromDropdownValue: any) => void;
|
|
144
|
-
/**
|
|
145
|
-
* Resolves the AG Grid filterModel key for an advance-search field.
|
|
146
|
-
* Prefers columnFieldsFilterMap, then colId / field / advance field.
|
|
147
|
-
*/
|
|
148
|
-
export declare const resolveFilterModelColumnKey: (columnDef: any, advanceField: any) => any;
|
|
149
|
-
/**
|
|
150
|
-
* Builds hidden AG Grid columns for `columnFieldsFilterMap` values that are not
|
|
151
|
-
* already real columns. Without these, setFilterModel drops the mapped keys.
|
|
152
|
-
* Each virtual column filters against the parent column's row-data field.
|
|
153
|
-
*/
|
|
154
|
-
export declare const createVirtualFilterColumns: (colDefs: any) => any[];
|
|
155
|
-
/**
|
|
156
|
-
* Appends hidden virtual filter columns for columnFieldsFilterMap values.
|
|
157
|
-
*/
|
|
158
|
-
export declare const appendVirtualFilterColumns: (colDefs: any) => any;
|
|
159
138
|
/**
|
|
160
139
|
* Processes advance search filters and builds AG Grid filter model
|
|
161
140
|
* @param {array} formValues - Array of filter objects from form
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterUtils.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/filterUtils.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,wBAAwB,GAAI,cAAS,QAoDjD,CAAC;AAGF,eAAO,MAAM,4BAA4B,GAAI,cAAS,EAAE,aAAa,QAyBpE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAK,QAMtC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,GAClC,iBAAY,MACZ,WAAM,QAMN,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAK,EAAE,cAAS;;;CA4EhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAG,EAAE,aAAQ,YAQ/C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,GAAI,gBAAW,EAAE,eAAU,EAAE,cAAS,EAAE,oBAAoB,QAsI7F,CAAC;AA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B,GAAI,oBAAe,EAAE,aAAQ,EAAE,UAAK,EAAE,cAAS,EAAE,YAAO,QAUrF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAG,EACH,oBAAe,EACf,eAAU,EACV,cAAS,EACT,YAAO,EACP,aAAQ,EACR,sBAAiB,EACjB,+BAA0B,SA2B3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GAAI,eAAU,EAAE,YAAO,OAqChE,CAAC"}
|
|
@@ -205,63 +205,23 @@ const buildFilterModelEntry = (parsedValue, filterType, columnDef, operationType
|
|
|
205
205
|
};
|
|
206
206
|
return filterEntry;
|
|
207
207
|
};
|
|
208
|
-
const resolveAdvanceSearchFieldFromFilterKey = (filterKey, colDefs) => {
|
|
209
|
-
if (!colDefs || !filterKey) {
|
|
210
|
-
return filterKey;
|
|
211
|
-
}
|
|
212
|
-
const find = (defs) => {
|
|
213
|
-
for (const col of defs) {
|
|
214
|
-
if (col.children) {
|
|
215
|
-
const nested = find(col.children);
|
|
216
|
-
if (nested != null) {
|
|
217
|
-
return nested;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (col.columnFieldsFilterMap) {
|
|
221
|
-
const entry = Object.entries(col.columnFieldsFilterMap).find(
|
|
222
|
-
([, mapped]) => mapped === filterKey
|
|
223
|
-
);
|
|
224
|
-
if (entry) {
|
|
225
|
-
return entry[0];
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return null;
|
|
230
|
-
};
|
|
231
|
-
return find(colDefs) ?? filterKey;
|
|
232
|
-
};
|
|
233
|
-
const resolveDuplicateAdvanceField = (col, field) => {
|
|
234
|
-
if (!col.toShowDuplicateColumnInAdvanceSearch || !col.columnFieldsInAdvanceSearch) {
|
|
235
|
-
return null;
|
|
236
|
-
}
|
|
237
|
-
let advanceField = field;
|
|
238
|
-
let index = col.columnFieldsInAdvanceSearch.indexOf(field);
|
|
239
|
-
if (index === -1 && col.columnFieldsFilterMap) {
|
|
240
|
-
const entry = Object.entries(col.columnFieldsFilterMap).find(([, mapped]) => mapped === field);
|
|
241
|
-
if (entry) {
|
|
242
|
-
advanceField = entry[0];
|
|
243
|
-
index = col.columnFieldsInAdvanceSearch.indexOf(advanceField);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
if (index === -1) {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
return { advanceField, index };
|
|
250
|
-
};
|
|
251
208
|
const findColumnDef = (colDefs, field) => {
|
|
209
|
+
var _a;
|
|
252
210
|
for (const col of colDefs) {
|
|
253
211
|
if (col.children) {
|
|
254
212
|
const found = findColumnDef(col.children, field);
|
|
255
213
|
if (found) return found;
|
|
256
214
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
215
|
+
if (col.toShowDuplicateColumnInAdvanceSearch && col.columnFieldsInAdvanceSearch) {
|
|
216
|
+
const index = (_a = col.columnFieldsInAdvanceSearch) == null ? void 0 : _a.indexOf(field);
|
|
217
|
+
if (index !== -1) {
|
|
218
|
+
return {
|
|
219
|
+
...col,
|
|
220
|
+
currentColumnField: `${field}${index + 1}`
|
|
221
|
+
// add index + 1
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
} else if (col.colId && col.colId === field || col.field && col.field === field) {
|
|
265
225
|
return col;
|
|
266
226
|
}
|
|
267
227
|
}
|
|
@@ -352,8 +312,7 @@ const hasValidFilterValue = (filter) => {
|
|
|
352
312
|
};
|
|
353
313
|
const convertFilterToModalFormat = (columnId, filter, columnDef, colDefs) => {
|
|
354
314
|
var _a;
|
|
355
|
-
const
|
|
356
|
-
const columnLabel = getColumnLabel(advanceField, columnDef, colDefs);
|
|
315
|
+
const columnLabel = getColumnLabel(columnId, columnDef, colDefs);
|
|
357
316
|
let value = (filter == null ? void 0 : filter.filter) || "";
|
|
358
317
|
if (filter == null ? void 0 : filter.dateFrom) {
|
|
359
318
|
if (typeof filter.dateFrom === "string") {
|
|
@@ -376,7 +335,7 @@ const convertFilterToModalFormat = (columnId, filter, columnDef, colDefs) => {
|
|
|
376
335
|
return {
|
|
377
336
|
column: {
|
|
378
337
|
label: columnLabel,
|
|
379
|
-
value:
|
|
338
|
+
value: columnId,
|
|
380
339
|
type: (filter == null ? void 0 : filter.filterType) || "text"
|
|
381
340
|
},
|
|
382
341
|
operation: {
|
|
@@ -427,11 +386,10 @@ const prepareValueForModal = (inputValue, columnDef, getOptionFromDropdownValue)
|
|
|
427
386
|
}
|
|
428
387
|
};
|
|
429
388
|
const createModalFilterEntry = (columnId, value, columnDef, colDefs) => {
|
|
430
|
-
const advanceField = resolveAdvanceSearchFieldFromFilterKey(columnId, colDefs);
|
|
431
389
|
return {
|
|
432
390
|
column: {
|
|
433
|
-
label: getColumnLabel(
|
|
434
|
-
value:
|
|
391
|
+
label: getColumnLabel(columnId, columnDef, colDefs),
|
|
392
|
+
value: columnId,
|
|
435
393
|
type: (columnDef == null ? void 0 : columnDef.type) || "text"
|
|
436
394
|
},
|
|
437
395
|
operation: getDefaultOperationForColumn(columnDef),
|
|
@@ -470,69 +428,6 @@ const syncFiltersWithModal = (api, currentColumnId, inputValue, columnDef, colDe
|
|
|
470
428
|
console.warn("Error syncing modal filters:", err);
|
|
471
429
|
}
|
|
472
430
|
};
|
|
473
|
-
const resolveFilterModelColumnKey = (columnDef, advanceField) => {
|
|
474
|
-
var _a;
|
|
475
|
-
const mappedKey = (_a = columnDef == null ? void 0 : columnDef.columnFieldsFilterMap) == null ? void 0 : _a[advanceField];
|
|
476
|
-
return mappedKey || (columnDef == null ? void 0 : columnDef.colId) || (columnDef == null ? void 0 : columnDef.field) || advanceField;
|
|
477
|
-
};
|
|
478
|
-
const collectExistingColumnIds = (colDefs, ids = /* @__PURE__ */ new Set()) => {
|
|
479
|
-
(colDefs || []).forEach((col) => {
|
|
480
|
-
if (col.children) {
|
|
481
|
-
collectExistingColumnIds(col.children, ids);
|
|
482
|
-
}
|
|
483
|
-
if (col.colId) ids.add(col.colId);
|
|
484
|
-
if (col.field) ids.add(col.field);
|
|
485
|
-
});
|
|
486
|
-
return ids;
|
|
487
|
-
};
|
|
488
|
-
const createVirtualFilterColumns = (colDefs) => {
|
|
489
|
-
const virtualCols = [];
|
|
490
|
-
const existingIds = collectExistingColumnIds(colDefs);
|
|
491
|
-
const walk = (cols) => {
|
|
492
|
-
(cols || []).forEach((col) => {
|
|
493
|
-
if (col.children) {
|
|
494
|
-
walk(col.children);
|
|
495
|
-
}
|
|
496
|
-
if (!col.columnFieldsFilterMap) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
const parentField = col.field;
|
|
500
|
-
Object.entries(col.columnFieldsFilterMap).forEach(([advanceField, mappedKey]) => {
|
|
501
|
-
if (!mappedKey || existingIds.has(mappedKey)) {
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
existingIds.add(mappedKey);
|
|
505
|
-
virtualCols.push({
|
|
506
|
-
colId: mappedKey,
|
|
507
|
-
field: mappedKey,
|
|
508
|
-
headerName: advanceField,
|
|
509
|
-
hide: true,
|
|
510
|
-
lockVisible: true,
|
|
511
|
-
suppressColumnsToolPanel: true,
|
|
512
|
-
// Keep out of advance-search option lists
|
|
513
|
-
advanceSearchEnabled: false,
|
|
514
|
-
isSearchable: false,
|
|
515
|
-
filter: col.filter || "agTextColumnFilter",
|
|
516
|
-
type: col.type,
|
|
517
|
-
filterParams: col.filterParams,
|
|
518
|
-
valueGetter: (params) => {
|
|
519
|
-
var _a;
|
|
520
|
-
return parentField != null ? (_a = params.data) == null ? void 0 : _a[parentField] : void 0;
|
|
521
|
-
}
|
|
522
|
-
});
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
};
|
|
526
|
-
walk(colDefs);
|
|
527
|
-
return virtualCols;
|
|
528
|
-
};
|
|
529
|
-
const appendVirtualFilterColumns = (colDefs) => {
|
|
530
|
-
if (!Array.isArray(colDefs) || colDefs.length === 0) {
|
|
531
|
-
return colDefs;
|
|
532
|
-
}
|
|
533
|
-
const virtualCols = createVirtualFilterColumns(colDefs);
|
|
534
|
-
return virtualCols.length > 0 ? [...colDefs, ...virtualCols] : colDefs;
|
|
535
|
-
};
|
|
536
431
|
const buildAdvanceSearchFilterModel = (formValues, colDefs) => {
|
|
537
432
|
const filterModel = {};
|
|
538
433
|
if (!formValues || !Array.isArray(formValues)) {
|
|
@@ -551,8 +446,7 @@ const buildAdvanceSearchFilterModel = (formValues, colDefs) => {
|
|
|
551
446
|
if (!isValidFilterValue(parsedValue)) {
|
|
552
447
|
return;
|
|
553
448
|
}
|
|
554
|
-
const
|
|
555
|
-
const columnKey = resolveFilterModelColumnKey(columnDef, advanceField);
|
|
449
|
+
const columnKey = columnDef.colId || value.column.value;
|
|
556
450
|
const filterEntry = buildFilterModelEntry(
|
|
557
451
|
parsedValue,
|
|
558
452
|
filterType,
|
|
@@ -566,12 +460,10 @@ const buildAdvanceSearchFilterModel = (formValues, colDefs) => {
|
|
|
566
460
|
return filterModel;
|
|
567
461
|
};
|
|
568
462
|
export {
|
|
569
|
-
appendVirtualFilterColumns,
|
|
570
463
|
buildAdvanceSearchFilterModel,
|
|
571
464
|
buildFilterModelEntry,
|
|
572
465
|
cleanNumericValue,
|
|
573
466
|
convertFilterToModalFormat,
|
|
574
|
-
createVirtualFilterColumns,
|
|
575
467
|
findColumnDef,
|
|
576
468
|
getColumnLabel,
|
|
577
469
|
getDefaultOperationForColumn,
|
|
@@ -581,8 +473,6 @@ export {
|
|
|
581
473
|
isValidFilterValue,
|
|
582
474
|
parseFilterValue,
|
|
583
475
|
parseInlineSearchValue,
|
|
584
|
-
resolveAdvanceSearchFieldFromFilterKey,
|
|
585
|
-
resolveFilterModelColumnKey,
|
|
586
476
|
syncFiltersWithModal,
|
|
587
477
|
updateOrAddFilter
|
|
588
478
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,sCAAsC,CAAC;AAC9C,OAAO,8CAA8C,CAAC;AACtD,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,sCAAsC,CAAC;AAC9C,OAAO,8CAA8C,CAAC;AACtD,OAAO,qBAAqB,CAAC;AAgjE7B,eAAO,MAAM,QAAQ,mFAUnB,CAAC"}
|