@goplusvn/core 0.1.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 (223) hide show
  1. package/dist/audit/index.d.mts +115 -0
  2. package/dist/audit/index.d.ts +115 -0
  3. package/dist/audit/index.js +204 -0
  4. package/dist/audit/index.js.map +1 -0
  5. package/dist/audit/index.mjs +200 -0
  6. package/dist/audit/index.mjs.map +1 -0
  7. package/dist/auth/index.d.mts +86 -0
  8. package/dist/auth/index.d.ts +86 -0
  9. package/dist/auth/index.js +210 -0
  10. package/dist/auth/index.js.map +1 -0
  11. package/dist/auth/index.mjs +198 -0
  12. package/dist/auth/index.mjs.map +1 -0
  13. package/dist/button-1dWvP9Ib.d.mts +30 -0
  14. package/dist/button-1dWvP9Ib.d.ts +30 -0
  15. package/dist/calendar-2QzdEo1z.d.mts +20 -0
  16. package/dist/calendar-2QzdEo1z.d.ts +20 -0
  17. package/dist/code-generation/index.d.mts +30 -0
  18. package/dist/code-generation/index.d.ts +30 -0
  19. package/dist/code-generation/index.js +31 -0
  20. package/dist/code-generation/index.js.map +1 -0
  21. package/dist/code-generation/index.mjs +28 -0
  22. package/dist/code-generation/index.mjs.map +1 -0
  23. package/dist/configs/index.d.mts +175 -0
  24. package/dist/configs/index.d.ts +175 -0
  25. package/dist/configs/index.js +254 -0
  26. package/dist/configs/index.js.map +1 -0
  27. package/dist/configs/index.mjs +233 -0
  28. package/dist/configs/index.mjs.map +1 -0
  29. package/dist/crud/index.d.mts +646 -0
  30. package/dist/crud/index.d.ts +646 -0
  31. package/dist/crud/index.js +11772 -0
  32. package/dist/crud/index.js.map +1 -0
  33. package/dist/crud/index.mjs +11665 -0
  34. package/dist/crud/index.mjs.map +1 -0
  35. package/dist/crud/server.d.mts +20 -0
  36. package/dist/crud/server.d.ts +20 -0
  37. package/dist/crud/server.js +123 -0
  38. package/dist/crud/server.js.map +1 -0
  39. package/dist/crud/server.mjs +120 -0
  40. package/dist/crud/server.mjs.map +1 -0
  41. package/dist/data-table-skeleton-12NA8Mjx.d.mts +39 -0
  42. package/dist/data-table-skeleton-12NA8Mjx.d.ts +39 -0
  43. package/dist/dialog-bKfjZMTd.d.mts +22 -0
  44. package/dist/dialog-bKfjZMTd.d.ts +22 -0
  45. package/dist/dynamic-icon-DrGIiu2N.d.mts +10 -0
  46. package/dist/dynamic-icon-DrGIiu2N.d.ts +10 -0
  47. package/dist/home/index.d.mts +269 -0
  48. package/dist/home/index.d.ts +269 -0
  49. package/dist/home/index.js +1678 -0
  50. package/dist/home/index.js.map +1 -0
  51. package/dist/home/index.mjs +1635 -0
  52. package/dist/home/index.mjs.map +1 -0
  53. package/dist/hooks/index.d.mts +7 -0
  54. package/dist/hooks/index.d.ts +7 -0
  55. package/dist/hooks/index.js +8316 -0
  56. package/dist/hooks/index.js.map +1 -0
  57. package/dist/hooks/index.mjs +8255 -0
  58. package/dist/hooks/index.mjs.map +1 -0
  59. package/dist/index-50hpiPrV.d.ts +116 -0
  60. package/dist/index-B9zQVEVi.d.mts +116 -0
  61. package/dist/index.d.mts +5 -0
  62. package/dist/index.d.ts +5 -0
  63. package/dist/index.js +123 -0
  64. package/dist/index.js.map +1 -0
  65. package/dist/index.mjs +118 -0
  66. package/dist/index.mjs.map +1 -0
  67. package/dist/infrastructure/index.d.mts +423 -0
  68. package/dist/infrastructure/index.d.ts +423 -0
  69. package/dist/infrastructure/index.js +633 -0
  70. package/dist/infrastructure/index.js.map +1 -0
  71. package/dist/infrastructure/index.mjs +619 -0
  72. package/dist/infrastructure/index.mjs.map +1 -0
  73. package/dist/label-DWTEkNPo.d.ts +226 -0
  74. package/dist/label-LPpdcoBx.d.mts +226 -0
  75. package/dist/layout/index.d.mts +48 -0
  76. package/dist/layout/index.d.ts +48 -0
  77. package/dist/layout/index.js +117 -0
  78. package/dist/layout/index.js.map +1 -0
  79. package/dist/layout/index.mjs +90 -0
  80. package/dist/layout/index.mjs.map +1 -0
  81. package/dist/navigation/index.d.mts +16 -0
  82. package/dist/navigation/index.d.ts +16 -0
  83. package/dist/navigation/index.js +53 -0
  84. package/dist/navigation/index.js.map +1 -0
  85. package/dist/navigation/index.mjs +50 -0
  86. package/dist/navigation/index.mjs.map +1 -0
  87. package/dist/notification/index.d.mts +105 -0
  88. package/dist/notification/index.d.ts +105 -0
  89. package/dist/notification/index.js +278 -0
  90. package/dist/notification/index.js.map +1 -0
  91. package/dist/notification/index.mjs +274 -0
  92. package/dist/notification/index.mjs.map +1 -0
  93. package/dist/organization/index.d.mts +99 -0
  94. package/dist/organization/index.d.ts +99 -0
  95. package/dist/organization/index.js +360 -0
  96. package/dist/organization/index.js.map +1 -0
  97. package/dist/organization/index.mjs +352 -0
  98. package/dist/organization/index.mjs.map +1 -0
  99. package/dist/plugin/index.d.mts +83 -0
  100. package/dist/plugin/index.d.ts +83 -0
  101. package/dist/plugin/index.js +86 -0
  102. package/dist/plugin/index.js.map +1 -0
  103. package/dist/plugin/index.mjs +84 -0
  104. package/dist/plugin/index.mjs.map +1 -0
  105. package/dist/providers/index.d.mts +25 -0
  106. package/dist/providers/index.d.ts +25 -0
  107. package/dist/providers/index.js +84 -0
  108. package/dist/providers/index.js.map +1 -0
  109. package/dist/providers/index.mjs +77 -0
  110. package/dist/providers/index.mjs.map +1 -0
  111. package/dist/rbac/index.d.mts +226 -0
  112. package/dist/rbac/index.d.ts +226 -0
  113. package/dist/rbac/index.js +4784 -0
  114. package/dist/rbac/index.js.map +1 -0
  115. package/dist/rbac/index.mjs +4722 -0
  116. package/dist/rbac/index.mjs.map +1 -0
  117. package/dist/rbac/permissions.d.mts +26 -0
  118. package/dist/rbac/permissions.d.ts +26 -0
  119. package/dist/rbac/permissions.js +94 -0
  120. package/dist/rbac/permissions.js.map +1 -0
  121. package/dist/rbac/permissions.mjs +90 -0
  122. package/dist/rbac/permissions.mjs.map +1 -0
  123. package/dist/rbac/server.d.mts +1 -0
  124. package/dist/rbac/server.d.ts +1 -0
  125. package/dist/rbac/server.js +128 -0
  126. package/dist/rbac/server.js.map +1 -0
  127. package/dist/rbac/server.mjs +124 -0
  128. package/dist/rbac/server.mjs.map +1 -0
  129. package/dist/schemas/index.d.mts +1257 -0
  130. package/dist/schemas/index.d.ts +1257 -0
  131. package/dist/schemas/index.js +572 -0
  132. package/dist/schemas/index.js.map +1 -0
  133. package/dist/schemas/index.mjs +523 -0
  134. package/dist/schemas/index.mjs.map +1 -0
  135. package/dist/server-QuYCTa89.d.mts +83 -0
  136. package/dist/server-QuYCTa89.d.ts +83 -0
  137. package/dist/sonner-C74GlRDQ.d.mts +71 -0
  138. package/dist/sonner-C74GlRDQ.d.ts +71 -0
  139. package/dist/status-BOXZgIqX.d.mts +12 -0
  140. package/dist/status-BOXZgIqX.d.ts +12 -0
  141. package/dist/system/index.d.mts +77 -0
  142. package/dist/system/index.d.ts +77 -0
  143. package/dist/system/index.js +102 -0
  144. package/dist/system/index.js.map +1 -0
  145. package/dist/system/index.mjs +100 -0
  146. package/dist/system/index.mjs.map +1 -0
  147. package/dist/tabs-C6FfBwPY.d.mts +18 -0
  148. package/dist/tabs-C6FfBwPY.d.ts +18 -0
  149. package/dist/tenant-provider-B8eC_Wpb.d.mts +27 -0
  150. package/dist/tenant-provider-B8eC_Wpb.d.ts +27 -0
  151. package/dist/types/index.d.mts +469 -0
  152. package/dist/types/index.d.ts +469 -0
  153. package/dist/types/index.js +25 -0
  154. package/dist/types/index.js.map +1 -0
  155. package/dist/types/index.mjs +21 -0
  156. package/dist/types/index.mjs.map +1 -0
  157. package/dist/ui/auth.d.mts +39 -0
  158. package/dist/ui/auth.d.ts +39 -0
  159. package/dist/ui/auth.js +4941 -0
  160. package/dist/ui/auth.js.map +1 -0
  161. package/dist/ui/auth.mjs +4896 -0
  162. package/dist/ui/auth.mjs.map +1 -0
  163. package/dist/ui/crud.d.mts +2 -0
  164. package/dist/ui/crud.d.ts +2 -0
  165. package/dist/ui/crud.js +4 -0
  166. package/dist/ui/crud.js.map +1 -0
  167. package/dist/ui/crud.mjs +3 -0
  168. package/dist/ui/crud.mjs.map +1 -0
  169. package/dist/ui/data-display.d.mts +596 -0
  170. package/dist/ui/data-display.d.ts +596 -0
  171. package/dist/ui/data-display.js +5307 -0
  172. package/dist/ui/data-display.js.map +1 -0
  173. package/dist/ui/data-display.mjs +5212 -0
  174. package/dist/ui/data-display.mjs.map +1 -0
  175. package/dist/ui/feedback.d.mts +55 -0
  176. package/dist/ui/feedback.d.ts +55 -0
  177. package/dist/ui/feedback.js +2608 -0
  178. package/dist/ui/feedback.js.map +1 -0
  179. package/dist/ui/feedback.mjs +2526 -0
  180. package/dist/ui/feedback.mjs.map +1 -0
  181. package/dist/ui/forms.d.mts +309 -0
  182. package/dist/ui/forms.d.ts +309 -0
  183. package/dist/ui/forms.js +4656 -0
  184. package/dist/ui/forms.js.map +1 -0
  185. package/dist/ui/forms.mjs +4571 -0
  186. package/dist/ui/forms.mjs.map +1 -0
  187. package/dist/ui/index.d.mts +331 -0
  188. package/dist/ui/index.d.ts +331 -0
  189. package/dist/ui/index.js +16953 -0
  190. package/dist/ui/index.js.map +1 -0
  191. package/dist/ui/index.mjs +16598 -0
  192. package/dist/ui/index.mjs.map +1 -0
  193. package/dist/ui/primitives/client.d.mts +61 -0
  194. package/dist/ui/primitives/client.d.ts +61 -0
  195. package/dist/ui/primitives/client.js +3408 -0
  196. package/dist/ui/primitives/client.js.map +1 -0
  197. package/dist/ui/primitives/client.mjs +3256 -0
  198. package/dist/ui/primitives/client.mjs.map +1 -0
  199. package/dist/ui/primitives.d.mts +113 -0
  200. package/dist/ui/primitives.d.ts +113 -0
  201. package/dist/ui/primitives.js +3356 -0
  202. package/dist/ui/primitives.js.map +1 -0
  203. package/dist/ui/primitives.mjs +3227 -0
  204. package/dist/ui/primitives.mjs.map +1 -0
  205. package/dist/user/index.d.mts +228 -0
  206. package/dist/user/index.d.ts +228 -0
  207. package/dist/user/index.js +4306 -0
  208. package/dist/user/index.js.map +1 -0
  209. package/dist/user/index.mjs +4260 -0
  210. package/dist/user/index.mjs.map +1 -0
  211. package/dist/utils/index.d.mts +205 -0
  212. package/dist/utils/index.d.ts +205 -0
  213. package/dist/utils/index.js +574 -0
  214. package/dist/utils/index.js.map +1 -0
  215. package/dist/utils/index.mjs +514 -0
  216. package/dist/utils/index.mjs.map +1 -0
  217. package/dist/workflow/index.d.mts +40 -0
  218. package/dist/workflow/index.d.ts +40 -0
  219. package/dist/workflow/index.js +3710 -0
  220. package/dist/workflow/index.js.map +1 -0
  221. package/dist/workflow/index.mjs +3677 -0
  222. package/dist/workflow/index.mjs.map +1 -0
  223. package/package.json +311 -0
