@aquera/nile-elements 0.1.57 → 0.1.58-beta-1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/demo/index.html +10 -26
- package/demo/index.js +83 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +276 -281
- package/dist/internal/resizable-table-helper.cjs.js +2 -0
- package/dist/internal/resizable-table-helper.cjs.js.map +1 -0
- package/dist/internal/resizable-table-helper.esm.js +1 -0
- package/dist/internal/resizable-table-styles.cjs.js +2 -0
- package/dist/internal/resizable-table-styles.cjs.js.map +1 -0
- package/dist/internal/resizable-table-styles.esm.js +120 -0
- package/dist/nile-table-body/index.cjs.js +1 -1
- package/dist/nile-table-body/index.esm.js +1 -1
- package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
- package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.css.cjs.js +1 -1
- package/dist/nile-table-body/nile-table-body.css.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.css.esm.js +5 -2
- package/dist/nile-table-body/nile-table-body.esm.js +3 -2
- package/dist/nile-table-cell-item/index.cjs.js +1 -1
- package/dist/nile-table-cell-item/index.esm.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js.map +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +21 -3
- package/dist/nile-table-cell-item/nile-table-cell-item.esm.js +8 -3
- package/dist/nile-table-header-item/index.cjs.js +1 -1
- package/dist/nile-table-header-item/index.esm.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +8 -2
- package/dist/nile-table-header-item/nile-table-header-item.esm.js +64 -32
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/resizable-table-helper.d.ts +59 -0
- package/dist/src/internal/resizable-table-helper.js +111 -0
- package/dist/src/internal/resizable-table-helper.js.map +1 -0
- package/dist/src/internal/resizable-table-styles.d.ts +16 -0
- package/dist/src/internal/resizable-table-styles.js +137 -0
- package/dist/src/internal/resizable-table-styles.js.map +1 -0
- package/dist/src/nile-table-body/nile-table-body.css.js +4 -0
- package/dist/src/nile-table-body/nile-table-body.css.js.map +1 -1
- package/dist/src/nile-table-body/nile-table-body.d.ts +2 -0
- package/dist/src/nile-table-body/nile-table-body.js +11 -0
- package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +20 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.d.ts +3 -0
- package/dist/src/nile-table-cell-item/nile-table-cell-item.js +27 -8
- package/dist/src/nile-table-cell-item/nile-table-cell-item.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js +7 -0
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.d.ts +3 -0
- package/dist/src/nile-table-header-item/nile-table-header-item.js +86 -35
- package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -2
- package/src/internal/resizable-table-helper.ts +151 -0
- package/src/internal/resizable-table-styles.ts +144 -0
- package/src/nile-table-body/nile-table-body.css.ts +4 -0
- package/src/nile-table-body/nile-table-body.ts +10 -0
- package/src/nile-table-cell-item/nile-table-cell-item.css.ts +20 -1
- package/src/nile-table-cell-item/nile-table-cell-item.ts +22 -5
- package/src/nile-table-header-item/nile-table-header-item.css.ts +7 -0
- package/src/nile-table-header-item/nile-table-header-item.ts +94 -45
- package/vscode-html-custom-data.json +59 -138
- package/dist/nile-slider/index.cjs.js +0 -2
- package/dist/nile-slider/index.cjs.js.map +0 -1
- package/dist/nile-slider/index.esm.js +0 -1
- package/dist/nile-slider/nile-slider.cjs.js +0 -2
- package/dist/nile-slider/nile-slider.cjs.js.map +0 -1
- package/dist/nile-slider/nile-slider.css.cjs.js +0 -2
- package/dist/nile-slider/nile-slider.css.cjs.js.map +0 -1
- package/dist/nile-slider/nile-slider.css.esm.js +0 -106
- package/dist/nile-slider/nile-slider.esm.js +0 -27
- package/dist/nile-slider/nile-slider.template.cjs.js +0 -2
- package/dist/nile-slider/nile-slider.template.cjs.js.map +0 -1
- package/dist/nile-slider/nile-slider.template.esm.js +0 -59
- package/dist/nile-slider/types/nile-slider.enums.cjs.js +0 -2
- package/dist/nile-slider/types/nile-slider.enums.cjs.js.map +0 -1
- package/dist/nile-slider/types/nile-slider.enums.esm.js +0 -1
- package/dist/nile-slider/types/nile-slider.types.cjs.js +0 -2
- package/dist/nile-slider/types/nile-slider.types.cjs.js.map +0 -1
- package/dist/nile-slider/types/nile-slider.types.esm.js +0 -1
- package/dist/nile-slider/utils/nile-slider.utils.cjs.js +0 -2
- package/dist/nile-slider/utils/nile-slider.utils.cjs.js.map +0 -1
- package/dist/nile-slider/utils/nile-slider.utils.esm.js +0 -1
- package/dist/src/nile-slider/index.d.ts +0 -1
- package/dist/src/nile-slider/index.js +0 -2
- package/dist/src/nile-slider/index.js.map +0 -1
- package/dist/src/nile-slider/nile-slider.css.d.ts +0 -6
- package/dist/src/nile-slider/nile-slider.css.js +0 -118
- package/dist/src/nile-slider/nile-slider.css.js.map +0 -1
- package/dist/src/nile-slider/nile-slider.d.ts +0 -48
- package/dist/src/nile-slider/nile-slider.js +0 -217
- package/dist/src/nile-slider/nile-slider.js.map +0 -1
- package/dist/src/nile-slider/nile-slider.template.d.ts +0 -5
- package/dist/src/nile-slider/nile-slider.template.js +0 -73
- package/dist/src/nile-slider/nile-slider.template.js.map +0 -1
- package/dist/src/nile-slider/types/nile-slider.enums.d.ts +0 -10
- package/dist/src/nile-slider/types/nile-slider.enums.js +0 -2
- package/dist/src/nile-slider/types/nile-slider.enums.js.map +0 -1
- package/dist/src/nile-slider/types/nile-slider.types.d.ts +0 -1
- package/dist/src/nile-slider/types/nile-slider.types.js +0 -2
- package/dist/src/nile-slider/types/nile-slider.types.js.map +0 -1
- package/dist/src/nile-slider/utils/nile-slider.utils.d.ts +0 -11
- package/dist/src/nile-slider/utils/nile-slider.utils.js +0 -99
- package/dist/src/nile-slider/utils/nile-slider.utils.js.map +0 -1
- package/src/nile-slider/index.ts +0 -1
- package/src/nile-slider/nile-slider.css.ts +0 -119
- package/src/nile-slider/nile-slider.template.ts +0 -77
- package/src/nile-slider/nile-slider.ts +0 -215
- package/src/nile-slider/types/nile-slider.enums.ts +0 -10
- package/src/nile-slider/types/nile-slider.types.ts +0 -13
- package/src/nile-slider/utils/nile-slider.utils.ts +0 -136
package/dist/index.js
CHANGED
@@ -4427,7 +4427,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
4427
4427
|
* @license
|
4428
4428
|
* Copyright 2021 Google LLC
|
4429
4429
|
* SPDX-License-Identifier: BSD-3-Clause
|
4430
|
-
*/(this._hostElement,M),this._scrollerController=new iN(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((M=>{M.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(M),this._hostElementRO.observe(M)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((M=>this._childrenRO.observe(M))),this._scrollEventListeners.forEach((M=>M.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((M=>M.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const M=this._hostElement.style;M.display=M.display||"block",M.position=M.position||"relative",M.contain=M.contain||"size layout",this._isScroller&&(M.overflow=M.overflow||"auto",M.minHeight=M.minHeight||"150px")}_getSizer(){const M=this._hostElement;if(!this._sizer){let e=M.querySelector(`[${sN}]`);e||(e=document.createElement("div"),e.setAttribute(sN,""),M.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(sN,""),this._sizer=e}return this._sizer}async updateLayoutConfig(M){await this._layoutInitialized;const e=M.type||nN;if("function"==typeof e&&this._layout instanceof e){const e={...M};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(M){let e,t;if("function"==typeof M.type){t=M.type;const i={...M};delete i.type,e=i}else e=M;void 0===t&&(nN=t=(await Promise.resolve().then((function(){return Xx}))).FlowLayout),this._layout=new t((M=>this._handleLayoutMessage(M)),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const M=window.performance.now(),e=M-this._benchmarkStart,t=performance.getEntriesByName("uv-virtualizing","measure").filter((e=>e.startTime>=this._benchmarkStart&&e.startTime<M)).reduce(((M,e)=>M+e.duration),0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:t}}return null}_measureChildren(){const M={},e=this._children,t=this._measureChildOverride||this._measureChild;for(let i=0;i<e.length;i++){const N=e[i],o=this._first+i;(this._itemsChanged||this._toBeMeasured.has(N))&&(M[o]=t.call(this,N,this._items[o]))}this._childMeasurements=M,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(M){const{width:e,height:t}=M.getBoundingClientRect();return Object.assign({width:e,height:t},function(M){const e=window.getComputedStyle(M);return{marginTop:rN(e.marginTop),marginRight:rN(e.marginRight),marginBottom:rN(e.marginBottom),marginLeft:rN(e.marginLeft)}}(M))}async _schedule(M){this._scheduled.has(M)||(this._scheduled.add(M),await Promise.resolve(),this._scheduled.delete(M),M.call(this))}async _updateDOM(M){this._scrollSize=M.scrollSize,this._adjustRange(M.range),this._childrenPos=M.childPositions,this._scrollError=M.scrollError||null;const{_rangeChanged:e,_itemsChanged:t}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||t)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((M=>this._childrenRO.observe(M))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(M){console.warn("Error measuring performance data: ",M)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(M){if("scroll"===M.type)(M.currentTarget===window||this._clippingAncestors.includes(M.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",M)}_handleLayoutMessage(M){"stateChanged"===M.type?this._updateDOM(M):"visibilityChanged"===M.type?(this._firstVisible=M.firstVisible,this._lastVisible=M.lastVisible,this._notifyVisibility()):"unpinned"===M.type&&this._hostElement.dispatchEvent(new eN)}get _children(){const M=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(sN)||M.push(e),e=e.nextElementSibling;return M}_updateView(){const M=this._hostElement,e=this._scrollerController?.element,t=this._layout;if(M&&e&&t){let i,N,o,s;const n=M.getBoundingClientRect();i=0,N=0,o=window.innerHeight,s=window.innerWidth;const D=this._clippingAncestors.map((M=>M.getBoundingClientRect()));D.unshift(n);for(const M of D)i=Math.max(i,M.top),N=Math.max(N,M.left),o=Math.min(o,M.bottom),s=Math.min(s,M.right);const r=e.getBoundingClientRect(),a={left:n.left-r.left,top:n.top-r.top},u={width:e.scrollWidth,height:e.scrollHeight},l=i-n.top+M.scrollTop,g=N-n.left+M.scrollLeft,j=Math.max(0,o-i),c=Math.max(0,s-N);t.viewportSize={width:c,height:j},t.viewportScroll={top:l,left:g},t.totalScrollSize=u,t.offsetWithinScroller=a}}_sizeHostElement(M){const e=82e5,t=M&&null!==M.width?Math.min(e,M.width):0,i=M&&null!==M.height?Math.min(e,M.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${t}px, ${i}px)`;else{const M=this._hostElement.style;M.minWidth=t?`${t}px`:"100%",M.minHeight=i?`${i}px`:"100%"}}_positionChildren(M){M&&M.forEach((({top:M,left:e,width:t,height:i,xOffset:N,yOffset:o},s)=>{const n=this._children[s-this._first];n&&(n.style.position="absolute",n.style.boxSizing="border-box",n.style.transform=`translate(${e}px, ${M}px)`,void 0!==t&&(n.style.width=t+"px"),void 0!==i&&(n.style.height=i+"px"),n.style.left=void 0===N?null:N+"px",n.style.top=void 0===o?null:o+"px")}))}async _adjustRange(M){const{_first:e,_last:t,_firstVisible:i,_lastVisible:N}=this;this._first=M.first,this._last=M.last,this._firstVisible=M.firstVisible,this._lastVisible=M.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==t,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==i||this._lastVisible!==N}_correctScrollError(){if(this._scrollError){const{scrollTop:M,scrollLeft:e}=this._scrollerController,{top:t,left:i}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:M-t,left:e-i})}}element(M){return M===1/0&&(M=this._items.length-1),void 0===this._items?.[M]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:M})}}_scrollElementIntoView(M){if(M.index>=this._first&&M.index<=this._last)this._children[M.index-this._first].scrollIntoView(M);else if(M.index=Math.min(M.index,this._items.length-1),"smooth"===M.behavior){const e=this._layout.getScrollIntoViewCoordinates(M),{behavior:t}=M;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:t}),(()=>this._layout.getScrollIntoViewCoordinates(M)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=M}else this._layout.pin=M}_checkScrollIntoViewTarget(M){const{index:e}=this._scrollIntoViewTarget||{};e&&M?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new Ki({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new MN({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((M,e)=>{this._layoutCompleteResolver=M,this._layoutCompleteRejecter=e}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(M){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(M),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(M){if(this._layout?.measureChildren){for(const e of M)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function rN(M){const e=M?parseFloat(M):NaN;return Number.isNaN(e)?0:e}function aN(M){if(null!==M.assignedSlot)return M.assignedSlot;if(null!==M.parentElement)return M.parentElement;const e=M.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}const uN=dM(class extends $i{constructor(M){if(super(M),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(M,e)=>((M,e)=>R`${e}: ${JSON.stringify(M,null,2)}`)(M,e+this._first),this._keyFunction=(M,e)=>(M=>M)(M,this._first),this._items=[],M.type!==OM)throw new Error("The virtualize directive can only be used in child expressions")}render(M){M&&this._setFunctions(M);const e=[];if(this._first>=0&&this._last>=this._first)for(let M=this._first;M<=this._last;M++)e.push(this._items[M]);return qi(e,this._keyFunction,this._renderItem)}update(M,[e]){this._setFunctions(e);const t=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(M,e):this._initialize(M,e),t?G:this.render()}async _updateVirtualizerConfig(M,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const t=M.parentNode;this._makeVirtualizer(t,e)}this._virtualizer.items=this._items}_setFunctions(M){const{renderItem:e,keyFunction:t}=M;e&&(this._renderItem=(M,t)=>e(M,t+this._first)),t&&(this._keyFunction=(M,e)=>t(M,e+this._first))}_makeVirtualizer(M,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:t,scroller:i,items:N}=e;this._virtualizer=new DN({hostElement:M,layout:t,scroller:i}),this._virtualizer.items=N,this._virtualizer.connected()}_initialize(M,e){const t=M.parentNode;t&&1===t.nodeType&&(t.addEventListener("rangeChanged",(M=>{this._first=M.first,this._last=M.last,this.setValue(this.render())})),this._makeVirtualizer(t,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});let lN=class extends PM{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.loading=!1,this.filterFunction=(M,e)=>M.toLowerCase().includes(e.toLowerCase()),this.renderItemFunction=M=>M,this.allMenuItems=[],this.menuItems=[]}connectedCallback(){super.connectedCallback(),this.renderItemFunction=M=>M}updated(M){super.updated(M),M.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),M.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),M.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction))}render(){const M=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return R`
|
4430
|
+
*/(this._hostElement,M),this._scrollerController=new iN(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((M=>{M.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(M),this._hostElementRO.observe(M)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((M=>this._childrenRO.observe(M))),this._scrollEventListeners.forEach((M=>M.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((M=>M.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const M=this._hostElement.style;M.display=M.display||"block",M.position=M.position||"relative",M.contain=M.contain||"size layout",this._isScroller&&(M.overflow=M.overflow||"auto",M.minHeight=M.minHeight||"150px")}_getSizer(){const M=this._hostElement;if(!this._sizer){let e=M.querySelector(`[${sN}]`);e||(e=document.createElement("div"),e.setAttribute(sN,""),M.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(sN,""),this._sizer=e}return this._sizer}async updateLayoutConfig(M){await this._layoutInitialized;const e=M.type||nN;if("function"==typeof e&&this._layout instanceof e){const e={...M};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(M){let e,t;if("function"==typeof M.type){t=M.type;const i={...M};delete i.type,e=i}else e=M;void 0===t&&(nN=t=(await Promise.resolve().then((function(){return Jx}))).FlowLayout),this._layout=new t((M=>this._handleLayoutMessage(M)),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const M=window.performance.now(),e=M-this._benchmarkStart,t=performance.getEntriesByName("uv-virtualizing","measure").filter((e=>e.startTime>=this._benchmarkStart&&e.startTime<M)).reduce(((M,e)=>M+e.duration),0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:t}}return null}_measureChildren(){const M={},e=this._children,t=this._measureChildOverride||this._measureChild;for(let i=0;i<e.length;i++){const N=e[i],o=this._first+i;(this._itemsChanged||this._toBeMeasured.has(N))&&(M[o]=t.call(this,N,this._items[o]))}this._childMeasurements=M,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(M){const{width:e,height:t}=M.getBoundingClientRect();return Object.assign({width:e,height:t},function(M){const e=window.getComputedStyle(M);return{marginTop:rN(e.marginTop),marginRight:rN(e.marginRight),marginBottom:rN(e.marginBottom),marginLeft:rN(e.marginLeft)}}(M))}async _schedule(M){this._scheduled.has(M)||(this._scheduled.add(M),await Promise.resolve(),this._scheduled.delete(M),M.call(this))}async _updateDOM(M){this._scrollSize=M.scrollSize,this._adjustRange(M.range),this._childrenPos=M.childPositions,this._scrollError=M.scrollError||null;const{_rangeChanged:e,_itemsChanged:t}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||t)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((M=>this._childrenRO.observe(M))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(M){console.warn("Error measuring performance data: ",M)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(M){if("scroll"===M.type)(M.currentTarget===window||this._clippingAncestors.includes(M.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",M)}_handleLayoutMessage(M){"stateChanged"===M.type?this._updateDOM(M):"visibilityChanged"===M.type?(this._firstVisible=M.firstVisible,this._lastVisible=M.lastVisible,this._notifyVisibility()):"unpinned"===M.type&&this._hostElement.dispatchEvent(new eN)}get _children(){const M=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(sN)||M.push(e),e=e.nextElementSibling;return M}_updateView(){const M=this._hostElement,e=this._scrollerController?.element,t=this._layout;if(M&&e&&t){let i,N,o,s;const n=M.getBoundingClientRect();i=0,N=0,o=window.innerHeight,s=window.innerWidth;const D=this._clippingAncestors.map((M=>M.getBoundingClientRect()));D.unshift(n);for(const M of D)i=Math.max(i,M.top),N=Math.max(N,M.left),o=Math.min(o,M.bottom),s=Math.min(s,M.right);const r=e.getBoundingClientRect(),a={left:n.left-r.left,top:n.top-r.top},u={width:e.scrollWidth,height:e.scrollHeight},l=i-n.top+M.scrollTop,g=N-n.left+M.scrollLeft,j=Math.max(0,o-i),c=Math.max(0,s-N);t.viewportSize={width:c,height:j},t.viewportScroll={top:l,left:g},t.totalScrollSize=u,t.offsetWithinScroller=a}}_sizeHostElement(M){const e=82e5,t=M&&null!==M.width?Math.min(e,M.width):0,i=M&&null!==M.height?Math.min(e,M.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${t}px, ${i}px)`;else{const M=this._hostElement.style;M.minWidth=t?`${t}px`:"100%",M.minHeight=i?`${i}px`:"100%"}}_positionChildren(M){M&&M.forEach((({top:M,left:e,width:t,height:i,xOffset:N,yOffset:o},s)=>{const n=this._children[s-this._first];n&&(n.style.position="absolute",n.style.boxSizing="border-box",n.style.transform=`translate(${e}px, ${M}px)`,void 0!==t&&(n.style.width=t+"px"),void 0!==i&&(n.style.height=i+"px"),n.style.left=void 0===N?null:N+"px",n.style.top=void 0===o?null:o+"px")}))}async _adjustRange(M){const{_first:e,_last:t,_firstVisible:i,_lastVisible:N}=this;this._first=M.first,this._last=M.last,this._firstVisible=M.firstVisible,this._lastVisible=M.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==t,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==i||this._lastVisible!==N}_correctScrollError(){if(this._scrollError){const{scrollTop:M,scrollLeft:e}=this._scrollerController,{top:t,left:i}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:M-t,left:e-i})}}element(M){return M===1/0&&(M=this._items.length-1),void 0===this._items?.[M]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:M})}}_scrollElementIntoView(M){if(M.index>=this._first&&M.index<=this._last)this._children[M.index-this._first].scrollIntoView(M);else if(M.index=Math.min(M.index,this._items.length-1),"smooth"===M.behavior){const e=this._layout.getScrollIntoViewCoordinates(M),{behavior:t}=M;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:t}),(()=>this._layout.getScrollIntoViewCoordinates(M)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=M}else this._layout.pin=M}_checkScrollIntoViewTarget(M){const{index:e}=this._scrollIntoViewTarget||{};e&&M?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new Ki({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new MN({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((M,e)=>{this._layoutCompleteResolver=M,this._layoutCompleteRejecter=e}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(M){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(M),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(M){if(this._layout?.measureChildren){for(const e of M)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function rN(M){const e=M?parseFloat(M):NaN;return Number.isNaN(e)?0:e}function aN(M){if(null!==M.assignedSlot)return M.assignedSlot;if(null!==M.parentElement)return M.parentElement;const e=M.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}const uN=dM(class extends $i{constructor(M){if(super(M),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(M,e)=>((M,e)=>R`${e}: ${JSON.stringify(M,null,2)}`)(M,e+this._first),this._keyFunction=(M,e)=>(M=>M)(M,this._first),this._items=[],M.type!==OM)throw new Error("The virtualize directive can only be used in child expressions")}render(M){M&&this._setFunctions(M);const e=[];if(this._first>=0&&this._last>=this._first)for(let M=this._first;M<=this._last;M++)e.push(this._items[M]);return qi(e,this._keyFunction,this._renderItem)}update(M,[e]){this._setFunctions(e);const t=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(M,e):this._initialize(M,e),t?G:this.render()}async _updateVirtualizerConfig(M,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const t=M.parentNode;this._makeVirtualizer(t,e)}this._virtualizer.items=this._items}_setFunctions(M){const{renderItem:e,keyFunction:t}=M;e&&(this._renderItem=(M,t)=>e(M,t+this._first)),t&&(this._keyFunction=(M,e)=>t(M,e+this._first))}_makeVirtualizer(M,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:t,scroller:i,items:N}=e;this._virtualizer=new DN({hostElement:M,layout:t,scroller:i}),this._virtualizer.items=N,this._virtualizer.connected()}_initialize(M,e){const t=M.parentNode;t&&1===t.nodeType&&(t.addEventListener("rangeChanged",(M=>{this._first=M.first,this._last=M.last,this.setValue(this.render())})),this._makeVirtualizer(t,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});let lN=class extends PM{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.loading=!1,this.filterFunction=(M,e)=>M.toLowerCase().includes(e.toLowerCase()),this.renderItemFunction=M=>M,this.allMenuItems=[],this.menuItems=[]}connectedCallback(){super.connectedCallback(),this.renderItemFunction=M=>M}updated(M){super.updated(M),M.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),M.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),M.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction))}render(){const M=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return R`
|
4431
4431
|
<nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick>
|
4432
4432
|
<nile-input class="nile-auto-complete--input"
|
4433
4433
|
?no-border=${this.noBorder}
|
@@ -7818,6 +7818,50 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
7818
7818
|
</slot>
|
7819
7819
|
</div>
|
7820
7820
|
`}};M([gM({type:Boolean,reflect:!0})],pL.prototype,"overlaysidebar",void 0),M([gM({reflect:!0})],pL.prototype,"placement",void 0),M([gM({type:Boolean,reflect:!0})],pL.prototype,"isopen",void 0),pL=M([aM("nile-sidebar-wrapper")],pL);const SL=s`
|
7821
|
+
:host([resizable]) {
|
7822
|
+
position: relative;
|
7823
|
+
}
|
7824
|
+
|
7825
|
+
:host([resizable]) .header__item__wrapper {
|
7826
|
+
border-right: 1px solid var(--nile-colors-neutral-400);
|
7827
|
+
position: relative;
|
7828
|
+
}
|
7829
|
+
`,QL=s`
|
7830
|
+
.resizer {
|
7831
|
+
position: absolute;
|
7832
|
+
right: -2px;
|
7833
|
+
top: -1000px;
|
7834
|
+
bottom: -1000px;
|
7835
|
+
width: 8px;
|
7836
|
+
cursor: ew-resize;
|
7837
|
+
user-select: none;
|
7838
|
+
transition: background-color 0.2s;
|
7839
|
+
z-index: 10;
|
7840
|
+
opacity: 0;
|
7841
|
+
transition: opacity 0.2s ease;
|
7842
|
+
}
|
7843
|
+
|
7844
|
+
:host([resizable]):hover .resizer {
|
7845
|
+
opacity: 1;
|
7846
|
+
}
|
7847
|
+
|
7848
|
+
.resizer::before {
|
7849
|
+
content: '';
|
7850
|
+
position: absolute;
|
7851
|
+
height: 100%;
|
7852
|
+
opacity: 0.8;
|
7853
|
+
}
|
7854
|
+
|
7855
|
+
.resizer.resizing {
|
7856
|
+
border-right: 4px double var(--nile-colors-neutral-400);
|
7857
|
+
background-color: transparent;
|
7858
|
+
opacity: 1;
|
7859
|
+
}
|
7860
|
+
`,EL=s`
|
7861
|
+
.nile__table__body[resizable] {
|
7862
|
+
table-layout: fixed;
|
7863
|
+
}
|
7864
|
+
`,kL=s`
|
7821
7865
|
:host {
|
7822
7866
|
--min-cell-width:auto;
|
7823
7867
|
--cell-width:auto;
|
@@ -7826,11 +7870,20 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
7826
7870
|
box-sizing: border-box;
|
7827
7871
|
display: table-cell;
|
7828
7872
|
vertical-align: middle;
|
7829
|
-
max-width: var(--max--cell-width);
|
7830
7873
|
padding: 16px 24px;
|
7874
|
+
max-width: var(--max--cell-width);
|
7831
7875
|
min-height: var(--min--height);
|
7832
7876
|
}
|
7833
7877
|
|
7878
|
+
.cell__wrapper {
|
7879
|
+
height: 100%;
|
7880
|
+
position: relative;
|
7881
|
+
display: flex;
|
7882
|
+
align-items: center;
|
7883
|
+
overflow: hidden;
|
7884
|
+
width: 100%;
|
7885
|
+
}
|
7886
|
+
|
7834
7887
|
.column {
|
7835
7888
|
min-width:var(--min-cell-width);
|
7836
7889
|
width:var(--cell-width);
|
@@ -7843,10 +7896,99 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
7843
7896
|
/* line-height: var(--nile-type-scale-6); */
|
7844
7897
|
line-height: normal;
|
7845
7898
|
letter-spacing: 0.2px;
|
7899
|
+
overflow: hidden;
|
7900
|
+
text-overflow: ellipsis;
|
7901
|
+
white-space: nowrap;
|
7902
|
+
display: block;
|
7903
|
+
}
|
7904
|
+
|
7905
|
+
/* Import resizable styles */
|
7906
|
+
${s`
|
7907
|
+
:host([resizable]) {
|
7908
|
+
position: relative;
|
7909
|
+
overflow: hidden;
|
7910
|
+
table-layout: fixed;
|
7911
|
+
}
|
7912
|
+
`}
|
7913
|
+
${s`
|
7914
|
+
.resizer {
|
7915
|
+
position: absolute;
|
7916
|
+
right: 0;
|
7917
|
+
top: -1000px;
|
7918
|
+
bottom: -1000px;
|
7919
|
+
width: 8px;
|
7920
|
+
cursor: col-resize;
|
7921
|
+
user-select: none;
|
7922
|
+
background-color: var(--nile-colors-neutral-100);
|
7923
|
+
transition: background-color 0.2s;
|
7924
|
+
z-index: 10;
|
7925
|
+
opacity: 0;
|
7926
|
+
transition: opacity 0.2s ease;
|
7927
|
+
pointer-events: none;
|
7928
|
+
}
|
7929
|
+
|
7930
|
+
:host([resizable]):hover .resizer {
|
7931
|
+
opacity: 1;
|
7932
|
+
pointer-events: auto;
|
7933
|
+
}
|
7934
|
+
|
7935
|
+
.resizer::before {
|
7936
|
+
content: '';
|
7937
|
+
position: absolute;
|
7938
|
+
right: 3px;
|
7939
|
+
top: 0;
|
7940
|
+
width: 2px;
|
7941
|
+
height: 100%;
|
7942
|
+
background-color: var(--nile-colors-neutral-500);
|
7943
|
+
opacity: 0.8;
|
7944
|
+
}
|
7945
|
+
|
7946
|
+
.resizer:hover {
|
7947
|
+
background-color: var(--nile-colors-neutral-400);
|
7948
|
+
}
|
7949
|
+
|
7950
|
+
.resizer:hover::before {
|
7951
|
+
background-color: var(--nile-colors-neutral-700);
|
7952
|
+
opacity: 1;
|
7953
|
+
}
|
7954
|
+
|
7955
|
+
.resizer.resizing {
|
7956
|
+
background-color: var(--nile-colors-neutral-400);
|
7957
|
+
opacity: 1;
|
7958
|
+
pointer-events: auto;
|
7959
|
+
}
|
7960
|
+
|
7961
|
+
.resizer.resizing::before {
|
7962
|
+
background-color: var(--nile-colors-neutral-700);
|
7963
|
+
opacity: 1;
|
7964
|
+
width: 3px;
|
7965
|
+
}
|
7966
|
+
`}
|
7967
|
+
${s`
|
7968
|
+
:host([resizable]) ::slotted(*) {
|
7969
|
+
overflow: hidden;
|
7970
|
+
text-overflow: ellipsis;
|
7971
|
+
white-space: nowrap;
|
7972
|
+
display: block;
|
7846
7973
|
}
|
7847
|
-
|
7848
|
-
|
7849
|
-
|
7974
|
+
|
7975
|
+
:host([resizable]) ::slotted(span),
|
7976
|
+
:host([resizable]) ::slotted(div),
|
7977
|
+
:host([resizable]) ::slotted(p) {
|
7978
|
+
overflow: hidden;
|
7979
|
+
text-overflow: ellipsis;
|
7980
|
+
white-space: nowrap;
|
7981
|
+
display: block;
|
7982
|
+
}
|
7983
|
+
`}
|
7984
|
+
`;function wL(M,e){M.preventDefault(),M.stopPropagation();const{minWidth:t=50,startX:i,startWidth:N,element:o}=e,s=M.target;s.classList.add("resizing");const n=M=>{M.preventDefault(),M.stopPropagation();const e=M.pageX-i,s=Math.max(t,N+e);o.style.width=s+"px",function(M,e){const t=M.closest("nile-table-body");if(!t)return;const i="nile-table-header-item"===M.tagName.toLowerCase(),N="nile-table-cell-item",o=function(M,e){const t=M.closest("nile-table-row");if(t){const i=t.querySelectorAll(e);return Array.from(i).indexOf(M)}return 0}(M,i?"nile-table-header-item":"nile-table-cell-item");t.querySelectorAll("nile-table-row").forEach((M=>{const t=M.querySelectorAll(N);t[o]&&(t[o].style.width=e+"px")}))}(o,s)},D=()=>{s.classList.remove("resizing"),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",D)};return document.addEventListener("mousemove",n),document.addEventListener("mouseup",D),()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",D)}}function mL(M){return M.hasAttribute("resizable")}function UL(M,e=50){return t=>{wL(t,{minWidth:e,startX:t.pageX,startWidth:M.offsetWidth,element:M})}}let CL=class extends PM{constructor(){super(...arguments),this.hasSlotController=new vM(this,"[default]"),this.resizable=!1,this.handleResizeStart=UL(this,50)}static get styles(){return[kL]}render(){return this.resizable?R`
|
7985
|
+
<div class="cell__wrapper" part="nile__table-cell">
|
7986
|
+
${this.hasSlotController.test("[default]")?R` <div class="column" part="nile__table-cell"><slot></slot></div>`:""}
|
7987
|
+
<div class="resizer" @mousedown=${this.handleResizeStart}></div>
|
7988
|
+
</div>
|
7989
|
+
`:R`
|
7990
|
+
${this.hasSlotController.test("[default]")?R` <slot class="column" part="nile__table-cell"> </slot>`:""}
|
7991
|
+
`}};M([gM({type:Boolean,reflect:!0})],CL.prototype,"resizable",void 0),CL=M([aM("nile-table-cell-item")],CL);const YL=s`
|
7850
7992
|
:host {
|
7851
7993
|
display: table-row;
|
7852
7994
|
width: 100%;
|
@@ -7863,12 +8005,12 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
7863
8005
|
nile-table-row > slot::slotted(nile-table-cell-item:first-child) {
|
7864
8006
|
color: red;
|
7865
8007
|
}
|
7866
|
-
`;let
|
8008
|
+
`;let bL=class extends PM{static get styles(){return[YL]}handleSortingAlter(M){const e=[...this.querySelectorAll("nile-table-header-item")];for(let t=0;t<e.length;t++){const i=e[t];i.textContent==M.detail.value.curr_sort_string||(i.sorting_ct=0)}}render(){return R`
|
7867
8009
|
<slot
|
7868
8010
|
part="nile-row"
|
7869
8011
|
@nile-click-sort="${this.handleSortingAlter}"
|
7870
8012
|
></slot>
|
7871
|
-
`}};
|
8013
|
+
`}};bL=M([aM("nile-table-row")],bL);const fL=s`
|
7872
8014
|
:host {
|
7873
8015
|
box-sizing: border-box;
|
7874
8016
|
--nile-table-background--odd: var(--nile-colors-base-white);
|
@@ -7906,17 +8048,21 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
7906
8048
|
slot::slotted(nile-table-row:last-child) {
|
7907
8049
|
border-bottom: 0px;
|
7908
8050
|
}
|
7909
|
-
|
8051
|
+
|
8052
|
+
/* Import resizable styles */
|
8053
|
+
${EL}
|
8054
|
+
`;let vL=class extends PM{constructor(){super(...arguments),this.type="primary",this.rows_data=[],this.header_rows_data=[],this.hasResizableColumns=!1}static get styles(){return[fL]}firstUpdated(M){this.emit("nile-body-load",{value:this.type,comp:this},!0,!1)}getChildren(M,e){return M.querySelectorAll(e)}getIndexValue(M){return this.header_rows_data.indexOf(M)}checkForResizableColumns(){this.hasResizableColumns=function(M){const e=M.querySelectorAll("nile-table-header-item"),t=M.querySelectorAll("nile-table-cell-item"),i=Array.from(e).some((M=>mL(M))),N=Array.from(t).some((M=>mL(M)));return i||N}(this)}handleSlotchange(M){let e=[];this._childNodes.forEach((M=>{if(M.tagName&&"nile-table-row"===M?.tagName?.toLowerCase()){let t=this.getChildren(M,"nile-table-cell-item");if(t.length>0)t.forEach((M=>{e.push(M.innerHTML)})),this.rows_data.push(e);else{let e=this.getChildren(M,"nile-table-header-item");e.length>0&&e.forEach(((M,e)=>{this.header_rows_data.push(M.innerHTML)}))}e=[]}})),this.checkForResizableColumns()}handleSort(M){const{curr_sort_string:e,order:t}=M.detail.value,i=this.getIndexValue(e);this.emit("nile-sort",{value:{header_index:i,curr_sort_string:e,order:t}})}handleSearch(M){const e=M.detail.value;this.search__index=this.getIndexValue(M.target.textContent),this.emit("nile-table-search",{index:this.search__index,value:e})}render(){return R`
|
7910
8055
|
<div class="base" part="base">
|
7911
8056
|
<slot name="table__header" class="table__header"></slot>
|
7912
8057
|
<slot
|
7913
8058
|
@slotchange=${this.handleSlotchange}
|
7914
8059
|
@nile-click-sort=${this.handleSort}
|
7915
8060
|
class="nile__table__body"
|
8061
|
+
?resizable=${this.hasResizableColumns}
|
7916
8062
|
@nile-search=${this.handleSearch}
|
7917
8063
|
></slot>
|
7918
8064
|
</div>
|
7919
|
-
`}};M([zM("slot")],
|
8065
|
+
`}};M([zM("slot")],vL.prototype,"defaultSlot",void 0),M([function(M){return(e,t)=>{const{slot:i}=M??{},N="slot"+(i?`[name=${i}]`:":not([name])");return cM(e,t,{get(){const e=this.renderRoot?.querySelector(N);return e?.assignedNodes(M)??[]}})}}({flatten:!0})],vL.prototype,"_childNodes",void 0),M([gM()],vL.prototype,"type",void 0),M([jM()],vL.prototype,"rows_data",void 0),M([jM()],vL.prototype,"header_rows_data",void 0),M([jM()],vL.prototype,"sort__index",void 0),M([jM()],vL.prototype,"search__index",void 0),M([jM()],vL.prototype,"hasResizableColumns",void 0),vL=M([aM("nile-table-body")],vL);const ZL=s`
|
7920
8066
|
:host {
|
7921
8067
|
--cell-min-width: auto;
|
7922
8068
|
--cell-width: auto;
|
@@ -7950,6 +8096,8 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
7950
8096
|
font-style: normal;
|
7951
8097
|
/* line-height: var(--nile-type-scale-5); */
|
7952
8098
|
line-height: normal;
|
8099
|
+
text-overflow: ellipsis;
|
8100
|
+
white-space: nowrap;
|
7953
8101
|
}
|
7954
8102
|
|
7955
8103
|
nile-icon {
|
@@ -7973,38 +8121,74 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
7973
8121
|
.headers:hover .hover__arrow {
|
7974
8122
|
opacity: 0.3;
|
7975
8123
|
}
|
7976
|
-
|
7977
|
-
|
7978
|
-
|
7979
|
-
|
7980
|
-
|
7981
|
-
|
7982
|
-
|
7983
|
-
|
7984
|
-
|
7985
|
-
|
7986
|
-
|
7987
|
-
|
7988
|
-
|
7989
|
-
|
7990
|
-
|
7991
|
-
|
7992
|
-
|
7993
|
-
|
7994
|
-
|
7995
|
-
|
7996
|
-
|
7997
|
-
|
7998
|
-
|
7999
|
-
|
8000
|
-
|
8001
|
-
|
8002
|
-
|
8003
|
-
|
8004
|
-
|
8005
|
-
|
8006
|
-
|
8007
|
-
|
8124
|
+
|
8125
|
+
/* Import resizable styles */
|
8126
|
+
${SL}
|
8127
|
+
${QL}
|
8128
|
+
`;let VL=class extends PM{constructor(){super(...arguments),this.hasSlotController=new vM(this,"[default]"),this.havesort=!1,this.havefilter=!1,this.iconName="",this.resizable=!1,this.sorting_ct=0,this.handleResizeStart=UL(this,50)}static get styles(){return[ZL]}handleSort(M){this.sorting_ct++;let e=this.hasSlotController.host.innerHTML;this.emit("nile-click-sort",{value:{curr_sort_string:e,order:["normal","asc","des"][this.sorting_ct%3]}})}handleSearch(M){this.emit("nile-search",{value:M.detail.value})}render(){return this.resizable?R`
|
8129
|
+
<div class="header__item__wrapper" part="nile__table-header-cell">
|
8130
|
+
<div class="headers">
|
8131
|
+
<slot> </slot>
|
8132
|
+
${this.havesort&&this.sorting_ct%3==0?R`<nile-icon
|
8133
|
+
name="sortdown"
|
8134
|
+
size="16"
|
8135
|
+
@click=${this.handleSort}
|
8136
|
+
class="hover__arrow"
|
8137
|
+
></nile-icon>`:null}
|
8138
|
+
${this.havesort&&this.sorting_ct%3==1?R`<nile-icon
|
8139
|
+
name="sortdown"
|
8140
|
+
size="16"
|
8141
|
+
@click=${this.handleSort}
|
8142
|
+
></nile-icon>`:null}
|
8143
|
+
${this.havesort&&this.sorting_ct%3==2?R`<nile-icon
|
8144
|
+
name="sortup"
|
8145
|
+
size="16"
|
8146
|
+
@click=${this.handleSort}
|
8147
|
+
></nile-icon>`:null}
|
8148
|
+
${this.iconName?R` <nile-icon name="${this.iconName}" size="16"></nile-icon>`:R``}
|
8149
|
+
${this.havefilter?R` <nile-popover title="Filter" placement="bottom">
|
8150
|
+
<nile-icon name="filter" size="16" slot="anchor"></nile-icon>
|
8151
|
+
<nile-input
|
8152
|
+
placeholder="Search"
|
8153
|
+
@nile-input=${this.handleSearch}
|
8154
|
+
part="filter__search"
|
8155
|
+
></nile-input>
|
8156
|
+
<slot name="filter__content" part="filter__content"></slot>
|
8157
|
+
</nile-popover>`:R``}
|
8158
|
+
</div>
|
8159
|
+
<div class="resizer" @mousedown=${this.handleResizeStart}></div>
|
8160
|
+
</div>`:R`
|
8161
|
+
<div class="header__item__wrapper" part="nile__table-header-cell">
|
8162
|
+
<div class="headers">
|
8163
|
+
<slot> </slot>
|
8164
|
+
${this.havesort&&this.sorting_ct%3==0?R`<nile-icon
|
8165
|
+
name="sortdown"
|
8166
|
+
size="16"
|
8167
|
+
@click=${this.handleSort}
|
8168
|
+
class="hover__arrow"
|
8169
|
+
></nile-icon>`:null}
|
8170
|
+
${this.havesort&&this.sorting_ct%3==1?R`<nile-icon
|
8171
|
+
name="sortdown"
|
8172
|
+
size="16"
|
8173
|
+
@click=${this.handleSort}
|
8174
|
+
></nile-icon>`:null}
|
8175
|
+
${this.havesort&&this.sorting_ct%3==2?R`<nile-icon
|
8176
|
+
name="sortup"
|
8177
|
+
size="16"
|
8178
|
+
@click=${this.handleSort}
|
8179
|
+
></nile-icon>`:null}
|
8180
|
+
${this.iconName?R` <nile-icon name="${this.iconName}" size="16"></nile-icon>`:R``}
|
8181
|
+
${this.havefilter?R` <nile-popover title="Filter" placement="bottom">
|
8182
|
+
<nile-icon name="filter" size="16" slot="anchor"></nile-icon>
|
8183
|
+
<nile-input
|
8184
|
+
placeholder="Search"
|
8185
|
+
@nile-input=${this.handleSearch}
|
8186
|
+
part="filter__search"
|
8187
|
+
></nile-input>
|
8188
|
+
<slot name="filter__content" part="filter__content"></slot>
|
8189
|
+
</nile-popover>`:R``}
|
8190
|
+
</div>
|
8191
|
+
</div>`}};M([gM({type:Boolean,reflect:!0})],VL.prototype,"havesort",void 0),M([gM({type:Boolean,reflect:!0})],VL.prototype,"havefilter",void 0),M([gM({type:String,reflect:!0,attribute:"icon-name"})],VL.prototype,"iconName",void 0),M([gM({type:Boolean,reflect:!0})],VL.prototype,"resizable",void 0),M([jM()],VL.prototype,"sorting_ct",void 0),VL=M([aM("nile-table-header-item")],VL);const WL=s`
|
8008
8192
|
:host {
|
8009
8193
|
}
|
8010
8194
|
|
@@ -8091,7 +8275,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8091
8275
|
.variant__green {
|
8092
8276
|
background: var(--nile-avatar-background-color-green);
|
8093
8277
|
}
|
8094
|
-
`;let
|
8278
|
+
`;let PL=class extends PM{constructor(){super(...arguments),this.src="",this.variant="text",this.icon="user",this.name="",this.bgColor="",this.textColor="#fff",this.borderColor="",this.size="md",this.isRounded=!0,this.imageError=!1}static get styles(){return[WL]}generateInitials(){if(!this.name)return"";const M=this.name.split(" ").filter((M=>M.length>0)).map((M=>M.charAt(0).toUpperCase())).slice(0,2);return M.length>1?M[0]+M[1]:M[0]}generateVariantCode(M){const e=M.charCodeAt(0),t=1==M.length?e:M.charCodeAt(1);return(e*t+e%23+t%23)%5}getDefaultIconSize(){switch(this.size){case"sm":return"10";case"md":default:return"16";case"lg":return"20";case"xl":return"24";case"2xl":return"28"}}render(){if("image"!=this.variant||this.imageError){const M=this.generateInitials();return"text"==this.variant&&M?this.getContentWrapped(R`${M}`,M):this.getContentWrapped(this.getIconContent(),M)}return this.getImageContent()}getContentWrapped(M,e){const t=this.generateVariantCode(e);return R`
|
8095
8279
|
<div
|
8096
8280
|
class=${LM({text__avatar:!0,avatar__small:"sm"===this.size,avatar__medium:"md"===this.size,avatar__large:"lg"===this.size,avatar__extralarge:"xl"===this.size,avatar__2xl:"2xl"===this.size,avatar__rounded:this.isRounded,variant__orange:0===t&&!this.bgColor,variant__pink:1===t&&!this.bgColor,variant__blue:2===t&&!this.bgColor,variant__light_blue:3===t&&!this.bgColor,variant__green:4===t&&!this.bgColor})}
|
8097
8281
|
part="avatar__content"
|
@@ -8116,7 +8300,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8116
8300
|
style=" background-image: url(${this.src}), linear-gradient(lightgray, lightgray);"
|
8117
8301
|
@error="${()=>this.imageError=!0}"
|
8118
8302
|
@load="${()=>this.imageError=!1}"
|
8119
|
-
/>`}};M([gM({type:String,reflect:!0})],
|
8303
|
+
/>`}};M([gM({type:String,reflect:!0})],PL.prototype,"src",void 0),M([gM({type:String,reflect:!0})],PL.prototype,"variant",void 0),M([gM({type:String,reflect:!0})],PL.prototype,"icon",void 0),M([gM({type:String,reflect:!0})],PL.prototype,"name",void 0),M([gM({type:String,reflect:!0,attribute:"bg-color"})],PL.prototype,"bgColor",void 0),M([gM({type:String,reflect:!0,attribute:"text-color"})],PL.prototype,"textColor",void 0),M([gM({type:String,reflect:!0,attribute:"border-color"})],PL.prototype,"borderColor",void 0),M([gM({reflect:!0})],PL.prototype,"size",void 0),M([gM({type:Boolean,reflect:!0})],PL.prototype,"isRounded",void 0),M([jM()],PL.prototype,"imageError",void 0),PL=M([aM("nile-avatar")],PL);const RL=s`
|
8120
8304
|
:host {
|
8121
8305
|
display: block;
|
8122
8306
|
width: 100%;
|
@@ -8152,7 +8336,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8152
8336
|
[hidden] {
|
8153
8337
|
display: none;
|
8154
8338
|
}
|
8155
|
-
`;let
|
8339
|
+
`;let GL=class extends PM{constructor(){super(...arguments),this.heading="",this.subHeading=""}static get styles(){return[RL]}render(){return R`<slot class="header">
|
8156
8340
|
<slot
|
8157
8341
|
name="header__heading"
|
8158
8342
|
class="header__heading"
|
@@ -8169,7 +8353,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8169
8353
|
>
|
8170
8354
|
${this.subHeading}
|
8171
8355
|
</slot>
|
8172
|
-
</slot>`}};M([gM({reflect:!0,attribute:"heading"})],
|
8356
|
+
</slot>`}};M([gM({reflect:!0,attribute:"heading"})],GL.prototype,"heading",void 0),M([gM({reflect:!0,attribute:"sub-heading"})],GL.prototype,"subHeading",void 0),GL=M([aM("nile-page-header")],GL);const BL=s`
|
8173
8357
|
:host {
|
8174
8358
|
display:inline-flex;
|
8175
8359
|
min-width:var(--nile-empty-state-max-width);
|
@@ -8326,7 +8510,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8326
8510
|
display:flex;
|
8327
8511
|
justify-content:center;
|
8328
8512
|
}
|
8329
|
-
`;let
|
8513
|
+
`;let _L=class extends PM{constructor(){super(...arguments),this.size="md",this.variant="tonal",this.icon="error",this.grayscale=!1,this.text="Empty State",this.subText="No Data"}static get styles(){return[BL]}render(){return R`
|
8330
8514
|
<div part="container" class="${LM({"empty-state":!0,"empty-state--sm":"sm"==this.size,"empty-state--md":"md"==this.size,"empty-state--lg":"lg"==this.size})}">
|
8331
8515
|
<div part="body" class="${LM({"empty-state__body":!0})}">
|
8332
8516
|
|
@@ -8362,7 +8546,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8362
8546
|
<slot></slot>
|
8363
8547
|
</div>
|
8364
8548
|
</div>
|
8365
|
-
`}};M([gM()],
|
8549
|
+
`}};M([gM()],_L.prototype,"size",void 0),M([gM()],_L.prototype,"variant",void 0),M([gM()],_L.prototype,"icon",void 0),M([gM({type:Boolean})],_L.prototype,"grayscale",void 0),M([gM()],_L.prototype,"text",void 0),M([gM({attribute:"sub-text"})],_L.prototype,"subText",void 0),_L=M([aM("nile-empty-state")],_L);const FL=s`
|
8366
8550
|
|
8367
8551
|
:host {
|
8368
8552
|
display:block;
|
@@ -8436,7 +8620,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8436
8620
|
height:var(--nile-hero-height);
|
8437
8621
|
width:auto;
|
8438
8622
|
}
|
8439
|
-
`;let
|
8623
|
+
`;let JL=class extends PM{constructor(){super(...arguments),this.icon="action",this.collapse=!1,this.imgSrc="",this.heroText=""}static get styles(){return[FL]}render(){return R`
|
8440
8624
|
<div part="nile__hero__container" class=${LM({hero__container:!0,"hero__container--collapsed":this.collapse,"hero__container--expanded":!this.collapse})}>
|
8441
8625
|
<nile-hero-header part="nile__hero__header" class='hero__header--collapsed' style="opacity:${this.collapse?1:0}" hero-text="${this.heroText}" icon="${this.icon}"></nile-hero-header>
|
8442
8626
|
<div class="hero__slot__container" style="opacity:${this.collapse?0:1}">
|
@@ -8451,7 +8635,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8451
8635
|
<img src="${this.imgSrc}" class="hero__img">
|
8452
8636
|
</div>
|
8453
8637
|
</div>
|
8454
|
-
`}};M([gM({reflect:!0})],
|
8638
|
+
`}};M([gM({reflect:!0})],JL.prototype,"icon",void 0),M([gM({reflect:!0,type:Boolean})],JL.prototype,"collapse",void 0),M([gM({reflect:!0,attribute:"img-src"})],JL.prototype,"imgSrc",void 0),M([gM({reflect:!0,attribute:"hero-text"})],JL.prototype,"heroText",void 0),JL=M([aM("nile-hero")],JL);const XL=s`
|
8455
8639
|
:host {
|
8456
8640
|
--stepper-flex-val:1;
|
8457
8641
|
--bulletin--dot--seperation:30%;
|
@@ -8604,7 +8788,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8604
8788
|
border: 1px solid var(--nile-colors-primary-500);
|
8605
8789
|
width: calc(var(--circle-height) + calc( var(--lines-thickness) * 2));
|
8606
8790
|
}
|
8607
|
-
`;let
|
8791
|
+
`;let $L=class extends PM{constructor(){super(...arguments),this.title="",this.subtitle="",this.contentBelow=!1,this.size="lg",this.icon="tick",this.isFirst=!1,this.isLast=!1,this.isComplete=!1,this.isCurrent=!1,this.haveFlex=!0}static get styles(){return[XL]}updated(M){if(M.has("subtitle")&&this.isLast&&!this.contentBelow&&this.subtitle){const M=this.absoluteSubtitle?.scrollWidth??"0";this.absoluteTitle.style.minWidth=M+"px"}}render(){this.haveFlex||this.style.setProperty("--stepper-flex-val","0");const M=this.isCurrent,e=this.isComplete;let t=!1;(e&&!M||this.completedStepValue==this.value)&&(t=!0);let i=!1;return e&&(i=!0,this.calculatedCompletedStepValue==this.value&&(i=!1)),R`
|
8608
8792
|
<div class="${LM({stepper__item:!0,"stepper__item--selected":M,"stepper__item--sm":"sm"==this.size,"stepper__item--lg":"lg"==this.size})}">
|
8609
8793
|
<div class="stepper__line__content">
|
8610
8794
|
<div class="stepper__line__container">
|
@@ -8645,7 +8829,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8645
8829
|
<svg width="${M}" height="${M}" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
8646
8830
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.7953 9.85334L13.2487 19.0667L10.7153 16.36C10.2487 15.92 9.51534 15.8933 8.982 16.2667C8.462 16.6533 8.31534 17.3333 8.63534 17.88L11.6353 22.76C11.9287 23.2133 12.4353 23.4933 13.0087 23.4933C13.5553 23.4933 14.0753 23.2133 14.3687 22.76C14.8487 22.1333 24.0087 11.2133 24.0087 11.2133C25.2087 9.98668 23.7553 8.90668 22.7953 9.84001V9.85334Z" fill="white"/>
|
8647
8831
|
</svg>
|
8648
|
-
`}};M([zM(".stepper__item__content--above .stepper__content__title")]
|
8832
|
+
`}};M([zM(".stepper__item__content--above .stepper__content__title")],$L.prototype,"absoluteTitle",void 0),M([zM(".stepper__item__content--above .stepper__content__subtitle")],$L.prototype,"absoluteSubtitle",void 0),M([gM()],$L.prototype,"title",void 0),M([gM()],$L.prototype,"subtitle",void 0),M([jM()],$L.prototype,"contentBelow",void 0),M([jM()],$L.prototype,"size",void 0),M([jM()],$L.prototype,"icon",void 0),M([jM()],$L.prototype,"isFirst",void 0),M([jM()],$L.prototype,"isLast",void 0),M([jM()],$L.prototype,"isComplete",void 0),M([jM()],$L.prototype,"isCurrent",void 0),M([jM()],$L.prototype,"currentStepValue",void 0),M([jM()],$L.prototype,"completedStepValue",void 0),M([jM()],$L.prototype,"calculatedCompletedStepValue",void 0),M([jM()],$L.prototype,"value",void 0),M([jM()],$L.prototype,"haveFlex",void 0),$L=M([aM("nile-stepper-item")],$L);const HL=s`
|
8649
8833
|
*{
|
8650
8834
|
box-sizing:border-box;
|
8651
8835
|
}
|
@@ -8665,13 +8849,13 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8665
8849
|
flex-direction:column;
|
8666
8850
|
padding: var(--nile-spacing-spacing-3xl);
|
8667
8851
|
}
|
8668
|
-
`;let
|
8852
|
+
`;let qL=class extends PM{constructor(){super(...arguments),this.isVertical=!1,this.contentBelow=!1,this.currentStep=0,this.completedStep=0,this.size="lg",this.icon="tick"}update(M){super.update(M),(M.has("currentStep")||M.has("completedStep"))&&this.updateItems()}handleCurrentStepChanges(){this.updateItems(),this.emit("nile-current-change",{value:this.currentStep})}handleCompletedStepChanges(){this.updateItems(),this.emit("nile-completed-change",{value:this.completedStep})}updateItems(){const M=[...this.querySelectorAll(this.isVertical?"nile-vertical-stepper-item":"nile-stepper-item")];if(!M.length)return;const e=M.length<3,t=0==this.currentStep||this.currentStep>M.length?1:this.currentStep,i=this.completedStep>M.length||this.completedStep<t?t:this.completedStep,N=this.completedStep>M.length?0:this.completedStep;M.forEach(((o,s)=>{s+1<t?(o.isComplete=!0,o.isCurrent=!1):s+1==t?(o.isComplete=s+1<=i,o.isCurrent=!0):(o.isComplete=s+1<=i,o.isCurrent=!1),0==s&&(o.isFirst=!0),s==M.length-1&&(o.isLast=!0),o.currentStepValue=t,o.calculatedCompletedStepValue=i,o.completedStepValue=N,o.icon=this.icon,o.size=this.size,o.value=s+1,o.contentBelow=this.contentBelow,0!=s&&s!=M.length-1||(o.haveFlex=e)}))}static get styles(){return[HL]}render(){return R`
|
8669
8853
|
<div class=${LM({"nile-stepper":!0,"nile-stepper--horizontal":!this.isVertical,"nile-stepper--vertical":this.isVertical})}>
|
8670
8854
|
<slot
|
8671
8855
|
@slotchange=${this.updateItems}
|
8672
8856
|
></slot>
|
8673
8857
|
</div>
|
8674
|
-
`}};M([gM({type:Boolean,attribute:"vertical"})],
|
8858
|
+
`}};M([gM({type:Boolean,attribute:"vertical"})],qL.prototype,"isVertical",void 0),M([gM({type:Boolean,attribute:!0,reflect:!0})],qL.prototype,"contentBelow",void 0),M([gM({type:Number,attribute:!0,reflect:!0})],qL.prototype,"currentStep",void 0),M([gM({type:Number,attribute:!0,reflect:!0})],qL.prototype,"completedStep",void 0),M([gM({type:String,attribute:!0,reflect:!0})],qL.prototype,"size",void 0),M([gM()],qL.prototype,"icon",void 0),M([VM("currentStep")],qL.prototype,"handleCurrentStepChanges",null),M([VM("completedStep")],qL.prototype,"handleCompletedStepChanges",null),qL=M([aM("nile-stepper")],qL);const KL=s`
|
8675
8859
|
|
8676
8860
|
:host {
|
8677
8861
|
width:100%;
|
@@ -8699,12 +8883,12 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8699
8883
|
font-style: normal;
|
8700
8884
|
font-weight: var(--nile-hero-text-font-weight);
|
8701
8885
|
}
|
8702
|
-
`;let
|
8886
|
+
`;let Mx=class extends PM{constructor(){super(...arguments),this.icon="action",this.heroText="Nile Hero"}static get styles(){return[KL]}render(){return R`
|
8703
8887
|
<span class="icon__container">
|
8704
8888
|
<nile-icon method="stroke" size="16" name="${this.icon}"></nile-icon>
|
8705
8889
|
</span>
|
8706
8890
|
<span class="hero__text">${this.heroText}</span>
|
8707
|
-
`}};M([gM({reflect:!0})],
|
8891
|
+
`}};M([gM({reflect:!0})],Mx.prototype,"icon",void 0),M([gM({reflect:!0,attribute:"hero-text"})],Mx.prototype,"heroText",void 0),Mx=M([aM("nile-hero-header")],Mx);const ex=s`
|
8708
8892
|
:host {
|
8709
8893
|
--vertical-stepper-flex-val:1;
|
8710
8894
|
flex-grow:var(--vertical-stepper-flex-val);
|
@@ -8841,7 +9025,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8841
9025
|
.stepper__content__subtitle--active{
|
8842
9026
|
color:var(--nile-colors-primary-600);
|
8843
9027
|
}
|
8844
|
-
`;let
|
9028
|
+
`;let tx=class extends PM{constructor(){super(...arguments),this.title="",this.subtitle="",this.contentBelow=!1,this.size="lg",this.icon="tick",this.isFirst=!1,this.isLast=!1,this.isComplete=!1,this.isCurrent=!1,this.haveFlex=!0}static get styles(){return[ex]}render(){this.isLast&&this.style.setProperty("--vertical-stepper-flex-val","0");const M=this.isCurrent,e=this.isComplete;let t=!1;(e&&!M||this.completedStepValue==this.value)&&(t=!0);let i=!1;return e&&(i=!0,this.calculatedCompletedStepValue==this.value&&(i=!1)),"sm"==this.size||this.size,R`
|
8845
9029
|
<div class="${LM({stepper__item:!0,"stepper__item--selected":M,"stepper__item--default":!M,"stepper__item--sm":"sm"==this.size,"stepper__item--lg":"lg"==this.size})}">
|
8846
9030
|
<div class="stepper-item__connector-content">
|
8847
9031
|
<div class="stepper__item__bulletin">
|
@@ -8860,15 +9044,15 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8860
9044
|
<svg width="${M}" height="${M}" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
8861
9045
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.7953 9.85334L13.2487 19.0667L10.7153 16.36C10.2487 15.92 9.51534 15.8933 8.982 16.2667C8.462 16.6533 8.31534 17.3333 8.63534 17.88L11.6353 22.76C11.9287 23.2133 12.4353 23.4933 13.0087 23.4933C13.5553 23.4933 14.0753 23.2133 14.3687 22.76C14.8487 22.1333 24.0087 11.2133 24.0087 11.2133C25.2087 9.98668 23.7553 8.90668 22.7953 9.84001V9.85334Z" fill="white"/>
|
8862
9046
|
</svg>
|
8863
|
-
`}};M([gM()]
|
9047
|
+
`}};M([gM()],tx.prototype,"title",void 0),M([gM()],tx.prototype,"subtitle",void 0),M([jM()],tx.prototype,"contentBelow",void 0),M([jM()],tx.prototype,"size",void 0),M([jM()],tx.prototype,"icon",void 0),M([jM()],tx.prototype,"isFirst",void 0),M([jM()],tx.prototype,"isLast",void 0),M([jM()],tx.prototype,"isComplete",void 0),M([jM()],tx.prototype,"isCurrent",void 0),M([jM()],tx.prototype,"currentStepValue",void 0),M([jM()],tx.prototype,"completedStepValue",void 0),M([jM()],tx.prototype,"calculatedCompletedStepValue",void 0),M([jM()],tx.prototype,"value",void 0),M([jM()],tx.prototype,"haveFlex",void 0),tx=M([aM("nile-vertical-stepper-item")],tx);const ix=s`
|
8864
9048
|
:host {
|
8865
9049
|
|
8866
9050
|
}
|
8867
|
-
`;let
|
9051
|
+
`;let Nx=class extends PM{constructor(){super(...arguments),this.date=new Date,this.hourFormat="auto",this.dateSeparator="-"}static get styles(){return[ix]}formatDate(M,e){M=new Date(M);return new Intl.DateTimeFormat("en-GB",e).formatToParts(M).map((({type:M,value:e})=>"day"===M||"month"===M||"year"===M?e:"literal"===M&&"/"===e?this.dateSeparator:e)).join("")}render(){const M=new Date(this.date),e="auto"===this.hourFormat?void 0:"12"===this.hourFormat;if(!isNaN(M.getMilliseconds()))return R`
|
8868
9052
|
<time datetime=${M.toISOString()}>
|
8869
9053
|
${this.formatDate(M,{weekday:this.weekday,era:this.era,year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second,timeZoneName:this.timeZoneName,timeZone:this.timeZone,hour12:e})}
|
8870
9054
|
</time>
|
8871
|
-
`}};M([gM()],
|
9055
|
+
`}};M([gM()],Nx.prototype,"date",void 0),M([gM()],Nx.prototype,"weekday",void 0),M([gM()],Nx.prototype,"era",void 0),M([gM()],Nx.prototype,"year",void 0),M([gM()],Nx.prototype,"month",void 0),M([gM()],Nx.prototype,"day",void 0),M([gM()],Nx.prototype,"hour",void 0),M([gM()],Nx.prototype,"minute",void 0),M([gM()],Nx.prototype,"second",void 0),M([gM({attribute:"time-zone-name"})],Nx.prototype,"timeZoneName",void 0),M([gM({attribute:"time-zone"})],Nx.prototype,"timeZone",void 0),M([gM({attribute:"hour-format"})],Nx.prototype,"hourFormat",void 0),M([gM({attribute:"date-separator"})],Nx.prototype,"dateSeparator",void 0),Nx=M([aM("nile-format-date")],Nx);const ox=s`
|
8872
9056
|
:host *,
|
8873
9057
|
:host *::before,
|
8874
9058
|
:host *::after {
|
@@ -8954,7 +9138,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8954
9138
|
outline: solid 1px transparent;
|
8955
9139
|
}
|
8956
9140
|
}
|
8957
|
-
`;function
|
9141
|
+
`;function sx(M,e,t){const i=M=>Object.is(M,-0)?0:M;return i(M<e?e:M>t?t:M)}let nx=class extends PM{constructor(){super(...arguments),this.position=50,this.vertical=!1,this.disabled=!1,this.snapThreshold=12}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((M=>this.handleResize(M))),this.updateComplete.then((()=>this.resizeObserver.observe(this))),this.detectSize(),this.cachedPositionInPixels=this.percentageToPixels(this.position)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this)}detectSize(){const{width:M,height:e}=this.getBoundingClientRect();this.size=this.vertical?e:M}percentageToPixels(M){return this.size*(M/100)}pixelsToPercentage(M){return M/this.size*100}handleDrag(M){this.disabled||(M.cancelable&&M.preventDefault(),function(M,e){function t(t){const i=M.getBoundingClientRect(),N=M.ownerDocument.defaultView,o=i.left+N.pageXOffset,s=i.top+N.pageYOffset,n=t.pageX-o,D=t.pageY-s;e?.onMove&&e.onMove(n,D)}document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerup",(function M(){document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",M),e?.onStop&&e.onStop()})),e?.initialEvent instanceof PointerEvent&&t(e.initialEvent)}(this,{onMove:(M,e)=>{let t=this.vertical?e:M;if("end"===this.primary&&(t=this.size-t),this.snap){this.snap.split(" ").forEach((M=>{let e;e=M.endsWith("%")?this.size*(parseFloat(M)/100):parseFloat(M),t>=e-this.snapThreshold&&t<=e+this.snapThreshold&&(t=e)}))}this.position=sx(this.pixelsToPercentage(t),0,100)},initialEvent:M}))}handleKeyDown(M){if(!this.disabled&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(M.key)){let e=this.position;const t=(M.shiftKey?10:1)*("end"===this.primary?-1:1);M.preventDefault(),("ArrowLeft"===M.key&&!this.vertical||"ArrowUp"===M.key&&this.vertical)&&(e-=t),("ArrowRight"===M.key&&!this.vertical||"ArrowDown"===M.key&&this.vertical)&&(e+=t),"Home"===M.key&&(e="end"===this.primary?100:0),"End"===M.key&&(e="end"===this.primary?0:100),this.position=sx(e,0,100)}}handleResize(M){const{width:e,height:t}=M[0].contentRect;this.size=this.vertical?t:e,this.primary&&(this.position=this.pixelsToPercentage(this.cachedPositionInPixels))}handlePositionChange(){this.cachedPositionInPixels=this.percentageToPixels(this.position),this.positionInPixels=this.percentageToPixels(this.position),this.emit("nile-reposition")}handlePositionInPixelsChange(){this.position=this.pixelsToPercentage(this.positionInPixels)}handleVerticalChange(){this.detectSize()}render(){const M=this.vertical?"gridTemplateRows":"gridTemplateColumns",e=this.vertical?"gridTemplateColumns":"gridTemplateRows",t=`\n clamp(\n 0%,\n clamp(\n var(--min),\n ${this.position}% - var(--divider-width) / 2,\n var(--max)\n ),\n calc(100% - var(--divider-width))\n )\n `,i="auto";return"end"===this.primary?this.style[M]=`${i} var(--divider-width) ${t}`:this.style[M]=`${t} var(--divider-width) ${i}`,this.style[e]="",R`
|
8958
9142
|
<slot name="start" part="panel start" class="start"></slot>
|
8959
9143
|
|
8960
9144
|
<div
|
@@ -8974,7 +9158,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
8974
9158
|
</div>
|
8975
9159
|
|
8976
9160
|
<slot name="end" part="panel end" class="end"></slot>
|
8977
|
-
`}};
|
9161
|
+
`}};nx.styles=ox,M([zM(".divider")],nx.prototype,"divider",void 0),M([gM({type:Number,reflect:!0})],nx.prototype,"position",void 0),M([gM({attribute:"position-in-pixels",type:Number})],nx.prototype,"positionInPixels",void 0),M([gM({type:Boolean,reflect:!0})],nx.prototype,"vertical",void 0),M([gM({type:Boolean,reflect:!0})],nx.prototype,"disabled",void 0),M([gM()],nx.prototype,"primary",void 0),M([gM()],nx.prototype,"snap",void 0),M([gM({type:Number,attribute:"snap-threshold"})],nx.prototype,"snapThreshold",void 0),M([VM("position")],nx.prototype,"handlePositionChange",null),M([VM("positionInPixels")],nx.prototype,"handlePositionInPixelsChange",null),M([VM("vertical")],nx.prototype,"handleVerticalChange",null),nx=M([aM("nile-split-panel")],nx);const Dx=s`
|
8978
9162
|
:host {
|
8979
9163
|
box-sizing: border-box;
|
8980
9164
|
}
|
@@ -9014,7 +9198,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9014
9198
|
* @license
|
9015
9199
|
* Copyright 2021 Google LLC
|
9016
9200
|
* SPDX-License-Identifier: BSD-3-Clause
|
9017
|
-
*/;function
|
9201
|
+
*/;function rx(M,e,t){return M?e(M):t?.(M)}const ax=s`
|
9018
9202
|
:host {
|
9019
9203
|
box-sizing: border-box;
|
9020
9204
|
}
|
@@ -9177,7 +9361,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9177
9361
|
outline: dashed 1px SelectedItem;
|
9178
9362
|
}
|
9179
9363
|
}
|
9180
|
-
`;var
|
9364
|
+
`;var ux;let lx=ux=class extends PM{constructor(){super(...arguments),this.indeterminate=!1,this.isLeaf=!1,this.loading=!1,this.selectable=!1,this.expanded=!1,this.selected=!1,this.disabled=!1,this.lazy=!1}static isTreeItem(M){return M instanceof Element&&"treeitem"===M.getAttribute("role")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","treeitem"),this.setAttribute("tabindex","-1"),this.isNestedItem()&&(this.slot="children")}firstUpdated(){this.childrenContainer.hidden=!this.expanded,this.childrenContainer.style.height=this.expanded?"auto":"0",this.isLeaf=!this.lazy&&0===this.getChildrenItems().length,this.handleExpandedChange()}async animateCollapse(){this.emit("nile-collapse"),await ce(this.childrenContainer);const{keyframes:M,options:e}=Ae(this,"tree-item.collapse",{dir:"ltr"});await le(this.childrenContainer,ze(M,this.childrenContainer.scrollHeight),e),this.childrenContainer.hidden=!0,this.emit("nile-after-collapse")}isNestedItem(){const M=this.parentElement;return!!M&&ux.isTreeItem(M)}handleChildrenSlotChange(){this.loading=!1,this.isLeaf=!this.lazy&&0===this.getChildrenItems().length}willUpdate(M){M.has("selected")&&!M.has("indeterminate")&&(this.indeterminate=!1)}async animateExpand(){this.emit("nile-expand"),await ce(this.childrenContainer),this.childrenContainer.hidden=!1;const{keyframes:M,options:e}=Ae(this,"tree-item.expand",{dir:"ltr"});await le(this.childrenContainer,ze(M,this.childrenContainer.scrollHeight),e),this.childrenContainer.style.height="auto",this.emit("nile-after-expand")}handleLoadingChange(){this.setAttribute("aria-busy",this.loading?"true":"false"),this.loading||this.animateExpand()}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleExpandedChange(){this.isLeaf?this.removeAttribute("aria-expanded"):this.setAttribute("aria-expanded",this.expanded?"true":"false")}handleExpandAnimation(){this.expanded?this.lazy?(this.loading=!0,this.emit("nile-lazy-load")):this.animateExpand():this.animateCollapse()}handleLazyChange(){this.emit("nile-lazy-change")}getChildrenItems({includeDisabled:M=!0}={}){return this.childrenSlot?[...this.childrenSlot.assignedElements({flatten:!0})].filter((e=>ux.isTreeItem(e)&&(M||!e.disabled))):[]}render(){const M=!this.loading&&(!this.isLeaf||this.lazy);return R`
|
9181
9365
|
<div
|
9182
9366
|
part="base"
|
9183
9367
|
class="${LM({"tree-item":!0,"tree-item--expanded":this.expanded,"tree-item--selected":this.selected,"tree-item--disabled":this.disabled,"tree-item--leaf":this.isLeaf,"tree-item--has-expand-button":M,"tree-item--rtl":!1})}"
|
@@ -9199,7 +9383,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9199
9383
|
class=${LM({"tree-item__expand-button":!0,"tree-item__expand-button--visible":M})}
|
9200
9384
|
aria-hidden="true"
|
9201
9385
|
>
|
9202
|
-
${
|
9386
|
+
${rx(this.loading,(()=>R` <nile-spinner></nile-spinner> `))}
|
9203
9387
|
<slot class="tree-item__expand-icon-slot" name="expand-icon">
|
9204
9388
|
<nile-icon library="system" name=${"arrowright"}></nile-icon>
|
9205
9389
|
</slot>
|
@@ -9208,7 +9392,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9208
9392
|
</slot>
|
9209
9393
|
</div>
|
9210
9394
|
|
9211
|
-
${
|
9395
|
+
${rx(this.selectable,(()=>R`
|
9212
9396
|
<nile-checkbox
|
9213
9397
|
part="checkbox"
|
9214
9398
|
exportparts="
|
@@ -9239,7 +9423,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9239
9423
|
@slotchange="${this.handleChildrenSlotChange}"
|
9240
9424
|
></slot>
|
9241
9425
|
</div>
|
9242
|
-
`}};
|
9426
|
+
`}};lx.styles=ax,M([jM()],lx.prototype,"indeterminate",void 0),M([jM()],lx.prototype,"isLeaf",void 0),M([jM()],lx.prototype,"loading",void 0),M([jM()],lx.prototype,"selectable",void 0),M([gM({type:Boolean,reflect:!0})],lx.prototype,"expanded",void 0),M([gM({type:Boolean,reflect:!0})],lx.prototype,"selected",void 0),M([gM({type:Boolean,reflect:!0})],lx.prototype,"disabled",void 0),M([gM({type:Boolean,reflect:!0})],lx.prototype,"lazy",void 0),M([zM("slot:not([name])")],lx.prototype,"defaultSlot",void 0),M([zM("slot[name=children]")],lx.prototype,"childrenSlot",void 0),M([zM(".tree-item__item")],lx.prototype,"itemElement",void 0),M([zM(".tree-item__children")],lx.prototype,"childrenContainer",void 0),M([zM(".tree-item__expand-button slot")],lx.prototype,"expandButtonSlot",void 0),M([VM("loading",{waitUntilFirstUpdate:!0})],lx.prototype,"handleLoadingChange",null),M([VM("disabled")],lx.prototype,"handleDisabledChange",null),M([VM("selected")],lx.prototype,"handleSelectedChange",null),M([VM("expanded",{waitUntilFirstUpdate:!0})],lx.prototype,"handleExpandedChange",null),M([VM("expanded",{waitUntilFirstUpdate:!0})],lx.prototype,"handleExpandAnimation",null),M([VM("lazy",{waitUntilFirstUpdate:!0})],lx.prototype,"handleLazyChange",null),lx=ux=M([aM("nile-tree-item")],lx),ye("tree-item.expand",{keyframes:[{height:"0",opacity:"0",overflow:"hidden"},{height:"auto",opacity:"1",overflow:"hidden"}],options:{duration:250,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)"}}),ye("tree-item.collapse",{keyframes:[{height:"auto",opacity:"1",overflow:"hidden"},{height:"0",opacity:"0",overflow:"hidden"}],options:{duration:200,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)"}});var gx=lx;function jx(M,e=!1){function t(M){const e=M.getChildrenItems({includeDisabled:!1});if(e.length){const t=e.every((M=>M.selected)),i=e.every((M=>!M.selected&&!M.indeterminate));M.selected=t,M.indeterminate=!t&&!i}}!function M(i){for(const t of i.getChildrenItems())t.selected=e?i.selected||t.selected:!t.disabled&&i.selected,M(t);e&&t(i)}(M),function M(e){const i=e.parentElement;gx.isTreeItem(i)&&(t(i),M(i))}(M)}let cx=class extends PM{constructor(){super(...arguments),this.selection="leaf",this.clickTarget=null,this.initTreeItem=M=>{M.selectable="multiple"===this.selection,["expand","collapse"].filter((M=>!!this.querySelector(`[slot="${M}-icon"]`))).forEach((e=>{const t=M.querySelector(`[slot="${e}-icon"]`);null===t?M.append(this.getExpandButtonIcon(e)):t.hasAttribute("data-default")&&t.replaceWith(this.getExpandButtonIcon(e))}))}}async connectedCallback(){super.connectedCallback(),this.handleTreeChanged=this.handleTreeChanged.bind(this),this.handleFocusIn=this.handleFocusIn.bind(this),this.handleFocusOut=this.handleFocusOut.bind(this),this.setAttribute("role","tree"),this.setAttribute("tabindex","0"),this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.addEventListener("nile-lazy-change",this.handleSlotChange),await this.updateComplete,this.mutationObserver=new MutationObserver(this.handleTreeChanged),this.mutationObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver.disconnect(),this.removeEventListener("focusin",this.handleFocusIn),this.removeEventListener("focusout",this.handleFocusOut),this.removeEventListener("nile-lazy-change",this.handleSlotChange)}getExpandButtonIcon(M){const e=("expand"===M?this.expandedIconSlot:this.collapsedIconSlot).assignedElements({flatten:!0})[0];if(e){const t=e.cloneNode(!0);return[t,...t.querySelectorAll("[id]")].forEach((M=>M.removeAttribute("id"))),t.setAttribute("data-default",""),t.slot=`${M}-icon`,t}return null}handleTreeChanged(M){for(const e of M){const M=[...e.addedNodes].filter(gx.isTreeItem),t=[...e.removedNodes].filter(gx.isTreeItem);M.forEach(this.initTreeItem),t.includes(this.lastFocusedItem)&&this.focusItem(this.getFocusableItems()[0])}}syncTreeItems(M){const e=this.getAllTreeItems();if("multiple"===this.selection)jx(M);else for(const t of e)t!==M&&(t.selected=!1)}selectItem(M){const e=[...this.selectedItems];"multiple"===this.selection?(M.selected=!M.selected,M.lazy&&(M.expanded=!0),this.syncTreeItems(M)):"single"===this.selection||M.isLeaf?(M.expanded=!M.expanded,M.selected=!0,this.syncTreeItems(M)):"leaf"===this.selection&&(M.expanded=!M.expanded);const t=this.selectedItems;(e.length!==t.length||t.some((M=>!e.includes(M))))&&Promise.all(t.map((M=>M.updateComplete))).then((()=>{this.emit("nile-selection-change",{detail:{selection:t}})}))}getAllTreeItems(){return[...this.querySelectorAll("nile-tree-item")]}focusItem(M){M?.focus()}handleKeyDown(M){if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","End","Enter"," "].includes(M.key))return;const e=this.getFocusableItems();if(e.length>0){M.preventDefault();const t=e.findIndex((M=>M.matches(":focus"))),i=e[t],N=M=>{const t=e[sx(M,0,e.length-1)];this.focusItem(t)},o=M=>{i.expanded=M};"ArrowDown"===M.key?N(t+1):"ArrowUp"===M.key?N(t-1):"ArrowRight"===M.key?!i||i.disabled||i.expanded||i.isLeaf&&!i.lazy?N(t+1):o(!0):"ArrowLeft"===M.key?!i||i.disabled||i.isLeaf||!i.expanded?N(t-1):o(!1):"Home"===M.key?N(0):"End"===M.key?N(e.length-1):"Enter"!==M.key&&" "!==M.key||i.disabled||this.selectItem(i)}}handleClick(M){const e=M.target,t=e.closest("nile-tree-item"),i=M.composedPath().some((M=>M?.classList?.contains("tree-item__expand-button")));t&&!t.disabled&&e===this.clickTarget&&("multiple"===this.selection&&i?t.expanded=!t.expanded:this.selectItem(t))}handleMouseDown(M){this.clickTarget=M.target}handleFocusOut(M){const e=M.relatedTarget;e&&this.contains(e)||(this.tabIndex=0)}handleFocusIn(M){const e=M.target;M.target===this&&this.focusItem(this.lastFocusedItem||this.getAllTreeItems()[0]),gx.isTreeItem(e)&&!e.disabled&&(this.lastFocusedItem&&(this.lastFocusedItem.tabIndex=-1),this.lastFocusedItem=e,this.tabIndex=-1,e.tabIndex=0)}handleSlotChange(){this.getAllTreeItems().forEach(this.initTreeItem)}async handleSelectionChange(){const M="multiple"===this.selection,e=this.getAllTreeItems();this.setAttribute("aria-multiselectable",M?"true":"false");for(const t of e)t.selectable=M;M&&(await this.updateComplete,[...this.querySelectorAll(":scope > nile-tree-item")].forEach((M=>jx(M,!0))))}get selectedItems(){return this.getAllTreeItems().filter((M=>M.selected))}getFocusableItems(){const M=this.getAllTreeItems(),e=new Set;return M.filter((M=>{if(M.disabled)return!1;const t=M.parentElement?.closest("[role=treeitem]");return t&&(!t.expanded||t.loading||e.has(t))&&e.add(M),!e.has(M)}))}render(){return R`
|
9243
9427
|
<div
|
9244
9428
|
part="base"
|
9245
9429
|
class="tree"
|
@@ -9251,7 +9435,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9251
9435
|
<slot name="expand-icon" hidden aria-hidden="true"> </slot>
|
9252
9436
|
<slot name="collapse-icon" hidden aria-hidden="true"> </slot>
|
9253
9437
|
</div>
|
9254
|
-
`}};
|
9438
|
+
`}};cx.styles=Dx,M([zM("slot:not([name])")],cx.prototype,"defaultSlot",void 0),M([zM("slot[name=expand-icon]")],cx.prototype,"expandedIconSlot",void 0),M([zM("slot[name=collapse-icon]")],cx.prototype,"collapsedIconSlot",void 0),M([gM()],cx.prototype,"selection",void 0),M([VM("selection")],cx.prototype,"handleSelectionChange",null),cx=M([aM("nile-tree")],cx);const zx=s`
|
9255
9439
|
:host {
|
9256
9440
|
display: flex;
|
9257
9441
|
padding: 12px 16px;
|
@@ -9304,7 +9488,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9304
9488
|
right: 16px;
|
9305
9489
|
cursor: pointer;
|
9306
9490
|
}
|
9307
|
-
`;let
|
9491
|
+
`;let Ix=class extends PM{constructor(){super(...arguments),this.hasSlotController=new vM(this,"preffix","heading","subheading"),this.iconName="",this.iconSize=14,this.heading="",this.subHeading=""}static get styles(){return[zx]}handleClick(M){this.emit("nile-list-item-click",{heading:this.heading,subheading:this.subHeading})}render(){return R`
|
9308
9492
|
${this.iconName||this.hasSlotController.test("preffix")?R` <slot name="preffix" part="preffix" class="preffix__icon">
|
9309
9493
|
<nile-icon
|
9310
9494
|
name="${this.iconName}"
|
@@ -9324,16 +9508,16 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9324
9508
|
<slot @click="${this.handleClick}" class="list__item" part="base"> </slot>
|
9325
9509
|
<slot name="suffix" part="suffix" class="list-item__suffix">
|
9326
9510
|
</slot>
|
9327
|
-
`}};M([gM({type:String,attribute:"icon-name"})],
|
9511
|
+
`}};M([gM({type:String,attribute:"icon-name"})],Ix.prototype,"iconName",void 0),M([gM({type:Number,attribute:"icon-size"})],Ix.prototype,"iconSize",void 0),M([gM({type:String,attribute:"heading"})],Ix.prototype,"heading",void 0),M([gM({type:String,attribute:"sub-heading"})],Ix.prototype,"subHeading",void 0),Ix=M([aM("nile-list-item")],Ix);const Tx=s`
|
9328
9512
|
:host {
|
9329
9513
|
display: flex;
|
9330
9514
|
flex-direction: column;
|
9331
9515
|
gap: 9px;
|
9332
9516
|
padding: 16px;
|
9333
9517
|
}
|
9334
|
-
`;let
|
9518
|
+
`;let Ox=class extends PM{static get styles(){return[Tx]}handleListItemClick(M){const e=M.target.innerText;this.emit("nile-list-click",{value:e})}render(){return R`
|
9335
9519
|
<slot @nile-list-item-click="${this.handleListItemClick}"> </slot>
|
9336
|
-
`}};
|
9520
|
+
`}};Ox=M([aM("nile-list")],Ox);const yx=s`
|
9337
9521
|
|
9338
9522
|
:host {
|
9339
9523
|
box-sizing: border-box;
|
@@ -9456,7 +9640,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9456
9640
|
.accordian__content--arrow-left{
|
9457
9641
|
margin-left:28px;
|
9458
9642
|
}
|
9459
|
-
`;let
|
9643
|
+
`;let Ax=class extends PM{constructor(){super(...arguments),this.open=!1,this.variant="light",this.expandIconPlacement="right",this.size="md",this.disabled=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}handleSummaryClick(){this.disabled||(this.open?this.hide():this.show(),this.header.focus())}handleSummaryKeyDown(M){"Enter"!==M.key&&" "!==M.key||(M.preventDefault(),this.open?this.hide():this.show()),"ArrowUp"!==M.key&&"ArrowLeft"!==M.key||(M.preventDefault(),this.hide()),"ArrowDown"!==M.key&&"ArrowRight"!==M.key||(M.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.emit("nile-show",{cancelable:!0}).defaultPrevented)return void(this.open=!1);await ce(this.body),this.body.hidden=!1;const{keyframes:M,options:e}=Ae(this,"accordian.show",{dir:"ltr"});await le(this.body,ze(M,this.body.scrollHeight),e),this.body.style.height="auto",this.emit("nile-after-show")}else{if(this.emit("nile-hide",{cancelable:!0}).defaultPrevented)return void(this.open=!0);await ce(this.body);const{keyframes:M,options:e}=Ae(this,"accordian.hide",{dir:"ltr"});await le(this.body,ze(M,this.body.scrollHeight),e),this.body.hidden=!0,this.body.style.height="auto",this.emit("nile-after-hide")}}async show(){if(!this.open&&!this.disabled)return this.open=!0,Se(this,"nile-after-show")}async hide(){if(this.open&&!this.disabled)return this.open=!1,Se(this,"nile-after-hide")}render(){return R`
|
9460
9644
|
<div
|
9461
9645
|
part="base"
|
9462
9646
|
class=${LM({accordian:!0,"accordian--open":this.open,"accordian--disabled":this.disabled,"accordian--sm":"sm"==this.size,"accordian--md":"md"==this.size,"accordian--lg":"lg"==this.size})}
|
@@ -9490,7 +9674,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9490
9674
|
class="${LM({accordian__content:!0,"accordian__content--arrow-left":"left"==this.expandIconPlacement})}"></slot>
|
9491
9675
|
</div>
|
9492
9676
|
</div>
|
9493
|
-
`}};
|
9677
|
+
`}};Ax.styles=yx,M([zM(".accordian")],Ax.prototype,"accordian",void 0),M([zM(".accordian__header")],Ax.prototype,"header",void 0),M([zM(".accordian__body")],Ax.prototype,"body",void 0),M([zM(".accordian__expand-icon-slot")],Ax.prototype,"expandIconSlot",void 0),M([gM({type:Boolean,reflect:!0})],Ax.prototype,"open",void 0),M([gM({reflect:!0})],Ax.prototype,"variant",void 0),M([gM({reflect:!0})],Ax.prototype,"expandIconPlacement",void 0),M([gM({reflect:!0})],Ax.prototype,"size",void 0),M([gM()],Ax.prototype,"summary",void 0),M([gM({type:Boolean,reflect:!0})],Ax.prototype,"disabled",void 0),M([VM("open",{waitUntilFirstUpdate:!0})],Ax.prototype,"handleOpenChange",null),Ax=M([aM("nile-accordion")],Ax),ye("accordian.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:250,easing:"linear"}}),ye("accordian.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:250,easing:"linear"}});const dx=s`
|
9494
9678
|
:host {
|
9495
9679
|
display: block;
|
9496
9680
|
height: 100%;
|
@@ -9517,13 +9701,13 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9517
9701
|
.inset.horizontal {
|
9518
9702
|
margin-left: 72px;
|
9519
9703
|
}
|
9520
|
-
`;let
|
9704
|
+
`;let hx=class extends PM{constructor(){super(...arguments),this.inset=!1,this.vertical=!1}static get styles(){return[dx]}render(){return R`
|
9521
9705
|
<div part="divider" class="divider ${this.vertical?"vertical":"horizontal"} ${this.inset?"inset":""}"></div>
|
9522
|
-
`}};M([gM({type:Boolean,reflect:!0})],
|
9706
|
+
`}};M([gM({type:Boolean,reflect:!0})],hx.prototype,"inset",void 0),M([gM({type:Boolean,reflect:!0})],hx.prototype,"vertical",void 0),hx=M([aM("nile-divider")],hx);const Lx=s`
|
9523
9707
|
:host {
|
9524
9708
|
font: 500 20px / 30px var(--nile-font-family-sans-serif);
|
9525
9709
|
}
|
9526
|
-
`;let
|
9710
|
+
`;let xx=class extends PM{constructor(){super(...arguments),this.headerText="",this.pageTitle=""}static get styles(){return[Lx]}updated(M){super.updated(M),this.updateDocumentTitle()}updateDocumentTitle(){document.title=this.pageTitle||this.headerText}render(){return R` ${this.headerText?R` ${this.headerText} `:""} `}};M([gM({type:String})],xx.prototype,"headerText",void 0),M([gM({type:String})],xx.prototype,"pageTitle",void 0),xx=M([aM("nile-title")],xx);const px=s`
|
9527
9711
|
:host {
|
9528
9712
|
display: block;
|
9529
9713
|
width: 100%;
|
@@ -9628,7 +9812,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9628
9812
|
color: var(--nile-section-message-footer-color);
|
9629
9813
|
margin-left: 8px;
|
9630
9814
|
}
|
9631
|
-
`;let
|
9815
|
+
`;let Sx=class extends PM{constructor(){super(...arguments),this.hasSlotController=new vM(this,"section__heading","section__description","footer__actions"),this.heading="",this.description="",this.iconSize=16,this.variant="primary",this.iconMap={primary:"info2",success:"done-02",warning:"warning",error:"warning"}}static get styles(){return[px]}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.addActionSeparators()}))}addActionSeparators(){this.shadowRoot?.querySelector('slot[name="footer__actions"]')}render(){const M=this.hasSlotController.test("section__heading")||this.heading,e=this.hasSlotController.test("section__description")||this.description,t=this.hasSlotController.test("footer__actions");return R`
|
9632
9816
|
<div
|
9633
9817
|
part="parent__wrapper"
|
9634
9818
|
class=${LM({parent__wrapper:!0,"section--primary":"primary"===this.variant,"section--success":"success"===this.variant,"section--warning":"warning"===this.variant,"section--error":"error"===this.variant})}
|
@@ -9665,7 +9849,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9665
9849
|
`:""}
|
9666
9850
|
</div>
|
9667
9851
|
</div>
|
9668
|
-
`}};M([gM({type:String,attribute:"heading"})],
|
9852
|
+
`}};M([gM({type:String,attribute:"heading"})],Sx.prototype,"heading",void 0),M([gM({type:String,attribute:"description"})],Sx.prototype,"description",void 0),M([gM({type:Number,attribute:"icon-size"})],Sx.prototype,"iconSize",void 0),M([gM()],Sx.prototype,"variant",void 0),Sx=M([aM("nile-section-message")],Sx);const Qx=s`
|
9669
9853
|
:host {
|
9670
9854
|
display: block;
|
9671
9855
|
width: 100%;
|
@@ -9685,7 +9869,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9685
9869
|
background-color: var(--nile-toolbar-background-color, var(--nile-colors-white-base));
|
9686
9870
|
color: var(--nile-toolbar-text-color, rgba(0, 0, 0, 0.87));
|
9687
9871
|
}
|
9688
|
-
`;let
|
9872
|
+
`;let Ex=class extends PM{constructor(){super(...arguments),this.color="",this.background=""}static get styles(){return[Qx]}render(){return R`
|
9689
9873
|
<div class="toolbar" part="nile-toolbar" style="${this.color?"color:"+this.color+";":""} ${this.background?"background:"+this.background+";":""}">
|
9690
9874
|
<slot name="start"></slot>
|
9691
9875
|
<div class="toolbar-content" part="toolbar-mid">
|
@@ -9693,7 +9877,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9693
9877
|
</div>
|
9694
9878
|
<slot name="end"></slot>
|
9695
9879
|
</div>
|
9696
|
-
`}};M([gM({reflect:!0})],
|
9880
|
+
`}};M([gM({reflect:!0})],Ex.prototype,"color",void 0),M([gM({reflect:!0})],Ex.prototype,"background",void 0),Ex=M([aM("nile-toolbar")],Ex);const kx=s`
|
9697
9881
|
:host {
|
9698
9882
|
box-sizing: border-box;
|
9699
9883
|
}
|
@@ -9734,19 +9918,19 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9734
9918
|
.inline__edit--container:hover {
|
9735
9919
|
background-color:var(--nile-inline-edit-hover-background-color);
|
9736
9920
|
}
|
9737
|
-
`;let
|
9921
|
+
`;let wx=class extends PM{constructor(){super(...arguments),this.label="",this.placeholder="",this.open=!1,this.value=""}static get styles(){return[kx]}handleClick(){this.open=!0}render(){const M=this.value||this.placeholder;return R`
|
9738
9922
|
<div class="inline__edit--label" part="label">${this.label}</div>
|
9739
9923
|
${this.open?R` <slot class="inline__edit--open--container" part="base"> </slot>`:R` <div class="inline__edit--container" part="container" @click=${this.handleClick}>
|
9740
9924
|
${M}
|
9741
9925
|
</div>`}
|
9742
|
-
`}};M([gM({type:String,reflect:!0})],
|
9926
|
+
`}};M([gM({type:String,reflect:!0})],wx.prototype,"label",void 0),M([gM({type:String,reflect:!0})],wx.prototype,"placeholder",void 0),M([gM({type:Boolean,reflect:!0})],wx.prototype,"open",void 0),M([gM({type:String,reflect:!0})],wx.prototype,"value",void 0),wx=M([aM("nile-inline-edit")],wx);const mx=s`
|
9743
9927
|
:host {
|
9744
9928
|
display:block;
|
9745
9929
|
width:100%;
|
9746
9930
|
}
|
9747
|
-
`;let
|
9931
|
+
`;let Ux=class extends PM{constructor(){super(...arguments),this.rows=[],this.primaryRowWidths=[]}static get styles(){return[mx]}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-body-load",this.handleRows)}firstUpdated(M){this.updateComplete.then((()=>{this.handleResizeObserver()}))}render(){return R`
|
9748
9932
|
<slot @slotchange="${this.repaintTable}"></slot>
|
9749
|
-
`}repaintTable(){this.realignStructure(),this.handleBodyCssUpdate()}handleRows(M){this.rows=[...this.rows,M.detail.comp]}handleBodyCssUpdate(){if(this.rows.length<2)return;const M=this.rows,e=M[0].shadowRoot?.querySelector("div.base");e&&(e.style.borderTopRightRadius="var(--nile-radius-radius-xl)",e.style.borderTopLeftRadius="var(--nile-radius-radius-xl)",e.style.borderBottomRightRadius="0px",e.style.borderBottomLeftRadius="0px",e.style.borderBottom="none"),M.forEach(((e,t)=>{if(t>0&&t<M.length-1){const M=e.shadowRoot?.querySelector("div.base");M&&(M.style.borderTopRightRadius="0px",M.style.borderTopLeftRadius="0px",M.style.borderBottomRightRadius="0px",M.style.borderBottomLeftRadius="0px",M.style.borderBottom="none")}}));const t=M[M.length-1].shadowRoot?.querySelector("div.base");t&&(t.style.borderTopRightRadius="0px",t.style.borderTopLeftRadius="0px",t.style.borderBottomRightRadius="var(--nile-radius-radius-xl)",t.style.borderBottomLeftRadius="var(--nile-radius-radius-xl)")}getPrimaryColumnWidths(){const M=this.rows.find((M=>"primary"==M.type)),e=this.getTableCellFetchQuery(M).map((M=>M.clientWidth));return e}realignStructure(){if(this.rows.length<2)return;const M=this.getPrimaryColumnWidths();this.rows.filter((M=>"primary"!=M.type)).forEach((e=>{let t=this.getTableCellFetchQuery(e);t?.forEach(((e,t)=>{e.style.setProperty("--cell-width",M.at(t)+"px")}))}))}getTableCellFetchQuery(M){return M?.shadowRoot?.querySelector("slot:not([name])")?.assignedElements()[0].shadowRoot?.querySelector("slot")?.assignedElements()}handleResizeObserver(){this.resizeObserver=new ResizeObserver((M=>{for(let e of M)this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout((()=>{this.realignStructure(),this.debounceTimeout=null}),50)})),this.resizeObserver.observe(this)}disconnectedCallback(){this.resizeObserver.disconnect(),super.disconnectedCallback()}};M([zM("slot")],
|
9933
|
+
`}repaintTable(){this.realignStructure(),this.handleBodyCssUpdate()}handleRows(M){this.rows=[...this.rows,M.detail.comp]}handleBodyCssUpdate(){if(this.rows.length<2)return;const M=this.rows,e=M[0].shadowRoot?.querySelector("div.base");e&&(e.style.borderTopRightRadius="var(--nile-radius-radius-xl)",e.style.borderTopLeftRadius="var(--nile-radius-radius-xl)",e.style.borderBottomRightRadius="0px",e.style.borderBottomLeftRadius="0px",e.style.borderBottom="none"),M.forEach(((e,t)=>{if(t>0&&t<M.length-1){const M=e.shadowRoot?.querySelector("div.base");M&&(M.style.borderTopRightRadius="0px",M.style.borderTopLeftRadius="0px",M.style.borderBottomRightRadius="0px",M.style.borderBottomLeftRadius="0px",M.style.borderBottom="none")}}));const t=M[M.length-1].shadowRoot?.querySelector("div.base");t&&(t.style.borderTopRightRadius="0px",t.style.borderTopLeftRadius="0px",t.style.borderBottomRightRadius="var(--nile-radius-radius-xl)",t.style.borderBottomLeftRadius="var(--nile-radius-radius-xl)")}getPrimaryColumnWidths(){const M=this.rows.find((M=>"primary"==M.type)),e=this.getTableCellFetchQuery(M).map((M=>M.clientWidth));return e}realignStructure(){if(this.rows.length<2)return;const M=this.getPrimaryColumnWidths();this.rows.filter((M=>"primary"!=M.type)).forEach((e=>{let t=this.getTableCellFetchQuery(e);t?.forEach(((e,t)=>{e.style.setProperty("--cell-width",M.at(t)+"px")}))}))}getTableCellFetchQuery(M){return M?.shadowRoot?.querySelector("slot:not([name])")?.assignedElements()[0].shadowRoot?.querySelector("slot")?.assignedElements()}handleResizeObserver(){this.resizeObserver=new ResizeObserver((M=>{for(let e of M)this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout((()=>{this.realignStructure(),this.debounceTimeout=null}),50)})),this.resizeObserver.observe(this)}disconnectedCallback(){this.resizeObserver.disconnect(),super.disconnectedCallback()}};M([zM("slot")],Ux.prototype,"defaultSlot",void 0),Ux=M([aM("nile-table")],Ux);const Cx=s`
|
9750
9934
|
|
9751
9935
|
|
9752
9936
|
.filter-chips {
|
@@ -9866,7 +10050,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9866
10050
|
margin-right: 12px;
|
9867
10051
|
}
|
9868
10052
|
|
9869
|
-
`;var
|
10053
|
+
`;var Yx;let bx=Yx=class extends PM{constructor(){super(...arguments),this.label="",this.value="",this.viewMoreCount=0,this.editable=!1,this.closable=!1,this.icon="",this.removeIcon="",this.active=!1}static get styles(){return[Cx]}connectedCallback(){super.connectedCallback(),this.registerChip()}disconnectedCallback(){super.disconnectedCallback(),this.unregisterChip()}registerChip(){Yx.activeChips.push(this)}unregisterChip(){Yx.activeChips=Yx.activeChips.filter((M=>M!==this))}handleClose(M){M.stopPropagation(),this.dispatchEvent(new CustomEvent("nile-close",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}})),this.remove()}handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{value:this.value,viewMoreCount:this.viewMoreCount}}))}getLabelSlot(){return R`
|
9870
10054
|
<span class="label-wrapper">
|
9871
10055
|
<slot name="label">
|
9872
10056
|
<span class="label" part="label">${this.label}:</span>
|
@@ -9908,7 +10092,7 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
9908
10092
|
${this.getviewMoreCountSlot()}
|
9909
10093
|
${this.getCloseIconSlot()}
|
9910
10094
|
</div>
|
9911
|
-
`}};
|
10095
|
+
`}};bx.activeChips=[],M([gM({type:String})],bx.prototype,"label",void 0),M([gM({type:String})],bx.prototype,"value",void 0),M([gM({type:Number})],bx.prototype,"viewMoreCount",void 0),M([gM({type:Boolean})],bx.prototype,"editable",void 0),M([gM({type:Boolean})],bx.prototype,"closable",void 0),M([gM({type:String})],bx.prototype,"icon",void 0),M([gM({type:String})],bx.prototype,"removeIcon",void 0),M([gM({type:Boolean,reflect:!0})],bx.prototype,"active",void 0),bx=Yx=M([aM("nile-filter-chip")],bx);const fx=s`
|
9912
10096
|
:host {
|
9913
10097
|
}
|
9914
10098
|
|
@@ -10145,9 +10329,9 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
10145
10329
|
}
|
10146
10330
|
|
10147
10331
|
|
10148
|
-
`;function
|
10332
|
+
`;function vx(M,e,t){return`Showing ${(t-1)*e+1}–${Math.min(t*e,M)} of ${M}`}let Zx=class extends PM{constructor(){super(...arguments),this.totalItems=0,this.currentPage=1,this.pageSize=50,this.pageSizeOptions=[10,25,50,100],this.variant="fluid",this.disabled=!1,this.showTitle=!0,this._pageSizeOpen=!1,this._pageOpen=!1}static get styles(){return[fx]}firstUpdated(){this._pageSizeDropdown&&(this._pageSizeDropdown.addEventListener("nile-show",(()=>{this._pageSizeOpen=!0})),this._pageSizeDropdown.addEventListener("nile-after-hide",(()=>{this._pageSizeOpen=!1})))}get totalPages(){return Math.max(1,(M=this.totalItems,e=this.pageSize,Math.ceil(M/e)));var M,e}goToPage(M){if(this.disabled)return;const e=this.currentPage;this.currentPage=M,this.emit("nile-change",{page:M,previousPage:e,pageSize:this.pageSize})}onPageSizeSelect(M){if(this.disabled||this.pageSize===M)return;const e=this.currentPage;this.pageSize=M,this.currentPage=1,this.emit("nile-change",{page:1,previousPage:e,pageSize:M})}renderCompactRangeText(){const M=vx(this.totalItems,this.pageSize,this.currentPage).replace(/^Showing\s*/,"");return R`<div class="range-text">${M}</div>`}renderRangeText(){return 0===this.totalItems?R`<div class="range-text">Showing 0 of 0</div>`:R`
|
10149
10333
|
<div part="range-text" class="range-text">
|
10150
|
-
${
|
10334
|
+
${vx(this.totalItems,this.pageSize,this.currentPage)}
|
10151
10335
|
</div>
|
10152
10336
|
`}renderPageSizeSelect(){return"fluid"!==this.variant?null:R`
|
10153
10337
|
<div class="page-size-select">
|
@@ -10322,209 +10506,20 @@ class tN{constructor(M){this._element=null;const e=M??window;this._node=e,M&&(th
|
|
10322
10506
|
</div>
|
10323
10507
|
${this.renderPageList()}
|
10324
10508
|
</div>
|
10325
|
-
`}};M([gM({attribute:"totalitems",reflect:!0,converter:{fromAttribute:M=>{const e=Number(M);return Number.isFinite(e)&&e>=0?Math.floor(e):0}}})],
|
10326
|
-
:host {
|
10327
|
-
display: block;
|
10328
|
-
}
|
10329
|
-
|
10330
|
-
.container {
|
10331
|
-
display: flex;
|
10332
|
-
justify-content: center;
|
10333
|
-
align-items: center;
|
10334
|
-
gap: 10px;
|
10335
|
-
height: 100px;
|
10336
|
-
}
|
10337
|
-
|
10338
|
-
.align-item-center {
|
10339
|
-
align-items: center;
|
10340
|
-
}
|
10341
|
-
|
10342
|
-
slot.span {
|
10343
|
-
font-size: var(--nile-font-size-micro);
|
10344
|
-
margin-top: 14px;
|
10345
|
-
}
|
10346
|
-
|
10347
|
-
.range-container {
|
10348
|
-
display: flex;
|
10349
|
-
flex-direction: column;
|
10350
|
-
gap: var(--nile-spacing-sm);
|
10351
|
-
}
|
10352
|
-
|
10353
|
-
.column-reverse {
|
10354
|
-
flex-direction: column-reverse;
|
10355
|
-
}
|
10356
|
-
|
10357
|
-
.label-container {
|
10358
|
-
display: flex;
|
10359
|
-
justify-content: space-between;
|
10360
|
-
}
|
10361
|
-
|
10362
|
-
.label-container span {
|
10363
|
-
margin: var(--nile-spacing-none);
|
10364
|
-
padding: var(--nile-spacing-none);
|
10365
|
-
font-size: var(--nile-font-size-micro);
|
10366
|
-
}
|
10367
|
-
|
10368
|
-
.range {
|
10369
|
-
position: relative;
|
10370
|
-
width: 228px;
|
10371
|
-
height: 4px;
|
10372
|
-
background-color: var(--nile-colors-neutral-400);
|
10373
|
-
user-select: none;
|
10374
|
-
border-radius: var(--nile-radius-radius-3xl);
|
10375
|
-
}
|
10376
|
-
|
10377
|
-
.range:hover {
|
10378
|
-
cursor: pointer;
|
10379
|
-
}
|
10380
|
-
|
10381
|
-
.range-completed {
|
10382
|
-
position: absolute;
|
10383
|
-
height: 100%;
|
10384
|
-
width: 0%;
|
10385
|
-
background-color: var(--nile-colors-primary-600);
|
10386
|
-
top: 0px;
|
10387
|
-
left: 0px;
|
10388
|
-
z-index: 98;
|
10389
|
-
border-radius: var(--nile-radius-radius-3xl);
|
10390
|
-
}
|
10391
|
-
|
10392
|
-
.range-button {
|
10393
|
-
height: 12px;
|
10394
|
-
width: 12px;
|
10395
|
-
background-color: var(--nile-colors-primary-600);
|
10396
|
-
position: absolute;
|
10397
|
-
top: 50%;
|
10398
|
-
transform: translate(-50%, -50%);
|
10399
|
-
border-radius: var(--nile-radius-radius-3xl);
|
10400
|
-
left: 0;
|
10401
|
-
z-index: 100;
|
10402
|
-
box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
|
10403
|
-
transition: box-shadow var(--nile-transition-duration-default) ease;
|
10404
|
-
}
|
10405
|
-
|
10406
|
-
.range-button:hover, .range-button-two:hover {
|
10407
|
-
cursor: pointer;
|
10408
|
-
background-color: var(--nile-colors-primary-700);
|
10409
|
-
}
|
10410
|
-
|
10411
|
-
.range-button:active, .range-button-two:active {
|
10412
|
-
transition: box-shadow var(--nile-transition-duration-default) ease;
|
10413
|
-
background-color: var(--nile-colors-primary-700);
|
10414
|
-
box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;
|
10415
|
-
}
|
10416
|
-
|
10417
|
-
.range-button-two {
|
10418
|
-
height: 12px;
|
10419
|
-
width: 12px;
|
10420
|
-
background-color: var(--nile-colors-primary-600);
|
10421
|
-
position: absolute;
|
10422
|
-
top: 50%;
|
10423
|
-
transform: translate(-50%, -50%);
|
10424
|
-
border-radius: var(--nile-radius-radius-3xl);
|
10425
|
-
left: 100%;
|
10426
|
-
z-index: 100;
|
10427
|
-
box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
|
10428
|
-
transition: box-shadow var(--nile-transition-duration-default) ease;
|
10429
|
-
}
|
10430
|
-
`,Yx=(M,e)=>Math.max(0,Math.min(e,M.width))/M.width*100,bx=(M,e)=>{const t=e.minValue+M/100*(e.maxValue-e.minValue);return e.maxValue-e.minValue<1?parseFloat(t.toFixed(2)):Math.floor(t)},fx=(M,e)=>(M-e.minValue)/(e.maxValue-e.minValue)*100,vx=(M,e,t)=>{const i=M.clientX-e.left,N=Yx(e,i);t.value=bx(N,t),t.emit("nile-change",{value:t.value}),t.buttonOne.style.left=`${N}%`,t.completed.style.width=`${N}%`},Zx=M=>{window.addEventListener("mousemove",M.onMouseMove),window.addEventListener("mouseup",M.onMouseUp)};let Vx=class extends PM{constructor(){super(...arguments),this.minValue=0,this.value=this.minValue,this.maxValue=100,this.rangeOneValue=this.minValue,this.rangeTwoValue=this.maxValue,this.showLabel=!1,this.labelStart="",this.labelEnd="",this.rangeSlider=!1,this.labelPosition="top",this.tooltipPosition="top",this.activeThumb=null,this.onMouseMove=M=>{const e=this.range.getBoundingClientRect();if(this.rangeSlider){"one"===this.activeThumb?((M,e,t)=>{const i=M.clientX-e.left,N=Yx(e,i);t.rangeOneValue=bx(N,t),t.rangeOneValue=Math.min(t.rangeOneValue,t.rangeTwoValue),t.emit("nile-button-first-change",{value:t.rangeOneValue}),t.rangeTwoValue>t.rangeOneValue&&(t.buttonOne.style.left=`${N}%`)})(M,e,this):"two"===this.activeThumb&&((M,e,t)=>{const i=M.clientX-e.left,N=Yx(e,i);t.rangeTwoValue=bx(N,t),t.rangeTwoValue=Math.max(t.rangeTwoValue,t.rangeOneValue),t.emit("nile-button-last-change",{value:t.rangeTwoValue}),t.rangeTwoValue>t.rangeOneValue&&(t.buttonTwo.style.left=`${N}%`)})(M,e,this);const t=fx(this.rangeOneValue,this),i=fx(this.rangeTwoValue,this),N=Math.min(t,i),o=Math.abs(i-t);this.rangeTwoValue>=this.rangeOneValue&&(this.completed.style.left=`${N}%`,this.completed.style.width=`${o}%`)}else vx(M,e,this)},this.onMouseUp=()=>{var M;this.rangeSlider?(this.emit("nile-button-first-change-end",{value:this.rangeOneValue}),this.emit("nile-button-last-change-end",{value:this.rangeTwoValue})):this.emit("nile-change-end",{value:this.value}),this.activeThumb=null,M=this,window.removeEventListener("mousemove",M.onMouseMove),window.removeEventListener("mouseup",M.onMouseUp)},this.onMouseDown=M=>{const e=this.range.getBoundingClientRect(),t=(M.clientX-e.left)/e.width*100,i=this.minValue+t/100*(this.maxValue-this.minValue);if(this.rangeSlider){((M,e)=>{if(Math.abs(M-e.rangeOneValue)<=Math.abs(M-e.rangeTwoValue)){const t=Math.min(M,e.rangeTwoValue);e.rangeOneValue=e.checkValueValidity(t,e.minValue,e.maxValue)}else{const t=Math.max(M,e.rangeOneValue);e.rangeTwoValue=e.checkValueValidity(t,e.minValue,e.maxValue)}const t=fx(e.rangeOneValue,e),i=fx(e.rangeTwoValue,e);e.buttonOne.style.left=`${t}%`,e.buttonTwo.style.left=`${i}%`;const N=Math.min(t,i),o=Math.abs(i-t);e.completed.style.left=`${N}%`,e.completed.style.width=`${o}%`,e.emit("nile-button-first-change",{value:e.rangeOneValue}),e.emit("nile-button-last-change",{value:e.rangeTwoValue})})(i,this);const M=Math.abs(i-this.rangeOneValue),e=Math.abs(i-this.rangeTwoValue);this.activeThumb=M<=e?"one":"two",Zx(this)}else vx(M,e,this),this.activeThumb="one",Zx(this)}}static get styles(){return[Cx]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity()}firstUpdated(M){var e;if((e=this).range=e.renderRoot.querySelector(".range"),e.buttonOne=e.renderRoot.querySelector(".range-button"),e.buttonTwo=e.renderRoot.querySelector(".range-button-two"),e.completed=e.renderRoot.querySelector(".range-completed"),e.range.addEventListener("mousedown",e.onMouseDown),e.buttonOne?.addEventListener("mousedown",(()=>{e.activeThumb="one",Zx(e)})),e.buttonTwo?.addEventListener("mousedown",(()=>{e.activeThumb="two",Zx(e)})),!this.rangeSlider&&M.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);const M=fx(this.value,this);this.buttonOne.style.left=`${M}%`,this.completed.style.width=`${M}%`}else if(this.rangeSlider){const M=fx(this.rangeOneValue,this),e=fx(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left=`${M}%`),this.buttonTwo&&(this.buttonTwo.style.left=`${e}%`);const t=Math.min(M,e),i=Math.abs(e-M);this.completed.style.left=`${t}%`,this.completed.style.width=`${i}%`}}checkValueValidity(M,e,t){return t-e<=1?Math.max(e,Math.min(M,t)):Math.floor(Math.max(e,Math.min(M,t)))}checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue)}render(){const M=this.showLabel,e=M?"label-start label-end":void 0;return R`
|
10431
|
-
<div
|
10432
|
-
part="base"
|
10433
|
-
class=${LM({container:!0,"align-item-center":!M})}
|
10434
|
-
>
|
10435
|
-
<slot class="span" name="prefix"></slot>
|
10436
|
-
|
10437
|
-
<div
|
10438
|
-
part="range-container"
|
10439
|
-
class=${LM({"range-container":!0,"column-reverse":"bottom"===this.labelPosition})}
|
10440
|
-
>
|
10441
|
-
${M?(t=this,R`
|
10442
|
-
<div part="label-container" class="label-container">
|
10443
|
-
<span id="label-start">${t.labelStart}</span>
|
10444
|
-
<span id="label-end">${t.labelEnd}</span>
|
10445
|
-
</div>
|
10446
|
-
`):R``}
|
10447
|
-
|
10448
|
-
<div
|
10449
|
-
class="range"
|
10450
|
-
part="range"
|
10451
|
-
role="group"
|
10452
|
-
aria-labelledby=${e}
|
10453
|
-
>
|
10454
|
-
<span class="range-completed" part="range-completed"></span>
|
10455
|
-
${this.rangeSlider?(M=>R`
|
10456
|
-
<div>
|
10457
|
-
<nile-tooltip
|
10458
|
-
content=${M.rangeOneValue}
|
10459
|
-
placement=${M.tooltipPosition}
|
10460
|
-
>
|
10461
|
-
<div
|
10462
|
-
id="range-one"
|
10463
|
-
class="range-button"
|
10464
|
-
part="range-button"
|
10465
|
-
role="slider"
|
10466
|
-
tabindex="0"
|
10467
|
-
aria-valuemin=${M.minValue}
|
10468
|
-
aria-valuemax=${M.maxValue}
|
10469
|
-
aria-valuenow=${M.rangeOneValue}
|
10470
|
-
aria-label="Minimum value"
|
10471
|
-
></div>
|
10472
|
-
</nile-tooltip>
|
10473
|
-
<nile-tooltip
|
10474
|
-
content=${M.rangeTwoValue}
|
10475
|
-
placement=${M.tooltipPosition}
|
10476
|
-
>
|
10477
|
-
<div
|
10478
|
-
id="range-two"
|
10479
|
-
class="range-button-two"
|
10480
|
-
part="range-button-two"
|
10481
|
-
role="slider"
|
10482
|
-
tabindex="0"
|
10483
|
-
aria-valuemin=${M.minValue}
|
10484
|
-
aria-valuemax=${M.maxValue}
|
10485
|
-
aria-valuenow=${M.rangeTwoValue}
|
10486
|
-
aria-label="Maximum value"
|
10487
|
-
></div>
|
10488
|
-
</nile-tooltip>
|
10489
|
-
</div>
|
10490
|
-
`)(this):(M=>R`
|
10491
|
-
<div>
|
10492
|
-
<nile-tooltip
|
10493
|
-
content=${M.value}
|
10494
|
-
placement=${M.tooltipPosition}
|
10495
|
-
>
|
10496
|
-
<div
|
10497
|
-
class=${LM({"range-button":!0,"range-button-active":"one"===M.activeThumb})}
|
10498
|
-
part="range-button"
|
10499
|
-
role="slider"
|
10500
|
-
tabindex="0"
|
10501
|
-
aria-valuemin=${M.minValue}
|
10502
|
-
aria-valuemax=${M.maxValue}
|
10503
|
-
aria-valuenow=${M.value}
|
10504
|
-
aria-label=${M.ariaLabel||"Slider value"}
|
10505
|
-
></div>
|
10506
|
-
</nile-tooltip>
|
10507
|
-
</div>
|
10508
|
-
`)(this)}
|
10509
|
-
</div>
|
10510
|
-
</div>
|
10511
|
-
|
10512
|
-
<slot class="span" name="suffix"></slot>
|
10513
|
-
</div>
|
10514
|
-
`;var t}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};M([gM({type:Number})],Vx.prototype,"minValue",void 0),M([gM({type:Number})],Vx.prototype,"value",void 0),M([gM({type:Number})],Vx.prototype,"maxValue",void 0),M([gM({type:Number})],Vx.prototype,"rangeOneValue",void 0),M([gM({type:Number})],Vx.prototype,"rangeTwoValue",void 0),M([gM({type:Boolean})],Vx.prototype,"showLabel",void 0),M([gM({type:String})],Vx.prototype,"labelStart",void 0),M([gM({type:String})],Vx.prototype,"labelEnd",void 0),M([gM({type:Boolean})],Vx.prototype,"rangeSlider",void 0),M([gM({type:String})],Vx.prototype,"labelPosition",void 0),M([gM({type:String})],Vx.prototype,"tooltipPosition",void 0),Vx=M([aM("nile-slider")],Vx);
|
10509
|
+
`}};M([gM({attribute:"totalitems",reflect:!0,converter:{fromAttribute:M=>{const e=Number(M);return Number.isFinite(e)&&e>=0?Math.floor(e):0}}})],Zx.prototype,"totalItems",void 0),M([gM({attribute:"currentpage",reflect:!0,converter:{fromAttribute:M=>{const e=Number(M);return Number.isFinite(e)&&e>=1?Math.floor(e):1}}})],Zx.prototype,"currentPage",void 0),M([gM({attribute:"pagesize",reflect:!0,converter:{fromAttribute:M=>{const e=Number(M);return Number.isFinite(e)&&e>=1?Math.floor(e):50}}})],Zx.prototype,"pageSize",void 0),M([gM({attribute:"pagesizeoptions",reflect:!1,converter:{fromAttribute:M=>{try{const e=JSON.parse(M);if(Array.isArray(e)&&e.every((M=>"number"==typeof M)))return e}catch{}return[10,25,50,100]}}})],Zx.prototype,"pageSizeOptions",void 0),M([gM({type:String})],Zx.prototype,"variant",void 0),M([gM({type:Boolean})],Zx.prototype,"disabled",void 0),M([gM({type:Boolean})],Zx.prototype,"showTitle",void 0),M([jM()],Zx.prototype,"_pageSizeOpen",void 0),M([jM()],Zx.prototype,"_pageOpen",void 0),M([zM(".page-size-dropdown")],Zx.prototype,"_pageSizeDropdown",void 0),Zx=M([aM("nile-pagination")],Zx);
|
10515
10510
|
/**
|
10516
10511
|
* @license
|
10517
10512
|
* Copyright 2021 Google LLC
|
10518
10513
|
* SPDX-License-Identifier: BSD-3-Clause
|
10519
10514
|
*/
|
10520
|
-
class
|
10515
|
+
class Vx{constructor(M){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===M?.roundAverageSize&&(this._roundAverageSize=!0)}set(M,e){const t=this._map.get(M)||0;this._map.set(M,e),this.totalSize+=e-t}get averageSize(){if(this._map.size>0){const M=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(M):M}return 0}getSize(M){return this._map.get(M)}clear(){this._map.clear(),this.totalSize=0}}
|
10521
10516
|
/**
|
10522
10517
|
* @license
|
10523
10518
|
* Copyright 2021 Google LLC
|
10524
10519
|
* SPDX-License-Identifier: BSD-3-Clause
|
10525
|
-
*/function
|
10520
|
+
*/function Wx(M){return"horizontal"===M?"width":"height"}class Px{_getDefaultConfig(){return{direction:"vertical"}}constructor(M,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=M,Promise.resolve().then((()=>this.config=e||this._getDefaultConfig()))}set config(M){Object.assign(this,Object.assign({},this._getDefaultConfig(),M))}get config(){return{direction:this.direction}}get items(){return this._items}set items(M){this._setItems(M)}_setItems(M){M!==this._items&&(this._items=M,this._scheduleReflow())}get direction(){return this._direction}set direction(M){(M="horizontal"===M?M:"vertical")!==this._direction&&(this._direction=M,this._sizeDim="horizontal"===M?"width":"height",this._secondarySizeDim="horizontal"===M?"height":"width",this._positionDim="horizontal"===M?"left":"top",this._secondaryPositionDim="horizontal"===M?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(M){const{_viewDim1:e,_viewDim2:t}=this;Object.assign(this._viewportSize,M),t!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(M){Object.assign(this._latestCoords,M);const e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(M=!1){(M||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(M){this._pin=M,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:M,block:e}=this._pin;return{index:Math.max(0,Math.min(M,this.items.length-1)),block:e}}return null}_clampScrollPosition(M){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(M,this.totalScrollSize[Wx(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const M=this._scrollPosition,{index:e,block:t}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:t||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=M-this._scrollPosition}}_calculateScrollIntoViewPosition(M){const{block:e}=M,t=Math.min(this.items.length,Math.max(0,M.index)),i=this._getItemPosition(t)[this._positionDim];let N=i;if("start"!==e){const M=this._getItemSize(t)[this._sizeDim];if("center"===e)N=i-.5*this._viewDim1+.5*M;else{const t=i-this._viewDim1+M;if("end"===e)N=t;else{const M=this._scrollPosition;N=Math.abs(M-i)<Math.abs(M-t)?i:t}}}return N+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(N)}getScrollIntoViewCoordinates(M){return{[this._positionDim]:this._calculateScrollIntoViewPosition(M)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const M=new Map;if(-1!==this._first&&-1!==this._last)for(let e=this._first;e<=this._last;e++)M.set(e,this._getItemPosition(e));const e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:M};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const M=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>M||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(M){if(-1===this._first||-1===this._last)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let t=this._last;for(;t>this._first&&Math.round(this._getItemPosition(t)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)t--;e===this._firstVisible&&t===this._lastVisible||(this._firstVisible=e,this._lastVisible=t,M&&M.emit&&this._sendVisibilityChangedMessage())}}
|
10526
10521
|
/**
|
10527
10522
|
* @license
|
10528
10523
|
* Copyright 2021 Google LLC
|
10529
10524
|
* SPDX-License-Identifier: BSD-3-Clause
|
10530
|
-
*/function
|
10525
|
+
*/function Rx(M){return"horizontal"===M?"marginLeft":"marginTop"}function Gx(M){return"horizontal"===M?"marginRight":"marginBottom"}function Bx(M){return"horizontal"===M?"xOffset":"yOffset"}function _x(M,e){const t=[M,e].sort();return t[1]<=0?Math.min(...t):t[0]>=0?Math.max(...t):t[0]+t[1]}class Fx{constructor(){this._childSizeCache=new Vx,this._marginSizeCache=new Vx,this._metricsCache=new Map}update(M,e){const t=new Set;Object.keys(M).forEach((i=>{const N=Number(i);this._metricsCache.set(N,M[N]),this._childSizeCache.set(N,M[N][Wx(e)]),t.add(N),t.add(N+1)}));for(const M of t){const t=this._metricsCache.get(M)?.[Rx(e)]||0,i=this._metricsCache.get(M-1)?.[Gx(e)]||0;this._marginSizeCache.set(M,_x(t,i))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(M,e){return this._metricsCache.get(M)?.[Rx(e)]||0}getChildSize(M){return this._childSizeCache.getSize(M)}getMarginSize(M){return this._marginSizeCache.getSize(M)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var Jx=Object.freeze({__proto__:null,FlowLayout:class extends Px{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Fx,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(M){this._metricsCache.update(M,this.direction),this._scheduleReflow()}_getPhysicalItem(M){return this._newPhysicalItems.get(M)??this._physicalItems.get(M)}_getSize(M){return this._getPhysicalItem(M)&&this._metricsCache.getChildSize(M)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(M){const e=this._metricsCache;if(-1===this._first||-1===this._last)return e.averageMarginSize+M*(e.averageMarginSize+this._getAverageSize());if(M<this._first){const t=this._first-M;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(t*e.averageChildSize+(t-1)*e.averageMarginSize)}{const t=M-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+t*(e.averageChildSize+e.averageMarginSize)}}_getPosition(M){const e=this._getPhysicalItem(M),{averageMarginSize:t}=this._metricsCache;return 0===M?this._metricsCache.getMarginSize(0)??t:e?e.pos:this._estimatePosition(M)}_calculateAnchor(M,e){return M<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((M+e)/2/this._delta)))}_getAnchor(M,e){if(0===this._physicalItems.size)return this._calculateAnchor(M,e);if(this._first<0)return this._calculateAnchor(M,e);if(this._last<0)return this._calculateAnchor(M,e);const t=this._getPhysicalItem(this._first),i=this._getPhysicalItem(this._last),N=t.pos;if(i.pos+this._metricsCache.getChildSize(this._last)<M)return this._calculateAnchor(M,e);if(N>e)return this._calculateAnchor(M,e);let o=this._firstVisible-1,s=-1/0;for(;s<M;){s=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const M=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=M,this._stable=!0}_getItems(){const M=this._newPhysicalItems;let e,t;if(this._stable=!0,null!==this.pin){const{index:M}=this.pin;this._anchorIdx=M,this._anchorPos=this._getPosition(M)}if(e=this._scrollPosition-this._overhang,t=this._scrollPosition+this._viewDim1+this._overhang,t<0||e>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(e,t),this._anchorPos=this._getPosition(this._anchorIdx));let i=this._getSize(this._anchorIdx);void 0===i&&(this._stable=!1,i=this._getAverageSize());const N=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=N),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-i);let s=0;for(this._anchorPos+i+o<e&&(s=e-(this._anchorPos+i+o)),this._anchorPos-N>t&&(s=t-(this._anchorPos-N)),s&&(this._scrollPosition-=s,e-=s,t-=s,this._scrollError+=s),M.set(this._anchorIdx,{pos:this._anchorPos,size:i}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-N,this._physicalMax=this._anchorPos+i+o;this._physicalMin>e&&this._first>0;){let e=this._getSize(--this._first);void 0===e&&(this._stable=!1,e=this._getAverageSize());let t=this._metricsCache.getMarginSize(this._first);void 0===t&&(this._stable=!1,t=this._metricsCache.averageMarginSize),this._physicalMin-=e;const i=this._physicalMin;if(M.set(this._first,{pos:i,size:e}),this._physicalMin-=t,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<t&&this._last<this.items.length-1;){let e=this._getSize(++this._last);void 0===e&&(this._stable=!1,e=this._getAverageSize());let t=this._metricsCache.getMarginSize(this._last);void 0===t&&(this._stable=!1,t=this._metricsCache.averageMarginSize);const i=this._physicalMax;if(M.set(this._last,{pos:i,size:e}),this._physicalMax+=e+t,!this._stable&&!this._estimate)break}const n=this._calculateError();n&&(this._physicalMin-=n,this._physicalMax-=n,this._anchorPos-=n,this._scrollPosition-=n,M.forEach((M=>M.pos-=n)),this._scrollError+=n),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=M)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:M,_last:e}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===M&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:M}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(M+this._getAverageSize())+M)}get _delta(){const{averageMarginSize:M}=this._metricsCache;return this._getAverageSize()+M}_getItemPosition(M){return{[this._positionDim]:this._getPosition(M),[this._secondaryPositionDim]:0,[Bx(this.direction)]:-(this._metricsCache.getLeadingMarginValue(M,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(M){return{[this._sizeDim]:this._getSize(M)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{Ax as NileAccordion,lN as NileAutoComplete,PL as NileAvatar,ue as NileBadge,DL as NileBreadcrumb,aL as NileBreadcrumbItem,BM as NileButton,TL as NileButtonFilter,mN as NileButtonToggle,CN as NileButtonToggleGroup,pN as NileCalendar,jL as NileCard,Ye as NileCheckbox,jN as NileChip,yL as NileCircularProgressbar,tL as NileCodeEditor,RN as NileContentEditor,TN as NileDatePicker,BN as NileDialog,hx as NileDivider,Ue as NileDrawer,Oi as NileDropdown,_L as NileEmptyState,yN as NileErrorMessage,FN as NileErrorNotification,bx as NileFilterChip,dN as NileFormErrorMessage,lL as NileFormGroup,LN as NileFormHelpText,Nx as NileFormatDate,_M as NileHeading,JL as NileHero,Mx as NileHeroHeader,wM as NileIcon,ae as NileIconButton,wx as NileInlineEdit,Ne as NileInput,EN as NileLink,Ox as NileList,Ix as NileListItem,oi as NileLoader,ne as NileMenu,Ii as NileMenuItem,ci as NileOption,GL as NilePageHeader,Zx as NilePagination,zL as NilePopover,Kt as NilePopup,ni as NileProgressBar,fe as NileRadio,Ze as NileRadioGroup,Sx as NileSectionMessage,gi as NileSelect,oe as NileSidebar,dL as NileSidebarMenu,LL as NileSidebarMenuItems,pL as NileSidebarWrapper,ii as NileSlideToggle,ri as NileSpinner,nx as NileSplitPanel,qL as NileStepper,$L as NileStepperItem,VN as NileSwitcher,qN as NileTab,XN as NileTabGroup,eo as NileTabPanel,Ux as NileTable,vL as NileTableBody,CL as NileTableCellItem,VL as NileTableHeaderItem,bL as NileTableRow,li as NileTag,zN as NileTextarea,xx as NileTitle,sL as NileToast,Ex as NileToolbar,ei as NileTooltip,cx as NileTree,lx as NileTreeItem,tx as NileVerticalStepperItem};
|