@archbase/components 4.0.19 → 4.0.21

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 (55) hide show
  1. package/dist/archbase-components-4.0.21.tgz +0 -0
  2. package/dist/datagrid/ag-grid/ag-grid-locale-ptbr.d.ts +7 -0
  3. package/dist/datagrid/ag-grid/ag-grid-mantine-theme.d.ts +24 -0
  4. package/dist/datagrid/ag-grid/archbase-data-grid-ag-formatters.d.ts +88 -0
  5. package/dist/datagrid/ag-grid/archbase-data-grid-ag-types.d.ts +329 -0
  6. package/dist/datagrid/ag-grid/archbase-data-grid-ag-utils.d.ts +71 -0
  7. package/dist/datagrid/ag-grid/archbase-data-grid-ag.d.ts +14 -0
  8. package/dist/datagrid/ag-grid/index.d.ts +14 -0
  9. package/dist/datagrid/index.d.ts +9 -1
  10. package/dist/index.js +11175 -10592
  11. package/package.json +16 -14
  12. package/src/datagrid/ag-grid/ag-grid-locale-ptbr.ts +432 -0
  13. package/src/datagrid/ag-grid/ag-grid-mantine-theme.ts +176 -0
  14. package/src/datagrid/ag-grid/archbase-data-grid-ag-formatters.tsx +470 -0
  15. package/src/datagrid/ag-grid/archbase-data-grid-ag-types.tsx +413 -0
  16. package/src/datagrid/ag-grid/archbase-data-grid-ag-utils.ts +394 -0
  17. package/src/datagrid/ag-grid/archbase-data-grid-ag.tsx +1241 -0
  18. package/src/datagrid/ag-grid/index.tsx +84 -0
  19. package/src/datagrid/index.tsx +59 -8
  20. package/src/datagrid/main/archbase-data-grid-pagination.tsx +1 -2
  21. package/src/datagrid/main/archbase-data-grid-toolbar.tsx +1 -2
  22. package/src/editors/ArchbaseAsyncMultiSelect.tsx +2 -1
  23. package/src/editors/ArchbaseAsyncSelect.tsx +2 -1
  24. package/src/editors/ArchbaseAvatarEdit.tsx +1 -0
  25. package/src/editors/ArchbaseCheckbox.tsx +1 -0
  26. package/src/editors/ArchbaseChip.tsx +1 -0
  27. package/src/editors/ArchbaseChipGroup.tsx +1 -0
  28. package/src/editors/ArchbaseColorGradientPicker.tsx +2 -1
  29. package/src/editors/ArchbaseDatePickerEdit.tsx +1 -0
  30. package/src/editors/ArchbaseDateTimePickerEdit.tsx +1 -0
  31. package/src/editors/ArchbaseDualListbox.tsx +1 -0
  32. package/src/editors/ArchbaseEdit.tsx +1 -0
  33. package/src/editors/ArchbaseImageEdit.tsx +1 -0
  34. package/src/editors/ArchbaseJsonEdit.tsx +1 -0
  35. package/src/editors/ArchbaseLookupEdit.tsx +2 -1
  36. package/src/editors/ArchbaseLookupNumber.tsx +2 -1
  37. package/src/editors/ArchbaseLookupSelect.tsx +2 -1
  38. package/src/editors/ArchbaseMarkdownEdit.tsx +1 -0
  39. package/src/editors/ArchbaseMaskEdit.tsx +1 -0
  40. package/src/editors/ArchbaseMentionInput.tsx +1 -0
  41. package/src/editors/ArchbaseMultiEmail.tsx +1 -0
  42. package/src/editors/ArchbaseMultiSelect.tsx +2 -1
  43. package/src/editors/ArchbaseNumberEdit.tsx +1 -0
  44. package/src/editors/ArchbaseNumberStepper.tsx +2 -1
  45. package/src/editors/ArchbasePasswordEdit.tsx +1 -0
  46. package/src/editors/ArchbaseRadioGroup.tsx +1 -0
  47. package/src/editors/ArchbaseRating.tsx +1 -0
  48. package/src/editors/ArchbaseRichTextEdit.tsx +1 -0
  49. package/src/editors/ArchbaseSelect.tsx +2 -1
  50. package/src/editors/ArchbaseSignaturePad.tsx +1 -0
  51. package/src/editors/ArchbaseSwitch.tsx +1 -0
  52. package/src/editors/ArchbaseTagInputEdit.tsx +1 -0
  53. package/src/editors/ArchbaseTextArea.tsx +1 -0
  54. package/src/editors/ArchbaseTimeEdit.tsx +1 -0
  55. package/dist/archbase-components-4.0.19.tgz +0 -0
