@descope/web-components-ui 1.37.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +11 -55
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +11 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/8961.js +1 -1
- package/dist/umd/8961.js.map +1 -1
- package/dist/umd/9365.js +1 -1
- package/dist/umd/9365.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-address-field.js +1 -1
- package/dist/umd/descope-address-field.js.map +1 -1
- package/dist/umd/descope-autocomplete-field.js +1 -1
- package/dist/umd/descope-autocomplete-field.js.map +1 -1
- package/package.json +9 -9
- package/src/mixins/draggableMixin.js +1 -23
package/dist/umd/8961.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8961],{34797:(t,e,s)=>{s.d(e,{q:()=>l});var i=s(63200),r=s(61246),n=s(27754),a=s(11501),o=s(36745);const l=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.Zz)(r.t,a.m,o.y,n.b)(s)}},84548:(t,e,s)=>{s.d(e,{O:()=>i,h:()=>r});const i={CONNECTOR_INVALID:"CONNECTOR_INVALID",FETCH_RESULTS_ERROR:"FETCH_RESULTS_ERROR"},r=()=>class{constructor(t){this.getAttribute=t,this.isValid=this.#s()}checkConnectorValidity(){this.isValid=this.#s()}#s(){return!this.getRequiredParams().filter((t=>{const e=this.getAttribute(t);return!e||!this.validateParam(t,e)})).length}validateParam(t,e){return e.trim().length>0}getRequiredParams(){return console.error("Connector must implement getRequiredParams"),[]}async fetch(t){return this.isValid?this._fetchResults(t):(console.error(`[${this.constructor.name}] Cannot fetch results: connector is not properly configured`),{results:[],error:i.CONNECTOR_INVALID})}_fetchResults(t){return console.error("Connector must implement fetchResults"),{results:[],error:void 0}}}},49449:(t,e,s)=>{s.d(e,{y:()=>h});var i=s(63200),r=s(1317),n=s(70962),a=s(4430),o=s(36745),l=s(34797);const h=(...t)=>(0,i.Zz)(a.X,r._,o.y,n.j)((0,l.q)(...t))},3563:(t,e,s)=>{s(63200),s(22515),s(34797),s(25964)},72270:(t,e,s)=>{s.d(e,{OR:()=>n.O,h:()=>n.h,qu:()=>i.q,yc:()=>r.y});var i=s(34797),r=(s(3563),s(49449)),n=s(84548)},50336:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{r:()=>i})},88961:(t,e,s)=>{s.d(e,{Jm:()=>i.Jm,OZ:()=>i.OZ,RF:()=>i.RF,VO:()=>i.VO,mA:()=>i.mA,tQ:()=>i.tQ,tz:()=>i.tz});var i=s(78968)},1317:(t,e,s)=>{s.d(e,{_:()=>r});var i=s(50336);const r=t=>class extends t{#i=i.r.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#i(),this.prevValue=this.value)}))}}},61246:(t,e,s)=>{s.d(e,{t:()=>i});const i=t=>class extends t{#r(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#r()}}},27754:(t,e,s)=>{s.d(e,{b:()=>i});const i=t=>class extends t{updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}}},83370:(t,e,s)=>{s.d(e,{J:()=>i});const i=({connectorClasses:t})=>e=>class extends e{#n=t;static get observedAttributes(){return[...e.observedAttributes||[],"connector-template"]}get connectorClasses(){return this.#n}set connectorClasses(t){this.#n=t}get connectorTemplate(){return this.getAttribute("connector-template")}initializeConnector(){const t=this.connectorTemplate;if(!this.connectorClasses[t])return;const e=this.connectorClasses[t];this.connector=new e(this.getAttribute.bind(this))}async fetchConnectorResults(t){if(!this.connector)return console.error(`No connector initialized for the field with template: ${this.connectorTemplate}`),{results:[]};const{results:e,error:s}=await this.connector.fetch(t);return s?{results:[],error:s}:{results:e.map((({label:t,value:e})=>({label:t,value:e})))}}init(){super.init?.(),this.initializeConnector()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&"connector-template"===t&&this.initializeConnector()}}},1160:(t,e,s)=>{s.d(e,{t:()=>o});var i=s(72270),r=s(63200),n=s(25964),a=s(50336);const o=({componentName:t,wrappedEleName:e,slots:s=[],style:o,excludeAttrsSync:l=[],includeAttrsSync:h=[],includeForwardProps:c=[],delegatesFocus:u=!0})=>{class d extends((0,i.qu)({componentName:t,baseSelector:e})){#a=a.r.bind(this,"blur");#o=a.r.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:u}).innerHTML=`\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""}></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`,(0,n.fz)(((0,r.Tn)(o)?o():o)||"",this)}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#a()})),this.baseElement.addEventListener("focus",(t=>{this.#o()})),(0,n.q)(this.baseElement,this,c),(0,n.Gh)(this.baseElement,this,{excludeAttrs:l,includeAttrs:h})}}return d}},83538:(t,e,s)=>{s.d(e,{AM:()=>u,SR:()=>c,_r:()=>l});var i=s(63200),r=s(25964);const n=(t,e)=>`var(${t}${e?`, ${e}`:""})`;class a{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const o=(t,e="fallback")=>(0,i.GL)(t,e),l=(t,e,s)=>{const l=new a,h=(t,e)=>{if(!t)return"";if("string"==typeof t)return t;const s=o(e,t?.suffix);return n(s,h(t.fallback,s))};return Object.keys(s).forEach((a=>{const o=((t,e)=>{const s={selector:"",property:(0,i.kW)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(a,s[a]),c=(0,r.Ix)(t,a);o.forEach((({selector:t,property:s,important:r,fallback:a})=>{const o=h(a,c);l.add(((t="",e="")=>(0,i.Tn)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,i.Tn)(s)?s():s,n(c,o)+(r?"!important":""))}))})),l.toString()},h=(t,e,{fallback:s})=>{if(!s)return{};const r=o(e,s.suffix),n=(0,i.dk)(t,s.suffix||"fallback");return{[n]:r,...h(n,r,s)}},c=(t,e)=>Object.keys(e).reduce(((s,i)=>{const n=(0,r.Ix)(t,i);return Object.assign(s,{[i]:n},h(i,n,e[i]))}),{}),u=(t,e)=>Array(e).fill(`.${t}`).join("")},22515:(t,e,s)=>{s.d(e,{R:()=>l});var i=s(69591),r=s(63200),n=s(25964),a=s(79673),o=s(83538);const l=({mappings:t={},componentNameOverride:e=""})=>s=>{const l=e||s.componentName;return class e extends s{static get cssVarList(){return{...s.cssVarList,...(0,o.SR)(l,{...t})}}#l;#h;#c;#u;#d;#m;#p;#g;#b;constructor({getRootElement:t,componentNameSuffix:s="",themeSection:n=i.IM,baseSelector:a}={}){super(),this.#u=s,this.#d=n,this.#p=a??this.baseSelector,this.#b=t,this.#g=Object.keys(e.cssVarList).map((t=>(0,r.GL)("st",s,t)))}get#E(){return a.br.currentTheme?.[l]||""}#v(){this.#h.replaceSync(this.#E[this.#d])}#f(){this.#h=(0,n.fz)("",this.#m,{prepend:!0}),this.#c=a.br.onCurrentThemeChange(this.#v.bind(this)),this.#v()}#y(){if(this.#g.length){const t=(0,o.AM)(l,i.aE);this.#l=(0,n.fz)(`:host(${t}) {}`,this.#m)}}#A(t,e){const s=this.#l?.cssRules[0].style;if(!s)return;const i=(0,n.Ix)(l,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#C(t=[]){t.forEach((t=>{this.#g.includes(t)&&this.#A(t,this.getAttribute(t))}))}#S(){if(Object.keys(t).length){const e=(0,o._r)((0,r.GL)(l,this.#u),this.#p,t);(0,n.fz)(e,this.#m,{prepend:!0})}}#w(t){(this.#m.classList||this.#m.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#m=await(this.#b?.(this))||this.shadowRoot,this.#w(l),this.#S(),this.#f(),this.#y(),(0,n.mx)(this,this.#C.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#c?.()}}}},11430:(t,e,s)=>{s.d(e,{V:()=>i});const i=t=>class extends t{#M=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#M=document.createElement("style"),this.#M.innerText="* { cursor: inherit!important }"}#R(t){t?this.shadowRoot.appendChild(this.#M):this.#M.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#R("true"===s)}}},19852:(t,e,s)=>{s(25964)},11501:(t,e,s)=>{s.d(e,{m:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},78968:(t,e,s)=>{s.d(e,{Jm:()=>h.J,OZ:()=>a.O,RF:()=>i.R,VO:()=>r.V,mA:()=>l.m,tQ:()=>o.t,tz:()=>n.t});var i=s(22515),r=s(11430),n=s(1160),a=s(71209),o=s(61246),l=(s(4430),s(87503)),h=(s(36745),s(19852),s(83370))},70962:(t,e,s)=>{s.d(e,{j:()=>r});var i=s(50336);const r=t=>class extends t{init(){this.#T(),super.init?.()}#T(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,i.r.call(this,"blur"),i.r.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(i.r.call(this,"focus"),i.r.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{this!==e.target&&(e.stopImmediatePropagation(),t!==this.value&&(t=this.value,i.r.call(this,"input",{bubbles:!0,composed:!0})))}))}}},4430:(t,e,s)=>{s.d(e,{X:()=>a}),s(42672);const i=["required","pattern"],r="data-errormessage-pattern-mismatch",n=Symbol("validationTarget"),a=t=>class extends t{#V=n;static get observedAttributes(){return[...t.observedAttributes||[],...i]}static get formAssociated(){return!0}#x;get internals(){return this.#x}set internals(t){this.#x=t}constructor(){super(),this.#x=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}get defaultErrorMsgTypeMismatch(){return"Please match the requested type."}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:a,tooLong:o,rangeOverflow:l,rangeUnderflow:h,badInput:c,customError:u}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||n||c:return this.getAttribute(r)||this.defaultErrorMsgPatternMismatch;case i:return this.getAttribute("data-errormessage-type-mismatch")||this.getAttribute(r)||this.defaultErrorMsgTypeMismatch;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case o:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case h:return this.getAttribute("data-errormessage-pattern-range-underflow")||this.defaultErrorMsgRangeUnderflow;case l:return this.getAttribute("data-errormessage-pattern-range-overflow")||this.defaultErrorMsgRangeOverflow;case u:return this.validationMessage;default:return""}}#L(){const t=this.isReadOnly?{}:this.getValidity();this.#x.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#x.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#x.validity.valid}reportValidity(){return this.#x.reportValidity()}get validity(){return this.#x.validity}get validationTarget(){return this.#V===n?this.inputElement:this.#V}set validationTarget(t){this.#V=t}setCustomValidity(t){t?this.#x.setValidity({customError:!0},t,this.validationTarget):(this.#x.setValidity({}),this.#L())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#x.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),i.includes(t)&&this.#L()}init(){super.init?.(),this.addEventListener("change",this.#L),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#L),setTimeout((()=>this.#L()))}}},36745:(t,e,s)=>{s.d(e,{y:()=>n});var i=s(25964);const r=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options","loading","allow-custom-value"],n=t=>class extends t{init(){super.init?.(),(0,i.mx)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>r.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.debug(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}},87503:(t,e,s)=>{s.d(e,{m:()=>l});var i=s(63200),r=s(25964),n=s(22515),a=s(83538);const o=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},l=({name:t,selector:e,mappings:s={},forward:{attributes:l=[],include:h=!0}={}})=>c=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=(0,n.R)({mappings:s})(c);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:(0,a.SR)((0,i.GL)(c.componentName,"_"+u),s)}}#O;constructor(){const t=o((async t=>{const s=(t.shadowRoot||t).querySelector(t.baseSelector);return e?(await o((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:"@"+u,baseSelector:":host"}),this.#O=t(this).then((t=>t.host))}async#N(){const t=await this.#O;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#O;(0,r.EA)(this,t,{[h?"includeAttrs":"excludeAttrs"]:l}),this.#N()}}}},71209:(t,e,s)=>{s.d(e,{O:()=>u});var i=s(63200),r=s(25964),n=s(50336),a=s(4430),o=s(22515);const l=["invalid","required"],h=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e?.localName)return e},c=({proxyProps:t=[],useProxyTargets:e=!1,inputEvent:s="input",triggerValidationEvents:i=[],proxyParentValidation:o=!1})=>c=>class extends((0,a.X)(c)){static get observedAttributes(){return[...c.observedAttributes||[],...l]}#k;#i=n.r.bind(this,"change");constructor(){super(),this.#k=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#k&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#k)return this.#k;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#k=h(t)||h(e),this.#k}set inputElement(t){this.#k=t}getValidity(){return this.inputElement?.validity||{}}#I(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#I(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},this.baseElement.addEventListener("input",(t=>{t.composed||this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))})),i.forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.inputElement?.setCustomValidity("")}))})),setTimeout((()=>{(Array.isArray(s)?s:[s]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#I()}))})),this.baseElement.addEventListener("change",(()=>{this.#i()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#I()})),t.forEach((t=>{const s=this.querySelector('input[slot="external-input"]')||null,i=e?[this.baseElement,s].filter(Boolean):[];((t,e,s)=>{const i=Array.isArray(e)?e:[e];Object.defineProperty(t,s,{set(t){i.forEach((e=>{e[s]=t}))},get:()=>e[0][s],configurable:!0})})(this,[this.inputElement,...i],t)})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,r.EA)(this,this.inputElement,{includeAttrs:["inputmode"]})})),o){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...i)=>{if(3===i.length){const t=i.slice(0,i.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...i);return t[s](...i)}:"function"==typeof t[s]?(...i)=>(e.internals[s](...i),t[s](...i)):t[s]})}}},u=t=>(0,i.Zz)(c(t),(0,o.R)({componentNameOverride:(0,r.xE)("input-wrapper")}))}}]);
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8961],{34797:(t,e,s)=>{s.d(e,{q:()=>l});var i=s(63200),r=s(61246),n=s(27754),a=s(11501),o=s(36745);const l=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.Zz)(r.t,a.m,o.y,n.b)(s)}},84548:(t,e,s)=>{s.d(e,{O:()=>i,h:()=>r});const i={CONNECTOR_INVALID:"CONNECTOR_INVALID",FETCH_RESULTS_ERROR:"FETCH_RESULTS_ERROR"},r=()=>class{constructor(t){this.getAttribute=t,this.isValid=this.#s()}checkConnectorValidity(){this.isValid=this.#s()}#s(){return!this.getRequiredParams().filter((t=>{const e=this.getAttribute(t);return!e||!this.validateParam(t,e)})).length}validateParam(t,e){return e.trim().length>0}getRequiredParams(){return console.error("Connector must implement getRequiredParams"),[]}async fetch(t){return this.isValid?this._fetchResults(t):(console.error(`[${this.constructor.name}] Cannot fetch results: connector is not properly configured`),{results:[],error:i.CONNECTOR_INVALID})}_fetchResults(t){return console.error("Connector must implement fetchResults"),{results:[],error:void 0}}}},49449:(t,e,s)=>{s.d(e,{y:()=>h});var i=s(63200),r=s(1317),n=s(70962),a=s(4430),o=s(36745),l=s(34797);const h=(...t)=>(0,i.Zz)(a.X,r._,o.y,n.j)((0,l.q)(...t))},3563:(t,e,s)=>{s(63200),s(22515),s(11430),s(34797),s(25964)},72270:(t,e,s)=>{s.d(e,{OR:()=>n.O,h:()=>n.h,qu:()=>i.q,yc:()=>r.y});var i=s(34797),r=(s(3563),s(49449)),n=s(84548)},50336:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{r:()=>i})},88961:(t,e,s)=>{s.d(e,{Jm:()=>i.Jm,OZ:()=>i.OZ,RF:()=>i.RF,VO:()=>i.VO,mA:()=>i.mA,tQ:()=>i.tQ,tz:()=>i.tz});var i=s(78968)},1317:(t,e,s)=>{s.d(e,{_:()=>r});var i=s(50336);const r=t=>class extends t{#i=i.r.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#i(),this.prevValue=this.value)}))}}},61246:(t,e,s)=>{s.d(e,{t:()=>i});const i=t=>class extends t{#r(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#r()}}},27754:(t,e,s)=>{s.d(e,{b:()=>i});const i=t=>class extends t{updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}}},83370:(t,e,s)=>{s.d(e,{J:()=>i});const i=({connectorClasses:t})=>e=>class extends e{#n=t;static get observedAttributes(){return[...e.observedAttributes||[],"connector-template"]}get connectorClasses(){return this.#n}set connectorClasses(t){this.#n=t}get connectorTemplate(){return this.getAttribute("connector-template")}initializeConnector(){const t=this.connectorTemplate;if(!this.connectorClasses[t])return;const e=this.connectorClasses[t];this.connector=new e(this.getAttribute.bind(this))}async fetchConnectorResults(t){if(!this.connector)return console.error(`No connector initialized for the field with template: ${this.connectorTemplate}`),{results:[]};const{results:e,error:s}=await this.connector.fetch(t);return s?{results:[],error:s}:{results:e.map((({label:t,value:e})=>({label:t,value:e})))}}init(){super.init?.(),this.initializeConnector()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&"connector-template"===t&&this.initializeConnector()}}},1160:(t,e,s)=>{s.d(e,{t:()=>o});var i=s(72270),r=s(63200),n=s(25964),a=s(50336);const o=({componentName:t,wrappedEleName:e,slots:s=[],style:o,excludeAttrsSync:l=[],includeAttrsSync:h=[],includeForwardProps:c=[],delegatesFocus:u=!0})=>{class d extends((0,i.qu)({componentName:t,baseSelector:e})){#a=a.r.bind(this,"blur");#o=a.r.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:u}).innerHTML=`\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""}></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`,(0,n.fz)(((0,r.Tn)(o)?o():o)||"",this)}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#a()})),this.baseElement.addEventListener("focus",(t=>{this.#o()})),(0,n.q)(this.baseElement,this,c),(0,n.Gh)(this.baseElement,this,{excludeAttrs:l,includeAttrs:h})}}return d}},83538:(t,e,s)=>{s.d(e,{AM:()=>u,SR:()=>c,_r:()=>l});var i=s(63200),r=s(25964);const n=(t,e)=>`var(${t}${e?`, ${e}`:""})`;class a{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const o=(t,e="fallback")=>(0,i.GL)(t,e),l=(t,e,s)=>{const l=new a,h=(t,e)=>{if(!t)return"";if("string"==typeof t)return t;const s=o(e,t?.suffix);return n(s,h(t.fallback,s))};return Object.keys(s).forEach((a=>{const o=((t,e)=>{const s={selector:"",property:(0,i.kW)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(a,s[a]),c=(0,r.Ix)(t,a);o.forEach((({selector:t,property:s,important:r,fallback:a})=>{const o=h(a,c);l.add(((t="",e="")=>(0,i.Tn)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,i.Tn)(s)?s():s,n(c,o)+(r?"!important":""))}))})),l.toString()},h=(t,e,{fallback:s})=>{if(!s)return{};const r=o(e,s.suffix),n=(0,i.dk)(t,s.suffix||"fallback");return{[n]:r,...h(n,r,s)}},c=(t,e)=>Object.keys(e).reduce(((s,i)=>{const n=(0,r.Ix)(t,i);return Object.assign(s,{[i]:n},h(i,n,e[i]))}),{}),u=(t,e)=>Array(e).fill(`.${t}`).join("")},22515:(t,e,s)=>{s.d(e,{R:()=>l});var i=s(69591),r=s(63200),n=s(25964),a=s(79673),o=s(83538);const l=({mappings:t={},componentNameOverride:e=""})=>s=>{const l=e||s.componentName;return class e extends s{static get cssVarList(){return{...s.cssVarList,...(0,o.SR)(l,{...t})}}#l;#h;#c;#u;#d;#m;#p;#g;#b;constructor({getRootElement:t,componentNameSuffix:s="",themeSection:n=i.IM,baseSelector:a}={}){super(),this.#u=s,this.#d=n,this.#p=a??this.baseSelector,this.#b=t,this.#g=Object.keys(e.cssVarList).map((t=>(0,r.GL)("st",s,t)))}get#E(){return a.br.currentTheme?.[l]||""}#v(){this.#h.replaceSync(this.#E[this.#d])}#f(){this.#h=(0,n.fz)("",this.#m,{prepend:!0}),this.#c=a.br.onCurrentThemeChange(this.#v.bind(this)),this.#v()}#y(){if(this.#g.length){const t=(0,o.AM)(l,i.aE);this.#l=(0,n.fz)(`:host(${t}) {}`,this.#m)}}#A(t,e){const s=this.#l?.cssRules[0].style;if(!s)return;const i=(0,n.Ix)(l,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#C(t=[]){t.forEach((t=>{this.#g.includes(t)&&this.#A(t,this.getAttribute(t))}))}#S(){if(Object.keys(t).length){const e=(0,o._r)((0,r.GL)(l,this.#u),this.#p,t);(0,n.fz)(e,this.#m,{prepend:!0})}}#w(t){(this.#m.classList||this.#m.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#m=await(this.#b?.(this))||this.shadowRoot,this.#w(l),this.#S(),this.#f(),this.#y(),(0,n.mx)(this,this.#C.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#c?.()}}}},11430:(t,e,s)=>{s.d(e,{V:()=>r});var i=s(25964);const r=t=>class extends t{constructor(){super(),(0,i.fz)(':host([draggable="true"]) * { cursor: inherit!important }',this)}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}}},19852:(t,e,s)=>{s(25964)},11501:(t,e,s)=>{s.d(e,{m:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},78968:(t,e,s)=>{s.d(e,{Jm:()=>h.J,OZ:()=>a.O,RF:()=>i.R,VO:()=>r.V,mA:()=>l.m,tQ:()=>o.t,tz:()=>n.t});var i=s(22515),r=s(11430),n=s(1160),a=s(71209),o=s(61246),l=(s(4430),s(87503)),h=(s(36745),s(19852),s(83370))},70962:(t,e,s)=>{s.d(e,{j:()=>r});var i=s(50336);const r=t=>class extends t{init(){this.#M(),super.init?.()}#M(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,i.r.call(this,"blur"),i.r.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(i.r.call(this,"focus"),i.r.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{this!==e.target&&(e.stopImmediatePropagation(),t!==this.value&&(t=this.value,i.r.call(this,"input",{bubbles:!0,composed:!0})))}))}}},4430:(t,e,s)=>{s.d(e,{X:()=>a}),s(42672);const i=["required","pattern"],r="data-errormessage-pattern-mismatch",n=Symbol("validationTarget"),a=t=>class extends t{#R=n;static get observedAttributes(){return[...t.observedAttributes||[],...i]}static get formAssociated(){return!0}#T;get internals(){return this.#T}set internals(t){this.#T=t}constructor(){super(),this.#T=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}get defaultErrorMsgTypeMismatch(){return"Please match the requested type."}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:a,tooLong:o,rangeOverflow:l,rangeUnderflow:h,badInput:c,customError:u}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||n||c:return this.getAttribute(r)||this.defaultErrorMsgPatternMismatch;case i:return this.getAttribute("data-errormessage-type-mismatch")||this.getAttribute(r)||this.defaultErrorMsgTypeMismatch;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case o:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case h:return this.getAttribute("data-errormessage-pattern-range-underflow")||this.defaultErrorMsgRangeUnderflow;case l:return this.getAttribute("data-errormessage-pattern-range-overflow")||this.defaultErrorMsgRangeOverflow;case u:return this.validationMessage;default:return""}}#V(){const t=this.isReadOnly?{}:this.getValidity();this.#T.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#T.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#T.validity.valid}reportValidity(){return this.#T.reportValidity()}get validity(){return this.#T.validity}get validationTarget(){return this.#R===n?this.inputElement:this.#R}set validationTarget(t){this.#R=t}setCustomValidity(t){t?this.#T.setValidity({customError:!0},t,this.validationTarget):(this.#T.setValidity({}),this.#V())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#T.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),i.includes(t)&&this.#V()}init(){super.init?.(),this.addEventListener("change",this.#V),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#V),setTimeout((()=>this.#V()))}}},36745:(t,e,s)=>{s.d(e,{y:()=>n});var i=s(25964);const r=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options","loading","allow-custom-value"],n=t=>class extends t{init(){super.init?.(),(0,i.mx)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>r.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.debug(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}},87503:(t,e,s)=>{s.d(e,{m:()=>l});var i=s(63200),r=s(25964),n=s(22515),a=s(83538);const o=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},l=({name:t,selector:e,mappings:s={},forward:{attributes:l=[],include:h=!0}={}})=>c=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=(0,n.R)({mappings:s})(c);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:(0,a.SR)((0,i.GL)(c.componentName,"_"+u),s)}}#x;constructor(){const t=o((async t=>{const s=(t.shadowRoot||t).querySelector(t.baseSelector);return e?(await o((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:"@"+u,baseSelector:":host"}),this.#x=t(this).then((t=>t.host))}async#L(){const t=await this.#x;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#x;(0,r.EA)(this,t,{[h?"includeAttrs":"excludeAttrs"]:l}),this.#L()}}}},71209:(t,e,s)=>{s.d(e,{O:()=>u});var i=s(63200),r=s(25964),n=s(50336),a=s(4430),o=s(22515);const l=["invalid","required"],h=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e?.localName)return e},c=({proxyProps:t=[],useProxyTargets:e=!1,inputEvent:s="input",triggerValidationEvents:i=[],proxyParentValidation:o=!1})=>c=>class extends((0,a.X)(c)){static get observedAttributes(){return[...c.observedAttributes||[],...l]}#O;#i=n.r.bind(this,"change");constructor(){super(),this.#O=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#O&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#O)return this.#O;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#O=h(t)||h(e),this.#O}set inputElement(t){this.#O=t}getValidity(){return this.inputElement?.validity||{}}#N(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#N(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},this.baseElement.addEventListener("input",(t=>{t.composed||this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))})),i.forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.inputElement?.setCustomValidity("")}))})),setTimeout((()=>{(Array.isArray(s)?s:[s]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#N()}))})),this.baseElement.addEventListener("change",(()=>{this.#i()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#N()})),t.forEach((t=>{const s=this.querySelector('input[slot="external-input"]')||null,i=e?[this.baseElement,s].filter(Boolean):[];((t,e,s)=>{const i=Array.isArray(e)?e:[e];Object.defineProperty(t,s,{set(t){i.forEach((e=>{e[s]=t}))},get:()=>e[0][s],configurable:!0})})(this,[this.inputElement,...i],t)})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,r.EA)(this,this.inputElement,{includeAttrs:["inputmode"]})})),o){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...i)=>{if(3===i.length){const t=i.slice(0,i.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...i);return t[s](...i)}:"function"==typeof t[s]?(...i)=>(e.internals[s](...i),t[s](...i)):t[s]})}}},u=t=>(0,i.Zz)(c(t),(0,o.R)({componentNameOverride:(0,r.xE)("input-wrapper")}))}}]);
|
2
2
|
//# sourceMappingURL=8961.js.map
|
package/dist/umd/8961.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"8961.js","mappings":"qNAMO,MAAMA,EAAkB,EAAGC,gBAAeC,eAAe,OAC9D,MAAMC,UAAyBC,YAC7B,wBAAWH,GACT,OAAOA,CACT,CAEA,GAEA,IAAU,EAKV,gBAAIC,GACF,OAAOA,CACT,CAGA,eAAIG,GASF,OARAC,MAAK,IAAiBA,KAAKJ,aACvBI,KAAKC,YAAYC,cAAcF,KAAKJ,cACpCI,KAECA,MAAK,GAERG,QAAQC,KAAK,qCAAsCJ,KAAKK,WAEnDL,MAAK,CACd,CAIA,eAAIC,GACF,OAAOD,KAAKM,YAAcN,IAC5B,CAEA,QAAIO,GACF,OAAOP,KAAKQ,aAAa,OAC3B,CAEA,iBAAAC,GACEC,MAAMD,sBAEFT,KAAKC,YAAYU,aAEfX,MAAK,IACPA,MAAK,GAAU,EACfA,KAAKY,SAGX,EAGF,OAAO,QACL,IACA,IACA,IACA,IAJK,CAKLf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,EAAWpE,cACxBoE,EAAWlG,UAAUqF,MAASe,EAChC,MACEF,EAAWlG,UAAUqF,MAASxP,GAEhC,OAAO6I,EAAO2G,MAASxP,EAAK,EAIJ,mBAAjB6I,EAAO2G,GACT,IAAIxP,KACTqQ,EAAWlG,UAAUqF,MAASxP,GACvB6I,EAAO2G,MAASxP,IAIpB6I,EAAO2G,IAGpB,CACF,GAGAkB,EAA2BC,IAC/B,QACElC,EAAgBkC,IAIhB,OAAiB,CAAEhK,uBAAuB,QAAiB,mB","sources":["webpack://@descope/web-components-ui/../../libs/common/src/baseClasses/baseClasses/createBaseClass.js","webpack://@descope/web-components-ui/../../libs/common/src/baseClasses/baseClasses/createBaseConnectorClass.js","webpack://@descope/web-components-ui/../../libs/common/src/baseClasses/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/helpers/mixinsHelpers.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/changeMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/componentNameValidationMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/componentsContextMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/connectorMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/createProxy.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/createStyleMixin/helpers.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/createStyleMixin/index.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/draggableMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/hoverableMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/inputValidationMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/portalMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/proxyInputMixin.js"],"sourcesContent":["import { compose } from '../../utils';\nimport { componentNameValidationMixin } from '../../componentsMixins/mixins/componentNameValidationMixin';\nimport { componentsContextMixin } from '../../componentsMixins/mixins/componentsContextMixin';\nimport { hoverableMixin } from '../../componentsMixins/mixins/hoverableMixin';\nimport { normalizeBooleanAttributesMixin } from '../../componentsMixins/mixins/normalizeBooleanAttributesMixin';\n\nexport const createBaseClass = ({ componentName, baseSelector = '' }) => {\n class DescopeBaseClass extends HTMLElement {\n static get componentName() {\n return componentName;\n }\n\n #baseElement;\n\n #isInit = true;\n\n // base selector is the selector for the component wrapper,\n // it's the highest element that is relevant for the layout\n // eslint-disable-next-line class-methods-use-this\n get baseSelector() {\n return baseSelector;\n }\n\n // this is the base element, which returned by querying the base selector\n get baseElement() {\n this.#baseElement ??= this.baseSelector\n ? this.rootElement.querySelector(this.baseSelector)\n : this;\n\n if (!this.#baseElement) {\n // eslint-disable-next-line no-console\n console.warn('missing base element for component', this.localName);\n }\n return this.#baseElement;\n }\n\n // this is the component root level element,\n // it can be either a shadow root or the component's node from the light DOM\n get rootElement() {\n return this.shadowRoot || this;\n }\n\n get name() {\n return this.getAttribute('name');\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n\n if (this.rootElement.isConnected) {\n // the init function is running once, on the first time the component is connected\n if (this.#isInit) {\n this.#isInit = false;\n this.init?.();\n }\n }\n }\n }\n\n return compose(\n componentNameValidationMixin,\n hoverableMixin,\n normalizeBooleanAttributesMixin,\n componentsContextMixin\n )(DescopeBaseClass);\n};\n","export const CONNECTOR_ERRORS = {\n CONNECTOR_INVALID: 'CONNECTOR_INVALID',\n FETCH_RESULTS_ERROR: 'FETCH_RESULTS_ERROR',\n};\n\nexport const createBaseConnectorClass = () =>\n class BaseConnectorClass {\n constructor(getAttribute) {\n this.getAttribute = getAttribute;\n this.isValid = this.#validateConfig();\n }\n\n checkConnectorValidity() {\n this.isValid = this.#validateConfig();\n }\n\n #validateConfig() {\n const missingOrInvalidParams = this.getRequiredParams().filter(\n (param) => {\n const value = this.getAttribute(param);\n return !value || !this.validateParam(param, value);\n },\n );\n\n if (missingOrInvalidParams.length) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line class-methods-use-this\n validateParam(param, value) {\n // Base validation - can be overridden by specific connectors\n return value.trim().length > 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n getRequiredParams() {\n // eslint-disable-next-line no-console\n console.error('Connector must implement getRequiredParams');\n return [];\n }\n\n async fetch(query) {\n if (!this.isValid) {\n // eslint-disable-next-line no-console\n console.error(\n `[${this.constructor.name}] Cannot fetch results: connector is not properly configured`,\n );\n return { results: [], error: CONNECTOR_ERRORS.CONNECTOR_INVALID };\n }\n\n return this._fetchResults(query);\n }\n\n // eslint-disable-next-line class-methods-use-this, no-unused-vars\n _fetchResults(query) {\n // eslint-disable-next-line no-console\n console.error('Connector must implement fetchResults');\n return { results: [], error: undefined };\n }\n };\n","import { compose } from '../../utils';\nimport { changeMixin } from '../../componentsMixins/mixins/changeMixin';\nimport { inputEventsDispatchingMixin } from '../../componentsMixins/mixins/inputEventsDispatchingMixin';\nimport { inputValidationMixin } from '../../componentsMixins/mixins/inputValidationMixin';\nimport { normalizeBooleanAttributesMixin } from '../../componentsMixins/mixins/normalizeBooleanAttributesMixin';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","// create a dispatch event function that also calls to the onevent function in case it's set\n// usage example:\n// #dispatchSomething = createDispatchEvent.bind(this, 'something' { ...options })\n// this will dispatch a new event when called, but also call to \"onsomething\"\nexport function createDispatchEvent(eventName, options = {}) {\n const event = new Event(eventName, options);\n\n this[`on${eventName}`]?.(event); // in case we got an event callback as property\n this.dispatchEvent(event);\n}\n","import { createDispatchEvent } from '../../componentsMixins/helpers/mixinsHelpers';\n\nexport const changeMixin = (superclass) =>\n class ChangeMixinClass extends superclass {\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n init() {\n super.init?.();\n this.prevValue = this.value;\n\n this.addEventListener('change', (e) => {\n e.stopPropagation();\n });\n\n this.addEventListener('blur', () => {\n if (this.value !== this.prevValue) {\n this.#dispatchChange();\n this.prevValue = this.value;\n }\n });\n }\n };\n","export const componentNameValidationMixin = (superclass) =>\n class ComponentNameValidationMixinClass extends superclass {\n #checkComponentName() {\n const currentComponentName = this.localName;\n\n if (!superclass.componentName) {\n throw Error(\n `component name is not defined on super class, make sure you have a static get for \"componentName\"`\n );\n }\n\n if (currentComponentName !== superclass.componentName) {\n throw Error(\n `component name mismatch, expected \"${superclass.componentName}\", current \"${currentComponentName}\"`\n );\n }\n }\n\n init() {\n super.init?.();\n this.#checkComponentName();\n }\n };\n","export const componentsContextMixin = (superclass) =>\n class ComponentsContextMixinClass extends superclass {\n updateComponentsContext(componentsContext) {\n this.dispatchEvent(\n new CustomEvent('components-context', {\n bubbles: true,\n composed: true,\n detail: componentsContext,\n })\n );\n }\n };\n","export const connectorMixin =\n ({ connectorClasses }) =>\n (superclass) =>\n class ConnectorMixinClass extends superclass {\n #connectorClasses = connectorClasses;\n\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), 'connector-template'];\n }\n\n get connectorClasses() {\n return this.#connectorClasses;\n }\n\n set connectorClasses(value) {\n this.#connectorClasses = value;\n }\n\n get connectorTemplate() {\n return this.getAttribute('connector-template');\n }\n\n initializeConnector() {\n const template = this.connectorTemplate;\n\n if (!this.connectorClasses[template]) {\n return;\n }\n const ConnectorClass = this.connectorClasses[template];\n this.connector = new ConnectorClass(this.getAttribute.bind(this));\n }\n\n async fetchConnectorResults(query) {\n if (!this.connector) {\n // eslint-disable-next-line no-console\n console.error(\n `No connector initialized for the field with template: ${this.connectorTemplate}`,\n );\n return { results: [] };\n }\n\n const { results, error } = await this.connector.fetch(query);\n if (error) {\n return { results: [], error };\n }\n return {\n results: results.map(({ label, value }) => ({\n label,\n value,\n })),\n };\n }\n\n init() {\n super.init?.();\n this.initializeConnector();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'connector-template') {\n this.initializeConnector();\n }\n }\n }\n };\n","import { createBaseClass } from '../../baseClasses';\nimport { isFunction } from '../../utils';\nimport { forwardProps, injectStyle, syncAttrs } from '../../componentsHelpers';\nimport { createDispatchEvent } from '../../componentsMixins/helpers/mixinsHelpers';\n\nexport const createProxy = ({\n componentName,\n wrappedEleName,\n slots = [],\n style,\n excludeAttrsSync = [],\n includeAttrsSync = [],\n includeForwardProps = [],\n delegatesFocus = true,\n}) => {\n class ProxyClass extends createBaseClass({ componentName, baseSelector: wrappedEleName }) {\n #dispatchBlur = createDispatchEvent.bind(this, 'blur');\n\n #dispatchFocus = createDispatchEvent.bind(this, 'focus');\n\n constructor() {\n super().attachShadow({ mode: 'open', delegatesFocus }).innerHTML = `\n\t\t\t<${wrappedEleName}>\n\t\t\t${slots\n .map(\n (\n slot // when slot is an empty string, we will create the default slot (without a name)\n ) => `<slot ${slot ? `name=\"${slot}\" slot=\"${slot}\"` : ''}></slot>`\n )\n .join('')}\n\t\t\t</${wrappedEleName}>\n\t\t`;\n\n injectStyle((isFunction(style) ? style() : style) || '', this);\n }\n\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('blur', (_) => {\n this.#dispatchBlur();\n });\n\n this.baseElement.addEventListener('focus', (_) => {\n this.#dispatchFocus();\n });\n\n // this is needed for components that uses props, such as combo box\n forwardProps(this.baseElement, this, includeForwardProps);\n\n syncAttrs(this.baseElement, this, {\n excludeAttrs: excludeAttrsSync,\n includeAttrs: includeAttrsSync,\n });\n }\n }\n\n return ProxyClass;\n};\n","import { camelCaseJoin, isFunction, kebabCase, kebabCaseJoin } from '../../../utils';\nimport { getCssVarName } from '../../../componentsHelpers';\n\nconst createCssVar = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;\n\nconst createCssSelector = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>\n isFunction(relativeSelectorOrSelectorFn)\n ? relativeSelectorOrSelectorFn(baseSelector)\n : `${baseSelector}${\n /^[A-Za-z]/.test(relativeSelectorOrSelectorFn)\n ? ` ${relativeSelectorOrSelectorFn}`\n : relativeSelectorOrSelectorFn\n }`;\n\nclass StyleBuilder {\n constructor() {\n this.styleMap = new Map();\n }\n\n add(selector, property, value) {\n if (!this.styleMap.has(selector)) {\n this.styleMap.set(selector, []);\n }\n\n this.styleMap.set(selector, [...this.styleMap.get(selector), { property, value }]);\n }\n\n toString() {\n return Array.from(this.styleMap.entries()).reduce((acc, [selector, propValArr]) => {\n const properties = propValArr\n .map(({ property, value }) => `${property}: ${value}`)\n .join(';\\n');\n\n return `${acc}${selector} { \\n${properties} \\n}\\n\\n`;\n }, '');\n }\n}\n\nconst normalizeConfig = (attr, config) => {\n const defaultMapping = { selector: '', property: kebabCase(attr) };\n\n if (!config || !Object.keys(config).length) return [defaultMapping];\n\n if (Array.isArray(config)) return config.map((entry) => ({ ...defaultMapping, ...entry }));\n\n return [{ ...defaultMapping, ...config }];\n};\n\nconst getFallbackVarName = (origVarName, suffix = 'fallback') => kebabCaseJoin(origVarName, suffix);\n\nexport const createStyle = (componentName, baseSelector, mappings) => {\n const style = new StyleBuilder();\n const createFallbackVar = (fallback, origVarName) => {\n if (!fallback) return '';\n if (typeof fallback === 'string') return fallback;\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback?.suffix);\n return createCssVar(fallbackVarName, createFallbackVar(fallback.fallback, fallbackVarName));\n };\n\n Object.keys(mappings).forEach((attr) => {\n const attrConfig = normalizeConfig(attr, mappings[attr]);\n\n const cssVarName = getCssVarName(componentName, attr);\n\n attrConfig.forEach(\n ({ selector: relativeSelectorOrSelectorFn, property, important, fallback }) => {\n const fallbackValue = createFallbackVar(fallback, cssVarName);\n style.add(\n createCssSelector(baseSelector, relativeSelectorOrSelectorFn),\n isFunction(property) ? property() : property,\n createCssVar(cssVarName, fallbackValue) + (important ? '!important' : '')\n );\n }\n );\n });\n\n return style.toString();\n};\n\nconst getFallbackVarsNames = (attr, origVarName, { fallback }) => {\n if (!fallback) return {};\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback.suffix);\n const fallbackAttrName = camelCaseJoin(attr, fallback.suffix || 'fallback');\n return {\n [fallbackAttrName]: fallbackVarName,\n ...getFallbackVarsNames(fallbackAttrName, fallbackVarName, fallback),\n };\n};\n\nexport const createCssVarsList = (componentName, mappings) =>\n Object.keys(mappings).reduce((acc, attr) => {\n const varName = getCssVarName(componentName, attr);\n\n return Object.assign(\n acc,\n { [attr]: varName },\n getFallbackVarsNames(attr, varName, mappings[attr])\n );\n }, {});\n\n// on some cases we need a selector to be more specific than another\n// for this we have this fn that generate a class selector multiple times\nexport const createClassSelectorSpecifier = (className, numOfRepeats) =>\n Array(numOfRepeats).fill(`.${className}`).join('');\n","import { BASE_THEME_SECTION, CSS_SELECTOR_SPECIFIER_MULTIPLY } from '../../../constants';\nimport { kebabCaseJoin } from '../../../utils';\nimport { getCssVarName, injectStyle, observeAttributes } from '../../../componentsHelpers';\nimport { componentsThemeManager } from '../../../themeHelpers';\nimport { createStyle, createCssVarsList, createClassSelectorSpecifier } from './helpers';\n\nconst STYLE_OVERRIDE_ATTR_PREFIX = 'st';\n\nexport const createStyleMixin =\n ({ mappings = {}, componentNameOverride = '' }) =>\n (superclass) => {\n const componentName = componentNameOverride || superclass.componentName;\n\n return class CustomStyleMixinClass extends superclass {\n static get cssVarList() {\n return {\n ...superclass.cssVarList,\n ...createCssVarsList(componentName, {\n ...mappings,\n }),\n };\n }\n\n #overrideStyleEle;\n\n #themeStyleEle;\n\n #disconnectThemeManager;\n\n #componentNameSuffix;\n\n #themeSection;\n\n #rootElement;\n\n #baseSelector;\n\n #styleAttributes;\n\n #getRootElement;\n\n // we are using this mixin also for portalMixin\n // so we should be able to inject styles to other DOM elements\n // this is why we need to support these overrides\n constructor({\n getRootElement,\n componentNameSuffix = '',\n themeSection = BASE_THEME_SECTION,\n baseSelector,\n } = {}) {\n super();\n this.#componentNameSuffix = componentNameSuffix;\n this.#themeSection = themeSection;\n this.#baseSelector = baseSelector ?? this.baseSelector;\n this.#getRootElement = getRootElement;\n\n this.#styleAttributes = Object.keys(CustomStyleMixinClass.cssVarList).map((key) =>\n kebabCaseJoin(STYLE_OVERRIDE_ATTR_PREFIX, componentNameSuffix, key)\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n get #componentTheme() {\n return componentsThemeManager.currentTheme?.[componentName] || '';\n }\n\n #onComponentThemeChange() {\n this.#themeStyleEle.replaceSync(this.#componentTheme[this.#themeSection]);\n }\n\n #createComponentTheme() {\n this.#themeStyleEle = injectStyle('', this.#rootElement, { prepend: true });\n this.#disconnectThemeManager = componentsThemeManager.onCurrentThemeChange(\n this.#onComponentThemeChange.bind(this)\n );\n this.#onComponentThemeChange();\n }\n\n #createOverridesStyle() {\n if (this.#styleAttributes.length) {\n const classSpecifier = createClassSelectorSpecifier(\n componentName,\n CSS_SELECTOR_SPECIFIER_MULTIPLY\n );\n\n this.#overrideStyleEle = injectStyle(`:host(${classSpecifier}) {}`, this.#rootElement);\n }\n }\n\n #setAttrOverride(attrName, value) {\n const style = this.#overrideStyleEle?.cssRules[0].style;\n\n if (!style) return;\n\n const varName = getCssVarName(\n componentName,\n attrName.replace(new RegExp(`^${STYLE_OVERRIDE_ATTR_PREFIX}-`), '')\n );\n\n if (value) style?.setProperty(varName, value);\n else {\n style?.removeProperty(varName);\n this.removeAttribute(attrName);\n }\n }\n\n #updateOverridesStyle(attrs = []) {\n attrs.forEach((attr) => {\n if (this.#styleAttributes.includes(attr)) {\n this.#setAttrOverride(attr, this.getAttribute(attr));\n }\n });\n }\n\n #createMappingStyle() {\n if (Object.keys(mappings).length) {\n const style = createStyle(\n kebabCaseJoin(componentName, this.#componentNameSuffix),\n this.#baseSelector,\n mappings\n );\n\n injectStyle(style, this.#rootElement, { prepend: true });\n }\n }\n\n #addClassName(className) {\n (this.#rootElement.classList || this.#rootElement.host.classList).add(className);\n }\n\n async init() {\n super.init?.();\n if (this.shadowRoot.isConnected) {\n this.#rootElement = (await this.#getRootElement?.(this)) || this.shadowRoot;\n\n this.#addClassName(componentName);\n\n this.#createMappingStyle();\n this.#createComponentTheme();\n this.#createOverridesStyle();\n\n // this is instead attributeChangedCallback because we cannot use static methods in this case\n observeAttributes(this, this.#updateOverridesStyle.bind(this), {});\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n\n this.#disconnectThemeManager?.();\n }\n };\n };\n","export const draggableMixin = (superclass) =>\n class DraggableMixinClass extends superclass {\n #styleEle = null;\n\n static get observedAttributes() {\n const superAttrs = superclass.observedAttributes || [];\n return [...superAttrs, 'draggable'];\n }\n\n constructor() {\n super();\n\n this.#styleEle = document.createElement('style');\n this.#styleEle.innerText = `* { cursor: inherit!important }`;\n }\n\n #handleDraggableStyle(isDraggable) {\n if (isDraggable) {\n this.shadowRoot.appendChild(this.#styleEle);\n } else {\n this.#styleEle.remove();\n }\n }\n\n get isDraggable() {\n return this.hasAttribute('draggable') && this.getAttribute('draggable') !== 'false';\n }\n\n init() {\n // because we are delegating the focus from the outer component,\n // the D&D is not working well in the page editor\n // in order to solve it we are making the inner component focusable on mouse down\n // and removing it on complete\n this.addEventListener('mousedown', (e) => {\n if (this.isDraggable) {\n const prevTabIndex = this.baseElement.getAttribute('tabindex');\n this.baseElement.setAttribute('tabindex', '-1');\n\n const onComplete = () => {\n prevTabIndex\n ? this.baseElement.setAttribute('tabindex', prevTabIndex)\n : this.baseElement.removeAttribute('tabindex');\n\n e.target.removeEventListener('mouseup', onComplete);\n e.target.removeEventListener('dragend', onComplete);\n };\n\n e.target.addEventListener('mouseup', onComplete, { once: true });\n e.target.addEventListener('dragend', onComplete, { once: true });\n }\n });\n\n super.init?.();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n if (attrName === 'draggable') {\n this.#handleDraggableStyle(newValue === 'true');\n }\n }\n };\n","export const hoverableMixin = (superclass) =>\n class HoverableMixinClass extends superclass {\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('mouseover', (e) => {\n this.setAttribute('hover', 'true');\n e.target.addEventListener('mouseleave', () => this.removeAttribute('hover'), {\n once: true,\n });\n });\n }\n };\n","import { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const inputEventsDispatchingMixin = (superclass) =>\n class InputEventsDispatchingMixinClass extends superclass {\n init() {\n this.#blockNativeEvents();\n\n super.init?.();\n }\n\n // we want to block the native (trusted) events and control when these events are being dispatched\n #blockNativeEvents() {\n ['blur', 'focus', 'focusin', 'focusout'].forEach((event) => {\n this.addEventListener(event, (e) => {\n e.isTrusted && e.target === this && e.stopImmediatePropagation();\n });\n });\n }\n\n handleFocusEventsDispatching(inputs) {\n let timerId;\n\n // in order to simulate blur & focusout on root input element\n // we are checking if focus on one of the inner elements happened immediately after blur\n // if not, the component is no longer focused and we should dispatch blur & focusout\n inputs?.forEach((input) => {\n input?.addEventListener('focusout', (e) => {\n e.stopImmediatePropagation();\n timerId = setTimeout(() => {\n timerId = null;\n\n createDispatchEvent.call(this, 'blur');\n createDispatchEvent.call(this, 'focusout', { bubbles: true });\n });\n });\n\n // in order to simulate focus & focusin on the root input element\n // we are holding a timer id and clearing it on focusin\n // if there is a timer id, it means that the root input is still focused\n // otherwise, it was not focused before, and we should dispatch focus & focusin\n const onFocus = (e) => {\n e.stopImmediatePropagation();\n clearTimeout(timerId);\n if (!timerId) {\n createDispatchEvent.call(this, 'focus');\n createDispatchEvent.call(this, 'focusin', { bubbles: true });\n }\n };\n\n // some components are not dispatching focusin but only focus\n input?.addEventListener('focusin', onFocus);\n input?.addEventListener('focus', onFocus);\n });\n }\n\n // we want to block the input events from propagating in case the value of the root input wasn't change\n // this can happen if we are sanitizing characters on the internal inputs and do not want it to affect the root input element value\n // in this case, on each input event, we are comparing the root input value to the previous one, and only if it does not match, we are allowing the input event to propagate\n handleInputEventDispatching() {\n let previousRootComponentValue = this.value;\n\n // we are comparing the previous value to the new one,\n // and if they have the same value, we are blocking the input event\n this.addEventListener('input', (e) => {\n // We don't want to block our own event that we fire from handleInputEventDispatching\n if (this !== e.target) {\n e.stopImmediatePropagation();\n\n if (previousRootComponentValue !== this.value) {\n previousRootComponentValue = this.value;\n createDispatchEvent.call(this, 'input', { bubbles: true, composed: true });\n }\n }\n });\n }\n };\n","import 'element-internals-polyfill'; // this is needed in order to support older browsers\n\nconst observedAttributes = ['required', 'pattern'];\n\nconst errorAttributes = {\n valueMissing: 'data-errormessage-value-missing',\n patternMismatch: 'data-errormessage-pattern-mismatch',\n tooShort: 'data-errormessage-pattern-mismatch-too-short',\n tooLong: 'data-errormessage-pattern-mismatch-too-long',\n rangeUnderflow: 'data-errormessage-pattern-range-underflow',\n rangeOverflow: 'data-errormessage-pattern-range-overflow',\n typeMismatch: 'data-errormessage-type-mismatch',\n};\n\nconst validationTargetSymbol = Symbol('validationTarget');\n\nexport const inputValidationMixin = (superclass) =>\n class InputValidationMixinClass extends superclass {\n #validationTarget = validationTargetSymbol;\n\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...observedAttributes];\n }\n\n static get formAssociated() {\n return true;\n }\n\n #internals;\n\n get internals() {\n return this.#internals;\n }\n\n set internals(value) {\n this.#internals = value;\n }\n\n constructor() {\n super();\n\n this.#internals = this.attachInternals();\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgValueMissing() {\n return 'Please fill out this field.';\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgPatternMismatch() {\n return 'Please match the requested format.';\n }\n\n get defaultErrorMsgTooShort() {\n return `Minimum length is ${this.getAttribute('minlength')}.`;\n }\n\n get defaultErrorMsgTooLong() {\n return `Maximum length is ${this.getAttribute('maxlength')}. `;\n }\n\n get defaultErrorMsgRangeUnderflow() {\n return `At least ${this.getAttribute('min-items-selection')} items are required.`;\n }\n\n get defaultErrorMsgRangeOverflow() {\n return `At most ${this.getAttribute('max-items-selection')} items are allowed.`;\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgTypeMismatch() {\n return `Please match the requested type.`;\n }\n\n getErrorMessage(flags) {\n const {\n valueMissing,\n patternMismatch,\n typeMismatch,\n stepMismatch,\n tooShort,\n tooLong,\n rangeOverflow,\n rangeUnderflow,\n badInput,\n customError,\n } = flags;\n\n switch (true) {\n case valueMissing:\n return (\n this.getAttribute(errorAttributes.valueMissing) || this.defaultErrorMsgValueMissing\n );\n case patternMismatch || stepMismatch || badInput:\n return (\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgPatternMismatch\n );\n case typeMismatch:\n return (\n this.getAttribute(errorAttributes.typeMismatch) ||\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgTypeMismatch\n );\n case tooShort:\n return this.getAttribute(errorAttributes.tooShort) || this.defaultErrorMsgTooShort;\n case tooLong:\n return this.getAttribute(errorAttributes.tooLong) || this.defaultErrorMsgTooLong;\n case rangeUnderflow:\n return (\n this.getAttribute(errorAttributes.rangeUnderflow) || this.defaultErrorMsgRangeUnderflow\n );\n case rangeOverflow:\n return (\n this.getAttribute(errorAttributes.rangeOverflow) || this.defaultErrorMsgRangeOverflow\n );\n case customError:\n return this.validationMessage;\n default:\n return '';\n }\n }\n\n #setValidity() {\n const validity = this.isReadOnly ? {} : this.getValidity();\n this.#internals.setValidity(validity, this.getErrorMessage(validity), this.validationTarget);\n }\n\n get validationMessage() {\n return this.#internals.validationMessage;\n }\n\n // eslint-disable-next-line class-methods-use-this\n getValidity() {\n // eslint-disable-next-line no-console\n console.warn('getValidity', 'is not implemented');\n }\n\n checkValidity() {\n return this.#internals.validity.valid;\n }\n\n reportValidity() {\n return this.#internals.reportValidity();\n }\n\n get validity() {\n return this.#internals.validity;\n }\n\n get validationTarget() {\n return this.#validationTarget === validationTargetSymbol\n ? this.inputElement\n : this.#validationTarget;\n }\n\n set validationTarget(val) {\n this.#validationTarget = val;\n }\n\n setCustomValidity(errorMessage) {\n if (errorMessage) {\n this.#internals.setValidity({ customError: true }, errorMessage, this.validationTarget);\n } else {\n this.#internals.setValidity({});\n this.#setValidity();\n }\n }\n\n get isRequired() {\n return this.hasAttribute('required') && this.getAttribute('required') !== 'false';\n }\n\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n get isDisabled() {\n return this.hasAttribute('disabled') && this.getAttribute('disabled') !== 'false';\n }\n\n get pattern() {\n return this.getAttribute('pattern');\n }\n\n get form() {\n return this.#internals.form;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (observedAttributes.includes(attrName)) {\n this.#setValidity();\n }\n }\n\n init() {\n super.init?.();\n this.addEventListener('change', this.#setValidity);\n this.addEventListener('invalid', (e) => e.stopPropagation());\n this.addEventListener('input', this.#setValidity);\n\n // The attribute sync takes time, so getValidity returns valid,\n // even when it shouldn't. This way allows all attributes to sync\n // after render, before checking the validity.\n setTimeout(() => this.#setValidity());\n }\n };\n","import { observeAttributes } from '../../componentsHelpers';\n\nconst booleanAttributesList = [\n 'readonly',\n 'focused',\n 'invalid',\n 'has-label',\n 'required',\n 'disabled',\n 'checked',\n 'has-helper',\n 'has-value',\n 'step-buttons-visible',\n 'hover',\n 'has-error-message',\n 'focus-ring',\n 'opened',\n 'active',\n 'password-visible',\n 'opening',\n 'closing',\n 'has-no-options',\n 'loading',\n 'allow-custom-value',\n];\n\nconst isBooleanAttribute = (attr) => {\n return booleanAttributesList.includes(attr);\n};\n// we want all the valueless attributes to have \"true\" value\n// and all the falsy attribute to be removed\nexport const normalizeBooleanAttributesMixin = (superclass) =>\n class NormalizeBooleanAttributesMixinClass extends superclass {\n init() {\n super.init?.();\n\n observeAttributes(\n this,\n (attrs) =>\n attrs.forEach((attr) => {\n const attrVal = this.getAttribute(attr);\n\n if (isBooleanAttribute(attr)) {\n if (attrVal === '') {\n this.setAttribute(attr, 'true');\n } else if (attrVal === 'false') {\n this.removeAttribute(attr);\n }\n } else if (!attrVal) {\n // eslint-disable-next-line no-console\n console.debug(\n `attribute \"${attr}\" has no value, should it be added to the boolean attributes list?`\n );\n }\n }),\n {}\n );\n }\n };\n","import { kebabCaseJoin } from '../../utils';\nimport { forwardAttrs } from '../../componentsHelpers';\nimport { createStyleMixin } from '../mixins/createStyleMixin';\nimport { createCssVarsList } from './createStyleMixin/helpers';\n\n// this is needed because we might generate the same css vars names\n// e.g. \"overlayColor\" attribute in style mixin's mapping,\n// will generate the same var as \"color\" attribute in portals's mapping\n// when the portal name is \"overlay\".\n// because of that, we are adding this separator that is also used as a differentiator\nconst DISPLAY_NAME_SEPARATOR = '_';\nconst PORTAL_THEME_PREFIX = '@';\n\n\nconst sanitizeSelector = (selector) => selector.replace(/[^\\w\\s]/gi, '');\n\nconst withWaitForShadowRoot = (getRootElementFn) => async (that) => {\n const ele = await getRootElementFn(that);\n\n return new Promise((res) => {\n const MAX_RETRIES = 20;\n let counter = 0;\n\n const check = () => {\n if (counter > MAX_RETRIES) {\n // eslint-disable-next-line no-console\n console.error('could not get shadow root for element', ele);\n res(ele);\n return;\n }\n\n counter++;\n\n if (!ele?.shadowRoot) {\n setTimeout(check);\n } else {\n res(ele.shadowRoot);\n }\n };\n check();\n });\n};\n\nexport const portalMixin =\n ({ name, selector, mappings = {}, forward: { attributes = [], include = true } = {} }) =>\n (superclass) => {\n const eleDisplayName = name || sanitizeSelector(selector);\n\n const BaseClass = createStyleMixin({\n mappings,\n })(superclass);\n\n return class PortalMixinClass extends BaseClass {\n static get cssVarList() {\n return {\n ...BaseClass.cssVarList,\n [eleDisplayName]: createCssVarsList(\n kebabCaseJoin(superclass.componentName, DISPLAY_NAME_SEPARATOR + eleDisplayName),\n mappings\n ),\n };\n }\n\n #portalEle;\n\n constructor() {\n // we cannot use \"this\" before calling \"super\"\n const getRootElement = async (that) => {\n const baseEle = (that.shadowRoot || that).querySelector(that.baseSelector);\n if (!selector) {\n return baseEle;\n }\n\n // in case we have a selector, we should first wait for the base element shadow root\n // and then look for the internal element\n const baseEleShadowRoot = await withWaitForShadowRoot(() => baseEle)(that);\n return baseEleShadowRoot.querySelector(selector);\n };\n\n const getPortalElement = withWaitForShadowRoot(getRootElement);\n\n super({\n getRootElement: getPortalElement,\n componentNameSuffix: DISPLAY_NAME_SEPARATOR + eleDisplayName,\n themeSection: PORTAL_THEME_PREFIX + eleDisplayName,\n baseSelector: ':host',\n });\n\n this.#portalEle = getPortalElement(this).then((ele) => ele.host);\n }\n\n async #handleHoverAttribute() {\n const portalEle = await this.#portalEle;\n portalEle.onmouseenter = (e) => {\n e.target.setAttribute('hover', 'true');\n };\n portalEle.onmouseleave = (e) => {\n e.target.removeAttribute('hover');\n };\n }\n\n async init() {\n super.init?.();\n const portalEle = await this.#portalEle;\n forwardAttrs(this, portalEle, {\n [include ? 'includeAttrs' : 'excludeAttrs']: attributes,\n });\n\n this.#handleHoverAttribute();\n }\n };\n };\n","/* eslint-disable no-param-reassign */\nimport { compose } from '../../utils';\nimport { forwardAttrs, getComponentName } from '../../componentsHelpers';\nimport { createDispatchEvent } from '../helpers/mixinsHelpers';\nimport { inputValidationMixin } from '../mixins/inputValidationMixin';\nimport { createStyleMixin } from '../mixins/createStyleMixin';\n\nconst errorAttrs = ['invalid', 'required'];\n\nconst forwardProps = (src, targets, property) => {\n const targetArr = Array.isArray(targets) ? targets : [targets];\n\n Object.defineProperty(src, property, {\n set(v) {\n targetArr.forEach((target) => {\n target[property] = v;\n });\n },\n get() {\n return targets[0][property];\n },\n configurable: true,\n });\n};\n\n// recursively take the first slot child until it finds an element which is not a slot\n// stops after \"nestingLevel\" times\nconst getNestedInput = (ele) => {\n if (!ele) return undefined;\n\n const nestingLevel = 10;\n\n let nonSlotEle = ele;\n for (let i = 0; i < nestingLevel; i++) {\n [nonSlotEle] = nonSlotEle.assignedElements();\n if (nonSlotEle?.localName !== 'slot') return nonSlotEle;\n }\n return undefined;\n};\n\nconst proxyInputMixin =\n ({\n proxyProps = [],\n // useProxyTargets flag allows to forwardProps to other targets, other than\n // `this.inputElement`. It's to be used within `external-input` components,\n // if needed\n useProxyTargets = false,\n // allows us to set the event that should trigger validation\n // it can be either a string or an array of strings (for multiple events)\n inputEvent = 'input',\n triggerValidationEvents = [],\n // Proxies all validations from the parent component to the input element\n proxyParentValidation = false,\n }) =>\n (superclass) =>\n class ProxyInputMixinClass extends inputValidationMixin(superclass) {\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...errorAttrs];\n }\n\n #inputElement;\n\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n constructor() {\n super();\n\n this.#inputElement = super.inputElement;\n }\n\n // the web-component does not loaded immediately, so we want to defer the warning\n // and show it only if the input element was not found after the component is loaded\n warnIfInputElementIsMissing() {\n clearTimeout(this.inputElementTimerId);\n\n this.inputElementTimerId = setTimeout(() => {\n // eslint-disable-next-line no-console\n !this.#inputElement && console.warn(this.localName, 'no input was found');\n }, 0);\n }\n\n get inputElement() {\n if (this.#inputElement) return this.#inputElement;\n\n this.warnIfInputElementIsMissing();\n\n const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"input\"]');\n const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"textarea\"]');\n\n this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);\n\n return this.#inputElement;\n }\n\n set inputElement(ele) {\n this.#inputElement = ele;\n }\n\n getValidity() {\n return this.inputElement?.validity || {};\n }\n\n #handleErrorMessage() {\n this.setAttribute('error-message', this.validationMessage);\n }\n\n // We do not want to show the default validity report tooltip\n // So we are overriding the reportValidity fn to show the input's error message\n reportValidity = () => {\n // we want to update validity so in case the value was set programmatically, we won't get an error\n this.inputElement.setCustomValidity('');\n this.setCustomValidity('');\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n this.#handleErrorMessage();\n this.focus();\n }\n };\n\n // we are keeping also the default reportValidity because there are some components that still using it\n defaultReportValidity() {\n return super.reportValidity();\n }\n\n init() {\n super.init?.();\n\n // vaadin sets invalid indication on blur\n // we want invalid indication to appear only when calling reportValidity\n // this is why we are overriding vaadin's setInvalid behavior\n // to update only when the element is valid (so invalid indication will only be removed)\n // and we are adding it in reportValidity\n // eslint-disable-next-line func-names\n this.baseElement._setInvalid = function (invalid) {\n if (!invalid && this._shouldSetInvalid(invalid)) {\n this.invalid = invalid;\n }\n };\n\n // We want to ensure that `input` events properly cross ShadowDOM boundries\n // e.g. When we autofill a component's input with 1Password, for instance,\n // the event is fired without `composed: true` and doesn't our component's\n // ShadowDOM.\n this.baseElement.addEventListener('input', (e) => {\n if (!e.composed) {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n }\n });\n\n triggerValidationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n this.inputElement?.setCustomValidity('');\n });\n });\n\n // on some cases the base element is not ready so the inputElement is empty\n // we are deferring this section to make sure the base element is ready\n setTimeout(() => {\n const validationEvents = Array.isArray(inputEvent) ? inputEvent : [inputEvent];\n\n validationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n if (!this.baseElement.checkValidity()) {\n this.#handleErrorMessage();\n } else {\n this.removeAttribute('invalid');\n }\n });\n });\n\n this.baseElement.addEventListener('change', () => {\n this.#dispatchChange();\n });\n\n this.addEventListener('invalid', () => {\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n }\n this.#handleErrorMessage();\n });\n\n // sync properties\n proxyProps.forEach((prop) => {\n const externalInput = this.querySelector('input[slot=\"external-input\"]') || null;\n const proxyTargets = useProxyTargets\n ? [this.baseElement, externalInput].filter(Boolean)\n : [];\n forwardProps(this, [this.inputElement, ...proxyTargets], prop);\n });\n\n this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);\n\n forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });\n });\n\n if (proxyParentValidation) {\n // All functions called on the inputElement internals will be applied to the parent\n // component internals as well. As a result, there's no need to add outer mechanisms\n // to update the parent component's validity state based on the input elements validity.\n const inputElementInternals = this.inputElement.internals;\n const parentThis = this;\n this.inputElement.internals = new Proxy(inputElementInternals, {\n get: (target, prop) => {\n if (typeof target[prop] === 'function' && prop === 'setValidity') {\n return (...args) => {\n // If we're calling setValidity with 3 args, then the validationTarget\n // needs to be swapped to be the inputElement\n if (args.length === 3) {\n const newArgs = args.slice(0, args.length - 1);\n newArgs.push(parentThis.inputElement);\n parentThis.internals[prop](...newArgs);\n } else {\n parentThis.internals[prop](...args);\n }\n return target[prop](...args);\n };\n }\n\n if (typeof target[prop] === 'function') {\n return (...args) => {\n parentThis.internals[prop](...args);\n return target[prop](...args);\n };\n }\n\n return target[prop];\n },\n });\n }\n }\n };\n\nconst composedProxyInputMixin = (proxyInputMixinConfig) =>\n compose(\n proxyInputMixin(proxyInputMixinConfig),\n // in order to use input-wrapper across all our input components, we need to inject its theme\n // to every proxy input mixin, to allow its css vars to be scoped properly and accessible\n // in the proxy input component\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })\n );\n\nexport { composedProxyInputMixin as proxyInputMixin };\n"],"names":["createBaseClass","componentName","baseSelector","DescopeBaseClass","HTMLElement","baseElement","this","rootElement","querySelector","console","warn","localName","shadowRoot","name","getAttribute","connectedCallback","super","isConnected","init","CONNECTOR_ERRORS","CONNECTOR_INVALID","FETCH_RESULTS_ERROR","createBaseConnectorClass","constructor","isValid","checkConnectorValidity","getRequiredParams","filter","param","value","validateParam","length","trim","error","fetch","query","_fetchResults","results","undefined","createBaseInputClass","args","createDispatchEvent","eventName","options","event","Event","dispatchEvent","changeMixin","superclass","bind","prevValue","addEventListener","e","stopPropagation","componentNameValidationMixin","currentComponentName","Error","componentsContextMixin","updateComponentsContext","componentsContext","CustomEvent","bubbles","composed","detail","connectorMixin","connectorClasses","observedAttributes","connectorTemplate","initializeConnector","template","ConnectorClass","connector","fetchConnectorResults","map","label","attributeChangedCallback","attrName","oldValue","newValue","createProxy","wrappedEleName","slots","style","excludeAttrsSync","includeAttrsSync","includeForwardProps","delegatesFocus","ProxyClass","attachShadow","mode","innerHTML","slot","join","_","excludeAttrs","includeAttrs","createCssVar","varName","fallback","StyleBuilder","styleMap","Map","add","selector","property","has","set","get","toString","Array","from","entries","reduce","acc","propValArr","getFallbackVarName","origVarName","suffix","createStyle","mappings","createFallbackVar","fallbackVarName","Object","keys","forEach","attr","attrConfig","config","defaultMapping","isArray","entry","normalizeConfig","cssVarName","relativeSelectorOrSelectorFn","important","fallbackValue","test","createCssSelector","getFallbackVarsNames","fallbackAttrName","createCssVarsList","assign","createClassSelectorSpecifier","className","numOfRepeats","fill","createStyleMixin","componentNameOverride","CustomStyleMixinClass","cssVarList","getRootElement","componentNameSuffix","themeSection","key","currentTheme","replaceSync","prepend","onCurrentThemeChange","classSpecifier","cssRules","replace","RegExp","setProperty","removeProperty","removeAttribute","attrs","includes","classList","host","disconnectedCallback","draggableMixin","document","createElement","innerText","isDraggable","appendChild","remove","hasAttribute","prevTabIndex","setAttribute","onComplete","target","removeEventListener","once","hoverableMixin","inputEventsDispatchingMixin","isTrusted","stopImmediatePropagation","handleFocusEventsDispatching","inputs","timerId","input","setTimeout","call","onFocus","clearTimeout","handleInputEventDispatching","previousRootComponentValue","errorAttributes","validationTargetSymbol","Symbol","inputValidationMixin","formAssociated","internals","attachInternals","defaultErrorMsgValueMissing","defaultErrorMsgPatternMismatch","defaultErrorMsgTooShort","defaultErrorMsgTooLong","defaultErrorMsgRangeUnderflow","defaultErrorMsgRangeOverflow","defaultErrorMsgTypeMismatch","getErrorMessage","flags","valueMissing","patternMismatch","typeMismatch","stepMismatch","tooShort","tooLong","rangeOverflow","rangeUnderflow","badInput","customError","validationMessage","validity","isReadOnly","getValidity","setValidity","validationTarget","checkValidity","valid","reportValidity","inputElement","val","setCustomValidity","errorMessage","isRequired","isDisabled","pattern","form","booleanAttributesList","normalizeBooleanAttributesMixin","attrVal","isBooleanAttribute","debug","withWaitForShadowRoot","getRootElementFn","async","that","ele","Promise","res","counter","check","portalMixin","forward","attributes","include","eleDisplayName","sanitizeSelector","BaseClass","getPortalElement","baseEle","then","portalEle","onmouseenter","onmouseleave","errorAttrs","getNestedInput","nonSlotEle","i","assignedElements","proxyInputMixin","proxyProps","useProxyTargets","inputEvent","triggerValidationEvents","proxyParentValidation","warnIfInputElementIsMissing","inputElementTimerId","inputSlot","textAreaSlot","focus","defaultReportValidity","_setInvalid","invalid","_shouldSetInvalid","prop","externalInput","proxyTargets","Boolean","src","targets","targetArr","defineProperty","v","configurable","forwardProps","setSelectionRange","inputElementInternals","parentThis","Proxy","newArgs","slice","push","composedProxyInputMixin","proxyInputMixinConfig"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"8961.js","mappings":"qNAMO,MAAMA,EAAkB,EAAGC,gBAAeC,eAAe,OAC9D,MAAMC,UAAyBC,YAC7B,wBAAWH,GACT,OAAOA,CACT,CAEA,GAEA,IAAU,EAKV,gBAAIC,GACF,OAAOA,CACT,CAGA,eAAIG,GASF,OARAC,MAAK,IAAiBA,KAAKJ,aACvBI,KAAKC,YAAYC,cAAcF,KAAKJ,cACpCI,KAECA,MAAK,GAERG,QAAQC,KAAK,qCAAsCJ,KAAKK,WAEnDL,MAAK,CACd,CAIA,eAAIC,GACF,OAAOD,KAAKM,YAAcN,IAC5B,CAEA,QAAIO,GACF,OAAOP,KAAKQ,aAAa,OAC3B,CAEA,iBAAAC,GACEC,MAAMD,sBAEFT,KAAKC,YAAYU,aAEfX,MAAK,IACPA,MAAK,GAAU,EACfA,KAAKY,SAGX,EAGF,OAAO,QACL,IACA,IACA,IACA,IAJK,CAKLf,EAAiB,C,2CChEd,MAAMgB,EAAmB,CAC9BC,kBAAmB,oBACnBC,oBAAqB,uBAGVC,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KD,YAAauR,GAAejQ,OAAOmQ,SACzC,GAjLK,EAACC,EAAKC,EAASxL,KAClC,MAAMyL,EAAYpL,MAAMoB,QAAQ+J,GAAWA,EAAU,CAACA,GAEtDtK,OAAOwK,eAAeH,EAAKvL,EAAU,CACnC,GAAAE,CAAIyL,GACFF,EAAUrK,SAASoD,IACjBA,EAAOxE,GAAY2L,CAAC,GAExB,EACAxL,IAAG,IACMqL,EAAQ,GAAGxL,GAEpB4L,cAAc,GACd,EAqKQC,CAAa/R,KAAM,CAACA,KAAK8N,gBAAiByD,GAAeF,EAAK,IAGhErR,KAAKgS,kBAAoBhS,KAAK8N,aAAakE,mBAAmBrP,KAAK3C,KAAK8N,eAExE,QAAa9N,KAAMA,KAAK8N,aAAc,CAAErI,aAAc,CAAC,cAAe,IAGpEkL,EAAuB,CAIzB,MAAMsB,EAAwBjS,KAAK8N,aAAa9B,UAC1CkG,EAAalS,KACnBA,KAAK8N,aAAa9B,UAAY,IAAImG,MAAMF,EAAuB,CAC7D5L,IAAK,CAACqE,EAAQ2G,IACgB,mBAAjB3G,EAAO2G,IAAiC,gBAATA,EACjC,IAAInP,KAGT,GAAoB,IAAhBA,EAAKT,OAAc,CACrB,MAAM2Q,EAAUlQ,EAAKmQ,MAAM,EAAGnQ,EAAKT,OAAS,GAC5C2Q,EAAQE,KAAKJ,EAAWpE,cACxBoE,EAAWlG,UAAUqF,MAASe,EAChC,MACEF,EAAWlG,UAAUqF,MAASnP,GAEhC,OAAOwI,EAAO2G,MAASnP,EAAK,EAIJ,mBAAjBwI,EAAO2G,GACT,IAAInP,KACTgQ,EAAWlG,UAAUqF,MAASnP,GACvBwI,EAAO2G,MAASnP,IAIpBwI,EAAO2G,IAGpB,CACF,GAGAkB,EAA2BC,IAC/B,QACElC,EAAgBkC,IAIhB,OAAiB,CAAE3J,uBAAuB,QAAiB,mB","sources":["webpack://@descope/web-components-ui/../../libs/common/src/baseClasses/baseClasses/createBaseClass.js","webpack://@descope/web-components-ui/../../libs/common/src/baseClasses/baseClasses/createBaseConnectorClass.js","webpack://@descope/web-components-ui/../../libs/common/src/baseClasses/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/helpers/mixinsHelpers.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/changeMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/componentNameValidationMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/componentsContextMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/connectorMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/createProxy.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/createStyleMixin/helpers.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/createStyleMixin/index.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/draggableMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/hoverableMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/inputValidationMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/portalMixin.js","webpack://@descope/web-components-ui/../../libs/common/src/componentsMixins/mixins/proxyInputMixin.js"],"sourcesContent":["import { compose } from '../../utils';\nimport { componentNameValidationMixin } from '../../componentsMixins/mixins/componentNameValidationMixin';\nimport { componentsContextMixin } from '../../componentsMixins/mixins/componentsContextMixin';\nimport { hoverableMixin } from '../../componentsMixins/mixins/hoverableMixin';\nimport { normalizeBooleanAttributesMixin } from '../../componentsMixins/mixins/normalizeBooleanAttributesMixin';\n\nexport const createBaseClass = ({ componentName, baseSelector = '' }) => {\n class DescopeBaseClass extends HTMLElement {\n static get componentName() {\n return componentName;\n }\n\n #baseElement;\n\n #isInit = true;\n\n // base selector is the selector for the component wrapper,\n // it's the highest element that is relevant for the layout\n // eslint-disable-next-line class-methods-use-this\n get baseSelector() {\n return baseSelector;\n }\n\n // this is the base element, which returned by querying the base selector\n get baseElement() {\n this.#baseElement ??= this.baseSelector\n ? this.rootElement.querySelector(this.baseSelector)\n : this;\n\n if (!this.#baseElement) {\n // eslint-disable-next-line no-console\n console.warn('missing base element for component', this.localName);\n }\n return this.#baseElement;\n }\n\n // this is the component root level element,\n // it can be either a shadow root or the component's node from the light DOM\n get rootElement() {\n return this.shadowRoot || this;\n }\n\n get name() {\n return this.getAttribute('name');\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n\n if (this.rootElement.isConnected) {\n // the init function is running once, on the first time the component is connected\n if (this.#isInit) {\n this.#isInit = false;\n this.init?.();\n }\n }\n }\n }\n\n return compose(\n componentNameValidationMixin,\n hoverableMixin,\n normalizeBooleanAttributesMixin,\n componentsContextMixin\n )(DescopeBaseClass);\n};\n","export const CONNECTOR_ERRORS = {\n CONNECTOR_INVALID: 'CONNECTOR_INVALID',\n FETCH_RESULTS_ERROR: 'FETCH_RESULTS_ERROR',\n};\n\nexport const createBaseConnectorClass = () =>\n class BaseConnectorClass {\n constructor(getAttribute) {\n this.getAttribute = getAttribute;\n this.isValid = this.#validateConfig();\n }\n\n checkConnectorValidity() {\n this.isValid = this.#validateConfig();\n }\n\n #validateConfig() {\n const missingOrInvalidParams = this.getRequiredParams().filter(\n (param) => {\n const value = this.getAttribute(param);\n return !value || !this.validateParam(param, value);\n },\n );\n\n if (missingOrInvalidParams.length) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line class-methods-use-this\n validateParam(param, value) {\n // Base validation - can be overridden by specific connectors\n return value.trim().length > 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n getRequiredParams() {\n // eslint-disable-next-line no-console\n console.error('Connector must implement getRequiredParams');\n return [];\n }\n\n async fetch(query) {\n if (!this.isValid) {\n // eslint-disable-next-line no-console\n console.error(\n `[${this.constructor.name}] Cannot fetch results: connector is not properly configured`,\n );\n return { results: [], error: CONNECTOR_ERRORS.CONNECTOR_INVALID };\n }\n\n return this._fetchResults(query);\n }\n\n // eslint-disable-next-line class-methods-use-this, no-unused-vars\n _fetchResults(query) {\n // eslint-disable-next-line no-console\n console.error('Connector must implement fetchResults');\n return { results: [], error: undefined };\n }\n };\n","import { compose } from '../../utils';\nimport { changeMixin } from '../../componentsMixins/mixins/changeMixin';\nimport { inputEventsDispatchingMixin } from '../../componentsMixins/mixins/inputEventsDispatchingMixin';\nimport { inputValidationMixin } from '../../componentsMixins/mixins/inputValidationMixin';\nimport { normalizeBooleanAttributesMixin } from '../../componentsMixins/mixins/normalizeBooleanAttributesMixin';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","// create a dispatch event function that also calls to the onevent function in case it's set\n// usage example:\n// #dispatchSomething = createDispatchEvent.bind(this, 'something' { ...options })\n// this will dispatch a new event when called, but also call to \"onsomething\"\nexport function createDispatchEvent(eventName, options = {}) {\n const event = new Event(eventName, options);\n\n this[`on${eventName}`]?.(event); // in case we got an event callback as property\n this.dispatchEvent(event);\n}\n","import { createDispatchEvent } from '../../componentsMixins/helpers/mixinsHelpers';\n\nexport const changeMixin = (superclass) =>\n class ChangeMixinClass extends superclass {\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n init() {\n super.init?.();\n this.prevValue = this.value;\n\n this.addEventListener('change', (e) => {\n e.stopPropagation();\n });\n\n this.addEventListener('blur', () => {\n if (this.value !== this.prevValue) {\n this.#dispatchChange();\n this.prevValue = this.value;\n }\n });\n }\n };\n","export const componentNameValidationMixin = (superclass) =>\n class ComponentNameValidationMixinClass extends superclass {\n #checkComponentName() {\n const currentComponentName = this.localName;\n\n if (!superclass.componentName) {\n throw Error(\n `component name is not defined on super class, make sure you have a static get for \"componentName\"`\n );\n }\n\n if (currentComponentName !== superclass.componentName) {\n throw Error(\n `component name mismatch, expected \"${superclass.componentName}\", current \"${currentComponentName}\"`\n );\n }\n }\n\n init() {\n super.init?.();\n this.#checkComponentName();\n }\n };\n","export const componentsContextMixin = (superclass) =>\n class ComponentsContextMixinClass extends superclass {\n updateComponentsContext(componentsContext) {\n this.dispatchEvent(\n new CustomEvent('components-context', {\n bubbles: true,\n composed: true,\n detail: componentsContext,\n })\n );\n }\n };\n","export const connectorMixin =\n ({ connectorClasses }) =>\n (superclass) =>\n class ConnectorMixinClass extends superclass {\n #connectorClasses = connectorClasses;\n\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), 'connector-template'];\n }\n\n get connectorClasses() {\n return this.#connectorClasses;\n }\n\n set connectorClasses(value) {\n this.#connectorClasses = value;\n }\n\n get connectorTemplate() {\n return this.getAttribute('connector-template');\n }\n\n initializeConnector() {\n const template = this.connectorTemplate;\n\n if (!this.connectorClasses[template]) {\n return;\n }\n const ConnectorClass = this.connectorClasses[template];\n this.connector = new ConnectorClass(this.getAttribute.bind(this));\n }\n\n async fetchConnectorResults(query) {\n if (!this.connector) {\n // eslint-disable-next-line no-console\n console.error(\n `No connector initialized for the field with template: ${this.connectorTemplate}`,\n );\n return { results: [] };\n }\n\n const { results, error } = await this.connector.fetch(query);\n if (error) {\n return { results: [], error };\n }\n return {\n results: results.map(({ label, value }) => ({\n label,\n value,\n })),\n };\n }\n\n init() {\n super.init?.();\n this.initializeConnector();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'connector-template') {\n this.initializeConnector();\n }\n }\n }\n };\n","import { createBaseClass } from '../../baseClasses';\nimport { isFunction } from '../../utils';\nimport { forwardProps, injectStyle, syncAttrs } from '../../componentsHelpers';\nimport { createDispatchEvent } from '../../componentsMixins/helpers/mixinsHelpers';\n\nexport const createProxy = ({\n componentName,\n wrappedEleName,\n slots = [],\n style,\n excludeAttrsSync = [],\n includeAttrsSync = [],\n includeForwardProps = [],\n delegatesFocus = true,\n}) => {\n class ProxyClass extends createBaseClass({ componentName, baseSelector: wrappedEleName }) {\n #dispatchBlur = createDispatchEvent.bind(this, 'blur');\n\n #dispatchFocus = createDispatchEvent.bind(this, 'focus');\n\n constructor() {\n super().attachShadow({ mode: 'open', delegatesFocus }).innerHTML = `\n\t\t\t<${wrappedEleName}>\n\t\t\t${slots\n .map(\n (\n slot // when slot is an empty string, we will create the default slot (without a name)\n ) => `<slot ${slot ? `name=\"${slot}\" slot=\"${slot}\"` : ''}></slot>`\n )\n .join('')}\n\t\t\t</${wrappedEleName}>\n\t\t`;\n\n injectStyle((isFunction(style) ? style() : style) || '', this);\n }\n\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('blur', (_) => {\n this.#dispatchBlur();\n });\n\n this.baseElement.addEventListener('focus', (_) => {\n this.#dispatchFocus();\n });\n\n // this is needed for components that uses props, such as combo box\n forwardProps(this.baseElement, this, includeForwardProps);\n\n syncAttrs(this.baseElement, this, {\n excludeAttrs: excludeAttrsSync,\n includeAttrs: includeAttrsSync,\n });\n }\n }\n\n return ProxyClass;\n};\n","import { camelCaseJoin, isFunction, kebabCase, kebabCaseJoin } from '../../../utils';\nimport { getCssVarName } from '../../../componentsHelpers';\n\nconst createCssVar = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;\n\nconst createCssSelector = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>\n isFunction(relativeSelectorOrSelectorFn)\n ? relativeSelectorOrSelectorFn(baseSelector)\n : `${baseSelector}${\n /^[A-Za-z]/.test(relativeSelectorOrSelectorFn)\n ? ` ${relativeSelectorOrSelectorFn}`\n : relativeSelectorOrSelectorFn\n }`;\n\nclass StyleBuilder {\n constructor() {\n this.styleMap = new Map();\n }\n\n add(selector, property, value) {\n if (!this.styleMap.has(selector)) {\n this.styleMap.set(selector, []);\n }\n\n this.styleMap.set(selector, [...this.styleMap.get(selector), { property, value }]);\n }\n\n toString() {\n return Array.from(this.styleMap.entries()).reduce((acc, [selector, propValArr]) => {\n const properties = propValArr\n .map(({ property, value }) => `${property}: ${value}`)\n .join(';\\n');\n\n return `${acc}${selector} { \\n${properties} \\n}\\n\\n`;\n }, '');\n }\n}\n\nconst normalizeConfig = (attr, config) => {\n const defaultMapping = { selector: '', property: kebabCase(attr) };\n\n if (!config || !Object.keys(config).length) return [defaultMapping];\n\n if (Array.isArray(config)) return config.map((entry) => ({ ...defaultMapping, ...entry }));\n\n return [{ ...defaultMapping, ...config }];\n};\n\nconst getFallbackVarName = (origVarName, suffix = 'fallback') => kebabCaseJoin(origVarName, suffix);\n\nexport const createStyle = (componentName, baseSelector, mappings) => {\n const style = new StyleBuilder();\n const createFallbackVar = (fallback, origVarName) => {\n if (!fallback) return '';\n if (typeof fallback === 'string') return fallback;\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback?.suffix);\n return createCssVar(fallbackVarName, createFallbackVar(fallback.fallback, fallbackVarName));\n };\n\n Object.keys(mappings).forEach((attr) => {\n const attrConfig = normalizeConfig(attr, mappings[attr]);\n\n const cssVarName = getCssVarName(componentName, attr);\n\n attrConfig.forEach(\n ({ selector: relativeSelectorOrSelectorFn, property, important, fallback }) => {\n const fallbackValue = createFallbackVar(fallback, cssVarName);\n style.add(\n createCssSelector(baseSelector, relativeSelectorOrSelectorFn),\n isFunction(property) ? property() : property,\n createCssVar(cssVarName, fallbackValue) + (important ? '!important' : '')\n );\n }\n );\n });\n\n return style.toString();\n};\n\nconst getFallbackVarsNames = (attr, origVarName, { fallback }) => {\n if (!fallback) return {};\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback.suffix);\n const fallbackAttrName = camelCaseJoin(attr, fallback.suffix || 'fallback');\n return {\n [fallbackAttrName]: fallbackVarName,\n ...getFallbackVarsNames(fallbackAttrName, fallbackVarName, fallback),\n };\n};\n\nexport const createCssVarsList = (componentName, mappings) =>\n Object.keys(mappings).reduce((acc, attr) => {\n const varName = getCssVarName(componentName, attr);\n\n return Object.assign(\n acc,\n { [attr]: varName },\n getFallbackVarsNames(attr, varName, mappings[attr])\n );\n }, {});\n\n// on some cases we need a selector to be more specific than another\n// for this we have this fn that generate a class selector multiple times\nexport const createClassSelectorSpecifier = (className, numOfRepeats) =>\n Array(numOfRepeats).fill(`.${className}`).join('');\n","import { BASE_THEME_SECTION, CSS_SELECTOR_SPECIFIER_MULTIPLY } from '../../../constants';\nimport { kebabCaseJoin } from '../../../utils';\nimport { getCssVarName, injectStyle, observeAttributes } from '../../../componentsHelpers';\nimport { componentsThemeManager } from '../../../themeHelpers';\nimport { createStyle, createCssVarsList, createClassSelectorSpecifier } from './helpers';\n\nconst STYLE_OVERRIDE_ATTR_PREFIX = 'st';\n\nexport const createStyleMixin =\n ({ mappings = {}, componentNameOverride = '' }) =>\n (superclass) => {\n const componentName = componentNameOverride || superclass.componentName;\n\n return class CustomStyleMixinClass extends superclass {\n static get cssVarList() {\n return {\n ...superclass.cssVarList,\n ...createCssVarsList(componentName, {\n ...mappings,\n }),\n };\n }\n\n #overrideStyleEle;\n\n #themeStyleEle;\n\n #disconnectThemeManager;\n\n #componentNameSuffix;\n\n #themeSection;\n\n #rootElement;\n\n #baseSelector;\n\n #styleAttributes;\n\n #getRootElement;\n\n // we are using this mixin also for portalMixin\n // so we should be able to inject styles to other DOM elements\n // this is why we need to support these overrides\n constructor({\n getRootElement,\n componentNameSuffix = '',\n themeSection = BASE_THEME_SECTION,\n baseSelector,\n } = {}) {\n super();\n this.#componentNameSuffix = componentNameSuffix;\n this.#themeSection = themeSection;\n this.#baseSelector = baseSelector ?? this.baseSelector;\n this.#getRootElement = getRootElement;\n\n this.#styleAttributes = Object.keys(CustomStyleMixinClass.cssVarList).map((key) =>\n kebabCaseJoin(STYLE_OVERRIDE_ATTR_PREFIX, componentNameSuffix, key)\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n get #componentTheme() {\n return componentsThemeManager.currentTheme?.[componentName] || '';\n }\n\n #onComponentThemeChange() {\n this.#themeStyleEle.replaceSync(this.#componentTheme[this.#themeSection]);\n }\n\n #createComponentTheme() {\n this.#themeStyleEle = injectStyle('', this.#rootElement, { prepend: true });\n this.#disconnectThemeManager = componentsThemeManager.onCurrentThemeChange(\n this.#onComponentThemeChange.bind(this)\n );\n this.#onComponentThemeChange();\n }\n\n #createOverridesStyle() {\n if (this.#styleAttributes.length) {\n const classSpecifier = createClassSelectorSpecifier(\n componentName,\n CSS_SELECTOR_SPECIFIER_MULTIPLY\n );\n\n this.#overrideStyleEle = injectStyle(`:host(${classSpecifier}) {}`, this.#rootElement);\n }\n }\n\n #setAttrOverride(attrName, value) {\n const style = this.#overrideStyleEle?.cssRules[0].style;\n\n if (!style) return;\n\n const varName = getCssVarName(\n componentName,\n attrName.replace(new RegExp(`^${STYLE_OVERRIDE_ATTR_PREFIX}-`), '')\n );\n\n if (value) style?.setProperty(varName, value);\n else {\n style?.removeProperty(varName);\n this.removeAttribute(attrName);\n }\n }\n\n #updateOverridesStyle(attrs = []) {\n attrs.forEach((attr) => {\n if (this.#styleAttributes.includes(attr)) {\n this.#setAttrOverride(attr, this.getAttribute(attr));\n }\n });\n }\n\n #createMappingStyle() {\n if (Object.keys(mappings).length) {\n const style = createStyle(\n kebabCaseJoin(componentName, this.#componentNameSuffix),\n this.#baseSelector,\n mappings\n );\n\n injectStyle(style, this.#rootElement, { prepend: true });\n }\n }\n\n #addClassName(className) {\n (this.#rootElement.classList || this.#rootElement.host.classList).add(className);\n }\n\n async init() {\n super.init?.();\n if (this.shadowRoot.isConnected) {\n this.#rootElement = (await this.#getRootElement?.(this)) || this.shadowRoot;\n\n this.#addClassName(componentName);\n\n this.#createMappingStyle();\n this.#createComponentTheme();\n this.#createOverridesStyle();\n\n // this is instead attributeChangedCallback because we cannot use static methods in this case\n observeAttributes(this, this.#updateOverridesStyle.bind(this), {});\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n\n this.#disconnectThemeManager?.();\n }\n };\n };\n","import { injectStyle } from '../../componentsHelpers'\nexport const draggableMixin = (superclass) =>\n class DraggableMixinClass extends superclass {\n constructor() {\n super();\n\n injectStyle(`:host([draggable=\"true\"]) * { cursor: inherit!important }`, this);\n }\n\n get isDraggable() {\n return this.hasAttribute('draggable') && this.getAttribute('draggable') !== 'false';\n }\n\n init() {\n // because we are delegating the focus from the outer component,\n // the D&D is not working well in the page editor\n // in order to solve it we are making the inner component focusable on mouse down\n // and removing it on complete\n this.addEventListener('mousedown', (e) => {\n if (this.isDraggable) {\n const prevTabIndex = this.baseElement.getAttribute('tabindex');\n this.baseElement.setAttribute('tabindex', '-1');\n\n const onComplete = () => {\n if (prevTabIndex) this.baseElement.setAttribute('tabindex', prevTabIndex)\n else this.baseElement.removeAttribute('tabindex');\n\n e.target.removeEventListener('mouseup', onComplete);\n e.target.removeEventListener('dragend', onComplete);\n };\n\n e.target.addEventListener('mouseup', onComplete, { once: true });\n e.target.addEventListener('dragend', onComplete, { once: true });\n }\n });\n\n super.init?.();\n }\n };\n","export const hoverableMixin = (superclass) =>\n class HoverableMixinClass extends superclass {\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('mouseover', (e) => {\n this.setAttribute('hover', 'true');\n e.target.addEventListener('mouseleave', () => this.removeAttribute('hover'), {\n once: true,\n });\n });\n }\n };\n","import { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const inputEventsDispatchingMixin = (superclass) =>\n class InputEventsDispatchingMixinClass extends superclass {\n init() {\n this.#blockNativeEvents();\n\n super.init?.();\n }\n\n // we want to block the native (trusted) events and control when these events are being dispatched\n #blockNativeEvents() {\n ['blur', 'focus', 'focusin', 'focusout'].forEach((event) => {\n this.addEventListener(event, (e) => {\n e.isTrusted && e.target === this && e.stopImmediatePropagation();\n });\n });\n }\n\n handleFocusEventsDispatching(inputs) {\n let timerId;\n\n // in order to simulate blur & focusout on root input element\n // we are checking if focus on one of the inner elements happened immediately after blur\n // if not, the component is no longer focused and we should dispatch blur & focusout\n inputs?.forEach((input) => {\n input?.addEventListener('focusout', (e) => {\n e.stopImmediatePropagation();\n timerId = setTimeout(() => {\n timerId = null;\n\n createDispatchEvent.call(this, 'blur');\n createDispatchEvent.call(this, 'focusout', { bubbles: true });\n });\n });\n\n // in order to simulate focus & focusin on the root input element\n // we are holding a timer id and clearing it on focusin\n // if there is a timer id, it means that the root input is still focused\n // otherwise, it was not focused before, and we should dispatch focus & focusin\n const onFocus = (e) => {\n e.stopImmediatePropagation();\n clearTimeout(timerId);\n if (!timerId) {\n createDispatchEvent.call(this, 'focus');\n createDispatchEvent.call(this, 'focusin', { bubbles: true });\n }\n };\n\n // some components are not dispatching focusin but only focus\n input?.addEventListener('focusin', onFocus);\n input?.addEventListener('focus', onFocus);\n });\n }\n\n // we want to block the input events from propagating in case the value of the root input wasn't change\n // this can happen if we are sanitizing characters on the internal inputs and do not want it to affect the root input element value\n // in this case, on each input event, we are comparing the root input value to the previous one, and only if it does not match, we are allowing the input event to propagate\n handleInputEventDispatching() {\n let previousRootComponentValue = this.value;\n\n // we are comparing the previous value to the new one,\n // and if they have the same value, we are blocking the input event\n this.addEventListener('input', (e) => {\n // We don't want to block our own event that we fire from handleInputEventDispatching\n if (this !== e.target) {\n e.stopImmediatePropagation();\n\n if (previousRootComponentValue !== this.value) {\n previousRootComponentValue = this.value;\n createDispatchEvent.call(this, 'input', { bubbles: true, composed: true });\n }\n }\n });\n }\n };\n","import 'element-internals-polyfill'; // this is needed in order to support older browsers\n\nconst observedAttributes = ['required', 'pattern'];\n\nconst errorAttributes = {\n valueMissing: 'data-errormessage-value-missing',\n patternMismatch: 'data-errormessage-pattern-mismatch',\n tooShort: 'data-errormessage-pattern-mismatch-too-short',\n tooLong: 'data-errormessage-pattern-mismatch-too-long',\n rangeUnderflow: 'data-errormessage-pattern-range-underflow',\n rangeOverflow: 'data-errormessage-pattern-range-overflow',\n typeMismatch: 'data-errormessage-type-mismatch',\n};\n\nconst validationTargetSymbol = Symbol('validationTarget');\n\nexport const inputValidationMixin = (superclass) =>\n class InputValidationMixinClass extends superclass {\n #validationTarget = validationTargetSymbol;\n\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...observedAttributes];\n }\n\n static get formAssociated() {\n return true;\n }\n\n #internals;\n\n get internals() {\n return this.#internals;\n }\n\n set internals(value) {\n this.#internals = value;\n }\n\n constructor() {\n super();\n\n this.#internals = this.attachInternals();\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgValueMissing() {\n return 'Please fill out this field.';\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgPatternMismatch() {\n return 'Please match the requested format.';\n }\n\n get defaultErrorMsgTooShort() {\n return `Minimum length is ${this.getAttribute('minlength')}.`;\n }\n\n get defaultErrorMsgTooLong() {\n return `Maximum length is ${this.getAttribute('maxlength')}. `;\n }\n\n get defaultErrorMsgRangeUnderflow() {\n return `At least ${this.getAttribute('min-items-selection')} items are required.`;\n }\n\n get defaultErrorMsgRangeOverflow() {\n return `At most ${this.getAttribute('max-items-selection')} items are allowed.`;\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgTypeMismatch() {\n return `Please match the requested type.`;\n }\n\n getErrorMessage(flags) {\n const {\n valueMissing,\n patternMismatch,\n typeMismatch,\n stepMismatch,\n tooShort,\n tooLong,\n rangeOverflow,\n rangeUnderflow,\n badInput,\n customError,\n } = flags;\n\n switch (true) {\n case valueMissing:\n return (\n this.getAttribute(errorAttributes.valueMissing) || this.defaultErrorMsgValueMissing\n );\n case patternMismatch || stepMismatch || badInput:\n return (\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgPatternMismatch\n );\n case typeMismatch:\n return (\n this.getAttribute(errorAttributes.typeMismatch) ||\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgTypeMismatch\n );\n case tooShort:\n return this.getAttribute(errorAttributes.tooShort) || this.defaultErrorMsgTooShort;\n case tooLong:\n return this.getAttribute(errorAttributes.tooLong) || this.defaultErrorMsgTooLong;\n case rangeUnderflow:\n return (\n this.getAttribute(errorAttributes.rangeUnderflow) || this.defaultErrorMsgRangeUnderflow\n );\n case rangeOverflow:\n return (\n this.getAttribute(errorAttributes.rangeOverflow) || this.defaultErrorMsgRangeOverflow\n );\n case customError:\n return this.validationMessage;\n default:\n return '';\n }\n }\n\n #setValidity() {\n const validity = this.isReadOnly ? {} : this.getValidity();\n this.#internals.setValidity(validity, this.getErrorMessage(validity), this.validationTarget);\n }\n\n get validationMessage() {\n return this.#internals.validationMessage;\n }\n\n // eslint-disable-next-line class-methods-use-this\n getValidity() {\n // eslint-disable-next-line no-console\n console.warn('getValidity', 'is not implemented');\n }\n\n checkValidity() {\n return this.#internals.validity.valid;\n }\n\n reportValidity() {\n return this.#internals.reportValidity();\n }\n\n get validity() {\n return this.#internals.validity;\n }\n\n get validationTarget() {\n return this.#validationTarget === validationTargetSymbol\n ? this.inputElement\n : this.#validationTarget;\n }\n\n set validationTarget(val) {\n this.#validationTarget = val;\n }\n\n setCustomValidity(errorMessage) {\n if (errorMessage) {\n this.#internals.setValidity({ customError: true }, errorMessage, this.validationTarget);\n } else {\n this.#internals.setValidity({});\n this.#setValidity();\n }\n }\n\n get isRequired() {\n return this.hasAttribute('required') && this.getAttribute('required') !== 'false';\n }\n\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n get isDisabled() {\n return this.hasAttribute('disabled') && this.getAttribute('disabled') !== 'false';\n }\n\n get pattern() {\n return this.getAttribute('pattern');\n }\n\n get form() {\n return this.#internals.form;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (observedAttributes.includes(attrName)) {\n this.#setValidity();\n }\n }\n\n init() {\n super.init?.();\n this.addEventListener('change', this.#setValidity);\n this.addEventListener('invalid', (e) => e.stopPropagation());\n this.addEventListener('input', this.#setValidity);\n\n // The attribute sync takes time, so getValidity returns valid,\n // even when it shouldn't. This way allows all attributes to sync\n // after render, before checking the validity.\n setTimeout(() => this.#setValidity());\n }\n };\n","import { observeAttributes } from '../../componentsHelpers';\n\nconst booleanAttributesList = [\n 'readonly',\n 'focused',\n 'invalid',\n 'has-label',\n 'required',\n 'disabled',\n 'checked',\n 'has-helper',\n 'has-value',\n 'step-buttons-visible',\n 'hover',\n 'has-error-message',\n 'focus-ring',\n 'opened',\n 'active',\n 'password-visible',\n 'opening',\n 'closing',\n 'has-no-options',\n 'loading',\n 'allow-custom-value',\n];\n\nconst isBooleanAttribute = (attr) => {\n return booleanAttributesList.includes(attr);\n};\n// we want all the valueless attributes to have \"true\" value\n// and all the falsy attribute to be removed\nexport const normalizeBooleanAttributesMixin = (superclass) =>\n class NormalizeBooleanAttributesMixinClass extends superclass {\n init() {\n super.init?.();\n\n observeAttributes(\n this,\n (attrs) =>\n attrs.forEach((attr) => {\n const attrVal = this.getAttribute(attr);\n\n if (isBooleanAttribute(attr)) {\n if (attrVal === '') {\n this.setAttribute(attr, 'true');\n } else if (attrVal === 'false') {\n this.removeAttribute(attr);\n }\n } else if (!attrVal) {\n // eslint-disable-next-line no-console\n console.debug(\n `attribute \"${attr}\" has no value, should it be added to the boolean attributes list?`\n );\n }\n }),\n {}\n );\n }\n };\n","import { kebabCaseJoin } from '../../utils';\nimport { forwardAttrs } from '../../componentsHelpers';\nimport { createStyleMixin } from '../mixins/createStyleMixin';\nimport { createCssVarsList } from './createStyleMixin/helpers';\n\n// this is needed because we might generate the same css vars names\n// e.g. \"overlayColor\" attribute in style mixin's mapping,\n// will generate the same var as \"color\" attribute in portals's mapping\n// when the portal name is \"overlay\".\n// because of that, we are adding this separator that is also used as a differentiator\nconst DISPLAY_NAME_SEPARATOR = '_';\nconst PORTAL_THEME_PREFIX = '@';\n\n\nconst sanitizeSelector = (selector) => selector.replace(/[^\\w\\s]/gi, '');\n\nconst withWaitForShadowRoot = (getRootElementFn) => async (that) => {\n const ele = await getRootElementFn(that);\n\n return new Promise((res) => {\n const MAX_RETRIES = 20;\n let counter = 0;\n\n const check = () => {\n if (counter > MAX_RETRIES) {\n // eslint-disable-next-line no-console\n console.error('could not get shadow root for element', ele);\n res(ele);\n return;\n }\n\n counter++;\n\n if (!ele?.shadowRoot) {\n setTimeout(check);\n } else {\n res(ele.shadowRoot);\n }\n };\n check();\n });\n};\n\nexport const portalMixin =\n ({ name, selector, mappings = {}, forward: { attributes = [], include = true } = {} }) =>\n (superclass) => {\n const eleDisplayName = name || sanitizeSelector(selector);\n\n const BaseClass = createStyleMixin({\n mappings,\n })(superclass);\n\n return class PortalMixinClass extends BaseClass {\n static get cssVarList() {\n return {\n ...BaseClass.cssVarList,\n [eleDisplayName]: createCssVarsList(\n kebabCaseJoin(superclass.componentName, DISPLAY_NAME_SEPARATOR + eleDisplayName),\n mappings\n ),\n };\n }\n\n #portalEle;\n\n constructor() {\n // we cannot use \"this\" before calling \"super\"\n const getRootElement = async (that) => {\n const baseEle = (that.shadowRoot || that).querySelector(that.baseSelector);\n if (!selector) {\n return baseEle;\n }\n\n // in case we have a selector, we should first wait for the base element shadow root\n // and then look for the internal element\n const baseEleShadowRoot = await withWaitForShadowRoot(() => baseEle)(that);\n return baseEleShadowRoot.querySelector(selector);\n };\n\n const getPortalElement = withWaitForShadowRoot(getRootElement);\n\n super({\n getRootElement: getPortalElement,\n componentNameSuffix: DISPLAY_NAME_SEPARATOR + eleDisplayName,\n themeSection: PORTAL_THEME_PREFIX + eleDisplayName,\n baseSelector: ':host',\n });\n\n this.#portalEle = getPortalElement(this).then((ele) => ele.host);\n }\n\n async #handleHoverAttribute() {\n const portalEle = await this.#portalEle;\n portalEle.onmouseenter = (e) => {\n e.target.setAttribute('hover', 'true');\n };\n portalEle.onmouseleave = (e) => {\n e.target.removeAttribute('hover');\n };\n }\n\n async init() {\n super.init?.();\n const portalEle = await this.#portalEle;\n forwardAttrs(this, portalEle, {\n [include ? 'includeAttrs' : 'excludeAttrs']: attributes,\n });\n\n this.#handleHoverAttribute();\n }\n };\n };\n","/* eslint-disable no-param-reassign */\nimport { compose } from '../../utils';\nimport { forwardAttrs, getComponentName } from '../../componentsHelpers';\nimport { createDispatchEvent } from '../helpers/mixinsHelpers';\nimport { inputValidationMixin } from '../mixins/inputValidationMixin';\nimport { createStyleMixin } from '../mixins/createStyleMixin';\n\nconst errorAttrs = ['invalid', 'required'];\n\nconst forwardProps = (src, targets, property) => {\n const targetArr = Array.isArray(targets) ? targets : [targets];\n\n Object.defineProperty(src, property, {\n set(v) {\n targetArr.forEach((target) => {\n target[property] = v;\n });\n },\n get() {\n return targets[0][property];\n },\n configurable: true,\n });\n};\n\n// recursively take the first slot child until it finds an element which is not a slot\n// stops after \"nestingLevel\" times\nconst getNestedInput = (ele) => {\n if (!ele) return undefined;\n\n const nestingLevel = 10;\n\n let nonSlotEle = ele;\n for (let i = 0; i < nestingLevel; i++) {\n [nonSlotEle] = nonSlotEle.assignedElements();\n if (nonSlotEle?.localName !== 'slot') return nonSlotEle;\n }\n return undefined;\n};\n\nconst proxyInputMixin =\n ({\n proxyProps = [],\n // useProxyTargets flag allows to forwardProps to other targets, other than\n // `this.inputElement`. It's to be used within `external-input` components,\n // if needed\n useProxyTargets = false,\n // allows us to set the event that should trigger validation\n // it can be either a string or an array of strings (for multiple events)\n inputEvent = 'input',\n triggerValidationEvents = [],\n // Proxies all validations from the parent component to the input element\n proxyParentValidation = false,\n }) =>\n (superclass) =>\n class ProxyInputMixinClass extends inputValidationMixin(superclass) {\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...errorAttrs];\n }\n\n #inputElement;\n\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n constructor() {\n super();\n\n this.#inputElement = super.inputElement;\n }\n\n // the web-component does not loaded immediately, so we want to defer the warning\n // and show it only if the input element was not found after the component is loaded\n warnIfInputElementIsMissing() {\n clearTimeout(this.inputElementTimerId);\n\n this.inputElementTimerId = setTimeout(() => {\n // eslint-disable-next-line no-console\n !this.#inputElement && console.warn(this.localName, 'no input was found');\n }, 0);\n }\n\n get inputElement() {\n if (this.#inputElement) return this.#inputElement;\n\n this.warnIfInputElementIsMissing();\n\n const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"input\"]');\n const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"textarea\"]');\n\n this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);\n\n return this.#inputElement;\n }\n\n set inputElement(ele) {\n this.#inputElement = ele;\n }\n\n getValidity() {\n return this.inputElement?.validity || {};\n }\n\n #handleErrorMessage() {\n this.setAttribute('error-message', this.validationMessage);\n }\n\n // We do not want to show the default validity report tooltip\n // So we are overriding the reportValidity fn to show the input's error message\n reportValidity = () => {\n // we want to update validity so in case the value was set programmatically, we won't get an error\n this.inputElement.setCustomValidity('');\n this.setCustomValidity('');\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n this.#handleErrorMessage();\n this.focus();\n }\n };\n\n // we are keeping also the default reportValidity because there are some components that still using it\n defaultReportValidity() {\n return super.reportValidity();\n }\n\n init() {\n super.init?.();\n\n // vaadin sets invalid indication on blur\n // we want invalid indication to appear only when calling reportValidity\n // this is why we are overriding vaadin's setInvalid behavior\n // to update only when the element is valid (so invalid indication will only be removed)\n // and we are adding it in reportValidity\n // eslint-disable-next-line func-names\n this.baseElement._setInvalid = function (invalid) {\n if (!invalid && this._shouldSetInvalid(invalid)) {\n this.invalid = invalid;\n }\n };\n\n // We want to ensure that `input` events properly cross ShadowDOM boundries\n // e.g. When we autofill a component's input with 1Password, for instance,\n // the event is fired without `composed: true` and doesn't our component's\n // ShadowDOM.\n this.baseElement.addEventListener('input', (e) => {\n if (!e.composed) {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n }\n });\n\n triggerValidationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n this.inputElement?.setCustomValidity('');\n });\n });\n\n // on some cases the base element is not ready so the inputElement is empty\n // we are deferring this section to make sure the base element is ready\n setTimeout(() => {\n const validationEvents = Array.isArray(inputEvent) ? inputEvent : [inputEvent];\n\n validationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n if (!this.baseElement.checkValidity()) {\n this.#handleErrorMessage();\n } else {\n this.removeAttribute('invalid');\n }\n });\n });\n\n this.baseElement.addEventListener('change', () => {\n this.#dispatchChange();\n });\n\n this.addEventListener('invalid', () => {\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n }\n this.#handleErrorMessage();\n });\n\n // sync properties\n proxyProps.forEach((prop) => {\n const externalInput = this.querySelector('input[slot=\"external-input\"]') || null;\n const proxyTargets = useProxyTargets\n ? [this.baseElement, externalInput].filter(Boolean)\n : [];\n forwardProps(this, [this.inputElement, ...proxyTargets], prop);\n });\n\n this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);\n\n forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });\n });\n\n if (proxyParentValidation) {\n // All functions called on the inputElement internals will be applied to the parent\n // component internals as well. As a result, there's no need to add outer mechanisms\n // to update the parent component's validity state based on the input elements validity.\n const inputElementInternals = this.inputElement.internals;\n const parentThis = this;\n this.inputElement.internals = new Proxy(inputElementInternals, {\n get: (target, prop) => {\n if (typeof target[prop] === 'function' && prop === 'setValidity') {\n return (...args) => {\n // If we're calling setValidity with 3 args, then the validationTarget\n // needs to be swapped to be the inputElement\n if (args.length === 3) {\n const newArgs = args.slice(0, args.length - 1);\n newArgs.push(parentThis.inputElement);\n parentThis.internals[prop](...newArgs);\n } else {\n parentThis.internals[prop](...args);\n }\n return target[prop](...args);\n };\n }\n\n if (typeof target[prop] === 'function') {\n return (...args) => {\n parentThis.internals[prop](...args);\n return target[prop](...args);\n };\n }\n\n return target[prop];\n },\n });\n }\n }\n };\n\nconst composedProxyInputMixin = (proxyInputMixinConfig) =>\n compose(\n proxyInputMixin(proxyInputMixinConfig),\n // in order to use input-wrapper across all our input components, we need to inject its theme\n // to every proxy input mixin, to allow its css vars to be scoped properly and accessible\n // in the proxy input component\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })\n );\n\nexport { composedProxyInputMixin as proxyInputMixin };\n"],"names":["createBaseClass","componentName","baseSelector","DescopeBaseClass","HTMLElement","baseElement","this","rootElement","querySelector","console","warn","localName","shadowRoot","name","getAttribute","connectedCallback","super","isConnected","init","CONNECTOR_ERRORS","CONNECTOR_INVALID","FETCH_RESULTS_ERROR","createBaseConnectorClass","constructor","isValid","checkConnectorValidity","getRequiredParams","filter","param","value","validateParam","length","trim","error","fetch","query","_fetchResults","results","undefined","createBaseInputClass","args","createDispatchEvent","eventName","options","event","Event","dispatchEvent","changeMixin","superclass","bind","prevValue","addEventListener","e","stopPropagation","componentNameValidationMixin","currentComponentName","Error","componentsContextMixin","updateComponentsContext","componentsContext","CustomEvent","bubbles","composed","detail","connectorMixin","connectorClasses","observedAttributes","connectorTemplate","initializeConnector","template","ConnectorClass","connector","fetchConnectorResults","map","label","attributeChangedCallback","attrName","oldValue","newValue","createProxy","wrappedEleName","slots","style","excludeAttrsSync","includeAttrsSync","includeForwardProps","delegatesFocus","ProxyClass","attachShadow","mode","innerHTML","slot","join","_","excludeAttrs","includeAttrs","createCssVar","varName","fallback","StyleBuilder","styleMap","Map","add","selector","property","has","set","get","toString","Array","from","entries","reduce","acc","propValArr","getFallbackVarName","origVarName","suffix","createStyle","mappings","createFallbackVar","fallbackVarName","Object","keys","forEach","attr","attrConfig","config","defaultMapping","isArray","entry","normalizeConfig","cssVarName","relativeSelectorOrSelectorFn","important","fallbackValue","test","createCssSelector","getFallbackVarsNames","fallbackAttrName","createCssVarsList","assign","createClassSelectorSpecifier","className","numOfRepeats","fill","createStyleMixin","componentNameOverride","CustomStyleMixinClass","cssVarList","getRootElement","componentNameSuffix","themeSection","key","currentTheme","replaceSync","prepend","onCurrentThemeChange","classSpecifier","cssRules","replace","RegExp","setProperty","removeProperty","removeAttribute","attrs","includes","classList","host","disconnectedCallback","draggableMixin","isDraggable","hasAttribute","prevTabIndex","setAttribute","onComplete","target","removeEventListener","once","hoverableMixin","inputEventsDispatchingMixin","isTrusted","stopImmediatePropagation","handleFocusEventsDispatching","inputs","timerId","input","setTimeout","call","onFocus","clearTimeout","handleInputEventDispatching","previousRootComponentValue","errorAttributes","validationTargetSymbol","Symbol","inputValidationMixin","formAssociated","internals","attachInternals","defaultErrorMsgValueMissing","defaultErrorMsgPatternMismatch","defaultErrorMsgTooShort","defaultErrorMsgTooLong","defaultErrorMsgRangeUnderflow","defaultErrorMsgRangeOverflow","defaultErrorMsgTypeMismatch","getErrorMessage","flags","valueMissing","patternMismatch","typeMismatch","stepMismatch","tooShort","tooLong","rangeOverflow","rangeUnderflow","badInput","customError","validationMessage","validity","isReadOnly","getValidity","setValidity","validationTarget","checkValidity","valid","reportValidity","inputElement","val","setCustomValidity","errorMessage","isRequired","isDisabled","pattern","form","booleanAttributesList","normalizeBooleanAttributesMixin","attrVal","isBooleanAttribute","debug","withWaitForShadowRoot","getRootElementFn","async","that","ele","Promise","res","counter","check","portalMixin","forward","attributes","include","eleDisplayName","sanitizeSelector","BaseClass","getPortalElement","baseEle","then","portalEle","onmouseenter","onmouseleave","errorAttrs","getNestedInput","nonSlotEle","i","assignedElements","proxyInputMixin","proxyProps","useProxyTargets","inputEvent","triggerValidationEvents","proxyParentValidation","warnIfInputElementIsMissing","inputElementTimerId","inputSlot","textAreaSlot","focus","defaultReportValidity","_setInvalid","invalid","_shouldSetInvalid","prop","externalInput","proxyTargets","Boolean","src","targets","targetArr","defineProperty","v","configurable","forwardProps","setSelectionRange","inputElementInternals","parentThis","Proxy","newArgs","slice","push","composedProxyInputMixin","proxyInputMixinConfig"],"sourceRoot":""}
|
package/dist/umd/9365.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9365],{81365:(t,e,s)=>{s.d(e,{q:()=>l});var i=s(9696),r=s(45677),n=s(50005),a=s(62754),o=s(64088);const l=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.Zz)(r.t,a.m,o.y,n.b)(s)}},13011:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{r:()=>i})},84448:(t,e,s)=>{s.d(e,{_:()=>r});var i=s(13011);const r=t=>class extends t{#s=i.r.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#s(),this.prevValue=this.value)}))}}},45677:(t,e,s)=>{s.d(e,{t:()=>i});const i=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},50005:(t,e,s)=>{s.d(e,{b:()=>i});const i=t=>class extends t{updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}}},35321:(t,e,s)=>{s.d(e,{t:()=>l});var i=s(25964),r=s(81365),n=s(9696),a=s(97810),o=s(13011);const l=({componentName:t,wrappedEleName:e,slots:s=[],style:l,excludeAttrsSync:u=[],includeAttrsSync:h=[],includeForwardProps:c=[],delegatesFocus:d=!0})=>{class m extends((0,r.q)({componentName:t,baseSelector:e})){#r=o.r.bind(this,"blur");#n=o.r.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:d}).innerHTML=`\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""}></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`,(0,i.fz)(((0,n.Tn)(l)?l():l)||"",this)}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#r()})),this.baseElement.addEventListener("focus",(t=>{this.#n()})),(0,a.q)(this.baseElement,this,c),(0,a.Gh)(this.baseElement,this,{excludeAttrs:u,includeAttrs:h})}}return m}},48401:(t,e,s)=>{s.d(e,{AM:()=>c,SR:()=>h,_r:()=>l});var i=s(9696),r=s(97810);const n=(t,e)=>`var(${t}${e?`, ${e}`:""})`;class a{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const o=(t,e="fallback")=>(0,i.GL)(t,e),l=(t,e,s)=>{const l=new a,u=(t,e)=>{if(!t)return"";if("string"==typeof t)return t;const s=o(e,t?.suffix);return n(s,u(t.fallback,s))};return Object.keys(s).forEach((a=>{const o=((t,e)=>{const s={selector:"",property:(0,i.kW)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(a,s[a]),h=(0,r.Ix)(t,a);o.forEach((({selector:t,property:s,important:r,fallback:a})=>{const o=u(a,h);l.add(((t="",e="")=>(0,i.Tn)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,i.Tn)(s)?s():s,n(h,o)+(r?"!important":""))}))})),l.toString()},u=(t,e,{fallback:s})=>{if(!s)return{};const r=o(e,s.suffix),n=(0,i.dk)(t,s.suffix||"fallback");return{[n]:r,...u(n,r,s)}},h=(t,e)=>Object.keys(e).reduce(((s,i)=>{const n=(0,r.Ix)(t,i);return Object.assign(s,{[i]:n},u(i,n,e[i]))}),{}),c=(t,e)=>Array(e).fill(`.${t}`).join("")},76356:(t,e,s)=>{s.d(e,{R:()=>u});var i=s(25964),r=s(3047),n=s(9696),a=s(97810),o=s(73227),l=s(48401);const u=({mappings:t={},componentNameOverride:e=""})=>s=>{const u=e||s.componentName;return class e extends s{static get cssVarList(){return{...s.cssVarList,...(0,l.SR)(u,{...t})}}#a;#o;#l;#u;#h;#c;#d;#m;#p;constructor({getRootElement:t,componentNameSuffix:s="",themeSection:i=r.IM,baseSelector:a}={}){super(),this.#u=s,this.#h=i,this.#d=a??this.baseSelector,this.#p=t,this.#m=Object.keys(e.cssVarList).map((t=>(0,n.GL)("st",s,t)))}get#g(){return o.componentsThemeManager.currentTheme?.[u]||""}#b(){this.#o.replaceSync(this.#g[this.#h])}#E(){this.#o=(0,i.fz)("",this.#c,{prepend:!0}),this.#l=o.componentsThemeManager.onCurrentThemeChange(this.#b.bind(this)),this.#b()}#v(){if(this.#m.length){const t=(0,l.AM)(u,r.aE);this.#a=(0,i.fz)(`:host(${t}) {}`,this.#c)}}#f(t,e){const s=this.#a?.cssRules[0].style;if(!s)return;const i=(0,a.Ix)(u,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#y(t=[]){t.forEach((t=>{this.#m.includes(t)&&this.#f(t,this.getAttribute(t))}))}#A(){if(Object.keys(t).length){const e=(0,l._r)((0,n.GL)(u,this.#u),this.#d,t);(0,i.fz)(e,this.#c,{prepend:!0})}}#x(t){(this.#c.classList||this.#c.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#c=await(this.#p?.(this))||this.shadowRoot,this.#x(u),this.#A(),this.#E(),this.#v(),(0,a.mx)(this,this.#y.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#l?.()}}}},4709:(t,e,s)=>{s.d(e,{V:()=>r});var i=s(25964);const r=t=>class extends t{#S=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),(0,i.fz)("* { cursor: inherit!important }",this)}#w(t){t?this.shadowRoot.appendChild(this.#S):this.#S.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#w("true"===s)}}},15083:(t,e,s)=>{s.d(e,{E8:()=>i,Mk:()=>n,q$:()=>r});const i=(t,e)=>{const s=document.createElement("slot");return s.setAttribute("name",t),s.setAttribute("slot",e),s},r=(t,e,s,i)=>{const r=document.createElement("input");return r.setAttribute("slot",t),r.setAttribute("type",e),r.setAttribute("name",i),r.setAttribute("data-hidden-input","true"),r.setAttribute("autocomplete",s),r},n=(t,e,s)=>{setTimeout((()=>{const i=getComputedStyle(t),r=i.getPropertyValue("height"),n=i.getPropertyValue("padding-left"),a=i.getPropertyValue("padding-right"),o=i.getPropertyValue("font-size"),l=i.getPropertyValue("font-family"),u=i.getPropertyValue("letter-spacing"),h=i.getPropertyValue("caret-color"),c=((t,e)=>{const s=t.value;t.value="_";const i=e.getPropertyValue("color");return"_"===t.value&&(t.value=s),i})(t,i);if([["all","unset"],["position","absolute"],["background-color","transparent"],["height",r],["left",n],["right",a],["font-size",o],["font-family",l],["letter-spacing",u],["caret-color",h],["color",c]].forEach((([t,s])=>e.style.setProperty(t,s,"important"))),"floating"===s){const t=i.getPropertyValue("margin-bottom");e.style.setProperty("margin-bottom",t,"important")}const d=i.getPropertyValue("width");e.style.setProperty("width",`calc(${d} - ${n} - ${a}`,"important")}),0)}},98511:(t,e,s)=>{s.d(e,{R:()=>n});var i=s(97810),r=s(15083);const n=({inputType:t,inputName:e,autocompleteType:s,includeAttrs:n=[],noBlurDispatch:a=!1})=>o=>class extends o{#M=[];get isExternalInput(){return"true"===this.getAttribute("external-input")}createExternalInput(){if(!this.isExternalInput||this.isReadOnly||this.isDisabled)return null;const s=this.baseElement.querySelector("input");if(!s)return null;s.setAttribute("tabindex","-1");const a=(0,r.E8)("external-input","suffix");return this.baseElement.appendChild(a),this.externalInput=(0,r.q$)("external-input",t,this.getAutocompleteType(),e),setTimeout((()=>{(0,r.Mk)(s,this.externalInput,this.getAttribute("label-type"))})),this.forwardInputValue(s,this.externalInput),(0,i.Gh)(s,this.externalInput,{includeAttrs:n}),this.baseElement.querySelector("input").addEventListener("focusout",(t=>t.stopImmediatePropagation()),!0),this.handleFocusEvents(),this.handleBlurEvents(),this.handlelInputEvents(this.externalInput),this.appendChild(this.externalInput),this.externalInput}clearBlurTimers(){this.#M.forEach((t=>clearTimeout(t))),this.#M.length=0}dispatchBlur(){return setTimeout((()=>{this.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0})),this.removeAttribute("focused")}))}handleFocusEvents(){this.baseElement.addEventListener("focus",(()=>{this.externalInput.focus(),this.clearBlurTimers()})),this.externalInput.addEventListener("focus",(()=>{this.clearBlurTimers(),setTimeout((()=>this.baseElement.setAttribute("focused","true")))}))}handleBlurEvents(){this.baseElement.addEventListener("blur",(t=>{t.stopImmediatePropagation(),a||this.#M.push(this.dispatchBlur())}),!0),this.externalInput.addEventListener("blur",(t=>{t.stopImmediatePropagation(),this.#M.push(this.dispatchBlur())}),!0)}handlelInputEvents(t){t.addEventListener("input",(t=>{this.value=t.target.value})),t.addEventListener("input",(t=>{t.target.value?this.setAttribute("has-value","true"):this.removeAttribute("has-value")}))}getAutocompleteType(){return this.getAttribute("autocomplete")||s}forwardInputValue(t,e){const s=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value");Object.defineProperty(t,"value",{...s,set(t){s.set.call(this,t),e.value=t},configurable:!0})}}},62754:(t,e,s)=>{s.d(e,{m:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},79365:(t,e,s)=>{s.d(e,{OZ:()=>a.O,RF:()=>i.R,RV:()=>p.R,VO:()=>r.V,XX:()=>u.X,_$:()=>c._,jd:()=>m.j,mA:()=>h.m,mZ:()=>l.m,tQ:()=>o.t,tz:()=>n.t,yF:()=>d.y});var i=s(76356),r=s(4709),n=s(35321),a=s(90764),o=s(45677),l=s(62754),u=s(41689),h=s(45566),c=s(84448),d=s(64088),m=s(27079),p=s(98511)},27079:(t,e,s)=>{s.d(e,{j:()=>r});var i=s(13011);const r=t=>class extends t{init(){this.#T(),super.init?.()}#T(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,i.r.call(this,"blur"),i.r.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(i.r.call(this,"focus"),i.r.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{this!==e.target&&(e.stopImmediatePropagation(),t!==this.value&&(t=this.value,i.r.call(this,"input",{bubbles:!0,composed:!0})))}))}}},41689:(t,e,s)=>{s.d(e,{X:()=>a}),s(42672);const i=["required","pattern"],r="data-errormessage-pattern-mismatch",n=Symbol("validationTarget"),a=t=>class extends t{#V=n;static get observedAttributes(){return[...t.observedAttributes||[],...i]}static get formAssociated(){return!0}#L;get internals(){return this.#L}set internals(t){this.#L=t}constructor(){super(),this.#L=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}get defaultErrorMsgTypeMismatch(){return"Please match the requested type."}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:a,tooLong:o,rangeOverflow:l,rangeUnderflow:u,badInput:h,customError:c}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||n||h:return this.getAttribute(r)||this.defaultErrorMsgPatternMismatch;case i:return this.getAttribute("data-errormessage-type-mismatch")||this.getAttribute(r)||this.defaultErrorMsgTypeMismatch;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case o:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case u:return this.getAttribute("data-errormessage-pattern-range-underflow")||this.defaultErrorMsgRangeUnderflow;case l:return this.getAttribute("data-errormessage-pattern-range-overflow")||this.defaultErrorMsgRangeOverflow;case c:return this.validationMessage;default:return""}}#C(){const t=this.isReadOnly?{}:this.getValidity();this.#L.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#L.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#L.validity.valid}reportValidity(){return this.#L.reportValidity()}get validity(){return this.#L.validity}get validationTarget(){return this.#V===n?this.inputElement:this.#V}set validationTarget(t){this.#V=t}setCustomValidity(t){t?this.#L.setValidity({customError:!0},t,this.validationTarget):(this.#L.setValidity({}),this.#C())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#L.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),i.includes(t)&&this.#C()}init(){super.init?.(),this.addEventListener("change",this.#C),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#C),setTimeout((()=>this.#C()))}}},64088:(t,e,s)=>{s.d(e,{y:()=>n});var i=s(97810);const r=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options","loading","allow-custom-value","loading"],n=t=>class extends t{init(){super.init?.(),(0,i.mx)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>r.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.debug(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}},45566:(t,e,s)=>{s.d(e,{m:()=>u});var i=s(3047),r=s(9696),n=s(97810),a=s(76356),o=s(48401);const l=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},u=({name:t,selector:e,mappings:s={},forward:{attributes:u=[],include:h=!0}={}})=>c=>{const d=t||(t=>t.replace(/[^\w\s]/gi,""))(e),m=(0,a.R)({mappings:s})(c);return class extends m{static get cssVarList(){return{...m.cssVarList,[d]:(0,o.SR)((0,r.GL)(c.componentName,"_"+d),s)}}#I;constructor(){const t=l((async t=>{const s=(t.shadowRoot||t).querySelector(t.baseSelector);return e?(await l((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+d,themeSection:i.WJ+d,baseSelector:":host"}),this.#I=t(this).then((t=>t.host))}async#P(){const t=await this.#I;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#I;(0,n.EA)(this,t,{[h?"includeAttrs":"excludeAttrs"]:u}),this.#P()}}}},90764:(t,e,s)=>{s.d(e,{O:()=>c});var i=s(9696),r=s(97810),n=s(13011),a=s(76356),o=s(41689);const l=["invalid","required"],u=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e?.localName)return e},h=({proxyProps:t=[],useProxyTargets:e=!1,inputEvent:s="input",triggerValidationEvents:i=[],proxyParentValidation:a=!1})=>h=>class extends((0,o.X)(h)){static get observedAttributes(){return[...h.observedAttributes||[],...l]}#R;#s=n.r.bind(this,"change");constructor(){super(),this.#R=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#R&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#R)return this.#R;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#R=u(t)||u(e),this.#R}set inputElement(t){this.#R=t}getValidity(){return this.inputElement?.validity||{}}#k(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#k(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},this.baseElement.addEventListener("input",(t=>{t.composed||this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))})),i.forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.inputElement?.setCustomValidity("")}))})),setTimeout((()=>{(Array.isArray(s)?s:[s]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#k()}))})),this.baseElement.addEventListener("change",(()=>{this.#s()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#k()})),t.forEach((t=>{const s=this.querySelector('input[slot="external-input"]')||null,i=e?[this.baseElement,s].filter(Boolean):[];((t,e,s)=>{const i=Array.isArray(e)?e:[e];Object.defineProperty(t,s,{set(t){i.forEach((e=>{e[s]=t}))},get:()=>e[0][s],configurable:!0})})(this,[this.inputElement,...i],t)})),this.setSelectionRange=this.inputElement?.setSelectionRange?.bind(this.inputElement),(0,r.EA)(this,this.inputElement,{includeAttrs:["inputmode"]})})),a){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...i)=>{if(3===i.length){const t=i.slice(0,i.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...i);return t[s](...i)}:"function"==typeof t[s]?(...i)=>(e.internals[s](...i),t[s](...i)):t[s]})}}},c=t=>(0,i.Zz)(h(t),(0,a.R)({componentNameOverride:(0,r.xE)("input-wrapper")}))}}]);
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9365],{81365:(t,e,s)=>{s.d(e,{q:()=>l});var i=s(9696),r=s(45677),n=s(50005),a=s(62754),o=s(64088);const l=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.Zz)(r.t,a.m,o.y,n.b)(s)}},13011:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{r:()=>i})},84448:(t,e,s)=>{s.d(e,{_:()=>r});var i=s(13011);const r=t=>class extends t{#s=i.r.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#s(),this.prevValue=this.value)}))}}},45677:(t,e,s)=>{s.d(e,{t:()=>i});const i=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},50005:(t,e,s)=>{s.d(e,{b:()=>i});const i=t=>class extends t{updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}}},35321:(t,e,s)=>{s.d(e,{t:()=>l});var i=s(25964),r=s(81365),n=s(9696),a=s(97810),o=s(13011);const l=({componentName:t,wrappedEleName:e,slots:s=[],style:l,excludeAttrsSync:u=[],includeAttrsSync:h=[],includeForwardProps:c=[],delegatesFocus:d=!0})=>{class m extends((0,r.q)({componentName:t,baseSelector:e})){#r=o.r.bind(this,"blur");#n=o.r.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:d}).innerHTML=`\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""}></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`,(0,i.fz)(((0,n.Tn)(l)?l():l)||"",this)}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#r()})),this.baseElement.addEventListener("focus",(t=>{this.#n()})),(0,a.q)(this.baseElement,this,c),(0,a.Gh)(this.baseElement,this,{excludeAttrs:u,includeAttrs:h})}}return m}},48401:(t,e,s)=>{s.d(e,{AM:()=>c,SR:()=>h,_r:()=>l});var i=s(9696),r=s(97810);const n=(t,e)=>`var(${t}${e?`, ${e}`:""})`;class a{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const o=(t,e="fallback")=>(0,i.GL)(t,e),l=(t,e,s)=>{const l=new a,u=(t,e)=>{if(!t)return"";if("string"==typeof t)return t;const s=o(e,t?.suffix);return n(s,u(t.fallback,s))};return Object.keys(s).forEach((a=>{const o=((t,e)=>{const s={selector:"",property:(0,i.kW)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(a,s[a]),h=(0,r.Ix)(t,a);o.forEach((({selector:t,property:s,important:r,fallback:a})=>{const o=u(a,h);l.add(((t="",e="")=>(0,i.Tn)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,i.Tn)(s)?s():s,n(h,o)+(r?"!important":""))}))})),l.toString()},u=(t,e,{fallback:s})=>{if(!s)return{};const r=o(e,s.suffix),n=(0,i.dk)(t,s.suffix||"fallback");return{[n]:r,...u(n,r,s)}},h=(t,e)=>Object.keys(e).reduce(((s,i)=>{const n=(0,r.Ix)(t,i);return Object.assign(s,{[i]:n},u(i,n,e[i]))}),{}),c=(t,e)=>Array(e).fill(`.${t}`).join("")},76356:(t,e,s)=>{s.d(e,{R:()=>u});var i=s(25964),r=s(3047),n=s(9696),a=s(97810),o=s(73227),l=s(48401);const u=({mappings:t={},componentNameOverride:e=""})=>s=>{const u=e||s.componentName;return class e extends s{static get cssVarList(){return{...s.cssVarList,...(0,l.SR)(u,{...t})}}#a;#o;#l;#u;#h;#c;#d;#m;#p;constructor({getRootElement:t,componentNameSuffix:s="",themeSection:i=r.IM,baseSelector:a}={}){super(),this.#u=s,this.#h=i,this.#d=a??this.baseSelector,this.#p=t,this.#m=Object.keys(e.cssVarList).map((t=>(0,n.GL)("st",s,t)))}get#g(){return o.componentsThemeManager.currentTheme?.[u]||""}#b(){this.#o.replaceSync(this.#g[this.#h])}#E(){this.#o=(0,i.fz)("",this.#c,{prepend:!0}),this.#l=o.componentsThemeManager.onCurrentThemeChange(this.#b.bind(this)),this.#b()}#v(){if(this.#m.length){const t=(0,l.AM)(u,r.aE);this.#a=(0,i.fz)(`:host(${t}) {}`,this.#c)}}#f(t,e){const s=this.#a?.cssRules[0].style;if(!s)return;const i=(0,a.Ix)(u,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#y(t=[]){t.forEach((t=>{this.#m.includes(t)&&this.#f(t,this.getAttribute(t))}))}#A(){if(Object.keys(t).length){const e=(0,l._r)((0,n.GL)(u,this.#u),this.#d,t);(0,i.fz)(e,this.#c,{prepend:!0})}}#x(t){(this.#c.classList||this.#c.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#c=await(this.#p?.(this))||this.shadowRoot,this.#x(u),this.#A(),this.#E(),this.#v(),(0,a.mx)(this,this.#y.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#l?.()}}}},4709:(t,e,s)=>{s.d(e,{V:()=>r});var i=s(25964);const r=t=>class extends t{constructor(){super(),(0,i.fz)(':host([draggable="true"]) * { cursor: inherit!important }',this)}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}}},15083:(t,e,s)=>{s.d(e,{E8:()=>i,Mk:()=>n,q$:()=>r});const i=(t,e)=>{const s=document.createElement("slot");return s.setAttribute("name",t),s.setAttribute("slot",e),s},r=(t,e,s,i)=>{const r=document.createElement("input");return r.setAttribute("slot",t),r.setAttribute("type",e),r.setAttribute("name",i),r.setAttribute("data-hidden-input","true"),r.setAttribute("autocomplete",s),r},n=(t,e,s)=>{setTimeout((()=>{const i=getComputedStyle(t),r=i.getPropertyValue("height"),n=i.getPropertyValue("padding-left"),a=i.getPropertyValue("padding-right"),o=i.getPropertyValue("font-size"),l=i.getPropertyValue("font-family"),u=i.getPropertyValue("letter-spacing"),h=i.getPropertyValue("caret-color"),c=((t,e)=>{const s=t.value;t.value="_";const i=e.getPropertyValue("color");return"_"===t.value&&(t.value=s),i})(t,i);if([["all","unset"],["position","absolute"],["background-color","transparent"],["height",r],["left",n],["right",a],["font-size",o],["font-family",l],["letter-spacing",u],["caret-color",h],["color",c]].forEach((([t,s])=>e.style.setProperty(t,s,"important"))),"floating"===s){const t=i.getPropertyValue("margin-bottom");e.style.setProperty("margin-bottom",t,"important")}const d=i.getPropertyValue("width");e.style.setProperty("width",`calc(${d} - ${n} - ${a}`,"important")}),0)}},98511:(t,e,s)=>{s.d(e,{R:()=>n});var i=s(97810),r=s(15083);const n=({inputType:t,inputName:e,autocompleteType:s,includeAttrs:n=[],noBlurDispatch:a=!1})=>o=>class extends o{#w=[];get isExternalInput(){return"true"===this.getAttribute("external-input")}createExternalInput(){if(!this.isExternalInput||this.isReadOnly||this.isDisabled)return null;const s=this.baseElement.querySelector("input");if(!s)return null;s.setAttribute("tabindex","-1");const a=(0,r.E8)("external-input","suffix");return this.baseElement.appendChild(a),this.externalInput=(0,r.q$)("external-input",t,this.getAutocompleteType(),e),setTimeout((()=>{(0,r.Mk)(s,this.externalInput,this.getAttribute("label-type"))})),this.forwardInputValue(s,this.externalInput),(0,i.Gh)(s,this.externalInput,{includeAttrs:n}),this.baseElement.querySelector("input").addEventListener("focusout",(t=>t.stopImmediatePropagation()),!0),this.handleFocusEvents(),this.handleBlurEvents(),this.handlelInputEvents(this.externalInput),this.appendChild(this.externalInput),this.externalInput}clearBlurTimers(){this.#w.forEach((t=>clearTimeout(t))),this.#w.length=0}dispatchBlur(){return setTimeout((()=>{this.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0})),this.removeAttribute("focused")}))}handleFocusEvents(){this.baseElement.addEventListener("focus",(()=>{this.externalInput.focus(),this.clearBlurTimers()})),this.externalInput.addEventListener("focus",(()=>{this.clearBlurTimers(),setTimeout((()=>this.baseElement.setAttribute("focused","true")))}))}handleBlurEvents(){this.baseElement.addEventListener("blur",(t=>{t.stopImmediatePropagation(),a||this.#w.push(this.dispatchBlur())}),!0),this.externalInput.addEventListener("blur",(t=>{t.stopImmediatePropagation(),this.#w.push(this.dispatchBlur())}),!0)}handlelInputEvents(t){t.addEventListener("input",(t=>{this.value=t.target.value})),t.addEventListener("input",(t=>{t.target.value?this.setAttribute("has-value","true"):this.removeAttribute("has-value")}))}getAutocompleteType(){return this.getAttribute("autocomplete")||s}forwardInputValue(t,e){const s=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value");Object.defineProperty(t,"value",{...s,set(t){s.set.call(this,t),e.value=t},configurable:!0})}}},62754:(t,e,s)=>{s.d(e,{m:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},79365:(t,e,s)=>{s.d(e,{OZ:()=>a.O,RF:()=>i.R,RV:()=>p.R,VO:()=>r.V,XX:()=>u.X,_$:()=>c._,jd:()=>m.j,mA:()=>h.m,mZ:()=>l.m,tQ:()=>o.t,tz:()=>n.t,yF:()=>d.y});var i=s(76356),r=s(4709),n=s(35321),a=s(90764),o=s(45677),l=s(62754),u=s(41689),h=s(45566),c=s(84448),d=s(64088),m=s(27079),p=s(98511)},27079:(t,e,s)=>{s.d(e,{j:()=>r});var i=s(13011);const r=t=>class extends t{init(){this.#M(),super.init?.()}#M(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,i.r.call(this,"blur"),i.r.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(i.r.call(this,"focus"),i.r.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{this!==e.target&&(e.stopImmediatePropagation(),t!==this.value&&(t=this.value,i.r.call(this,"input",{bubbles:!0,composed:!0})))}))}}},41689:(t,e,s)=>{s.d(e,{X:()=>a}),s(42672);const i=["required","pattern"],r="data-errormessage-pattern-mismatch",n=Symbol("validationTarget"),a=t=>class extends t{#S=n;static get observedAttributes(){return[...t.observedAttributes||[],...i]}static get formAssociated(){return!0}#T;get internals(){return this.#T}set internals(t){this.#T=t}constructor(){super(),this.#T=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}get defaultErrorMsgTypeMismatch(){return"Please match the requested type."}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:a,tooLong:o,rangeOverflow:l,rangeUnderflow:u,badInput:h,customError:c}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||n||h:return this.getAttribute(r)||this.defaultErrorMsgPatternMismatch;case i:return this.getAttribute("data-errormessage-type-mismatch")||this.getAttribute(r)||this.defaultErrorMsgTypeMismatch;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case o:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case u:return this.getAttribute("data-errormessage-pattern-range-underflow")||this.defaultErrorMsgRangeUnderflow;case l:return this.getAttribute("data-errormessage-pattern-range-overflow")||this.defaultErrorMsgRangeOverflow;case c:return this.validationMessage;default:return""}}#V(){const t=this.isReadOnly?{}:this.getValidity();this.#T.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#T.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#T.validity.valid}reportValidity(){return this.#T.reportValidity()}get validity(){return this.#T.validity}get validationTarget(){return this.#S===n?this.inputElement:this.#S}set validationTarget(t){this.#S=t}setCustomValidity(t){t?this.#T.setValidity({customError:!0},t,this.validationTarget):(this.#T.setValidity({}),this.#V())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#T.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),i.includes(t)&&this.#V()}init(){super.init?.(),this.addEventListener("change",this.#V),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#V),setTimeout((()=>this.#V()))}}},64088:(t,e,s)=>{s.d(e,{y:()=>n});var i=s(97810);const r=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options","loading","allow-custom-value","loading"],n=t=>class extends t{init(){super.init?.(),(0,i.mx)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>r.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.debug(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}},45566:(t,e,s)=>{s.d(e,{m:()=>u});var i=s(3047),r=s(9696),n=s(97810),a=s(76356),o=s(48401);const l=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},u=({name:t,selector:e,mappings:s={},forward:{attributes:u=[],include:h=!0}={}})=>c=>{const d=t||(t=>t.replace(/[^\w\s]/gi,""))(e),m=(0,a.R)({mappings:s})(c);return class extends m{static get cssVarList(){return{...m.cssVarList,[d]:(0,o.SR)((0,r.GL)(c.componentName,"_"+d),s)}}#L;constructor(){const t=l((async t=>{const s=(t.shadowRoot||t).querySelector(t.baseSelector);return e?(await l((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+d,themeSection:i.WJ+d,baseSelector:":host"}),this.#L=t(this).then((t=>t.host))}async#I(){const t=await this.#L;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#L;(0,n.EA)(this,t,{[h?"includeAttrs":"excludeAttrs"]:u}),this.#I()}}}},90764:(t,e,s)=>{s.d(e,{O:()=>c});var i=s(9696),r=s(97810),n=s(13011),a=s(76356),o=s(41689);const l=["invalid","required"],u=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e?.localName)return e},h=({proxyProps:t=[],useProxyTargets:e=!1,inputEvent:s="input",triggerValidationEvents:i=[],proxyParentValidation:a=!1})=>h=>class extends((0,o.X)(h)){static get observedAttributes(){return[...h.observedAttributes||[],...l]}#C;#s=n.r.bind(this,"change");constructor(){super(),this.#C=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#C&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#C)return this.#C;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#C=u(t)||u(e),this.#C}set inputElement(t){this.#C=t}getValidity(){return this.inputElement?.validity||{}}#P(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#P(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},this.baseElement.addEventListener("input",(t=>{t.composed||this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))})),i.forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.inputElement?.setCustomValidity("")}))})),setTimeout((()=>{(Array.isArray(s)?s:[s]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#P()}))})),this.baseElement.addEventListener("change",(()=>{this.#s()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#P()})),t.forEach((t=>{const s=this.querySelector('input[slot="external-input"]')||null,i=e?[this.baseElement,s].filter(Boolean):[];((t,e,s)=>{const i=Array.isArray(e)?e:[e];Object.defineProperty(t,s,{set(t){i.forEach((e=>{e[s]=t}))},get:()=>e[0][s],configurable:!0})})(this,[this.inputElement,...i],t)})),this.setSelectionRange=this.inputElement?.setSelectionRange?.bind(this.inputElement),(0,r.EA)(this,this.inputElement,{includeAttrs:["inputmode"]})})),a){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...i)=>{if(3===i.length){const t=i.slice(0,i.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...i);return t[s](...i)}:"function"==typeof t[s]?(...i)=>(e.internals[s](...i),t[s](...i)):t[s]})}}},c=t=>(0,i.Zz)(h(t),(0,a.R)({componentNameOverride:(0,r.xE)("input-wrapper")}))}}]);
|
2
2
|
//# sourceMappingURL=9365.js.map
|