@cas-smartdesign/virtual-list 6.3.1 → 7.0.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/dist/docs/doc.mjs
CHANGED
|
@@ -391,13 +391,13 @@ list.addEventListener("selection", (event: CustomEvent) => {
|
|
|
391
391
|
${n?Be` <div class="${s}-icon" style="background-image:url('${n}')" aria-hidden="true"></div> `:Z}
|
|
392
392
|
${this.contentMode==="html"?Mr(e):e}
|
|
393
393
|
</div>
|
|
394
|
-
`:Z}updated(s){super.updated(s),s.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){const s=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let e=0;const t=this.shadowRoot.querySelector(".caption");t&&(e+=t.scrollWidth-t.clientWidth);const n=this.shadowRoot.querySelector(".description");return n&&(e=Math.max(e,n.scrollWidth-n.clientWidth)),e>0&&e++,s&&this.setAttribute("enable-line-clamp",""),e}handleIconClick(s){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",s))&&s.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Oe.ID="sd-list-item",Oe.ensureDefined=()=>{customElements.get(Oe.ID)||customElements.define(Oe.ID,Oe)},Oe);ae([J({type:String})],re.prototype,"caption");ae([J({type:String})],re.prototype,"description");ae([J({type:String})],re.prototype,"descriptionIcon");ae([J({type:Boolean})],re.prototype,"selected");ae([J({type:String})],re.prototype,"icon");ae([J({type:String})],re.prototype,"iconBackgroundColor");ae([J({type:String})],re.prototype,"iconPlaceholder");ae([J({type:Number})],re.prototype,"level");ae([J()],re.prototype,"contentMode");ae([J({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],re.prototype,"enableLineClamp");ae([J({converter:{fromAttribute:s=>s=="true",toAttribute:s=>s},reflect:!0,attribute:"aria-disabled"})],re.prototype,"disabled");ae([J({type:String,attribute:"icon-attr-aria-label"})],re.prototype,"iconAttrAriaLabel");ae([J({type:String,reflect:!0})],re.prototype,"role");ae([J({type:String,attribute:"caption-attr-title"})],re.prototype,"captionAttrTitle");ae([J({type:String,attribute:"description-attr-title"})],re.prototype,"descriptionAttrTitle");ae([J({type:String,attribute:"icon-attr-title"})],re.prototype,"iconAttrTitle");let qe=re;const Fr=(s,e)=>{const t=document.createElement(qe.ID);if(s){if(t.caption=s.caption,t.description=s.description,t.descriptionIcon=s.descriptionIcon,t.icon=s.icon,t.iconBackgroundColor=s.iconBackgroundColor,t.iconPlaceholder=s.iconPlaceholder,t.level=s.level,t.disabled=s.disabled,s.contentMode&&(t.contentMode=s.contentMode),s.leftContentGenerator){const n=s.leftContentGenerator(s,t);n&&(n.slot="left-content",t.appendChild(n))}if(s.rightContentGenerator){const n=s.rightContentGenerator(s,t);n&&(n.slot="right-content",t.appendChild(n))}}return t};qe.ensureDefined();const Wr=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}";var Vr=Object.defineProperty,Gr=Object.getOwnPropertyDescriptor,Ae=(s,e,t,n)=>{for(var i=n>1?void 0:n?Gr(e,t):e,o=s.length-1,a;o>=0;o--)(a=s[o])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Vr(e,t,i),i};let Kr=0;var de;const ye=(de=class extends He{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=de.ID+"_"+Kr++,this.role="listbox",this.itemGenerator=Fr,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;const e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":this.focusIndex=(this.focusIndex+1)%this.itemCount;break;case"Up":case"ArrowUp":this.focusIndex>0?this.focusIndex--:this.finalSizeIsKnown&&(this.focusIndex=this.itemCount-1);break;case"Enter":this.handleSelection(this.focusIndex,e
|
|
394
|
+
`:Z}updated(s){super.updated(s),s.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){const s=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let e=0;const t=this.shadowRoot.querySelector(".caption");t&&(e+=t.scrollWidth-t.clientWidth);const n=this.shadowRoot.querySelector(".description");return n&&(e=Math.max(e,n.scrollWidth-n.clientWidth)),e>0&&e++,s&&this.setAttribute("enable-line-clamp",""),e}handleIconClick(s){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",s))&&s.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Oe.ID="sd-list-item",Oe.ensureDefined=()=>{customElements.get(Oe.ID)||customElements.define(Oe.ID,Oe)},Oe);ae([J({type:String})],re.prototype,"caption");ae([J({type:String})],re.prototype,"description");ae([J({type:String})],re.prototype,"descriptionIcon");ae([J({type:Boolean})],re.prototype,"selected");ae([J({type:String})],re.prototype,"icon");ae([J({type:String})],re.prototype,"iconBackgroundColor");ae([J({type:String})],re.prototype,"iconPlaceholder");ae([J({type:Number})],re.prototype,"level");ae([J()],re.prototype,"contentMode");ae([J({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],re.prototype,"enableLineClamp");ae([J({converter:{fromAttribute:s=>s=="true",toAttribute:s=>s},reflect:!0,attribute:"aria-disabled"})],re.prototype,"disabled");ae([J({type:String,attribute:"icon-attr-aria-label"})],re.prototype,"iconAttrAriaLabel");ae([J({type:String,reflect:!0})],re.prototype,"role");ae([J({type:String,attribute:"caption-attr-title"})],re.prototype,"captionAttrTitle");ae([J({type:String,attribute:"description-attr-title"})],re.prototype,"descriptionAttrTitle");ae([J({type:String,attribute:"icon-attr-title"})],re.prototype,"iconAttrTitle");let qe=re;const Fr=(s,e)=>{const t=document.createElement(qe.ID);if(s){if(t.caption=s.caption,t.description=s.description,t.descriptionIcon=s.descriptionIcon,t.icon=s.icon,t.iconBackgroundColor=s.iconBackgroundColor,t.iconPlaceholder=s.iconPlaceholder,t.level=s.level,t.disabled=s.disabled,s.contentMode&&(t.contentMode=s.contentMode),s.leftContentGenerator){const n=s.leftContentGenerator(s,t);n&&(n.slot="left-content",t.appendChild(n))}if(s.rightContentGenerator){const n=s.rightContentGenerator(s,t);n&&(n.slot="right-content",t.appendChild(n))}}return t};qe.ensureDefined();const Wr=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}";var Vr=Object.defineProperty,Gr=Object.getOwnPropertyDescriptor,Ae=(s,e,t,n)=>{for(var i=n>1?void 0:n?Gr(e,t):e,o=s.length-1,a;o>=0;o--)(a=s[o])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Vr(e,t,i),i};let Kr=0;var de;const ye=(de=class extends He{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=de.ID+"_"+Kr++,this.role="listbox",this.itemGenerator=Fr,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;const e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":this.focusIndex=(this.focusIndex+1)%this.itemCount;break;case"Up":case"ArrowUp":this.focusIndex>0?this.focusIndex--:this.finalSizeIsKnown&&(this.focusIndex=this.itemCount-1);break;case"Enter":this.handleSelection(this.focusIndex,e);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(e.preventDefault(),e.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(e){this.toggleAttribute("focus-target",e)}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.itemCount){const t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToItem(e),t!=e&&(e==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(e){e?this._selectedIndices=e.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(e,t="auto"){this.scrollTop=Nr.getOffsetForIndexAndAlignment(this.normalizeIndex(e),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(e){return!this.shadowRoot||e<this._firstVisibleIndex||this._lastVisibleIndex<e?null:this.querySelector(`[item-index="${e}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){const e=this.getListItem(this.focusIndex);e&&(this.focusTarget||document.activeElement==this?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[zn`
|
|
395
395
|
${vi(Wr)}
|
|
396
396
|
`]}render(){return this.updateItemsRenderData(),Be`
|
|
397
397
|
<div class="container" style="height: ${this.itemCount*this.itemHeight}px">
|
|
398
398
|
<slot name="items"></slot>
|
|
399
399
|
</div>
|
|
400
|
-
`}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{const t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{const e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;const t=[...this.querySelectorAll("[item-index]")].map(i=>{if(i instanceof qe){i.enableLineClamp=!1;const o=i.missingWidthForTexts;return o>e&&(i.enableLineClamp=!0),o}}),n=Math.max(...t);n>0&&(this.style.width=`${this.offsetWidth+n}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof qe&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){const e=[...this.querySelectorAll("[item-index]")],t=new Map,n=document.createDocumentFragment();for(const i of this._itemsRenderData){const o=this.renderItem(i);o.parentElement||n.appendChild(o),t.set(i.dataHash,o);const a=e.indexOf(o);a!==-1&&e.splice(a,1)}this.appendChild(n);for(const i of e)i instanceof qe&&(i.enableLineClamp=!1),this.removeChild(i);t.forEach((i,o)=>{this._elementCache.set(o,i)})}renderItem({index:e,top:t,dataHash:n,data:i}){let o;return i?this._elementCache.has(n)?(o=this._elementCache.get(n),this._elementCache.delete(n)):(o=this.itemGenerator(i,e),o.setAttribute("slot","items")):(o=document.createElement("div"),o.setAttribute("placeholder-item",""),o.setAttribute("slot","items")),Object.assign(o.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),o.setAttribute("item-index",e.toString()),o.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),o.setAttribute("aria-posinset",String(e+1)),(!o.id||o.id.startsWith(this.id+"_item_"))&&(o.id=this.id+"_item_"+e),this.itemCount-1==e?o.setAttribute("last",""):o.removeAttribute("last"),this.updateSelectedAttribute(e,o),this.updateFocusedAttribute(e,o),o}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){const n=this.selectedIndices.indexOf(e)!==-1;n?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(n))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);const e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let n=e;n<=t;n++){const i=n-e,o=this.items[i];let a;o?a=JSON.stringify(o):a=`placeholder-${i}`,this._itemsRenderData.push({index:n,top:this.itemHeight*n,physicalIndex:i,dataHash:a,data:o})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;const n=this.getListItem(e);if(n.getAttribute("aria-disabled")=="true"||n.hasAttribute("disabled"))return;let i=!0;if(this.selectionType!=="trigger-only"){const o=this.selectedIndices.indexOf(e);i=o==-1,i?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(o,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,i,t)}dispatchSelectionEvent(e,t,n){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,
|
|
400
|
+
`}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{const t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{const e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;const t=[...this.querySelectorAll("[item-index]")].map(i=>{if(i instanceof qe){i.enableLineClamp=!1;const o=i.missingWidthForTexts;return o>e&&(i.enableLineClamp=!0),o}}),n=Math.max(...t);n>0&&(this.style.width=`${this.offsetWidth+n}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof qe&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){const e=[...this.querySelectorAll("[item-index]")],t=new Map,n=document.createDocumentFragment();for(const i of this._itemsRenderData){const o=this.renderItem(i);o.parentElement||n.appendChild(o),t.set(i.dataHash,o);const a=e.indexOf(o);a!==-1&&e.splice(a,1)}this.appendChild(n);for(const i of e)i instanceof qe&&(i.enableLineClamp=!1),this.removeChild(i);t.forEach((i,o)=>{this._elementCache.set(o,i)})}renderItem({index:e,top:t,dataHash:n,data:i}){let o;return i?this._elementCache.has(n)?(o=this._elementCache.get(n),this._elementCache.delete(n)):(o=this.itemGenerator(i,e),o.setAttribute("slot","items")):(o=document.createElement("div"),o.setAttribute("placeholder-item",""),o.setAttribute("slot","items")),Object.assign(o.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),o.setAttribute("item-index",e.toString()),o.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),o.setAttribute("aria-posinset",String(e+1)),(!o.id||o.id.startsWith(this.id+"_item_"))&&(o.id=this.id+"_item_"+e),this.itemCount-1==e?o.setAttribute("last",""):o.removeAttribute("last"),this.updateSelectedAttribute(e,o),this.updateFocusedAttribute(e,o),o}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){const n=this.selectedIndices.indexOf(e)!==-1;n?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(n))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);const e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let n=e;n<=t;n++){const i=n-e,o=this.items[i];let a;o?a=JSON.stringify(o):a=`placeholder-${i}`,this._itemsRenderData.push({index:n,top:this.itemHeight*n,physicalIndex:i,dataHash:a,data:o})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;const n=this.getListItem(e);if(n.getAttribute("aria-disabled")=="true"||n.hasAttribute("disabled"))return;let i=!0;if(this.selectionType!=="trigger-only"){const o=this.selectedIndices.indexOf(e);i=o==-1,i?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(o,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,i,t)}dispatchSelectionEvent(e,t,n){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,originalEvent:n}}))}handleClick(e){const t=e.composedPath().find(n=>n.hasAttribute&&n.hasAttribute("item-index"));if(t){const n=parseInt(t.getAttribute("item-index"));Number.isInteger(n)&&((e.button==0||e.button==1)&&this.handleSelection(n,e),this.focusIndex=n)}}},de.ID="sd-virtual-list",de.ensureDefined=()=>{qe.ensureDefined(),customElements.get(de.ID)||customElements.define(de.ID,de)},de);Ae([J({type:Number,attribute:"item-height",reflect:!0})],ye.prototype,"itemHeight",2);Ae([J({type:Number})],ye.prototype,"itemCount",2);Ae([J({type:Array,attribute:!1})],ye.prototype,"items",2);Ae([J({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],ye.prototype,"selectionType",2);Ae([J({type:String,attribute:!0,reflect:!0})],ye.prototype,"id",2);Ae([J({type:String,reflect:!0})],ye.prototype,"role",2);Ae([J({type:Number,attribute:"focus-index",reflect:!0})],ye.prototype,"focusIndex",1);Ae([J({type:Array,attribute:!1})],ye.prototype,"selectedIndices",1);let Zr=ye;Zr.ensureDefined();function Gn(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Jr(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(n){var i=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return s[n]}})}),t}var ft={exports:{}},ln;function Xr(){if(ln)return ft.exports;ln=1;var s=String,e=function(){return{isColorSupported:!1,reset:s,bold:s,dim:s,italic:s,underline:s,inverse:s,hidden:s,strikethrough:s,black:s,red:s,green:s,yellow:s,blue:s,magenta:s,cyan:s,white:s,gray:s,bgBlack:s,bgRed:s,bgGreen:s,bgYellow:s,bgBlue:s,bgMagenta:s,bgCyan:s,bgWhite:s,blackBright:s,redBright:s,greenBright:s,yellowBright:s,blueBright:s,magentaBright:s,cyanBright:s,whiteBright:s,bgBlackBright:s,bgRedBright:s,bgGreenBright:s,bgYellowBright:s,bgBlueBright:s,bgMagentaBright:s,bgCyanBright:s,bgWhiteBright:s}};return ft.exports=e(),ft.exports.createColors=e,ft.exports}const Qr={},Yr=Object.freeze(Object.defineProperty({__proto__:null,default:Qr},Symbol.toStringTag,{value:"Module"})),fe=Jr(Yr);var Ut,cn;function Ci(){if(cn)return Ut;cn=1;let s=Xr(),e=fe;class t extends Error{constructor(i,o,a,p,b,h){super(i),this.name="CssSyntaxError",this.reason=i,b&&(this.file=b),p&&(this.source=p),h&&(this.plugin=h),typeof o<"u"&&typeof a<"u"&&(typeof o=="number"?(this.line=o,this.column=a):(this.line=o.line,this.column=o.column,this.endLine=a.line,this.endColumn=a.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let o=this.source;i==null&&(i=s.isColorSupported);let a=c=>c,p=c=>c,b=c=>c;if(i){let{bold:c,gray:f,red:m}=s.createColors(!0);p=g=>c(m(g)),a=g=>f(g),e&&(b=g=>e(g))}let h=o.split(/\r?\n/),r=Math.max(this.line-3,0),u=Math.min(this.line+2,h.length),l=String(u).length;return h.slice(r,u).map((c,f)=>{let m=r+1+f,g=" "+(" "+m).slice(-l)+" | ";if(m===this.line){if(c.length>160){let E=20,v=Math.max(0,this.column-E),w=Math.max(this.column+E,this.endColumn+E),y=c.slice(v,w),A=a(g.replace(/\d/g," "))+c.slice(0,Math.min(this.column-1,E-1)).replace(/[^\t]/g," ");return p(">")+a(g)+b(y)+`
|
|
401
401
|
`+A+p("^")}let _=a(g.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return p(">")+a(g)+b(c)+`
|
|
402
402
|
`+_+p("^")}return" "+a(g)+b(c)}).join(`
|
|
403
403
|
`)}toString(){let i=this.showSourceCode();return i&&(i=`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var lt=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Ft=Object.prototype.hasOwnProperty;var Gt=(
|
|
1
|
+
var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var lt=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Ft=Object.prototype.hasOwnProperty;var Gt=(i,t)=>{for(var e in t)lt(i,e,{get:t[e],enumerable:!0})},Jt=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of jt(t))!Ft.call(i,n)&&n!==e&<(i,n,{get:()=>t[n],enumerable:!(s=Vt(t,n))||s.enumerable});return i};var Zt=i=>Jt(lt({},"__esModule",{value:!0}),i);var Ae={};Gt(Ae,{ListDataProvider:()=>bt,SelectionType:()=>Wt,default:()=>Kt});var Z=globalThis,Q=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),At=new WeakMap,O=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Q&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=At.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&At.set(e,t))}return t}toString(){return this.cssText}},N=i=>new O(typeof i=="string"?i:i+"",void 0,ht),H=(i,...t)=>{let e=i.length===1?i[0]:t.reduce(((s,n,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1]),i[0]);return new O(e,i,ht)},yt=(i,t)=>{if(Q)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),n=Z.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},ct=Q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return N(e)})(i):i;var{is:Qt,defineProperty:Yt,getOwnPropertyDescriptor:Xt,getOwnPropertyNames:te,getOwnPropertySymbols:ee,getPrototypeOf:ie}=Object,Y=globalThis,xt=Y.trustedTypes,se=xt?xt.emptyScript:"",ne=Y.reactiveElementPolyfillSupport,U=(i,t)=>i,z={toAttribute(i,t){switch(t){case Boolean:i=i?se:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},X=(i,t)=>!Qt(i,t),It={attribute:!0,type:String,converter:z,reflect:!1,useDefault:!1,hasChanged:X};Symbol.metadata??=Symbol("metadata"),Y.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=It){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Yt(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){let{get:n,set:o}=Xt(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:n,set(r){let l=n?.call(this);o?.call(this,r),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??It}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;let t=ie(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){let e=this.properties,s=[...te(e),...ee(e)];for(let n of s)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(ct(n))}else t!==void 0&&e.push(ct(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return yt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:z).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let o=s.getPropertyOptions(n),r=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:z;this._$Em=n;let l=r.fromAttribute(e,o.type);this[n]=l??this._$Ej?.get(n)??l,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let n=this.constructor,o=this[t];if(s??=n.getPropertyOptions(t),!((s.hasChanged??X)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:o},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),o!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,o]of s){let{wrapped:r}=o,l=this[n];r!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[U("elementProperties")]=new Map,$[U("finalized")]=new Map,ne?.({ReactiveElement:$}),(Y.reactiveElementVersions??=[]).push("2.1.1");var pt=globalThis,tt=pt.trustedTypes,St=tt?tt.createPolicy("lit-html",{createHTML:i=>i}):void 0,ut="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+v,oe=`<${mt}>`,E=document,B=()=>E.createComment(""),W=i=>i===null||typeof i!="object"&&typeof i!="function",ft=Array.isArray,Lt=i=>ft(i)||typeof i?.[Symbol.iterator]=="function",dt=`[
|
|
2
2
|
\f\r]`,q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wt=/-->/g,Ct=/>/g,w=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Mt=/^(?:script|style|textarea|title)$/i,_t=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),x=_t(1),Ce=_t(2),Ee=_t(3),b=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Pt=new WeakMap,C=E.createTreeWalker(E,129);function Nt(e,t){if(!ft(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return St!==void 0?St.createHTML(t):t}var kt=(e,t)=>{let i=e.length-1,s=[],n,o=t===2?"<svg>":t===3?"<math>":"",r=q;for(let l=0;l<i;l++){let a=e[l],d,u,p=-1,g=0;for(;g<a.length&&(r.lastIndex=g,u=r.exec(a),u!==null);)g=r.lastIndex,r===q?u[1]==="!--"?r=wt:u[1]!==void 0?r=Ct:u[2]!==void 0?(Mt.test(u[2])&&(n=RegExp("</"+u[2],"g")),r=w):u[3]!==void 0&&(r=w):r===w?u[0]===">"?(r=n??q,p=-1):u[1]===void 0?p=-2:(p=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?w:u[3]==='"'?Tt:Et):r===Tt||r===Et?r=w:r===wt||r===Ct?r=q:(r=w,n=void 0);let A=r===w&&e[l+1].startsWith("/>")?" ":"";o+=r===q?a+oe:p>=0?(s.push(d),a.slice(0,p)+ut+a.slice(p)+v+A):a+v+(p===-2?l:A)}return[Nt(e,o+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},W=class e{constructor({strings:t,_$litType$:i},s){let n;this.parts=[];let o=0,r=0,l=t.length-1,a=this.parts,[d,u]=kt(t,i);if(this.el=e.createElement(d,s),C.currentNode=this.el.content,i===2||i===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=C.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(ut)){let g=u[r++],A=n.getAttribute(p).split(v),J=/([.?@])?(.*)/.exec(g);a.push({type:1,index:o,name:J[2],strings:A,ctor:J[1]==="."?it:J[1]==="?"?st:J[1]==="@"?nt:P}),n.removeAttribute(p)}else p.startsWith(v)&&(a.push({type:6,index:o}),n.removeAttribute(p));if(Mt.test(n.tagName)){let p=n.textContent.split(v),g=p.length-1;if(g>0){n.textContent=tt?tt.emptyScript:"";for(let A=0;A<g;A++)n.append(p[A],K()),C.nextNode(),a.push({type:2,index:++o});n.append(p[g],K())}}}else if(n.nodeType===8)if(n.data===mt)a.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(v,p+1))!==-1;)a.push({type:7,index:o}),p+=v.length-1}o++}}static createElement(t,i){let s=E.createElement("template");return s.innerHTML=t,s}};function T(e,t,i=e,s){if(t===b)return t;let n=s!==void 0?i._$Co?.[s]:i._$Cl,o=B(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(e),n._$AT(e,i,s)),s!==void 0?(i._$Co??=[])[s]=n:i._$Cl=n),n!==void 0&&(t=T(e,n._$AS(e,t.values),n,s)),t}var et=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:i},parts:s}=this._$AD,n=(t?.creationScope??E).importNode(i,!0);C.currentNode=n;let o=C.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let d;a.type===2?d=new k(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new ot(o,this,t)),this._$AV.push(d),a=s[++l]}r!==a?.index&&(o=C.nextNode(),r++)}return C.currentNode=E,n}p(t){let i=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}},k=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,n){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=T(this,t,i),B(t)?t===h||t==null||t===""?(this._$AH!==h&&this._$AR(),this._$AH=h):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Lt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==h&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=W.createElement(Nt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(i);else{let o=new et(n,this),r=o.u(this.options);o.p(i),this.T(r),this._$AH=o}}_$AC(t){let i=Pt.get(t.strings);return i===void 0&&Pt.set(t.strings,i=new W(t)),i}k(t){ft(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,s,n=0;for(let o of t)n===i.length?i.push(s=new e(this.O(K()),this.O(K()),this,this.options)):s=i[n],s._$AI(o),n++;n<i.length&&(this._$AR(s&&s._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,n,o){this.type=1,this._$AH=h,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=h}_$AI(t,i=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=T(this,t,i,0),r=!B(t)||t!==this._$AH&&t!==b,r&&(this._$AH=t);else{let l=t,a,d;for(t=o[0],a=0;a<o.length-1;a++)d=T(this,l[s+a],i,a),d===b&&(d=this._$AH[a]),r||=!B(d)||d!==this._$AH[a],d===h?t=h:t!==h&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}r&&!n&&this.j(t)}j(t){t===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},it=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===h?void 0:t}},st=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==h)}},nt=class extends P{constructor(t,i,s,n,o){super(t,i,s,n,o),this.type=5}_$AI(t,i=this){if((t=T(this,t,i,0)??h)===b)return;let s=this._$AH,n=t===h&&s!==h||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==h&&(s===h||n);n&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ot=class{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}},Dt={M:ut,P:v,A:mt,C:1,L:kt,R:et,D:Lt,V:T,I:k,H:P,N:st,U:nt,B:it,F:ot},re=pt.litHtmlPolyfillSupport;re?.(W,k),(pt.litHtmlVersions??=[]).push("3.3.1");var Rt=(e,t,i)=>{let s=i?.renderBefore??t,n=s._$litPart$;if(n===void 0){let o=i?.renderBefore??null;s._$litPart$=n=new k(t.insertBefore(K(),o),o,void 0,i??{})}return n._$AI(e),n};var gt=globalThis,_=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return b}};_._$litElement$=!0,_.finalized=!0,gt.litElementHydrateSupport?.({LitElement:_});var ae=gt.litElementPolyfillSupport;ae?.({LitElement:_});(gt.litElementVersions??=[]).push("4.2.1");var le={attribute:!0,type:String,converter:z,reflect:!1,hasChanged:X},he=(e=le,t,i)=>{let{kind:s,metadata:n}=i,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),s==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(i.name,e),s==="accessor"){let{name:r}=i;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,e)},init(l){return l!==void 0&&this.C(r,void 0,e,l),l}}}if(s==="setter"){let{name:r}=i;return function(l){let a=this[r];t.call(this,l),this.requestUpdate(r,a,e)}}throw Error("Unsupported decorator location: "+s)};function c(e){return(t,i)=>typeof i=="object"?he(e,t,i):((s,n,o)=>{let r=n.hasOwnProperty(o);return n.constructor.createProperty(o,s),r?Object.getOwnPropertyDescriptor(n,o):void 0})(e,t,i)}var R={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},V=e=>(...t)=>({_$litDirective$:e,values:t}),D=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var j=class extends D{constructor(t){if(super(t),this.it=h,t.type!==R.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===h||t==null)return this._t=void 0,this.it=t;if(t===b)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};j.directiveName="unsafeHTML",j.resultType=1;var Ot=V(j);var F=e=>e??h;var{I:ii}=Dt;var Ht=e=>e.strings===void 0;var G=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),G(s,t);return!0},rt=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},Ut=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),pe(t)}};function ce(e){this._$AN!==void 0?(rt(this),this._$AM=e,Ut(this)):this._$AM=e}function de(e,t=!1,i=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=i;o<s.length;o++)G(s[o],!1),rt(s[o]);else s!=null&&(G(s,!1),rt(s));else G(this,e)}var pe=e=>{e.type==R.CHILD&&(e._$AP??=de,e._$AQ??=ce)},at=class extends D{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),Ut(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(G(this,t),rt(this))}setValue(t){if(Ht(this._$Ct))this._$Ct._$AI(t,this);else{let i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};var zt=e=>e?e.startsWith("url")?e:`url("${e}")`:null,ue=(e,t)=>{if(e){let i=new Image;i.addEventListener("load",t),i.src=e,i.complete&&(i.removeEventListener("load",t),window.queueMicrotask(()=>t()))}};var $t=class extends at{constructor(t){if(super(t),t.type!==R.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[i,s]){return this.useCssBackground=t.name=="style",this.render(i,s)}render(t,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(n=>{this.preload(n,s)}),this.useCssBackground?zt(i):i}preload(t,i){t!=null&&!i.cancelled&&ue(t,()=>{i.cancelled||this.setValue(this.useCssBackground?zt(t):t)})}},qt=V($t);var me=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.description.with-icon{display:flex;align-items:center;gap:4px}.description.with-icon .description-icon{width:var(--sd-list-item-description-font-size, 13px);height:var(--sd-list-item-description-font-size, 13px);background-repeat:no-repeat;background-position:bottom;background-size:90%}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',fe=Object.defineProperty,f=(e,t,i,s)=>{for(var n=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=r(t,i,n)||n);return n&&fe(t,i,n),n},L,m=(L=class extends _{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[H`
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Mt=/^(?:script|style|textarea|title)$/i,_t=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),x=_t(1),Ce=_t(2),Ee=_t(3),b=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Pt=new WeakMap,C=E.createTreeWalker(E,129);function Nt(i,t){if(!ft(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return St!==void 0?St.createHTML(t):t}var Dt=(i,t)=>{let e=i.length-1,s=[],n,o=t===2?"<svg>":t===3?"<math>":"",r=q;for(let l=0;l<e;l++){let a=i[l],d,u,p=-1,g=0;for(;g<a.length&&(r.lastIndex=g,u=r.exec(a),u!==null);)g=r.lastIndex,r===q?u[1]==="!--"?r=wt:u[1]!==void 0?r=Ct:u[2]!==void 0?(Mt.test(u[2])&&(n=RegExp("</"+u[2],"g")),r=w):u[3]!==void 0&&(r=w):r===w?u[0]===">"?(r=n??q,p=-1):u[1]===void 0?p=-2:(p=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?w:u[3]==='"'?Tt:Et):r===Tt||r===Et?r=w:r===wt||r===Ct?r=q:(r=w,n=void 0);let y=r===w&&i[l+1].startsWith("/>")?" ":"";o+=r===q?a+oe:p>=0?(s.push(d),a.slice(0,p)+ut+a.slice(p)+v+y):a+v+(p===-2?l:y)}return[Nt(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},K=class i{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,r=0,l=t.length-1,a=this.parts,[d,u]=Dt(t,e);if(this.el=i.createElement(d,s),C.currentNode=this.el.content,e===2||e===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=C.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(ut)){let g=u[r++],y=n.getAttribute(p).split(v),J=/([.?@])?(.*)/.exec(g);a.push({type:1,index:o,name:J[2],strings:y,ctor:J[1]==="."?it:J[1]==="?"?st:J[1]==="@"?nt:P}),n.removeAttribute(p)}else p.startsWith(v)&&(a.push({type:6,index:o}),n.removeAttribute(p));if(Mt.test(n.tagName)){let p=n.textContent.split(v),g=p.length-1;if(g>0){n.textContent=tt?tt.emptyScript:"";for(let y=0;y<g;y++)n.append(p[y],B()),C.nextNode(),a.push({type:2,index:++o});n.append(p[g],B())}}}else if(n.nodeType===8)if(n.data===mt)a.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(v,p+1))!==-1;)a.push({type:7,index:o}),p+=v.length-1}o++}}static createElement(t,e){let s=E.createElement("template");return s.innerHTML=t,s}};function T(i,t,e=i,s){if(t===b)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl,o=W(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=T(i,n._$AS(i,t.values),n,s)),t}var et=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??E).importNode(e,!0);C.currentNode=n;let o=C.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let d;a.type===2?d=new D(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new ot(o,this,t)),this._$AV.push(d),a=s[++l]}r!==a?.index&&(o=C.nextNode(),r++)}return C.currentNode=E,n}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},D=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=T(this,t,e),W(t)?t===h||t==null||t===""?(this._$AH!==h&&this._$AR(),this._$AH=h):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Lt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==h&&W(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=K.createElement(Nt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{let o=new et(n,this),r=o.u(this.options);o.p(e),this.T(r),this._$AH=o}}_$AC(t){let e=Pt.get(t.strings);return e===void 0&&Pt.set(t.strings,e=new K(t)),e}k(t){ft(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let o of t)n===e.length?e.push(s=new i(this.O(B()),this.O(B()),this,this.options)):s=e[n],s._$AI(o),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,o){this.type=1,this._$AH=h,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=h}_$AI(t,e=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=T(this,t,e,0),r=!W(t)||t!==this._$AH&&t!==b,r&&(this._$AH=t);else{let l=t,a,d;for(t=o[0],a=0;a<o.length-1;a++)d=T(this,l[s+a],e,a),d===b&&(d=this._$AH[a]),r||=!W(d)||d!==this._$AH[a],d===h?t=h:t!==h&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}r&&!n&&this.j(t)}j(t){t===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},it=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===h?void 0:t}},st=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==h)}},nt=class extends P{constructor(t,e,s,n,o){super(t,e,s,n,o),this.type=5}_$AI(t,e=this){if((t=T(this,t,e,0)??h)===b)return;let s=this._$AH,n=t===h&&s!==h||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==h&&(s===h||n);n&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ot=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}},kt={M:ut,P:v,A:mt,C:1,L:Dt,R:et,D:Lt,V:T,I:D,H:P,N:st,U:nt,B:it,F:ot},re=pt.litHtmlPolyfillSupport;re?.(K,D),(pt.litHtmlVersions??=[]).push("3.3.1");var Rt=(i,t,e)=>{let s=e?.renderBefore??t,n=s._$litPart$;if(n===void 0){let o=e?.renderBefore??null;s._$litPart$=n=new D(t.insertBefore(B(),o),o,void 0,e??{})}return n._$AI(i),n};var gt=globalThis,_=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return b}};_._$litElement$=!0,_.finalized=!0,gt.litElementHydrateSupport?.({LitElement:_});var ae=gt.litElementPolyfillSupport;ae?.({LitElement:_});(gt.litElementVersions??=[]).push("4.2.1");var le={attribute:!0,type:String,converter:z,reflect:!1,hasChanged:X},he=(i=le,t,e)=>{let{kind:s,metadata:n}=e,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(e.name,i),s==="accessor"){let{name:r}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,i)},init(l){return l!==void 0&&this.C(r,void 0,i,l),l}}}if(s==="setter"){let{name:r}=e;return function(l){let a=this[r];t.call(this,l),this.requestUpdate(r,a,i)}}throw Error("Unsupported decorator location: "+s)};function c(i){return(t,e)=>typeof e=="object"?he(i,t,e):((s,n,o)=>{let r=n.hasOwnProperty(o);return n.constructor.createProperty(o,s),r?Object.getOwnPropertyDescriptor(n,o):void 0})(i,t,e)}var R={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},V=i=>(...t)=>({_$litDirective$:i,values:t}),k=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var j=class extends k{constructor(t){if(super(t),this.it=h,t.type!==R.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===h||t==null)return this._t=void 0,this.it=t;if(t===b)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};j.directiveName="unsafeHTML",j.resultType=1;var Ot=V(j);var F=i=>i??h;var{I:ii}=kt;var Ht=i=>i.strings===void 0;var G=(i,t)=>{let e=i._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),G(s,t);return!0},rt=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while(e?.size===0)},Ut=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),pe(t)}};function ce(i){this._$AN!==void 0?(rt(this),this._$AM=i,Ut(this)):this._$AM=i}function de(i,t=!1,e=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=e;o<s.length;o++)G(s[o],!1),rt(s[o]);else s!=null&&(G(s,!1),rt(s));else G(this,i)}var pe=i=>{i.type==R.CHILD&&(i._$AP??=de,i._$AQ??=ce)},at=class extends k{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Ut(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(G(this,t),rt(this))}setValue(t){if(Ht(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var zt=i=>i?i.startsWith("url")?i:`url("${i}")`:null,ue=(i,t)=>{if(i){let e=new Image;e.addEventListener("load",t),e.src=i,e.complete&&(e.removeEventListener("load",t),window.queueMicrotask(()=>t()))}};var $t=class extends at{constructor(t){if(super(t),t.type!==R.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[e,s]){return this.useCssBackground=t.name=="style",this.render(e,s)}render(t,e){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(n=>{this.preload(n,s)}),this.useCssBackground?zt(e):e}preload(t,e){t!=null&&!e.cancelled&&ue(t,()=>{e.cancelled||this.setValue(this.useCssBackground?zt(t):t)})}},qt=V($t);var me=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.description.with-icon{display:flex;align-items:center;gap:4px}.description.with-icon .description-icon{width:var(--sd-list-item-description-font-size, 13px);height:var(--sd-list-item-description-font-size, 13px);background-repeat:no-repeat;background-position:bottom;background-size:90%}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',fe=Object.defineProperty,f=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&fe(t,e,n),n},L,m=(L=class extends _{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[H`
|
|
4
4
|
${N(me)}
|
|
5
5
|
`]}render(){return x`
|
|
6
6
|
<div class="container">
|
|
7
|
-
${this.getLevelIndicators().map((
|
|
7
|
+
${this.getLevelIndicators().map((i,t)=>x` <div class="level-indicator level-${t}"></div> `)}
|
|
8
8
|
<div class="side-content">
|
|
9
9
|
<slot name="left-content"></slot>
|
|
10
10
|
${this.renderIcon()}
|
|
@@ -26,18 +26,18 @@ var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var lt=Object.de
|
|
|
26
26
|
title="${F(this.iconAttrTitle)}"
|
|
27
27
|
>
|
|
28
28
|
<div class="icon" style="background-image:${qt(this.icon,this.iconPlaceholder)}"></div>
|
|
29
|
-
</div> `:h}renderLabel(
|
|
30
|
-
<div class="${
|
|
31
|
-
${s?x` <div class="${
|
|
29
|
+
</div> `:h}renderLabel(i,t,e,s){return t?x`
|
|
30
|
+
<div class="${i} ${s?"with-icon":""}" title="${F(e)}">
|
|
31
|
+
${s?x` <div class="${i}-icon" style="background-image:url('${s}')" aria-hidden="true"></div> `:h}
|
|
32
32
|
${this.contentMode==="html"?Ot(t):t}
|
|
33
33
|
</div>
|
|
34
|
-
`:h}updated(
|
|
34
|
+
`:h}updated(i){super.updated(i),i.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let i=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,e=this.shadowRoot.querySelector(".caption");e&&(t+=e.scrollWidth-e.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,i&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(i){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",i))&&i.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},L.ID="sd-list-item",L.ensureDefined=()=>{customElements.get(L.ID)||customElements.define(L.ID,L)},L);f([c({type:String})],m.prototype,"caption");f([c({type:String})],m.prototype,"description");f([c({type:String})],m.prototype,"descriptionIcon");f([c({type:Boolean})],m.prototype,"selected");f([c({type:String})],m.prototype,"icon");f([c({type:String})],m.prototype,"iconBackgroundColor");f([c({type:String})],m.prototype,"iconPlaceholder");f([c({type:Number})],m.prototype,"level");f([c()],m.prototype,"contentMode");f([c({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],m.prototype,"enableLineClamp");f([c({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],m.prototype,"disabled");f([c({type:String,attribute:"icon-attr-aria-label"})],m.prototype,"iconAttrAriaLabel");f([c({type:String,reflect:!0})],m.prototype,"role");f([c({type:String,attribute:"caption-attr-title"})],m.prototype,"captionAttrTitle");f([c({type:String,attribute:"description-attr-title"})],m.prototype,"descriptionAttrTitle");f([c({type:String,attribute:"icon-attr-title"})],m.prototype,"iconAttrTitle");var M=m,Bt=(i,t)=>{let e=document.createElement(M.ID);if(i){if(e.caption=i.caption,e.description=i.description,e.descriptionIcon=i.descriptionIcon,e.icon=i.icon,e.iconBackgroundColor=i.iconBackgroundColor,e.iconPlaceholder=i.iconPlaceholder,e.level=i.level,e.disabled=i.disabled,i.contentMode&&(e.contentMode=i.contentMode),i.leftContentGenerator){let s=i.leftContentGenerator(i,e);s&&(s.slot="left-content",e.appendChild(s))}if(i.rightContentGenerator){let s=i.rightContentGenerator(i,e);s&&(s.slot="right-content",e.appendChild(s))}}return e};M.ensureDefined();var vt=class{getOffsetForIndexAndAlignment(t,e,s,n,o,r){let l=Math.max(0,r*n),a=Math.min(l,t*n),d=Math.max(0,t*n-o+n);switch(e){case"start":return a;case"end":return d;case"center":{let u=Math.round(d+(a-d)/2);return u<Math.ceil(o/2)?0:u>l+Math.floor(o/2)?l:u}case"auto":default:return s>=d&&s<=a?s:s<d?d:a}}debounce(t){let e;return(...s)=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{t(...s),e=null})}}},_e=new vt,bt=class{constructor(t=100,e=5){this.pageSize=t,this.preloadedItemsCount=e,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this.handleListDataRequest=s=>{let{startIndex:n,stopIndex:o}=s.detail;this._lastRequestedFirstIndex=n,this._lastRequestedLastIndex=o,this._list.items=this._itemCache.slice(n,o+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<o+this.preloadedItemsCount&&this.requestData()},this.itemCount=t}get currentPage(){return this.items.length==0&&this.finalSizeIsKnown?0:Math.floor((this.items.length-1)/this.pageSize)}get finalSizeIsKnown(){return this._finalSizeIsKnown}set finalSizeIsKnown(t){this._finalSizeIsKnown=t,t&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=t)}get itemCount(){return this._itemCount}set itemCount(t){this._itemCount=t,this._list&&(this._list.itemCount=t)}get items(){return this._itemCache}set items(t){this._itemCache=t,this.onItemsChange()}addItems(t){this._itemCache=this._itemCache.concat(t),this.onItemsChange()}connectList(t){this._list&&this._list.removeEventListener("data-request",this.handleListDataRequest),this._list=t,t.itemCount=this.itemCount,t.addEventListener("data-request",this.handleListDataRequest),t.finalSizeIsKnown=this._finalSizeIsKnown}onItemsChange(){this._pendingDataRequest=!1,this._lastLoadedIndex=this._itemCache.length-1,this.finalSizeIsKnown?this.itemCount=this._itemCache.length:this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex),this._list&&(this._list.items=this._itemCache.slice(this._lastRequestedFirstIndex,this._lastRequestedLastIndex+1))}requestData(){if(!this._pendingDataRequest)if(this.onDataRequest)this._pendingDataRequest=!0,this.onDataRequest(this.currentPage+1),this._lastLoadedIndex+=this.pageSize-1,this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex);else throw Error("The final size is not yet known and the list would require item data from index "+this._lastRequestedFirstIndex+". to "+this._lastRequestedLastIndex+". which is not possible to load without a configured onDataRequest")}},ge=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}",$e=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(i,t,e,s)=>{for(var n=s>1?void 0:s?ve(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&$e(t,e,n),n},Wt=(i=>(i.TriggerOnly="trigger-only",i.Single="single",i.Multi="multi",i))(Wt||{}),be=0,I,A=(I=class extends _{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=I.ID+"_"+be++,this.role="listbox",this.itemGenerator=Bt,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let i=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(i)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=i=>{let t=!0;switch(i.key){case"Down":case"ArrowDown":this.focusIndex=(this.focusIndex+1)%this.itemCount;break;case"Up":case"ArrowUp":this.focusIndex>0?this.focusIndex--:this.finalSizeIsKnown&&(this.focusIndex=this.itemCount-1);break;case"Enter":this.handleSelection(this.focusIndex,i);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(i.preventDefault(),i.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(i){this.toggleAttribute("focus-target",i)}get focusIndex(){return this._focusIndex}set focusIndex(i){if(i>=-1&&i<this.itemCount){let t=this._focusIndex;this._focusIndex=i,(i<=this._firstVisibleIndex||this._lastVisibleIndex<=i)&&this.scrollToItem(i),t!=i&&(i==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(i){i?this._selectedIndices=i.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(i,t="auto"){this.scrollTop=_e.getOffsetForIndexAndAlignment(this.normalizeIndex(i),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(i){return!this.shadowRoot||i<this._firstVisibleIndex||this._lastVisibleIndex<i?null:this.querySelector(`[item-index="${i}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(i){super.firstUpdated(i),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){let i=this.getListItem(this.focusIndex);i&&(this.focusTarget||document.activeElement==this?(i.setAttribute("focused",""),this.setAttribute("aria-activedescendant",i.id)):(i.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[H`
|
|
35
35
|
${N(ge)}
|
|
36
36
|
`]}render(){return this.updateItemsRenderData(),x`
|
|
37
37
|
<div class="container" style="height: ${this.itemCount*this.itemHeight}px">
|
|
38
38
|
<slot name="items"></slot>
|
|
39
39
|
</div>
|
|
40
|
-
`}updated(
|
|
40
|
+
`}updated(i){if(super.updated(i),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{let t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{let i=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(i==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof M){s.enableLineClamp=!1;let n=s.missingWidthForTexts;return n>i&&(s.enableLineClamp=!0),n}}),e=Math.max(...t);e>0&&(this.style.width=`${this.offsetWidth+e}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(i=>{i instanceof M&&(i.enableLineClamp=i.enableLineClamp||i.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let i=[...this.querySelectorAll("[item-index]")],t=new Map,e=document.createDocumentFragment();for(let s of this._itemsRenderData){let n=this.renderItem(s);n.parentElement||e.appendChild(n),t.set(s.dataHash,n);let o=i.indexOf(n);o!==-1&&i.splice(o,1)}this.appendChild(e);for(let s of i)s instanceof M&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,n)=>{this._elementCache.set(n,s)})}renderItem({index:i,top:t,dataHash:e,data:s}){let n;return s?this._elementCache.has(e)?(n=this._elementCache.get(e),this._elementCache.delete(e)):(n=this.itemGenerator(s,i),n.setAttribute("slot","items")):(n=document.createElement("div"),n.setAttribute("placeholder-item",""),n.setAttribute("slot","items")),Object.assign(n.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),n.setAttribute("item-index",i.toString()),n.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),n.setAttribute("aria-posinset",String(i+1)),(!n.id||n.id.startsWith(this.id+"_item_"))&&(n.id=this.id+"_item_"+i),this.itemCount-1==i?n.setAttribute("last",""):n.removeAttribute("last"),this.updateSelectedAttribute(i,n),this.updateFocusedAttribute(i,n),n}updateFocusedAttribute(i,t){this.focusIndex==i&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(i,t){let e=this.selectedIndices.indexOf(i)!==-1;e?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(e))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);let i=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(i,t);for(let e=i;e<=t;e++){let s=e-i,n=this.items[s],o;n?o=JSON.stringify(n):o=`placeholder-${s}`,this._itemsRenderData.push({index:e,top:this.itemHeight*e,physicalIndex:s,dataHash:o,data:n})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(i){return Math.max(0,Math.min(i,this.itemCount-1))}get height(){return this.offsetHeight}requestData(i,t){!Number.isNaN(i)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:i,stopIndex:t}}))}handleSelection(i,t){if(i<0||this.itemCount<=i)return;let e=this.getListItem(i);if(e.getAttribute("aria-disabled")=="true"||e.hasAttribute("disabled"))return;let s=!0;if(this.selectionType!=="trigger-only"){let n=this.selectedIndices.indexOf(i);s=n==-1,s?this.selectionType==="single"?this.selectedIndices=[i]:this.selectedIndices.push(i):this.selectedIndices.splice(n,1),this.requestUpdate("selectedIndices")}this.focusIndex=i,this.dispatchSelectionEvent(i,s,t)}dispatchSelectionEvent(i,t,e){this.dispatchEvent(new CustomEvent("selection",{detail:{index:i,selected:t,originalEvent:e}}))}handleClick(i){let t=i.composedPath().find(e=>e.hasAttribute&&e.hasAttribute("item-index"));if(t){let e=parseInt(t.getAttribute("item-index"));Number.isInteger(e)&&((i.button==0||i.button==1)&&this.handleSelection(e,i),this.focusIndex=e)}}},I.ID="sd-virtual-list",I.ensureDefined=()=>{M.ensureDefined(),customElements.get(I.ID)||customElements.define(I.ID,I)},I);S([c({type:Number,attribute:"item-height",reflect:!0})],A.prototype,"itemHeight",2);S([c({type:Number})],A.prototype,"itemCount",2);S([c({type:Array,attribute:!1})],A.prototype,"items",2);S([c({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],A.prototype,"selectionType",2);S([c({type:String,attribute:!0,reflect:!0})],A.prototype,"id",2);S([c({type:String,reflect:!0})],A.prototype,"role",2);S([c({type:Number,attribute:"focus-index",reflect:!0})],A.prototype,"focusIndex",1);S([c({type:Array,attribute:!1})],A.prototype,"selectedIndices",1);var Kt=A;Kt.ensureDefined();return Zt(Ae);})();
|
|
41
41
|
/*! Bundled license information:
|
|
42
42
|
|
|
43
43
|
@lit/reactive-element/css-tag.js:
|