aq-fe-framework 0.1.231 → 0.1.233

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.
@@ -194,6 +194,32 @@ function utils_file_fileToAQDocumentType(file) {
194
194
  fileReader.readAsDataURL(file);
195
195
  });
196
196
  }
197
+ async function utils_file_AQDocumentTypeToFile({
198
+ data,
199
+ filePath,
200
+ fileName = "output.docx"
201
+ }) {
202
+ const response = await fetch(filePath);
203
+ const arrayBuffer = await response.arrayBuffer();
204
+ const zip = new PizZip(arrayBuffer);
205
+ const doc = new Docxtemplater(zip);
206
+ doc.render(data);
207
+ const blob = doc.getZip().generate({ type: "blob" });
208
+ return new Promise((resolve, reject) => {
209
+ const reader = new FileReader();
210
+ reader.onloadend = () => {
211
+ var _a;
212
+ const base64String = (_a = reader.result) == null ? void 0 : _a.split(",")[1];
213
+ resolve({
214
+ fileName,
215
+ fileExtension: "docx",
216
+ fileBase64String: base64String
217
+ });
218
+ };
219
+ reader.onerror = reject;
220
+ reader.readAsDataURL(blob);
221
+ });
222
+ }
197
223
  async function utils_file_docxtemplaterDownload({
198
224
  data,
199
225
  filePath,
@@ -259,6 +285,7 @@ export {
259
285
  utils_date_formatToDateTimeStartEnd,
260
286
  utils_date_getHHmm,
261
287
  utils_file_fileToAQDocumentType,
288
+ utils_file_AQDocumentTypeToFile,
262
289
  utils_file_docxtemplaterDownload,
263
290
  utils_config_getBaseUrl,
264
291
  utils_converter_getLabelByValue,
@@ -6712,10 +6712,18 @@ function MyFieldset(_a) {
6712
6712
 
6713
6713
  // src/components/Inputs/FileInput/MyFileInput.tsx
6714
6714
  import { FileInput as FileInput3 } from "@mantine/core";
6715
+ import { IconFile } from "@tabler/icons-react";
6715
6716
  import { jsx as jsx46 } from "react/jsx-runtime";
6716
6717
  function MyFileInput(_a) {
6717
6718
  var _b = _a, { label } = _b, rest = __objRest(_b, ["label"]);
6718
- return /* @__PURE__ */ jsx46(FileInput3, __spreadValues({ label, placeholder: label ? `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
6719
+ return /* @__PURE__ */ jsx46(
6720
+ FileInput3,
6721
+ __spreadValues({
6722
+ rightSection: /* @__PURE__ */ jsx46(IconFile, {}),
6723
+ label,
6724
+ placeholder: label ? `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}` : ""
6725
+ }, rest)
6726
+ );
6719
6727
  }
6720
6728
 
6721
6729
  // src/components/Inputs/NumberInput/MyNumberInput.tsx
@@ -5,7 +5,7 @@ import { useDisclosure, useListState } from '@mantine/hooks';
5
5
  import { UseFormReturnType, useForm } from '@mantine/form';
6
6
  import { I as I_BasicAppShell_LinkItem } from '../BasicAppShell-CGKvZ5wV.mjs';
7
7
  export { a as BasicAppShell, B as BasicAppShell_transformMenuToEnum, g as groupToTwoLevels, u as utils_layout_getItemsWithoutLinks } from '../BasicAppShell-CGKvZ5wV.mjs';
8
- import { I as IUtils_Excel_ColumnConfig, a as IAQFileDetail } from '../utils_file-DAglO3jY.mjs';
8
+ import { I as IUtils_Excel_ColumnConfig, a as IAQFileDetail } from '../utils_file-G8NTHCO-.mjs';
9
9
  import { MRT_ColumnDef, MRT_RowData, MRT_TableOptions, MRT_TableInstance } from 'mantine-react-table';
10
10
  import { ConfigOptions } from 'export-to-csv';
11
11
  import { DateInputProps } from '@mantine/dates';
@@ -65,7 +65,7 @@ import {
65
65
  useS_BasicAppShell,
66
66
  useS_ButtonImport,
67
67
  utils_layout_getItemsWithoutLinks
68
- } from "../chunk-PZS7HFGP.mjs";
68
+ } from "../chunk-Z4HWHVNV.mjs";
69
69
  import "../chunk-P5TKOHP7.mjs";
70
70
  import "../chunk-Y3YGC5IH.mjs";
71
71
  import "../chunk-5U2JSHSJ.mjs";
@@ -25,7 +25,7 @@ import {
25
25
  useS_BasicAppShell,
26
26
  useS_authenticate,
27
27
  utils_layout_getItemsWithoutLinks
28
- } from "../chunk-PZS7HFGP.mjs";
28
+ } from "../chunk-Z4HWHVNV.mjs";
29
29
  import {
30
30
  baseAxios_default,
31
31
  useQ_AQ_GetAQModule,
@@ -41,7 +41,7 @@ import {
41
41
  utils_config_getBaseUrl,
42
42
  utils_converter_enumToSelectOptions,
43
43
  utils_file_fileToAQDocumentType
44
- } from "../chunk-AQ2ORDKJ.mjs";
44
+ } from "../chunk-PI7ZROBI.mjs";
45
45
  import "../chunk-5U2JSHSJ.mjs";
46
46
  import {
47
47
  utils_notification_show
@@ -1,4 +1,4 @@
1
- export { a as IAQFileDetail, I as IUtils_Excel_ColumnConfig, b as utils_excel_download, u as utils_excel_exportExcel, d as utils_file_docxtemplaterDownload, c as utils_file_fileToAQDocumentType } from '../utils_file-DAglO3jY.mjs';
1
+ export { a as IAQFileDetail, I as IUtils_Excel_ColumnConfig, b as utils_excel_download, u as utils_excel_exportExcel, d as utils_file_AQDocumentTypeToFile, e as utils_file_docxtemplaterDownload, c as utils_file_fileToAQDocumentType } from '../utils_file-G8NTHCO-.mjs';
2
2
  import { DefaultMantineColor } from '@mantine/core';
3
3
  import 'exceljs';
4
4
 
@@ -12,11 +12,12 @@ import {
12
12
  utils_date_getHHmm,
13
13
  utils_excel_download,
14
14
  utils_excel_exportExcel,
15
+ utils_file_AQDocumentTypeToFile,
15
16
  utils_file_docxtemplaterDownload,
16
17
  utils_file_fileToAQDocumentType,
17
18
  utils_time_convertTimeStringToSeconds,
18
19
  utils_time_getCurrentTimeString
19
- } from "../chunk-AQ2ORDKJ.mjs";
20
+ } from "../chunk-PI7ZROBI.mjs";
20
21
  import {
21
22
  utils_pdf_download
22
23
  } from "../chunk-5U2JSHSJ.mjs";
@@ -38,6 +39,7 @@ export {
38
39
  utils_date_getHHmm,
39
40
  utils_excel_download,
40
41
  utils_excel_exportExcel,
42
+ utils_file_AQDocumentTypeToFile,
41
43
  utils_file_docxtemplaterDownload,
42
44
  utils_file_fileToAQDocumentType,
43
45
  utils_notification_show,
@@ -22,10 +22,15 @@ interface IAQFileDetail {
22
22
  fileBase64String?: string;
23
23
  }
24
24
  declare function utils_file_fileToAQDocumentType(file: File): Promise<IAQFileDetail>;
25
+ declare function utils_file_AQDocumentTypeToFile({ data, filePath, fileName }: {
26
+ data: any;
27
+ filePath: string;
28
+ fileName?: string;
29
+ }): Promise<IAQFileDetail>;
25
30
  declare function utils_file_docxtemplaterDownload({ data, filePath, fileName }: {
26
31
  data: any;
27
32
  filePath: string;
28
33
  fileName?: string;
29
34
  }): Promise<void>;
30
35
 
31
- export { type IUtils_Excel_ColumnConfig as I, type IAQFileDetail as a, utils_excel_download as b, utils_file_fileToAQDocumentType as c, utils_file_docxtemplaterDownload as d, utils_excel_exportExcel as u };
36
+ export { type IUtils_Excel_ColumnConfig as I, type IAQFileDetail as a, utils_excel_download as b, utils_file_fileToAQDocumentType as c, utils_file_AQDocumentTypeToFile as d, utils_file_docxtemplaterDownload as e, utils_excel_exportExcel as u };
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "types": "./dist/hooks/index.d.mts"
23
23
  }
24
24
  },
25
- "version": "0.1.231",
25
+ "version": "0.1.233",
26
26
  "private": false,
27
27
  "files": [
28
28
  "dist"