@ixfx/components 0.7.4 → 0.8.0
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/bundle/index.d.ts +787 -190
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +2770 -592
- package/bundle/index.js.map +1 -1
- package/dist/ac-token.js +1 -1
- package/dist/crumbs.d.ts +5 -1
- package/dist/crumbs.d.ts.map +1 -1
- package/dist/crumbs.js +10 -0
- package/dist/crumbs.js.map +1 -1
- package/dist/{data-grid-BddUjAti.d.ts → data-grid-D-z7bx5-.d.ts} +26 -1
- package/dist/data-grid-D-z7bx5-.d.ts.map +1 -0
- package/dist/data-grid.d.ts +1 -1
- package/dist/data-grid.js +88 -7
- package/dist/data-grid.js.map +1 -1
- package/dist/{detail-list-Br0WAnry.d.ts → detail-list-_ZJHYEBr.d.ts} +20 -12
- package/dist/detail-list-_ZJHYEBr.d.ts.map +1 -0
- package/dist/detail-list.d.ts +2 -2
- package/dist/detail-list.js +51 -135
- package/dist/detail-list.js.map +1 -1
- package/dist/grid-list-nRUQOcEL.js +1537 -0
- package/dist/grid-list-nRUQOcEL.js.map +1 -0
- package/dist/{grid-list-B_orPsot.d.ts → grid-list-u33vmKzb.d.ts} +128 -10
- package/dist/grid-list-u33vmKzb.d.ts.map +1 -0
- package/dist/grid-list.d.ts +1 -1
- package/dist/grid-list.js +1 -932
- package/dist/incr-search-C05WjbZh.js +999 -0
- package/dist/incr-search-C05WjbZh.js.map +1 -0
- package/dist/incr-search.d.ts +2 -2
- package/dist/incr-search.js +2 -3
- package/dist/index-h6gxtfHH.d.ts +397 -0
- package/dist/index-h6gxtfHH.d.ts.map +1 -0
- package/dist/index.d.ts +62 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +343 -17
- package/dist/index.js.map +1 -1
- package/dist/led.d.ts +33 -1
- package/dist/led.d.ts.map +1 -1
- package/dist/led.js +157 -13
- package/dist/led.js.map +1 -1
- package/dist/{list-selection-controller-CUo-Hhcm.js → list-selection-controller-DTFI40li.js} +2 -76
- package/dist/list-selection-controller-DTFI40li.js.map +1 -0
- package/dist/miller.d.ts +81 -3
- package/dist/miller.d.ts.map +1 -1
- package/dist/miller.js +327 -68
- package/dist/miller.js.map +1 -1
- package/dist/narrowed-text.js +1 -2
- package/dist/narrowed-text.js.map +1 -1
- package/dist/panel.d.ts +3 -1
- package/dist/panel.d.ts.map +1 -1
- package/dist/panel.js +31 -1
- package/dist/panel.js.map +1 -1
- package/dist/plots.d.ts +2 -2
- package/dist/plots.js +1 -1
- package/dist/{titlebar-Bj5pfdw_.d.ts → titlebar-YQ-jVQoS.d.ts} +2 -2
- package/dist/{titlebar-Bj5pfdw_.d.ts.map → titlebar-YQ-jVQoS.d.ts.map} +1 -1
- package/dist/titlebar.d.ts +1 -1
- package/dist/titlebar.js +83 -1
- package/dist/titlebar.js.map +1 -1
- package/dist/{tree-B74zdI60.js → tree-Chptss7I.js} +77 -15
- package/dist/tree-Chptss7I.js.map +1 -0
- package/dist/{tree-component-BvV4muxx.d.ts → tree-component-F6qZ0Gdv.d.ts} +9 -1
- package/dist/{tree-component-BvV4muxx.d.ts.map → tree-component-F6qZ0Gdv.d.ts.map} +1 -1
- package/dist/tree.d.ts +22 -1
- package/dist/tree.d.ts.map +1 -1
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-CQSEVeOT.d.ts → vertical-list-CFuFDygi.d.ts} +17 -14
- package/dist/vertical-list-CFuFDygi.d.ts.map +1 -0
- package/dist/vertical-list.d.ts +1 -1
- package/dist/vertical-list.js +59 -127
- package/dist/vertical-list.js.map +1 -1
- package/dist/{xy-axis-5KhVTNoX.d.ts → xy-axis-BfP9hKLj.d.ts} +25 -2
- package/dist/{xy-axis-5KhVTNoX.d.ts.map → xy-axis-BfP9hKLj.d.ts.map} +1 -1
- package/dist/{xy-axis-VrX8dmvS.js → xy-axis-DzM1brBZ.js} +141 -8
- package/dist/xy-axis-DzM1brBZ.js.map +1 -0
- package/docs-user/data-grid.md +19 -0
- package/docs-user/detail-list.md +1 -1
- package/docs-user/grid-list.md +120 -11
- package/docs-user/incr-search.md +12 -2
- package/docs-user/index.json +3 -3
- package/docs-user/led.md +37 -7
- package/docs-user/llms.txt +1 -1
- package/docs-user/panel.md +68 -13
- package/docs-user/titlebar.md +3 -4
- package/docs-user/tree.md +22 -1
- package/docs-user/vertical-list.md +7 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/dist/data-grid-BddUjAti.d.ts.map +0 -1
- package/dist/detail-list-Br0WAnry.d.ts.map +0 -1
- package/dist/element-search-Y8SRfPGM.js +0 -185
- package/dist/element-search-Y8SRfPGM.js.map +0 -1
- package/dist/grid-list-B_orPsot.d.ts.map +0 -1
- package/dist/grid-list.js.map +0 -1
- package/dist/incr-search-vCzuao-2.js +0 -137
- package/dist/incr-search-vCzuao-2.js.map +0 -1
- package/dist/index-Cu5i8zZY.d.ts +0 -160
- package/dist/index-Cu5i8zZY.d.ts.map +0 -1
- package/dist/list-selection-controller-CUo-Hhcm.js.map +0 -1
- package/dist/tree-B74zdI60.js.map +0 -1
- package/dist/vertical-list-CQSEVeOT.d.ts.map +0 -1
- package/dist/xy-axis-VrX8dmvS.js.map +0 -1
package/dist/data-grid.js
CHANGED
|
@@ -2,12 +2,14 @@ import { t as TickledController } from "./tickled-controller-C66DgJHl.js";
|
|
|
2
2
|
import { n as tickledStyles, t as tickledItemStyles } from "./tickled-styles-BrAHEj1q.js";
|
|
3
3
|
import { t as themeFallbacks } from "./fallbacks-DNI9xt0F.js";
|
|
4
4
|
import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
|
|
5
|
+
import { i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES } from "./incr-search-C05WjbZh.js";
|
|
5
6
|
import { i as listItemFadeKeyframes } from "./list-item-animation-DuiwgN3l.js";
|
|
6
7
|
import "./interaction-Cr13azbM.js";
|
|
7
8
|
import { t as createDragGhost } from "./drag-ghost-DtSDvjri.js";
|
|
8
9
|
import "./menu-Bg90Qr0B.js";
|
|
9
10
|
import { LitElement, css, html, nothing } from "lit";
|
|
10
11
|
import { property, query, state } from "lit/decorators.js";
|
|
12
|
+
import { createCommandRegistry } from "@clinth/ui-commands";
|
|
11
13
|
import { repeat } from "lit/directives/repeat.js";
|
|
12
14
|
//#region src/data-grid/data-grid.ts
|
|
13
15
|
let DataGridElement = class DataGridElement extends LitElement {
|
|
@@ -48,6 +50,8 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
48
50
|
this._sortedRows = [];
|
|
49
51
|
this._flat = [];
|
|
50
52
|
this._flatKeys = [];
|
|
53
|
+
this.#searchKeyByRow = /* @__PURE__ */ new Map();
|
|
54
|
+
this.search = new ListSearchController(this, { adapter: this.#createSearchAdapter() });
|
|
51
55
|
this.#prevFlatKeys = [];
|
|
52
56
|
this.#enteringRowKeys = /* @__PURE__ */ new Set();
|
|
53
57
|
this.#rowReflowTimer = 0;
|
|
@@ -253,6 +257,7 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
253
257
|
tickledStyles,
|
|
254
258
|
tickledItemStyles,
|
|
255
259
|
listItemFadeKeyframes,
|
|
260
|
+
listSearchStyles,
|
|
256
261
|
css`
|
|
257
262
|
:host {
|
|
258
263
|
--data-grid-row-height: 28px;
|
|
@@ -261,6 +266,7 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
261
266
|
--data-grid-header-bg: var(--surface-2);
|
|
262
267
|
--data-grid-border: var(--border);
|
|
263
268
|
--data-grid-header-text: var(--surface-3-text);
|
|
269
|
+
position: relative;
|
|
264
270
|
display: block;
|
|
265
271
|
overflow: hidden;
|
|
266
272
|
border: var(--data-grid-border);
|
|
@@ -354,6 +360,55 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
354
360
|
`
|
|
355
361
|
];
|
|
356
362
|
}
|
|
363
|
+
#searchRegistry;
|
|
364
|
+
#unregisterSearchCommands;
|
|
365
|
+
#searchKeyByRow;
|
|
366
|
+
/** Command registry carrying this grid's `list.search.*` commands. */
|
|
367
|
+
get registry() {
|
|
368
|
+
return this.#searchRegistry;
|
|
369
|
+
}
|
|
370
|
+
#rowSearchText(row) {
|
|
371
|
+
if (this.rowSearchText) return this.rowSearchText(row);
|
|
372
|
+
const rec = row;
|
|
373
|
+
return this._visibleColumns.map((c) => String(rec[c.key] ?? ``)).join(` `);
|
|
374
|
+
}
|
|
375
|
+
#createSearchAdapter() {
|
|
376
|
+
return {
|
|
377
|
+
getItems: () => {
|
|
378
|
+
this.#searchKeyByRow.clear();
|
|
379
|
+
this._sortedRows.forEach((r, i) => this.#searchKeyByRow.set(r, this.getRowKey(r, i)));
|
|
380
|
+
return this._sortedRows;
|
|
381
|
+
},
|
|
382
|
+
getLabel: (row) => this.#rowSearchText(row),
|
|
383
|
+
getKey: (row) => this.#searchKeyByRow.get(row) ?? String(this._sortedRows.indexOf(row)),
|
|
384
|
+
focusItem: (row) => {
|
|
385
|
+
if (row === void 0) return;
|
|
386
|
+
const key = this.#searchKeyByRow.get(row);
|
|
387
|
+
if (key !== void 0) this.tickleRow(key);
|
|
388
|
+
},
|
|
389
|
+
selectItems: (rows) => {
|
|
390
|
+
this.selectKeys(rows.map((r) => this.#searchKeyByRow.get(r)).filter((k) => k !== void 0));
|
|
391
|
+
},
|
|
392
|
+
applyFilter: (matched) => {
|
|
393
|
+
this.filterPredicate = matched === void 0 ? void 0 : (row) => {
|
|
394
|
+
const k = this.#searchKeyByRow.get(row);
|
|
395
|
+
return k === void 0 || matched.has(k);
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
#effectiveSearchModes() {
|
|
401
|
+
const raw = this.searchModes?.trim();
|
|
402
|
+
if (raw === void 0) return [...LIST_SEARCH_MODES];
|
|
403
|
+
const requested = new Set(raw.split(/\s+/));
|
|
404
|
+
return LIST_SEARCH_MODES.filter((m) => requested.has(m));
|
|
405
|
+
}
|
|
406
|
+
#syncSearchCommands() {
|
|
407
|
+
if (!this.#searchRegistry) return;
|
|
408
|
+
this.search.setModes(this.#effectiveSearchModes());
|
|
409
|
+
this.#unregisterSearchCommands?.();
|
|
410
|
+
this.#unregisterSearchCommands = registerListSearchCommands(this.#searchRegistry, this.search);
|
|
411
|
+
}
|
|
357
412
|
/** Row-key snapshot from the previous update, for the insertion / removal animation. */
|
|
358
413
|
#prevFlatKeys;
|
|
359
414
|
#enteringRowKeys;
|
|
@@ -366,17 +421,29 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
366
421
|
if (!this.hasAttribute(`tabindex`)) this.tabIndex = 0;
|
|
367
422
|
this.addEventListener(`keydown`, this._onKeyDown);
|
|
368
423
|
this.addEventListener(`focusout`, this._onFocusOut);
|
|
424
|
+
this.#searchRegistry ??= createCommandRegistry();
|
|
425
|
+
this.#syncSearchCommands();
|
|
369
426
|
}
|
|
370
427
|
disconnectedCallback() {
|
|
371
428
|
super.disconnectedCallback();
|
|
372
429
|
this.removeEventListener(`keydown`, this._onKeyDown);
|
|
373
430
|
this.removeEventListener(`focusout`, this._onFocusOut);
|
|
374
431
|
cancelAnimationFrame(this._raf);
|
|
432
|
+
this.#unregisterSearchCommands?.();
|
|
433
|
+
this.#unregisterSearchCommands = void 0;
|
|
434
|
+
this.#searchRegistry = void 0;
|
|
375
435
|
if (this.#rowReflowTimer) {
|
|
376
436
|
clearTimeout(this.#rowReflowTimer);
|
|
377
437
|
this.#rowReflowTimer = 0;
|
|
378
438
|
}
|
|
379
439
|
}
|
|
440
|
+
/**
|
|
441
|
+
* Dispatch a command to this grid — routes through the command registry so
|
|
442
|
+
* `list.search.*` (and any other registered commands) work.
|
|
443
|
+
*/
|
|
444
|
+
dispatch(commandId, args) {
|
|
445
|
+
this.#searchRegistry?.invoke(commandId, args);
|
|
446
|
+
}
|
|
380
447
|
firstUpdated() {
|
|
381
448
|
new ResizeObserver(() => {
|
|
382
449
|
if (!this._viewportEl) return;
|
|
@@ -402,6 +469,7 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
402
469
|
willUpdate(changed) {
|
|
403
470
|
super.willUpdate(changed);
|
|
404
471
|
this.setAttribute(`data-input-mode`, this._tickled.inputMode);
|
|
472
|
+
if (changed.has(`searchModes`)) this.#syncSearchCommands();
|
|
405
473
|
if (!this.#appendInProgress) {
|
|
406
474
|
if (changed.has(`rows`) || changed.has(`sortState`) || changed.has(`columns`) || changed.has(`groupBy`) || changed.has(`groupLabel`)) this._sortedRows = this._applySort([...this.rows]);
|
|
407
475
|
this._rebuildFlat();
|
|
@@ -456,18 +524,23 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
456
524
|
return String(this.groupBy(row));
|
|
457
525
|
}
|
|
458
526
|
_rebuildFlat() {
|
|
527
|
+
const filtered = this.filterPredicate !== void 0;
|
|
528
|
+
const source = filtered ? this._sortedRows.filter((r) => this.filterPredicate(r)) : this._sortedRows;
|
|
459
529
|
if (!this.groupBy) {
|
|
460
|
-
this._flat =
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
530
|
+
this._flat = source.map((r, i) => {
|
|
531
|
+
const idx = filtered ? this._sortedRows.indexOf(r) : i;
|
|
532
|
+
return {
|
|
533
|
+
type: `row`,
|
|
534
|
+
key: this.getRowKey(r, idx),
|
|
535
|
+
row: r,
|
|
536
|
+
idx
|
|
537
|
+
};
|
|
538
|
+
});
|
|
466
539
|
this._flatKeys = this._flat.map((f) => f.key);
|
|
467
540
|
return;
|
|
468
541
|
}
|
|
469
542
|
const groups = /* @__PURE__ */ new Map();
|
|
470
|
-
for (const r of
|
|
543
|
+
for (const r of source) {
|
|
471
544
|
const k = this._getGroupKey(r) ?? ``;
|
|
472
545
|
const arr = groups.get(k);
|
|
473
546
|
if (arr) arr.push(r);
|
|
@@ -1337,6 +1410,7 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
1337
1410
|
})}
|
|
1338
1411
|
</div>
|
|
1339
1412
|
</div>
|
|
1413
|
+
${this.search.renderField()}
|
|
1340
1414
|
</div>
|
|
1341
1415
|
`;
|
|
1342
1416
|
}
|
|
@@ -1380,6 +1454,13 @@ __decorate([property({
|
|
|
1380
1454
|
attribute: `column-menu`
|
|
1381
1455
|
})], DataGridElement.prototype, "columnMenu", void 0);
|
|
1382
1456
|
__decorate([property({ attribute: false })], DataGridElement.prototype, "globalFormatter", void 0);
|
|
1457
|
+
__decorate([property({ attribute: false })], DataGridElement.prototype, "filterPredicate", void 0);
|
|
1458
|
+
__decorate([property({ attribute: false })], DataGridElement.prototype, "rowSearchText", void 0);
|
|
1459
|
+
__decorate([property({
|
|
1460
|
+
type: String,
|
|
1461
|
+
attribute: `search-modes`,
|
|
1462
|
+
reflect: true
|
|
1463
|
+
})], DataGridElement.prototype, "searchModes", void 0);
|
|
1383
1464
|
__decorate([state()], DataGridElement.prototype, "_selectedKeys", void 0);
|
|
1384
1465
|
__decorate([state()], DataGridElement.prototype, "_scrollTop", void 0);
|
|
1385
1466
|
__decorate([state()], DataGridElement.prototype, "_scrollLeft", void 0);
|