@aquera/nile-elements 1.7.5 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.js +56 -18
- 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 +25 -2
- package/dist/nile-detail/nile-detail.esm.js +43 -28
- package/dist/src/nile-detail/nile-detail.css.js +25 -2
- package/dist/src/nile-detail/nile-detail.css.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.d.ts +8 -0
- package/dist/src/nile-detail/nile-detail.js +67 -16
- package/dist/src/nile-detail/nile-detail.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-detail/nile-detail.css.ts +25 -2
- package/src/nile-detail/nile-detail.ts +65 -18
- package/vscode-html-custom-data.json +14 -1
package/README.md
CHANGED
|
@@ -79,6 +79,9 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
|
79
79
|
|
|
80
80
|
In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
|
81
81
|
|
|
82
|
+
#### Version 1.7.6 (May 19, 2026)
|
|
83
|
+
- Nile Detail: Improvement in the Selection Variant (UIF-1231)
|
|
84
|
+
|
|
82
85
|
#### Version 1.7.5 (May 18, 2026)
|
|
83
86
|
- Nile OTP Input: Fixed Value Color for NxtGen (UIF-1228)
|
|
84
87
|
|
package/dist/index.js
CHANGED
|
@@ -17544,7 +17544,7 @@ nile-rich-text-editor[disabled] .editor a {
|
|
|
17544
17544
|
</span>
|
|
17545
17545
|
`:B}
|
|
17546
17546
|
</button>
|
|
17547
|
-
`}};e([ue({type:String,reflect:!0})],GS.prototype,"color",void 0),e([ue({type:Boolean,reflect:!0})],GS.prototype,"active",void 0),GS=e([ge("nile-color-swatch")],GS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.7.
|
|
17547
|
+
`}};e([ue({type:String,reflect:!0})],GS.prototype,"color",void 0),e([ue({type:Boolean,reflect:!0})],GS.prototype,"active",void 0),GS=e([ge("nile-color-swatch")],GS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.7.6"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const FS=r`
|
|
17548
17548
|
:host {
|
|
17549
17549
|
|
|
17550
17550
|
top: 0;
|
|
@@ -19194,6 +19194,11 @@ a {
|
|
|
19194
19194
|
padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
19195
19195
|
}
|
|
19196
19196
|
|
|
19197
|
+
.detail__content:not(:has(*)) {
|
|
19198
|
+
display: none;
|
|
19199
|
+
padding: 0;
|
|
19200
|
+
}
|
|
19201
|
+
|
|
19197
19202
|
/* ── Selection variant ──────────────────────────────────────────────────── */
|
|
19198
19203
|
|
|
19199
19204
|
.detail__selection-label {
|
|
@@ -19238,6 +19243,23 @@ a {
|
|
|
19238
19243
|
min-width: 0;
|
|
19239
19244
|
}
|
|
19240
19245
|
|
|
19246
|
+
.detail__selection-search-slot {
|
|
19247
|
+
display: flex;
|
|
19248
|
+
flex: 1;
|
|
19249
|
+
min-width: 0;
|
|
19250
|
+
}
|
|
19251
|
+
|
|
19252
|
+
.detail__selection-search-slot::slotted(*) {
|
|
19253
|
+
flex: 1;
|
|
19254
|
+
min-width: 0;
|
|
19255
|
+
}
|
|
19256
|
+
|
|
19257
|
+
.detail__selected-toggle {
|
|
19258
|
+
display: inline-flex;
|
|
19259
|
+
align-items: center;
|
|
19260
|
+
gap: 6px;
|
|
19261
|
+
}
|
|
19262
|
+
|
|
19241
19263
|
.detail__selection-actions {
|
|
19242
19264
|
display: flex;
|
|
19243
19265
|
align-items: center;
|
|
@@ -19251,7 +19273,7 @@ a {
|
|
|
19251
19273
|
gap: 8px 24px;
|
|
19252
19274
|
overflow-x: auto;
|
|
19253
19275
|
overflow-y: hidden;
|
|
19254
|
-
padding
|
|
19276
|
+
padding: 4px 4px 8px;
|
|
19255
19277
|
scroll-snap-type: x proximity;
|
|
19256
19278
|
}
|
|
19257
19279
|
|
|
@@ -19298,7 +19320,8 @@ a {
|
|
|
19298
19320
|
min-width: 0;
|
|
19299
19321
|
display: block;
|
|
19300
19322
|
max-width: 100%;
|
|
19301
|
-
overflow:
|
|
19323
|
+
overflow: visible;
|
|
19324
|
+
padding-left: 4px;
|
|
19302
19325
|
}
|
|
19303
19326
|
|
|
19304
19327
|
.detail__selection-checkbox {
|
|
@@ -19423,7 +19446,7 @@ a {
|
|
|
19423
19446
|
background: rgba(0, 0, 0, 0.2);
|
|
19424
19447
|
border-radius: 4px;
|
|
19425
19448
|
}
|
|
19426
|
-
`;async function ck(e){if(!e.open&&!e.disabled)return e.open=!0,Ht(e,"nile-after-show")}async function uk(e){if(e.open&&!e.disabled)return e.open=!1,Ht(e,"nile-after-hide")}Pt("detail.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),Pt("detail.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});const Dk="undefined"!=typeof window;let dk=class extends Fe{constructor(){super(...arguments),this.open=!1,this.heading="",this.description="",this.expandIconPlacement="right",this.disabled=!1,this.variant="default",this.items=[],this.selected=[],this.allowHtmlLabel=!1,this.disableLocalSearch=!1,this.pageSize=200,this.placeholderLabel="Loading…",this.searchPlaceholder="Search...",this.itemsLabel="attributes",this.restoreLabel="Restore",this.clearLabel="Clear",this.gridRows=6,this.gridColumns=3,this.minColumnWidth="220px",this.laneHeight=32,this.orientation="horizontal",this.maxHeight="320px",this.matrixColumns=20,this.virtualize=!1,this.virtualizeThreshold=60,this.overscan=4,this._detailOpen=!1,this._searchTerm="",this._selectedSet=new Set,this._restoreDefaults=null,this._gridResizeObserver=null,this._virtCtrl=null,this._rowVirtCtrl=null,this._colVirtCtrl=null,this._pageCache=new Map,this._pendingPages=new Set}get _isInfiniteMode(){return"selection"===this.variant&&"function"==typeof this.fetchPage&&"number"==typeof this.totalCount&&"both"!==this.orientation}_effectiveTotalCount(){return this._isInfiniteMode?this.totalCount??0:this._filteredItems.length}_getItemAt(e){if(!this._isInfiniteMode)return this._filteredItems[e];const t=Math.max(1,this.pageSize),i=Math.floor(e/t),M=this._pageCache.get(i);return M?M[e-i*t]:void 0}_scheduleFetchForRange(e,t){if(!this._isInfiniteMode||!this.fetchPage)return;const i=Math.max(1,this.pageSize),M=this.totalCount??0;if(M<=0)return;const n=Math.floor(e/i),o=Math.floor(Math.min(t,M-1)/i);for(let e=n;e<=o;e++)this._pageCache.has(e)||this._pendingPages.has(e)||this._loadPage(e)}async _loadPage(e){if(!this.fetchPage)return;const t=Math.max(1,this.pageSize),i=e*t,M=this.totalCount??0,n=Math.min(t,Math.max(0,M-i));if(!(n<=0)){this._pendingPages.add(e);try{const t=await this.fetchPage(i,n);this._pageCache.set(e,Array.isArray(t)?t:[]),this.dispatchEvent(new CustomEvent("nile-page-load",{detail:{pageIndex:e,offset:i,limit:n,rows:this._pageCache.get(e)},bubbles:!0,composed:!0}))}catch(t){this.dispatchEvent(new CustomEvent("nile-page-error",{detail:{pageIndex:e,offset:i,limit:n,error:t},bubbles:!0,composed:!0}))}finally{this._pendingPages.delete(e),this.requestUpdate()}}}resetPages(){this._pageCache=new Map,this._pendingPages=new Set,this.requestUpdate()}get _isVirtualized(){return!!Dk&&(!!this._isInfiniteMode||"selection"===this.variant&&(this.virtualize||this.items.length>this.virtualizeThreshold))}get _columnWidthPx(){const e=parseInt(this.minColumnWidth,10);return Number.isFinite(e)&&e>0?e:220}firstUpdated(){this._detailOpen=this.open,this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this._syncSelectedFromProperty(),null===this._restoreDefaults&&(this._restoreDefaults=[...this._selectedSet]),this._setupGridResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._gridResizeObserver?.disconnect(),this._gridResizeObserver=null}updated(e){"selection"===this.variant&&(this._setupGridResizeObserver(),this._syncVirtualizer(),this._scheduleTooltipOverflowCheck())}_syncVirtualizer(){if(!Dk)return;if(!this._isVirtualized)return this._virtCtrl=null,this._rowVirtCtrl=null,void(this._colVirtCtrl=null);const e=this.shadowRoot?.querySelector(".detail__selection-grid");if(!e)return;if("both"===this.orientation)return this._virtCtrl=null,void this._syncBothVirtualizers();this._rowVirtCtrl=null,this._colVirtCtrl=null;const t=this._effectiveTotalCount(),i="vertical"===this.orientation,M=Math.max(1,i?this.gridColumns:this.gridRows),n=i?this.laneHeight:this._columnWidthPx;if(!this._virtCtrl)return void(this._virtCtrl=new no(this,{count:t,getScrollElement:()=>this.shadowRoot?.querySelector(".detail__selection-grid"),estimateSize:()=>n,horizontal:!i,lanes:M,overscan:this.overscan}));const o=this._virtCtrl.getVirtualizer(),r=o.options,s=!!r.horizontal!=!i;(r.count!==t||r.lanes!==M||r.overscan!==this.overscan||s)&&(o.setOptions({...r,count:t,lanes:M,overscan:this.overscan,horizontal:!i,estimateSize:()=>n}),o.measure())}_syncBothVirtualizers(){const e=this._filteredItems.length,t=Math.max(1,this.matrixColumns),i=Math.max(1,Math.ceil(e/t)),M=this._columnWidthPx,n=this.laneHeight,o=()=>this.shadowRoot?.querySelector(".detail__selection-grid");if(this._rowVirtCtrl){const e=this._rowVirtCtrl.getVirtualizer(),t=e.options;t.count===i&&t.overscan===this.overscan||(e.setOptions({...t,count:i,overscan:this.overscan,estimateSize:()=>n}),e.measure())}else this._rowVirtCtrl=new no(this,{count:i,getScrollElement:o,estimateSize:()=>n,horizontal:!1,overscan:this.overscan});if(this._colVirtCtrl){const e=this._colVirtCtrl.getVirtualizer(),i=e.options;i.count===t&&i.overscan===this.overscan||(e.setOptions({...i,count:t,overscan:this.overscan,estimateSize:()=>M}),e.measure())}else this._colVirtCtrl=new no(this,{count:t,getScrollElement:o,estimateSize:()=>M,horizontal:!0,overscan:this.overscan})}_setupGridResizeObserver(){if("selection"!==this.variant)return;if("undefined"==typeof ResizeObserver)return;const e=this.shadowRoot?.querySelector(".detail__selection-grid");e&&(this._gridResizeObserver||(this._gridResizeObserver=new ResizeObserver((()=>this._scheduleTooltipOverflowCheck())),this._gridResizeObserver.observe(e)))}_scheduleTooltipOverflowCheck(){"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((()=>this._updateTooltipOverflowStates()))}async _updateTooltipOverflowStates(){const e=this.shadowRoot?.querySelectorAll(".detail__selection-tooltip");if(e)for(const t of e){const e=t.querySelector("nile-checkbox");if(!e)continue;e.updateComplete&&await e.updateComplete;const i=e.shadowRoot?.querySelector('[part="label"]');!!i&&i.scrollWidth>i.clientWidth+1?t.removeAttribute("disabled"):t.setAttribute("disabled","")}}_onSelectedPropertyChange(){this._syncSelectedFromProperty()}_onConfigChange(){this._applyConfig()}_applyConfig(){const e=this.config;if(e){if(void 0!==e.variant&&(this.variant=e.variant),void 0!==e.heading&&(this.heading=e.heading),void 0!==e.description&&(this.description=e.description),void 0!==e.itemsLabel&&(this.itemsLabel=e.itemsLabel),void 0!==e.open&&(this.open=e.open),void 0!==e.disabled&&(this.disabled=e.disabled),void 0!==e.items&&(this.items=e.items),void 0!==e.selected&&(this.selected=e.selected),void 0!==e.renderItemConfig&&(this.renderItemConfig=e.renderItemConfig),void 0!==e.allowHtmlLabel&&(this.allowHtmlLabel=e.allowHtmlLabel),e.layout){const t=e.layout;void 0!==t.orientation&&(this.orientation=t.orientation),void 0!==t.gridRows&&(this.gridRows=t.gridRows),void 0!==t.gridColumns&&(this.gridColumns=t.gridColumns),void 0!==t.matrixColumns&&(this.matrixColumns=t.matrixColumns),void 0!==t.minColumnWidth&&(this.minColumnWidth=t.minColumnWidth),void 0!==t.laneHeight&&(this.laneHeight=t.laneHeight),void 0!==t.maxHeight&&(this.maxHeight=t.maxHeight),void 0!==t.expandIconPlacement&&(this.expandIconPlacement=t.expandIconPlacement)}e.search&&(void 0!==e.search.placeholder&&(this.searchPlaceholder=e.search.placeholder),void 0!==e.search.disableLocal&&(this.disableLocalSearch=e.search.disableLocal)),e.virtualization&&(void 0!==e.virtualization.enabled&&(this.virtualize=e.virtualization.enabled),void 0!==e.virtualization.threshold&&(this.virtualizeThreshold=e.virtualization.threshold),void 0!==e.virtualization.overscan&&(this.overscan=e.virtualization.overscan)),e.pagination&&(void 0!==e.pagination.totalCount&&(this.totalCount=e.pagination.totalCount),void 0!==e.pagination.pageSize&&(this.pageSize=e.pagination.pageSize),void 0!==e.pagination.fetchPage&&(this.fetchPage=e.pagination.fetchPage),void 0!==e.pagination.placeholderLabel&&(this.placeholderLabel=e.pagination.placeholderLabel)),e.labels&&(void 0!==e.labels.restore&&(this.restoreLabel=e.labels.restore),void 0!==e.labels.clear&&(this.clearLabel=e.labels.clear))}}_syncSelectedFromProperty(){this._selectedSet=new Set(this.selected||[])}_getItemValue(e){const t=this.renderItemConfig;return t?.getValue?String(t.getValue(e)):"string"==typeof e?e:String(e.value??"")}_getItemLabel(e){const t=this.renderItemConfig;return t?.getDisplayText?t.getDisplayText(e):"string"==typeof e?e:e.label??this._getItemValue(e)}_getItemSearchText(e){const t=this.renderItemConfig;return t?.getSearchText?t.getSearchText(e):this._getItemLabel(e)}_getItemDescription(e){const t=this.renderItemConfig;return t?.getDescription?t.getDescription(e)??"":"string"==typeof e?"":e.description??""}_getItemPrefix(e){const t=this.renderItemConfig;return t?.getPrefix?t.getPrefix(e)??"":"string"==typeof e?"":e.prefix??""}_getItemSuffix(e){const t=this.renderItemConfig;return t?.getSuffix?t.getSuffix(e)??"":"string"==typeof e?"":e.suffix??""}_getItemDisabled(e){const t=this.renderItemConfig;return t?.getDisabled?!!t.getDisabled(e):"string"!=typeof e&&!!e.disabled}_getItemClassName(e){const t=this.renderItemConfig;return t?.getClassName?t.getClassName(e)??"":"string"==typeof e?"":e.className??""}get _filteredItems(){if(this.disableLocalSearch)return this.items;const e=this._searchTerm.trim().toLowerCase();return e?this.items.filter((t=>this._getItemSearchText(t).toLowerCase().includes(e))):this.items}_selectableValues(){return(this._isInfiniteMode?Array.from(this._pageCache.values()).flat():this.items).filter((e=>!this._getItemDisabled(e))).map((e=>this._getItemValue(e)))}get _allChecked(){const e=this._selectableValues();return 0!==e.length&&e.every((e=>this._selectedSet.has(e)))}get _indeterminate(){const e=this._selectableValues(),t=e.filter((e=>this._selectedSet.has(e))).length;return t>0&&t<e.length}get _countLabel(){const e=this._isInfiniteMode?this.totalCount??0:this.items.length;return`${this._selectedSet.size} of ${e} ${this.itemsLabel} selected`}_emitSelectionChange(){this.selected=[...this._selectedSet],this.dispatchEvent(new CustomEvent("nile-change",{detail:{selected:[...this._selectedSet]},bubbles:!0,composed:!0}))}_onItemChange(e,t,i){if(t)return void i.preventDefault();const M=i.target,n=new Set(this._selectedSet);M.checked?n.add(e):n.delete(e),this._selectedSet=n,this._emitSelectionChange()}_onSelectAllChange(e){const t=e.target,i=this._selectableValues(),M=new Set(this._selectedSet);t.checked?i.forEach((e=>M.add(e))):i.forEach((e=>M.delete(e))),this._selectedSet=M,this._emitSelectionChange()}_emitSearch(e){this.dispatchEvent(new CustomEvent("nile-search",{detail:{value:e},bubbles:!0,composed:!0}))}_onSearchInput(e){const t=e.target.value??"";this._searchTerm=t,this.disableLocalSearch&&this._emitSearch(t)}_onSearchClear(){this._searchTerm="",this.disableLocalSearch&&this._emitSearch("")}_onRestore(e){e.preventDefault();const t=this._restoreDefaults??this._selectableValues();this._selectedSet=new Set(t),this._emitSelectionChange()}_onClear(e){e.preventDefault(),this._selectedSet=new Set,this._emitSelectionChange()}_stopHeaderToggle(e){e.stopPropagation()}_handleSummaryClick(e){e.preventDefault(),function(e){e.disabled||(e.open?uk(e):ck(e))}(this)}_handleSummaryKeyDown(e){!function(e,t){e.preventDefault(),"Enter"!==e.key&&" "!==e.key||(t.open?uk(t):ck(t)),"ArrowUp"!==e.key&&"ArrowLeft"!==e.key||uk(t),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||ck(t)}(e,this)}async handleOpenChange(){this.open?(this._detailOpen=!0,await async function(e){if(e.emit("nile-show",{cancelable:!0}).defaultPrevented)return void(e.open=!1);await Ct(e.body),e.body.hidden=!1;const{keyframes:t,options:i}=Wt(e,"detail.show",{dir:"ltr"});await vt(e.body,Ut(t,e.body.scrollHeight),i),e.body.style.height="auto",e.emit("nile-after-show")}(this)):(await async function(e){if(e.emit("nile-hide",{cancelable:!0}).defaultPrevented)return void(e.open=!0);await Ct(e.body);const{keyframes:t,options:i}=Wt(e,"detail.hide",{dir:"ltr"});await vt(e.body,Ut(t,e.body.scrollHeight),i),e.body.hidden=!0,e.body.style.height="auto",e.emit("nile-after-hide")}(this),this._detailOpen=!1)}async show(){return ck(this)}async hide(){return uk(this)}get _summaryLabel(){return[this.heading,this.description].filter(Boolean).join(", ")}_renderSelectionLabel(){return _`
|
|
19449
|
+
`;async function ck(e){if(!e.open&&!e.disabled)return e.open=!0,Ht(e,"nile-after-show")}async function uk(e){if(e.open&&!e.disabled)return e.open=!1,Ht(e,"nile-after-hide")}Pt("detail.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),Pt("detail.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});const Dk="undefined"!=typeof window;let dk=class extends Fe{constructor(){super(...arguments),this.open=!1,this.heading="",this.description="",this.expandIconPlacement="right",this.disabled=!1,this.variant="default",this.items=[],this.selected=[],this.allowHtmlLabel=!1,this.disableLocalSearch=!1,this.pageSize=200,this.placeholderLabel="Loading…",this.searchPlaceholder="Search...",this.itemsLabel="attributes",this.restoreLabel="Restore",this.clearLabel="Clear",this.gridRows=6,this.gridColumns=3,this.minColumnWidth="220px",this.laneHeight=32,this.orientation="horizontal",this.maxHeight="320px",this.matrixColumns=20,this.virtualize=!1,this.virtualizeThreshold=60,this.overscan=4,this._detailOpen=!1,this._searchTerm="",this._selectedSet=new Set,this._showSelectedOnly=!1,this.showSelectedToggle=!1,this.selectedOnlyLabel="Selected",this.showAllLabel="Show all",this._restoreDefaults=null,this._gridResizeObserver=null,this._virtCtrl=null,this._rowVirtCtrl=null,this._colVirtCtrl=null,this._pageCache=new Map,this._pendingPages=new Set}get _isInfiniteMode(){return"selection"===this.variant&&"function"==typeof this.fetchPage&&"number"==typeof this.totalCount&&"both"!==this.orientation}_effectiveTotalCount(){return this._isInfiniteMode?this.totalCount??0:this._filteredItems.length}_getItemAt(e){if(!this._isInfiniteMode)return this._filteredItems[e];const t=Math.max(1,this.pageSize),i=Math.floor(e/t),M=this._pageCache.get(i);return M?M[e-i*t]:void 0}_scheduleFetchForRange(e,t){if(!this._isInfiniteMode||!this.fetchPage)return;const i=Math.max(1,this.pageSize),M=this.totalCount??0;if(M<=0)return;const n=Math.floor(e/i),o=Math.floor(Math.min(t,M-1)/i);for(let e=n;e<=o;e++)this._pageCache.has(e)||this._pendingPages.has(e)||this._loadPage(e)}async _loadPage(e){if(!this.fetchPage)return;const t=Math.max(1,this.pageSize),i=e*t,M=this.totalCount??0,n=Math.min(t,Math.max(0,M-i));if(!(n<=0)){this._pendingPages.add(e);try{const t=await this.fetchPage(i,n);this._pageCache.set(e,Array.isArray(t)?t:[]),this.dispatchEvent(new CustomEvent("nile-page-load",{detail:{pageIndex:e,offset:i,limit:n,rows:this._pageCache.get(e)},bubbles:!0,composed:!0}))}catch(t){this.dispatchEvent(new CustomEvent("nile-page-error",{detail:{pageIndex:e,offset:i,limit:n,error:t},bubbles:!0,composed:!0}))}finally{this._pendingPages.delete(e),this.requestUpdate()}}}resetPages(){this._pageCache=new Map,this._pendingPages=new Set,this.requestUpdate()}get _isVirtualized(){return!!Dk&&(!!this._isInfiniteMode||"selection"===this.variant&&(this.virtualize||this.items.length>this.virtualizeThreshold))}get _columnWidthPx(){const e=parseInt(this.minColumnWidth,10);return Number.isFinite(e)&&e>0?e:220}firstUpdated(){this._detailOpen=this.open,this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this._syncSelectedFromProperty(),null===this._restoreDefaults&&(this._restoreDefaults=[...this._selectedSet]),this._setupGridResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._gridResizeObserver?.disconnect(),this._gridResizeObserver=null}updated(e){"selection"===this.variant&&(this._setupGridResizeObserver(),this._syncVirtualizer(),this._scheduleTooltipOverflowCheck())}_syncVirtualizer(){if(!Dk)return;if(!this._isVirtualized)return this._virtCtrl=null,this._rowVirtCtrl=null,void(this._colVirtCtrl=null);const e=this.shadowRoot?.querySelector(".detail__selection-grid");if(!e)return;if("both"===this.orientation)return this._virtCtrl=null,void this._syncBothVirtualizers();this._rowVirtCtrl=null,this._colVirtCtrl=null;const t=this._effectiveTotalCount(),i="vertical"===this.orientation,M=Math.max(1,i?this.gridColumns:this.gridRows),n=i?this.laneHeight:this._columnWidthPx;if(!this._virtCtrl)return void(this._virtCtrl=new no(this,{count:t,getScrollElement:()=>this.shadowRoot?.querySelector(".detail__selection-grid"),estimateSize:()=>n,horizontal:!i,lanes:M,overscan:this.overscan}));const o=this._virtCtrl.getVirtualizer(),r=o.options,s=!!r.horizontal!=!i;(r.count!==t||r.lanes!==M||r.overscan!==this.overscan||s)&&(o.setOptions({...r,count:t,lanes:M,overscan:this.overscan,horizontal:!i,estimateSize:()=>n}),o.measure())}_syncBothVirtualizers(){const e=this._filteredItems.length,t=Math.max(1,this.matrixColumns),i=Math.max(1,Math.ceil(e/t)),M=this._columnWidthPx,n=this.laneHeight,o=()=>this.shadowRoot?.querySelector(".detail__selection-grid");if(this._rowVirtCtrl){const e=this._rowVirtCtrl.getVirtualizer(),t=e.options;t.count===i&&t.overscan===this.overscan||(e.setOptions({...t,count:i,overscan:this.overscan,estimateSize:()=>n}),e.measure())}else this._rowVirtCtrl=new no(this,{count:i,getScrollElement:o,estimateSize:()=>n,horizontal:!1,overscan:this.overscan});if(this._colVirtCtrl){const e=this._colVirtCtrl.getVirtualizer(),i=e.options;i.count===t&&i.overscan===this.overscan||(e.setOptions({...i,count:t,overscan:this.overscan,estimateSize:()=>M}),e.measure())}else this._colVirtCtrl=new no(this,{count:t,getScrollElement:o,estimateSize:()=>M,horizontal:!0,overscan:this.overscan})}_setupGridResizeObserver(){if("selection"!==this.variant)return;if("undefined"==typeof ResizeObserver)return;const e=this.shadowRoot?.querySelector(".detail__selection-grid");e&&(this._gridResizeObserver||(this._gridResizeObserver=new ResizeObserver((()=>this._scheduleTooltipOverflowCheck())),this._gridResizeObserver.observe(e)))}_scheduleTooltipOverflowCheck(){"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((()=>this._updateTooltipOverflowStates()))}async _updateTooltipOverflowStates(){const e=this.shadowRoot?.querySelectorAll(".detail__selection-tooltip");if(e)for(const t of e){const e=t.querySelector("nile-checkbox");if(!e)continue;e.updateComplete&&await e.updateComplete;const i=e.shadowRoot?.querySelector('[part="label"]');!!i&&i.scrollWidth>i.clientWidth+1?t.removeAttribute("disabled"):t.setAttribute("disabled","")}}_onSelectedPropertyChange(){this._syncSelectedFromProperty()}_onConfigChange(){this._applyConfig()}_applyConfig(){const e=this.config;if(e){if(void 0!==e.variant&&(this.variant=e.variant),void 0!==e.heading&&(this.heading=e.heading),void 0!==e.description&&(this.description=e.description),void 0!==e.itemsLabel&&(this.itemsLabel=e.itemsLabel),void 0!==e.open&&(this.open=e.open),void 0!==e.disabled&&(this.disabled=e.disabled),void 0!==e.items&&(this.items=e.items),void 0!==e.selected&&(this.selected=e.selected),void 0!==e.renderItemConfig&&(this.renderItemConfig=e.renderItemConfig),void 0!==e.allowHtmlLabel&&(this.allowHtmlLabel=e.allowHtmlLabel),e.layout){const t=e.layout;void 0!==t.orientation&&(this.orientation=t.orientation),void 0!==t.gridRows&&(this.gridRows=t.gridRows),void 0!==t.gridColumns&&(this.gridColumns=t.gridColumns),void 0!==t.matrixColumns&&(this.matrixColumns=t.matrixColumns),void 0!==t.minColumnWidth&&(this.minColumnWidth=t.minColumnWidth),void 0!==t.laneHeight&&(this.laneHeight=t.laneHeight),void 0!==t.maxHeight&&(this.maxHeight=t.maxHeight),void 0!==t.expandIconPlacement&&(this.expandIconPlacement=t.expandIconPlacement)}e.search&&(void 0!==e.search.placeholder&&(this.searchPlaceholder=e.search.placeholder),void 0!==e.search.disableLocal&&(this.disableLocalSearch=e.search.disableLocal)),e.virtualization&&(void 0!==e.virtualization.enabled&&(this.virtualize=e.virtualization.enabled),void 0!==e.virtualization.threshold&&(this.virtualizeThreshold=e.virtualization.threshold),void 0!==e.virtualization.overscan&&(this.overscan=e.virtualization.overscan)),e.pagination&&(void 0!==e.pagination.totalCount&&(this.totalCount=e.pagination.totalCount),void 0!==e.pagination.pageSize&&(this.pageSize=e.pagination.pageSize),void 0!==e.pagination.fetchPage&&(this.fetchPage=e.pagination.fetchPage),void 0!==e.pagination.placeholderLabel&&(this.placeholderLabel=e.pagination.placeholderLabel)),e.labels&&(void 0!==e.labels.restore&&(this.restoreLabel=e.labels.restore),void 0!==e.labels.clear&&(this.clearLabel=e.labels.clear),void 0!==e.labels.selectedOnly&&(this.selectedOnlyLabel=e.labels.selectedOnly),void 0!==e.labels.showAll&&(this.showAllLabel=e.labels.showAll)),void 0!==e.showSelectedToggle&&(this.showSelectedToggle=e.showSelectedToggle)}}_syncSelectedFromProperty(){this._selectedSet=new Set(this.selected||[])}_getItemValue(e){const t=this.renderItemConfig;return t?.getValue?String(t.getValue(e)):"string"==typeof e?e:String(e.value??"")}_getItemLabel(e){const t=this.renderItemConfig;return t?.getDisplayText?t.getDisplayText(e):"string"==typeof e?e:e.label??this._getItemValue(e)}_getItemSearchText(e){const t=this.renderItemConfig;return t?.getSearchText?t.getSearchText(e):this._getItemLabel(e)}_getItemDescription(e){const t=this.renderItemConfig;return t?.getDescription?t.getDescription(e)??"":"string"==typeof e?"":e.description??""}_getItemPrefix(e){const t=this.renderItemConfig;return t?.getPrefix?t.getPrefix(e)??"":"string"==typeof e?"":e.prefix??""}_getItemSuffix(e){const t=this.renderItemConfig;return t?.getSuffix?t.getSuffix(e)??"":"string"==typeof e?"":e.suffix??""}_getItemDisabled(e){const t=this.renderItemConfig;return t?.getDisabled?!!t.getDisabled(e):"string"!=typeof e&&!!e.disabled}_getItemClassName(e){const t=this.renderItemConfig;return t?.getClassName?t.getClassName(e)??"":"string"==typeof e?"":e.className??""}get _filteredItems(){let e=this.items;if(this._showSelectedOnly&&(e=e.filter((e=>this._selectedSet.has(this._getItemValue(e))))),this.disableLocalSearch)return e;const t=this._searchTerm.trim().toLowerCase();return t?e.filter((e=>this._getItemSearchText(e).toLowerCase().includes(t))):e}_onToggleSelectedOnly(e){e.preventDefault();const t=!this._showSelectedOnly;t&&0===this._selectedSet.size||(this._showSelectedOnly=t)}_selectableValues(){return(this._isInfiniteMode?Array.from(this._pageCache.values()).flat():this.items).filter((e=>!this._getItemDisabled(e))).map((e=>this._getItemValue(e)))}get _allChecked(){const e=this._selectableValues();return 0!==e.length&&e.every((e=>this._selectedSet.has(e)))}get _indeterminate(){const e=this._selectableValues(),t=e.filter((e=>this._selectedSet.has(e))).length;return t>0&&t<e.length}get _countLabel(){const e=this._isInfiniteMode?this.totalCount??0:this.items.length;return`${this._selectedSet.size} of ${e} ${this.itemsLabel} selected`}_emitSelectionChange(){this.selected=[...this._selectedSet],this.dispatchEvent(new CustomEvent("nile-change",{detail:{selected:[...this._selectedSet]},bubbles:!0,composed:!0}))}_onItemChange(e,t,i){if(t)return void i.preventDefault();const M=i.target,n=new Set(this._selectedSet);M.checked?n.add(e):n.delete(e),this._selectedSet=n,this._emitSelectionChange()}_onSelectAllChange(e){const t=e.target,i=this._selectableValues(),M=new Set(this._selectedSet);t.checked?i.forEach((e=>M.add(e))):i.forEach((e=>M.delete(e))),this._selectedSet=M,this._emitSelectionChange()}_emitSearch(e){this.dispatchEvent(new CustomEvent("nile-search",{detail:{value:e},bubbles:!0,composed:!0}))}_onSearchInput(e){const t=e.target.value??"";this._searchTerm=t,this.disableLocalSearch&&this._emitSearch(t)}_onSearchClear(){this._searchTerm="",this.disableLocalSearch&&this._emitSearch("")}_onRestore(e){e.preventDefault();const t=this._restoreDefaults??this._selectableValues();this._selectedSet=new Set(t),this._emitSelectionChange()}_onClear(e){e.preventDefault(),this._selectedSet=new Set,this._showSelectedOnly=!1,this._emitSelectionChange()}_stopHeaderToggle(e){e.stopPropagation()}_handleSummaryClick(e){e.preventDefault(),function(e){e.disabled||(e.open?uk(e):ck(e))}(this)}_handleSummaryKeyDown(e){!function(e,t){e.preventDefault(),"Enter"!==e.key&&" "!==e.key||(t.open?uk(t):ck(t)),"ArrowUp"!==e.key&&"ArrowLeft"!==e.key||uk(t),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||ck(t)}(e,this)}async handleOpenChange(){this.open?(this._detailOpen=!0,await async function(e){if(e.emit("nile-show",{cancelable:!0}).defaultPrevented)return void(e.open=!1);await Ct(e.body),e.body.hidden=!1;const{keyframes:t,options:i}=Wt(e,"detail.show",{dir:"ltr"});await vt(e.body,Ut(t,e.body.scrollHeight),i),e.body.style.height="auto",e.emit("nile-after-show")}(this)):(await async function(e){if(e.emit("nile-hide",{cancelable:!0}).defaultPrevented)return void(e.open=!0);await Ct(e.body);const{keyframes:t,options:i}=Wt(e,"detail.hide",{dir:"ltr"});await vt(e.body,Ut(t,e.body.scrollHeight),i),e.body.hidden=!0,e.body.style.height="auto",e.emit("nile-after-hide")}(this),this._detailOpen=!1)}async show(){return ck(this)}async hide(){return uk(this)}get _summaryLabel(){return[this.heading,this.description].filter(Boolean).join(", ")}_renderSelectionLabel(){return _`
|
|
19427
19450
|
<div part="selection-label" class="detail__selection-label">
|
|
19428
19451
|
<nile-checkbox
|
|
19429
19452
|
part="select-all"
|
|
@@ -19441,21 +19464,36 @@ a {
|
|
|
19441
19464
|
</div>
|
|
19442
19465
|
`}_renderSelectionBody(){const e=this._isVirtualized,t="vertical"===this.orientation,i="both"===this.orientation,M=this.laneHeight,n=this._columnWidthPx;let o="";if(e)if(i)o=`max-height: ${this.maxHeight}; height: ${this.maxHeight};`;else if(t)o=`max-height: ${this.maxHeight}; height: ${this.maxHeight};`;else{o=`height: ${Math.max(1,this.gridRows)*M}px;`}else if(t){o=`grid-template-columns: repeat(${Math.max(1,this.gridColumns)}, minmax(0, 1fr)); grid-auto-flow: row; max-height: ${this.maxHeight}; overflow-y: auto; overflow-x: hidden;`}else{o=`grid-template-rows: repeat(${Math.max(1,this.gridRows)}, auto); grid-auto-columns: minmax(${this.minColumnWidth}, 1fr);`}return _`
|
|
19443
19466
|
<div part="selection-toolbar" class="detail__selection-toolbar">
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19467
|
+
<slot name="tooblar-actions-prefix"></slot>
|
|
19468
|
+
<slot name="toolbar-search" class="detail__selection-search-slot">
|
|
19469
|
+
<nile-input
|
|
19470
|
+
part="search"
|
|
19471
|
+
class="detail__selection-search"
|
|
19472
|
+
placeholder=${this.searchPlaceholder}
|
|
19473
|
+
clearable
|
|
19474
|
+
.value=${this._searchTerm}
|
|
19475
|
+
@nile-input=${this._onSearchInput}
|
|
19476
|
+
@nile-clear=${this._onSearchClear}
|
|
19477
|
+
>
|
|
19478
|
+
<nile-icon slot="prefix" name="search" library="system"></nile-icon>
|
|
19479
|
+
</nile-input>
|
|
19480
|
+
</slot>
|
|
19481
|
+
<slot name="toolbar-actions" class="detail__selection-actions">
|
|
19482
|
+
${this.showSelectedToggle?_`
|
|
19483
|
+
<nile-link
|
|
19484
|
+
href="#"
|
|
19485
|
+
variant="subtle"
|
|
19486
|
+
class="detail__selected-toggle"
|
|
19487
|
+
@click=${this._onToggleSelectedOnly}
|
|
19488
|
+
>
|
|
19489
|
+
<nile-icon slot="prefix" name="filter" library="system"></nile-icon>
|
|
19490
|
+
${this._showSelectedOnly?this.showAllLabel:this.selectedOnlyLabel}
|
|
19491
|
+
</nile-link>
|
|
19492
|
+
`:B}
|
|
19456
19493
|
<nile-link href="#" variant="subtle" @click=${this._onRestore}>${this.restoreLabel}</nile-link>
|
|
19457
19494
|
<nile-link href="#" variant="subtle" @click=${this._onClear}>${this.clearLabel}</nile-link>
|
|
19458
|
-
</
|
|
19495
|
+
</slot>
|
|
19496
|
+
<slot name="tooblar-actions-suffix"></slot>
|
|
19459
19497
|
</div>
|
|
19460
19498
|
<div
|
|
19461
19499
|
part="selection-grid"
|
|
@@ -19549,7 +19587,7 @@ a {
|
|
|
19549
19587
|
<slot id="content" class="detail__content"></slot>
|
|
19550
19588
|
</div>
|
|
19551
19589
|
</details>
|
|
19552
|
-
`}};dk.styles=Nk,e([je("details")],dk.prototype,"detail",void 0),e([je("summary")],dk.prototype,"header",void 0),e([je(".detail__body")],dk.prototype,"body",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],dk.prototype,"open",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"heading",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"description",void 0),e([ue({attribute:!0,reflect:!0})],dk.prototype,"expandIconPlacement",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],dk.prototype,"disabled",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"variant",void 0),e([ue({attribute:!1,type:Array})],dk.prototype,"items",void 0),e([ue({attribute:!1,type:Array})],dk.prototype,"selected",void 0),e([ue({attribute:!1})],dk.prototype,"renderItemConfig",void 0),e([ue({attribute:"allow-html-label",type:Boolean})],dk.prototype,"allowHtmlLabel",void 0),e([ue({attribute:"disable-local-search",type:Boolean})],dk.prototype,"disableLocalSearch",void 0),e([ue({attribute:"total-count",type:Number})],dk.prototype,"totalCount",void 0),e([ue({attribute:"page-size",type:Number})],dk.prototype,"pageSize",void 0),e([ue({attribute:!1})],dk.prototype,"fetchPage",void 0),e([ue({attribute:"placeholder-label",type:String})],dk.prototype,"placeholderLabel",void 0),e([ue({attribute:!1})],dk.prototype,"config",void 0),e([ue({attribute:"search-placeholder",type:String})],dk.prototype,"searchPlaceholder",void 0),e([ue({attribute:"items-label",type:String})],dk.prototype,"itemsLabel",void 0),e([ue({attribute:"restore-label",type:String})],dk.prototype,"restoreLabel",void 0),e([ue({attribute:"clear-label",type:String})],dk.prototype,"clearLabel",void 0),e([ue({attribute:"grid-rows",type:Number})],dk.prototype,"gridRows",void 0),e([ue({attribute:"grid-columns",type:Number})],dk.prototype,"gridColumns",void 0),e([ue({attribute:"min-column-width",type:String})],dk.prototype,"minColumnWidth",void 0),e([ue({attribute:"lane-height",type:Number})],dk.prototype,"laneHeight",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"orientation",void 0),e([ue({attribute:"max-height",type:String})],dk.prototype,"maxHeight",void 0),e([ue({attribute:"matrix-columns",type:Number})],dk.prototype,"matrixColumns",void 0),e([ue({attribute:!0,type:Boolean})],dk.prototype,"virtualize",void 0),e([ue({attribute:"virtualize-threshold",type:Number})],dk.prototype,"virtualizeThreshold",void 0),e([ue({attribute:"overscan",type:Number})],dk.prototype,"overscan",void 0),e([De()],dk.prototype,"_detailOpen",void 0),e([De()],dk.prototype,"_searchTerm",void 0),e([De()],dk.prototype,"_selectedSet",void 0),e([We("selected",{waitUntilFirstUpdate:!1})],dk.prototype,"_onSelectedPropertyChange",null),e([We("config",{waitUntilFirstUpdate:!1})],dk.prototype,"_onConfigChange",null),e([We("open",{waitUntilFirstUpdate:!0})],dk.prototype,"handleOpenChange",null),dk=e([ge("nile-detail")],dk);const jk=r`
|
|
19590
|
+
`}};dk.styles=Nk,e([je("details")],dk.prototype,"detail",void 0),e([je("summary")],dk.prototype,"header",void 0),e([je(".detail__body")],dk.prototype,"body",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],dk.prototype,"open",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"heading",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"description",void 0),e([ue({attribute:!0,reflect:!0})],dk.prototype,"expandIconPlacement",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],dk.prototype,"disabled",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"variant",void 0),e([ue({attribute:!1,type:Array})],dk.prototype,"items",void 0),e([ue({attribute:!1,type:Array})],dk.prototype,"selected",void 0),e([ue({attribute:!1})],dk.prototype,"renderItemConfig",void 0),e([ue({attribute:"allow-html-label",type:Boolean})],dk.prototype,"allowHtmlLabel",void 0),e([ue({attribute:"disable-local-search",type:Boolean})],dk.prototype,"disableLocalSearch",void 0),e([ue({attribute:"total-count",type:Number})],dk.prototype,"totalCount",void 0),e([ue({attribute:"page-size",type:Number})],dk.prototype,"pageSize",void 0),e([ue({attribute:!1})],dk.prototype,"fetchPage",void 0),e([ue({attribute:"placeholder-label",type:String})],dk.prototype,"placeholderLabel",void 0),e([ue({attribute:!1})],dk.prototype,"config",void 0),e([ue({attribute:"search-placeholder",type:String})],dk.prototype,"searchPlaceholder",void 0),e([ue({attribute:"items-label",type:String})],dk.prototype,"itemsLabel",void 0),e([ue({attribute:"restore-label",type:String})],dk.prototype,"restoreLabel",void 0),e([ue({attribute:"clear-label",type:String})],dk.prototype,"clearLabel",void 0),e([ue({attribute:"grid-rows",type:Number})],dk.prototype,"gridRows",void 0),e([ue({attribute:"grid-columns",type:Number})],dk.prototype,"gridColumns",void 0),e([ue({attribute:"min-column-width",type:String})],dk.prototype,"minColumnWidth",void 0),e([ue({attribute:"lane-height",type:Number})],dk.prototype,"laneHeight",void 0),e([ue({attribute:!0,type:String,reflect:!0})],dk.prototype,"orientation",void 0),e([ue({attribute:"max-height",type:String})],dk.prototype,"maxHeight",void 0),e([ue({attribute:"matrix-columns",type:Number})],dk.prototype,"matrixColumns",void 0),e([ue({attribute:!0,type:Boolean})],dk.prototype,"virtualize",void 0),e([ue({attribute:"virtualize-threshold",type:Number})],dk.prototype,"virtualizeThreshold",void 0),e([ue({attribute:"overscan",type:Number})],dk.prototype,"overscan",void 0),e([De()],dk.prototype,"_detailOpen",void 0),e([De()],dk.prototype,"_searchTerm",void 0),e([De()],dk.prototype,"_selectedSet",void 0),e([De()],dk.prototype,"_showSelectedOnly",void 0),e([ue({attribute:"show-selected-toggle",type:Boolean,reflect:!0})],dk.prototype,"showSelectedToggle",void 0),e([ue({attribute:"selected-only-label",type:String})],dk.prototype,"selectedOnlyLabel",void 0),e([ue({attribute:"show-all-label",type:String})],dk.prototype,"showAllLabel",void 0),e([We("selected",{waitUntilFirstUpdate:!1})],dk.prototype,"_onSelectedPropertyChange",null),e([We("config",{waitUntilFirstUpdate:!1})],dk.prototype,"_onConfigChange",null),e([We("open",{waitUntilFirstUpdate:!0})],dk.prototype,"handleOpenChange",null),dk=e([ge("nile-detail")],dk);const jk=r`
|
|
19553
19591
|
:host {
|
|
19554
19592
|
display: inline-block;
|
|
19555
19593
|
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|