@dakataa/crud-react 1.0.9 → 2.0.0
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/CHANGELOG.md +83 -0
- package/README.md +837 -96
- package/dist/Crud.d.ts +15 -0
- package/dist/component/BaseButtonContent.d.ts +10 -0
- package/dist/component/Button.d.ts +9 -0
- package/dist/component/Dropdown.d.ts +17 -0
- package/dist/component/Empty.d.ts +5 -0
- package/dist/component/Link.d.ts +6 -0
- package/dist/component/LottieAnimation.d.ts +8 -0
- package/dist/component/Modal.d.ts +22 -0
- package/dist/component/Money.d.ts +7 -0
- package/dist/component/Preloader.d.ts +20 -0
- package/dist/component/Translation.d.ts +14 -0
- package/dist/component/crud/ActionLink.d.ts +10 -0
- package/dist/component/crud/CrudLoader.d.ts +29 -0
- package/dist/component/crud/DynamicView.d.ts +19 -0
- package/dist/component/crud/FiltersView.d.ts +6 -0
- package/dist/component/crud/GridView.d.ts +27 -0
- package/dist/component/crud/IsListItemActionGranted.d.ts +10 -0
- package/dist/component/crud/ItemAction.d.ts +9 -0
- package/dist/component/crud/ItemActions.d.ts +7 -0
- package/dist/component/crud/ItemLabel.d.ts +6 -0
- package/dist/component/crud/ItemValue.d.ts +6 -0
- package/dist/component/crud/List.d.ts +19 -0
- package/dist/component/crud/ListItem.d.ts +4 -0
- package/dist/component/crud/ListView.d.ts +8 -0
- package/dist/component/crud/Modify.d.ts +9 -0
- package/dist/component/crud/Navigation.d.ts +19 -0
- package/dist/component/crud/Paginator.d.ts +2 -0
- package/dist/component/crud/ViewLoader.d.ts +14 -0
- package/dist/component/crud/batch/BatchActionSelector.d.ts +2 -0
- package/dist/component/crud/batch/BatchActionsContext.d.ts +17 -0
- package/dist/component/crud/batch/BatchItemSelector.d.ts +4 -0
- package/dist/component/crud/form/Form.d.ts +31 -0
- package/dist/component/crud/form/FormError.d.ts +6 -0
- package/dist/component/crud/form/FormField.d.ts +11 -0
- package/dist/component/crud/form/FormGroup.d.ts +76 -0
- package/dist/component/crud/form/FormGroupViewLoader.d.ts +2 -0
- package/dist/component/crud/form/FormLabel.d.ts +4 -0
- package/dist/component/crud/form/FormRequestError.d.ts +14 -0
- package/dist/component/crud/form/FormRest.d.ts +2 -0
- package/dist/component/crud/form/FormRestError.d.ts +4 -0
- package/dist/component/error/ErrorBoundary.d.ts +13 -0
- package/dist/component/error/Exception.d.ts +9 -0
- package/dist/component/error/HttpException.d.ts +16 -0
- package/dist/component/form/Choice.d.ts +24 -0
- package/dist/component/form/Collection.d.ts +27 -0
- package/dist/component/form/Form.d.ts +62 -0
- package/dist/component/form/FormAlert.d.ts +3 -0
- package/dist/component/form/FormFieldError.d.ts +6 -0
- package/dist/component/form/FormGroup.d.ts +8 -0
- package/dist/component/form/FormHelp.d.ts +5 -0
- package/dist/component/form/FormLabel.d.ts +7 -0
- package/dist/component/form/FormSetting.d.ts +11 -0
- package/dist/component/form/FormStore.d.ts +93 -0
- package/dist/component/form/Input.d.ts +13 -0
- package/dist/component/form/Textarea.d.ts +15 -0
- package/dist/component/form/constraint/Contraint.d.ts +6 -0
- package/dist/component/form/constraint/NotBlank.d.ts +11 -0
- package/dist/component/form/formChoices.d.ts +8 -0
- package/dist/component/form/formSession.d.ts +3 -0
- package/dist/component/form/formView.d.ts +35 -0
- package/dist/component/router/Route.d.ts +11 -0
- package/dist/component/templating/Template.d.ts +17 -0
- package/dist/component/templating/TemplateBlock.d.ts +8 -0
- package/dist/component/templating/TemplateExtend.d.ts +9 -0
- package/dist/component/templating/TemplateParentBlock.d.ts +5 -0
- package/dist/context/ActionContext.d.ts +46 -0
- package/dist/context/AlertContext.d.ts +52 -0
- package/dist/context/ConfigContext.d.ts +34 -0
- package/dist/context/CrudProvider.d.ts +7 -0
- package/dist/context/GetData.d.ts +43 -0
- package/dist/context/ListContext.d.ts +69 -0
- package/dist/context/ListItemContext.d.ts +8 -0
- package/dist/context/LoaderContext.d.ts +5 -0
- package/dist/context/ModalContext.d.ts +18 -0
- package/dist/context/NamespaceContext.d.ts +5 -0
- package/dist/crud-react.css +2 -1
- package/dist/crud-react.js +4015 -2881
- package/dist/denied-Emsz18Y8.js +688 -0
- package/dist/helper/ObjectUtils.d.ts +3 -0
- package/dist/helper/PathUtils.d.ts +12 -0
- package/dist/helper/StringUtils.d.ts +3 -0
- package/dist/info-C897Uj_w.js +626 -0
- package/dist/layout/default/Base.d.ts +5 -0
- package/dist/layout/default/Error.d.ts +11 -0
- package/dist/layout/default/Main.d.ts +4 -0
- package/dist/main.d.ts +91 -77
- package/dist/setupTests.d.ts +0 -0
- package/dist/success-YbPKEx5j.js +559 -0
- package/dist/type/ActionRequestType.d.ts +17 -0
- package/dist/type/ActionType.d.ts +15 -0
- package/dist/type/ColumnType.d.ts +24 -0
- package/dist/type/ExceptionType.d.ts +6 -0
- package/dist/type/FormType.d.ts +6 -0
- package/dist/type/FormViewType.d.ts +96 -0
- package/dist/type/ListMetaType.d.ts +8 -0
- package/dist/type/ListType.d.ts +32 -0
- package/dist/type/ModifyType.d.ts +15 -0
- package/dist/type/RedirectType.d.ts +7 -0
- package/dist/type/RouteType.d.ts +7 -0
- package/dist/type/ViewType.d.ts +15 -0
- package/dist/warning-DJITKJj5.js +630 -0
- package/package.json +86 -81
- package/dist/denied-CgoMpaA7.js +0 -27
- package/dist/info-D-NzIEYs.js +0 -144
- package/dist/success-Bu_BJcf1.js +0 -27
- package/dist/warning-B1nr7TsB.js +0 -27
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.0.0 — 2026-11-04
|
|
4
|
+
|
|
5
|
+
Forms now keep unsaved edits when fields are hidden and shown again, and better
|
|
6
|
+
handle validation and server responses. This release also improves translations,
|
|
7
|
+
lists and error handling. Custom integrations need the API updates below.
|
|
8
|
+
|
|
9
|
+
Changes since `1.0.10`.
|
|
10
|
+
|
|
11
|
+
### What's new
|
|
12
|
+
|
|
13
|
+
- **Forms remember edits.** Field values and added or removed collection rows survive
|
|
14
|
+
unmounting. Server responses preserve newer edits made while saving.
|
|
15
|
+
- **React to individual field changes.** Use `useFormField` for custom controls,
|
|
16
|
+
`useFormValue` / `useFormValues` to watch values, and `useFormErrors` for errors.
|
|
17
|
+
`useFormState` watches form status; `onStateChange` exposes it to parent components.
|
|
18
|
+
- **More control over saving and errors.** `Form.onSubmit(data, submission, runtime)`
|
|
19
|
+
provides a snapshot of submitted values and access to the form API. Handle failures
|
|
20
|
+
with `GetData.onError`, `GetData.throwOnError` or `CrudForm.onError`.
|
|
21
|
+
Redirects wait for asynchronous `CrudForm.onSuccess` handlers.
|
|
22
|
+
- **Easier form customization.** `FormGroup` and `FormField` accept `optional` for
|
|
23
|
+
fields that may be absent. Error components accept HTML and accessibility attributes.
|
|
24
|
+
Schema attributes such as `class`, `for` and `readonly` are converted to React names.
|
|
25
|
+
- **Shared helpers and translations.** Export `choiceToken`, `choiceList`,
|
|
26
|
+
`selectionTokens` and `resolveAttribute`. `config.translate` handles form labels,
|
|
27
|
+
help text, placeholders, accessible labels and choice group labels.
|
|
28
|
+
- **More display options.** Add configurable timezone, customizable pagination and
|
|
29
|
+
list/action helpers for embedded views.
|
|
30
|
+
|
|
31
|
+
### Fixes
|
|
32
|
+
|
|
33
|
+
- Validation responses preserve edited values and update untouched fields with new
|
|
34
|
+
backend defaults. Programmatic changes are available immediately to submission
|
|
35
|
+
and `getFormData()`.
|
|
36
|
+
- Compound filters and choice groups keyed by identifiers work correctly.
|
|
37
|
+
- Sorting stays consistent across Activity tab changes, without duplicate handlers.
|
|
38
|
+
- List item actions work when no permission is declared.
|
|
39
|
+
- Canceled requests no longer cause unhandled request-abort errors.
|
|
40
|
+
- Modals share animations and play them in reverse when closing.
|
|
41
|
+
|
|
42
|
+
### Breaking changes
|
|
43
|
+
|
|
44
|
+
- **Dependencies:** `@dakataa/requester` now requires **^3.0.0** instead of **^2.0.3**.
|
|
45
|
+
React and React DOM remain at **^19.2.3**.
|
|
46
|
+
- **Form context:** `UseForm()` returns `{ store, apiRef, elementRef }` instead of
|
|
47
|
+
`[[state, dispatch], formRef, elementRef]`. Read status with `useFormState()` and
|
|
48
|
+
change values through `apiRef.current`. `FormRef` remains supported.
|
|
49
|
+
- **Field values:** `FormViewType` and `options.data` / `value` / `checked` describe
|
|
50
|
+
initial values. Use setters for later updates; changing `view.data` has no effect.
|
|
51
|
+
Bind custom validation with `useFormField(view, constraints)` and `field.change()`.
|
|
52
|
+
- **Removed APIs:** `FormAction`, `dispatch`, `FormState.response`,
|
|
53
|
+
`UseFormView().setRendered`, `UseFormView().setErrorRendered` and `Choice.prototype`.
|
|
54
|
+
Keep response data in application state. Collection prototypes still use
|
|
55
|
+
`FormViewType.prototype`.
|
|
56
|
+
- **Translations:** replace translation templates with `config.translate`.
|
|
57
|
+
Custom templates can call `UseTranslate()`.
|
|
58
|
+
- **Action and list contexts:** use `actionRequest` / `setActionRequest` instead of
|
|
59
|
+
`action` / `setAction`. Pass `actionRequest` to `CurrentActionRequestProvider` and
|
|
60
|
+
`GetDataByAction`. `ListProvider` now reads data from the data context, not a `data` prop.
|
|
61
|
+
|
|
62
|
+
Renamed public exports:
|
|
63
|
+
|
|
64
|
+
| Before | Now |
|
|
65
|
+
| -------------------------- | --------------------------------- |
|
|
66
|
+
| `Action` | `ActionLink` |
|
|
67
|
+
| `OnClickAction` | `ActionRequestType` |
|
|
68
|
+
| `CurrentActionProvider` | `CurrentActionRequestProvider` |
|
|
69
|
+
| `CurrentActionProviderRef` | `CurrentActionRequestProviderRef` |
|
|
70
|
+
| `UseCurrentAction` | `UseCurrentActionRequest` |
|
|
71
|
+
| `GetDataByActionProps` | `GetDataByActionRequestProps` |
|
|
72
|
+
| `ListContextType` | `ListContextPropsType` |
|
|
73
|
+
|
|
74
|
+
### Upgrading from v1
|
|
75
|
+
|
|
76
|
+
1. Update `@dakataa/crud-react` to `^2.0.0` and `@dakataa/requester` to `^3.0.0`.
|
|
77
|
+
2. Apply the API changes above. For custom forms, follow the
|
|
78
|
+
[Form API migration guide](https://github.com/dakataa/crud-react/blob/2.0.0/src/component/form/README.md#migration-from-v1).
|
|
79
|
+
3. Check saving, validation, conditional fields, collections, translations, filters,
|
|
80
|
+
sorting and modal navigation in your application.
|
|
81
|
+
|
|
82
|
+
Native controls still submit normally. Use `useFormField` to preserve custom control
|
|
83
|
+
values across unmounts. Unmounted and disabled controls are excluded from `FormData`.
|