@goplusvn/core 0.1.1 → 0.1.3

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/package.json +31 -175
  2. package/dist/audit/index.d.mts +0 -115
  3. package/dist/audit/index.d.ts +0 -115
  4. package/dist/audit/index.js +0 -204
  5. package/dist/audit/index.js.map +0 -1
  6. package/dist/audit/index.mjs +0 -200
  7. package/dist/audit/index.mjs.map +0 -1
  8. package/dist/auth/index.d.mts +0 -86
  9. package/dist/auth/index.d.ts +0 -86
  10. package/dist/auth/index.js +0 -210
  11. package/dist/auth/index.js.map +0 -1
  12. package/dist/auth/index.mjs +0 -198
  13. package/dist/auth/index.mjs.map +0 -1
  14. package/dist/button-1dWvP9Ib.d.mts +0 -30
  15. package/dist/button-1dWvP9Ib.d.ts +0 -30
  16. package/dist/calendar-2QzdEo1z.d.mts +0 -20
  17. package/dist/calendar-2QzdEo1z.d.ts +0 -20
  18. package/dist/code-generation/index.d.mts +0 -30
  19. package/dist/code-generation/index.d.ts +0 -30
  20. package/dist/code-generation/index.js +0 -31
  21. package/dist/code-generation/index.js.map +0 -1
  22. package/dist/code-generation/index.mjs +0 -28
  23. package/dist/code-generation/index.mjs.map +0 -1
  24. package/dist/configs/index.d.mts +0 -175
  25. package/dist/configs/index.d.ts +0 -175
  26. package/dist/configs/index.js +0 -254
  27. package/dist/configs/index.js.map +0 -1
  28. package/dist/configs/index.mjs +0 -233
  29. package/dist/configs/index.mjs.map +0 -1
  30. package/dist/crud/index.d.mts +0 -646
  31. package/dist/crud/index.d.ts +0 -646
  32. package/dist/crud/index.js +0 -11772
  33. package/dist/crud/index.js.map +0 -1
  34. package/dist/crud/index.mjs +0 -11665
  35. package/dist/crud/index.mjs.map +0 -1
  36. package/dist/crud/server.d.mts +0 -20
  37. package/dist/crud/server.d.ts +0 -20
  38. package/dist/crud/server.js +0 -123
  39. package/dist/crud/server.js.map +0 -1
  40. package/dist/crud/server.mjs +0 -120
  41. package/dist/crud/server.mjs.map +0 -1
  42. package/dist/data-table-skeleton-12NA8Mjx.d.mts +0 -39
  43. package/dist/data-table-skeleton-12NA8Mjx.d.ts +0 -39
  44. package/dist/dialog-bKfjZMTd.d.mts +0 -22
  45. package/dist/dialog-bKfjZMTd.d.ts +0 -22
  46. package/dist/dynamic-icon-DrGIiu2N.d.mts +0 -10
  47. package/dist/dynamic-icon-DrGIiu2N.d.ts +0 -10
  48. package/dist/home/index.d.mts +0 -269
  49. package/dist/home/index.d.ts +0 -269
  50. package/dist/home/index.js +0 -1678
  51. package/dist/home/index.js.map +0 -1
  52. package/dist/home/index.mjs +0 -1635
  53. package/dist/home/index.mjs.map +0 -1
  54. package/dist/hooks/index.d.mts +0 -7
  55. package/dist/hooks/index.d.ts +0 -7
  56. package/dist/hooks/index.js +0 -8316
  57. package/dist/hooks/index.js.map +0 -1
  58. package/dist/hooks/index.mjs +0 -8255
  59. package/dist/hooks/index.mjs.map +0 -1
  60. package/dist/index-50hpiPrV.d.ts +0 -116
  61. package/dist/index-B9zQVEVi.d.mts +0 -116
  62. package/dist/index.d.mts +0 -5
  63. package/dist/index.d.ts +0 -5
  64. package/dist/index.js +0 -123
  65. package/dist/index.js.map +0 -1
  66. package/dist/index.mjs +0 -118
  67. package/dist/index.mjs.map +0 -1
  68. package/dist/infrastructure/index.d.mts +0 -423
  69. package/dist/infrastructure/index.d.ts +0 -423
  70. package/dist/infrastructure/index.js +0 -633
  71. package/dist/infrastructure/index.js.map +0 -1
  72. package/dist/infrastructure/index.mjs +0 -619
  73. package/dist/infrastructure/index.mjs.map +0 -1
  74. package/dist/label-DWTEkNPo.d.ts +0 -226
  75. package/dist/label-LPpdcoBx.d.mts +0 -226
  76. package/dist/layout/index.d.mts +0 -48
  77. package/dist/layout/index.d.ts +0 -48
  78. package/dist/layout/index.js +0 -117
  79. package/dist/layout/index.js.map +0 -1
  80. package/dist/layout/index.mjs +0 -90
  81. package/dist/layout/index.mjs.map +0 -1
  82. package/dist/navigation/index.d.mts +0 -16
  83. package/dist/navigation/index.d.ts +0 -16
  84. package/dist/navigation/index.js +0 -53
  85. package/dist/navigation/index.js.map +0 -1
  86. package/dist/navigation/index.mjs +0 -50
  87. package/dist/navigation/index.mjs.map +0 -1
  88. package/dist/notification/index.d.mts +0 -105
  89. package/dist/notification/index.d.ts +0 -105
  90. package/dist/notification/index.js +0 -278
  91. package/dist/notification/index.js.map +0 -1
  92. package/dist/notification/index.mjs +0 -274
  93. package/dist/notification/index.mjs.map +0 -1
  94. package/dist/organization/index.d.mts +0 -99
  95. package/dist/organization/index.d.ts +0 -99
  96. package/dist/organization/index.js +0 -360
  97. package/dist/organization/index.js.map +0 -1
  98. package/dist/organization/index.mjs +0 -352
  99. package/dist/organization/index.mjs.map +0 -1
  100. package/dist/plugin/index.d.mts +0 -83
  101. package/dist/plugin/index.d.ts +0 -83
  102. package/dist/plugin/index.js +0 -86
  103. package/dist/plugin/index.js.map +0 -1
  104. package/dist/plugin/index.mjs +0 -84
  105. package/dist/plugin/index.mjs.map +0 -1
  106. package/dist/providers/index.d.mts +0 -25
  107. package/dist/providers/index.d.ts +0 -25
  108. package/dist/providers/index.js +0 -84
  109. package/dist/providers/index.js.map +0 -1
  110. package/dist/providers/index.mjs +0 -77
  111. package/dist/providers/index.mjs.map +0 -1
  112. package/dist/rbac/index.d.mts +0 -226
  113. package/dist/rbac/index.d.ts +0 -226
  114. package/dist/rbac/index.js +0 -4784
  115. package/dist/rbac/index.js.map +0 -1
  116. package/dist/rbac/index.mjs +0 -4722
  117. package/dist/rbac/index.mjs.map +0 -1
  118. package/dist/rbac/permissions.d.mts +0 -26
  119. package/dist/rbac/permissions.d.ts +0 -26
  120. package/dist/rbac/permissions.js +0 -94
  121. package/dist/rbac/permissions.js.map +0 -1
  122. package/dist/rbac/permissions.mjs +0 -90
  123. package/dist/rbac/permissions.mjs.map +0 -1
  124. package/dist/rbac/server.d.mts +0 -1
  125. package/dist/rbac/server.d.ts +0 -1
  126. package/dist/rbac/server.js +0 -128
  127. package/dist/rbac/server.js.map +0 -1
  128. package/dist/rbac/server.mjs +0 -124
  129. package/dist/rbac/server.mjs.map +0 -1
  130. package/dist/schemas/index.d.mts +0 -1257
  131. package/dist/schemas/index.d.ts +0 -1257
  132. package/dist/schemas/index.js +0 -572
  133. package/dist/schemas/index.js.map +0 -1
  134. package/dist/schemas/index.mjs +0 -523
  135. package/dist/schemas/index.mjs.map +0 -1
  136. package/dist/server-QuYCTa89.d.mts +0 -83
  137. package/dist/server-QuYCTa89.d.ts +0 -83
  138. package/dist/sonner-C74GlRDQ.d.mts +0 -71
  139. package/dist/sonner-C74GlRDQ.d.ts +0 -71
  140. package/dist/status-BOXZgIqX.d.mts +0 -12
  141. package/dist/status-BOXZgIqX.d.ts +0 -12
  142. package/dist/system/index.d.mts +0 -77
  143. package/dist/system/index.d.ts +0 -77
  144. package/dist/system/index.js +0 -102
  145. package/dist/system/index.js.map +0 -1
  146. package/dist/system/index.mjs +0 -100
  147. package/dist/system/index.mjs.map +0 -1
  148. package/dist/tabs-C6FfBwPY.d.mts +0 -18
  149. package/dist/tabs-C6FfBwPY.d.ts +0 -18
  150. package/dist/tenant-provider-B8eC_Wpb.d.mts +0 -27
  151. package/dist/tenant-provider-B8eC_Wpb.d.ts +0 -27
  152. package/dist/types/index.d.mts +0 -469
  153. package/dist/types/index.d.ts +0 -469
  154. package/dist/types/index.js +0 -25
  155. package/dist/types/index.js.map +0 -1
  156. package/dist/types/index.mjs +0 -21
  157. package/dist/types/index.mjs.map +0 -1
  158. package/dist/ui/auth.d.mts +0 -39
  159. package/dist/ui/auth.d.ts +0 -39
  160. package/dist/ui/auth.js +0 -4941
  161. package/dist/ui/auth.js.map +0 -1
  162. package/dist/ui/auth.mjs +0 -4896
  163. package/dist/ui/auth.mjs.map +0 -1
  164. package/dist/ui/crud.d.mts +0 -2
  165. package/dist/ui/crud.d.ts +0 -2
  166. package/dist/ui/crud.js +0 -4
  167. package/dist/ui/crud.js.map +0 -1
  168. package/dist/ui/crud.mjs +0 -3
  169. package/dist/ui/crud.mjs.map +0 -1
  170. package/dist/ui/data-display.d.mts +0 -596
  171. package/dist/ui/data-display.d.ts +0 -596
  172. package/dist/ui/data-display.js +0 -5307
  173. package/dist/ui/data-display.js.map +0 -1
  174. package/dist/ui/data-display.mjs +0 -5212
  175. package/dist/ui/data-display.mjs.map +0 -1
  176. package/dist/ui/feedback.d.mts +0 -55
  177. package/dist/ui/feedback.d.ts +0 -55
  178. package/dist/ui/feedback.js +0 -2608
  179. package/dist/ui/feedback.js.map +0 -1
  180. package/dist/ui/feedback.mjs +0 -2526
  181. package/dist/ui/feedback.mjs.map +0 -1
  182. package/dist/ui/forms.d.mts +0 -309
  183. package/dist/ui/forms.d.ts +0 -309
  184. package/dist/ui/forms.js +0 -4656
  185. package/dist/ui/forms.js.map +0 -1
  186. package/dist/ui/forms.mjs +0 -4571
  187. package/dist/ui/forms.mjs.map +0 -1
  188. package/dist/ui/index.d.mts +0 -331
  189. package/dist/ui/index.d.ts +0 -331
  190. package/dist/ui/index.js +0 -16953
  191. package/dist/ui/index.js.map +0 -1
  192. package/dist/ui/index.mjs +0 -16598
  193. package/dist/ui/index.mjs.map +0 -1
  194. package/dist/ui/primitives/client.d.mts +0 -61
  195. package/dist/ui/primitives/client.d.ts +0 -61
  196. package/dist/ui/primitives/client.js +0 -3408
  197. package/dist/ui/primitives/client.js.map +0 -1
  198. package/dist/ui/primitives/client.mjs +0 -3256
  199. package/dist/ui/primitives/client.mjs.map +0 -1
  200. package/dist/ui/primitives.d.mts +0 -113
  201. package/dist/ui/primitives.d.ts +0 -113
  202. package/dist/ui/primitives.js +0 -3356
  203. package/dist/ui/primitives.js.map +0 -1
  204. package/dist/ui/primitives.mjs +0 -3227
  205. package/dist/ui/primitives.mjs.map +0 -1
  206. package/dist/user/index.d.mts +0 -228
  207. package/dist/user/index.d.ts +0 -228
  208. package/dist/user/index.js +0 -4306
  209. package/dist/user/index.js.map +0 -1
  210. package/dist/user/index.mjs +0 -4260
  211. package/dist/user/index.mjs.map +0 -1
  212. package/dist/utils/index.d.mts +0 -205
  213. package/dist/utils/index.d.ts +0 -205
  214. package/dist/utils/index.js +0 -574
  215. package/dist/utils/index.js.map +0 -1
  216. package/dist/utils/index.mjs +0 -514
  217. package/dist/utils/index.mjs.map +0 -1
  218. package/dist/workflow/index.d.mts +0 -40
  219. package/dist/workflow/index.d.ts +0 -40
  220. package/dist/workflow/index.js +0 -3710
  221. package/dist/workflow/index.js.map +0 -1
  222. package/dist/workflow/index.mjs +0 -3677
  223. package/dist/workflow/index.mjs.map +0 -1
@@ -1,646 +0,0 @@
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 };