@@ -0,0 +1,413 @@
1
+ /**
2
+ * ArchbaseDataGridAG Types
3
+ *
4
+ * Type definitions for the AG Grid implementation of ArchbaseDataGrid.
5
+ * Maintains API compatibility with the MUI DataGrid version.
6
+ */
7
+ import React, { MutableRefObject, ReactNode, RefObject } from 'react';
8
+ import type { ColDef, GridApi, RowSelectionOptions } from 'ag-grid-community';
9
+ import type { IArchbaseDataSourceBase } from '@archbase/data';
10
+ import type {
11
+ ArchbaseFilterDefinition,
12
+ ArchbaseActiveFilter,
13
+ } from '../../filters/ArchbaseCompositeFilters.types';
14
+
15
+ /**
16
+ * Reference interface for external grid control
17
+ */
18
+ export interface ArchbaseDataGridAGRef<T = any> {
19
+ /** Get selected rows */
20
+ getSelectedRows: () => T[];
21
+ /** Clear selection */
22
+ clearSelection: () => void;
23
+ /** Refresh grid data */
24
+ refreshData: () => void;
25
+ /** Export grid data */
26
+ exportData: () => void;
27
+ /** Print grid data */
28
+ printData: () => void;
29
+ /** Expand a specific row's detail panel */
30
+ expandRow: (rowId: string | number) => void;
31
+ /** Collapse a specific row's detail panel */
32
+ collapseRow: (rowId: string | number) => void;
33
+ /** Collapse all expanded detail panels */
34
+ collapseAllRows: () => void;
35
+ /** Get all expanded row IDs */
36
+ getExpandedRows: () => (string | number)[];
37
+ /** Get current filter model */
38
+ getFilterModel: () => any;
39
+ /** Get AG Grid API */
40
+ getGridApi: () => GridApi | null;
41
+ /** Auto-size all columns to fit their content */
42
+ autoSizeAllColumns: (skipHeader?: boolean) => void;
43
+ /** Size columns to fit the grid width */
44
+ sizeColumnsToFit: () => void;
45
+ }
46
+
47
+ /**
48
+ * Data types supported by grid columns
49
+ */
50
+ export type FieldDataType =
51
+ | 'text'
52
+ | 'integer'
53
+ | 'float'
54
+ | 'currency'
55
+ | 'boolean'
56
+ | 'date'
57
+ | 'datetime'
58
+ | 'time'
59
+ | 'enum'
60
+ | 'image'
61
+ | 'uuid';
62
+
63
+ /**
64
+ * Column props (same API as MUI version)
65
+ */
66
+ export interface ArchbaseDataGridAGColumnProps<T = any> {
67
+ /** Column header text */
68
+ header: string;
69
+ /** Column footer text */
70
+ footer?: string;
71
+ /** Data field to bind */
72
+ dataField: string;
73
+ /** Enable column filtering */
74
+ enableColumnFilter?: boolean;
75
+ /** Enable global filter search on this column */
76
+ enableGlobalFilter?: boolean;
77
+ /** Custom accessor function */
78
+ dataFieldAcessorFn?: (originalRow: T) => any;
79
+ /** Data type for formatting and filtering */
80
+ dataType: FieldDataType;
81
+ /** Mask options for text formatting */
82
+ maskOptions?: any;
83
+ /** Input filter type */
84
+ inputFilterType?: string;
85
+ /** Enum values for select filters */
86
+ enumValues?: Array<{ label: string; value: string }>;
87
+ /** Minimum column width */
88
+ minSize?: number;
89
+ /** Maximum column width */
90
+ maxSize?: number;
91
+ /** Custom cell renderer */
92
+ render?: (data: any) => ReactNode;
93
+ /** Column visibility */
94
+ visible: boolean;
95
+ /** Column width */
96
+ size: number;
97
+ /** Enable click to copy */
98
+ enableClickToCopy: boolean;
99
+ /** Enable sorting */
100
+ enableSorting: boolean;
101
+ /** Cell alignment */
102
+ align?: 'left' | 'center' | 'right';
103
+ /** Header alignment */
104
+ headerAlign?: 'left' | 'center' | 'right';
105
+ /** Footer alignment */
106
+ footerAlign?: 'left' | 'center' | 'right';
107
+
108
+ // Security props (optional)
109
+ /** Permission name to view this column */
110
+ viewPermission?: string;
111
+ /** Permission name to edit this column */
112
+ editPermission?: string;
113
+ /** Fallback content when no permission */
114
+ fallbackContent?: ReactNode | string;
115
+ /** Hide column completely when no permission */
116
+ hideWhenNoPermission?: boolean;
117
+ /** Auto-register column permission */
118
+ autoRegisterPermission?: boolean;
119
+ }
120
+
121
+ /**
122
+ * Default column props
123
+ */
124
+ export const defaultColumnProps: Partial<ArchbaseDataGridAGColumnProps> = {
125
+ visible: true,
126
+ size: 100,
127
+ align: 'left',
128
+ enableColumnFilter: true,
129
+ enableGlobalFilter: true,
130
+ headerAlign: 'left',
131
+ footerAlign: 'left',
132
+ enableClickToCopy: false,
133
+ enableSorting: true,
134
+ dataType: 'text',
135
+ inputFilterType: 'text',
136
+ enumValues: [],
137
+ hideWhenNoPermission: false,
138
+ autoRegisterPermission: true,
139
+ fallbackContent: '***',
140
+ };
141
+
142
+ /**
143
+ * Props for toolbar actions
144
+ */
145
+ export interface GridToolBarActionsProps {
146
+ children: ReactNode;
147
+ }
148
+
149
+ /**
150
+ * Props for columns wrapper
151
+ */
152
+ export interface GridColumnsProps {
153
+ children: ReactNode;
154
+ }
155
+
156
+ /**
157
+ * Cell click event data
158
+ */
159
+ export interface CellClickEvent<T = any> {
160
+ id: string | number;
161
+ columnName: string;
162
+ rowData: T;
163
+ }
164
+
165
+ /**
166
+ * Main ArchbaseDataGridAG props
167
+ */
168
+ export interface ArchbaseDataGridAGProps<T extends object = any, ID = any> {
169
+ // Data properties
170
+ /** DataSource (V1 or V2 compatible) */
171
+ dataSource: IArchbaseDataSourceBase<T>;
172
+ /** Function to get row ID */
173
+ getRowId?: (row: T) => ID;
174
+
175
+ // Security props (optional)
176
+ /** Resource name for grid security */
177
+ resourceName?: string;
178
+ /** Resource description */
179
+ resourceDescription?: string;
180
+ /** Column security options */
181
+ columnSecurityOptions?: {
182
+ defaultFallback?: ReactNode | string;
183
+ hideByDefault?: boolean;
184
+ permissionPrefix?: string;
185
+ };
186
+
187
+ // Feature toggles
188
+ /** Enable column resizing */
189
+ enableColumnResizing?: boolean;
190
+ /** Enable row numbers */
191
+ enableRowNumbers?: boolean;
192
+ /** Enable row selection with checkboxes */
193
+ enableRowSelection?: boolean;
194
+ /** Enable row actions column */
195
+ enableRowActions?: boolean;
196
+ /** Enable column filter modes */
197
+ enableColumnFilterModes?: boolean;
198
+ /** Enable global filter search */
199
+ enableGlobalFilter?: boolean;
200
+ /** Enable top toolbar */
201
+ enableTopToolbar?: boolean;
202
+ /** Enable toolbar actions */
203
+ enableTopToolbarActions?: boolean;
204
+ /** Show pagination */
205
+ showPagination?: boolean;
206
+
207
+ // Manual mode flags
208
+ /** Manual filtering (server-side) */
209
+ manualFiltering?: boolean;
210
+ /** Manual pagination (server-side) */
211
+ manualPagination?: boolean;
212
+ /** Manual sorting (server-side) */
213
+ manualSorting?: boolean;
214
+
215
+ // State
216
+ /** Loading state */
217
+ isLoading?: boolean;
218
+ /** Error state */
219
+ isError?: boolean;
220
+ /** Error object */
221
+ error?: any;
222
+
223
+ // Dimensions
224
+ /** Grid height */
225
+ height?: string | number;
226
+ /** Grid width */
227
+ width?: string | number;
228
+
229
+ // Pagination
230
+ /** Page size */
231
+ pageSize?: number;
232
+ /** Current page index */
233
+ pageIndex?: number;
234
+
235
+ // Content and rendering
236
+ /** Column definitions as children */
237
+ children?: ReactNode;
238
+ /** Render row actions */
239
+ renderRowActions?: (row: T) => ReactNode;
240
+ /** Render toolbar actions */
241
+ renderToolbarActions?: () => ReactNode;
242
+ /** Render internal toolbar actions */
243
+ renderToolbarInternalActions?: (props: { table: any }) => ReactNode | null;
244
+ /** Custom top toolbar */
245
+ renderTopToolbar?: ReactNode;
246
+
247
+ // Detail panel
248
+ /** Render detail panel content */
249
+ renderDetailPanel?: (props: { row: T }) => ReactNode;
250
+ /** Allow multiple detail panels open */
251
+ allowMultipleDetailPanels?: boolean;
252
+ /** Minimum detail panel height */
253
+ detailPanelMinHeight?: number;
254
+ /** Detail panel style */
255
+ detailPanelStyle?: React.CSSProperties;
256
+ /** Detail panel class name */
257
+ detailPanelClassName?: string;
258
+ /** Callback when detail panels change */
259
+ onDetailPanelChange?: (expandedRowIds: (string | number)[]) => void;
260
+ /** Detail panel display mode */
261
+ detailPanelDisplayMode?: 'auto' | 'inline' | 'modal' | 'drawer';
262
+ /** Detail panel title */
263
+ detailPanelTitle?: string | ((rowId: string | number, rowData: T) => string);
264
+ /** Detail panel position (for drawer) */
265
+ detailPanelPosition?: 'right' | 'left' | 'bottom' | 'top';
266
+ /** Detail panel size (for modal/drawer) */
267
+ detailPanelSize?: string | number;
268
+
269
+ // Permissions
270
+ /** Allow column filters */
271
+ allowColumnFilters?: boolean;
272
+ /** Allow data export */
273
+ allowExportData?: boolean;
274
+ /** Allow data print */
275
+ allowPrintData?: boolean;
276
+
277
+ // Composite filters
278
+ /** Use ArchbaseCompositeFilters */
279
+ useCompositeFilters?: boolean;
280
+ /** Filter definitions */
281
+ filterDefinitions?: ArchbaseFilterDefinition[];
282
+ /** Active filters */
283
+ activeFilters?: ArchbaseActiveFilter[];
284
+ /** Callback when filters change */
285
+ onFiltersChange?: (filters: ArchbaseActiveFilter[], rsql?: string) => void;
286
+ /** Hide AG Grid native filters */
287
+ hideAgGridFilters?: boolean;
288
+
289
+ // Appearance
290
+ /** Show border */
291
+ withBorder?: boolean;
292
+ /** Show column borders */
293
+ withColumnBorders?: boolean;
294
+ /** Highlight row on hover */
295
+ highlightOnHover?: boolean;
296
+ /** Striped rows */
297
+ striped?: boolean;
298
+ /** CSS class name */
299
+ className?: string;
300
+ /** Grid variant */
301
+ variant?: 'filled' | 'outlined';
302
+ /** Font size */
303
+ fontSize?: string | number;
304
+ /** Cell padding */
305
+ cellPadding?: string | number;
306
+ /** Table head cell padding */
307
+ tableHeadCellPadding?: string;
308
+ /** Auto column width (flex: 1 for all columns) */
309
+ columnAutoWidth?: boolean;
310
+ /**
311
+ * Auto-size strategy for columns
312
+ * - 'fitCellContents': Auto-size columns to fit their cell contents
313
+ * - 'fitGridWidth': Auto-size columns to fit the grid width
314
+ */
315
+ autoSizeStrategy?: 'fitCellContents' | 'fitGridWidth';
316
+ /** Skip header when calculating auto-size */
317
+ skipHeaderOnAutoSize?: boolean;
318
+ /** Row height */
319
+ rowHeight?: number;
320
+ /** Header font weight (default: 600 = bold) */
321
+ headerFontWeight?: number | 'normal' | 'bold';
322
+
323
+ // Internal border controls
324
+ /** Show toolbar border */
325
+ withToolbarBorder?: boolean;
326
+ /** Show pagination border */
327
+ withPaginationBorder?: boolean;
328
+ /** Toolbar padding */
329
+ toolbarPadding?: string | number;
330
+ /** Pagination padding */
331
+ paginationPadding?: string | number;
332
+
333
+ // Export/Print
334
+ /** Print title */
335
+ printTitle?: string;
336
+ /** Print logo */
337
+ logoPrint?: string;
338
+ /** Global date format */
339
+ globalDateFormat?: string;
340
+ /** CSV export options */
341
+ csvOptions?: any;
342
+
343
+ // Layout
344
+ /** Toolbar alignment */
345
+ toolbarAlignment?: 'left' | 'right' | 'center';
346
+ /** Actions column position */
347
+ positionActionsColumn?: 'first' | 'last';
348
+ /** Actions column width */
349
+ actionsColumnWidth?: number;
350
+ /** Toolbar left content */
351
+ toolbarLeftContent?: ReactNode;
352
+ /** Bottom toolbar min height */
353
+ bottomToolbarMinHeight?: string | number;
354
+
355
+ // Labels
356
+ /** Pagination labels */
357
+ paginationLabels?: Record<string, string>;
358
+
359
+ // Display flags
360
+ /** Show progress bars */
361
+ showProgressBars?: boolean;
362
+ /** Hide footer */
363
+ hideFooter?: boolean;
364
+
365
+ // Callbacks
366
+ /** Selected rows changed callback */
367
+ onSelectedRowsChanged?: (rows: T[]) => void;
368
+ /** Cell double click callback */
369
+ onCellDoubleClick?: (params: CellClickEvent<T>) => void;
370
+ /** Export callback */
371
+ onExport?: (callback: () => void) => void;
372
+ /** Print callback */
373
+ onPrint?: (callback: () => void) => void;
374
+ /** Filter model change callback */
375
+ onFilterModelChange?: (filterModel: any) => void;
376
+
377
+ // Reference
378
+ /** Grid reference */
379
+ gridRef?: RefObject<ArchbaseDataGridAGRef<T>> | MutableRefObject<ArchbaseDataGridAGRef<T> | null>;
380
+ }
381
+
382
+ /**
383
+ * Declarative Column component
384
+ */
385
+ export function ArchbaseDataGridAGColumn<T>(_props: ArchbaseDataGridAGColumnProps<T>) {
386
+ return null;
387
+ }
388
+
389
+ ArchbaseDataGridAGColumn.defaultProps = defaultColumnProps;
390
+
391
+ /**
392
+ * Columns wrapper component
393
+ */
394
+ export function Columns(props: GridColumnsProps) {
395
+ return <>{props.children}</>;
396
+ }
397
+
398
+ Columns.componentName = 'Columns';
399
+
400
+ /**
401
+ * Toolbar actions wrapper
402
+ */
403
+ export function GridToolBarActions(props: GridToolBarActionsProps) {
404
+ return <>{props.children}</>;
405
+ }
406
+
407
+ /**
408
+ * Internal AG Grid ColDef with extended properties
409
+ */
410
+ export interface ExtendedColDef<TData = any, TValue = any> extends ColDef<TData, TValue> {
411
+ enableGlobalFilter?: boolean;
412
+ dataType?: FieldDataType;
413
+ }