@ixfx/components 0.11.4 → 0.11.5
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 +442 -120
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +2230 -538
- package/bundle/index.js.map +1 -1
- package/dist/ac-text.d.ts +1 -1
- package/dist/{ac-token-TCLAZeVg.d.ts → ac-token--_vCHXWw.d.ts} +2 -2
- package/dist/{ac-token-TCLAZeVg.d.ts.map → ac-token--_vCHXWw.d.ts.map} +1 -1
- package/dist/ac-token.d.ts +1 -1
- package/dist/{button-CTL45aBl.d.ts → button-BYuf72aR.d.ts} +2 -2
- package/dist/{button-CTL45aBl.d.ts.map → button-BYuf72aR.d.ts.map} +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/colour-picker.d.ts +1 -1
- package/dist/crumbs.d.ts +3 -3
- package/dist/{data-grid-CfiaBqTA.d.ts → data-grid-CPsJBnL4.d.ts} +48 -6
- package/dist/data-grid-CPsJBnL4.d.ts.map +1 -0
- package/dist/data-grid.d.ts +3 -3
- package/dist/data-grid.js +66 -2
- package/dist/data-grid.js.map +1 -1
- package/dist/{detail-list-DxQZkK-C.d.ts → detail-list-CmdCxddo.d.ts} +22 -5
- package/dist/detail-list-CmdCxddo.d.ts.map +1 -0
- package/dist/detail-list.d.ts +3 -3
- package/dist/detail-list.js +67 -4
- package/dist/detail-list.js.map +1 -1
- package/dist/{grid-list-k89JpiNy.js → grid-list-3fGhdaFA.js} +92 -7
- package/dist/grid-list-3fGhdaFA.js.map +1 -0
- package/dist/{grid-list-ChgYpUUq.d.ts → grid-list-D6AfWfwn.d.ts} +27 -4
- package/dist/grid-list-D6AfWfwn.d.ts.map +1 -0
- package/dist/grid-list.d.ts +2 -2
- package/dist/grid-list.js +1 -1
- package/dist/{grouped-item-lister-Bhyo-dkH.d.ts → grouped-item-lister-DETte0Dh.d.ts} +2 -2
- package/dist/{grouped-item-lister-Bhyo-dkH.d.ts.map → grouped-item-lister-DETte0Dh.d.ts.map} +1 -1
- package/dist/grouped-item-lister.d.ts +1 -1
- package/dist/{icon-DR_3rSyZ.d.ts → icon-CDGprSdE.d.ts} +2 -2
- package/dist/icon-CDGprSdE.d.ts.map +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/incr-search.d.ts +1 -1
- package/dist/{index-CHbuPyLL.d.ts → index-CMsmZ6Or.d.ts} +4 -4
- package/dist/{index-CHbuPyLL.d.ts.map → index-CMsmZ6Or.d.ts.map} +1 -1
- package/dist/{index-garxxqgV.d.ts → index-CYndvTWH.d.ts} +2 -2
- package/dist/{index-garxxqgV.d.ts.map → index-CYndvTWH.d.ts.map} +1 -1
- package/dist/{index-CDllxjVG.d.ts → index-CnyoNA6m.d.ts} +4 -4
- package/dist/{index-CDllxjVG.d.ts.map → index-CnyoNA6m.d.ts.map} +1 -1
- package/dist/{index-BUB5SICW.d.ts → index-CoqtMSd9.d.ts} +2 -2
- package/dist/{index-BUB5SICW.d.ts.map → index-CoqtMSd9.d.ts.map} +1 -1
- package/dist/{index-CJ5fshD3.d.ts → index-UvnoZUAo.d.ts} +2 -2
- package/dist/{index-CJ5fshD3.d.ts.map → index-UvnoZUAo.d.ts.map} +1 -1
- package/dist/{index-BOUaDIW-.d.ts → index-tq6f8007.d.ts} +2 -2
- package/dist/{index-BOUaDIW-.d.ts.map → index-tq6f8007.d.ts.map} +1 -1
- package/dist/index.d.ts +337 -140
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2036 -644
- package/dist/index.js.map +1 -1
- package/dist/item-appearance-BjcMyauw.js +31 -0
- package/dist/item-appearance-BjcMyauw.js.map +1 -0
- package/dist/{labelled-input-base-Dp_9KP0G.d.ts → labelled-input-base-DiTme1JO.d.ts} +2 -2
- package/dist/{labelled-input-base-Dp_9KP0G.d.ts.map → labelled-input-base-DiTme1JO.d.ts.map} +1 -1
- package/dist/labelled-radial-input.d.ts +2 -2
- package/dist/labelled-radial-input.d.ts.map +1 -1
- package/dist/labelled-range-input.d.ts +1 -1
- package/dist/labelled-slider-input.d.ts +1 -1
- package/dist/{list-native-drag-controller-B9reY4uM.d.ts → list-native-drag-controller-CllsHLxw.d.ts} +2 -2
- package/dist/{list-native-drag-controller-B9reY4uM.d.ts.map → list-native-drag-controller-CllsHLxw.d.ts.map} +1 -1
- package/dist/{menu-item-DlxAb0Xr.d.ts → menu-item-DT7bKAIw.d.ts} +2 -2
- package/dist/{menu-item-DlxAb0Xr.d.ts.map → menu-item-DT7bKAIw.d.ts.map} +1 -1
- package/dist/menu.d.ts +2 -2
- package/dist/miller.d.ts +3 -3
- package/dist/miller.d.ts.map +1 -1
- package/dist/miller.js +18 -2
- package/dist/miller.js.map +1 -1
- package/dist/panel.d.ts +1 -1
- package/dist/{split-layout-C5SYbDrq.d.ts → split-layout-JK3xWVX2.d.ts} +2 -2
- package/dist/{split-layout-C5SYbDrq.d.ts.map → split-layout-JK3xWVX2.d.ts.map} +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/{tab-list-v8mKX7Fu.d.ts → tab-list-pqfKaVAE.d.ts} +2 -2
- package/dist/{tab-list-v8mKX7Fu.d.ts.map → tab-list-pqfKaVAE.d.ts.map} +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/{titlebar-B5zSTZnF.d.ts → titlebar-Tqu-VvMU.d.ts} +2 -2
- package/dist/{titlebar-B5zSTZnF.d.ts.map → titlebar-Tqu-VvMU.d.ts.map} +1 -1
- package/dist/titlebar.d.ts +1 -1
- package/dist/{tree-component-CMGeqyjZ.d.ts → tree-component-DukLqesg.d.ts} +2 -2
- package/dist/{tree-component-CMGeqyjZ.d.ts.map → tree-component-DukLqesg.d.ts.map} +1 -1
- package/dist/tree.d.ts +4 -4
- package/dist/{types-3Jfcaxvo.d.ts → types-D-kYF16b.d.ts} +21 -1
- package/dist/types-D-kYF16b.d.ts.map +1 -0
- package/dist/{vertical-list-R25WqAVO.d.ts → vertical-list-DTp-UIUE.d.ts} +26 -3
- package/dist/vertical-list-DTp-UIUE.d.ts.map +1 -0
- package/dist/vertical-list.d.ts +2 -2
- package/dist/vertical-list.js +53 -4
- package/dist/vertical-list.js.map +1 -1
- package/docs-user/data-grid.md +51 -1
- package/docs-user/detail-list.md +46 -0
- package/docs-user/grid-list.md +49 -2
- package/docs-user/hyperbolic-tree.md +98 -18
- package/docs-user/index.json +2 -2
- package/docs-user/miller.md +52 -7
- package/docs-user/vertical-list.md +63 -0
- package/package.json +1 -1
- package/dist/data-grid-CfiaBqTA.d.ts.map +0 -1
- package/dist/detail-list-DxQZkK-C.d.ts.map +0 -1
- package/dist/grid-list-ChgYpUUq.d.ts.map +0 -1
- package/dist/grid-list-k89JpiNy.js.map +0 -1
- package/dist/icon-DR_3rSyZ.d.ts.map +0 -1
- package/dist/types-3Jfcaxvo.d.ts.map +0 -1
- package/dist/vertical-list-R25WqAVO.d.ts.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./icon-
|
|
1
|
+
import "./icon-CDGprSdE.js";
|
|
2
2
|
import { r as IDataProvider } from "./data-provider-BAn_-oR1.js";
|
|
3
|
-
import { F as ListDragPreviewSourceResolver, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent } from "./tree-component-
|
|
3
|
+
import { F as ListDragPreviewSourceResolver, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent } from "./tree-component-DukLqesg.js";
|
|
4
4
|
import { n as ListViewportChangeEvent } from "./list-viewport-types-BRZsLcvp.js";
|
|
5
|
-
import { S as ListSearchController } from "./index-
|
|
5
|
+
import { S as ListSearchController } from "./index-CMsmZ6Or.js";
|
|
6
6
|
import { i as ListInteractionMode, l as ListSelectionMode, r as ListElementEventMap } from "./list-selection-types-PjKdhF-a.js";
|
|
7
|
-
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-
|
|
7
|
+
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-DTp-UIUE.js";
|
|
8
8
|
import { LitElement, PropertyValues } from "lit";
|
|
9
9
|
import { CommandId, CommandRegistry } from "@clinth/ui-commands";
|
|
10
10
|
//#region src/detail-list/types.d.ts
|
|
@@ -51,6 +51,22 @@ declare class DetailListElement extends LitElement {
|
|
|
51
51
|
displayProperty: string;
|
|
52
52
|
formatter: DetailFormatter | undefined;
|
|
53
53
|
iconProperty: string;
|
|
54
|
+
/**
|
|
55
|
+
* Property on each `items` entry holding a CSS colour for the item's
|
|
56
|
+
* `<ixfx-icon>`. Only read when `iconProperty` also resolves an icon.
|
|
57
|
+
*/
|
|
58
|
+
iconColorProperty: string;
|
|
59
|
+
/**
|
|
60
|
+
* Property on each `items` entry holding a CSS colour for the item's caption
|
|
61
|
+
* text. Inline, so it wins over the selected/tickled text colours.
|
|
62
|
+
*/
|
|
63
|
+
textColorProperty: string;
|
|
64
|
+
/**
|
|
65
|
+
* Property on each `items` entry holding a Finder-style badge — a
|
|
66
|
+
* `TemplateResult`, a DOM `Node`, or anything Lit can render. Rendered
|
|
67
|
+
* right-justified on the row, after the caption.
|
|
68
|
+
*/
|
|
69
|
+
badgeProperty: string;
|
|
54
70
|
keyProperty: string;
|
|
55
71
|
filterPredicate: ((el: Element) => boolean) | undefined;
|
|
56
72
|
/**
|
|
@@ -165,6 +181,7 @@ declare class DetailListElement extends LitElement {
|
|
|
165
181
|
*/
|
|
166
182
|
fitColumnWidth(): Promise<number>;
|
|
167
183
|
private _isCheckable;
|
|
184
|
+
/** Appends the caption span; returns it so callers can style it per item. */
|
|
168
185
|
private _setLabel;
|
|
169
186
|
private _syncItemStates;
|
|
170
187
|
private _syncCheckboxes;
|
|
@@ -202,4 +219,4 @@ interface DetailListElementEventMap extends ListElementEventMap {
|
|
|
202
219
|
}
|
|
203
220
|
//#endregion
|
|
204
221
|
export { DetailSortItem as a, DetailSortComparator as i, DetailListElementEventMap as n, DetailSortMode as o, DetailFormatter as r, DetailListElement as t };
|
|
205
|
-
//# sourceMappingURL=detail-list-
|
|
222
|
+
//# sourceMappingURL=detail-list-CmdCxddo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-list-CmdCxddo.d.ts","names":[],"sources":["../src/detail-list/types.ts","../src/detail-list/detail-list.ts"],"mappings":";;;;;;;;;;;KACY;;KAGA;WACD,SAAS;WACT;WACA;;;KAIC,wBAAwB,GAAG,gBAAgB,GAAG;;KAG9C,mBAAmB,eAAe,2BAA2B;;;;;;;;;;;;;;;;;;;;cC+H5D,0BAA0B;;EAErC,eAAe;EAGf,iBAAiB;EAGjB,MAAM;EAGN;EAGA,gBAAgB;EAGhB;EAGA,UAAU;EAGV;EAGA,WAAW;EAGX;;;;;EAOA;;;;;EAOA;;;;;;EAQA;EAGA;EAGA,mBAAmB,IAAI;;;;;;EAQvB;;EAIA,oBAAoB,gCAAgC;;;;;;EAQpD;;;;;;EAQA;;;;;EAOA,qBAAqB,wBAAwB;EAG7C,mBAAmB,8BAA8B;UAGzC;mBAoBS;UAeT;UAyFA;;WAkGC,QAAM,qBAAA;;MAYX,YAAY;EAoBP;EA8DA;EA2BA;EASA,QAAQ,SAAS;;MAuDtB,gBAAgB;;MAKhB,iBAAiB,YAAY;;;;;;EASjC;EAIA,QAAQ,MAAM,kBAAkB,UAAU;;;;;EAuB1C,WAAW,MAAM,UAAU;;EAW3B,YAAY,OAAO,SAAS,WAAW;EAIvC;;;;;EAYA,SAAS,gBAAgB;;;;;EAgBzB,YAAY,MAAM;;;;;;;;;;EAalB;;;;;;EAsBA,SAAS,WAAW,WAAW,OAAO;EAItC,OAAO,MAAM;EAIb,WAAW,OAAO,SAAS;EAI3B,SAAS,MAAM;EAIf;EAIA;;MAQI,gBAAgB;;MAKhB;;EAMJ,WAAW,MAAM;;EAKjB,gBAAgB,MAAM;;EAKtB,mBAAmB,MAAM;;EAKzB,SAAS;EAgBP,eAAe,0CAA0C,UAAU;UA0b7D;;;;;;;;;EAkBF,kBAAkB;UAwBhB;;UAOA;UA2DA;UAiBA;;;;;;;UA2DA;;UAoBA;UAcA;UAYA;UAQA;UA6DA;UAMA;UAIA;UA4EA;UAWA;UAMA;UAUA;SAUQ,sBAAM;EAqJb,wBAAM;;QAsBT;YACI;IACR,oBAAoB;;YAGZ,4BAA4B;;UAGvB,kCAAkC;EACjD,+BAA+B;EAC/B,0BAA0B,yBAAyB"}
|
package/dist/detail-list.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as ListDragSource, L as ListNativeDragStartDetail, M as ListDragPreview, N as ListDragPreviewContext, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent, j as ListDragEntry } from "./tree-component-
|
|
1
|
+
import { I as ListDragSource, L as ListNativeDragStartDetail, M as ListDragPreview, N as ListDragPreviewContext, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent, j as ListDragEntry } from "./tree-component-DukLqesg.js";
|
|
2
2
|
import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
|
|
3
|
-
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-
|
|
4
|
-
import { a as DetailSortItem, i as DetailSortComparator, n as DetailListElementEventMap, o as DetailSortMode, r as DetailFormatter, t as DetailListElement } from "./detail-list-
|
|
3
|
+
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-DTp-UIUE.js";
|
|
4
|
+
import { a as DetailSortItem, i as DetailSortComparator, n as DetailListElementEventMap, o as DetailSortMode, r as DetailFormatter, t as DetailListElement } from "./detail-list-CmdCxddo.js";
|
|
5
5
|
export { type AddItemOptions, type CustomCheckboxOptions, type DetailFormatter, DetailListElement, DetailListElementEventMap, type DetailSortComparator, type DetailSortItem, type DetailSortMode, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListViewportChangeDetail, type ListViewportChangeEvent };
|
package/dist/detail-list.js
CHANGED
|
@@ -8,6 +8,7 @@ import { t as ListNativeDragController } from "./list-native-drag-controller-B9x
|
|
|
8
8
|
import { r as ListDragSelectController, t as ListSelectionController } from "./list-selection-controller-SA4piSBi.js";
|
|
9
9
|
import { n as animateListItemIn, r as animateListItemOut } from "./list-item-animation-BUoEKi5s.js";
|
|
10
10
|
import { t as scrollFadeStyles } from "./scroll-fade-BrNUIYnm.js";
|
|
11
|
+
import { n as appearanceColor, t as appearanceAbsent } from "./item-appearance-BjcMyauw.js";
|
|
11
12
|
import { LitElement, css, html, nothing, render } from "lit";
|
|
12
13
|
import { property, query } from "lit/decorators.js";
|
|
13
14
|
import { createCommandRegistry } from "@clinth/ui-commands";
|
|
@@ -15,6 +16,14 @@ import { createCommandRegistry } from "@clinth/ui-commands";
|
|
|
15
16
|
const ITEM_SELECTOR = `:scope > li`;
|
|
16
17
|
const SEARCH_HIGHLIGHT_KEY = `detail-list-search`;
|
|
17
18
|
const LABEL_SPAN_CSS = `overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0`;
|
|
19
|
+
/**
|
|
20
|
+
* Layout for the per-item badge wrapper `#ensureBadge` adds. Applied as inline
|
|
21
|
+
* `cssText` rather than shadow CSS because `::slotted()` only matches the
|
|
22
|
+
* host's *direct* children — the badge lives inside a slotted `<li>`, so a
|
|
23
|
+
* `::slotted()` rule could never reach it. The values still read the CSS
|
|
24
|
+
* custom property, so it stays themeable from the outside.
|
|
25
|
+
*/
|
|
26
|
+
const BADGE_EL_CSS = `flex-shrink:0;display:inline-flex;align-items:center;margin-inline-start:auto;padding-inline-start:var(--detail-list-badge-gap,8px)`;
|
|
18
27
|
function pointInRect(x, y, rect) {
|
|
19
28
|
return rect.width > 0 && rect.height > 0 && x >= rect.left && x < rect.right && y >= rect.top && y < rect.bottom;
|
|
20
29
|
}
|
|
@@ -48,6 +57,9 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
48
57
|
this.items = [];
|
|
49
58
|
this.displayProperty = ``;
|
|
50
59
|
this.iconProperty = ``;
|
|
60
|
+
this.iconColorProperty = ``;
|
|
61
|
+
this.textColorProperty = ``;
|
|
62
|
+
this.badgeProperty = ``;
|
|
51
63
|
this.keyProperty = ``;
|
|
52
64
|
this.itemWrap = `stop`;
|
|
53
65
|
this.itemsDraggable = false;
|
|
@@ -249,7 +261,8 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
249
261
|
};
|
|
250
262
|
this._onWheel = (e) => {
|
|
251
263
|
e.preventDefault();
|
|
252
|
-
|
|
264
|
+
const delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY;
|
|
265
|
+
this._listEl.scrollLeft += delta;
|
|
253
266
|
};
|
|
254
267
|
}
|
|
255
268
|
#itemData;
|
|
@@ -454,7 +467,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
454
467
|
});
|
|
455
468
|
return;
|
|
456
469
|
}
|
|
457
|
-
if (changed.has(`items`) && this.provider === void 0 && this.items.length > 0) this.#rebuildFromObjects(this.items);
|
|
470
|
+
if ((changed.has(`items`) || changed.has(`displayProperty`) || changed.has(`formatter`) || changed.has(`iconProperty`) || changed.has(`iconColorProperty`) || changed.has(`textColorProperty`) || changed.has(`badgeProperty`) || changed.has(`keyProperty`)) && this.provider === void 0 && this.items.length > 0) this.#rebuildFromObjects(this.items);
|
|
458
471
|
this.#syncFromProvider();
|
|
459
472
|
if (changed.has(`sort`) || changed.has(`sortBy`) || changed.has(`sortComparator`)) this.#applySort();
|
|
460
473
|
if (changed.has(`filterPredicate`)) {
|
|
@@ -659,24 +672,36 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
659
672
|
const li = document.createElement(`li`);
|
|
660
673
|
this.#itemData.set(li, item);
|
|
661
674
|
const content = this.formatter ? this.formatter(item, index) : this.displayProperty ? this.#propertyValue(item, this.displayProperty) : item;
|
|
675
|
+
const textColor = this.#colorValue(item, this.textColorProperty);
|
|
676
|
+
const iconColor = this.#colorValue(item, this.iconColorProperty);
|
|
677
|
+
if (iconColor !== void 0) li.setAttribute(`data-icon-color`, iconColor);
|
|
662
678
|
if (typeof content === `string`) {
|
|
663
|
-
this._setLabel(li, content);
|
|
679
|
+
const span = this._setLabel(li, content);
|
|
680
|
+
if (textColor !== void 0) span.style.color = textColor;
|
|
664
681
|
if (this.iconProperty) {
|
|
665
682
|
const icon = this.#propertyValue(item, this.iconProperty);
|
|
666
683
|
if (typeof icon === `string` && icon.length > 0) li.setAttribute(`data-icon`, icon);
|
|
667
684
|
}
|
|
668
|
-
} else if (content instanceof Node)
|
|
685
|
+
} else if (content instanceof Node) {
|
|
686
|
+
li.appendChild(content);
|
|
687
|
+
if (textColor !== void 0) li.style.color = textColor;
|
|
688
|
+
}
|
|
669
689
|
if (this.keyProperty) {
|
|
670
690
|
const key = this.#propertyValue(item, this.keyProperty);
|
|
671
691
|
if (key !== void 0 && key !== null) li.setAttribute(`data-key`, String(key));
|
|
672
692
|
}
|
|
673
693
|
this.#ensureIcon(li);
|
|
694
|
+
this.#ensureBadge(li, this.#propertyValue(item, this.badgeProperty));
|
|
674
695
|
return li;
|
|
675
696
|
}
|
|
676
697
|
#propertyValue(item, prop) {
|
|
677
698
|
if (typeof item !== `object` || item === null || !(prop in item)) return void 0;
|
|
678
699
|
return item[prop];
|
|
679
700
|
}
|
|
701
|
+
/** A non-empty string from `item[prop]`, else `undefined`. */
|
|
702
|
+
#colorValue(item, prop) {
|
|
703
|
+
return prop ? appearanceColor(this.#propertyValue(item, prop)) : void 0;
|
|
704
|
+
}
|
|
680
705
|
#syncFromProvider() {
|
|
681
706
|
if (this.provider === void 0) return;
|
|
682
707
|
const items = this.#data.items;
|
|
@@ -934,12 +959,14 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
934
959
|
if (this.interactionMode !== `checked`) return true;
|
|
935
960
|
return !item.hasAttribute(`not-checked`);
|
|
936
961
|
}
|
|
962
|
+
/** Appends the caption span; returns it so callers can style it per item. */
|
|
937
963
|
_setLabel(li, label) {
|
|
938
964
|
const span = document.createElement(`span`);
|
|
939
965
|
span.style.cssText = LABEL_SPAN_CSS;
|
|
940
966
|
span.textContent = label;
|
|
941
967
|
li.appendChild(span);
|
|
942
968
|
li.setAttribute(`data-search-label`, label);
|
|
969
|
+
return span;
|
|
943
970
|
}
|
|
944
971
|
/**
|
|
945
972
|
* Inject a leading `<ixfx-icon>` into an item carrying `data-icon`.
|
|
@@ -953,8 +980,28 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
953
980
|
icon.setAttribute(`name`, name);
|
|
954
981
|
icon.style.marginInlineEnd = `var(--detail-list-icon-gap, 6px)`;
|
|
955
982
|
icon.style.flexShrink = `0`;
|
|
983
|
+
const color = li.getAttribute(`data-icon-color`);
|
|
984
|
+
if (color) icon.style.color = color;
|
|
956
985
|
li.prepend(icon);
|
|
957
986
|
}
|
|
987
|
+
/**
|
|
988
|
+
* Append a right-justified Finder-style badge. `badge` may be a DOM `Node`
|
|
989
|
+
* or anything Lit can render (typically a `TemplateResult`). Idempotent —
|
|
990
|
+
* a second call replaces the existing badge.
|
|
991
|
+
*/
|
|
992
|
+
#ensureBadge(li, badge) {
|
|
993
|
+
if (appearanceAbsent(badge)) return;
|
|
994
|
+
let holder = li.querySelector(`:scope > .item-badge`);
|
|
995
|
+
if (!holder) {
|
|
996
|
+
holder = document.createElement(`span`);
|
|
997
|
+
holder.className = `item-badge`;
|
|
998
|
+
holder.style.cssText = BADGE_EL_CSS;
|
|
999
|
+
li.appendChild(holder);
|
|
1000
|
+
}
|
|
1001
|
+
holder.replaceChildren();
|
|
1002
|
+
if (badge instanceof Node) holder.appendChild(badge);
|
|
1003
|
+
else render(badge, holder);
|
|
1004
|
+
}
|
|
958
1005
|
/** Scan light-DOM children for unprocessed `data-icon` items. */
|
|
959
1006
|
#processChildren() {
|
|
960
1007
|
for (const el of this.querySelectorAll(ITEM_SELECTOR)) this.#ensureIcon(el);
|
|
@@ -1228,6 +1275,10 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
1228
1275
|
opacity: 0.6;
|
|
1229
1276
|
}
|
|
1230
1277
|
|
|
1278
|
+
/* Per-item icon / badge (adapter mode) are styled inline by
|
|
1279
|
+
#ensureBadge — ::slotted() only reaches the host's direct children,
|
|
1280
|
+
and these spans live inside a slotted <li>. */
|
|
1281
|
+
|
|
1231
1282
|
/* checked mode: the injected checkbox communicates selection — suppress bg */
|
|
1232
1283
|
:host([interaction-mode="checked"]) ::slotted([data-selected]) {
|
|
1233
1284
|
background: transparent;
|
|
@@ -1302,6 +1353,18 @@ __decorate([property({
|
|
|
1302
1353
|
type: String,
|
|
1303
1354
|
attribute: `icon-property`
|
|
1304
1355
|
})], DetailListElement.prototype, "iconProperty", void 0);
|
|
1356
|
+
__decorate([property({
|
|
1357
|
+
type: String,
|
|
1358
|
+
attribute: `icon-color-property`
|
|
1359
|
+
})], DetailListElement.prototype, "iconColorProperty", void 0);
|
|
1360
|
+
__decorate([property({
|
|
1361
|
+
type: String,
|
|
1362
|
+
attribute: `text-color-property`
|
|
1363
|
+
})], DetailListElement.prototype, "textColorProperty", void 0);
|
|
1364
|
+
__decorate([property({
|
|
1365
|
+
type: String,
|
|
1366
|
+
attribute: `badge-property`
|
|
1367
|
+
})], DetailListElement.prototype, "badgeProperty", void 0);
|
|
1305
1368
|
__decorate([property({
|
|
1306
1369
|
type: String,
|
|
1307
1370
|
attribute: `key-property`
|