UNPKG

@nuralyui/select

Version:

A comprehensive select component with advanced features including multi-selection, keyboard navigation, validation, and accessibility support.

705 lines (619 loc) 92.4 kB
/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;class o{constructor(t,e,s){if(this._$cssResult$=!0,s!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=s.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&s.set(i,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new o(s,t,i)},l=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,i))(e)})(t):t /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */;var n;const c=window,a=c.trustedTypes,h=a?a.emptyScript:"",d=c.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},p=(t,e)=>e!==t&&(e==e||t==t),v={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:p},b="finalized";class y extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Ep(i,e);void 0!==s&&(this._$Ev.set(s,i),t.push(s))})),t}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(b))return!1;this[b]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var i;const s=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,s)=>{e?i.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((e=>{const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=e.cssText,i.appendChild(s)}))})(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=v){var s;const o=this.constructor._$Ep(t,i);if(void 0!==o&&!0===i.reflect){const r=(void 0!==(null===(s=i.converter)||void 0===s?void 0:s.toAttribute)?i.converter:u).toAttribute(e,i.type);this._$El=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null}}_$AK(t,e){var i;const s=this.constructor,o=s._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:u;this._$El=o,this[o]=r.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var f;y[b]=!0,y.elementProperties=new Map,y.elementStyles=[],y.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:y}),(null!==(n=c.reactiveElementVersions)&&void 0!==n?n:c.reactiveElementVersions=[]).push("1.6.3");const g=window,m=g.trustedTypes,w=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,x="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,k="?"+$,E=`<${k}>`,S=document,O=()=>S.createComment(""),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,z=Array.isArray,C="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,D=/>/g,I=RegExp(`>|${C}(?:([^\\s"'>=/]+)(${C}*=${C}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,R=/"/g,L=/^(?:script|style|textarea|title)$/i,P=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),F=new WeakMap,M=S.createTreeWalker(S,129,null,!1);function j(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(e):e}class V{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const l=t.length-1,n=this.parts,[c,a]=((t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":"",l=T;for(let e=0;e<i;e++){const i=t[e];let n,c,a=-1,h=0;for(;h<i.length&&(l.lastIndex=h,c=l.exec(i),null!==c);)h=l.lastIndex,l===T?"!--"===c[1]?l=_:void 0!==c[1]?l=D:void 0!==c[2]?(L.test(c[2])&&(o=RegExp("</"+c[2],"g")),l=I):void 0!==c[3]&&(l=I):l===I?">"===c[0]?(l=null!=o?o:T,a=-1):void 0===c[1]?a=-2:(a=l.lastIndex-c[2].length,n=c[1],l=void 0===c[3]?I:'"'===c[3]?R:N):l===R||l===N?l=I:l===_||l===D?l=T:(l=I,o=void 0);const d=l===I&&t[e+1].startsWith("/>")?" ":"";r+=l===T?i+E:a>=0?(s.push(n),i.slice(0,a)+x+i.slice(a)+$+d):i+$+(-2===a?(s.push(void 0),e):d)}return[j(t,r+(t[i]||"<?>")+(2===e?"</svg>":"")),s]})(t,e);if(this.el=V.createElement(c,i),M.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=M.nextNode())&&n.length<l;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith(x)||e.startsWith($)){const i=a[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+x).split($),e=/([.?@])?(.*)/.exec(i);n.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?K:"?"===e[1]?Y:"@"===e[1]?Z:G})}else n.push({type:6,index:o})}for(const e of t)s.removeAttribute(e)}if(L.test(s.tagName)){const t=s.textContent.split($),e=t.length-1;if(e>0){s.textContent=m?m.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],O()),M.nextNode(),n.push({type:2,index:++o});s.append(t[e],O())}}}else if(8===s.nodeType)if(s.data===k)n.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf($,t+1));)n.push({type:7,index:o}),t+=$.length-1}o++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function B(t,e,i=t,s){var o,r,l,n;if(e===P)return e;let c=void 0!==s?null===(o=i._$Co)||void 0===o?void 0:o[s]:i._$Cl;const a=A(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(r=null==c?void 0:c._$AO)||void 0===r||r.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,i,s)),void 0!==s?(null!==(l=(n=i)._$Co)&&void 0!==l?l:n._$Co=[])[s]=c:i._$Cl=c),void 0!==c&&(e=B(t,c._$AS(t,e.values),c,s)),e}class H{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);M.currentNode=o;let r=M.nextNode(),l=0,n=0,c=s[0];for(;void 0!==c;){if(l===c.index){let e;2===c.type?e=new W(r,r.nextSibling,this,t):1===c.type?e=new c.ctor(r,c.name,c.strings,this,t):6===c.type&&(e=new Q(r,this,t)),this._$AV.push(e),c=s[++n]}l!==(null==c?void 0:c.index)&&(r=M.nextNode(),l++)}return M.currentNode=S,o}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class W{constructor(t,e,i,s){var o;this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cp=null===(o=null==s?void 0:s.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),A(t)?t===U||null==t||""===t?(this._$AH!==U&&this._$AR(),this._$AH=U):t!==this._$AH&&t!==P&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>z(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==U&&A(this._$AH)?this._$AA.nextSibling.data=t:this.$(S.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=V.createElement(j(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.v(i);else{const t=new H(o,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=F.get(t.strings);return void 0===e&&F.set(t.strings,e=new V(t)),e}T(t){z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new W(this.k(O()),this.k(O()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class G{constructor(t,e,i,s,o){this.type=1,this._$AH=U,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=U}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=B(this,t,e,0),r=!A(t)||t!==this._$AH&&t!==P,r&&(this._$AH=t);else{const s=t;let l,n;for(t=o[0],l=0;l<o.length-1;l++)n=B(this,s[i+l],e,l),n===P&&(n=this._$AH[l]),r||(r=!A(n)||n!==this._$AH[l]),n===U?t=U:t!==U&&(t+=(null!=n?n:"")+o[l+1]),this._$AH[l]=n}r&&!s&&this.j(t)}j(t){t===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class K extends G{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===U?void 0:t}}const q=m?m.emptyScript:"";class Y extends G{constructor(){super(...arguments),this.type=4}j(t){t&&t!==U?this.element.setAttribute(this.name,q):this.element.removeAttribute(this.name)}}class Z extends G{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=B(this,t,e,0))&&void 0!==i?i:U)===P)return;const s=this._$AH,o=t===U&&s!==U||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==U&&(s===U||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const X=g.litHtmlPolyfillSupport; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var J;null==X||X(V,W),(null!==(f=g.litHtmlVersions)&&void 0!==f?f:g.litHtmlVersions=[]).push("2.8.0");const tt=window,et=tt.trustedTypes,it=et?et.createPolicy("lit-html",{createHTML:t=>t}):void 0,st="$lit$",ot=`lit$${(Math.random()+"").slice(9)}$`,rt="?"+ot,lt=`<${rt}>`,nt=document,ct=()=>nt.createComment(""),at=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ht=Array.isArray,dt="[ \t\n\f\r]",ut=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pt=/-->/g,vt=/>/g,bt=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),yt=/'/g,ft=/"/g,gt=/^(?:script|style|textarea|title)$/i,mt=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),wt=Symbol.for("lit-noChange"),xt=Symbol.for("lit-nothing"),$t=new WeakMap,kt=nt.createTreeWalker(nt,129,null,!1);function Et(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==it?it.createHTML(e):e}const St=(t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":"",l=ut;for(let e=0;e<i;e++){const i=t[e];let n,c,a=-1,h=0;for(;h<i.length&&(l.lastIndex=h,c=l.exec(i),null!==c);)h=l.lastIndex,l===ut?"!--"===c[1]?l=pt:void 0!==c[1]?l=vt:void 0!==c[2]?(gt.test(c[2])&&(o=RegExp("</"+c[2],"g")),l=bt):void 0!==c[3]&&(l=bt):l===bt?">"===c[0]?(l=null!=o?o:ut,a=-1):void 0===c[1]?a=-2:(a=l.lastIndex-c[2].length,n=c[1],l=void 0===c[3]?bt:'"'===c[3]?ft:yt):l===ft||l===yt?l=bt:l===pt||l===vt?l=ut:(l=bt,o=void 0);const d=l===bt&&t[e+1].startsWith("/>")?" ":"";r+=l===ut?i+lt:a>=0?(s.push(n),i.slice(0,a)+st+i.slice(a)+ot+d):i+ot+(-2===a?(s.push(void 0),e):d)}return[Et(t,r+(t[i]||"<?>")+(2===e?"</svg>":"")),s]};class Ot{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const l=t.length-1,n=this.parts,[c,a]=St(t,e);if(this.el=Ot.createElement(c,i),kt.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=kt.nextNode())&&n.length<l;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith(st)||e.startsWith(ot)){const i=a[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+st).split(ot),e=/([.?@])?(.*)/.exec(i);n.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?_t:"?"===e[1]?It:"@"===e[1]?Nt:Tt})}else n.push({type:6,index:o})}for(const e of t)s.removeAttribute(e)}if(gt.test(s.tagName)){const t=s.textContent.split(ot),e=t.length-1;if(e>0){s.textContent=et?et.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],ct()),kt.nextNode(),n.push({type:2,index:++o});s.append(t[e],ct())}}}else if(8===s.nodeType)if(s.data===rt)n.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(ot,t+1));)n.push({type:7,index:o}),t+=ot.length-1}o++}}static createElement(t,e){const i=nt.createElement("template");return i.innerHTML=t,i}}function At(t,e,i=t,s){var o,r,l,n;if(e===wt)return e;let c=void 0!==s?null===(o=i._$Co)||void 0===o?void 0:o[s]:i._$Cl;const a=at(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(r=null==c?void 0:c._$AO)||void 0===r||r.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,i,s)),void 0!==s?(null!==(l=(n=i)._$Co)&&void 0!==l?l:n._$Co=[])[s]=c:i._$Cl=c),void 0!==c&&(e=At(t,c._$AS(t,e.values),c,s)),e}class zt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:nt).importNode(i,!0);kt.currentNode=o;let r=kt.nextNode(),l=0,n=0,c=s[0];for(;void 0!==c;){if(l===c.index){let e;2===c.type?e=new Ct(r,r.nextSibling,this,t):1===c.type?e=new c.ctor(r,c.name,c.strings,this,t):6===c.type&&(e=new Rt(r,this,t)),this._$AV.push(e),c=s[++n]}l!==(null==c?void 0:c.index)&&(r=kt.nextNode(),l++)}return kt.currentNode=nt,o}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Ct{constructor(t,e,i,s){var o;this.type=2,this._$AH=xt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cp=null===(o=null==s?void 0:s.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=At(this,t,e),at(t)?t===xt||null==t||""===t?(this._$AH!==xt&&this._$AR(),this._$AH=xt):t!==this._$AH&&t!==wt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ht(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==xt&&at(this._$AH)?this._$AA.nextSibling.data=t:this.$(nt.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Ot.createElement(Et(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.v(i);else{const t=new zt(o,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=$t.get(t.strings);return void 0===e&&$t.set(t.strings,e=new Ot(t)),e}T(t){ht(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new Ct(this.k(ct()),this.k(ct()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Tt{constructor(t,e,i,s,o){this.type=1,this._$AH=xt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=xt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=At(this,t,e,0),r=!at(t)||t!==this._$AH&&t!==wt,r&&(this._$AH=t);else{const s=t;let l,n;for(t=o[0],l=0;l<o.length-1;l++)n=At(this,s[i+l],e,l),n===wt&&(n=this._$AH[l]),r||(r=!at(n)||n!==this._$AH[l]),n===xt?t=xt:t!==xt&&(t+=(null!=n?n:"")+o[l+1]),this._$AH[l]=n}r&&!s&&this.j(t)}j(t){t===xt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class _t extends Tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===xt?void 0:t}}const Dt=et?et.emptyScript:"";class It extends Tt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==xt?this.element.setAttribute(this.name,Dt):this.element.removeAttribute(this.name)}}class Nt extends Tt{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=At(this,t,e,0))&&void 0!==i?i:xt)===wt)return;const s=this._$AH,o=t===xt&&s!==xt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==xt&&(s===xt||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){At(this,t)}}const Lt=tt.litHtmlPolyfillSupport;null==Lt||Lt(Ot,Ct),(null!==(J=tt.litHtmlVersions)&&void 0!==J?J:tt.litHtmlVersions=[]).push("2.8.0"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var Pt,Ut;class Ft extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var s,o;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let l=r._$litPart$;if(void 0===l){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;r._$litPart$=l=new Ct(e.insertBefore(ct(),t),t,void 0,null!=i?i:{})}return l._$AI(t),l})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return wt}}Ft.finalized=!0,Ft._$litElement$=!0,null===(Pt=globalThis.litElementHydrateSupport)||void 0===Pt||Pt.call(globalThis,{LitElement:Ft});const Mt=globalThis.litElementPolyfillSupport;null==Mt||Mt({LitElement:Ft}),(null!==(Ut=globalThis.litElementVersions)&&void 0!==Ut?Ut:globalThis.litElementVersions=[]).push("3.3.3"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const jt=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function Vt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):jt(t,e) /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function Bt(t,e){return(({finisher:t,descriptor:e})=>(i,s)=>{var o;if(void 0===s){const s=null!==(o=i.originalKey)&&void 0!==o?o:i.key,r=null!=e?{kind:"method",placement:"prototype",key:s,descriptor:e(i.key)}:{...i,key:s};return null!=t&&(r.finisher=function(e){t(e,s)}),r}{const o=i.constructor;void 0!==e&&Object.defineProperty(i,s,e(s)),null==t||t(o,s)}})({descriptor:i=>{const s={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;s.get=function(){var i,s;return void 0===this[e]&&(this[e]=null!==(s=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==s?s:null),this[e]}}return s}})} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */var Ht;null===(Ht=window.HTMLSlotElement)||void 0===Ht||Ht.prototype.assignedElements;const Wt=r` ${r` :host { /* Layout and sizing */ --hybrid-select-local-width: 300px; --hybrid-select-local-min-height: 40px; --hybrid-select-local-padding-top: 8px; --hybrid-select-local-padding-bottom: 8px; --hybrid-select-local-padding-left: 12px; --hybrid-select-local-padding-right: 12px; --hybrid-select-local-wrapper-margin: 0; --hybrid-select-local-border-radius: 6px; --hybrid-select-local-border-width: 1px; /* Colors - Light theme defaults */ --hybrid-select-local-background-color: #ffffff; --hybrid-select-local-border-color: #d9d9d9; --hybrid-select-local-text-color: #262626; --hybrid-select-local-placeholder-color: #8c8c8c; --hybrid-select-local-hover-border-color: #1677ff; --hybrid-select-local-focus-border-color: #1677ff; --hybrid-select-local-error-border-color: #da1e28; --hybrid-select-local-warning-border-color: #f0c300; --hybrid-select-local-success-border-color: #52c41a; /* Dropdown colors */ --hybrid-select-local-dropdown-background: #ffffff; --hybrid-select-local-dropdown-border-color: #d9d9d9; --hybrid-select-local-dropdown-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08); --hybrid-select-local-dropdown-z-index: 9999; --hybrid-select-local-dropdown-max-height: 200px; --hybrid-select-local-option-hover-background: #f5f5f5; --hybrid-select-local-option-selected-background: #e6f7ff; --hybrid-select-local-option-selected-color: #1677ff; /* Typography */ --hybrid-select-local-font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif; --hybrid-select-local-font-size: 14px; --hybrid-select-local-line-height: 1.5; --hybrid-select-local-placeholder-font-size: 14px; --hybrid-select-local-option-font-size: 14px; /* Icon settings */ --hybrid-select-local-icon-size: 16px; --hybrid-select-local-icon-color: #8c8c8c; --hybrid-select-local-icon-hover-color: #1677ff; --hybrid-select-local-arrow-icon-size: 12px; /* Sizes */ --hybrid-select-local-small-height: 24px; --hybrid-select-local-small-font-size: 12px; --hybrid-select-local-small-padding: 4px 8px; --hybrid-select-local-medium-height: 32px; --hybrid-select-local-medium-font-size: 14px; --hybrid-select-local-medium-padding: 4px 12px; --hybrid-select-local-large-height: 40px; --hybrid-select-local-large-font-size: 16px; --hybrid-select-local-large-padding: 6px 12px; /* States */ --hybrid-select-local-disabled-opacity: 0.5; --hybrid-select-local-disabled-background: #f5f5f5; --hybrid-select-local-disabled-border-color: #d9d9d9; --hybrid-select-local-disabled-text-color: #8c8c8c; /* Animation and transitions */ --hybrid-select-local-transition-duration: 0.2s; --hybrid-select-local-transition-timing: ease-in-out; --hybrid-select-local-dropdown-animation-duration: 0.15s; /* Multi-select specific */ --hybrid-select-local-tag-background: #f0f0f0; --hybrid-select-local-tag-color: #262626; --hybrid-select-local-tag-border-radius: 4px; --hybrid-select-local-tag-padding: 2px 6px; --hybrid-select-local-tag-margin: 2px; --hybrid-select-local-tag-close-color: #8c8c8c; --hybrid-select-local-tag-close-hover-color: #da1e28; /* Validation message */ --hybrid-select-local-message-font-size: 12px; --hybrid-select-local-message-margin-top: 4px; --hybrid-select-local-error-message-color: #da1e28; --hybrid-select-local-warning-message-color: #f0c300; --hybrid-select-local-success-message-color: #52c41a; } `} :host { width: fit-content; display: block; font-family: var(--hybrid-select-font-family, var(--hybrid-select-local-font-family)); font-size: var(--hybrid-select-font-size, var(--hybrid-select-local-font-size)); line-height: var(--hybrid-select-line-height, var(--hybrid-select-local-line-height)); margin: var(--hybrid-select-margin, var(--hybrid-select-local-wrapper-margin)); } /* Host attribute selectors for configuration */ :host([disabled]) { opacity: var(--hybrid-select-disabled-opacity, var(--hybrid-select-local-disabled-opacity)); pointer-events: none; } :host([disabled]) .wrapper { background-color: var(--hybrid-select-disabled-background, var(--hybrid-select-local-disabled-background)); border-color: var(--hybrid-select-disabled-border-color, var(--hybrid-select-local-disabled-border-color)); color: var(--hybrid-select-disabled-text-color, var(--hybrid-select-local-disabled-text-color)); cursor: not-allowed; } /* * Light theme styles using data-theme attribute on wrapper element * These are explicit light theme overrides when data-theme="light" is applied */ .wrapper[data-theme="light"] { /* Select wrapper light theme overrides */ --hybrid-select-local-background-color: #ffffff; --hybrid-select-local-border-color: #d9d9d9; --hybrid-select-local-text-color: #262626; --hybrid-select-local-placeholder-color: #8c8c8c; --hybrid-select-local-hover-border-color: #1677ff; --hybrid-select-local-focus-border-color: #1677ff; /* Dropdown light theme overrides */ --hybrid-select-local-dropdown-background: #ffffff; --hybrid-select-local-dropdown-border-color: #d9d9d9; --hybrid-select-local-option-hover-background: #f5f5f5; --hybrid-select-local-option-selected-background: #e6f7ff; --hybrid-select-local-option-selected-color: #1677ff; /* Tag styles for multi-select light theme */ --hybrid-select-local-tag-background: #f0f0f0; --hybrid-select-local-tag-color: #262626; --hybrid-select-local-tag-close-color: #8c8c8c; --hybrid-select-local-tag-close-hover-color: #da1e28; /* Icon colors for light theme */ --hybrid-select-local-icon-color: #8c8c8c; --hybrid-select-local-icon-hover-color: #1677ff; } /* * Dark theme styles using data-theme attribute on wrapper element * These override the light theme defaults when data-theme="dark" is applied */ .wrapper[data-theme="dark"] { /* Select wrapper dark theme overrides */ --hybrid-select-local-background-color: #262626; --hybrid-select-local-border-color: #424242; --hybrid-select-local-text-color: #ffffff; --hybrid-select-local-placeholder-color: #8c8c8c; --hybrid-select-local-hover-border-color: #4096ff; --hybrid-select-local-focus-border-color: #4096ff; /* Dropdown dark theme overrides */ --hybrid-select-local-dropdown-background: #262626; --hybrid-select-local-dropdown-border-color: #424242; --hybrid-select-local-option-hover-background: #393939; --hybrid-select-local-option-selected-background: #1e3a5f; --hybrid-select-local-option-selected-color: #4096ff; /* Tag styles for multi-select dark theme */ --hybrid-select-local-tag-background: #393939; --hybrid-select-local-tag-color: #ffffff; --hybrid-select-local-tag-close-color: #8c8c8c; --hybrid-select-local-tag-close-hover-color: #ff4d4f; /* Icon colors for dark theme */ --hybrid-select-local-icon-color: #8c8c8c; --hybrid-select-local-icon-hover-color: #4096ff; } /* Size variants */ :host([size='small']) .wrapper { min-height: var(--hybrid-select-small-height, var(--hybrid-select-local-small-height)); font-size: var(--hybrid-select-small-font-size, var(--hybrid-select-local-small-font-size)); } :host([size='small']) .select-trigger { padding: var(--hybrid-select-small-padding, var(--hybrid-select-local-small-padding)); padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px); } :host([size='medium']) .wrapper { min-height: var(--hybrid-select-medium-height, var(--hybrid-select-local-medium-height)); font-size: var(--hybrid-select-medium-font-size, var(--hybrid-select-local-medium-font-size)); } :host([size='medium']) .select-trigger { padding: var(--hybrid-select-medium-padding, var(--hybrid-select-local-medium-padding)); padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px); } :host([size='large']) .wrapper { min-height: var(--hybrid-select-large-height, var(--hybrid-select-local-large-height)); font-size: var(--hybrid-select-large-font-size, var(--hybrid-select-local-large-font-size)); } :host([size='large']) .select-trigger { padding: var(--hybrid-select-large-padding, var(--hybrid-select-local-large-padding)); padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px); } /* Status variants */ :host([status='error']) .wrapper { border-color: var(--hybrid-select-error-border-color, var(--hybrid-select-local-error-border-color)); } :host([status='warning']) .wrapper { border-color: var(--hybrid-select-warning-border-color, var(--hybrid-select-local-warning-border-color)); } :host([status='success']) .wrapper { border-color: var(--hybrid-select-success-border-color, var(--hybrid-select-local-success-border-color)); } /* Type variants */ :host([type='inline']) { display: flex; align-items: center; gap: 8px; } :host([type='inline']) .wrapper { flex: 1; } /* Show dropdown */ :host([show]) .options { display: flex !important; } /* Main wrapper container */ .wrapper { position: relative; width: var(--hybrid-select-width, var(--hybrid-select-local-width)); background-color: var(--hybrid-select-background-color, var(--hybrid-select-local-background-color)); border: var(--hybrid-select-border-width, var(--hybrid-select-local-border-width)) solid var(--hybrid-select-border-color, var(--hybrid-select-local-border-color)); border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius)); transition: all var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration)) var(--hybrid-select-transition-timing, var(--hybrid-select-local-transition-timing)); cursor: pointer; outline: none; margin: var(--hybrid-select-wrapper-margin, 0); min-height: var(--hybrid-select-min-height, var(--hybrid-select-local-min-height)); /* Ensure dropdown can overflow the wrapper */ overflow: visible; } .wrapper:hover:not(:disabled) { border-color: var(--hybrid-select-hover-border-color, var(--hybrid-select-local-hover-border-color)); } .wrapper:focus, .wrapper:focus-within { border-color: var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color)); box-shadow: 0 0 0 2px var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color))33; } /* Select container */ .select { display: flex; flex-direction: column; } /* Select trigger (main display area) */ .select-trigger { display: flex; align-items: center; padding: var(--hybrid-select-padding-top, var(--hybrid-select-local-padding-top)) calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px) var(--hybrid-select-padding-bottom, var(--hybrid-select-local-padding-bottom)) var(--hybrid-select-padding-left, var(--hybrid-select-local-padding-left)); color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color)); font-size: inherit; line-height: inherit; word-break: break-word; min-height: inherit; flex-wrap: wrap; gap: var(--hybrid-select-tag-margin, var(--hybrid-select-local-tag-margin)); } .select-trigger:empty:before { content: attr(data-placeholder); color: var(--hybrid-select-placeholder-color, var(--hybrid-select-local-placeholder-color)); font-size: var(--hybrid-select-placeholder-font-size, var(--hybrid-select-local-placeholder-font-size)); } /* Multi-select tags */ .tag { display: inline-flex; align-items: center; gap: 4px; background-color: var(--hybrid-select-tag-background, var(--hybrid-select-local-tag-background)); color: var(--hybrid-select-tag-color, var(--hybrid-select-local-tag-color)); padding: var(--hybrid-select-tag-padding, var(--hybrid-select-local-tag-padding)); border-radius: var(--hybrid-select-tag-border-radius, var(--hybrid-select-local-tag-border-radius)); font-size: calc(var(--hybrid-select-font-size, var(--hybrid-select-local-font-size)) - 1px); max-width: 100%; } .tag-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tag-close { color: var(--hybrid-select-tag-close-color, var(--hybrid-select-local-tag-close-color)); cursor: pointer; display: flex; align-items: center; justify-content: center; width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)); height: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)); border-radius: 50%; transition: color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration)); } .tag-close:hover { color: var(--hybrid-select-tag-close-hover-color, var(--hybrid-select-local-tag-close-hover-color)); } /* Icons container */ .icons-container { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); display: flex; align-items: center; gap: 4px; pointer-events: none; } .icons-container hy-icon { --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)); --hybrid-icon-color: var(--hybrid-select-icon-color, var(--hybrid-select-local-icon-color)); pointer-events: auto; cursor: pointer; transition: color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration)); } .icons-container hy-icon:hover { --hybrid-icon-color: var(--hybrid-select-icon-hover-color, var(--hybrid-select-local-icon-hover-color)); } .arrow-icon { --hybrid-icon-width: var(--hybrid-select-arrow-icon-size, var(--hybrid-select-local-arrow-icon-size)); transition: transform var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration)); pointer-events: none !important; } :host([show]) .arrow-icon { transform: rotate(180deg); } /* Dropdown options */ .options { /* Default positioning - will be overridden by controller when opened */ position: absolute; top: 100%; margin-top: 1px; left: 0; right: 0; background-color: var(--hybrid-select-dropdown-background, var(--hybrid-select-local-dropdown-background)); border: var(--hybrid-select-border-width, var(--hybrid-select-local-border-width)) solid var(--hybrid-select-dropdown-border-color, var(--hybrid-select-local-dropdown-border-color)); border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius)); box-shadow: var(--hybrid-select-dropdown-shadow, var(--hybrid-select-local-dropdown-shadow)); z-index: var(--hybrid-select-dropdown-z-index, var(--hybrid-select-local-dropdown-z-index)); max-height: var(--hybrid-select-dropdown-max-height, var(--hybrid-select-local-dropdown-max-height)); overflow-y: auto; overflow-x: hidden; display: none; flex-direction: column; animation: dropdown-enter var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out; /* Ensure proper containment and exact wrapper width */ box-sizing: border-box; width: 100%; /* Create new stacking context to prevent layering issues */ isolation: isolate; /* Ensure solid background to prevent visual bleed-through */ backdrop-filter: none; -webkit-backdrop-filter: none; /* Force above other elements */ transform: translateZ(0); } .options.placement-top { top: auto; bottom: 100%; margin-bottom: 1px; margin-top: 0; animation: dropdown-enter-top var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out; } @keyframes dropdown-enter { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } } @keyframes dropdown-enter-top { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } } /* Search container - sticky at top of dropdown */ .search-container { position: sticky; top: 0; z-index: 10; background-color: var(--hybrid-select-dropdown-background, var(--hybrid-select-local-dropdown-background)); border-bottom: var(--hybrid-select-border-width, var(--hybrid-select-local-border-width)) solid var(--hybrid-select-dropdown-border-color, var(--hybrid-select-local-dropdown-border-color)); padding: 8px; margin: 0; /* Ensure it stays above options during scroll */ backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); /* Ensure proper stacking and smooth scrolling */ will-change: transform; transform: translateZ(0); } /* Search input styling */ .search-container .search-input { width: 100%; --hybrid-input-border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius)); --hybrid-input-background-color: var(--hybrid-select-background-color, var(--hybrid-select-local-background-color)); --hybrid-input-border-color: var(--hybrid-select-border-color, var(--hybrid-select-local-border-color)); --hybrid-input-text-color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color)); --hybrid-input-placeholder-color: var(--hybrid-select-placeholder-color, var(--hybrid-select-local-placeholder-color)); } /* Search icon in the search input */ .search-container .search-icon { --hybrid-icon-color: var(--hybrid-select-icon-color, var(--hybrid-select-local-icon-color)); } /* Dark theme overrides for search container */ .wrapper[data-theme="dark"] .search-container { background-color: var(--hybrid-select-local-dropdown-background); border-bottom-color: var(--hybrid-select-local-dropdown-border-color); } .wrapper[data-theme="dark"] .search-container .search-input { --hybrid-input-background-color: var(--hybrid-select-local-background-color); --hybrid-input-border-color: var(--hybrid-select-local-border-color); --hybrid-input-text-color: var(--hybrid-select-local-text-color); --hybrid-input-placeholder-color: var(--hybrid-select-local-placeholder-color); } .wrapper[data-theme="dark"] .search-container .search-icon { --hybrid-icon-color: var(--hybrid-select-local-icon-color); } /* Options list container - ensure proper scroll behavior with sticky search */ .options:has(.search-container) { /* Add small padding-top when search is present to ensure proper separation */ padding-top: 0; } /* Option items */ .option { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color)); font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size)); cursor: pointer; transition: background-color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration)); position: relative; } /* First option after search container should have no extra margin */ .search-container + .option { margin-top: 0; } .option:hover { background-color: var(--hybrid-select-option-hover-background, var(--hybrid-select-local-option-hover-background)); } .option.selected { background-color: var(--hybrid-select-option-selected-background, var(--hybrid-select-local-option-selected-background)); color: var(--hybrid-select-option-selected-color, var(--hybrid-select-local-option-selected-color)); } .option.focused { background-color: var(--hybrid-select-option-hover-background, var(--hybrid-select-local-option-hover-background)); outline: 2px solid var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color)); outline-offset: -2px; } .option.disabled { opacity: var(--hybrid-select-disabled-opacity, var(--hybrid-select-local-disabled-opacity)); cursor: not-allowed; } .option-content { flex: 1; display: flex; align-items: center; gap: 8px; } .option-icon { --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)); --hybrid-icon-color: currentColor; } .option-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .option-description { font-size: calc(var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size)) - 1px); opacity: 0.7; margin-top: 2px; } .check-icon { --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)); --hybrid-icon-color: var(--hybrid-select-option-selected-color, var(--hybrid-select-local-option-selected-color)); } /* No options message - styled like Ant Design */ .no-options { display: flex; align-items: center; justify-content: center; padding: var(--select-no-options-padding, 24px 16px); color: var(--select-no-options-color, #8c8c8c); font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size)); cursor: default; user-select: none; } .no-options-content { display: flex; flex-direction: column; align-items: center; gap: var(--select-no-options-gap, 8px); text-align: center; } .no-options-icon { --hybrid-icon-width: 24px; --hybrid-icon-color: var(--select-no-options-icon-color, #d9d9d9); opacity: 0.8; } .no-options-text { font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size)); color: var(--select-no-options-color, #8c8c8c); line-height: 1.4; } /* Dark theme adjustments for no-options */ :host([theme='dark']) .no-options { color: var(--select-no-options-color, #595959); } :host([theme='dark']) .no-options-icon { --hybrid-icon-color: var(--select-no-options-icon-color, #434343); } :host([theme='dark']) .no-options-text { color: var(--select-no-options-color, #595959); } /* Validation message */ .validation-message { display: block; margin-top: var(--hybrid-select-message-margin-top, var(--hybrid-select-local-message-margin-top)); font-size: var(--hybrid-select-message-font-size, var(--hybrid-select-local-message-font-size)); color: var(--hybrid-select-error-message-color, var(--hybrid-select-local-error-message-color)); } .validation-message.warning { color: var(--hybrid-select-warning-message-color, var(--hybrid-select-local-warning-message-color)); } .validation-message.success { color: var(--hybrid-select-success-message-color, var(--hybrid-select-local-success-message-color)); } /* Slotted content styles */ ::slotted([slot='label']) { display: block; margin-bottom: 4px; font-weight: 500; color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color)); } ::slotted([slot='helper-text']) { display: block; margin-top: var(--hybrid-select-message-margin-top, var(--hybrid-select-local-message-margin-top)); font-size: var(--hybrid-select-message-font-size, var(--hybrid-select-local-message-font-size)); color: var(--hybrid-select-placeholder-color, var(--hybrid-select-local-placeholder-color)); } /* Accessibility improvements */ @media (prefers-reduced-motion: reduce) { .options, .wrapper, .tag-close, .arrow-icon, .option { transition: none; animation: none; } } /* High contrast mode support */ @media (prefers-contrast: high) { .wrapper { border-width: 2px; } .wrapper:focus, .wrapper:focus-within { outline: 3px solid; } } ` /** * @license * Copyright 2021 Google LLC * SPDX-License-I