aq-fe-framework 0.1.29 → 0.1.32

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.
@@ -1,3 +1,11 @@
1
+ import {
2
+ U0DateToDDMMYYYString,
3
+ U0MyValidateEmail,
4
+ U0MyValidateEmpty,
5
+ utils_date_dateToDDMMYYYString,
6
+ utils_file_docxtemplaterDownload,
7
+ utils_file_fileToAQDocumentType
8
+ } from "../chunk-GHGYRQUR.mjs";
1
9
  import {
2
10
  utils_notification_show,
3
11
  utils_pdf_download
@@ -30,20 +38,6 @@ function utils_converter_enumToSelectOptions(enumObject) {
30
38
  return result;
31
39
  }
32
40
 
33
- // src/utils/date.ts
34
- function U0DateToDDMMYYYString(date) {
35
- const day = String(date.getDate()).padStart(2, "0");
36
- const month = String(date.getMonth() + 1).padStart(2, "0");
37
- const year = date.getFullYear();
38
- return `${day}/${month}/${year}`;
39
- }
40
- function utils_date_dateToDDMMYYYString(date) {
41
- const day = String(date.getDate()).padStart(2, "0");
42
- const month = String(date.getMonth() + 1).padStart(2, "0");
43
- const year = date.getFullYear();
44
- return `${day}/${month}/${year}`;
45
- }
46
-
47
41
  // src/utils/excel.ts
48
42
  import saveAs from "file-saver";
49
43
  async function utils_excel_exportExcel({
@@ -136,42 +130,6 @@ async function utils_excel_download({
136
130
  saveAs(blob, name);
137
131
  }
138
132
 
139
- // src/utils/file.ts
140
- import Docxtemplater from "docxtemplater";
141
- import { saveAs as saveAs2 } from "file-saver";
142
- import PizZip from "pizzip";
143
- function utils_file_fileToAQDocumentType(file) {
144
- return new Promise((resolve, reject) => {
145
- const fileReader = new FileReader();
146
- fileReader.onloadend = () => {
147
- const fileName = file.name;
148
- const fileExtension = file.name.split(".").pop();
149
- const fileBase64String = fileReader.result;
150
- resolve({
151
- fileName,
152
- fileExtension,
153
- fileBase64String: fileBase64String.split(",")[1]
154
- // Chỉ lấy phần base64 sau dấu phẩy
155
- });
156
- };
157
- fileReader.onerror = reject;
158
- fileReader.readAsDataURL(file);
159
- });
160
- }
161
- async function utils_file_docxtemplaterDownload({
162
- data,
163
- filePath,
164
- fileName
165
- }) {
166
- const response = await fetch(filePath);
167
- const arrayBuffer = await response.arrayBuffer();
168
- const zip = new PizZip(arrayBuffer);
169
- const doc = new Docxtemplater(zip);
170
- doc.render(data);
171
- const buffer = doc.getZip().generate({ type: "blob" });
172
- saveAs2(buffer, fileName || "output.docx");
173
- }
174
-
175
133
  // src/utils/time.ts
176
134
  var utils_time_convertTimeStringToSeconds = (time) => {
177
135
  const [hours, minutes, seconds] = time.split(":").map(Number);
@@ -187,15 +145,6 @@ var utils_time_getCurrentTimeString = () => {
187
145
  const seconds = formatTime(now.getSeconds());
188
146
  return `${hours}:${minutes}:${seconds}`;
189
147
  };
190
-
191
- // src/utils/validateForm.ts
192
- import { isNotEmpty } from "@mantine/form";
193
- function U0MyValidateEmpty(message) {
194
- return isNotEmpty(message ? message : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng");
195
- }
196
- function U0MyValidateEmail(value) {
197
- return /^\S+@\S+$/.test(value) ? null : "Email kh\xF4ng \u0111\xFAng \u0111\u1ECBnh d\u1EA1ng";
198
- }
199
148
  export {
200
149
  U0DateToDDMMYYYString,
201
150
  U0MyValidateEmail,
package/package.json CHANGED
@@ -12,15 +12,19 @@
12
12
  "./stores": {
13
13
  "import": "./dist/stores/index.mjs",
14
14
  "types": "./dist/stores/index.d.mts"
15
+ },
16
+ "./modules-features": {
17
+ "import": "./dist/modules-features/admin/core/index.mjs",
18
+ "types": "./dist/modules-features//admin/core/index.d.mts"
15
19
  }
16
20
  },
17
- "version": "0.1.29",
21
+ "version": "0.1.32",
18
22
  "private": false,
19
23
  "files": [
20
24
  "dist"
21
25
  ],
22
26
  "scripts": {
23
- "generate-barrels": "barrelsby --config barrelsby.json",
27
+ "gen": "barrelsby --config barrelsby.json",
24
28
  "build": "tsup",
25
29
  "start": "next start",
26
30
  "lint": "next lint",