@rozie-ui/data-table-lit 0.2.4 → 0.2.6
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 +2 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +1 -0
- package/package.json +2 -2
- package/src/Column.ts +13 -4
- package/src/DataTable.ts +1404 -1
- package/src/DetailPanel.ts +3 -0
- package/src/EditorCheckbox.ts +2 -0
- package/src/EditorNumber.ts +3 -0
- package/src/EditorSelect.ts +2 -2
- package/src/EditorText.ts +3 -3
- package/src/FilterNumberRange.ts +5 -2
- package/src/FilterSelect.ts +6 -0
- package/src/FilterText.ts +3 -3
- package/src/GroupBar.ts +18 -0
- package/src/themes/base.css +15 -0
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ npm i @rozie-ui/data-table-lit
|
|
|
10
10
|
|
|
11
11
|
Peer dependencies: `lit + @lit/context + @lit-labs/preact-signals + @preact/signals-core + @tanstack/table-core + @tanstack/virtual-core + @rozie-ui/popover-lit`. Install them alongside this package.
|
|
12
12
|
|
|
13
|
+
Also installed: `@rozie/runtime-lit` — Rozie's small, tree-shaken runtime helper package (controllable state, keyboard navigation, event modifiers, and safe interpolation). It arrives as a regular dependency, so npm pulls it for you. Your bundler keeps only the helpers this component actually uses — typically a few hundred bytes to a few KB, minified and gzipped. [What's in it and what it costs](https://github.com/One-Learning-Community/rozie.js/blob/main/docs/guide/output-and-runtime.md).
|
|
14
|
+
|
|
13
15
|
## Usage
|
|
14
16
|
|
|
15
17
|
Columns may be declared as a `:columns` config array **or** as `<Column>` children (or both — an id-keyed last-write-wins union). Per-cell rendering is one parent `#cell` / `#colHeader` renderer on `<DataTable>`, dispatched by `columnId`, so it works the same with either column form.
|
package/dist/index.cjs
CHANGED
|
@@ -4671,6 +4671,7 @@ __decorate([(0, lit_decorators_js.queryAssignedElements)({
|
|
|
4671
4671
|
flatten: true
|
|
4672
4672
|
})], DataTable.prototype, "_slotDetailElements", void 0);
|
|
4673
4673
|
__decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "detail", void 0);
|
|
4674
|
+
__decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "rozieSlots", void 0);
|
|
4674
4675
|
DataTable = __decorate([(0, lit_decorators_js.customElement)("rozie-data-table")], DataTable);
|
|
4675
4676
|
var DataTable_default = DataTable;
|
|
4676
4677
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -8,7 +8,7 @@ declare class DataTable extends DataTable_base {
|
|
|
8
8
|
/**
|
|
9
9
|
* The row data — `model: true`, so a committed cell/row edit writes a **fresh** array back through `r-model:data` (uncontrolled fallback `dataDefault`). A stable reference per Rozie's setup-once model — fed directly into table-core (never map/cloned in the watcher).
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
11
|
+
* <rozie-data-table .data=${rows} @data-change=${…} .columns=${cols}></rozie-data-table>
|
|
12
12
|
*/
|
|
13
13
|
_data_attr: any[];
|
|
14
14
|
private _dataControllable;
|
|
@@ -235,6 +235,7 @@ declare class DataTable extends DataTable_base {
|
|
|
235
235
|
detail?: (scope: {
|
|
236
236
|
row: any;
|
|
237
237
|
}) => unknown;
|
|
238
|
+
rozieSlots?: Record<string, (scope: any) => unknown>;
|
|
238
239
|
private _disconnectCleanups;
|
|
239
240
|
private _rozieTornDown;
|
|
240
241
|
private _armListeners;
|
|
@@ -673,7 +674,7 @@ declare class Column extends Column_base {
|
|
|
673
674
|
/**
|
|
674
675
|
* The row field this column reads (table-core `accessorKey`). The plain accessor value renders when the `#cell` slot falls through.
|
|
675
676
|
* @example
|
|
676
|
-
* <
|
|
677
|
+
* <rozie-column field="email" header="Email"></rozie-column>
|
|
677
678
|
*/
|
|
678
679
|
field: string;
|
|
679
680
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ declare class DataTable extends DataTable_base {
|
|
|
8
8
|
/**
|
|
9
9
|
* The row data — `model: true`, so a committed cell/row edit writes a **fresh** array back through `r-model:data` (uncontrolled fallback `dataDefault`). A stable reference per Rozie's setup-once model — fed directly into table-core (never map/cloned in the watcher).
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
11
|
+
* <rozie-data-table .data=${rows} @data-change=${…} .columns=${cols}></rozie-data-table>
|
|
12
12
|
*/
|
|
13
13
|
_data_attr: any[];
|
|
14
14
|
private _dataControllable;
|
|
@@ -235,6 +235,7 @@ declare class DataTable extends DataTable_base {
|
|
|
235
235
|
detail?: (scope: {
|
|
236
236
|
row: any;
|
|
237
237
|
}) => unknown;
|
|
238
|
+
rozieSlots?: Record<string, (scope: any) => unknown>;
|
|
238
239
|
private _disconnectCleanups;
|
|
239
240
|
private _rozieTornDown;
|
|
240
241
|
private _armListeners;
|
|
@@ -673,7 +674,7 @@ declare class Column extends Column_base {
|
|
|
673
674
|
/**
|
|
674
675
|
* The row field this column reads (table-core `accessorKey`). The plain accessor value renders when the `#cell` slot falls through.
|
|
675
676
|
* @example
|
|
676
|
-
* <
|
|
677
|
+
* <rozie-column field="email" header="Email"></rozie-column>
|
|
677
678
|
*/
|
|
678
679
|
field: string;
|
|
679
680
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -4667,6 +4667,7 @@ __decorate([queryAssignedElements({
|
|
|
4667
4667
|
flatten: true
|
|
4668
4668
|
})], DataTable.prototype, "_slotDetailElements", void 0);
|
|
4669
4669
|
__decorate([property({ attribute: false })], DataTable.prototype, "detail", void 0);
|
|
4670
|
+
__decorate([property({ attribute: false })], DataTable.prototype, "rozieSlots", void 0);
|
|
4670
4671
|
DataTable = __decorate([customElement("rozie-data-table")], DataTable);
|
|
4671
4672
|
var DataTable_default = DataTable;
|
|
4672
4673
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozie-ui/data-table-lit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"src"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@rozie/runtime-lit": "0.
|
|
48
|
+
"@rozie/runtime-lit": "0.7.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"lit": "^3.2",
|
package/src/Column.ts
CHANGED
|
@@ -18,7 +18,7 @@ export default class Column extends SignalWatcher(LitElement) {
|
|
|
18
18
|
/**
|
|
19
19
|
* The row field this column reads (table-core `accessorKey`). The plain accessor value renders when the `#cell` slot falls through.
|
|
20
20
|
* @example
|
|
21
|
-
* <
|
|
21
|
+
* <rozie-column field="email" header="Email"></rozie-column>
|
|
22
22
|
*/
|
|
23
23
|
@property({ type: String, reflect: true }) field: string = '';
|
|
24
24
|
/**
|
|
@@ -81,9 +81,6 @@ private get registry() { return this.__rozieCtxConsumer_data_table_columns.value
|
|
|
81
81
|
firstUpdated(): void {
|
|
82
82
|
this.reg = this.registry;
|
|
83
83
|
|
|
84
|
-
// idempotency flag so a reactive late-context registration (Lit async first paint,
|
|
85
|
-
// REQ-30) and the $onMount registration never double-register the column.
|
|
86
|
-
|
|
87
84
|
this._disconnectCleanups.push((() => {
|
|
88
85
|
if (this.reg) this.reg.unregisterColumn(this.colId());
|
|
89
86
|
}));
|
|
@@ -128,10 +125,22 @@ private get registry() { return this.__rozieCtxConsumer_data_table_columns.value
|
|
|
128
125
|
`;
|
|
129
126
|
}
|
|
130
127
|
|
|
128
|
+
// $inject is typed `unknown` (Phase 36 D-4: no rich type synthesis yet), which the
|
|
129
|
+
// STRICT BUNDLED-LEAF tsc rejects on `.registerColumn(...)` (TS2339). The .rozie-native
|
|
130
|
+
// fix is the null-let → `any` typeNeutralize idiom: alias the injected API through a
|
|
131
|
+
// MODULE-SCOPE `let reg = null` (typeNeutralize types it `any`). Module-scope (not
|
|
132
|
+
// hook-local) so the alias is in scope from the Solid teardown — which the Solid
|
|
133
|
+
// emitter hoists into a sibling onCleanup() OUTSIDE the mount closure. ZERO emitter
|
|
134
|
+
// change.
|
|
131
135
|
reg: any = null;
|
|
132
136
|
|
|
137
|
+
// idempotency flag so a reactive late-context registration (Lit async first paint,
|
|
138
|
+
// REQ-30) and the $onMount registration never double-register the column.
|
|
133
139
|
registered = false;
|
|
134
140
|
|
|
141
|
+
// the column SPEC builder — shared by the $onMount register and the late-context
|
|
142
|
+
// $onUpdate below. Carries METADATA ONLY (no cell/header render callbacks — D-A moved
|
|
143
|
+
// per-cell rendering to the parent's #cell/#header scoped slot, dispatched by columnId).
|
|
135
144
|
colId = () => this.id !== '' ? this.id : this.field;
|
|
136
145
|
|
|
137
146
|
buildSpec = () => ({
|