aq-fe-framework 0.2.10 → 0.2.12

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.
@@ -15,7 +15,7 @@ import {
15
15
  utils_file,
16
16
  utils_mantineReactTable,
17
17
  utils_text
18
- } from "./chunk-G75DH6JW.mjs";
18
+ } from "./chunk-BNRBLSD7.mjs";
19
19
  import {
20
20
  baseAxios_default,
21
21
  useConfig,
@@ -11358,6 +11358,7 @@ function CustomMappingFormatDataModal(_a) {
11358
11358
  }
11359
11359
  switch (field.parseType) {
11360
11360
  case "number":
11361
+ if (!rawValue) return void 0;
11361
11362
  if (rawValue === null || rawValue === void 0 || rawValue === "")
11362
11363
  parsedValue = null;
11363
11364
  else if (isNaN(Number(rawValue.replaceAll(",", ""))))
@@ -11365,6 +11366,7 @@ function CustomMappingFormatDataModal(_a) {
11365
11366
  else parsedValue = Number(rawValue.replaceAll(",", ""));
11366
11367
  break;
11367
11368
  case "boolean":
11369
+ if (!rawValue) return void 0;
11368
11370
  if (typeof rawValue === "boolean") parsedValue = rawValue;
11369
11371
  else if (["true", "1"].includes(String(rawValue).toLowerCase()))
11370
11372
  parsedValue = true;
@@ -11373,6 +11375,7 @@ function CustomMappingFormatDataModal(_a) {
11373
11375
  else throw new Error(`Kh\xF4ng th\u1EC3 \xE9p "${rawValue}" sang boolean`);
11374
11376
  break;
11375
11377
  case "date":
11378
+ if (!rawValue) return void 0;
11376
11379
  if (!CustomMappingDataModalUtils.isDDMMYYYYFormat(rawValue))
11377
11380
  throw new Error(`Kh\xF4ng th\u1EC3 \xE9p "${rawValue}" sang date`);
11378
11381
  parsedValue = CustomMappingDataModalUtils.convertToYYYYMMDD(rawValue);
@@ -1,3 +1,7 @@
1
+ import {
2
+ __spreadValues
3
+ } from "./chunk-JD6AELXS.mjs";
4
+
1
5
  // src/utils-v2/utils_build.ts
2
6
  var utils_build = {
3
7
  createEnumKeyMap(enumObj) {
@@ -31,6 +35,17 @@ var utils_converter = {
31
35
  return Object.fromEntries(
32
36
  Object.entries(options).map(([key, value]) => [value, key])
33
37
  );
38
+ },
39
+ mapIds(values, references) {
40
+ return values.map((v) => {
41
+ const mappedIds = {};
42
+ for (const outputKey in references) {
43
+ const { data, key, idField = "id" } = references[outputKey];
44
+ const match = data.find((d) => d[key] === v[key]);
45
+ mappedIds[outputKey] = match ? match[idField] : null;
46
+ }
47
+ return __spreadValues(__spreadValues({}, v), mappedIds);
48
+ });
34
49
  }
35
50
  };
36
51
 
@@ -65,9 +65,9 @@ import {
65
65
  getReadablePageIdSet,
66
66
  useHeaderMegaMenuStore,
67
67
  useStore_BasicAppShell
68
- } from "../chunk-BDL36J6Y.mjs";
68
+ } from "../chunk-64PGWSXE.mjs";
69
69
  import "../chunk-LZVUOVHO.mjs";
70
- import "../chunk-G75DH6JW.mjs";
70
+ import "../chunk-BNRBLSD7.mjs";
71
71
  import "../chunk-YMMUWZA3.mjs";
72
72
  import "../chunk-CBZXSBNX.mjs";
73
73
  import "../chunk-WZ6PXGGC.mjs";
@@ -37,9 +37,9 @@ import {
37
37
  MyStatsCard,
38
38
  MyTextInput2 as MyTextInput,
39
39
  MyWeeklySessionSchedulerPicker
40
- } from "../chunk-BDL36J6Y.mjs";
40
+ } from "../chunk-64PGWSXE.mjs";
41
41
  import "../chunk-LZVUOVHO.mjs";
42
- import "../chunk-G75DH6JW.mjs";
42
+ import "../chunk-BNRBLSD7.mjs";
43
43
  import "../chunk-YMMUWZA3.mjs";
44
44
  import "../chunk-CBZXSBNX.mjs";
45
45
  import "../chunk-WZ6PXGGC.mjs";
@@ -64,9 +64,9 @@ import {
64
64
  UserAvatarMenu,
65
65
  useS_moduleConfig,
66
66
  useStore_Authenticate
67
- } from "../chunk-BDL36J6Y.mjs";
67
+ } from "../chunk-64PGWSXE.mjs";
68
68
  import "../chunk-LZVUOVHO.mjs";
69
- import "../chunk-G75DH6JW.mjs";
69
+ import "../chunk-BNRBLSD7.mjs";
70
70
  import "../chunk-YMMUWZA3.mjs";
71
71
  import "../chunk-CBZXSBNX.mjs";
72
72
  import "../chunk-WZ6PXGGC.mjs";
@@ -8,11 +8,11 @@ import {
8
8
  documentTypesObject,
9
9
  genderEnum,
10
10
  genderLabel
11
- } from "../chunk-BDL36J6Y.mjs";
11
+ } from "../chunk-64PGWSXE.mjs";
12
12
  import "../chunk-LZVUOVHO.mjs";
13
13
  import {
14
14
  utils_converter
15
- } from "../chunk-G75DH6JW.mjs";
15
+ } from "../chunk-BNRBLSD7.mjs";
16
16
  import "../chunk-YMMUWZA3.mjs";
17
17
  import {
18
18
  createGenericStore
@@ -17,6 +17,13 @@ declare const utils_converter: {
17
17
  }[];
18
18
  mapOptionsToSelectData<T extends string>(options: OptionsRecord<T>, t: (key: T) => string): ComboboxData;
19
19
  invertObject<TKey extends string | number | symbol, TValue>(options: Record<TKey, TValue>): any;
20
+ mapIds<T extends Record<string, any>>(values: T[], references: {
21
+ [outputKey: string]: {
22
+ data: T[];
23
+ key: keyof T;
24
+ idField?: keyof T;
25
+ };
26
+ }): (T & Record<string, any>)[];
20
27
  };
21
28
 
22
29
  interface IExcelColumnConfig<T> {
@@ -8,7 +8,7 @@ import {
8
8
  utils_mantineReactTable,
9
9
  utils_text,
10
10
  utils_time
11
- } from "../chunk-G75DH6JW.mjs";
11
+ } from "../chunk-BNRBLSD7.mjs";
12
12
  import "../chunk-JD6AELXS.mjs";
13
13
  export {
14
14
  utils_build,
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/types/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.2.10",
45
+ "version": "0.2.12",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"