@toolbox-web/grid 0.3.3 → 0.4.1
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/all.d.ts +19 -19
- package/all.d.ts.map +1 -1
- package/all.js +1798 -1201
- package/all.js.map +1 -1
- package/index.js +2215 -2026
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +22 -12
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/columns.d.ts +0 -9
- package/lib/core/internal/columns.d.ts.map +1 -1
- package/lib/core/internal/config-manager.d.ts +236 -0
- package/lib/core/internal/config-manager.d.ts.map +1 -0
- package/lib/core/internal/editing.d.ts +3 -3
- package/lib/core/internal/editing.d.ts.map +1 -1
- package/lib/core/internal/event-delegation.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/internal/keyboard.d.ts.map +1 -1
- package/lib/core/internal/render-scheduler.d.ts +123 -0
- package/lib/core/internal/render-scheduler.d.ts.map +1 -0
- package/lib/core/internal/rows.d.ts +8 -3
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/sanitize.d.ts +2 -2
- package/lib/core/internal/sanitize.d.ts.map +1 -1
- package/lib/core/internal/shell.d.ts +40 -2
- package/lib/core/internal/shell.d.ts.map +1 -1
- package/lib/core/internal/validate-config.d.ts +25 -0
- package/lib/core/internal/validate-config.d.ts.map +1 -0
- package/lib/core/plugin/base-plugin.d.ts +118 -0
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/index.d.ts +1 -0
- package/lib/core/plugin/index.d.ts.map +1 -1
- package/lib/core/plugin/plugin-manager.d.ts +13 -2
- package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +17 -3
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +112 -12
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +7 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +78 -22
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +72 -21
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +53 -2
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +117 -0
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -0
- package/lib/{core/internal → plugins/editing}/editors.d.ts +1 -1
- package/lib/plugins/editing/editors.d.ts.map +1 -0
- package/lib/plugins/editing/index.d.ts +8 -0
- package/lib/plugins/editing/index.d.ts.map +1 -0
- package/lib/plugins/editing/index.js +721 -0
- package/lib/plugins/editing/index.js.map +1 -0
- package/lib/plugins/editing/types.d.ts +45 -0
- package/lib/plugins/editing/types.d.ts.map +1 -0
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
- package/lib/plugins/export/index.js +68 -17
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +103 -50
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/grouping-columns.d.ts +4 -4
- package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js +80 -29
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.js +62 -11
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +2 -2
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js +156 -102
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/master-detail/types.d.ts +12 -2
- package/lib/plugins/master-detail/types.d.ts.map +1 -1
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.js +75 -22
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +57 -6
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.js +61 -9
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +58 -7
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
- package/lib/plugins/reorder/index.js +75 -19
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/selection/index.js +57 -6
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +60 -9
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/TreePlugin.d.ts +3 -3
- package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
- package/lib/plugins/tree/index.js +181 -126
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/tree/tree-data.d.ts +6 -6
- package/lib/plugins/tree/tree-data.d.ts.map +1 -1
- package/lib/plugins/tree/tree-detect.d.ts +5 -9
- package/lib/plugins/tree/tree-detect.d.ts.map +1 -1
- package/lib/plugins/tree/types.d.ts +16 -4
- package/lib/plugins/tree/types.d.ts.map +1 -1
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +7 -1
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.js +65 -6
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +7 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
- package/lib/plugins/visibility/index.js +61 -2
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +104 -13
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +37 -19
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +25 -7
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +2 -2
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +2 -0
- package/umd/plugins/editing.umd.js.map +1 -0
- package/umd/plugins/export.umd.js +2 -2
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.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/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
- package/umd/plugins/undo-redo.umd.js +1 -1
- package/umd/plugins/undo-redo.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
- package/lib/core/internal/column-state.d.ts +0 -124
- package/lib/core/internal/column-state.d.ts.map +0 -1
- package/lib/core/internal/editors.d.ts.map +0 -1
- package/lib/core/internal/grid-internals.d.ts +0 -83
- package/lib/core/internal/grid-internals.d.ts.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { BaseGridPlugin, CellClickEvent, GridElement } from '../../core/plugin/base-plugin';
|
|
2
|
+
import { ColumnConfig, RowElementInternal } from '../../core/types';
|
|
3
|
+
import { EditingConfig } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* CSS selector for focusable editor elements within a cell.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FOCUSABLE_EDITOR_SELECTOR = "input,select,textarea,[contenteditable=\"true\"],[contenteditable=\"\"],[tabindex]:not([tabindex=\"-1\"])";
|
|
8
|
+
/**
|
|
9
|
+
* Check if a row element has any cells in editing mode.
|
|
10
|
+
*/
|
|
11
|
+
export declare function hasEditingCells(rowEl: RowElementInternal): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Clear all editing state from a row element.
|
|
14
|
+
*/
|
|
15
|
+
export declare function clearEditingState(rowEl: RowElementInternal): void;
|
|
16
|
+
/**
|
|
17
|
+
* Editing Plugin for tbw-grid
|
|
18
|
+
*
|
|
19
|
+
* Provides complete cell/row editing functionality. Without this plugin,
|
|
20
|
+
* the grid has no editing capability.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';
|
|
25
|
+
*
|
|
26
|
+
* const grid = document.createElement('tbw-grid');
|
|
27
|
+
* grid.gridConfig = {
|
|
28
|
+
* columns: [
|
|
29
|
+
* { field: 'name', editable: true },
|
|
30
|
+
* { field: 'age', editable: true, type: 'number' }
|
|
31
|
+
* ],
|
|
32
|
+
* plugins: [new EditingPlugin({ editOn: 'dblclick' })]
|
|
33
|
+
* };
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class EditingPlugin<T = unknown> extends BaseGridPlugin<EditingConfig> {
|
|
37
|
+
#private;
|
|
38
|
+
readonly name = "editing";
|
|
39
|
+
readonly version = "1.0.0";
|
|
40
|
+
protected get defaultConfig(): Partial<EditingConfig>;
|
|
41
|
+
attach(grid: GridElement): void;
|
|
42
|
+
detach(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Augment columns with editing metadata.
|
|
45
|
+
* This enables the grid to recognize editable columns without core knowledge.
|
|
46
|
+
*/
|
|
47
|
+
processColumns?(columns: readonly ColumnConfig<T>[]): ColumnConfig<T>[];
|
|
48
|
+
/**
|
|
49
|
+
* Handle cell clicks - start editing if configured for click mode.
|
|
50
|
+
* Both click and dblclick events come through this handler.
|
|
51
|
+
* Starts row-based editing (all editable cells in the row get editors).
|
|
52
|
+
*/
|
|
53
|
+
onCellClick(event: CellClickEvent): boolean | void;
|
|
54
|
+
/**
|
|
55
|
+
* Handle keyboard events for edit lifecycle.
|
|
56
|
+
*/
|
|
57
|
+
onKeyDown(event: KeyboardEvent): boolean | void;
|
|
58
|
+
/**
|
|
59
|
+
* After render, reapply editors to cells in edit mode.
|
|
60
|
+
* This handles virtualization - when a row scrolls back into view,
|
|
61
|
+
* we need to re-inject the editor.
|
|
62
|
+
*/
|
|
63
|
+
afterRender(): void;
|
|
64
|
+
/**
|
|
65
|
+
* On scroll render, reapply editors to recycled cells.
|
|
66
|
+
*/
|
|
67
|
+
onScrollRender(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get all rows that have been modified.
|
|
70
|
+
*/
|
|
71
|
+
get changedRows(): T[];
|
|
72
|
+
/**
|
|
73
|
+
* Get indices of all modified rows.
|
|
74
|
+
*/
|
|
75
|
+
get changedRowIndices(): number[];
|
|
76
|
+
/**
|
|
77
|
+
* Get the currently active edit row index, or -1 if not editing.
|
|
78
|
+
*/
|
|
79
|
+
get activeEditRow(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Get the currently active edit column index, or -1 if not editing.
|
|
82
|
+
*/
|
|
83
|
+
get activeEditCol(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Check if a specific row is currently being edited.
|
|
86
|
+
*/
|
|
87
|
+
isRowEditing(rowIndex: number): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Check if a specific cell is currently being edited.
|
|
90
|
+
*/
|
|
91
|
+
isCellEditing(rowIndex: number, colIndex: number): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Check if a specific row has been modified.
|
|
94
|
+
*/
|
|
95
|
+
isRowChanged(rowIndex: number): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Reset all change tracking.
|
|
98
|
+
*/
|
|
99
|
+
resetChangedRows(silent?: boolean): void;
|
|
100
|
+
/**
|
|
101
|
+
* Programmatically begin editing a cell.
|
|
102
|
+
*/
|
|
103
|
+
beginCellEdit(rowIndex: number, field: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* Programmatically begin editing all editable cells in a row.
|
|
106
|
+
*/
|
|
107
|
+
beginBulkEdit(rowIndex: number): void;
|
|
108
|
+
/**
|
|
109
|
+
* Commit the currently active row edit.
|
|
110
|
+
*/
|
|
111
|
+
commitActiveRowEdit(): void;
|
|
112
|
+
/**
|
|
113
|
+
* Cancel the currently active row edit.
|
|
114
|
+
*/
|
|
115
|
+
cancelActiveRowEdit(): void;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=EditingPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditingPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/editing/EditingPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACtG,OAAO,KAAK,EAAE,YAAY,EAAgC,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvG,OAAO,KAAK,EAA4C,aAAa,EAAkC,MAAM,SAAS,CAAC;AAMvH;;GAEG;AACH,eAAO,MAAM,yBAAyB,8GACiE,CAAC;AAexG;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAElE;AAWD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAGjE;AA6CD;;;;;;;;;;;;;;;;;;;GAmBG;AAC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Q,EAAE,MAAM,GAAG,IAAI;IA2CrC;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAM3B;;OAEG;IACH,mBAAmB,IAAI,IAAI;CAiZ5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/editing/editors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,aAAa,KAAK,WAAW,GAAG,MAAM,CAgFxG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editing Plugin Entry Point
|
|
3
|
+
* Re-exports plugin class and types for tree-shakeable imports.
|
|
4
|
+
*/
|
|
5
|
+
export { EditingPlugin, FOCUSABLE_EDITOR_SELECTOR, clearEditingState, hasEditingCells } from './EditingPlugin';
|
|
6
|
+
export { defaultEditorFor } from './editors';
|
|
7
|
+
export type { CellCommitDetail, ChangedRowsResetDetail, EditingConfig, EditorContext, RowCommitDetail } from './types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/editing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|