@cas-smartdesign/token-selector 0.21.1 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/docs/doc.mjs
CHANGED
|
@@ -575,7 +575,7 @@ export function getItems(): ExtendedTokenData[] {
|
|
|
575
575
|
</div>
|
|
576
576
|
`}updated(i){if(super.updated(i),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{const e=new MutationObserver(()=>{this.adjustWidthIfNeeded(),e.disconnect()});e.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{const i=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(i==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;const e=[...this.querySelectorAll("[item-index]")].map(n=>{if(n instanceof rt){n.enableLineClamp=!1;const s=n.missingWidthForTexts;return s>i&&(n.enableLineClamp=!0),s}}),t=Math.max(...e);t>0&&(this.style.width=`${this.offsetWidth+t}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(i=>{i instanceof rt&&(i.enableLineClamp=i.enableLineClamp||i.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){const i=[...this.querySelectorAll("[item-index]")],e=new Map,t=document.createDocumentFragment();for(const n of this._itemsRenderData){const s=this.renderItem(n);s.parentElement||t.appendChild(s),e.set(n.dataHash,s);const r=i.indexOf(s);r!==-1&&i.splice(r,1)}this.appendChild(t);for(const n of i)n instanceof rt&&(n.enableLineClamp=!1),this.removeChild(n);e.forEach((n,s)=>{this._elementCache.set(s,n)})}renderItem({index:i,top:e,dataHash:t,data:n}){let s;return n?this._elementCache.has(t)?(s=this._elementCache.get(t),this._elementCache.delete(t)):(s=this.itemGenerator(n,i),s.setAttribute("slot","items")):(s=document.createElement("div"),s.setAttribute("placeholder-item",""),s.setAttribute("slot","items")),Object.assign(s.style,{transform:`translateY(${e}px)`,height:`${this.itemHeight}px`}),s.setAttribute("item-index",i.toString()),s.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),s.setAttribute("aria-posinset",String(i+1)),(!s.id||s.id.startsWith(this.id+"_item_"))&&(s.id=this.id+"_item_"+i),this.itemCount-1==i?s.setAttribute("last",""):s.removeAttribute("last"),this.updateSelectedAttribute(i,s),this.updateFocusedAttribute(i,s),s}updateFocusedAttribute(i,e){this.focusIndex==i&&(this.focusTarget||document.activeElement==this)?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):e.removeAttribute("focused")}updateSelectedAttribute(i,e){const t=this.selectedIndices.indexOf(i)!==-1;t?e.setAttribute("selected",""):e.removeAttribute("selected"),e.setAttribute("aria-selected",String(t))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);const i=this.normalizeIndex(this._firstVisibleIndex-2),e=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(i,e);for(let t=i;t<=e;t++){const n=t-i,s=this.items[n];let r;s?r=JSON.stringify(s):r=`placeholder-${n}`,this._itemsRenderData.push({index:t,top:this.itemHeight*t,physicalIndex:n,dataHash:r,data:s})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(i){return Math.max(0,Math.min(i,this.itemCount-1))}get height(){return this.offsetHeight}requestData(i,e){!Number.isNaN(i)&&!Number.isNaN(e)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:i,stopIndex:e}}))}handleSelection(i,e){if(i<0||this.itemCount<=i)return;const t=i%this._visibleItemsNum,n=this.items[t];if(!n||n.disabled)return;let s=!0;if(this.selectionType!=="trigger-only"){const r=this.selectedIndices.indexOf(i);s=r==-1,s?this.selectionType==="single"?this.selectedIndices=[i]:this.selectedIndices.push(i):this.selectedIndices.splice(r,1),this.requestUpdate("selectedIndices")}this.focusIndex=i,this.dispatchSelectionEvent(i,s,e)}dispatchSelectionEvent(i,e,t){this.dispatchEvent(new CustomEvent("selection",{detail:{index:i,selected:e,hasModifier:t}}))}handleClick(i){const e=i.composedPath().find(t=>t.hasAttribute&&t.hasAttribute("item-index"));if(e){const t=parseInt(e.getAttribute("item-index"));if(Number.isInteger(t)){if(i.button==0||i.button==1){const n=i.type=="auxclick"&&i.button==1||i.metaKey||i.ctrlKey;this.handleSelection(t,n)}this.focusIndex=t}}}},Re.ID="sd-virtual-list",Re.ensureDefined=()=>{rt.ensureDefined(),customElements.get(Re.ID)||customElements.define(Re.ID,Re)},Re);Ne([v({type:Number,attribute:"item-height",reflect:!0})],Te.prototype,"itemHeight",2);Ne([v({type:Number})],Te.prototype,"itemCount",2);Ne([v({type:Array,attribute:!1})],Te.prototype,"items",2);Ne([v({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],Te.prototype,"selectionType",2);Ne([v({type:String,attribute:!0,reflect:!0})],Te.prototype,"id",2);Ne([v({type:String,reflect:!0})],Te.prototype,"role",2);Ne([v({type:Number,attribute:"focus-index",reflect:!0})],Te.prototype,"focusIndex",1);Ne([v({type:Array,attribute:!1})],Te.prototype,"selectedIndices",1);let ti=Te;ti.ensureDefined();let Rl=class rr{constructor(e,t){this.eventTarget=e,this.keydownHandler=t,this.catchedKeys=["Down","ArrowDown","Up","ArrowUp","Enter"],this.markAsFocusTargetHandler=()=>this.eventTarget.setAttribute("focus-target",""),this.unmarkAsFocusTargetHandler=()=>this.eventTarget.removeAttribute("focus-target"),this.delegateKeyDownEvent=n=>{if(this.catchedKeys.indexOf(n.key)!==-1){const s=n.key.toLocaleLowerCase();let r=0;const o=s.includes("enter");o||(r=s.includes("down")?1:-1),this.keydownHandler(n,r,o),n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()}}}static delegateTo(e){return new rr(e,t=>e.dispatchEvent(new KeyboardEvent(t.type,t)))}connect(e){var t,n;if(e!=null){e.addEventListener("keydown",this.delegateKeyDownEvent),e.addEventListener("focus",this.markAsFocusTargetHandler),e.addEventListener("blur",this.unmarkAsFocusTargetHandler);const s=document.activeElement;(e.contains(s)||(n=(t=e.shadowRoot)==null?void 0:t.activeElement)!=null&&n.contains(s))&&this.markAsFocusTargetHandler()}}disconnect(e){e!=null&&(e.removeEventListener("keydown",this.delegateKeyDownEvent),e.removeEventListener("focus",this.markAsFocusTargetHandler),e.removeEventListener("blur",this.unmarkAsFocusTargetHandler),this.unmarkAsFocusTargetHandler())}},Pl=0;class Ml{constructor(e,t,n,s){this.inputElement=e,this.notSelectedTokensProvider=t,this.initializeCallback=s,this.filter=(r,o)=>r?o.filter(a=>a.disabled||a.deactivated?!1:a.caption&&a.caption.toLowerCase().includes(r)):o,ti.ensureDefined(),this._tokenList=new ti,this._tokenList.id="sd_token_suggest_popover_list_"+Pl++,this._tokenList.style.minWidth="250px",this._tokenList.style.maxHeight="49vh",this._tokenList.itemHeight=50,this._tokenList.addEventListener("pointerdown",()=>{this.pointerDown=!0,window.addEventListener("pointerup",()=>{this.pointerDown=!1,this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.isUpdatePending||this._tokenList.requestUpdate()},{once:!0,capture:!0})}),this._tokenList.addEventListener("selection",r=>{const o=r.detail.index,a=this._suggestItems[o];n(a),this.hide()}),this._tokenList.addEventListener("data-request",r=>{this.lastRequestedStartIndex=r.detail.startIndex,this.lastRequestedStopIndex=r.detail.stopIndex,this.pointerDown||this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1)}),new Rl(this._tokenList,(r,o,a)=>{this._tokenList.dispatchEvent(new KeyboardEvent(r.type,r)),!a&&!this.isOpened&&this.show()}).connect(e)}show(){this.inputElement.effectiveDisabled||(this.popover,this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.focusIndex=-1,this._tokenList.style.width=null,requestAnimationFrame(()=>{this.lastRequestedStartIndex!=null&&(this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1))}),this.popover.show()))}refreshItems(){this.isOpened&&(this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.items=[],this._tokenList.style.width=null))}filterItems(e){const t=this.notSelectedTokensProvider();return this.filter(e,t)}hide(){var e;this._suggestItems=[],this._tokenList.itemCount=0,this._tokenList.items=[],(e=this._popover)==null||e.hide()}get list(){return this._tokenList}get popover(){return this._popover||(this._popover=this.createPopover(),this.initializeCallback(this)),this._popover}createPopover(){const e=new hn;return e.setAttribute("trigger-type","manual"),e.setAttribute("placement","bottom-start"),e.setAttribute("modal",""),e.setAttribute("popover-for","token-autosuggest-popover"),e.setAttribute("offset","-2"),e.targetElement=this.inputElement,e.appendChild(this._tokenList),e}get isOpened(){return this._popover&&this._popover.hasAttribute("open")}get focusedSuggestToken(){return this._suggestItems[this._tokenList.focusIndex]}}class ni extends vn{}ni.directiveName="unsafeSVG",ni.resultType=2;const Dl=Vs(ni),Nl=`:host{flex-shrink:0;max-width:100%;height:28px}:host([aria-checked=true]){position:relative}:host([aria-checked=true]):before{content:"";position:absolute;left:0;top:0;height:12px;width:12px;background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20fill='none'%3e%3cpath%20stroke='%23FFF'%20stroke-width='2'%20d='M9%204%205%208%203%206'/%3e%3c/svg%3e") no-repeat center center}.container{display:flex;height:100%;background-color:var(--sd-token-background-color, #f3f3f3);border:var(--sd-token-focused-border, var(--sd-token-border));box-sizing:border-box}.container .icon-wrapper{display:flex;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:100%;overflow:hidden;background-color:var(--sd-token-icon-background-color, transparent)}.container .icon-wrapper .icon{height:100%;width:100%;object-fit:contain;background-size:cover;background-repeat:no-repeat;background-position:center}.container .value{display:inline-block;align-self:center;padding:0 8px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.container .delete-button-wrapper{display:flex;align-self:center;height:16px;width:16px;padding-right:8px;opacity:.5}.container .delete-button-wrapper:hover{cursor:pointer;filter:brightness(10%);opacity:1}`,jl=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\r
|
|
577
577
|
<path d="m3.5 12.5 9-9m-9 0 9 9" style="fill:none;stroke:#333;stroke-linecap:square;stroke-width:1.1px"/>\r
|
|
578
|
-
</svg>`;var Bl=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,je=(i,e,t,n)=>{for(var s=n>1?void 0:n?zl(e,t):e,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=(n?o(e,t,s):o(s))||s);return n&&s&&Bl(e,t,s),s};const Ci={fromAttribute:i=>i=="true",toAttribute:i=>i};var Ie;const Le=(Ie=class extends ue{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return Ze(Nl)}set checked(e){const t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",n=>{const s=window.getSelection();if(s&&s.type=="Range"
|
|
578
|
+
</svg>`;var Bl=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,je=(i,e,t,n)=>{for(var s=n>1?void 0:n?zl(e,t):e,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=(n?o(e,t,s):o(s))||s);return n&&s&&Bl(e,t,s),s};const Ci={fromAttribute:i=>i=="true",toAttribute:i=>i};var Ie;const Le=(Ie=class extends ue{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return Ze(Nl)}set checked(e){const t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",n=>{const s=window.getSelection();if(s&&s.type=="Range")return;n.stopPropagation();const r=n.getModifierState("Control");this.disabled||(r?this.checked=!this.checked:this.checked=!0),this._tokenClickHandler&&this._tokenClickHandler(this.index,r)});const t=this.shadowRoot.querySelector(".delete-button-wrapper");t&&t.addEventListener("click",n=>{n.stopPropagation(),this._tokenDeleteHandler&&this._tokenDeleteHandler(this.index)})}render(){return X`
|
|
579
579
|
<div class="container">
|
|
580
580
|
<slot name="before-icon"></slot>
|
|
581
581
|
${this.renderIcon()}
|
|
@@ -611,7 +611,7 @@ export function getItems(): ExtendedTokenData[] {
|
|
|
611
611
|
><div class="token-wrapper" slot="prefix"><slot name="items"></slot></div>
|
|
612
612
|
</sd-lit-input>
|
|
613
613
|
<slot class="additonal-content" name="additional-content" @focusin=${this.clearCheckedTokens}></slot>
|
|
614
|
-
`}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable","true"),!this.hasAttribute("tabIndex")&&!this.disabled&&(this.tabIndex=0),this.addEventListener("focusout",t=>{const n=t.relatedTarget;!this.contains(n)&&!this.shadowRoot.contains(n)&&this.clearCheckedTokens()}),this.addEventListener("focusin",()=>{this.selectionMode=="remove-only"&&this.activeTokenIndex==-1&&this.items.length>0&&!this.disabled&&(this.activeTokenIndex=0)}),new Fl(this,()=>{var t;return(t=this.inputElement)==null?void 0:t.value},t=>this.selectOrAddItems(t)),new Wl(this,t=>this.selectOrAddItems(t))}clearCheckedTokens(){this.querySelectorAll("[slot='items'][aria-checked='true']").forEach(t=>t.checked=!1);const e=this.inputElement;e&&(e.removeAttribute("focus-visible"),e.removeAttribute("focused"))}removeSelectionOrActiveToken(){if(!this.disabled){const e=this.querySelectorAll("[slot='items'][aria-checked='true']");if(e.length>0){const t=Array.from(e);this.removeTokens(t.filter(n=>!n.disabled).map(n=>n.index))}else if(this.activeTokenIndex!=-1){const t=this.activeTokenElement;t&&!t.disabled&&this.removeTokens([t.index])}}}updateActiveToken(e){var n;if(this.disabled)return;const t=this.querySelectorAll("[slot='items']").length-1;if(this.activeTokenIndex==-1?e<0&&(this.activeTokenIndex=t):this.activeTokenIndex==t&&e>0&&this.selectionMode=="multi"?(this.activeTokenIndex=-1,this.focus()):this.activeTokenIndex=Math.max(0,Math.min(t,this.activeTokenIndex+e)),this.activeTokenIndex>-1&&((n=this.inputElement)==null||n.setAttribute("focus-visible",""),this.scrollHeight>this.offsetHeight)){const s=this.activeTokenElement;s.scrollIntoViewIfNeeded?s.scrollIntoViewIfNeeded():s.scrollIntoView()}}commitTokenValue(e){if(this.disabled)return;if(this.tokenSuggestPopover.isOpened){const n=this.tokenSuggestPopover.focusedSuggestToken;if(n){if(!n.disabled){const s=this.findIndex(n);this.handleTokenSelection([s]),this.tokenSuggestPopover.hide()}return}}if(!(e!=null&&e.trim()))return;const t=this.items.findIndex(n=>this.caseSensitive?n.caption==e:n.caption.toLowerCase()==e.toLowerCase());this.selectedIndexes.includes(t)||(t>=0?this.handleTokenSelection([t]):this.handleTokenCreation(e)),this.requestUpdate("selectedIndexes"),this.tokenSuggestPopover.hide(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updated(e){if(super.updated(e),this._tokenSuggestPopover&&(this.tokenSuggestPopover.list.className=this.suggestListClass||"",this.suggestionFilter&&(this.tokenSuggestPopover.filter=this.suggestionFilter)),e.has("selectionMode"))if(this.selectionMode=="multi"){this.setAttribute("aria-haspopup","listbox");const t=this.inputElement;t.addEventListener("immediate-value-change",n=>this.handleInputValueChange(n)),t.addEventListener("keydown",n=>this.handleInputKeyDown(n,t)),window.queueMicrotask(()=>this.tokenSuggestPopover)}else this.removeAttribute("aria-haspopup"),this.addEventListener("keydown",this.handleKeyDown),this._tokenSuggestPopover&&(this._tokenSuggestPopover.popover.remove(),this._tokenSuggestPopover=null);(e.size==0||e.has("selectionMode")||e.has("items")||e.has("selectedIndexes")||e.has("disabled"))&&this.updateItems(),e.has("inputLabel")&&(this.inputLabel?this.setAttribute("aria-label",this.inputLabel):this.removeAttribute("aria-label"))}handleInputValueChange(e){e.detail.value?(this.activeTokenIndex=-1,this.cancelSearch=!1,this.debouncedShowTokenSuggestPopover(),window.addEventListener("pointerdown",this.handleWindowPointerDown)):(this.tokenSuggestPopover.hide(),this.cancelSearch=!0)}showFilteredTokenSuggestions(){!this.cancelSearch&&this.inputElement.value&&this.tokenSuggestPopover.show()}isTokenNotSelected(e){return!this.selectedIndexes.includes(e)}get tokenSuggestPopover(){return!this._tokenSuggestPopover&&this.inputElement&&(this._tokenSuggestPopover=new Ml(this.inputElement,()=>this.items.filter((e,t)=>!e.disabled&&this.isTokenNotSelected(t)),e=>{const t=this.findIndex(e);this.handleTokenSelection([t]),window.removeEventListener("pointerdown",this.handleWindowPointerDown)},e=>{this.appendChild(e.popover),this.inputElement.setAttribute("aria-controls",e.list.id),this.dispatchEvent(new CustomEvent("auto-suggest-initialized")),e.popover.addEventListener("close",()=>{this.inputElement.value&&!this.contains(document.activeElement)&&(this.inputElement.value="")})}),this._tokenSuggestPopover.list.itemGenerator=this._autoSuggestItemGenerator,this._tokenSuggestPopover.list.className=this.suggestListClass,this.suggestionFilter&&(this._tokenSuggestPopover.filter=this.suggestionFilter)),this._tokenSuggestPopover}updateItems(){if(!this.isConnected||!this.items)return;this.activeTokenIndex=-1;const e=this.inputElement;e&&(!this._tokenSuggestPopover||!this._tokenSuggestPopover.isOpened)&&(e.value=""),this.querySelectorAll("[slot='items']").forEach(s=>{this.removeChild(s)});const t=document.createDocumentFragment();let n=[];this.selectionMode=="remove-only"?n=this.items.map(s=>this.disableIfNeeded(s)):this.selectedIndexes.forEach(s=>{n.push(this.disableIfNeeded(this.items[s]))}),n.forEach(s=>{const r=this.tokenGenerator(s,this.findIndex(s));r.slot="items",t.appendChild(r),r.id||(r.id=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)),r.setClickHandler((o,a)=>this.onTokenClick(r,!0,a)),r.addEventListener("click",()=>{var a;(a=this.inputElement)==null||a.removeAttribute("focus-visible");const o=window.getSelection();(!o||o.type!="Range")&&document.activeElement!=this&&this.focus()}),r.setDeleteHandler(o=>this.removeTokens([o]))}),this.appendChild(t),this._tokenSuggestPopover&&this._tokenSuggestPopover.refreshItems()}removeTokens(e){if(!(this.disabled||e==null||e.length==0))if(this.activeTokenIndex!=-1&&e.includes(this.activeTokenElement.index)&&(this.activeTokenIndex=-1),this.selectionMode=="remove-only")this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:e}}));else{const t=e.filter(n=>this.selectedIndexes.includes(n));t.length>0&&(this.selectedIndexes=this.selectedIndexes.filter(n=>!t.includes(n)),this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:t,selectedIndices:[...this.selectedIndexes]}})))}}onTokenClick(e,t,n){let s;this.querySelectorAll("[slot='items']").forEach((r,o)=>{e==r?s=o:n||r.setAttribute("aria-checked","false")}),this.activeTokenIndex=s,this.setAttribute("aria-activedescendant",this.activeTokenElement.id),this._tokenSuggestPopover&&this._tokenSuggestPopover.isOpened&&this._tokenSuggestPopover.hide(),n||this.dispatchEvent(new CustomEvent("token-clicked",{detail:{index:e.index,tokenElement:e,byPointerDevice:t}}))}disableIfNeeded(e){return this.disabled?{...e,disabled:!0}:e}handleTokenSelection(e){this.selectedIndexes=this.selectedIndexes.concat(e),this.dispatchEvent(new CustomEvent("tokens-selected",{detail:{newIndices:e,selectedIndices:[...this.selectedIndexes]}}))}handleTokenCreation(e){this.dispatchEvent(new CustomEvent("token-created",{detail:{value:e}}))}get inputElement(){return this.shadowRoot.querySelector(".input")}get activeTokenElement(){return this.getTokenElement(this.activeTokenIndex)}getTokenElement(e){return this.querySelector("[slot='items']:nth-of-type("+(e+1)+")")}findIndex(e){return this.items.findIndex(t=>t.caption===e.caption)}get activeTokenIndex(){return this._activeTokenIndex}set activeTokenIndex(e){if(this._activeTokenIndex!=-1){const t=this.activeTokenElement;t&&(t.current=!1)}if(this._activeTokenIndex=e,e==-1)this.removeAttribute("aria-activedescendant");else{const t=this.activeTokenElement;t.current=!0,this.setAttribute("aria-activedescendant",t.id)}}get hasInputValue(){var e;return!!((e=this.inputElement)!=null&&e.value)}},Se.ID="sd-token-selector",Se.ensureDefined=()=>{In.ensureDefined(),customElements.get(Se.ID)||customElements.define(Se.ID,Se)},Se.shadowRootOptions={...ue.shadowRootOptions,delegatesFocus:!0},Se);ge([v({type:String,attribute:"selection-mode",reflect:!0})],de.prototype,"selectionMode",2);ge([v({type:Array,attribute:!1})],de.prototype,"items",2);ge([v({type:Array,attribute:!1})],de.prototype,"selectedIndexes",2);ge([v({type:String,reflect:!0})],de.prototype,"placeholder",2);ge([v({type:String,reflect:!0,attribute:"suggest-list-class"})],de.prototype,"suggestListClass",2);ge([v({type:String,reflect:!0,attribute:"input-label"})],de.prototype,"inputLabel",2);ge([v({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],de.prototype,"disabled",2);ge([v({type:String,attribute:!0})],de.prototype,"validationMessage",2);ge([v({type:String,attribute:!0})],de.prototype,"validationIconSrc",2);ge([v({converter:dn.levelConverter,attribute:!0,reflect:!0})],de.prototype,"validationLevel",2);ge([v({type:String,reflect:!0,attribute:"token-type"})],de.prototype,"tokenType",2);ge([v({type:Boolean,reflect:!0,attribute:"case-sensitive"})],de.prototype,"caseSensitive",2);let lh=de;function or(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Kl(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Oi={exports:{}},U=String,ar=function(){return{isColorSupported:!1,reset:U,bold:U,dim:U,italic:U,underline:U,inverse:U,hidden:U,strikethrough:U,black:U,red:U,green:U,yellow:U,blue:U,magenta:U,cyan:U,white:U,gray:U,bgBlack:U,bgRed:U,bgGreen:U,bgYellow:U,bgBlue:U,bgMagenta:U,bgCyan:U,bgWhite:U}};Oi.exports=ar();Oi.exports.createColors=ar;var Zl=Oi.exports;const Xl={},Jl=Object.freeze(Object.defineProperty({__proto__:null,default:Xl},Symbol.toStringTag,{value:"Module"})),ye=Kl(Jl);let gs=Zl,ms=ye,ii=class lr extends Error{constructor(e,t,n,s,r,o){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),s&&(this.source=s),o&&(this.plugin=o),typeof t<"u"&&typeof n<"u"&&(typeof t=="number"?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,lr)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=gs.isColorSupported),ms&&e&&(t=ms(t));let n=t.split(/\r?\n/),s=Math.max(this.line-3,0),r=Math.min(this.line+2,n.length),o=String(r).length,a,l;if(e){let{bold:c,gray:d,red:h}=gs.createColors(!0);a=p=>c(h(p)),l=p=>d(p)}else a=l=c=>c;return n.slice(s,r).map((c,d)=>{let h=s+1+d,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let m=l(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+c+`
|
|
614
|
+
`}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable","true"),!this.hasAttribute("tabIndex")&&!this.disabled&&(this.tabIndex=0),this.addEventListener("focusout",t=>{const n=t.relatedTarget;!this.contains(n)&&!this.shadowRoot.contains(n)&&this.clearCheckedTokens()}),this.addEventListener("focusin",()=>{this.selectionMode=="remove-only"&&this.activeTokenIndex==-1&&this.items.length>0&&!this.disabled&&(this.activeTokenIndex=0)}),new Fl(this,()=>{var t;return(t=this.inputElement)==null?void 0:t.value},t=>this.selectOrAddItems(t)),new Wl(this,t=>this.selectOrAddItems(t))}clearCheckedTokens(){this.querySelectorAll("[slot='items'][aria-checked='true']").forEach(t=>t.checked=!1);const e=this.inputElement;e&&(e.removeAttribute("focus-visible"),e.removeAttribute("focused"))}removeSelectionOrActiveToken(){if(!this.disabled){const e=this.querySelectorAll("[slot='items'][aria-checked='true']");if(e.length>0){const t=Array.from(e);this.removeTokens(t.filter(n=>!n.disabled).map(n=>n.index))}else if(this.activeTokenIndex!=-1){const t=this.activeTokenElement;t&&!t.disabled&&this.removeTokens([t.index])}}}updateActiveToken(e){var n;if(this.disabled)return;const t=this.querySelectorAll("[slot='items']").length-1;if(this.activeTokenIndex==-1?e<0&&(this.activeTokenIndex=t):this.activeTokenIndex==t&&e>0&&this.selectionMode=="multi"?(this.activeTokenIndex=-1,this.focus()):this.activeTokenIndex=Math.max(0,Math.min(t,this.activeTokenIndex+e)),this.activeTokenIndex>-1&&((n=this.inputElement)==null||n.setAttribute("focus-visible",""),this.scrollHeight>this.offsetHeight)){const s=this.activeTokenElement;s.scrollIntoViewIfNeeded?s.scrollIntoViewIfNeeded():s.scrollIntoView()}}commitTokenValue(e){if(this.disabled)return;if(this.tokenSuggestPopover.isOpened){const n=this.tokenSuggestPopover.focusedSuggestToken;if(n){if(!n.disabled){const s=this.findIndex(n);this.handleTokenSelection([s]),this.tokenSuggestPopover.hide()}return}}if(!(e!=null&&e.trim()))return;const t=this.items.findIndex(n=>this.caseSensitive?n.caption==e:n.caption.toLowerCase()==e.toLowerCase());this.selectedIndexes.includes(t)||(t>=0?this.handleTokenSelection([t]):this.handleTokenCreation(e)),this.requestUpdate("selectedIndexes"),this.tokenSuggestPopover.hide(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updated(e){if(super.updated(e),this._tokenSuggestPopover&&(this.tokenSuggestPopover.list.className=this.suggestListClass||"",this.suggestionFilter&&(this.tokenSuggestPopover.filter=this.suggestionFilter)),e.has("selectionMode"))if(this.selectionMode=="multi"){this.setAttribute("aria-haspopup","listbox");const t=this.inputElement;t.addEventListener("immediate-value-change",n=>this.handleInputValueChange(n)),t.addEventListener("keydown",n=>this.handleInputKeyDown(n,t)),window.queueMicrotask(()=>this.tokenSuggestPopover)}else this.removeAttribute("aria-haspopup"),this.addEventListener("keydown",this.handleKeyDown),this._tokenSuggestPopover&&(this._tokenSuggestPopover.hide(),this._tokenSuggestPopover=null);(e.size==0||e.has("selectionMode")||e.has("items")||e.has("selectedIndexes")||e.has("disabled"))&&this.updateItems(),e.has("inputLabel")&&(this.inputLabel?this.setAttribute("aria-label",this.inputLabel):this.removeAttribute("aria-label"))}handleInputValueChange(e){e.detail.value?(this.activeTokenIndex=-1,this.cancelSearch=!1,this.debouncedShowTokenSuggestPopover(),window.addEventListener("pointerdown",this.handleWindowPointerDown)):(this.tokenSuggestPopover.hide(),this.cancelSearch=!0)}showFilteredTokenSuggestions(){!this.cancelSearch&&this.inputElement.value&&this.tokenSuggestPopover.show()}isTokenNotSelected(e){return!this.selectedIndexes.includes(e)}get tokenSuggestPopover(){return!this._tokenSuggestPopover&&this.inputElement&&(this._tokenSuggestPopover=new Ml(this.inputElement,()=>this.items.filter((e,t)=>!e.disabled&&this.isTokenNotSelected(t)),e=>{const t=this.findIndex(e);this.handleTokenSelection([t]),window.removeEventListener("pointerdown",this.handleWindowPointerDown)},e=>{this.appendChild(e.popover),this.inputElement.setAttribute("aria-controls",e.list.id),this.dispatchEvent(new CustomEvent("auto-suggest-initialized")),e.popover.addEventListener("close",()=>{this.inputElement.value&&!this.contains(document.activeElement)&&(this.inputElement.value="")})}),this._tokenSuggestPopover.list.itemGenerator=this._autoSuggestItemGenerator,this._tokenSuggestPopover.list.className=this.suggestListClass,this.suggestionFilter&&(this._tokenSuggestPopover.filter=this.suggestionFilter)),this._tokenSuggestPopover}updateItems(){if(!this.isConnected||!this.items)return;this.activeTokenIndex=-1;const e=this.inputElement;e&&(!this._tokenSuggestPopover||!this._tokenSuggestPopover.isOpened)&&(e.value=""),this.querySelectorAll("[slot='items']").forEach(s=>{this.removeChild(s)});const t=document.createDocumentFragment();let n=[];this.selectionMode=="remove-only"?n=this.items.map(s=>this.disableIfNeeded(s)):this.selectedIndexes.forEach(s=>{n.push(this.disableIfNeeded(this.items[s]))}),n.forEach(s=>{const r=this.tokenGenerator(s,this.findIndex(s));r.slot="items",t.appendChild(r),r.id||(r.id=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)),r.setClickHandler((o,a)=>this.onTokenClick(r,!0,a)),r.addEventListener("click",()=>{var a;(a=this.inputElement)==null||a.removeAttribute("focus-visible");const o=window.getSelection();(!o||o.type!="Range")&&document.activeElement!=this&&this.focus()}),r.setDeleteHandler(o=>this.removeTokens([o]))}),this.appendChild(t),this._tokenSuggestPopover&&this._tokenSuggestPopover.refreshItems()}removeTokens(e){if(!(this.disabled||e==null||e.length==0))if(this.activeTokenIndex!=-1&&e.includes(this.activeTokenElement.index)&&(this.activeTokenIndex=-1),this.selectionMode=="remove-only")this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:e}}));else{const t=e.filter(n=>this.selectedIndexes.includes(n));t.length>0&&(this.selectedIndexes=this.selectedIndexes.filter(n=>!t.includes(n)),this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:t,selectedIndices:[...this.selectedIndexes]}})))}}onTokenClick(e,t,n){let s;this.querySelectorAll("[slot='items']").forEach((r,o)=>{e==r?s=o:n||r.setAttribute("aria-checked","false")}),this.activeTokenIndex=s,this.setAttribute("aria-activedescendant",this.activeTokenElement.id),this._tokenSuggestPopover&&this._tokenSuggestPopover.isOpened&&this._tokenSuggestPopover.hide(),n||this.dispatchEvent(new CustomEvent("token-clicked",{detail:{index:e.index,tokenElement:e,byPointerDevice:t}}))}disableIfNeeded(e){return this.disabled?{...e,disabled:!0}:e}handleTokenSelection(e){this.selectedIndexes=this.selectedIndexes.concat(e),this.dispatchEvent(new CustomEvent("tokens-selected",{detail:{newIndices:e,selectedIndices:[...this.selectedIndexes]}}))}handleTokenCreation(e){this.dispatchEvent(new CustomEvent("token-created",{detail:{value:e}}))}get inputElement(){return this.shadowRoot.querySelector(".input")}get activeTokenElement(){return this.getTokenElement(this.activeTokenIndex)}getTokenElement(e){return this.querySelector("[slot='items']:nth-of-type("+(e+1)+")")}findIndex(e){return this.items.findIndex(t=>t.caption===e.caption)}get activeTokenIndex(){return this._activeTokenIndex}set activeTokenIndex(e){if(this._activeTokenIndex!=-1){const t=this.activeTokenElement;t&&(t.current=!1)}if(this._activeTokenIndex=e,e==-1)this.removeAttribute("aria-activedescendant");else{const t=this.activeTokenElement;t.current=!0,this.setAttribute("aria-activedescendant",t.id)}}get hasInputValue(){var e;return!!((e=this.inputElement)!=null&&e.value)}},Se.ID="sd-token-selector",Se.ensureDefined=()=>{In.ensureDefined(),customElements.get(Se.ID)||customElements.define(Se.ID,Se)},Se.shadowRootOptions={...ue.shadowRootOptions,delegatesFocus:!0},Se);ge([v({type:String,attribute:"selection-mode",reflect:!0})],de.prototype,"selectionMode",2);ge([v({type:Array,attribute:!1})],de.prototype,"items",2);ge([v({type:Array,attribute:!1})],de.prototype,"selectedIndexes",2);ge([v({type:String,reflect:!0})],de.prototype,"placeholder",2);ge([v({type:String,reflect:!0,attribute:"suggest-list-class"})],de.prototype,"suggestListClass",2);ge([v({type:String,reflect:!0,attribute:"input-label"})],de.prototype,"inputLabel",2);ge([v({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],de.prototype,"disabled",2);ge([v({type:String,attribute:!0})],de.prototype,"validationMessage",2);ge([v({type:String,attribute:!0})],de.prototype,"validationIconSrc",2);ge([v({converter:dn.levelConverter,attribute:!0,reflect:!0})],de.prototype,"validationLevel",2);ge([v({type:String,reflect:!0,attribute:"token-type"})],de.prototype,"tokenType",2);ge([v({type:Boolean,reflect:!0,attribute:"case-sensitive"})],de.prototype,"caseSensitive",2);let lh=de;function or(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Kl(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Oi={exports:{}},U=String,ar=function(){return{isColorSupported:!1,reset:U,bold:U,dim:U,italic:U,underline:U,inverse:U,hidden:U,strikethrough:U,black:U,red:U,green:U,yellow:U,blue:U,magenta:U,cyan:U,white:U,gray:U,bgBlack:U,bgRed:U,bgGreen:U,bgYellow:U,bgBlue:U,bgMagenta:U,bgCyan:U,bgWhite:U}};Oi.exports=ar();Oi.exports.createColors=ar;var Zl=Oi.exports;const Xl={},Jl=Object.freeze(Object.defineProperty({__proto__:null,default:Xl},Symbol.toStringTag,{value:"Module"})),ye=Kl(Jl);let gs=Zl,ms=ye,ii=class lr extends Error{constructor(e,t,n,s,r,o){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),s&&(this.source=s),o&&(this.plugin=o),typeof t<"u"&&typeof n<"u"&&(typeof t=="number"?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,lr)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=gs.isColorSupported),ms&&e&&(t=ms(t));let n=t.split(/\r?\n/),s=Math.max(this.line-3,0),r=Math.min(this.line+2,n.length),o=String(r).length,a,l;if(e){let{bold:c,gray:d,red:h}=gs.createColors(!0);a=p=>c(h(p)),l=p=>d(p)}else a=l=c=>c;return n.slice(s,r).map((c,d)=>{let h=s+1+d,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let m=l(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+c+`
|
|
615
615
|
`+m+a("^")}return" "+l(p)+c}).join(`
|
|
616
616
|
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
617
617
|
|
|
@@ -117,7 +117,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
117
117
|
</div>
|
|
118
118
|
`}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{let t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{let e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(o=>{if(o instanceof Pt){o.enableLineClamp=!1;let r=o.missingWidthForTexts;return r>e&&(o.enableLineClamp=!0),r}}),i=Math.max(...t);i>0&&(this.style.width=`${this.offsetWidth+i}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof Pt&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let e=[...this.querySelectorAll("[item-index]")],t=new Map,i=document.createDocumentFragment();for(let o of this._itemsRenderData){let r=this.renderItem(o);r.parentElement||i.appendChild(r),t.set(o.dataHash,r);let s=e.indexOf(r);s!==-1&&e.splice(s,1)}this.appendChild(i);for(let o of e)o instanceof Pt&&(o.enableLineClamp=!1),this.removeChild(o);t.forEach((o,r)=>{this._elementCache.set(r,o)})}renderItem({index:e,top:t,dataHash:i,data:o}){let r;return o?this._elementCache.has(i)?(r=this._elementCache.get(i),this._elementCache.delete(i)):(r=this.itemGenerator(o,e),r.setAttribute("slot","items")):(r=document.createElement("div"),r.setAttribute("placeholder-item",""),r.setAttribute("slot","items")),Object.assign(r.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),r.setAttribute("item-index",e.toString()),r.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),r.setAttribute("aria-posinset",String(e+1)),(!r.id||r.id.startsWith(this.id+"_item_"))&&(r.id=this.id+"_item_"+e),this.itemCount-1==e?r.setAttribute("last",""):r.removeAttribute("last"),this.updateSelectedAttribute(e,r),this.updateFocusedAttribute(e,r),r}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){let i=this.selectedIndices.indexOf(e)!==-1;i?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(i))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);let e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let i=e;i<=t;i++){let o=i-e,r=this.items[o],s;r?s=JSON.stringify(r):s=`placeholder-${o}`,this._itemsRenderData.push({index:i,top:this.itemHeight*i,physicalIndex:o,dataHash:s,data:r})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;let i=e%this._visibleItemsNum,o=this.items[i];if(!o||o.disabled)return;let r=!0;if(this.selectionType!=="trigger-only"){let s=this.selectedIndices.indexOf(e);r=s==-1,r?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(s,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,r,t)}dispatchSelectionEvent(e,t,i){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,hasModifier:i}}))}handleClick(e){let t=e.composedPath().find(i=>i.hasAttribute&&i.hasAttribute("item-index"));if(t){let i=parseInt(t.getAttribute("item-index"));if(Number.isInteger(i)){if(e.button==0||e.button==1){let o=e.type=="auxclick"&&e.button==1||e.metaKey||e.ctrlKey;this.handleSelection(i,o)}this.focusIndex=i}}}},yt.ID="sd-virtual-list",yt.ensureDefined=()=>{Pt.ensureDefined(),customElements.get(yt.ID)||customElements.define(yt.ID,yt)},yt);xt([h({type:Number,attribute:"item-height",reflect:!0})],ut.prototype,"itemHeight",2);xt([h({type:Number})],ut.prototype,"itemCount",2);xt([h({type:Array,attribute:!1})],ut.prototype,"items",2);xt([h({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],ut.prototype,"selectionType",2);xt([h({type:String,attribute:!0,reflect:!0})],ut.prototype,"id",2);xt([h({type:String,reflect:!0})],ut.prototype,"role",2);xt([h({type:Number,attribute:"focus-index",reflect:!0})],ut.prototype,"focusIndex",1);xt([h({type:Array,attribute:!1})],ut.prototype,"selectedIndices",1);var He=ut;He.ensureDefined();var Ue=class e{constructor(t,i){this.eventTarget=t,this.keydownHandler=i,this.catchedKeys=["Down","ArrowDown","Up","ArrowUp","Enter"],this.markAsFocusTargetHandler=()=>this.eventTarget.setAttribute("focus-target",""),this.unmarkAsFocusTargetHandler=()=>this.eventTarget.removeAttribute("focus-target"),this.delegateKeyDownEvent=o=>{if(this.catchedKeys.indexOf(o.key)!==-1){let r=o.key.toLocaleLowerCase(),s=0,n=r.includes("enter");n||(s=r.includes("down")?1:-1),this.keydownHandler(o,s,n),o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation()}}}static delegateTo(t){return new e(t,i=>t.dispatchEvent(new KeyboardEvent(i.type,i)))}connect(t){var i,o;if(t!=null){t.addEventListener("keydown",this.delegateKeyDownEvent),t.addEventListener("focus",this.markAsFocusTargetHandler),t.addEventListener("blur",this.unmarkAsFocusTargetHandler);let r=document.activeElement;(t.contains(r)||(o=(i=t.shadowRoot)==null?void 0:i.activeElement)!=null&&o.contains(r))&&this.markAsFocusTargetHandler()}}disconnect(t){t!=null&&(t.removeEventListener("keydown",this.delegateKeyDownEvent),t.removeEventListener("focus",this.markAsFocusTargetHandler),t.removeEventListener("blur",this.unmarkAsFocusTargetHandler),this.unmarkAsFocusTargetHandler())}};var be=class extends Lt{};be.directiveName="unsafeSVG",be.resultType=2;var Lo=Te(be);var Qr=0,Si=class{constructor(t,i,o,r){this.inputElement=t,this.notSelectedTokensProvider=i,this.initializeCallback=r,this.filter=(s,n)=>s?n.filter(a=>a.disabled||a.deactivated?!1:a.caption&&a.caption.toLowerCase().includes(s)):n,He.ensureDefined(),this._tokenList=new He,this._tokenList.id="sd_token_suggest_popover_list_"+Qr++,this._tokenList.style.minWidth="250px",this._tokenList.style.maxHeight="49vh",this._tokenList.itemHeight=50,this._tokenList.addEventListener("pointerdown",()=>{this.pointerDown=!0,window.addEventListener("pointerup",()=>{this.pointerDown=!1,this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.isUpdatePending||this._tokenList.requestUpdate()},{once:!0,capture:!0})}),this._tokenList.addEventListener("selection",s=>{let n=s.detail.index,a=this._suggestItems[n];o(a),this.hide()}),this._tokenList.addEventListener("data-request",s=>{this.lastRequestedStartIndex=s.detail.startIndex,this.lastRequestedStopIndex=s.detail.stopIndex,this.pointerDown||this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1)}),new Ue(this._tokenList,(s,n,a)=>{this._tokenList.dispatchEvent(new KeyboardEvent(s.type,s)),!a&&!this.isOpened&&this.show()}).connect(t)}show(){this.inputElement.effectiveDisabled||(this.popover,this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.focusIndex=-1,this._tokenList.style.width=null,requestAnimationFrame(()=>{this.lastRequestedStartIndex!=null&&(this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1))}),this.popover.show()))}refreshItems(){this.isOpened&&(this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.items=[],this._tokenList.style.width=null))}filterItems(t){let i=this.notSelectedTokensProvider();return this.filter(t,i)}hide(){var t;this._suggestItems=[],this._tokenList.itemCount=0,this._tokenList.items=[],(t=this._popover)==null||t.hide()}get list(){return this._tokenList}get popover(){return this._popover||(this._popover=this.createPopover(),this.initializeCallback(this)),this._popover}createPopover(){let t=new ge;return t.setAttribute("trigger-type","manual"),t.setAttribute("placement","bottom-start"),t.setAttribute("modal",""),t.setAttribute("popover-for","token-autosuggest-popover"),t.setAttribute("offset","-2"),t.targetElement=this.inputElement,t.appendChild(this._tokenList),t}get isOpened(){return this._popover&&this._popover.hasAttribute("open")}get focusedSuggestToken(){return this._suggestItems[this._tokenList.focusIndex]}},ts=`:host{flex-shrink:0;max-width:100%;height:28px}:host([aria-checked=true]){position:relative}:host([aria-checked=true]):before{content:"";position:absolute;left:0;top:0;height:12px;width:12px;background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20fill='none'%3e%3cpath%20stroke='%23FFF'%20stroke-width='2'%20d='M9%204%205%208%203%206'/%3e%3c/svg%3e") no-repeat center center}.container{display:flex;height:100%;background-color:var(--sd-token-background-color, #f3f3f3);border:var(--sd-token-focused-border, var(--sd-token-border));box-sizing:border-box}.container .icon-wrapper{display:flex;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:100%;overflow:hidden;background-color:var(--sd-token-icon-background-color, transparent)}.container .icon-wrapper .icon{height:100%;width:100%;object-fit:contain;background-size:cover;background-repeat:no-repeat;background-position:center}.container .value{display:inline-block;align-self:center;padding:0 8px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.container .delete-button-wrapper{display:flex;align-self:center;height:16px;width:16px;padding-right:8px;opacity:.5}.container .delete-button-wrapper:hover{cursor:pointer;filter:brightness(10%);opacity:1}`,es=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\r
|
|
119
119
|
<path d="m3.5 12.5 9-9m-9 0 9 9" style="fill:none;stroke:#333;stroke-linecap:square;stroke-width:1.1px"/>\r
|
|
120
|
-
</svg>`,is=Object.defineProperty,os=Object.getOwnPropertyDescriptor,_t=(e,t,i,o)=>{for(var r=o>1?void 0:o?os(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&is(t,i,r),r},Ci={fromAttribute:e=>e=="true",toAttribute:e=>e},Bt,ft=(Bt=class extends D{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return X(ts)}set checked(e){let t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",i=>{let o=window.getSelection();if(o&&o.type=="Range"
|
|
120
|
+
</svg>`,is=Object.defineProperty,os=Object.getOwnPropertyDescriptor,_t=(e,t,i,o)=>{for(var r=o>1?void 0:o?os(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&is(t,i,r),r},Ci={fromAttribute:e=>e=="true",toAttribute:e=>e},Bt,ft=(Bt=class extends D{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return X(ts)}set checked(e){let t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",i=>{let o=window.getSelection();if(o&&o.type=="Range")return;i.stopPropagation();let r=i.getModifierState("Control");this.disabled||(r?this.checked=!this.checked:this.checked=!0),this._tokenClickHandler&&this._tokenClickHandler(this.index,r)});let t=this.shadowRoot.querySelector(".delete-button-wrapper");t&&t.addEventListener("click",i=>{i.stopPropagation(),this._tokenDeleteHandler&&this._tokenDeleteHandler(this.index)})}render(){return E`
|
|
121
121
|
<div class="container">
|
|
122
122
|
<slot name="before-icon"></slot>
|
|
123
123
|
${this.renderIcon()}
|
|
@@ -153,7 +153,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
153
153
|
><div class="token-wrapper" slot="prefix"><slot name="items"></slot></div>
|
|
154
154
|
</sd-lit-input>
|
|
155
155
|
<slot class="additonal-content" name="additional-content" @focusin=${this.clearCheckedTokens}></slot>
|
|
156
|
-
`}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable","true"),!this.hasAttribute("tabIndex")&&!this.disabled&&(this.tabIndex=0),this.addEventListener("focusout",t=>{let i=t.relatedTarget;!this.contains(i)&&!this.shadowRoot.contains(i)&&this.clearCheckedTokens()}),this.addEventListener("focusin",()=>{this.selectionMode=="remove-only"&&this.activeTokenIndex==-1&&this.items.length>0&&!this.disabled&&(this.activeTokenIndex=0)}),new Ii(this,()=>{var t;return(t=this.inputElement)==null?void 0:t.value},t=>this.selectOrAddItems(t)),new $i(this,t=>this.selectOrAddItems(t))}clearCheckedTokens(){this.querySelectorAll("[slot='items'][aria-checked='true']").forEach(t=>t.checked=!1);let e=this.inputElement;e&&(e.removeAttribute("focus-visible"),e.removeAttribute("focused"))}removeSelectionOrActiveToken(){if(!this.disabled){let e=this.querySelectorAll("[slot='items'][aria-checked='true']");if(e.length>0){let t=Array.from(e);this.removeTokens(t.filter(i=>!i.disabled).map(i=>i.index))}else if(this.activeTokenIndex!=-1){let t=this.activeTokenElement;t&&!t.disabled&&this.removeTokens([t.index])}}}updateActiveToken(e){var t;if(this.disabled)return;let i=this.querySelectorAll("[slot='items']").length-1;if(this.activeTokenIndex==-1?e<0&&(this.activeTokenIndex=i):this.activeTokenIndex==i&&e>0&&this.selectionMode=="multi"?(this.activeTokenIndex=-1,this.focus()):this.activeTokenIndex=Math.max(0,Math.min(i,this.activeTokenIndex+e)),this.activeTokenIndex>-1&&((t=this.inputElement)==null||t.setAttribute("focus-visible",""),this.scrollHeight>this.offsetHeight)){let o=this.activeTokenElement;o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o.scrollIntoView()}}commitTokenValue(e){if(this.disabled)return;if(this.tokenSuggestPopover.isOpened){let i=this.tokenSuggestPopover.focusedSuggestToken;if(i){if(!i.disabled){let o=this.findIndex(i);this.handleTokenSelection([o]),this.tokenSuggestPopover.hide()}return}}if(!(e!=null&&e.trim()))return;let t=this.items.findIndex(i=>this.caseSensitive?i.caption==e:i.caption.toLowerCase()==e.toLowerCase());this.selectedIndexes.includes(t)||(t>=0?this.handleTokenSelection([t]):this.handleTokenCreation(e)),this.requestUpdate("selectedIndexes"),this.tokenSuggestPopover.hide(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updated(e){if(super.updated(e),this._tokenSuggestPopover&&(this.tokenSuggestPopover.list.className=this.suggestListClass||"",this.suggestionFilter&&(this.tokenSuggestPopover.filter=this.suggestionFilter)),e.has("selectionMode"))if(this.selectionMode=="multi"){this.setAttribute("aria-haspopup","listbox");let t=this.inputElement;t.addEventListener("immediate-value-change",i=>this.handleInputValueChange(i)),t.addEventListener("keydown",i=>this.handleInputKeyDown(i,t)),window.queueMicrotask(()=>this.tokenSuggestPopover)}else this.removeAttribute("aria-haspopup"),this.addEventListener("keydown",this.handleKeyDown),this._tokenSuggestPopover&&(this._tokenSuggestPopover.
|
|
156
|
+
`}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable","true"),!this.hasAttribute("tabIndex")&&!this.disabled&&(this.tabIndex=0),this.addEventListener("focusout",t=>{let i=t.relatedTarget;!this.contains(i)&&!this.shadowRoot.contains(i)&&this.clearCheckedTokens()}),this.addEventListener("focusin",()=>{this.selectionMode=="remove-only"&&this.activeTokenIndex==-1&&this.items.length>0&&!this.disabled&&(this.activeTokenIndex=0)}),new Ii(this,()=>{var t;return(t=this.inputElement)==null?void 0:t.value},t=>this.selectOrAddItems(t)),new $i(this,t=>this.selectOrAddItems(t))}clearCheckedTokens(){this.querySelectorAll("[slot='items'][aria-checked='true']").forEach(t=>t.checked=!1);let e=this.inputElement;e&&(e.removeAttribute("focus-visible"),e.removeAttribute("focused"))}removeSelectionOrActiveToken(){if(!this.disabled){let e=this.querySelectorAll("[slot='items'][aria-checked='true']");if(e.length>0){let t=Array.from(e);this.removeTokens(t.filter(i=>!i.disabled).map(i=>i.index))}else if(this.activeTokenIndex!=-1){let t=this.activeTokenElement;t&&!t.disabled&&this.removeTokens([t.index])}}}updateActiveToken(e){var t;if(this.disabled)return;let i=this.querySelectorAll("[slot='items']").length-1;if(this.activeTokenIndex==-1?e<0&&(this.activeTokenIndex=i):this.activeTokenIndex==i&&e>0&&this.selectionMode=="multi"?(this.activeTokenIndex=-1,this.focus()):this.activeTokenIndex=Math.max(0,Math.min(i,this.activeTokenIndex+e)),this.activeTokenIndex>-1&&((t=this.inputElement)==null||t.setAttribute("focus-visible",""),this.scrollHeight>this.offsetHeight)){let o=this.activeTokenElement;o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o.scrollIntoView()}}commitTokenValue(e){if(this.disabled)return;if(this.tokenSuggestPopover.isOpened){let i=this.tokenSuggestPopover.focusedSuggestToken;if(i){if(!i.disabled){let o=this.findIndex(i);this.handleTokenSelection([o]),this.tokenSuggestPopover.hide()}return}}if(!(e!=null&&e.trim()))return;let t=this.items.findIndex(i=>this.caseSensitive?i.caption==e:i.caption.toLowerCase()==e.toLowerCase());this.selectedIndexes.includes(t)||(t>=0?this.handleTokenSelection([t]):this.handleTokenCreation(e)),this.requestUpdate("selectedIndexes"),this.tokenSuggestPopover.hide(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updated(e){if(super.updated(e),this._tokenSuggestPopover&&(this.tokenSuggestPopover.list.className=this.suggestListClass||"",this.suggestionFilter&&(this.tokenSuggestPopover.filter=this.suggestionFilter)),e.has("selectionMode"))if(this.selectionMode=="multi"){this.setAttribute("aria-haspopup","listbox");let t=this.inputElement;t.addEventListener("immediate-value-change",i=>this.handleInputValueChange(i)),t.addEventListener("keydown",i=>this.handleInputKeyDown(i,t)),window.queueMicrotask(()=>this.tokenSuggestPopover)}else this.removeAttribute("aria-haspopup"),this.addEventListener("keydown",this.handleKeyDown),this._tokenSuggestPopover&&(this._tokenSuggestPopover.hide(),this._tokenSuggestPopover=null);(e.size==0||e.has("selectionMode")||e.has("items")||e.has("selectedIndexes")||e.has("disabled"))&&this.updateItems(),e.has("inputLabel")&&(this.inputLabel?this.setAttribute("aria-label",this.inputLabel):this.removeAttribute("aria-label"))}handleInputValueChange(e){e.detail.value?(this.activeTokenIndex=-1,this.cancelSearch=!1,this.debouncedShowTokenSuggestPopover(),window.addEventListener("pointerdown",this.handleWindowPointerDown)):(this.tokenSuggestPopover.hide(),this.cancelSearch=!0)}showFilteredTokenSuggestions(){!this.cancelSearch&&this.inputElement.value&&this.tokenSuggestPopover.show()}isTokenNotSelected(e){return!this.selectedIndexes.includes(e)}get tokenSuggestPopover(){return!this._tokenSuggestPopover&&this.inputElement&&(this._tokenSuggestPopover=new Si(this.inputElement,()=>this.items.filter((e,t)=>!e.disabled&&this.isTokenNotSelected(t)),e=>{let t=this.findIndex(e);this.handleTokenSelection([t]),window.removeEventListener("pointerdown",this.handleWindowPointerDown)},e=>{this.appendChild(e.popover),this.inputElement.setAttribute("aria-controls",e.list.id),this.dispatchEvent(new CustomEvent("auto-suggest-initialized")),e.popover.addEventListener("close",()=>{this.inputElement.value&&!this.contains(document.activeElement)&&(this.inputElement.value="")})}),this._tokenSuggestPopover.list.itemGenerator=this._autoSuggestItemGenerator,this._tokenSuggestPopover.list.className=this.suggestListClass,this.suggestionFilter&&(this._tokenSuggestPopover.filter=this.suggestionFilter)),this._tokenSuggestPopover}updateItems(){if(!this.isConnected||!this.items)return;this.activeTokenIndex=-1;let e=this.inputElement;e&&(!this._tokenSuggestPopover||!this._tokenSuggestPopover.isOpened)&&(e.value=""),this.querySelectorAll("[slot='items']").forEach(o=>{this.removeChild(o)});let t=document.createDocumentFragment(),i=[];this.selectionMode=="remove-only"?i=this.items.map(o=>this.disableIfNeeded(o)):this.selectedIndexes.forEach(o=>{i.push(this.disableIfNeeded(this.items[o]))}),i.forEach(o=>{let r=this.tokenGenerator(o,this.findIndex(o));r.slot="items",t.appendChild(r),r.id||(r.id=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)),r.setClickHandler((s,n)=>this.onTokenClick(r,!0,n)),r.addEventListener("click",()=>{var s;(s=this.inputElement)==null||s.removeAttribute("focus-visible");let n=window.getSelection();(!n||n.type!="Range")&&document.activeElement!=this&&this.focus()}),r.setDeleteHandler(s=>this.removeTokens([s]))}),this.appendChild(t),this._tokenSuggestPopover&&this._tokenSuggestPopover.refreshItems()}removeTokens(e){if(!(this.disabled||e==null||e.length==0))if(this.activeTokenIndex!=-1&&e.includes(this.activeTokenElement.index)&&(this.activeTokenIndex=-1),this.selectionMode=="remove-only")this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:e}}));else{let t=e.filter(i=>this.selectedIndexes.includes(i));t.length>0&&(this.selectedIndexes=this.selectedIndexes.filter(i=>!t.includes(i)),this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:t,selectedIndices:[...this.selectedIndexes]}})))}}onTokenClick(e,t,i){let o;this.querySelectorAll("[slot='items']").forEach((r,s)=>{e==r?o=s:i||r.setAttribute("aria-checked","false")}),this.activeTokenIndex=o,this.setAttribute("aria-activedescendant",this.activeTokenElement.id),this._tokenSuggestPopover&&this._tokenSuggestPopover.isOpened&&this._tokenSuggestPopover.hide(),i||this.dispatchEvent(new CustomEvent("token-clicked",{detail:{index:e.index,tokenElement:e,byPointerDevice:t}}))}disableIfNeeded(e){return this.disabled?{...e,disabled:!0}:e}handleTokenSelection(e){this.selectedIndexes=this.selectedIndexes.concat(e),this.dispatchEvent(new CustomEvent("tokens-selected",{detail:{newIndices:e,selectedIndices:[...this.selectedIndexes]}}))}handleTokenCreation(e){this.dispatchEvent(new CustomEvent("token-created",{detail:{value:e}}))}get inputElement(){return this.shadowRoot.querySelector(".input")}get activeTokenElement(){return this.getTokenElement(this.activeTokenIndex)}getTokenElement(e){return this.querySelector("[slot='items']:nth-of-type("+(e+1)+")")}findIndex(e){return this.items.findIndex(t=>t.caption===e.caption)}get activeTokenIndex(){return this._activeTokenIndex}set activeTokenIndex(e){if(this._activeTokenIndex!=-1){let t=this.activeTokenElement;t&&(t.current=!1)}if(this._activeTokenIndex=e,e==-1)this.removeAttribute("aria-activedescendant");else{let t=this.activeTokenElement;t.current=!0,this.setAttribute("aria-activedescendant",t.id)}}get hasInputValue(){var e;return!!((e=this.inputElement)!=null&&e.value)}},wt.ID="sd-token-selector",wt.ensureDefined=()=>{qe.ensureDefined(),customElements.get(wt.ID)||customElements.define(wt.ID,wt)},wt.shadowRootOptions={...D.shadowRootOptions,delegatesFocus:!0},wt);tt([h({type:String,attribute:"selection-mode",reflect:!0})],Y.prototype,"selectionMode",2);tt([h({type:Array,attribute:!1})],Y.prototype,"items",2);tt([h({type:Array,attribute:!1})],Y.prototype,"selectedIndexes",2);tt([h({type:String,reflect:!0})],Y.prototype,"placeholder",2);tt([h({type:String,reflect:!0,attribute:"suggest-list-class"})],Y.prototype,"suggestListClass",2);tt([h({type:String,reflect:!0,attribute:"input-label"})],Y.prototype,"inputLabel",2);tt([h({converter:{fromAttribute:e=>e=="true",toAttribute:e=>e},reflect:!0,attribute:"aria-disabled"})],Y.prototype,"disabled",2);tt([h({type:String,attribute:!0})],Y.prototype,"validationMessage",2);tt([h({type:String,attribute:!0})],Y.prototype,"validationIconSrc",2);tt([h({converter:de.levelConverter,attribute:!0,reflect:!0})],Y.prototype,"validationLevel",2);tt([h({type:String,reflect:!0,attribute:"token-type"})],Y.prototype,"tokenType",2);tt([h({type:Boolean,reflect:!0,attribute:"case-sensitive"})],Y.prototype,"caseSensitive",2);var ls=Y;return jo(ds);})();
|
|
157
157
|
/*! Bundled license information:
|
|
158
158
|
|
|
159
159
|
@lit/reactive-element/css-tag.js:
|