@toolbox-web/grid 0.6.0 → 1.0.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.
- package/README.md +79 -26
- package/all.js +731 -1739
- package/all.js.map +1 -1
- package/index.js +1382 -2410
- package/index.js.map +1 -1
- package/lib/core/constants.d.ts +8 -0
- package/lib/core/constants.d.ts.map +1 -1
- package/lib/core/grid.d.ts +704 -55
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/config-manager.d.ts +3 -7
- package/lib/core/internal/config-manager.d.ts.map +1 -1
- package/lib/core/internal/dom-builder.d.ts +2 -10
- package/lib/core/internal/dom-builder.d.ts.map +1 -1
- package/lib/core/internal/inference.d.ts.map +1 -1
- package/lib/core/internal/keyboard.d.ts.map +1 -1
- package/lib/core/internal/render-scheduler.d.ts +2 -0
- package/lib/core/internal/render-scheduler.d.ts.map +1 -1
- package/lib/core/internal/rows.d.ts +9 -1
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/shell.d.ts +41 -41
- package/lib/core/internal/shell.d.ts.map +1 -1
- package/lib/core/internal/validate-config.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +2 -15
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +33 -6
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +376 -68
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +89 -2
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.d.ts +2 -0
- package/lib/plugins/clipboard/index.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +24 -35
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +57 -2
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.d.ts +2 -0
- package/lib/plugins/column-virtualization/index.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js +7 -17
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +75 -5
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
- package/lib/plugins/context-menu/index.d.ts +3 -1
- package/lib/plugins/context-menu/index.d.ts.map +1 -1
- package/lib/plugins/context-menu/index.js +15 -27
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +101 -9
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/editors.d.ts +9 -1
- package/lib/plugins/editing/editors.d.ts.map +1 -1
- package/lib/plugins/editing/index.d.ts +4 -2
- package/lib/plugins/editing/index.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +412 -279
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/types.d.ts +88 -0
- package/lib/plugins/editing/types.d.ts.map +1 -1
- package/lib/plugins/export/ExportPlugin.d.ts +73 -7
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
- package/lib/plugins/export/index.d.ts +2 -0
- package/lib/plugins/export/index.d.ts.map +1 -1
- package/lib/plugins/export/index.js +4 -19
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +98 -2
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.d.ts +2 -0
- package/lib/plugins/filtering/index.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +50 -58
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +80 -6
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.d.ts +2 -0
- package/lib/plugins/grouping-columns/index.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js +10 -21
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +81 -5
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.d.ts +3 -1
- package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.js +13 -21
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +90 -5
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.d.ts +2 -0
- package/lib/plugins/master-detail/index.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js +11 -17
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +83 -2
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.d.ts +2 -0
- package/lib/plugins/multi-sort/index.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.js +11 -19
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +61 -2
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-columns/index.d.ts +3 -1
- package/lib/plugins/pinned-columns/index.d.ts.map +1 -1
- package/lib/plugins/pinned-columns/index.js +7 -17
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +71 -10
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.d.ts +3 -1
- package/lib/plugins/pinned-rows/index.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.js +5 -17
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/PivotPlugin.d.ts +81 -4
- package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
- package/lib/plugins/pivot/index.d.ts +2 -0
- package/lib/plugins/pivot/index.d.ts.map +1 -1
- package/lib/plugins/pivot/index.js +10 -17
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/ReorderPlugin.d.ts +71 -3
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
- package/lib/plugins/reorder/index.d.ts +2 -0
- package/lib/plugins/reorder/index.d.ts.map +1 -1
- package/lib/plugins/reorder/index.js +8 -18
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/reorder/types.d.ts +0 -5
- package/lib/plugins/reorder/types.d.ts.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +84 -20
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +2 -1
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +70 -131
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +25 -4
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/ServerSidePlugin.d.ts +65 -4
- package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -1
- package/lib/plugins/server-side/index.d.ts +3 -1
- package/lib/plugins/server-side/index.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js +5 -17
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/TreePlugin.d.ts +89 -2
- package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
- package/lib/plugins/tree/index.d.ts +3 -2
- package/lib/plugins/tree/index.d.ts.map +1 -1
- package/lib/plugins/tree/index.js +59 -94
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +66 -3
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.d.ts +3 -1
- package/lib/plugins/undo-redo/index.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.js +5 -17
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +86 -2
- package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
- package/lib/plugins/visibility/index.d.ts +2 -0
- package/lib/plugins/visibility/index.d.ts.map +1 -1
- package/lib/plugins/visibility/index.js +6 -17
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +30 -2
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +19 -19
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +11 -11
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/column-virtualization.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/pinned-columns.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/reorder.umd.js +1 -1
- package/umd/plugins/reorder.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/umd/plugins/server-side.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
- package/umd/plugins/undo-redo.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
|
@@ -10,6 +10,17 @@ declare module '../../core/types' {
|
|
|
10
10
|
editable?: boolean;
|
|
11
11
|
/** Optional custom editor factory or element tag name. Requires EditingPlugin. */
|
|
12
12
|
editor?: ColumnEditorSpec<TRow, TValue>;
|
|
13
|
+
/**
|
|
14
|
+
* Configuration parameters for built-in editors.
|
|
15
|
+
* Shape depends on column type (NumberEditorParams, TextEditorParams, DateEditorParams, SelectEditorParams).
|
|
16
|
+
* Requires EditingPlugin.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* { field: 'price', type: 'number', editable: true, editorParams: { min: 0, max: 1000, step: 0.01 } }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
editorParams?: EditorParams;
|
|
13
24
|
}
|
|
14
25
|
}
|
|
15
26
|
/**
|
|
@@ -31,6 +42,8 @@ export interface EditingConfig {
|
|
|
31
42
|
export interface EditorContext<T = any, V = unknown> {
|
|
32
43
|
/** The row data object */
|
|
33
44
|
row: T;
|
|
45
|
+
/** Stable row identifier (from getRowId) */
|
|
46
|
+
rowId: string;
|
|
34
47
|
/** Current cell value */
|
|
35
48
|
value: V;
|
|
36
49
|
/** Field name being edited */
|
|
@@ -41,5 +54,80 @@ export interface EditorContext<T = any, V = unknown> {
|
|
|
41
54
|
commit: (newValue: V) => void;
|
|
42
55
|
/** Call to cancel editing */
|
|
43
56
|
cancel: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Update other fields in this row.
|
|
59
|
+
* Useful for editors that affect multiple fields (e.g., address lookup).
|
|
60
|
+
* Changes will be committed with source: 'cascade'.
|
|
61
|
+
*/
|
|
62
|
+
updateRow: (changes: Partial<T>) => void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Configuration parameters for the built-in number editor.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* { field: 'price', type: 'number', editable: true, editorParams: { min: 0, max: 1000, step: 0.01 } }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export interface NumberEditorParams {
|
|
73
|
+
/** Minimum allowed value */
|
|
74
|
+
min?: number;
|
|
75
|
+
/** Maximum allowed value */
|
|
76
|
+
max?: number;
|
|
77
|
+
/** Step increment for up/down arrows */
|
|
78
|
+
step?: number;
|
|
79
|
+
/** Placeholder text when empty */
|
|
80
|
+
placeholder?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Configuration parameters for the built-in text editor.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* { field: 'name', editable: true, editorParams: { maxLength: 50, placeholder: 'Enter name...' } }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export interface TextEditorParams {
|
|
91
|
+
/** Maximum character length */
|
|
92
|
+
maxLength?: number;
|
|
93
|
+
/** Regex pattern for validation (HTML5 pattern attribute) */
|
|
94
|
+
pattern?: string;
|
|
95
|
+
/** Placeholder text when empty */
|
|
96
|
+
placeholder?: string;
|
|
44
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Configuration parameters for the built-in date editor.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* { field: 'startDate', type: 'date', editable: true, editorParams: { min: '2024-01-01' } }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export interface DateEditorParams {
|
|
107
|
+
/** Minimum date (ISO string: 'YYYY-MM-DD') */
|
|
108
|
+
min?: string;
|
|
109
|
+
/** Maximum date (ISO string: 'YYYY-MM-DD') */
|
|
110
|
+
max?: string;
|
|
111
|
+
/** Placeholder text when empty */
|
|
112
|
+
placeholder?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Configuration parameters for the built-in select editor.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* { field: 'status', type: 'select', editable: true, editorParams: { includeEmpty: true, emptyLabel: '-- Select --' } }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export interface SelectEditorParams {
|
|
123
|
+
/** Include an empty option at the start */
|
|
124
|
+
includeEmpty?: boolean;
|
|
125
|
+
/** Label for the empty option (default: '') */
|
|
126
|
+
emptyLabel?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Union type of all editor parameter configurations.
|
|
130
|
+
* The applicable shape depends on the column type.
|
|
131
|
+
*/
|
|
132
|
+
export type EditorParams = NumberEditorParams | TextEditorParams | DateEditorParams | SelectEditorParams;
|
|
45
133
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/editing/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMlG;;;GAGG;AACH,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,gBAAgB,CAAC,IAAI,EAAE,MAAM;QACrC,+EAA+E;QAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,kFAAkF;QAClF,MAAM,CAAC,EAAE,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/editing/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMlG;;;GAGG;AACH,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,gBAAgB,CAAC,IAAI,EAAE,MAAM;QACrC,+EAA+E;QAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,kFAAkF;QAClF,MAAM,CAAC,EAAE,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxC;;;;;;;;;WASG;QACH,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B;CACF;AAMD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,OAAO;IACjD,0BAA0B;IAC1B,GAAG,EAAE,CAAC,CAAC;IACP,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,KAAK,EAAE,CAAC,CAAC;IACT,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACxB,mCAAmC;IACnC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,6BAA6B;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;;;OAIG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC1C;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC"}
|
|
@@ -3,18 +3,84 @@ import { ExportConfig, ExportFormat, ExportParams } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Export Plugin for tbw-grid
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Lets users download grid data as CSV, Excel (XML), or JSON with a single click
|
|
7
|
+
* or API call. Great for reporting, data backup, or letting users work with data
|
|
8
|
+
* in Excel. Integrates with SelectionPlugin to export only selected rows.
|
|
9
|
+
*
|
|
10
|
+
* ## Installation
|
|
11
|
+
*
|
|
7
12
|
* ```ts
|
|
8
|
-
*
|
|
9
|
-
* enabled: true,
|
|
10
|
-
* fileName: 'my-data',
|
|
11
|
-
* includeHeaders: true,
|
|
12
|
-
* onlyVisible: true,
|
|
13
|
-
* })
|
|
13
|
+
* import { ExportPlugin } from '@toolbox-web/grid/plugins/export';
|
|
14
14
|
* ```
|
|
15
|
+
*
|
|
16
|
+
* ## Configuration Options
|
|
17
|
+
*
|
|
18
|
+
* | Option | Type | Default | Description |
|
|
19
|
+
* |--------|------|---------|-------------|
|
|
20
|
+
* | `fileName` | `string` | `'export'` | Base filename (without extension) |
|
|
21
|
+
* | `includeHeaders` | `boolean` | `true` | Include column headers in export |
|
|
22
|
+
* | `onlyVisible` | `boolean` | `true` | Export only visible columns |
|
|
23
|
+
* | `onlySelected` | `boolean` | `false` | Export only selected rows (requires SelectionPlugin) |
|
|
24
|
+
*
|
|
25
|
+
* ## Supported Formats
|
|
26
|
+
*
|
|
27
|
+
* | Format | Method | Description |
|
|
28
|
+
* |--------|--------|-------------|
|
|
29
|
+
* | CSV | `exportToCSV()` | Comma-separated values |
|
|
30
|
+
* | Excel | `exportToExcel()` | Excel XML format (.xlsx) |
|
|
31
|
+
* | JSON | `exportToJSON()` | JSON array of objects |
|
|
32
|
+
*
|
|
33
|
+
* ## Programmatic API
|
|
34
|
+
*
|
|
35
|
+
* | Method | Signature | Description |
|
|
36
|
+
* |--------|-----------|-------------|
|
|
37
|
+
* | `exportToCSV` | `(params?) => void` | Export as CSV file |
|
|
38
|
+
* | `exportToExcel` | `(params?) => void` | Export as Excel file |
|
|
39
|
+
* | `exportToJSON` | `(params?) => void` | Export as JSON file |
|
|
40
|
+
* | `isExporting` | `() => boolean` | Check if export is in progress |
|
|
41
|
+
*
|
|
42
|
+
* @example Basic Export with Button
|
|
43
|
+
* ```ts
|
|
44
|
+
* import '@toolbox-web/grid';
|
|
45
|
+
* import { ExportPlugin } from '@toolbox-web/grid/plugins/export';
|
|
46
|
+
*
|
|
47
|
+
* const grid = document.querySelector('tbw-grid');
|
|
48
|
+
* grid.gridConfig = {
|
|
49
|
+
* columns: [
|
|
50
|
+
* { field: 'name', header: 'Name' },
|
|
51
|
+
* { field: 'email', header: 'Email' },
|
|
52
|
+
* ],
|
|
53
|
+
* plugins: [new ExportPlugin({ fileName: 'employees', includeHeaders: true })],
|
|
54
|
+
* };
|
|
55
|
+
*
|
|
56
|
+
* // Trigger export via button
|
|
57
|
+
* document.getElementById('export-btn').addEventListener('click', () => {
|
|
58
|
+
* grid.getPlugin(ExportPlugin).exportToCSV();
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @example Export Selected Rows Only
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';
|
|
65
|
+
*
|
|
66
|
+
* grid.gridConfig = {
|
|
67
|
+
* plugins: [
|
|
68
|
+
* new SelectionPlugin({ mode: 'row' }),
|
|
69
|
+
* new ExportPlugin({ onlySelected: true }),
|
|
70
|
+
* ],
|
|
71
|
+
* };
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @see {@link ExportConfig} for all configuration options
|
|
75
|
+
* @see {@link ExportParams} for method parameters
|
|
76
|
+
* @see {@link SelectionPlugin} for exporting selected rows
|
|
77
|
+
*
|
|
78
|
+
* @internal Extends BaseGridPlugin
|
|
15
79
|
*/
|
|
16
80
|
export declare class ExportPlugin extends BaseGridPlugin<ExportConfig> {
|
|
81
|
+
/** @internal */
|
|
17
82
|
readonly name = "export";
|
|
83
|
+
/** @internal */
|
|
18
84
|
protected get defaultConfig(): Partial<ExportConfig>;
|
|
19
85
|
private isExportingFlag;
|
|
20
86
|
private lastExportInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/export/ExportPlugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,KAAK,EAAwB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAO9F
|
|
1
|
+
{"version":3,"file":"ExportPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/export/ExportPlugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,KAAK,EAAwB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAO9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,qBAAa,YAAa,SAAQ,cAAc,CAAC,YAAY,CAAC;IAC5D,gBAAgB;IAChB,QAAQ,CAAC,IAAI,YAAY;IAEzB,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,CAO5D;IAGD,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,cAAc,CAA0D;IAKhF,OAAO,CAAC,aAAa;IAyFrB,OAAO,CAAC,iBAAiB;IAWzB;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAI/C;;;OAGG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAIjD;;;OAGG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAIhD;;;OAGG;IACH,WAAW,IAAI,OAAO;IAItB;;;OAGG;IACH,aAAa,IAAI;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI;CAIlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/export/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/export/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -184,23 +184,6 @@ class x {
|
|
|
184
184
|
get gridElement() {
|
|
185
185
|
return this.grid;
|
|
186
186
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Get the render root of the grid for DOM queries.
|
|
189
|
-
* @deprecated Use `gridElement` instead. This getter exists only for backward compatibility.
|
|
190
|
-
*
|
|
191
|
-
* With Shadow DOM removed, the grid element itself is the render root.
|
|
192
|
-
* All new code should use `this.gridElement` for DOM queries.
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* // OLD (deprecated)
|
|
196
|
-
* const rows = this.shadowRoot?.querySelector('.rows');
|
|
197
|
-
*
|
|
198
|
-
* // NEW (preferred)
|
|
199
|
-
* const rows = this.gridElement.querySelector('.rows');
|
|
200
|
-
*/
|
|
201
|
-
get shadowRoot() {
|
|
202
|
-
return this.gridElement;
|
|
203
|
-
}
|
|
204
187
|
/**
|
|
205
188
|
* Get the disconnect signal for event listener cleanup.
|
|
206
189
|
* This signal is aborted when the grid disconnects from the DOM.
|
|
@@ -379,8 +362,10 @@ function y(i, e) {
|
|
|
379
362
|
});
|
|
380
363
|
h(n, t);
|
|
381
364
|
}
|
|
382
|
-
class
|
|
365
|
+
class v extends x {
|
|
366
|
+
/** @internal */
|
|
383
367
|
name = "export";
|
|
368
|
+
/** @internal */
|
|
384
369
|
get defaultConfig() {
|
|
385
370
|
return {
|
|
386
371
|
fileName: "export",
|
|
@@ -500,6 +485,6 @@ class R extends x {
|
|
|
500
485
|
// #endregion
|
|
501
486
|
}
|
|
502
487
|
export {
|
|
503
|
-
|
|
488
|
+
v as ExportPlugin
|
|
504
489
|
};
|
|
505
490
|
//# sourceMappingURL=index.js.map
|