@@ -0,0 +1,646 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { EntityConfig, CrudPermissions, CrudResponse, ActiveFilter, SortingState, CrudQueryParams, ExportOptions, FieldConfig, FilterOperator, DataSource, ImportOptions, ImportResult } from '../types/index.mjs';
3
+ import * as React$1 from 'react';
4
+ import { ReactNode } from 'react';
5
+ import { useForm } from 'react-hook-form';
6
+ import { a as DictionaryType } from '../index-B9zQVEVi.mjs';
7
+ import { Table } from '@tanstack/react-table';
8
+ import { z } from 'zod';
9
+ export { getCrudPermissions, mergePermissions } from './server.mjs';
10
+ export { a as CrudTableSkeleton, b as CrudTableSkeletonProps } from '../data-table-skeleton-12NA8Mjx.mjs';
11
+ import 'lucide-react';
12
+ import '../tenant-provider-B8eC_Wpb.mjs';
13
+ import 'next-auth';
14
+
15
+ interface CrudBulkActionsProps {
16
+ config: EntityConfig;
17
+ permissions: CrudPermissions;
18
+ onDelete?: (rowIds: string[]) => void;
19
+ onExport?: (rowIds: string[]) => void;
20
+ }
21
+ declare function CrudBulkActions({ config, permissions, onDelete, onExport, }: CrudBulkActionsProps): react_jsx_runtime.JSX.Element | null;
22
+
23
+ interface CrudCardViewProps<TData = Record<string, unknown>> {
24
+ config: EntityConfig;
25
+ data: CrudResponse<TData>;
26
+ permissions: CrudPermissions;
27
+ loading?: boolean;
28
+ onEdit?: (rowId: string, rowData?: Record<string, unknown>) => void;
29
+ onDelete?: (rowId: string) => void;
30
+ onCustomAction?: (action: string, rowId: string, rowData: Record<string, unknown>) => void | Promise<void>;
31
+ onEmptyStateAction?: {
32
+ onCreate?: () => void;
33
+ onClearSearch?: () => void;
34
+ onClearFilters?: () => void;
35
+ };
36
+ }
37
+ declare function CrudCardView<TData extends Record<string, unknown>>({ config: propConfig, // Rename to avoid conflict if we use context, but here we might just use props as it was designed
38
+ data, permissions: propPermissions, loading, onEdit, onDelete, onCustomAction, onEmptyStateAction, }: CrudCardViewProps<TData>): react_jsx_runtime.JSX.Element;
39
+
40
+ interface CrudTranslations {
41
+ edit?: string;
42
+ delete?: string;
43
+ save?: string;
44
+ cancel?: string;
45
+ create?: string;
46
+ update?: string;
47
+ creating?: string;
48
+ updating?: string;
49
+ deleting?: string;
50
+ savedSuccessfully?: string;
51
+ createdSuccessfully?: string;
52
+ updatedSuccessfully?: string;
53
+ confirmDeleteTitle?: string;
54
+ confirmBulkDeleteTitle?: string;
55
+ confirmDeleteDescription?: string;
56
+ confirmBulkDeleteDescription?: string;
57
+ deleteSelected?: string;
58
+ actions?: string;
59
+ add?: string;
60
+ addNew?: string;
61
+ }
62
+ interface CrudConfigContextValue {
63
+ config: EntityConfig | null;
64
+ setConfig: (config: EntityConfig) => void;
65
+ permissions: CrudPermissions;
66
+ setPermissions: (permissions: CrudPermissions) => void;
67
+ translations: CrudTranslations;
68
+ setTranslations: (translations: CrudTranslations) => void;
69
+ }
70
+ declare const CrudConfigContext: React$1.Context<CrudConfigContextValue | undefined>;
71
+ declare function useCrudConfig(): CrudConfigContextValue;
72
+ interface CrudStateContextValue {
73
+ search: string;
74
+ setSearch: (search: string) => void;
75
+ filters: ActiveFilter[];
76
+ setFilters: (filters: ActiveFilter[]) => void;
77
+ addFilter: (filter: ActiveFilter) => void;
78
+ removeFilter: (filterName: string) => void;
79
+ updateFilter: (filterName: string, value: unknown) => void;
80
+ clearFilters: () => void;
81
+ pagination: {
82
+ page: number;
83
+ pageSize: number;
84
+ };
85
+ setPagination: (pagination: {
86
+ page: number;
87
+ pageSize: number;
88
+ }) => void;
89
+ setPage: (page: number) => void;
90
+ setPageSize: (pageSize: number) => void;
91
+ sorting: SortingState | null;
92
+ setSorting: (sorting: SortingState | null) => void;
93
+ getQueryParams: () => CrudQueryParams;
94
+ }
95
+ declare const CrudStateContext: React$1.Context<CrudStateContextValue | undefined>;
96
+ declare function useCrudState(): CrudStateContextValue;
97
+ interface CrudSelectionContextValue {
98
+ selectedRows: Set<string>;
99
+ setSelectedRows: (selectedRows: Set<string>) => void;
100
+ toggleRowSelection: (rowId: string) => void;
101
+ selectAllRows: (rowIds: string[]) => void;
102
+ clearSelection: () => void;
103
+ }
104
+ declare const CrudSelectionContext: React$1.Context<CrudSelectionContextValue | undefined>;
105
+ declare function useCrudSelection(): CrudSelectionContextValue;
106
+
107
+ interface CrudDeleteDialogProps {
108
+ open: boolean;
109
+ onOpenChange: (open: boolean) => void;
110
+ config: EntityConfig;
111
+ itemData?: Record<string, unknown>;
112
+ itemCount?: number;
113
+ onConfirm: () => void;
114
+ loading?: boolean;
115
+ translations?: {
116
+ confirmDeleteTitle?: string;
117
+ confirmBulkDeleteTitle?: string;
118
+ confirmDeleteDescription?: string;
119
+ confirmBulkDeleteDescription?: string;
120
+ cancel?: string;
121
+ delete?: string;
122
+ deleting?: string;
123
+ };
124
+ }
125
+ declare function CrudDeleteDialog({ open, onOpenChange, config, itemData, itemCount, onConfirm, loading, translations, }: CrudDeleteDialogProps): react_jsx_runtime.JSX.Element;
126
+
127
+ interface CrudDialogProps {
128
+ open: boolean;
129
+ onOpenChange: (open: boolean) => void;
130
+ config: EntityConfig;
131
+ initialData?: Record<string, unknown>;
132
+ mode?: "create" | "edit";
133
+ onSubmit: (data: Record<string, unknown>) => Promise<void> | void;
134
+ }
135
+ declare function CrudDialog({ open, onOpenChange, config, initialData, mode, onSubmit, }: CrudDialogProps): react_jsx_runtime.JSX.Element;
136
+
137
+ interface CrudEmptyStateProps {
138
+ config: EntityConfig;
139
+ hasSearch?: boolean;
140
+ hasFilters?: boolean;
141
+ onClearSearch?: () => void;
142
+ onClearFilters?: () => void;
143
+ onCreate?: () => void;
144
+ canCreate?: boolean;
145
+ }
146
+ declare function CrudEmptyState({ config, hasSearch, hasFilters, onClearSearch, onClearFilters, onCreate, canCreate, }: CrudEmptyStateProps): react_jsx_runtime.JSX.Element;
147
+
148
+ interface CrudExportButtonProps {
149
+ endpoint: string;
150
+ filters?: ActiveFilter[];
151
+ search?: string;
152
+ canExport?: boolean;
153
+ format?: ExportOptions["format"];
154
+ }
155
+ declare function CrudExportButton({ endpoint, filters, search, canExport, }: CrudExportButtonProps): react_jsx_runtime.JSX.Element | null;
156
+
157
+ interface CrudFieldRendererProps {
158
+ field: FieldConfig;
159
+ mode?: "create" | "edit";
160
+ }
161
+ declare function CrudFieldRenderer({ field, mode, }: CrudFieldRendererProps): react_jsx_runtime.JSX.Element;
162
+
163
+ interface CrudFilterChipsProps {
164
+ config: EntityConfig;
165
+ }
166
+ declare function CrudFilterChips({ config }: CrudFilterChipsProps): react_jsx_runtime.JSX.Element | null;
167
+
168
+ interface CrudFormProps {
169
+ config: EntityConfig;
170
+ initialData?: Record<string, unknown>;
171
+ onSubmit: (data: Record<string, unknown>) => Promise<void> | void;
172
+ onCancel?: () => void;
173
+ submitLabel?: string;
174
+ cancelLabel?: string;
175
+ submittingLabel?: string;
176
+ isSubmitting?: boolean;
177
+ mode?: "create" | "edit";
178
+ enableAutoSave?: boolean;
179
+ onFormReady?: (form: ReturnType<typeof useForm>) => void;
180
+ }
181
+ declare const CrudForm: React$1.ForwardRefExoticComponent<CrudFormProps & React$1.RefAttributes<HTMLFormElement>>;
182
+
183
+ interface CrudImportDialogProps {
184
+ config: EntityConfig;
185
+ endpoint: string;
186
+ canImport?: boolean;
187
+ onSuccess?: () => void;
188
+ open?: boolean;
189
+ onOpenChange?: (open: boolean) => void;
190
+ }
191
+ declare function CrudImportDialog({ config, endpoint, canImport, onSuccess, open: controlledOpen, onOpenChange: controlledOnOpenChange, }: CrudImportDialogProps): react_jsx_runtime.JSX.Element | null;
192
+
193
+ interface CrudInfiniteScrollProps {
194
+ endpoint: string;
195
+ queryParams: CrudQueryParams;
196
+ onLoadMore: (data: unknown[]) => void;
197
+ mode?: "auto" | "button";
198
+ }
199
+ declare function CrudInfiniteScroll({ endpoint, queryParams, onLoadMore, mode, }: CrudInfiniteScrollProps): react_jsx_runtime.JSX.Element | null;
200
+
201
+ interface CrudPageProps {
202
+ config: EntityConfig;
203
+ permissions: CrudPermissions;
204
+ entityName?: string;
205
+ dictionary: DictionaryType;
206
+ customActions?: React.ReactNode;
207
+ }
208
+ declare function CrudPage({ config, permissions, entityName, dictionary, customActions, }: CrudPageProps): react_jsx_runtime.JSX.Element;
209
+
210
+ interface CrudContextValue extends CrudConfigContextValue, CrudStateContextValue, CrudSelectionContextValue {
211
+ }
212
+ interface CrudProviderProps {
213
+ children: ReactNode;
214
+ initialConfig?: EntityConfig;
215
+ initialPermissions?: CrudPermissions;
216
+ initialTranslations?: CrudTranslations;
217
+ }
218
+ declare function CrudProvider({ children, initialConfig, initialPermissions, initialTranslations, }: CrudProviderProps): react_jsx_runtime.JSX.Element;
219
+ declare function useCrudContext(): CrudContextValue;
220
+
221
+ interface CrudRowActionsProps {
222
+ rowId: string;
223
+ rowData: Record<string, unknown>;
224
+ config: EntityConfig;
225
+ permissions: CrudPermissions;
226
+ onEdit?: (rowId: string, rowData?: Record<string, unknown>) => void;
227
+ onDelete?: (rowId: string) => void;
228
+ onCustomAction?: (action: string, rowId: string, rowData: Record<string, unknown>) => void | Promise<void>;
229
+ translations?: {
230
+ edit?: string;
231
+ delete?: string;
232
+ actions?: string;
233
+ };
234
+ }
235
+ declare function CrudRowActions({ rowId, rowData, config, permissions, onEdit, onDelete, onCustomAction, translations, }: CrudRowActionsProps): react_jsx_runtime.JSX.Element | null;
236
+
237
+ interface CrudSearchProps {
238
+ placeholder?: string;
239
+ debounceMs?: number;
240
+ }
241
+ declare function CrudSearch({ placeholder, debounceMs, }: CrudSearchProps): react_jsx_runtime.JSX.Element;
242
+
243
+ interface CrudSheetProps {
244
+ open: boolean;
245
+ onOpenChange: (open: boolean) => void;
246
+ config: EntityConfig;
247
+ initialData?: Record<string, unknown>;
248
+ mode?: "create" | "edit";
249
+ onSubmit: (data: Record<string, unknown>) => Promise<void> | void;
250
+ side?: "top" | "right" | "bottom" | "left";
251
+ }
252
+ declare function CrudSheet({ open, onOpenChange, config, initialData, mode, onSubmit, side, }: CrudSheetProps): react_jsx_runtime.JSX.Element;
253
+
254
+ interface LegacyCrudTableSkeletonProps {
255
+ columns: number;
256
+ rows?: number;
257
+ }
258
+ /**
259
+ * @deprecated Use DataTableSkeleton from @goerp/core/ui instead
260
+ * This is kept for backward compatibility
261
+ */
262
+ declare function CrudTableSkeletonLegacy({ columns, rows, }: LegacyCrudTableSkeletonProps): react_jsx_runtime.JSX.Element;
263
+
264
+ interface CrudTableToolbarProps<TData> {
265
+ table?: Table<TData>;
266
+ config: EntityConfig;
267
+ permissions: CrudPermissions;
268
+ viewMode?: "table" | "card";
269
+ onViewModeChange?: (mode: "table" | "card") => void;
270
+ }
271
+ declare function CrudTableToolbar<TData>({ table, config, permissions, viewMode, onViewModeChange, }: CrudTableToolbarProps<TData>): react_jsx_runtime.JSX.Element;
272
+
273
+ interface CrudTableProps<TData = Record<string, unknown>> {
274
+ data: CrudResponse<TData>;
275
+ loading?: boolean;
276
+ onEdit?: (rowId: string, rowData?: Record<string, unknown>) => void;
277
+ onDelete?: (rowId: string) => void;
278
+ onCustomAction?: (action: string, rowId: string, rowData: Record<string, unknown>) => void | Promise<void>;
279
+ onTableReady?: (table: Table<TData>) => void;
280
+ onEmptyStateAction?: {
281
+ onCreate?: () => void;
282
+ onClearSearch?: () => void;
283
+ onClearFilters?: () => void;
284
+ };
285
+ getTranslation?: (key: string) => string;
286
+ }
287
+ declare function CrudTable<TData extends Record<string, unknown>>({ data, loading, onEdit, onDelete, onCustomAction, onTableReady, onEmptyStateAction, getTranslation, }: CrudTableProps<TData>): react_jsx_runtime.JSX.Element;
288
+
289
+ interface CrudVirtualTableProps<TData = Record<string, unknown>> {
290
+ config: EntityConfig;
291
+ data: CrudResponse<TData>;
292
+ permissions: CrudPermissions;
293
+ loading?: boolean;
294
+ onEdit?: (rowId: string) => void;
295
+ onDelete?: (rowId: string) => void;
296
+ }
297
+ /**
298
+ * Virtual table component for large datasets
299
+ *
300
+ * TODO: Implement with @tanstack/react-virtual when needed
301
+ * Example implementation:
302
+ *
303
+ * import { useVirtualizer } from '@tanstack/react-virtual'
304
+ *
305
+ * const parentRef = useRef<HTMLDivElement>(null)
306
+ * const virtualizer = useVirtualizer({
307
+ * count: data.data.length,
308
+ * getScrollElement: () => parentRef.current,
309
+ * estimateSize: () => 50,
310
+ * overscan: 5,
311
+ * })
312
+ */
313
+ declare function CrudVirtualTable<TData extends Record<string, unknown>>({ config, data, permissions, loading, onEdit, onDelete, }: CrudVirtualTableProps<TData>): react_jsx_runtime.JSX.Element;
314
+
315
+ interface EntityCrudPageProps {
316
+ entity: string;
317
+ lang: string;
318
+ config: EntityConfig;
319
+ session: any;
320
+ dictionary: any;
321
+ }
322
+ declare function EntityCrudPage({ entity, lang, config, session, dictionary, }: EntityCrudPageProps): Promise<react_jsx_runtime.JSX.Element>;
323
+
324
+ declare class CrudService {
325
+ /**
326
+ * Fetch list of records
327
+ */
328
+ fetch<T = Record<string, unknown>>(endpoint: string, params: CrudQueryParams, signal?: AbortSignal): Promise<CrudResponse<T>>;
329
+ /**
330
+ * Create a new record
331
+ */
332
+ create(endpoint: string, data: Record<string, unknown>): Promise<Record<string, unknown>>;
333
+ /**
334
+ * Update an existing record
335
+ */
336
+ update(endpoint: string, id: string, data: Record<string, unknown>): Promise<Record<string, unknown>>;
337
+ /**
338
+ * Delete a record
339
+ */
340
+ delete(endpoint: string, id: string): Promise<void>;
341
+ /**
342
+ * Delete multiple records
343
+ */
344
+ deleteMany(endpoint: string, ids: string[]): Promise<void>;
345
+ }
346
+ declare const crudService: CrudService;
347
+
348
+ /**
349
+ * Build query string from CrudQueryParams
350
+ */
351
+ declare function buildQueryString(params: CrudQueryParams): string;
352
+ /**
353
+ * Parse query string to CrudQueryParams
354
+ */
355
+ declare function parseQueryString(searchParams: URLSearchParams): CrudQueryParams;
356
+ /**
357
+ * Apply filter operator to value
358
+ */
359
+ declare function applyFilterOperator(value: unknown, operator: FilterOperator, filterValue: unknown): boolean;
360
+ /**
361
+ * Get default value for a field
362
+ */
363
+ declare function getFieldDefaultValue(field: FieldConfig): unknown;
364
+ /**
365
+ * Get default values for all fields in config
366
+ */
367
+ declare function getDefaultValues(config: EntityConfig): Record<string, unknown>;
368
+ /**
369
+ * Check if a field is visible in table
370
+ */
371
+ declare function isFieldVisibleInTable(field: FieldConfig): boolean;
372
+ /**
373
+ * Check if a field is visible in form
374
+ */
375
+ declare function isFieldVisibleInForm(field: FieldConfig): boolean;
376
+ /**
377
+ * Filter out display-only (DTO) fields from form data before submitting to API
378
+ * Display-only fields are computed/transformed fields, not actual entity fields
379
+ */
380
+ declare function filterDisplayOnlyFields(data: Record<string, unknown>, config: EntityConfig): Record<string, unknown>;
381
+ /**
382
+ * Sort fields by order property
383
+ * Fields without order will be placed after fields with order
384
+ * If multiple fields have the same order, maintain original array order
385
+ */
386
+ declare function sortFieldsByOrder(fields: FieldConfig[]): FieldConfig[];
387
+ /**
388
+ * Validate field value
389
+ */
390
+ declare function validateFieldValue(value: unknown, field: FieldConfig): {
391
+ valid: boolean;
392
+ error?: string;
393
+ };
394
+ /**
395
+ * Type guard: Check if value is a valid CrudResponse
396
+ */
397
+ declare function isCrudResponse<T = unknown>(value: unknown): value is CrudResponse<T>;
398
+
399
+ /**
400
+ * Build Zod schema from FieldConfig
401
+ */
402
+ declare function buildSchemaFromConfig(fields: FieldConfig[]): z.ZodObject<Record<string, z.ZodTypeAny>>;
403
+ /**
404
+ * Validate form data against EntityConfig
405
+ */
406
+ declare function validateFormData(data: Record<string, unknown>, config: EntityConfig): {
407
+ valid: boolean;
408
+ errors: Record<string, string>;
409
+ };
410
+ /**
411
+ * Get default values object from config
412
+ */
413
+ declare function getDefaultValuesFromConfig(config: EntityConfig): Record<string, unknown>;
414
+ /**
415
+ * Transform form data to match API format
416
+ */
417
+ declare function transformFormData(data: Record<string, unknown>, config: EntityConfig): Record<string, unknown>;
418
+
419
+ declare class DataLoader {
420
+ private cache;
421
+ private cacheEnabled;
422
+ private defaultCacheTime;
423
+ private pendingRequests;
424
+ /**
425
+ * Load options from dataSource (static or API)
426
+ */
427
+ loadOptions(dataSource: DataSource): Promise<Array<{
428
+ label: string;
429
+ value: string | number | boolean;
430
+ }>>;
431
+ /**
432
+ * Load options from API with caching
433
+ */
434
+ private loadFromAPI;
435
+ /**
436
+ * Actually fetch data from API
437
+ */
438
+ private fetchFromAPI;
439
+ /**
440
+ * Generate cache key from dataSource
441
+ */
442
+ private getCacheKey;
443
+ /**
444
+ * Clear cache for a specific endpoint or all cache
445
+ */
446
+ clearCache(endpoint?: string): void;
447
+ /**
448
+ * Get cache size
449
+ */
450
+ getCacheSize(): number;
451
+ }
452
+ declare const dataLoader: DataLoader;
453
+
454
+ /**
455
+ * Field Calculator - Handles field calculations based on dependencies
456
+ */
457
+
458
+ /**
459
+ * Evaluate a formula string or function
460
+ * SECURITY: No longer uses eval() - uses safe evaluator instead
461
+ */
462
+ declare function evaluateFormula(formula: string | ((values: Record<string, unknown>) => unknown), values: Record<string, unknown>): unknown;
463
+ /**
464
+ * Calculate field value based on dependencies
465
+ */
466
+ declare function calculateFieldValue(field: FieldConfig, formValues: Record<string, unknown>): unknown;
467
+ /**
468
+ * Get all fields that depend on a given field
469
+ */
470
+ declare function getDependentFields(fieldName: string, allFields: FieldConfig[]): FieldConfig[];
471
+
472
+ /**
473
+ * Field Formatter - Handles field value formatting for display
474
+ */
475
+
476
+ /**
477
+ * Format a value based on field configuration
478
+ */
479
+ declare function formatFieldValue(value: unknown, field: FieldConfig): string;
480
+
481
+ /**
482
+ * Parse CSV file
483
+ */
484
+ declare function parseCSV(file: File): Promise<Record<string, unknown>[]>;
485
+ /**
486
+ * Parse JSON file
487
+ */
488
+ declare function parseJSON(file: File): Promise<Record<string, unknown>[]>;
489
+ /**
490
+ * Parse XLSX file (requires xlsx library)
491
+ */
492
+ declare function parseXLSX(file: File): Promise<Record<string, unknown>[]>;
493
+ /**
494
+ * Parse file based on format
495
+ */
496
+ declare function parseFile(file: File, format: ImportOptions["format"]): Promise<Record<string, unknown>[]>;
497
+ /**
498
+ * Validate import data against field configs
499
+ */
500
+ declare function validateImportData(data: Record<string, unknown>[], config: EntityConfig, options?: Partial<ImportOptions>): ImportResult;
501
+ /**
502
+ * Generate CSV template from config
503
+ */
504
+ declare function generateCSVTemplate(config: EntityConfig): string;
505
+ /**
506
+ * Generate JSON template from config
507
+ */
508
+ declare function generateJSONTemplate(config: EntityConfig): Record<string, unknown>;
509
+ /**
510
+ * Generate XLSX template (requires xlsx library)
511
+ */
512
+ declare function generateXLSXTemplate(config: EntityConfig): Promise<Blob>;
513
+ /**
514
+ * Export data to CSV
515
+ */
516
+ declare function exportToCSV(data: Record<string, unknown>[], fields?: string[]): string;
517
+ /**
518
+ * Export data to JSON
519
+ */
520
+ declare function exportToJSON(data: Record<string, unknown>[], fields?: string[]): string;
521
+ /**
522
+ * Export data to XLSX (requires xlsx library)
523
+ */
524
+ declare function exportToXLSX(data: Record<string, unknown>[], fields?: string[]): Promise<Blob>;
525
+ /**
526
+ * Download file
527
+ */
528
+ declare function downloadFile(blob: Blob, filename: string): void;
529
+
530
+ declare function getRowValue(row: Record<string, unknown>, field: Pick<FieldConfig, "name" | "label">): unknown;
531
+ declare function normalizeRowForConfig(row: Record<string, unknown>, config: EntityConfig): Record<string, unknown>;
532
+ declare function coerceRowForConfig(row: Record<string, unknown>, config: EntityConfig): Record<string, unknown>;
533
+ declare function emptyImportResult(): ImportResult;
534
+
535
+ declare class LazyLoader {
536
+ private state;
537
+ private lastAccessTime;
538
+ private readonly MAX_STATES;
539
+ private readonly MAX_AGE;
540
+ private cleanupInterval;
541
+ constructor();
542
+ /**
543
+ * Start periodic cleanup of old states
544
+ */
545
+ private startCleanupInterval;
546
+ /**
547
+ * Stop cleanup interval
548
+ */
549
+ private stopCleanupInterval;
550
+ /**
551
+ * Cleanup old and unused states
552
+ */
553
+ private cleanupOldStates;
554
+ /**
555
+ * Get or initialize state for an endpoint
556
+ */
557
+ private getState;
558
+ /**
559
+ * Load initial data
560
+ */
561
+ loadInitial(endpoint: string, queryParams: CrudQueryParams): Promise<CrudResponse>;
562
+ /**
563
+ * Load more data (next page)
564
+ */
565
+ loadMore(endpoint: string, queryParams: CrudQueryParams): Promise<CrudResponse>;
566
+ /**
567
+ * Reset state for an endpoint
568
+ */
569
+ reset(endpoint: string): void;
570
+ /**
571
+ * Cleanup all states (useful for testing or memory management)
572
+ */
573
+ cleanupAll(): void;
574
+ /**
575
+ * Get current cache size
576
+ */
577
+ getCacheSize(): number;
578
+ /**
579
+ * Check if has more data to load
580
+ */
581
+ hasMore(endpoint: string): boolean;
582
+ /**
583
+ * Get current data
584
+ */
585
+ getData(endpoint: string): unknown[];
586
+ /**
587
+ * Get loading state
588
+ */
589
+ isLoading(endpoint: string): boolean;
590
+ }
591
+ declare const lazyLoader: LazyLoader;
592
+
593
+ /**
594
+ * Parse filters from CRUD query params
595
+ * Extracts filter values from filters array format
596
+ */
597
+ /**
598
+ * Parse filters from query params and extract specific filter values
599
+ * @param filtersParam - JSON string of filters array
600
+ * @param filterName - Name of the filter to extract
601
+ * @returns Filter value or undefined
602
+ */
603
+ declare function parseFilterValue(filtersParam: string | null, filterName: string): string | undefined;
604
+ /**
605
+ * Parse multiple filter values from query params
606
+ * @param filtersParam - JSON string of filters array
607
+ * @param filterNames - Array of filter names to extract
608
+ * @returns Object with filter values
609
+ */
610
+ declare function parseFilterValues<T extends string>(filtersParam: string | null, filterNames: T[]): Partial<Record<T, string>>;
611
+
612
+ interface StreamChunk {
613
+ type: "data" | "error" | "done";
614
+ data?: unknown[];
615
+ error?: string;
616
+ total?: number;
617
+ }
618
+ /**
619
+ * Stream data from API using fetch streaming
620
+ */
621
+ declare function streamData(endpoint: string, queryParams: CrudQueryParams): AsyncGenerator<StreamChunk, void, unknown>;
622
+ /**
623
+ * Load data progressively from stream
624
+ */
625
+ declare function loadStreamData(endpoint: string, queryParams: CrudQueryParams, onChunk: (chunk: unknown[]) => void): Promise<CrudResponse>;
626
+
627
+ /**
628
+ * CRUD Translation Utilities
629
+ * Translate EntityConfig ở server-side trước khi pass xuống client
630
+ */
631
+
632
+ /**
633
+ * Translate EntityConfig với dictionary
634
+ * Chạy ở server-side trước khi pass xuống client
635
+ */
636
+ declare function translateEntityConfig(config: EntityConfig, dictionary: DictionaryType, locale: string, entityName?: string): EntityConfig;
637
+ /**
638
+ * Get common CRUD translations
639
+ */
640
+ declare function getCrudCommonTranslations(dictionary: DictionaryType): Record<string, string>;
641
+ /**
642
+ * Translate CRUD message với parameters
643
+ */
644
+ declare function translateCrudMessage(dictionary: DictionaryType, key: string, params?: Record<string, string | number>): string;
645
+
646
+ export { CrudBulkActions, CrudCardView, CrudConfigContext, type CrudConfigContextValue, CrudDeleteDialog, CrudDialog, CrudEmptyState, CrudExportButton, CrudFieldRenderer, CrudFilterChips, CrudForm, CrudImportDialog, CrudInfiniteScroll, CrudPage, CrudProvider, CrudRowActions, CrudSearch, CrudSelectionContext, type CrudSelectionContextValue, CrudSheet, CrudStateContext, type CrudStateContextValue, CrudTable, CrudTableSkeletonLegacy, CrudTableToolbar, type CrudTranslations, CrudVirtualTable, DataLoader, EntityCrudPage, LazyLoader, type LegacyCrudTableSkeletonProps, applyFilterOperator, buildQueryString, buildSchemaFromConfig, calculateFieldValue, coerceRowForConfig, crudService, dataLoader, downloadFile, emptyImportResult, evaluateFormula, exportToCSV, exportToJSON, exportToXLSX, filterDisplayOnlyFields, formatFieldValue, generateCSVTemplate, generateJSONTemplate, generateXLSXTemplate, getCrudCommonTranslations, getDefaultValues, getDefaultValuesFromConfig, getDependentFields, getFieldDefaultValue, getRowValue, isCrudResponse, isFieldVisibleInForm, isFieldVisibleInTable, lazyLoader, loadStreamData, normalizeRowForConfig, parseCSV, parseFile, parseFilterValue, parseFilterValues, parseJSON, parseQueryString, parseXLSX, sortFieldsByOrder, streamData, transformFormData, translateCrudMessage, translateEntityConfig, useCrudConfig, useCrudContext, useCrudSelection, useCrudState, validateFieldValue, validateFormData, validateImportData };