@mythpe/quasar-ui-qui 0.4.72 → 0.4.73
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.
package/package.json
CHANGED
|
@@ -110,6 +110,7 @@ type Props = {
|
|
|
110
110
|
wrapCells?: MDatatableProps['wrapCells'];
|
|
111
111
|
tooSmall?: MDatatableProps['tooSmall'];
|
|
112
112
|
color?: MDatatableProps['color'];
|
|
113
|
+
transformer?: MDatatableProps['transformer'];
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -195,7 +196,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
195
196
|
noExampleBtn: undefined,
|
|
196
197
|
wrapCells: undefined,
|
|
197
198
|
tooSmall: undefined,
|
|
198
|
-
color: 'primary'
|
|
199
|
+
color: 'primary',
|
|
200
|
+
transformer: undefined
|
|
199
201
|
})
|
|
200
202
|
|
|
201
203
|
interface Emits {
|
|
@@ -401,9 +403,12 @@ const onSuccess: SubmissionHandler = async (form) => {
|
|
|
401
403
|
requestWith: getRequestWith(isUpdateMode.value ? 'withUpdate' : 'withStore') || undefined
|
|
402
404
|
}
|
|
403
405
|
}
|
|
404
|
-
|
|
405
|
-
form
|
|
406
|
-
|
|
406
|
+
if (props.transformer) {
|
|
407
|
+
form = props.transformer(form)
|
|
408
|
+
}
|
|
409
|
+
const method = async () => isUpdateMode.value
|
|
410
|
+
? await apiServices.update(dialogItem.value?.id || '', form, _conf)
|
|
411
|
+
: await apiServices.store(form, _conf)
|
|
407
412
|
try {
|
|
408
413
|
const response: ApiInterface = await method()
|
|
409
414
|
const { _message, _success, _data } = response
|
|
@@ -381,6 +381,10 @@ export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = O
|
|
|
381
381
|
* too small a screen size in px.
|
|
382
382
|
*/
|
|
383
383
|
tooSmall?: number;
|
|
384
|
+
/**
|
|
385
|
+
* transformer for form data
|
|
386
|
+
*/
|
|
387
|
+
transformer?: (formData: any) => any;
|
|
384
388
|
}
|
|
385
389
|
|
|
386
390
|
export interface MDtAvatarProps extends QAvatarProps {
|