@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.
- package/CHANGELOG.md +83 -0
- package/README.md +439 -169
- 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 +4014 -2955
- 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 -79
- 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
|
@@ -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,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;
|
package/dist/crud-react.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
.modal
|
|
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*/
|