ding-react-admin 1.0.4 → 2.0.4
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/LICENSE +21 -21
- package/README.md +254 -201
- package/dist/index.css +2 -0
- package/dist/index.js +2073 -1202
- package/dist/src/components/NavMenuLabel.d.ts +8 -0
- package/dist/src/components/NavMenuLabel.d.ts.map +1 -0
- package/dist/src/components/NavMenuSearch.d.ts +9 -0
- package/dist/src/components/NavMenuSearch.d.ts.map +1 -0
- package/dist/src/components/ScrollableArea.d.ts +10 -0
- package/dist/src/components/ScrollableArea.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/context/AuthProvider.d.ts +2 -0
- package/dist/src/context/AuthProvider.d.ts.map +1 -1
- package/dist/src/crud/FormGlobalErrorsAlert.d.ts +5 -0
- package/dist/src/crud/FormGlobalErrorsAlert.d.ts.map +1 -0
- package/dist/src/crud/InlineFormSet.d.ts +2 -17
- package/dist/src/crud/InlineFormSet.d.ts.map +1 -1
- package/dist/src/crud/ResourceForm.d.ts +2 -10
- package/dist/src/crud/ResourceForm.d.ts.map +1 -1
- package/dist/src/crud/ResourceFormModal.d.ts +7 -1
- package/dist/src/crud/ResourceFormModal.d.ts.map +1 -1
- package/dist/src/crud/ResourceList.d.ts.map +1 -1
- package/dist/src/crud/ResourceRecordForm.d.ts +27 -0
- package/dist/src/crud/ResourceRecordForm.d.ts.map +1 -0
- package/dist/src/crud/columns/ImageColumn.d.ts +14 -0
- package/dist/src/crud/columns/ImageColumn.d.ts.map +1 -0
- package/dist/src/crud/context/InlineFieldsRegistry.d.ts +15 -0
- package/dist/src/crud/context/InlineFieldsRegistry.d.ts.map +1 -0
- package/dist/src/crud/context/PayloadFieldsContext.d.ts +18 -0
- package/dist/src/crud/context/PayloadFieldsContext.d.ts.map +1 -0
- package/dist/src/crud/fields/FileField.d.ts +12 -0
- package/dist/src/crud/fields/FileField.d.ts.map +1 -0
- package/dist/src/crud/fields/ImageField.d.ts +14 -0
- package/dist/src/crud/fields/ImageField.d.ts.map +1 -0
- package/dist/src/crud/fields/ReferenceField.d.ts +12 -2
- package/dist/src/crud/fields/ReferenceField.d.ts.map +1 -1
- package/dist/src/crud/fields/ReferenceInputActions.d.ts +16 -0
- package/dist/src/crud/fields/ReferenceInputActions.d.ts.map +1 -0
- package/dist/src/crud/fields/ReferenceManyField.d.ts +10 -1
- package/dist/src/crud/fields/ReferenceManyField.d.ts.map +1 -1
- package/dist/src/crud/fields/uploadFieldUtils.d.ts +5 -0
- package/dist/src/crud/fields/uploadFieldUtils.d.ts.map +1 -0
- package/dist/src/crud/fields/useUploadPreviewUrl.d.ts +4 -0
- package/dist/src/crud/fields/useUploadPreviewUrl.d.ts.map +1 -0
- package/dist/src/crud/filters/ReferenceFilter.d.ts +1 -1
- package/dist/src/crud/filters/ReferenceFilter.d.ts.map +1 -1
- package/dist/src/crud/index.d.ts +27 -9
- package/dist/src/crud/index.d.ts.map +1 -1
- package/dist/src/crud/types.d.ts +21 -7
- package/dist/src/crud/types.d.ts.map +1 -1
- package/dist/src/crud/utils/buildFormPayload.d.ts +6 -0
- package/dist/src/crud/utils/buildFormPayload.d.ts.map +1 -0
- package/dist/src/crud/utils/buildInlineRowsPayload.d.ts +6 -0
- package/dist/src/crud/utils/buildInlineRowsPayload.d.ts.map +1 -0
- package/dist/src/crud/utils/buildResourceFormSubmitBody.d.ts +5 -0
- package/dist/src/crud/utils/buildResourceFormSubmitBody.d.ts.map +1 -0
- package/dist/src/crud/utils/choiceSelectionUtils.d.ts +10 -0
- package/dist/src/crud/utils/choiceSelectionUtils.d.ts.map +1 -0
- package/dist/src/crud/utils/choiceSelectionUtils.test.d.ts +2 -0
- package/dist/src/crud/utils/choiceSelectionUtils.test.d.ts.map +1 -0
- package/dist/src/crud/utils/formErrors.d.ts +18 -7
- package/dist/src/crud/utils/formErrors.d.ts.map +1 -1
- package/dist/src/crud/utils/formErrors.test.d.ts +2 -0
- package/dist/src/crud/utils/formErrors.test.d.ts.map +1 -0
- package/dist/src/crud/utils/getFormValue.d.ts +3 -0
- package/dist/src/crud/utils/getFormValue.d.ts.map +1 -0
- package/dist/src/crud/utils/hasUploadValues.d.ts +3 -0
- package/dist/src/crud/utils/hasUploadValues.d.ts.map +1 -0
- package/dist/src/crud/utils/nestedFieldPath.d.ts +3 -0
- package/dist/src/crud/utils/nestedFieldPath.d.ts.map +1 -0
- package/dist/src/crud/utils/prepareFormSubmitBody.d.ts +8 -0
- package/dist/src/crud/utils/prepareFormSubmitBody.d.ts.map +1 -0
- package/dist/src/crud/utils/referenceSelectNotFoundContent.d.ts +4 -0
- package/dist/src/crud/utils/referenceSelectNotFoundContent.d.ts.map +1 -0
- package/dist/src/crud/utils/setFormValue.d.ts +3 -0
- package/dist/src/crud/utils/setFormValue.d.ts.map +1 -0
- package/dist/src/crud/utils/toFormData.d.ts +13 -0
- package/dist/src/crud/utils/toFormData.d.ts.map +1 -0
- package/dist/src/crud/utils/uploadReferenceUtils.d.ts +5 -0
- package/dist/src/crud/utils/uploadReferenceUtils.d.ts.map +1 -0
- package/dist/src/crud/utils/useChoices.d.ts +27 -1
- package/dist/src/crud/utils/useChoices.d.ts.map +1 -1
- package/dist/src/crud/utils/useFormRecord.d.ts +44 -0
- package/dist/src/crud/utils/useFormRecord.d.ts.map +1 -0
- package/dist/src/data/createRestResourceHandlers.d.ts +5 -5
- package/dist/src/data/createRestResourceHandlers.d.ts.map +1 -1
- package/dist/src/data/dataProviderTypes.d.ts +6 -5
- package/dist/src/data/dataProviderTypes.d.ts.map +1 -1
- package/dist/src/data/parseFormErrorHelpers.d.ts +23 -6
- package/dist/src/data/parseFormErrorHelpers.d.ts.map +1 -1
- package/dist/src/data/resourceHandlers.d.ts +1 -1
- package/dist/src/data/resourceHandlers.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/layouts/AdminLayout.d.ts +1 -1
- package/dist/src/layouts/AdminLayout.d.ts.map +1 -1
- package/dist/src/layouts/AuthPageLayout.d.ts.map +1 -1
- package/dist/src/layouts/navFilter.d.ts +5 -0
- package/dist/src/layouts/navFilter.d.ts.map +1 -0
- package/dist/src/layouts/navMenuItems.d.ts +6 -0
- package/dist/src/layouts/navMenuItems.d.ts.map +1 -0
- package/dist/src/types.d.ts +12 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +79 -59
- package/src/app/AdminApp.tsx +34 -34
- package/src/components/AuthAlternateLink.tsx +23 -23
- package/src/components/DensitySwitch.tsx +31 -31
- package/src/components/NavMenuLabel.tsx +26 -0
- package/src/components/NavMenuSearch.tsx +76 -0
- package/src/components/ScrollableArea.tsx +46 -0
- package/src/components/ThemeSwitch.tsx +28 -28
- package/src/components/ThemeToolbar.tsx +34 -34
- package/src/components/index.ts +7 -4
- package/src/components/navMenu.css +21 -0
- package/src/components/scrollable.css +28 -0
- package/src/context/AppThemeProvider.tsx +128 -128
- package/src/context/AuthProvider.tsx +89 -77
- package/src/context/DataProvider.tsx +30 -30
- package/src/context/PermissionsProvider.tsx +57 -57
- package/src/crud/FilterBar.tsx +36 -36
- package/src/crud/FormGlobalErrorsAlert.tsx +36 -0
- package/src/crud/FormSteps.tsx +135 -135
- package/src/crud/FormTabs.tsx +126 -126
- package/src/crud/InlineFormSet.tsx +162 -219
- package/src/crud/ListActionsBar.tsx +106 -106
- package/src/crud/ResourceForm.tsx +83 -166
- package/src/crud/ResourceFormModal.tsx +75 -133
- package/src/crud/ResourceList.tsx +1 -0
- package/src/crud/ResourceRecordForm.tsx +166 -0
- package/src/crud/columns/BooleanColumn.tsx +32 -32
- package/src/crud/columns/CustomColumn.tsx +33 -33
- package/src/crud/columns/DateColumn.tsx +28 -28
- package/src/crud/columns/ImageColumn.tsx +58 -0
- package/src/crud/columns/NumberColumn.tsx +31 -31
- package/src/crud/columns/ReferenceColumn.tsx +85 -85
- package/src/crud/columns/ReferenceManyColumn.tsx +67 -67
- package/src/crud/columns/TextColumn.tsx +38 -38
- package/src/crud/context/FilterContext.tsx +71 -71
- package/src/crud/context/FormContext.tsx +39 -39
- package/src/crud/context/FormSectionContext.tsx +22 -22
- package/src/crud/context/InlineFieldsRegistry.tsx +61 -0
- package/src/crud/context/ListContext.tsx +93 -93
- package/src/crud/context/PayloadFieldsContext.tsx +62 -0
- package/src/crud/fields/BooleanField.tsx +38 -38
- package/src/crud/fields/DateField.tsx +53 -53
- package/src/crud/fields/FieldWrapper.tsx +87 -87
- package/src/crud/fields/FileField.tsx +123 -0
- package/src/crud/fields/ImageField.tsx +120 -0
- package/src/crud/fields/NumberField.tsx +52 -52
- package/src/crud/fields/PasswordField.tsx +99 -99
- package/src/crud/fields/ReferenceField.tsx +237 -96
- package/src/crud/fields/ReferenceInputActions.tsx +106 -0
- package/src/crud/fields/ReferenceManyField.tsx +200 -76
- package/src/crud/fields/SelectField.tsx +48 -48
- package/src/crud/fields/TextField.tsx +46 -46
- package/src/crud/fields/uploadFieldUtils.ts +21 -0
- package/src/crud/fields/useUploadPreviewUrl.ts +20 -0
- package/src/crud/filters/BooleanFilter.tsx +38 -38
- package/src/crud/filters/DateFilter.tsx +35 -35
- package/src/crud/filters/NumberFilter.tsx +33 -33
- package/src/crud/filters/ReferenceFilter.tsx +192 -173
- package/src/crud/filters/SelectFilter.tsx +44 -44
- package/src/crud/filters/TextFilter.tsx +36 -36
- package/src/crud/index.ts +99 -90
- package/src/crud/types.ts +146 -132
- package/src/crud/utils/buildFormPayload.ts +24 -0
- package/src/crud/utils/buildInlineRowsPayload.ts +37 -0
- package/src/crud/utils/buildResourceFormSubmitBody.ts +29 -0
- package/src/crud/utils/choiceSelectionUtils.test.ts +45 -0
- package/src/crud/utils/choiceSelectionUtils.ts +116 -0
- package/src/crud/utils/formErrors.test.ts +168 -0
- package/src/crud/utils/formErrors.ts +138 -38
- package/src/crud/utils/formSectionErrors.ts +85 -85
- package/src/crud/utils/{getByPath.ts → getFormValue.ts} +13 -13
- package/src/crud/utils/hasUploadValues.ts +9 -0
- package/src/crud/utils/nestedFieldPath.ts +8 -0
- package/src/crud/utils/prepareFormSubmitBody.ts +22 -0
- package/src/crud/utils/referenceSelectNotFoundContent.tsx +7 -0
- package/src/crud/utils/{setByPath.ts → setFormValue.ts} +18 -18
- package/src/crud/utils/sortQueryParam.ts +37 -37
- package/src/crud/utils/toFormData.ts +79 -0
- package/src/crud/utils/uploadReferenceUtils.ts +44 -0
- package/src/crud/utils/useAbortableEffect.ts +17 -17
- package/src/crud/utils/useChoices.ts +330 -182
- package/src/crud/utils/useFormRecord.ts +179 -0
- package/src/crud/utils/useListQueryState.ts +191 -191
- package/src/data/abortError.test.ts +19 -19
- package/src/data/abortError.ts +10 -10
- package/src/data/createMemoryResourceHandlers.ts +78 -78
- package/src/data/createRestResourceHandlers.ts +63 -57
- package/src/data/dataProviderTypes.ts +7 -5
- package/src/data/dataUtils.test.ts +228 -108
- package/src/data/inMemoryList.ts +97 -97
- package/src/data/parseFormErrorHelpers.test.ts +201 -84
- package/src/data/parseFormErrorHelpers.ts +376 -224
- package/src/data/resourceHandlers.ts +1 -1
- package/src/data/sortHelpers.ts +48 -48
- package/src/index.ts +211 -195
- package/src/layouts/AdminLayout.tsx +530 -381
- package/src/layouts/AuthPageLayout.tsx +87 -81
- package/src/layouts/navFilter.ts +49 -0
- package/src/layouts/navMenuItems.tsx +44 -0
- package/src/pages/LoginPage.tsx +80 -80
- package/src/pages/PlaceholderPage.tsx +9 -9
- package/src/permissions/resourcePermissions.ts +47 -47
- package/src/router/createAdminRouter.tsx +64 -64
- package/src/router/guards.tsx +63 -63
- package/src/router/routeAccess.ts +89 -89
- package/src/types.ts +10 -0
- package/src/vite-env.d.ts +1 -1
- package/dist/src/crud/context/SubmitFieldsContext.d.ts +0 -18
- package/dist/src/crud/context/SubmitFieldsContext.d.ts.map +0 -1
- package/dist/src/crud/utils/getByPath.d.ts +0 -3
- package/dist/src/crud/utils/getByPath.d.ts.map +0 -1
- package/dist/src/crud/utils/inlineArrayName.d.ts +0 -3
- package/dist/src/crud/utils/inlineArrayName.d.ts.map +0 -1
- package/dist/src/crud/utils/inlineFieldName.d.ts +0 -3
- package/dist/src/crud/utils/inlineFieldName.d.ts.map +0 -1
- package/dist/src/crud/utils/pickBySources.d.ts +0 -6
- package/dist/src/crud/utils/pickBySources.d.ts.map +0 -1
- package/dist/src/crud/utils/setByPath.d.ts +0 -3
- package/dist/src/crud/utils/setByPath.d.ts.map +0 -1
- package/dist/src/crud/utils/useResourceFormData.d.ts +0 -47
- package/dist/src/crud/utils/useResourceFormData.d.ts.map +0 -1
- package/src/crud/context/SubmitFieldsContext.tsx +0 -62
- package/src/crud/utils/inlineArrayName.ts +0 -4
- package/src/crud/utils/inlineFieldName.ts +0 -8
- package/src/crud/utils/pickBySources.ts +0 -24
- package/src/crud/utils/useResourceFormData.ts +0 -231
package/dist/src/crud/types.d.ts
CHANGED
|
@@ -25,6 +25,18 @@ export type ReferenceProps = {
|
|
|
25
25
|
choices?: ChoicesLoader;
|
|
26
26
|
optionLabel?: string | ((record: Record<string, unknown>) => string);
|
|
27
27
|
optionValue?: string;
|
|
28
|
+
/** When true (default), options load on dropdown open / search instead of on mount. */
|
|
29
|
+
lazy?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Key on the loaded form record with the related object or array of objects.
|
|
32
|
+
* Use when retrieve embeds relations, e.g. `source="branch_id"` + `recordSource="branch"`.
|
|
33
|
+
*/
|
|
34
|
+
recordSource?: string;
|
|
35
|
+
/**
|
|
36
|
+
* When true (default), fetch labels for primitive ids via `getOne` if they are not
|
|
37
|
+
* already embedded in the form record. Set `false` to never call `getOne`.
|
|
38
|
+
*/
|
|
39
|
+
fetchSelected?: boolean;
|
|
28
40
|
};
|
|
29
41
|
export type DisplayProps = {
|
|
30
42
|
display?: string | ((record: Record<string, unknown>) => ReactNode);
|
|
@@ -47,17 +59,19 @@ export type FilterDefinition = {
|
|
|
47
59
|
}) => ReactNode;
|
|
48
60
|
};
|
|
49
61
|
export type InlineFormSetBaseProps = {
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
/** RHF `useFieldArray` name and default API nested key, e.g. `"lines"`. */
|
|
63
|
+
field: string;
|
|
52
64
|
label?: string;
|
|
53
|
-
|
|
65
|
+
/** API key when different from `field`. */
|
|
66
|
+
payloadKey?: string;
|
|
67
|
+
transformRows?: (rows: Record<string, unknown>[]) => unknown;
|
|
54
68
|
};
|
|
55
69
|
/** Passed to each tabular inline column's `cell` renderer. */
|
|
56
70
|
export type InlineCellContext = {
|
|
57
|
-
/** Full RHF path, e.g. `
|
|
71
|
+
/** Full RHF path, e.g. `lines.0.label`. */
|
|
58
72
|
name: string;
|
|
59
73
|
index: number;
|
|
60
|
-
|
|
74
|
+
field: string;
|
|
61
75
|
};
|
|
62
76
|
export type InlineColumnDef = {
|
|
63
77
|
source: string;
|
|
@@ -68,9 +82,9 @@ export type InlineColumnDef = {
|
|
|
68
82
|
};
|
|
69
83
|
/** Passed to `InlineFormSetStacked`'s `renderRow` for one related row. */
|
|
70
84
|
export type InlineRowContext = {
|
|
71
|
-
|
|
85
|
+
field: string;
|
|
72
86
|
index: number;
|
|
73
|
-
/** RHF path helper — `name("label")` → `
|
|
87
|
+
/** RHF path helper — `name("label")` → `field.index.label`. */
|
|
74
88
|
name: (source: string) => string;
|
|
75
89
|
};
|
|
76
90
|
export type EditMode = "page" | "modal" | "both";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/crud/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,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AAEF,eAAO,MAAM,mBAAmB,aAM9B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the API save body from form values using registered field paths.
|
|
3
|
+
* Flat `email` → `{ email }`; nested `address.city` → `{ address: { city } }`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function buildFormPayload(values: Record<string, unknown>, fieldPaths: string[]): Record<string, unknown>;
|
|
6
|
+
//# sourceMappingURL=buildFormPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildFormPayload.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/buildFormPayload.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,UAAU,EAAE,MAAM,EAAE,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAazB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type BuildInlineRowsPayloadOptions = {
|
|
2
|
+
transformRows?: (rows: Record<string, unknown>[]) => unknown;
|
|
3
|
+
};
|
|
4
|
+
/** Clean inline field-array rows for the API (strip RHF `rowKey`, keep record `id`). */
|
|
5
|
+
export declare function buildInlineRowsPayload(rows: unknown, sources: string[], options?: BuildInlineRowsPayloadOptions): unknown;
|
|
6
|
+
//# sourceMappingURL=buildInlineRowsPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildInlineRowsPayload.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/buildInlineRowsPayload.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC;CAC9D,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,CAAC,EAAE,6BAA6B,GACtC,OAAO,CA2BT"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InlineFieldRegistration } from '../context/InlineFieldsRegistry';
|
|
2
|
+
import { PrepareFormSubmitBodyOptions } from './prepareFormSubmitBody';
|
|
3
|
+
/** Build the create/update body from form values, auto-switching to multipart when needed. */
|
|
4
|
+
export declare function buildResourceFormSubmitBody(raw: Record<string, unknown>, payloadFieldPaths: string[], inlineRegistry?: Iterable<InlineFieldRegistration>, options?: PrepareFormSubmitBodyOptions): Record<string, unknown> | FormData;
|
|
5
|
+
//# sourceMappingURL=buildResourceFormSubmitBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildResourceFormSubmitBody.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/buildResourceFormSubmitBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG/E,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,yBAAyB,CAAC;AAEjC,8FAA8F;AAC9F,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,iBAAiB,EAAE,MAAM,EAAE,EAC3B,cAAc,CAAC,EAAE,QAAQ,CAAC,uBAAuB,CAAC,EAClD,OAAO,CAAC,EAAE,4BAA4B,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAcpC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChoiceOption } from '../types';
|
|
2
|
+
export declare function isRecordObject(value: unknown, optionValue: string): value is Record<string, unknown>;
|
|
3
|
+
export declare function valueAsId(value: unknown, optionValue: string): string | number | undefined;
|
|
4
|
+
export declare function valuesAsIds(values: unknown, optionValue: string): (string | number)[];
|
|
5
|
+
export declare function normalizeSelectedIds(selectedValues: unknown | unknown[] | undefined, optionValue: string): unknown[];
|
|
6
|
+
export declare function collectSelectedRecords(selectedValues: unknown | unknown[] | undefined, selectedRecords: Record<string, unknown> | Record<string, unknown>[] | undefined, optionValue: string): Record<string, unknown>[];
|
|
7
|
+
export declare function resolveOptionLabel(record: Record<string, unknown>, optionLabel: string | ((record: Record<string, unknown>) => string)): string;
|
|
8
|
+
export declare function recordsToOptions(records: Record<string, unknown>[], optionLabel: string | ((record: Record<string, unknown>) => string), optionValue: string): ChoiceOption[];
|
|
9
|
+
export declare function mergeOptions(existing: ChoiceOption[], incoming: ChoiceOption[]): ChoiceOption[];
|
|
10
|
+
//# sourceMappingURL=choiceSelectionUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choiceSelectionUtils.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/choiceSelectionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,MAAM,GAClB,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOlC;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,MAAM,GAAG,SAAS,CAS7B;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,MAAM,GAClB,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAKrB;AAED,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,SAAS,EAC/C,WAAW,EAAE,MAAM,GAClB,OAAO,EAAE,CAUX;AAED,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,SAAS,EAC/C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS,EAChF,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CA4B3B;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAW,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,GAClE,MAAM,CAGR;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAClC,WAAW,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,EACnE,WAAW,EAAE,MAAM,GAClB,YAAY,EAAE,CAMhB;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,YAAY,EAAE,EACxB,QAAQ,EAAE,YAAY,EAAE,GACvB,YAAY,EAAE,CAKhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choiceSelectionUtils.test.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/choiceSelectionUtils.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import { MessageInstance } from 'antd/es/message/interface';
|
|
2
1
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { DataProvider, ParseFormErrorContext } from '../../data/dataProviderTypes';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { DataProvider, FormValidationErrors, ParseFormErrorContext } from '../../data/dataProviderTypes';
|
|
3
|
+
import { InlineFieldRegistration } from '../context/InlineFieldsRegistry';
|
|
4
|
+
export type ApplyApiErrorsResult = {
|
|
5
|
+
handled: boolean;
|
|
6
|
+
globalErrors: string[];
|
|
7
|
+
};
|
|
8
|
+
export type ApplyApiErrorsOptions = {
|
|
9
|
+
payloadFields: Iterable<string>;
|
|
10
|
+
inlineRegistry: Iterable<InlineFieldRegistration>;
|
|
11
|
+
};
|
|
12
|
+
/** Top-level `source` or inline cell path such as `lines.0.quantity`. */
|
|
13
|
+
export declare function isKnownFormFieldPath(path: string, payloadFields: Set<string>, inlineRegistry: Map<string, InlineFieldRegistration>): boolean;
|
|
14
|
+
export declare function partitionFormErrors(parsed: FormValidationErrors, payloadFields: Set<string>, inlineRegistry: Map<string, InlineFieldRegistration>): {
|
|
15
|
+
fieldErrors: Record<string, string | string[]>;
|
|
16
|
+
globalErrors: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare function applyFormErrors<T extends FieldValues>(form: UseFormReturn<T>, fieldErrors: Record<string, string | string[]>): void;
|
|
19
|
+
export declare function applyApiErrorsToForm<T extends FieldValues>(dp: DataProvider, form: UseFormReturn<T>, error: unknown, context: ParseFormErrorContext, options: ApplyApiErrorsOptions): Promise<ApplyApiErrorsResult>;
|
|
9
20
|
//# sourceMappingURL=formErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formErrors.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/formErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"formErrors.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/formErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAQ/E,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;CACnD,CAAC;AAWF,yEAAyE;AACzE,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,EAC1B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,GACnD,OAAO,CAQT;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,oBAAoB,EAC5B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,EAC1B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,GACnD;IAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAa5E;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EACnD,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,QAQ/C;AAUD,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,WAAW,EAC9D,EAAE,EAAE,YAAY,EAChB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CA2C/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formErrors.test.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/formErrors.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFormValue.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/getFormValue.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,EAAE,MAAM,GACX,OAAO,CAQT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasUploadValues.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/hasUploadValues.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nestedFieldPath.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/nestedFieldPath.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM,CAER"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ToFormDataOptions } from './toFormData';
|
|
2
|
+
export type PrepareFormSubmitBodyOptions = ToFormDataOptions;
|
|
3
|
+
/**
|
|
4
|
+
* When the payload contains any `File`/`Blob`, return `FormData`; otherwise the plain object.
|
|
5
|
+
* Unchanged upload URL references are omitted so edit saves do not re-post existing files.
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareFormSubmitBody(payload: Record<string, unknown>, options?: PrepareFormSubmitBodyOptions): Record<string, unknown> | FormData;
|
|
8
|
+
//# sourceMappingURL=prepareFormSubmitBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareFormSubmitBody.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/prepareFormSubmitBody.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGlE,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE,4BAA4B,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAQpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceSelectNotFoundContent.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/referenceSelectNotFoundContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,kEAAkE;AAClE,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAE1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setFormValue.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/setFormValue.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,IAAI,CAYN"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ToFormDataOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Omit unchanged upload URL strings (`http://` / `https://` / `/media/`) from the body.
|
|
4
|
+
* Default `true` — edit forms keep existing files without re-sending the URL.
|
|
5
|
+
*/
|
|
6
|
+
skipExistingUploadUrls?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Flatten a save payload into `FormData` using bracket notation for nested fields
|
|
10
|
+
* and arrays (e.g. `lines[0][label]`, `address[city]`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function toFormData(data: Record<string, unknown>, options?: ToFormDataOptions): FormData;
|
|
13
|
+
//# sourceMappingURL=toFormData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toFormData.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/toFormData.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAoDF;;;GAGG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,QAAQ,CAWV"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Existing server-side upload reference — omit on save unless replaced with a new File. */
|
|
2
|
+
export declare function isExistingUploadReference(value: string): boolean;
|
|
3
|
+
export declare function stripExistingUploadReferences(value: unknown, skipExistingUploadUrls: boolean): unknown;
|
|
4
|
+
export declare function stripExistingUploadReferencesFromPayload(payload: Record<string, unknown>, skipExistingUploadUrls?: boolean): Record<string, unknown>;
|
|
5
|
+
//# sourceMappingURL=uploadReferenceUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadReferenceUtils.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/uploadReferenceUtils.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,EACd,sBAAsB,EAAE,OAAO,GAC9B,OAAO,CAyBT;AAED,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,sBAAsB,UAAO,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB"}
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import { ChoiceOption, ChoicesLoader } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type UseChoicesOptions = {
|
|
3
|
+
/** When true, the option list loads only while the dropdown is open or the user is searching. */
|
|
4
|
+
lazy?: boolean;
|
|
5
|
+
/** Dropdown open or active search — triggers lazy list loading. */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Current field value — primitive id(s), nested object(s), or mixed.
|
|
9
|
+
* Objects shaped like `{ id, name, … }` are turned into options without `getOne`.
|
|
10
|
+
*/
|
|
11
|
+
selectedValues?: unknown | unknown[];
|
|
12
|
+
/**
|
|
13
|
+
* Related record(s) from the loaded form row (e.g. `recordSource="branch"`).
|
|
14
|
+
* Used to show labels on edit when the retrieve API embeds relations.
|
|
15
|
+
*/
|
|
16
|
+
selectedRecords?: Record<string, unknown> | Record<string, unknown>[];
|
|
17
|
+
/**
|
|
18
|
+
* When true (default), fetch labels for primitive ids via `getOne` if they are
|
|
19
|
+
* not already known from `selectedValues` / `selectedRecords`.
|
|
20
|
+
*/
|
|
21
|
+
fetchSelected?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Cache list results in memory. Defaults to `false` when `lazy` is true so each
|
|
24
|
+
* dropdown open refetches; eager loads (e.g. table columns) default to `true`.
|
|
25
|
+
*/
|
|
26
|
+
cache?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function useChoices(loader: ChoicesLoader | undefined, reference: string | undefined, optionLabel?: string | ((record: Record<string, unknown>) => string), optionValue?: string, search?: string, hookOptions?: UseChoicesOptions): {
|
|
3
29
|
options: ChoiceOption[];
|
|
4
30
|
loading: boolean;
|
|
5
31
|
labelForValue: (value: unknown) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChoices.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/useChoices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useChoices.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/useChoices.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAY5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,iGAAiG;IACjG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;IACrC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACtE;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAyEF,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,GAAG,SAAS,EACjC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,WAAW,GAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAU,EAC5E,WAAW,SAAO,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,WAAW,GAAE,iBAAsB;;;2BAqLzB,OAAO,KAAG,MAAM;8BAQf,OAAO,EAAE,KAAG,MAAM;4BAQnB,OAAO,KAAG,YAAY,GAAG,SAAS;;EAa7C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { MessageInstance } from 'antd/es/message/interface';
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
3
|
+
import { DataProvider } from '../../data/dataProviderTypes';
|
|
4
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
5
|
+
import { InlineFieldRegistration } from '../context/InlineFieldsRegistry';
|
|
6
|
+
type LoadOptions<T extends FieldValues> = {
|
|
7
|
+
dp: DataProvider;
|
|
8
|
+
resource: string;
|
|
9
|
+
id: string | undefined;
|
|
10
|
+
isNew: boolean;
|
|
11
|
+
form: UseFormReturn<T>;
|
|
12
|
+
message: MessageInstance;
|
|
13
|
+
defaultValues?: Partial<T>;
|
|
14
|
+
/** When false, skip loading (e.g. modal closed). Defaults to true. */
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** Edit mode: `getOne` → `form.reset` → bump `formVersion` so field arrays remount. */
|
|
18
|
+
export declare function useFormRecordLoad<T extends FieldValues>({ dp, resource, id, isNew, form, message, defaultValues, enabled, }: LoadOptions<T>): {
|
|
19
|
+
loading: boolean;
|
|
20
|
+
formVersion: number;
|
|
21
|
+
};
|
|
22
|
+
type SubmitOptions<T extends FieldValues & {
|
|
23
|
+
id?: unknown;
|
|
24
|
+
}> = {
|
|
25
|
+
dp: DataProvider;
|
|
26
|
+
resource: string;
|
|
27
|
+
id: string | undefined;
|
|
28
|
+
isNew: boolean;
|
|
29
|
+
form: UseFormReturn<T>;
|
|
30
|
+
message: MessageInstance;
|
|
31
|
+
payloadFieldsRef: MutableRefObject<Set<string>>;
|
|
32
|
+
inlineRegistryRef: MutableRefObject<Map<string, InlineFieldRegistration>>;
|
|
33
|
+
setGlobalErrors: (errors: string[]) => void;
|
|
34
|
+
onSuccess?: (record: T) => void;
|
|
35
|
+
};
|
|
36
|
+
/** Save: `buildFormPayload` → clean inline rows → one `create` or `update`. */
|
|
37
|
+
export declare function useFormRecordSave<T extends FieldValues & {
|
|
38
|
+
id?: unknown;
|
|
39
|
+
}>({ dp, resource, id, isNew, form, message, payloadFieldsRef, inlineRegistryRef, setGlobalErrors, onSuccess, }: SubmitOptions<T>): {
|
|
40
|
+
onSubmit: (values: T) => Promise<void>;
|
|
41
|
+
saving: boolean;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=useFormRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormRecord.d.ts","sourceRoot":"","sources":["../../../../src/crud/utils/useFormRecord.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,C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AAgB,CAAC,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAC1E,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,EAC1E,EAAE,EACF,QAAQ,EACR,EAAE,EACF,KAAK,EACL,IAAI,EACJ,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,SAAS,GACV,EAAE,aAAa,CAAC,CAAC,CAAC;uBAIA,CAAC;;EAkEnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetListParams, GetOneParams, Identifier } from './dataProviderTypes';
|
|
1
|
+
import { GetListParams, GetOneParams, Identifier, FormMutationBody } from './dataProviderTypes';
|
|
2
2
|
import { ResourceHandlers } from './resourceHandlers';
|
|
3
3
|
export type RestResourceHandlersConfig<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
4
4
|
list: (params: GetListParams) => Promise<{
|
|
@@ -6,12 +6,12 @@ export type RestResourceHandlersConfig<T extends Record<string, unknown> = Recor
|
|
|
6
6
|
total: number;
|
|
7
7
|
}>;
|
|
8
8
|
retrieve: (id: Identifier, params?: GetOneParams) => Promise<T>;
|
|
9
|
-
create: (data:
|
|
10
|
-
update: (id: Identifier, data:
|
|
9
|
+
create: (data: FormMutationBody) => Promise<T>;
|
|
10
|
+
update: (id: Identifier, data: FormMutationBody) => Promise<T>;
|
|
11
11
|
destroy: (id: Identifier) => Promise<void>;
|
|
12
|
-
/** When API create body differs from form `source` paths. */
|
|
12
|
+
/** When API create body differs from form `source` paths. Not applied when body is already `FormData`. */
|
|
13
13
|
transformCreate?: (data: Record<string, unknown>) => unknown;
|
|
14
|
-
/** When API update body differs from form `source` paths. */
|
|
14
|
+
/** When API update body differs from form `source` paths. Not applied when body is already `FormData`. */
|
|
15
15
|
transformUpdate?: (data: Record<string, unknown>) => unknown;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRestResourceHandlers.d.ts","sourceRoot":"","sources":["../../../src/data/createRestResourceHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"createRestResourceHandlers.d.ts","sourceRoot":"","sources":["../../../src/data/createRestResourceHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,MAAM,0BAA0B,CACpC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACzD;IACF,IAAI,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,QAAQ,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/D,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,0GAA0G;IAC1G,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAC7D,0GAA0G;IAC1G,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;CAC9D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAuC5D"}
|
|
@@ -34,7 +34,7 @@ export type CreateResult<RecordType extends Record<string, unknown>> = {
|
|
|
34
34
|
};
|
|
35
35
|
export type UpdateParams<RecordType extends Record<string, unknown>> = {
|
|
36
36
|
id: Identifier;
|
|
37
|
-
data: Partial<RecordType
|
|
37
|
+
data: Partial<RecordType> | FormData;
|
|
38
38
|
};
|
|
39
39
|
export type UpdateResult<RecordType extends Record<string, unknown>> = {
|
|
40
40
|
data: RecordType;
|
|
@@ -42,13 +42,14 @@ export type UpdateResult<RecordType extends Record<string, unknown>> = {
|
|
|
42
42
|
export type DeleteResult<RecordType extends Record<string, unknown>> = {
|
|
43
43
|
data: RecordType | null;
|
|
44
44
|
};
|
|
45
|
+
/** Save body from forms — plain JSON object or multipart `FormData` when uploads are present. */
|
|
46
|
+
export type FormMutationBody = Record<string, unknown> | FormData;
|
|
45
47
|
export type FormMutation = "create" | "update";
|
|
46
48
|
export type ParseFormErrorContext = {
|
|
47
49
|
resource: string;
|
|
48
50
|
mutation: FormMutation;
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
rowIndex?: number;
|
|
51
|
+
/** Top-level inline field-array paths on the form, e.g. `["lines"]`. */
|
|
52
|
+
inlineFieldPaths?: string[];
|
|
52
53
|
};
|
|
53
54
|
/** Field paths match react-hook-form `name` (form `source` or inline `arrayName.index.source`). */
|
|
54
55
|
export type FormValidationErrors = {
|
|
@@ -64,7 +65,7 @@ export type ParseFormError = (error: unknown, context: ParseFormErrorContext) =>
|
|
|
64
65
|
export type DataProvider<RecordType extends Record<string, unknown> = Record<string, unknown>> = {
|
|
65
66
|
getList: (resource: string, params: GetListParams) => Promise<GetListResult<RecordType>>;
|
|
66
67
|
getOne: (resource: string, id: Identifier, params?: GetOneParams) => Promise<GetOneResult<RecordType>>;
|
|
67
|
-
create: (resource: string, data: Partial<RecordType>) => Promise<CreateResult<RecordType>>;
|
|
68
|
+
create: (resource: string, data: Partial<RecordType> | FormData) => Promise<CreateResult<RecordType>>;
|
|
68
69
|
update: (resource: string, params: UpdateParams<RecordType>) => Promise<UpdateResult<RecordType>>;
|
|
69
70
|
delete: (resource: string, id: Identifier) => Promise<DeleteResult<RecordType>>;
|
|
70
71
|
/** Map API validation errors to form field paths. Optional. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataProviderTypes.d.ts","sourceRoot":"","sources":["../../../src/data/dataProviderTypes.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,gBAA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C,CAAC;IACvC,MAAM,EAAE,CACN,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,KAC7B,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;IACvC,MAAM,EAAE,CACN,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,UAAU,KACX,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;IACvC,+DAA+D;IAC/D,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC"}
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
import { FormValidationErrors, ParseFormErrorContext } from './dataProviderTypes';
|
|
2
|
+
export declare const EXPECTED_VALIDATION_BODY_HINT = "Expected HTTP 400 with a JSON object such as `{ \"field_name\": [\"message\"] }` or `{ \"non_field_errors\": [\"message\"] }`.";
|
|
2
3
|
export declare function asStringMessages(value: unknown): string[];
|
|
3
|
-
|
|
4
|
+
export declare function describeNonStandardValidationBody(body: Record<string, unknown> | null, options?: {
|
|
5
|
+
hint?: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function getValidationErrorStatus(error: unknown): number | null;
|
|
8
|
+
export declare function getErrorResponseContentType(error: unknown): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Read a parsed JSON validation body when it is already available on the error.
|
|
11
|
+
*
|
|
12
|
+
* Supported transport shapes (sync only):
|
|
13
|
+
* - `{ body: { email: ["…"] } }` — explicit throw from a handler
|
|
14
|
+
* - `{ response: { data: { email: ["…"] } } }` — axios-style wrappers
|
|
15
|
+
* - `{ data: { email: ["…"] } }` — some HTTP clients attach parsed JSON here
|
|
16
|
+
*
|
|
17
|
+
* For fetch / OpenAPI clients that only expose a `Response`, use `resolveErrorBody`.
|
|
18
|
+
*/
|
|
4
19
|
export declare function getErrorBody(error: unknown): Record<string, unknown> | null;
|
|
5
|
-
export declare function
|
|
6
|
-
|
|
20
|
+
export declare function resolveErrorBody(error: unknown): Promise<Record<string, unknown> | null>;
|
|
21
|
+
/** Map `{ lines: [{ label: ["…"] }] }` → `{ "lines.0.label": "…" }`. */
|
|
22
|
+
export declare function flattenNestedArrayErrors(arrayKey: string, rows: unknown[], fields: Record<string, string | string[]>): void;
|
|
23
|
+
export declare function finalizeFormErrors(fields: Record<string, string | string[]>, global: string[]): FormValidationErrors;
|
|
7
24
|
/**
|
|
8
25
|
* Django REST framework validation body:
|
|
9
26
|
* `{ "email": ["Invalid"], "non_field_errors": ["…"] }`
|
|
10
27
|
*/
|
|
11
|
-
export declare function parseDjangoDRFFormErrors(error: unknown,
|
|
28
|
+
export declare function parseDjangoDRFFormErrors(error: unknown, _ctx: ParseFormErrorContext): FormValidationErrors | null;
|
|
12
29
|
export type DotNetFormErrorOptions = {
|
|
13
30
|
/** Map API property names to form `source` paths. */
|
|
14
31
|
fieldMap?: Record<string, string>;
|
|
@@ -21,7 +38,7 @@ export type DotNetFormErrorOptions = {
|
|
|
21
38
|
* ASP.NET Core `ValidationProblemDetails`:
|
|
22
39
|
* `{ "errors": { "Email": ["The Email field is required."] } }`
|
|
23
40
|
*/
|
|
24
|
-
export declare function parseDotNetFormErrors(error: unknown,
|
|
41
|
+
export declare function parseDotNetFormErrors(error: unknown, _ctx: ParseFormErrorContext, options?: DotNetFormErrorOptions): FormValidationErrors | null;
|
|
25
42
|
export type NodeFormErrorOptions = {
|
|
26
43
|
fieldMap?: Record<string, string>;
|
|
27
44
|
};
|
|
@@ -31,5 +48,5 @@ export type NodeFormErrorOptions = {
|
|
|
31
48
|
* - `{ errors: [{ path: "email", msg: "Invalid" }] }` (express-validator)
|
|
32
49
|
* - `{ details: [{ message: "…", path: ["email"] }] }` (Joi)
|
|
33
50
|
*/
|
|
34
|
-
export declare function parseNodeFormErrors(error: unknown,
|
|
51
|
+
export declare function parseNodeFormErrors(error: unknown, _ctx: ParseFormErrorContext, options?: NodeFormErrorOptions): FormValidationErrors | null;
|
|
35
52
|
//# sourceMappingURL=parseFormErrorHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseFormErrorHelpers.d.ts","sourceRoot":"","sources":["../../../src/data/parseFormErrorHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAOzD;
|
|
1
|
+
{"version":3,"file":"parseFormErrorHelpers.d.ts","sourceRoot":"","sources":["../../../src/data/parseFormErrorHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,6BAA6B,mIACgF,CAAC;AAI3H,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAOzD;AAwCD,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACpC,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,MAAM,CAGR;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAYtE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAsB3E;AAiBD,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAoBzC;AAeD,wEAAwE;AACxE,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EAAE,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GACxC,IAAI,CAYN;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EACzC,MAAM,EAAE,MAAM,EAAE,GACf,oBAAoB,CAKtB;AA2BD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,qBAAqB,GAC1B,oBAAoB,GAAG,IAAI,CAI7B;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mFAAmF;IACnF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,sBAAsB,GAC/B,oBAAoB,GAAG,IAAI,CA0B7B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,oBAAoB,GAAG,IAAI,CAyD7B"}
|
|
@@ -8,7 +8,7 @@ export type ResourceGuard = (resource: string, action: ResourceAction) => void;
|
|
|
8
8
|
export type ResourceHandlers<RecordType extends Record<string, unknown> = Record<string, unknown>> = {
|
|
9
9
|
getList: (params: GetListParams) => Promise<GetListResult<RecordType>>;
|
|
10
10
|
getOne: (id: Identifier, params?: GetOneParams) => Promise<GetOneResult<RecordType>>;
|
|
11
|
-
create: (data: Partial<RecordType>) => Promise<CreateResult<RecordType>>;
|
|
11
|
+
create: (data: Partial<RecordType> | FormData) => Promise<CreateResult<RecordType>>;
|
|
12
12
|
update: (params: UpdateParams<RecordType>) => Promise<UpdateResult<RecordType>>;
|
|
13
13
|
delete: (id: Identifier) => Promise<DeleteResult<RecordType>>;
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceHandlers.d.ts","sourceRoot":"","sources":["../../../src/data/resourceHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3E,gGAAgG;AAChG,MAAM,MAAM,aAAa,GAAG,CAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,KACnB,IAAI,CAAC;AAEV,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,CAC1B,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAClE;IACF,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;IACvE,MAAM,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,MAAM,EA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AAU,CAAC,KAC7B,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;IACvC,MAAM,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,gBAAgB,GAChB;IACE,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC,CAAC;AAEN,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEtE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,0DAA0D;IAC1D,GAAG,CAAC,EAAE,kBAAkB,CAAC;IACzB,kEAAkE;IAClE,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yEAAyE;IACzE,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAqBF;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,CAAC,EAAE,8BAA8B,GACvC,YAAY,CA0Cd"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export { AuthProvider, createSessionStorageAuthAdapter, useAuth, type AuthProvid
|
|
|
4
4
|
export { DataProvider, useDataProvider, type DataProviderProps, } from './context/DataProvider';
|
|
5
5
|
export { PermissionsProvider, createPermissionsChecker, useCan, usePermissions, type PermissionsProviderProps, } from './context/PermissionsProvider';
|
|
6
6
|
export { AppThemeProvider, useThemeMode, } from './context/AppThemeProvider';
|
|
7
|
-
export type { CreateResult, DataProvider as DataProviderContract, DeleteResult, GetListParams, GetListResult, GetOneParams, GetOneResult, Identifier, PaginationParams, SortOrder, SortSpec, UpdateParams, UpdateResult, FormMutation, FormValidationErrors, ParseFormError, ParseFormErrorContext, } from './data/dataProviderTypes';
|
|
7
|
+
export type { CreateResult, DataProvider as DataProviderContract, DeleteResult, GetListParams, GetListResult, GetOneParams, GetOneResult, Identifier, PaginationParams, SortOrder, SortSpec, UpdateParams, UpdateResult, FormMutation, FormMutationBody, FormValidationErrors, ParseFormError, ParseFormErrorContext, } from './data/dataProviderTypes';
|
|
8
8
|
export { combineResourceHandlers } from './data/resourceHandlers';
|
|
9
9
|
export { isAbortError } from './data/abortError';
|
|
10
|
-
export { parseDjangoDRFFormErrors, parseDotNetFormErrors, parseNodeFormErrors, getErrorBody,
|
|
10
|
+
export { parseDjangoDRFFormErrors, parseDotNetFormErrors, parseNodeFormErrors, getErrorBody, resolveErrorBody, flattenNestedArrayErrors, asStringMessages, finalizeFormErrors, describeNonStandardValidationBody, EXPECTED_VALIDATION_BODY_HINT, } from './data/parseFormErrorHelpers';
|
|
11
11
|
export type { DotNetFormErrorOptions, NodeFormErrorOptions, } from './data/parseFormErrorHelpers';
|
|
12
12
|
export { createMemoryResourceHandlers } from './data/createMemoryResourceHandlers';
|
|
13
13
|
export { createRestResourceHandlers } from './data/createRestResourceHandlers';
|
|
@@ -27,6 +27,6 @@ export { Guard, GuestOnly, Protected, RequirePermission } from './router/guards'
|
|
|
27
27
|
export { createAdminRouter } from './router/createAdminRouter';
|
|
28
28
|
export { deriveAuthPaths, getRouteAccess, partitionAdminRoutes, } from './router/routeAccess';
|
|
29
29
|
export type { AdminAppProps, AdminLayoutProps, AdminRouteChild, AppThemeProviderProps, AuthAdapter, LoginCredentials, AuthRedirects, CreateAdminRouterOptions, AuthAlternateLinkProps, AuthPageLayoutProps, LoginPageProps, NavItem, RouteAccess, ThemeDensity, ThemeMode, } from './types';
|
|
30
|
-
export { ResourceList, FilterBar, ResourceForm, ResourceFormModal, InlineFormSet, InlineFormSetStacked, FormTabs, FormTab, FormSteps, FormStep,
|
|
31
|
-
export type { ResourceFormProps,
|
|
30
|
+
export { ResourceList, FilterBar, ResourceForm, ResourceFormModal, InlineFormSet, InlineFormSetStacked, FormTabs, FormTab, FormSteps, FormStep, TextField, NumberField, BooleanField, DateField, SelectField, PasswordField, ReferenceField, ReferenceManyField, ImageField, FileField, FieldWrapper, TextColumn, NumberColumn, BooleanColumn, DateColumn, ReferenceColumn, ReferenceManyColumn, ImageColumn, CustomColumn, TextFilter, NumberFilter, BooleanFilter, DateFilter, SelectFilter, ReferenceFilter, ReferenceManyFilter, useListQueryState, useChoices, useAbortableEffect, getFormValue, setFormValue, buildFormPayload, buildInlineRowsPayload, buildResourceFormSubmitBody, prepareFormSubmitBody, toFormData, hasUploadValues, nestedFieldPath, useResourceListContext, useRegisterPayloadField, useRegisterSectionField, } from './crud';
|
|
31
|
+
export type { ResourceFormProps, ResourceFormModalProps, InlineFormSetProps, InlineFormSetStackedProps, FormTabsProps, FormTabProps, FormStepsProps, FormStepProps, InlineFormSetLayout, ResourceListProps, BaseSourceProps, ChoiceOption, ChoicesLoader, UseChoicesOptions, ReferenceFieldProps, ReferenceManyFieldProps, DisplayProps, EditMode, FieldRules, InlineCellContext, InlineColumnDef, InlineFormSetBaseProps, InlineRowContext, InlineFieldRegistration, FieldWrapperProps, ImageFieldProps, FileFieldProps, UploadFieldValue, ToFormDataOptions, PrepareFormSubmitBodyOptions, ResourceListBuiltInActions, ResourceListBulkAction, ResourceListBulkActionHelpers, ResourceListRowActionsHelpers, ListQueryState, ListQueryActions, } from './crud';
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,+BAA+B,EAC/B,OAAO,EACP,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,MAAM,EACN,cAAc,EACd,KAAK,wBAAwB,GAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,YAAY,EACZ,YAAY,IAAI,oBAAoB,EACpC,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,+BAA+B,EAC/B,OAAO,EACP,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,MAAM,EACN,cAAc,EACd,KAAK,wBAAwB,GAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,YAAY,EACZ,YAAY,IAAI,oBAAoB,EACpC,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EAC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