@dashadmin/dash-auto-admin 1.3.24 → 1.3.26

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 (176) hide show
  1. package/dist/DashAutoAdminComponentRegistry.js +64 -1
  2. package/dist/DashAutoAdminForm.js +137 -1
  3. package/dist/DashAutoAdminResizableDrawer.js +63 -1
  4. package/dist/DashAutoAdminSaveButton.js +57 -1
  5. package/dist/DashAutoCreate.js +102 -1
  6. package/dist/DashAutoDrawer.js +256 -1
  7. package/dist/DashAutoEdit.js +99 -1
  8. package/dist/DashAutoFiltersGenerator.js +193 -1
  9. package/dist/DashAutoFormGroups.js +118 -1
  10. package/dist/DashAutoFormLayout.js +68 -1
  11. package/dist/DashAutoFormMuiTabs.js +291 -1
  12. package/dist/DashAutoFormTabs.js +132 -1
  13. package/dist/DashAutoGroup.js +27 -1
  14. package/dist/DashAutoLayout.js +31 -1
  15. package/dist/DashAutoList.js +218 -1
  16. package/dist/DashAutoPostFilterForm.js +47 -1
  17. package/dist/DashAutoReferenceTab.js +10 -1
  18. package/dist/DashAutoResource.js +77 -1
  19. package/dist/DashAutoResourceLayout.js +16 -1
  20. package/dist/DashAutoShow.js +195 -1
  21. package/dist/DashAutoTabbedForm.js +244 -1
  22. package/dist/DashAutoTabbedForm.review.js +221 -1
  23. package/dist/DashAutoTabs.js +11 -1
  24. package/dist/DashFilterWrapper.js +62 -1
  25. package/dist/DashRedirect.js +56 -1
  26. package/dist/TabbedLayout.js +38 -1
  27. package/dist/common/DashAutoTitle.js +33 -1
  28. package/dist/common/components/FabButton.js +59 -1
  29. package/dist/common/components/TranslatedLabel.js +60 -1
  30. package/dist/common/settings/Settings.js +196 -1
  31. package/dist/common/settings/SettingsBarIcons.js +61 -1
  32. package/dist/context/DashAutoAdminFormContext.js +15 -1
  33. package/dist/hooks/useAutoAdminLoadingStateMediator.js +36 -1
  34. package/dist/hooks/useAutoAdminTranslate.js +61 -1
  35. package/dist/hooks/useHash.js +24 -1
  36. package/dist/hooks/useLogger.js +20 -1
  37. package/dist/hooks/useRoutePathPattern.js +20 -1
  38. package/dist/hooks/useVirtualHash.js +28 -1
  39. package/dist/index.js +77 -3406
  40. package/dist/list/DashAutoListActions.js +57 -1
  41. package/dist/list/DashAutoListDatagridWrapper.js +68 -1
  42. package/dist/list/DashAutoListDefaultActionsWrapper.js +14 -1
  43. package/dist/list/DashAutoListFilterFormWithButton.js +80 -1
  44. package/dist/list/DashAutoListTopToolbar.js +180 -1
  45. package/dist/mui/AttributeToField.js +576 -1
  46. package/dist/mui/AttributeToInput.js +630 -1
  47. package/dist/mui/AutoAdminResizableDrawer.js +63 -1
  48. package/dist/mui/AutoDataGrid.js +120 -1
  49. package/dist/mui/AutoReferenceFormTab.js +53 -1
  50. package/dist/mui/AutoReferenceTab.js +46 -1
  51. package/dist/mui/AutoTabs.js +19 -1
  52. package/dist/mui/components/ExtendedPagination.js +34 -1
  53. package/dist/mui/components/ListStringField.js +25 -1
  54. package/dist/providers/DashAuthProvider.js +215 -1
  55. package/dist/providers/DashDataProvider.js +310 -1
  56. package/dist/providers/index.js +10 -1
  57. package/dist/react-admin.d.js +0 -0
  58. package/dist/toolbar/buttons/BottomToolbarButtons.js +65 -1
  59. package/dist/toolbar/buttons/DashResourceButton.js +181 -1
  60. package/dist/toolbar/buttons/ListButtons.js +80 -1
  61. package/dist/toolbar/buttons/ToolbarButtons.js +135 -1
  62. package/dist/types/ActionCallback.d.js +0 -0
  63. package/dist/utils/SimpleLogger.js +52 -1
  64. package/dist/utils/enumToChoices.js +5 -1
  65. package/dist/utils/evalActionPermission.js +11 -1
  66. package/dist/utils/groupByTabs.js +21 -1
  67. package/dist/utils/hashedGroupByTabs.js +12 -1
  68. package/dist/utils/invertMap.js +12 -1
  69. package/dist/utils/isClassComponent.js +7 -1
  70. package/dist/utils/isComponent.js +29 -1
  71. package/dist/utils/isEnum.js +5 -1
  72. package/dist/utils/isFC.js +8 -1
  73. package/dist/utils/replaceParams.js +9 -1
  74. package/dist/utils/validate.js +19 -1
  75. package/dist/wrappers/UserAction.js +60 -1
  76. package/dist/wrappers/index.js +4 -1
  77. package/package.json +135 -120
  78. package/src/DashAutoAdminComponentRegistry.tsx +75 -0
  79. package/src/DashAutoAdminForm.tsx +155 -0
  80. package/src/DashAutoAdminResizableDrawer.tsx +69 -0
  81. package/src/DashAutoAdminSaveButton.tsx +116 -0
  82. package/src/DashAutoCreate.tsx +118 -0
  83. package/src/DashAutoDrawer.tsx +288 -0
  84. package/src/DashAutoEdit.tsx +109 -0
  85. package/src/DashAutoFiltersGenerator.tsx +208 -0
  86. package/src/DashAutoFormGroups.tsx +146 -0
  87. package/src/DashAutoFormLayout.tsx.review +113 -0
  88. package/src/DashAutoFormMuiTabs.tsx +368 -0
  89. package/src/DashAutoFormTabs.tsx +177 -0
  90. package/src/DashAutoGroup.tsx +42 -0
  91. package/src/DashAutoLayout.tsx +57 -0
  92. package/src/DashAutoList.tsx +237 -0
  93. package/src/DashAutoPostFilterForm.tsx +35 -0
  94. package/src/DashAutoReferenceTab.tsx +9 -0
  95. package/src/DashAutoResource.tsx +85 -0
  96. package/src/DashAutoResourceLayout.tsx +50 -0
  97. package/src/DashAutoShow.tsx +200 -0
  98. package/src/DashAutoTabbedForm.review.tsx +262 -0
  99. package/src/DashAutoTabbedForm.tsx +324 -0
  100. package/src/DashAutoTabs.tsx +19 -0
  101. package/src/DashFilterWrapper.tsx +43 -0
  102. package/src/DashRedirect.tsx +46 -0
  103. package/src/TabbedLayout.tsx +29 -0
  104. package/src/common/DashAutoTitle.tsx +24 -0
  105. package/src/common/components/FabButton.tsx +40 -0
  106. package/src/common/components/TranslatedLabel.tsx +81 -0
  107. package/src/common/settings/Settings.tsx +236 -0
  108. package/src/common/settings/SettingsBarIcons.tsx +72 -0
  109. package/src/context/DashAutoAdminFormContext.tsx +31 -0
  110. package/src/hooks/useAutoAdminLoadingStateMediator.tsx +42 -0
  111. package/src/hooks/useAutoAdminTranslate.tsx +106 -0
  112. package/src/hooks/useHash.tsx +27 -0
  113. package/src/hooks/useLogger.tsx +23 -0
  114. package/src/hooks/useRoutePathPattern.tsx +24 -0
  115. package/src/hooks/useVirtualHash.tsx +34 -0
  116. package/src/index.ts +85 -0
  117. package/src/interfaces/ICustomResourceSubComponent.ts +11 -0
  118. package/src/interfaces/IDashApplicationLayoutMainAction.ts +37 -0
  119. package/src/interfaces/IDashApplicationLayoutMenuItem.ts +24 -0
  120. package/src/interfaces/IDashAutoAdminAttribute.ts +104 -0
  121. package/src/interfaces/IDashAutoAdminCustomFieldComponent.ts +18 -0
  122. package/src/interfaces/IDashAutoAdminFormOptions.ts +22 -0
  123. package/src/interfaces/IDashAutoAdminListActions.ts +13 -0
  124. package/src/interfaces/IDashAutoAdminReference.ts +16 -0
  125. package/src/interfaces/IDashAutoAdminResourceConfig.ts +360 -0
  126. package/src/interfaces/IDashAutoForm.ts +24 -0
  127. package/src/interfaces/IDashAutoGridButton.ts +35 -0
  128. package/src/interfaces/IDashAutoShow.ts +12 -0
  129. package/src/interfaces/IGroupExtraData.ts +8 -0
  130. package/src/interfaces/IRecord.ts +7 -0
  131. package/src/interfaces/IReferenceFilter.ts +55 -0
  132. package/src/interfaces/IResourceComponent.ts +8 -0
  133. package/src/interfaces/IToolbarButton.ts +11 -0
  134. package/src/list/DashAutoListActions.tsx +88 -0
  135. package/src/list/DashAutoListDatagridWrapper.tsx +74 -0
  136. package/src/list/DashAutoListDefaultActionsWrapper.tsx +31 -0
  137. package/src/list/DashAutoListFilterFormWithButton.tsx +93 -0
  138. package/src/list/DashAutoListTopToolbar.tsx +240 -0
  139. package/src/mui/AttributeToField.tsx +657 -0
  140. package/src/mui/AttributeToInput.tsx +728 -0
  141. package/src/mui/AutoAdminResizableDrawer.tsx +69 -0
  142. package/src/mui/AutoDataGrid.tsx +127 -0
  143. package/src/mui/AutoReferenceFormTab.tsx +51 -0
  144. package/src/mui/AutoReferenceTab.tsx +45 -0
  145. package/src/mui/AutoTabs.tsx +32 -0
  146. package/src/mui/components/ExtendedPagination.tsx +23 -0
  147. package/src/mui/components/ListStringField.tsx +32 -0
  148. package/src/providers/DashAuthProvider.ts +341 -0
  149. package/src/providers/DashDataProvider.ts +466 -0
  150. package/src/providers/index.ts +17 -0
  151. package/src/toolbar/buttons/BottomToolbarButtons.tsx +59 -0
  152. package/src/toolbar/buttons/DashResourceButton.tsx +223 -0
  153. package/src/toolbar/buttons/ListButtons.tsx +137 -0
  154. package/src/toolbar/buttons/ToolbarButtons.tsx +186 -0
  155. package/src/utils/SimpleLogger.tsx +46 -0
  156. package/src/utils/enumToChoices.tsx +3 -0
  157. package/src/utils/evalActionPermission.tsx +14 -0
  158. package/src/utils/groupByTabs.tsx +23 -0
  159. package/src/utils/hashedGroupByTabs.tsx +16 -0
  160. package/src/utils/invertMap.tsx +10 -0
  161. package/src/utils/isClassComponent.tsx +9 -0
  162. package/src/utils/isComponent.tsx +45 -0
  163. package/src/utils/isEnum.tsx +3 -0
  164. package/src/utils/isFC.tsx +6 -0
  165. package/src/utils/replaceParams.tsx +6 -0
  166. package/src/utils/validate.tsx +24 -0
  167. package/src/wrappers/UserAction.tsx +67 -0
  168. package/src/wrappers/index.tsx +1 -0
  169. /package/{dist → src}/DashAutoAdminSaveButton.tsx.bkup +0 -0
  170. /package/{dist/DashAutoFormLayout.tsx.review → src/DashAutoFormLayout.tsx} +0 -0
  171. /package/{dist → src}/DashAutoFormTabs.review +0 -0
  172. /package/{dist → src}/DashAutoFormTabs.tsx.formcontext.wip +0 -0
  173. /package/{dist → src}/mui/AttributeToField.tsx.review +0 -0
  174. /package/{dist → src}/mui/AttributeToInput.tsx.review +0 -0
  175. /package/{dist → src}/react-admin.d.ts +0 -0
  176. /package/{dist → src}/types/ActionCallback.d.ts +0 -0
