aq-fe-framework 0.1.345 → 0.1.346

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.
@@ -48,14 +48,14 @@ function utils_currency_formatWithSuffix(amount, suffix = "") {
48
48
 
49
49
  // src/utils/utils_excel.ts
50
50
  import saveAs from "file-saver";
51
- function isObjectPath(path2) {
52
- return /^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*)+$/.test(path2);
51
+ function isObjectPath(path) {
52
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*)+$/.test(path);
53
53
  }
54
- function getValueByPath(obj, path2) {
55
- if (isObjectPath(path2)) {
56
- return path2.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
54
+ function getValueByPath(obj, path) {
55
+ if (isObjectPath(path)) {
56
+ return path.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
57
57
  }
58
- return obj == null ? void 0 : obj[path2];
58
+ return obj == null ? void 0 : obj[path];
59
59
  }
60
60
  async function utils_excel_exportExcel({
61
61
  workbook,
@@ -145,13 +145,13 @@ import Docxtemplater from "docxtemplater";
145
145
  import { saveAs as saveAs2 } from "file-saver";
146
146
  import PizZip from "pizzip";
147
147
  function utils_file_fileToAQDocumentType(file) {
148
- return new Promise((resolve2, reject) => {
148
+ return new Promise((resolve, reject) => {
149
149
  const fileReader = new FileReader();
150
150
  fileReader.onloadend = () => {
151
151
  const fileName = file.name;
152
152
  const fileExtension = file.name.split(".").pop();
153
153
  const fileBase64String = fileReader.result;
154
- resolve2({
154
+ resolve({
155
155
  fileName,
156
156
  fileExtension,
157
157
  fileBase64String: fileBase64String.split(",")[1]
@@ -173,12 +173,12 @@ async function utils_file_AQDocumentTypeToFile({
173
173
  const doc = new Docxtemplater(zip);
174
174
  doc.render(data);
175
175
  const blob = doc.getZip().generate({ type: "blob" });
176
- return new Promise((resolve2, reject) => {
176
+ return new Promise((resolve, reject) => {
177
177
  const reader = new FileReader();
178
178
  reader.onloadend = () => {
179
179
  var _a;
180
180
  const base64String = (_a = reader.result) == null ? void 0 : _a.split(",")[1];
181
- resolve2({
181
+ resolve({
182
182
  fileName,
183
183
  fileExtension: "docx",
184
184
  fileBase64String: base64String
@@ -202,39 +202,6 @@ async function utils_file_docxtemplaterDownload({
202
202
  saveAs2(buffer, fileName || "output.docx");
203
203
  }
204
204
 
205
- // src/utils/utils_framework.ts
206
- import * as fs from "fs";
207
- import * as path from "path";
208
- function utils_framework_checkPackageVersionMismatch(packageName = "aq-fe-framework") {
209
- var _a, _b;
210
- const rootPkgPath = path.resolve("package.json");
211
- if (!fs.existsSync(rootPkgPath)) {
212
- throw new Error("Kh\xF4ng t\xECm th\u1EA5y file package.json \u1EDF th\u01B0 m\u1EE5c g\u1ED1c.");
213
- }
214
- const rootPkg = JSON.parse(fs.readFileSync(rootPkgPath, "utf-8"));
215
- const expectedVersion = ((_a = rootPkg.dependencies) == null ? void 0 : _a[packageName]) || ((_b = rootPkg.devDependencies) == null ? void 0 : _b[packageName]);
216
- if (!expectedVersion) {
217
- console.warn(`[WARN] Kh\xF4ng t\xECm th\u1EA5y package ${packageName} trong dependencies/devDependencies.`);
218
- return;
219
- }
220
- const actualPkgPath = path.resolve("node_modules", packageName, "package.json");
221
- if (!fs.existsSync(actualPkgPath)) {
222
- console.error(`[ERROR] Package "${packageName}" ch\u01B0a \u0111\u01B0\u1EE3c c\xE0i. Vui l\xF2ng ch\u1EA1y: npm install`);
223
- process.exit(1);
224
- }
225
- const actualPkg = JSON.parse(fs.readFileSync(actualPkgPath, "utf-8"));
226
- const actualVersion = actualPkg.version;
227
- const expectedVersionNum = expectedVersion.replace(/^[^\d]*/, "");
228
- if (!actualVersion.startsWith(expectedVersionNum)) {
229
- console.error(`[ERROR] Phi\xEAn b\u1EA3n kh\xF4ng kh\u1EDBp cho "${packageName}"`);
230
- console.error(` - \u0110ang d\xF9ng (node_modules): ${actualVersion}`);
231
- console.error(` - Mong \u0111\u1EE3i (package.json): ${expectedVersion}`);
232
- console.error(`=> Vui l\xF2ng ch\u1EA1y l\u1EA1i: npm install`);
233
- process.exit(1);
234
- }
235
- console.log(`[OK] Phi\xEAn b\u1EA3n "${packageName}" h\u1EE3p l\u1EC7: ${actualVersion}`);
236
- }
237
-
238
205
  // src/utils/utils_input_updateEnableList.ts
239
206
  function updateEnableList(oldList, selectedIds, getId, createNew) {
240
207
  const result = [];
@@ -326,7 +293,6 @@ export {
326
293
  utils_currency_formatWithSuffix,
327
294
  utils_excel_exportExcel,
328
295
  utils_excel_download,
329
- utils_framework_checkPackageVersionMismatch,
330
296
  utils_reactQuery_updateListItemInQuery,
331
297
  utils_time_convertTimeStringToSeconds,
332
298
  utils_time_getCurrentTimeString,
@@ -12,10 +12,10 @@ import {
12
12
  MyStatsCard,
13
13
  MyTextInput,
14
14
  MyWeeklySessionSchedulerPicker
15
- } from "../chunk-A7SOCM54.mjs";
15
+ } from "../chunk-IID4MGPX.mjs";
16
16
  import "../chunk-GEYCGM75.mjs";
17
- import "../chunk-NWBLJ3W3.mjs";
18
17
  import "../chunk-K6S7R6LU.mjs";
18
+ import "../chunk-NWBLJ3W3.mjs";
19
19
  import "../chunk-YQPDRFRL.mjs";
20
20
  import "../chunk-7ZCOFATU.mjs";
21
21
  import "../chunk-FWCSY2DS.mjs";
@@ -4,7 +4,7 @@ import {
4
4
  utils_config_getBaseUrl,
5
5
  utils_converter_enumToSelectOptions,
6
6
  utils_file_fileToAQDocumentType
7
- } from "../chunk-MKOPTV6N.mjs";
7
+ } from "../chunk-FBGCXKGK.mjs";
8
8
  import {
9
9
  baseColumns
10
10
  } from "../chunk-2SBUKAGS.mjs";
@@ -38,26 +38,26 @@ import {
38
38
  createGenericStore
39
39
  } from "../chunk-Y3YGC5IH.mjs";
40
40
  import "../chunk-5U2JSHSJ.mjs";
41
- import {
42
- const_object_documentTypes
43
- } from "../chunk-BZMQOGL6.mjs";
44
41
  import {
45
42
  MyButton as MyButton2,
46
43
  MyDataTableSelectOne,
47
44
  MyTextInput as MyTextInput2
48
- } from "../chunk-A7SOCM54.mjs";
45
+ } from "../chunk-IID4MGPX.mjs";
49
46
  import {
50
47
  MyDataTable,
51
48
  MyFlexColumn,
52
49
  MyFlexRow
53
50
  } from "../chunk-GEYCGM75.mjs";
54
- import {
55
- const_object_colors
56
- } from "../chunk-NWBLJ3W3.mjs";
57
51
  import {
58
52
  enum_emailConfigModule
59
53
  } from "../chunk-VH4ZAD6M.mjs";
60
54
  import "../chunk-K6S7R6LU.mjs";
55
+ import {
56
+ const_object_documentTypes
57
+ } from "../chunk-BZMQOGL6.mjs";
58
+ import {
59
+ const_object_colors
60
+ } from "../chunk-NWBLJ3W3.mjs";
61
61
  import {
62
62
  baseAxios_default,
63
63
  createBaseApi,
@@ -22,8 +22,6 @@ declare function utils_date_dateToDDMMYYYString(date: Date): string;
22
22
  declare function utils_date_formatToDateTimeStartEnd(startDate: Date, endDate: Date): string;
23
23
  declare function utils_date_getHHmm(date: Date): string;
24
24
 
25
- declare function utils_framework_checkPackageVersionMismatch(packageName?: string): void;
26
-
27
25
  /**
28
26
  * Cập nhật danh sách dạng many-to-many có cờ enable.
29
27
  * @param oldList - danh sách gốc đang lưu trong state
@@ -59,4 +57,4 @@ declare function U0MyValidateEmpty(message?: string): (value: unknown) => React.
59
57
  declare function U0MyValidateEmail(value?: string): "Email không đúng định dạng" | null;
60
58
  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
59
 
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_framework_checkPackageVersionMismatch, utils_notification_show, utils_pdf_download, utils_reactQuery_updateListItemInQuery, utils_time_convertTimeStringToSeconds, utils_time_extractHourMinute, utils_time_getCurrentTimeString, utils_validator_validateCode };
60
+ 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_extractHourMinute, utils_time_getCurrentTimeString, utils_validator_validateCode };
@@ -11,13 +11,12 @@ import {
11
11
  utils_file_AQDocumentTypeToFile,
12
12
  utils_file_docxtemplaterDownload,
13
13
  utils_file_fileToAQDocumentType,
14
- utils_framework_checkPackageVersionMismatch,
15
14
  utils_reactQuery_updateListItemInQuery,
16
15
  utils_time_convertTimeStringToSeconds,
17
16
  utils_time_extractHourMinute,
18
17
  utils_time_getCurrentTimeString,
19
18
  utils_validator_validateCode
20
- } from "../chunk-MKOPTV6N.mjs";
19
+ } from "../chunk-FBGCXKGK.mjs";
21
20
  import {
22
21
  U0DateToDDMMYYYString,
23
22
  utils_date_dateToDDMMYYYString,
@@ -48,7 +47,6 @@ export {
48
47
  utils_file_AQDocumentTypeToFile,
49
48
  utils_file_docxtemplaterDownload,
50
49
  utils_file_fileToAQDocumentType,
51
- utils_framework_checkPackageVersionMismatch,
52
50
  utils_notification_show,
53
51
  utils_pdf_download,
54
52
  utils_reactQuery_updateListItemInQuery,
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/columns/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.1.345",
45
+ "version": "0.1.346",
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-NWBLJ3W3.mjs";
9
6
  import {
10
7
  enum_daysOfWeek
11
8
  } from "./chunk-K6S7R6LU.mjs";
9
+ import {
10
+ const_object_colors
11
+ } from "./chunk-NWBLJ3W3.mjs";
12
12
  import {
13
13
  useMyReactMutation
14
14
  } from "./chunk-YQPDRFRL.mjs";