@dakataa/crud-react 1.0.10 → 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 +439 -169
  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 +4014 -2955
  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 -79
  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
@@ -0,0 +1,69 @@
1
+ import { PropsWithChildren, SyntheticEvent } from 'react';
2
+ import { ActionRequestType } from '../type/ActionRequestType.tsx';
3
+ import { ActionType, ActionVisibility } from '../type/ActionType.tsx';
4
+ import { FormViewType } from '../type/FormViewType.tsx';
5
+ import { Method, RequestBodyType } from '@dakataa/requester';
6
+ export type ListContextPropsType = {
7
+ embedded?: boolean;
8
+ onClick?: (props: ActionRequestType, event?: SyntheticEvent) => void;
9
+ };
10
+ type ListItemRow = Record<string, string | number | null>;
11
+ export declare function UseList<Item extends object = ListItemRow>(safe?: boolean): {
12
+ data?: undefined;
13
+ columns?: undefined;
14
+ actions?: undefined;
15
+ objectActions?: undefined;
16
+ columnsTotal?: undefined;
17
+ primaryColumn?: undefined;
18
+ items?: undefined;
19
+ onClick?: undefined;
20
+ handleAction?: undefined;
21
+ filterData?: undefined;
22
+ getActions?: undefined;
23
+ getAction?: undefined;
24
+ getActionRequests?: undefined;
25
+ getActionRequest?: undefined;
26
+ handleBatchAction?: undefined;
27
+ appliedFilters?: undefined;
28
+ } | {
29
+ data: any;
30
+ columns: any;
31
+ actions: ActionType[];
32
+ objectActions: ActionType[];
33
+ columnsTotal: any;
34
+ primaryColumn: any;
35
+ items: Item[];
36
+ onClick: (actionRequest: ActionRequestType, event?: SyntheticEvent) => void;
37
+ handleAction: (actionRequest: ActionRequestType, event?: SyntheticEvent) => void;
38
+ filterData: ({ newAction, excludeFilterParameters, clear }: {
39
+ newAction?: ActionRequestType;
40
+ excludeFilterParameters?: [string];
41
+ clear?: boolean;
42
+ }) => void;
43
+ getActions: (visibility: ActionVisibility) => ActionType[];
44
+ getAction: (actionName: string) => ActionType | undefined;
45
+ getActionRequests: (visibility: ActionVisibility) => {
46
+ action: ActionType;
47
+ method?: Method;
48
+ parameters?: {
49
+ [key: string]: any;
50
+ };
51
+ query?: {
52
+ [key: string]: any;
53
+ };
54
+ body?: FormData | string | {
55
+ [key: string]: any;
56
+ };
57
+ bodyType?: RequestBodyType;
58
+ hash?: string;
59
+ }[];
60
+ getActionRequest: (actionName: string) => ActionRequestType | undefined;
61
+ handleBatchAction: (method: string, ids: any, data: FormData) => Promise<void>;
62
+ appliedFilters: {
63
+ label: string | undefined;
64
+ value: string | number | null;
65
+ formView: FormViewType;
66
+ }[];
67
+ };
68
+ export declare function ListProvider({ embedded, onClick, children }: ListContextPropsType & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
69
+ export {};
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export type ListItemContextType<TData = Record<string, any>> = {
3
+ index: number;
4
+ id?: string | number;
5
+ data: TData;
6
+ };
7
+ export declare function UseListItem<TData = Record<string, any>>(): ListItemContextType<TData>;
8
+ export declare function ListItemProvider({ children, ...props }: ListItemContextType & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function UseDataLoaderIndicator(url?: string): {
3
+ isLoading: boolean;
4
+ };
5
+ export declare function DataLoaderIndicatorProvider({ ...props }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { ActionRequestType } from '../type/ActionRequestType.tsx';
3
+ import { ModalType } from '../component/Modal.tsx';
4
+ export type ModalActionType = {
5
+ action: ActionRequestType;
6
+ props?: ModalType;
7
+ };
8
+ export type ModalContextType = {
9
+ modal?: ModalActionType | null;
10
+ setModal?: (modal: ModalActionType | null) => void;
11
+ closeModal?: () => void;
12
+ };
13
+ export declare function UseModal(): {
14
+ modal: ModalActionType | null | undefined;
15
+ openModal: (modal: ModalActionType) => void;
16
+ closeModal: () => void;
17
+ };
18
+ export declare function ModalProvider(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function UseNamespace(): string;
3
+ export declare function NamespaceProvider({ namespace, ...props }: {
4
+ namespace: string;
5
+ } & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
- .modal-alert{--animation-transform: null;--animation-transition: null;--animation-keyframes: animation-open-default;--animation-keyframes-duration: .3s;--animation-timeout-progress: 1s;--modal-alert-vertical-gutter: 1.5rem;--modal-alert-icon-size: 92px;--bs-modal-zindex: 1150;transition:var(--animation-transition);transform:var(--animation-transform)}.modal-alert+.modal-backdrop{--bs-backdrop-zindex: 1100}.modal-alert.fade{animation:animation-open-fade}.modal-alert.scale,.modal-alert.bounce,.modal-alert.default{animation:var(--animation-keyframes) var(--animation-keyframes-duration) ease-in-out}.modal-alert.show{--animation-transform: none}.modal-alert.close{animation-direction:reverse;animation-duration:calc(var(--animation-keyframes-duration) / 2)}.modal-alert .btn-close{position:absolute;top:1rem;right:1rem}.modal-alert .modal-alert-icon{width:var(--modal-alert-icon-size);height:var(--modal-alert-icon-size);margin-bottom:var(--modal-alert-vertical-gutter)}.modal-alert .modal-alert-title,.modal-alert .modal-alert-text{margin-bottom:var(--modal-alert-vertical-gutter)}.modal-alert .modal-alert-progress{background:var(--bs-primary);animation:animation-progress var(--animation-timeout-progress) linear;height:.25rem;position:absolute;bottom:0}@keyframes animation-progress{0%{width:100%}to{width:0%}}@keyframes animation-open-default{0%{transform:scale(.7);opacity:0}45%{transform:scale(1.05)}80%{transform:scale(.95)}to{transform:scale(1);opacity:1}}@keyframes animation-open-fade{0%{opacity:0}to{opacity:1}}
1
+ .modal{--animation-keyframes:animation-open-default;--animation-keyframes-duration:.3s}.modal.fade{animation:.15s ease-in-out animation-open-fade}.modal.scale,.modal.bounce,.modal.default{animation:var(--animation-keyframes) var(--animation-keyframes-duration) ease-in-out}.modal.close{animation-direction:reverse;animation-duration:calc(var(--animation-keyframes-duration) / 2)}.modal-alert{--animation-transform:null;--animation-transition:null;--animation-timeout-progress:1s;--modal-alert-vertical-gutter:1.5rem;--modal-alert-icon-size:92px;--bs-modal-zindex:1150;transition:var(--animation-transition);transform:var(--animation-transform)}.modal-alert+.modal-backdrop{--bs-backdrop-zindex:1100}.modal-alert.show{--animation-transform:none}.modal-alert .btn-close{position:absolute;top:1rem;right:1rem}.modal-alert .modal-alert-icon{width:var(--modal-alert-icon-size);height:var(--modal-alert-icon-size);margin-bottom:var(--modal-alert-vertical-gutter)}.modal-alert .modal-alert-title,.modal-alert .modal-alert-text{margin-bottom:var(--modal-alert-vertical-gutter)}.modal-alert .modal-alert-progress{background:var(--bs-primary);animation:animation-progress var(--animation-timeout-progress) linear;height:.25rem;position:absolute;bottom:0}@keyframes animation-progress{0%{width:100%}to{width:0%}}@keyframes animation-open-default{0%{opacity:0;transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes animation-open-fade{0%{opacity:0}to{opacity:1}}
2
+ /*$vite$:1*/