aq-fe-framework 0.1.291 → 0.1.293
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-RMQVCX5X.mjs → chunk-GZDMUSUB.mjs} +5 -5
- package/dist/{chunk-4H6NEAG4.mjs → chunk-NRFQDAYS.mjs} +20 -0
- package/dist/components/index.mjs +2 -2
- package/dist/modules-features/index.mjs +5 -5
- package/dist/utils/index.d.mts +11 -1
- package/dist/utils/index.mjs +3 -1
- package/package.json +1 -1
@@ -9,15 +9,15 @@ import {
|
|
9
9
|
useMyReactMutation,
|
10
10
|
useQ_AQ_GetAQModule
|
11
11
|
} from "./chunk-KKJ3OEEW.mjs";
|
12
|
-
import {
|
13
|
-
createGenericStore
|
14
|
-
} from "./chunk-Y3YGC5IH.mjs";
|
15
12
|
import {
|
16
13
|
utils_pdf_download
|
17
14
|
} from "./chunk-5U2JSHSJ.mjs";
|
18
15
|
import {
|
19
16
|
utils_notification_show
|
20
17
|
} from "./chunk-7ZCOFATU.mjs";
|
18
|
+
import {
|
19
|
+
createGenericStore
|
20
|
+
} from "./chunk-Y3YGC5IH.mjs";
|
21
21
|
import {
|
22
22
|
__objRest,
|
23
23
|
__spreadProps,
|
@@ -848,9 +848,9 @@ import {
|
|
848
848
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
849
849
|
var actionConfig2 = {
|
850
850
|
create: {
|
851
|
-
color: "
|
851
|
+
color: "blue",
|
852
852
|
type: "submit",
|
853
|
-
icon: /* @__PURE__ */ jsx18(
|
853
|
+
icon: /* @__PURE__ */ jsx18(IconDeviceFloppy4, {}),
|
854
854
|
defaultText: "L\u01B0u"
|
855
855
|
},
|
856
856
|
createMultiple: {
|
@@ -254,6 +254,25 @@ function updateEnableList(oldList, selectedIds, getId, createNew) {
|
|
254
254
|
return result;
|
255
255
|
}
|
256
256
|
|
257
|
+
// src/utils/utils_reactQuery.ts
|
258
|
+
function utils_reactQuery_updateListItemInQuery({
|
259
|
+
queryClient,
|
260
|
+
queryKey,
|
261
|
+
listKey,
|
262
|
+
itemId,
|
263
|
+
updatedFields,
|
264
|
+
matchBy = "id"
|
265
|
+
}) {
|
266
|
+
const oldData = queryClient.getQueryData(queryKey);
|
267
|
+
if (!oldData) return;
|
268
|
+
const updatedList = oldData[listKey].map(
|
269
|
+
(item) => item[matchBy] === itemId ? __spreadValues(__spreadValues({}, item), updatedFields) : item
|
270
|
+
);
|
271
|
+
queryClient.setQueryData(queryKey, __spreadProps(__spreadValues({}, oldData), {
|
272
|
+
[listKey]: updatedList
|
273
|
+
}));
|
274
|
+
}
|
275
|
+
|
257
276
|
// src/utils/utils_time.ts
|
258
277
|
var utils_time_convertTimeStringToSeconds = (time) => {
|
259
278
|
const [hours, minutes, seconds] = time.split(":").map(Number);
|
@@ -300,6 +319,7 @@ export {
|
|
300
319
|
utils_excel_exportExcel,
|
301
320
|
utils_excel_download,
|
302
321
|
updateEnableList,
|
322
|
+
utils_reactQuery_updateListItemInQuery,
|
303
323
|
utils_time_convertTimeStringToSeconds,
|
304
324
|
utils_time_getCurrentTimeString,
|
305
325
|
U0MyValidateEmpty,
|
@@ -72,13 +72,13 @@ import {
|
|
72
72
|
useS_BasicAppShell,
|
73
73
|
useS_ButtonImport,
|
74
74
|
utils_layout_getItemsWithoutLinks
|
75
|
-
} from "../chunk-
|
75
|
+
} from "../chunk-GZDMUSUB.mjs";
|
76
76
|
import "../chunk-NWBLJ3W3.mjs";
|
77
77
|
import "../chunk-K6S7R6LU.mjs";
|
78
78
|
import "../chunk-KKJ3OEEW.mjs";
|
79
|
-
import "../chunk-Y3YGC5IH.mjs";
|
80
79
|
import "../chunk-5U2JSHSJ.mjs";
|
81
80
|
import "../chunk-7ZCOFATU.mjs";
|
81
|
+
import "../chunk-Y3YGC5IH.mjs";
|
82
82
|
import "../chunk-FWCSY2DS.mjs";
|
83
83
|
export {
|
84
84
|
AQButtonCreateByImportFile,
|
@@ -24,7 +24,7 @@ import {
|
|
24
24
|
useS_BasicAppShell,
|
25
25
|
useS_authenticate,
|
26
26
|
utils_layout_getItemsWithoutLinks
|
27
|
-
} from "../chunk-
|
27
|
+
} from "../chunk-GZDMUSUB.mjs";
|
28
28
|
import {
|
29
29
|
const_object_documentTypes
|
30
30
|
} from "../chunk-GFEMKKFH.mjs";
|
@@ -40,9 +40,6 @@ import {
|
|
40
40
|
useQ_AQ_GetAQModule,
|
41
41
|
useQ_SkillCenter_GetAll
|
42
42
|
} from "../chunk-KKJ3OEEW.mjs";
|
43
|
-
import {
|
44
|
-
createGenericStore
|
45
|
-
} from "../chunk-Y3YGC5IH.mjs";
|
46
43
|
import {
|
47
44
|
U0DateToDDMMYYYString,
|
48
45
|
U0MyValidateEmail,
|
@@ -50,11 +47,14 @@ import {
|
|
50
47
|
utils_config_getBaseUrl,
|
51
48
|
utils_converter_enumToSelectOptions,
|
52
49
|
utils_file_fileToAQDocumentType
|
53
|
-
} from "../chunk-
|
50
|
+
} from "../chunk-NRFQDAYS.mjs";
|
54
51
|
import "../chunk-5U2JSHSJ.mjs";
|
55
52
|
import {
|
56
53
|
utils_notification_show
|
57
54
|
} from "../chunk-7ZCOFATU.mjs";
|
55
|
+
import {
|
56
|
+
createGenericStore
|
57
|
+
} from "../chunk-Y3YGC5IH.mjs";
|
58
58
|
import {
|
59
59
|
__objRest,
|
60
60
|
__spreadProps,
|
package/dist/utils/index.d.mts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
export { a as IAQFileDetail, I as IUtils_Excel_ColumnConfig, b as utils_excel_download, u as utils_excel_exportExcel, d as utils_file_AQDocumentTypeToFile, e as utils_file_docxtemplaterDownload, c as utils_file_fileToAQDocumentType } from '../utils_file-G8NTHCO-.mjs';
|
2
2
|
import { DefaultMantineColor } from '@mantine/core';
|
3
|
+
import { useQueryClient } from '@tanstack/react-query';
|
3
4
|
import 'exceljs';
|
4
5
|
|
5
6
|
declare const utils_converter_getLabelByValue: (data: Record<number, string>, value?: number | string) => string;
|
@@ -39,6 +40,15 @@ declare function utils_notification_show({ crudType, message, color }: I): void;
|
|
39
40
|
|
40
41
|
declare function utils_pdf_download(url: string): Promise<void>;
|
41
42
|
|
43
|
+
declare function utils_reactQuery_updateListItemInQuery<T>({ queryClient, queryKey, listKey, itemId, updatedFields, matchBy, }: {
|
44
|
+
queryClient: ReturnType<typeof useQueryClient>;
|
45
|
+
queryKey: unknown[];
|
46
|
+
listKey: keyof T;
|
47
|
+
itemId: any;
|
48
|
+
updatedFields: Partial<any>;
|
49
|
+
matchBy?: string;
|
50
|
+
}): void;
|
51
|
+
|
42
52
|
declare const utils_time_convertTimeStringToSeconds: (time: string) => number;
|
43
53
|
declare const utils_time_getCurrentTimeString: () => string;
|
44
54
|
|
@@ -46,4 +56,4 @@ declare function U0MyValidateEmpty(message?: string): (value: unknown) => React.
|
|
46
56
|
declare function U0MyValidateEmail(value?: string): "Email không đúng định dạng" | null;
|
47
57
|
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;
|
48
58
|
|
49
|
-
export { U0DateToDDMMYYYString, U0MyValidateEmail, U0MyValidateEmpty, updateEnableList, utils_converter_enumToSelectOptions, utils_converter_getKeyByValue, utils_converter_getLabelByValue, utils_currency_formatWithSuffix, utils_date_dateToDDMMYYYString, utils_date_formatToDateTimeStartEnd, utils_date_getHHmm, utils_notification_show, utils_pdf_download, utils_time_convertTimeStringToSeconds, utils_time_getCurrentTimeString, utils_validator_validateCode };
|
59
|
+
export { U0DateToDDMMYYYString, U0MyValidateEmail, U0MyValidateEmpty, updateEnableList, utils_converter_enumToSelectOptions, utils_converter_getKeyByValue, utils_converter_getLabelByValue, utils_currency_formatWithSuffix, utils_date_dateToDDMMYYYString, utils_date_formatToDateTimeStartEnd, utils_date_getHHmm, utils_notification_show, utils_pdf_download, utils_reactQuery_updateListItemInQuery, utils_time_convertTimeStringToSeconds, utils_time_getCurrentTimeString, utils_validator_validateCode };
|
package/dist/utils/index.mjs
CHANGED
@@ -15,10 +15,11 @@ import {
|
|
15
15
|
utils_file_AQDocumentTypeToFile,
|
16
16
|
utils_file_docxtemplaterDownload,
|
17
17
|
utils_file_fileToAQDocumentType,
|
18
|
+
utils_reactQuery_updateListItemInQuery,
|
18
19
|
utils_time_convertTimeStringToSeconds,
|
19
20
|
utils_time_getCurrentTimeString,
|
20
21
|
utils_validator_validateCode
|
21
|
-
} from "../chunk-
|
22
|
+
} from "../chunk-NRFQDAYS.mjs";
|
22
23
|
import {
|
23
24
|
utils_pdf_download
|
24
25
|
} from "../chunk-5U2JSHSJ.mjs";
|
@@ -45,6 +46,7 @@ export {
|
|
45
46
|
utils_file_fileToAQDocumentType,
|
46
47
|
utils_notification_show,
|
47
48
|
utils_pdf_download,
|
49
|
+
utils_reactQuery_updateListItemInQuery,
|
48
50
|
utils_time_convertTimeStringToSeconds,
|
49
51
|
utils_time_getCurrentTimeString,
|
50
52
|
utils_validator_validateCode
|