@aquera/nile-elements 1.7.2 → 1.7.4
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 +4 -0
- package/dist/index-199b0eac.esm.js +1 -0
- package/dist/index-f5e587e2.cjs.js +2 -0
- package/dist/index-f5e587e2.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1203 -768
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js +1 -1
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js.map +1 -1
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.esm.js +8 -6
- package/dist/nile-combobox/group-utils.cjs.js +2 -0
- package/dist/nile-combobox/group-utils.cjs.js.map +1 -0
- package/dist/nile-combobox/group-utils.esm.js +1 -0
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/index.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js.map +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js.map +1 -1
- package/dist/nile-combobox/nile-combobox.css.esm.js +77 -4
- package/dist/nile-combobox/nile-combobox.esm.js +27 -22
- package/dist/nile-combobox/renderer.cjs.js +1 -1
- package/dist/nile-combobox/renderer.cjs.js.map +1 -1
- package/dist/nile-combobox/renderer.esm.js +84 -42
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/index.esm.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js.map +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -1
- package/dist/nile-detail/nile-detail.css.esm.js +230 -0
- package/dist/nile-detail/nile-detail.esm.js +89 -7
- package/dist/nile-floating-panel/index.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.esm.js +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.esm.js +2 -1
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +4 -2
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -1
- package/dist/src/nile-combobox/group-utils.d.ts +26 -0
- package/dist/src/nile-combobox/group-utils.js +140 -0
- package/dist/src/nile-combobox/group-utils.js.map +1 -0
- package/dist/src/nile-combobox/nile-combobox.css.js +77 -4
- package/dist/src/nile-combobox/nile-combobox.css.js.map +1 -1
- package/dist/src/nile-combobox/nile-combobox.d.ts +33 -0
- package/dist/src/nile-combobox/nile-combobox.js +171 -34
- package/dist/src/nile-combobox/nile-combobox.js.map +1 -1
- package/dist/src/nile-combobox/renderer.d.ts +4 -0
- package/dist/src/nile-combobox/renderer.js +71 -2
- package/dist/src/nile-combobox/renderer.js.map +1 -1
- package/dist/src/nile-combobox/types.d.ts +30 -0
- package/dist/src/nile-combobox/types.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.css.js +230 -0
- package/dist/src/nile-detail/nile-detail.css.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.d.ts +151 -0
- package/dist/src/nile-detail/nile-detail.js +829 -4
- package/dist/src/nile-detail/nile-detail.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.js +2 -1
- package/dist/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.ts +4 -2
- package/src/nile-combobox/group-utils.ts +157 -0
- package/src/nile-combobox/nile-combobox.css.ts +77 -4
- package/src/nile-combobox/nile-combobox.ts +223 -70
- package/src/nile-combobox/renderer.ts +119 -2
- package/src/nile-combobox/types.ts +36 -0
- package/src/nile-detail/nile-detail.css.ts +230 -0
- package/src/nile-detail/nile-detail.ts +876 -4
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts +1 -1
- package/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.ts +2 -1
- package/vscode-html-custom-data.json +126 -2
|
@@ -9,6 +9,75 @@ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
10
|
import { repeat } from 'lit/directives/repeat.js';
|
|
11
11
|
export class ComboboxRenderer {
|
|
12
|
+
static renderGroupHeader(row) {
|
|
13
|
+
return html `
|
|
14
|
+
<div
|
|
15
|
+
part="group-header"
|
|
16
|
+
class="combobox__group-header"
|
|
17
|
+
role="presentation"
|
|
18
|
+
data-group-id=${row.id}
|
|
19
|
+
style=${`--group-depth:${row.depth}`}
|
|
20
|
+
>
|
|
21
|
+
${row.prefix
|
|
22
|
+
? html `<nile-icon
|
|
23
|
+
class="combobox__group-prefix"
|
|
24
|
+
name=${row.prefix}
|
|
25
|
+
size="14"
|
|
26
|
+
method="fill"
|
|
27
|
+
></nile-icon>`
|
|
28
|
+
: ''}
|
|
29
|
+
<span class="combobox__group-label">${row.label}</span>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
static renderRowsPlain(rows, value, multiple, getDisplayText, getItemValue, showNoResults, noResultsMessage, isLoading, onScroll, allowHtmlLabel, getItemDescription, getItemPrefix, getItemSuffix, enableDescription, noResultsSubtitle) {
|
|
34
|
+
if (showNoResults && !isLoading && rows.length === 0) {
|
|
35
|
+
return ComboboxRenderer.renderNoResults(noResultsMessage, noResultsSubtitle);
|
|
36
|
+
}
|
|
37
|
+
return html `
|
|
38
|
+
<div
|
|
39
|
+
part="select-options"
|
|
40
|
+
class="combobox__options ${isLoading ? 'loading' : ''}"
|
|
41
|
+
>
|
|
42
|
+
<div class="combobox__options-plain" @scroll=${onScroll}>
|
|
43
|
+
${rows.map((row) => row.kind === 'header'
|
|
44
|
+
? ComboboxRenderer.renderGroupHeader(row)
|
|
45
|
+
: ComboboxRenderer.renderItem(row.item, value, multiple, getDisplayText, getItemValue, allowHtmlLabel, getItemDescription, getItemPrefix, getItemSuffix, enableDescription))}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
static renderRowsVirtualized(virtualItems, totalSize, rows, value, multiple, getDisplayText, getItemValue, isLoading, allowHtmlLabel, getItemDescription, getItemPrefix, getItemSuffix, enableDescription) {
|
|
51
|
+
return html `
|
|
52
|
+
<div
|
|
53
|
+
part="select-options"
|
|
54
|
+
class="combobox__options ${isLoading ? 'loading' : ''}"
|
|
55
|
+
>
|
|
56
|
+
<div style="position:relative;height:${totalSize}px;width:100%;">
|
|
57
|
+
${repeat(virtualItems, (vItem) => vItem.key, (vItem) => {
|
|
58
|
+
const row = rows[vItem.index];
|
|
59
|
+
if (!row)
|
|
60
|
+
return html ``;
|
|
61
|
+
const posStyle = `position:absolute;top:0;left:0;right:0;` +
|
|
62
|
+
`transform:translateY(${vItem.start}px);` +
|
|
63
|
+
`height:${vItem.size}px;`;
|
|
64
|
+
if (row.kind === 'header') {
|
|
65
|
+
return html `
|
|
66
|
+
<div style=${posStyle} class="combobox__group-header-slot">
|
|
67
|
+
${ComboboxRenderer.renderGroupHeader(row)}
|
|
68
|
+
</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
return html `
|
|
72
|
+
<div style=${posStyle}>
|
|
73
|
+
${ComboboxRenderer.renderItem(row.item, value, multiple, getDisplayText, getItemValue, allowHtmlLabel, getItemDescription, getItemPrefix, getItemSuffix, enableDescription)}
|
|
74
|
+
</div>
|
|
75
|
+
`;
|
|
76
|
+
})}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
12
81
|
static renderVirtualizedOptions(virtualItems, totalSize, data, value, multiple, getDisplayText, getItemValue, isLoading, allowHtmlLabel, measureElement, getItemDescription, getItemPrefix, getItemSuffix, enableDescription) {
|
|
13
82
|
const offsetTop = virtualItems.length > 0 ? virtualItems[0].start : 0;
|
|
14
83
|
return html `
|
|
@@ -20,7 +89,7 @@ export class ComboboxRenderer {
|
|
|
20
89
|
<div style="position:absolute;top:0;left:0;width:100%;transform:translateY(${offsetTop}px);">
|
|
21
90
|
${repeat(virtualItems, (vItem) => vItem.key, (vItem) => {
|
|
22
91
|
const item = data[vItem.index];
|
|
23
|
-
return ComboboxRenderer.renderMeasuredItem(item, vItem.index, value, multiple, getDisplayText, getItemValue, allowHtmlLabel,
|
|
92
|
+
return ComboboxRenderer.renderMeasuredItem(item, vItem.index, value, multiple, getDisplayText, getItemValue, allowHtmlLabel, getItemDescription, getItemPrefix, getItemSuffix, enableDescription);
|
|
24
93
|
})}
|
|
25
94
|
</div>
|
|
26
95
|
</div>
|
|
@@ -67,7 +136,7 @@ export class ComboboxRenderer {
|
|
|
67
136
|
</div>
|
|
68
137
|
`;
|
|
69
138
|
}
|
|
70
|
-
static renderMeasuredItem(item, index, value, multiple, getDisplayText, getItemValue, allowHtmlLabel,
|
|
139
|
+
static renderMeasuredItem(item, index, value, multiple, getDisplayText, getItemValue, allowHtmlLabel, getItemDescription, getItemPrefix, getItemSuffix, enableDescription) {
|
|
71
140
|
if (!item)
|
|
72
141
|
return html ``;
|
|
73
142
|
const optionValue = getItemValue(item);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/nile-combobox/renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,MAAM,OAAO,gBAAgB;IAE3B,MAAM,CAAC,wBAAwB,CAC7B,YAA2B,EAC3B,SAAiB,EACjB,IAAW,EACX,KAAwB,EACxB,QAAiB,EACjB,cAAqC,EACrC,YAAmC,EACnC,SAAkB,EAClB,cAAuB,EACvB,cAA4C,EAC5C,kBAA0C,EAC1C,aAAqC,EACrC,aAAqC,EACrC,iBAA2B;QAE3B,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtE,OAAO,IAAI,CAAA;;;mCAGoB,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;;+CAEd,SAAS;uFAC+B,SAAS;cAClF,MAAM,CACN,YAAY,EACZ,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EACpB,CAAC,KAAK,EAAE,EAAE;YACR,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC/B,OAAO,gBAAgB,CAAC,kBAAkB,CACxC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,Q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AAM,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, type TemplateResult } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { VirtualItem } from '@tanstack/virtual-core';\n\nexport class ComboboxRenderer {\n\n static renderVirtualizedOptions(\n virtualItems: VirtualItem[],\n totalSize: number,\n data: any[],\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n isLoading: boolean,\n allowHtmlLabel: boolean,\n measureElement: (el: Element | null) => void,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n ): TemplateResult {\n const offsetTop = virtualItems.length > 0 ? virtualItems[0].start : 0;\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div style=\"position:relative;height:${totalSize}px;width:100%;\">\n <div style=\"position:absolute;top:0;left:0;width:100%;transform:translateY(${offsetTop}px);\">\n ${repeat(\n virtualItems,\n (vItem) => vItem.key,\n (vItem) => {\n const item = data[vItem.index];\n return ComboboxRenderer.renderMeasuredItem(\n item, vItem.index, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, measureElement, getItemDescription, getItemPrefix,\n getItemSuffix, enableDescription,\n );\n },\n )}\n </div>\n </div>\n </div>\n `;\n }\n\n static renderPlainOptions(\n data: any[],\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n showNoResults: boolean,\n noResultsMessage: string,\n isLoading: boolean,\n onScroll: (e: Event) => void,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n noResultsSubtitle?: string,\n ): TemplateResult {\n if (showNoResults && !isLoading && data.length === 0) {\n return ComboboxRenderer.renderNoResults(noResultsMessage, noResultsSubtitle);\n }\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div class=\"combobox__options-plain\" @scroll=${onScroll}>\n ${data.map((item: any) =>\n ComboboxRenderer.renderItem(\n item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix, enableDescription,\n ),\n )}\n </div>\n </div>\n `;\n }\n\n static renderNoResults(noResultsMessage: string, noResultsSubtitle?: string): TemplateResult {\n return html`\n <div part=\"select-options\" class=\"combobox__options\">\n <div part=\"no-results\" class=\"combobox__no-results\">\n <div part=\"no-results-title\" class=\"combobox__no-results-title\">\n ${noResultsMessage || 'No result found'}\n </div>\n ${noResultsSubtitle\n ? html`<div part=\"no-results-subtitle\" class=\"combobox__no-results-subtitle\">${noResultsSubtitle}</div>`\n : ''}\n </div>\n </div>\n `;\n }\n\n static renderNoData(noDataMessage: string): TemplateResult {\n return html`\n <div part=\"select-options\" class=\"combobox__options\">\n <div part=\"no-data\" class=\"combobox__no-results\">\n <div part=\"no-data-title\" class=\"combobox__no-results-title\">\n ${noDataMessage || 'No data available'}\n </div>\n </div>\n </div>\n `;\n }\n\n private static renderMeasuredItem(\n item: any,\n index: number,\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n allowHtmlLabel: boolean,\n measureElement: (el: Element | null) => void,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n ): TemplateResult {\n if (!item) return html``;\n\n const optionValue = getItemValue(item);\n const displayText = getDisplayText(item);\n const isDisabled = item?.disabled || false;\n const className = item?.className;\n const description = getItemDescription ? getItemDescription(item) : (item?.description ?? '');\n const prefix = getItemPrefix ? getItemPrefix(item) : (item?.prefix ?? '');\n const suffix = getItemSuffix ? getItemSuffix(item) : (item?.suffix ?? '');\n\n let isSelected = false;\n if (multiple) {\n isSelected = Array.isArray(value) && value.some(v => String(v) === String(optionValue));\n } else {\n isSelected = String(Array.isArray(value) ? value[0] : value) === String(optionValue);\n }\n\n return html`\n <nile-option\n data-index=${index}\n value=${optionValue}\n .selected=${isSelected}\n .disabled=${isDisabled}\n .showCheckbox=${multiple}\n class=${classMap({\n option: enableDescription ?? false,\n [className ?? '']: !!className,\n })}\n .description=${description}\n .isDescriptionEnabled=${enableDescription}\n >\n ${unsafeHTML(prefix)}\n ${allowHtmlLabel ? unsafeHTML(displayText) : displayText}\n ${unsafeHTML(suffix)}\n </nile-option>\n `;\n }\n\n static renderItem(\n item: any,\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n ): TemplateResult {\n if (!item) return html``;\n\n const optionValue = getItemValue(item);\n const displayText = getDisplayText(item);\n const isDisabled = item?.disabled || false;\n const className = item?.className;\n const description = getItemDescription ? getItemDescription(item) : (item?.description ?? '');\n const prefix = getItemPrefix ? getItemPrefix(item) : (item?.prefix ?? '');\n const suffix = getItemSuffix ? getItemSuffix(item) : (item?.suffix ?? '');\n\n let isSelected = false;\n if (multiple) {\n isSelected = Array.isArray(value) && value.some(v => String(v) === String(optionValue));\n } else {\n isSelected = String(Array.isArray(value) ? value[0] : value) === String(optionValue);\n }\n\n return html`\n <nile-option\n value=${optionValue}\n .selected=${isSelected}\n .disabled=${isDisabled}\n .showCheckbox=${multiple}\n class=${classMap({\n option: enableDescription ?? false,\n [className ?? '']: !!className,\n })}\n .description=${description}\n .isDescriptionEnabled=${enableDescription}\n >\n ${unsafeHTML(prefix)}\n ${allowHtmlLabel ? unsafeHTML(displayText) : displayText}\n ${unsafeHTML(suffix)}\n </nile-option>\n `;\n }\n\n static renderVirtualizedGrid(\n virtualItems: VirtualItem[],\n totalSize: number,\n data: any[],\n value: string | string[],\n multiple: boolean,\n gridColumns: number,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n isLoading: boolean,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n gridColumnWidth?: number,\n ): TemplateResult {\n const offsetTop = virtualItems.length > 0 ? virtualItems[0].start : 0;\n const colTemplate = gridColumnWidth\n ? `repeat(${gridColumns}, ${gridColumnWidth}px)`\n : `repeat(${gridColumns}, 1fr)`;\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div style=\"position:relative;height:${totalSize}px;width:${gridColumnWidth ? 'max-content' : '100%'};min-width:100%;\">\n <div style=\"position:absolute;top:0;left:0;width:${gridColumnWidth ? 'max-content' : '100%'};min-width:100%;transform:translateY(${offsetTop}px);\">\n ${repeat(\n virtualItems,\n (vItem) => vItem.key,\n (vItem) => {\n const rowStart = vItem.index * gridColumns;\n const rowItems = data.slice(rowStart, rowStart + gridColumns);\n return html`\n <div class=\"combobox__grid-row\" style=\"display:grid;grid-template-columns:${colTemplate};gap:4px;\">\n ${rowItems.map((item: any) =>\n ComboboxRenderer.renderItem(\n item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix,\n ),\n )}\n </div>\n `;\n },\n )}\n </div>\n </div>\n </div>\n `;\n }\n\n static renderHorizontalGrid(\n virtualItems: VirtualItem[],\n totalSize: number,\n data: any[],\n value: string | string[],\n multiple: boolean,\n gridRows: number,\n gridColumnWidth: number,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n isLoading: boolean,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n ): TemplateResult {\n const offsetLeft = virtualItems.length > 0 ? virtualItems[0].start : 0;\n const rowHeight = 38;\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options combobox__options--horizontal ${isLoading ? 'loading' : ''}\"\n >\n <div style=\"position:relative;width:${totalSize}px;height:${rowHeight * gridRows}px;\">\n <div style=\"position:absolute;top:0;left:0;height:100%;display:flex;transform:translateX(${offsetLeft}px);\">\n ${repeat(\n virtualItems,\n (vCol) => vCol.key,\n (vCol) => {\n const colStart = vCol.index * gridRows;\n const colItems = data.slice(colStart, colStart + gridRows);\n return html`\n <div class=\"combobox__grid-col\" style=\"width:${gridColumnWidth}px;flex-shrink:0;display:flex;flex-direction:column;\">\n ${colItems.map((item: any) =>\n ComboboxRenderer.renderItem(\n item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix,\n ),\n )}\n </div>\n `;\n },\n )}\n </div>\n </div>\n </div>\n `;\n }\n\n static renderAddCustomOption(\n searchValue: string,\n multiple: boolean,\n ): TemplateResult {\n return html`\n <nile-option\n value=${searchValue}\n class=\"combobox__add-option\"\n .showCheckbox=${multiple}\n >\n + Add \"${searchValue}\"\n </nile-option>\n `;\n }\n\n static shouldUseVirtualizer(data: any[], gridColumns = 1): boolean {\n if (gridColumns > 1) return true;\n return data.length >= 5;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/nile-combobox/renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIlD,MAAM,OAAO,gBAAgB;IAE3B,MAAM,CAAC,iBAAiB,CAAC,GAAsB;QA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,CACzB,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EACnD,cAAc,EAAE,kBAAkB,EAAE,aAAa,EACjD,aAAa,CACd,CACF;;iBAEJ,CAAC;QACJ,CAAC,CACF;;;;KAIR,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,qBAAqB,CAC1B,WAAmB,EACnB,QAAiB;QAEjB,OAAO,IAAI,CAAA;;gBAEC,WAAW;;wBAEH,QAAQ;;iBAEf,WAAW;;KAEvB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,IAAW,EAAE,WAAW,GAAG,CAAC;QACtD,IAAI,WAAW,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, type TemplateResult } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { VirtualItem } from '@tanstack/virtual-core';\nimport type { ComboboxRow, ComboboxHeaderRow } from './types';\n\nexport class ComboboxRenderer {\n\n static renderGroupHeader(row: ComboboxHeaderRow): TemplateResult {\n return html`\n <div\n part=\"group-header\"\n class=\"combobox__group-header\"\n role=\"presentation\"\n data-group-id=${row.id}\n style=${`--group-depth:${row.depth}`}\n >\n ${row.prefix\n ? html`<nile-icon\n class=\"combobox__group-prefix\"\n name=${row.prefix}\n size=\"14\"\n method=\"fill\"\n ></nile-icon>`\n : ''}\n <span class=\"combobox__group-label\">${row.label}</span>\n </div>\n `;\n }\n\n static renderRowsPlain(\n rows: ComboboxRow[],\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n showNoResults: boolean,\n noResultsMessage: string,\n isLoading: boolean,\n onScroll: (e: Event) => void,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n noResultsSubtitle?: string,\n ): TemplateResult {\n if (showNoResults && !isLoading && rows.length === 0) {\n return ComboboxRenderer.renderNoResults(noResultsMessage, noResultsSubtitle);\n }\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div class=\"combobox__options-plain\" @scroll=${onScroll}>\n ${rows.map((row) =>\n row.kind === 'header'\n ? ComboboxRenderer.renderGroupHeader(row)\n : ComboboxRenderer.renderItem(\n row.item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix, enableDescription,\n ),\n )}\n </div>\n </div>\n `;\n }\n\n static renderRowsVirtualized(\n virtualItems: VirtualItem[],\n totalSize: number,\n rows: ComboboxRow[],\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n isLoading: boolean,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n ): TemplateResult {\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div style=\"position:relative;height:${totalSize}px;width:100%;\">\n ${repeat(\n virtualItems,\n (vItem) => vItem.key,\n (vItem) => {\n const row = rows[vItem.index];\n if (!row) return html``;\n const posStyle =\n `position:absolute;top:0;left:0;right:0;` +\n `transform:translateY(${vItem.start}px);` +\n `height:${vItem.size}px;`;\n if (row.kind === 'header') {\n return html`\n <div style=${posStyle} class=\"combobox__group-header-slot\">\n ${ComboboxRenderer.renderGroupHeader(row)}\n </div>\n `;\n }\n return html`\n <div style=${posStyle}>\n ${ComboboxRenderer.renderItem(\n row.item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix, enableDescription,\n )}\n </div>\n `;\n },\n )}\n </div>\n </div>\n `;\n }\n\n static renderVirtualizedOptions(\n virtualItems: VirtualItem[],\n totalSize: number,\n data: any[],\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n isLoading: boolean,\n allowHtmlLabel: boolean,\n measureElement: (el: Element | null) => void,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n ): TemplateResult {\n const offsetTop = virtualItems.length > 0 ? virtualItems[0].start : 0;\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div style=\"position:relative;height:${totalSize}px;width:100%;\">\n <div style=\"position:absolute;top:0;left:0;width:100%;transform:translateY(${offsetTop}px);\">\n ${repeat(\n virtualItems,\n (vItem) => vItem.key,\n (vItem) => {\n const item = data[vItem.index];\n return ComboboxRenderer.renderMeasuredItem(\n item, vItem.index, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix, enableDescription,\n );\n },\n )}\n </div>\n </div>\n </div>\n `;\n }\n\n static renderPlainOptions(\n data: any[],\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n showNoResults: boolean,\n noResultsMessage: string,\n isLoading: boolean,\n onScroll: (e: Event) => void,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n noResultsSubtitle?: string,\n ): TemplateResult {\n if (showNoResults && !isLoading && data.length === 0) {\n return ComboboxRenderer.renderNoResults(noResultsMessage, noResultsSubtitle);\n }\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div class=\"combobox__options-plain\" @scroll=${onScroll}>\n ${data.map((item: any) =>\n ComboboxRenderer.renderItem(\n item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix, enableDescription,\n ),\n )}\n </div>\n </div>\n `;\n }\n\n static renderNoResults(noResultsMessage: string, noResultsSubtitle?: string): TemplateResult {\n return html`\n <div part=\"select-options\" class=\"combobox__options\">\n <div part=\"no-results\" class=\"combobox__no-results\">\n <div part=\"no-results-title\" class=\"combobox__no-results-title\">\n ${noResultsMessage || 'No result found'}\n </div>\n ${noResultsSubtitle\n ? html`<div part=\"no-results-subtitle\" class=\"combobox__no-results-subtitle\">${noResultsSubtitle}</div>`\n : ''}\n </div>\n </div>\n `;\n }\n\n static renderNoData(noDataMessage: string): TemplateResult {\n return html`\n <div part=\"select-options\" class=\"combobox__options\">\n <div part=\"no-data\" class=\"combobox__no-results\">\n <div part=\"no-data-title\" class=\"combobox__no-results-title\">\n ${noDataMessage || 'No data available'}\n </div>\n </div>\n </div>\n `;\n }\n\n private static renderMeasuredItem(\n item: any,\n index: number,\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n ): TemplateResult {\n if (!item) return html``;\n\n const optionValue = getItemValue(item);\n const displayText = getDisplayText(item);\n const isDisabled = item?.disabled || false;\n const className = item?.className;\n const description = getItemDescription ? getItemDescription(item) : (item?.description ?? '');\n const prefix = getItemPrefix ? getItemPrefix(item) : (item?.prefix ?? '');\n const suffix = getItemSuffix ? getItemSuffix(item) : (item?.suffix ?? '');\n\n let isSelected = false;\n if (multiple) {\n isSelected = Array.isArray(value) && value.some(v => String(v) === String(optionValue));\n } else {\n isSelected = String(Array.isArray(value) ? value[0] : value) === String(optionValue);\n }\n\n return html`\n <nile-option\n data-index=${index}\n value=${optionValue}\n .selected=${isSelected}\n .disabled=${isDisabled}\n .showCheckbox=${multiple}\n class=${classMap({\n option: enableDescription ?? false,\n [className ?? '']: !!className,\n })}\n .description=${description}\n .isDescriptionEnabled=${enableDescription}\n >\n ${unsafeHTML(prefix)}\n ${allowHtmlLabel ? unsafeHTML(displayText) : displayText}\n ${unsafeHTML(suffix)}\n </nile-option>\n `;\n }\n\n static renderItem(\n item: any,\n value: string | string[],\n multiple: boolean,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n enableDescription?: boolean,\n ): TemplateResult {\n if (!item) return html``;\n\n const optionValue = getItemValue(item);\n const displayText = getDisplayText(item);\n const isDisabled = item?.disabled || false;\n const className = item?.className;\n const description = getItemDescription ? getItemDescription(item) : (item?.description ?? '');\n const prefix = getItemPrefix ? getItemPrefix(item) : (item?.prefix ?? '');\n const suffix = getItemSuffix ? getItemSuffix(item) : (item?.suffix ?? '');\n\n let isSelected = false;\n if (multiple) {\n isSelected = Array.isArray(value) && value.some(v => String(v) === String(optionValue));\n } else {\n isSelected = String(Array.isArray(value) ? value[0] : value) === String(optionValue);\n }\n\n return html`\n <nile-option\n value=${optionValue}\n .selected=${isSelected}\n .disabled=${isDisabled}\n .showCheckbox=${multiple}\n class=${classMap({\n option: enableDescription ?? false,\n [className ?? '']: !!className,\n })}\n .description=${description}\n .isDescriptionEnabled=${enableDescription}\n >\n ${unsafeHTML(prefix)}\n ${allowHtmlLabel ? unsafeHTML(displayText) : displayText}\n ${unsafeHTML(suffix)}\n </nile-option>\n `;\n }\n\n static renderVirtualizedGrid(\n virtualItems: VirtualItem[],\n totalSize: number,\n data: any[],\n value: string | string[],\n multiple: boolean,\n gridColumns: number,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n isLoading: boolean,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n gridColumnWidth?: number,\n ): TemplateResult {\n const offsetTop = virtualItems.length > 0 ? virtualItems[0].start : 0;\n const colTemplate = gridColumnWidth\n ? `repeat(${gridColumns}, ${gridColumnWidth}px)`\n : `repeat(${gridColumns}, 1fr)`;\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options ${isLoading ? 'loading' : ''}\"\n >\n <div style=\"position:relative;height:${totalSize}px;width:${gridColumnWidth ? 'max-content' : '100%'};min-width:100%;\">\n <div style=\"position:absolute;top:0;left:0;width:${gridColumnWidth ? 'max-content' : '100%'};min-width:100%;transform:translateY(${offsetTop}px);\">\n ${repeat(\n virtualItems,\n (vItem) => vItem.key,\n (vItem) => {\n const rowStart = vItem.index * gridColumns;\n const rowItems = data.slice(rowStart, rowStart + gridColumns);\n return html`\n <div class=\"combobox__grid-row\" style=\"display:grid;grid-template-columns:${colTemplate};gap:4px;\">\n ${rowItems.map((item: any) =>\n ComboboxRenderer.renderItem(\n item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix,\n ),\n )}\n </div>\n `;\n },\n )}\n </div>\n </div>\n </div>\n `;\n }\n\n static renderHorizontalGrid(\n virtualItems: VirtualItem[],\n totalSize: number,\n data: any[],\n value: string | string[],\n multiple: boolean,\n gridRows: number,\n gridColumnWidth: number,\n getDisplayText: (item: any) => string,\n getItemValue: (item: any) => string,\n isLoading: boolean,\n allowHtmlLabel: boolean,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n ): TemplateResult {\n const offsetLeft = virtualItems.length > 0 ? virtualItems[0].start : 0;\n const rowHeight = 38;\n\n return html`\n <div\n part=\"select-options\"\n class=\"combobox__options combobox__options--horizontal ${isLoading ? 'loading' : ''}\"\n >\n <div style=\"position:relative;width:${totalSize}px;height:${rowHeight * gridRows}px;\">\n <div style=\"position:absolute;top:0;left:0;height:100%;display:flex;transform:translateX(${offsetLeft}px);\">\n ${repeat(\n virtualItems,\n (vCol) => vCol.key,\n (vCol) => {\n const colStart = vCol.index * gridRows;\n const colItems = data.slice(colStart, colStart + gridRows);\n return html`\n <div class=\"combobox__grid-col\" style=\"width:${gridColumnWidth}px;flex-shrink:0;display:flex;flex-direction:column;\">\n ${colItems.map((item: any) =>\n ComboboxRenderer.renderItem(\n item, value, multiple, getDisplayText, getItemValue,\n allowHtmlLabel, getItemDescription, getItemPrefix,\n getItemSuffix,\n ),\n )}\n </div>\n `;\n },\n )}\n </div>\n </div>\n </div>\n `;\n }\n\n static renderAddCustomOption(\n searchValue: string,\n multiple: boolean,\n ): TemplateResult {\n return html`\n <nile-option\n value=${searchValue}\n class=\"combobox__add-option\"\n .showCheckbox=${multiple}\n >\n + Add \"${searchValue}\"\n </nile-option>\n `;\n }\n\n static shouldUseVirtualizer(data: any[], gridColumns = 1): boolean {\n if (gridColumns > 1) return true;\n return data.length >= 5;\n }\n}\n"]}
|
|
@@ -21,3 +21,33 @@ export interface ComboboxRenderItemConfig {
|
|
|
21
21
|
export type ComboboxTagLayout = 'single-line' | 'wrap' | 'fixed-height';
|
|
22
22
|
export type ComboboxSize = 'small' | 'medium' | 'large';
|
|
23
23
|
export type ComboboxPlacement = 'top' | 'bottom';
|
|
24
|
+
export interface ComboboxGroupItem {
|
|
25
|
+
type: 'group';
|
|
26
|
+
id: string;
|
|
27
|
+
label: string;
|
|
28
|
+
prefix?: string;
|
|
29
|
+
options: ComboboxDataItem[];
|
|
30
|
+
collapsible?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ComboboxOptionItem {
|
|
33
|
+
type?: 'option';
|
|
34
|
+
value: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
export type ComboboxDataItem = ComboboxGroupItem | ComboboxOptionItem;
|
|
39
|
+
export interface ComboboxHeaderRow {
|
|
40
|
+
kind: 'header';
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
prefix?: string;
|
|
44
|
+
depth: number;
|
|
45
|
+
optionCount: number;
|
|
46
|
+
}
|
|
47
|
+
export interface ComboboxOptionRow {
|
|
48
|
+
kind: 'option';
|
|
49
|
+
item: ComboboxOptionItem;
|
|
50
|
+
depth: number;
|
|
51
|
+
parentIds: string[];
|
|
52
|
+
}
|
|
53
|
+
export type ComboboxRow = ComboboxHeaderRow | ComboboxOptionRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/nile-combobox/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport type NileRemoveEvent = CustomEvent<Record<PropertyKey, never>>;\n\nexport interface ComboboxOption {\n value: string;\n selected: boolean;\n getTextLabel: () => string;\n}\n\nexport interface ComboboxRenderItemConfig {\n getDisplayText: (item: any) => string;\n getValue?: (item: any) => string;\n getSearchText?: (item: any) => string;\n getDescription?: (item: any) => string;\n getPrefix?: (item: any) => string;\n getSuffix?: (item: any) => string;\n}\n\nexport type ComboboxTagLayout = 'single-line' | 'wrap' | 'fixed-height';\nexport type ComboboxSize = 'small' | 'medium' | 'large';\nexport type ComboboxPlacement = 'top' | 'bottom';\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/nile-combobox/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport type NileRemoveEvent = CustomEvent<Record<PropertyKey, never>>;\n\nexport interface ComboboxOption {\n value: string;\n selected: boolean;\n getTextLabel: () => string;\n}\n\nexport interface ComboboxRenderItemConfig {\n getDisplayText: (item: any) => string;\n getValue?: (item: any) => string;\n getSearchText?: (item: any) => string;\n getDescription?: (item: any) => string;\n getPrefix?: (item: any) => string;\n getSuffix?: (item: any) => string;\n}\n\nexport type ComboboxTagLayout = 'single-line' | 'wrap' | 'fixed-height';\nexport type ComboboxSize = 'small' | 'medium' | 'large';\nexport type ComboboxPlacement = 'top' | 'bottom';\n\nexport interface ComboboxGroupItem {\n type: 'group';\n id: string;\n label: string;\n prefix?: string;\n options: ComboboxDataItem[];\n collapsible?: boolean;\n}\n\nexport interface ComboboxOptionItem {\n type?: 'option';\n value: string;\n label?: string;\n [key: string]: any;\n}\n\nexport type ComboboxDataItem = ComboboxGroupItem | ComboboxOptionItem;\n\nexport interface ComboboxHeaderRow {\n kind: 'header';\n id: string;\n label: string;\n prefix?: string;\n depth: number;\n optionCount: number;\n}\n\nexport interface ComboboxOptionRow {\n kind: 'option';\n item: ComboboxOptionItem;\n depth: number;\n parentIds: string[];\n}\n\nexport type ComboboxRow = ComboboxHeaderRow | ComboboxOptionRow;\n"]}
|
|
@@ -147,6 +147,236 @@ export const styles = css `
|
|
|
147
147
|
display: block;
|
|
148
148
|
padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
149
149
|
}
|
|
150
|
+
|
|
151
|
+
/* ── Selection variant ──────────────────────────────────────────────────── */
|
|
152
|
+
|
|
153
|
+
.detail__selection-label {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
157
|
+
flex: 1;
|
|
158
|
+
min-width: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.detail__select-all {
|
|
162
|
+
flex: 0 0 auto;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.detail__selection-title {
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
line-height: 1.3;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.detail__selection-count {
|
|
173
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
174
|
+
font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
|
|
175
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));
|
|
176
|
+
margin-top: 2px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.detail__selection-content {
|
|
180
|
+
padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.detail__selection-toolbar {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
187
|
+
margin-bottom: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.detail__selection-search {
|
|
191
|
+
flex: 1;
|
|
192
|
+
min-width: 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.detail__selection-actions {
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: center;
|
|
198
|
+
gap: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
199
|
+
flex: 0 0 auto;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.detail__selection-grid {
|
|
203
|
+
display: grid;
|
|
204
|
+
grid-auto-flow: column;
|
|
205
|
+
gap: 8px 24px;
|
|
206
|
+
overflow-x: auto;
|
|
207
|
+
overflow-y: hidden;
|
|
208
|
+
padding-bottom: 8px;
|
|
209
|
+
scroll-snap-type: x proximity;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.detail__selection-grid--virtual {
|
|
213
|
+
display: block;
|
|
214
|
+
position: relative;
|
|
215
|
+
width: 100%;
|
|
216
|
+
contain: layout paint;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.detail__selection-grid--virtual.detail__selection-grid--vertical {
|
|
220
|
+
overflow-x: hidden;
|
|
221
|
+
overflow-y: auto;
|
|
222
|
+
scroll-snap-type: y proximity;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.detail__selection-grid--virtual.detail__selection-grid--vertical::-webkit-scrollbar {
|
|
226
|
+
width: 8px;
|
|
227
|
+
height: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.detail__selection-grid--virtual.detail__selection-grid--both {
|
|
231
|
+
overflow: auto;
|
|
232
|
+
scroll-snap-type: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.detail__selection-grid--virtual.detail__selection-grid--both::-webkit-scrollbar {
|
|
236
|
+
width: 8px;
|
|
237
|
+
height: 8px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.detail__selection-grid--virtual .detail__selection-track {
|
|
241
|
+
position: relative;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.detail__selection-tooltip--virtual {
|
|
245
|
+
box-sizing: border-box;
|
|
246
|
+
padding-right: 24px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.detail__selection-grid > nile-checkbox,
|
|
250
|
+
.detail__selection-grid > .detail__selection-tooltip {
|
|
251
|
+
scroll-snap-align: start;
|
|
252
|
+
min-width: 0;
|
|
253
|
+
display: block;
|
|
254
|
+
max-width: 100%;
|
|
255
|
+
overflow: hidden;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.detail__selection-checkbox {
|
|
259
|
+
display: block;
|
|
260
|
+
width: 100%;
|
|
261
|
+
min-width: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.detail__selection-checkbox::part(base) {
|
|
265
|
+
display: flex;
|
|
266
|
+
width: 100%;
|
|
267
|
+
min-width: 0;
|
|
268
|
+
align-items: center;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.detail__selection-checkbox::part(label) {
|
|
272
|
+
flex: 1 1 auto;
|
|
273
|
+
min-width: 0;
|
|
274
|
+
max-width: 100%;
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
text-overflow: ellipsis;
|
|
277
|
+
white-space: nowrap;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.detail__selection-checkbox--disabled {
|
|
281
|
+
opacity: 0.5;
|
|
282
|
+
pointer-events: none;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.detail__selection-text {
|
|
286
|
+
display: inline-flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
min-width: 0;
|
|
289
|
+
flex: 1 1 auto;
|
|
290
|
+
line-height: 1.25;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.detail__selection-item-label {
|
|
294
|
+
display: block;
|
|
295
|
+
overflow: hidden;
|
|
296
|
+
text-overflow: ellipsis;
|
|
297
|
+
white-space: nowrap;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.detail__selection-desc {
|
|
301
|
+
display: block;
|
|
302
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
303
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));
|
|
304
|
+
margin-top: 2px;
|
|
305
|
+
overflow: hidden;
|
|
306
|
+
text-overflow: ellipsis;
|
|
307
|
+
white-space: nowrap;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.detail__selection-prefix,
|
|
311
|
+
.detail__selection-suffix {
|
|
312
|
+
display: inline-flex;
|
|
313
|
+
align-items: center;
|
|
314
|
+
flex: 0 0 auto;
|
|
315
|
+
margin: 0 6px;
|
|
316
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.detail__selection-prefix { margin-left: 0; }
|
|
320
|
+
.detail__selection-suffix { margin-right: 0; }
|
|
321
|
+
|
|
322
|
+
.detail__selection-placeholder {
|
|
323
|
+
display: flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
gap: 10px;
|
|
326
|
+
padding: 4px 8px;
|
|
327
|
+
box-sizing: border-box;
|
|
328
|
+
opacity: 0.6;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.detail__selection-placeholder-bar {
|
|
332
|
+
width: 16px;
|
|
333
|
+
height: 16px;
|
|
334
|
+
border-radius: 4px;
|
|
335
|
+
background: linear-gradient(
|
|
336
|
+
90deg,
|
|
337
|
+
rgba(0,0,0,0.06) 0%,
|
|
338
|
+
rgba(0,0,0,0.12) 50%,
|
|
339
|
+
rgba(0,0,0,0.06) 100%
|
|
340
|
+
);
|
|
341
|
+
background-size: 200% 100%;
|
|
342
|
+
animation: nile-detail-shimmer 1.4s linear infinite;
|
|
343
|
+
flex: 0 0 auto;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.detail__selection-placeholder-label {
|
|
347
|
+
flex: 1 1 auto;
|
|
348
|
+
min-width: 0;
|
|
349
|
+
overflow: hidden;
|
|
350
|
+
text-overflow: ellipsis;
|
|
351
|
+
white-space: nowrap;
|
|
352
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
353
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));
|
|
354
|
+
background: linear-gradient(
|
|
355
|
+
90deg,
|
|
356
|
+
rgba(0,0,0,0.06) 0%,
|
|
357
|
+
rgba(0,0,0,0.12) 50%,
|
|
358
|
+
rgba(0,0,0,0.06) 100%
|
|
359
|
+
);
|
|
360
|
+
background-size: 200% 100%;
|
|
361
|
+
background-clip: text;
|
|
362
|
+
-webkit-background-clip: text;
|
|
363
|
+
color: transparent;
|
|
364
|
+
animation: nile-detail-shimmer 1.4s linear infinite;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@keyframes nile-detail-shimmer {
|
|
368
|
+
0% { background-position: 200% 0; }
|
|
369
|
+
100% { background-position: -200% 0; }
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.detail__selection-grid::-webkit-scrollbar {
|
|
373
|
+
height: 8px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.detail__selection-grid::-webkit-scrollbar-thumb {
|
|
377
|
+
background: rgba(0, 0, 0, 0.2);
|
|
378
|
+
border-radius: 4px;
|
|
379
|
+
}
|
|
150
380
|
`;
|
|
151
381
|
export default [styles];
|
|
152
382
|
//# sourceMappingURL=nile-detail.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-detail.css.js","sourceRoot":"","sources":["../../../src/nile-detail/nile-detail.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoJxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n [hidden] {\n display: none;\n }\n\n :host {\n display: block;\n width: 100%;\n }\n\n .detail {\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n border-radius: var(--nile-radius-md, var(--ng-radius-xl));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-xs));\n overflow: hidden;\n width: 100%;\n line-height: var(--nile-line-height-inherit, var(--ng-line-height-text-sm));\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n }\n\n .detail--disabled {\n opacity: var(--nile-opacity-50, var(--ng-opacity-50));\n }\n\n .detail__header {\n display: flex;\n gap: var(--nile-spacing-lg, var(--ng-spacing-lg));\n align-items: center;\n border-radius: inherit;\n padding: var(--nile-spacing-xl, var(--ng-spacing-xl));\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-tertiary));\n font-size: var(--nile-type-scale-4, var(--ng-spacing-xl));\n font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n color: var(--nile-colors-neutral-900, var(--ng-colors-text-primary));\n user-select: none;\n cursor: pointer;\n list-style: none;\n }\n\n .detail__header::-webkit-details-marker {\n display: none;\n }\n\n .detail__header::marker {\n content: '';\n }\n\n .detail__header--icon-left {\n flex-direction: row-reverse;\n }\n\n .detail__header:focus {\n outline: none;\n }\n\n .detail__header:focus-visible {\n outline: solid 3px var(--nile-colors-blue-500, var(--ng-colors-fg-brand-primary-600));\n outline-offset: calc(1px + 1px);\n }\n\n .detail--disabled .detail__header {\n cursor: not-allowed;\n }\n\n .detail--disabled .detail__header:focus-visible {\n outline: none;\n box-shadow: none;\n }\n\n .detail__label {\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .detail__header-actions {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .detail__prefix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .detail__suffix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .detail__heading-text {\n font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n font-family: var(--nile-font-family-medium, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-spacing-xl));\n }\n\n .detail__description {\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));\n margin-top: 2px;\n }\n\n .detail__summary-icon {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n transition: 250ms transform ease;\n color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary));\n transform: rotate(90deg);\n }\n\n .detail--open .detail__summary-icon {\n transform: rotate(-90deg);\n }\n\n .detail__body {\n overflow: hidden;\n }\n\n .detail__body[hidden] {\n display: none;\n }\n\n .detail__content {\n display: block;\n padding: var(--nile-spacing-xl, var(--ng-spacing-xl));\n }\n`;\n\nexport default [styles];\n"]}
|
|
1
|
+
{"version":3,"file":"nile-detail.css.js","sourceRoot":"","sources":["../../../src/nile-detail/nile-detail.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0XxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n [hidden] {\n display: none;\n }\n\n :host {\n display: block;\n width: 100%;\n }\n\n .detail {\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n border-radius: var(--nile-radius-md, var(--ng-radius-xl));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-xs));\n overflow: hidden;\n width: 100%;\n line-height: var(--nile-line-height-inherit, var(--ng-line-height-text-sm));\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n }\n\n .detail--disabled {\n opacity: var(--nile-opacity-50, var(--ng-opacity-50));\n }\n\n .detail__header {\n display: flex;\n gap: var(--nile-spacing-lg, var(--ng-spacing-lg));\n align-items: center;\n border-radius: inherit;\n padding: var(--nile-spacing-xl, var(--ng-spacing-xl));\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-tertiary));\n font-size: var(--nile-type-scale-4, var(--ng-spacing-xl));\n font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n color: var(--nile-colors-neutral-900, var(--ng-colors-text-primary));\n user-select: none;\n cursor: pointer;\n list-style: none;\n }\n\n .detail__header::-webkit-details-marker {\n display: none;\n }\n\n .detail__header::marker {\n content: '';\n }\n\n .detail__header--icon-left {\n flex-direction: row-reverse;\n }\n\n .detail__header:focus {\n outline: none;\n }\n\n .detail__header:focus-visible {\n outline: solid 3px var(--nile-colors-blue-500, var(--ng-colors-fg-brand-primary-600));\n outline-offset: calc(1px + 1px);\n }\n\n .detail--disabled .detail__header {\n cursor: not-allowed;\n }\n\n .detail--disabled .detail__header:focus-visible {\n outline: none;\n box-shadow: none;\n }\n\n .detail__label {\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .detail__header-actions {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .detail__prefix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .detail__suffix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .detail__heading-text {\n font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n font-family: var(--nile-font-family-medium, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-spacing-xl));\n }\n\n .detail__description {\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));\n margin-top: 2px;\n }\n\n .detail__summary-icon {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n transition: 250ms transform ease;\n color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary));\n transform: rotate(90deg);\n }\n\n .detail--open .detail__summary-icon {\n transform: rotate(-90deg);\n }\n\n .detail__body {\n overflow: hidden;\n }\n\n .detail__body[hidden] {\n display: none;\n }\n\n .detail__content {\n display: block;\n padding: var(--nile-spacing-xl, var(--ng-spacing-xl));\n }\n\n /* ── Selection variant ──────────────────────────────────────────────────── */\n\n .detail__selection-label {\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-lg, var(--ng-spacing-lg));\n flex: 1;\n min-width: 0;\n }\n\n .detail__select-all {\n flex: 0 0 auto;\n }\n\n .detail__selection-title {\n display: flex;\n flex-direction: column;\n line-height: 1.3;\n min-width: 0;\n }\n\n .detail__selection-count {\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));\n margin-top: 2px;\n }\n\n .detail__selection-content {\n padding: var(--nile-spacing-xl, var(--ng-spacing-xl));\n }\n\n .detail__selection-toolbar {\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-lg, var(--ng-spacing-lg));\n margin-bottom: var(--nile-spacing-lg, var(--ng-spacing-lg));\n }\n\n .detail__selection-search {\n flex: 1;\n min-width: 0;\n }\n\n .detail__selection-actions {\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-xl, var(--ng-spacing-xl));\n flex: 0 0 auto;\n }\n\n .detail__selection-grid {\n display: grid;\n grid-auto-flow: column;\n gap: 8px 24px;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 8px;\n scroll-snap-type: x proximity;\n }\n\n .detail__selection-grid--virtual {\n display: block;\n position: relative;\n width: 100%;\n contain: layout paint;\n }\n\n .detail__selection-grid--virtual.detail__selection-grid--vertical {\n overflow-x: hidden;\n overflow-y: auto;\n scroll-snap-type: y proximity;\n }\n\n .detail__selection-grid--virtual.detail__selection-grid--vertical::-webkit-scrollbar {\n width: 8px;\n height: 0;\n }\n\n .detail__selection-grid--virtual.detail__selection-grid--both {\n overflow: auto;\n scroll-snap-type: none;\n }\n\n .detail__selection-grid--virtual.detail__selection-grid--both::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n .detail__selection-grid--virtual .detail__selection-track {\n position: relative;\n }\n\n .detail__selection-tooltip--virtual {\n box-sizing: border-box;\n padding-right: 24px;\n }\n\n .detail__selection-grid > nile-checkbox,\n .detail__selection-grid > .detail__selection-tooltip {\n scroll-snap-align: start;\n min-width: 0;\n display: block;\n max-width: 100%;\n overflow: hidden;\n }\n\n .detail__selection-checkbox {\n display: block;\n width: 100%;\n min-width: 0;\n }\n\n .detail__selection-checkbox::part(base) {\n display: flex;\n width: 100%;\n min-width: 0;\n align-items: center;\n }\n\n .detail__selection-checkbox::part(label) {\n flex: 1 1 auto;\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .detail__selection-checkbox--disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .detail__selection-text {\n display: inline-flex;\n flex-direction: column;\n min-width: 0;\n flex: 1 1 auto;\n line-height: 1.25;\n }\n\n .detail__selection-item-label {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .detail__selection-desc {\n display: block;\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));\n margin-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .detail__selection-prefix,\n .detail__selection-suffix {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n margin: 0 6px;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));\n }\n\n .detail__selection-prefix { margin-left: 0; }\n .detail__selection-suffix { margin-right: 0; }\n\n .detail__selection-placeholder {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 4px 8px;\n box-sizing: border-box;\n opacity: 0.6;\n }\n\n .detail__selection-placeholder-bar {\n width: 16px;\n height: 16px;\n border-radius: 4px;\n background: linear-gradient(\n 90deg,\n rgba(0,0,0,0.06) 0%,\n rgba(0,0,0,0.12) 50%,\n rgba(0,0,0,0.06) 100%\n );\n background-size: 200% 100%;\n animation: nile-detail-shimmer 1.4s linear infinite;\n flex: 0 0 auto;\n }\n\n .detail__selection-placeholder-label {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));\n background: linear-gradient(\n 90deg,\n rgba(0,0,0,0.06) 0%,\n rgba(0,0,0,0.12) 50%,\n rgba(0,0,0,0.06) 100%\n );\n background-size: 200% 100%;\n background-clip: text;\n -webkit-background-clip: text;\n color: transparent;\n animation: nile-detail-shimmer 1.4s linear infinite;\n }\n\n @keyframes nile-detail-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n\n .detail__selection-grid::-webkit-scrollbar {\n height: 8px;\n }\n\n .detail__selection-grid::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 4px;\n }\n`;\n\nexport default [styles];\n"]}
|