aq-fe-framework 0.1.1040 → 0.1.1041
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/build-object/index.mjs +10 -50
- package/dist/chunk-7ZI7IOEP.mjs +336 -0
- package/dist/chunk-BTITP4TN.mjs +21 -0
- package/dist/chunk-C74M5VPE.mjs +99 -0
- package/dist/chunk-JD6AELXS.mjs +39 -0
- package/dist/chunk-KGBXMHKR.mjs +554 -0
- package/dist/chunk-NMY3UEY5.mjs +0 -0
- package/dist/chunk-NYAWQRB7.mjs +29 -0
- package/dist/chunk-PBRAAZSZ.mjs +18871 -0
- package/dist/chunk-WJYGAYCW.mjs +28 -0
- package/dist/chunk-WW55EZ4B.mjs +64 -0
- package/dist/chunk-WZ6PXGGC.mjs +12 -0
- package/dist/chunk-Z76CSZFI.mjs +383 -0
- package/dist/components/index.mjs +153 -9023
- package/dist/const/index.mjs +16 -91
- package/dist/core/index.mjs +81 -7567
- package/dist/enum/index.mjs +11 -23
- package/dist/hooks/index.mjs +27 -365
- package/dist/interfaces/index.mjs +0 -1
- package/dist/modules-features/index.mjs +209 -15038
- package/dist/shared/index.mjs +35 -5184
- package/dist/stores/index.mjs +13 -75
- package/dist/types/index.mjs +6 -9
- package/dist/utils/index.mjs +76 -523
- package/dist/utils-v2/index.mjs +24 -319
- package/dist/zod-schemas/index.mjs +5 -2
- package/package.json +1 -1
|
@@ -1,51 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
1
|
+
import {
|
|
2
|
+
createTenantSettingsStore
|
|
3
|
+
} from "../chunk-NYAWQRB7.mjs";
|
|
4
|
+
import {
|
|
5
|
+
createGenericStore
|
|
6
|
+
} from "../chunk-BTITP4TN.mjs";
|
|
7
|
+
import "../chunk-JD6AELXS.mjs";
|
|
8
|
+
export {
|
|
9
|
+
createGenericStore,
|
|
10
|
+
createTenantSettingsStore
|
|
21
11
|
};
|
|
22
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
-
function createGenericStore({ initialState, storageKey }) {
|
|
24
|
-
const storeCreator = (set) => ({
|
|
25
|
-
state: initialState,
|
|
26
|
-
setState: (newState) => set({ state: newState }),
|
|
27
|
-
setProperty: (key, value) => set((store) => ({ state: __spreadProps(__spreadValues({}, store.state), { [key]: value }) })),
|
|
28
|
-
resetState: () => set({ state: initialState })
|
|
29
|
-
});
|
|
30
|
-
return storageKey ? create(persist(storeCreator, { name: storageKey })) : create(storeCreator);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// src/build-object/createTenantSettingsStore.ts
|
|
34
|
-
function createTenantSettingsStore(params) {
|
|
35
|
-
const useStore = createGenericStore({
|
|
36
|
-
initialState: params.initialState || {},
|
|
37
|
-
storageKey: params.storageKey || "useStore_TenantSettings"
|
|
38
|
-
});
|
|
39
|
-
return function useTenantSettingsStore() {
|
|
40
|
-
const store = useStore();
|
|
41
|
-
function getSetting(settingKey) {
|
|
42
|
-
var _a, _b;
|
|
43
|
-
return (_b = (_a = store.state.tenantSettings) == null ? void 0 : _a.find((s) => s.settingKey === settingKey)) == null ? void 0 : _b.settingValue;
|
|
44
|
-
}
|
|
45
|
-
return __spreadProps(__spreadValues({}, store), {
|
|
46
|
-
getSetting
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { createGenericStore, createTenantSettingsStore };
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
// src/utils-v2/utils_build.ts
|
|
2
|
+
var utils_build = {
|
|
3
|
+
createEnumKeyMap(enumObj) {
|
|
4
|
+
return Object.keys(enumObj).filter((k) => isNaN(Number(k))).reduce((acc, key) => {
|
|
5
|
+
const val = enumObj[key];
|
|
6
|
+
acc[val] = key;
|
|
7
|
+
return acc;
|
|
8
|
+
}, {});
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/utils-v2/utils_converter.ts
|
|
13
|
+
var utils_converter = {
|
|
14
|
+
mapEnumToSelectData(enumObj, labelMap) {
|
|
15
|
+
return Object.entries(enumObj).filter(([key, value]) => isNaN(Number(key))).map(([_, value]) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const stringValue = value.toString();
|
|
18
|
+
return {
|
|
19
|
+
value: stringValue,
|
|
20
|
+
label: (_a = labelMap[stringValue]) != null ? _a : `Kh\xF4ng r\xF5 (${stringValue})`
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
mapOptionsToSelectData(options, t) {
|
|
25
|
+
return Object.keys(options).map((key) => ({
|
|
26
|
+
value: options[key].toString(),
|
|
27
|
+
label: t(key)
|
|
28
|
+
}));
|
|
29
|
+
},
|
|
30
|
+
invertObject(options) {
|
|
31
|
+
return Object.fromEntries(
|
|
32
|
+
Object.entries(options).map(([key, value]) => [value, key])
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/utils-v2/utils_excel.ts
|
|
38
|
+
import dayjs from "dayjs";
|
|
39
|
+
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
40
|
+
import saveAs from "file-saver";
|
|
41
|
+
dayjs.extend(customParseFormat);
|
|
42
|
+
var utils_excel = {
|
|
43
|
+
addSheet(props) {
|
|
44
|
+
const sheet = props.workbook.addWorksheet(props.sheetName);
|
|
45
|
+
const fieldKeys = props.config.map((item) => String(item.fieldKey));
|
|
46
|
+
const headerMappings = {};
|
|
47
|
+
const markedColumns = [];
|
|
48
|
+
props.config.forEach((item) => {
|
|
49
|
+
const fieldKeyStr = String(item.fieldKey);
|
|
50
|
+
headerMappings[fieldKeyStr] = item.fieldName;
|
|
51
|
+
if (item.isRequired) markedColumns.push(fieldKeyStr);
|
|
52
|
+
});
|
|
53
|
+
sheet.columns = fieldKeys.map((fieldKey) => ({
|
|
54
|
+
key: fieldKey,
|
|
55
|
+
width: 20
|
|
56
|
+
}));
|
|
57
|
+
const displayRow = sheet.addRow(
|
|
58
|
+
fieldKeys.map(
|
|
59
|
+
(fieldKey) => markedColumns.includes(fieldKey) ? `${headerMappings[fieldKey]} *` : headerMappings[fieldKey] || fieldKey
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
const keyRow = sheet.addRow(fieldKeys);
|
|
63
|
+
props.data.forEach((row) => {
|
|
64
|
+
const rowData = {};
|
|
65
|
+
props.config.forEach(({ fieldKey, formatter }) => {
|
|
66
|
+
const fieldKeyStr = String(fieldKey);
|
|
67
|
+
const rawValue = getValueByPath(row, fieldKeyStr);
|
|
68
|
+
rowData[fieldKeyStr] = formatter ? formatter(rawValue, row) : rawValue;
|
|
69
|
+
});
|
|
70
|
+
sheet.addRow(rowData);
|
|
71
|
+
});
|
|
72
|
+
for (let i = 1; i <= fieldKeys.length; i++) {
|
|
73
|
+
const cell = displayRow.getCell(i);
|
|
74
|
+
cell.font = { bold: true };
|
|
75
|
+
cell.fill = {
|
|
76
|
+
type: "pattern",
|
|
77
|
+
pattern: "solid",
|
|
78
|
+
fgColor: { argb: "FFE0E0E0" }
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
for (let i = 1; i <= fieldKeys.length; i++) {
|
|
82
|
+
const cell = keyRow.getCell(i);
|
|
83
|
+
cell.font = { italic: true };
|
|
84
|
+
cell.fill = {
|
|
85
|
+
type: "pattern",
|
|
86
|
+
pattern: "solid",
|
|
87
|
+
fgColor: { argb: "FFF0F0F0" }
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (markedColumns.length > 0) {
|
|
91
|
+
for (let i = 1; i <= fieldKeys.length; i++) {
|
|
92
|
+
const cell = displayRow.getCell(i);
|
|
93
|
+
const text = cell.value;
|
|
94
|
+
if (typeof text === "string" && text.endsWith(" *")) {
|
|
95
|
+
cell.value = {
|
|
96
|
+
richText: [
|
|
97
|
+
{
|
|
98
|
+
text: text.slice(0, -2),
|
|
99
|
+
font: { bold: true }
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
text: " *",
|
|
103
|
+
font: { bold: true, color: { argb: "FFFF0000" } }
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return props.workbook;
|
|
111
|
+
},
|
|
112
|
+
async download(props) {
|
|
113
|
+
const buffer = await props.workbook.xlsx.writeBuffer();
|
|
114
|
+
const blob = new Blob([buffer], {
|
|
115
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
116
|
+
});
|
|
117
|
+
saveAs(blob, props.name);
|
|
118
|
+
},
|
|
119
|
+
normalizeDate(input) {
|
|
120
|
+
if (!input) return void 0;
|
|
121
|
+
if (!isNaN(Number(input))) {
|
|
122
|
+
const excelEpoch = dayjs("1899-12-30").add(Number(input), "day");
|
|
123
|
+
return excelEpoch.format("YYYY-MM-DDTHH:mm:ss");
|
|
124
|
+
}
|
|
125
|
+
for (const pattern of DATE_PATTERNS) {
|
|
126
|
+
const parsed = dayjs(input, pattern, true);
|
|
127
|
+
if (parsed.isValid()) {
|
|
128
|
+
return parsed.format("YYYY-MM-DDTHH:mm:ss");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const autoParsed = dayjs(input);
|
|
132
|
+
if (autoParsed.isValid()) {
|
|
133
|
+
return autoParsed.format("YYYY-MM-DDTHH:mm:ss");
|
|
134
|
+
}
|
|
135
|
+
console.warn("Kh\xF4ng parse \u0111\u01B0\u1EE3c ng\xE0y:", input);
|
|
136
|
+
return void 0;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
function isObjectPath(path) {
|
|
140
|
+
return /^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*)+$/.test(path);
|
|
141
|
+
}
|
|
142
|
+
function getValueByPath(obj, path) {
|
|
143
|
+
if (isObjectPath(path)) {
|
|
144
|
+
return path.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
|
|
145
|
+
}
|
|
146
|
+
return obj == null ? void 0 : obj[path];
|
|
147
|
+
}
|
|
148
|
+
var DATE_PATTERNS = [
|
|
149
|
+
"DD/MM/YYYY",
|
|
150
|
+
"D/M/YYYY",
|
|
151
|
+
"DD-MM-YYYY",
|
|
152
|
+
"D-M-YYYY",
|
|
153
|
+
"DD.MM.YYYY",
|
|
154
|
+
"D.M.YYYY",
|
|
155
|
+
"YYYY-MM-DD",
|
|
156
|
+
"YYYY/MM/DD",
|
|
157
|
+
"MMM D, YYYY",
|
|
158
|
+
"MMMM D, YYYY",
|
|
159
|
+
"DD MMM YYYY",
|
|
160
|
+
"DD-MMM-YYYY",
|
|
161
|
+
"YYYYMMDD",
|
|
162
|
+
// Date + Time
|
|
163
|
+
"DD/MM/YYYY HH:mm",
|
|
164
|
+
"DD-MM-YYYY HH:mm",
|
|
165
|
+
"YYYY-MM-DD HH:mm",
|
|
166
|
+
"DD MMM YYYY HH:mm",
|
|
167
|
+
"MMM D, YYYY h:mm A",
|
|
168
|
+
"YYYY-MM-DDTHH:mm:ss"
|
|
169
|
+
// ISO
|
|
170
|
+
];
|
|
171
|
+
function normalizeDate(input) {
|
|
172
|
+
if (!input) return null;
|
|
173
|
+
if (!isNaN(Number(input))) {
|
|
174
|
+
const excelEpoch = dayjs("1899-12-30").add(Number(input), "day");
|
|
175
|
+
return excelEpoch.format("YYYY-MM-DDTHH:mm:ss");
|
|
176
|
+
}
|
|
177
|
+
for (const pattern of DATE_PATTERNS) {
|
|
178
|
+
const parsed = dayjs(input, pattern, true);
|
|
179
|
+
if (parsed.isValid()) {
|
|
180
|
+
return parsed.format("YYYY-MM-DDTHH:mm:ss");
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const autoParsed = dayjs(input);
|
|
184
|
+
if (autoParsed.isValid()) {
|
|
185
|
+
return autoParsed.format("YYYY-MM-DDTHH:mm:ss");
|
|
186
|
+
}
|
|
187
|
+
console.warn("Kh\xF4ng parse \u0111\u01B0\u1EE3c ng\xE0y:", input);
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// src/utils-v2/utils_file.ts
|
|
192
|
+
var utils_file = {
|
|
193
|
+
base64ToBlobUrl(base64, mimeType) {
|
|
194
|
+
const byteCharacters = atob(base64);
|
|
195
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
196
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
197
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
198
|
+
}
|
|
199
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
200
|
+
const blob = new Blob([byteArray], { type: mimeType });
|
|
201
|
+
return URL.createObjectURL(blob);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// src/utils-v2/utils_mantineReactTable.ts
|
|
206
|
+
var utils_mantineReactTable = {
|
|
207
|
+
filterColumnsByVisibleKeys(allColumns, visibleFields) {
|
|
208
|
+
if (!visibleFields || visibleFields.length === 0) return allColumns;
|
|
209
|
+
return allColumns.filter(
|
|
210
|
+
(col) => typeof col.accessorKey === "string" && visibleFields.includes(col.accessorKey)
|
|
211
|
+
);
|
|
212
|
+
},
|
|
213
|
+
sortColumnsByKeyOrder(columns, orderedKeys) {
|
|
214
|
+
if (!orderedKeys) return columns;
|
|
215
|
+
return [...columns].sort((a, b) => {
|
|
216
|
+
const aKey = a.accessorKey;
|
|
217
|
+
const bKey = b.accessorKey;
|
|
218
|
+
const aIndex = orderedKeys.indexOf(aKey);
|
|
219
|
+
const bIndex = orderedKeys.indexOf(bKey);
|
|
220
|
+
return (aIndex === -1 ? Infinity : aIndex) - (bIndex === -1 ? Infinity : bIndex);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// src/utils-v2/utils_text.ts
|
|
226
|
+
var utils_text = {
|
|
227
|
+
splitFullName(fullName) {
|
|
228
|
+
const parts = fullName.trim().split(/\s+/);
|
|
229
|
+
if (parts.length === 1) {
|
|
230
|
+
return { lastName: "", firstName: parts[0] };
|
|
231
|
+
}
|
|
232
|
+
const lastName = parts.slice(0, -1).join(" ");
|
|
233
|
+
const firstName = parts[parts.length - 1];
|
|
234
|
+
return { lastName, firstName };
|
|
235
|
+
},
|
|
236
|
+
getNormalizedTextFromHtml(html) {
|
|
237
|
+
const noHtml = (html != null ? html : "").replace(/<[^>]+>/g, "");
|
|
238
|
+
return noHtml.trim().toLowerCase();
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// src/utils-v2/utils_time.ts
|
|
243
|
+
var utils_time = {
|
|
244
|
+
toTotalSecond(time) {
|
|
245
|
+
const [hours, minutes, seconds] = time.split(":").map(Number);
|
|
246
|
+
return hours * 3600 + minutes * 60 + seconds;
|
|
247
|
+
},
|
|
248
|
+
getCurrentTime() {
|
|
249
|
+
const formatTime = (number) => {
|
|
250
|
+
return number < 10 ? "0" + number : number;
|
|
251
|
+
};
|
|
252
|
+
const now = /* @__PURE__ */ new Date();
|
|
253
|
+
const hours = formatTime(now.getHours());
|
|
254
|
+
const minutes = formatTime(now.getMinutes());
|
|
255
|
+
const seconds = formatTime(now.getSeconds());
|
|
256
|
+
return `${hours}:${minutes}:${seconds}`;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/utils-v2/utils_currency/utils_currency.ts
|
|
261
|
+
var utils_currency = {
|
|
262
|
+
formatWithSuffix(amount, suffix = "") {
|
|
263
|
+
if (amount == null || isNaN(amount)) {
|
|
264
|
+
return "";
|
|
265
|
+
}
|
|
266
|
+
const formatter = new Intl.NumberFormat("vi-VN");
|
|
267
|
+
const formattedAmount = formatter.format(amount).replace(/\./g, ",");
|
|
268
|
+
return `${formattedAmount}${suffix}`;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// src/utils-v2/utils_date/UtilsDateDemo.tsx
|
|
273
|
+
import { Paper } from "@mantine/core";
|
|
274
|
+
import { useState } from "react";
|
|
275
|
+
|
|
276
|
+
// src/utils-v2/utils_date/utils_date.ts
|
|
277
|
+
var utils_date = {
|
|
278
|
+
toDDMMYYYY(date) {
|
|
279
|
+
const parsedDate = typeof date === "string" ? new Date(date) : date;
|
|
280
|
+
if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
|
|
281
|
+
const day = String(parsedDate.getDate()).padStart(2, "0");
|
|
282
|
+
const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
|
|
283
|
+
const year = parsedDate.getFullYear();
|
|
284
|
+
return `${day}/${month}/${year}`;
|
|
285
|
+
},
|
|
286
|
+
toMMYYYY(date) {
|
|
287
|
+
const parsedDate = typeof date === "string" ? new Date(date) : date;
|
|
288
|
+
if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
|
|
289
|
+
const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
|
|
290
|
+
const year = parsedDate.getFullYear();
|
|
291
|
+
return `${month}/${year}`;
|
|
292
|
+
},
|
|
293
|
+
toHHmm(date) {
|
|
294
|
+
if (!(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
295
|
+
const hour = String(date.getHours()).padStart(2, "0");
|
|
296
|
+
const minute = String(date.getMinutes()).padStart(2, "0");
|
|
297
|
+
return `${hour}:${minute}`;
|
|
298
|
+
},
|
|
299
|
+
toDateTime(date, WithSeconds) {
|
|
300
|
+
const parsedDate = typeof date === "string" ? new Date(date) : date;
|
|
301
|
+
if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
|
|
302
|
+
const day = String(parsedDate.getDate()).padStart(2, "0");
|
|
303
|
+
const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
|
|
304
|
+
const year = parsedDate.getFullYear();
|
|
305
|
+
const hours = String(parsedDate.getHours()).padStart(2, "0");
|
|
306
|
+
const minutes = String(parsedDate.getMinutes()).padStart(2, "0");
|
|
307
|
+
const seconds = String(parsedDate.getSeconds()).padStart(2, "0");
|
|
308
|
+
return `${day}/${month}/${year} - ${hours}:${minutes}${WithSeconds && `:${seconds}`}`;
|
|
309
|
+
},
|
|
310
|
+
toDateTimeStartEnd(startDate, endDate) {
|
|
311
|
+
const startday = String(startDate.getDate()).padStart(2, "0");
|
|
312
|
+
const startmonth = String(startDate.getMonth() + 1).padStart(2, "0");
|
|
313
|
+
const startyear = startDate.getFullYear();
|
|
314
|
+
const starthour = String(startDate.getHours()).padStart(2, "0");
|
|
315
|
+
const startminute = String(startDate.getMinutes()).padStart(2, "0");
|
|
316
|
+
const endhour = String(endDate.getHours()).padStart(2, "0");
|
|
317
|
+
const endminuate = String(endDate.getMinutes()).padStart(2, "0");
|
|
318
|
+
return `${startday}/${startmonth}/${startyear} [${starthour}:${startminute} - ${endhour}:${endminuate}]`;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
// src/utils-v2/utils_date/UtilsDateDemo.tsx
|
|
323
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
324
|
+
|
|
325
|
+
export {
|
|
326
|
+
utils_file,
|
|
327
|
+
utils_build,
|
|
328
|
+
utils_converter,
|
|
329
|
+
utils_excel,
|
|
330
|
+
normalizeDate,
|
|
331
|
+
utils_mantineReactTable,
|
|
332
|
+
utils_text,
|
|
333
|
+
utils_time,
|
|
334
|
+
utils_currency,
|
|
335
|
+
utils_date
|
|
336
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "./chunk-JD6AELXS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/build-object/CreateGenericStore.ts
|
|
7
|
+
import { create } from "zustand";
|
|
8
|
+
import { persist } from "zustand/middleware";
|
|
9
|
+
function createGenericStore({ initialState, storageKey }) {
|
|
10
|
+
const storeCreator = (set) => ({
|
|
11
|
+
state: initialState,
|
|
12
|
+
setState: (newState) => set({ state: newState }),
|
|
13
|
+
setProperty: (key, value) => set((store) => ({ state: __spreadProps(__spreadValues({}, store.state), { [key]: value }) })),
|
|
14
|
+
resetState: () => set({ state: initialState })
|
|
15
|
+
});
|
|
16
|
+
return storageKey ? create(persist(storeCreator, { name: storageKey })) : create(storeCreator);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
createGenericStore
|
|
21
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// src/const/array/const_array_daysOfWeek.ts
|
|
2
|
+
var const_array_daysOfWeek = [
|
|
3
|
+
"Th\u1EE9 Hai",
|
|
4
|
+
"Th\u1EE9 Ba",
|
|
5
|
+
"Th\u1EE9 T\u01B0",
|
|
6
|
+
"Th\u1EE9 N\u0103m",
|
|
7
|
+
"Th\u1EE9 S\xE1u",
|
|
8
|
+
"Th\u1EE9 B\u1EA3y",
|
|
9
|
+
"Ch\u1EE7 Nh\u1EADt"
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
// src/const/object/const_aqModuleId.ts
|
|
13
|
+
var const_aqModuleId = {
|
|
14
|
+
SAE: 1,
|
|
15
|
+
SRM: 8,
|
|
16
|
+
EAQ: 10
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// src/const/object/const_columnSize.ts
|
|
20
|
+
var const_columnSize = {
|
|
21
|
+
name: 300,
|
|
22
|
+
// Tên (họ tên, tên đề tài, tên đơn vị...)
|
|
23
|
+
description: 500
|
|
24
|
+
// Mô tả dài
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/const/object/const_object_colors.ts
|
|
28
|
+
var const_object_colors = {
|
|
29
|
+
mantineBackgroundPrimary: "light-dark(var(--mantine-color-white), var(--mantine-color-dark))",
|
|
30
|
+
mantineBackgroundSecondary: "light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-8))",
|
|
31
|
+
mantineBackgroundTertiary: "light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6))",
|
|
32
|
+
mantineBackgroundBlueLight: "var(--mantine-color-blue-light)",
|
|
33
|
+
mantineBackgroundBlue: "var(--mantine-color-blue)",
|
|
34
|
+
mantineBackgroundTealLight: "var(--mantine-color-teal-light)"
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/const/object/const_object_documentTypes.ts
|
|
38
|
+
var const_object_documentTypes = {
|
|
39
|
+
Security: 1,
|
|
40
|
+
Refinement: 2,
|
|
41
|
+
Guideline: 3,
|
|
42
|
+
Regulations: 4,
|
|
43
|
+
Workflow: 5,
|
|
44
|
+
Form: 6
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/const/object/const_object_menuData.ts
|
|
48
|
+
var const_object_generalMenuData = {
|
|
49
|
+
managementSystem: () => {
|
|
50
|
+
return {
|
|
51
|
+
label: "Qu\u1EA3n l\xFD h\u1EC7 th\u1ED1ng",
|
|
52
|
+
links: [
|
|
53
|
+
{ pageId: 1, name: "Account management", label: "Qu\u1EA3n l\xFD t\xE0i kho\u1EA3n", link: "accountManagement" },
|
|
54
|
+
{ pageId: 100005, name: "Account group management", label: "Qu\u1EA3n l\xFD nh\xF3m t\xE0i kho\u1EA3n", link: "roleManagement" },
|
|
55
|
+
{ pageId: 2, name: "Access control level", label: "Ph\xE2n quy\u1EC1n c\u1EA5p \u0111\u01A1n v\u1ECB", link: "accessControlLevel" },
|
|
56
|
+
{ pageId: 3, name: "Access control", label: "Ph\xE2n quy\u1EC1n s\u1EED d\u1EE5ng", link: "accessControl" },
|
|
57
|
+
{ pageId: 4, name: "Security regulations", label: "Quy \u0111\u1ECBnh an to\xE0n/ b\u1EA3o m\u1EADt th\xF4ng tin", link: "securityPolicyDocs" },
|
|
58
|
+
{ pageId: 5, name: "System updates", label: "Th\xF4ng tin x\xE2y d\u1EF1ng, c\u1EA3i ti\u1EBFn, b\u1EA3o tr\xEC h\u1EC7 th\u1ED1ng", link: "systemUpdateDocs" },
|
|
59
|
+
{ pageId: 6, name: "User guide", label: "T\xE0i li\u1EC7u h\u01B0\u1EDBng d\u1EABn s\u1EED d\u1EE5ng", link: "userGuideDocs" }
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
documentManagement: () => {
|
|
64
|
+
return {
|
|
65
|
+
label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh",
|
|
66
|
+
links: [
|
|
67
|
+
{ pageId: 7, name: "Organizational regulations", label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", link: "organizationPolicyDocs" },
|
|
68
|
+
{ pageId: 8, name: "Workflow process", label: "Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c", link: "workflowProcessDocs" },
|
|
69
|
+
{ pageId: 9, name: "Form templates", label: "T\xE0i li\u1EC7u bi\u1EC3u m\u1EABu", link: "formTemplateDocs" }
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
systemCatalog: (extraMenu) => {
|
|
74
|
+
return {
|
|
75
|
+
label: "Danh m\u1EE5c h\u1EC7 th\u1ED1ng",
|
|
76
|
+
links: [
|
|
77
|
+
// { pageId: 100008, name: "lecturerList", label: "Danh mục viên chức", link: "lecturerList" },
|
|
78
|
+
{ pageId: 100001, name: "Document categories", label: "Danh m\u1EE5c lo\u1EA1i v\u0103n b\u1EA3n", link: "documentCategories" },
|
|
79
|
+
{ pageId: 100011, name: "Code config", label: "Danh m\u1EE5c b\u1ED9 \u0111\u1EBFm", link: "codeFormula" },
|
|
80
|
+
{ pageId: 100002, name: "mailConfig", label: "Danh m\u1EE5c c\u1EA5u h\xECnh mail", link: "mailConfig" },
|
|
81
|
+
{ pageId: 100010, name: "Mail template", label: "M\u1EABu Mail th\xF4ng b\xE1o", link: "mailTemplate" },
|
|
82
|
+
{ pageId: 100003, name: "pageContentConfig", label: "Danh m\u1EE5c Page Content", link: "pageContent" },
|
|
83
|
+
// { pageId: 100006, name: "Department list", label: "Danh mục đơn vị", link: "departmentList" },
|
|
84
|
+
// { pageId: 100007, name: "Academic year", label: "Danh mục năm học", link: "academicYear" },
|
|
85
|
+
{ pageId: 100004, name: "moduleConfig", label: "C\u1EA5u h\xECnh th\xF4ng tin ch\u1EE7 qu\u1EA3n", link: "moduleConfig" },
|
|
86
|
+
...extraMenu || []
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
const_array_daysOfWeek,
|
|
94
|
+
const_aqModuleId,
|
|
95
|
+
const_columnSize,
|
|
96
|
+
const_object_colors,
|
|
97
|
+
const_object_documentTypes,
|
|
98
|
+
const_object_generalMenuData
|
|
99
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __restKey = (key) => typeof key === "symbol" ? key : key + "";
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
__spreadValues,
|
|
36
|
+
__spreadProps,
|
|
37
|
+
__restKey,
|
|
38
|
+
__objRest
|
|
39
|
+
};
|