aq-fe-framework 0.1.547 → 0.1.549
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.
|
@@ -261,15 +261,17 @@ function utils_list_sumField(list, field) {
|
|
|
261
261
|
function utils_mantineReactTable_filterColumnsByVisibleKeys(allColumns, visibleFields) {
|
|
262
262
|
if (!visibleFields || visibleFields.length === 0) return allColumns;
|
|
263
263
|
return allColumns.filter((col) => {
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
var _a;
|
|
265
|
+
const key = (_a = col.accessorKey) != null ? _a : col.id;
|
|
266
|
+
return typeof key === "string" && visibleFields.includes(key);
|
|
266
267
|
});
|
|
267
268
|
}
|
|
268
269
|
function utils_mantineReactTable_sortColumnsByKeyOrder(columns, orderedKeys) {
|
|
269
|
-
if (!orderedKeys) return columns;
|
|
270
|
+
if (!orderedKeys || orderedKeys.length === 0) return columns;
|
|
270
271
|
return [...columns].sort((a, b) => {
|
|
271
|
-
|
|
272
|
-
const
|
|
272
|
+
var _a, _b;
|
|
273
|
+
const aKey = (_a = a.accessorKey) != null ? _a : a.id;
|
|
274
|
+
const bKey = (_b = b.accessorKey) != null ? _b : b.id;
|
|
273
275
|
const aIndex = orderedKeys.indexOf(aKey);
|
|
274
276
|
const bIndex = orderedKeys.indexOf(bKey);
|
|
275
277
|
return (aIndex === -1 ? Infinity : aIndex) - (bIndex === -1 ? Infinity : bIndex);
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -52,7 +52,7 @@ declare function utils_list_hasEmptyField<T>(list: T[], field: keyof T): boolean
|
|
|
52
52
|
declare function utils_list_sumField<T>(list: T[], field: keyof T): number;
|
|
53
53
|
|
|
54
54
|
declare function utils_mantineReactTable_filterColumnsByVisibleKeys<T extends MRT_RowData>(allColumns: MRT_ColumnDef<T>[], visibleFields?: (keyof T | string)[]): MRT_ColumnDef<T>[];
|
|
55
|
-
declare function utils_mantineReactTable_sortColumnsByKeyOrder<T extends MRT_RowData>(columns: MRT_ColumnDef<T>[], orderedKeys?: (keyof T)[]): MRT_ColumnDef<T>[];
|
|
55
|
+
declare function utils_mantineReactTable_sortColumnsByKeyOrder<T extends MRT_RowData>(columns: MRT_ColumnDef<T>[], orderedKeys?: (keyof T | string)[]): MRT_ColumnDef<T>[];
|
|
56
56
|
|
|
57
57
|
interface I {
|
|
58
58
|
crudType?: "delete" | "update" | "create" | "error" | "importSucess";
|
package/dist/utils/index.mjs
CHANGED