@@ -0,0 +1,23 @@
1
+ import { SimpleLogger } from '../utils/SimpleLogger';
2
+
3
+ export const useLogger = (logger: string) => {
4
+ const _logger = new SimpleLogger(logger, true);
5
+
6
+ const log = (...any: any[]) => {
7
+ _logger.log(any);
8
+ };
9
+
10
+ const info = (...any: any[]) => {
11
+ _logger.log(any);
12
+ };
13
+
14
+ const error = (...any: any[]) => {
15
+ _logger.error(any);
16
+ };
17
+
18
+ const warn = (...any: any[]) => {
19
+ _logger.warn(any);
20
+ };
21
+
22
+ return { info, log, error, warn };
23
+ };
@@ -0,0 +1,24 @@
1
+ import { useLocation, useParams } from 'react-router';
2
+
3
+ export const useRoutePathPattern = () => {
4
+ const routeParams = useParams();
5
+ const location = useLocation();
6
+
7
+ let routePathPattern = location.pathname;
8
+
9
+ Object.keys(routeParams)
10
+ .filter((paramKey) => paramKey !== '*')
11
+ .forEach((paramKey) => {
12
+ const paramValue = routeParams[paramKey];
13
+ const regexMiddle = new RegExp(`\/${paramValue}\/`, 'g');
14
+ const regexEnd = new RegExp(`\/${paramValue}$`, 'g');
15
+
16
+ routePathPattern = routePathPattern.replaceAll(
17
+ regexMiddle,
18
+ `/:${paramKey}/`,
19
+ );
20
+ routePathPattern = routePathPattern.replaceAll(regexEnd, `/:${paramKey}`);
21
+ });
22
+
23
+ return routePathPattern;
24
+ }
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ const useVirtualHash = () => {
4
+ const [hash, setHash] = React.useState<string>(() => window.location.hash);
5
+
6
+ const hashChangeHandler = React.useCallback((e) => {
7
+
8
+ setHash(e.data);
9
+ }, []);
10
+
11
+ React.useEffect(() => {
12
+ window.addEventListener('virtualhash', hashChangeHandler);
13
+ return () => {
14
+ window.removeEventListener('virtualhash', hashChangeHandler);
15
+ };
16
+ }, []);
17
+
18
+ const _update = React.useCallback(
19
+ (newHash) => {
20
+ history.replaceState(null, '', newHash);
21
+ window.dispatchEvent(new MessageEvent('virtualhash', { data: newHash }));
22
+ //}
23
+ },
24
+ [hash],
25
+ );
26
+
27
+ const setVirtualHash = (h: string) => {
28
+ _update(h);
29
+ };
30
+
31
+ return { hash, setVirtualHash };
32
+ };
33
+
34
+ export default useVirtualHash;
package/src/index.ts ADDED
@@ -0,0 +1,85 @@
1
+ /** Core */
2
+ export { default as DashAutoList } from './DashAutoList';
3
+ export { default as DashAutoDrawer } from './DashAutoDrawer';
4
+ export { default as DashAutoCreate } from './DashAutoCreate';
5
+ export { default as DashAutoEdit } from './DashAutoEdit';
6
+ export { default as DashAutoFormGroups } from './DashAutoFormGroups';
7
+ export { default as DashAutoFormLayout } from './DashAutoFormLayout';
8
+ export { default as DashAutoAdminForm } from './DashAutoAdminForm';
9
+ export { default as DashAutoFormTabs } from './DashAutoFormTabs';
10
+ export { default as DashAutoFormMuiTabs } from './DashAutoFormMuiTabs';
11
+ export { default as DashAutoReferenceTab } from './DashAutoReferenceTab';
12
+ export { default as DashAutoTabs } from './DashAutoTabs';
13
+ export { default as DashAutoLayout } from './DashAutoLayout';
14
+ export { default as DashAutoAdminSaveButton } from './DashAutoAdminSaveButton';
15
+ export type { IDashAutoAdminSaveButton } from './DashAutoAdminSaveButton';
16
+
17
+ /** Context */
18
+ export {
19
+ DashAutoAdminFormProvider,
20
+ useDashAutoAdminForm
21
+ } from './context/DashAutoAdminFormContext';
22
+ export type { IDashAutoAdminFormContext } from './context/DashAutoAdminFormContext';
23
+
24
+ export { default as DashAutoTitle } from './common/DashAutoTitle';
25
+
26
+ /** Interfaces */
27
+ export type { default as IDashAutoAdminCustomFieldComponent } from './interfaces/IDashAutoAdminCustomFieldComponent';
28
+ export type { default as ICustomResourceSubComponent } from './interfaces/ICustomResourceSubComponent';
29
+ export type { default as IDashAutoAdminAttribute } from './interfaces/IDashAutoAdminAttribute';
30
+ export type { default as IDashAutoAdminResourceConfig } from './interfaces/IDashAutoAdminResourceConfig';
31
+ export type { IDashAutoLayoutRenderFunction } from './DashAutoLayout';
32
+ export type { IDashAutoAdminDataGrid } from './list/DashAutoListDatagridWrapper';
33
+ export type { IDashAutoList } from './DashAutoList';
34
+
35
+ /** Utils */
36
+ export { default as isComponent } from './utils/isComponent';
37
+ export { default as isFC } from './utils/isFC';
38
+ export { default as isEnum } from './utils/isEnum';
39
+ export { default as invertMap } from './utils/invertMap';
40
+ export { default as enumToChoices } from './utils/enumToChoices';
41
+ export { default as groupByTabs } from './utils/groupByTabs';
42
+ export { default as validate } from './utils/validate';
43
+
44
+ /** Translation utilities */
45
+ export {
46
+ useAutoAdminTranslate,
47
+ isTranslationKey,
48
+ translateLabelSync
49
+ } from './hooks/useAutoAdminTranslate';
50
+ export { TranslatedLabel, withTranslatedLabel } from './common/components/TranslatedLabel';
51
+
52
+ export { default as DashRedirect } from './DashRedirect';
53
+
54
+ export { default as evalActionPermission } from './utils/evalActionPermission';
55
+
56
+ export {
57
+ ComponentRegistryProvider,
58
+ useComponentRegistry
59
+ } from './DashAutoAdminComponentRegistry';
60
+ export type {
61
+ ComponentRegistryContextType,
62
+ ComponentRegistryProviderProps
63
+ } from './DashAutoAdminComponentRegistry';
64
+
65
+ export interface IDashAutoAdminSettings {
66
+ /** */
67
+ library: 'mui';
68
+ /** */
69
+ defaultTabName: string;
70
+ }
71
+
72
+ export const AutoAdminSettings: IDashAutoAdminSettings = {
73
+ library: 'mui',
74
+ defaultTabName: 'Data',
75
+ };
76
+
77
+ /** Providers */
78
+ export {
79
+ createDashAuthProvider,
80
+ createDashDataProvider,
81
+ type DashAuthProviderConfig,
82
+ type DashAuthProviderOverrides,
83
+ type DashDataProviderConfig,
84
+ type DashDataProviderOverrides
85
+ } from './providers';
@@ -0,0 +1,11 @@
1
+ import IDashAutoAdminResourceConfig from './IDashAutoAdminResourceConfig';
2
+
3
+ /**
4
+ * Interface for a custom resource sub-component.
5
+ */
6
+ export default interface ICustomResourceSubComponent {
7
+ /**
8
+ * Configuration for the resource.
9
+ */
10
+ resourceConfig: IDashAutoAdminResourceConfig;
11
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Interface for defining the main action in a Dash application layout.
3
+ */
4
+ export default interface IDashApplicationLayoutMainAction {
5
+ /**
6
+ * The title of the main action.
7
+ */
8
+ title: string;
9
+
10
+ /**
11
+ * @deprecated
12
+ * The type of the main action, which can be one of the following:
13
+ * 'link', 'text', 'ghost', 'default', 'primary', 'dashed'.
14
+ */
15
+ type?: 'link' | 'text' | 'ghost' | 'default' | 'primary' | 'dashed';
16
+
17
+ /**
18
+ * The icon associated with the main action.
19
+ */
20
+ icon?: string;
21
+
22
+ /**
23
+ * @deprecated
24
+ * The function to be called when the main action is clicked.
25
+ */
26
+ onClick?: Function;
27
+
28
+ /**
29
+ * The URL to redirect to when the main action is triggered.
30
+ */
31
+ redirect?: string;
32
+ mode?: "create" | "show" | "edit"
33
+ /**
34
+ * The function type, which can be either 'redirect' or 'virtualhash'.
35
+ */
36
+ fn?: 'redirect' | 'virtualhash';
37
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Interface representing a menu item in the application layout
3
+ */
4
+ export default interface IApplicationLayoutMenuItem {
5
+ /**
6
+ * The display text of the menu item
7
+ */
8
+ title: string;
9
+
10
+ /**
11
+ * Optional click handler function for the menu item
12
+ */
13
+ onClick?: Function;
14
+
15
+ /**
16
+ * Optional URL or path to redirect to when menu item is clicked
17
+ */
18
+ redirect?: string;
19
+
20
+ /**
21
+ * Optional icon identifier for the menu item
22
+ */
23
+ icon?: string;
24
+ }
@@ -0,0 +1,104 @@
1
+ import { JSX, ReactNode } from 'react';
2
+
3
+ import IDashAutoAdminCustomFieldComponent from './IDashAutoAdminCustomFieldComponent';
4
+ import IRecord from './IRecord';
5
+
6
+ /**
7
+ * Interface for defining attributes and behavior of auto-admin fields.
8
+ * This interface provides a way to configure various aspects of form fields,
9
+ * such as their type, label, layout, and visibility in different views.
10
+ */
11
+ export default interface IDashAutoAdminAttribute<M = any> {
12
+ /** Model attribute name, must match with the json endpoint */
13
+ attribute: string;
14
+ /** Label for the field */
15
+ label?: string;
16
+ /** Flag to indicate if this is a custom field (deprecated - use type: "component" instead) */
17
+ custom?: boolean;
18
+ /**
19
+ * Type definition for the attribute that determines how it's rendered
20
+ * Can be a component, function component, string, array, object, or constructor
21
+ * For paths like '/api/category/{id}/resource.name', wrap params in '{}'.
22
+ * type logic is at the core of AttributeToInput and AttributeToField component.
23
+ * Allows certain literals to resolve specific components.
24
+ * Specific case: e.g: '/api/category/{id}/resource.name'
25
+ * when a string is provided with a custom component literal such as AutoCompleteInput,
26
+ * it is possible to wrap a react router param name to the resource path '{}'
27
+ */
28
+ type:
29
+ | 'custom'
30
+ | React.FC<IRecord>
31
+ | string
32
+ | string[]
33
+ | Object
34
+ | DateConstructor
35
+ | NumberConstructor
36
+ | StringConstructor
37
+ | IDashAutoAdminAttribute[];
38
+ /** Position order of the field */
39
+ position?: number;
40
+ /** Layout position key for the field */
41
+ layoutPosition?: React.Key;
42
+ /** Input component configuration */
43
+ input?: /*IntrinsicAttributes &*/ IDashAutoAdminCustomFieldComponent & {
44
+ /** */
45
+ children?: ReactNode;
46
+ };
47
+ /** Attribute name in the model */
48
+ modelAttribute?: string;
49
+ /** Variant style or type */
50
+ variant?: any;
51
+ /** Tab name where this field should appear */
52
+ tab?: string;
53
+ /** Whether to show in list view */
54
+ inList?: boolean;
55
+ /** Whether to show in drawer view */
56
+ inDrawer?: boolean;
57
+ /** Whether to show in show view */
58
+ inShow?: boolean;
59
+ /** Whether to show in edit view */
60
+ inEdit?: boolean;
61
+ /** Whether to show in create view */
62
+ inCreate?: boolean;
63
+ /** Whether to display the label */
64
+ showLabel?: boolean;
65
+ /** Whether field is extended */
66
+ extended?: boolean;
67
+ /** Whether field is read-only */
68
+ readOnly?: boolean;
69
+ /** Whether field is a password input */
70
+ isPassword?: boolean;
71
+ /** Additional field options */
72
+ fieldProps?: any;
73
+ slotProps?: any;
74
+ /** Action for the field : ReactNode | React.FC<IRecord> | ActionCallback;*/
75
+ action?: any;
76
+ /** Additional props for the component */
77
+ componentProps?: any;
78
+ /** Validation function for the field */
79
+ validate?: (value: any, allValues: any) => void;
80
+ /** Some components handle by default the react-hook-form error, use this prop to hide the DASH Auto default error message */
81
+ hideErrorMessage?: boolean;
82
+ /** Whether to enable pagination */
83
+ pagination?: boolean;
84
+ /** Whether multiple values are allowed */
85
+ multiple?: boolean;
86
+ /** Whether field is sortable */
87
+ sortable?: boolean;
88
+ /** Custom component for rendering the field */
89
+ component?: string | (React.FC<IDashAutoAdminCustomFieldComponent> | ((props:IDashAutoAdminCustomFieldComponent) => JSX.Element) | ((props:any) => JSX.Element));
90
+ /** Field to use for search functionality */
91
+ searchField?: string;
92
+ /** Attribute to use for list display */
93
+ listAttribute?: string;
94
+ /** Whether field is a data form */
95
+ isDataForm?: boolean;
96
+ /** Processor type for the field */
97
+ processor?: 'Blob' | 'RawFile' | 'Boolean' | 'Null' | string;
98
+ /** When true, forces use of default schema show field even with custom component */
99
+ useCustomShowField?: boolean;
100
+
101
+ metadata?: M;
102
+ default_value?: any;
103
+ fieldOptions?:any;
104
+ }
@@ -0,0 +1,18 @@
1
+ import { JSX } from 'react';
2
+ import IDashAutoAdminAttribute from './IDashAutoAdminAttribute';
3
+ import IDashAutoAdminResourceConfig from './IDashAutoAdminResourceConfig';
4
+
5
+ export default interface IDashAutoAdminCustomFieldComponent {
6
+ attribute: IDashAutoAdminAttribute; // TODO attribute must required?
7
+ method: 'list' | 'view' | 'edit' | 'create';
8
+ resourceConfig: IDashAutoAdminResourceConfig;
9
+ record?: any;
10
+ locale?: string;
11
+ options?: any;
12
+
13
+ /** */
14
+ children?: JSX.Element;
15
+ [x: string]: any;
16
+ }
17
+
18
+
@@ -0,0 +1,22 @@
1
+ export default interface IDashAutoAdminFormOptions {
2
+ /** */
3
+ mode: 'list' | 'create' | 'edit' | 'view';
4
+ /** */
5
+ label?: string;
6
+ /** */
7
+ saveButtonProps?: any;
8
+ /** */
9
+ useReadOnlyInputAsTextField?: boolean;
10
+ /** */
11
+ readOnlyComponent?: any;
12
+ /** */
13
+ record?: any;
14
+ /** */
15
+ meta?: any;
16
+ /** */
17
+ isDrawer?: boolean;
18
+ /** */
19
+ handleChange?: (e:any) => void;
20
+ /** */
21
+ locale?: string;
22
+ }
@@ -0,0 +1,13 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import IDashAutoAdminResourceConfig from './IDashAutoAdminResourceConfig';
3
+
4
+ export interface IDashAutoAdminListActions extends PropsWithChildren {
5
+ /** */
6
+ resourceConfig: IDashAutoAdminResourceConfig;
7
+ /** */
8
+ listProps: any;
9
+ //isLoading: boolean;
10
+ //data: any;
11
+ }
12
+
13
+ export default IDashAutoAdminListActions;
@@ -0,0 +1,16 @@
1
+ import IDashAutoAdminAttribute from './IDashAutoAdminAttribute';
2
+
3
+ export interface IDashAutoAdminReference {
4
+ /** */
5
+ reference: string;
6
+ /** */
7
+ target: string;
8
+ /** */
9
+ type?: 'ReferenceArrayField' | 'ReferenceManyField';
10
+ /** */
11
+ tab?: string;
12
+ /** */
13
+ schema: IDashAutoAdminAttribute[];
14
+ /** */
15
+ BulkActions?: any;
16
+ }