@toolbox-web/grid 0.6.0 → 1.1.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.d.ts +1 -0
- package/all.d.ts.map +1 -1
- package/all.js +1899 -2696
- package/all.js.map +1 -1
- package/index.js +1498 -2489
- 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 +10 -0
- package/lib/core/internal/validate-config.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +103 -15
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/index.d.ts +1 -1
- package/lib/core/plugin/index.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 +46 -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 +55 -43
- 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 +76 -66
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +107 -10
- 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 +458 -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 +40 -33
- 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 +31 -17
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +86 -7
- 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 +57 -27
- 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 +35 -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 +33 -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 +33 -19
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +67 -3
- 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 +43 -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 +27 -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 +32 -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 +30 -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/responsive/ResponsivePlugin.d.ts +123 -0
- package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +1 -0
- package/lib/plugins/responsive/index.d.ts +11 -0
- package/lib/plugins/responsive/index.d.ts.map +1 -0
- package/lib/plugins/responsive/index.js +589 -0
- package/lib/plugins/responsive/index.js.map +1 -0
- package/lib/plugins/responsive/types.d.ts +133 -0
- package/lib/plugins/responsive/types.d.ts.map +1 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts +90 -21
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +3 -2
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +125 -144
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +51 -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 +27 -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 +81 -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 +32 -22
- 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 +28 -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 +31 -25
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +21 -17
- 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 +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 +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/responsive.umd.js +2 -0
- package/umd/plugins/responsive.umd.js.map +1 -0
- package/umd/plugins/selection.umd.js +3 -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
|
@@ -1,16 +1,80 @@
|
|
|
1
1
|
import { BaseGridPlugin } from '../../core/plugin/base-plugin';
|
|
2
2
|
import { ReorderConfig } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* Column
|
|
4
|
+
* Column Reorder Plugin for tbw-grid
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Lets users rearrange columns by dragging and dropping column headers. Supports smooth
|
|
7
|
+
* FLIP animations, fade transitions, or instant reordering. Animation respects the
|
|
8
|
+
* grid-level `animation.mode` setting.
|
|
9
|
+
*
|
|
10
|
+
* ## Installation
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* ## Configuration Options
|
|
17
|
+
*
|
|
18
|
+
* | Option | Type | Default | Description |
|
|
19
|
+
* |--------|------|---------|-------------|
|
|
20
|
+
* | `animation` | `false \| 'flip' \| 'fade'` | `'flip'` | Animation type for column moves |
|
|
21
|
+
* | `animationDuration` | `number` | `200` | Animation duration in ms |
|
|
22
|
+
*
|
|
23
|
+
* ## Keyboard Shortcuts
|
|
24
|
+
*
|
|
25
|
+
* | Key | Action |
|
|
26
|
+
* |-----|--------|
|
|
27
|
+
* | `Alt + ←` | Move focused column left |
|
|
28
|
+
* | `Alt + →` | Move focused column right |
|
|
29
|
+
*
|
|
30
|
+
* ## Events
|
|
31
|
+
*
|
|
32
|
+
* | Event | Detail | Cancelable | Description |
|
|
33
|
+
* |-------|--------|------------|-------------|
|
|
34
|
+
* | `column-move` | `{ field, fromIndex, toIndex, columnOrder }` | Yes | Fired when a column move is attempted |
|
|
35
|
+
*
|
|
36
|
+
* @example Basic Drag-and-Drop Reordering
|
|
7
37
|
* ```ts
|
|
8
|
-
*
|
|
38
|
+
* import '@toolbox-web/grid';
|
|
39
|
+
* import { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';
|
|
40
|
+
*
|
|
41
|
+
* const grid = document.querySelector('tbw-grid');
|
|
42
|
+
* grid.gridConfig = {
|
|
43
|
+
* columns: [
|
|
44
|
+
* { field: 'id', header: 'ID' },
|
|
45
|
+
* { field: 'name', header: 'Name' },
|
|
46
|
+
* { field: 'email', header: 'Email' },
|
|
47
|
+
* ],
|
|
48
|
+
* plugins: [new ReorderPlugin({ animation: 'flip', animationDuration: 200 })],
|
|
49
|
+
* };
|
|
50
|
+
*
|
|
51
|
+
* // Persist column order
|
|
52
|
+
* grid.addEventListener('column-move', (e) => {
|
|
53
|
+
* localStorage.setItem('columnOrder', JSON.stringify(e.detail.columnOrder));
|
|
54
|
+
* });
|
|
9
55
|
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example Prevent Moves That Break Group Boundaries
|
|
58
|
+
* ```ts
|
|
59
|
+
* grid.addEventListener('column-move', (e) => {
|
|
60
|
+
* if (!isValidMoveWithinGroup(e.detail.field, e.detail.fromIndex, e.detail.toIndex)) {
|
|
61
|
+
* e.preventDefault(); // Column snaps back to original position
|
|
62
|
+
* }
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @see {@link ReorderConfig} for all configuration options
|
|
67
|
+
* @see {@link ColumnMoveDetail} for the event detail structure
|
|
68
|
+
* @see {@link GroupingColumnsPlugin} for column group integration
|
|
69
|
+
*
|
|
70
|
+
* @internal Extends BaseGridPlugin
|
|
10
71
|
*/
|
|
11
72
|
export declare class ReorderPlugin extends BaseGridPlugin<ReorderConfig> {
|
|
73
|
+
/** @internal */
|
|
12
74
|
readonly name = "reorder";
|
|
75
|
+
/** @internal */
|
|
13
76
|
readonly styles: string;
|
|
77
|
+
/** @internal */
|
|
14
78
|
protected get defaultConfig(): Partial<ReorderConfig>;
|
|
15
79
|
/**
|
|
16
80
|
* Resolve animation type from plugin config.
|
|
@@ -34,11 +98,15 @@ export declare class ReorderPlugin extends BaseGridPlugin<ReorderConfig> {
|
|
|
34
98
|
* Clear all drag-related classes from header cells.
|
|
35
99
|
*/
|
|
36
100
|
private clearDragClasses;
|
|
101
|
+
/** @internal */
|
|
37
102
|
attach(grid: import('../../core/plugin/base-plugin').GridElement): void;
|
|
103
|
+
/** @internal */
|
|
38
104
|
detach(): void;
|
|
105
|
+
/** @internal */
|
|
39
106
|
afterRender(): void;
|
|
40
107
|
/**
|
|
41
108
|
* Handle Alt+Arrow keyboard shortcuts for column reordering.
|
|
109
|
+
* @internal
|
|
42
110
|
*/
|
|
43
111
|
onKeyDown(event: KeyboardEvent): boolean | void;
|
|
44
112
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReorderPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/reorder/ReorderPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAkB,MAAM,+BAA+B,CAAC;AAI/E,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"ReorderPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/reorder/ReorderPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAkB,MAAM,+BAA+B,CAAC;AAI/E,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,qBAAa,aAAc,SAAQ,cAAc,CAAC,aAAa,CAAC;IAC9D,gBAAgB;IAChB,QAAQ,CAAC,IAAI,aAAa;IAC1B,gBAAgB;IAChB,SAAkB,MAAM,SAAU;IAElC,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,CAI7D;IAED;;;OAGG;IACH,OAAO,KAAK,aAAa,GAQxB;IAED;;;OAGG;IACH,cAAuB,iBAAiB,IAAI,MAAM,CAMjD;IAGD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,SAAS,CAAuB;IAExC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB,gBAAgB;IACP,MAAM,CAAC,IAAI,EAAE,OAAO,+BAA+B,EAAE,WAAW,GAAG,IAAI;IAiBhF,gBAAgB;IACP,MAAM,IAAI,IAAI;IAUvB,gBAAgB;IACP,WAAW,IAAI,IAAI;IAiG5B;;;OAGG;IACM,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;IAyCxD;;;OAGG;IACH,cAAc,IAAI,MAAM,EAAE;IAI1B;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAoBhD;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAIrC;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAQxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAS9B;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAmDnB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAgDnB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAqB1B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reorder Plugin Entry Point
|
|
3
3
|
* Re-exports plugin class and types for tree-shakeable imports.
|
|
4
|
+
*
|
|
5
|
+
* @module Plugins/Reorder
|
|
4
6
|
*/
|
|
5
7
|
export { ReorderPlugin } from './ReorderPlugin';
|
|
6
8
|
export type { ColumnMoveDetail, ReorderAnimation, ReorderConfig } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/reorder/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/reorder/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -78,6 +78,28 @@ class A {
|
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
80
|
static dependencies;
|
|
81
|
+
/**
|
|
82
|
+
* Plugin manifest - declares owned properties, config rules, and hook priorities.
|
|
83
|
+
*
|
|
84
|
+
* This is read by the configuration validator to:
|
|
85
|
+
* - Validate that required plugins are loaded when their properties are used
|
|
86
|
+
* - Execute configRules to detect invalid/conflicting settings
|
|
87
|
+
* - Order hook execution based on priority
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* static override readonly manifest: PluginManifest<MyConfig> = {
|
|
92
|
+
* ownedProperties: [
|
|
93
|
+
* { property: 'myProp', level: 'column', description: 'the "myProp" column property' },
|
|
94
|
+
* ],
|
|
95
|
+
* configRules: [
|
|
96
|
+
* { id: 'myPlugin/conflict', severity: 'warn', message: '...', check: (c) => c.a && c.b },
|
|
97
|
+
* ],
|
|
98
|
+
* };
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
+
static manifest;
|
|
81
103
|
/**
|
|
82
104
|
* Plugin version - defaults to grid version for built-in plugins.
|
|
83
105
|
* Third-party plugins can override with their own semver.
|
|
@@ -237,23 +259,6 @@ class A {
|
|
|
237
259
|
get gridElement() {
|
|
238
260
|
return this.grid;
|
|
239
261
|
}
|
|
240
|
-
/**
|
|
241
|
-
* Get the render root of the grid for DOM queries.
|
|
242
|
-
* @deprecated Use `gridElement` instead. This getter exists only for backward compatibility.
|
|
243
|
-
*
|
|
244
|
-
* With Shadow DOM removed, the grid element itself is the render root.
|
|
245
|
-
* All new code should use `this.gridElement` for DOM queries.
|
|
246
|
-
*
|
|
247
|
-
* @example
|
|
248
|
-
* // OLD (deprecated)
|
|
249
|
-
* const rows = this.shadowRoot?.querySelector('.rows');
|
|
250
|
-
*
|
|
251
|
-
* // NEW (preferred)
|
|
252
|
-
* const rows = this.gridElement.querySelector('.rows');
|
|
253
|
-
*/
|
|
254
|
-
get shadowRoot() {
|
|
255
|
-
return this.gridElement;
|
|
256
|
-
}
|
|
257
262
|
/**
|
|
258
263
|
* Get the disconnect signal for event listener cleanup.
|
|
259
264
|
* This signal is aborted when the grid disconnects from the DOM.
|
|
@@ -367,8 +372,11 @@ function p(l, e, t) {
|
|
|
367
372
|
}
|
|
368
373
|
const _ = '@layer tbw-plugins{.header-row>.cell[draggable=true]{cursor:grab;position:relative}.header-row>.cell.dragging{opacity:.5;cursor:grabbing}.header-row>.cell.drop-before:before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent));z-index:1}.header-row>.cell.drop-after:after{content:"";position:absolute;right:0;top:0;bottom:0;width:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent));z-index:1}.cell.flip-animating{transition:transform var(--tbw-animation-duration, .2s) ease-out;will-change:transform;z-index:1}@keyframes reorder-fade-in{0%{opacity:0}to{opacity:1}}.cell.fade-animating{animation:reorder-fade-in var(--tbw-animation-duration, .2s) ease-out backwards}}';
|
|
369
374
|
class R extends A {
|
|
375
|
+
/** @internal */
|
|
370
376
|
name = "reorder";
|
|
377
|
+
/** @internal */
|
|
371
378
|
styles = _;
|
|
379
|
+
/** @internal */
|
|
372
380
|
get defaultConfig() {
|
|
373
381
|
return {
|
|
374
382
|
animation: "flip"
|
|
@@ -380,7 +388,7 @@ class R extends A {
|
|
|
380
388
|
* Uses base class isAnimationEnabled to respect grid-level settings.
|
|
381
389
|
*/
|
|
382
390
|
get animationType() {
|
|
383
|
-
return this.isAnimationEnabled ? this.config.animation !== void 0 ? this.config.animation :
|
|
391
|
+
return this.isAnimationEnabled ? this.config.animation !== void 0 ? this.config.animation : "flip" : !1;
|
|
384
392
|
}
|
|
385
393
|
/**
|
|
386
394
|
* Get animation duration, allowing plugin config override.
|
|
@@ -413,6 +421,7 @@ class R extends A {
|
|
|
413
421
|
}
|
|
414
422
|
// #endregion
|
|
415
423
|
// #region Lifecycle
|
|
424
|
+
/** @internal */
|
|
416
425
|
attach(e) {
|
|
417
426
|
super.attach(e), e.addEventListener(
|
|
418
427
|
"column-reorder-request",
|
|
@@ -423,11 +432,13 @@ class R extends A {
|
|
|
423
432
|
{ signal: this.disconnectSignal }
|
|
424
433
|
);
|
|
425
434
|
}
|
|
435
|
+
/** @internal */
|
|
426
436
|
detach() {
|
|
427
437
|
this.isDragging = !1, this.draggedField = null, this.draggedIndex = null, this.dropIndex = null;
|
|
428
438
|
}
|
|
429
439
|
// #endregion
|
|
430
440
|
// #region Hooks
|
|
441
|
+
/** @internal */
|
|
431
442
|
afterRender() {
|
|
432
443
|
const e = this.gridElement;
|
|
433
444
|
if (!e) return;
|
|
@@ -467,6 +478,7 @@ class R extends A {
|
|
|
467
478
|
}
|
|
468
479
|
/**
|
|
469
480
|
* Handle Alt+Arrow keyboard shortcuts for column reordering.
|
|
481
|
+
* @internal
|
|
470
482
|
*/
|
|
471
483
|
onKeyDown(e) {
|
|
472
484
|
if (!e.altKey || e.key !== "ArrowLeft" && e.key !== "ArrowRight")
|