aq-fe-framework 0.1.976 → 0.1.977

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.
@@ -2,12 +2,6 @@ import {
2
2
  useStore_Permission,
3
3
  useStore_ProjectInfo
4
4
  } from "./chunk-BJAYNNOF.mjs";
5
- import {
6
- utils_date,
7
- utils_excel,
8
- utils_file,
9
- utils_mantineReactTable
10
- } from "./chunk-PBI7RFUT.mjs";
11
5
  import {
12
6
  utils_aq_mapBaseEntityToDomain,
13
7
  utils_aq_mapDomainToEntity,
@@ -22,6 +16,12 @@ import {
22
16
  utils_notification_show,
23
17
  utils_pdf_download
24
18
  } from "./chunk-KGBXMHKR.mjs";
19
+ import {
20
+ utils_date,
21
+ utils_excel,
22
+ utils_file,
23
+ utils_mantineReactTable
24
+ } from "./chunk-XAQLBGVI.mjs";
25
25
  import {
26
26
  createGenericStore2 as createGenericStore
27
27
  } from "./chunk-YGWSHSTG.mjs";
@@ -80,7 +80,7 @@ function CustomSwitchTheme() {
80
80
  }
81
81
 
82
82
  // src/core/button/MyButtonCreateUpdate.tsx
83
- import { Modal, ScrollArea, Space, Tooltip, useMantineColorScheme as useMantineColorScheme4 } from "@mantine/core";
83
+ import { Modal, ScrollArea, Space, Tooltip as Tooltip2, useMantineColorScheme as useMantineColorScheme4 } from "@mantine/core";
84
84
  import { useDisclosure } from "@mantine/hooks";
85
85
  import { notifications } from "@mantine/notifications";
86
86
 
@@ -93,7 +93,7 @@ function MyFlexColumn(_a) {
93
93
  }
94
94
 
95
95
  // src/core/button/MyActionIcon/MyActionIcon.tsx
96
- import { ActionIcon as ActionIcon2, useMantineColorScheme as useMantineColorScheme2 } from "@mantine/core";
96
+ import { ActionIcon as ActionIcon2, Tooltip, useMantineColorScheme as useMantineColorScheme2 } from "@mantine/core";
97
97
  import {
98
98
  IconBook,
99
99
  IconChecklist,
@@ -183,7 +183,8 @@ var getActionConfig = (colorScheme) => ({
183
183
  },
184
184
  validate: {
185
185
  color: "orange",
186
- children: /* @__PURE__ */ jsx3(IconChecklist, {})
186
+ children: /* @__PURE__ */ jsx3(IconChecklist, {}),
187
+ tooltipLabel: "Ki\u1EC3m tra"
187
188
  }
188
189
  });
189
190
  function MyActionIcon(_a) {
@@ -199,14 +200,8 @@ function MyActionIcon(_a) {
199
200
  return false;
200
201
  return actionType2 === "create" && permissionStore.state.currentPermissionPage.isCreate === false || actionType2 === "update" && permissionStore.state.currentPermissionPage.isUpdate === false || actionType2 === "delete" && permissionStore.state.currentPermissionPage.isDelete === false || actionType2 === "print" && permissionStore.state.currentPermissionPage.isPrint === false || actionType2 === "export" && permissionStore.state.currentPermissionPage.isExport === false;
201
202
  })();
202
- return /* @__PURE__ */ jsx3(
203
- ActionIcon2,
204
- __spreadProps(__spreadValues(__spreadValues({
205
- hidden: shouldHide
206
- }, config4), rest), {
207
- children: children || config4.children
208
- })
209
- );
203
+ const actionIcon = /* @__PURE__ */ jsx3(ActionIcon2, __spreadProps(__spreadValues(__spreadValues({ hidden: shouldHide }, config4), rest), { children: children || config4.children }));
204
+ return config4.tooltipLabel ? /* @__PURE__ */ jsx3(Tooltip, { label: config4.tooltipLabel, children: actionIcon }) : actionIcon;
210
205
  }
211
206
 
212
207
  // src/core/button/MyButton/MyButton.tsx
@@ -390,7 +385,7 @@ function MyButtonCreateUpdate({
390
385
  }, useMyReactMutationProps == null ? void 0 : useMyReactMutationProps.options)
