aq-fe-framework 0.1.532 → 0.1.534
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.
@@ -216,7 +216,8 @@ function MyButtonCreateUpdate({
|
|
216
216
|
children,
|
217
217
|
disclosure: externalDisclosure,
|
218
218
|
isUpdate = false,
|
219
|
-
scrollAreaAutosizeProps
|
219
|
+
scrollAreaAutosizeProps,
|
220
|
+
formId
|
220
221
|
}) {
|
221
222
|
const theme = useMantineColorScheme3();
|
222
223
|
const defaultDisclosure = useDisclosure();
|
@@ -229,8 +230,6 @@ function MyButtonCreateUpdate({
|
|
229
230
|
options: {
|
230
231
|
onSuccess: (...args) => {
|
231
232
|
if (!ignoreDefaultOnSuccess) {
|
232
|
-
queryClient.invalidateQueries();
|
233
|
-
utils_notification_show({ crudType: isUpdate ? "update" : "create" });
|
234
233
|
if (closeModalWhenSubmit) disclosure[1].close();
|
235
234
|
if (resetFormWhenSubmit) form.reset();
|
236
235
|
}
|
@@ -277,6 +276,7 @@ function MyButtonCreateUpdate({
|
|
277
276
|
children: /* @__PURE__ */ jsxs(
|
278
277
|
"form",
|
279
278
|
{
|
279
|
+
id: formId,
|
280
280
|
onSubmit: form.onSubmit((values) => {
|
281
281
|
const result = onSubmit(values);
|
282
282
|
let axiosPromise;
|
@@ -293,8 +293,9 @@ function MyButtonCreateUpdate({
|
|
293
293
|
headers: {},
|
294
294
|
config: {}
|
295
295
|
});
|
296
|
+
} else {
|
297
|
+
axiosPromise = result;
|
296
298
|
}
|
297
|
-
axiosPromise = result;
|
298
299
|
mutation.mutate(axiosPromise);
|
299
300
|
}),
|
300
301
|
children: [
|
@@ -307,7 +308,7 @@ function MyButtonCreateUpdate({
|
|
307
308
|
})
|
308
309
|
),
|
309
310
|
/* @__PURE__ */ jsx4(Space, {}),
|
310
|
-
/* @__PURE__ */ jsx4(MyButton, { fullWidth: true, actionType: "save" })
|
311
|
+
/* @__PURE__ */ jsx4(MyButton, { form: formId, fullWidth: true, actionType: "save" })
|
311
312
|
]
|
312
313
|
}
|
313
314
|
)
|
package/dist/core/index.d.mts
CHANGED
@@ -41,8 +41,9 @@ interface CoreButtonCreateUpdateProps<IReq, IRes> {
|
|
41
41
|
resetFormWhenSubmit?: boolean;
|
42
42
|
disclosure?: ReturnType<typeof useDisclosure>;
|
43
43
|
children?: ReactNode;
|
44
|
+
formId?: string;
|
44
45
|
}
|
45
|
-
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;
|
46
|
+
declare function MyButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, buttonProps, form, onSubmit, onSuccess, onError, ignoreDefaultOnError, ignoreDefaultOnSuccess, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isUpdate, scrollAreaAutosizeProps, formId }: CoreButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
|
46
47
|
|
47
48
|
interface IFieldStructure {
|
48
49
|
fieldCode?: string;
|
package/dist/core/index.mjs
CHANGED