aq-fe-framework 0.1.790 → 0.1.792
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-7NNLZDND.mjs +56 -0
- package/dist/{chunk-EGZC46BP.mjs → chunk-LJRTI7UU.mjs} +6 -4
- package/dist/{chunk-ST7567XG.mjs → chunk-RJH5TVHS.mjs} +0 -54
- package/dist/components/index.mjs +4 -3
- package/dist/const/index.mjs +1 -1
- package/dist/core/index.mjs +4 -3
- package/dist/coreService/index.mjs +4 -3
- package/dist/modules-features/index.mjs +4 -3
- package/dist/utils/index.d.mts +2 -18
- package/dist/utils/index.mjs +8 -6
- package/dist/utils-v2/index.d.mts +7 -1
- package/dist/utils-v2/index.mjs +9 -0
- package/dist/utils_converter-DHT1b-Qe.d.mts +18 -0
- package/package.json +1 -1
- package/dist/{chunk-DC3L5XSB.mjs → chunk-KAC7JMQB.mjs} +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/utils/utils_converter.ts
|
|
2
|
+
function utils_converter_mapEnumToSelectData(enumObj, labelMap) {
|
|
3
|
+
return Object.entries(enumObj).filter(([key, value]) => isNaN(Number(key))).map(([_, value]) => {
|
|
4
|
+
var _a;
|
|
5
|
+
const stringValue = value.toString();
|
|
6
|
+
return {
|
|
7
|
+
value: stringValue,
|
|
8
|
+
label: (_a = labelMap[stringValue]) != null ? _a : `Kh\xF4ng r\xF5 (${stringValue})`
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
var utils_converter_getLabelByValue = (data, value) => {
|
|
13
|
+
const numericValue = Number(value);
|
|
14
|
+
return data[numericValue] || "Kh\xF4ng x\xE1c \u0111\u1ECBnh";
|
|
15
|
+
};
|
|
16
|
+
var utils_converter_getKeyByValue = (obj, value) => {
|
|
17
|
+
var _a;
|
|
18
|
+
return (_a = Object.entries(obj).find(([_, v]) => v === value)) == null ? void 0 : _a[0];
|
|
19
|
+
};
|
|
20
|
+
function utils_converter_enumToSelectOptions(enumObject) {
|
|
21
|
+
const result = [];
|
|
22
|
+
const numericEnumKeys = Object.keys(enumObject).filter((key) => isNaN(Number(key)));
|
|
23
|
+
for (const key of numericEnumKeys) {
|
|
24
|
+
const enumValue = enumObject[key];
|
|
25
|
+
if (typeof enumValue === "number") {
|
|
26
|
+
result.push({
|
|
27
|
+
value: String(enumValue),
|
|
28
|
+
label: key
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
function utils_converter_youTubeUrlToEmbed(url) {
|
|
35
|
+
try {
|
|
36
|
+
const urlObj = new URL(url);
|
|
37
|
+
const videoId = urlObj.searchParams.get("v");
|
|
38
|
+
if (videoId) {
|
|
39
|
+
return `https://www.youtube.com/embed/${videoId}`;
|
|
40
|
+
}
|
|
41
|
+
if (url.includes("/embed/")) {
|
|
42
|
+
return url;
|
|
43
|
+
}
|
|
44
|
+
return "";
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return "";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
utils_converter_mapEnumToSelectData,
|
|
52
|
+
utils_converter_getLabelByValue,
|
|
53
|
+
utils_converter_getKeyByValue,
|
|
54
|
+
utils_converter_enumToSelectOptions,
|
|
55
|
+
utils_converter_youTubeUrlToEmbed
|
|
56
|
+
};
|
|
@@ -5,8 +5,6 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
utils_aq_mapBaseEntityToDomain,
|
|
7
7
|
utils_aq_mapDomainToEntity,
|
|
8
|
-
utils_converter_enumToSelectOptions,
|
|
9
|
-
utils_converter_mapEnumToSelectData,
|
|
10
8
|
utils_excel_download,
|
|
11
9
|
utils_excel_exportExcel,
|
|
12
10
|
utils_excel_handleExport,
|
|
@@ -14,7 +12,11 @@ import {
|
|
|
14
12
|
utils_mantineReactTable_filterColumnsByVisibleKeys,
|
|
15
13
|
utils_mantineReactTable_sortColumnsByKeyOrder,
|
|
16
14
|
utils_pdf_download
|
|
17
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RJH5TVHS.mjs";
|
|
16
|
+
import {
|
|
17
|
+
utils_converter_enumToSelectOptions,
|
|
18
|
+
utils_converter_mapEnumToSelectData
|
|
19
|
+
} from "./chunk-7NNLZDND.mjs";
|
|
18
20
|
import {
|
|
19
21
|
baseColumns
|
|
20
22
|
} from "./chunk-O7YCQQO5.mjs";
|
|
@@ -25,7 +27,7 @@ import {
|
|
|
25
27
|
import {
|
|
26
28
|
const_object_colors,
|
|
27
29
|
const_object_documentTypes
|
|
28
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-KAC7JMQB.mjs";
|
|
29
31
|
import {
|
|
30
32
|
enum_daysOfWeek
|
|
31
33
|
} from "./chunk-K6S7R6LU.mjs";
|
|
@@ -30,55 +30,6 @@ function utils_aq_mapDomainToEntity(domain) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// src/utils/utils_converter.ts
|
|
34
|
-
function utils_converter_mapEnumToSelectData(enumObj, labelMap) {
|
|
35
|
-
return Object.entries(enumObj).filter(([key, value]) => isNaN(Number(key))).map(([_, value]) => {
|
|
36
|
-
var _a;
|
|
37
|
-
const stringValue = value.toString();
|
|
38
|
-
return {
|
|
39
|
-
value: stringValue,
|
|
40
|
-
label: (_a = labelMap[stringValue]) != null ? _a : `Kh\xF4ng r\xF5 (${stringValue})`
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
var utils_converter_getLabelByValue = (data, value) => {
|
|
45
|
-
const numericValue = Number(value);
|
|
46
|
-
return data[numericValue] || "Kh\xF4ng x\xE1c \u0111\u1ECBnh";
|
|
47
|
-
};
|
|
48
|
-
var utils_converter_getKeyByValue = (obj, value) => {
|
|
49
|
-
var _a;
|
|
50
|
-
return (_a = Object.entries(obj).find(([_, v]) => v === value)) == null ? void 0 : _a[0];
|
|
51
|
-
};
|
|
52
|
-
function utils_converter_enumToSelectOptions(enumObject) {
|
|
53
|
-
const result = [];
|
|
54
|
-
const numericEnumKeys = Object.keys(enumObject).filter((key) => isNaN(Number(key)));
|
|
55
|
-
for (const key of numericEnumKeys) {
|
|
56
|
-
const enumValue = enumObject[key];
|
|
57
|
-
if (typeof enumValue === "number") {
|
|
58
|
-
result.push({
|
|
59
|
-
value: String(enumValue),
|
|
60
|
-
label: key
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
function utils_converter_youTubeUrlToEmbed(url) {
|
|
67
|
-
try {
|
|
68
|
-
const urlObj = new URL(url);
|
|
69
|
-
const videoId = urlObj.searchParams.get("v");
|
|
70
|
-
if (videoId) {
|
|
71
|
-
return `https://www.youtube.com/embed/${videoId}`;
|
|
72
|
-
}
|
|
73
|
-
if (url.includes("/embed/")) {
|
|
74
|
-
return url;
|
|
75
|
-
}
|
|
76
|
-
return "";
|
|
77
|
-
} catch (e) {
|
|
78
|
-
return "";
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
33
|
// src/utils/utils_currency.ts
|
|
83
34
|
function utils_currency_formatWithSuffix(amount, suffix = "") {
|
|
84
35
|
const formatter = new Intl.NumberFormat("vi-VN");
|
|
@@ -458,11 +409,6 @@ export {
|
|
|
458
409
|
utils_pdf_download,
|
|
459
410
|
utils_aq_mapBaseEntityToDomain,
|
|
460
411
|
utils_aq_mapDomainToEntity,
|
|
461
|
-
utils_converter_mapEnumToSelectData,
|
|
462
|
-
utils_converter_getLabelByValue,
|
|
463
|
-
utils_converter_getKeyByValue,
|
|
464
|
-
utils_converter_enumToSelectOptions,
|
|
465
|
-
utils_converter_youTubeUrlToEmbed,
|
|
466
412
|
utils_currency_formatWithSuffix,
|
|
467
413
|
utils_excel_exportExcel,
|
|
468
414
|
utils_excel_download,
|
|
@@ -70,12 +70,13 @@ import {
|
|
|
70
70
|
useHeaderMegaMenuStore,
|
|
71
71
|
useS_ButtonImport,
|
|
72
72
|
useStore_BasicAppShell
|
|
73
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-LJRTI7UU.mjs";
|
|
74
74
|
import "../chunk-SUH3FFFV.mjs";
|
|
75
|
-
import "../chunk-
|
|
75
|
+
import "../chunk-RJH5TVHS.mjs";
|
|
76
|
+
import "../chunk-7NNLZDND.mjs";
|
|
76
77
|
import "../chunk-O7YCQQO5.mjs";
|
|
77
78
|
import "../chunk-QSWIVDXC.mjs";
|
|
78
|
-
import "../chunk-
|
|
79
|
+
import "../chunk-KAC7JMQB.mjs";
|
|
79
80
|
import "../chunk-K6S7R6LU.mjs";
|
|
80
81
|
import "../chunk-NSBIYOKX.mjs";
|
|
81
82
|
import "../chunk-WZ6PXGGC.mjs";
|
package/dist/const/index.mjs
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -27,12 +27,13 @@ import {
|
|
|
27
27
|
MyTextInput2 as MyTextInput,
|
|
28
28
|
MyThemeIconSquareCheck,
|
|
29
29
|
MyWeeklySessionSchedulerPicker
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-LJRTI7UU.mjs";
|
|
31
31
|
import "../chunk-SUH3FFFV.mjs";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-RJH5TVHS.mjs";
|
|
33
|
+
import "../chunk-7NNLZDND.mjs";
|
|
33
34
|
import "../chunk-O7YCQQO5.mjs";
|
|
34
35
|
import "../chunk-QSWIVDXC.mjs";
|
|
35
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-KAC7JMQB.mjs";
|
|
36
37
|
import "../chunk-K6S7R6LU.mjs";
|
|
37
38
|
import "../chunk-NSBIYOKX.mjs";
|
|
38
39
|
import "../chunk-WZ6PXGGC.mjs";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MyModalDelete
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-LJRTI7UU.mjs";
|
|
4
4
|
import "../chunk-SUH3FFFV.mjs";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-RJH5TVHS.mjs";
|
|
6
|
+
import "../chunk-7NNLZDND.mjs";
|
|
6
7
|
import "../chunk-O7YCQQO5.mjs";
|
|
7
8
|
import "../chunk-QSWIVDXC.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-KAC7JMQB.mjs";
|
|
9
10
|
import "../chunk-K6S7R6LU.mjs";
|
|
10
11
|
import {
|
|
11
12
|
useMyReactMutation
|
|
@@ -112,12 +112,13 @@ import {
|
|
|
112
112
|
MailTemplateDeleteButton,
|
|
113
113
|
useS_moduleConfig,
|
|
114
114
|
useStore_Authenticate
|
|
115
|
-
} from "../chunk-
|
|
115
|
+
} from "../chunk-LJRTI7UU.mjs";
|
|
116
116
|
import "../chunk-SUH3FFFV.mjs";
|
|
117
|
-
import "../chunk-
|
|
117
|
+
import "../chunk-RJH5TVHS.mjs";
|
|
118
|
+
import "../chunk-7NNLZDND.mjs";
|
|
118
119
|
import "../chunk-O7YCQQO5.mjs";
|
|
119
120
|
import "../chunk-QSWIVDXC.mjs";
|
|
120
|
-
import "../chunk-
|
|
121
|
+
import "../chunk-KAC7JMQB.mjs";
|
|
121
122
|
import "../chunk-K6S7R6LU.mjs";
|
|
122
123
|
import "../chunk-NSBIYOKX.mjs";
|
|
123
124
|
import "../chunk-WZ6PXGGC.mjs";
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { I as IBaseDomain } from '../IBaseDomain-CUxofYh8.mjs';
|
|
2
2
|
import { I as IBaseEntity } from '../IBaseEntity-ChMy9RzQ.mjs';
|
|
3
|
+
export { c as utils_converter_enumToSelectOptions, b as utils_converter_getKeyByValue, a as utils_converter_getLabelByValue, u as utils_converter_mapEnumToSelectData, d as utils_converter_youTubeUrlToEmbed } from '../utils_converter-DHT1b-Qe.mjs';
|
|
3
4
|
export { c as IExportConfig, I as IUtils_Excel_ColumnConfig, a as utils_excel_download, u as utils_excel_exportExcel, d as utils_excel_handleExport, b as utils_excel_parseToJson } from '../utils_excel-DGgLE7He.mjs';
|
|
4
5
|
export { I as IAQFileDetail, a as utils_file_AQDocumentTypeToFile, c as utils_file_base64ToFile, b as utils_file_docxtemplaterDownload, u as utils_file_fileToAQDocumentType } from '../utils_file-JlhzjLGS.mjs';
|
|
5
6
|
import { MRT_RowData, MRT_ColumnDef } from 'mantine-react-table';
|
|
@@ -10,23 +11,6 @@ import 'exceljs';
|
|
|
10
11
|
declare function utils_aq_mapBaseEntityToDomain<T extends IBaseEntity>(entity: T): IBaseDomain;
|
|
11
12
|
declare function utils_aq_mapDomainToEntity(domain: IBaseDomain): IBaseEntity;
|
|
12
13
|
|
|
13
|
-
declare function utils_converter_mapEnumToSelectData<T extends Record<string, string | number>>(enumObj: T, labelMap: Record<string, string>): {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}[];
|
|
17
|
-
declare const utils_converter_getLabelByValue: (data: Record<number, string>, value?: number | string) => string;
|
|
18
|
-
declare const utils_converter_getKeyByValue: <K extends string | number, V>(obj: Record<K, V>, value: V) => K | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Chuyển đổi enum thành mảng các đối tượng {value, label}
|
|
21
|
-
* @param enumObject - Đối tượng enum cần chuyển đổi
|
|
22
|
-
* @returns Mảng các đối tượng có dạng {value: string, label: string}
|
|
23
|
-
*/
|
|
24
|
-
declare function utils_converter_enumToSelectOptions<T extends Record<string, string | number>>(enumObject: T): Array<{
|
|
25
|
-
value: string;
|
|
26
|
-
label: string;
|
|
27
|
-
}>;
|
|
28
|
-
declare function utils_converter_youTubeUrlToEmbed(url: string): string;
|
|
29
|
-
|
|
30
14
|
declare function utils_currency_formatWithSuffix(amount: number, suffix?: string): string;
|
|
31
15
|
|
|
32
16
|
declare function utils_date_dateToDDMMYYYString(date?: Date | string): string;
|
|
@@ -87,4 +71,4 @@ declare function utils_time_extractHourMinute(isoString?: string): string;
|
|
|
87
71
|
|
|
88
72
|
declare const utils_validator_validateCode: (value?: string) => "Không được để trống" | null;
|
|
89
73
|
|
|
90
|
-
export { updateEnableList, utils_aq_mapBaseEntityToDomain, utils_aq_mapDomainToEntity,
|
|
74
|
+
export { updateEnableList, utils_aq_mapBaseEntityToDomain, utils_aq_mapDomainToEntity, utils_currency_formatWithSuffix, utils_date_dateToDDMMYYYString, utils_date_formatToDateTimeStartEnd, utils_date_formatToDateTimeString, 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
|
@@ -2,11 +2,6 @@ import {
|
|
|
2
2
|
updateEnableList,
|
|
3
3
|
utils_aq_mapBaseEntityToDomain,
|
|
4
4
|
utils_aq_mapDomainToEntity,
|
|
5
|
-
utils_converter_enumToSelectOptions,
|
|
6
|
-
utils_converter_getKeyByValue,
|
|
7
|
-
utils_converter_getLabelByValue,
|
|
8
|
-
utils_converter_mapEnumToSelectData,
|
|
9
|
-
utils_converter_youTubeUrlToEmbed,
|
|
10
5
|
utils_currency_formatWithSuffix,
|
|
11
6
|
utils_excel_download,
|
|
12
7
|
utils_excel_exportExcel,
|
|
@@ -32,7 +27,14 @@ import {
|
|
|
32
27
|
utils_time_getCurrentTimeString,
|
|
33
28
|
utils_time_getHourMinuteFromString,
|
|
34
29
|
utils_validator_validateCode
|
|
35
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-RJH5TVHS.mjs";
|
|
31
|
+
import {
|
|
32
|
+
utils_converter_enumToSelectOptions,
|
|
33
|
+
utils_converter_getKeyByValue,
|
|
34
|
+
utils_converter_getLabelByValue,
|
|
35
|
+
utils_converter_mapEnumToSelectData,
|
|
36
|
+
utils_converter_youTubeUrlToEmbed
|
|
37
|
+
} from "../chunk-7NNLZDND.mjs";
|
|
36
38
|
import {
|
|
37
39
|
utils_date_dateToDDMMYYYString,
|
|
38
40
|
utils_date_formatToDateTimeStartEnd,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { u as utils_converter_mapEnumToSelectData } from '../utils_converter-DHT1b-Qe.mjs';
|
|
2
|
+
|
|
3
|
+
declare const utils_converter: {
|
|
4
|
+
mapEnumToSelectData: typeof utils_converter_mapEnumToSelectData;
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
declare const utils_currency: {
|
|
2
8
|
formatWithSuffix(amount: number, suffix?: string): string;
|
|
3
9
|
};
|
|
@@ -25,4 +31,4 @@ declare const utils_time: {
|
|
|
25
31
|
extractHourMinute(isoString?: string): string;
|
|
26
32
|
};
|
|
27
33
|
|
|
28
|
-
export { utils_currency, utils_date, utils_text, utils_time };
|
|
34
|
+
export { utils_converter, utils_currency, utils_date, utils_text, utils_time };
|
package/dist/utils-v2/index.mjs
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
utils_converter_mapEnumToSelectData
|
|
3
|
+
} from "../chunk-7NNLZDND.mjs";
|
|
1
4
|
import "../chunk-FWCSY2DS.mjs";
|
|
2
5
|
|
|
6
|
+
// src/utils-v2/utils_converter.ts
|
|
7
|
+
var utils_converter = {
|
|
8
|
+
mapEnumToSelectData: utils_converter_mapEnumToSelectData
|
|
9
|
+
};
|
|
10
|
+
|
|
3
11
|
// src/utils-v2/utils_currency.ts
|
|
4
12
|
var utils_currency = {
|
|
5
13
|
formatWithSuffix(amount, suffix = "") {
|
|
@@ -107,6 +115,7 @@ var utils_time = {
|
|
|
107
115
|
}
|
|
108
116
|
};
|
|
109
117
|
export {
|
|
118
|
+
utils_converter,
|
|
110
119
|
utils_currency,
|
|
111
120
|
utils_date,
|
|
112
121
|
utils_text,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare function utils_converter_mapEnumToSelectData<T extends Record<string, string | number>>(enumObj: T, labelMap: Record<string, string>): {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}[];
|
|
5
|
+
declare const utils_converter_getLabelByValue: (data: Record<number, string>, value?: number | string) => string;
|
|
6
|
+
declare const utils_converter_getKeyByValue: <K extends string | number, V>(obj: Record<K, V>, value: V) => K | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Chuyển đổi enum thành mảng các đối tượng {value, label}
|
|
9
|
+
* @param enumObject - Đối tượng enum cần chuyển đổi
|
|
10
|
+
* @returns Mảng các đối tượng có dạng {value: string, label: string}
|
|
11
|
+
*/
|
|
12
|
+
declare function utils_converter_enumToSelectOptions<T extends Record<string, string | number>>(enumObject: T): Array<{
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}>;
|
|
16
|
+
declare function utils_converter_youTubeUrlToEmbed(url: string): string;
|
|
17
|
+
|
|
18
|
+
export { utils_converter_getLabelByValue as a, utils_converter_getKeyByValue as b, utils_converter_enumToSelectOptions as c, utils_converter_youTubeUrlToEmbed as d, utils_converter_mapEnumToSelectData as u };
|
package/package.json
CHANGED