aq-fe-framework 0.1.400 → 0.1.402

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.
@@ -212,6 +212,8 @@ function MyButtonCreateUpdate({
212
212
  onSubmit,
213
213
  onSuccess,
214
214
  onError,
215
+ ignoreDefaultOnError,
216
+ ignoreDefaultOnSuccess,
215
217
  closeModalWhenSubmit = true,
216
218
  resetFormWhenSubmit = true,
217
219
  children,
@@ -241,23 +243,23 @@ function MyButtonCreateUpdate({
241
243
  }
242
244
  return result;
243
245
  },
244
- options: __spreadValues(__spreadValues({
245
- onSuccess: () => {
246
- queryClient.invalidateQueries();
247
- utils_notification_show({ crudType: isUpdate ? "update" : "create" });
248
- disclosure[1].close();
249
- if (closeModalWhenSubmit) disclosure[1].close();
250
- if (resetFormWhenSubmit) form.reset();
251
- }
252
- }, onSuccess && {
253
- onSuccess: () => {
254
- onSuccess();
255
- }
256
- }), onError && {
257
- onError: () => {
258
- onError();
246
+ options: {
247
+ onSuccess: (...args) => {
248
+ if (!ignoreDefaultOnSuccess) {
249
+ queryClient.invalidateQueries();
250
+ utils_notification_show({ crudType: isUpdate ? "update" : "create" });
251
+ if (closeModalWhenSubmit) disclosure[1].close();
252
+ if (resetFormWhenSubmit) form.reset();
253
+ }
254
+ onSuccess == null ? void 0 : onSuccess(...args);
255
+ },
256
+ onError: (...args) => {
257
+ if (!ignoreDefaultOnError) {
258
+ utils_notification_show({ message: "L\u1ED7i khi l\u01B0u d\u1EEF li\u1EC7u", color: "error" });
259
+ }
260
+ onError == null ? void 0 : onError(...args);
259
261
  }
260
- })
262
+ }
261
263
  });
262
264
  return /* @__PURE__ */ jsxs(Fragment, { children: [
263
265
  isUpdate == true ? /* @__PURE__ */ jsx4(
@@ -29,15 +29,17 @@ interface CoreButtonCreateUpdateProps<IReq, IRes> {
29
29
  scrollAreaAutosizeProps?: ScrollAreaAutosizeProps;
30
30
  isUpdate?: boolean;
31
31
  onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | void;
32
- onSuccess?: () => void;
33
- onError?: () => void;
32
+ onSuccess?: (...args: any[]) => void;
33
+ onError?: (...args: any[]) => void;
34
+ ignoreDefaultOnSuccess?: boolean;
35
+ ignoreDefaultOnError?: boolean;
34
36
  form: UseFormReturnType<IReq>;
35
37
  closeModalWhenSubmit?: boolean;
36
38
  resetFormWhenSubmit?: boolean;
37
39
  disclosure?: ReturnType<typeof useDisclosure>;
38
40
  children?: ReactNode;
39
41
  }
40
- declare function MyButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, buttonProps, form, onSubmit, onSuccess, onError, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isUpdate, scrollAreaAutosizeProps }: CoreButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
42
+ declare function MyButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, buttonProps, form, onSubmit, onSuccess, onError, ignoreDefaultOnError, ignoreDefaultOnSuccess, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isUpdate, scrollAreaAutosizeProps }: CoreButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
41
43
 
42
44
  interface CoreButtonModalProps {
43
45
  children?: ReactNode;
@@ -13,7 +13,7 @@ import {
13
13
  MyStatsCard,
14
14
  MyTextInput,
15
15
  MyWeeklySessionSchedulerPicker
16
- } from "../chunk-NCNHWCYV.mjs";
16
+ } from "../chunk-PQ3X2HRM.mjs";
17
17
  import "../chunk-GEYCGM75.mjs";
18
18
  import "../chunk-7ORPZMGL.mjs";
19
19
  import "../chunk-K6S7R6LU.mjs";
@@ -45,7 +45,7 @@ import {
45
45
  MyButton as MyButton2,
46
46
  MyDataTableSelectOne,
47
47
  MyTextInput as MyTextInput2
48
- } from "../chunk-NCNHWCYV.mjs";
48
+ } from "../chunk-PQ3X2HRM.mjs";
49
49
  import {
50
50
  MyDataTable,
51
51
  MyFlexColumn,
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/columns/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.1.400",
45
+ "version": "0.1.402",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"