@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.
Files changed (108) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +837 -96
  3. package/dist/Crud.d.ts +15 -0
  4. package/dist/component/BaseButtonContent.d.ts +10 -0
  5. package/dist/component/Button.d.ts +9 -0
  6. package/dist/component/Dropdown.d.ts +17 -0
  7. package/dist/component/Empty.d.ts +5 -0
  8. package/dist/component/Link.d.ts +6 -0
  9. package/dist/component/LottieAnimation.d.ts +8 -0
  10. package/dist/component/Modal.d.ts +22 -0
  11. package/dist/component/Money.d.ts +7 -0
  12. package/dist/component/Preloader.d.ts +20 -0
  13. package/dist/component/Translation.d.ts +14 -0
  14. package/dist/component/crud/ActionLink.d.ts +10 -0
  15. package/dist/component/crud/CrudLoader.d.ts +29 -0
  16. package/dist/component/crud/DynamicView.d.ts +19 -0
  17. package/dist/component/crud/FiltersView.d.ts +6 -0
  18. package/dist/component/crud/GridView.d.ts +27 -0
  19. package/dist/component/crud/IsListItemActionGranted.d.ts +10 -0
  20. package/dist/component/crud/ItemAction.d.ts +9 -0
  21. package/dist/component/crud/ItemActions.d.ts +7 -0
  22. package/dist/component/crud/ItemLabel.d.ts +6 -0
  23. package/dist/component/crud/ItemValue.d.ts +6 -0
  24. package/dist/component/crud/List.d.ts +19 -0
  25. package/dist/component/crud/ListItem.d.ts +4 -0
  26. package/dist/component/crud/ListView.d.ts +8 -0
  27. package/dist/component/crud/Modify.d.ts +9 -0
  28. package/dist/component/crud/Navigation.d.ts +19 -0
  29. package/dist/component/crud/Paginator.d.ts +2 -0
  30. package/dist/component/crud/ViewLoader.d.ts +14 -0
  31. package/dist/component/crud/batch/BatchActionSelector.d.ts +2 -0
  32. package/dist/component/crud/batch/BatchActionsContext.d.ts +17 -0
  33. package/dist/component/crud/batch/BatchItemSelector.d.ts +4 -0
  34. package/dist/component/crud/form/Form.d.ts +31 -0
  35. package/dist/component/crud/form/FormError.d.ts +6 -0
  36. package/dist/component/crud/form/FormField.d.ts +11 -0
  37. package/dist/component/crud/form/FormGroup.d.ts +76 -0
  38. package/dist/component/crud/form/FormGroupViewLoader.d.ts +2 -0
  39. package/dist/component/crud/form/FormLabel.d.ts +4 -0
  40. package/dist/component/crud/form/FormRequestError.d.ts +14 -0
  41. package/dist/component/crud/form/FormRest.d.ts +2 -0
  42. package/dist/component/crud/form/FormRestError.d.ts +4 -0
  43. package/dist/component/error/ErrorBoundary.d.ts +13 -0
  44. package/dist/component/error/Exception.d.ts +9 -0
  45. package/dist/component/error/HttpException.d.ts +16 -0
  46. package/dist/component/form/Choice.d.ts +24 -0
  47. package/dist/component/form/Collection.d.ts +27 -0
  48. package/dist/component/form/Form.d.ts +62 -0
  49. package/dist/component/form/FormAlert.d.ts +3 -0
  50. package/dist/component/form/FormFieldError.d.ts +6 -0
  51. package/dist/component/form/FormGroup.d.ts +8 -0
  52. package/dist/component/form/FormHelp.d.ts +5 -0
  53. package/dist/component/form/FormLabel.d.ts +7 -0
  54. package/dist/component/form/FormSetting.d.ts +11 -0
  55. package/dist/component/form/FormStore.d.ts +93 -0
  56. package/dist/component/form/Input.d.ts +13 -0
  57. package/dist/component/form/Textarea.d.ts +15 -0
  58. package/dist/component/form/constraint/Contraint.d.ts +6 -0
  59. package/dist/component/form/constraint/NotBlank.d.ts +11 -0
  60. package/dist/component/form/formChoices.d.ts +8 -0
  61. package/dist/component/form/formSession.d.ts +3 -0
  62. package/dist/component/form/formView.d.ts +35 -0
  63. package/dist/component/router/Route.d.ts +11 -0
  64. package/dist/component/templating/Template.d.ts +17 -0
  65. package/dist/component/templating/TemplateBlock.d.ts +8 -0
  66. package/dist/component/templating/TemplateExtend.d.ts +9 -0
  67. package/dist/component/templating/TemplateParentBlock.d.ts +5 -0
  68. package/dist/context/ActionContext.d.ts +46 -0
  69. package/dist/context/AlertContext.d.ts +52 -0
  70. package/dist/context/ConfigContext.d.ts +34 -0
  71. package/dist/context/CrudProvider.d.ts +7 -0
  72. package/dist/context/GetData.d.ts +43 -0
  73. package/dist/context/ListContext.d.ts +69 -0
  74. package/dist/context/ListItemContext.d.ts +8 -0
  75. package/dist/context/LoaderContext.d.ts +5 -0
  76. package/dist/context/ModalContext.d.ts +18 -0
  77. package/dist/context/NamespaceContext.d.ts +5 -0
  78. package/dist/crud-react.css +2 -1
  79. package/dist/crud-react.js +4015 -2881
  80. package/dist/denied-Emsz18Y8.js +688 -0
  81. package/dist/helper/ObjectUtils.d.ts +3 -0
  82. package/dist/helper/PathUtils.d.ts +12 -0
  83. package/dist/helper/StringUtils.d.ts +3 -0
  84. package/dist/info-C897Uj_w.js +626 -0
  85. package/dist/layout/default/Base.d.ts +5 -0
  86. package/dist/layout/default/Error.d.ts +11 -0
  87. package/dist/layout/default/Main.d.ts +4 -0
  88. package/dist/main.d.ts +91 -77
  89. package/dist/setupTests.d.ts +0 -0
  90. package/dist/success-YbPKEx5j.js +559 -0
  91. package/dist/type/ActionRequestType.d.ts +17 -0
  92. package/dist/type/ActionType.d.ts +15 -0
  93. package/dist/type/ColumnType.d.ts +24 -0
  94. package/dist/type/ExceptionType.d.ts +6 -0
  95. package/dist/type/FormType.d.ts +6 -0
  96. package/dist/type/FormViewType.d.ts +96 -0
  97. package/dist/type/ListMetaType.d.ts +8 -0
  98. package/dist/type/ListType.d.ts +32 -0
  99. package/dist/type/ModifyType.d.ts +15 -0
  100. package/dist/type/RedirectType.d.ts +7 -0
  101. package/dist/type/RouteType.d.ts +7 -0
  102. package/dist/type/ViewType.d.ts +15 -0
  103. package/dist/warning-DJITKJj5.js +630 -0
  104. package/package.json +86 -81
  105. package/dist/denied-CgoMpaA7.js +0 -27
  106. package/dist/info-D-NzIEYs.js +0 -144
  107. package/dist/success-Bu_BJcf1.js +0 -27
  108. 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`.