@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":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ui-grid-body-cell>` — Data cell element.
|
|
3
|
+
*
|
|
4
|
+
* An empty custom element. The grid shell pre-computes `class`, `style`,
|
|
5
|
+
* `tabindex`, and all `data-*` attributes directly into the emitted HTML
|
|
6
|
+
* string, so the browser parser finishes the element's visual state in one
|
|
7
|
+
* pass. No `attributeChangedCallback` work is required at upgrade time — at
|
|
8
|
+
* 1000+ cells per render, the callback storm was the single largest cost on
|
|
9
|
+
* the hot path.
|
|
10
|
+
*
|
|
11
|
+
* The class remains so the tag name resolves (`closest('ui-grid-body-cell')`
|
|
12
|
+
* still works) and so the element-specific CSS selectors target correctly.
|
|
13
|
+
* The parent is the single writer; cells are never mutated from outside.
|
|
14
|
+
*/
|
|
15
|
+
export declare class UIGridBodyCell extends HTMLElement {
|
|
16
|
+
static readonly TAG = "ui-grid-body-cell";
|
|
17
|
+
static define(tagName?: string): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=grid-body-cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-body-cell.d.ts","sourceRoot":"","sources":["../../../src/components/grid-body-cell/grid-body-cell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAC,QAAQ,CAAC,GAAG,uBAAuB;IAE1C,MAAM,CAAC,MAAM,CAAC,OAAO,SAAqB,GAAG,IAAI;CAKlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grid-body-cell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ui-grid-cell-editor>` — Single-input cell editor element.
|
|
3
|
+
*
|
|
4
|
+
* Light-DOM custom element. Mounts ONE `<input class="cell-editor">` in
|
|
5
|
+
* `connectedCallback` and reuses it across renders — every subsequent snapshot
|
|
6
|
+
* patches `value`/`type`/`disabled` in place instead of recreating the input.
|
|
7
|
+
* That keeps the keystroke path destructive-free: typing never rebuilds the
|
|
8
|
+
* focused node, so focus and caret survive the parent grid's re-renders.
|
|
9
|
+
*
|
|
10
|
+
* The inner `<input>` carries `data-role="editor"` + `data-row` + `data-column`
|
|
11
|
+
* so the parent grid's delegated `input` / `blur` handlers continue to find it
|
|
12
|
+
* via `composedPath()`/event.target unchanged.
|
|
13
|
+
*
|
|
14
|
+
* Value updates coming in from the controller (`data-value`) are only pushed
|
|
15
|
+
* into the input when the input is NOT the currently focused element — this
|
|
16
|
+
* avoids clobbering the user's in-progress edit / caret position.
|
|
17
|
+
*/
|
|
18
|
+
export declare class UIGridCellEditor extends HTMLElement {
|
|
19
|
+
static readonly TAG = "ui-grid-cell-editor";
|
|
20
|
+
private mounted;
|
|
21
|
+
private inputEl;
|
|
22
|
+
static get observedAttributes(): string[];
|
|
23
|
+
connectedCallback(): void;
|
|
24
|
+
attributeChangedCallback(): void;
|
|
25
|
+
private sync;
|
|
26
|
+
static define(tagName?: string): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=grid-cell-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-cell-editor.d.ts","sourceRoot":"","sources":["../../../src/components/grid-cell-editor/grid-cell-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,QAAQ,CAAC,GAAG,yBAAyB;IAE5C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAiC;IAEhD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IA8BzB,wBAAwB,IAAI,IAAI;IAMhC,OAAO,CAAC,IAAI;IAmCZ,MAAM,CAAC,MAAM,CAAC,OAAO,SAAuB,GAAG,IAAI;CAKpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grid-cell-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ui-grid-filter-cell>` — Column filter input element.
|
|
3
|
+
*
|
|
4
|
+
* An autonomous custom element that renders a filter input for a single grid column.
|
|
5
|
+
* Uses shadow DOM with scoped styles via `adoptedStyleSheets`.
|
|
6
|
+
*
|
|
7
|
+
* **Rendering pattern:** the template is mounted once in `connectedCallback` via
|
|
8
|
+
* `renderFilterCell()`. Attribute updates patch the existing input in place
|
|
9
|
+
* (value, placeholder, disabled) so the filter input never loses focus on re-renders.
|
|
10
|
+
*
|
|
11
|
+
* **CSS architecture:** Styles are scoped to the shadow DOM via `grid-filter-cell.scss`.
|
|
12
|
+
* CSS custom properties (`--ui-grid-*`) inherit from the parent grid's shadow tree.
|
|
13
|
+
*
|
|
14
|
+
* **Pinning:** The host element receives pinning classes (`is-pinned`, `is-pinned-left-last`,
|
|
15
|
+
* `is-pinned-right-first`) which are styled by the parent grid's CSS since the host element
|
|
16
|
+
* itself lives in the grid's shadow tree.
|
|
17
|
+
*/
|
|
18
|
+
export declare class UIGridFilterCell extends HTMLElement {
|
|
19
|
+
static readonly TAG = "ui-grid-filter-cell";
|
|
20
|
+
columnName: string;
|
|
21
|
+
value: string;
|
|
22
|
+
placeholder: string;
|
|
23
|
+
private mounted;
|
|
24
|
+
private inputEl;
|
|
25
|
+
constructor();
|
|
26
|
+
static get observedAttributes(): string[];
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
attributeChangedCallback(): void;
|
|
29
|
+
private sync;
|
|
30
|
+
static define(tagName?: string): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=grid-filter-cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-filter-cell.d.ts","sourceRoot":"","sources":["../../../src/components/grid-filter-cell/grid-filter-cell.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,QAAQ,CAAC,GAAG,yBAAyB;IAE5C,UAAU,SAAM;IAChB,KAAK,SAAM;IACX,WAAW,SAAM;IAEjB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAiC;;IAOhD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAIxC;IAED,iBAAiB,IAAI,IAAI;IAYzB,wBAAwB,IAAI,IAAI;IAMhC,OAAO,CAAC,IAAI;IAyDZ,MAAM,CAAC,MAAM,CAAC,OAAO,SAAuB,GAAG,IAAI;CAKpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-filter-cell.template.d.ts","sourceRoot":"","sources":["../../../src/components/grid-filter-cell/grid-filter-cell.template.ts"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAQrF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grid-filter-cell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ui-grid-group-row>` — Group disclosure row element.
|
|
3
|
+
*
|
|
4
|
+
* An autonomous custom element that renders a group header row with a disclosure
|
|
5
|
+
* toggle icon, group field/label, and row count. Uses shadow DOM with scoped styles
|
|
6
|
+
* via `adoptedStyleSheets`.
|
|
7
|
+
*
|
|
8
|
+
* **Rendering pattern:** instance properties are populated from data attributes,
|
|
9
|
+
* then `renderGroupRow(this, shadowRoot)` writes the markup into the shadow root.
|
|
10
|
+
*
|
|
11
|
+
* **CSS architecture:** Styles are scoped to the shadow DOM via `grid-group-row.scss`.
|
|
12
|
+
* CSS custom properties (`--ui-grid-*`) inherit from the parent grid's shadow tree.
|
|
13
|
+
*
|
|
14
|
+
* **Event delegation:** The host element carries `data-action="toggle-group"` and
|
|
15
|
+
* `data-group` attributes so the parent grid's click handler can identify it without
|
|
16
|
+
* piercing the shadow boundary.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```html
|
|
20
|
+
* <ui-grid-group-row
|
|
21
|
+
* data-action="toggle-group"
|
|
22
|
+
* data-group="category:Fruit"
|
|
23
|
+
* data-collapsed="false"
|
|
24
|
+
* data-field="category"
|
|
25
|
+
* data-label="Fruit"
|
|
26
|
+
* data-count="5"
|
|
27
|
+
* data-depth="0"
|
|
28
|
+
* data-icon-path="M7 10l5 5 5-5z">
|
|
29
|
+
* </ui-grid-group-row>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class UIGridGroupRow extends HTMLElement {
|
|
33
|
+
static readonly TAG = "ui-grid-group-row";
|
|
34
|
+
/** The grouping field name (e.g. "category"). */
|
|
35
|
+
field: string;
|
|
36
|
+
/** The group value label (e.g. "Fruit"). */
|
|
37
|
+
label: string;
|
|
38
|
+
/** Number of rows in this group. */
|
|
39
|
+
count: string;
|
|
40
|
+
/** Accessibility label for the disclosure toggle. */
|
|
41
|
+
disclosureLabel: string;
|
|
42
|
+
/** SVG path data for the disclosure icon. */
|
|
43
|
+
iconPath: string;
|
|
44
|
+
/** SVG viewBox for the disclosure icon. */
|
|
45
|
+
iconViewBox: string;
|
|
46
|
+
/** Suffix text after the count (e.g. "items"). */
|
|
47
|
+
rowsSuffix: string;
|
|
48
|
+
constructor();
|
|
49
|
+
static get observedAttributes(): string[];
|
|
50
|
+
connectedCallback(): void;
|
|
51
|
+
attributeChangedCallback(): void;
|
|
52
|
+
private render;
|
|
53
|
+
static define(tagName?: string): void;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=grid-group-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-group-row.d.ts","sourceRoot":"","sources":["../../../src/components/grid-group-row/grid-group-row.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAC,QAAQ,CAAC,GAAG,uBAAuB;IAE1C,iDAAiD;IACjD,KAAK,SAAM;IACX,4CAA4C;IAC5C,KAAK,SAAM;IACX,oCAAoC;IACpC,KAAK,SAAO;IACZ,qDAAqD;IACrD,eAAe,SAAM;IACrB,6CAA6C;IAC7C,QAAQ,SAAM;IACd,2CAA2C;IAC3C,WAAW,SAAe;IAC1B,kDAAkD;IAClD,UAAU,SAAM;;IAOhB,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAIxC;IAED,iBAAiB,IAAI,IAAI;IAIzB,wBAAwB,IAAI,IAAI;IAMhC,OAAO,CAAC,MAAM;IAgBd,MAAM,CAAC,MAAM,CAAC,OAAO,SAAqB,GAAG,IAAI;CAKlD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface GroupRowContext {
|
|
2
|
+
iconViewBox: string;
|
|
3
|
+
iconPath: string;
|
|
4
|
+
disclosureLabel: string;
|
|
5
|
+
field: string;
|
|
6
|
+
label: string;
|
|
7
|
+
count: string;
|
|
8
|
+
rowsSuffix: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function renderGroupRow(ctx: GroupRowContext, shadowRoot: ShadowRoot): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=grid-group-row.template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-group-row.template.d.ts","sourceRoot":"","sources":["../../../src/components/grid-group-row/grid-group-row.template.ts"],"names":[],"mappings":"AAKA,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAOjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grid-group-row/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ui-grid-header-cell>` — Column header cell element.
|
|
3
|
+
*
|
|
4
|
+
* An empty custom element. Same performance rationale as `<ui-grid-body-cell>`:
|
|
5
|
+
* the grid shell pre-computes `class`, `style`, `draggable`, and all `data-*`
|
|
6
|
+
* attributes into the emitted HTML string. No per-element lifecycle callback
|
|
7
|
+
* runs during parse — the parent is the single writer.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UIGridHeaderCell extends HTMLElement {
|
|
10
|
+
static readonly TAG = "ui-grid-header-cell";
|
|
11
|
+
static define(tagName?: string): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=grid-header-cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-header-cell.d.ts","sourceRoot":"","sources":["../../../src/components/grid-header-cell/grid-header-cell.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,QAAQ,CAAC,GAAG,yBAAyB;IAE5C,MAAM,CAAC,MAAM,CAAC,OAAO,SAAuB,GAAG,IAAI;CAKpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grid-header-cell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ui-grid-pagination>` — Pagination controls element.
|
|
3
|
+
*
|
|
4
|
+
* Mounts once via `template(this).connect()` in `connectedCallback`; subsequent
|
|
5
|
+
* attribute changes patch the existing DOM in place (text labels, button disabled
|
|
6
|
+
* flags, select options). The parent grid re-uses a single `<ui-grid-pagination>`
|
|
7
|
+
* node and just sets data-attributes on it, so nothing inside ever loses focus.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UIGridPagination extends HTMLElement {
|
|
10
|
+
static readonly TAG = "ui-grid-pagination";
|
|
11
|
+
rangeLabel: string;
|
|
12
|
+
currentPage: string;
|
|
13
|
+
totalPages: string;
|
|
14
|
+
pageLabel: string;
|
|
15
|
+
ofLabel: string;
|
|
16
|
+
prevLabel: string;
|
|
17
|
+
nextLabel: string;
|
|
18
|
+
rowsLabel: string;
|
|
19
|
+
prevIconPath: string;
|
|
20
|
+
prevIconViewBox: string;
|
|
21
|
+
nextIconPath: string;
|
|
22
|
+
nextIconViewBox: string;
|
|
23
|
+
private mounted;
|
|
24
|
+
private rangeEl;
|
|
25
|
+
private pageCounterEl;
|
|
26
|
+
private prevBtn;
|
|
27
|
+
private nextBtn;
|
|
28
|
+
private prevIconPathEl;
|
|
29
|
+
private nextIconPathEl;
|
|
30
|
+
private prevLabelSr;
|
|
31
|
+
private nextLabelSr;
|
|
32
|
+
private rowsLabelSr;
|
|
33
|
+
private sizeSelect;
|
|
34
|
+
private lastPageSizesKey;
|
|
35
|
+
constructor();
|
|
36
|
+
static get observedAttributes(): string[];
|
|
37
|
+
connectedCallback(): void;
|
|
38
|
+
attributeChangedCallback(): void;
|
|
39
|
+
private captureTemplateBindings;
|
|
40
|
+
private cacheElements;
|
|
41
|
+
private attachSelectListener;
|
|
42
|
+
private sync;
|
|
43
|
+
static define(tagName?: string): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=grid-pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-pagination.d.ts","sourceRoot":"","sources":["../../../src/components/grid-pagination/grid-pagination.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,QAAQ,CAAC,GAAG,wBAAwB;IAE3C,UAAU,SAAM;IAChB,WAAW,SAAO;IAClB,UAAU,SAAO;IACjB,SAAS,SAAM;IACf,OAAO,SAAM;IACb,SAAS,SAAM;IACf,SAAS,SAAM;IACf,SAAS,SAAM;IACf,YAAY,SAAM;IAClB,eAAe,SAAe;IAC9B,YAAY,SAAM;IAClB,eAAe,SAAe;IAE9B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,aAAa,CAA4B;IACjD,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,gBAAgB,CAAM;;IAO9B,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAMxC;IAED,iBAAiB,IAAI,IAAI;IAWzB,wBAAwB,IAAI,IAAI;IAMhC,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,IAAI;IAwFZ,MAAM,CAAC,MAAM,CAAC,OAAO,SAAuB,GAAG,IAAI;CAKpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface PaginationContext {
|
|
2
|
+
rangeLabel: string;
|
|
3
|
+
prevLabel: string;
|
|
4
|
+
prevIconViewBox: string;
|
|
5
|
+
prevIconPath: string;
|
|
6
|
+
pageLabel: string;
|
|
7
|
+
currentPage: string;
|
|
8
|
+
ofLabel: string;
|
|
9
|
+
totalPages: string;
|
|
10
|
+
nextLabel: string;
|
|
11
|
+
nextIconViewBox: string;
|
|
12
|
+
nextIconPath: string;
|
|
13
|
+
rowsLabel: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function renderPagination(ctx: PaginationContext, shadowRoot: ShadowRoot): void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=grid-pagination.template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-pagination.template.d.ts","sourceRoot":"","sources":["../../../src/components/grid-pagination/grid-pagination.template.ts"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAmBrF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grid-pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A declarative template element for defining reusable cell/row templates
|
|
3
|
+
* without writing JavaScript.
|
|
4
|
+
*
|
|
5
|
+
* Supports both `${this.prop}` and `{{prop}}` binding syntax.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```html
|
|
9
|
+
* <template is="ui-grid-template" name="ui-status-badge" status="unknown">
|
|
10
|
+
* <style>
|
|
11
|
+
* :host { display: inline-block; }
|
|
12
|
+
* .badge { padding: 2px 8px; border-radius: 4px; font-size: 0.8em; }
|
|
13
|
+
* .badge-active { background: #d1fae5; color: #065f46; }
|
|
14
|
+
* .badge-inactive { background: #fee2e2; color: #991b1b; }
|
|
15
|
+
* </style>
|
|
16
|
+
* <span class="badge badge-${this.status}">${this.status}</span>
|
|
17
|
+
* </template>
|
|
18
|
+
*
|
|
19
|
+
* <ui-grid-element>
|
|
20
|
+
* <template slot="cell-status">
|
|
21
|
+
* <ui-status-badge status="{{value}}"></ui-status-badge>
|
|
22
|
+
* </template>
|
|
23
|
+
* </ui-grid-element>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class UIGridTemplate extends HTMLTemplateElement {
|
|
27
|
+
static readonly TAG = "ui-grid-template";
|
|
28
|
+
connectedCallback(): void;
|
|
29
|
+
static define(tagName?: string): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=grid-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-template.d.ts","sourceRoot":"","sources":["../../../src/components/grid-template/grid-template.ts"],"names":[],"mappings":"AAuEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,cAAe,SAAQ,mBAAmB;IACrD,MAAM,CAAC,QAAQ,CAAC,GAAG,sBAAsB;IAEzC,iBAAiB,IAAI,IAAI;IA6DzB,MAAM,CAAC,MAAM,CAAC,OAAO,SAAqB,GAAG,IAAI;CAKlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grid-template/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM event wiring for the grid element.
|
|
3
|
+
*
|
|
4
|
+
* One entry point — `bindEvents(el)` — attaches every shadow-root event
|
|
5
|
+
* listener the grid needs: click, focusin/out, input, mousedown (selection
|
|
6
|
+
* drag + column resize), dblclick, keydown, blur, dragstart/over/leave/
|
|
7
|
+
* drop/end, wheel, scroll. Each handler is a standalone function declared
|
|
8
|
+
* inside `bindEvents` so it closes over the element and keeps the coupling
|
|
9
|
+
* local.
|
|
10
|
+
*
|
|
11
|
+
* Supporting helpers (`observeTemplateSlots`, `syncHeaderHorizontalScroll`,
|
|
12
|
+
* `maybeTriggerInfiniteScroll`) also live here because they are only used
|
|
13
|
+
* by the event path.
|
|
14
|
+
*/
|
|
15
|
+
import type { UiGridStandaloneElement } from './ui-grid-standalone.element';
|
|
16
|
+
/**
|
|
17
|
+
* Watch the element's light DOM for `<template slot="…">` changes so
|
|
18
|
+
* consumer template edits trigger a re-render. Ports the old grid's
|
|
19
|
+
* observer that let template updates flow through without an explicit
|
|
20
|
+
* options re-assign.
|
|
21
|
+
*/
|
|
22
|
+
export declare function observeTemplateSlots(el: UiGridStandaloneElement): void;
|
|
23
|
+
/**
|
|
24
|
+
* Mirror horizontal scroll from the body viewport onto the header +
|
|
25
|
+
* filter strips. The strips are real scroll containers (necessary for
|
|
26
|
+
* `position: sticky` on pinned cells), so they need scrollLeft set
|
|
27
|
+
* imperatively to stay aligned with the body.
|
|
28
|
+
*/
|
|
29
|
+
export declare function syncHeaderHorizontalScroll(el: UiGridStandaloneElement, scrollLeft: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* Ask the controller to evaluate whether the current scroll position
|
|
32
|
+
* should request more data at the top or bottom — ports the old grid's
|
|
33
|
+
* `handleScroll → loadData` check. The controller raises
|
|
34
|
+
* `needLoadMoreData` / `needLoadMoreDataTop` when thresholds are crossed.
|
|
35
|
+
*/
|
|
36
|
+
export declare function maybeTriggerInfiniteScroll(el: UiGridStandaloneElement): void;
|
|
37
|
+
/**
|
|
38
|
+
* Attach every shadow-root listener the grid needs. Idempotent: a
|
|
39
|
+
* `__uiGridBound` marker on the shadow root prevents re-binding on
|
|
40
|
+
* reconnect.
|
|
41
|
+
*/
|
|
42
|
+
export declare function bindEvents(el: UiGridStandaloneElement): void;
|
|
43
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAaH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAsB5E;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,uBAAuB,GAAG,IAAI,CAiCtE;AAmBD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,EAAE,EAAE,uBAAuB,EAC3B,UAAU,EAAE,MAAM,GACjB,IAAI,CAWN;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,uBAAuB,GAAG,IAAI,CAW5E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,uBAAuB,GAAG,IAAI,CAktB5D"}
|
package/dist/focus.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard navigation + focused-cell management.
|
|
3
|
+
*
|
|
4
|
+
* `moveGridFocus` is the central router: arrow keys, Tab/Enter inside an
|
|
5
|
+
* edit session, Home/End, Ctrl+Home/End all funnel through it. It knows
|
|
6
|
+
* how to walk the visible-row list (skipping group headers + expandable
|
|
7
|
+
* rows), moves the `cell-focused` decoration, nudges virtualization to
|
|
8
|
+
* bring off-screen targets into view, and DOM-focuses the target cell.
|
|
9
|
+
*
|
|
10
|
+
* Each function takes the element as its first argument and reads its
|
|
11
|
+
* internal state (snapshot / controller / focusedCell / shadowRoot)
|
|
12
|
+
* directly.
|
|
13
|
+
*/
|
|
14
|
+
import type { UiGridStandaloneElement } from './ui-grid-standalone.element';
|
|
15
|
+
export type GridMoveDirection = 'left' | 'right' | 'up' | 'down' | 'rowStart' | 'rowEnd' | 'top' | 'bottom';
|
|
16
|
+
/**
|
|
17
|
+
* Commit the in-flight edit, then move keyboard focus relative to the
|
|
18
|
+
* committed cell. Splits commit + focus across two paint frames: commit
|
|
19
|
+
* runs synchronously (editor unmounts, cell re-renders with the new
|
|
20
|
+
* value), then focus moves to the adjacent cell in a microtask so the
|
|
21
|
+
* blur handler's re-entry guard doesn't race the focus attempt.
|
|
22
|
+
*
|
|
23
|
+
* If the source cell was being edited, the destination cell also enters
|
|
24
|
+
* edit mode provided its column is editable — Tab/Enter inside an edit
|
|
25
|
+
* session stays continuous. Arrow nav outside an edit session does NOT
|
|
26
|
+
* auto-enter edit.
|
|
27
|
+
*/
|
|
28
|
+
export declare function commitAndMove(el: UiGridStandaloneElement, fromRowId: string | null, fromColumnName: string | null, direction: 'left' | 'right' | 'up' | 'down'): void;
|
|
29
|
+
/**
|
|
30
|
+
* Move focus relative to `(rowId, columnName)`. Uses the snapshot's
|
|
31
|
+
* display-items order so ArrowDown skips over group headers + expandable
|
|
32
|
+
* rows to whatever row comes visually next. `top` / `bottom` jump to the
|
|
33
|
+
* first/last visible row; `rowStart` / `rowEnd` jump to the first/last
|
|
34
|
+
* column of the current row.
|
|
35
|
+
*/
|
|
36
|
+
export declare function moveGridFocus(el: UiGridStandaloneElement, direction: GridMoveDirection, rowId: string | null, columnName: string | null, opts?: {
|
|
37
|
+
resumeEdit?: boolean;
|
|
38
|
+
}): void;
|
|
39
|
+
/**
|
|
40
|
+
* Ensure the row for `rowId` is inside the virtualization window before
|
|
41
|
+
* focus moves there. When virtualization is on, a distant row isn't yet
|
|
42
|
+
* rendered into the DOM — scroll to bring it in, let the virtual-body
|
|
43
|
+
* rebuild on the next frame, then `focusCellElement`'s retry picks it up.
|
|
44
|
+
*/
|
|
45
|
+
export declare function scrollFocusedRowIntoView(el: UiGridStandaloneElement, rowId: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Toggle the `cell-focused` class between the previous and next cells.
|
|
48
|
+
* The grid shell doesn't re-render on every arrow press — we hand-mutate
|
|
49
|
+
* the two affected cells instead to avoid touching the rest of the DOM.
|
|
50
|
+
*/
|
|
51
|
+
export declare function applyFocusedCellClass(el: UiGridStandaloneElement, previous: {
|
|
52
|
+
rowId: string;
|
|
53
|
+
columnName: string;
|
|
54
|
+
} | null, next: {
|
|
55
|
+
rowId: string;
|
|
56
|
+
columnName: string;
|
|
57
|
+
} | null): void;
|
|
58
|
+
/**
|
|
59
|
+
* DOM-focus the body cell matching the given row/column. Retries across
|
|
60
|
+
* two animation frames so a scroll-triggered virtual-body rebuild has
|
|
61
|
+
* time to bring the target row into the DOM before we give up.
|
|
62
|
+
*/
|
|
63
|
+
export declare function focusCellElement(el: UiGridStandaloneElement, rowId: string | null, columnName: string | null): void;
|
|
64
|
+
/**
|
|
65
|
+
* Dispatch a plain click on a body cell through the selection module.
|
|
66
|
+
* Mirrors the old `ui.grid.selection.uiGridCell` directive: shift-click
|
|
67
|
+
* ranges, ctrl/meta toggles one, plain click respects
|
|
68
|
+
* `enableFullRowSelection` + `enableSelectRowOnFocus` +
|
|
69
|
+
* `modifierKeysToMultiSelect`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function handleRowSelectionClick(el: UiGridStandaloneElement, rowId: string, columnName: string, event: Event): void;
|
|
72
|
+
/**
|
|
73
|
+
* Click handler for the row-header checkbox column. Differs from the
|
|
74
|
+
* full-row click only in that shift/ctrl semantics mirror the old
|
|
75
|
+
* selection module (shift-select pulls from `lastSelectedRow` regardless
|
|
76
|
+
* of modifier).
|
|
77
|
+
*/
|
|
78
|
+
export declare function handleRowHeaderCheckboxClick(el: UiGridStandaloneElement, rowId: string, event: Event): void;
|
|
79
|
+
/**
|
|
80
|
+
* Does a keydown event match a cellNav key-override descriptor?
|
|
81
|
+
* Undefined fields on the override are treated as wildcards. Used by the
|
|
82
|
+
* event bus to decide whether a key should be handled internally or
|
|
83
|
+
* forwarded to the consumer via `viewPortKeyDown`.
|
|
84
|
+
*/
|
|
85
|
+
export declare function matchesKeyOverride(override: {
|
|
86
|
+
keyCode?: number;
|
|
87
|
+
key?: string;
|
|
88
|
+
shiftKey?: boolean;
|
|
89
|
+
ctrlKey?: boolean;
|
|
90
|
+
altKey?: boolean;
|
|
91
|
+
metaKey?: boolean;
|
|
92
|
+
}, event: KeyboardEvent): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Measure the natural content width of a column by cloning visible cells
|
|
95
|
+
* into a hidden max-content container. This avoids measuring the CSS Grid
|
|
96
|
+
* track width (which just reflects the current column size) and instead
|
|
97
|
+
* returns the width the content actually needs.
|
|
98
|
+
*/
|
|
99
|
+
export declare function measureAutoColumnWidth(el: UiGridStandaloneElement, columnName: string): number;
|
|
100
|
+
//# sourceMappingURL=focus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../src/focus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAI5E,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,OAAO,GACP,IAAI,GACJ,MAAM,GACN,UAAU,GACV,QAAQ,GACR,KAAK,GACL,QAAQ,CAAC;AAEb;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,uBAAuB,EAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAC1C,IAAI,CAMN;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,uBAAuB,EAC3B,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GAClC,IAAI,CA6DN;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAkBzF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,uBAAuB,EAC3B,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EACtD,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GACjD,IAAI,CAqBN;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,uBAAuB,EAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,IAAI,CAkBN;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,uBAAuB,EAC3B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,KAAK,GACX,IAAI,CAiCN;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,EAAE,EAAE,uBAAuB,EAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,KAAK,GACX,IAAI,CAwBN;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,EACD,KAAK,EAAE,aAAa,GACnB,OAAO,CAQT;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CA0C9F"}
|