@nuralyui/select 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +47 -14
- package/package.json +1 -1
- package/select.component.d.ts +1 -1
- package/select.component.js +1 -14
- package/select.component.js.map +1 -1
- package/select.style.js +35 -6
- package/select.style.js.map +1 -1
- package/select.style.variables.js +4 -0
- package/select.style.variables.js.map +1 -1
package/bundle.js
CHANGED
|
@@ -14,19 +14,19 @@ const t=window,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"
|
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
var f;y[b]=!0,y.elementProperties=new Map,y.elementStyles=[],y.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:y}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.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)}$`,E="?"+$,S=`<${E}>`,O=document,A=()=>O.createComment(""),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,
|
|
17
|
+
var f;y[b]=!0,y.elementProperties=new Map,y.elementStyles=[],y.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:y}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.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)}$`,E="?"+$,S=`<${E}>`,O=document,A=()=>O.createComment(""),k=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,N=/>/g,D=RegExp(`>|${C}(?:([^\\s"'>=/]+)(${C}*=${C}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,R=/"/g,P=/^(?:script|style|textarea|title)$/i,U=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),M=new WeakMap,F=O.createTreeWalker(O,129,null,!1);function j(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(i):i}class V{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let o=0,r=0;const n=t.length-1,l=this.parts,[h,c]=((t,i)=>{const e=t.length-1,s=[];let o,r=2===i?"<svg>":"",n=T;for(let i=0;i<e;i++){const e=t[i];let l,h,c=-1,a=0;for(;a<e.length&&(n.lastIndex=a,h=n.exec(e),null!==h);)a=n.lastIndex,n===T?"!--"===h[1]?n=_:void 0!==h[1]?n=N:void 0!==h[2]?(P.test(h[2])&&(o=RegExp("</"+h[2],"g")),n=D):void 0!==h[3]&&(n=D):n===D?">"===h[0]?(n=null!=o?o:T,c=-1):void 0===h[1]?c=-2:(c=n.lastIndex-h[2].length,l=h[1],n=void 0===h[3]?D:'"'===h[3]?R:I):n===R||n===I?n=D:n===_||n===N?n=T:(n=D,o=void 0);const d=n===D&&t[i+1].startsWith("/>")?" ":"";r+=n===T?e+S:c>=0?(s.push(l),e.slice(0,c)+x+e.slice(c)+$+d):e+$+(-2===c?(s.push(void 0),i):d)}return[j(t,r+(t[e]||"<?>")+(2===i?"</svg>":"")),s]})(t,i);if(this.el=V.createElement(h,e),F.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=F.nextNode())&&l.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(x)||i.startsWith($)){const e=c[r++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+x).split($),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?K:"?"===i[1]?Y:"@"===i[1]?Z:G})}else l.push({type:6,index:o})}for(const i of t)s.removeAttribute(i)}if(P.test(s.tagName)){const t=s.textContent.split($),i=t.length-1;if(i>0){s.textContent=m?m.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],A()),F.nextNode(),l.push({type:2,index:++o});s.append(t[i],A())}}}else if(8===s.nodeType)if(s.data===E)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf($,t+1));)l.push({type:7,index:o}),t+=$.length-1}o++}}static createElement(t,i){const e=O.createElement("template");return e.innerHTML=t,e}}function B(t,i,e=t,s){var o,r,n,l;if(i===U)return i;let h=void 0!==s?null===(o=e._$Co)||void 0===o?void 0:o[s]:e._$Cl;const c=k(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==c&&(null===(r=null==h?void 0:h._$AO)||void 0===r||r.call(h,!1),void 0===c?h=void 0:(h=new c(t),h._$AT(t,e,s)),void 0!==s?(null!==(n=(l=e)._$Co)&&void 0!==n?n:l._$Co=[])[s]=h:e._$Cl=h),void 0!==h&&(i=B(t,h._$AS(t,i.values),h,s)),i}class H{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:s}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:O).importNode(e,!0);F.currentNode=o;let r=F.nextNode(),n=0,l=0,h=s[0];for(;void 0!==h;){if(n===h.index){let i;2===h.type?i=new W(r,r.nextSibling,this,t):1===h.type?i=new h.ctor(r,h.name,h.strings,this,t):6===h.type&&(i=new Q(r,this,t)),this._$AV.push(i),h=s[++l]}n!==(null==h?void 0:h.index)&&(r=F.nextNode(),n++)}return F.currentNode=O,o}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class W{constructor(t,i,e,s){var o;this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(o=null==s?void 0:s.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=B(this,t,i),k(t)?t===L||null==t||""===t?(this._$AH!==L&&this._$AR(),this._$AH=L):t!==this._$AH&&t!==U&&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!==L&&k(this._$AH)?this._$AA.nextSibling.data=t:this.$(O.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$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===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(e);else{const t=new H(o,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=M.get(t.strings);return void 0===i&&M.set(t.strings,i=new V(t)),i}T(t){z(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const o of t)s===i.length?i.push(e=new W(this.k(A()),this.k(A()),this,this.options)):e=i[s],e._$AI(o),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class G{constructor(t,i,e,s,o){this.type=1,this._$AH=L,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=L}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const o=this.strings;let r=!1;if(void 0===o)t=B(this,t,i,0),r=!k(t)||t!==this._$AH&&t!==U,r&&(this._$AH=t);else{const s=t;let n,l;for(t=o[0],n=0;n<o.length-1;n++)l=B(this,s[e+n],i,n),l===U&&(l=this._$AH[n]),r||(r=!k(l)||l!==this._$AH[n]),l===L?t=L:t!==L&&(t+=(null!=l?l:"")+o[n+1]),this._$AH[n]=l}r&&!s&&this.j(t)}j(t){t===L?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===L?void 0:t}}const q=m?m.emptyScript:"";class Y extends G{constructor(){super(...arguments),this.type=4}j(t){t&&t!==L?this.element.setAttribute(this.name,q):this.element.removeAttribute(this.name)}}class Z extends G{constructor(t,i,e,s,o){super(t,i,e,s,o),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=B(this,t,i,0))&&void 0!==e?e:L)===U)return;const s=this._$AH,o=t===L&&s!==L||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==L&&(s===L||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const X=g.litHtmlPolyfillSupport;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
22
|
*/
|
|
23
|
-
var J;null==
|
|
23
|
+
var J;null==X||X(V,W),(null!==(f=g.litHtmlVersions)&&void 0!==f?f:g.litHtmlVersions=[]).push("2.8.0");const tt=window,it=tt.trustedTypes,et=it?it.createPolicy("lit-html",{createHTML:t=>t}):void 0,st="$lit$",ot=`lit$${(Math.random()+"").slice(9)}$`,rt="?"+ot,nt=`<${rt}>`,lt=document,ht=()=>lt.createComment(""),ct=t=>null===t||"object"!=typeof t&&"function"!=typeof t,at=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=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),wt=Symbol.for("lit-noChange"),xt=Symbol.for("lit-nothing"),$t=new WeakMap,Et=lt.createTreeWalker(lt,129,null,!1);function St(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==et?et.createHTML(i):i}const Ot=(t,i)=>{const e=t.length-1,s=[];let o,r=2===i?"<svg>":"",n=ut;for(let i=0;i<e;i++){const e=t[i];let l,h,c=-1,a=0;for(;a<e.length&&(n.lastIndex=a,h=n.exec(e),null!==h);)a=n.lastIndex,n===ut?"!--"===h[1]?n=pt:void 0!==h[1]?n=vt:void 0!==h[2]?(gt.test(h[2])&&(o=RegExp("</"+h[2],"g")),n=bt):void 0!==h[3]&&(n=bt):n===bt?">"===h[0]?(n=null!=o?o:ut,c=-1):void 0===h[1]?c=-2:(c=n.lastIndex-h[2].length,l=h[1],n=void 0===h[3]?bt:'"'===h[3]?ft:yt):n===ft||n===yt?n=bt:n===pt||n===vt?n=ut:(n=bt,o=void 0);const d=n===bt&&t[i+1].startsWith("/>")?" ":"";r+=n===ut?e+nt:c>=0?(s.push(l),e.slice(0,c)+st+e.slice(c)+ot+d):e+ot+(-2===c?(s.push(void 0),i):d)}return[St(t,r+(t[e]||"<?>")+(2===i?"</svg>":"")),s]};class At{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let o=0,r=0;const n=t.length-1,l=this.parts,[h,c]=Ot(t,i);if(this.el=At.createElement(h,e),Et.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=Et.nextNode())&&l.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(st)||i.startsWith(ot)){const e=c[r++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+st).split(ot),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?_t:"?"===i[1]?Dt:"@"===i[1]?It:Tt})}else l.push({type:6,index:o})}for(const i of t)s.removeAttribute(i)}if(gt.test(s.tagName)){const t=s.textContent.split(ot),i=t.length-1;if(i>0){s.textContent=it?it.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],ht()),Et.nextNode(),l.push({type:2,index:++o});s.append(t[i],ht())}}}else if(8===s.nodeType)if(s.data===rt)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(ot,t+1));)l.push({type:7,index:o}),t+=ot.length-1}o++}}static createElement(t,i){const e=lt.createElement("template");return e.innerHTML=t,e}}function kt(t,i,e=t,s){var o,r,n,l;if(i===wt)return i;let h=void 0!==s?null===(o=e._$Co)||void 0===o?void 0:o[s]:e._$Cl;const c=ct(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==c&&(null===(r=null==h?void 0:h._$AO)||void 0===r||r.call(h,!1),void 0===c?h=void 0:(h=new c(t),h._$AT(t,e,s)),void 0!==s?(null!==(n=(l=e)._$Co)&&void 0!==n?n:l._$Co=[])[s]=h:e._$Cl=h),void 0!==h&&(i=kt(t,h._$AS(t,i.values),h,s)),i}class zt{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:s}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:lt).importNode(e,!0);Et.currentNode=o;let r=Et.nextNode(),n=0,l=0,h=s[0];for(;void 0!==h;){if(n===h.index){let i;2===h.type?i=new Ct(r,r.nextSibling,this,t):1===h.type?i=new h.ctor(r,h.name,h.strings,this,t):6===h.type&&(i=new Rt(r,this,t)),this._$AV.push(i),h=s[++l]}n!==(null==h?void 0:h.index)&&(r=Et.nextNode(),n++)}return Et.currentNode=lt,o}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class Ct{constructor(t,i,e,s){var o;this.type=2,this._$AH=xt,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(o=null==s?void 0:s.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=kt(this,t,i),ct(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=>at(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&&ct(this._$AH)?this._$AA.nextSibling.data=t:this.$(lt.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=At.createElement(St(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(e);else{const t=new zt(o,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=$t.get(t.strings);return void 0===i&&$t.set(t.strings,i=new At(t)),i}T(t){at(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const o of t)s===i.length?i.push(e=new Ct(this.k(ht()),this.k(ht()),this,this.options)):e=i[s],e._$AI(o),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Tt{constructor(t,i,e,s,o){this.type=1,this._$AH=xt,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=xt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const o=this.strings;let r=!1;if(void 0===o)t=kt(this,t,i,0),r=!ct(t)||t!==this._$AH&&t!==wt,r&&(this._$AH=t);else{const s=t;let n,l;for(t=o[0],n=0;n<o.length-1;n++)l=kt(this,s[e+n],i,n),l===wt&&(l=this._$AH[n]),r||(r=!ct(l)||l!==this._$AH[n]),l===xt?t=xt:t!==xt&&(t+=(null!=l?l:"")+o[n+1]),this._$AH[n]=l}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 Nt=it?it.emptyScript:"";class Dt extends Tt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==xt?this.element.setAttribute(this.name,Nt):this.element.removeAttribute(this.name)}}class It extends Tt{constructor(t,i,e,s,o){super(t,i,e,s,o),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=kt(this,t,i,0))&&void 0!==e?e: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 i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){kt(this,t)}}const Pt=tt.litHtmlPolyfillSupport;null==Pt||Pt(At,Ct),(null!==(J=tt.litHtmlVersions)&&void 0!==J?J:tt.litHtmlVersions=[]).push("2.8.0");
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
var Ut,Lt;class Mt extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,e)=>{var s,o;const r=null!==(s=null==e?void 0:e.renderBefore)&&void 0!==s?s:i;let n=r._$litPart$;if(void 0===n){const t=null!==(o=null==e?void 0:e.renderBefore)&&void 0!==o?o:null;r._$litPart$=n=new
|
|
29
|
+
var Ut,Lt;class Mt extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,e)=>{var s,o;const r=null!==(s=null==e?void 0:e.renderBefore)&&void 0!==s?s:i;let n=r._$litPart$;if(void 0===n){const t=null!==(o=null==e?void 0:e.renderBefore)&&void 0!==o?o:null;r._$litPart$=n=new Ct(i.insertBefore(ht(),t),t,void 0,null!=e?e:{})}return n._$AI(t),n})(i,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}}Mt.finalized=!0,Mt._$litElement$=!0,null===(Ut=globalThis.litElementHydrateSupport)||void 0===Ut||Ut.call(globalThis,{LitElement:Mt});const Ft=globalThis.litElementPolyfillSupport;null==Ft||Ft({LitElement:Mt}),(null!==(Lt=globalThis.litElementVersions)&&void 0!==Lt?Lt:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
@@ -59,8 +59,11 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
59
59
|
/* Layout and sizing */
|
|
60
60
|
--hybrid-select-local-width: 300px;
|
|
61
61
|
--hybrid-select-local-min-height: 40px;
|
|
62
|
+
--hybrid-select-local-padding-top: 8px;
|
|
63
|
+
--hybrid-select-local-padding-bottom: 8px;
|
|
62
64
|
--hybrid-select-local-padding-left: 12px;
|
|
63
65
|
--hybrid-select-local-padding-right: 12px;
|
|
66
|
+
--hybrid-select-local-wrapper-margin: 0;
|
|
64
67
|
--hybrid-select-local-border-radius: 6px;
|
|
65
68
|
--hybrid-select-local-border-width: 1px;
|
|
66
69
|
|
|
@@ -79,6 +82,7 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
79
82
|
--hybrid-select-local-dropdown-background: #ffffff;
|
|
80
83
|
--hybrid-select-local-dropdown-border-color: #d9d9d9;
|
|
81
84
|
--hybrid-select-local-dropdown-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08);
|
|
85
|
+
--hybrid-select-local-dropdown-z-index: 9999;
|
|
82
86
|
--hybrid-select-local-option-hover-background: #f5f5f5;
|
|
83
87
|
--hybrid-select-local-option-selected-background: #e6f7ff;
|
|
84
88
|
--hybrid-select-local-option-selected-color: #1677ff;
|
|
@@ -144,6 +148,7 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
144
148
|
font-family: var(--hybrid-select-font-family, var(--hybrid-select-local-font-family));
|
|
145
149
|
font-size: var(--hybrid-select-font-size, var(--hybrid-select-local-font-size));
|
|
146
150
|
line-height: var(--hybrid-select-line-height, var(--hybrid-select-local-line-height));
|
|
151
|
+
margin: var(--hybrid-select-margin, var(--hybrid-select-local-wrapper-margin));
|
|
147
152
|
}
|
|
148
153
|
|
|
149
154
|
/* Host attribute selectors for configuration */
|
|
@@ -177,19 +182,31 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
177
182
|
:host([size='small']) .wrapper {
|
|
178
183
|
min-height: var(--hybrid-select-small-height, var(--hybrid-select-local-small-height));
|
|
179
184
|
font-size: var(--hybrid-select-small-font-size, var(--hybrid-select-local-small-font-size));
|
|
180
|
-
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host([size='small']) .select-trigger {
|
|
188
|
+
padding: var(--hybrid-select-small-padding, var(--hybrid-select-local-small-padding));
|
|
189
|
+
padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);
|
|
181
190
|
}
|
|
182
191
|
|
|
183
192
|
:host([size='medium']) .wrapper {
|
|
184
193
|
min-height: var(--hybrid-select-medium-height, var(--hybrid-select-local-medium-height));
|
|
185
194
|
font-size: var(--hybrid-select-medium-font-size, var(--hybrid-select-local-medium-font-size));
|
|
186
|
-
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:host([size='medium']) .select-trigger {
|
|
198
|
+
padding: var(--hybrid-select-medium-padding, var(--hybrid-select-local-medium-padding));
|
|
199
|
+
padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);
|
|
187
200
|
}
|
|
188
201
|
|
|
189
202
|
:host([size='large']) .wrapper {
|
|
190
203
|
min-height: var(--hybrid-select-large-height, var(--hybrid-select-local-large-height));
|
|
191
204
|
font-size: var(--hybrid-select-large-font-size, var(--hybrid-select-local-large-font-size));
|
|
192
|
-
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
:host([size='large']) .select-trigger {
|
|
208
|
+
padding: var(--hybrid-select-large-padding, var(--hybrid-select-local-large-padding));
|
|
209
|
+
padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);
|
|
193
210
|
}
|
|
194
211
|
|
|
195
212
|
/* Status variants */
|
|
@@ -233,6 +250,10 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
233
250
|
var(--hybrid-select-transition-timing, var(--hybrid-select-local-transition-timing));
|
|
234
251
|
cursor: pointer;
|
|
235
252
|
outline: none;
|
|
253
|
+
margin: var(--hybrid-select-wrapper-margin, 0);
|
|
254
|
+
min-height: var(--hybrid-select-min-height, var(--hybrid-select-local-min-height));
|
|
255
|
+
/* Ensure dropdown can overflow the wrapper */
|
|
256
|
+
overflow: visible;
|
|
236
257
|
}
|
|
237
258
|
|
|
238
259
|
.wrapper:hover:not(:disabled) {
|
|
@@ -249,14 +270,16 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
249
270
|
.select {
|
|
250
271
|
display: flex;
|
|
251
272
|
flex-direction: column;
|
|
252
|
-
position: relative;
|
|
253
273
|
}
|
|
254
274
|
|
|
255
275
|
/* Select trigger (main display area) */
|
|
256
276
|
.select-trigger {
|
|
257
277
|
display: flex;
|
|
258
278
|
align-items: center;
|
|
259
|
-
padding:
|
|
279
|
+
padding: var(--hybrid-select-padding-top, var(--hybrid-select-local-padding-top))
|
|
280
|
+
calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px)
|
|
281
|
+
var(--hybrid-select-padding-bottom, var(--hybrid-select-local-padding-bottom))
|
|
282
|
+
var(--hybrid-select-padding-left, var(--hybrid-select-local-padding-left));
|
|
260
283
|
color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));
|
|
261
284
|
font-size: inherit;
|
|
262
285
|
line-height: inherit;
|
|
@@ -346,6 +369,7 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
346
369
|
/* Default positioning - will be overridden by controller when opened */
|
|
347
370
|
position: absolute;
|
|
348
371
|
top: 100%;
|
|
372
|
+
margin-top: 1px;
|
|
349
373
|
left: 0;
|
|
350
374
|
right: 0;
|
|
351
375
|
background-color: var(--hybrid-select-dropdown-background, var(--hybrid-select-local-dropdown-background));
|
|
@@ -353,7 +377,7 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
353
377
|
var(--hybrid-select-dropdown-border-color, var(--hybrid-select-local-dropdown-border-color));
|
|
354
378
|
border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius));
|
|
355
379
|
box-shadow: var(--hybrid-select-dropdown-shadow, var(--hybrid-select-local-dropdown-shadow));
|
|
356
|
-
z-index:
|
|
380
|
+
z-index: var(--hybrid-select-dropdown-z-index, var(--hybrid-select-local-dropdown-z-index));
|
|
357
381
|
max-height: 200px;
|
|
358
382
|
overflow-y: auto;
|
|
359
383
|
overflow-x: hidden;
|
|
@@ -363,11 +387,20 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
363
387
|
/* Ensure proper containment and exact wrapper width */
|
|
364
388
|
box-sizing: border-box;
|
|
365
389
|
width: 100%;
|
|
390
|
+
/* Create new stacking context to prevent layering issues */
|
|
391
|
+
isolation: isolate;
|
|
392
|
+
/* Ensure solid background to prevent visual bleed-through */
|
|
393
|
+
backdrop-filter: none;
|
|
394
|
+
-webkit-backdrop-filter: none;
|
|
395
|
+
/* Force above other elements */
|
|
396
|
+
transform: translateZ(0);
|
|
366
397
|
}
|
|
367
398
|
|
|
368
399
|
.options.placement-top {
|
|
369
400
|
top: auto;
|
|
370
401
|
bottom: 100%;
|
|
402
|
+
margin-bottom: 1px;
|
|
403
|
+
margin-top: 0;
|
|
371
404
|
animation: dropdown-enter-top var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out;
|
|
372
405
|
}
|
|
373
406
|
|
|
@@ -575,7 +608,7 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
575
608
|
* @license
|
|
576
609
|
* Copyright 2018 Google LLC
|
|
577
610
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
578
|
-
*/const
|
|
611
|
+
*/const Zt=qt(class extends Yt{constructor(t){var i;if(super(t),t.type!==Kt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var e,s;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(e=this.nt)||void 0===e?void 0:e.has(t))&&this.it.add(t);return this.render(i)}const o=t.element.classList;this.it.forEach((t=>{t in i||(o.remove(t),this.it.delete(t))}));for(const t in i){const e=!!i[t];e===this.it.has(t)||(null===(s=this.nt)||void 0===s?void 0:s.has(t))||(e?(o.add(t),this.it.add(t)):(o.remove(t),this.it.delete(t)))}return U}}),Qt="important",Xt=" !"+Qt,Jt=qt(class extends Yt{constructor(t){var i;if(super(t),t.type!==Kt||"style"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((i,e)=>{const s=t[e];return null==s?i:i+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(t,[i]){const{style:e}=t.element;if(void 0===this.ht){this.ht=new Set;for(const t in i)this.ht.add(t);return this.render(i)}this.ht.forEach((t=>{null==i[t]&&(this.ht.delete(t),t.includes("-")?e.removeProperty(t):e[t]="")}));for(const t in i){const s=i[t];if(null!=s){this.ht.add(t);const i="string"==typeof s&&s.endsWith(Xt);t.includes("-")||i?e.setProperty(t,i?s.slice(0,-11):s,i?Qt:""):e[t]=s}}return U}}),ti=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const e=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return"dark"===e||"light"===e?e:(null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"}setupThemeObserver(){this.themeObserver=new MutationObserver((()=>{this.requestUpdate()})),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},ii=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},ei=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(ii())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!ii())return!0;let i=!0;for(const e of this.requiredComponents)if(!this.isComponentAvailable(e)){i=!1;const s=new Error(`Required component "${e}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(e,s):console.error(s.message)}return i}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter((t=>!this.isComponentAvailable(t)))}areDependenciesAvailable(){return this.requiredComponents.every((t=>this.isComponentAvailable(t)))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const i=this.requiredComponents.indexOf(t);i>-1&&this.requiredComponents.splice(i,1)}},si=t=>class extends t{dispatchCustomEvent(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,i){var e;const s=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(e=this.tagName)||void 0===e?void 0:e.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,s)}dispatchInputEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,e)}dispatchFocusEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,e)}dispatchValidationEvent(t,i){var e;const s=Object.assign({target:i.target||this,value:i.value,isValid:null!==(e=i.isValid)&&void 0!==e&&e,error:i.error},i);this.dispatchCustomEvent(t,s)}dispatchActionEvent(t,i){const e=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,e)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}};
|
|
579
612
|
/**
|
|
580
613
|
* @license
|
|
581
614
|
* Copyright 2018 Google LLC
|
|
@@ -617,10 +650,10 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
617
650
|
* @license
|
|
618
651
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
619
652
|
* SPDX-License-Identifier: MIT
|
|
620
|
-
*/var xi=function(t,i,e,s){for(var o,r=arguments.length,n=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(i,e,n):o(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};let $i=class extends((t=>ei(ti(si(t))))(Mt)){constructor(){super(...arguments),this.requiredComponents=[],this.options=[],this.defaultValue=[],this.placeholder="Select an option",this.disabled=!1,this.type=oi.Default,this.multiple=!1,this.show=!1,this.status=ri.Default,this.size=ni.Medium,this.required=!1,this.name="",this.value="",this.noOptionsMessage="No options available",this.noOptionsIcon="circle-info",this.searchable=!1,this.searchPlaceholder="Search options...",this.searchQuery="",this.selectionController=new vi(this),this.dropdownController=new yi(this),this.keyboardController=new bi(this,this.selectionController,this.dropdownController),this.focusController=new fi(this),this.validationController=new gi(this,this.selectionController),this.searchController=new mi(this),this.eventController=new wi(this),this.handleTriggerClick=t=>{this.eventController.handleTriggerClick(t)},this.handleOptionClick=(t,i)=>{this.eventController.handleOptionClick(t,i)},this.handleTagRemove=(t,i)=>{this.eventController.handleTagRemove(t,i)},this.handleClearAll=t=>{this.eventController.handleClearAll(t)},this.handleKeyDown=t=>{this.eventController.handleKeyDown(t)},this.handleFocus=()=>{this.eventController.handleFocus()},this.handleBlur=()=>{this.eventController.handleBlur()}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),this.optionsElement&&this.wrapper?this.dropdownController.setElements(this.optionsElement,this.wrapper):setTimeout((()=>{this.optionsElement&&this.wrapper&&this.dropdownController.setElements(this.optionsElement,this.wrapper)}),100),this.defaultValue.length>0&&this.selectionController.initializeFromDefaultValue()}get selectedOptions(){return this.selectionController.getSelectedOptions()}get selectedOption(){return this.selectionController.getSelectedOption()}selectOption(t){this.selectionController.selectOption(t)}unselectOption(t){this.selectionController.unselectOption(t)}clearSelection(){this.selectionController.clearSelection()}isOptionSelected(t){return this.selectionController.isOptionSelected(t)}toggleDropdown(){this.dropdownController.toggle()}openDropdown(){this.dropdownController.open()}closeDropdown(){this.dropdownController.close()}focus(){this.focusController.focus()}blur(){this.focusController.blur()}validate(){return this.validationController.validate()}checkValidity(){return this.validationController.checkValidity()}reportValidity(){return this.validationController.reportValidity()}setCustomValidity(t){this.validationController.setCustomValidity(t)}searchOptions(t){this.searchController.search(t)}clearSearch(){this.searchController.clearSearch()}getSearchFilteredOptions(){return this.searchController.getFilteredOptions(this.options)}getCurrentSearchQuery(){return this.searchController.searchQuery}setupGlobalEventListeners(){this.eventController.setupEventListeners()}removeGlobalEventListeners(){this.eventController.removeEventListeners()}getFilteredOptions(){return this.searchController.getFilteredOptions(this.options)}setupEventListeners(){this.eventController.setupEventListeners()}removeEventListeners(){this.eventController.removeEventListeners()}render(){return mt`${((t,i,e)=>{for(const e of i)if(e[0]===t)return(0,e[1])();return null==e?void 0:e()})(this.type,[[oi.Default,()=>this.renderDefault()],[oi.Inline,()=>this.renderInline()],[oi.Button,()=>this.renderButton()],[oi.Slot,()=>this.renderSlot()]])}`}renderDefault(){const t=this.selectedOptions,i=this.validationController.getValidationClasses();return mt`
|
|
653
|
+
*/var xi=function(t,i,e,s){for(var o,r=arguments.length,n=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(i,e,n):o(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};let $i=class extends((t=>ei(ti(si(t))))(Mt)){constructor(){super(...arguments),this.requiredComponents=["nr-input","hy-icon"],this.options=[],this.defaultValue=[],this.placeholder="Select an option",this.disabled=!1,this.type=oi.Default,this.multiple=!1,this.show=!1,this.status=ri.Default,this.size=ni.Medium,this.required=!1,this.name="",this.value="",this.noOptionsMessage="No options available",this.noOptionsIcon="circle-info",this.searchable=!1,this.searchPlaceholder="Search options...",this.searchQuery="",this.selectionController=new vi(this),this.dropdownController=new yi(this),this.keyboardController=new bi(this,this.selectionController,this.dropdownController),this.focusController=new fi(this),this.validationController=new gi(this,this.selectionController),this.searchController=new mi(this),this.eventController=new wi(this),this.handleTriggerClick=t=>{this.eventController.handleTriggerClick(t)},this.handleOptionClick=(t,i)=>{this.eventController.handleOptionClick(t,i)},this.handleTagRemove=(t,i)=>{this.eventController.handleTagRemove(t,i)},this.handleClearAll=t=>{this.eventController.handleClearAll(t)},this.handleKeyDown=t=>{this.eventController.handleKeyDown(t)},this.handleFocus=()=>{this.eventController.handleFocus()},this.handleBlur=()=>{this.eventController.handleBlur()}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),this.optionsElement&&this.wrapper?this.dropdownController.setElements(this.optionsElement,this.wrapper):setTimeout((()=>{this.optionsElement&&this.wrapper&&this.dropdownController.setElements(this.optionsElement,this.wrapper)}),100),this.defaultValue.length>0&&this.selectionController.initializeFromDefaultValue()}get selectedOptions(){return this.selectionController.getSelectedOptions()}get selectedOption(){return this.selectionController.getSelectedOption()}selectOption(t){this.selectionController.selectOption(t)}unselectOption(t){this.selectionController.unselectOption(t)}clearSelection(){this.selectionController.clearSelection()}isOptionSelected(t){return this.selectionController.isOptionSelected(t)}toggleDropdown(){this.dropdownController.toggle()}openDropdown(){this.dropdownController.open()}closeDropdown(){this.dropdownController.close()}focus(){this.focusController.focus()}blur(){this.focusController.blur()}validate(){return this.validationController.validate()}checkValidity(){return this.validationController.checkValidity()}reportValidity(){return this.validationController.reportValidity()}setCustomValidity(t){this.validationController.setCustomValidity(t)}searchOptions(t){this.searchController.search(t)}clearSearch(){this.searchController.clearSearch()}getSearchFilteredOptions(){return this.searchController.getFilteredOptions(this.options)}getCurrentSearchQuery(){return this.searchController.searchQuery}setupGlobalEventListeners(){this.eventController.setupEventListeners()}removeGlobalEventListeners(){this.eventController.removeEventListeners()}getFilteredOptions(){return this.searchController.getFilteredOptions(this.options)}setupEventListeners(){this.eventController.setupEventListeners()}removeEventListeners(){this.eventController.removeEventListeners()}render(){return mt`${((t,i,e)=>{for(const e of i)if(e[0]===t)return(0,e[1])();return null==e?void 0:e()})(this.type,[[oi.Default,()=>this.renderDefault()],[oi.Inline,()=>this.renderInline()],[oi.Button,()=>this.renderButton()],[oi.Slot,()=>this.renderSlot()]])}`}renderDefault(){const t=this.selectedOptions,i=this.validationController.getValidationClasses();return mt`
|
|
621
654
|
<slot name="label"></slot>
|
|
622
655
|
<div
|
|
623
|
-
class="${
|
|
656
|
+
class="${Zt(Object.assign({wrapper:!0},i))}"
|
|
624
657
|
tabindex="0"
|
|
625
658
|
role="combobox"
|
|
626
659
|
aria-expanded="${this.show}"
|
|
@@ -716,7 +749,7 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
716
749
|
</div>
|
|
717
750
|
`;if(this.searchController.hasNoResults(this.options))return this.searchController.renderNoResults();const i=this.keyboardController.focusedOption;return Gt(t,(t=>{const e=this.isOptionSelected(t),s=i&&i.value===t.value;return mt`
|
|
718
751
|
<div
|
|
719
|
-
class="${
|
|
752
|
+
class="${Zt({option:!0,selected:e,focused:s,disabled:Boolean(t.disabled)})}"
|
|
720
753
|
role="option"
|
|
721
754
|
aria-selected="${e}"
|
|
722
755
|
aria-disabled="${Boolean(t.disabled)}"
|
|
@@ -752,4 +785,4 @@ function Bt(t,i){return(({finisher:t,descriptor:i})=>(e,s)=>{var o;if(void 0===s
|
|
|
752
785
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
753
786
|
* SPDX-License-Identifier: MIT
|
|
754
787
|
*/
|
|
755
|
-
const Ei={CHANGE:"nr-change",FOCUS:"nr-focus",BLUR:"nr-blur",DROPDOWN_OPEN:"nr-dropdown-open",DROPDOWN_CLOSE:"nr-dropdown-close",VALIDATION:"nr-validation",ERROR:"nr-select-error"},Si={WRAPPER:"wrapper",SELECT:"select",TRIGGER:"select-trigger",OPTIONS:"options",OPTION:"option",SELECTED:"selected",FOCUSED:"focused",DISABLED:"disabled",TAG:"tag",TAG_LABEL:"tag-label",TAG_CLOSE:"tag-close",ICONS_CONTAINER:"icons-container",ARROW_ICON:"arrow-icon",CLEAR_ICON:"clear-icon",STATUS_ICON:"status-icon",CHECK_ICON:"check-icon",VALIDATION_MESSAGE:"validation-message",PLACEHOLDER:"placeholder",NO_OPTIONS:"no-options",NO_OPTIONS_CONTENT:"no-options-content",NO_OPTIONS_ICON:"no-options-icon",NO_OPTIONS_TEXT:"no-options-text",SEARCH_CONTAINER:"search-container",SEARCH_INPUT:"search-input",SEARCH_ICON:"search-icon",SEARCH_CLEAR:"search-clear"},Oi={COMBOBOX:"combobox",LISTBOX:"listbox",OPTION:"option",EXPANDED:"aria-expanded",HASPOPUP:"aria-haspopup",MULTISELECTABLE:"aria-multiselectable",SELECTED:"aria-selected",DISABLED:"aria-disabled",REQUIRED:"aria-required",INVALID:"aria-invalid",DESCRIBEDBY:"aria-describedby",LABELLEDBY:"aria-labelledby"},Ai={PLACEHOLDER:"Select an option",MAX_HEIGHT:"200px",DROPDOWN_OFFSET:4,TAG_MAX_WIDTH:"150px",TRANSITION_DURATION:200,DEBOUNCE_DELAY:300},ki={ENTER:"Enter",SPACE:" ",ESCAPE:"Escape",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",HOME:"Home",END:"End",TAB:"Tab"},
|
|
788
|
+
const Ei={CHANGE:"nr-change",FOCUS:"nr-focus",BLUR:"nr-blur",DROPDOWN_OPEN:"nr-dropdown-open",DROPDOWN_CLOSE:"nr-dropdown-close",VALIDATION:"nr-validation",ERROR:"nr-select-error"},Si={WRAPPER:"wrapper",SELECT:"select",TRIGGER:"select-trigger",OPTIONS:"options",OPTION:"option",SELECTED:"selected",FOCUSED:"focused",DISABLED:"disabled",TAG:"tag",TAG_LABEL:"tag-label",TAG_CLOSE:"tag-close",ICONS_CONTAINER:"icons-container",ARROW_ICON:"arrow-icon",CLEAR_ICON:"clear-icon",STATUS_ICON:"status-icon",CHECK_ICON:"check-icon",VALIDATION_MESSAGE:"validation-message",PLACEHOLDER:"placeholder",NO_OPTIONS:"no-options",NO_OPTIONS_CONTENT:"no-options-content",NO_OPTIONS_ICON:"no-options-icon",NO_OPTIONS_TEXT:"no-options-text",SEARCH_CONTAINER:"search-container",SEARCH_INPUT:"search-input",SEARCH_ICON:"search-icon",SEARCH_CLEAR:"search-clear"},Oi={COMBOBOX:"combobox",LISTBOX:"listbox",OPTION:"option",EXPANDED:"aria-expanded",HASPOPUP:"aria-haspopup",MULTISELECTABLE:"aria-multiselectable",SELECTED:"aria-selected",DISABLED:"aria-disabled",REQUIRED:"aria-required",INVALID:"aria-invalid",DESCRIBEDBY:"aria-describedby",LABELLEDBY:"aria-labelledby"},Ai={PLACEHOLDER:"Select an option",MAX_HEIGHT:"200px",DROPDOWN_OFFSET:4,TAG_MAX_WIDTH:"150px",TRANSITION_DURATION:200,DEBOUNCE_DELAY:300},ki={ENTER:"Enter",SPACE:" ",ESCAPE:"Escape",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",HOME:"Home",END:"End",TAB:"Tab"},zi="",Ci=", ";export{pi as BaseSelectController,ai as DropdownPlacement,zi as EMPTY_STRING,$i as HySelectComponent,Ci as MULTIPLE_OPTIONS_SEPARATOR,li as OptionSize,Oi as SELECT_ARIA,Si as SELECT_CLASSES,Ai as SELECT_DEFAULTS,Ei as SELECT_EVENTS,ki as SELECT_KEYS,di as SearchMode,hi as SelectDirection,yi as SelectDropdownController,wi as SelectEventController,fi as SelectFocusController,bi as SelectKeyboardController,mi as SelectSearchController,vi as SelectSelectionController,ni as SelectSize,ri as SelectStatus,oi as SelectType,gi as SelectValidationController,ci as SelectVariant};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuralyui/select",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A comprehensive select component with advanced features including multi-selection, keyboard navigation, validation, and accessibility support.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/select.component.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ declare const HySelectComponent_base: (new (...args: any[]) => import("../../sha
|
|
|
60
60
|
*/
|
|
61
61
|
export declare class HySelectComponent extends HySelectComponent_base implements SelectHost {
|
|
62
62
|
static styles: import("lit").CSSResult;
|
|
63
|
-
requiredComponents:
|
|
63
|
+
requiredComponents: string[];
|
|
64
64
|
/** Array of options to display in the select dropdown */
|
|
65
65
|
options: SelectOption[];
|
|
66
66
|
/** Default selected values (for initialization) */
|
package/select.component.js
CHANGED
|
@@ -75,9 +75,7 @@ import { SelectSelectionController, SelectKeyboardController, SelectDropdownCont
|
|
|
75
75
|
let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitElement) {
|
|
76
76
|
constructor() {
|
|
77
77
|
super(...arguments);
|
|
78
|
-
|
|
79
|
-
this.requiredComponents = [];
|
|
80
|
-
// === Properties ===
|
|
78
|
+
this.requiredComponents = ["nr-input", "hy-icon"];
|
|
81
79
|
/** Array of options to display in the select dropdown */
|
|
82
80
|
this.options = [];
|
|
83
81
|
/** Default selected values (for initialization) */
|
|
@@ -112,7 +110,6 @@ let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitEle
|
|
|
112
110
|
this.searchPlaceholder = 'Search options...';
|
|
113
111
|
/** Current search query */
|
|
114
112
|
this.searchQuery = '';
|
|
115
|
-
// === Controller instances ===
|
|
116
113
|
/** Handles option selection logic */
|
|
117
114
|
this.selectionController = new SelectSelectionController(this);
|
|
118
115
|
/** Manages dropdown visibility and positioning */
|
|
@@ -127,9 +124,6 @@ let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitEle
|
|
|
127
124
|
this.searchController = new SelectSearchController(this);
|
|
128
125
|
/** Handles all event management */
|
|
129
126
|
this.eventController = new SelectEventController(this);
|
|
130
|
-
// === Private Event Handlers ===
|
|
131
|
-
// Note: Event handling logic has been extracted to SelectEventController
|
|
132
|
-
// These methods serve as thin wrappers for template bindings
|
|
133
127
|
/**
|
|
134
128
|
* Handles clicks on the select trigger element
|
|
135
129
|
*/
|
|
@@ -173,20 +167,17 @@ let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitEle
|
|
|
173
167
|
this.eventController.handleBlur();
|
|
174
168
|
};
|
|
175
169
|
}
|
|
176
|
-
// === Lifecycle methods ===
|
|
177
170
|
/**
|
|
178
171
|
* Component connected to DOM - initialize base functionality
|
|
179
172
|
*/
|
|
180
173
|
connectedCallback() {
|
|
181
174
|
super.connectedCallback();
|
|
182
|
-
// Window click listener is setup only when dropdown opens for better performance
|
|
183
175
|
}
|
|
184
176
|
/**
|
|
185
177
|
* Component disconnected from DOM - cleanup event listeners
|
|
186
178
|
*/
|
|
187
179
|
disconnectedCallback() {
|
|
188
180
|
super.disconnectedCallback();
|
|
189
|
-
// Event cleanup is now handled by EventController
|
|
190
181
|
}
|
|
191
182
|
/**
|
|
192
183
|
* First render complete - setup controllers and initialize state
|
|
@@ -357,7 +348,6 @@ let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitEle
|
|
|
357
348
|
return this.searchController.getFilteredOptions(this.options);
|
|
358
349
|
}
|
|
359
350
|
;
|
|
360
|
-
// === Event Listener Management ===
|
|
361
351
|
/**
|
|
362
352
|
* Sets up global event listeners (called when dropdown opens)
|
|
363
353
|
*/
|
|
@@ -370,7 +360,6 @@ let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitEle
|
|
|
370
360
|
removeEventListeners() {
|
|
371
361
|
this.eventController.removeEventListeners();
|
|
372
362
|
}
|
|
373
|
-
// === Main Render Method ===
|
|
374
363
|
/**
|
|
375
364
|
* Main render method that delegates to specific type renderers
|
|
376
365
|
*/
|
|
@@ -382,7 +371,6 @@ let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitEle
|
|
|
382
371
|
[SelectType.Slot, () => this.renderSlot()],
|
|
383
372
|
])}`;
|
|
384
373
|
}
|
|
385
|
-
// === Type-Specific Render Methods ===
|
|
386
374
|
/**
|
|
387
375
|
* Renders the default select appearance with full features
|
|
388
376
|
*/
|
|
@@ -478,7 +466,6 @@ let HySelectComponent = class HySelectComponent extends NuralyUIBaseMixin(LitEle
|
|
|
478
466
|
</div>
|
|
479
467
|
`;
|
|
480
468
|
}
|
|
481
|
-
// === Helper Render Methods ===
|
|
482
469
|
/**
|
|
483
470
|
* Renders the selected content in the trigger area
|
|
484
471
|
*/
|
package/select.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../src/components/select/select.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,eAAe;AACf,OAAO,EAEL,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,qBAAqB;AACrB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAKhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAApE;;QAGE,4CAA4C;QACnC,uBAAkB,GAAG,EAAE,CAAC;QAEjC,qBAAqB;QAErB,yDAAyD;QAEzD,YAAO,GAAmB,EAAE,CAAC;QAE7B,mDAAmD;QAEnD,iBAAY,GAAa,EAAE,CAAC;QAE5B,wDAAwD;QAExD,gBAAW,GAAW,kBAAkB,CAAC;QAEzC,oCAAoC;QAEpC,aAAQ,GAAY,KAAK,CAAC;QAE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AAI,EAAE,CAAC;qDACf;AAI5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;4DACZ;AAIhD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACF;AAMzB;IADC,KAAK,CAAC,UAAU,CAAC;yDACW;AAI7B;IADC,KAAK,CAAC,UAAU,CAAC;kDACI;AAItB;IADC,KAAK,CAAC,eAAe,CAAC;sDACQ;AAxFpB,iBAAiB;IAD7B,aAAa,CAAC,WAAW,CAAC;GACd,iBAAiB,CAypB7B;SAzpBY,iBAAiB","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, html, nothing } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { styles } from './select.style.js';\nimport { map } from 'lit/directives/map.js';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\n\n// Import types\nimport { \n SelectOption, \n SelectType,\n SelectSize,\n SelectStatus\n} from './select.types.js';\n\n// Import controllers\nimport {\n SelectSelectionController,\n SelectKeyboardController,\n SelectDropdownController,\n SelectFocusController,\n SelectValidationController,\n SelectSearchController,\n SelectEventController\n} from './controllers/index.js';\n\n// Import interfaces\nimport { SelectHost } from './interfaces/index.js';\n\n/**\n * Advanced select component with multiple selection modes, validation, and accessibility features.\n * \n * Supports single and multiple selection, custom rendering, validation states, keyboard navigation,\n * and various display types including default, inline, button, and slot-based configurations.\n * \n * @example\n * ```html\n * <!-- Basic select -->\n * <hy-select placeholder=\"Choose an option\">\n * <option value=\"1\">Option 1</option>\n * <option value=\"2\">Option 2</option>\n * </hy-select>\n * \n * <!-- Multiple selection -->\n * <hy-select multiple placeholder=\"Choose multiple options\"></hy-select>\n * \n * <!-- With validation -->\n * <hy-select required status=\"error\"></hy-select>\n * \n * <!-- Button style -->\n * <hy-select type=\"button\"></hy-select>\n * \n * <!-- With search functionality -->\n * <hy-select searchable search-placeholder=\"Search options...\"></hy-select>\n * ```\n * \n * @fires nr-change - Selection changed\n * @fires nr-focus - Component focused \n * @fires nr-blur - Component blurred\n * @fires nr-dropdown-open - Dropdown opened\n * @fires nr-dropdown-close - Dropdown closed\n * @fires nr-validation - Validation state changed\n * \n * @slot label - Select label content\n * @slot helper-text - Helper text below select\n * @slot trigger - Custom trigger content (slot type only)\n * \n * @cssproperty --select-border-color - Border color\n * @cssproperty --select-background - Background color\n * @cssproperty --select-text-color - Text color\n * @cssproperty --select-focus-color - Focus indicator color\n * @cssproperty --select-dropdown-shadow - Dropdown shadow\n * @cssproperty --select-no-options-color - No options message text color\n * @cssproperty --select-no-options-icon-color - No options icon color\n * @cssproperty --select-no-options-padding - Padding for no options message\n * @cssproperty --select-no-options-gap - Gap between icon and text\n * @cssproperty --select-search-border - Search input border\n * @cssproperty --select-search-background - Search input background\n * @cssproperty --select-search-padding - Search input padding\n */\n@customElement('hy-select')\nexport class HySelectComponent extends NuralyUIBaseMixin(LitElement) implements SelectHost {\n static override styles = styles;\n \n // Temporarily disable dependency validation\n override requiredComponents = [];\n\n // === Properties ===\n \n /** Array of options to display in the select dropdown */\n @property({ type: Array }) \n options: SelectOption[] = [];\n \n /** Default selected values (for initialization) */\n @property({ type: Array, attribute: 'default-value' }) \n defaultValue: string[] = [];\n \n /** Placeholder text shown when no option is selected */\n @property({ type: String }) \n placeholder: string = 'Select an option';\n \n /** Disables the select component */\n @property({ type: Boolean, reflect: true }) \n disabled: boolean = false;\n \n /** Select display type (default, inline, button, slot) */\n @property({ type: String, reflect: true }) \n type: SelectType = SelectType.Default;\n \n /** Enables multiple option selection */\n @property({ type: Boolean, attribute: 'multiple' }) \n multiple: boolean = false;\n \n /** Controls dropdown visibility */\n @property({ type: Boolean, reflect: true }) \n show: boolean = false;\n \n /** Validation status (default, warning, error, success) */\n @property({ type: String, reflect: true }) \n status: SelectStatus = SelectStatus.Default;\n \n /** Select size (small, medium, large) */\n @property({ type: String, reflect: true }) \n size: SelectSize = SelectSize.Medium;\n \n /** Makes the select required for form validation */\n @property({ type: Boolean, reflect: true }) \n required: boolean = false;\n \n /** Form field name */\n @property({ type: String }) \n name: string = '';\n \n /** Current selected value(s) */\n @property({ type: String }) \n value: string | string[] = '';\n \n /** Message to display when no options are available */\n @property({ type: String, attribute: 'no-options-message' })\n noOptionsMessage: string = 'No options available';\n \n /** Icon to display with the no options message */\n @property({ type: String, attribute: 'no-options-icon' })\n noOptionsIcon: string = 'circle-info';\n \n /** Enable search/filter functionality */\n @property({ type: Boolean, reflect: true })\n searchable: boolean = false;\n \n /** Placeholder text for the search input */\n @property({ type: String, attribute: 'search-placeholder' })\n searchPlaceholder: string = 'Search options...';\n \n /** Current search query */\n @property({ type: String })\n searchQuery: string = '';\n\n // === Query selectors ===\n \n /** Options dropdown container element */\n @query('.options') \n optionsElement!: HTMLElement;\n \n /** Main wrapper element */\n @query('.wrapper') \n wrapper!: HTMLElement;\n \n /** Search input element */\n @query('.search-input')\n searchInput?: HTMLInputElement;\n\n // === Controller instances ===\n \n /** Handles option selection logic */\n private selectionController = new SelectSelectionController(this);\n \n /** Manages dropdown visibility and positioning */\n private dropdownController = new SelectDropdownController(this);\n \n /** Handles keyboard navigation */\n private keyboardController = new SelectKeyboardController(this, this.selectionController, this.dropdownController);\n \n /** Manages focus states */\n private focusController = new SelectFocusController(this);\n \n /** Handles validation logic */\n private validationController = new SelectValidationController(this, this.selectionController);\n \n /** Handles search/filter functionality */\n private searchController = new SelectSearchController(this);\n \n /** Handles all event management */\n private eventController = new SelectEventController(this);\n\n // === Lifecycle methods ===\n \n /**\n * Component connected to DOM - initialize base functionality\n */\n override connectedCallback(): void {\n super.connectedCallback();\n // Window click listener is setup only when dropdown opens for better performance\n }\n\n /**\n * Component disconnected from DOM - cleanup event listeners\n */\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n // Event cleanup is now handled by EventController\n }\n\n /**\n * First render complete - setup controllers and initialize state\n */\n override firstUpdated(changedProperties: any): void {\n super.firstUpdated(changedProperties);\n \n // Configure dropdown controller with DOM element references\n if (this.optionsElement && this.wrapper) {\n this.dropdownController.setElements(this.optionsElement, this.wrapper);\n } else {\n // Retry element setup if DOM isn't ready yet\n setTimeout(() => {\n if (this.optionsElement && this.wrapper) {\n this.dropdownController.setElements(this.optionsElement, this.wrapper);\n }\n }, 100);\n }\n\n // Apply default selection if specified\n if (this.defaultValue.length > 0) {\n this.selectionController.initializeFromDefaultValue();\n }\n }\n\n // === Public API Methods ===\n\n /**\n * Gets the currently selected options\n * @returns Array of selected options\n */\n get selectedOptions(): SelectOption[] {\n return this.selectionController.getSelectedOptions();\n }\n\n /**\n * Gets the first selected option (for single selection mode)\n * @returns Selected option or undefined if none selected\n */\n get selectedOption(): SelectOption | undefined {\n return this.selectionController.getSelectedOption();\n }\n\n /**\n * Selects an option programmatically\n * @param option - The option to select\n */\n selectOption(option: SelectOption): void {\n this.selectionController.selectOption(option);\n }\n\n /**\n * Unselects an option programmatically\n * @param option - The option to unselect\n */\n unselectOption(option: SelectOption): void {\n this.selectionController.unselectOption(option);\n }\n\n /**\n * Clears all current selections\n */\n clearSelection(): void {\n this.selectionController.clearSelection();\n }\n\n /**\n * Checks if a specific option is currently selected\n * @param option - The option to check\n * @returns True if the option is selected\n */\n isOptionSelected(option: SelectOption): boolean {\n return this.selectionController.isOptionSelected(option);\n }\n\n /**\n * Toggles the dropdown visibility\n */\n toggleDropdown(): void {\n this.dropdownController.toggle();\n }\n\n /**\n * Opens the dropdown programmatically\n */\n openDropdown(): void {\n this.dropdownController.open();\n }\n\n /**\n * Closes the dropdown programmatically\n */\n closeDropdown(): void {\n this.dropdownController.close();\n }\n\n /**\n * Focuses the select component\n */\n override focus(): void {\n this.focusController.focus();\n }\n\n /**\n * Removes focus from the select component\n */\n override blur(): void {\n this.focusController.blur();\n }\n\n /**\n * Validates the current selection according to component rules\n * @returns True if valid, false otherwise\n */\n validate(): boolean {\n return this.validationController.validate();\n }\n\n /**\n * Checks if the current selection is valid without showing validation UI\n * @returns True if valid, false otherwise\n */\n checkValidity(): boolean {\n return this.validationController.checkValidity();\n }\n\n /**\n * Reports the current validation state and shows validation UI if invalid\n * @returns True if valid, false otherwise\n */\n reportValidity(): boolean {\n return this.validationController.reportValidity();\n }\n\n /**\n * Sets a custom validation message\n * @param message - Custom validation message (empty string to clear)\n */\n setCustomValidity(message: string): void {\n this.validationController.setCustomValidity(message);\n }\n\n /**\n * Searches for options with the given query\n * @param query - Search query string\n */\n searchOptions(query: string): void {\n this.searchController.search(query);\n }\n\n /**\n * Clears the current search query\n */\n clearSearch(): void {\n this.searchController.clearSearch();\n }\n\n /**\n * Gets the filtered options based on current search\n * @returns Array of filtered options\n */\n getSearchFilteredOptions(): SelectOption[] {\n return this.searchController.getFilteredOptions(this.options);\n }\n\n /**\n * Gets the current search query\n * @returns Current search query string\n */\n getCurrentSearchQuery(): string {\n return this.searchController.searchQuery;\n }\n\n /**\n * Manually trigger setup of global event listeners\n */\n setupGlobalEventListeners(): void {\n this.eventController.setupEventListeners();\n }\n\n /**\n * Manually trigger removal of global event listeners\n */\n removeGlobalEventListeners(): void {\n this.eventController.removeEventListeners();\n }\n\n // === Private Event Handlers ===\n // Note: Event handling logic has been extracted to SelectEventController\n // These methods serve as thin wrappers for template bindings\n \n /**\n * Handles clicks on the select trigger element\n */\n private handleTriggerClick = (event: Event): void => {\n this.eventController.handleTriggerClick(event);\n };\n\n /**\n * Handles clicks on individual options\n */\n private handleOptionClick = (event: Event, option: SelectOption): void => {\n this.eventController.handleOptionClick(event, option);\n };\n\n /**\n * Handles removal of selected tags in multiple selection mode\n */\n private handleTagRemove = (event: Event, option: SelectOption): void => {\n this.eventController.handleTagRemove(event, option);\n };\n\n /**\n * Handles the clear all selections button\n */\n private handleClearAll = (event: Event): void => {\n this.eventController.handleClearAll(event);\n };\n\n /**\n * Handles keyboard navigation and interactions\n */\n private handleKeyDown = (event: KeyboardEvent): void => {\n this.eventController.handleKeyDown(event);\n };\n\n /**\n * Handles focus events\n */\n private handleFocus = (): void => {\n this.eventController.handleFocus();\n };\n\n /**\n * Handles blur events\n */\n private handleBlur = (): void => {\n this.eventController.handleBlur();\n };\n\n /**\n * Filters options based on search query\n */\n private getFilteredOptions(): SelectOption[] {\n return this.searchController.getFilteredOptions(this.options);\n };\n\n // === Event Listener Management ===\n \n /**\n * Sets up global event listeners (called when dropdown opens)\n */\n public setupEventListeners(): void {\n this.eventController.setupEventListeners();\n }\n\n /**\n * Removes global event listeners (called on disconnect or dropdown close)\n */\n public removeEventListeners(): void {\n this.eventController.removeEventListeners();\n }\n\n // === Main Render Method ===\n \n /**\n * Main render method that delegates to specific type renderers\n */\n protected override render() {\n return html`${choose(this.type, [\n [SelectType.Default, () => this.renderDefault()],\n [SelectType.Inline, () => this.renderInline()],\n [SelectType.Button, () => this.renderButton()],\n [SelectType.Slot, () => this.renderSlot()],\n ])}`;\n }\n\n // === Type-Specific Render Methods ===\n \n /**\n * Renders the default select appearance with full features\n */\n private renderDefault() {\n const selectedOptions = this.selectedOptions;\n const validationClasses = this.validationController.getValidationClasses();\n \n return html`\n <slot name=\"label\"></slot>\n <div \n class=\"${classMap({\n 'wrapper': true,\n ...validationClasses\n })}\"\n tabindex=\"0\"\n role=\"combobox\"\n aria-expanded=\"${this.show}\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"select-label\"\n\n @click=${this.handleTriggerClick}\n @keydown=${this.handleKeyDown}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n >\n <div class=\"select\">\n <div class=\"select-trigger\">\n ${this.renderSelectedContent(selectedOptions)}\n </div>\n \n <div class=\"icons-container\">\n ${this.renderStatusIcon()}\n ${this.renderClearButton(selectedOptions)}\n <hy-icon \n name=\"angle-down\" \n class=\"arrow-icon\"\n aria-hidden=\"true\"\n ></hy-icon>\n </div>\n \n <div \n class=\"options\"\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n >\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n </div>\n </div>\n \n ${this.renderValidationMessage()}\n <slot name=\"helper-text\"></slot>\n `;\n }\n\n /**\n * Renders inline select with integrated label and helper text\n */\n private renderInline() {\n return html`\n <slot name=\"label\"></slot>\n ${this.renderDefault()}\n <slot name=\"helper-text\"></slot>\n `;\n }\n\n /**\n * Renders select as a button-style component\n */\n private renderButton() {\n const selectedOptions = this.selectedOptions;\n return html`\n <button\n class=\"select-button\"\n ?disabled=${this.disabled}\n @click=${this.handleTriggerClick}\n @keydown=${this.handleKeyDown}\n >\n ${selectedOptions.length > 0 ? selectedOptions[0].label : this.placeholder}\n <hy-icon name=\"angle-down\" class=\"arrow-icon\"></hy-icon>\n </button>\n \n <div class=\"options\" role=\"listbox\">\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n `;\n }\n\n /**\n * Renders select with custom trigger content via slots\n */\n private renderSlot() {\n return html`\n <slot name=\"trigger\" @click=${this.handleTriggerClick}></slot>\n <div class=\"options\" role=\"listbox\">\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n `;\n }\n\n // === Helper Render Methods ===\n \n /**\n * Renders the selected content in the trigger area\n */\n private renderSelectedContent(selectedOptions: SelectOption[]) {\n if (selectedOptions.length === 0) {\n return html`<span class=\"placeholder\" aria-hidden=\"true\">${this.placeholder}</span>`;\n }\n\n if (this.multiple) {\n return map(selectedOptions, (option) => html`\n <span class=\"tag\">\n <span class=\"tag-label\">${option.label}</span>\n <hy-icon \n name=\"remove\"\n class=\"tag-close\"\n @click=${(e: Event) => this.handleTagRemove(e, option)}\n aria-label=\"Remove ${option.label}\"\n ></hy-icon>\n </span>\n `);\n } else {\n return html`${selectedOptions[0].label}`;\n }\n }\n\n /**\n * Renders status/validation icons based on current status\n */\n private renderStatusIcon() {\n switch (this.status) {\n case SelectStatus.Warning:\n return html`<hy-icon name=\"warning\" class=\"status-icon warning\"></hy-icon>`;\n case SelectStatus.Error:\n return html`<hy-icon name=\"exclamation-circle\" class=\"status-icon error\"></hy-icon>`;\n case SelectStatus.Success:\n return html`<hy-icon name=\"check-circle\" class=\"status-icon success\"></hy-icon>`;\n default:\n return nothing;\n }\n }\n\n /**\n * Renders the clear all selections button when applicable\n */\n private renderClearButton(selectedOptions: SelectOption[]) {\n if (selectedOptions.length === 0 || this.disabled) {\n return nothing;\n }\n\n return html`\n <hy-icon\n name=\"remove\"\n class=\"clear-icon\"\n @click=${this.handleClearAll}\n aria-label=\"Clear selection\"\n tabindex=\"-1\"\n ></hy-icon>\n `;\n }\n\n /**\n * Renders all available options in the dropdown\n */\n private renderSelectOptions() {\n const filteredOptions = this.getFilteredOptions();\n \n // Show \"no options\" message when no options are available (original array empty)\n if (!this.options || this.options.length === 0) {\n return html`\n <div class=\"no-options\" role=\"option\" aria-disabled=\"true\">\n <div class=\"no-options-content\">\n <hy-icon \n name=\"${this.noOptionsIcon}\" \n class=\"no-options-icon\"\n aria-hidden=\"true\">\n </hy-icon>\n <span class=\"no-options-text\">${this.noOptionsMessage}</span>\n </div>\n </div>\n `;\n }\n \n // Show \"no results\" message when search returns no results\n if (this.searchController.hasNoResults(this.options)) {\n return this.searchController.renderNoResults();\n }\n \n // Cache the focused option to avoid multiple controller accesses\n const focusedOption = this.keyboardController.focusedOption;\n \n return map(filteredOptions, (option) => {\n const isSelected = this.isOptionSelected(option);\n const isFocused = focusedOption && focusedOption.value === option.value;\n \n return html`\n <div\n class=\"${classMap({\n 'option': true,\n 'selected': isSelected,\n 'focused': isFocused,\n 'disabled': Boolean(option.disabled)\n })}\"\n role=\"option\"\n aria-selected=\"${isSelected}\"\n aria-disabled=\"${Boolean(option.disabled)}\"\n data-value=\"${option.value}\"\n @click=${(e: Event) => this.handleOptionClick(e, option)}\n style=${styleMap(option.style ? { style: option.style } : {})}\n title=\"${option.title || ''}\"\n >\n <div class=\"option-content\">\n ${option.icon ? html`<hy-icon name=\"${option.icon}\" class=\"option-icon\"></hy-icon>` : nothing}\n <div class=\"option-text\">\n ${option.htmlContent ? html`<div .innerHTML=${option.htmlContent}></div>` : option.label}\n ${option.description ? html`<div class=\"option-description\">${option.description}</div>` : nothing}\n </div>\n </div>\n \n ${isSelected ? html`<hy-icon name=\"check\" class=\"check-icon\" aria-hidden=\"true\"></hy-icon>` : nothing}\n \n ${option.state && option.message ? html`\n <div class=\"option-message ${option.state}\">\n <hy-icon name=\"${option.state === 'error' ? 'exclamation-circle' : 'warning'}\"></hy-icon>\n <span>${option.message}</span>\n </div>\n ` : nothing}\n </div>\n `;\n });\n }\n\n /**\n * Renders the search input when searchable is enabled\n */\n private renderSearchInput() {\n return this.searchController.renderSearchInput();\n }\n\n /**\n * Renders validation message when present\n */\n private renderValidationMessage() {\n const validationMessage = this.validationController.validationMessage;\n if (!validationMessage) return nothing;\n\n return html`\n <div class=\"validation-message ${this.status}\" id=\"validation-message\">\n ${validationMessage}\n </div>\n `;\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../src/components/select/select.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM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CAAC;+CACL;AAIrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDACjB;AAI1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACT;AAIlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACG;AAI9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;2DACV;AAIlD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;wDACnB;AAItC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDACf;AAI5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;4DACZ;AAIhD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACF;AAIzB;IADC,KAAK,CAAC,UAAU,CAAC;yDACW;AAI7B;IADC,KAAK,CAAC,UAAU,CAAC;kDACI;AAItB;IADC,KAAK,CAAC,eAAe,CAAC;sDACQ;AAnFpB,iBAAiB;IAD7B,aAAa,CAAC,WAAW,CAAC;GACd,iBAAiB,CAkoB7B;SAloBY,iBAAiB","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, html, nothing } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { styles } from './select.style.js';\nimport { map } from 'lit/directives/map.js';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\n\n// Import types\nimport {\n SelectOption,\n SelectType,\n SelectSize,\n SelectStatus\n} from './select.types.js';\n\n// Import controllers\nimport {\n SelectSelectionController,\n SelectKeyboardController,\n SelectDropdownController,\n SelectFocusController,\n SelectValidationController,\n SelectSearchController,\n SelectEventController\n} from './controllers/index.js';\n\n// Import interfaces\nimport { SelectHost } from './interfaces/index.js';\n\n/**\n * Advanced select component with multiple selection modes, validation, and accessibility features.\n * \n * Supports single and multiple selection, custom rendering, validation states, keyboard navigation,\n * and various display types including default, inline, button, and slot-based configurations.\n * \n * @example\n * ```html\n * <!-- Basic select -->\n * <hy-select placeholder=\"Choose an option\">\n * <option value=\"1\">Option 1</option>\n * <option value=\"2\">Option 2</option>\n * </hy-select>\n * \n * <!-- Multiple selection -->\n * <hy-select multiple placeholder=\"Choose multiple options\"></hy-select>\n * \n * <!-- With validation -->\n * <hy-select required status=\"error\"></hy-select>\n * \n * <!-- Button style -->\n * <hy-select type=\"button\"></hy-select>\n * \n * <!-- With search functionality -->\n * <hy-select searchable search-placeholder=\"Search options...\"></hy-select>\n * ```\n * \n * @fires nr-change - Selection changed\n * @fires nr-focus - Component focused \n * @fires nr-blur - Component blurred\n * @fires nr-dropdown-open - Dropdown opened\n * @fires nr-dropdown-close - Dropdown closed\n * @fires nr-validation - Validation state changed\n * \n * @slot label - Select label content\n * @slot helper-text - Helper text below select\n * @slot trigger - Custom trigger content (slot type only)\n * \n * @cssproperty --select-border-color - Border color\n * @cssproperty --select-background - Background color\n * @cssproperty --select-text-color - Text color\n * @cssproperty --select-focus-color - Focus indicator color\n * @cssproperty --select-dropdown-shadow - Dropdown shadow\n * @cssproperty --select-no-options-color - No options message text color\n * @cssproperty --select-no-options-icon-color - No options icon color\n * @cssproperty --select-no-options-padding - Padding for no options message\n * @cssproperty --select-no-options-gap - Gap between icon and text\n * @cssproperty --select-search-border - Search input border\n * @cssproperty --select-search-background - Search input background\n * @cssproperty --select-search-padding - Search input padding\n */\n@customElement('hy-select')\nexport class HySelectComponent extends NuralyUIBaseMixin(LitElement) implements SelectHost {\n static override styles = styles;\n \n override requiredComponents = [ \"nr-input\", \"hy-icon\" ];\n\n /** Array of options to display in the select dropdown */\n @property({ type: Array }) \n options: SelectOption[] = [];\n \n /** Default selected values (for initialization) */\n @property({ type: Array, attribute: 'default-value' }) \n defaultValue: string[] = [];\n \n /** Placeholder text shown when no option is selected */\n @property({ type: String }) \n placeholder: string = 'Select an option';\n \n /** Disables the select component */\n @property({ type: Boolean, reflect: true }) \n disabled: boolean = false;\n \n /** Select display type (default, inline, button, slot) */\n @property({ type: String, reflect: true }) \n type: SelectType = SelectType.Default;\n \n /** Enables multiple option selection */\n @property({ type: Boolean, attribute: 'multiple' }) \n multiple: boolean = false;\n \n /** Controls dropdown visibility */\n @property({ type: Boolean, reflect: true }) \n show: boolean = false;\n \n /** Validation status (default, warning, error, success) */\n @property({ type: String, reflect: true }) \n status: SelectStatus = SelectStatus.Default;\n \n /** Select size (small, medium, large) */\n @property({ type: String, reflect: true }) \n size: SelectSize = SelectSize.Medium;\n \n /** Makes the select required for form validation */\n @property({ type: Boolean, reflect: true }) \n required: boolean = false;\n \n /** Form field name */\n @property({ type: String }) \n name: string = '';\n \n /** Current selected value(s) */\n @property({ type: String }) \n value: string | string[] = '';\n \n /** Message to display when no options are available */\n @property({ type: String, attribute: 'no-options-message' })\n noOptionsMessage: string = 'No options available';\n \n /** Icon to display with the no options message */\n @property({ type: String, attribute: 'no-options-icon' })\n noOptionsIcon: string = 'circle-info';\n \n /** Enable search/filter functionality */\n @property({ type: Boolean, reflect: true })\n searchable: boolean = false;\n \n /** Placeholder text for the search input */\n @property({ type: String, attribute: 'search-placeholder' })\n searchPlaceholder: string = 'Search options...';\n \n /** Current search query */\n @property({ type: String })\n searchQuery: string = '';\n\n /** Options dropdown container element */\n @query('.options') \n optionsElement!: HTMLElement;\n \n /** Main wrapper element */\n @query('.wrapper') \n wrapper!: HTMLElement;\n \n /** Search input element */\n @query('.search-input')\n searchInput?: HTMLInputElement;\n\n /** Handles option selection logic */\n private selectionController = new SelectSelectionController(this);\n \n /** Manages dropdown visibility and positioning */\n private dropdownController = new SelectDropdownController(this);\n \n /** Handles keyboard navigation */\n private keyboardController = new SelectKeyboardController(this, this.selectionController, this.dropdownController);\n \n /** Manages focus states */\n private focusController = new SelectFocusController(this);\n \n /** Handles validation logic */\n private validationController = new SelectValidationController(this, this.selectionController);\n \n /** Handles search/filter functionality */\n private searchController = new SelectSearchController(this);\n \n /** Handles all event management */\n private eventController = new SelectEventController(this);\n\n /**\n * Component connected to DOM - initialize base functionality\n */\n override connectedCallback(): void {\n super.connectedCallback();\n }\n\n /**\n * Component disconnected from DOM - cleanup event listeners\n */\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n\n /**\n * First render complete - setup controllers and initialize state\n */\n override firstUpdated(changedProperties: any): void {\n super.firstUpdated(changedProperties);\n \n // Configure dropdown controller with DOM element references\n if (this.optionsElement && this.wrapper) {\n this.dropdownController.setElements(this.optionsElement, this.wrapper);\n } else {\n // Retry element setup if DOM isn't ready yet\n setTimeout(() => {\n if (this.optionsElement && this.wrapper) {\n this.dropdownController.setElements(this.optionsElement, this.wrapper);\n }\n }, 100);\n }\n\n // Apply default selection if specified\n if (this.defaultValue.length > 0) {\n this.selectionController.initializeFromDefaultValue();\n }\n }\n\n // === Public API Methods ===\n\n /**\n * Gets the currently selected options\n * @returns Array of selected options\n */\n get selectedOptions(): SelectOption[] {\n return this.selectionController.getSelectedOptions();\n }\n\n /**\n * Gets the first selected option (for single selection mode)\n * @returns Selected option or undefined if none selected\n */\n get selectedOption(): SelectOption | undefined {\n return this.selectionController.getSelectedOption();\n }\n\n /**\n * Selects an option programmatically\n * @param option - The option to select\n */\n selectOption(option: SelectOption): void {\n this.selectionController.selectOption(option);\n }\n\n /**\n * Unselects an option programmatically\n * @param option - The option to unselect\n */\n unselectOption(option: SelectOption): void {\n this.selectionController.unselectOption(option);\n }\n\n /**\n * Clears all current selections\n */\n clearSelection(): void {\n this.selectionController.clearSelection();\n }\n\n /**\n * Checks if a specific option is currently selected\n * @param option - The option to check\n * @returns True if the option is selected\n */\n isOptionSelected(option: SelectOption): boolean {\n return this.selectionController.isOptionSelected(option);\n }\n\n /**\n * Toggles the dropdown visibility\n */\n toggleDropdown(): void {\n this.dropdownController.toggle();\n }\n\n /**\n * Opens the dropdown programmatically\n */\n openDropdown(): void {\n this.dropdownController.open();\n }\n\n /**\n * Closes the dropdown programmatically\n */\n closeDropdown(): void {\n this.dropdownController.close();\n }\n\n /**\n * Focuses the select component\n */\n override focus(): void {\n this.focusController.focus();\n }\n\n /**\n * Removes focus from the select component\n */\n override blur(): void {\n this.focusController.blur();\n }\n\n /**\n * Validates the current selection according to component rules\n * @returns True if valid, false otherwise\n */\n validate(): boolean {\n return this.validationController.validate();\n }\n\n /**\n * Checks if the current selection is valid without showing validation UI\n * @returns True if valid, false otherwise\n */\n checkValidity(): boolean {\n return this.validationController.checkValidity();\n }\n\n /**\n * Reports the current validation state and shows validation UI if invalid\n * @returns True if valid, false otherwise\n */\n reportValidity(): boolean {\n return this.validationController.reportValidity();\n }\n\n /**\n * Sets a custom validation message\n * @param message - Custom validation message (empty string to clear)\n */\n setCustomValidity(message: string): void {\n this.validationController.setCustomValidity(message);\n }\n\n /**\n * Searches for options with the given query\n * @param query - Search query string\n */\n searchOptions(query: string): void {\n this.searchController.search(query);\n }\n\n /**\n * Clears the current search query\n */\n clearSearch(): void {\n this.searchController.clearSearch();\n }\n\n /**\n * Gets the filtered options based on current search\n * @returns Array of filtered options\n */\n getSearchFilteredOptions(): SelectOption[] {\n return this.searchController.getFilteredOptions(this.options);\n }\n\n /**\n * Gets the current search query\n * @returns Current search query string\n */\n getCurrentSearchQuery(): string {\n return this.searchController.searchQuery;\n }\n\n /**\n * Manually trigger setup of global event listeners\n */\n setupGlobalEventListeners(): void {\n this.eventController.setupEventListeners();\n }\n\n /**\n * Manually trigger removal of global event listeners\n */\n removeGlobalEventListeners(): void {\n this.eventController.removeEventListeners();\n }\n\n \n /**\n * Handles clicks on the select trigger element\n */\n private handleTriggerClick = (event: Event): void => {\n this.eventController.handleTriggerClick(event);\n };\n\n /**\n * Handles clicks on individual options\n */\n private handleOptionClick = (event: Event, option: SelectOption): void => {\n this.eventController.handleOptionClick(event, option);\n };\n\n /**\n * Handles removal of selected tags in multiple selection mode\n */\n private handleTagRemove = (event: Event, option: SelectOption): void => {\n this.eventController.handleTagRemove(event, option);\n };\n\n /**\n * Handles the clear all selections button\n */\n private handleClearAll = (event: Event): void => {\n this.eventController.handleClearAll(event);\n };\n\n /**\n * Handles keyboard navigation and interactions\n */\n private handleKeyDown = (event: KeyboardEvent): void => {\n this.eventController.handleKeyDown(event);\n };\n\n /**\n * Handles focus events\n */\n private handleFocus = (): void => {\n this.eventController.handleFocus();\n };\n\n /**\n * Handles blur events\n */\n private handleBlur = (): void => {\n this.eventController.handleBlur();\n };\n\n /**\n * Filters options based on search query\n */\n private getFilteredOptions(): SelectOption[] {\n return this.searchController.getFilteredOptions(this.options);\n };\n\n /**\n * Sets up global event listeners (called when dropdown opens)\n */\n public setupEventListeners(): void {\n this.eventController.setupEventListeners();\n }\n\n /**\n * Removes global event listeners (called on disconnect or dropdown close)\n */\n public removeEventListeners(): void {\n this.eventController.removeEventListeners();\n }\n \n /**\n * Main render method that delegates to specific type renderers\n */\n protected override render() {\n return html`${choose(this.type, [\n [SelectType.Default, () => this.renderDefault()],\n [SelectType.Inline, () => this.renderInline()],\n [SelectType.Button, () => this.renderButton()],\n [SelectType.Slot, () => this.renderSlot()],\n ])}`;\n }\n /**\n * Renders the default select appearance with full features\n */\n private renderDefault() {\n const selectedOptions = this.selectedOptions;\n const validationClasses = this.validationController.getValidationClasses();\n \n return html`\n <slot name=\"label\"></slot>\n <div \n class=\"${classMap({\n 'wrapper': true,\n ...validationClasses\n })}\"\n tabindex=\"0\"\n role=\"combobox\"\n aria-expanded=\"${this.show}\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"select-label\"\n\n @click=${this.handleTriggerClick}\n @keydown=${this.handleKeyDown}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n >\n <div class=\"select\">\n <div class=\"select-trigger\">\n ${this.renderSelectedContent(selectedOptions)}\n </div>\n \n <div class=\"icons-container\">\n ${this.renderStatusIcon()}\n ${this.renderClearButton(selectedOptions)}\n <hy-icon \n name=\"angle-down\" \n class=\"arrow-icon\"\n aria-hidden=\"true\"\n ></hy-icon>\n </div>\n \n <div \n class=\"options\"\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n >\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n </div>\n </div>\n \n ${this.renderValidationMessage()}\n <slot name=\"helper-text\"></slot>\n `;\n }\n\n /**\n * Renders inline select with integrated label and helper text\n */\n private renderInline() {\n return html`\n <slot name=\"label\"></slot>\n ${this.renderDefault()}\n <slot name=\"helper-text\"></slot>\n `;\n }\n\n /**\n * Renders select as a button-style component\n */\n private renderButton() {\n const selectedOptions = this.selectedOptions;\n return html`\n <button\n class=\"select-button\"\n ?disabled=${this.disabled}\n @click=${this.handleTriggerClick}\n @keydown=${this.handleKeyDown}\n >\n ${selectedOptions.length > 0 ? selectedOptions[0].label : this.placeholder}\n <hy-icon name=\"angle-down\" class=\"arrow-icon\"></hy-icon>\n </button>\n \n <div class=\"options\" role=\"listbox\">\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n `;\n }\n\n /**\n * Renders select with custom trigger content via slots\n */\n private renderSlot() {\n return html`\n <slot name=\"trigger\" @click=${this.handleTriggerClick}></slot>\n <div class=\"options\" role=\"listbox\">\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n `;\n }\n\n /**\n * Renders the selected content in the trigger area\n */\n private renderSelectedContent(selectedOptions: SelectOption[]) {\n if (selectedOptions.length === 0) {\n return html`<span class=\"placeholder\" aria-hidden=\"true\">${this.placeholder}</span>`;\n }\n\n if (this.multiple) {\n return map(selectedOptions, (option) => html`\n <span class=\"tag\">\n <span class=\"tag-label\">${option.label}</span>\n <hy-icon \n name=\"remove\"\n class=\"tag-close\"\n @click=${(e: Event) => this.handleTagRemove(e, option)}\n aria-label=\"Remove ${option.label}\"\n ></hy-icon>\n </span>\n `);\n } else {\n return html`${selectedOptions[0].label}`;\n }\n }\n\n /**\n * Renders status/validation icons based on current status\n */\n private renderStatusIcon() {\n switch (this.status) {\n case SelectStatus.Warning:\n return html`<hy-icon name=\"warning\" class=\"status-icon warning\"></hy-icon>`;\n case SelectStatus.Error:\n return html`<hy-icon name=\"exclamation-circle\" class=\"status-icon error\"></hy-icon>`;\n case SelectStatus.Success:\n return html`<hy-icon name=\"check-circle\" class=\"status-icon success\"></hy-icon>`;\n default:\n return nothing;\n }\n }\n\n /**\n * Renders the clear all selections button when applicable\n */\n private renderClearButton(selectedOptions: SelectOption[]) {\n if (selectedOptions.length === 0 || this.disabled) {\n return nothing;\n }\n\n return html`\n <hy-icon\n name=\"remove\"\n class=\"clear-icon\"\n @click=${this.handleClearAll}\n aria-label=\"Clear selection\"\n tabindex=\"-1\"\n ></hy-icon>\n `;\n }\n\n /**\n * Renders all available options in the dropdown\n */\n private renderSelectOptions() {\n const filteredOptions = this.getFilteredOptions();\n \n // Show \"no options\" message when no options are available (original array empty)\n if (!this.options || this.options.length === 0) {\n return html`\n <div class=\"no-options\" role=\"option\" aria-disabled=\"true\">\n <div class=\"no-options-content\">\n <hy-icon \n name=\"${this.noOptionsIcon}\" \n class=\"no-options-icon\"\n aria-hidden=\"true\">\n </hy-icon>\n <span class=\"no-options-text\">${this.noOptionsMessage}</span>\n </div>\n </div>\n `;\n }\n \n // Show \"no results\" message when search returns no results\n if (this.searchController.hasNoResults(this.options)) {\n return this.searchController.renderNoResults();\n }\n \n // Cache the focused option to avoid multiple controller accesses\n const focusedOption = this.keyboardController.focusedOption;\n \n return map(filteredOptions, (option) => {\n const isSelected = this.isOptionSelected(option);\n const isFocused = focusedOption && focusedOption.value === option.value;\n \n return html`\n <div\n class=\"${classMap({\n 'option': true,\n 'selected': isSelected,\n 'focused': isFocused,\n 'disabled': Boolean(option.disabled)\n })}\"\n role=\"option\"\n aria-selected=\"${isSelected}\"\n aria-disabled=\"${Boolean(option.disabled)}\"\n data-value=\"${option.value}\"\n @click=${(e: Event) => this.handleOptionClick(e, option)}\n style=${styleMap(option.style ? { style: option.style } : {})}\n title=\"${option.title || ''}\"\n >\n <div class=\"option-content\">\n ${option.icon ? html`<hy-icon name=\"${option.icon}\" class=\"option-icon\"></hy-icon>` : nothing}\n <div class=\"option-text\">\n ${option.htmlContent ? html`<div .innerHTML=${option.htmlContent}></div>` : option.label}\n ${option.description ? html`<div class=\"option-description\">${option.description}</div>` : nothing}\n </div>\n </div>\n \n ${isSelected ? html`<hy-icon name=\"check\" class=\"check-icon\" aria-hidden=\"true\"></hy-icon>` : nothing}\n \n ${option.state && option.message ? html`\n <div class=\"option-message ${option.state}\">\n <hy-icon name=\"${option.state === 'error' ? 'exclamation-circle' : 'warning'}\"></hy-icon>\n <span>${option.message}</span>\n </div>\n ` : nothing}\n </div>\n `;\n });\n }\n\n /**\n * Renders the search input when searchable is enabled\n */\n private renderSearchInput() {\n return this.searchController.renderSearchInput();\n }\n\n /**\n * Renders validation message when present\n */\n private renderValidationMessage() {\n const validationMessage = this.validationController.validationMessage;\n if (!validationMessage) return nothing;\n\n return html`\n <div class=\"validation-message ${this.status}\" id=\"validation-message\">\n ${validationMessage}\n </div>\n `;\n }\n}"]}
|
package/select.style.js
CHANGED
|
@@ -9,6 +9,7 @@ export const styles = css `
|
|
|
9
9
|
font-family: var(--hybrid-select-font-family, var(--hybrid-select-local-font-family));
|
|
10
10
|
font-size: var(--hybrid-select-font-size, var(--hybrid-select-local-font-size));
|
|
11
11
|
line-height: var(--hybrid-select-line-height, var(--hybrid-select-local-line-height));
|
|
12
|
+
margin: var(--hybrid-select-margin, var(--hybrid-select-local-wrapper-margin));
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
/* Host attribute selectors for configuration */
|
|
@@ -42,19 +43,31 @@ export const styles = css `
|
|
|
42
43
|
:host([size='small']) .wrapper {
|
|
43
44
|
min-height: var(--hybrid-select-small-height, var(--hybrid-select-local-small-height));
|
|
44
45
|
font-size: var(--hybrid-select-small-font-size, var(--hybrid-select-local-small-font-size));
|
|
45
|
-
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host([size='small']) .select-trigger {
|
|
49
|
+
padding: var(--hybrid-select-small-padding, var(--hybrid-select-local-small-padding));
|
|
50
|
+
padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
:host([size='medium']) .wrapper {
|
|
49
54
|
min-height: var(--hybrid-select-medium-height, var(--hybrid-select-local-medium-height));
|
|
50
55
|
font-size: var(--hybrid-select-medium-font-size, var(--hybrid-select-local-medium-font-size));
|
|
51
|
-
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([size='medium']) .select-trigger {
|
|
59
|
+
padding: var(--hybrid-select-medium-padding, var(--hybrid-select-local-medium-padding));
|
|
60
|
+
padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
:host([size='large']) .wrapper {
|
|
55
64
|
min-height: var(--hybrid-select-large-height, var(--hybrid-select-local-large-height));
|
|
56
65
|
font-size: var(--hybrid-select-large-font-size, var(--hybrid-select-local-large-font-size));
|
|
57
|
-
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([size='large']) .select-trigger {
|
|
69
|
+
padding: var(--hybrid-select-large-padding, var(--hybrid-select-local-large-padding));
|
|
70
|
+
padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);
|
|
58
71
|
}
|
|
59
72
|
|
|
60
73
|
/* Status variants */
|
|
@@ -98,6 +111,10 @@ export const styles = css `
|
|
|
98
111
|
var(--hybrid-select-transition-timing, var(--hybrid-select-local-transition-timing));
|
|
99
112
|
cursor: pointer;
|
|
100
113
|
outline: none;
|
|
114
|
+
margin: var(--hybrid-select-wrapper-margin, 0);
|
|
115
|
+
min-height: var(--hybrid-select-min-height, var(--hybrid-select-local-min-height));
|
|
116
|
+
/* Ensure dropdown can overflow the wrapper */
|
|
117
|
+
overflow: visible;
|
|
101
118
|
}
|
|
102
119
|
|
|
103
120
|
.wrapper:hover:not(:disabled) {
|
|
@@ -114,14 +131,16 @@ export const styles = css `
|
|
|
114
131
|
.select {
|
|
115
132
|
display: flex;
|
|
116
133
|
flex-direction: column;
|
|
117
|
-
position: relative;
|
|
118
134
|
}
|
|
119
135
|
|
|
120
136
|
/* Select trigger (main display area) */
|
|
121
137
|
.select-trigger {
|
|
122
138
|
display: flex;
|
|
123
139
|
align-items: center;
|
|
124
|
-
padding:
|
|
140
|
+
padding: var(--hybrid-select-padding-top, var(--hybrid-select-local-padding-top))
|
|
141
|
+
calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px)
|
|
142
|
+
var(--hybrid-select-padding-bottom, var(--hybrid-select-local-padding-bottom))
|
|
143
|
+
var(--hybrid-select-padding-left, var(--hybrid-select-local-padding-left));
|
|
125
144
|
color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));
|
|
126
145
|
font-size: inherit;
|
|
127
146
|
line-height: inherit;
|
|
@@ -211,6 +230,7 @@ export const styles = css `
|
|
|
211
230
|
/* Default positioning - will be overridden by controller when opened */
|
|
212
231
|
position: absolute;
|
|
213
232
|
top: 100%;
|
|
233
|
+
margin-top: 1px;
|
|
214
234
|
left: 0;
|
|
215
235
|
right: 0;
|
|
216
236
|
background-color: var(--hybrid-select-dropdown-background, var(--hybrid-select-local-dropdown-background));
|
|
@@ -218,7 +238,7 @@ export const styles = css `
|
|
|
218
238
|
var(--hybrid-select-dropdown-border-color, var(--hybrid-select-local-dropdown-border-color));
|
|
219
239
|
border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius));
|
|
220
240
|
box-shadow: var(--hybrid-select-dropdown-shadow, var(--hybrid-select-local-dropdown-shadow));
|
|
221
|
-
z-index:
|
|
241
|
+
z-index: var(--hybrid-select-dropdown-z-index, var(--hybrid-select-local-dropdown-z-index));
|
|
222
242
|
max-height: 200px;
|
|
223
243
|
overflow-y: auto;
|
|
224
244
|
overflow-x: hidden;
|
|
@@ -228,11 +248,20 @@ export const styles = css `
|
|
|
228
248
|
/* Ensure proper containment and exact wrapper width */
|
|
229
249
|
box-sizing: border-box;
|
|
230
250
|
width: 100%;
|
|
251
|
+
/* Create new stacking context to prevent layering issues */
|
|
252
|
+
isolation: isolate;
|
|
253
|
+
/* Ensure solid background to prevent visual bleed-through */
|
|
254
|
+
backdrop-filter: none;
|
|
255
|
+
-webkit-backdrop-filter: none;
|
|
256
|
+
/* Force above other elements */
|
|
257
|
+
transform: translateZ(0);
|
|
231
258
|
}
|
|
232
259
|
|
|
233
260
|
.options.placement-top {
|
|
234
261
|
top: auto;
|
|
235
262
|
bottom: 100%;
|
|
263
|
+
margin-bottom: 1px;
|
|
264
|
+
margin-top: 0;
|
|
236
265
|
animation: dropdown-enter-top var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out;
|
|
237
266
|
}
|
|
238
267
|
|
package/select.style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.style.js","sourceRoot":"","sources":["../../../src/components/select/select.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmalB,CAAC","sourcesContent":["import { css } from 'lit';\nimport { selectVariables } from './select.style.variables.js';\n\nexport const styles = css`\n ${selectVariables}\n\n :host {\n width: fit-content;\n display: block;\n font-family: var(--hybrid-select-font-family, var(--hybrid-select-local-font-family));\n font-size: var(--hybrid-select-font-size, var(--hybrid-select-local-font-size));\n line-height: var(--hybrid-select-line-height, var(--hybrid-select-local-line-height));\n }\n\n /* Host attribute selectors for configuration */\n :host([disabled]) {\n opacity: var(--hybrid-select-disabled-opacity, var(--hybrid-select-local-disabled-opacity));\n pointer-events: none;\n }\n\n :host([disabled]) .wrapper {\n background-color: var(--hybrid-select-disabled-background, var(--hybrid-select-local-disabled-background));\n border-color: var(--hybrid-select-disabled-border-color, var(--hybrid-select-local-disabled-border-color));\n color: var(--hybrid-select-disabled-text-color, var(--hybrid-select-local-disabled-text-color));\n cursor: not-allowed;\n }\n\n /* Theme-specific styles */\n :host([theme='dark']) {\n --hybrid-select-local-background-color: #262626;\n --hybrid-select-local-border-color: #424242;\n --hybrid-select-local-text-color: #ffffff;\n --hybrid-select-local-placeholder-color: #8c8c8c;\n --hybrid-select-local-dropdown-background: #262626;\n --hybrid-select-local-dropdown-border-color: #424242;\n --hybrid-select-local-option-hover-background: #393939;\n --hybrid-select-local-option-selected-background: #1e3a5f;\n --hybrid-select-local-hover-border-color: #4096ff;\n --hybrid-select-local-focus-border-color: #4096ff;\n }\n\n /* Size variants */\n :host([size='small']) .wrapper {\n min-height: var(--hybrid-select-small-height, var(--hybrid-select-local-small-height));\n font-size: var(--hybrid-select-small-font-size, var(--hybrid-select-local-small-font-size));\n padding: 0;\n }\n\n :host([size='medium']) .wrapper {\n min-height: var(--hybrid-select-medium-height, var(--hybrid-select-local-medium-height));\n font-size: var(--hybrid-select-medium-font-size, var(--hybrid-select-local-medium-font-size));\n padding: 0;\n }\n\n :host([size='large']) .wrapper {\n min-height: var(--hybrid-select-large-height, var(--hybrid-select-local-large-height));\n font-size: var(--hybrid-select-large-font-size, var(--hybrid-select-local-large-font-size));\n padding: 0;\n }\n\n /* Status variants */\n :host([status='error']) .wrapper {\n border-color: var(--hybrid-select-error-border-color, var(--hybrid-select-local-error-border-color));\n }\n\n :host([status='warning']) .wrapper {\n border-color: var(--hybrid-select-warning-border-color, var(--hybrid-select-local-warning-border-color));\n }\n\n :host([status='success']) .wrapper {\n border-color: var(--hybrid-select-success-border-color, var(--hybrid-select-local-success-border-color));\n }\n\n /* Type variants */\n :host([type='inline']) {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n :host([type='inline']) .wrapper {\n flex: 1;\n }\n\n /* Show dropdown */\n :host([show]) .options {\n display: flex !important;\n }\n\n /* Main wrapper container */\n .wrapper {\n position: relative;\n width: var(--hybrid-select-width, var(--hybrid-select-local-width));\n background-color: var(--hybrid-select-background-color, var(--hybrid-select-local-background-color));\n border: var(--hybrid-select-border-width, var(--hybrid-select-local-border-width)) solid \n var(--hybrid-select-border-color, var(--hybrid-select-local-border-color));\n border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius));\n transition: all var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration)) \n var(--hybrid-select-transition-timing, var(--hybrid-select-local-transition-timing));\n cursor: pointer;\n outline: none;\n }\n\n .wrapper:hover:not(:disabled) {\n border-color: var(--hybrid-select-hover-border-color, var(--hybrid-select-local-hover-border-color));\n }\n\n .wrapper:focus,\n .wrapper:focus-within {\n border-color: var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color));\n box-shadow: 0 0 0 2px var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color))33;\n }\n\n /* Select container */\n .select {\n display: flex;\n flex-direction: column;\n position: relative;\n }\n\n /* Select trigger (main display area) */\n .select-trigger {\n display: flex;\n align-items: center;\n padding: 0 calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px) 0 12px;\n color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));\n font-size: inherit;\n line-height: inherit;\n word-break: break-word;\n min-height: inherit;\n flex-wrap: wrap;\n gap: var(--hybrid-select-tag-margin, var(--hybrid-select-local-tag-margin));\n }\n\n .select-trigger:empty:before {\n content: attr(data-placeholder);\n color: var(--hybrid-select-placeholder-color, var(--hybrid-select-local-placeholder-color));\n font-size: var(--hybrid-select-placeholder-font-size, var(--hybrid-select-local-placeholder-font-size));\n }\n\n /* Multi-select tags */\n .tag {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n background-color: var(--hybrid-select-tag-background, var(--hybrid-select-local-tag-background));\n color: var(--hybrid-select-tag-color, var(--hybrid-select-local-tag-color));\n padding: var(--hybrid-select-tag-padding, var(--hybrid-select-local-tag-padding));\n border-radius: var(--hybrid-select-tag-border-radius, var(--hybrid-select-local-tag-border-radius));\n font-size: calc(var(--hybrid-select-font-size, var(--hybrid-select-local-font-size)) - 1px);\n max-width: 100%;\n }\n\n .tag-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .tag-close {\n color: var(--hybrid-select-tag-close-color, var(--hybrid-select-local-tag-close-color));\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n height: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n border-radius: 50%;\n transition: color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n }\n\n .tag-close:hover {\n color: var(--hybrid-select-tag-close-hover-color, var(--hybrid-select-local-tag-close-hover-color));\n }\n\n /* Icons container */\n .icons-container {\n position: absolute;\n top: 50%;\n right: 12px;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n gap: 4px;\n pointer-events: none;\n }\n\n .icons-container hy-icon {\n --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n --hybrid-icon-color: var(--hybrid-select-icon-color, var(--hybrid-select-local-icon-color));\n pointer-events: auto;\n cursor: pointer;\n transition: color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n }\n\n .icons-container hy-icon:hover {\n --hybrid-icon-color: var(--hybrid-select-icon-hover-color, var(--hybrid-select-local-icon-hover-color));\n }\n\n .arrow-icon {\n --hybrid-icon-width: var(--hybrid-select-arrow-icon-size, var(--hybrid-select-local-arrow-icon-size));\n transition: transform var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n pointer-events: none !important;\n }\n\n :host([show]) .arrow-icon {\n transform: rotate(180deg);\n }\n\n /* Dropdown options */\n .options {\n /* Default positioning - will be overridden by controller when opened */\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n background-color: var(--hybrid-select-dropdown-background, var(--hybrid-select-local-dropdown-background));\n border: var(--hybrid-select-border-width, var(--hybrid-select-local-border-width)) solid \n var(--hybrid-select-dropdown-border-color, var(--hybrid-select-local-dropdown-border-color));\n border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius));\n box-shadow: var(--hybrid-select-dropdown-shadow, var(--hybrid-select-local-dropdown-shadow));\n z-index: 1000;\n max-height: 200px;\n overflow-y: auto;\n overflow-x: hidden;\n display: none;\n flex-direction: column;\n animation: dropdown-enter var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out;\n /* Ensure proper containment and exact wrapper width */\n box-sizing: border-box;\n width: 100%;\n }\n\n .options.placement-top {\n top: auto;\n bottom: 100%;\n animation: dropdown-enter-top var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out;\n }\n\n @keyframes dropdown-enter {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n @keyframes dropdown-enter-top {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n /* Option items */\n .option {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));\n font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size));\n cursor: pointer;\n transition: background-color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n position: relative;\n }\n\n .option:hover {\n background-color: var(--hybrid-select-option-hover-background, var(--hybrid-select-local-option-hover-background));\n }\n\n .option.selected {\n background-color: var(--hybrid-select-option-selected-background, var(--hybrid-select-local-option-selected-background));\n color: var(--hybrid-select-option-selected-color, var(--hybrid-select-local-option-selected-color));\n }\n\n .option.focused {\n background-color: var(--hybrid-select-option-hover-background, var(--hybrid-select-local-option-hover-background));\n outline: 2px solid var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color));\n outline-offset: -2px;\n }\n\n .option.disabled {\n opacity: var(--hybrid-select-disabled-opacity, var(--hybrid-select-local-disabled-opacity));\n cursor: not-allowed;\n }\n\n .option-content {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .option-icon {\n --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n --hybrid-icon-color: currentColor;\n }\n\n .option-text {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .option-description {\n font-size: calc(var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size)) - 1px);\n opacity: 0.7;\n margin-top: 2px;\n }\n\n .check-icon {\n --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n --hybrid-icon-color: var(--hybrid-select-option-selected-color, var(--hybrid-select-local-option-selected-color));\n }\n\n /* No options message - styled like Ant Design */\n .no-options {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--select-no-options-padding, 24px 16px);\n color: var(--select-no-options-color, #8c8c8c);\n font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size));\n cursor: default;\n user-select: none;\n }\n\n .no-options-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--select-no-options-gap, 8px);\n text-align: center;\n }\n\n .no-options-icon {\n --hybrid-icon-width: 24px;\n --hybrid-icon-color: var(--select-no-options-icon-color, #d9d9d9);\n opacity: 0.8;\n }\n\n .no-options-text {\n font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size));\n color: var(--select-no-options-color, #8c8c8c);\n line-height: 1.4;\n }\n\n /* Dark theme adjustments for no-options */\n :host([theme='dark']) .no-options {\n color: var(--select-no-options-color, #595959);\n }\n\n :host([theme='dark']) .no-options-icon {\n --hybrid-icon-color: var(--select-no-options-icon-color, #434343);\n }\n\n :host([theme='dark']) .no-options-text {\n color: var(--select-no-options-color, #595959);\n }\n\n /* Validation message */\n .validation-message {\n display: block;\n margin-top: var(--hybrid-select-message-margin-top, var(--hybrid-select-local-message-margin-top));\n font-size: var(--hybrid-select-message-font-size, var(--hybrid-select-local-message-font-size));\n color: var(--hybrid-select-error-message-color, var(--hybrid-select-local-error-message-color));\n }\n\n .validation-message.warning {\n color: var(--hybrid-select-warning-message-color, var(--hybrid-select-local-warning-message-color));\n }\n\n .validation-message.success {\n color: var(--hybrid-select-success-message-color, var(--hybrid-select-local-success-message-color));\n }\n\n /* Slotted content styles */\n ::slotted([slot='label']) {\n display: block;\n margin-bottom: 4px;\n font-weight: 500;\n color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));\n }\n\n ::slotted([slot='helper-text']) {\n display: block;\n margin-top: var(--hybrid-select-message-margin-top, var(--hybrid-select-local-message-margin-top));\n font-size: var(--hybrid-select-message-font-size, var(--hybrid-select-local-message-font-size));\n color: var(--hybrid-select-placeholder-color, var(--hybrid-select-local-placeholder-color));\n }\n\n /* Accessibility improvements */\n @media (prefers-reduced-motion: reduce) {\n .options,\n .wrapper,\n .tag-close,\n .arrow-icon,\n .option {\n transition: none;\n animation: none;\n }\n }\n\n /* High contrast mode support */\n @media (prefers-contrast: high) {\n .wrapper {\n border-width: 2px;\n }\n \n .wrapper:focus,\n .wrapper:focus-within {\n outline: 3px solid;\n }\n }\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"select.style.js","sourceRoot":"","sources":["../../../src/components/select/select.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgclB,CAAC","sourcesContent":["import { css } from 'lit';\nimport { selectVariables } from './select.style.variables.js';\n\nexport const styles = css`\n ${selectVariables}\n\n :host {\n width: fit-content;\n display: block;\n font-family: var(--hybrid-select-font-family, var(--hybrid-select-local-font-family));\n font-size: var(--hybrid-select-font-size, var(--hybrid-select-local-font-size));\n line-height: var(--hybrid-select-line-height, var(--hybrid-select-local-line-height));\n margin: var(--hybrid-select-margin, var(--hybrid-select-local-wrapper-margin));\n }\n\n /* Host attribute selectors for configuration */\n :host([disabled]) {\n opacity: var(--hybrid-select-disabled-opacity, var(--hybrid-select-local-disabled-opacity));\n pointer-events: none;\n }\n\n :host([disabled]) .wrapper {\n background-color: var(--hybrid-select-disabled-background, var(--hybrid-select-local-disabled-background));\n border-color: var(--hybrid-select-disabled-border-color, var(--hybrid-select-local-disabled-border-color));\n color: var(--hybrid-select-disabled-text-color, var(--hybrid-select-local-disabled-text-color));\n cursor: not-allowed;\n }\n\n /* Theme-specific styles */\n :host([theme='dark']) {\n --hybrid-select-local-background-color: #262626;\n --hybrid-select-local-border-color: #424242;\n --hybrid-select-local-text-color: #ffffff;\n --hybrid-select-local-placeholder-color: #8c8c8c;\n --hybrid-select-local-dropdown-background: #262626;\n --hybrid-select-local-dropdown-border-color: #424242;\n --hybrid-select-local-option-hover-background: #393939;\n --hybrid-select-local-option-selected-background: #1e3a5f;\n --hybrid-select-local-hover-border-color: #4096ff;\n --hybrid-select-local-focus-border-color: #4096ff;\n }\n\n /* Size variants */\n :host([size='small']) .wrapper {\n min-height: var(--hybrid-select-small-height, var(--hybrid-select-local-small-height));\n font-size: var(--hybrid-select-small-font-size, var(--hybrid-select-local-small-font-size));\n }\n\n :host([size='small']) .select-trigger {\n padding: var(--hybrid-select-small-padding, var(--hybrid-select-local-small-padding));\n padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);\n }\n\n :host([size='medium']) .wrapper {\n min-height: var(--hybrid-select-medium-height, var(--hybrid-select-local-medium-height));\n font-size: var(--hybrid-select-medium-font-size, var(--hybrid-select-local-medium-font-size));\n }\n\n :host([size='medium']) .select-trigger {\n padding: var(--hybrid-select-medium-padding, var(--hybrid-select-local-medium-padding));\n padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);\n }\n\n :host([size='large']) .wrapper {\n min-height: var(--hybrid-select-large-height, var(--hybrid-select-local-large-height));\n font-size: var(--hybrid-select-large-font-size, var(--hybrid-select-local-large-font-size));\n }\n\n :host([size='large']) .select-trigger {\n padding: var(--hybrid-select-large-padding, var(--hybrid-select-local-large-padding));\n padding-right: calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px);\n }\n\n /* Status variants */\n :host([status='error']) .wrapper {\n border-color: var(--hybrid-select-error-border-color, var(--hybrid-select-local-error-border-color));\n }\n\n :host([status='warning']) .wrapper {\n border-color: var(--hybrid-select-warning-border-color, var(--hybrid-select-local-warning-border-color));\n }\n\n :host([status='success']) .wrapper {\n border-color: var(--hybrid-select-success-border-color, var(--hybrid-select-local-success-border-color));\n }\n\n /* Type variants */\n :host([type='inline']) {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n :host([type='inline']) .wrapper {\n flex: 1;\n }\n\n /* Show dropdown */\n :host([show]) .options {\n display: flex !important;\n }\n\n /* Main wrapper container */\n .wrapper {\n position: relative;\n width: var(--hybrid-select-width, var(--hybrid-select-local-width));\n background-color: var(--hybrid-select-background-color, var(--hybrid-select-local-background-color));\n border: var(--hybrid-select-border-width, var(--hybrid-select-local-border-width)) solid \n var(--hybrid-select-border-color, var(--hybrid-select-local-border-color));\n border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius));\n transition: all var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration)) \n var(--hybrid-select-transition-timing, var(--hybrid-select-local-transition-timing));\n cursor: pointer;\n outline: none;\n margin: var(--hybrid-select-wrapper-margin, 0);\n min-height: var(--hybrid-select-min-height, var(--hybrid-select-local-min-height));\n /* Ensure dropdown can overflow the wrapper */\n overflow: visible;\n }\n\n .wrapper:hover:not(:disabled) {\n border-color: var(--hybrid-select-hover-border-color, var(--hybrid-select-local-hover-border-color));\n }\n\n .wrapper:focus,\n .wrapper:focus-within {\n border-color: var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color));\n box-shadow: 0 0 0 2px var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color))33;\n }\n\n /* Select container */\n .select {\n display: flex;\n flex-direction: column;\n }\n\n /* Select trigger (main display area) */\n .select-trigger {\n display: flex;\n align-items: center;\n padding: var(--hybrid-select-padding-top, var(--hybrid-select-local-padding-top)) \n calc(var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size)) + 20px) \n var(--hybrid-select-padding-bottom, var(--hybrid-select-local-padding-bottom)) \n var(--hybrid-select-padding-left, var(--hybrid-select-local-padding-left));\n color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));\n font-size: inherit;\n line-height: inherit;\n word-break: break-word;\n min-height: inherit;\n flex-wrap: wrap;\n gap: var(--hybrid-select-tag-margin, var(--hybrid-select-local-tag-margin));\n }\n\n .select-trigger:empty:before {\n content: attr(data-placeholder);\n color: var(--hybrid-select-placeholder-color, var(--hybrid-select-local-placeholder-color));\n font-size: var(--hybrid-select-placeholder-font-size, var(--hybrid-select-local-placeholder-font-size));\n }\n\n /* Multi-select tags */\n .tag {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n background-color: var(--hybrid-select-tag-background, var(--hybrid-select-local-tag-background));\n color: var(--hybrid-select-tag-color, var(--hybrid-select-local-tag-color));\n padding: var(--hybrid-select-tag-padding, var(--hybrid-select-local-tag-padding));\n border-radius: var(--hybrid-select-tag-border-radius, var(--hybrid-select-local-tag-border-radius));\n font-size: calc(var(--hybrid-select-font-size, var(--hybrid-select-local-font-size)) - 1px);\n max-width: 100%;\n }\n\n .tag-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .tag-close {\n color: var(--hybrid-select-tag-close-color, var(--hybrid-select-local-tag-close-color));\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n height: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n border-radius: 50%;\n transition: color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n }\n\n .tag-close:hover {\n color: var(--hybrid-select-tag-close-hover-color, var(--hybrid-select-local-tag-close-hover-color));\n }\n\n /* Icons container */\n .icons-container {\n position: absolute;\n top: 50%;\n right: 12px;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n gap: 4px;\n pointer-events: none;\n }\n\n .icons-container hy-icon {\n --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n --hybrid-icon-color: var(--hybrid-select-icon-color, var(--hybrid-select-local-icon-color));\n pointer-events: auto;\n cursor: pointer;\n transition: color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n }\n\n .icons-container hy-icon:hover {\n --hybrid-icon-color: var(--hybrid-select-icon-hover-color, var(--hybrid-select-local-icon-hover-color));\n }\n\n .arrow-icon {\n --hybrid-icon-width: var(--hybrid-select-arrow-icon-size, var(--hybrid-select-local-arrow-icon-size));\n transition: transform var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n pointer-events: none !important;\n }\n\n :host([show]) .arrow-icon {\n transform: rotate(180deg);\n }\n\n /* Dropdown options */\n .options {\n /* Default positioning - will be overridden by controller when opened */\n position: absolute;\n top: 100%;\n margin-top: 1px;\n left: 0;\n right: 0;\n background-color: var(--hybrid-select-dropdown-background, var(--hybrid-select-local-dropdown-background));\n border: var(--hybrid-select-border-width, var(--hybrid-select-local-border-width)) solid \n var(--hybrid-select-dropdown-border-color, var(--hybrid-select-local-dropdown-border-color));\n border-radius: var(--hybrid-select-border-radius, var(--hybrid-select-local-border-radius));\n box-shadow: var(--hybrid-select-dropdown-shadow, var(--hybrid-select-local-dropdown-shadow));\n z-index: var(--hybrid-select-dropdown-z-index, var(--hybrid-select-local-dropdown-z-index));\n max-height: 200px;\n overflow-y: auto;\n overflow-x: hidden;\n display: none;\n flex-direction: column;\n animation: dropdown-enter var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out;\n /* Ensure proper containment and exact wrapper width */\n box-sizing: border-box;\n width: 100%;\n /* Create new stacking context to prevent layering issues */\n isolation: isolate;\n /* Ensure solid background to prevent visual bleed-through */\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n /* Force above other elements */\n transform: translateZ(0);\n }\n\n .options.placement-top {\n top: auto;\n bottom: 100%;\n margin-bottom: 1px;\n margin-top: 0;\n animation: dropdown-enter-top var(--hybrid-select-dropdown-animation-duration, var(--hybrid-select-local-dropdown-animation-duration)) ease-out;\n }\n\n @keyframes dropdown-enter {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n @keyframes dropdown-enter-top {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n /* Option items */\n .option {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));\n font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size));\n cursor: pointer;\n transition: background-color var(--hybrid-select-transition-duration, var(--hybrid-select-local-transition-duration));\n position: relative;\n }\n\n .option:hover {\n background-color: var(--hybrid-select-option-hover-background, var(--hybrid-select-local-option-hover-background));\n }\n\n .option.selected {\n background-color: var(--hybrid-select-option-selected-background, var(--hybrid-select-local-option-selected-background));\n color: var(--hybrid-select-option-selected-color, var(--hybrid-select-local-option-selected-color));\n }\n\n .option.focused {\n background-color: var(--hybrid-select-option-hover-background, var(--hybrid-select-local-option-hover-background));\n outline: 2px solid var(--hybrid-select-focus-border-color, var(--hybrid-select-local-focus-border-color));\n outline-offset: -2px;\n }\n\n .option.disabled {\n opacity: var(--hybrid-select-disabled-opacity, var(--hybrid-select-local-disabled-opacity));\n cursor: not-allowed;\n }\n\n .option-content {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .option-icon {\n --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n --hybrid-icon-color: currentColor;\n }\n\n .option-text {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .option-description {\n font-size: calc(var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size)) - 1px);\n opacity: 0.7;\n margin-top: 2px;\n }\n\n .check-icon {\n --hybrid-icon-width: var(--hybrid-select-icon-size, var(--hybrid-select-local-icon-size));\n --hybrid-icon-color: var(--hybrid-select-option-selected-color, var(--hybrid-select-local-option-selected-color));\n }\n\n /* No options message - styled like Ant Design */\n .no-options {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--select-no-options-padding, 24px 16px);\n color: var(--select-no-options-color, #8c8c8c);\n font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size));\n cursor: default;\n user-select: none;\n }\n\n .no-options-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--select-no-options-gap, 8px);\n text-align: center;\n }\n\n .no-options-icon {\n --hybrid-icon-width: 24px;\n --hybrid-icon-color: var(--select-no-options-icon-color, #d9d9d9);\n opacity: 0.8;\n }\n\n .no-options-text {\n font-size: var(--hybrid-select-option-font-size, var(--hybrid-select-local-option-font-size));\n color: var(--select-no-options-color, #8c8c8c);\n line-height: 1.4;\n }\n\n /* Dark theme adjustments for no-options */\n :host([theme='dark']) .no-options {\n color: var(--select-no-options-color, #595959);\n }\n\n :host([theme='dark']) .no-options-icon {\n --hybrid-icon-color: var(--select-no-options-icon-color, #434343);\n }\n\n :host([theme='dark']) .no-options-text {\n color: var(--select-no-options-color, #595959);\n }\n\n /* Validation message */\n .validation-message {\n display: block;\n margin-top: var(--hybrid-select-message-margin-top, var(--hybrid-select-local-message-margin-top));\n font-size: var(--hybrid-select-message-font-size, var(--hybrid-select-local-message-font-size));\n color: var(--hybrid-select-error-message-color, var(--hybrid-select-local-error-message-color));\n }\n\n .validation-message.warning {\n color: var(--hybrid-select-warning-message-color, var(--hybrid-select-local-warning-message-color));\n }\n\n .validation-message.success {\n color: var(--hybrid-select-success-message-color, var(--hybrid-select-local-success-message-color));\n }\n\n /* Slotted content styles */\n ::slotted([slot='label']) {\n display: block;\n margin-bottom: 4px;\n font-weight: 500;\n color: var(--hybrid-select-text-color, var(--hybrid-select-local-text-color));\n }\n\n ::slotted([slot='helper-text']) {\n display: block;\n margin-top: var(--hybrid-select-message-margin-top, var(--hybrid-select-local-message-margin-top));\n font-size: var(--hybrid-select-message-font-size, var(--hybrid-select-local-message-font-size));\n color: var(--hybrid-select-placeholder-color, var(--hybrid-select-local-placeholder-color));\n }\n\n /* Accessibility improvements */\n @media (prefers-reduced-motion: reduce) {\n .options,\n .wrapper,\n .tag-close,\n .arrow-icon,\n .option {\n transition: none;\n animation: none;\n }\n }\n\n /* High contrast mode support */\n @media (prefers-contrast: high) {\n .wrapper {\n border-width: 2px;\n }\n \n .wrapper:focus,\n .wrapper:focus-within {\n outline: 3px solid;\n }\n }\n`;\n"]}
|
|
@@ -8,8 +8,11 @@ export const selectVariables = css `
|
|
|
8
8
|
/* Layout and sizing */
|
|
9
9
|
--hybrid-select-local-width: 300px;
|
|
10
10
|
--hybrid-select-local-min-height: 40px;
|
|
11
|
+
--hybrid-select-local-padding-top: 8px;
|
|
12
|
+
--hybrid-select-local-padding-bottom: 8px;
|
|
11
13
|
--hybrid-select-local-padding-left: 12px;
|
|
12
14
|
--hybrid-select-local-padding-right: 12px;
|
|
15
|
+
--hybrid-select-local-wrapper-margin: 0;
|
|
13
16
|
--hybrid-select-local-border-radius: 6px;
|
|
14
17
|
--hybrid-select-local-border-width: 1px;
|
|
15
18
|
|
|
@@ -28,6 +31,7 @@ export const selectVariables = css `
|
|
|
28
31
|
--hybrid-select-local-dropdown-background: #ffffff;
|
|
29
32
|
--hybrid-select-local-dropdown-border-color: #d9d9d9;
|
|
30
33
|
--hybrid-select-local-dropdown-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08);
|
|
34
|
+
--hybrid-select-local-dropdown-z-index: 9999;
|
|
31
35
|
--hybrid-select-local-option-hover-background: #f5f5f5;
|
|
32
36
|
--hybrid-select-local-option-selected-background: #e6f7ff;
|
|
33
37
|
--hybrid-select-local-option-selected-color: #1677ff;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.style.variables.js","sourceRoot":"","sources":["../../../src/components/select/select.style.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"select.style.variables.js","sourceRoot":"","sources":["../../../src/components/select/select.style.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFjC,CAAC","sourcesContent":["import { css } from 'lit';\n\n/**\n * CSS custom properties for select component (light theme defaults)\n * These are the local component defaults that can be overridden globally\n */\nexport const selectVariables = css`\n :host {\n /* Layout and sizing */\n --hybrid-select-local-width: 300px;\n --hybrid-select-local-min-height: 40px;\n --hybrid-select-local-padding-top: 8px;\n --hybrid-select-local-padding-bottom: 8px;\n --hybrid-select-local-padding-left: 12px;\n --hybrid-select-local-padding-right: 12px;\n --hybrid-select-local-wrapper-margin: 0;\n --hybrid-select-local-border-radius: 6px;\n --hybrid-select-local-border-width: 1px;\n \n /* Colors - Light theme defaults */\n --hybrid-select-local-background-color: #ffffff;\n --hybrid-select-local-border-color: #d9d9d9;\n --hybrid-select-local-text-color: #262626;\n --hybrid-select-local-placeholder-color: #8c8c8c;\n --hybrid-select-local-hover-border-color: #1677ff;\n --hybrid-select-local-focus-border-color: #1677ff;\n --hybrid-select-local-error-border-color: #da1e28;\n --hybrid-select-local-warning-border-color: #f0c300;\n --hybrid-select-local-success-border-color: #52c41a;\n \n /* Dropdown colors */\n --hybrid-select-local-dropdown-background: #ffffff;\n --hybrid-select-local-dropdown-border-color: #d9d9d9;\n --hybrid-select-local-dropdown-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08);\n --hybrid-select-local-dropdown-z-index: 9999;\n --hybrid-select-local-option-hover-background: #f5f5f5;\n --hybrid-select-local-option-selected-background: #e6f7ff;\n --hybrid-select-local-option-selected-color: #1677ff;\n \n /* Typography */\n --hybrid-select-local-font-family: Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Ubuntu, Cantarell, \"Noto Sans\", sans-serif;\n --hybrid-select-local-font-size: 14px;\n --hybrid-select-local-line-height: 1.5;\n --hybrid-select-local-placeholder-font-size: 14px;\n --hybrid-select-local-option-font-size: 14px;\n \n /* Icon settings */\n --hybrid-select-local-icon-size: 16px;\n --hybrid-select-local-icon-color: #8c8c8c;\n --hybrid-select-local-icon-hover-color: #1677ff;\n --hybrid-select-local-arrow-icon-size: 12px;\n \n /* Sizes */\n --hybrid-select-local-small-height: 24px;\n --hybrid-select-local-small-font-size: 12px;\n --hybrid-select-local-small-padding: 4px 8px;\n \n --hybrid-select-local-medium-height: 32px;\n --hybrid-select-local-medium-font-size: 14px;\n --hybrid-select-local-medium-padding: 4px 12px;\n \n --hybrid-select-local-large-height: 40px;\n --hybrid-select-local-large-font-size: 16px;\n --hybrid-select-local-large-padding: 6px 12px;\n \n /* States */\n --hybrid-select-local-disabled-opacity: 0.5;\n --hybrid-select-local-disabled-background: #f5f5f5;\n --hybrid-select-local-disabled-border-color: #d9d9d9;\n --hybrid-select-local-disabled-text-color: #8c8c8c;\n \n /* Animation and transitions */\n --hybrid-select-local-transition-duration: 0.2s;\n --hybrid-select-local-transition-timing: ease-in-out;\n --hybrid-select-local-dropdown-animation-duration: 0.15s;\n \n /* Multi-select specific */\n --hybrid-select-local-tag-background: #f0f0f0;\n --hybrid-select-local-tag-color: #262626;\n --hybrid-select-local-tag-border-radius: 4px;\n --hybrid-select-local-tag-padding: 2px 6px;\n --hybrid-select-local-tag-margin: 2px;\n --hybrid-select-local-tag-close-color: #8c8c8c;\n --hybrid-select-local-tag-close-hover-color: #da1e28;\n \n /* Validation message */\n --hybrid-select-local-message-font-size: 12px;\n --hybrid-select-local-message-margin-top: 4px;\n --hybrid-select-local-error-message-color: #da1e28;\n --hybrid-select-local-warning-message-color: #f0c300;\n --hybrid-select-local-success-message-color: #52c41a;\n }\n`;\n"]}
|