@myunisoft/design-system 1.3.3-rev157 → 1.3.4-rev157-2types
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/components/AnchoredPopper/index.d.ts +0 -14
- package/dist/components/Autocomplete/Autocomplete/example-usage.d.ts +0 -4
- package/dist/components/DataGrid/components/toolbar/buttons/AddButton.d.ts +0 -6
- package/dist/components/DataGrid/components/toolbar/buttons/ExportButton.d.ts +0 -9
- package/dist/components/DataGrid/types/index.d.ts +0 -428
- package/dist/components/DocumentComposer/hooks/useDragVisualFeedback.d.ts +0 -15
- package/dist/components/DocumentComposer/types/props.d.ts +0 -67
- package/dist/components/DocumentComposer/types/section.d.ts +0 -33
- package/dist/components/DocumentComposer/types.d.ts +0 -56
- package/dist/components/Export/index.d.ts +0 -3
- package/dist/components/Export/style/index.d.ts +0 -9
- package/dist/components/Export/types/index.d.ts +0 -30
- package/dist/locale/index.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, RefObject } from 'react';
|
|
2
|
-
import { PopperPlacementType } from '@mui/material';
|
|
3
|
-
type AnchoredPopperProps = {
|
|
4
|
-
open: boolean;
|
|
5
|
-
anchorRef: RefObject<HTMLElement | null>;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
placement?: PopperPlacementType;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
minWidth?: number | string;
|
|
10
|
-
zIndex?: number;
|
|
11
|
-
elevation?: number;
|
|
12
|
-
};
|
|
13
|
-
declare const AnchoredPopper: ({ open, anchorRef, onClose, placement, children, minWidth, zIndex, elevation }: AnchoredPopperProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export default AnchoredPopper;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const BasicExample: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
-
declare const CustomOptionExample: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const ProductExample: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { BasicExample, CustomOptionExample, ProductExample };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GridExportFormat } from '@mui/x-data-grid-pro';
|
|
2
|
-
type ExportButtonProps = {
|
|
3
|
-
exportAction?: {
|
|
4
|
-
onExport: (format: GridExportFormat) => void;
|
|
5
|
-
exportFormats: GridExportFormat[];
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const ExportButton: ({ exportAction }: ExportButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default ExportButton;
|
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, RefObject, ComponentType, Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import type { ButtonProps } from '@mui/material';
|
|
3
|
-
import type { DataGridProProps, GridApiPro, GridColDef as MuiGridColDef, GridRowSelectionModel, GridValidRowModel } from '@mui/x-data-grid-pro';
|
|
4
|
-
/**
|
|
5
|
-
* Extended GridColDef with custom export-related properties
|
|
6
|
-
*/
|
|
7
|
-
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = MuiGridColDef<R, V, F> & {
|
|
8
|
-
/**
|
|
9
|
-
* Custom formatter function for export operations
|
|
10
|
-
* @param params - Object containing the value and row data
|
|
11
|
-
* @returns Formatted value for export
|
|
12
|
-
*/
|
|
13
|
-
exportFormatter?: (params: {
|
|
14
|
-
value: V;
|
|
15
|
-
row: R;
|
|
16
|
-
}) => any;
|
|
17
|
-
/**
|
|
18
|
-
* If true, this column will be excluded from export operations
|
|
19
|
-
*/
|
|
20
|
-
ignoreExport?: boolean;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Props for the DataGridDS component
|
|
24
|
-
* Extends MUI DataGridProProps with custom row context menu functionality
|
|
25
|
-
*/
|
|
26
|
-
export interface DataGridDSProps extends DataGridProProps {
|
|
27
|
-
/**
|
|
28
|
-
* Configuration for row context menu (right-click menu)
|
|
29
|
-
*/
|
|
30
|
-
rowContextMenu?: RowContextMenuConfig;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Configuration for row context menu
|
|
34
|
-
*/
|
|
35
|
-
export interface RowContextMenuConfig {
|
|
36
|
-
/**
|
|
37
|
-
* Array of actions available in the context menu
|
|
38
|
-
*/
|
|
39
|
-
actions: RowMenuAction[];
|
|
40
|
-
/**
|
|
41
|
-
* Optional function to determine if the menu can be opened
|
|
42
|
-
* @param selectedRows - Currently selected rows
|
|
43
|
-
* @returns true if menu can be opened, false otherwise
|
|
44
|
-
*/
|
|
45
|
-
canOpen?: (selectedRows: GridValidRowModel[]) => boolean;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Action definition for row context menu
|
|
49
|
-
*/
|
|
50
|
-
export type RowMenuAction = {
|
|
51
|
-
/**
|
|
52
|
-
* Unique identifier for the action
|
|
53
|
-
*/
|
|
54
|
-
key: string;
|
|
55
|
-
/**
|
|
56
|
-
* Display label for the action
|
|
57
|
-
*/
|
|
58
|
-
label: string;
|
|
59
|
-
/**
|
|
60
|
-
* Callback function executed when action is clicked
|
|
61
|
-
* @param selectedRows - Array of selected row models
|
|
62
|
-
*/
|
|
63
|
-
onClick: (selectedRows: GridValidRowModel[]) => void;
|
|
64
|
-
/**
|
|
65
|
-
* Whether the action is disabled
|
|
66
|
-
* Can be a boolean or a function that determines disabled state based on selected rows
|
|
67
|
-
*/
|
|
68
|
-
disabled?: boolean | ((selectedRows: GridValidRowModel[]) => boolean);
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Props for RowMenu component
|
|
72
|
-
*/
|
|
73
|
-
export interface RowMenuProps {
|
|
74
|
-
/**
|
|
75
|
-
* Whether the menu is currently open
|
|
76
|
-
*/
|
|
77
|
-
isOpen: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Callback to close the menu
|
|
80
|
-
*/
|
|
81
|
-
onClose: () => void;
|
|
82
|
-
/**
|
|
83
|
-
* X coordinate for menu positioning
|
|
84
|
-
*/
|
|
85
|
-
mouseX: number;
|
|
86
|
-
/**
|
|
87
|
-
* Y coordinate for menu positioning
|
|
88
|
-
*/
|
|
89
|
-
mouseY: number;
|
|
90
|
-
/**
|
|
91
|
-
* Array of actions to display in the menu
|
|
92
|
-
*/
|
|
93
|
-
rowMenuActions: RowMenuAction[];
|
|
94
|
-
/**
|
|
95
|
-
* Currently selected rows
|
|
96
|
-
*/
|
|
97
|
-
selectedRows: GridValidRowModel[];
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* State for row menu hook
|
|
101
|
-
*/
|
|
102
|
-
export interface RowMenuState {
|
|
103
|
-
/**
|
|
104
|
-
* Whether the menu is open
|
|
105
|
-
*/
|
|
106
|
-
isOpen: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Mouse X coordinate
|
|
109
|
-
*/
|
|
110
|
-
mouseX: number;
|
|
111
|
-
/**
|
|
112
|
-
* Mouse Y coordinate
|
|
113
|
-
*/
|
|
114
|
-
mouseY: number;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Return type for useRowMenu hook
|
|
118
|
-
*/
|
|
119
|
-
export interface UseRowMenuReturn {
|
|
120
|
-
/**
|
|
121
|
-
* Current menu state
|
|
122
|
-
*/
|
|
123
|
-
rowMenuState: RowMenuState;
|
|
124
|
-
/**
|
|
125
|
-
* Function to open the menu at specified coordinates
|
|
126
|
-
*/
|
|
127
|
-
openRowMenu: (mouseX: number, mouseY: number) => void;
|
|
128
|
-
/**
|
|
129
|
-
* Function to close the menu
|
|
130
|
-
*/
|
|
131
|
-
closeRowMenu: () => void;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Base configuration for toolbar buttons
|
|
135
|
-
*/
|
|
136
|
-
interface BaseButtonConfig {
|
|
137
|
-
/**
|
|
138
|
-
* Unique identifier for the button
|
|
139
|
-
*/
|
|
140
|
-
key: ButtonKey;
|
|
141
|
-
/**
|
|
142
|
-
* Button color theme
|
|
143
|
-
*/
|
|
144
|
-
color?: ButtonProps['color'];
|
|
145
|
-
/**
|
|
146
|
-
* Whether the button is disabled
|
|
147
|
-
*/
|
|
148
|
-
disabled?: boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Whether the button is in loading state
|
|
151
|
-
*/
|
|
152
|
-
isLoading?: boolean;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Configuration for text-based toolbar button
|
|
156
|
-
*/
|
|
157
|
-
export interface TextButtonConfig extends BaseButtonConfig {
|
|
158
|
-
type: 'text';
|
|
159
|
-
/**
|
|
160
|
-
* Button text label
|
|
161
|
-
*/
|
|
162
|
-
text: string;
|
|
163
|
-
/**
|
|
164
|
-
* Click handler
|
|
165
|
-
*/
|
|
166
|
-
onClick: ButtonProps['onClick'];
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Configuration for icon-based toolbar button
|
|
170
|
-
*/
|
|
171
|
-
export interface IconButtonConfig extends BaseButtonConfig {
|
|
172
|
-
type: 'icon';
|
|
173
|
-
/**
|
|
174
|
-
* Icon element to display
|
|
175
|
-
*/
|
|
176
|
-
icon: ReactNode;
|
|
177
|
-
/**
|
|
178
|
-
* Click handler
|
|
179
|
-
*/
|
|
180
|
-
onClick: ButtonProps['onClick'];
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Union type for all button configurations
|
|
184
|
-
*/
|
|
185
|
-
export type ButtonConfig = TextButtonConfig | IconButtonConfig;
|
|
186
|
-
/**
|
|
187
|
-
* Type for button keys
|
|
188
|
-
*/
|
|
189
|
-
export type ButtonKey = string | number;
|
|
190
|
-
/**
|
|
191
|
-
* Props for ArrayButtons component
|
|
192
|
-
*/
|
|
193
|
-
export interface ArrayButtonsProps {
|
|
194
|
-
/**
|
|
195
|
-
* Array of button configurations to render
|
|
196
|
-
*/
|
|
197
|
-
buttons: ButtonConfig[];
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Custom text button configuration with enhanced onClick signature
|
|
201
|
-
*/
|
|
202
|
-
export interface CustomTextButtonConfig extends Omit<TextButtonConfig, 'onClick'> {
|
|
203
|
-
/**
|
|
204
|
-
* Enhanced onClick handler that receives selected row information
|
|
205
|
-
* @param selectedRowIds - Array of selected row IDs
|
|
206
|
-
* @param selectedRows - Array of selected row models
|
|
207
|
-
*/
|
|
208
|
-
onClick: (selectedRowIds: GridRowSelectionModel, selectedRows: GridValidRowModel[]) => void | Promise<void>;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Custom icon button configuration with enhanced onClick signature
|
|
212
|
-
*/
|
|
213
|
-
export interface CustomIconButtonConfig extends Omit<IconButtonConfig, 'onClick'> {
|
|
214
|
-
/**
|
|
215
|
-
* Enhanced onClick handler that receives selected row information
|
|
216
|
-
* @param selectedRowIds - Array of selected row IDs
|
|
217
|
-
* @param selectedRows - Array of selected row models
|
|
218
|
-
*/
|
|
219
|
-
onClick: (selectedRowIds: GridRowSelectionModel, selectedRows: GridValidRowModel[]) => void | Promise<void>;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Union type for custom toolbar button configurations
|
|
223
|
-
*/
|
|
224
|
-
export type CustomToolbarButtonConfig = CustomTextButtonConfig | CustomIconButtonConfig;
|
|
225
|
-
/**
|
|
226
|
-
* Configuration for delete action in toolbar
|
|
227
|
-
*/
|
|
228
|
-
export interface DeleteAction {
|
|
229
|
-
/**
|
|
230
|
-
* Handler function for delete operation
|
|
231
|
-
* @param selectedRowIds - Array of selected row IDs to delete
|
|
232
|
-
* @returns Promise or boolean indicating success
|
|
233
|
-
*/
|
|
234
|
-
onDelete: (selectedRowIds: GridRowSelectionModel) => boolean | Promise<boolean>;
|
|
235
|
-
/**
|
|
236
|
-
* Whether the delete action is disabled
|
|
237
|
-
*/
|
|
238
|
-
disabled?: boolean;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Configuration for bulk edit action in toolbar
|
|
242
|
-
*/
|
|
243
|
-
export interface BulkEditAction {
|
|
244
|
-
/**
|
|
245
|
-
* Handler function for bulk edit save operation
|
|
246
|
-
* @param selectedRowIds - Array of selected row IDs
|
|
247
|
-
* @param newRows - Array of modified row models
|
|
248
|
-
* @returns Promise or boolean indicating success
|
|
249
|
-
*/
|
|
250
|
-
onBulkEditSave: (selectedRowIds: GridRowSelectionModel, newRows: GridValidRowModel[]) => boolean | Promise<boolean>;
|
|
251
|
-
/**
|
|
252
|
-
* Whether the bulk edit action is disabled
|
|
253
|
-
*/
|
|
254
|
-
disabled?: boolean;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Configuration for add action in toolbar
|
|
258
|
-
*/
|
|
259
|
-
export interface AddAction {
|
|
260
|
-
/**
|
|
261
|
-
* Handler function for add operation
|
|
262
|
-
*/
|
|
263
|
-
onClick: () => void;
|
|
264
|
-
/**
|
|
265
|
-
* Whether the add action is disabled
|
|
266
|
-
*/
|
|
267
|
-
disabled?: boolean;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Configuration for content component to be displayed in AnchoredPopper
|
|
271
|
-
* Note: This type matches the contentComponentConfig from AnchoredPopper
|
|
272
|
-
* for use within DataGrid components
|
|
273
|
-
*/
|
|
274
|
-
export type ContentComponentConfig = {
|
|
275
|
-
/**
|
|
276
|
-
* Name identifier for the component (useful for debugging/analytics)
|
|
277
|
-
*/
|
|
278
|
-
name: string;
|
|
279
|
-
/**
|
|
280
|
-
* React component to render
|
|
281
|
-
*/
|
|
282
|
-
component: ComponentType<any>;
|
|
283
|
-
/**
|
|
284
|
-
* Props to pass to the component
|
|
285
|
-
*/
|
|
286
|
-
props: Record<string, any>;
|
|
287
|
-
};
|
|
288
|
-
/**
|
|
289
|
-
* Action definition for actions menu (toolbar menu)
|
|
290
|
-
*/
|
|
291
|
-
export type MenuAction = {
|
|
292
|
-
/**
|
|
293
|
-
* Unique identifier for the action
|
|
294
|
-
*/
|
|
295
|
-
key: string;
|
|
296
|
-
/**
|
|
297
|
-
* Display label for the action
|
|
298
|
-
*/
|
|
299
|
-
label: string;
|
|
300
|
-
/**
|
|
301
|
-
* Optional icon to display before the label
|
|
302
|
-
*/
|
|
303
|
-
icon?: ReactNode;
|
|
304
|
-
/**
|
|
305
|
-
* Optional color for the menu item text
|
|
306
|
-
*/
|
|
307
|
-
color?: string;
|
|
308
|
-
/**
|
|
309
|
-
* Whether the action is disabled
|
|
310
|
-
* Can be a boolean or a function that determines disabled state based on selected rows
|
|
311
|
-
*/
|
|
312
|
-
disabled?: boolean | ((selectedRows: GridValidRowModel[]) => boolean);
|
|
313
|
-
/**
|
|
314
|
-
* Optional click handler for simple actions
|
|
315
|
-
* @param selectedRows - Array of selected row models
|
|
316
|
-
*/
|
|
317
|
-
onClick?: (selectedRows: GridValidRowModel[]) => void;
|
|
318
|
-
/**
|
|
319
|
-
* Optional configuration for displaying a popper with custom content
|
|
320
|
-
* When provided, clicking the action will open an AnchoredPopper with the specified component
|
|
321
|
-
*/
|
|
322
|
-
contentConfig?: ContentComponentConfig | null;
|
|
323
|
-
};
|
|
324
|
-
/**
|
|
325
|
-
* Props for ActionsMenu component
|
|
326
|
-
*/
|
|
327
|
-
export interface ActionsMenuProps {
|
|
328
|
-
/**
|
|
329
|
-
* Whether the menu is currently open
|
|
330
|
-
*/
|
|
331
|
-
isOpen: boolean;
|
|
332
|
-
/**
|
|
333
|
-
* Anchor element for the menu
|
|
334
|
-
*/
|
|
335
|
-
anchorEl: HTMLElement | null;
|
|
336
|
-
/**
|
|
337
|
-
* Array of menu actions to display
|
|
338
|
-
*/
|
|
339
|
-
menuActions: MenuAction[];
|
|
340
|
-
/**
|
|
341
|
-
* Currently selected rows
|
|
342
|
-
*/
|
|
343
|
-
selectedRows: GridValidRowModel[];
|
|
344
|
-
/**
|
|
345
|
-
* Callback to close the menu
|
|
346
|
-
*/
|
|
347
|
-
onClose: () => void;
|
|
348
|
-
/**
|
|
349
|
-
* Reference to the element that should anchor the popper
|
|
350
|
-
*/
|
|
351
|
-
popperAnchorRef: RefObject<HTMLElement | null>;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Type for EditContext value
|
|
355
|
-
*/
|
|
356
|
-
export interface EditContextType {
|
|
357
|
-
/**
|
|
358
|
-
* Whether bulk editing mode is active
|
|
359
|
-
*/
|
|
360
|
-
isBulkEditing: boolean;
|
|
361
|
-
/**
|
|
362
|
-
* Whether an edit save operation is in progress
|
|
363
|
-
*/
|
|
364
|
-
isEditSaving: boolean;
|
|
365
|
-
/**
|
|
366
|
-
* Function to set bulk editing state
|
|
367
|
-
*/
|
|
368
|
-
setIsBulkEditing: Dispatch<SetStateAction<boolean>>;
|
|
369
|
-
/**
|
|
370
|
-
* Function to set edit saving state
|
|
371
|
-
*/
|
|
372
|
-
setIsEditSaving: Dispatch<SetStateAction<boolean>>;
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Props for EditProvider component
|
|
376
|
-
*/
|
|
377
|
-
export interface EditProviderProps {
|
|
378
|
-
/**
|
|
379
|
-
* Child components
|
|
380
|
-
*/
|
|
381
|
-
children: ReactNode;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Function type for exporting grid data to Excel
|
|
385
|
-
*/
|
|
386
|
-
export type ExportGridApiToExcelFn = (apiRef: RefObject<GridApiPro>, fileName: string, sheetName?: string) => Promise<void>;
|
|
387
|
-
/**
|
|
388
|
-
* Function type for attaching Excel export functionality to grid API
|
|
389
|
-
*/
|
|
390
|
-
export type AttachExcelExportToApiFn = (apiRef: RefObject<GridApiPro>, fileName?: string) => void;
|
|
391
|
-
/**
|
|
392
|
-
* Function type for getting selected rows from grid API
|
|
393
|
-
*/
|
|
394
|
-
export type GetSelectedRowsFn = (apiRef: RefObject<GridApiPro>) => GridValidRowModel[];
|
|
395
|
-
/**
|
|
396
|
-
* Augmentation for MUI DataGridPro ToolbarPropsOverrides
|
|
397
|
-
* Adds custom toolbar props to the DataGridPro component
|
|
398
|
-
*/
|
|
399
|
-
declare module '@mui/x-data-grid-pro' {
|
|
400
|
-
interface ToolbarPropsOverrides {
|
|
401
|
-
/**
|
|
402
|
-
* Whether to show the selected row count
|
|
403
|
-
* @default true
|
|
404
|
-
*/
|
|
405
|
-
showSelectedCount?: boolean;
|
|
406
|
-
/**
|
|
407
|
-
* Array of custom button configurations
|
|
408
|
-
*/
|
|
409
|
-
customButtons?: CustomToolbarButtonConfig[];
|
|
410
|
-
/**
|
|
411
|
-
* Configuration for delete action
|
|
412
|
-
*/
|
|
413
|
-
deleteAction?: DeleteAction;
|
|
414
|
-
/**
|
|
415
|
-
* Configuration for bulk edit action
|
|
416
|
-
*/
|
|
417
|
-
bulkEditAction?: BulkEditAction;
|
|
418
|
-
/**
|
|
419
|
-
* Array of menu actions for the actions menu
|
|
420
|
-
*/
|
|
421
|
-
menuActions?: MenuAction[];
|
|
422
|
-
/**
|
|
423
|
-
* Configuration for add action
|
|
424
|
-
*/
|
|
425
|
-
addAction?: AddAction;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type RefObject } from 'react';
|
|
2
|
-
import type { DocumentSection } from '../types';
|
|
3
|
-
type UseDragVisualFeedbackParams = {
|
|
4
|
-
containerRef: RefObject<HTMLDivElement | null>;
|
|
5
|
-
getSectionById: (sectionId: string) => DocumentSection | null;
|
|
6
|
-
isValidDropTarget?: (draggedSection: DocumentSection, targetSection: DocumentSection | null, newIndex: number) => boolean;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Provides visual feedback during drag-and-drop by graying out invalid drop targets.
|
|
10
|
-
*
|
|
11
|
-
* Uses direct DOM manipulation instead of React state to avoid re-rendering
|
|
12
|
-
* all tree items on every drag event.
|
|
13
|
-
*/
|
|
14
|
-
export declare const useDragVisualFeedback: ({ containerRef, getSectionById, isValidDropTarget }: UseDragVisualFeedbackParams) => void;
|
|
15
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ItemPositionParams } from '../Treeview/types';
|
|
3
|
-
import type { DocumentSection, SectionContent } from './section';
|
|
4
|
-
export type DeleteConfirmationRenderProps = {
|
|
5
|
-
isOpen: boolean;
|
|
6
|
-
onConfirm: () => void;
|
|
7
|
-
onCancel: () => void;
|
|
8
|
-
};
|
|
9
|
-
export type UnsavedChangesRenderProps = {
|
|
10
|
-
isOpen: boolean;
|
|
11
|
-
isSaving: boolean;
|
|
12
|
-
/** True if onSectionContentSave is provided */
|
|
13
|
-
canSave: boolean;
|
|
14
|
-
onSaveAndQuit: () => void;
|
|
15
|
-
onQuitWithoutSaving: () => void;
|
|
16
|
-
onCancel: () => void;
|
|
17
|
-
};
|
|
18
|
-
export type DocumentComposerLabels = {
|
|
19
|
-
createSection?: string;
|
|
20
|
-
rename?: string;
|
|
21
|
-
delete?: string;
|
|
22
|
-
createSubsection?: string;
|
|
23
|
-
hiddenItemTooltip?: string;
|
|
24
|
-
};
|
|
25
|
-
export type DocumentComposerCustomProps = {
|
|
26
|
-
noSectionsPlaceholder?: string | ReactNode;
|
|
27
|
-
isLoadingSections?: boolean;
|
|
28
|
-
/** Defaults to `() => true` */
|
|
29
|
-
getSectionTitleChangePermission?: (section: DocumentSection) => boolean;
|
|
30
|
-
/** Defaults to `() => true` */
|
|
31
|
-
getSectionDeletePermission?: (section: DocumentSection) => boolean;
|
|
32
|
-
/** Defaults to `() => true` */
|
|
33
|
-
getSectionOrderChangePermission?: (section: DocumentSection) => boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Custom validation for drag & drop positions.
|
|
36
|
-
* Called after basic permission checks pass.
|
|
37
|
-
* Use this to implement custom drop zone restrictions (e.g., only drop after certain sections).
|
|
38
|
-
* Defaults to `() => true`
|
|
39
|
-
*/
|
|
40
|
-
canMoveSectionToNewPosition?: (params: ItemPositionParams) => boolean;
|
|
41
|
-
/** Defaults to `() => true` */
|
|
42
|
-
getSectionCreatePermission?: (section: DocumentSection) => boolean;
|
|
43
|
-
/** Defaults to `() => true` */
|
|
44
|
-
getSectionVisibilityChangePermission?: (section: DocumentSection) => boolean;
|
|
45
|
-
hiddenSectionTooltip?: string;
|
|
46
|
-
visibleIconTooltip?: string;
|
|
47
|
-
hiddenIconTooltip?: string;
|
|
48
|
-
/** Return null for no icon */
|
|
49
|
-
renderSectionIcon?: (section: DocumentSection) => ReactNode;
|
|
50
|
-
sectionContent?: SectionContent;
|
|
51
|
-
isLoadingSectionContent?: boolean;
|
|
52
|
-
selectedSectionId?: string | null;
|
|
53
|
-
/** If not provided, deletion proceeds without confirmation */
|
|
54
|
-
renderDeleteConfirmation?: (props: DeleteConfirmationRenderProps) => ReactNode;
|
|
55
|
-
/** If not provided, navigation proceeds without confirmation (discards changes) */
|
|
56
|
-
renderUnsavedChangesConfirmation?: (props: UnsavedChangesRenderProps) => ReactNode;
|
|
57
|
-
};
|
|
58
|
-
export type DocumentComposerCallbacks = {
|
|
59
|
-
onSectionOrderChange?: (params: ItemPositionParams) => void;
|
|
60
|
-
onSectionTitleChange?: (sectionId: string, newTitle: string) => void;
|
|
61
|
-
onSectionDelete?: (sectionId: string) => void;
|
|
62
|
-
onSectionVisibilityChange?: (sectionId: string, visible: boolean) => void;
|
|
63
|
-
onSectionCreate?: (parentId: string | null, title: string) => string | Promise<string>;
|
|
64
|
-
onSectionSelect?: (sectionId: string | null) => void;
|
|
65
|
-
/** Used by unsaved changes modal "Save and quit" action */
|
|
66
|
-
onSectionContentSave?: () => Promise<void>;
|
|
67
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const CellFormat: {
|
|
2
|
-
readonly TEXT: "text";
|
|
3
|
-
readonly AMOUNT: "amount";
|
|
4
|
-
};
|
|
5
|
-
export type CellFormat = (typeof CellFormat)[keyof typeof CellFormat];
|
|
6
|
-
export type TableCell = {
|
|
7
|
-
value: string;
|
|
8
|
-
editable: boolean;
|
|
9
|
-
format: CellFormat;
|
|
10
|
-
};
|
|
11
|
-
export type TableRow = TableCell[];
|
|
12
|
-
export type TableValue = {
|
|
13
|
-
id: string;
|
|
14
|
-
headers: TableRow[];
|
|
15
|
-
rows: TableRow[];
|
|
16
|
-
footers: TableRow[];
|
|
17
|
-
};
|
|
18
|
-
export type TableContentBlock = {
|
|
19
|
-
type: 'table';
|
|
20
|
-
value: TableValue;
|
|
21
|
-
};
|
|
22
|
-
/** Extend this union as new content block types are added */
|
|
23
|
-
export type ContentBlock = TableContentBlock;
|
|
24
|
-
export type SectionContent = ContentBlock[];
|
|
25
|
-
export type DocumentSection = {
|
|
26
|
-
id: string;
|
|
27
|
-
title: string;
|
|
28
|
-
visible: boolean;
|
|
29
|
-
parentId: string | null;
|
|
30
|
-
type?: string;
|
|
31
|
-
hasTables?: boolean;
|
|
32
|
-
sections?: DocumentSection[] | null;
|
|
33
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ItemPositionParams } from './Treeview/types';
|
|
2
|
-
export type DocumentSection = {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
visible: boolean;
|
|
6
|
-
parentId: string | null;
|
|
7
|
-
sections?: DocumentSection[] | null;
|
|
8
|
-
};
|
|
9
|
-
export type DocumentComposerLabels = {
|
|
10
|
-
/** Label for the "Create section" button */
|
|
11
|
-
createSection?: string;
|
|
12
|
-
/** Label for the "Rename" menu item */
|
|
13
|
-
rename?: string;
|
|
14
|
-
/** Label for the "Delete" menu item */
|
|
15
|
-
delete?: string;
|
|
16
|
-
/** Label for the "Create subsection" menu item */
|
|
17
|
-
createSubsection?: string;
|
|
18
|
-
/** Tooltip for hidden item */
|
|
19
|
-
hiddenItemTooltip?: string;
|
|
20
|
-
};
|
|
21
|
-
export type DocumentComposerCustomProps = {
|
|
22
|
-
/** Content displayed when there are no sections */
|
|
23
|
-
noSectionsPlaceholder?: string | React.ReactNode;
|
|
24
|
-
/** Show a loading state that prevents rendering the sections */
|
|
25
|
-
isLoading?: boolean;
|
|
26
|
-
/** Returns whether section title can be edited (double-click + "Renommer" menu). Defaults to `() => true`. */
|
|
27
|
-
getSectionTitleChangePermission?: (section: DocumentSection) => boolean;
|
|
28
|
-
/** Returns whether section can be deleted ("Supprimer" menu). Defaults to `() => true`. */
|
|
29
|
-
getSectionDeletePermission?: (section: DocumentSection) => boolean;
|
|
30
|
-
/** Returns whether section can be reordered via drag & drop. Defaults to `() => true`. */
|
|
31
|
-
getSectionOrderChangePermission?: (section: DocumentSection) => boolean;
|
|
32
|
-
/** Returns whether a section can be created under this section. Defaults to `() => true`. */
|
|
33
|
-
getSectionCreatePermission?: (section: DocumentSection) => boolean;
|
|
34
|
-
/** Returns whether section visibility can be toggled. Defaults to `() => true`. */
|
|
35
|
-
getSectionVisibilityChangePermission?: (section: DocumentSection) => boolean;
|
|
36
|
-
/** Tooltip text displayed when hovering a hidden section label (visible: false) */
|
|
37
|
-
hiddenSectionTooltip?: string;
|
|
38
|
-
/** Tooltip text displayed when hovering the visibility icon of a visible section */
|
|
39
|
-
visibleIconTooltip?: string;
|
|
40
|
-
/** Tooltip text displayed when hovering the visibility icon of a hidden section */
|
|
41
|
-
hiddenIconTooltip?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Determines if `targetSection` is a valid drop location for `draggedSection`.
|
|
44
|
-
* When provided, invalid targets are visually greyed out during drag.
|
|
45
|
-
* Defaults to () => true (all targets valid).
|
|
46
|
-
* @param targetSection - The parent section where the item would be dropped, or `null` if dropping at root level.
|
|
47
|
-
*/
|
|
48
|
-
isValidDropTarget?: (draggedSection: DocumentSection, targetSection: DocumentSection | null) => boolean;
|
|
49
|
-
};
|
|
50
|
-
export type DocumentComposerCallbacks = {
|
|
51
|
-
onSectionOrderChange?: (params: ItemPositionParams) => void;
|
|
52
|
-
onSectionTitleChange?: (sectionId: string, newTitle: string) => void;
|
|
53
|
-
onSectionDelete?: (sectionId: string) => void;
|
|
54
|
-
onSectionVisibilityChange?: (sectionId: string, visible: boolean) => void;
|
|
55
|
-
onSectionCreate?: (parentId: string | null, title: string) => string | Promise<string>;
|
|
56
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { GridExportFormat } from "@mui/x-data-grid-pro";
|
|
2
|
-
/**
|
|
3
|
-
* Props for ExportContent component
|
|
4
|
-
*/
|
|
5
|
-
export interface ExportContentProps {
|
|
6
|
-
/**
|
|
7
|
-
* Available export formats
|
|
8
|
-
*/
|
|
9
|
-
exportFormats: GridExportFormat[];
|
|
10
|
-
/**
|
|
11
|
-
* Handler function called when export is triggered
|
|
12
|
-
* @param format - Selected export format
|
|
13
|
-
*/
|
|
14
|
-
onExport: (format: GridExportFormat) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Optional title for the export dialog
|
|
17
|
-
* @default 'Export'
|
|
18
|
-
*/
|
|
19
|
-
title?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Optional label for format selection
|
|
22
|
-
* @default 'Select format:'
|
|
23
|
-
*/
|
|
24
|
-
selectFormatLabel?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Optional label for the export button
|
|
27
|
-
* @default 'Export'
|
|
28
|
-
*/
|
|
29
|
-
exportButtonLabel?: string;
|
|
30
|
-
}
|