391
386
  }));
392
387
  return /* @__PURE__ */ jsxs(Fragment, { children: [
393
- isUpdate == true ? /* @__PURE__ */ jsx5(Tooltip, __spreadProps(__spreadValues({ label: toolTipProps == null ? void 0 : toolTipProps.label, hidden: !(toolTipProps == null ? void 0 : toolTipProps.label) }, toolTipProps), { children: /* @__PURE__ */ jsx5(
388
+ isUpdate == true ? /* @__PURE__ */ jsx5(Tooltip2, __spreadProps(__spreadValues({ label: toolTipProps == null ? void 0 : toolTipProps.label, hidden: !(toolTipProps == null ? void 0 : toolTipProps.label) }, toolTipProps), { children: /* @__PURE__ */ jsx5(
394
389
  MyActionIcon,
395
390
  __spreadValues({
396
391
  actionType: "update",
@@ -474,7 +469,7 @@ function MyFlexColumn2(_a) {
474
469
  }
475
470
 
476
471
  // src/core/button/MyButtonModal.tsx
477
- import { Modal as Modal2, Tooltip as Tooltip2 } from "@mantine/core";
472
+ import { Modal as Modal2, Tooltip as Tooltip3 } from "@mantine/core";
478
473
  import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
479
474
  function MyButtonModal({
480
475
  disclosure,
@@ -495,7 +490,7 @@ function MyButtonModal({
495
490
  disclosure == null ? void 0 : disclosure[1].open();
496
491
  };
497
492
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
498
- isActionIcon ? /* @__PURE__ */ jsx8(Tooltip2, __spreadProps(__spreadValues({ label: toolTipProps == null ? void 0 : toolTipProps.label, hidden: !(toolTipProps == null ? void 0 : toolTipProps.label) }, toolTipProps), { children: /* @__PURE__ */ jsx8(
493
+ isActionIcon ? /* @__PURE__ */ jsx8(Tooltip3, __spreadProps(__spreadValues({ label: toolTipProps == null ? void 0 : toolTipProps.label, hidden: !(toolTipProps == null ? void 0 : toolTipProps.label) }, toolTipProps), { children: /* @__PURE__ */ jsx8(
499
494
  MyActionIcon,
500
495
  __spreadProps(__spreadValues({}, actionIconProps), {
501
496
  onClick: handleClick
@@ -1218,11 +1213,11 @@ function MyActionIconUpdate(_a) {
1218
1213
  }
1219
1214
 
1220
1215
  // src/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx
1221
- import { ActionIcon as ActionIcon5, Tooltip as Tooltip3 } from "@mantine/core";
1216
+ import { ActionIcon as ActionIcon5, Tooltip as Tooltip4 } from "@mantine/core";
1222
1217
  import { IconDownload as IconDownload3 } from "@tabler/icons-react";
1223
1218
  import { jsx as jsx21 } from "react/jsx-runtime";
1224
1219
  function MyActionIconDownloadPDF({ pdfLink = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2021/07/17-bgd.signed.pdf" }) {
1225
- return /* @__PURE__ */ jsx21(Tooltip3, { label: "Nh\u1EA5p \u0111\u1EC3 t\u1EA3i xu\u1ED1ng", children: /* @__PURE__ */ jsx21(ActionIcon5, { onClick: async () => await utils_pdf_download(pdfLink), color: "red", children: /* @__PURE__ */ jsx21(IconDownload3, {}) }) });
1220
+ return /* @__PURE__ */ jsx21(Tooltip4, { label: "Nh\u1EA5p \u0111\u1EC3 t\u1EA3i xu\u1ED1ng", children: /* @__PURE__ */ jsx21(ActionIcon5, { onClick: async () => await utils_pdf_download(pdfLink), color: "red", children: /* @__PURE__ */ jsx21(IconDownload3, {}) }) });
1226
1221
  }
1227
1222
 
1228
1223
  // src/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx
@@ -1247,7 +1242,7 @@ function MyActionIconUpload() {
1247
1242
  }
1248
1243
 
1249
1244
  // src/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx
1250
- import { ActionIcon as ActionIcon7, Group as Group2, Modal as Modal4, Paper, Text as Text3, Tooltip as Tooltip4 } from "@mantine/core";
1245
+ import { ActionIcon as ActionIcon7, Group as Group2, Modal as Modal4, Paper, Text as Text3, Tooltip as Tooltip5 } from "@mantine/core";
1251
1246
  import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
1252
1247
  import { IconLivePhoto as IconLivePhoto2, IconMaximize, IconMinimize } from "@tabler/icons-react";
1253
1248
  import { useState as useState4 } from "react";
@@ -1264,7 +1259,7 @@ function MyActionIconViewPDF(_a) {
1264
1259
  const fullScreen = useState4(false);
1265
1260
  const hSize = useState4("80vh");
1266
1261
  return /* @__PURE__ */ jsxs10(Fragment7, { children: [
1267
- /* @__PURE__ */ jsx23(Tooltip4, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp", children: /* @__PURE__ */ jsx23(ActionIcon7, __spreadProps(__spreadValues({ color: "cyan", onClick: disc[1].open }, rest), { children: /* @__PURE__ */ jsx23(IconLivePhoto2, {}) })) }),
1262
+ /* @__PURE__ */ jsx23(Tooltip5, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp", children: /* @__PURE__ */ jsx23(ActionIcon7, __spreadProps(__spreadValues({ color: "cyan", onClick: disc[1].open }, rest), { children: /* @__PURE__ */ jsx23(IconLivePhoto2, {}) })) }),
1268
1263
  /* @__PURE__ */ jsx23(
1269
1264
  Modal4,
1270
1265
  {
@@ -2655,7 +2650,7 @@ import {
2655
2650
  Modal as Modal11,
2656
2651
  Paper as Paper3,
2657
2652
  Text as Text7,
2658
- Tooltip as Tooltip5
2653
+ Tooltip as Tooltip6
2659
2654
  } from "@mantine/core";
2660
2655
  import { useDisclosure as useDisclosure11 } from "@mantine/hooks";
2661
2656
  import { IconLivePhoto as IconLivePhoto3, IconMaximize as IconMaximize3, IconMinimize as IconMinimize3 } from "@tabler/icons-react";
@@ -2712,7 +2707,7 @@ function MyButtonViewPDF({
2712
2707
  }
2713
2708
  }, [opened]);
2714
2709
  return /* @__PURE__ */ jsxs24(Fragment14, { children: [
2715
- /* @__PURE__ */ jsx43(Tooltip5, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp", children: isActionIcon ? /* @__PURE__ */ jsx43(ActionIcon10, { onClick: open, children: /* @__PURE__ */ jsx43(IconLivePhoto3, {}) }) : /* @__PURE__ */ jsx43(Button12, { color: "cyan", onClick: open, leftSection: /* @__PURE__ */ jsx43(IconLivePhoto3, {}), children: label }) }),
2710
+ /* @__PURE__ */ jsx43(Tooltip6, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp", children: isActionIcon ? /* @__PURE__ */ jsx43(ActionIcon10, { onClick: open, children: /* @__PURE__ */ jsx43(IconLivePhoto3, {}) }) : /* @__PURE__ */ jsx43(Button12, { color: "cyan", onClick: open, leftSection: /* @__PURE__ */ jsx43(IconLivePhoto3, {}), children: label }) }),
2716
2711
  /* @__PURE__ */ jsx43(
2717
2712
  Modal11,
2718
2713
  {
@@ -8202,7 +8197,7 @@ import {
8202
8197
  Image as Image4,
8203
8198
  ScrollArea as ScrollArea4,
8204
8199
  Text as Text22,
8205
- Tooltip as Tooltip6
8200
+ Tooltip as Tooltip7
8206
8201
  } from "@mantine/core";
8207
8202
  import { useFavicon, useMediaQuery } from "@mantine/hooks";
8208
8203
  import {
@@ -17198,10 +17193,10 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect, i
17198
17193
  const canAccess = isDev || isAccessible || permissionStore.state.isSuperAdmin;
17199
17194
  const renderHeader = () => /* @__PURE__ */ jsx216(AppShell.Header, { children: media ? /* @__PURE__ */ jsxs125(Group33, { h: "100%", px: "md", justify: "space-between", children: [
17200
17195
  /* @__PURE__ */ jsxs125(Group33, { h: "100%", children: [
17201
- /* @__PURE__ */ jsx216(Tooltip6, { label: appShellStore.state.opened ? "\u1EA8n thanh menu" : "Hi\u1EC7n thanh menu", children: /* @__PURE__ */ jsx216(ActionIcon11, { variant: "default", size: "lg", radius: "md", onClick: appShellStore.toggle, children: appShellStore.state.opened ? /* @__PURE__ */ jsx216(IconLayoutSidebarLeftExpand, {}) : /* @__PURE__ */ jsx216(IconLayoutSidebarLeftCollapse, {}) }) }),
17202
- /* @__PURE__ */ jsx216(Tooltip6, { label: "\u0110\xF3ng t\u1EA5t c\u1EA3 menu", children: /* @__PURE__ */ jsx216(ActionIcon11, { variant: "default", size: "lg", radius: "md", onClick: appShellStore.clearGroupMenuOpenId, children: /* @__PURE__ */ jsx216(IconLibraryMinus, {}) }) })
17196
+ /* @__PURE__ */ jsx216(Tooltip7, { label: appShellStore.state.opened ? "\u1EA8n thanh menu" : "Hi\u1EC7n thanh menu", children: /* @__PURE__ */ jsx216(ActionIcon11, { variant: "default", size: "lg", radius: "md", onClick: appShellStore.toggle, children: appShellStore.state.opened ? /* @__PURE__ */ jsx216(IconLayoutSidebarLeftExpand, {}) : /* @__PURE__ */ jsx216(IconLayoutSidebarLeftCollapse, {}) }) }),
17197
+ /* @__PURE__ */ jsx216(Tooltip7, { label: "\u0110\xF3ng t\u1EA5t c\u1EA3 menu", children: /* @__PURE__ */ jsx216(ActionIcon11, { variant: "default", size: "lg", radius: "md", onClick: appShellStore.clearGroupMenuOpenId, children: /* @__PURE__ */ jsx216(IconLibraryMinus, {}) }) })
17203
17198
  ] }),
17204
- /* @__PURE__ */ jsx216(Tooltip6, { label: title || `${appShellStore.state.moduleCode} - ${appShellStore.state.moduleName}`, children: /* @__PURE__ */ jsx216(Group33, { style: { position: "absolute", left: "50%", transform: "translateX(-50%)" }, children: /* @__PURE__ */ jsx216(Text22, { c: "green", fw: "bold", size: "sm", children: title || `${appShellStore.state.moduleCode} - ${appShellStore.state.moduleName}` }) }) }),
17199
+ /* @__PURE__ */ jsx216(Tooltip7, { label: title || `${appShellStore.state.moduleCode} - ${appShellStore.state.moduleName}`, children: /* @__PURE__ */ jsx216(Group33, { style: { position: "absolute", left: "50%", transform: "translateX(-50%)" }, children: /* @__PURE__ */ jsx216(Text22, { c: "green", fw: "bold", size: "sm", children: title || `${appShellStore.state.moduleCode} - ${appShellStore.state.moduleName}` }) }) }),
17205
17200
  /* @__PURE__ */ jsxs125(Group33, { children: [
17206
17201
  extraTopRight,
17207
17202
  /* @__PURE__ */ jsx216(CustomSwitchTheme, {}),
@@ -17210,7 +17205,7 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect, i
17210
17205
  ] }) : /* @__PURE__ */ jsxs125(Group33, { h: "100%", px: "md", justify: "space-between", children: [
17211
17206
  /* @__PURE__ */ jsx216(ActionIcon11, { variant: "default", size: "lg", radius: "md", onClick: appShellStore.toggle, children: appShellStore.state.opened ? /* @__PURE__ */ jsx216(IconLayoutSidebarLeftExpand, {}) : /* @__PURE__ */ jsx216(IconLayoutSidebarLeftCollapse, {}) }),
17212
17207
  /* @__PURE__ */ jsx216(
17213
- Tooltip6,
17208
+ Tooltip7,
17214
17209
  {
17215
17210
  label: title || `${appShellStore.state.moduleCode} - ${appShellStore.state.moduleName}`,
17216
17211
  withArrow: true,
@@ -17432,7 +17427,7 @@ var service_aq = __spreadProps(__spreadValues({}, createBaseApi(CONTROLLER12, ba
17432
17427
  });
17433
17428
 
17434
17429
  // src/components/Layouts/PageContent/MyPageContent.tsx
17435
- import { Badge as Badge7, Breadcrumbs, Center as Center13, Container as Container3, Divider as Divider5, Flex as Flex10, Group as Group35, Stack as Stack11, Text as Text24, Title as Title4, Tooltip as Tooltip7 } from "@mantine/core";
17430
+ import { Badge as Badge7, Breadcrumbs, Center as Center13, Container as Container3, Divider as Divider5, Flex as Flex10, Group as Group35, Stack as Stack11, Text as Text24, Title as Title4, Tooltip as Tooltip8 } from "@mantine/core";
17436
17431
  import { useClipboard, useDisclosure as useDisclosure18 } from "@mantine/hooks";
17437
17432
  import { notifications as notifications8 } from "@mantine/notifications";
17438
17433
  import { IconBrandParsinta } from "@tabler/icons-react";
@@ -17531,7 +17526,7 @@ function MyPageContent({
17531
17526
  note: basicAppShellStore.state.note
17532
17527
  }
17533
17528
  ),
17534
- /* @__PURE__ */ jsx219(Tooltip7, { label: "Xem video h\u01B0\u1EDBng d\u1EABn", children: /* @__PURE__ */ jsx219(
17529
+ /* @__PURE__ */ jsx219(Tooltip8, { label: "Xem video h\u01B0\u1EDBng d\u1EABn", children: /* @__PURE__ */ jsx219(
17535
17530
  MyButtonModal,
17536
17531
  {
17537
17532
  isActionIcon: true,
@@ -46,52 +46,6 @@ var utils_currency = {
46
46
  }
47
47
  };
48
48
 
49
- // src/utils-v2/utils_date.ts
50
- var utils_date = {
51
- toDDMMYYYY(date) {
52
- const parsedDate = typeof date === "string" ? new Date(date) : date;
53
- if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
54
- const day = String(parsedDate.getDate()).padStart(2, "0");
55
- const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
56
- const year = parsedDate.getFullYear();
57
- return `${day}/${month}/${year}`;
58
- },
59
- toMMYYYY(date) {
60
- const parsedDate = typeof date === "string" ? new Date(date) : date;
61
- if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
62
- const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
63
- const year = parsedDate.getFullYear();
64
- return `${month}/${year}`;
65
- },
66
- toHHmm(date) {
67
- if (!(date instanceof Date) || isNaN(date.getTime())) return "";
68
- const hour = String(date.getHours()).padStart(2, "0");
69
- const minute = String(date.getMinutes()).padStart(2, "0");
70
- return `${hour}:${minute}`;
71
- },
72
- toDateTime(date, WithSeconds) {
73
- const parsedDate = typeof date === "string" ? new Date(date) : date;
74
- if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
75
- const day = String(parsedDate.getDate()).padStart(2, "0");
76
- const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
77
- const year = parsedDate.getFullYear();
78
- const hours = String(parsedDate.getHours()).padStart(2, "0");
79
- const minutes = String(parsedDate.getMinutes()).padStart(2, "0");
80
- const seconds = String(parsedDate.getSeconds()).padStart(2, "0");
81
- return `${day}/${month}/${year} - ${hours}:${minutes}${WithSeconds && `:${seconds}`}`;
82
- },
83
- toDateTimeStartEnd(startDate, endDate) {
84
- const startday = String(startDate.getDate()).padStart(2, "0");
85
- const startmonth = String(startDate.getMonth() + 1).padStart(2, "0");
86
- const startyear = startDate.getFullYear();
87
- const starthour = String(startDate.getHours()).padStart(2, "0");
88
- const startminute = String(startDate.getMinutes()).padStart(2, "0");
89
- const endhour = String(endDate.getHours()).padStart(2, "0");
90
- const endminuate = String(endDate.getMinutes()).padStart(2, "0");
91
- return `${startday}/${startmonth}/${startyear} [${starthour}:${startminute} - ${endhour}:${endminuate}]`;
92
- }
93
- };
94
-
95
49
  // src/utils-v2/utils_excel.ts
96
50
  import dayjs from "dayjs";
97
51
  import customParseFormat from "dayjs/plugin/customParseFormat";
@@ -315,15 +269,130 @@ var utils_time = {
315
269
  }
316
270
  };
317
271
 
272
+ // src/utils-v2/utils_date/demo.tsx
273
+ import { Paper } from "@mantine/core";
274
+ import { useState } from "react";
275
+
276
+ // src/utils-v2/utils_date/utils_date.ts
277
+ var utils_date = {
278
+ toDDMMYYYY(date) {
279
+ const parsedDate = typeof date === "string" ? new Date(date) : date;
280
+ if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
281
+ const day = String(parsedDate.getDate()).padStart(2, "0");
282
+ const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
283
+ const year = parsedDate.getFullYear();
284
+ return `${day}/${month}/${year}`;
285
+ },
286
+ toMMYYYY(date) {
287
+ const parsedDate = typeof date === "string" ? new Date(date) : date;
288
+ if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
289
+ const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
290
+ const year = parsedDate.getFullYear();
291
+ return `${month}/${year}`;
292
+ },
293
+ toHHmm(date) {
294
+ if (!(date instanceof Date) || isNaN(date.getTime())) return "";
295
+ const hour = String(date.getHours()).padStart(2, "0");
296
+ const minute = String(date.getMinutes()).padStart(2, "0");
297
+ return `${hour}:${minute}`;
298
+ },
299
+ toDateTime(date, WithSeconds) {
300
+ const parsedDate = typeof date === "string" ? new Date(date) : date;
301
+ if (!(parsedDate instanceof Date) || isNaN(parsedDate.getTime())) return "";
302
+ const day = String(parsedDate.getDate()).padStart(2, "0");
303
+ const month = String(parsedDate.getMonth() + 1).padStart(2, "0");
304
+ const year = parsedDate.getFullYear();
305
+ const hours = String(parsedDate.getHours()).padStart(2, "0");
306
+ const minutes = String(parsedDate.getMinutes()).padStart(2, "0");
307
+ const seconds = String(parsedDate.getSeconds()).padStart(2, "0");
308
+ return `${day}/${month}/${year} - ${hours}:${minutes}${WithSeconds && `:${seconds}`}`;
309
+ },
310
+ toDateTimeStartEnd(startDate, endDate) {
311
+ const startday = String(startDate.getDate()).padStart(2, "0");
312
+ const startmonth = String(startDate.getMonth() + 1).padStart(2, "0");
313
+ const startyear = startDate.getFullYear();
314
+ const starthour = String(startDate.getHours()).padStart(2, "0");
315
+ const startminute = String(startDate.getMinutes()).padStart(2, "0");
316
+ const endhour = String(endDate.getHours()).padStart(2, "0");
317
+ const endminuate = String(endDate.getMinutes()).padStart(2, "0");
318
+ return `${startday}/${startmonth}/${startyear} [${starthour}:${startminute} - ${endhour}:${endminuate}]`;
319
+ }
320
+ };
321
+
322
+ // src/utils-v2/utils_date/demo.tsx
323
+ import { jsx, jsxs } from "react/jsx-runtime";
324
+ var demo = () => {
325
+ const [input, setInput] = useState((/* @__PURE__ */ new Date()).toISOString());
326
+ const parsedDate = new Date(input);
327
+ return /* @__PURE__ */ jsxs(Paper, { style: { padding: 16, fontFamily: "monospace", maxWidth: 500 }, children: [
328
+ /* @__PURE__ */ jsxs("label", { style: { display: "block", marginBottom: 8 }, children: [
329
+ "Nh\u1EADp ng\xE0y (ISO string ho\u1EB7c yyyy-mm-dd):",
330
+ " "
331
+ ] }),
332
+ /* @__PURE__ */ jsx(
333
+ "input",
334
+ {
335
+ type: "text",
336
+ value: input,
337
+ onChange: (e) => setInput(e.target.value),
338
+ style: {
339
+ width: "100%",
340
+ padding: 8,
341
+ marginBottom: 16,
342
+ border: "1px solid #ccc",
343
+ borderRadius: 4
344
+ }
345
+ }
346
+ ),
347
+ isNaN(parsedDate.getTime()) ? /* @__PURE__ */ jsx("p", { style: { color: "red" }, children: "\u274C Ng\xE0y kh\xF4ng h\u1EE3p l\u1EC7" }) : /* @__PURE__ */ jsxs("div", { children: [
348
+ /* @__PURE__ */ jsxs("p", { children: [
349
+ /* @__PURE__ */ jsx("strong", { children: "Input Date:" }),
350
+ " ",
351
+ parsedDate.toString()
352
+ ] }),
353
+ /* @__PURE__ */ jsxs("p", { children: [
354
+ /* @__PURE__ */ jsx("strong", { children: "toDDMMYYYY:" }),
355
+ " ",
356
+ utils_date.toDDMMYYYY(parsedDate)
357
+ ] }),
358
+ /* @__PURE__ */ jsxs("p", { children: [
359
+ /* @__PURE__ */ jsx("strong", { children: "toMMYYYY:" }),
360
+ " ",
361
+ utils_date.toMMYYYY(parsedDate)
362
+ ] }),
363
+ /* @__PURE__ */ jsxs("p", { children: [
364
+ /* @__PURE__ */ jsx("strong", { children: "toHHmm:" }),
365
+ " ",
366
+ utils_date.toHHmm(parsedDate)
367
+ ] }),
368
+ /* @__PURE__ */ jsxs("p", { children: [
369
+ /* @__PURE__ */ jsx("strong", { children: "toDateTime:" }),
370
+ " ",
371
+ utils_date.toDateTime(parsedDate, true)
372
+ ] }),
373
+ /* @__PURE__ */ jsxs("p", { children: [
374
+ /* @__PURE__ */ jsx("strong", { children: "toDateTimeStartEnd:" }),
375
+ " ",
376
+ utils_date.toDateTimeStartEnd(
377
+ parsedDate,
378
+ new Date(parsedDate.getTime() + 2 * 60 * 60 * 1e3)
379
+ // cộng thêm 2h
380
+ )
381
+ ] })
382
+ ] })
383
+ ] });
384
+ };
385
+
318
386
  export {
319
387
  utils_file,
320
388
  utils_build,
321
389
  utils_converter,
322
390
  utils_currency,
323
- utils_date,
324
391
  utils_excel,
325
392
  normalizeDate,
326
393
  utils_mantineReactTable,
327
394
  utils_text,
328
- utils_time
395
+ utils_time,
396
+ utils_date,
397
+ demo
329
398
  };
@@ -68,10 +68,10 @@ import {
68
68
  useHeaderMegaMenuStore,
69
69
  useS_ButtonImport,
70
70
  useStore_BasicAppShell
71
- } from "../chunk-2ZDGJ3SE.mjs";
71
+ } from "../chunk-Q3M6GQ26.mjs";
72
72
  import "../chunk-BJAYNNOF.mjs";
73
- import "../chunk-PBI7RFUT.mjs";
74
73
  import "../chunk-KGBXMHKR.mjs";
74
+ import "../chunk-XAQLBGVI.mjs";
75
75
  import "../chunk-YGWSHSTG.mjs";
76
76
  import "../chunk-SPG47QW7.mjs";
77
77
  import "../chunk-K6S7R6LU.mjs";
@@ -31,10 +31,10 @@ import {
31
31
  MyStatsCard,
32
32
  MyTextInput2 as MyTextInput,
33
33
  MyWeeklySessionSchedulerPicker
34
- } from "../chunk-2ZDGJ3SE.mjs";
34
+ } from "../chunk-Q3M6GQ26.mjs";
35
35
  import "../chunk-BJAYNNOF.mjs";
36
- import "../chunk-PBI7RFUT.mjs";
37
36
  import "../chunk-KGBXMHKR.mjs";
37
+ import "../chunk-XAQLBGVI.mjs";
38
38
  import "../chunk-YGWSHSTG.mjs";
39
39
  import "../chunk-SPG47QW7.mjs";
40
40
  import "../chunk-K6S7R6LU.mjs";
@@ -102,10 +102,10 @@ import {
102
102
  MailTemplateDeleteButton,
103
103
  useS_moduleConfig,
104
104
  useStore_Authenticate
105
- } from "../chunk-2ZDGJ3SE.mjs";
105
+ } from "../chunk-Q3M6GQ26.mjs";
106
106
  import "../chunk-BJAYNNOF.mjs";
107
- import "../chunk-PBI7RFUT.mjs";
108
107
  import "../chunk-KGBXMHKR.mjs";
108
+ import "../chunk-XAQLBGVI.mjs";
109
109
  import "../chunk-YGWSHSTG.mjs";
110
110
  import "../chunk-SPG47QW7.mjs";
111
111
  import "../chunk-K6S7R6LU.mjs";
@@ -4,12 +4,12 @@ import {
4
4
  } from "../chunk-RGUQWALX.mjs";
5
5
  import {
6
6
  MySelect
7
- } from "../chunk-2ZDGJ3SE.mjs";
7
+ } from "../chunk-Q3M6GQ26.mjs";
8
8
  import "../chunk-BJAYNNOF.mjs";
9
+ import "../chunk-KGBXMHKR.mjs";
9
10
  import {
10
11
  utils_converter
11
- } from "../chunk-PBI7RFUT.mjs";
12
- import "../chunk-KGBXMHKR.mjs";
12
+ } from "../chunk-XAQLBGVI.mjs";
13
13
  import "../chunk-YGWSHSTG.mjs";
14
14
  import "../chunk-SPG47QW7.mjs";
15
15
  import "../chunk-K6S7R6LU.mjs";
@@ -1,6 +1,7 @@
1
1
  import { ComboboxData } from '@mantine/core';
2
2
  import { Workbook } from 'exceljs';
3
3
  import { MRT_RowData, MRT_ColumnDef } from 'mantine-react-table';
4
+ import react__default from 'react';
4
5
 
5
6
  declare const utils_build: {
6
7
  createEnumKeyMap<T extends Record<string, number | string>>(enumObj: T): Record<Extract<T[keyof T], number>, keyof T>;
@@ -20,14 +21,6 @@ declare const utils_currency: {
20
21
  formatWithSuffix(amount?: number, suffix?: string): string;
21
22
  };
22
23
 
23
- declare const utils_date: {
24
- toDDMMYYYY(date?: Date | string): string;
25
- toMMYYYY(date?: Date | string): string;
26
- toHHmm(date: Date): string;
27
- toDateTime(date?: Date | string, WithSeconds?: boolean): string;
28
- toDateTimeStartEnd(startDate: Date, endDate: Date): string;
29
- };
30
-
31
24
  interface IExcelColumnConfig<T> {
32
25
  fieldKey: keyof T | (string & {});
33
26
  fieldName: string;
@@ -71,4 +64,14 @@ declare const utils_time: {
71
64
  getCurrentTime(): string;
72
65
  };
73
66
 
74
- export { type IExcelColumnConfig, normalizeDate, utils_build, utils_converter, utils_currency, utils_date, utils_excel, utils_file, utils_mantineReactTable, utils_text, utils_time };
67
+ declare const demo: react__default.FC;
68
+
69
+ declare const utils_date: {
70
+ toDDMMYYYY(date?: Date | string): string;
71
+ toMMYYYY(date?: Date | string): string;
72
+ toHHmm(date: Date): string;
73
+ toDateTime(date?: Date | string, WithSeconds?: boolean): string;
74
+ toDateTimeStartEnd(startDate: Date, endDate: Date): string;
75
+ };
76
+
77
+ export { type IExcelColumnConfig, demo, normalizeDate, utils_build, utils_converter, utils_currency, utils_date, utils_excel, utils_file, utils_mantineReactTable, utils_text, utils_time };
@@ -1,4 +1,5 @@
1
1
  import {
2
+ demo,
2
3
  normalizeDate,
3
4
  utils_build,
4
5
  utils_converter,
@@ -9,9 +10,10 @@ import {
9
10
  utils_mantineReactTable,
10
11
  utils_text,
11
12
  utils_time
12
- } from "../chunk-PBI7RFUT.mjs";
13
+ } from "../chunk-XAQLBGVI.mjs";
13
14
  import "../chunk-JD6AELXS.mjs";
14
15
  export {
16
+ demo,
15
17
  normalizeDate,
16
18
  utils_build,
17
19
  utils_converter,
package/package.json CHANGED
@@ -54,7 +54,7 @@
54
54
  "types": "./dist/build-object/index.d.mts"
55
55
  }
56
56
  },
57
- "version": "0.1.976",
57
+ "version": "0.1.977",
58
58
  "private": false,
59
59
  "files": [
60
60
  "dist"