@ornery/ui-grid-vanilla 0.1.7-hotfix
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/demo/index.html +79 -0
- package/demo/main.ts +68 -0
- package/dist/index.d.mts +206 -0
- package/dist/index.d.ts +206 -0
- package/dist/index.js +1456 -0
- package/dist/index.mjs +1495 -0
- package/package.json +33 -0
- package/src/grid-controller.ts +906 -0
- package/src/index.integration.test.ts +245 -0
- package/src/index.test.ts +52 -0
- package/src/index.ts +60 -0
- package/src/ui-grid-standalone.element.ts +972 -0
- package/tsconfig.json +13 -0
- package/vite.config.ts +23 -0
package/demo/index.html
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>UI Grid Vanilla Demo</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
|
|
10
|
+
color: #14213d;
|
|
11
|
+
background:
|
|
12
|
+
radial-gradient(circle at top left, rgba(244, 162, 97, 0.28), transparent 28%),
|
|
13
|
+
radial-gradient(circle at bottom right, rgba(42, 157, 143, 0.24), transparent 32%),
|
|
14
|
+
#f7f3eb;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body {
|
|
18
|
+
margin: 0;
|
|
19
|
+
min-height: 100vh;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.page {
|
|
23
|
+
display: grid;
|
|
24
|
+
gap: 1.5rem;
|
|
25
|
+
max-width: 1200px;
|
|
26
|
+
margin: 0 auto;
|
|
27
|
+
padding: 2rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.hero {
|
|
31
|
+
padding: 1.5rem 1.75rem;
|
|
32
|
+
border: 1px solid rgba(20, 33, 61, 0.12);
|
|
33
|
+
border-radius: 1.25rem;
|
|
34
|
+
background: rgba(255, 255, 255, 0.72);
|
|
35
|
+
backdrop-filter: blur(18px);
|
|
36
|
+
box-shadow: 0 24px 80px rgba(20, 33, 61, 0.08);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
h1 {
|
|
40
|
+
margin: 0 0 0.5rem;
|
|
41
|
+
font-size: clamp(2rem, 4vw, 3.5rem);
|
|
42
|
+
line-height: 0.95;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
p {
|
|
46
|
+
margin: 0;
|
|
47
|
+
max-width: 65ch;
|
|
48
|
+
line-height: 1.5;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#app {
|
|
52
|
+
min-height: 640px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.shell {
|
|
56
|
+
--ui-grid-surface: rgba(255, 255, 255, 0.88);
|
|
57
|
+
--ui-grid-header-background: #143a52;
|
|
58
|
+
--ui-grid-header-color: #f7f3eb;
|
|
59
|
+
--ui-grid-accent: #e76f51;
|
|
60
|
+
--ui-grid-cell-color: #14213d;
|
|
61
|
+
--ui-grid-border-color: rgba(20, 33, 61, 0.16);
|
|
62
|
+
--ui-grid-row-hover: rgba(231, 111, 81, 0.08);
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<main class="page shell">
|
|
68
|
+
<section class="hero">
|
|
69
|
+
<h1>Vanilla + Rust/WASM UI Grid</h1>
|
|
70
|
+
<p>
|
|
71
|
+
This page mounts the Rust-backed custom element directly, without Angular or React host code.
|
|
72
|
+
It is the baseline integration target for future Rust-framework wrappers.
|
|
73
|
+
</p>
|
|
74
|
+
</section>
|
|
75
|
+
<section id="app"></section>
|
|
76
|
+
</main>
|
|
77
|
+
<script type="module" src="./main.ts"></script>
|
|
78
|
+
</body>
|
|
79
|
+
</html>
|
package/demo/main.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { mountVanillaUiGrid } from '../src/index';
|
|
2
|
+
import type { GridOptions } from '../src/index';
|
|
3
|
+
import * as uiGridRustWebModule from '../../../dist/ui-grid-wasm-web/ui_grid_wasm.js';
|
|
4
|
+
|
|
5
|
+
const statuses = ['Active', 'Expansion', 'Enterprise', 'Pilot'] as const;
|
|
6
|
+
const companies = ['Northwind', 'Blue Harbor', 'Forge Group', 'Larkspur', 'Atlas'] as const;
|
|
7
|
+
const owners = ['Casey Tran', 'Jordan Silva', 'Priya Rao', 'Evan Brooks', 'Mina Patel'] as const;
|
|
8
|
+
|
|
9
|
+
function createDemoData(count = 5000) {
|
|
10
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
11
|
+
id: `row-${i + 1}`,
|
|
12
|
+
name: `Customer ${i + 1}`,
|
|
13
|
+
company: companies[i % companies.length],
|
|
14
|
+
revenue: 40000 + i * 1350,
|
|
15
|
+
status: statuses[i % statuses.length],
|
|
16
|
+
renewalDate: `2026-${String((i % 12) + 1).padStart(2, '0')}-${String((i % 27) + 1).padStart(2, '0')}`,
|
|
17
|
+
account: { owner: owners[i % owners.length] },
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const options: GridOptions = {
|
|
22
|
+
id: 'vanilla-demo-grid',
|
|
23
|
+
title: 'UI Grid Vanilla Demo',
|
|
24
|
+
emptyMessage: 'No rows match the current filters.',
|
|
25
|
+
rowHeight: 48,
|
|
26
|
+
viewportHeight: 620,
|
|
27
|
+
enableSorting: true,
|
|
28
|
+
enableFiltering: true,
|
|
29
|
+
enableGrouping: true,
|
|
30
|
+
enableVirtualization: true,
|
|
31
|
+
virtualizationThreshold: 25,
|
|
32
|
+
grouping: { groupBy: ['status'] },
|
|
33
|
+
columnDefs: [
|
|
34
|
+
{ name: 'name', displayName: 'Customer', width: 'minmax(14rem, 1.2fr)' },
|
|
35
|
+
{ name: 'company', width: 'minmax(12rem, 1fr)' },
|
|
36
|
+
{
|
|
37
|
+
name: 'revenue',
|
|
38
|
+
type: 'number',
|
|
39
|
+
align: 'end',
|
|
40
|
+
width: 'minmax(10rem, 0.7fr)',
|
|
41
|
+
},
|
|
42
|
+
{ name: 'status', width: 'minmax(8rem, 0.7fr)' },
|
|
43
|
+
{
|
|
44
|
+
name: 'renewalDate',
|
|
45
|
+
type: 'date',
|
|
46
|
+
displayName: 'Renewal',
|
|
47
|
+
width: 'minmax(11rem, 0.8fr)',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'owner',
|
|
51
|
+
field: 'account.owner',
|
|
52
|
+
displayName: 'Account Owner',
|
|
53
|
+
width: 'minmax(11rem, 0.8fr)',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
data: createDemoData(),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const mountPoint = document.getElementById('app');
|
|
60
|
+
|
|
61
|
+
if (!mountPoint) {
|
|
62
|
+
throw new Error('Expected vanilla demo mount point');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void mountVanillaUiGrid(mountPoint, options, uiGridRustWebModule).catch((error) => {
|
|
66
|
+
console.error(error);
|
|
67
|
+
mountPoint.textContent = error instanceof Error ? error.message : String(error);
|
|
68
|
+
});
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { GridOptions, GridLabels, GridColumnDef, PipelineResult, SortState, PinnedColumnState, GridCellPosition, UiGridApi, DisplayItem, SortDirection, PinDirection, GridRow, GridRecord, GroupItem, BuildGridPipelineContext } from '@ornery/ui-grid-core';
|
|
2
|
+
export { GridOptions, UiGridApi } from '@ornery/ui-grid-core';
|
|
3
|
+
|
|
4
|
+
interface GridSaveState {
|
|
5
|
+
sortState: SortState;
|
|
6
|
+
activeFilters: Record<string, string>;
|
|
7
|
+
groupByColumns: string[];
|
|
8
|
+
pinnedColumns: PinnedColumnState;
|
|
9
|
+
columnOrder: string[];
|
|
10
|
+
currentPage: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
}
|
|
13
|
+
interface GridControllerSnapshot {
|
|
14
|
+
options: GridOptions;
|
|
15
|
+
labels: GridLabels;
|
|
16
|
+
rowSize: number;
|
|
17
|
+
visibleColumns: GridColumnDef[];
|
|
18
|
+
gridTemplateColumns: string;
|
|
19
|
+
pipeline: PipelineResult;
|
|
20
|
+
activeFilters: Record<string, string>;
|
|
21
|
+
sortState: SortState;
|
|
22
|
+
groupByColumns: string[];
|
|
23
|
+
pinnedColumns: PinnedColumnState;
|
|
24
|
+
currentPage: number;
|
|
25
|
+
totalPages: number;
|
|
26
|
+
firstRowIndex: number;
|
|
27
|
+
lastRowIndex: number;
|
|
28
|
+
pageSize: number;
|
|
29
|
+
editingCell: GridCellPosition | null;
|
|
30
|
+
editingValue: string;
|
|
31
|
+
}
|
|
32
|
+
type GridControllerSubscriber = (snapshot: GridControllerSnapshot) => void;
|
|
33
|
+
declare class VanillaGridController {
|
|
34
|
+
private options;
|
|
35
|
+
private activeFilters;
|
|
36
|
+
private sortState;
|
|
37
|
+
private groupByColumns;
|
|
38
|
+
private collapsedGroups;
|
|
39
|
+
private hiddenRowReasons;
|
|
40
|
+
private expandedRows;
|
|
41
|
+
private expandedTreeRows;
|
|
42
|
+
private pinnedColumns;
|
|
43
|
+
private columnOrder;
|
|
44
|
+
private currentPage;
|
|
45
|
+
private pageSize;
|
|
46
|
+
private editingCell;
|
|
47
|
+
private editingValue;
|
|
48
|
+
private pipeline;
|
|
49
|
+
private labels;
|
|
50
|
+
private visibleColumns;
|
|
51
|
+
private apiRegistered;
|
|
52
|
+
private readonly subscribers;
|
|
53
|
+
readonly gridApi: UiGridApi;
|
|
54
|
+
constructor(options: GridOptions);
|
|
55
|
+
setOptions(options: GridOptions): void;
|
|
56
|
+
subscribe(subscriber: GridControllerSubscriber): () => void;
|
|
57
|
+
getSnapshot(): GridControllerSnapshot;
|
|
58
|
+
getDisplayItems(): DisplayItem[];
|
|
59
|
+
setCollapsedGroup(groupId: string, collapsed: boolean): void;
|
|
60
|
+
toggleSort(columnName: string): void;
|
|
61
|
+
sortColumn(columnName: string, direction?: SortDirection): void;
|
|
62
|
+
setFilter(columnName: string, value: string): void;
|
|
63
|
+
clearAllFilters(): void;
|
|
64
|
+
toggleGrouping(columnName: string): void;
|
|
65
|
+
clearGrouping(): void;
|
|
66
|
+
seekPage(page: number): void;
|
|
67
|
+
setPageSize(pageSize: number): void;
|
|
68
|
+
pinColumn(columnName: string, direction: PinDirection): void;
|
|
69
|
+
moveVisibleColumn(columnName: string, targetColumnName: string): void;
|
|
70
|
+
toggleRowExpansion(row: GridRow | GridRecord | string): void;
|
|
71
|
+
expandAllRows(): void;
|
|
72
|
+
collapseAllRows(): void;
|
|
73
|
+
toggleTreeRow(row: GridRow | GridRecord | string): void;
|
|
74
|
+
expandAllTreeRows(): void;
|
|
75
|
+
collapseAllTreeRows(): void;
|
|
76
|
+
setTreeRowExpanded(row: GridRow | GridRecord | string, expanded: boolean): void;
|
|
77
|
+
beginCellEdit(row: GridRow | GridRecord | string, columnName: string, triggerEvent?: Event | KeyboardEvent | null): void;
|
|
78
|
+
updateEditingValue(value: string): void;
|
|
79
|
+
commitCellEdit(): void;
|
|
80
|
+
cancelCellEdit(): void;
|
|
81
|
+
isGroupingEnabled(): boolean;
|
|
82
|
+
isSortingEnabled(): boolean;
|
|
83
|
+
isFilteringEnabled(): boolean;
|
|
84
|
+
isPaginationEnabled(): boolean;
|
|
85
|
+
shouldShowPaginationControls(): boolean;
|
|
86
|
+
isTreeEnabled(): boolean;
|
|
87
|
+
isExpandableEnabled(): boolean;
|
|
88
|
+
isColumnSortable(column: GridColumnDef): boolean;
|
|
89
|
+
isColumnFilterable(column: GridColumnDef): boolean;
|
|
90
|
+
isColumnGrouped(column: GridColumnDef): boolean;
|
|
91
|
+
sortButtonLabel(column: GridColumnDef): string;
|
|
92
|
+
groupingButtonLabel(column: GridColumnDef): string;
|
|
93
|
+
filterPlaceholder(column: GridColumnDef): string;
|
|
94
|
+
getSortDirection(column: GridColumnDef): SortDirection;
|
|
95
|
+
isPinningEnabled(): boolean;
|
|
96
|
+
isColumnPinnable(column: GridColumnDef): boolean;
|
|
97
|
+
isPinned(column: GridColumnDef): boolean;
|
|
98
|
+
isPinnedLeftLast(column: GridColumnDef): boolean;
|
|
99
|
+
isPinnedRightFirst(column: GridColumnDef): boolean;
|
|
100
|
+
groupDisclosureLabel(group: GroupItem): string;
|
|
101
|
+
pinnedOffset(column: GridColumnDef): {
|
|
102
|
+
side: 'left' | 'right';
|
|
103
|
+
offset: string;
|
|
104
|
+
} | null;
|
|
105
|
+
displayValue(row: GridRow, column: GridColumnDef): unknown;
|
|
106
|
+
headerLabel(column: GridColumnDef): string;
|
|
107
|
+
cellIndent(row: GridRow, column: GridColumnDef): string;
|
|
108
|
+
showTreeToggle(row: GridRow, column: GridColumnDef): boolean;
|
|
109
|
+
showExpandToggle(_row: GridRow, column: GridColumnDef): boolean;
|
|
110
|
+
isTreeRowExpanded(row: GridRow): boolean;
|
|
111
|
+
treeToggleLabel(row: GridRow): string;
|
|
112
|
+
expandToggleLabel(row: GridRow): string;
|
|
113
|
+
editorInputType(column: GridColumnDef): string;
|
|
114
|
+
isEditingCell(rowId: string, columnName: string): boolean;
|
|
115
|
+
getState(): GridSaveState;
|
|
116
|
+
setState(state: Partial<GridSaveState>): void;
|
|
117
|
+
private refresh;
|
|
118
|
+
private emit;
|
|
119
|
+
private findRowById;
|
|
120
|
+
private buildRowsFromData;
|
|
121
|
+
private findColumnByName;
|
|
122
|
+
private resolveRowId;
|
|
123
|
+
private getRowSize;
|
|
124
|
+
private getTotalPages;
|
|
125
|
+
private getEffectivePageSize;
|
|
126
|
+
private getCurrentPage;
|
|
127
|
+
private getFirstRowIndex;
|
|
128
|
+
private getLastRowIndex;
|
|
129
|
+
private setRowInvisible;
|
|
130
|
+
private clearRowInvisible;
|
|
131
|
+
private benchmark;
|
|
132
|
+
}
|
|
133
|
+
declare function createVanillaGridController(options: GridOptions): VanillaGridController;
|
|
134
|
+
|
|
135
|
+
type VanillaUiGridElement = HTMLElement & {
|
|
136
|
+
options: GridOptions;
|
|
137
|
+
getState(): GridSaveState | null;
|
|
138
|
+
setState(state: Partial<GridSaveState>): void;
|
|
139
|
+
};
|
|
140
|
+
type UiGridControlIconKey = 'sortNone' | 'sortAsc' | 'sortDesc' | 'group' | 'groupExpanded' | 'groupCollapsed' | 'treeExpanded' | 'treeCollapsed' | 'expandExpanded' | 'expandCollapsed' | 'pin' | 'pinLeft' | 'pinRight' | 'paginationPrev' | 'paginationNext';
|
|
141
|
+
interface UiGridIconDefinition {
|
|
142
|
+
viewBox?: string;
|
|
143
|
+
path: string;
|
|
144
|
+
}
|
|
145
|
+
type UiGridIconOverrides = Partial<Record<UiGridControlIconKey, UiGridIconDefinition>>;
|
|
146
|
+
declare class UiGridStandaloneElement extends HTMLElement {
|
|
147
|
+
private controller;
|
|
148
|
+
private snapshot;
|
|
149
|
+
private unsubscribe;
|
|
150
|
+
private activeOptions;
|
|
151
|
+
private iconOverrides;
|
|
152
|
+
private templateObserver;
|
|
153
|
+
private openPinMenuColumn;
|
|
154
|
+
private focusedCell;
|
|
155
|
+
private draggedColumnName;
|
|
156
|
+
private dropTargetColumnName;
|
|
157
|
+
private scrollPosition;
|
|
158
|
+
private scrollFrame;
|
|
159
|
+
private suppressScrollEvent;
|
|
160
|
+
private lastVirtualStartIndex;
|
|
161
|
+
private measuredHeaderStickyHeight;
|
|
162
|
+
private measuredFilterStickyHeight;
|
|
163
|
+
private stickyHeightRelayoutQueued;
|
|
164
|
+
private benchmarkAverage;
|
|
165
|
+
get options(): GridOptions;
|
|
166
|
+
set options(value: GridOptions);
|
|
167
|
+
get controlIcons(): UiGridIconOverrides;
|
|
168
|
+
set controlIcons(value: UiGridIconOverrides);
|
|
169
|
+
getState(): GridSaveState | null;
|
|
170
|
+
setState(state: Partial<GridSaveState>): void;
|
|
171
|
+
connectedCallback(): void;
|
|
172
|
+
disconnectedCallback(): void;
|
|
173
|
+
private ensureShadowRoot;
|
|
174
|
+
private ensureController;
|
|
175
|
+
private observeTemplateSlots;
|
|
176
|
+
private buildEffectiveOptions;
|
|
177
|
+
private bindEvents;
|
|
178
|
+
private render;
|
|
179
|
+
private renderHeaderCell;
|
|
180
|
+
private renderFilterCell;
|
|
181
|
+
private renderDisplayItem;
|
|
182
|
+
private renderBodyCell;
|
|
183
|
+
private renderPagination;
|
|
184
|
+
private renderSlotRegistry;
|
|
185
|
+
private renderCellTemplate;
|
|
186
|
+
private renderExpandableTemplate;
|
|
187
|
+
private getTemplateMarkup;
|
|
188
|
+
private interpolateTemplate;
|
|
189
|
+
private resolveTemplateValue;
|
|
190
|
+
private rowIndexFor;
|
|
191
|
+
private cellSlotName;
|
|
192
|
+
private downloadCsv;
|
|
193
|
+
private renderControlIcon;
|
|
194
|
+
private renderIconWithClass;
|
|
195
|
+
}
|
|
196
|
+
declare function defineStandaloneUiGridElement(tagName?: string): Promise<void>;
|
|
197
|
+
|
|
198
|
+
interface UiGridRustWebModule {
|
|
199
|
+
default(input?: unknown): Promise<unknown>;
|
|
200
|
+
build_pipeline_js(context: BuildGridPipelineContext): PipelineResult;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare function registerVanillaUiGridRustModule(module: UiGridRustWebModule, input?: unknown): Promise<void>;
|
|
204
|
+
declare function mountVanillaUiGrid(target: Element, options: GridOptions, rustModule?: UiGridRustWebModule, tagName?: string): Promise<VanillaUiGridElement>;
|
|
205
|
+
|
|
206
|
+
export { type GridControllerSnapshot, type GridSaveState, type UiGridControlIconKey, type UiGridIconDefinition, type UiGridIconOverrides, type UiGridRustWebModule, UiGridStandaloneElement, VanillaGridController, type VanillaUiGridElement, createVanillaGridController, defineStandaloneUiGridElement, defineStandaloneUiGridElement as defineUiGridElement, mountVanillaUiGrid, registerVanillaUiGridRustModule };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { GridOptions, GridLabels, GridColumnDef, PipelineResult, SortState, PinnedColumnState, GridCellPosition, UiGridApi, DisplayItem, SortDirection, PinDirection, GridRow, GridRecord, GroupItem, BuildGridPipelineContext } from '@ornery/ui-grid-core';
|
|
2
|
+
export { GridOptions, UiGridApi } from '@ornery/ui-grid-core';
|
|
3
|
+
|
|
4
|
+
interface GridSaveState {
|
|
5
|
+
sortState: SortState;
|
|
6
|
+
activeFilters: Record<string, string>;
|
|
7
|
+
groupByColumns: string[];
|
|
8
|
+
pinnedColumns: PinnedColumnState;
|
|
9
|
+
columnOrder: string[];
|
|
10
|
+
currentPage: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
}
|
|
13
|
+
interface GridControllerSnapshot {
|
|
14
|
+
options: GridOptions;
|
|
15
|
+
labels: GridLabels;
|
|
16
|
+
rowSize: number;
|
|
17
|
+
visibleColumns: GridColumnDef[];
|
|
18
|
+
gridTemplateColumns: string;
|
|
19
|
+
pipeline: PipelineResult;
|
|
20
|
+
activeFilters: Record<string, string>;
|
|
21
|
+
sortState: SortState;
|
|
22
|
+
groupByColumns: string[];
|
|
23
|
+
pinnedColumns: PinnedColumnState;
|
|
24
|
+
currentPage: number;
|
|
25
|
+
totalPages: number;
|
|
26
|
+
firstRowIndex: number;
|
|
27
|
+
lastRowIndex: number;
|
|
28
|
+
pageSize: number;
|
|
29
|
+
editingCell: GridCellPosition | null;
|
|
30
|
+
editingValue: string;
|
|
31
|
+
}
|
|
32
|
+
type GridControllerSubscriber = (snapshot: GridControllerSnapshot) => void;
|
|
33
|
+
declare class VanillaGridController {
|
|
34
|
+
private options;
|
|
35
|
+
private activeFilters;
|
|
36
|
+
private sortState;
|
|
37
|
+
private groupByColumns;
|
|
38
|
+
private collapsedGroups;
|
|
39
|
+
private hiddenRowReasons;
|
|
40
|
+
private expandedRows;
|
|
41
|
+
private expandedTreeRows;
|
|
42
|
+
private pinnedColumns;
|
|
43
|
+
private columnOrder;
|
|
44
|
+
private currentPage;
|
|
45
|
+
private pageSize;
|
|
46
|
+
private editingCell;
|
|
47
|
+
private editingValue;
|
|
48
|
+
private pipeline;
|
|
49
|
+
private labels;
|
|
50
|
+
private visibleColumns;
|
|
51
|
+
private apiRegistered;
|
|
52
|
+
private readonly subscribers;
|
|
53
|
+
readonly gridApi: UiGridApi;
|
|
54
|
+
constructor(options: GridOptions);
|
|
55
|
+
setOptions(options: GridOptions): void;
|
|
56
|
+
subscribe(subscriber: GridControllerSubscriber): () => void;
|
|
57
|
+
getSnapshot(): GridControllerSnapshot;
|
|
58
|
+
getDisplayItems(): DisplayItem[];
|
|
59
|
+
setCollapsedGroup(groupId: string, collapsed: boolean): void;
|
|
60
|
+
toggleSort(columnName: string): void;
|
|
61
|
+
sortColumn(columnName: string, direction?: SortDirection): void;
|
|
62
|
+
setFilter(columnName: string, value: string): void;
|
|
63
|
+
clearAllFilters(): void;
|
|
64
|
+
toggleGrouping(columnName: string): void;
|
|
65
|
+
clearGrouping(): void;
|
|
66
|
+
seekPage(page: number): void;
|
|
67
|
+
setPageSize(pageSize: number): void;
|
|
68
|
+
pinColumn(columnName: string, direction: PinDirection): void;
|
|
69
|
+
moveVisibleColumn(columnName: string, targetColumnName: string): void;
|
|
70
|
+
toggleRowExpansion(row: GridRow | GridRecord | string): void;
|
|
71
|
+
expandAllRows(): void;
|
|
72
|
+
collapseAllRows(): void;
|
|
73
|
+
toggleTreeRow(row: GridRow | GridRecord | string): void;
|
|
74
|
+
expandAllTreeRows(): void;
|
|
75
|
+
collapseAllTreeRows(): void;
|
|
76
|
+
setTreeRowExpanded(row: GridRow | GridRecord | string, expanded: boolean): void;
|
|
77
|
+
beginCellEdit(row: GridRow | GridRecord | string, columnName: string, triggerEvent?: Event | KeyboardEvent | null): void;
|
|
78
|
+
updateEditingValue(value: string): void;
|
|
79
|
+
commitCellEdit(): void;
|
|
80
|
+
cancelCellEdit(): void;
|
|
81
|
+
isGroupingEnabled(): boolean;
|
|
82
|
+
isSortingEnabled(): boolean;
|
|
83
|
+
isFilteringEnabled(): boolean;
|
|
84
|
+
isPaginationEnabled(): boolean;
|
|
85
|
+
shouldShowPaginationControls(): boolean;
|
|
86
|
+
isTreeEnabled(): boolean;
|
|
87
|
+
isExpandableEnabled(): boolean;
|
|
88
|
+
isColumnSortable(column: GridColumnDef): boolean;
|
|
89
|
+
isColumnFilterable(column: GridColumnDef): boolean;
|
|
90
|
+
isColumnGrouped(column: GridColumnDef): boolean;
|
|
91
|
+
sortButtonLabel(column: GridColumnDef): string;
|
|
92
|
+
groupingButtonLabel(column: GridColumnDef): string;
|
|
93
|
+
filterPlaceholder(column: GridColumnDef): string;
|
|
94
|
+
getSortDirection(column: GridColumnDef): SortDirection;
|
|
95
|
+
isPinningEnabled(): boolean;
|
|
96
|
+
isColumnPinnable(column: GridColumnDef): boolean;
|
|
97
|
+
isPinned(column: GridColumnDef): boolean;
|
|
98
|
+
isPinnedLeftLast(column: GridColumnDef): boolean;
|
|
99
|
+
isPinnedRightFirst(column: GridColumnDef): boolean;
|
|
100
|
+
groupDisclosureLabel(group: GroupItem): string;
|
|
101
|
+
pinnedOffset(column: GridColumnDef): {
|
|
102
|
+
side: 'left' | 'right';
|
|
103
|
+
offset: string;
|
|
104
|
+
} | null;
|
|
105
|
+
displayValue(row: GridRow, column: GridColumnDef): unknown;
|
|
106
|
+
headerLabel(column: GridColumnDef): string;
|
|
107
|
+
cellIndent(row: GridRow, column: GridColumnDef): string;
|
|
108
|
+
showTreeToggle(row: GridRow, column: GridColumnDef): boolean;
|
|
109
|
+
showExpandToggle(_row: GridRow, column: GridColumnDef): boolean;
|
|
110
|
+
isTreeRowExpanded(row: GridRow): boolean;
|
|
111
|
+
treeToggleLabel(row: GridRow): string;
|
|
112
|
+
expandToggleLabel(row: GridRow): string;
|
|
113
|
+
editorInputType(column: GridColumnDef): string;
|
|
114
|
+
isEditingCell(rowId: string, columnName: string): boolean;
|
|
115
|
+
getState(): GridSaveState;
|
|
116
|
+
setState(state: Partial<GridSaveState>): void;
|
|
117
|
+
private refresh;
|
|
118
|
+
private emit;
|
|
119
|
+
private findRowById;
|
|
120
|
+
private buildRowsFromData;
|
|
121
|
+
private findColumnByName;
|
|
122
|
+
private resolveRowId;
|
|
123
|
+
private getRowSize;
|
|
124
|
+
private getTotalPages;
|
|
125
|
+
private getEffectivePageSize;
|
|
126
|
+
private getCurrentPage;
|
|
127
|
+
private getFirstRowIndex;
|
|
128
|
+
private getLastRowIndex;
|
|
129
|
+
private setRowInvisible;
|
|
130
|
+
private clearRowInvisible;
|
|
131
|
+
private benchmark;
|
|
132
|
+
}
|
|
133
|
+
declare function createVanillaGridController(options: GridOptions): VanillaGridController;
|
|
134
|
+
|
|
135
|
+
type VanillaUiGridElement = HTMLElement & {
|
|
136
|
+
options: GridOptions;
|
|
137
|
+
getState(): GridSaveState | null;
|
|
138
|
+
setState(state: Partial<GridSaveState>): void;
|
|
139
|
+
};
|
|
140
|
+
type UiGridControlIconKey = 'sortNone' | 'sortAsc' | 'sortDesc' | 'group' | 'groupExpanded' | 'groupCollapsed' | 'treeExpanded' | 'treeCollapsed' | 'expandExpanded' | 'expandCollapsed' | 'pin' | 'pinLeft' | 'pinRight' | 'paginationPrev' | 'paginationNext';
|
|
141
|
+
interface UiGridIconDefinition {
|
|
142
|
+
viewBox?: string;
|
|
143
|
+
path: string;
|
|
144
|
+
}
|
|
145
|
+
type UiGridIconOverrides = Partial<Record<UiGridControlIconKey, UiGridIconDefinition>>;
|
|
146
|
+
declare class UiGridStandaloneElement extends HTMLElement {
|
|
147
|
+
private controller;
|
|
148
|
+
private snapshot;
|
|
149
|
+
private unsubscribe;
|
|
150
|
+
private activeOptions;
|
|
151
|
+
private iconOverrides;
|
|
152
|
+
private templateObserver;
|
|
153
|
+
private openPinMenuColumn;
|
|
154
|
+
private focusedCell;
|
|
155
|
+
private draggedColumnName;
|
|
156
|
+
private dropTargetColumnName;
|
|
157
|
+
private scrollPosition;
|
|
158
|
+
private scrollFrame;
|
|
159
|
+
private suppressScrollEvent;
|
|
160
|
+
private lastVirtualStartIndex;
|
|
161
|
+
private measuredHeaderStickyHeight;
|
|
162
|
+
private measuredFilterStickyHeight;
|
|
163
|
+
private stickyHeightRelayoutQueued;
|
|
164
|
+
private benchmarkAverage;
|
|
165
|
+
get options(): GridOptions;
|
|
166
|
+
set options(value: GridOptions);
|
|
167
|
+
get controlIcons(): UiGridIconOverrides;
|
|
168
|
+
set controlIcons(value: UiGridIconOverrides);
|
|
169
|
+
getState(): GridSaveState | null;
|
|
170
|
+
setState(state: Partial<GridSaveState>): void;
|
|
171
|
+
connectedCallback(): void;
|
|
172
|
+
disconnectedCallback(): void;
|
|
173
|
+
private ensureShadowRoot;
|
|
174
|
+
private ensureController;
|
|
175
|
+
private observeTemplateSlots;
|
|
176
|
+
private buildEffectiveOptions;
|
|
177
|
+
private bindEvents;
|
|
178
|
+
private render;
|
|
179
|
+
private renderHeaderCell;
|
|
180
|
+
private renderFilterCell;
|
|
181
|
+
private renderDisplayItem;
|
|
182
|
+
private renderBodyCell;
|
|
183
|
+
private renderPagination;
|
|
184
|
+
private renderSlotRegistry;
|
|
185
|
+
private renderCellTemplate;
|
|
186
|
+
private renderExpandableTemplate;
|
|
187
|
+
private getTemplateMarkup;
|
|
188
|
+
private interpolateTemplate;
|
|
189
|
+
private resolveTemplateValue;
|
|
190
|
+
private rowIndexFor;
|
|
191
|
+
private cellSlotName;
|
|
192
|
+
private downloadCsv;
|
|
193
|
+
private renderControlIcon;
|
|
194
|
+
private renderIconWithClass;
|
|
195
|
+
}
|
|
196
|
+
declare function defineStandaloneUiGridElement(tagName?: string): Promise<void>;
|
|
197
|
+
|
|
198
|
+
interface UiGridRustWebModule {
|
|
199
|
+
default(input?: unknown): Promise<unknown>;
|
|
200
|
+
build_pipeline_js(context: BuildGridPipelineContext): PipelineResult;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare function registerVanillaUiGridRustModule(module: UiGridRustWebModule, input?: unknown): Promise<void>;
|
|
204
|
+
declare function mountVanillaUiGrid(target: Element, options: GridOptions, rustModule?: UiGridRustWebModule, tagName?: string): Promise<VanillaUiGridElement>;
|
|
205
|
+
|
|
206
|
+
export { type GridControllerSnapshot, type GridSaveState, type UiGridControlIconKey, type UiGridIconDefinition, type UiGridIconOverrides, type UiGridRustWebModule, UiGridStandaloneElement, VanillaGridController, type VanillaUiGridElement, createVanillaGridController, defineStandaloneUiGridElement, defineStandaloneUiGridElement as defineUiGridElement, mountVanillaUiGrid, registerVanillaUiGridRustModule };
|