aq-fe-framework 0.1.542 → 0.1.544
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/{chunk-6N4KCI5F.mjs → chunk-5ZQB77YQ.mjs} +7 -2
- package/dist/{chunk-6SKW54VT.mjs → chunk-F3A4SX3H.mjs} +16 -21
- package/dist/components/index.d.mts +1 -1
- package/dist/core/index.d.mts +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/modules-features/index.mjs +5 -5
- package/dist/{types-DbltiEAP.d.mts → types-R8qp2Kru.d.mts} +1 -1
- package/dist/utils/index.d.mts +3 -4
- package/dist/utils/index.mjs +5 -7
- package/package.json +1 -1
|
@@ -79,7 +79,11 @@ var getActionConfig = (colorScheme) => ({
|
|
|
79
79
|
},
|
|
80
80
|
select: {},
|
|
81
81
|
check: {},
|
|
82
|
-
find: {}
|
|
82
|
+
find: {},
|
|
83
|
+
tempDelete: {
|
|
84
|
+
color: "red",
|
|
85
|
+
children: /* @__PURE__ */ jsx(IconX, {})
|
|
86
|
+
}
|
|
83
87
|
});
|
|
84
88
|
function MyActionIcon(_a) {
|
|
85
89
|
var _b = _a, { children, actionType } = _b, rest = __objRest(_b, ["children", "actionType"]);
|
|
@@ -173,7 +177,8 @@ var getActionConfig2 = (colorScheme) => ({
|
|
|
173
177
|
color: "green",
|
|
174
178
|
leftSection: /* @__PURE__ */ jsx2(IconSearch, {}),
|
|
175
179
|
children: "T\xECm"
|
|
176
|
-
}
|
|
180
|
+
},
|
|
181
|
+
tempDelete: {}
|
|
177
182
|
});
|
|
178
183
|
function MyButton(_a) {
|
|
179
184
|
var _b = _a, { children, actionType } = _b, rest = __objRest(_b, ["children", "actionType"]);
|
|
@@ -270,23 +270,19 @@ function utils_list_sumField(list, field) {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
// src/utils/utils_mantineReactTable.ts
|
|
273
|
-
function
|
|
273
|
+
function utils_mantineReactTable_filterColumnsByVisibleKeys(allColumns, visibleFields) {
|
|
274
274
|
if (!visibleFields || visibleFields.length === 0) return allColumns;
|
|
275
275
|
return allColumns.filter(
|
|
276
276
|
(col) => typeof col.accessorKey === "string" && visibleFields.includes(col.accessorKey)
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
281
|
-
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
function utils_mantineReactTable_sortColumnsByOrder(allColumns, order) {
|
|
285
|
-
return [...allColumns].sort((a, b) => {
|
|
279
|
+
function utils_mantineReactTable_sortColumnsByKeyOrder(columns, orderedKeys) {
|
|
280
|
+
if (!orderedKeys) return columns;
|
|
281
|
+
return [...columns].sort((a, b) => {
|
|
286
282
|
const aKey = a.accessorKey;
|
|
287
283
|
const bKey = b.accessorKey;
|
|
288
|
-
const aIndex =
|
|
289
|
-
const bIndex =
|
|
284
|
+
const aIndex = orderedKeys.indexOf(aKey);
|
|
285
|
+
const bIndex = orderedKeys.indexOf(bKey);
|
|
290
286
|
return (aIndex === -1 ? Infinity : aIndex) - (bIndex === -1 ? Infinity : bIndex);
|
|
291
287
|
});
|
|
292
288
|
}
|
|
@@ -364,16 +360,6 @@ var utils_validator_validateCode = (value) => {
|
|
|
364
360
|
};
|
|
365
361
|
|
|
366
362
|
export {
|
|
367
|
-
utils_mantineDataTable_filterColumns,
|
|
368
|
-
utils_mantineReactTable_getVisibleColumnsByHiddenKeys,
|
|
369
|
-
utils_mantineReactTable_sortColumnsByOrder,
|
|
370
|
-
U0MyValidateEmpty,
|
|
371
|
-
U0MyValidateEmail,
|
|
372
|
-
utils_validator_validateCode,
|
|
373
|
-
updateEnableList,
|
|
374
|
-
utils_file_fileToAQDocumentType,
|
|
375
|
-
utils_file_AQDocumentTypeToFile,
|
|
376
|
-
utils_file_docxtemplaterDownload,
|
|
377
363
|
utils_config_getBaseUrl,
|
|
378
364
|
utils_converter_mapEnumToSelectData,
|
|
379
365
|
utils_converter_getLabelByValue,
|
|
@@ -383,15 +369,24 @@ export {
|
|
|
383
369
|
utils_excel_exportExcel,
|
|
384
370
|
utils_excel_download,
|
|
385
371
|
utils_field_extractAQBaseField,
|
|
372
|
+
utils_file_fileToAQDocumentType,
|
|
373
|
+
utils_file_AQDocumentTypeToFile,
|
|
374
|
+
utils_file_docxtemplaterDownload,
|
|
386
375
|
utils_format_fixDecimal,
|
|
376
|
+
updateEnableList,
|
|
387
377
|
utils_list_isTotalEqual,
|
|
388
378
|
utils_list_isFieldUnique,
|
|
389
379
|
utils_list_hasEmptyField,
|
|
390
380
|
utils_list_sumField,
|
|
381
|
+
utils_mantineReactTable_filterColumnsByVisibleKeys,
|
|
382
|
+
utils_mantineReactTable_sortColumnsByKeyOrder,
|
|
391
383
|
utils_reactQuery_updateListItemInQuery,
|
|
392
384
|
utils_text_getNormalizedTextFromHtml,
|
|
393
385
|
utils_time_convertTimeStringToSeconds,
|
|
394
386
|
utils_time_getHourMinuteFromString,
|
|
395
387
|
utils_time_getCurrentTimeString,
|
|
396
|
-
utils_time_extractHourMinute
|
|
388
|
+
utils_time_extractHourMinute,
|
|
389
|
+
U0MyValidateEmpty,
|
|
390
|
+
U0MyValidateEmail,
|
|
391
|
+
utils_validator_validateCode
|
|
397
392
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { ReactNode, ComponentProps } from 'react';
|
|
3
|
-
import { t as type_action, a as type_mantineSize } from '../types-
|
|
3
|
+
import { t as type_action, a as type_mantineSize } from '../types-R8qp2Kru.mjs';
|
|
4
4
|
import { ActionIconProps, ButtonProps, useModalsStack, CheckboxProps, SelectProps, NumberFormatterProps, FieldsetProps, FileInputProps, NumberInputProps, TextareaProps, MantineSize, InputWrapperProps, TextInputProps, ContainerProps, FlexProps, GroupProps, TypographyStylesProviderProps, TabsProps, SkeletonProps } from '@mantine/core';
|
|
5
5
|
import { AxiosResponse } from 'axios';
|
|
6
6
|
import { M as MyApiResponse } from '../createBaseApi-75GHCO22.mjs';
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { t as type_action } from '../types-
|
|
2
|
+
import { t as type_action } from '../types-R8qp2Kru.mjs';
|
|
3
3
|
import { ActionIconProps, ButtonProps, ModalProps, ScrollAreaAutosizeProps, TextProps, PaperProps, GroupProps, ThemeIconProps, InputWrapperProps, SelectProps, TextInputProps, FlexProps } from '@mantine/core';
|
|
4
4
|
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
5
5
|
import { UseFormReturnType } from '@mantine/form';
|
package/dist/core/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
utils_config_getBaseUrl,
|
|
5
5
|
utils_converter_enumToSelectOptions,
|
|
6
6
|
utils_file_fileToAQDocumentType,
|
|
7
|
-
|
|
8
|
-
} from "../chunk-
|
|
7
|
+
utils_mantineReactTable_filterColumnsByVisibleKeys
|
|
8
|
+
} from "../chunk-F3A4SX3H.mjs";
|
|
9
9
|
import {
|
|
10
10
|
baseColumns
|
|
11
11
|
} from "../chunk-7PUDC2WF.mjs";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
MyButton as MyButton2,
|
|
17
17
|
MyDataTableSelectOne,
|
|
18
18
|
MyTextInput as MyTextInput2
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-5ZQB77YQ.mjs";
|
|
20
20
|
import {
|
|
21
21
|
const_object_documentTypes
|
|
22
22
|
} from "../chunk-GFEMKKFH.mjs";
|
|
@@ -113,7 +113,7 @@ function UseCase_AccountTable(_a) {
|
|
|
113
113
|
}
|
|
114
114
|
], []);
|
|
115
115
|
const columns = useMemo(() => {
|
|
116
|
-
return
|
|
116
|
+
return utils_mantineReactTable_filterColumnsByVisibleKeys(allColumns, visibleFields);
|
|
117
117
|
}, [allColumns, visibleFields]);
|
|
118
118
|
return /* @__PURE__ */ jsx(
|
|
119
119
|
MyDataTable,
|
|
@@ -874,7 +874,7 @@ function UseCase_RoleTable(_a) {
|
|
|
874
874
|
...baseColumns
|
|
875
875
|
], []);
|
|
876
876
|
const columns = useMemo3(() => {
|
|
877
|
-
return
|
|
877
|
+
return utils_mantineReactTable_filterColumnsByVisibleKeys(allColumns, visibleFields);
|
|
878
878
|
}, [allColumns, visibleFields]);
|
|
879
879
|
return /* @__PURE__ */ jsx11(
|
|
880
880
|
MyDataTable,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MantineSize } from '@mantine/core';
|
|
2
2
|
|
|
3
3
|
type type_mantineSize = number | MantineSize | (string & {}) | undefined;
|
|
4
|
-
type type_action = "default" | "create" | "update" | "delete" | "save" | "createMultiple" | "check" | "import" | "print" | "cancel" | "export" | "select" | "find";
|
|
4
|
+
type type_action = "default" | "create" | "update" | "delete" | "save" | "createMultiple" | "check" | "import" | "print" | "cancel" | "export" | "select" | "find" | "tempDelete";
|
|
5
5
|
|
|
6
6
|
export type { type_mantineSize as a, type_action as t };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -51,9 +51,8 @@ declare function utils_list_isFieldUnique<T>(list: T[], field: keyof T): boolean
|
|
|
51
51
|
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
|
-
declare function
|
|
55
|
-
declare function
|
|
56
|
-
declare function utils_mantineReactTable_sortColumnsByOrder<T extends MRT_RowData>(allColumns: MRT_ColumnDef<T>[], order: (keyof T)[]): MRT_ColumnDef<T>[];
|
|
54
|
+
declare function utils_mantineReactTable_filterColumnsByVisibleKeys<T extends MRT_RowData>(allColumns: MRT_ColumnDef<T>[], visibleFields?: (keyof T)[]): MRT_ColumnDef<T>[];
|
|
55
|
+
declare function utils_mantineReactTable_sortColumnsByKeyOrder<T extends MRT_RowData>(columns: MRT_ColumnDef<T>[], orderedKeys?: (keyof T)[]): MRT_ColumnDef<T>[];
|
|
57
56
|
|
|
58
57
|
interface I {
|
|
59
58
|
crudType?: "delete" | "update" | "create" | "error" | "importSucess";
|
|
@@ -84,4 +83,4 @@ declare function U0MyValidateEmpty(message?: string): (value: unknown) => React.
|
|
|
84
83
|
declare function U0MyValidateEmail(value?: string): "Email không đúng định dạng" | null;
|
|
85
84
|
declare const utils_validator_validateCode: (value?: string) => "Không được để trống" | "Chỉ được nhập chữ, số và dấu '-' (không bắt đầu bằng '-')" | null;
|
|
86
85
|
|
|
87
|
-
export { U0DateToDDMMYYYString, U0MyValidateEmail, U0MyValidateEmpty, updateEnableList, utils_converter_enumToSelectOptions, utils_converter_getKeyByValue, utils_converter_getLabelByValue, utils_converter_mapEnumToSelectData, utils_currency_formatWithSuffix, utils_date_dateToDDMMYYYString, utils_date_formatToDateTimeStartEnd, utils_date_getHHmm, utils_field_extractAQBaseField, utils_format_fixDecimal, utils_list_hasEmptyField, utils_list_isFieldUnique, utils_list_isTotalEqual, utils_list_sumField,
|
|
86
|
+
export { U0DateToDDMMYYYString, U0MyValidateEmail, U0MyValidateEmpty, updateEnableList, utils_converter_enumToSelectOptions, utils_converter_getKeyByValue, utils_converter_getLabelByValue, utils_converter_mapEnumToSelectData, utils_currency_formatWithSuffix, utils_date_dateToDDMMYYYString, utils_date_formatToDateTimeStartEnd, utils_date_getHHmm, utils_field_extractAQBaseField, utils_format_fixDecimal, utils_list_hasEmptyField, utils_list_isFieldUnique, utils_list_isTotalEqual, utils_list_sumField, utils_mantineReactTable_filterColumnsByVisibleKeys, utils_mantineReactTable_sortColumnsByKeyOrder, utils_notification_show, utils_pdf_download, utils_reactQuery_updateListItemInQuery, utils_text_getNormalizedTextFromHtml, utils_time_convertTimeStringToSeconds, utils_time_extractHourMinute, utils_time_getCurrentTimeString, utils_time_getHourMinuteFromString, utils_validator_validateCode };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -18,9 +18,8 @@ import {
|
|
|
18
18
|
utils_list_isFieldUnique,
|
|
19
19
|
utils_list_isTotalEqual,
|
|
20
20
|
utils_list_sumField,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
utils_mantineReactTable_sortColumnsByOrder,
|
|
21
|
+
utils_mantineReactTable_filterColumnsByVisibleKeys,
|
|
22
|
+
utils_mantineReactTable_sortColumnsByKeyOrder,
|
|
24
23
|
utils_reactQuery_updateListItemInQuery,
|
|
25
24
|
utils_text_getNormalizedTextFromHtml,
|
|
26
25
|
utils_time_convertTimeStringToSeconds,
|
|
@@ -28,7 +27,7 @@ import {
|
|
|
28
27
|
utils_time_getCurrentTimeString,
|
|
29
28
|
utils_time_getHourMinuteFromString,
|
|
30
29
|
utils_validator_validateCode
|
|
31
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-F3A4SX3H.mjs";
|
|
32
31
|
import {
|
|
33
32
|
U0DateToDDMMYYYString,
|
|
34
33
|
utils_date_dateToDDMMYYYString,
|
|
@@ -66,9 +65,8 @@ export {
|
|
|
66
65
|
utils_list_isFieldUnique,
|
|
67
66
|
utils_list_isTotalEqual,
|
|
68
67
|
utils_list_sumField,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
utils_mantineReactTable_sortColumnsByOrder,
|
|
68
|
+
utils_mantineReactTable_filterColumnsByVisibleKeys,
|
|
69
|
+
utils_mantineReactTable_sortColumnsByKeyOrder,
|
|
72
70
|
utils_notification_show,
|
|
73
71
|
utils_pdf_download,
|
|
74
72
|
utils_reactQuery_updateListItemInQuery,
|