@ornery/ui-grid-vanilla 1.0.6 → 1.0.8
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 +75 -11
- package/dist/adopt-styles.d.ts +2 -0
- package/dist/adopt-styles.d.ts.map +1 -0
- package/dist/attribute-bridge.d.ts +39 -0
- package/dist/attribute-bridge.d.ts.map +1 -0
- package/dist/browser/ui-grid-element.js +9586 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/components/grid-body-cell/grid-body-cell.d.ts +19 -0
- package/dist/components/grid-body-cell/grid-body-cell.d.ts.map +1 -0
- package/dist/components/grid-body-cell/index.d.ts +2 -0
- package/dist/components/grid-body-cell/index.d.ts.map +1 -0
- package/dist/components/grid-cell-editor/grid-cell-editor.d.ts +28 -0
- package/dist/components/grid-cell-editor/grid-cell-editor.d.ts.map +1 -0
- package/dist/components/grid-cell-editor/index.d.ts +2 -0
- package/dist/components/grid-cell-editor/index.d.ts.map +1 -0
- package/dist/components/grid-filter-cell/grid-filter-cell.d.ts +32 -0
- package/dist/components/grid-filter-cell/grid-filter-cell.d.ts.map +1 -0
- package/dist/components/grid-filter-cell/grid-filter-cell.template.d.ts +8 -0
- package/dist/components/grid-filter-cell/grid-filter-cell.template.d.ts.map +1 -0
- package/dist/components/grid-filter-cell/index.d.ts +2 -0
- package/dist/components/grid-filter-cell/index.d.ts.map +1 -0
- package/dist/components/grid-group-row/grid-group-row.d.ts +55 -0
- package/dist/components/grid-group-row/grid-group-row.d.ts.map +1 -0
- package/dist/components/grid-group-row/grid-group-row.template.d.ts +12 -0
- package/dist/components/grid-group-row/grid-group-row.template.d.ts.map +1 -0
- package/dist/components/grid-group-row/index.d.ts +2 -0
- package/dist/components/grid-group-row/index.d.ts.map +1 -0
- package/dist/components/grid-header-cell/grid-header-cell.d.ts +13 -0
- package/dist/components/grid-header-cell/grid-header-cell.d.ts.map +1 -0
- package/dist/components/grid-header-cell/index.d.ts +2 -0
- package/dist/components/grid-header-cell/index.d.ts.map +1 -0
- package/dist/components/grid-pagination/grid-pagination.d.ts +45 -0
- package/dist/components/grid-pagination/grid-pagination.d.ts.map +1 -0
- package/dist/components/grid-pagination/grid-pagination.template.d.ts +17 -0
- package/dist/components/grid-pagination/grid-pagination.template.d.ts.map +1 -0
- package/dist/components/grid-pagination/index.d.ts +2 -0
- package/dist/components/grid-pagination/index.d.ts.map +1 -0
- package/dist/components/grid-template/grid-template.d.ts +31 -0
- package/dist/components/grid-template/grid-template.d.ts.map +1 -0
- package/dist/components/grid-template/index.d.ts +2 -0
- package/dist/components/grid-template/index.d.ts.map +1 -0
- package/dist/events.d.ts +43 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/focus.d.ts +100 -0
- package/dist/focus.d.ts.map +1 -0
- package/dist/framework-slots.d.ts +170 -0
- package/dist/framework-slots.d.ts.map +1 -0
- package/dist/grid-controller.d.ts +363 -0
- package/dist/grid-controller.d.ts.map +1 -0
- package/dist/icons.d.ts +34 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/index.d.ts +11 -899
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.mjs +20 -0
- package/dist/patch.d.ts +88 -0
- package/dist/patch.d.ts.map +1 -0
- package/dist/render.d.ts +62 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/templates/index.d.ts +24 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/ui-grid-empty.template.d.ts +8 -0
- package/dist/ui-grid-empty.template.d.ts.map +1 -0
- package/dist/ui-grid-shell.template.d.ts +17 -0
- package/dist/ui-grid-shell.template.d.ts.map +1 -0
- package/dist/ui-grid-standalone.element.d.ts +309 -0
- package/dist/ui-grid-standalone.element.d.ts.map +1 -0
- package/dist/utils/cell-class.d.ts +9 -0
- package/dist/utils/cell-class.d.ts.map +1 -0
- package/dist/utils/display-items.d.ts +11 -0
- package/dist/utils/display-items.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +22 -0
- package/dist/utils/dom.d.ts.map +1 -0
- package/package.json +18 -11
- package/src/browser.test.ts +9 -0
- package/src/browser.ts +8 -0
- package/src/grid-controller.ts +24 -0
- package/src/index.integration.test.ts +32 -6
- package/tsconfig.dts.json +15 -0
- package/tsconfig.json +0 -1
- package/tsup.config.ts +22 -7
- package/dist/index.d.mts +0 -901
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,2BAA2B,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5C;AAED,OAAO,EAAE,6BAA6B,IAAI,mBAAmB,EAAE,CAAC;AAEhE,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,mBAAmB,EAC3B,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,WAAW,EACpB,UAAU,CAAC,EAAE,mBAAmB,EAChC,OAAO,SAAoB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CAe/B"}
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ var FrameworkSlotBridge = class {
|
|
|
54
54
|
constructor(host) {
|
|
55
55
|
this.host = host;
|
|
56
56
|
}
|
|
57
|
+
host;
|
|
57
58
|
flaggedCells = /* @__PURE__ */ new Set();
|
|
58
59
|
flaggedHeaders = /* @__PURE__ */ new Set();
|
|
59
60
|
flaggedFilters = /* @__PURE__ */ new Set();
|
|
@@ -2371,6 +2372,8 @@ var VanillaGridController = class {
|
|
|
2371
2372
|
labels;
|
|
2372
2373
|
visibleColumns = [];
|
|
2373
2374
|
apiRegistered = false;
|
|
2375
|
+
disposed = false;
|
|
2376
|
+
wasmEngineInitRequested = false;
|
|
2374
2377
|
subscribers = /* @__PURE__ */ new Set();
|
|
2375
2378
|
gridApi;
|
|
2376
2379
|
constructor(options) {
|
|
@@ -2579,6 +2582,7 @@ var VanillaGridController = class {
|
|
|
2579
2582
|
* subscriptions). */
|
|
2580
2583
|
disposeLanguageListener = null;
|
|
2581
2584
|
dispose() {
|
|
2585
|
+
this.disposed = true;
|
|
2582
2586
|
this.disposeLanguageListener?.();
|
|
2583
2587
|
this.disposeLanguageListener = null;
|
|
2584
2588
|
this.subscribers.clear();
|
|
@@ -3579,6 +3583,7 @@ var VanillaGridController = class {
|
|
|
3579
3583
|
this.saveStateScrollRestore = restore;
|
|
3580
3584
|
}
|
|
3581
3585
|
refresh() {
|
|
3586
|
+
this.maybeEnableWasmEngine();
|
|
3582
3587
|
const orderedColumns = orderVisibleColumns(this.options.columnDefs, this.columnOrder);
|
|
3583
3588
|
const applyWidthOverrides = (columns) => columns.map((col) => {
|
|
3584
3589
|
const override = this.columnWidthOverrides[col.name];
|
|
@@ -3642,6 +3647,19 @@ var VanillaGridController = class {
|
|
|
3642
3647
|
}
|
|
3643
3648
|
this.emit();
|
|
3644
3649
|
}
|
|
3650
|
+
maybeEnableWasmEngine() {
|
|
3651
|
+
if (this.wasmEngineInitRequested || (0, import_ui_grid_core5.activeGridEngineBackend)() === "rust-wasm") {
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3654
|
+
this.wasmEngineInitRequested = true;
|
|
3655
|
+
void (0, import_ui_grid_core5.enableUiGridWasmEngine)().then(() => {
|
|
3656
|
+
if (!this.disposed) {
|
|
3657
|
+
this.refresh();
|
|
3658
|
+
}
|
|
3659
|
+
}).catch(() => {
|
|
3660
|
+
this.wasmEngineInitRequested = false;
|
|
3661
|
+
});
|
|
3662
|
+
}
|
|
3645
3663
|
emit() {
|
|
3646
3664
|
const snapshot = this.getSnapshot();
|
|
3647
3665
|
for (const subscriber of this.subscribers) {
|
package/dist/index.mjs
CHANGED
|
@@ -27,6 +27,7 @@ var FrameworkSlotBridge = class {
|
|
|
27
27
|
constructor(host) {
|
|
28
28
|
this.host = host;
|
|
29
29
|
}
|
|
30
|
+
host;
|
|
30
31
|
flaggedCells = /* @__PURE__ */ new Set();
|
|
31
32
|
flaggedHeaders = /* @__PURE__ */ new Set();
|
|
32
33
|
flaggedFilters = /* @__PURE__ */ new Set();
|
|
@@ -2235,6 +2236,7 @@ var IconRegistry = class {
|
|
|
2235
2236
|
// src/grid-controller.ts
|
|
2236
2237
|
import {
|
|
2237
2238
|
SORT_DIRECTIONS as SORT_DIRECTIONS2,
|
|
2239
|
+
activeGridEngineBackend,
|
|
2238
2240
|
beginGridCellEditCommand,
|
|
2239
2241
|
buildGridRows,
|
|
2240
2242
|
buildGridCellContext,
|
|
@@ -2250,6 +2252,7 @@ import {
|
|
|
2250
2252
|
defaultGridEngine,
|
|
2251
2253
|
expandAllGridRowsCommand,
|
|
2252
2254
|
expandAllGridTreeRowsCommand,
|
|
2255
|
+
enableUiGridWasmEngine,
|
|
2253
2256
|
findGridRowById as coreFindGridRowById,
|
|
2254
2257
|
formatGridCellDisplayValue,
|
|
2255
2258
|
getCellValue as getCellValue3,
|
|
@@ -2458,6 +2461,8 @@ var VanillaGridController = class {
|
|
|
2458
2461
|
labels;
|
|
2459
2462
|
visibleColumns = [];
|
|
2460
2463
|
apiRegistered = false;
|
|
2464
|
+
disposed = false;
|
|
2465
|
+
wasmEngineInitRequested = false;
|
|
2461
2466
|
subscribers = /* @__PURE__ */ new Set();
|
|
2462
2467
|
gridApi;
|
|
2463
2468
|
constructor(options) {
|
|
@@ -2666,6 +2671,7 @@ var VanillaGridController = class {
|
|
|
2666
2671
|
* subscriptions). */
|
|
2667
2672
|
disposeLanguageListener = null;
|
|
2668
2673
|
dispose() {
|
|
2674
|
+
this.disposed = true;
|
|
2669
2675
|
this.disposeLanguageListener?.();
|
|
2670
2676
|
this.disposeLanguageListener = null;
|
|
2671
2677
|
this.subscribers.clear();
|
|
@@ -3666,6 +3672,7 @@ var VanillaGridController = class {
|
|
|
3666
3672
|
this.saveStateScrollRestore = restore;
|
|
3667
3673
|
}
|
|
3668
3674
|
refresh() {
|
|
3675
|
+
this.maybeEnableWasmEngine();
|
|
3669
3676
|
const orderedColumns = orderVisibleColumns(this.options.columnDefs, this.columnOrder);
|
|
3670
3677
|
const applyWidthOverrides = (columns) => columns.map((col) => {
|
|
3671
3678
|
const override = this.columnWidthOverrides[col.name];
|
|
@@ -3729,6 +3736,19 @@ var VanillaGridController = class {
|
|
|
3729
3736
|
}
|
|
3730
3737
|
this.emit();
|
|
3731
3738
|
}
|
|
3739
|
+
maybeEnableWasmEngine() {
|
|
3740
|
+
if (this.wasmEngineInitRequested || activeGridEngineBackend() === "rust-wasm") {
|
|
3741
|
+
return;
|
|
3742
|
+
}
|
|
3743
|
+
this.wasmEngineInitRequested = true;
|
|
3744
|
+
void enableUiGridWasmEngine().then(() => {
|
|
3745
|
+
if (!this.disposed) {
|
|
3746
|
+
this.refresh();
|
|
3747
|
+
}
|
|
3748
|
+
}).catch(() => {
|
|
3749
|
+
this.wasmEngineInitRequested = false;
|
|
3750
|
+
});
|
|
3751
|
+
}
|
|
3732
3752
|
emit() {
|
|
3733
3753
|
const snapshot = this.getSnapshot();
|
|
3734
3754
|
for (const subscriber of this.subscribers) {
|
package/dist/patch.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Patch path: apply the next snapshot onto the existing shadow-DOM tree
|
|
3
|
+
* without rebuilding it. The initial mount produces the full structure
|
|
4
|
+
* via `renderFull`; subsequent renders pass through `renderPatch` here,
|
|
5
|
+
* which walks the existing nodes and only mutates what changed. This is
|
|
6
|
+
* what keeps focus inside mounted `<ui-grid-cell-editor>` components and
|
|
7
|
+
* what makes per-keystroke snapshot rebroadcasts cheap.
|
|
8
|
+
*
|
|
9
|
+
* Every function takes the element as its first argument and reads its
|
|
10
|
+
* internal state directly. See the @internal field markers on the class
|
|
11
|
+
* for the coupling contract.
|
|
12
|
+
*/
|
|
13
|
+
import type { DisplayItem, GridColumnDef, GridOptions, GridRow, GroupItem } from '@ornery/ui-grid-core';
|
|
14
|
+
import type { GridControllerSnapshot } from './grid-controller';
|
|
15
|
+
import type { UiGridStandaloneElement } from './ui-grid-standalone.element';
|
|
16
|
+
/**
|
|
17
|
+
* Fast-path data refresh: walk every rendered body cell and re-interpolate
|
|
18
|
+
* its content. Used when the data changed but the row / column identity
|
|
19
|
+
* didn't, so we can avoid a full render + scroll-position restore.
|
|
20
|
+
*/
|
|
21
|
+
export declare function patchCells(el: UiGridStandaloneElement, changedRowIds?: ReadonlySet<string>): void;
|
|
22
|
+
/**
|
|
23
|
+
* Structural patch: apply a full `RenderPlan` to the existing shadow-DOM
|
|
24
|
+
* tree. Replaces `renderFull`'s innerHTML-dump path whenever the structure
|
|
25
|
+
* key hasn't changed between snapshots.
|
|
26
|
+
*/
|
|
27
|
+
export declare function renderPatch(el: UiGridStandaloneElement, plan: {
|
|
28
|
+
snapshot: GridControllerSnapshot;
|
|
29
|
+
options: GridOptions;
|
|
30
|
+
labels: GridControllerSnapshot['labels'];
|
|
31
|
+
templateColumns: string;
|
|
32
|
+
sortEnabled: boolean;
|
|
33
|
+
filterEnabled: boolean;
|
|
34
|
+
groupingEnabled: boolean;
|
|
35
|
+
pinningEnabled: boolean;
|
|
36
|
+
paginationEnabled: boolean;
|
|
37
|
+
showPagination: boolean;
|
|
38
|
+
virtualizationEnabled: boolean;
|
|
39
|
+
itemsToRender: readonly DisplayItem[];
|
|
40
|
+
startIndex: number;
|
|
41
|
+
virtualOffset: number;
|
|
42
|
+
totalVirtualHeight: number;
|
|
43
|
+
}, root: ShadowRoot): void;
|
|
44
|
+
/**
|
|
45
|
+
* Ensures the grid-body-viewport contains the right body node for the
|
|
46
|
+
* desired kind (empty-state / virtual / static), reusing the existing
|
|
47
|
+
* node where possible. Returns the body container the caller should
|
|
48
|
+
* patch into, or null for the empty state.
|
|
49
|
+
*/
|
|
50
|
+
export declare function reconcileBodyRoot(el: UiGridStandaloneElement, root: ShadowRoot, kind: 'empty' | 'virtual' | 'static', options: GridOptions, labels: GridControllerSnapshot['labels'], templateColumns: string, virtualOffset: number, totalVirtualHeight: number): HTMLElement | null;
|
|
51
|
+
/**
|
|
52
|
+
* Pagination reconciliation: mount, patch, or remove the `<ui-grid-pagination>`
|
|
53
|
+
* based on whether the snapshot should show it. Lives inside `.grid-table`
|
|
54
|
+
* (after `.grid-body-viewport`) matching the Angular layout.
|
|
55
|
+
*/
|
|
56
|
+
export declare function reconcilePagination(el: UiGridStandaloneElement, root: ShadowRoot, snapshot: GridControllerSnapshot, shouldShow: boolean): void;
|
|
57
|
+
/**
|
|
58
|
+
* Patch the filter-cell data-attrs on the existing `<ui-grid-filter-cell>`
|
|
59
|
+
* instances — this preserves native input focus + caret across snapshot
|
|
60
|
+
* rebuilds. `renderPatch` takes this path instead of swapping innerHTML.
|
|
61
|
+
*/
|
|
62
|
+
export declare function patchFilterCells(el: UiGridStandaloneElement, filterGrid: HTMLElement, snapshot: GridControllerSnapshot): void;
|
|
63
|
+
/**
|
|
64
|
+
* Reconcile the body region: pick the right container kind (empty /
|
|
65
|
+
* virtual / static), apply its styles, and either in-place-patch or
|
|
66
|
+
* innerHTML-swap the rows depending on whether the fingerprint changed.
|
|
67
|
+
*/
|
|
68
|
+
export declare function patchBodyRegion(el: UiGridStandaloneElement, root: ShadowRoot, snapshot: GridControllerSnapshot, options: GridOptions, labels: GridControllerSnapshot['labels'], templateColumns: string, virtualizationEnabled: boolean, itemsToRender: readonly DisplayItem[], startIndex: number, virtualOffset: number, totalVirtualHeight: number): void;
|
|
69
|
+
/**
|
|
70
|
+
* Lean per-item fingerprint: `kind:id` joined by `|`. If any row/group is
|
|
71
|
+
* added/removed/reordered between renders, the fingerprint shifts and the
|
|
72
|
+
* body-region patch falls back to the innerHTML path.
|
|
73
|
+
*/
|
|
74
|
+
export declare function fingerprintItems(items: readonly DisplayItem[]): string;
|
|
75
|
+
/**
|
|
76
|
+
* Walk the rendered body container, match existing DOM nodes to display
|
|
77
|
+
* items by identity, and patch each in place. Called only on the fast
|
|
78
|
+
* path where the fingerprint matches.
|
|
79
|
+
*/
|
|
80
|
+
export declare function patchExistingRows(el: UiGridStandaloneElement, bodyContainer: HTMLElement, snapshot: GridControllerSnapshot, itemsToRender: readonly DisplayItem[], startIndex: number): void;
|
|
81
|
+
/** Patch a group-row element's data-attrs. */
|
|
82
|
+
export declare function patchGroupRow(el: UiGridStandaloneElement, target: HTMLElement, group: GroupItem): void;
|
|
83
|
+
/** Patch a body-cell element in place: class, sticky style, data-attrs,
|
|
84
|
+
* and the cell-shell's interpolated content. */
|
|
85
|
+
export declare function patchBodyCell(el: UiGridStandaloneElement, cell: HTMLElement, row: GridRow, column: GridColumnDef, displayIndex: number, templateMarkupMap: Map<string, string | null>): void;
|
|
86
|
+
/** Patch the pagination component's data-attrs without re-mounting it. */
|
|
87
|
+
export declare function patchPagination(el: UiGridStandaloneElement, paginationEl: HTMLElement, snapshot: GridControllerSnapshot): void;
|
|
88
|
+
//# sourceMappingURL=patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../src/patch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,OAAO,EACP,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAehE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAY5E;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,uBAAuB,EAC3B,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAClC,IAAI,CAsDN;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,uBAAuB,EAC3B,IAAI,EAAE;IACJ,QAAQ,EAAE,sBAAsB,CAAC;IACjC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,EACD,IAAI,EAAE,UAAU,GACf,IAAI,CAwFN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,C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,8CAA8C;AAC9C,wBAAgB,aAAa,CAC3B,EAAE,EAAE,uBAAuB,EAC3B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,SAAS,GACf,IAAI,CAcN;AAED;gDACgD;AAChD,wBAAgB,aAAa,CAC3B,EAAE,EAAE,uBAAuB,EAC3B,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,GAC5C,IAAI,CAwFN;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAC7B,EAAE,EAAE,uBAAuB,EAC3B,YAAY,EAAE,WAAW,EACzB,QAAQ,EAAE,sBAAsB,GAC/B,IAAI,CAwBN"}
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure markup builders used by the grid element's initial-render and patch
|
|
3
|
+
* paths. Every function here returns an HTML string — none of them touch
|
|
4
|
+
* the DOM or the element's scroll state. The element's top-level `render()`
|
|
5
|
+
* / `renderFull()` / `renderPatch()` orchestrators wire these into the
|
|
6
|
+
* actual mount pipeline.
|
|
7
|
+
*
|
|
8
|
+
* The element is passed in as the first argument; these functions read its
|
|
9
|
+
* internal state (controller / snapshot / focusedCell / …) directly.
|
|
10
|
+
* TypeScript's @internal JSDoc markers on those fields document the
|
|
11
|
+
* coupling — nothing outside this package should depend on the fields.
|
|
12
|
+
*/
|
|
13
|
+
import { type DisplayItem, type GridColumnDef, type GridOptions, type GridRow } from '@ornery/ui-grid-core';
|
|
14
|
+
import type { GridControllerSnapshot } from './grid-controller';
|
|
15
|
+
import type { UiGridStandaloneElement } from './ui-grid-standalone.element';
|
|
16
|
+
/**
|
|
17
|
+
* Render a single column's header cell. Emits the selection-row-header
|
|
18
|
+
* variant, the framework-rendered `<slot>` variant, or the full
|
|
19
|
+
* header-cell markup with sort / group / pin / resize chrome.
|
|
20
|
+
*/
|
|
21
|
+
export declare function renderHeaderCell(el: UiGridStandaloneElement, column: GridColumnDef, sortEnabled: boolean, groupingEnabled: boolean, pinningEnabled: boolean, options: GridOptions): string;
|
|
22
|
+
/** Render the filter-row cell for one column. Selection column gets a bare
|
|
23
|
+
* spacer div; framework-rendered columns get a `<slot>`; everything else
|
|
24
|
+
* renders a `<ui-grid-filter-cell>` component with data-attributes. */
|
|
25
|
+
export declare function renderFilterCell(el: UiGridStandaloneElement, column: GridColumnDef): string;
|
|
26
|
+
/** Render one display-item: group row, expandable row, or the cells of a
|
|
27
|
+
* regular data row. */
|
|
28
|
+
export declare function renderDisplayItem(el: UiGridStandaloneElement, item: DisplayItem, displayIndex: number): string;
|
|
29
|
+
/** Render one body cell including its pin / focus / edit / validation
|
|
30
|
+
* chrome. The inner `.cell-content` is produced by `renderCellTemplate`. */
|
|
31
|
+
export declare function renderBodyCell(el: UiGridStandaloneElement, row: GridRow, column: GridColumnDef, displayIndex: number): string;
|
|
32
|
+
/** Render the contents of `.cell-shell` (tree/expand toggles + the
|
|
33
|
+
* interpolated cell content). Used by the patch path to replace inner
|
|
34
|
+
* HTML without rebuilding the body-cell wrapper. */
|
|
35
|
+
export declare function renderCellShellContents(el: UiGridStandaloneElement, row: GridRow, column: GridColumnDef, displayIndex: number, editing: boolean, templateMarkupMap?: Map<string, string | null>): string;
|
|
36
|
+
/** Pagination footer markup. Reads page-size options + labels + icons off
|
|
37
|
+
* the snapshot; emits a `<ui-grid-pagination>` component with data-* attrs. */
|
|
38
|
+
export declare function renderPagination(el: UiGridStandaloneElement, snapshot: GridControllerSnapshot): string;
|
|
39
|
+
/** Hidden `<slot>` registry block so the element's shadow DOM exposes a
|
|
40
|
+
* named slot for every visible column's default `<template slot="cell-…">`
|
|
41
|
+
* markup. Matches the old grid's slot-exposure contract. */
|
|
42
|
+
export declare function renderSlotRegistry(columns: readonly GridColumnDef[]): string;
|
|
43
|
+
/** Render the inner `.cell-content` of one cell — the value interpolated
|
|
44
|
+
* through a consumer template, or the default display value. */
|
|
45
|
+
export declare function renderCellTemplate(el: UiGridStandaloneElement, row: GridRow, column: GridColumnDef, displayIndex: number): string;
|
|
46
|
+
/** Render the inner `.cell-content` from a pre-fetched template markup
|
|
47
|
+
* string. Used by the patch path which resolves templates once per column
|
|
48
|
+
* and reuses the result across every cell. */
|
|
49
|
+
export declare function renderCellTemplateFromMarkup(el: UiGridStandaloneElement, row: GridRow, column: GridColumnDef, displayIndex: number, templateMarkup: string | null): string;
|
|
50
|
+
/** Render the body of an expandable detail row — either a framework slot
|
|
51
|
+
* placeholder or the interpolated `<template slot="expandable-row">`. */
|
|
52
|
+
export declare function renderExpandableTemplate(el: UiGridStandaloneElement, row: GridRow): string;
|
|
53
|
+
/** Render the no-data empty-state panel. In framework-rendered mode,
|
|
54
|
+
* stages the singleton `empty` slot and emits a slot placeholder. */
|
|
55
|
+
export declare function renderEmptyState(el: UiGridStandaloneElement, headingRaw: string, descriptionRaw: string): string;
|
|
56
|
+
/** Read a consumer-provided `<template slot="…">` out of the element's
|
|
57
|
+
* light DOM. Returns the template's innerHTML or null when absent. */
|
|
58
|
+
export declare function getTemplateMarkup(el: UiGridStandaloneElement, slotName: string): string | null;
|
|
59
|
+
/** Resolve the visible-rows index for a given row, falling back to the
|
|
60
|
+
* render-pass displayIndex when the row isn't in `visibleRows`. */
|
|
61
|
+
export declare function rowIndexFor(el: UiGridStandaloneElement, row: GridRow, fallback?: number): number;
|
|
62
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,OAAO,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,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AAM,EAAE,aAAa,EACrB,YAAY,EAAE,MAAM,GACnB,MAAM,CAGR;AAED;;8CAE8C;AAC9C,wBAAgB,4BAA4B,CAC1C,EAAE,EAAE,uBAAuB,EAC3B,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GAAG,IAAI,GAC5B,MAAM,CAkCR;AAED;yEACyE;AACzE,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,uBAAuB,EAC3B,GAAG,EAAE,OAAO,GACX,MAAM,CAkBR;AAED;qEACqE;AACrE,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,uBAAuB,EAC3B,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,MAAM,CAQR;AAED;sEACsE;AACtE,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,uBAAuB,EAC3B,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAGf;AAED;mEACmE;AACnE,wBAAgB,WAAW,CACzB,EAAE,EAAE,uBAAuB,EAC3B,GAAG,EAAE,OAAO,EACZ,QAAQ,SAAI,GACX,MAAM,CAIR"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String template helpers for grid markup fragments.
|
|
3
|
+
*
|
|
4
|
+
* These are simple functions that return HTML strings for use in innerHTML
|
|
5
|
+
* concatenation (the hot render path). They are NOT .html template imports —
|
|
6
|
+
* .html templates should only be used where connect() is called against
|
|
7
|
+
* a DOM target (shell, components with shadow DOM).
|
|
8
|
+
*
|
|
9
|
+
* This avoids the DOM→string→DOM round-trip that toHTML() would cause.
|
|
10
|
+
*/
|
|
11
|
+
export declare function iconMarkup(svgClass: string, viewBox: string, path: string): string;
|
|
12
|
+
export declare function slotRegistryMarkup(cellSlots: string): string;
|
|
13
|
+
export declare function filterRowMarkup(templateColumns: string, filterCells: string): string;
|
|
14
|
+
export declare function bodyVirtualMarkup(templateColumns: string, totalVirtualHeight: number, virtualOffset: number, bodyContent: string): string;
|
|
15
|
+
export declare function bodyStaticMarkup(templateColumns: string, bodyContent: string): string;
|
|
16
|
+
export declare function emptyDataMarkup(heading: string, description: string): string;
|
|
17
|
+
export declare function expandableRowMarkup(expandableContent: string): string;
|
|
18
|
+
export declare function treeToggleMarkup(rowId: string, toggleLabel: string, iconViewBox: string, iconPath: string): string;
|
|
19
|
+
export declare function expandToggleMarkup(rowId: string, toggleLabel: string, iconViewBox: string, iconPath: string): string;
|
|
20
|
+
export declare function cellEditorMarkup(rowId: string, columnName: string, inputType: string, editingValue: string): string;
|
|
21
|
+
export declare function cellValueMarkup(displayValue: string): string;
|
|
22
|
+
export declare function defaultExpandableMarkup(label: string): string;
|
|
23
|
+
export declare function resizerMarkup(columnName: string, headerValue: string): string;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElF;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzI;AAED,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAErF;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,wBAAgB,mBAAmB,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElH;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpH;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAEnH;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-grid-empty.template.d.ts","sourceRoot":"","sources":["../src/ui-grid-empty.template.ts"],"names":[],"mappings":"AAKA,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,GAAG,EAAE,YAAY;mBAEpC,UAAU,GAAG,IAAI;EAWnC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ShellContext {
|
|
2
|
+
shadowRoot?: ShadowRoot | null;
|
|
3
|
+
slotRegistry: string;
|
|
4
|
+
gridTitle: string;
|
|
5
|
+
gridTableStyle: string;
|
|
6
|
+
templateColumns: string;
|
|
7
|
+
headerContent: string;
|
|
8
|
+
filterRowContent: string;
|
|
9
|
+
bodyViewportStyle: string;
|
|
10
|
+
bodyContent: string;
|
|
11
|
+
paginationContent: string;
|
|
12
|
+
}
|
|
13
|
+
export default function gridShellTemplate(ctx: ShellContext): {
|
|
14
|
+
connect(root?: ShadowRoot): void;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ui-grid-shell.template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-grid-shell.template.d.ts","sourceRoot":"","sources":["../src/ui-grid-shell.template.ts"],"names":[],"mappings":"AAKA,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,GAAG,EAAE,YAAY;mBAExC,UAAU,GAAG,IAAI;EAwBnC"}
|