@toolbox-web/grid 2.4.1 → 2.6.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 +15 -3
- package/all.js +2 -2
- package/all.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/core/types.d.ts +72 -30
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/internal/helpers.d.ts +17 -0
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +28 -4
- package/lib/plugins/pinned-rows/index.d.ts +3 -2
- package/lib/plugins/pinned-rows/index.js +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pinned-rows/pinned-rows.d.ts +29 -1
- package/lib/plugins/pinned-rows/types.d.ts +96 -9
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder-columns/index.js.map +1 -1
- package/lib/plugins/reorder-rows/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-drag-drop/index.js.map +1 -1
- package/lib/plugins/row-drag-drop/types.d.ts +7 -0
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tooltip/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +0 -11
- package/lib/plugins/visibility/index.d.ts +1 -2
- package/lib/plugins/visibility/index.js.map +1 -1
- package/lib/plugins/visibility/types.d.ts +32 -0
- package/package.json +1 -1
- package/public.d.ts +28 -67
- package/umd/grid.all.umd.js +1 -1
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +1 -1
- package/umd/grid.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/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/responsive.umd.js +1 -1
- package/umd/plugins/responsive.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
|
@@ -69,7 +69,39 @@ export interface ColumnGroupInfo {
|
|
|
69
69
|
*/
|
|
70
70
|
fields: string[];
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Detail for `column-reorder-request` events emitted when users drag-drop
|
|
74
|
+
* columns in the visibility sidebar panel.
|
|
75
|
+
*
|
|
76
|
+
* This event is consumed by `ReorderPlugin` to actually perform the column
|
|
77
|
+
* move; if `ReorderPlugin` is not loaded, the event is informational only.
|
|
78
|
+
*/
|
|
79
|
+
export interface ColumnReorderRequestDetail {
|
|
80
|
+
/** The field name of the column to move. */
|
|
81
|
+
field: string;
|
|
82
|
+
/** The source index in the column order (before the move). */
|
|
83
|
+
fromIndex: number;
|
|
84
|
+
/** The target index in the column order (after the move). */
|
|
85
|
+
toIndex: number;
|
|
86
|
+
}
|
|
72
87
|
declare module '../../core/types' {
|
|
88
|
+
interface DataGridEventMap {
|
|
89
|
+
/**
|
|
90
|
+
* Fired when the user drag-reorders columns in the visibility sidebar panel.
|
|
91
|
+
* Consumed by `ReorderPlugin` to perform the actual column move.
|
|
92
|
+
* @group Visibility Events
|
|
93
|
+
*/
|
|
94
|
+
'column-reorder-request': ColumnReorderRequestDetail;
|
|
95
|
+
/**
|
|
96
|
+
* Fired when a column is shown or hidden — either via the visibility
|
|
97
|
+
* sidebar, `grid.toggleColumnVisibility(field)`, `grid.setColumnVisible(field, visible)`,
|
|
98
|
+
* or `grid.showAllColumns()`. The `field` and `visible` properties are
|
|
99
|
+
* present for single-column toggles and undefined for bulk operations
|
|
100
|
+
* (`showAllColumns`); `visibleColumns` always lists the current set.
|
|
101
|
+
* @group Visibility Events
|
|
102
|
+
*/
|
|
103
|
+
'column-visibility': ColumnVisibilityDetail;
|
|
104
|
+
}
|
|
73
105
|
interface PluginNameMap {
|
|
74
106
|
visibility: import('./VisibilityPlugin').VisibilityPlugin;
|
|
75
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolbox-web/grid",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Zero-dependency, framework-agnostic data grid web component with virtualization, sorting, filtering, editing, and 20+ plugins. Works in vanilla JS, React, Vue, Angular, and any framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
package/public.d.ts
CHANGED
|
@@ -79,32 +79,16 @@ export declare function queryGrid<TRow = unknown>(selector: string, parent: Pare
|
|
|
79
79
|
export declare function queryGrid<TRow = unknown>(selector: string, awaitUpgrade: true): Promise<DataGridElement<TRow> | null>;
|
|
80
80
|
export declare function queryGrid<TRow = unknown>(selector: string, parent: ParentNode, awaitUpgrade: true): Promise<DataGridElement<TRow> | null>;
|
|
81
81
|
/**
|
|
82
|
-
* Event
|
|
82
|
+
* Event-name constants for DataGrid (public API).
|
|
83
83
|
*
|
|
84
|
-
* Use
|
|
84
|
+
* @deprecated Use string literals directly with the typed `DataGridEventMap`
|
|
85
|
+
* (or import a framework adapter that wires events declaratively, such as
|
|
86
|
+
* `EventProps` in `@toolbox-web/grid-react` or output bindings in
|
|
87
|
+
* `@toolbox-web/grid-angular`). This object is unmaintained — entries may
|
|
88
|
+
* reference events that no longer exist or miss new ones. It will be removed
|
|
89
|
+
* in a future major release.
|
|
85
90
|
*
|
|
86
|
-
* @
|
|
87
|
-
* ```typescript
|
|
88
|
-
* import { DGEvents } from '@toolbox-web/grid';
|
|
89
|
-
*
|
|
90
|
-
* // Type-safe event listening
|
|
91
|
-
* grid.addEventListener(DGEvents.CELL_CLICK, (e) => {
|
|
92
|
-
* console.log('Cell clicked:', e.detail);
|
|
93
|
-
* });
|
|
94
|
-
*
|
|
95
|
-
* grid.addEventListener(DGEvents.SORT_CHANGE, (e) => {
|
|
96
|
-
* const { field, direction } = e.detail;
|
|
97
|
-
* console.log(`Sorted by ${field}`);
|
|
98
|
-
* });
|
|
99
|
-
*
|
|
100
|
-
* grid.addEventListener(DGEvents.CELL_COMMIT, (e) => {
|
|
101
|
-
* // Save edited value
|
|
102
|
-
* saveToServer(e.detail.row);
|
|
103
|
-
* });
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* @see {@link PluginEvents} for plugin-specific events
|
|
107
|
-
* @see {@link DataGridEventMap} for event detail types
|
|
91
|
+
* @see {@link DataGridEventMap} — the canonical, type-checked event registry
|
|
108
92
|
* @category Events
|
|
109
93
|
*/
|
|
110
94
|
export declare const DGEvents: {
|
|
@@ -131,46 +115,27 @@ export declare const DGEvents: {
|
|
|
131
115
|
/**
|
|
132
116
|
* Union type of all DataGrid event names.
|
|
133
117
|
*
|
|
134
|
-
* @
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* grid.addEventListener(event, (e) => console.log(e));
|
|
138
|
-
* }
|
|
139
|
-
* ```
|
|
118
|
+
* @deprecated Use `keyof DataGridEventMap` for a maintained, type-checked
|
|
119
|
+
* union that includes plugin events. Will be removed in a future major
|
|
120
|
+
* release alongside {@link DGEvents}.
|
|
140
121
|
*
|
|
141
|
-
* @see {@link DGEvents} for event constants
|
|
142
122
|
* @category Events
|
|
143
123
|
*/
|
|
144
124
|
export type DGEventName = (typeof DGEvents)[keyof typeof DGEvents];
|
|
145
125
|
/**
|
|
146
|
-
* Plugin event constants (mirrors DGEvents pattern).
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* });
|
|
160
|
-
*
|
|
161
|
-
* // Listen for filter changes
|
|
162
|
-
* grid.addEventListener(PluginEvents.FILTER_CHANGE, (e) => {
|
|
163
|
-
* console.log('Active filters:', e.detail);
|
|
164
|
-
* });
|
|
165
|
-
*
|
|
166
|
-
* // Listen for tree expand/collapse
|
|
167
|
-
* grid.addEventListener(PluginEvents.TREE_EXPAND, (e) => {
|
|
168
|
-
* const { row, expanded } = e.detail;
|
|
169
|
-
* console.log(`Row ${expanded ? 'expanded' : 'collapsed'}`);
|
|
170
|
-
* });
|
|
171
|
-
* ```
|
|
172
|
-
*
|
|
173
|
-
* @see {@link DGEvents} for core grid events
|
|
126
|
+
* Plugin event-name constants (mirrors {@link DGEvents} pattern).
|
|
127
|
+
*
|
|
128
|
+
* @deprecated Use string literals directly with the typed `DataGridEventMap`,
|
|
129
|
+
* which is augmented automatically when plugin modules are imported. This
|
|
130
|
+
* object is unmaintained — several entries here (`TREE_LOAD_START`,
|
|
131
|
+
* `TREE_LOAD_END`, `TREE_LOAD_ERROR`, `SORT_MODEL_CHANGE`, `EXPORT_START`,
|
|
132
|
+
* `CLIPBOARD_COPY`, `CLIPBOARD_PASTE`, `CONTEXT_MENU_CLOSE`,
|
|
133
|
+
* `HISTORY_CHANGE`, `SERVER_LOADING`, `SERVER_ERROR`,
|
|
134
|
+
* `COLUMN_VISIBILITY_CHANGE`, `COLUMN_REORDER`) reference events that are
|
|
135
|
+
* not actually emitted by any plugin. Will be removed in a future major
|
|
136
|
+
* release.
|
|
137
|
+
*
|
|
138
|
+
* @see {@link DataGridEventMap}
|
|
174
139
|
* @category Events
|
|
175
140
|
*/
|
|
176
141
|
export declare const PluginEvents: {
|
|
@@ -198,18 +163,14 @@ export declare const PluginEvents: {
|
|
|
198
163
|
/**
|
|
199
164
|
* Union type of all plugin event names.
|
|
200
165
|
*
|
|
201
|
-
* @
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
* grid.addEventListener(event, (e) => console.log(e));
|
|
205
|
-
* }
|
|
206
|
-
* ```
|
|
166
|
+
* @deprecated Use `keyof DataGridEventMap` (after importing plugin modules)
|
|
167
|
+
* instead. Will be removed alongside {@link PluginEvents} in a future major
|
|
168
|
+
* release.
|
|
207
169
|
*
|
|
208
|
-
* @see {@link PluginEvents} for event constants
|
|
209
170
|
* @category Events
|
|
210
171
|
*/
|
|
211
172
|
export type PluginEventName = (typeof PluginEvents)[keyof typeof PluginEvents];
|
|
212
|
-
export type { A11yConfig, A11yMessages, AggregatorRef, AnimationConfig, AnimationMode, AnimationStyle, BaseColumnConfig, CellActivateDetail, CellActivateTrigger, CellChangeDetail, CellClickDetail, CellRenderContext, ColumnConfig, ColumnConfigMap, ColumnEditorContext, ColumnEditorSpec, ColumnResizeDetail, ColumnSortState, ColumnState, ColumnType, ColumnViewRenderer, DataChangeDetail, DataGridCustomEvent,
|
|
173
|
+
export type { A11yConfig, A11yMessages, AggregatorRef, AnimationConfig, AnimationMode, AnimationStyle, BaseColumnConfig, CellActivateDetail, CellActivateTrigger, CellChangeDetail, CellClickDetail, CellRenderContext, ColumnConfig, ColumnConfigMap, ColumnEditorContext, ColumnEditorSpec, ColumnResizeDetail, ColumnResizeResetDetail, ColumnSortState, ColumnState, ColumnType, ColumnViewRenderer, DataChangeDetail, DataGridCustomEvent, DataGridEventMap, ExpandCollapseAnimation, ExternalMountEditorDetail, ExternalMountViewDetail, FeatureConfig, FitMode, FrameworkAdapter, GridColumnState, GridConfig, GridIcons, GridPlugin, HeaderCellContext, HeaderContentDefinition, HeaderLabelContext, HeaderLabelRenderer, HeaderRenderer, IconValue, InferredColumnResult, LoadingContext, LoadingRenderer, LoadingSize, PrimitiveColumnType, PublicGrid, RowAnimationType, RowClickDetail, RowGroupRenderConfig, RowTransaction, RowUpdate, ScrollToRowOptions, ShellConfig, ShellHeaderConfig, SortChangeDetail, SortHandler, SortState, TbwScrollDetail, ToolbarContentDefinition, ToolPanelConfig, ToolPanelDefinition, TransactionResult, TypeDefault, UpdateSource, } from './lib/core/types';
|
|
213
174
|
export { DEFAULT_A11Y_MESSAGES, DEFAULT_ANIMATION_CONFIG, DEFAULT_GRID_ICONS, FitModeEnum } from './lib/core/types';
|
|
214
175
|
export { builtInSort, defaultComparator } from './lib/core/internal/sorting';
|
|
215
176
|
export { CORE_CONSUMED_ADAPTER_METHODS } from './lib/core/adapter-conformance';
|