@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
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { BaseGridPlugin } from '../plugin';
|
|
2
|
-
import { ColumnConfig, GridColumnState, InternalGrid } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Collect column state from the grid and all plugins.
|
|
5
|
-
* Returns a complete GridColumnState object ready for serialization.
|
|
6
|
-
*/
|
|
7
|
-
export declare function collectColumnState<T>(grid: InternalGrid<T>, plugins: BaseGridPlugin[]): GridColumnState;
|
|
8
|
-
/**
|
|
9
|
-
* Apply column state to the grid and all plugins.
|
|
10
|
-
* Modifies the grid's internal state and triggers plugin state restoration.
|
|
11
|
-
*
|
|
12
|
-
* @param grid - The grid instance
|
|
13
|
-
* @param state - The state to apply
|
|
14
|
-
* @param allColumns - All available columns (including hidden ones)
|
|
15
|
-
* @param plugins - Plugins that may have applyColumnState hooks
|
|
16
|
-
*/
|
|
17
|
-
export declare function applyColumnState<T>(grid: InternalGrid<T>, state: GridColumnState, allColumns: ColumnConfig<T>[], plugins: BaseGridPlugin[]): void;
|
|
18
|
-
/**
|
|
19
|
-
* Create a state change handler with debouncing.
|
|
20
|
-
* Returns a function that, when called, will eventually emit the state change event.
|
|
21
|
-
*/
|
|
22
|
-
export declare function createStateChangeHandler<T>(grid: InternalGrid<T>, getPlugins: () => BaseGridPlugin[], emit: (detail: GridColumnState) => void): () => void;
|
|
23
|
-
/**
|
|
24
|
-
* Compare two column states to check if they are equal.
|
|
25
|
-
* Useful for preventing duplicate state change events.
|
|
26
|
-
*/
|
|
27
|
-
export declare function areColumnStatesEqual(a: GridColumnState, b: GridColumnState): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* State manager for a grid instance.
|
|
30
|
-
* Encapsulates the state change handler and initial state storage.
|
|
31
|
-
*/
|
|
32
|
-
export interface ColumnStateManager {
|
|
33
|
-
/** The initial state to apply after initialization */
|
|
34
|
-
initialState: GridColumnState | undefined;
|
|
35
|
-
/** Debounced state change handler */
|
|
36
|
-
stateChangeHandler: (() => void) | undefined;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Create a column state manager for a grid.
|
|
40
|
-
*/
|
|
41
|
-
export declare function createColumnStateManager(): ColumnStateManager;
|
|
42
|
-
/**
|
|
43
|
-
* Get the current column state from the grid.
|
|
44
|
-
* @param grid - The grid instance
|
|
45
|
-
* @param plugins - Array of attached plugins
|
|
46
|
-
* @returns Serializable column state object
|
|
47
|
-
*/
|
|
48
|
-
export declare function getGridColumnState<T>(grid: InternalGrid<T>, plugins: BaseGridPlugin[]): GridColumnState;
|
|
49
|
-
/**
|
|
50
|
-
* Set column state on a grid, storing for later if not yet initialized.
|
|
51
|
-
* @param grid - The grid instance
|
|
52
|
-
* @param state - The state to apply
|
|
53
|
-
* @param manager - The column state manager
|
|
54
|
-
* @param isInitialized - Whether the grid is initialized
|
|
55
|
-
* @param applyNow - Function to apply the state immediately
|
|
56
|
-
*/
|
|
57
|
-
export declare function setGridColumnState<T>(state: GridColumnState | undefined, manager: ColumnStateManager, isInitialized: boolean, applyNow: (state: GridColumnState) => void): void;
|
|
58
|
-
/**
|
|
59
|
-
* Request a state change event emission (debounced).
|
|
60
|
-
* @param grid - The grid instance
|
|
61
|
-
* @param manager - The column state manager
|
|
62
|
-
* @param getPlugins - Function to get attached plugins
|
|
63
|
-
* @param emit - Function to emit the event
|
|
64
|
-
*/
|
|
65
|
-
export declare function requestGridStateChange<T>(grid: InternalGrid<T>, manager: ColumnStateManager, getPlugins: () => BaseGridPlugin[], emit: (state: GridColumnState) => void): void;
|
|
66
|
-
/**
|
|
67
|
-
* Reset column state to initial configuration.
|
|
68
|
-
* @param grid - The grid instance
|
|
69
|
-
* @param manager - The column state manager
|
|
70
|
-
* @param plugins - Array of attached plugins
|
|
71
|
-
* @param callbacks - Grid callbacks for triggering updates
|
|
72
|
-
*/
|
|
73
|
-
export declare function resetGridColumnState<T>(grid: InternalGrid<T>, manager: ColumnStateManager, plugins: BaseGridPlugin[], callbacks: {
|
|
74
|
-
mergeEffectiveConfig: () => void;
|
|
75
|
-
setup: () => void;
|
|
76
|
-
requestStateChange: () => void;
|
|
77
|
-
}): void;
|
|
78
|
-
/** Callbacks for visibility changes that need grid integration */
|
|
79
|
-
export interface VisibilityCallbacks {
|
|
80
|
-
emit: (eventName: string, detail: unknown) => void;
|
|
81
|
-
clearRowPool: () => void;
|
|
82
|
-
setup: () => void;
|
|
83
|
-
requestStateChange: () => void;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Set the visibility of a column.
|
|
87
|
-
* @returns true if visibility changed, false otherwise
|
|
88
|
-
*/
|
|
89
|
-
export declare function setColumnVisible<T>(grid: InternalGrid<T>, field: string, visible: boolean, callbacks: VisibilityCallbacks): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Toggle column visibility.
|
|
92
|
-
* @returns true if toggled, false if column not found or locked
|
|
93
|
-
*/
|
|
94
|
-
export declare function toggleColumnVisibility<T>(grid: InternalGrid<T>, field: string, callbacks: VisibilityCallbacks): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Check if a column is visible.
|
|
97
|
-
*/
|
|
98
|
-
export declare function isColumnVisible<T>(grid: InternalGrid<T>, field: string): boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Show all columns.
|
|
101
|
-
*/
|
|
102
|
-
export declare function showAllColumns<T>(grid: InternalGrid<T>, callbacks: VisibilityCallbacks): void;
|
|
103
|
-
/**
|
|
104
|
-
* Get all columns with visibility info.
|
|
105
|
-
*/
|
|
106
|
-
export declare function getAllColumns<T>(grid: InternalGrid<T>): Array<{
|
|
107
|
-
field: string;
|
|
108
|
-
header: string;
|
|
109
|
-
visible: boolean;
|
|
110
|
-
lockVisible?: boolean;
|
|
111
|
-
}>;
|
|
112
|
-
/**
|
|
113
|
-
* Get current column order.
|
|
114
|
-
*/
|
|
115
|
-
export declare function getColumnOrder<T>(grid: InternalGrid<T>): string[];
|
|
116
|
-
/**
|
|
117
|
-
* Set column order.
|
|
118
|
-
*/
|
|
119
|
-
export declare function setColumnOrder<T>(grid: InternalGrid<T>, order: string[], callbacks: {
|
|
120
|
-
renderHeader: () => void;
|
|
121
|
-
updateTemplate: () => void;
|
|
122
|
-
refreshVirtualWindow: () => void;
|
|
123
|
-
}): void;
|
|
124
|
-
//# sourceMappingURL=column-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-state.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/column-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EACV,YAAY,EAIZ,eAAe,EACf,YAAY,EACb,MAAM,UAAU,CAAC;AAsBlB;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,eAAe,CAwCvG;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,EAC7B,OAAO,EAAE,cAAc,EAAE,GACxB,IAAI,CA8DN;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,UAAU,EAAE,MAAM,cAAc,EAAE,EAClC,IAAI,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,GACtC,MAAM,IAAI,CAgBZ;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,GAAG,OAAO,CAuBpF;AAQD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,sDAAsD;IACtD,YAAY,EAAE,eAAe,GAAG,SAAS,CAAC;IAC1C,qCAAqC;IACrC,kBAAkB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,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/src/lib/core/internal/editors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,aAAa,KAAK,WAAW,GAAG,MAAM,CAiFxG"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { BaseGridPlugin } from '../plugin';
|
|
2
|
-
import { ColumnInternal, GridConfig, InternalGrid } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Callback interface for grid operations that modules need to trigger.
|
|
5
|
-
* These are provided by the grid to modules so they can trigger re-renders,
|
|
6
|
-
* emit events, etc. without direct coupling.
|
|
7
|
-
*/
|
|
8
|
-
export interface GridCallbacks<T = any> {
|
|
9
|
-
/** Emit a custom event from the grid element */
|
|
10
|
-
emit: (eventName: string, detail: any) => void;
|
|
11
|
-
/** Trigger full grid setup (re-parse columns, re-render) */
|
|
12
|
-
setup: () => void;
|
|
13
|
-
/** Refresh the virtual window (re-render visible rows) */
|
|
14
|
-
refreshVirtualWindow: (full: boolean) => void;
|
|
15
|
-
/** Update CSS grid template for column widths */
|
|
16
|
-
updateTemplate: () => void;
|
|
17
|
-
/** Render the header row */
|
|
18
|
-
renderHeader: () => void;
|
|
19
|
-
/** Get array of attached plugins */
|
|
20
|
-
getPlugins: () => BaseGridPlugin[];
|
|
21
|
-
/** Find rendered row element by index */
|
|
22
|
-
findRenderedRowElement: (rowIndex: number) => HTMLElement | null;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Interface for internal grid state access.
|
|
26
|
-
*
|
|
27
|
-
* Extracted modules (columns.ts, column-state.ts, editing.ts, shell.ts) receive
|
|
28
|
-
* this interface instead of the full Grid class. This:
|
|
29
|
-
* 1. Makes dependencies explicit
|
|
30
|
-
* 2. Enables tree-shaking (modules don't depend on entire Grid)
|
|
31
|
-
* 3. Improves testability (can mock this interface)
|
|
32
|
-
*/
|
|
33
|
-
export interface GridInternals<T = any> {
|
|
34
|
-
/** The merged effective config - single source of truth */
|
|
35
|
-
effectiveConfig: GridConfig<T>;
|
|
36
|
-
/** All columns including hidden */
|
|
37
|
-
_columns: ColumnInternal<T>[];
|
|
38
|
-
/** Visible columns only (computed from _columns) */
|
|
39
|
-
readonly _visibleColumns: ColumnInternal<T>[];
|
|
40
|
-
/** Processed rows (after plugin hooks) */
|
|
41
|
-
_rows: T[];
|
|
42
|
-
/** Source rows before processing */
|
|
43
|
-
readonly sourceRows: T[];
|
|
44
|
-
/** Currently active edit row index (-1 if none) */
|
|
45
|
-
_activeEditRows: number;
|
|
46
|
-
/** Snapshots of row data before editing started */
|
|
47
|
-
_rowEditSnapshots: Map<number, T>;
|
|
48
|
-
/** Set of row indices that have been modified */
|
|
49
|
-
_changedRowIndices: Set<number>;
|
|
50
|
-
/** Currently focused row index */
|
|
51
|
-
_focusRow: number;
|
|
52
|
-
/** Currently focused column index */
|
|
53
|
-
_focusCol: number;
|
|
54
|
-
/** Current sort state */
|
|
55
|
-
_sortState: {
|
|
56
|
-
field: string;
|
|
57
|
-
direction: 1 | -1;
|
|
58
|
-
} | null;
|
|
59
|
-
/** Shadow root of the grid element */
|
|
60
|
-
readonly shadowRoot: ShadowRoot | null;
|
|
61
|
-
/** Header row element */
|
|
62
|
-
readonly _headerRowEl: HTMLElement;
|
|
63
|
-
/** Body container element (holds rendered rows) */
|
|
64
|
-
readonly _bodyEl: HTMLElement;
|
|
65
|
-
/** Row element pool for virtualization */
|
|
66
|
-
_rowPool: HTMLElement[];
|
|
67
|
-
/** Epoch counter for row rendering (incremented on structural changes) */
|
|
68
|
-
__rowRenderEpoch: number;
|
|
69
|
-
/** Grid operation callbacks */
|
|
70
|
-
readonly _callbacks: GridCallbacks<T>;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Create a GridInternals adapter from an InternalGrid instance.
|
|
74
|
-
*
|
|
75
|
-
* This function bridges the gap between the full grid and the minimal interface
|
|
76
|
-
* that extracted modules need. Call this in grid.ts to create the adapter once.
|
|
77
|
-
*
|
|
78
|
-
* @param grid - The full grid instance
|
|
79
|
-
* @param callbacks - Callbacks for grid operations
|
|
80
|
-
* @returns GridInternals interface backed by the grid
|
|
81
|
-
*/
|
|
82
|
-
export declare function createGridInternals<T>(grid: InternalGrid<T>, callbacks: GridCallbacks<T>): GridInternals<T>;
|
|
83
|
-
//# sourceMappingURL=grid-internals.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-internals.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/grid-internals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG;IACpC,gDAAgD;IAChD,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/C,4DAA4D;IAC5D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,0DAA0D;IAC1D,oBAAoB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,iDAAiD;IACjD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,4BAA4B;IAC5B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,oCAAoC;IACpC,UAAU,EAAE,MAAM,cAAc,EAAE,CAAC;IACnC,yCAAyC;IACzC,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;CAClE;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,G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