aq-fe-framework 0.1.280 → 0.1.281

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,9 +1,9 @@
1
- import {
2
- enum_daysOfWeek
3
- } from "./chunk-K6S7R6LU.mjs";
4
1
  import {
5
2
  const_object_colors
6
3
  } from "./chunk-NWBLJ3W3.mjs";
4
+ import {
5
+ enum_daysOfWeek
6
+ } from "./chunk-K6S7R6LU.mjs";
7
7
  import {
8
8
  baseAxios_default,
9
9
  useMyReactMutation,
@@ -1196,10 +1196,89 @@ function AQButtonExportData({
1196
1196
  );
1197
1197
  }
1198
1198
 
1199
- // src/components/Buttons/ButtonCRUD/MyButtonCreate.tsx
1199
+ // src/components/Buttons/ButtonCRUD/CoreButtonCreateUpdate.tsx
1200
1200
  import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
1201
1201
  import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
1202
- import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
1202
+ import { ActionIcon as ActionIcon10, Button as Button7, Modal as Modal6 } from "@mantine/core";
1203
+ import { IconEdit as IconEdit7, IconPlus as IconPlus7 } from "@tabler/icons-react";
1204
+ import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
1205
+ function CoreButtonCreateUpdate({
1206
+ modalProps,
1207
+ actionIconProps,
1208
+ buttonProps,
1209
+ form,
1210
+ onSubmit,
1211
+ onSuccess,
1212
+ onError,
1213
+ closeModalWhenSubmit = true,
1214
+ resetFormWhenSubmit = true,
1215
+ children,
1216
+ disclosure: externalDisclosure,
1217
+ isCreate = true
1218
+ }) {
1219
+ const defaultDisclosure = useDisclosure7();
1220
+ const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
1221
+ const queryClient = useQueryClient4();
1222
+ const mutation = useMyReactMutation({
1223
+ axiosFn: (values) => onSubmit(values),
1224
+ options: __spreadValues(__spreadValues({
1225
+ onSuccess: () => {
1226
+ queryClient.invalidateQueries();
1227
+ utils_notification_show({ crudType: "create" });
1228
+ disclosure[1].close();
1229
+ if (closeModalWhenSubmit) disclosure[1].close();
1230
+ if (resetFormWhenSubmit) form.reset();
1231
+ }
1232
+ }, onSuccess && {
1233
+ onSuccess: () => {
1234
+ onSuccess();
1235
+ }
1236
+ }), onError && {
1237
+ onError: () => {
1238
+ onError();
1239
+ }
1240
+ })
1241
+ });
1242
+ return /* @__PURE__ */ jsxs11(Fragment7, { children: [
1243
+ isCreate ? /* @__PURE__ */ jsx23(
1244
+ Button7,
1245
+ __spreadProps(__spreadValues({
1246
+ onClick: disclosure[1].open,
1247
+ leftSection: /* @__PURE__ */ jsx23(IconPlus7, {})
1248
+ }, buttonProps), {
1249
+ children: "Th\xEAm"
1250
+ })
1251
+ ) : /* @__PURE__ */ jsx23(
1252
+ ActionIcon10,
1253
+ __spreadProps(__spreadValues({
1254
+ color: "yellow",
1255
+ onClick: disclosure[1].open
1256
+ }, actionIconProps), {
1257
+ children: /* @__PURE__ */ jsx23(IconEdit7, {})
1258
+ })
1259
+ ),
1260
+ /* @__PURE__ */ jsx23(
1261
+ Modal6,
1262
+ __spreadProps(__spreadValues({
1263
+ title: isCreate ? "Th\xEAm d\u1EEF li\u1EC7u" : "S\u1EEDa d\u1EEF li\u1EC7u",
1264
+ opened: disclosure[0],
1265
+ onClose: disclosure[1].close
1266
+ }, modalProps), {
1267
+ children: /* @__PURE__ */ jsx23("form", { onSubmit: form.onSubmit((values) => {
1268
+ mutation.mutate(values);
1269
+ }), children: /* @__PURE__ */ jsxs11(MyFlexColumn, { children: [
1270
+ children,
1271
+ /* @__PURE__ */ jsx23(Button7, { children: "L\u01B0u" })
1272
+ ] }) })
1273
+ })
1274
+ )
1275
+ ] });
1276
+ }
1277
+
1278
+ // src/components/Buttons/ButtonCRUD/MyButtonCreate.tsx
1279
+ import { useDisclosure as useDisclosure8 } from "@mantine/hooks";
1280
+ import { useQueryClient as useQueryClient5 } from "@tanstack/react-query";
1281
+ import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
1203
1282
  function MyButtonCreate(_a) {
1204
1283
  var _b = _a, {
1205
1284
  form,
@@ -1220,9 +1299,9 @@ function MyButtonCreate(_a) {
1220
1299
  "children",
1221
1300
  "disclosure"
1222
1301
  ]);
1223
- const defaultDisclosure = useDisclosure7();
1302
+ const defaultDisclosure = useDisclosure8();
1224
1303
  const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
1225
- const queryClient = useQueryClient4();
1304
+ const queryClient = useQueryClient5();
1226
1305
  const mutation = useMyReactMutation({
1227
1306
  axiosFn: (values) => {
1228
1307
  const result = onSubmit(values);
@@ -1263,93 +1342,14 @@ function MyButtonCreate(_a) {
1263
1342
  }
1264
1343
  })
1265
1344
  });
1266
- return /* @__PURE__ */ jsx23(MyButtonModal, __spreadProps(__spreadValues({ disclosure, crudType: "create" }, rest), { children: /* @__PURE__ */ jsx23("form", { onSubmit: form.onSubmit((values) => {
1345
+ return /* @__PURE__ */ jsx24(MyButtonModal, __spreadProps(__spreadValues({ disclosure, crudType: "create" }, rest), { children: /* @__PURE__ */ jsx24("form", { onSubmit: form.onSubmit((values) => {
1267
1346
  mutation.mutate(values);
1268
- }), children: /* @__PURE__ */ jsxs11(MyFlexColumn, { children: [
1347
+ }), children: /* @__PURE__ */ jsxs12(MyFlexColumn, { children: [
1269
1348
  children,
1270
- /* @__PURE__ */ jsx23(MyButton, { type: "submit", crudType: "save" })
1349
+ /* @__PURE__ */ jsx24(MyButton, { type: "submit", crudType: "save" })
1271
1350
  ] }) }) }));
1272
1351
  }
1273
1352
 
1274
- // src/components/Buttons/ButtonCRUD/MyButtonCreateUpdate.tsx
1275
- import { useDisclosure as useDisclosure8 } from "@mantine/hooks";
1276
- import { useQueryClient as useQueryClient5 } from "@tanstack/react-query";
1277
- import { ActionIcon as ActionIcon10, Button as Button7, Modal as Modal6 } from "@mantine/core";
1278
- import { IconEdit as IconEdit7, IconPlus as IconPlus7 } from "@tabler/icons-react";
1279
- import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
1280
- function MyButtonCreateUpdate({
1281
- modalProps,
1282
- actionIconProps,
1283
- buttonProps,
1284
- form,
1285
- onSubmit,
1286
- onSuccess,
1287
- onError,
1288
- closeModalWhenSubmit = true,
1289
- resetFormWhenSubmit = true,
1290
- children,
1291
- disclosure: externalDisclosure,
1292
- isCreate = true
1293
- }) {
1294
- const defaultDisclosure = useDisclosure8();
1295
- const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
1296
- const queryClient = useQueryClient5();
1297
- const mutation = useMyReactMutation({
1298
- axiosFn: (values) => onSubmit(values),
1299
- options: __spreadValues(__spreadValues({
1300
- onSuccess: () => {
1301
- queryClient.invalidateQueries();
1302
- utils_notification_show({ crudType: "create" });
1303
- disclosure[1].close();
1304
- if (closeModalWhenSubmit) disclosure[1].close();
1305
- if (resetFormWhenSubmit) form.reset();
1306
- }
1307
- }, onSuccess && {
1308
- onSuccess: () => {
1309
- onSuccess();
1310
- }
1311
- }), onError && {
1312
- onError: () => {
1313
- onError();
1314
- }
1315
- })
1316
- });
1317
- return /* @__PURE__ */ jsxs12(Fragment7, { children: [
1318
- isCreate ? /* @__PURE__ */ jsx24(
1319
- Button7,
1320
- __spreadProps(__spreadValues({
1321
- onClick: disclosure[1].open,
1322
- leftSection: /* @__PURE__ */ jsx24(IconPlus7, {})
1323
- }, buttonProps), {
1324
- children: "Th\xEAm"
1325
- })
1326
- ) : /* @__PURE__ */ jsx24(
1327
- ActionIcon10,
1328
- __spreadProps(__spreadValues({
1329
- color: "yellow",
1330
- onClick: disclosure[1].open
1331
- }, actionIconProps), {
1332
- children: /* @__PURE__ */ jsx24(IconEdit7, {})
1333
- })
1334
- ),
1335
- /* @__PURE__ */ jsx24(
1336
- Modal6,
1337
- __spreadProps(__spreadValues({
1338
- title: isCreate ? "Th\xEAm d\u1EEF li\u1EC7u" : "S\u1EEDa d\u1EEF li\u1EC7u",
1339
- opened: disclosure[0],
1340
- onClose: disclosure[1].close
1341
- }, modalProps), {
1342
- children: /* @__PURE__ */ jsx24("form", { onSubmit: form.onSubmit((values) => {
1343
- mutation.mutate(values);
1344
- }), children: /* @__PURE__ */ jsxs12(MyFlexColumn, { children: [
1345
- children,
1346
- /* @__PURE__ */ jsx24(Button7, { children: "L\u01B0u" })
1347
- ] }) })
1348
- })
1349
- )
1350
- ] });
1351
- }
1352
-
1353
1353
  // src/components/Buttons/ButtonCRUD/MyButtonDeleteList.tsx
1354
1354
  import { Group as Group5, Highlight as Highlight2 } from "@mantine/core";
1355
1355
  import { useDisclosure as useDisclosure9 } from "@mantine/hooks";
@@ -2043,18 +2043,12 @@ function AQSelectTableByOpenModal(_a) {
2043
2043
  // src/components/Buttons/ButtonModal/CoreButtonModal.tsx
2044
2044
  import { Button as Button13, Modal as Modal11 } from "@mantine/core";
2045
2045
  import { Fragment as Fragment11, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
2046
- function CoreButtonModal(_a) {
2047
- var _b = _a, {
2048
- disclosure,
2049
- children,
2050
- buttonProps,
2051
- modalProps
2052
- } = _b, rest = __objRest(_b, [
2053
- "disclosure",
2054
- "children",
2055
- "buttonProps",
2056
- "modalProps"
2057
- ]);
2046
+ function CoreButtonModal({
2047
+ disclosure,
2048
+ children,
2049
+ buttonProps,
2050
+ modalProps
2051
+ }) {
2058
2052
  return /* @__PURE__ */ jsxs19(Fragment11, { children: [
2059
2053
  /* @__PURE__ */ jsx33(Button13, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "indigo" }, buttonProps)),
2060
2054
  /* @__PURE__ */ jsx33(
@@ -8327,8 +8321,8 @@ export {
8327
8321
  MyButtonModal,
8328
8322
  AQButtonCreateByImportFile,
8329
8323
  AQButtonExportData,
8324
+ CoreButtonCreateUpdate,
8330
8325
  MyButtonCreate,
8331
- MyButtonCreateUpdate,
8332
8326
  MyButtonDeleteList,
8333
8327
  MySelect,
8334
8328
  MyFlexEnd,
@@ -152,18 +152,7 @@ interface AQButtonExportDataProps {
152
152
  }
153
153
  declare function AQButtonExportData({ isAllData, objectName, data, exportConfig }: AQButtonExportDataProps): react_jsx_runtime.JSX.Element;
154
154
 
155
- interface IMyButtonCreate<IReq, IRes> extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure" | "form" | "onSubmit"> {
156
- onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | void;
157
- onSuccess?: () => void;
158
- onError?: () => void;
159
- form: UseFormReturnType<IReq>;
160
- notCloseModalWhenSubmit?: boolean;
161
- notResetFormWhenSubmit?: boolean;
162
- disclosure?: ReturnType<typeof useDisclosure>;
163
- }
164
- declare function MyButtonCreate<IReq, IRes>({ form, onSubmit, onSuccess, onError, notCloseModalWhenSubmit, notResetFormWhenSubmit, children, disclosure: externalDisclosure, ...rest }: IMyButtonCreate<IReq, IRes>): react_jsx_runtime.JSX.Element;
165
-
166
- interface IMyButtonCreateUpdate<IReq, IRes> {
155
+ interface CoreButtonCreateUpdateProps<IReq, IRes> {
167
156
  modalProps?: ModalProps;
168
157
  actionIconProps?: ActionIconProps;
169
158
  buttonProps?: ButtonProps;
@@ -177,7 +166,18 @@ interface IMyButtonCreateUpdate<IReq, IRes> {
177
166
  disclosure?: ReturnType<typeof useDisclosure>;
178
167
  children?: ReactNode;
179
168
  }
180
- declare function MyButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, buttonProps, form, onSubmit, onSuccess, onError, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isCreate, }: IMyButtonCreateUpdate<IReq, IRes>): react_jsx_runtime.JSX.Element;
169
+ declare function CoreButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, buttonProps, form, onSubmit, onSuccess, onError, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isCreate, }: CoreButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
170
+
171
+ interface IMyButtonCreate<IReq, IRes> extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure" | "form" | "onSubmit"> {
172
+ onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | void;
173
+ onSuccess?: () => void;
174
+ onError?: () => void;
175
+ form: UseFormReturnType<IReq>;
176
+ notCloseModalWhenSubmit?: boolean;
177
+ notResetFormWhenSubmit?: boolean;
178
+ disclosure?: ReturnType<typeof useDisclosure>;
179
+ }
180
+ declare function MyButtonCreate<IReq, IRes>({ form, onSubmit, onSuccess, onError, notCloseModalWhenSubmit, notResetFormWhenSubmit, children, disclosure: externalDisclosure, ...rest }: IMyButtonCreate<IReq, IRes>): react_jsx_runtime.JSX.Element;
181
181
 
182
182
  interface IMyButtonDeleteList extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure"> {
183
183
  onSubmit: () => void;
@@ -251,7 +251,7 @@ interface CoreButtonModalProps {
251
251
  buttonProps?: ButtonProps;
252
252
  modalProps?: ModalProps;
253
253
  }
254
- declare function CoreButtonModal({ disclosure, children, buttonProps, modalProps, ...rest }: CoreButtonModalProps): react_jsx_runtime.JSX.Element;
254
+ declare function CoreButtonModal({ disclosure, children, buttonProps, modalProps, }: CoreButtonModalProps): react_jsx_runtime.JSX.Element;
255
255
 
256
256
  interface I$6 extends ButtonProps {
257
257
  contentToPrint?: ReactNode;
@@ -584,4 +584,4 @@ interface IMySkeletonTable extends SkeletonProps {
584
584
  }
585
585
  declare function MySkeletonTable({ h }: IMySkeletonTable): react_jsx_runtime.JSX.Element;
586
586
 
587
- export { AQButtonCreateByImportFile, AQButtonExportData, AQCard, AQSelectTableByOpenModal, AQStatCard1, Boxes, CoreActionIcon, CoreButton, CoreButtonModal, FaviconSetter, HeaderMegaMenu, type IAQCardProps, type IMyTextEditor, type IWeeklySession, I_BasicAppShell_LinkItem, MyActionIcon, MyActionIconCheck, MyActionIconDelete, MyActionIconDownloadPDF, MyActionIconModal, MyActionIconUpdate, MyActionIconUpload, MyActionIconViewPDF, MyAnchorViewPDF, MyAppSpotlight, MyBoxesBackground, MyBoxesCore, MyButton, MyButtonCreate, MyButtonCreateUpdate, MyButtonDeleteList, MyButtonImport, MyButtonModal, MyButtonPrintPDF, MyButtonPrintTablePDF, MyButtonRouterBack, MyButtonViewPDF, MyCalendar, MyCardInformation, MyCardioLoader, MyCenterFull, MyCheckbox, MyContainer, MyDataTable, type MyDataTableInternalProps, type MyDataTableProps, MyDataTableSelect, MyDateInput, MyDayOfWeekPicker, MyFieldset, MyFileInput, MyFlexColumn, MyFlexEnd, MyFlexRow, MyHtmlWrapper, MyIconText, MyKeyLabel, MyNumberFormatter, MyNumberInput, MyPageContent, MyScheduleX, MySelect, MySelectAPIGet, MySkeletonTable, MySwitchTheme, MyTab, MyTextArea, MyTextEditor, MyTextInput, MyWeeklySessionSchedulerPicker, SelectFieldModal, SelectFileModal, type SelectFileModalProps, type WeeklySessionSchedulerProps, useHeaderMegaMenuStore, useS_BasicAppShell, useS_ButtonImport };
587
+ export { AQButtonCreateByImportFile, AQButtonExportData, AQCard, AQSelectTableByOpenModal, AQStatCard1, Boxes, CoreActionIcon, CoreButton, CoreButtonCreateUpdate, CoreButtonModal, FaviconSetter, HeaderMegaMenu, type IAQCardProps, type IMyTextEditor, type IWeeklySession, I_BasicAppShell_LinkItem, MyActionIcon, MyActionIconCheck, MyActionIconDelete, MyActionIconDownloadPDF, MyActionIconModal, MyActionIconUpdate, MyActionIconUpload, MyActionIconViewPDF, MyAnchorViewPDF, MyAppSpotlight, MyBoxesBackground, MyBoxesCore, MyButton, MyButtonCreate, MyButtonDeleteList, MyButtonImport, MyButtonModal, MyButtonPrintPDF, MyButtonPrintTablePDF, MyButtonRouterBack, MyButtonViewPDF, MyCalendar, MyCardInformation, MyCardioLoader, MyCenterFull, MyCheckbox, MyContainer, MyDataTable, type MyDataTableInternalProps, type MyDataTableProps, MyDataTableSelect, MyDateInput, MyDayOfWeekPicker, MyFieldset, MyFileInput, MyFlexColumn, MyFlexEnd, MyFlexRow, MyHtmlWrapper, MyIconText, MyKeyLabel, MyNumberFormatter, MyNumberInput, MyPageContent, MyScheduleX, MySelect, MySelectAPIGet, MySkeletonTable, MySwitchTheme, MyTab, MyTextArea, MyTextEditor, MyTextInput, MyWeeklySessionSchedulerPicker, SelectFieldModal, SelectFileModal, type SelectFileModalProps, type WeeklySessionSchedulerProps, useHeaderMegaMenuStore, useS_BasicAppShell, useS_ButtonImport };
@@ -9,6 +9,7 @@ import {
9
9
  Boxes,
10
10
  CoreActionIcon,
11
11
  CoreButton,
12
+ CoreButtonCreateUpdate,
12
13
  CoreButtonModal,
13
14
  FaviconSetter,
14
15
  HeaderMegaMenu,
@@ -26,7 +27,6 @@ import {
26
27
  MyBoxesCore,
27
28
  MyButton,
28
29
  MyButtonCreate,
29
- MyButtonCreateUpdate,
30
30
  MyButtonDeleteList,
31
31
  MyButtonImport,
32
32
  MyButtonModal,
@@ -72,9 +72,9 @@ import {
72
72
  useS_BasicAppShell,
73
73
  useS_ButtonImport,
74
74
  utils_layout_getItemsWithoutLinks
75
- } from "../chunk-M72WIRIX.mjs";
76
- import "../chunk-K6S7R6LU.mjs";
75
+ } from "../chunk-6OYVVLKC.mjs";
77
76
  import "../chunk-NWBLJ3W3.mjs";
77
+ import "../chunk-K6S7R6LU.mjs";
78
78
  import "../chunk-KKJ3OEEW.mjs";
79
79
  import "../chunk-Y3YGC5IH.mjs";
80
80
  import "../chunk-5U2JSHSJ.mjs";
@@ -91,6 +91,7 @@ export {
91
91
  Boxes,
92
92
  CoreActionIcon,
93
93
  CoreButton,
94
+ CoreButtonCreateUpdate,
94
95
  CoreButtonModal,
95
96
  FaviconSetter,
96
97
  HeaderMegaMenu,
@@ -108,7 +109,6 @@ export {
108
109
  MyBoxesCore,
109
110
  MyButton,
110
111
  MyButtonCreate,
111
- MyButtonCreateUpdate,
112
112
  MyButtonDeleteList,
113
113
  MyButtonImport,
114
114
  MyButtonModal,
@@ -24,17 +24,17 @@ import {
24
24
  useS_BasicAppShell,
25
25
  useS_authenticate,
26
26
  utils_layout_getItemsWithoutLinks
27
- } from "../chunk-M72WIRIX.mjs";
28
- import {
29
- enum_emailConfigModule
30
- } from "../chunk-VH4ZAD6M.mjs";
31
- import "../chunk-K6S7R6LU.mjs";
27
+ } from "../chunk-6OYVVLKC.mjs";
32
28
  import {
33
29
  const_object_documentTypes
34
30
  } from "../chunk-GFEMKKFH.mjs";
35
31
  import {
36
32
  const_object_colors
37
33
  } from "../chunk-NWBLJ3W3.mjs";
34
+ import {
35
+ enum_emailConfigModule
36
+ } from "../chunk-VH4ZAD6M.mjs";
37
+ import "../chunk-K6S7R6LU.mjs";
38
38
  import {
39
39
  baseAxios_default,
40
40
  useQ_AQ_GetAQModule,
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "types": "./dist/enum/index.d.mts"
35
35
  }
36
36
  },
37
- "version": "0.1.280",
37
+ "version": "0.1.281",
38
38
  "private": false,
39
39
  "files": [
40
40
  "dist"