aq-fe-framework 0.1.368 → 0.1.369

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.
@@ -16,6 +16,15 @@ async function utils_config_getBaseUrl({
16
16
  }
17
17
 
18
18
  // src/utils/utils_converter.ts
19
+ function utils_converter_mapEnumToSelectData(enumObj, labelMap) {
20
+ return Object.entries(enumObj).filter(([key, value]) => typeof value === "number").map(([_, value]) => {
21
+ var _a;
22
+ return {
23
+ value: value.toString(),
24
+ label: (_a = labelMap[value]) != null ? _a : `Kh\xF4ng r\xF5 (${value})`
25
+ };
26
+ });
27
+ }
19
28
  var utils_converter_getLabelByValue = (data, value) => {
20
29
  const numericValue = Number(value);
21
30
  return data[numericValue] || "Kh\xF4ng x\xE1c \u0111\u1ECBnh";
@@ -293,6 +302,7 @@ export {
293
302
  utils_file_AQDocumentTypeToFile,
294
303
  utils_file_docxtemplaterDownload,
295
304
  utils_config_getBaseUrl,
305
+ utils_converter_mapEnumToSelectData,
296
306
  utils_converter_getLabelByValue,
297
307
  utils_converter_getKeyByValue,
298
308
  utils_converter_enumToSelectOptions,
@@ -12,10 +12,10 @@ import {
12
12
  MyStatsCard,
13
13
  MyTextInput,
14
14
  MyWeeklySessionSchedulerPicker
15
- } from "../chunk-YSSHMYFL.mjs";
15
+ } from "../chunk-476TD6DI.mjs";
16
16
  import "../chunk-GEYCGM75.mjs";
17
- import "../chunk-7ORPZMGL.mjs";
18
17
  import "../chunk-K6S7R6LU.mjs";
18
+ import "../chunk-7ORPZMGL.mjs";
19
19
  import "../chunk-YQPDRFRL.mjs";
20
20
  import "../chunk-7ZCOFATU.mjs";
21
21
  import "../chunk-FWCSY2DS.mjs";
@@ -4,16 +4,13 @@ import {
4
4
  utils_config_getBaseUrl,
5
5
  utils_converter_enumToSelectOptions,
6
6
  utils_file_fileToAQDocumentType
7
- } from "../chunk-VJUY7DLP.mjs";
7
+ } from "../chunk-P3IR7UL7.mjs";
8
8
  import {
9
9
  baseColumns
10
10
  } from "../chunk-2SBUKAGS.mjs";
11
11
  import {
12
12
  U0DateToDDMMYYYString
13
13
  } from "../chunk-I2XIN2R3.mjs";
14
- import {
15
- const_object_documentTypes
16
- } from "../chunk-BZMQOGL6.mjs";
17
14
  import {
18
15
  F_authenticate_Logout,
19
16
  MyActionIconDelete,
@@ -41,23 +38,26 @@ import {
41
38
  createGenericStore
42
39
  } from "../chunk-Y3YGC5IH.mjs";
43
40
  import "../chunk-5U2JSHSJ.mjs";
41
+ import {
42
+ enum_emailConfigModule
43
+ } from "../chunk-VH4ZAD6M.mjs";
44
44
  import {
45
45
  MyButton as MyButton2,
46
46
  MyDataTableSelectOne,
47
47
  MyTextInput as MyTextInput2
48
- } from "../chunk-YSSHMYFL.mjs";
48
+ } from "../chunk-476TD6DI.mjs";
49
49
  import {
50
50
  MyDataTable,
51
51
  MyFlexColumn,
52
52
  MyFlexRow
53
53
  } from "../chunk-GEYCGM75.mjs";
54
+ import "../chunk-K6S7R6LU.mjs";
55
+ import {
56
+ const_object_documentTypes
57
+ } from "../chunk-BZMQOGL6.mjs";
54
58
  import {
55
59
  const_object_colors
56
60
  } from "../chunk-7ORPZMGL.mjs";
57
- import {
58
- enum_emailConfigModule
59
- } from "../chunk-VH4ZAD6M.mjs";
60
- import "../chunk-K6S7R6LU.mjs";
61
61
  import {
62
62
  baseAxios_default,
63
63
  createBaseApi,
@@ -3,6 +3,10 @@ import { DefaultMantineColor } from '@mantine/core';
3
3
  import { useQueryClient } from '@tanstack/react-query';
4
4
  import 'exceljs';
5
5
 
6
+ declare function utils_converter_mapEnumToSelectData<T extends Record<string, string | number>>(enumObj: T, labelMap: Record<T[keyof T], string>): {
7
+ value: string;
8
+ label: Record<T[keyof T], string>[T[keyof T]];
9
+ }[];
6
10
  declare const utils_converter_getLabelByValue: (data: Record<number, string>, value?: number | string) => string;
7
11
  declare const utils_converter_getKeyByValue: <K extends string | number, V>(obj: Record<K, V>, value: V) => K | undefined;
8
12
  /**
@@ -59,4 +63,4 @@ declare function U0MyValidateEmpty(message?: string): (value: unknown) => React.
59
63
  declare function U0MyValidateEmail(value?: string): "Email không đúng định dạng" | null;
60
64
  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;
61
65
 
62
- 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_text_getNormalizedTextFromHtml, utils_time_convertTimeStringToSeconds, utils_time_extractHourMinute, utils_time_getCurrentTimeString, utils_validator_validateCode };
66
+ 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_notification_show, utils_pdf_download, utils_reactQuery_updateListItemInQuery, utils_text_getNormalizedTextFromHtml, utils_time_convertTimeStringToSeconds, utils_time_extractHourMinute, utils_time_getCurrentTimeString, utils_validator_validateCode };
@@ -5,6 +5,7 @@ import {
5
5
  utils_converter_enumToSelectOptions,
6
6
  utils_converter_getKeyByValue,
7
7
  utils_converter_getLabelByValue,
8
+ utils_converter_mapEnumToSelectData,
8
9
  utils_currency_formatWithSuffix,
9
10
  utils_excel_download,
10
11
  utils_excel_exportExcel,
@@ -17,7 +18,7 @@ import {
17
18
  utils_time_extractHourMinute,
18
19
  utils_time_getCurrentTimeString,
19
20
  utils_validator_validateCode
20
- } from "../chunk-VJUY7DLP.mjs";
21
+ } from "../chunk-P3IR7UL7.mjs";
21
22
  import {
22
23
  U0DateToDDMMYYYString,
23
24
  utils_date_dateToDDMMYYYString,
@@ -39,6 +40,7 @@ export {
39
40
  utils_converter_enumToSelectOptions,
40
41
  utils_converter_getKeyByValue,
41
42
  utils_converter_getLabelByValue,
43
+ utils_converter_mapEnumToSelectData,
42
44
  utils_currency_formatWithSuffix,
43
45
  utils_date_dateToDDMMYYYString,
44
46
  utils_date_formatToDateTimeStartEnd,
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/columns/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.1.368",
45
+ "version": "0.1.369",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"
@@ -3,12 +3,12 @@ import {
3
3
  MyFlexColumn,
4
4
  MyFlexRow
5
5
  } from "./chunk-GEYCGM75.mjs";
6
- import {
7
- const_object_colors
8
- } from "./chunk-7ORPZMGL.mjs";
9
6
  import {
10
7
  enum_daysOfWeek
11
8
  } from "./chunk-K6S7R6LU.mjs";
9
+ import {
10
+ const_object_colors
11
+ } from "./chunk-7ORPZMGL.mjs";
12
12
  import {
13
13
  useMyReactMutation
14
14
  } from "./chunk-YQPDRFRL.mjs";