@cas-smartdesign/virtual-list 9.0.0 → 9.0.1
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 +2 -2
- package/dist/virtual-list.mjs +1 -1
- package/dist/virtual-list.mjs.map +1 -1
- package/package.json +4 -4
package/dist/docs/doc.mjs
CHANGED
|
@@ -366,7 +366,7 @@ list.addEventListener("sd-virtual-list-selection", (event) => {
|
|
|
366
366
|
}\`;
|
|
367
367
|
});
|
|
368
368
|
`,M=s({default:()=>N}),N={mainContent:k,description:A,css:O,initializer:{content:j,type:`typescript`,initialize:()=>y(()=>import(`./3_duplicate_items.js`),__vite__mapDeps([3,1]),import.meta.url)},additionalSources:[{type:`source`,label:`item-provider`,language:`typescript`,content:u},{type:`source`,label:`sample-data`,language:`typescript`,content:d}]},P=globalThis,F=e=>e,I=P.trustedTypes,L=I?I.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,R=`$lit$`,z=`lit$${Math.random().toFixed(9).slice(2)}$`,B=`?`+z,ee=`<${B}>`,V=document,te=()=>V.createComment(``),ne=e=>e===null||typeof e!=`object`&&typeof e!=`function`,re=Array.isArray,ie=e=>re(e)||typeof e?.[Symbol.iterator]==`function`,ae=`[
|
|
369
|
-
\f\r]`,oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,se=/-->/g,ce=/>/g,le=RegExp(`>|${ae}(?:([^\\s"'>=/]+)(${ae}*=${ae}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ue=/'/g,de=/"/g,fe=/^(?:script|style|textarea|title)$/i,pe=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),me=Symbol.for(`lit-noChange`),H=Symbol.for(`lit-nothing`),he=new WeakMap,ge=V.createTreeWalker(V,129);function _e(e,t){if(!re(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return L===void 0?t:L.createHTML(t)}var U=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=oe;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===oe?c[1]===`!--`?o=se:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=le):(fe.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=le):o=ce:o===le?c[0]===`>`?(o=i??oe,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?le:c[3]===`"`?de:ue):o===de||o===ue?o=le:o===se||o===ce?o=oe:(o=le,i=void 0);let d=o===le&&e[t+1].startsWith(`/>`)?` `:``;a+=o===oe?n+ee:l>=0?(r.push(s),n.slice(0,l)+R+n.slice(l)+z+d):n+z+(l===-2?t:d)}return[_e(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},ve=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=U(t,n);if(this.el=e.createElement(l,r),ge.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=ge.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(R)){let t=u[o++],n=i.getAttribute(e).split(z),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Se:r[1]===`?`?Ce:r[1]===`@`?we:xe}),i.removeAttribute(e)}else e.startsWith(z)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(fe.test(i.tagName)){let e=i.textContent.split(z),t=e.length-1;if(t>0){i.textContent=I?I.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],te()),ge.nextNode(),c.push({type:2,index:++a});i.append(e[t],te())}}}else if(i.nodeType===8)if(i.data===B)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(z,e+1))!==-1;)c.push({type:7,index:a}),e+=z.length-1}a++}}static createElement(e,t){let n=V.createElement(`template`);return n.innerHTML=e,n}};function W(e,t,n=e,r){if(t===me)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ne(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=W(e,i._$AS(e,t.values),i,r)),t}var ye=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??V).importNode(t,!0);ge.currentNode=r;let i=ge.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new be(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Te(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=ge.nextNode(),a++)}return ge.currentNode=V,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},be=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=W(this,e,t),ne(e)?e===H||e==null||e===``?(this._$AH!==H&&this._$AR(),this._$AH=H):e!==this._$AH&&e!==me&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ie(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==H&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(V.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=ve.createElement(_e(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new ye(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=he.get(e.strings);return t===void 0&&he.set(e.strings,t=new ve(e)),t}k(t){re(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(te()),this.O(te()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=F(e).nextSibling;F(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},xe=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=H,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=H}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=W(this,e,t,0),a=!ne(e)||e!==this._$AH&&e!==me,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=W(this,r[n+o],t,o),s===me&&(s=this._$AH[o]),a||=!ne(s)||s!==this._$AH[o],s===H?e=H:e!==H&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Se=class extends xe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===H?void 0:e}},Ce=class extends xe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==H)}},we=class extends xe{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??H)===me)return;let n=this._$AH,r=e===H&&n!==H||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==H&&(n===H||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Te=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){W(this,e)}},Ee={M:R,P:z,A:B,C:1,L:U,R:ye,D:ie,V:W,I:be,H:xe,N:Ce,U:we,B:Se,F:Te},De=P.litHtmlPolyfillSupport;De?.(ve,be),(P.litHtmlVersions??=[]).push(`3.3.2`);var Oe=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new be(t.insertBefore(te(),e),e,void 0,n??{})}return i._$AI(e),i},{I:ke}=Ee,Ae=e=>e.strings===void 0,je={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Me=e=>(...t)=>({_$litDirective$:e,values:t}),Ne=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},Pe=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Pe(e,t);return!0},G=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Fe=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Re(t)}};function Ie(e){this._$AN===void 0?this._$AM=e:(G(this),this._$AM=e,Fe(this))}function Le(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)Pe(r[e],!1),G(r[e]);else r!=null&&(Pe(r,!1),G(r));else Pe(this,e)}var Re=e=>{e.type==je.CHILD&&(e._$AP??=Le,e._$AQ??=Ie)},ze=class extends Ne{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Fe(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Pe(this,e),G(this))}setValue(e){if(Ae(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},Be=e=>e?e.startsWith(`url`)?e:`url("${e}")`:``,Ve=(e,t)=>{if(e){let n=new Image;n.addEventListener(`load`,t),n.src=e,n.complete&&(n.removeEventListener(`load`,t),window.queueMicrotask(()=>t()))}},He=Me(class extends ze{constructor(e){if(super(e),this.useCssBackground=!1,e.type!==je.ATTRIBUTE||e.name!==`src`&&e.name!==`style`)throw Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(e,[t,n]){return this.useCssBackground=e.name==`style`,this.render(t,n)}render(e,t){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let n={cancelled:!1};return this.loadingToken=n,typeof e==`string`?this.preload(e,n):e?.then(e=>{this.preload(e,n)}),this.useCssBackground?Be(t):t}preload(e,t){e!=null&&!t.cancelled&&Ve(e,()=>{t.cancelled||this.setValue(this.useCssBackground?Be(e):e)})}}),Ue=globalThis,We=Ue.ShadowRoot&&(Ue.ShadyCSS===void 0||Ue.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,Ge=Symbol(),Ke=new WeakMap,qe=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ge)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(We&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Ke.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ke.set(t,e))}return e}toString(){return this.cssText}},Je=e=>new qe(typeof e==`string`?e:e+``,void 0,Ge),Ye=(e,...t)=>new qe(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,Ge),Xe=(e,t)=>{if(We)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=Ue.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},Ze=We?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return Je(t)})(e):e,{is:Qe,defineProperty:$e,getOwnPropertyDescriptor:et,getOwnPropertyNames:tt,getOwnPropertySymbols:nt,getPrototypeOf:rt}=Object,it=globalThis,at=it.trustedTypes,ot=at?at.emptyScript:``,st=it.reactiveElementPolyfillSupport,ct=(e,t)=>e,lt={toAttribute(e,t){switch(t){case Boolean:e=e?ot:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ut=(e,t)=>!Qe(e,t),dt={attribute:!0,type:String,converter:lt,reflect:!1,useDefault:!1,hasChanged:ut};Symbol.metadata??=Symbol(`metadata`),it.litPropertyMetadata??=new WeakMap;var ft=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=dt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&$e(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=et(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??dt}static _$Ei(){if(this.hasOwnProperty(ct(`elementProperties`)))return;let e=rt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ct(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ct(`properties`))){let e=this.properties,t=[...tt(e),...nt(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(Ze(e))}else e!==void 0&&t.push(Ze(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Xe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?lt:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?lt:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??ut)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};ft.elementStyles=[],ft.shadowRootOptions={mode:`open`},ft[ct(`elementProperties`)]=new Map,ft[ct(`finalized`)]=new Map,st?.({ReactiveElement:ft}),(it.reactiveElementVersions??=[]).push(`2.1.2`);var pt=globalThis,mt=class extends ft{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Oe(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return me}};mt._$litElement$=!0,mt.finalized=!0,pt.litElementHydrateSupport?.({LitElement:mt});var ht=pt.litElementPolyfillSupport;ht?.({LitElement:mt}),(pt.litElementVersions??=[]).push(`4.2.2`);var gt={attribute:!0,type:String,converter:lt,reflect:!1,hasChanged:ut},_t=(e=gt,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function K(e){return(t,n)=>typeof n==`object`?_t(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var vt=e=>e??H,yt=class extends Ne{constructor(e){if(super(e),this.it=H,e.type!==je.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===H||e==null)return this._t=void 0,this.it=e;if(e===me)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};yt.directiveName=`unsafeHTML`,yt.resultType=1;var bt=Me(yt),xt=`:host{contain:size layout style;box-sizing:border-box;border:1px solid #0000;height:48px;display:block}:host(:is(:hover,[focused])){background-color:var(--color-bg-action-neutral-weakest-hover,#ededed)}:host(:not([aria-disabled=true]):active){background-color:var(--color-bg-action-neutral-weakest-pressed,#dfdfdf)}:host([aria-selected=true]){background-color:var(--color-bg-selection-neutral-default,#ededed)}:host([aria-selected=true]:is(:hover,[focused])){background-color:var(--color-bg-selection-neutral-default-hover,#dfdfdf)}:host([aria-disabled=true]) .side-content{opacity:var(--opacity-default,.5)}:host([aria-disabled=true]) .caption,:host([aria-disabled=true]) .description{color:var(--color-fg-interaction-disabled,#999)}:host:after{content:"";border:2px solid var(--sd-list-item-focus-ring-offset-color,transparent);outline:1px solid var(--sd-list-item-focus-ring-color,transparent);border-radius:var(--radius-s,4px);pointer-events:none;position:absolute;inset:-2px}@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{-webkit-line-clamp:2;white-space:pre-wrap;overflow-wrap:break-word;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.container{box-sizing:border-box;height:100%;display:flex}.container .level-indicator{flex-shrink:0;width:6px;height:100%}.container .level-indicator+.level-indicator{margin-left:var(--spacing-x1,2px)}.container .level-indicator.level-0{background-color:var(--sd-list-item-level-0-color,var(--color-rainbow-dark-blue-weak30,#c7dbef))}.container .level-indicator.level-1{background-color:var(--sd-list-item-level-1-color,var(--color-rainbow-orange-weak20,#ffc19b))}.container .level-indicator.level-2{background-color:var(--sd-list-item-level-2-color,var(--color-rainbow-green-weak10,#bdda76))}.container .level-indicator.level-3{background-color:var(--sd-list-item-level-3-color,var(--color-rainbow-red-weak20,#f3939e))}.container .level-indicator.level-4{background-color:var(--sd-list-item-level-4-color,var(--color-rainbow-blue-weak10,#77c5ff))}.container .level-indicator.level-5{background-color:var(--sd-list-item-level-5-color,var(--color-rainbow-yellow-weak10,#ffd979))}.container .level-indicator.level-6{background-color:var(--sd-list-item-level-6-color,var(--color-rainbow-purple-weak20,#d493df))}.side-content{flex-grow:0;align-items:center;display:flex}.labels{height:100%;padding:var(--sd-list-item-label-content-padding,0 var(--spacing-x4,8px));flex-direction:column;flex:auto;justify-content:center;line-height:normal;display:flex;overflow:hidden}.caption,.description{text-overflow:ellipsis;-webkit-user-select:none;user-select:none;width:100%;-webkit-text-decoration:inherit;text-decoration:inherit;overflow:hidden}.caption span,.description span{white-space:pre;text-overflow:ellipsis;overflow:hidden}span.caption,span.description{white-space:pre}.caption{font:var(--sd-list-item-caption-font,var(--text-body,400 15px/20px Inter));color:var(--sd-list-item-caption-color,var(--color-fg-default,#111))}.caption em{font:var(--text-body-highlighted,700 15px/20px Inter)}.description{font:var(--sd-list-item-description-font,var(--text-description,400 13px/16px Inter));color:var(--sd-list-item-description-color,var(--color-fg-weak,#565656))}.description em{font:var(--text-description-highlighted,700 13px/16px Inter)}.description.with-icon{align-items:center;gap:var(--spacing-x2,4px);display:flex}.description.with-icon .description-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;flex-shrink:0;width:12px;height:12px}.icon-wrapper{width:32px;height:32px;margin-left:var(--spacing-x4,8px);border-radius:var(--sd-list-item-icon-background-radius,var(--radius-xs,2px));justify-content:center;align-items:center;display:flex;overflow:hidden}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size,24px);min-width:var(--sd-list-item-icon-size,24px);background-position:50%;background-repeat:no-repeat;background-size:var(--sd-list-item-icon-background-size,cover)}`;function q(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function J(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Y=class e extends mt{constructor(...e){super(...e),this.contentMode=`text`,this.role=`option`}static{this.ID=`sd-list-item`}static{this.ensureDefined=()=>{customElements.get(e.ID)||customElements.define(e.ID,e)}}static get styles(){return[Ye`
|
|
369
|
+
\f\r]`,oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,se=/-->/g,ce=/>/g,le=RegExp(`>|${ae}(?:([^\\s"'>=/]+)(${ae}*=${ae}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ue=/'/g,de=/"/g,fe=/^(?:script|style|textarea|title)$/i,pe=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),me=Symbol.for(`lit-noChange`),H=Symbol.for(`lit-nothing`),he=new WeakMap,ge=V.createTreeWalker(V,129);function _e(e,t){if(!re(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return L===void 0?t:L.createHTML(t)}var U=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=oe;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===oe?c[1]===`!--`?o=se:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=le):(fe.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=le):o=ce:o===le?c[0]===`>`?(o=i??oe,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?le:c[3]===`"`?de:ue):o===de||o===ue?o=le:o===se||o===ce?o=oe:(o=le,i=void 0);let d=o===le&&e[t+1].startsWith(`/>`)?` `:``;a+=o===oe?n+ee:l>=0?(r.push(s),n.slice(0,l)+R+n.slice(l)+z+d):n+z+(l===-2?t:d)}return[_e(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},ve=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=U(t,n);if(this.el=e.createElement(l,r),ge.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=ge.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(R)){let t=u[o++],n=i.getAttribute(e).split(z),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Se:r[1]===`?`?Ce:r[1]===`@`?we:xe}),i.removeAttribute(e)}else e.startsWith(z)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(fe.test(i.tagName)){let e=i.textContent.split(z),t=e.length-1;if(t>0){i.textContent=I?I.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],te()),ge.nextNode(),c.push({type:2,index:++a});i.append(e[t],te())}}}else if(i.nodeType===8)if(i.data===B)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(z,e+1))!==-1;)c.push({type:7,index:a}),e+=z.length-1}a++}}static createElement(e,t){let n=V.createElement(`template`);return n.innerHTML=e,n}};function W(e,t,n=e,r){if(t===me)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ne(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=W(e,i._$AS(e,t.values),i,r)),t}var ye=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??V).importNode(t,!0);ge.currentNode=r;let i=ge.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new be(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Te(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=ge.nextNode(),a++)}return ge.currentNode=V,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},be=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=W(this,e,t),ne(e)?e===H||e==null||e===``?(this._$AH!==H&&this._$AR(),this._$AH=H):e!==this._$AH&&e!==me&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ie(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==H&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(V.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=ve.createElement(_e(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new ye(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=he.get(e.strings);return t===void 0&&he.set(e.strings,t=new ve(e)),t}k(t){re(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(te()),this.O(te()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=F(e).nextSibling;F(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},xe=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=H,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=H}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=W(this,e,t,0),a=!ne(e)||e!==this._$AH&&e!==me,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=W(this,r[n+o],t,o),s===me&&(s=this._$AH[o]),a||=!ne(s)||s!==this._$AH[o],s===H?e=H:e!==H&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Se=class extends xe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===H?void 0:e}},Ce=class extends xe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==H)}},we=class extends xe{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??H)===me)return;let n=this._$AH,r=e===H&&n!==H||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==H&&(n===H||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Te=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){W(this,e)}},Ee={M:R,P:z,A:B,C:1,L:U,R:ye,D:ie,V:W,I:be,H:xe,N:Ce,U:we,B:Se,F:Te},De=P.litHtmlPolyfillSupport;De?.(ve,be),(P.litHtmlVersions??=[]).push(`3.3.2`);var Oe=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new be(t.insertBefore(te(),e),e,void 0,n??{})}return i._$AI(e),i},{I:ke}=Ee,Ae=e=>e.strings===void 0,je={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Me=e=>(...t)=>({_$litDirective$:e,values:t}),Ne=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},Pe=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Pe(e,t);return!0},G=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Fe=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Re(t)}};function Ie(e){this._$AN===void 0?this._$AM=e:(G(this),this._$AM=e,Fe(this))}function Le(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)Pe(r[e],!1),G(r[e]);else r!=null&&(Pe(r,!1),G(r));else Pe(this,e)}var Re=e=>{e.type==je.CHILD&&(e._$AP??=Le,e._$AQ??=Ie)},ze=class extends Ne{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Fe(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Pe(this,e),G(this))}setValue(e){if(Ae(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},Be=e=>e?e.startsWith(`url`)?e:`url("${e}")`:``,Ve=(e,t)=>{if(e){let n=new Image;n.addEventListener(`load`,t),n.src=e,n.complete&&(n.removeEventListener(`load`,t),window.queueMicrotask(()=>t()))}},He=Me(class extends ze{constructor(e){if(super(e),this.useCssBackground=!1,e.type!==je.ATTRIBUTE||e.name!==`src`&&e.name!==`style`)throw Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(e,[t,n]){return this.useCssBackground=e.name==`style`,this.render(t,n)}render(e,t){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let n={cancelled:!1};return this.loadingToken=n,typeof e==`string`?this.preload(e,n):e?.then(e=>{this.preload(e,n)}),this.useCssBackground?Be(t):t}preload(e,t){e!=null&&!t.cancelled&&Ve(e,()=>{t.cancelled||this.setValue(this.useCssBackground?Be(e):e)})}}),Ue=globalThis,We=Ue.ShadowRoot&&(Ue.ShadyCSS===void 0||Ue.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,Ge=Symbol(),Ke=new WeakMap,qe=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ge)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(We&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Ke.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ke.set(t,e))}return e}toString(){return this.cssText}},Je=e=>new qe(typeof e==`string`?e:e+``,void 0,Ge),Ye=(e,...t)=>new qe(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,Ge),Xe=(e,t)=>{if(We)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=Ue.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},Ze=We?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return Je(t)})(e):e,{is:Qe,defineProperty:$e,getOwnPropertyDescriptor:et,getOwnPropertyNames:tt,getOwnPropertySymbols:nt,getPrototypeOf:rt}=Object,it=globalThis,at=it.trustedTypes,ot=at?at.emptyScript:``,st=it.reactiveElementPolyfillSupport,ct=(e,t)=>e,lt={toAttribute(e,t){switch(t){case Boolean:e=e?ot:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ut=(e,t)=>!Qe(e,t),dt={attribute:!0,type:String,converter:lt,reflect:!1,useDefault:!1,hasChanged:ut};Symbol.metadata??=Symbol(`metadata`),it.litPropertyMetadata??=new WeakMap;var ft=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=dt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&$e(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=et(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??dt}static _$Ei(){if(this.hasOwnProperty(ct(`elementProperties`)))return;let e=rt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ct(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ct(`properties`))){let e=this.properties,t=[...tt(e),...nt(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(Ze(e))}else e!==void 0&&t.push(Ze(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Xe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?lt:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?lt:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??ut)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};ft.elementStyles=[],ft.shadowRootOptions={mode:`open`},ft[ct(`elementProperties`)]=new Map,ft[ct(`finalized`)]=new Map,st?.({ReactiveElement:ft}),(it.reactiveElementVersions??=[]).push(`2.1.2`);var pt=globalThis,mt=class extends ft{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Oe(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return me}};mt._$litElement$=!0,mt.finalized=!0,pt.litElementHydrateSupport?.({LitElement:mt});var ht=pt.litElementPolyfillSupport;ht?.({LitElement:mt}),(pt.litElementVersions??=[]).push(`4.2.2`);var gt={attribute:!0,type:String,converter:lt,reflect:!1,hasChanged:ut},_t=(e=gt,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function K(e){return(t,n)=>typeof n==`object`?_t(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var vt=e=>e??H,yt=class extends Ne{constructor(e){if(super(e),this.it=H,e.type!==je.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===H||e==null)return this._t=void 0,this.it=e;if(e===me)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};yt.directiveName=`unsafeHTML`,yt.resultType=1;var bt=Me(yt),xt=`:host{contain:size layout style;box-sizing:border-box;border-style:solid;border-width:1px;border-color:var(--sd-list-item-border-color,transparent);height:48px;display:block}:host(:is(:hover,[focused])){background-color:var(--color-bg-action-neutral-weakest-hover,#ededed)}:host(:not([aria-disabled=true]):active){background-color:var(--color-bg-action-neutral-weakest-pressed,#dfdfdf)}:host([selected]){background-color:var(--color-bg-selection-neutral-default,#ededed)}:host([selected]:is(:hover,[focused])){background-color:var(--color-bg-selection-neutral-default-hover,#dfdfdf)}:host([aria-disabled=true]) .side-content{opacity:var(--opacity-default,.5)}:host([aria-disabled=true]) .caption,:host([aria-disabled=true]) .description{color:var(--color-fg-interaction-disabled,#999)}:host([focused]){z-index:1;position:relative}:host([focused]):after{content:"";border:2px solid var(--sd-list-item-focus-ring-offset-color,transparent);outline:1px solid var(--sd-list-item-focus-ring-color,transparent);border-radius:var(--radius-s,4px);pointer-events:none;position:absolute;inset:-2px}@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{-webkit-line-clamp:2;white-space:pre-wrap;overflow-wrap:break-word;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.container{box-sizing:border-box;height:100%;display:flex}.container .level-indicator{flex-shrink:0;width:6px;height:100%}.container .level-indicator+.level-indicator{margin-left:var(--spacing-x1,2px)}.container .level-indicator.level-0{background-color:var(--sd-list-item-level-0-color,var(--color-rainbow-dark-blue-weak30,#c7dbef))}.container .level-indicator.level-1{background-color:var(--sd-list-item-level-1-color,var(--color-rainbow-orange-weak20,#ffc19b))}.container .level-indicator.level-2{background-color:var(--sd-list-item-level-2-color,var(--color-rainbow-green-weak10,#bdda76))}.container .level-indicator.level-3{background-color:var(--sd-list-item-level-3-color,var(--color-rainbow-red-weak20,#f3939e))}.container .level-indicator.level-4{background-color:var(--sd-list-item-level-4-color,var(--color-rainbow-blue-weak10,#77c5ff))}.container .level-indicator.level-5{background-color:var(--sd-list-item-level-5-color,var(--color-rainbow-yellow-weak10,#ffd979))}.container .level-indicator.level-6{background-color:var(--sd-list-item-level-6-color,var(--color-rainbow-purple-weak20,#d493df))}.side-content{flex-grow:0;align-items:center;display:flex}.labels{height:100%;padding:var(--sd-list-item-label-content-padding,0 var(--spacing-x4,8px));flex-direction:column;flex:auto;justify-content:center;line-height:normal;display:flex;overflow:hidden}.caption,.description{text-overflow:ellipsis;-webkit-user-select:none;user-select:none;width:100%;-webkit-text-decoration:inherit;text-decoration:inherit;overflow:hidden}.caption span,.description span{white-space:pre;text-overflow:ellipsis;overflow:hidden}span.caption,span.description{white-space:pre}.caption{font:var(--sd-list-item-caption-font,var(--text-body,400 15px/20px Inter));color:var(--sd-list-item-caption-color,var(--color-fg-default,#111))}.caption em{font:var(--text-body-highlighted,700 15px/20px Inter)}.description{font:var(--sd-list-item-description-font,var(--text-description,400 13px/16px Inter));color:var(--sd-list-item-description-color,var(--color-fg-weak,#565656))}.description em{font:var(--text-description-highlighted,700 13px/16px Inter)}.description.with-icon{align-items:center;gap:var(--spacing-x2,4px);display:flex}.description.with-icon .description-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;flex-shrink:0;width:12px;height:12px}.icon-wrapper{width:32px;height:32px;margin-left:var(--spacing-x4,8px);border-radius:var(--sd-list-item-icon-background-radius,var(--radius-xs,2px));justify-content:center;align-items:center;display:flex;overflow:hidden}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size,24px);min-width:var(--sd-list-item-icon-size,24px);background-position:50%;background-repeat:no-repeat;background-size:var(--sd-list-item-icon-background-size,cover)}`;function q(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function J(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Y=class e extends mt{constructor(...e){super(...e),this.contentMode=`text`,this.role=`option`}static{this.ID=`sd-list-item`}static{this.ensureDefined=()=>{customElements.get(e.ID)||customElements.define(e.ID,e)}}static get styles(){return[Ye`
|
|
370
370
|
${Je(xt)}
|
|
371
371
|
`]}render(){return pe`
|
|
372
372
|
<div class="container">
|
|
@@ -396,7 +396,7 @@ list.addEventListener("sd-virtual-list-selection", (event) => {
|
|
|
396
396
|
</div> `:H}renderLabel(e,t,n,r){if(t==null)return H;let i=this.contentMode===`html`?bt(t):t;return r==null?pe`<span class="${e}" title="${vt(n)}">${i}</span>`:pe`<div class="${e} with-icon" title="${vt(n)}">
|
|
397
397
|
<div class="${e}-icon" style="background-image:url('${r}')" aria-hidden="true"></div>
|
|
398
398
|
<span>${i}</span>
|
|
399
|
-
</div>`}updated(e){super.updated(e),e.has(`selected`)&&this.setAttribute(`aria-selected`,String(this.selected))}get missingWidthForTexts(){let e=this.enableLineClamp;this.removeAttribute(`enable-line-clamp`);let t=0;if(!this.shadowRoot)return 0;let n=this.shadowRoot.querySelector(`.caption`);n&&(t+=n.scrollWidth-n.clientWidth);let r=this.shadowRoot.querySelector(`.description`);return r&&(t=Math.max(t,r.scrollWidth-r.clientWidth)),t>0&&t++,e&&this.setAttribute(`enable-line-clamp`,``),t}handleIconClick(e){!this.disabled&&!this.dispatchEvent(new PointerEvent(`sd-list-item-icon-click`,e))&&e.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}};J([K({type:String}),q(`design:type`,String)],Y.prototype,`caption`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`description`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`descriptionIcon`,void 0),J([K({type:Boolean}),q(`design:type`,Boolean)],Y.prototype,`selected`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`icon`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`iconBackgroundColor`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`iconPlaceholder`,void 0),J([K({type:Number}),q(`design:type`,Number)],Y.prototype,`level`,void 0),J([K(),q(`design:type`,Object)],Y.prototype,`contentMode`,void 0),J([K({type:Boolean,reflect:!0,attribute:`enable-line-clamp`}),q(`design:type`,Boolean)],Y.prototype,`enableLineClamp`,void 0),J([K({converter:{fromAttribute:e=>e==`true`,toAttribute:e=>e},reflect:!0,attribute:`aria-disabled`}),q(`design:type`,Boolean)],Y.prototype,`disabled`,void 0),J([K({type:String,attribute:`icon-attr-aria-label`}),q(`design:type`,String)],Y.prototype,`iconAttrAriaLabel`,void 0),J([K({type:String,reflect:!0}),q(`design:type`,Object)],Y.prototype,`role`,void 0),J([K({type:String,attribute:`caption-attr-title`}),q(`design:type`,String)],Y.prototype,`captionAttrTitle`,void 0),J([K({type:String,attribute:`description-attr-title`}),q(`design:type`,String)],Y.prototype,`descriptionAttrTitle`,void 0),J([K({type:String,attribute:`icon-attr-title`}),q(`design:type`,String)],Y.prototype,`iconAttrTitle`,void 0);var St=(e,t)=>{let n=document.createElement(Y.ID);if(e){if(n.caption=e.caption,n.description=e.description,n.descriptionIcon=e.descriptionIcon,n.icon=e.icon,n.iconBackgroundColor=e.iconBackgroundColor,n.iconPlaceholder=e.iconPlaceholder,n.level=e.level,n.disabled=e.disabled,e.contentMode&&(n.contentMode=e.contentMode),e.leftContentGenerator){let t=e.leftContentGenerator(e,n);t&&(t.slot=`left-content`,n.appendChild(t))}if(e.rightContentGenerator){let t=e.rightContentGenerator(e,n);t&&(t.slot=`right-content`,n.appendChild(t))}}return n};Y.ensureDefined();var Ct=new class e{static{this.FOCUS_RING_WIDTH=3}getOffsetForIndexAndAlignment(t,n,r,i,a,o){let s=e.FOCUS_RING_WIDTH,c=Math.max(0,o*i),l=t*i+s,u=Math.min(c,l),d=Math.max(0,l-a+i),f=Math.max(0,u-s),p=Math.min(c,d+s);switch(n){case`start`:return f;case`end`:return p;case`center`:{let e=Math.round(d+(u-d)/2);return e<Math.ceil(a/2)?0:e>c+Math.floor(a/2)?c:e}default:return r>=p&&r<=f?r:r<p?p:f}}debounce(e){let t;return(...n)=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{e(...n),t=null})}}};function X(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function wt(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Tt=class{constructor(e=100,t=5){this.pageSize=e,this.preloadedItemsCount=t,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this._pendingDataRequest=!1,this.handleListDataRequest=e=>{if(this._list==null)return;let{startIndex:t,stopIndex:n}=e.detail;this._lastRequestedFirstIndex=t,this._lastRequestedLastIndex=n,this._list.items=this._itemCache.slice(t,n+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<n+this.preloadedItemsCount&&this.requestData()},this._itemCount=e}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(e){this._finalSizeIsKnown=e,e&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=e)}get itemCount(){return this._itemCount}set itemCount(e){this._itemCount=e,this._list&&(this._list.itemCount=e)}get items(){return this._itemCache}set items(e){this._itemCache=e,this.onItemsChange()}addItems(e){this._itemCache=this._itemCache.concat(e),this.onItemsChange()}connectList(e){this._list&&this._list.removeEventListener(`sd-virtual-list-data-request`,this.handleListDataRequest),this._list=e,e.itemCount=this.itemCount,e.addEventListener(`sd-virtual-list-data-request`,this.handleListDataRequest),e.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`)}},Et=`:host{contain:layout;--list-item-focus-ring-width:3px;scroll-padding:var(--list-item-focus-ring-width);display:block;position:relative;overflow:hidden auto}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){--sd-list-item-focus-ring-offset-color:var(--color-bg-default,#fff);--sd-list-item-focus-ring-color:var(--color-border-interaction-focus,#111);border-color:var(--color-rainbow-mono-weak,#fff);z-index:1}.scroll-container{padding:var(--list-item-focus-ring-width);background:linear-gradient(var(--sd-virtual-list-background-color,var(--color-bg-default,#fff)), var(--sd-virtual-list-background-color,var(--color-bg-default,#fff))) no-repeat right center/var(--list-item-focus-ring-width) calc(100% - 2 * var(--list-item-focus-ring-width));display:block}.container{background-color:var(--sd-virtual-list-background-color,var(--color-bg-default,#fff));width:100%;position:relative}.container>::slotted(*){box-sizing:border-box;width:100%;position:absolute}.container>::slotted(sd-list-item:not([last])){--sd-list-item-bottom-border-color:var(--color-border-weak,#ededed);border-bottom-color:var(--sd-list-item-bottom-border-color)}.container>::slotted(sd-list-item:is(:hover,[focused],:not([aria-disabled=true]):active,[selected])){--sd-list-item-bottom-border-color:var(--color-rainbow-mono-weak,#fff)}.container>::slotted(sd-list-item[selected]){border-left-color:var(--color-rainbow-mono-weak,#fff);border-right-color:var(--color-rainbow-mono-weak,#fff)}.container>::slotted(:not(:is(sd-list-item,[last]))){border-bottom:1px solid var(--color-border-weak,#ededed)}`,Dt,Ot=function(e){return e.TriggerOnly=`trigger-only`,e.Single=`single`,e.Multi=`multi`,e}({}),kt=0,Z=class e extends mt{static{this.ID=`sd-virtual-list`}static{this.ensureDefined=()=>{Y.ensureDefined(),customElements.get(e.ID)||customElements.define(e.ID,e)}}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){let 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(e=>Number(e)):this._selectedIndices=[],this.requestUpdate(`selectedIndices`)}scrollToItem(e,t=`auto`){this.scrollTop=Ct.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}"]`)}constructor(){super(),this.itemHeight=48,this.itemCount=0,this.items=[],this.selectionType=Ot.TriggerOnly,this.id=e.ID+`_`+ kt++,this.role=`listbox`,this.itemGenerator=St,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._firstVisibleIndex=-1,this._lastVisibleIndex=-1,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let 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.handleClick=e=>{let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.hasAttribute&&e.hasAttribute(`item-index`));if(t){let n=t.getAttribute(`item-index`);if(n!=null){let t=parseInt(n);Number.isInteger(t)&&((e.button==0||e.button==1)&&this.handleSelection(t,e),this.focusIndex=t)}}},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}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`,e=>{e.button==1&&e.preventDefault()}),this.addEventListener(`auxclick`,this.handleClick),this.addEventListener(`focus`,()=>{this.matches(`:focus-visible`)&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]??-1),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]??-1,`center`)}updateFocusedItemAttributes(){let 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[Ye`
|
|
399
|
+
</div>`}updated(e){super.updated(e),e.has(`selected`)&&this.setAttribute(`aria-selected`,String(this.selected))}get missingWidthForTexts(){let e=this.enableLineClamp;this.removeAttribute(`enable-line-clamp`);let t=0;if(!this.shadowRoot)return 0;let n=this.shadowRoot.querySelector(`.caption`);n&&(t+=n.scrollWidth-n.clientWidth);let r=this.shadowRoot.querySelector(`.description`);return r&&(t=Math.max(t,r.scrollWidth-r.clientWidth)),t>0&&t++,e&&this.setAttribute(`enable-line-clamp`,``),t}handleIconClick(e){!this.disabled&&!this.dispatchEvent(new PointerEvent(`sd-list-item-icon-click`,e))&&e.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}};J([K({type:String}),q(`design:type`,String)],Y.prototype,`caption`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`description`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`descriptionIcon`,void 0),J([K({type:Boolean}),q(`design:type`,Boolean)],Y.prototype,`selected`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`icon`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`iconBackgroundColor`,void 0),J([K({type:String}),q(`design:type`,String)],Y.prototype,`iconPlaceholder`,void 0),J([K({type:Number}),q(`design:type`,Number)],Y.prototype,`level`,void 0),J([K(),q(`design:type`,Object)],Y.prototype,`contentMode`,void 0),J([K({type:Boolean,reflect:!0,attribute:`enable-line-clamp`}),q(`design:type`,Boolean)],Y.prototype,`enableLineClamp`,void 0),J([K({converter:{fromAttribute:e=>e==`true`,toAttribute:e=>e},reflect:!0,attribute:`aria-disabled`}),q(`design:type`,Boolean)],Y.prototype,`disabled`,void 0),J([K({type:String,attribute:`icon-attr-aria-label`}),q(`design:type`,String)],Y.prototype,`iconAttrAriaLabel`,void 0),J([K({type:String,reflect:!0}),q(`design:type`,Object)],Y.prototype,`role`,void 0),J([K({type:String,attribute:`caption-attr-title`}),q(`design:type`,String)],Y.prototype,`captionAttrTitle`,void 0),J([K({type:String,attribute:`description-attr-title`}),q(`design:type`,String)],Y.prototype,`descriptionAttrTitle`,void 0),J([K({type:String,attribute:`icon-attr-title`}),q(`design:type`,String)],Y.prototype,`iconAttrTitle`,void 0);var St=(e,t)=>{let n=document.createElement(Y.ID);if(e){if(n.caption=e.caption,n.description=e.description,n.descriptionIcon=e.descriptionIcon,n.icon=e.icon,n.iconBackgroundColor=e.iconBackgroundColor,n.iconPlaceholder=e.iconPlaceholder,n.level=e.level,n.disabled=e.disabled,e.contentMode&&(n.contentMode=e.contentMode),e.leftContentGenerator){let t=e.leftContentGenerator(e,n);t&&(t.slot=`left-content`,n.appendChild(t))}if(e.rightContentGenerator){let t=e.rightContentGenerator(e,n);t&&(t.slot=`right-content`,n.appendChild(t))}}return n};Y.ensureDefined();var Ct=new class e{static{this.FOCUS_RING_WIDTH=3}getOffsetForIndexAndAlignment(t,n,r,i,a,o){let s=e.FOCUS_RING_WIDTH,c=Math.max(0,o*i),l=t*i+s,u=Math.min(c,l),d=Math.max(0,l-a+i),f=Math.max(0,u-s),p=Math.min(c,d+s);switch(n){case`start`:return f;case`end`:return p;case`center`:{let e=Math.round(d+(u-d)/2);return e<Math.ceil(a/2)?0:e>c+Math.floor(a/2)?c:e}default:return r>=p&&r<=f?r:r<p?p:f}}debounce(e){let t;return(...n)=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{e(...n),t=null})}}};function X(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function wt(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Tt=class{constructor(e=100,t=5){this.pageSize=e,this.preloadedItemsCount=t,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this._pendingDataRequest=!1,this.handleListDataRequest=e=>{if(this._list==null)return;let{startIndex:t,stopIndex:n}=e.detail;this._lastRequestedFirstIndex=t,this._lastRequestedLastIndex=n,this._list.items=this._itemCache.slice(t,n+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<n+this.preloadedItemsCount&&this.requestData()},this._itemCount=e}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(e){this._finalSizeIsKnown=e,e&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=e)}get itemCount(){return this._itemCount}set itemCount(e){this._itemCount=e,this._list&&(this._list.itemCount=e)}get items(){return this._itemCache}set items(e){this._itemCache=e,this.onItemsChange()}addItems(e){this._itemCache=this._itemCache.concat(e),this.onItemsChange()}connectList(e){this._list&&this._list.removeEventListener(`sd-virtual-list-data-request`,this.handleListDataRequest),this._list=e,e.itemCount=this.itemCount,e.addEventListener(`sd-virtual-list-data-request`,this.handleListDataRequest),e.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`)}},Et=`:host{contain:layout;--list-item-focus-ring-width:3px;scroll-padding:var(--list-item-focus-ring-width);display:block;position:relative;overflow:hidden auto}:host(:focus){outline:none}:host(:focus-visible){--sd-list-item-focus-ring-offset-color:var(--color-bg-default,#fff);--sd-list-item-focus-ring-color:var(--color-border-interaction-focus,#111)}.scroll-container{padding:var(--list-item-focus-ring-width);background:linear-gradient(var(--sd-virtual-list-background-color,var(--color-bg-default,#fff)), var(--sd-virtual-list-background-color,var(--color-bg-default,#fff))) no-repeat right center/var(--list-item-focus-ring-width) calc(100% - 2 * var(--list-item-focus-ring-width));display:block}.container{background-color:var(--sd-virtual-list-background-color,var(--color-bg-default,#fff));width:100%;position:relative}.container>::slotted(*){box-sizing:border-box;width:100%;position:absolute}.container>::slotted(sd-list-item:not([last])){--sd-list-item-bottom-border-color:var(--color-border-weak,#ededed);border-bottom-color:var(--sd-list-item-bottom-border-color)}.container>::slotted(sd-list-item:is(:hover,[focused],:not([aria-disabled=true]):active,[selected])){--sd-list-item-bottom-border-color:var(--color-rainbow-mono-weak,#fff)}.container>::slotted(sd-list-item[selected]){border-left-color:var(--color-rainbow-mono-weak,#fff);border-right-color:var(--color-rainbow-mono-weak,#fff)}.container>::slotted(:not(:is(sd-list-item,[last]))){border-bottom:1px solid var(--color-border-weak,#ededed)}`,Dt,Ot=function(e){return e.TriggerOnly=`trigger-only`,e.Single=`single`,e.Multi=`multi`,e}({}),kt=0,Z=class e extends mt{static{this.ID=`sd-virtual-list`}static{this.ensureDefined=()=>{Y.ensureDefined(),customElements.get(e.ID)||customElements.define(e.ID,e)}}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){let 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(e=>Number(e)):this._selectedIndices=[],this.requestUpdate(`selectedIndices`)}scrollToItem(e,t=`auto`){this.scrollTop=Ct.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}"]`)}constructor(){super(),this.itemHeight=48,this.itemCount=0,this.items=[],this.selectionType=Ot.TriggerOnly,this.id=e.ID+`_`+ kt++,this.role=`listbox`,this.itemGenerator=St,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._firstVisibleIndex=-1,this._lastVisibleIndex=-1,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let 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.handleClick=e=>{let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.hasAttribute&&e.hasAttribute(`item-index`));if(t){let n=t.getAttribute(`item-index`);if(n!=null){let t=parseInt(n);Number.isInteger(t)&&((e.button==0||e.button==1)&&this.handleSelection(t,e),this.focusIndex=t)}}},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}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`,e=>{e.button==1&&e.preventDefault()}),this.addEventListener(`auxclick`,this.handleClick),this.addEventListener(`focus`,()=>{this.matches(`:focus-visible`)&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]??-1),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]??-1,`center`)}updateFocusedItemAttributes(){let 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[Ye`
|
|
400
400
|
${Je(Et)}
|
|
401
401
|
`]}render(){return this.updateItemsRenderData(),pe`
|
|
402
402
|
<div class="scroll-container">
|
package/dist/virtual-list.mjs
CHANGED
|
@@ -83,7 +83,7 @@ var u = class {
|
|
|
83
83
|
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);
|
|
84
84
|
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");
|
|
85
85
|
}
|
|
86
|
-
}, d = ":host{contain:layout;--list-item-focus-ring-width:3px;scroll-padding:var(--list-item-focus-ring-width);display:block;position:relative;overflow:hidden auto}:host(:focus){outline:none}:host(:focus-visible)
|
|
86
|
+
}, d = ":host{contain:layout;--list-item-focus-ring-width:3px;scroll-padding:var(--list-item-focus-ring-width);display:block;position:relative;overflow:hidden auto}:host(:focus){outline:none}:host(:focus-visible){--sd-list-item-focus-ring-offset-color:var(--color-bg-default,#fff);--sd-list-item-focus-ring-color:var(--color-border-interaction-focus,#111)}.scroll-container{padding:var(--list-item-focus-ring-width);background:linear-gradient(var(--sd-virtual-list-background-color,var(--color-bg-default,#fff)), var(--sd-virtual-list-background-color,var(--color-bg-default,#fff))) no-repeat right center/var(--list-item-focus-ring-width) calc(100% - 2 * var(--list-item-focus-ring-width));display:block}.container{background-color:var(--sd-virtual-list-background-color,var(--color-bg-default,#fff));width:100%;position:relative}.container>::slotted(*){box-sizing:border-box;width:100%;position:absolute}.container>::slotted(sd-list-item:not([last])){--sd-list-item-bottom-border-color:var(--color-border-weak,#ededed);border-bottom-color:var(--sd-list-item-bottom-border-color)}.container>::slotted(sd-list-item:is(:hover,[focused],:not([aria-disabled=true]):active,[selected])){--sd-list-item-bottom-border-color:var(--color-rainbow-mono-weak,#fff)}.container>::slotted(sd-list-item[selected]){border-left-color:var(--color-rainbow-mono-weak,#fff);border-right-color:var(--color-rainbow-mono-weak,#fff)}.container>::slotted(:not(:is(sd-list-item,[last]))){border-bottom:1px solid var(--color-border-weak,#ededed)}", f, p = /* @__PURE__ */ function(e) {
|
|
87
87
|
return e.TriggerOnly = "trigger-only", e.Single = "single", e.Multi = "multi", e;
|
|
88
88
|
}({}), m = 0, h = class o extends n {
|
|
89
89
|
static {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list.mjs","names":[],"sources":["../list-util.ts","../data-provider.ts","../style.scss?inline","../virtual-list.ts"],"sourcesContent":["export type ScrollToAlignment = \"auto\" | \"center\" | \"start\" | \"end\";\n\nexport interface IListUtil {\n getOffsetForIndexAndAlignment(\n index: number,\n alignment: ScrollToAlignment,\n scrollOffset: number,\n itemHeight: number,\n height: number,\n itemCount: number,\n ): number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n debounce(func: (...args: any) => void): () => void;\n}\n\nclass ListUtil implements IListUtil {\n /**\n * Padding kept between a scrolled-to item and the viewport edge so the item's focus ring\n * stays visible. Must be kept in sync with `--list-item-focus-ring-width` in style.scss.\n */\n private static readonly FOCUS_RING_WIDTH = 3;\n\n public getOffsetForIndexAndAlignment(\n index: number,\n alignment: ScrollToAlignment,\n scrollOffset: number,\n itemHeight: number,\n height: number,\n itemCount: number,\n ): number {\n const focusRingWidth = ListUtil.FOCUS_RING_WIDTH;\n const lastItemOffset = Math.max(0, itemCount * itemHeight);\n const renderedTop = index * itemHeight + focusRingWidth;\n const rawMaxOffset = Math.min(lastItemOffset, renderedTop);\n const rawMinOffset = Math.max(0, renderedTop - height + itemHeight);\n const maxOffset = Math.max(0, rawMaxOffset - focusRingWidth);\n const minOffset = Math.min(lastItemOffset, rawMinOffset + focusRingWidth);\n\n switch (alignment) {\n case \"start\":\n return maxOffset;\n case \"end\":\n return minOffset;\n case \"center\": {\n const middleOffset = Math.round(rawMinOffset + (rawMaxOffset - rawMinOffset) / 2);\n if (middleOffset < Math.ceil(height / 2)) {\n return 0;\n } else if (middleOffset > lastItemOffset + Math.floor(height / 2)) {\n return lastItemOffset;\n } else {\n return middleOffset;\n }\n }\n case \"auto\":\n default:\n if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {\n return scrollOffset;\n } else if (scrollOffset < minOffset) {\n return minOffset;\n } else {\n return maxOffset;\n }\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public debounce(func: (...args: any) => void): (...args: unknown[]) => void {\n let timer: number | null;\n return (...args: unknown[]) => {\n if (timer) {\n window.cancelAnimationFrame(timer);\n }\n timer = window.requestAnimationFrame(() => {\n func(...args);\n timer = null;\n });\n };\n }\n}\n\nexport default new ListUtil();\n","import VirtualList from \"./virtual-list\";\n\nexport class ListDataProvider {\n public onDataRequest?: (page: number) => void;\n\n private _finalSizeIsKnown = false;\n private _itemCache: unknown[] = [];\n private _lastRequestedFirstIndex = 0;\n private _lastRequestedLastIndex = 0;\n private _lastLoadedIndex = 0;\n private _list?: VirtualList;\n private _itemCount: number;\n private _pendingDataRequest: boolean = false;\n\n constructor(\n public pageSize: number = 100,\n public preloadedItemsCount: number = 5,\n ) {\n this._itemCount = pageSize; // configure initial load\n }\n\n public get currentPage(): number {\n if (this.items.length == 0 && this.finalSizeIsKnown) {\n return 0; // Otherwise empty cache means we haven't fetched anything\n }\n // With pageSize 100\n // 0 => -1\n // 1 100 => 0\n // 101 200 => 1\n return Math.floor((this.items.length - 1) / this.pageSize);\n }\n\n public get finalSizeIsKnown(): boolean {\n return this._finalSizeIsKnown;\n }\n\n public set finalSizeIsKnown(value: boolean) {\n this._finalSizeIsKnown = value;\n if (value) {\n this.itemCount = this._itemCache.length;\n }\n if (this._list) {\n this._list.finalSizeIsKnown = value;\n }\n }\n\n private get itemCount(): number {\n return this._itemCount;\n }\n\n private set itemCount(count: number) {\n this._itemCount = count;\n if (this._list) {\n this._list.itemCount = count;\n }\n }\n\n public get items(): unknown[] {\n return this._itemCache;\n }\n\n public set items(items: unknown[]) {\n this._itemCache = items;\n this.onItemsChange();\n }\n\n public addItems(items: unknown[]): void {\n this._itemCache = this._itemCache.concat(items);\n this.onItemsChange();\n }\n\n public connectList(list: VirtualList): void {\n if (this._list) {\n this._list.removeEventListener(\"sd-virtual-list-data-request\", this.handleListDataRequest);\n }\n this._list = list;\n list.itemCount = this.itemCount;\n list.addEventListener(\"sd-virtual-list-data-request\", this.handleListDataRequest);\n list.finalSizeIsKnown = this._finalSizeIsKnown;\n }\n\n private onItemsChange(): void {\n this._pendingDataRequest = false;\n this._lastLoadedIndex = this._itemCache.length - 1;\n if (this.finalSizeIsKnown) {\n this.itemCount = this._itemCache.length;\n } else if (this._lastLoadedIndex > this.itemCount) {\n this.itemCount = this._lastLoadedIndex;\n }\n if (this._list) {\n this._list.items = this._itemCache.slice(this._lastRequestedFirstIndex, this._lastRequestedLastIndex + 1);\n }\n }\n\n private handleListDataRequest = (event: CustomEvent) => {\n if (this._list == null) {\n return;\n }\n const { startIndex, stopIndex } = event.detail;\n this._lastRequestedFirstIndex = startIndex;\n this._lastRequestedLastIndex = stopIndex;\n this._list.items = this._itemCache.slice(startIndex, stopIndex + 1);\n\n if (!this.finalSizeIsKnown && this._lastLoadedIndex < stopIndex + this.preloadedItemsCount) {\n this.requestData();\n }\n };\n\n private requestData(): void {\n if (this._pendingDataRequest) {\n return;\n }\n if (this.onDataRequest) {\n this._pendingDataRequest = true;\n this.onDataRequest(this.currentPage + 1);\n this._lastLoadedIndex += this.pageSize - 1;\n if (this._lastLoadedIndex > this.itemCount) {\n this.itemCount = this._lastLoadedIndex;\n }\n } else {\n throw Error(\n \"The final size is not yet known and the list would require item data from index \" +\n this._lastRequestedFirstIndex +\n \". to \" +\n this._lastRequestedLastIndex +\n \". which is not possible to load without a configured onDataRequest\",\n );\n }\n }\n}\n",":host {\n\tdisplay: block;\n\tposition: relative;\n\tcontain: layout;\n\toverflow-y: auto;\n\toverflow-x: hidden;\n\t--list-item-focus-ring-width: 3px;\n\tscroll-padding: var(--list-item-focus-ring-width);\n}\n\n:host(:focus) {\n\toutline: none;\n}\n\n:host(:focus-visible) ::slotted([focused]) {\n\t--sd-list-item-focus-ring-offset-color: var(--color-bg-default, #ffffff);\n\t--sd-list-item-focus-ring-color: var(--color-border-interaction-focus, #111);\n\tborder-color: var(--color-rainbow-mono-weak, #ffffff);\n\tz-index: 1;\n}\n\n.scroll-container {\n\tdisplay: block;\n\tpadding: var(--list-item-focus-ring-width);\n\t/* join the list background with the scrollbar */\n\tbackground: linear-gradient(\n\t\t\tvar(--sd-virtual-list-background-color, var(--color-bg-default, #ffffff)),\n\t\t\tvar(--sd-virtual-list-background-color, var(--color-bg-default, #ffffff))\n\t\t)\n\t\tno-repeat right center / var(--list-item-focus-ring-width) calc(100% - 2 * var(--list-item-focus-ring-width));\n}\n\n.container {\n\twidth: 100%;\n\tposition: relative;\n\tbackground-color: var(--sd-virtual-list-background-color, var(--color-bg-default, #ffffff));\n\n\t& > ::slotted(*) {\n\t\twidth: 100%;\n\t\tposition: absolute;\n\t\tbox-sizing: border-box;\n\t}\n\n\t& > ::slotted(sd-list-item:not([last])) {\n\t\t--sd-list-item-bottom-border-color: var(--color-border-weak, #ededed);\n\t\tborder-bottom-color: var(--sd-list-item-bottom-border-color);\n\t}\n\n\t& > ::slotted(sd-list-item:is(:hover, [focused], :not([aria-disabled=\"true\"]):active, [selected])) {\n\t\t--sd-list-item-bottom-border-color: var(--color-rainbow-mono-weak, #ffffff);\n\t}\n\n\t& > ::slotted(sd-list-item[selected]) {\n\t\tborder-left-color: var(--color-rainbow-mono-weak, #ffffff);\n\t\tborder-right-color: var(--color-rainbow-mono-weak, #ffffff);\n\t}\n\n\t& > ::slotted(:not(:is(sd-list-item, [last]))) {\n\t\tborder-bottom: 1px solid var(--color-border-weak, #ededed);\n\t}\n}\n","import ListItem, { generator, type ItemData } from \"@cas-smartdesign/list-item\";\nimport { LitElement, type TemplateResult, html, unsafeCSS, type PropertyValues, css } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\n\nimport ListUtil, { type ScrollToAlignment } from \"./list-util\";\nexport { ListDataProvider } from \"./data-provider\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [VirtualList.ID]: VirtualList;\n }\n interface HTMLElementEventMap {\n \"sd-virtual-list-data-request\": CustomEvent<IDataRequestEvent>;\n \"sd-virtual-list-selection\": CustomEvent<ISelectionEvent>;\n }\n}\n\nimport style from \"./style.scss?inline\";\n\nexport type ItemGenerator = (data: ItemData, _index: number) => HTMLElement;\nexport enum SelectionType {\n TriggerOnly = \"trigger-only\",\n Single = \"single\",\n Multi = \"multi\",\n}\n\ninterface ItemRenderData {\n index: number;\n top: number;\n physicalIndex: number;\n dataHash: string;\n data?: unknown;\n}\n\nlet idCounter = 0;\n\nexport interface IDataRequestEvent {\n startIndex: number;\n stopIndex: number;\n}\n\nexport interface ISelectionEvent {\n index: number;\n selected: boolean;\n originalEvent: Event;\n}\n\nexport default class VirtualList extends LitElement {\n public static readonly ID = \"sd-virtual-list\";\n public static ensureDefined = (): void => {\n ListItem.ensureDefined();\n if (!customElements.get(VirtualList.ID)) {\n customElements.define(VirtualList.ID, VirtualList);\n }\n };\n\n @property({ type: Number, attribute: \"item-height\", reflect: true })\n public itemHeight: number = 48;\n @property({ type: Number })\n public itemCount: number = 0;\n @property({ type: Array, attribute: false })\n public items: unknown[] = [];\n @property({ type: String, attribute: \"selection-type\", reflect: true, noAccessor: true })\n public selectionType: SelectionType = SelectionType.TriggerOnly;\n @property({ type: String, attribute: true, reflect: true })\n public override id: string = VirtualList.ID + \"_\" + idCounter++;\n\n // aria attributes\n @property({ type: String, reflect: true })\n public override role = \"listbox\";\n\n public itemGenerator: ItemGenerator = generator;\n public finalSizeIsKnown?: boolean;\n\n private _lastKnownScrollTop = 0;\n private _lastRenderedScrollTop = 0;\n\n private _itemsRenderData: ItemRenderData[] = [];\n private _elementCache: Map<string, HTMLElement> = new Map();\n\n private _firstVisibleIndex: number = -1;\n private _lastVisibleIndex: number = -1;\n private _visibleItemsNum = 0;\n\n private _selectedIndices: number[] = [];\n private _focusIndex = -1;\n private _resizeObserver: ResizeObserver;\n private _lastKnownHeight = 0;\n private _increaseWidthOnNextRenderIfNeeded?: boolean;\n private _reachedMaxWidth?: boolean;\n\n public get focusTarget(): boolean {\n return this.hasAttribute(\"focus-target\");\n }\n\n public set focusTarget(value: boolean) {\n this.toggleAttribute(\"focus-target\", value);\n }\n\n @property({ type: Number, attribute: \"focus-index\", reflect: true })\n public get focusIndex(): number {\n return this._focusIndex;\n }\n\n public set focusIndex(index: number) {\n if (index >= -1 && index < this.itemCount) {\n const oldValue = this._focusIndex;\n this._focusIndex = index;\n if (index <= this._firstVisibleIndex || this._lastVisibleIndex <= index) {\n this.scrollToItem(index);\n }\n if (oldValue != index) {\n if (index == -1) {\n this.removeAttribute(\"aria-activedescendant\");\n }\n this.requestUpdate(\"focusIndex\", oldValue);\n }\n }\n }\n\n @property({ type: Array, attribute: false })\n public get selectedIndices(): number[] {\n return this._selectedIndices;\n }\n\n public set selectedIndices(selectedIndices: number[]) {\n if (selectedIndices) {\n // Parse to primitive numbers as the virtual-list uses numbers and not objects for the indexOf(item-index) checks.\n this._selectedIndices = selectedIndices.map((index) => Number(index));\n } else {\n this._selectedIndices = [];\n }\n this.requestUpdate(\"selectedIndices\");\n }\n\n public scrollToItem(index: number, alignment: ScrollToAlignment = \"auto\"): void {\n this.scrollTop = ListUtil.getOffsetForIndexAndAlignment(\n this.normalizeIndex(index),\n alignment,\n this.scrollTop,\n this.itemHeight,\n this.height,\n this.itemCount,\n );\n // The render might have already been scheduled, but the onScroll event is dispatched later.\n // We need to update the _lastKnownScrollTop manually to ensure an up-to-date value is used even for the next render.\n this._lastKnownScrollTop = this.scrollTop;\n }\n\n public getListItem(index: number): HTMLElement | null {\n if (!this.shadowRoot || index < this._firstVisibleIndex || this._lastVisibleIndex < index) {\n return null;\n }\n return this.querySelector(`[item-index=\"${index}\"]`);\n }\n\n constructor() {\n super();\n this._resizeObserver = new ResizeObserver(() => {\n if (this._lastKnownHeight !== this.offsetHeight) {\n this._lastKnownHeight = this.offsetHeight;\n this.requestUpdate();\n }\n });\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n this._resizeObserver.observe(this);\n // these are needed because when reattaching the list to the DOM\n // then the scroll position is reset but no scroll event is called\n // so the list shows the items at incorrect position\n if (this.scrollTop !== this._lastKnownScrollTop) {\n this.scrollTop = this._lastKnownScrollTop;\n this.requestUpdate();\n }\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._resizeObserver.disconnect();\n }\n\n public override firstUpdated(_changedProperties: PropertyValues): void {\n super.firstUpdated(_changedProperties);\n\n this.addEventListener(\"scroll\", this.onScroll);\n this.addEventListener(\"keydown\", this.handleKeyDown);\n this.addEventListener(\"click\", this.handleClick);\n this.addEventListener(\"mousedown\", (event) => {\n if (event.button == 1) {\n event.preventDefault();\n }\n });\n this.addEventListener(\"auxclick\", this.handleClick);\n this.addEventListener(\"focus\", () => {\n if (this.matches(\":focus-visible\")) {\n if (this.focusIndex == -1) {\n if (this.selectedIndices) {\n this.focusIndex = this.selectedIndices[0] ?? -1;\n }\n if (this.focusIndex == -1 && this.itemCount > 0) {\n this.focusIndex = 0;\n }\n } else {\n this.updateFocusedItemAttributes();\n }\n }\n });\n this.addEventListener(\"blur\", () => {\n if (this.focusIndex != -1) {\n this.updateFocusedItemAttributes();\n }\n });\n if (this.selectedIndices.length > 0) {\n this.scrollToItem(this.selectedIndices[0] ?? -1, \"center\");\n }\n }\n\n private updateFocusedItemAttributes() {\n const focusedElement = this.getListItem(this.focusIndex);\n if (focusedElement) {\n if (this.focusTarget || document.activeElement == this) {\n focusedElement.setAttribute(\"focused\", \"\");\n this.setAttribute(\"aria-activedescendant\", focusedElement.id);\n } else {\n focusedElement.removeAttribute(\"focused\");\n this.removeAttribute(\"aria-activedescendant\");\n }\n }\n }\n\n static override get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n public override render(): TemplateResult {\n this.updateItemsRenderData();\n return html`\n <div class=\"scroll-container\">\n <div class=\"container\" style=\"height: ${this.itemCount * this.itemHeight}px\">\n <slot name=\"items\"></slot>\n </div>\n </div>\n `;\n }\n\n public override updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n this._lastRenderedScrollTop = this._lastKnownScrollTop;\n this.updateItems();\n\n if (\n (this._increaseWidthOnNextRenderIfNeeded || this._reachedMaxWidth) && //\n this._firstVisibleIndex < this._lastVisibleIndex\n ) {\n this.adjustWidthIfNeeded();\n }\n }\n\n private adjustWidthIfNeeded() {\n if (this._increaseWidthOnNextRenderIfNeeded) {\n this._increaseWidthOnNextRenderIfNeeded = false;\n window.requestAnimationFrame(() => {\n const remainingWidth = Number.parseInt(getComputedStyle(this).maxWidth) - this.offsetWidth;\n if (remainingWidth == 0) {\n this._reachedMaxWidth = true;\n this.enableLineClampOnItemsIfNeeded();\n } else {\n this._reachedMaxWidth = false;\n const missingWidths = [...this.querySelectorAll(\"[item-index]\")].map((item) => {\n if (item instanceof ListItem) {\n item.enableLineClamp = false;\n const missingWidthForTexts = item.missingWidthForTexts;\n if (missingWidthForTexts > remainingWidth) {\n item.enableLineClamp = true;\n }\n return missingWidthForTexts;\n }\n const missingWidth = item.scrollWidth - item.clientWidth;\n if (missingWidth > 0) {\n return missingWidth + 1; // ensure ellipsis is not shown for subpixel rendering\n }\n return 0;\n });\n const additionalWidth = Math.max(...missingWidths);\n if (additionalWidth > 0) {\n this.style.width = `${this.offsetWidth + additionalWidth}px`;\n }\n }\n });\n } else if (this._reachedMaxWidth) {\n this.enableLineClampOnItemsIfNeeded();\n }\n }\n\n private enableLineClampOnItemsIfNeeded() {\n this.querySelectorAll(\"[item-index]\").forEach((item) => {\n if (item instanceof ListItem) {\n item.enableLineClamp = item.enableLineClamp || item.missingWidthForTexts > 0;\n }\n });\n }\n\n /**\n * Searches for list-items where there is a need for an additional width (ellipsis maybe shown) and increases the width of the list,\n * therefore all the content is visible without tooltips. As it can be an expensive task to retrieve the required details, calling\n * this function has an effect only on the very next render. Note that it only works if the virtual-list works with sd-list-item elements.\n * If the maximum width is reached, line clamp is enabled on list items as a last resort approach to show the content if possible.\n */\n public increaseWidthOnNextRenderIfNeeded(): void {\n this._increaseWidthOnNextRenderIfNeeded = true;\n }\n\n private updateItems() {\n const unusedItems: Element[] = [...this.querySelectorAll(\"[item-index]\")];\n const renderedItems: Map<string, HTMLElement> = new Map();\n\n const newItemsFragment = document.createDocumentFragment();\n for (const renderData of this._itemsRenderData) {\n const itemElement = this.renderItem(renderData);\n if (!itemElement.parentElement) {\n newItemsFragment.appendChild(itemElement);\n }\n renderedItems.set(renderData.dataHash, itemElement);\n const index = unusedItems.indexOf(itemElement);\n if (index !== -1) {\n unusedItems.splice(index, 1);\n }\n }\n this.appendChild(newItemsFragment);\n\n for (const unusedItemElement of unusedItems) {\n if (unusedItemElement instanceof ListItem) {\n unusedItemElement.enableLineClamp = false;\n }\n this.removeChild(unusedItemElement);\n }\n\n renderedItems.forEach((itemElement, dataHash) => {\n this._elementCache.set(dataHash, itemElement);\n });\n }\n\n private renderItem({ index, top, dataHash, data }: ItemRenderData): HTMLElement {\n let element: HTMLElement;\n if (data) {\n if (this._elementCache.has(dataHash)) {\n element = this._elementCache.get(dataHash)!;\n this._elementCache.delete(dataHash); // Allow to be rendered twice\n } else {\n element = this.itemGenerator(data, index);\n element.setAttribute(\"slot\", \"items\");\n // Do not add to cache yet, because the same item might need to be rendered twice\n }\n } else {\n element = document.createElement(\"div\");\n element.setAttribute(\"placeholder-item\", \"\");\n element.setAttribute(\"slot\", \"items\");\n }\n Object.assign(element.style, {\n transform: `translateY(${top}px)`,\n height: `${this.itemHeight}px`,\n });\n element.setAttribute(\"item-index\", index.toString());\n element.setAttribute(\"aria-setsize\", String(this.finalSizeIsKnown ? this.itemCount : -1));\n element.setAttribute(\"aria-posinset\", String(index + 1));\n if (!element.id || element.id.startsWith(this.id + \"_item_\")) {\n element.id = this.id + \"_item_\" + index;\n }\n if (this.itemCount - 1 == index) {\n element.setAttribute(\"last\", \"\");\n } else {\n element.removeAttribute(\"last\");\n }\n\n this.updateSelectedAttribute(index, element);\n this.updateFocusedAttribute(index, element);\n\n return element;\n }\n\n private onScroll = () => {\n this._lastKnownScrollTop = this.scrollTop;\n const delta = this._lastRenderedScrollTop - this._lastKnownScrollTop;\n if (Math.abs(delta) >= this.itemHeight) {\n this._lastRenderedScrollTop = this._lastKnownScrollTop;\n this.requestUpdate();\n }\n };\n\n private updateFocusedAttribute(index: number, itemElement: HTMLElement) {\n if (this.focusIndex == index && (this.focusTarget || document.activeElement == this)) {\n itemElement.setAttribute(\"focused\", \"\");\n this.setAttribute(\"aria-activedescendant\", itemElement.id);\n } else {\n itemElement.removeAttribute(\"focused\");\n }\n }\n\n private updateSelectedAttribute(index: number, itemElement: HTMLElement) {\n const selected = this.selectedIndices.indexOf(index) !== -1;\n if (selected) {\n itemElement.setAttribute(\"selected\", \"\");\n } else {\n itemElement.removeAttribute(\"selected\");\n }\n itemElement.setAttribute(\"aria-selected\", String(selected));\n }\n\n private updateItemsRenderData(): void {\n this._itemsRenderData = [];\n this._visibleItemsNum = Math.min(Math.ceil(this.height / this.itemHeight), this.itemCount);\n\n if (this._visibleItemsNum > 0) {\n this._firstVisibleIndex = this.normalizeIndex(Math.floor(this._lastKnownScrollTop / this.itemHeight));\n this._lastVisibleIndex = this.normalizeIndex(this._firstVisibleIndex + this._visibleItemsNum);\n\n const firstRenderedIndex = this.normalizeIndex(this._firstVisibleIndex - 2);\n const lastRenderedIndex = this.normalizeIndex(this._lastVisibleIndex + 2);\n\n // May update value of this.items, which could trigger another render if not called from a lifecycle callback where it is ignored\n this.requestData(firstRenderedIndex, lastRenderedIndex);\n\n for (let i = firstRenderedIndex; i <= lastRenderedIndex; i++) {\n const physicalIndex = i - firstRenderedIndex;\n const itemData = this.items[physicalIndex];\n let dataHash;\n if (itemData) {\n dataHash = JSON.stringify(itemData);\n } else {\n dataHash = `placeholder-${physicalIndex}`;\n }\n this._itemsRenderData.push({\n index: i,\n top: this.itemHeight * i,\n physicalIndex,\n dataHash,\n data: itemData,\n });\n }\n } else {\n this._firstVisibleIndex = 0;\n this._lastVisibleIndex = 0;\n }\n }\n\n private normalizeIndex(index: number): number {\n return Math.max(0, Math.min(index, this.itemCount - 1));\n }\n\n private get height(): number {\n return this.offsetHeight;\n }\n\n private requestData(firstRenderedIndex: number, lastRenderedIndex: number): void {\n if (!Number.isNaN(firstRenderedIndex) && !Number.isNaN(lastRenderedIndex)) {\n this.dispatchEvent(\n new CustomEvent<IDataRequestEvent>(\"sd-virtual-list-data-request\", {\n detail: {\n startIndex: firstRenderedIndex,\n stopIndex: lastRenderedIndex,\n },\n }),\n );\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n let shouldPrevent = true;\n switch (event.key) {\n case \"Down\":\n case \"ArrowDown\":\n this.focusIndex = (this.focusIndex + 1) % this.itemCount;\n break;\n case \"Up\":\n case \"ArrowUp\":\n if (this.focusIndex > 0) {\n this.focusIndex--;\n } else if (this.finalSizeIsKnown) {\n this.focusIndex = this.itemCount - 1;\n }\n break;\n case \"Enter\":\n this.handleSelection(this.focusIndex, event);\n break;\n case \"End\":\n this.focusIndex = this.itemCount - 1;\n break;\n case \"PageDown\":\n this.focusIndex = this.normalizeIndex(this.focusIndex + this._visibleItemsNum - 1);\n break;\n case \"Home\":\n this.focusIndex = 0;\n break;\n case \"PageUp\":\n this.focusIndex = this.normalizeIndex(this.focusIndex - this._visibleItemsNum + 1);\n break;\n default:\n shouldPrevent = false;\n break;\n }\n if (shouldPrevent) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n private handleSelection(index: number, event: Event): void {\n if (index < 0 || this.itemCount <= index) {\n return;\n }\n const element = this.getListItem(index);\n if (element == null || element.getAttribute(\"aria-disabled\") == \"true\" || element.hasAttribute(\"disabled\")) {\n return;\n }\n let hasBeenSelected = true;\n if (this.selectionType !== SelectionType.TriggerOnly) {\n const existingIndex = this.selectedIndices.indexOf(index);\n hasBeenSelected = existingIndex == -1;\n if (hasBeenSelected) {\n if (this.selectionType === SelectionType.Single) {\n this.selectedIndices = [index];\n } else {\n this.selectedIndices.push(index);\n }\n } else {\n this.selectedIndices.splice(existingIndex, 1);\n }\n this.requestUpdate(\"selectedIndices\"); // altering inside of an array does not retrigger an update\n }\n this.focusIndex = index;\n this.dispatchSelectionEvent(index, hasBeenSelected, event);\n }\n\n private dispatchSelectionEvent(index: number, selected: boolean, originalEvent: Event): void {\n this.dispatchEvent(\n new CustomEvent<ISelectionEvent>(\"sd-virtual-list-selection\", {\n detail: { index, selected, originalEvent },\n }),\n );\n }\n\n private handleClick = (event: MouseEvent) => {\n const clickedElement = event\n .composedPath()\n .find(\n (target) => target instanceof HTMLElement && target.hasAttribute && target.hasAttribute(\"item-index\"),\n ) as HTMLElement | undefined;\n if (clickedElement) {\n const itemIndexFromAttribute = clickedElement.getAttribute(\"item-index\");\n if (itemIndexFromAttribute != null) {\n const index = parseInt(itemIndexFromAttribute);\n if (Number.isInteger(index)) {\n if (event.button == 0 || event.button == 1) {\n this.handleSelection(index, event);\n }\n this.focusIndex = index;\n }\n }\n }\n };\n}\n\nVirtualList.ensureDefined();\n"],"mappings":";;;AAgFA,IAAA,IAAe,IAjEf,MAAM,EAA8B;;0BAKW;;CAE3C,8BACI,GACA,GACA,GACA,GACA,GACA,GACM;EACN,IAAM,IAAi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GAxeJ,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAe,SAAS;CAAM,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,cAAA,KAAA,EAAA,KAEnE,EAAS,EAAE,MAAM,QAAQ,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,KAE1B,EAAS;CAAE,MAAM;CAAO,WAAW;CAAO,CAAC,EAAA,EAAA,eAAA,MAAA,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAE3C,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAkB,SAAS;CAAM,YAAY;CAAM,CAAC,EAAA,EAAA,eAAA,QAAA,IAAA,MAAA,UAAA,MAAA,aAAA,IAAA,OAAA,CAAA,EAAA,EAAA,WAAA,iBAAA,KAAA,EAAA,KAExF,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAM,SAAS;CAAM,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,MAAA,KAAA,EAAA,KAI1D,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA;CA+BzC,EAAS;EAAE,MAAM;EAAQ,WAAW;EAAe,SAAS;EAAM,CAAC;;;;CAqBnE,EAAS;EAAE,MAAM;EAAO,WAAW;EAAO,CAAC;;;0CAgchD,EAAY,eAAe"}
|
|
1
|
+
{"version":3,"file":"virtual-list.mjs","names":[],"sources":["../list-util.ts","../data-provider.ts","../style.scss?inline","../virtual-list.ts"],"sourcesContent":["export type ScrollToAlignment = \"auto\" | \"center\" | \"start\" | \"end\";\n\nexport interface IListUtil {\n getOffsetForIndexAndAlignment(\n index: number,\n alignment: ScrollToAlignment,\n scrollOffset: number,\n itemHeight: number,\n height: number,\n itemCount: number,\n ): number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n debounce(func: (...args: any) => void): () => void;\n}\n\nclass ListUtil implements IListUtil {\n /**\n * Padding kept between a scrolled-to item and the viewport edge so the item's focus ring\n * stays visible. Must be kept in sync with `--list-item-focus-ring-width` in style.scss.\n */\n private static readonly FOCUS_RING_WIDTH = 3;\n\n public getOffsetForIndexAndAlignment(\n index: number,\n alignment: ScrollToAlignment,\n scrollOffset: number,\n itemHeight: number,\n height: number,\n itemCount: number,\n ): number {\n const focusRingWidth = ListUtil.FOCUS_RING_WIDTH;\n const lastItemOffset = Math.max(0, itemCount * itemHeight);\n const renderedTop = index * itemHeight + focusRingWidth;\n const rawMaxOffset = Math.min(lastItemOffset, renderedTop);\n const rawMinOffset = Math.max(0, renderedTop - height + itemHeight);\n const maxOffset = Math.max(0, rawMaxOffset - focusRingWidth);\n const minOffset = Math.min(lastItemOffset, rawMinOffset + focusRingWidth);\n\n switch (alignment) {\n case \"start\":\n return maxOffset;\n case \"end\":\n return minOffset;\n case \"center\": {\n const middleOffset = Math.round(rawMinOffset + (rawMaxOffset - rawMinOffset) / 2);\n if (middleOffset < Math.ceil(height / 2)) {\n return 0;\n } else if (middleOffset > lastItemOffset + Math.floor(height / 2)) {\n return lastItemOffset;\n } else {\n return middleOffset;\n }\n }\n case \"auto\":\n default:\n if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {\n return scrollOffset;\n } else if (scrollOffset < minOffset) {\n return minOffset;\n } else {\n return maxOffset;\n }\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public debounce(func: (...args: any) => void): (...args: unknown[]) => void {\n let timer: number | null;\n return (...args: unknown[]) => {\n if (timer) {\n window.cancelAnimationFrame(timer);\n }\n timer = window.requestAnimationFrame(() => {\n func(...args);\n timer = null;\n });\n };\n }\n}\n\nexport default new ListUtil();\n","import VirtualList from \"./virtual-list\";\n\nexport class ListDataProvider {\n public onDataRequest?: (page: number) => void;\n\n private _finalSizeIsKnown = false;\n private _itemCache: unknown[] = [];\n private _lastRequestedFirstIndex = 0;\n private _lastRequestedLastIndex = 0;\n private _lastLoadedIndex = 0;\n private _list?: VirtualList;\n private _itemCount: number;\n private _pendingDataRequest: boolean = false;\n\n constructor(\n public pageSize: number = 100,\n public preloadedItemsCount: number = 5,\n ) {\n this._itemCount = pageSize; // configure initial load\n }\n\n public get currentPage(): number {\n if (this.items.length == 0 && this.finalSizeIsKnown) {\n return 0; // Otherwise empty cache means we haven't fetched anything\n }\n // With pageSize 100\n // 0 => -1\n // 1 100 => 0\n // 101 200 => 1\n return Math.floor((this.items.length - 1) / this.pageSize);\n }\n\n public get finalSizeIsKnown(): boolean {\n return this._finalSizeIsKnown;\n }\n\n public set finalSizeIsKnown(value: boolean) {\n this._finalSizeIsKnown = value;\n if (value) {\n this.itemCount = this._itemCache.length;\n }\n if (this._list) {\n this._list.finalSizeIsKnown = value;\n }\n }\n\n private get itemCount(): number {\n return this._itemCount;\n }\n\n private set itemCount(count: number) {\n this._itemCount = count;\n if (this._list) {\n this._list.itemCount = count;\n }\n }\n\n public get items(): unknown[] {\n return this._itemCache;\n }\n\n public set items(items: unknown[]) {\n this._itemCache = items;\n this.onItemsChange();\n }\n\n public addItems(items: unknown[]): void {\n this._itemCache = this._itemCache.concat(items);\n this.onItemsChange();\n }\n\n public connectList(list: VirtualList): void {\n if (this._list) {\n this._list.removeEventListener(\"sd-virtual-list-data-request\", this.handleListDataRequest);\n }\n this._list = list;\n list.itemCount = this.itemCount;\n list.addEventListener(\"sd-virtual-list-data-request\", this.handleListDataRequest);\n list.finalSizeIsKnown = this._finalSizeIsKnown;\n }\n\n private onItemsChange(): void {\n this._pendingDataRequest = false;\n this._lastLoadedIndex = this._itemCache.length - 1;\n if (this.finalSizeIsKnown) {\n this.itemCount = this._itemCache.length;\n } else if (this._lastLoadedIndex > this.itemCount) {\n this.itemCount = this._lastLoadedIndex;\n }\n if (this._list) {\n this._list.items = this._itemCache.slice(this._lastRequestedFirstIndex, this._lastRequestedLastIndex + 1);\n }\n }\n\n private handleListDataRequest = (event: CustomEvent) => {\n if (this._list == null) {\n return;\n }\n const { startIndex, stopIndex } = event.detail;\n this._lastRequestedFirstIndex = startIndex;\n this._lastRequestedLastIndex = stopIndex;\n this._list.items = this._itemCache.slice(startIndex, stopIndex + 1);\n\n if (!this.finalSizeIsKnown && this._lastLoadedIndex < stopIndex + this.preloadedItemsCount) {\n this.requestData();\n }\n };\n\n private requestData(): void {\n if (this._pendingDataRequest) {\n return;\n }\n if (this.onDataRequest) {\n this._pendingDataRequest = true;\n this.onDataRequest(this.currentPage + 1);\n this._lastLoadedIndex += this.pageSize - 1;\n if (this._lastLoadedIndex > this.itemCount) {\n this.itemCount = this._lastLoadedIndex;\n }\n } else {\n throw Error(\n \"The final size is not yet known and the list would require item data from index \" +\n this._lastRequestedFirstIndex +\n \". to \" +\n this._lastRequestedLastIndex +\n \". which is not possible to load without a configured onDataRequest\",\n );\n }\n }\n}\n",":host {\n\tdisplay: block;\n\tposition: relative;\n\tcontain: layout;\n\toverflow-y: auto;\n\toverflow-x: hidden;\n\t--list-item-focus-ring-width: 3px;\n\tscroll-padding: var(--list-item-focus-ring-width);\n}\n\n:host(:focus) {\n\toutline: none;\n}\n\n:host(:focus-visible) {\n\t--sd-list-item-focus-ring-offset-color: var(--color-bg-default, #ffffff);\n\t--sd-list-item-focus-ring-color: var(--color-border-interaction-focus, #111);\n}\n\n.scroll-container {\n\tdisplay: block;\n\tpadding: var(--list-item-focus-ring-width);\n\t/* join the list background with the scrollbar */\n\tbackground: linear-gradient(\n\t\t\tvar(--sd-virtual-list-background-color, var(--color-bg-default, #ffffff)),\n\t\t\tvar(--sd-virtual-list-background-color, var(--color-bg-default, #ffffff))\n\t\t)\n\t\tno-repeat right center / var(--list-item-focus-ring-width) calc(100% - 2 * var(--list-item-focus-ring-width));\n}\n\n.container {\n\twidth: 100%;\n\tposition: relative;\n\tbackground-color: var(--sd-virtual-list-background-color, var(--color-bg-default, #ffffff));\n\n\t& > ::slotted(*) {\n\t\twidth: 100%;\n\t\tposition: absolute;\n\t\tbox-sizing: border-box;\n\t}\n\n\t& > ::slotted(sd-list-item:not([last])) {\n\t\t--sd-list-item-bottom-border-color: var(--color-border-weak, #ededed);\n\t\tborder-bottom-color: var(--sd-list-item-bottom-border-color);\n\t}\n\n\t& > ::slotted(sd-list-item:is(:hover, [focused], :not([aria-disabled=\"true\"]):active, [selected])) {\n\t\t--sd-list-item-bottom-border-color: var(--color-rainbow-mono-weak, #ffffff);\n\t}\n\n\t& > ::slotted(sd-list-item[selected]) {\n\t\tborder-left-color: var(--color-rainbow-mono-weak, #ffffff);\n\t\tborder-right-color: var(--color-rainbow-mono-weak, #ffffff);\n\t}\n\n\t& > ::slotted(:not(:is(sd-list-item, [last]))) {\n\t\tborder-bottom: 1px solid var(--color-border-weak, #ededed);\n\t}\n}\n","import ListItem, { generator, type ItemData } from \"@cas-smartdesign/list-item\";\nimport { LitElement, type TemplateResult, html, unsafeCSS, type PropertyValues, css } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\n\nimport ListUtil, { type ScrollToAlignment } from \"./list-util\";\nexport { ListDataProvider } from \"./data-provider\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [VirtualList.ID]: VirtualList;\n }\n interface HTMLElementEventMap {\n \"sd-virtual-list-data-request\": CustomEvent<IDataRequestEvent>;\n \"sd-virtual-list-selection\": CustomEvent<ISelectionEvent>;\n }\n}\n\nimport style from \"./style.scss?inline\";\n\nexport type ItemGenerator = (data: ItemData, _index: number) => HTMLElement;\nexport enum SelectionType {\n TriggerOnly = \"trigger-only\",\n Single = \"single\",\n Multi = \"multi\",\n}\n\ninterface ItemRenderData {\n index: number;\n top: number;\n physicalIndex: number;\n dataHash: string;\n data?: unknown;\n}\n\nlet idCounter = 0;\n\nexport interface IDataRequestEvent {\n startIndex: number;\n stopIndex: number;\n}\n\nexport interface ISelectionEvent {\n index: number;\n selected: boolean;\n originalEvent: Event;\n}\n\nexport default class VirtualList extends LitElement {\n public static readonly ID = \"sd-virtual-list\";\n public static ensureDefined = (): void => {\n ListItem.ensureDefined();\n if (!customElements.get(VirtualList.ID)) {\n customElements.define(VirtualList.ID, VirtualList);\n }\n };\n\n @property({ type: Number, attribute: \"item-height\", reflect: true })\n public itemHeight: number = 48;\n @property({ type: Number })\n public itemCount: number = 0;\n @property({ type: Array, attribute: false })\n public items: unknown[] = [];\n @property({ type: String, attribute: \"selection-type\", reflect: true, noAccessor: true })\n public selectionType: SelectionType = SelectionType.TriggerOnly;\n @property({ type: String, attribute: true, reflect: true })\n public override id: string = VirtualList.ID + \"_\" + idCounter++;\n\n // aria attributes\n @property({ type: String, reflect: true })\n public override role = \"listbox\";\n\n public itemGenerator: ItemGenerator = generator;\n public finalSizeIsKnown?: boolean;\n\n private _lastKnownScrollTop = 0;\n private _lastRenderedScrollTop = 0;\n\n private _itemsRenderData: ItemRenderData[] = [];\n private _elementCache: Map<string, HTMLElement> = new Map();\n\n private _firstVisibleIndex: number = -1;\n private _lastVisibleIndex: number = -1;\n private _visibleItemsNum = 0;\n\n private _selectedIndices: number[] = [];\n private _focusIndex = -1;\n private _resizeObserver: ResizeObserver;\n private _lastKnownHeight = 0;\n private _increaseWidthOnNextRenderIfNeeded?: boolean;\n private _reachedMaxWidth?: boolean;\n\n public get focusTarget(): boolean {\n return this.hasAttribute(\"focus-target\");\n }\n\n public set focusTarget(value: boolean) {\n this.toggleAttribute(\"focus-target\", value);\n }\n\n @property({ type: Number, attribute: \"focus-index\", reflect: true })\n public get focusIndex(): number {\n return this._focusIndex;\n }\n\n public set focusIndex(index: number) {\n if (index >= -1 && index < this.itemCount) {\n const oldValue = this._focusIndex;\n this._focusIndex = index;\n if (index <= this._firstVisibleIndex || this._lastVisibleIndex <= index) {\n this.scrollToItem(index);\n }\n if (oldValue != index) {\n if (index == -1) {\n this.removeAttribute(\"aria-activedescendant\");\n }\n this.requestUpdate(\"focusIndex\", oldValue);\n }\n }\n }\n\n @property({ type: Array, attribute: false })\n public get selectedIndices(): number[] {\n return this._selectedIndices;\n }\n\n public set selectedIndices(selectedIndices: number[]) {\n if (selectedIndices) {\n // Parse to primitive numbers as the virtual-list uses numbers and not objects for the indexOf(item-index) checks.\n this._selectedIndices = selectedIndices.map((index) => Number(index));\n } else {\n this._selectedIndices = [];\n }\n this.requestUpdate(\"selectedIndices\");\n }\n\n public scrollToItem(index: number, alignment: ScrollToAlignment = \"auto\"): void {\n this.scrollTop = ListUtil.getOffsetForIndexAndAlignment(\n this.normalizeIndex(index),\n alignment,\n this.scrollTop,\n this.itemHeight,\n this.height,\n this.itemCount,\n );\n // The render might have already been scheduled, but the onScroll event is dispatched later.\n // We need to update the _lastKnownScrollTop manually to ensure an up-to-date value is used even for the next render.\n this._lastKnownScrollTop = this.scrollTop;\n }\n\n public getListItem(index: number): HTMLElement | null {\n if (!this.shadowRoot || index < this._firstVisibleIndex || this._lastVisibleIndex < index) {\n return null;\n }\n return this.querySelector(`[item-index=\"${index}\"]`);\n }\n\n constructor() {\n super();\n this._resizeObserver = new ResizeObserver(() => {\n if (this._lastKnownHeight !== this.offsetHeight) {\n this._lastKnownHeight = this.offsetHeight;\n this.requestUpdate();\n }\n });\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n this._resizeObserver.observe(this);\n // these are needed because when reattaching the list to the DOM\n // then the scroll position is reset but no scroll event is called\n // so the list shows the items at incorrect position\n if (this.scrollTop !== this._lastKnownScrollTop) {\n this.scrollTop = this._lastKnownScrollTop;\n this.requestUpdate();\n }\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._resizeObserver.disconnect();\n }\n\n public override firstUpdated(_changedProperties: PropertyValues): void {\n super.firstUpdated(_changedProperties);\n\n this.addEventListener(\"scroll\", this.onScroll);\n this.addEventListener(\"keydown\", this.handleKeyDown);\n this.addEventListener(\"click\", this.handleClick);\n this.addEventListener(\"mousedown\", (event) => {\n if (event.button == 1) {\n event.preventDefault();\n }\n });\n this.addEventListener(\"auxclick\", this.handleClick);\n this.addEventListener(\"focus\", () => {\n if (this.matches(\":focus-visible\")) {\n if (this.focusIndex == -1) {\n if (this.selectedIndices) {\n this.focusIndex = this.selectedIndices[0] ?? -1;\n }\n if (this.focusIndex == -1 && this.itemCount > 0) {\n this.focusIndex = 0;\n }\n } else {\n this.updateFocusedItemAttributes();\n }\n }\n });\n this.addEventListener(\"blur\", () => {\n if (this.focusIndex != -1) {\n this.updateFocusedItemAttributes();\n }\n });\n if (this.selectedIndices.length > 0) {\n this.scrollToItem(this.selectedIndices[0] ?? -1, \"center\");\n }\n }\n\n private updateFocusedItemAttributes() {\n const focusedElement = this.getListItem(this.focusIndex);\n if (focusedElement) {\n if (this.focusTarget || document.activeElement == this) {\n focusedElement.setAttribute(\"focused\", \"\");\n this.setAttribute(\"aria-activedescendant\", focusedElement.id);\n } else {\n focusedElement.removeAttribute(\"focused\");\n this.removeAttribute(\"aria-activedescendant\");\n }\n }\n }\n\n static override get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n public override render(): TemplateResult {\n this.updateItemsRenderData();\n return html`\n <div class=\"scroll-container\">\n <div class=\"container\" style=\"height: ${this.itemCount * this.itemHeight}px\">\n <slot name=\"items\"></slot>\n </div>\n </div>\n `;\n }\n\n public override updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n this._lastRenderedScrollTop = this._lastKnownScrollTop;\n this.updateItems();\n\n if (\n (this._increaseWidthOnNextRenderIfNeeded || this._reachedMaxWidth) && //\n this._firstVisibleIndex < this._lastVisibleIndex\n ) {\n this.adjustWidthIfNeeded();\n }\n }\n\n private adjustWidthIfNeeded() {\n if (this._increaseWidthOnNextRenderIfNeeded) {\n this._increaseWidthOnNextRenderIfNeeded = false;\n window.requestAnimationFrame(() => {\n const remainingWidth = Number.parseInt(getComputedStyle(this).maxWidth) - this.offsetWidth;\n if (remainingWidth == 0) {\n this._reachedMaxWidth = true;\n this.enableLineClampOnItemsIfNeeded();\n } else {\n this._reachedMaxWidth = false;\n const missingWidths = [...this.querySelectorAll(\"[item-index]\")].map((item) => {\n if (item instanceof ListItem) {\n item.enableLineClamp = false;\n const missingWidthForTexts = item.missingWidthForTexts;\n if (missingWidthForTexts > remainingWidth) {\n item.enableLineClamp = true;\n }\n return missingWidthForTexts;\n }\n const missingWidth = item.scrollWidth - item.clientWidth;\n if (missingWidth > 0) {\n return missingWidth + 1; // ensure ellipsis is not shown for subpixel rendering\n }\n return 0;\n });\n const additionalWidth = Math.max(...missingWidths);\n if (additionalWidth > 0) {\n this.style.width = `${this.offsetWidth + additionalWidth}px`;\n }\n }\n });\n } else if (this._reachedMaxWidth) {\n this.enableLineClampOnItemsIfNeeded();\n }\n }\n\n private enableLineClampOnItemsIfNeeded() {\n this.querySelectorAll(\"[item-index]\").forEach((item) => {\n if (item instanceof ListItem) {\n item.enableLineClamp = item.enableLineClamp || item.missingWidthForTexts > 0;\n }\n });\n }\n\n /**\n * Searches for list-items where there is a need for an additional width (ellipsis maybe shown) and increases the width of the list,\n * therefore all the content is visible without tooltips. As it can be an expensive task to retrieve the required details, calling\n * this function has an effect only on the very next render. Note that it only works if the virtual-list works with sd-list-item elements.\n * If the maximum width is reached, line clamp is enabled on list items as a last resort approach to show the content if possible.\n */\n public increaseWidthOnNextRenderIfNeeded(): void {\n this._increaseWidthOnNextRenderIfNeeded = true;\n }\n\n private updateItems() {\n const unusedItems: Element[] = [...this.querySelectorAll(\"[item-index]\")];\n const renderedItems: Map<string, HTMLElement> = new Map();\n\n const newItemsFragment = document.createDocumentFragment();\n for (const renderData of this._itemsRenderData) {\n const itemElement = this.renderItem(renderData);\n if (!itemElement.parentElement) {\n newItemsFragment.appendChild(itemElement);\n }\n renderedItems.set(renderData.dataHash, itemElement);\n const index = unusedItems.indexOf(itemElement);\n if (index !== -1) {\n unusedItems.splice(index, 1);\n }\n }\n this.appendChild(newItemsFragment);\n\n for (const unusedItemElement of unusedItems) {\n if (unusedItemElement instanceof ListItem) {\n unusedItemElement.enableLineClamp = false;\n }\n this.removeChild(unusedItemElement);\n }\n\n renderedItems.forEach((itemElement, dataHash) => {\n this._elementCache.set(dataHash, itemElement);\n });\n }\n\n private renderItem({ index, top, dataHash, data }: ItemRenderData): HTMLElement {\n let element: HTMLElement;\n if (data) {\n if (this._elementCache.has(dataHash)) {\n element = this._elementCache.get(dataHash)!;\n this._elementCache.delete(dataHash); // Allow to be rendered twice\n } else {\n element = this.itemGenerator(data, index);\n element.setAttribute(\"slot\", \"items\");\n // Do not add to cache yet, because the same item might need to be rendered twice\n }\n } else {\n element = document.createElement(\"div\");\n element.setAttribute(\"placeholder-item\", \"\");\n element.setAttribute(\"slot\", \"items\");\n }\n Object.assign(element.style, {\n transform: `translateY(${top}px)`,\n height: `${this.itemHeight}px`,\n });\n element.setAttribute(\"item-index\", index.toString());\n element.setAttribute(\"aria-setsize\", String(this.finalSizeIsKnown ? this.itemCount : -1));\n element.setAttribute(\"aria-posinset\", String(index + 1));\n if (!element.id || element.id.startsWith(this.id + \"_item_\")) {\n element.id = this.id + \"_item_\" + index;\n }\n if (this.itemCount - 1 == index) {\n element.setAttribute(\"last\", \"\");\n } else {\n element.removeAttribute(\"last\");\n }\n\n this.updateSelectedAttribute(index, element);\n this.updateFocusedAttribute(index, element);\n\n return element;\n }\n\n private onScroll = () => {\n this._lastKnownScrollTop = this.scrollTop;\n const delta = this._lastRenderedScrollTop - this._lastKnownScrollTop;\n if (Math.abs(delta) >= this.itemHeight) {\n this._lastRenderedScrollTop = this._lastKnownScrollTop;\n this.requestUpdate();\n }\n };\n\n private updateFocusedAttribute(index: number, itemElement: HTMLElement) {\n if (this.focusIndex == index && (this.focusTarget || document.activeElement == this)) {\n itemElement.setAttribute(\"focused\", \"\");\n this.setAttribute(\"aria-activedescendant\", itemElement.id);\n } else {\n itemElement.removeAttribute(\"focused\");\n }\n }\n\n private updateSelectedAttribute(index: number, itemElement: HTMLElement) {\n const selected = this.selectedIndices.indexOf(index) !== -1;\n if (selected) {\n itemElement.setAttribute(\"selected\", \"\");\n } else {\n itemElement.removeAttribute(\"selected\");\n }\n itemElement.setAttribute(\"aria-selected\", String(selected));\n }\n\n private updateItemsRenderData(): void {\n this._itemsRenderData = [];\n this._visibleItemsNum = Math.min(Math.ceil(this.height / this.itemHeight), this.itemCount);\n\n if (this._visibleItemsNum > 0) {\n this._firstVisibleIndex = this.normalizeIndex(Math.floor(this._lastKnownScrollTop / this.itemHeight));\n this._lastVisibleIndex = this.normalizeIndex(this._firstVisibleIndex + this._visibleItemsNum);\n\n const firstRenderedIndex = this.normalizeIndex(this._firstVisibleIndex - 2);\n const lastRenderedIndex = this.normalizeIndex(this._lastVisibleIndex + 2);\n\n // May update value of this.items, which could trigger another render if not called from a lifecycle callback where it is ignored\n this.requestData(firstRenderedIndex, lastRenderedIndex);\n\n for (let i = firstRenderedIndex; i <= lastRenderedIndex; i++) {\n const physicalIndex = i - firstRenderedIndex;\n const itemData = this.items[physicalIndex];\n let dataHash;\n if (itemData) {\n dataHash = JSON.stringify(itemData);\n } else {\n dataHash = `placeholder-${physicalIndex}`;\n }\n this._itemsRenderData.push({\n index: i,\n top: this.itemHeight * i,\n physicalIndex,\n dataHash,\n data: itemData,\n });\n }\n } else {\n this._firstVisibleIndex = 0;\n this._lastVisibleIndex = 0;\n }\n }\n\n private normalizeIndex(index: number): number {\n return Math.max(0, Math.min(index, this.itemCount - 1));\n }\n\n private get height(): number {\n return this.offsetHeight;\n }\n\n private requestData(firstRenderedIndex: number, lastRenderedIndex: number): void {\n if (!Number.isNaN(firstRenderedIndex) && !Number.isNaN(lastRenderedIndex)) {\n this.dispatchEvent(\n new CustomEvent<IDataRequestEvent>(\"sd-virtual-list-data-request\", {\n detail: {\n startIndex: firstRenderedIndex,\n stopIndex: lastRenderedIndex,\n },\n }),\n );\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n let shouldPrevent = true;\n switch (event.key) {\n case \"Down\":\n case \"ArrowDown\":\n this.focusIndex = (this.focusIndex + 1) % this.itemCount;\n break;\n case \"Up\":\n case \"ArrowUp\":\n if (this.focusIndex > 0) {\n this.focusIndex--;\n } else if (this.finalSizeIsKnown) {\n this.focusIndex = this.itemCount - 1;\n }\n break;\n case \"Enter\":\n this.handleSelection(this.focusIndex, event);\n break;\n case \"End\":\n this.focusIndex = this.itemCount - 1;\n break;\n case \"PageDown\":\n this.focusIndex = this.normalizeIndex(this.focusIndex + this._visibleItemsNum - 1);\n break;\n case \"Home\":\n this.focusIndex = 0;\n break;\n case \"PageUp\":\n this.focusIndex = this.normalizeIndex(this.focusIndex - this._visibleItemsNum + 1);\n break;\n default:\n shouldPrevent = false;\n break;\n }\n if (shouldPrevent) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n private handleSelection(index: number, event: Event): void {\n if (index < 0 || this.itemCount <= index) {\n return;\n }\n const element = this.getListItem(index);\n if (element == null || element.getAttribute(\"aria-disabled\") == \"true\" || element.hasAttribute(\"disabled\")) {\n return;\n }\n let hasBeenSelected = true;\n if (this.selectionType !== SelectionType.TriggerOnly) {\n const existingIndex = this.selectedIndices.indexOf(index);\n hasBeenSelected = existingIndex == -1;\n if (hasBeenSelected) {\n if (this.selectionType === SelectionType.Single) {\n this.selectedIndices = [index];\n } else {\n this.selectedIndices.push(index);\n }\n } else {\n this.selectedIndices.splice(existingIndex, 1);\n }\n this.requestUpdate(\"selectedIndices\"); // altering inside of an array does not retrigger an update\n }\n this.focusIndex = index;\n this.dispatchSelectionEvent(index, hasBeenSelected, event);\n }\n\n private dispatchSelectionEvent(index: number, selected: boolean, originalEvent: Event): void {\n this.dispatchEvent(\n new CustomEvent<ISelectionEvent>(\"sd-virtual-list-selection\", {\n detail: { index, selected, originalEvent },\n }),\n );\n }\n\n private handleClick = (event: MouseEvent) => {\n const clickedElement = event\n .composedPath()\n .find(\n (target) => target instanceof HTMLElement && target.hasAttribute && target.hasAttribute(\"item-index\"),\n ) as HTMLElement | undefined;\n if (clickedElement) {\n const itemIndexFromAttribute = clickedElement.getAttribute(\"item-index\");\n if (itemIndexFromAttribute != null) {\n const index = parseInt(itemIndexFromAttribute);\n if (Number.isInteger(index)) {\n if (event.button == 0 || event.button == 1) {\n this.handleSelection(index, event);\n }\n this.focusIndex = index;\n }\n }\n }\n };\n}\n\nVirtualList.ensureDefined();\n"],"mappings":";;;AAgFA,IAAA,IAAe,IAjEf,MAAM,EAA8B;;0BAKW;;CAE3C,8BACI,GACA,GACA,GACA,GACA,GACA,GACM;EACN,IAAM,IAAiB,EAAS,kBAC1B,IAAiB,KAAK,IAAI,GAAG,IAAY,EAAW,EACpD,IAAc,IAAQ,IAAa,GACnC,IAAe,KAAK,IAAI,GAAgB,EAAY,EACpD,IAAe,KAAK,IAAI,GAAG,IAAc,IAAS,EAAW,EAC7D,IAAY,KAAK,IAAI,GAAG,IAAe,EAAe,EACtD,IAAY,KAAK,IAAI,GAAgB,IAAe,EAAe;AAEzE,UAAQ,GAAR;GACI,KAAK,QACD,QAAO;GACX,KAAK,MACD,QAAO;GACX,KAAK,UAAU;IACX,IAAM,IAAe,KAAK,MAAM,KAAgB,IAAe,KAAgB,EAAE;AAM7E,WALA,IAAe,KAAK,KAAK,IAAS,EAAE,GAC7B,IACA,IAAe,IAAiB,KAAK,MAAM,IAAS,EAAE,GACtD,IAEA;;GAIf,QAMQ,QALA,KAAgB,KAAa,KAAgB,IACtC,IACA,IAAe,IACf,IAEA;;;CAMvB,SAAgB,GAA4D;EACxE,IAAI;AACJ,UAAQ,GAAG,MAAoB;AAI3B,GAHI,KACA,OAAO,qBAAqB,EAAM,EAEtC,IAAQ,OAAO,4BAA4B;AAEvC,IADA,EAAK,GAAG,EAAK,EACb,IAAQ;KACV;;;GAKe;;;;;;;;;;;;;;;;AC9E7B,IAAa,IAAb,MAA8B;CAY1B,YACI,IAA0B,KAC1B,IAAqC,GACvC;AACE,EAHO,KAAA,WAAA,GACA,KAAA,sBAAA,4BAXiB,sBACI,EAAE,kCACC,kCACD,2BACP,8BAGY,kCAkFN,MAAuB;AACpD,OAAI,KAAK,SAAS,KACd;GAEJ,IAAM,EAAE,e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|
2
2
|
"name": "@cas-smartdesign/virtual-list",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "A virtualized list element with SmartDesign look and feel.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"files": [
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"lit": "^3.3.2",
|
|
20
|
-
"@cas-smartdesign/list-item": "^9.0.
|
|
20
|
+
"@cas-smartdesign/list-item": "^9.0.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@cas-smartdesign/element-
|
|
23
|
+
"@cas-smartdesign/element-utils": "^2.0.0",
|
|
24
24
|
"@cas-smartdesign/license-generator": "^1.10.0",
|
|
25
|
-
"@cas-smartdesign/element-
|
|
25
|
+
"@cas-smartdesign/element-preview": "^1.1.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@cas-smartdesign/design-tokens": "^3.0.2"
|