@descope/web-components-ui 1.0.74 → 1.0.76

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/index.esm.js +2550 -632
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/umd/447.js +1 -1
  4. package/dist/umd/744.js +1 -1
  5. package/dist/umd/878.js +1 -0
  6. package/dist/umd/descope-combo-box-index-js.js +1 -1
  7. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  8. package/dist/umd/descope-passcode-index-js.js +1 -1
  9. package/dist/umd/descope-phone-field-descope-phone-field-internal-index-js.js +1 -0
  10. package/dist/umd/descope-phone-field-index-js.js +1 -0
  11. package/dist/umd/descope-text-area-index-js.js +1 -1
  12. package/dist/umd/descope-text-field-index-js.js +1 -1
  13. package/dist/umd/index.js +1 -1
  14. package/package.json +1 -1
  15. package/src/components/descope-combo-box/ComboBox.js +85 -50
  16. package/src/components/descope-passcode/Passcode.js +43 -12
  17. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +32 -14
  18. package/src/components/descope-phone-field/CountryCodes.js +1212 -0
  19. package/src/components/descope-phone-field/PhoneField.js +186 -0
  20. package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +213 -0
  21. package/src/components/descope-phone-field/descope-phone-field-internal/index.js +6 -0
  22. package/src/components/descope-phone-field/helpers.js +23 -0
  23. package/src/components/descope-phone-field/index.js +9 -0
  24. package/src/components/descope-text-area/TextArea.js +3 -1
  25. package/src/components/descope-text-field/TextField.js +38 -3
  26. package/src/components/descope-text-field/textFieldMappings.js +22 -14
  27. package/src/index.js +1 -0
  28. package/src/mixins/inputValidationMixin.js +21 -2
  29. package/src/mixins/normalizeBooleanAttributesMixin.js +16 -7
  30. package/src/mixins/portalMixin.js +8 -3
  31. package/src/mixins/proxyInputMixin.js +1 -1
  32. package/src/theme/components/button.js +0 -3
  33. package/src/theme/components/comboBox.js +39 -9
  34. package/src/theme/components/index.js +3 -1
  35. package/src/theme/components/passcode.js +36 -3
  36. package/src/theme/components/phoneField.js +74 -0
  37. package/src/theme/components/textArea.js +5 -2
  38. package/src/theme/components/textField.js +6 -3
package/dist/umd/447.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[447],{4447:(e,t,o)=>{o.d(t,{Z:()=>l});const r={label:"::part(label)",input:"::part(input-field)",readOnlyInput:"[readonly]::part(input-field)::after",placeholder:"> input:placeholder-shown",host:()=>":host"},l={backgroundColor:{selector:r.input},color:{selector:r.input},width:{selector:r.host},borderColor:[{selector:r.input},{selector:r.readOnlyInput}],borderWidth:[{selector:r.input},{selector:r.readOnlyInput}],borderStyle:[{selector:r.input},{selector:r.readOnlyInput}],borderRadius:{selector:r.input},boxShadow:{selector:r.input},fontSize:{},height:{selector:r.input},padding:{selector:r.input},outline:{selector:r.input},outlineOffset:{selector:r.input},placeholderColor:{selector:r.placeholder,property:"color"}}}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[447],{4447:(e,r,t)=>{t.d(r,{Z:()=>o});const p={label:"::part(label)",inputWrapper:"::part(input-field)",readOnlyInput:"[readonly]::part(input-field)::after",placeholder:"> input:placeholder-shown",host:()=>":host",input:"input"},o={backgroundColor:{selector:p.inputWrapper},color:{selector:p.inputWrapper},width:{selector:p.host},borderColor:[{selector:p.inputWrapper},{selector:p.readOnlyInput}],borderWidth:[{selector:p.inputWrapper},{selector:p.readOnlyInput}],borderStyle:[{selector:p.inputWrapper},{selector:p.readOnlyInput}],borderRadius:{selector:p.inputWrapper},boxShadow:{selector:p.inputWrapper},fontSize:[{},{selector:p.host}],height:{selector:p.inputWrapper},padding:{selector:p.inputWrapper},margin:{selector:p.inputWrapper},caretColor:{selector:p.input},outlineColor:{selector:p.inputWrapper},outlineStyle:{selector:p.inputWrapper},outlineWidth:{selector:p.inputWrapper},outlineOffset:{selector:p.inputWrapper},textAlign:{selector:p.input},placeholderColor:{selector:p.placeholder,property:"color"}}}}]);
package/dist/umd/744.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[744],{3346:(t,e,s)=>{s.d(e,{s:()=>r});var i=s(2061),n=s(9629);const r=({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}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(n.Ae,n._A,n.QT)(s)}},5279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>n,qM:()=>a,qg:()=>r});const i="descope",n=3,r="host",a="@"},4567:(t,e,s)=>{s.d(e,{Db:()=>u,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>d,tg:()=>l});var i=s(2061),n=s(5279);const r=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const n=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{for(const n of t)"attributes"!==n.type||s.includes(n.attributeName)||i.length&&!i.includes(n.attributeName)||e([n.attributeName])})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{for(const s of t)"childList"===s.type&&e(s)})).observe(t,{childList:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const n=s[i]||i,r=t.getAttribute(i);null!==r?e.getAttribute(n)!==r&&e.setAttribute(n,r):e.removeAttribute(n)}))},l=(t,e,s)=>{r(t,o(t,e),s),r(e,o(e,t),s)},h=t=>(0,i.E3)(n.gh,t),c=(...t)=>`--${(0,i.E3)(...t)}`,d=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},u=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((t,s)=>Object.assign(t,{[s]:{get:()=>e[s],set(t){e[s]=t}}})),{});Object.defineProperties(t,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>n,GL:()=>i,mf:()=>a,qC:()=>r});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>i(t.filter((t=>!!t)).join("-")),r=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},9629:(t,e,s)=>{s.d(e,{li:()=>V,Ae:()=>A,DM:()=>p,yk:()=>c,e4:()=>d,pY:()=>C,_A:()=>S,wX:()=>b,QT:()=>x,Iw:()=>M,dj:()=>f,P4:()=>L});var i=s(5279),n=s(2061),r=s(4567),a=s(5561);const o=(t,...e)=>`var(${t}${e.length?` , ${o(...e)}`:""})`;class l{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 h=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,r.Tk)(t,s)})),{}),c=({mappings:t={}})=>e=>class extends e{static get cssVarList(){return{...e.cssVarList,...h(e.componentName,{...t})}}#s;#i;#n;#r;#a;#o;#l;#h;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#r=s,this.#a=r,this.#o=e?.(this)||this.shadowRoot,this.#l=a??this.baseSelector,this.#h=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#c(){this.#i.innerHTML=this.componentTheme[this.#a]}#d(){this.#i=document.createElement("style"),this.#i.id="style-mixin-theme",this.#o.prepend(this.#i),this.#n=a.componentsThemeManager.onCurrentThemeChange(this.#c.bind(this)),this.#c()}#u(){this.#s=document.createElement("style"),this.#s.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#s.innerText=`:host(${t}) {}`,this.#o.append(this.#s)}#m(t,s){const i=this.#s?.sheet?.cssRules[0].style;if(!i)return;const n=(0,r.Tk)(e.componentName,t.replace(new RegExp("^st-"),""));s?i?.setProperty(n,s):i?.removeProperty(n)}#p(t=[]){for(const e of t)this.#h.includes(e)&&this.#m(e,this.getAttribute(e));this.#s.innerHTML=this.#s?.sheet?.cssRules[0].cssText}#g(){const s=document.createElement("style");s.id="style-mixin-mappings",s.innerHTML=((t,e,s)=>{const i=new l;return Object.keys(s).forEach((a=>{const l=((t,e)=>{const s={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>Object.assign({},s,t))):[Object.assign({},s,e)]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s})=>{i.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(s)?s():s,o(h))}))})),i.toString()})((0,n.E3)(e.componentName,this.#r),this.#l,t),this.#o.prepend(s)}#b(t){(this.#o.classList||this.#o.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#b(e.componentName),this.#g(),this.#d(),this.#u(),(0,r.FX)(this,this.#p.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#n?.()}},d=t=>class extends t{#E=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#E=document.createElement("style"),this.#E.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#E):this.#E.remove()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var u=s(3346),m=s(7878);const p=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[]})=>{class h extends((0,u.s)({componentName:t,baseSelector:e})){#v=m.C.bind(this,"blur");#f=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open"}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t<slot></slot>\n\t\t\t${s.map((t=>`<slot name="${t}" slot="${t}"></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}focus=()=>this.baseElement.focus();init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#v()})),this.baseElement.addEventListener("focus",(t=>{this.#f()})),this.addEventListener("focus",(t=>{t.isTrusted&&this.focus()})),(0,r.Db)(this,this.baseElement,l),this.baseElement.onkeydown=t=>{t.shiftKey&&9===t.keyCode&&this.getRootNode()===document&&(this.removeAttribute("tabindex"),setTimeout((()=>this.setAttribute("tabindex","0")),0))},(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h},g=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#A;constructor(){super(),this.#A=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}getErrorMessage(t){switch(!0){case t.valueMissing:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case t.patternMismatch||t.typeMismatch:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case t.customError:return this.validationMessage;default:return""}}#S(){const t=this.getValidity();this.#A.setValidity(t,this.getErrorMessage(t))}get validationMessage(){return this.#A.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#A.validity.valid}reportValidity(){return this.#A.reportValidity()}get validity(){return this.#A.validity}setCustomValidity(t){t?this.#A.setValidity({customError:!0},t):(this.#A.setValidity({}),this.#S())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#A.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#S()}init(){super.init?.(),this.addEventListener("change",this.#S),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#S),this.#S()}},E=["invalid","has-error-message"],y=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},v=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if(e=e.assignedElements()[0],"slot"!==e.localName)return e},f=t=>class extends(b(t)){static get observedAttributes(){return[...t.observedAttributes||[],...E]}#C;#M=m.C.bind(this,"change");constructor(){super(),this.#C=super.inputElement}get inputElement(){const t=this.baseElement.shadowRoot.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot.querySelector('slot[name="textarea"]');if(this.#C??=v(t)||v(e),!this.#C)throw Error("no input was found");return this.#C}set inputElement(t){this.#C=t}getValidity(){return this.inputElement.validity}reportValidityOnInternalInput(){setTimeout((()=>{this.inputElement.reportValidity()}))}reportValidity(){isValid||(this.setAttribute("invalid","true"),this.reportValidityOnInternalInput())}handleInternalInputErrorMessage(){this.inputElement.checkValidity()||this.inputElement.setCustomValidity(this.validationMessage)}#V(){this.handleInternalInputErrorMessage(),this.setAttribute("error-message",this.validationMessage)}init(){super.init?.(),this.inputElement.addEventListener("input",(t=>{this.inputElement.checkValidity()||(this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.baseElement.__onInput(t),this.#V())})),this.baseElement.addEventListener("change",(()=>{this.#M()})),this.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#V())})),this.addEventListener("focus",(t=>{t.relatedTarget?.form===this.form&&(this.checkValidity()||this.setAttribute("invalid","true"),this.hasAttribute("invalid")&&this.reportValidityOnInternalInput())})),this.addEventListener("invalid",this.#V),this.handleInternalInputErrorMessage(),this.hasAttribute("tabindex")||this.getRootNode()!==document||this.setAttribute("tabindex",0),y(this,this.inputElement,"value"),y(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}},A=t=>class extends t{#x(){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.#x()}},S=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})}))}},C=t=>class extends t{init(){super.init?.(),this.addEventListener("blur",(t=>{t.isTrusted&&t.stopImmediatePropagation()})),this.addEventListener("focus",(t=>{t.isTrusted&&t.stopImmediatePropagation()})),this.addEventListener("focusout",(t=>{t.isTrusted&&t.stopImmediatePropagation()})),this.addEventListener("focusin",(t=>{t.isTrusted&&t.stopImmediatePropagation()}))}},M=({name:t,selector:e,mappings:s={}})=>a=>{const o=t||(t=>t.replace(/[^\w\s]/gi,""))(e),l=c({mappings:s})(a);return class extends l{static get cssVarList(){return{...l.cssVarList,[o]:h((0,n.E3)(a.componentName,"_"+o),s)}}#L;constructor(){const t=t=>{const s=t.shadowRoot.querySelector(t.baseSelector),i=e?s.shadowRoot.querySelector(e):s;return i.shadowRoot||i};var s;super({getRootElement:t,componentNameSuffix:"_"+o,themeSection:i.qM+o,baseSelector:":host"}),this.#L=(s=t(this)).host||s}#T(){this.#L.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#L.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#L,{excludeAttrs:["hover"]}),this.#T()}}},V=t=>class extends t{#M=m.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#M(),this.prevValue=this.value)}))}},x=t=>class extends t{attributeChangedCallback(t,e,s){""===s&&(this.setAttribute(t,"true"),s="true"),super.attributeChangedCallback?.(t,e,s)}},L=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){["focus","blur"].forEach((t=>{this.addEventListener(t,(t=>{this.isReadOnly&&(t.stopImmediatePropagation(),t.preventDefault())}),!0)})),super.init?.()}}}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[744],{3346:(t,e,s)=>{s.d(e,{s:()=>n});var i=s(2061),r=s(9629);const n=({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}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(r.Ae,r._A,r.QT)(s)}},5279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>r,qM:()=>a,qg:()=>n});const i="descope",r=3,n="host",a="@"},4567:(t,e,s)=>{s.d(e,{Db:()=>d,FX:()=>n,P$:()=>a,Tk:()=>u,iY:()=>h,oP:()=>c,tg:()=>l});var i=s(2061),r=s(5279);const n=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const r=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(r),new MutationObserver((t=>{for(const r of t)"attributes"!==r.type||s.includes(r.attributeName)||i.length&&!i.includes(r.attributeName)||e([r.attributeName])})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{for(const s of t)"childList"===s.type&&e(s)})).observe(t,{childList:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const r=s[i]||i,n=t.getAttribute(i);null!==n?e.getAttribute(r)!==n&&e.setAttribute(r,n):e.removeAttribute(r)}))},l=(t,e,s)=>{n(t,o(t,e),s),n(e,o(e,t),s)},h=t=>(0,i.E3)(r.gh,t),u=(...t)=>`--${(0,i.E3)(...t)}`,c=(t,e,s={})=>{n(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((t,s)=>Object.assign(t,{[s]:{get:()=>e[s],set(t){e[s]=t}}})),{});Object.defineProperties(t,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>r,GL:()=>i,mf:()=>a,qC:()=>n});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),r=(...t)=>i(t.filter((t=>!!t)).join("-")),n=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},9629:(t,e,s)=>{s.d(e,{li:()=>T,Ae:()=>A,DM:()=>p,yk:()=>u,e4:()=>c,pY:()=>M,_A:()=>S,wX:()=>b,QT:()=>L,Iw:()=>C,dj:()=>f,P4:()=>V});var i=s(5279),r=s(2061),n=s(4567),a=s(5561);const o=(t,...e)=>`var(${t}${e.length?` , ${o(...e)}`:""})`;class l{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 h=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,n.Tk)(t,s)})),{}),u=({mappings:t={}})=>e=>class extends e{static get cssVarList(){return{...e.cssVarList,...h(e.componentName,{...t})}}#s;#i;#r;#n;#a;#o;#l;#h;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:n=i.qg,baseSelector:a}={}){super(),this.#n=s,this.#a=n,this.#o=e?.(this)||this.shadowRoot,this.#l=a??this.baseSelector,this.#h=Object.keys(t).map((t=>(0,r.E3)("st",s,t)))}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#u(){this.#i.innerHTML=this.componentTheme[this.#a]}#c(){this.#i=document.createElement("style"),this.#i.id="style-mixin-theme",this.#o.prepend(this.#i),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#u.bind(this)),this.#u()}#d(){this.#s=document.createElement("style"),this.#s.id="style-mixin-overrides";const t=(s=e.componentName,r=i.k4,Array(r).fill(`.${s}`).join(""));var s,r;this.#s.innerText=`:host(${t}) {}`,this.#o.append(this.#s)}#m(t,s){const i=this.#s?.sheet?.cssRules[0].style;if(!i)return;const r=(0,n.Tk)(e.componentName,t.replace(new RegExp("^st-"),""));s?i?.setProperty(r,s):i?.removeProperty(r)}#p(t=[]){for(const e of t)this.#h.includes(e)&&this.#m(e,this.getAttribute(e));this.#s.innerHTML=this.#s?.sheet?.cssRules[0].cssText}#g(){const s=document.createElement("style");s.id="style-mixin-mappings",s.innerHTML=((t,e,s)=>{const i=new l;return Object.keys(s).forEach((a=>{const l=((t,e)=>{const s={selector:"",property:(0,r.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>Object.assign({},s,t))):[Object.assign({},s,e)]:[s]})(a,s[a]),h=(0,n.Tk)(t,a);l.forEach((({selector:t,property:s})=>{i.add(((t="",e="")=>(0,r.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,r.mf)(s)?s():s,o(h))}))})),i.toString()})((0,r.E3)(e.componentName,this.#n),this.#l,t),this.#o.prepend(s)}#b(t){(this.#o.classList||this.#o.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#b(e.componentName),this.#g(),this.#c(),this.#d(),(0,n.FX)(this,this.#p.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},c=t=>class extends t{#E=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#E=document.createElement("style"),this.#E.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#E):this.#E.remove()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(3346),m=s(7878);const p=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[]})=>{class h extends((0,d.s)({componentName:t,baseSelector:e})){#v=m.C.bind(this,"blur");#f=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open"}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,r.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t<slot></slot>\n\t\t\t${s.map((t=>`<slot name="${t}" slot="${t}"></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}focus=()=>this.baseElement.focus();init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#v()})),this.baseElement.addEventListener("focus",(t=>{this.#f()})),this.addEventListener("focus",(t=>{t.isTrusted&&this.focus()})),(0,n.Db)(this,this.baseElement,l),this.baseElement.onkeydown=t=>{t.shiftKey&&9===t.keyCode&&this.getRootNode()===document&&(this.removeAttribute("tabindex"),setTimeout((()=>this.setAttribute("tabindex","0")),0))},(0,n.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h},g=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#A;constructor(){super(),this.#A=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")}. `}getErrorMessage(t){switch(!0){case t.valueMissing:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case t.patternMismatch||t.typeMismatch:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case t.tooShort:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case t.tooLong:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case t.customError:return this.validationMessage;default:return""}}#S(){const t=this.getValidity();this.#A.setValidity(t,this.getErrorMessage(t))}get validationMessage(){return this.#A.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#A.validity.valid}reportValidity(){return this.#A.reportValidity()}get validity(){return this.#A.validity}setCustomValidity(t){t?this.#A.setValidity({customError:!0},t):(this.#A.setValidity({}),this.#S())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#A.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#S()}init(){super.init?.(),this.addEventListener("change",this.#S),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#S),setTimeout((()=>this.#S()))}},E=["invalid","required"],y=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},v=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if(e=e.assignedElements()[0],"slot"!==e.localName)return e},f=t=>class extends(b(t)){static get observedAttributes(){return[...t.observedAttributes||[],...E]}#M;#C=m.C.bind(this,"change");constructor(){super(),this.#M=super.inputElement}get inputElement(){const t=this.baseElement.shadowRoot.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot.querySelector('slot[name="textarea"]');if(this.#M??=v(t)||v(e),!this.#M)throw Error("no input was found");return this.#M}set inputElement(t){this.#M=t}getValidity(){return this.inputElement.validity}reportValidityOnInternalInput(){setTimeout((()=>{this.inputElement.reportValidity()}))}reportValidity(){isValid||(this.setAttribute("invalid","true"),this.reportValidityOnInternalInput())}handleInternalInputErrorMessage(){this.inputElement.checkValidity()||this.inputElement.setCustomValidity(this.validationMessage)}#T(){this.handleInternalInputErrorMessage(),this.setAttribute("error-message",this.validationMessage)}init(){super.init?.(),this.inputElement.addEventListener("input",(t=>{this.inputElement.checkValidity()||(this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.baseElement.__onInput(t),this.#T())})),this.baseElement.addEventListener("change",(()=>{this.#C()})),this.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#T())})),this.addEventListener("focus",(t=>{t.relatedTarget?.form===this.form&&(this.checkValidity()||this.setAttribute("invalid","true"),this.hasAttribute("invalid")&&this.reportValidityOnInternalInput())})),this.addEventListener("invalid",this.#T),this.handleInternalInputErrorMessage(),this.hasAttribute("tabindex")||this.getRootNode()!==document||this.setAttribute("tabindex",0),y(this,this.inputElement,"value"),y(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}},A=t=>class extends t{#L(){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.#L()}},S=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})}))}},M=t=>class extends t{init(){super.init?.(),this.addEventListener("blur",(t=>{t.isTrusted&&t.stopImmediatePropagation()})),this.addEventListener("focus",(t=>{t.isTrusted&&t.stopImmediatePropagation()})),this.addEventListener("focusout",(t=>{t.isTrusted&&t.stopImmediatePropagation()})),this.addEventListener("focusin",(t=>{t.isTrusted&&t.stopImmediatePropagation()}))}},C=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const c=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=u({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[c]:h((0,r.E3)(l.componentName,"_"+c),s)}}#V;constructor(){const t=t=>{const s=t.shadowRoot.querySelector(t.baseSelector),i=e?s.shadowRoot.querySelector(e):s;return i.shadowRoot||i};var s;super({getRootElement:t,componentNameSuffix:"_"+c,themeSection:i.qM+c,baseSelector:":host"}),this.#V=(s=t(this)).host||s}#x(){this.#V.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#V.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,n.oP)(this,this.#V,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#x()}}},T=t=>class extends t{#C=m.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#C(),this.prevValue=this.value)}))}},L=t=>class extends t{init(){super.init?.(),(0,n.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t)}))),{})}},V=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){["focus","blur"].forEach((t=>{this.addEventListener(t,(t=>{this.isReadOnly&&(t.stopImmediatePropagation(),t.preventDefault())}),!0)})),super.init?.()}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[878],{3878:(e,s,c)=>{c.d(s,{P:()=>a});var p=c(2061),k=c(9629),u=c(3346);const a=(...e)=>(0,p.qC)(k.pY,k.wX,k.li,k.P4)((0,u.s)(...e))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[483],{9258:(e,t,o)=>{o.r(t),o.d(t,{ComboBox:()=>c}),o(9314);var r=o(2061),i=o(4567),s=o(9629);const n=(0,i.iY)("combo-box"),{input:a,toggle:d}={input:{selector:"::part(input-field)"},toggle:{selector:"::part(toggle-button)"}},l={topRightRadius:{selector:a.selector,property:"border-top-right-radius"},bottomRightRadius:{selector:a.selector,property:"border-bottom-right-radius"},topLeftRadius:{selector:a.selector,property:"border-top-left-radius"},bottomLeftRadius:{selector:a.selector,property:"border-bottom-left-radius"}},c=(0,r.qC)((0,s.yk)({mappings:{...l,backgroundColor:a,width:a,color:a,padding:a,borderColor:a,borderStyle:a,borderWidth:a,cursor:d,height:a}}),s.e4,(0,s.Iw)({name:"overlay",selector:"",mappings:{}}),s.dj,s.Ae,(e=>class extends e{#e(){const e=this.shadowRoot.querySelector(this.baseSelector),t=Array.from(this.children);e.items=t.map((e=>Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name")}))),e.renderer=(e,o,r)=>{e.innerHTML=t[r.index].outerHTML}}#t(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=function(){this.bringToFront()},e._detachOverlay=function(){},e._enterModalState=function(){}}init(){super.init?.(),this.#t(),(0,i.P$)(this,this.#e.bind(this))}}))((0,s.DM)({slots:["prefix"],wrappedEleName:"vaadin-combo-box",style:()=>"\n\t\t:host {\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t",excludeAttrsSync:["tabindex"],includeAttrsSync:[],componentName:n,includeForwardProps:["items","renderer"]}));customElements.define(n,c)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[483],{3352:(e,t,o)=>{o.d(t,{Z:()=>p,f:()=>i});var r=o(2061),n=o(4567),a=o(9629);const i=(0,n.iY)("combo-box"),{host:s,input:l,placeholder:d,toggle:c}={host:{selector:()=>":host"},input:{selector:"::part(input-field)"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"}},b=(0,r.qC)((0,a.yk)({mappings:{width:s,height:l,padding:l,backgroundColor:l,boxShadow:l,borderColor:l,borderWidth:l,borderStyle:l,borderRadius:l,color:l,fontSize:[{},s],placeholderColor:{...d,property:"color"},toggleCursor:{...c,property:"cursor"},toggleColor:{...c,property:"color"},overlayBackground:{property:()=>b.cssVarList.overlay.backgroundColor},overlayBorder:{property:()=>b.cssVarList.overlay.border}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},cursor:{selector:"vaadin-combo-box-item"}},forward:{include:!1,attributes:["size"]}}),a.dj,a.Ae,(e=>class extends e{constructor(){super()}#e(){const e=this.shadowRoot.querySelector(this.baseSelector),t=Array.from(this.children);t.length&&(t.forEach((e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name")}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id")})})),e.items=t,e.renderer=(e,t,o)=>{e.innerHTML=o.item.outerHTML})}#t(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=function(){this.bringToFront()},e._detachOverlay=function(){},e._enterModalState=function(){}}connectedCallback(){super.connectedCallback?.(),this.#t(),(0,n.P$)(this,this.#e.bind(this))}}))((0,a.DM)({slots:["prefix"],wrappedEleName:"vaadin-combo-box",style:()=>'\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t}\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\t-webkit-mask-image: none;\n\t\t\tborder-radius: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t',excludeAttrsSync:["tabindex","size"],componentName:i,includeForwardProps:["items","renderer"]})),p=b},1294:(e,t,o)=>{o.r(t),o.d(t,{ComboBox:()=>r.Z}),o(9314);var r=o(3352);customElements.define(r.f,r.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[841],{1688:(t,e,i)=>{i.d(e,{f:()=>d,Z:()=>c});var s=i(2061),n=i(9629),a=i(3346),r=i(4567),u=i(7878);const l=t=>{t?.focus(),t?.setSelectionRange(1,1)},o=t=>{const e=t.replace(/\s/g,"");return e.match(/^\d+$/)?[...e]:[]},d=(0,r.iY)("passcode-internal"),p=["disabled","bordered","size","invalid","readonly"],h=((...t)=>(0,s.qC)(n.pY,n.wX,n.li,n.P4)((0,a.s)(...t)))({componentName:d,baseSelector:"div"}),c=class extends h{static get observedAttributes(){return p.concat(h.observedAttributes||[])}static get componentName(){return d}#t=u.C.bind(this,"blur");#e=u.C.bind(this,"focus");constructor(){super();const t=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tst-width="35px"\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="off"\n\t\t></descope-text-field>\n\t`));this.innerHTML=`\n\t\t<div>\n\t\t\t${t.join("")}\n\t\t</div>\n\t\t`,this.inputs=Array.from(this.querySelectorAll("descope-text-field"))}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}get value(){return this.inputs.map((({value:t})=>t)).join("")}set value(t){if(t===this.value)return;const e=o(t);e.length&&this.fillDigits(e,this.inputs[0])}get pattern(){return`^$|^\\d{${this.digits},}$`}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[0].focus()})),super.init?.(),this.initInputs()}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),i=Math.min(e+1,this.inputs.length-1);return this.inputs[i]}getPrevInput(t){const e=this.getInputIdx(t),i=Math.max(e-1,0);return this.inputs[i]}fillDigits(t,e){for(let i=0;i<t.length;i+=1){e.value=t[i]??"";const s=this.getNextInput(e);if(s===e)break;e=s}l(e)}initInputs(){let t,e=this.value;this.inputs.forEach((i=>{i.addEventListener("blur",(e=>{e.stopImmediatePropagation(),t=setTimeout((()=>{t=null,this.#t()}))})),i.addEventListener("focus",(e=>{e.stopImmediatePropagation(),clearTimeout(t),t||this.#e()})),i.addEventListener("input",(t=>{const s=o(i.value);s.length?this.fillDigits(s,i):i.value="",e===this.value&&t.stopImmediatePropagation()})),i.onkeydown=({key:t})=>{e=this.value,"Backspace"===t?(i.selectionStart||i.setSelectionRange(1,1),setTimeout((()=>{l(this.getPrevInput(i))}))):1===t.length&&(i.value="")}}))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),e!==i&&p.includes(t)&&this.inputs.forEach((e=>null===i?e.removeAttribute(t):e.setAttribute(t,i)))}}},4775:(t,e,i)=>{i.r(e);var s=i(1688);customElements.define(s.f,s.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[841],{7361:(t,e,i)=>{i.d(e,{f:()=>l,Z:()=>h});var s=i(3878),n=i(4567),r=i(7878);const a=t=>{t?.focus(),t?.setSelectionRange(1,1)},u=t=>{const e=t.replace(/\s/g,"");return e.match(/^\d+$/)?[...e]:[]},l=(0,n.iY)("passcode-internal"),p=["digits"],d=["disabled","bordered","size","invalid","readonly"],o=(0,s.P)({componentName:l,baseSelector:"div"}),h=class extends o{static get observedAttributes(){return p.concat(o.observedAttributes||[])}static get componentName(){return l}#t=r.C.bind(this,"blur");#e=r.C.bind(this,"focus");constructor(){super(),this.innerHTML='\n\t\t<div class="wrapper"></div>\n\t\t<style>\n\t\t\t.wrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\t\t</style>\n\t\t',this.wrapperEle=this.querySelector("div")}renderInputs(){const t=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="off"\n\t\t></descope-text-field>\n\t`));this.wrapperEle.innerHTML=t.join(""),this.inputs=Array.from(this.querySelectorAll("descope-text-field")),this.initInputs()}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}get value(){return this.inputs?.map((({value:t})=>t)).join("")||""}set value(t){if(t===this.value)return;const e=u(t);e.length&&this.fillDigits(e,this.inputs[0])}get pattern(){return`^$|^\\d{${this.digits},}$`}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[0].focus()})),super.init?.(),this.renderInputs()}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),i=Math.min(e+1,this.inputs.length-1);return this.inputs[i]}getPrevInput(t){const e=this.getInputIdx(t),i=Math.max(e-1,0);return this.inputs[i]}fillDigits(t,e){for(let i=0;i<t.length;i+=1){e.value=t[i]??"";const s=this.getNextInput(e);if(s===e)break;e=s}a(e)}initInputs(){let t,e=this.value;this.inputs.forEach((i=>{i.addEventListener("blur",(e=>{e.stopImmediatePropagation(),t=setTimeout((()=>{t=null,this.#t()}))})),i.addEventListener("focus",(e=>{e.stopImmediatePropagation(),clearTimeout(t),t||this.#e()})),i.addEventListener("input",(t=>{const s=u(i.value);s.length?this.fillDigits(s,i):i.value="",e===this.value&&t.stopImmediatePropagation()})),i.onkeydown=({key:t})=>{e=this.value,"Backspace"===t?(i.selectionStart||i.setSelectionRange(1,1),setTimeout((()=>{a(this.getPrevInput(i))}))):1===t.length&&(i.value="")},(0,n.oP)(this,i,{includeAttrs:d})}))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),e!==i&&p.includes(t)&&"digits"===t&&this.renderInputs()}}},4775:(t,e,i)=>{i.r(e);var s=i(7361);customElements.define(s.f,s.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[939],{7102:(t,e,n)=>{n.r(e);var i=n(9629),r=n(4447),d=n(1688),a=n(9063),o=n(2061),l=n(4567);const s=(0,l.iY)("passcode"),{borderStyle:p,borderWidth:c,...u}=r.Z,{digitField:f,label:b,requiredIndicator:m}={digitField:{selector:()=>a.Z.componentName},label:{selector:"> label"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"}},h=a.Z.cssVarList,x=(0,o.qC)((0,i.yk)({mappings:{...u,borderColor:{...f,property:h.borderColor},color:[u.color,b,m]}}),i.e4,i.dj,i.Ae,(t=>class extends t{constructor(){super()}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${d.f} \n\t\t\t\tbordered="true" \n\t\t\t\tname="code" \n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${d.f}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(d.f),(0,l.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["required","pattern"]})}}))((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>'\n :host {\n --vaadin-field-default-width: auto;\n\t\t\tdisplay: inline-block;\n }\n\n descope-passcode-internal {\n -webkit-mask-image: none;\n display: flex;\n gap: 2px;\n align-items: center;\n padding: 0;\n }\n vaadin-text-field::part(input-field) {\n background-color: transparent;\n padding: 0;\n\t\t\toverflow: hidden;\n }\n\t\tvaadin-text-field {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\topacity: 1;\n\t\t}\n\t\tvaadin-text-field > label,\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tcursor: pointer;\n\t\t}\n\t\tvaadin-text-field::part(input-field):focus {\n\t\t\tcursor: text;\n\t\t}\n\t\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\t\tfont-size: "12px";\n\t\t\tcontent: "*";\n\t\t}\n\t\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\t\tborder: 0 solid;\n\t\t}\n ',excludeAttrsSync:["tabindex"],componentName:s}));n(9357),n(4775),customElements.define(s,x)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[939],{7102:(t,e,n)=>{n.r(e);var i=n(9629),r=n(4447),o=n(7361),d=n(9063),a=n(2061),l=n(4567);const p=(0,l.iY)("passcode"),{borderStyle:s,borderWidth:c,...u}=r.Z,{digitField:g,label:h,requiredIndicator:f,internalWrapper:m,focusedValidDigitField:b}={focusedValidDigitField:{selector:()=>`${d.Z.componentName}[focused="true"]:not([invalid="true"])`},digitField:{selector:()=>d.Z.componentName},label:{selector:"> label"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:"descope-passcode-internal .wrapper"}},x=d.Z.cssVarList,y=(0,a.qC)((0,i.yk)({mappings:{...u,borderColor:{...g,property:x.borderColor},outlineColor:{...g,property:x.outlineColor},outlineWidth:[{...g,property:x.outlineWidth},{...m,property:"padding"}],color:[u.color,h,f],padding:{...g,property:x.padding},margin:{...g,property:x.margin},textAlign:{...g,property:x.textAlign},caretColor:{...g,property:x.caretColor},digitsGap:{...m,property:"gap"},focusedValidDigitFieldBorderColor:{...b,property:x.borderColor}}}),i.e4,i.dj,i.Ae,(t=>class extends t{constructor(){super()}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${o.f} \n\t\t\t\tbordered="true" \n\t\t\t\tname="code" \n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${o.f}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,l.oP)(this,this.inputElement,{includeAttrs:["digits","size"]})}}))((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n --vaadin-field-default-width: auto;\n\t\t\tdisplay: inline-block;\n }\n\n descope-passcode-internal {\n -webkit-mask-image: none;\n padding: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmin-height: initial;\n }\n\n\t\tdescope-passcode-internal .wrapper {\n\t\t\tbox-sizing: border-box;\n\t\t\tmin-height: initial;\n\t\t\theight: 100%;\n }\n\n\t\tdescope-passcode-internal descope-text-field {\n\t\t\twidth: var(${x.height})\t\t\t\n\t\t}\n\n vaadin-text-field::part(input-field) {\n background-color: transparent;\n padding: 0;\n\t\t\toverflow: hidden;\n\t\t\t-webkit-mask-image: none;\n }\n\n\t\tvaadin-text-field {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\twidth: 100%\n\t\t}\n\n\t\tvaadin-text-field::before {\n\t\t\theight: initial;\n\t\t}\n\n\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\topacity: 1;\n\t\t}\n\t\n\t\tvaadin-text-field::part(input-field):focus {\n\t\t\tcursor: text;\n\t\t}\n\n\t\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\t\tfont-size: "12px";\n\t\t\tcontent: "*";\n\t\t}\n\t\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\t\tborder: 0 solid;\n\t\t}\n `,excludeAttrsSync:["tabindex"],componentName:p}));n(9357),n(4775),customElements.define(p,y)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[646],{9859:(e,a,d)=>{d.d(a,{f:()=>t,Z:()=>p});var o=d(3878),n=d(4567),i=d(7878);const l=[{name:"Afghanistan",dialCode:"+93",code:"AF"},{name:"Aland Islands",dialCode:"+358",code:"AX"},{name:"Albania",dialCode:"+355",code:"AL"},{name:"Algeria",dialCode:"+213",code:"DZ"},{name:"AmericanSamoa",dialCode:"+1684",code:"AS"},{name:"Andorra",dialCode:"+376",code:"AD"},{name:"Angola",dialCode:"+244",code:"AO"},{name:"Anguilla",dialCode:"+1264",code:"AI"},{name:"Antarctica",dialCode:"+672",code:"AQ"},{name:"Antigua and Barbuda",dialCode:"+1268",code:"AG"},{name:"Argentina",dialCode:"+54",code:"AR"},{name:"Armenia",dialCode:"+374",code:"AM"},{name:"Aruba",dialCode:"+297",code:"AW"},{name:"Australia",dialCode:"+61",code:"AU"},{name:"Austria",dialCode:"+43",code:"AT"},{name:"Azerbaijan",dialCode:"+994",code:"AZ"},{name:"Bahamas",dialCode:"+1242",code:"BS"},{name:"Bahrain",dialCode:"+973",code:"BH"},{name:"Bangladesh",dialCode:"+880",code:"BD"},{name:"Barbados",dialCode:"+1246",code:"BB"},{name:"Belarus",dialCode:"+375",code:"BY"},{name:"Belgium",dialCode:"+32",code:"BE"},{name:"Belize",dialCode:"+501",code:"BZ"},{name:"Benin",dialCode:"+229",code:"BJ"},{name:"Bermuda",dialCode:"+1441",code:"BM"},{name:"Bhutan",dialCode:"+975",code:"BT"},{name:"Bolivia, Plurinational State of",dialCode:"+591",code:"BO"},{name:"Bosnia and Herzegovina",dialCode:"+387",code:"BA"},{name:"Botswana",dialCode:"+267",code:"BW"},{name:"Brazil",dialCode:"+55",code:"BR"},{name:"British Indian Ocean Territory",dialCode:"+246",code:"IO"},{name:"Brunei Darussalam",dialCode:"+673",code:"BN"},{name:"Bulgaria",dialCode:"+359",code:"BG"},{name:"Burkina Faso",dialCode:"+226",code:"BF"},{name:"Burundi",dialCode:"+257",code:"BI"},{name:"Cambodia",dialCode:"+855",code:"KH"},{name:"Cameroon",dialCode:"+237",code:"CM"},{name:"Canada",dialCode:"+1",code:"CA"},{name:"Cape Verde",dialCode:"+238",code:"CV"},{name:"Cayman Islands",dialCode:"+345",code:"KY"},{name:"Central African Republic",dialCode:"+236",code:"CF"},{name:"Chad",dialCode:"+235",code:"TD"},{name:"Chile",dialCode:"+56",code:"CL"},{name:"China",dialCode:"+86",code:"CN"},{name:"Christmas Island",dialCode:"+61",code:"CX"},{name:"Cocos (Keeling) Islands",dialCode:"+61",code:"CC"},{name:"Colombia",dialCode:"+57",code:"CO"},{name:"Comoros",dialCode:"+269",code:"KM"},{name:"Congo",dialCode:"+242",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dialCode:"+243",code:"CD"},{name:"Cook Islands",dialCode:"+682",code:"CK"},{name:"Costa Rica",dialCode:"+506",code:"CR"},{name:"Cote d'Ivoire",dialCode:"+225",code:"CI"},{name:"Croatia",dialCode:"+385",code:"HR"},{name:"Cuba",dialCode:"+53",code:"CU"},{name:"Cyprus",dialCode:"+357",code:"CY"},{name:"Czech Republic",dialCode:"+420",code:"CZ"},{name:"Denmark",dialCode:"+45",code:"DK"},{name:"Djibouti",dialCode:"+253",code:"DJ"},{name:"Dominica",dialCode:"+1767",code:"DM"},{name:"Dominican Republic",dialCode:"+1849",code:"DO"},{name:"Ecuador",dialCode:"+593",code:"EC"},{name:"Egypt",dialCode:"+20",code:"EG"},{name:"El Salvador",dialCode:"+503",code:"SV"},{name:"Equatorial Guinea",dialCode:"+240",code:"GQ"},{name:"Eritrea",dialCode:"+291",code:"ER"},{name:"Estonia",dialCode:"+372",code:"EE"},{name:"Ethiopia",dialCode:"+251",code:"ET"},{name:"Falkland Islands (Malvinas)",dialCode:"+500",code:"FK"},{name:"Faroe Islands",dialCode:"+298",code:"FO"},{name:"Fiji",dialCode:"+679",code:"FJ"},{name:"Finland",dialCode:"+358",code:"FI"},{name:"France",dialCode:"+33",code:"FR"},{name:"French Guiana",dialCode:"+594",code:"GF"},{name:"French Polynesia",dialCode:"+689",code:"PF"},{name:"Gabon",dialCode:"+241",code:"GA"},{name:"Gambia",dialCode:"+220",code:"GM"},{name:"Georgia",dialCode:"+995",code:"GE"},{name:"Germany",dialCode:"+49",code:"DE"},{name:"Ghana",dialCode:"+233",code:"GH"},{name:"Gibraltar",dialCode:"+350",code:"GI"},{name:"Greece",dialCode:"+30",code:"GR"},{name:"Greenland",dialCode:"+299",code:"GL"},{name:"Grenada",dialCode:"+1473",code:"GD"},{name:"Guadeloupe",dialCode:"+590",code:"GP"},{name:"Guam",dialCode:"+1671",code:"GU"},{name:"Guatemala",dialCode:"+502",code:"GT"},{name:"Guernsey",dialCode:"+44",code:"GG"},{name:"Guinea",dialCode:"+224",code:"GN"},{name:"Guinea-Bissau",dialCode:"+245",code:"GW"},{name:"Guyana",dialCode:"+595",code:"GY"},{name:"Haiti",dialCode:"+509",code:"HT"},{name:"Holy See (Vatican City State)",dialCode:"+379",code:"VA"},{name:"Honduras",dialCode:"+504",code:"HN"},{name:"Hong Kong",dialCode:"+852",code:"HK"},{name:"Hungary",dialCode:"+36",code:"HU"},{name:"Iceland",dialCode:"+354",code:"IS"},{name:"India",dialCode:"+91",code:"IN"},{name:"Indonesia",dialCode:"+62",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dialCode:"+98",code:"IR"},{name:"Iraq",dialCode:"+964",code:"IQ"},{name:"Ireland",dialCode:"+353",code:"IE"},{name:"Isle of Man",dialCode:"+44",code:"IM"},{name:"Israel",dialCode:"+972",code:"IL"},{name:"Italy",dialCode:"+39",code:"IT"},{name:"Jamaica",dialCode:"+1876",code:"JM"},{name:"Japan",dialCode:"+81",code:"JP"},{name:"Jersey",dialCode:"+44",code:"JE"},{name:"Jordan",dialCode:"+962",code:"JO"},{name:"Kazakhstan",dialCode:"+77",code:"KZ"},{name:"Kenya",dialCode:"+254",code:"KE"},{name:"Kiribati",dialCode:"+686",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dialCode:"+850",code:"KP"},{name:"Korea, Republic of South Korea",dialCode:"+82",code:"KR"},{name:"Kuwait",dialCode:"+965",code:"KW"},{name:"Kyrgyzstan",dialCode:"+996",code:"KG"},{name:"Laos",dialCode:"+856",code:"LA"},{name:"Latvia",dialCode:"+371",code:"LV"},{name:"Lebanon",dialCode:"+961",code:"LB"},{name:"Lesotho",dialCode:"+266",code:"LS"},{name:"Liberia",dialCode:"+231",code:"LR"},{name:"Libyan Arab Jamahiriya",dialCode:"+218",code:"LY"},{name:"Liechtenstein",dialCode:"+423",code:"LI"},{name:"Lithuania",dialCode:"+370",code:"LT"},{name:"Luxembourg",dialCode:"+352",code:"LU"},{name:"Macao",dialCode:"+853",code:"MO"},{name:"Macedonia",dialCode:"+389",code:"MK"},{name:"Madagascar",dialCode:"+261",code:"MG"},{name:"Malawi",dialCode:"+265",code:"MW"},{name:"Malaysia",dialCode:"+60",code:"MY"},{name:"Maldives",dialCode:"+960",code:"MV"},{name:"Mali",dialCode:"+223",code:"ML"},{name:"Malta",dialCode:"+356",code:"MT"},{name:"Marshall Islands",dialCode:"+692",code:"MH"},{name:"Martinique",dialCode:"+596",code:"MQ"},{name:"Mauritania",dialCode:"+222",code:"MR"},{name:"Mauritius",dialCode:"+230",code:"MU"},{name:"Mayotte",dialCode:"+262",code:"YT"},{name:"Mexico",dialCode:"+52",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dialCode:"+691",code:"FM"},{name:"Moldova",dialCode:"+373",code:"MD"},{name:"Monaco",dialCode:"+377",code:"MC"},{name:"Mongolia",dialCode:"+976",code:"MN"},{name:"Montenegro",dialCode:"+382",code:"ME"},{name:"Montserrat",dialCode:"+1664",code:"MS"},{name:"Morocco",dialCode:"+212",code:"MA"},{name:"Mozambique",dialCode:"+258",code:"MZ"},{name:"Myanmar",dialCode:"+95",code:"MM"},{name:"Namibia",dialCode:"+264",code:"NA"},{name:"Nauru",dialCode:"+674",code:"NR"},{name:"Nepal",dialCode:"+977",code:"NP"},{name:"Netherlands",dialCode:"+31",code:"NL"},{name:"Netherlands Antilles",dialCode:"+599",code:"AN"},{name:"New Caledonia",dialCode:"+687",code:"NC"},{name:"New Zealand",dialCode:"+64",code:"NZ"},{name:"Nicaragua",dialCode:"+505",code:"NI"},{name:"Niger",dialCode:"+227",code:"NE"},{name:"Nigeria",dialCode:"+234",code:"NG"},{name:"Niue",dialCode:"+683",code:"NU"},{name:"Norfolk Island",dialCode:"+672",code:"NF"},{name:"Northern Mariana Islands",dialCode:"+1670",code:"MP"},{name:"Norway",dialCode:"+47",code:"NO"},{name:"Oman",dialCode:"+968",code:"OM"},{name:"Pakistan",dialCode:"+92",code:"PK"},{name:"Palau",dialCode:"+680",code:"PW"},{name:"Palestinian Territory, Occupied",dialCode:"+970",code:"PS"},{name:"Panama",dialCode:"+507",code:"PA"},{name:"Papua New Guinea",dialCode:"+675",code:"PG"},{name:"Paraguay",dialCode:"+595",code:"PY"},{name:"Peru",dialCode:"+51",code:"PE"},{name:"Philippines",dialCode:"+63",code:"PH"},{name:"Pitcairn",dialCode:"+872",code:"PN"},{name:"Poland",dialCode:"+48",code:"PL"},{name:"Portugal",dialCode:"+351",code:"PT"},{name:"Puerto Rico",dialCode:"+1939",code:"PR"},{name:"Qatar",dialCode:"+974",code:"QA"},{name:"Romania",dialCode:"+40",code:"RO"},{name:"Russia",dialCode:"+7",code:"RU"},{name:"Rwanda",dialCode:"+250",code:"RW"},{name:"Reunion",dialCode:"+262",code:"RE"},{name:"Saint Barthelemy",dialCode:"+590",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290",code:"SH"},{name:"Saint Kitts and Nevis",dialCode:"+1869",code:"KN"},{name:"Saint Lucia",dialCode:"+1758",code:"LC"},{name:"Saint Martin",dialCode:"+590",code:"MF"},{name:"Saint Pierre and Miquelon",dialCode:"+508",code:"PM"},{name:"Saint Vincent and the Grenadines",dialCode:"+1784",code:"VC"},{name:"Samoa",dialCode:"+685",code:"WS"},{name:"San Marino",dialCode:"+378",code:"SM"},{name:"Sao Tome and Principe",dialCode:"+239",code:"ST"},{name:"Saudi Arabia",dialCode:"+966",code:"SA"},{name:"Senegal",dialCode:"+221",code:"SN"},{name:"Serbia",dialCode:"+381",code:"RS"},{name:"Seychelles",dialCode:"+248",code:"SC"},{name:"Sierra Leone",dialCode:"+232",code:"SL"},{name:"Singapore",dialCode:"+65",code:"SG"},{name:"Slovakia",dialCode:"+421",code:"SK"},{name:"Slovenia",dialCode:"+386",code:"SI"},{name:"Solomon Islands",dialCode:"+677",code:"SB"},{name:"Somalia",dialCode:"+252",code:"SO"},{name:"South Africa",dialCode:"+27",code:"ZA"},{name:"South Sudan",dialCode:"+211",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dialCode:"+500",code:"GS"},{name:"Spain",dialCode:"+34",code:"ES"},{name:"Sri Lanka",dialCode:"+94",code:"LK"},{name:"Sudan",dialCode:"+249",code:"SD"},{name:"Suriname",dialCode:"+597",code:"SR"},{name:"Svalbard and Jan Mayen",dialCode:"+47",code:"SJ"},{name:"Swaziland",dialCode:"+268",code:"SZ"},{name:"Sweden",dialCode:"+46",code:"SE"},{name:"Switzerland",dialCode:"+41",code:"CH"},{name:"Syrian Arab Republic",dialCode:"+963",code:"SY"},{name:"Taiwan",dialCode:"+886",code:"TW"},{name:"Tajikistan",dialCode:"+992",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dialCode:"+255",code:"TZ"},{name:"Thailand",dialCode:"+66",code:"TH"},{name:"Timor-Leste",dialCode:"+670",code:"TL"},{name:"Togo",dialCode:"+228",code:"TG"},{name:"Tokelau",dialCode:"+690",code:"TK"},{name:"Tonga",dialCode:"+676",code:"TO"},{name:"Trinidad and Tobago",dialCode:"+1868",code:"TT"},{name:"Tunisia",dialCode:"+216",code:"TN"},{name:"Turkey",dialCode:"+90",code:"TR"},{name:"Turkmenistan",dialCode:"+993",code:"TM"},{name:"Turks and Caicos Islands",dialCode:"+1649",code:"TC"},{name:"Tuvalu",dialCode:"+688",code:"TV"},{name:"Uganda",dialCode:"+256",code:"UG"},{name:"Ukraine",dialCode:"+380",code:"UA"},{name:"United Arab Emirates",dialCode:"+971",code:"AE"},{name:"United Kingdom",dialCode:"+44",code:"GB"},{name:"United States",dialCode:"+1",code:"US"},{name:"Uruguay",dialCode:"+598",code:"UY"},{name:"Uzbekistan",dialCode:"+998",code:"UZ"},{name:"Vanuatu",dialCode:"+678",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dialCode:"+58",code:"VE"},{name:"Vietnam",dialCode:"+84",code:"VN"},{name:"Virgin Islands, British",dialCode:"+1284",code:"VG"},{name:"Virgin Islands, U.S.",dialCode:"+1340",code:"VI"},{name:"Wallis and Futuna",dialCode:"+681",code:"WF"},{name:"Yemen",dialCode:"+967",code:"YE"},{name:"Zambia",dialCode:"+260",code:"ZM"},{name:"Zimbabwe",dialCode:"+263",code:"ZW"}].sort(((e,a)=>e.name<a.name?-1:1)),t=(0,n.iY)("phone-field-internal"),c=["disabled","size","bordered","invalid"],m=["country-input-placeholder","default-code"],C=["phone-input-placeholder","maxlength"],r={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},s=[].concat(c,m,C),u=(0,o.P)({componentName:t,baseSelector:"div"}),p=class extends u{static get observedAttributes(){return[].concat(u.observedAttributes||[],s)}#e=i.C.bind(this,"blur");#a=i.C.bind(this,"focus");constructor(){super(),this.innerHTML=`\n <div>\n <descope-combo-box\n\t\t\t\titem-label-path="data-name"\n\t\t\t\titem-value-path="data-id"\n\t\t\t>\n\t\t\t${l.map((e=>(({code:e,dialCode:a,name:d})=>`\n\t<div\n\t\tstyle="display:flex; flex-direction: column;"\n\t\tdata-id="${e}"\n\t\tdata-name="${e} ${a} ${d}"\n\t>\n\t\t<div>\n\t\t\t<span>\n\t\t\t\t<img src="${(e=>`https://cdn.jsdelivr.net/npm/svg-country-flags@1.2.10/svg/${e.toLowerCase()}.svg`)(e)}" width="20"/>\n\t\t\t</span>\n\t\t\t<span>${d}</span>\n\t\t</div>\n\t\t<div>\n\t\t\t<span>${e}</span>\n\t\t\t<span>${a}</span>\n\t\t</div>\n\t</div>\n`)(e))).join("")}\n\t\t\t</descope-combo-box>\n\t\t\t<div class="separator"></div>\n <descope-text-field type="tel"></descope-text-field>\n </div>`,this.countryCodeInput=this.querySelector("descope-combo-box"),this.phoneNumberInput=this.querySelector("descope-text-field"),this.inputs=[this.countryCodeInput,this.phoneNumberInput]}get value(){return this.inputs.map((({value:e})=>e)).join("-")}set value(e){const[a="",d=""]=e.split("-");this.countryCodeInput.value=a,this.phoneNumberInput.value=d}get phoneNumberValue(){return this.phoneNumberInput.value}get countryCodeValue(){return this.countryCodeInput.shadowRoot.querySelector("input").value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}getValidity(){const e=this.countryCodeInput.value,a=this.phoneNumberInput.value,d=!e||!a,o=this.phoneNumberInput.value.length&&this.phoneNumberInput.value.length<this.minLength;return this.isRequired&&d?{valueMissing:!0}:o?{tooShort:!0}:e&&!a||!e&&a?{valueMissing:!0}:{}}init(){super.init(),this.initInputs(),this.setComboBoxDescriptor()}handleDefaultCountryCode(e){if(!this.countryCodeInput.value){const a=this.countryCodeInput.items.find((a=>a["data-id"]===e))?.["data-name"];a&&setTimeout((()=>this.countryCodeInput.value=a))}}setComboBoxDescriptor(){const e=this.countryCodeInput,a=e.shadowRoot.querySelector("input"),d=Object.getOwnPropertyDescriptor(a.constructor.prototype,"value");Object.defineProperties(a,{value:{...d,set(a){if(!e.items?.length)return;const[o,n]=a.split(" ");a!==this.value&&d.set.call(this,n||"")}}})}initInputs(){let e,a=this.value;this.phoneNumberInput.addEventListener("input",(e=>{const a=/^\d$/,d=e.target.value.split("").filter((e=>a.test(e))).join("");e.target.value=d})),this.inputs.forEach((d=>{d.addEventListener("blur",(a=>{a.stopImmediatePropagation(),e=setTimeout((()=>{e=null,this.#e()}))})),d.addEventListener("focus",(a=>{a.stopImmediatePropagation(),clearTimeout(e),e||this.#a()})),d.addEventListener("input",(e=>{a===this.value&&e.stopImmediatePropagation()}))}))}attributeChangedCallback(e,a,d){if(super.attributeChangedCallback(e,a,d),a!==d)if("default-code"===e&&d)this.handleDefaultCountryCode(d);else if(s.includes(e)){const a=r[e]||e;c.includes(e)?this.inputs.forEach((e=>e.setAttribute(a,d))):m.includes(e)?this.countryCodeInput.setAttribute(a,d):C.includes(e)&&this.phoneNumberInput.setAttribute(a,d)}}}},4772:(e,a,d)=>{d.r(a),d(1294),d(9357);var o=d(9859);customElements.define(o.f,o.Z)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[414],{4840:(t,e,n)=>{n.r(e),n.d(e,{PhoneField:()=>w}),n(4772),n(1294),n(9357);var r=n(9859),o=n(4567),d=n(2061),i=n(9629),p=n(9063),l=n(3352);const a=p.Z.cssVarList,s=l.Z.cssVarList,c=(0,o.iY)("phone-field"),{inputWrapper:h,countryCodeInput:u,phoneInput:y,label:f,requiredIndicator:b,separator:m}={inputWrapper:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},label:{selector:"> label"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},separator:{selector:"descope-phone-field-internal .separator"}},w=(0,d.qC)((0,i.yk)({mappings:{componentWidth:{selector:()=>":host",property:"width"},wrapperBorderStyle:[{...h,property:"border-style"},{...m,property:"border-left-style"}],wrapperBorderWidth:[{...h,property:"border-width"},{...m,property:"border-left-width"}],wrapperBorderColor:[{...h,property:"border-color"},{...m,property:"border-left-color"}],wrapperBorderRadius:{...h,property:"border-radius"},inputHeight:{...h,property:"height"},countryCodeInputWidth:{...u,property:s.width},countryCodeDropdownWidth:{...u,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...y,property:"width"},color:[f,b,{...y,property:a.color},{...u,property:s.color}],placeholderColor:{...y,property:a.placeholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:s.overlayItemBackgroundColor}}}),i.e4,i.dj,(t=>class extends t{constructor(){super()}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${r.f} \n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${r.f}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.f),(0,o.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder"]})}}))((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\t--vaadin-field-default-width: auto;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\tdiv {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-text-field {\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 0;\n\t\t\t\tmin-height: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\tdescope-phone-field-internal {\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tmin-height: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\t\n\t\t\t}\n\t\t\tdescope-phone-field-internal > div {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\tdescope-phone-field-internal .separator {\n\t\t\t\tflex: 0;\n\t\t\t\tborder: none;\n\t\t\t}\n\t\t\tdescope-combo-box {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\theight: 100%;\n\t\t\t\t${s.borderWidth}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\tmin-height: 0;\n\t\t\t\theight: 100%;\n\t\t\t\t${a.borderWidth}: 0;\n\t\t\t\t${a.borderRadius}: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\t\t\tcontent: "*";\n\t\t\t}\n\t\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:c}));customElements.define(c,w)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[322],{178:(t,e,n)=>{n.r(e),n.d(e,{TextArea:()=>c}),n(7101);var r=n(9629),a=n(2061);const o=(0,n(4567).iY)("text-area"),i={label:"::part(label)",input:"::part(input-field)",required:"::part(required-indicator)::after",host:()=>":host"};let s="";const l=(0,a.qC)((0,r.yk)({mappings:{resize:{selector:"> textarea"},color:{selector:i.label},cursor:{},width:{selector:i.host},backgroundColor:{selector:i.input},borderWidth:{selector:i.input},borderStyle:{selector:i.input},borderColor:{selector:i.input},borderRadius:{selector:i.input},outline:{selector:i.input},outlineOffset:{selector:i.input}}}),r.e4,r.dj,r.Ae)((0,r.DM)({slots:[],wrappedEleName:"vaadin-text-area",style:()=>s,excludeAttrsSync:["tabindex"],componentName:o}));s='\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\tvaadin-text-area {\n\t\tmargin: 0;\n\t\twidth: 100%;\n\t}\n\tvaadin-text-area > label,\n\tvaadin-text-area::part(input-field) {\n\t\tcursor: pointer;\n\t}\n\tvaadin-text-area[focused]::part(input-field) {\n\t\tcursor: text;\n\t}\n\tvaadin-text-area::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t}\t\n';const c=l;customElements.define(o,c)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[322],{178:(t,e,n)=>{n.r(e),n.d(e,{TextArea:()=>c}),n(7101);var r=n(9629),a=n(2061);const o=(0,n(4567).iY)("text-area"),i={label:"::part(label)",input:"::part(input-field)",required:"::part(required-indicator)::after",host:()=>":host"};let l="";const s=(0,a.qC)((0,r.yk)({mappings:{resize:{selector:"> textarea"},color:{selector:i.label},cursor:{},width:{selector:i.host},backgroundColor:{selector:i.input},borderWidth:{selector:i.input},borderStyle:{selector:i.input},borderColor:{selector:i.input},borderRadius:{selector:i.input},outlineWidth:{selector:i.input},outlineStyle:{selector:i.input},outlineColor:{selector:i.input},outlineOffset:{selector:i.input}}}),r.e4,r.dj,r.Ae)((0,r.DM)({slots:[],wrappedEleName:"vaadin-text-area",style:()=>l,excludeAttrsSync:["tabindex"],componentName:o}));l='\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\tvaadin-text-area {\n\t\tmargin: 0;\n\t\twidth: 100%;\n\t}\n\tvaadin-text-area > label,\n\tvaadin-text-area::part(input-field) {\n\t\tcursor: pointer;\n\t}\n\tvaadin-text-area[focused]::part(input-field) {\n\t\tcursor: text;\n\t}\n\tvaadin-text-area::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t}\t\n';const c=s;customElements.define(o,c)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[934],{9063:(t,e,n)=>{n.d(e,{Z:()=>s,f:()=>d});var i=n(9629),a=n(4447),l=n(2061);const d=(0,n(4567).iY)("text-field");let o="";const r=(0,l.qC)((0,i.yk)({mappings:a.Z}),i.e4,i.dj,i.Ae)((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>o,excludeAttrsSync:["tabindex"],componentName:d}));o=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\tvaadin-text-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\tvaadin-text-field::part(input-field) {\n\t\toverflow: hidden;\n\t}\n\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-text-field input:-webkit-autofill,\n\tvaadin-text-field input:-webkit-autofill::first-line,\n\tvaadin-text-field input:-webkit-autofill:hover,\n\tvaadin-text-field input:-webkit-autofill:active,\n\tvaadin-text-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${r.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${r.cssVarList.height}) var(${r.cssVarList.backgroundColor}) inset;\n\t}\n\tvaadin-text-field > label,\n\tvaadin-text-field::part(input-field) {\n\t\tcursor: pointer;\n\t\tcolor: var(${r.cssVarList.color});\n\t}\n\tvaadin-text-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${r.cssVarList.color});\n\t}\n\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n`;const s=r},9357:(t,e,n)=>{n.r(e),n.d(e,{TextField:()=>i.Z}),n(9789);var i=n(9063);customElements.define(i.f,i.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[934],{9063:(t,e,n)=>{n.d(e,{Z:()=>f,f:()=>l});var i=n(9629),a=n(4447),d=n(2061);const l=(0,n(4567).iY)("text-field");let r="";const s=["type"],o=(0,d.qC)((0,i.yk)({mappings:a.Z}),i.e4,i.dj,i.Ae,(t=>class extends t{static get observedAttributes(){return s.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,n){super.attributeChangeCallback?.(t,e,n),"type"===t&&this.baseElement._setType(n)}}))((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>r,excludeAttrsSync:["tabindex"],componentName:l}));r=`\n\t:host {\n\t\tdisplay: inline-block;\n\t\t--vaadin-field-default-width: auto;\n\t}\n\tvaadin-text-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\tvaadin-text-field::part(input-field) {\n\t\toverflow: hidden;\n\t\tpadding: 0;\n\t}\n\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-text-field input:-webkit-autofill,\n\tvaadin-text-field input:-webkit-autofill::first-line,\n\tvaadin-text-field input:-webkit-autofill:hover,\n\tvaadin-text-field input:-webkit-autofill:active,\n\tvaadin-text-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${o.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${o.cssVarList.height}) var(${o.cssVarList.backgroundColor}) inset;\n\t}\n\n\tvaadin-text-field input {\n\t\t-webkit-mask-image: none;\n\t}\n\n\tvaadin-text-field > label,\n\tvaadin-text-field::part(input-field) {\n\t\tcolor: var(${o.cssVarList.color});\n\t}\n\tvaadin-text-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${o.cssVarList.color});\n\t}\n\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n\n\tvaadin-text-field::before {\n\t\theight: unset;\n\t}\n`;const f=o},9357:(t,e,n)=>{n.r(e),n.d(e,{TextField:()=>i.Z}),n(9789);var i=n(9063);customElements.define(i.f,i.Z)}}]);
package/dist/umd/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DescopeUI=t():e.DescopeUI=t()}(self,(()=>(()=>{var e,t,o,r={534:(e,t,o)=>{var r={"./descope-button/index.js":[3029,840,767,211,513,729,744,662],"./descope-checkbox/index.js":[7904,840,786,208,767,515,744,761],"./descope-combo-box/index.js":[9258,840,786,208,233,824,314,744,483],"./descope-container/index.js":[147,744,317],"./descope-date-picker/index.js":[2552,840,786,208,233,767,211,824,513,541,744,17],"./descope-divider/index.js":[6446,744,528,178],"./descope-email-field/index.js":[689,840,786,208,233,422,725,437,744,447,760],"./descope-image/index.js":[8116,744,772],"./descope-link/index.js":[8029,744,528,58],"./descope-loader-linear/index.js":[9929,744,453],"./descope-loader-radial/index.js":[7603,744,72],"./descope-logo/index.js":[4641,744,984],"./descope-number-field/index.js":[4951,840,786,208,233,422,806,744,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,744,841],"./descope-passcode/index.js":[7102,840,786,208,233,422,725,789,744,447,841,934,939],"./descope-password-field/index.js":[1721,840,786,208,233,422,767,725,211,56,744,447,320],"./descope-switch-toggle/index.js":[3774,840,786,208,767,515,744,739],"./descope-text-area/index.js":[178,840,786,233,422,101,744,322],"./descope-text-field/index.js":[9357,840,786,208,233,422,725,789,744,447,934],"./descope-text/index.js":[1876,744,528]};function s(e){if(!o.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],s=t[0];return Promise.all(t.slice(1).map(o.e)).then((()=>o(s)))}s.keys=()=>Object.keys(r),s.id=534,e.exports=s},5561:(e,t,o)=>{"use strict";o.r(t),o.d(t,{componentsThemeManager:()=>r});const r=new class{static mountOnPropName="DescopeThemeManager";#e={};#t="light";#o=new Set;#r(){this.#o.forEach((e=>e?.()))}get currentThemeName(){return this.#t}set currentThemeName(e){this.#t=e,this.#r()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#o.add(e),()=>{this.#o.delete(e)}}set themes(e){this.#e=e,this.#r()}}},7507:(e,t,o)=>{const{componentsThemeManager:r}=o(5561),s=o(534);e.exports=s.keys().reduce(((e,t)=>(e[t.replace(/.*?([^\/]+)\/index\.js$/,"$1")]=()=>s(t),e)),{}),e.exports.componentsThemeManager=r}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,s)=>{if(!o){var i=1/0;for(p=0;p<e.length;p++){for(var[o,r,s]=e[p],d=!0,c=0;c<o.length;c++)(!1&s||i>=s)&&Object.keys(n.O).every((e=>n.O[e](o[c])))?o.splice(c--,1):(d=!1,s<i&&(i=s));if(d){e.splice(p--,1);var a=r();void 0!==a&&(t=a)}}return t}s=s||0;for(var p=e.length;p>0&&e[p-1][2]>s;p--)e[p]=e[p-1];e[p]=[o,r,s]},n.F={},n.E=e=>{Object.keys(n.F).map((t=>{n.F[t](e)}))},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,o)=>(n.f[o](e,t),t)),[])),n.u=e=>(({17:"descope-date-picker-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",453:"descope-loader-linear-index-js",483:"descope-combo-box-index-js",528:"descope-text-index-js",662:"descope-button-index-js",739:"descope-switch-toggle-index-js",760:"descope-email-field-index-js",761:"descope-checkbox-index-js",772:"descope-image-index-js",841:"descope-passcode-descope-passcode-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},o="DescopeUI:",n.l=(e,r,s,i)=>{if(t[e])t[e].push(r);else{var d,c;if(void 0!==s)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+s){d=l;break}}d||(c=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,n.nc&&d.setAttribute("nonce",n.nc),d.setAttribute("data-webpack",o+s),d.src=e),t[e]=[r];var u=(o,r)=>{d.onerror=d.onload=null,clearTimeout(m);var s=t[e];if(delete t[e],d.parentNode&&d.parentNode.removeChild(d),s&&s.forEach((e=>e(r))),o)return o(r)},m=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),c&&document.head.appendChild(d)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");o.length&&(e=o[o.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={826:0};n.f.j=(t,o)=>{var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{var s=new Promise(((o,s)=>r=e[t]=[o,s]));o.push(r[2]=s);var i=n.p+n.u(t),d=new Error;n.l(i,(o=>{if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var s=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;d.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",d.name="ChunkLoadError",d.type=s,d.request=i,r[1](d)}}),"chunk-"+t,t)}},n.F.j=t=>{if(!n.o(e,t)||void 0===e[t]){e[t]=null;var o=document.createElement("link");n.nc&&o.setAttribute("nonce",n.nc),o.rel="prefetch",o.as="script",o.href=n.p+n.u(t),document.head.appendChild(o)}},n.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[i,d,c]=o,a=0;if(i.some((t=>0!==e[t]))){for(r in d)n.o(d,r)&&(n.m[r]=d[r]);if(c)var p=c(n)}for(t&&t(o);a<i.length;a++)s=i[a],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(p)},o=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),n.O(0,[826],(()=>{[840,767,211,513,729,744,662,786,208,515,761,233,824,314,483,317,541,17,528,178,422,725,437,447,760,772,58,453,72,984,806,142,841,789,934,939,56,320,739,101,322].map(n.E)}),5);var i=n(7507);return n.O(i)})()));
1
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.DescopeUI=o():e.DescopeUI=o()}(self,(()=>(()=>{var e,o,t,s={534:(e,o,t)=>{var s={"./descope-button/index.js":[3029,840,767,211,513,729,744,662],"./descope-checkbox/index.js":[7904,840,786,208,767,515,744,761],"./descope-combo-box/index.js":[1294,840,786,208,233,824,314,744,483],"./descope-container/index.js":[147,744,317],"./descope-date-picker/index.js":[2552,840,786,208,233,767,824,211,513,541,744,17],"./descope-divider/index.js":[6446,744,528,178],"./descope-email-field/index.js":[689,840,786,208,233,422,725,437,744,447,760],"./descope-image/index.js":[8116,744,772],"./descope-link/index.js":[8029,744,528,58],"./descope-loader-linear/index.js":[9929,744,453],"./descope-loader-radial/index.js":[7603,744,72],"./descope-logo/index.js":[4641,744,984],"./descope-number-field/index.js":[4951,840,786,208,233,422,806,744,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,744,878,841],"./descope-passcode/index.js":[7102,840,786,208,233,422,725,789,744,447,934,878,841,939],"./descope-password-field/index.js":[1721,840,786,208,233,422,725,767,211,56,744,447,320],"./descope-phone-field/descope-phone-field-internal/index.js":[4772,840,786,208,233,422,725,824,789,314,744,447,934,878,483,646],"./descope-phone-field/index.js":[4840,840,786,208,233,422,725,824,789,314,744,447,934,878,483,646,414],"./descope-switch-toggle/index.js":[3774,840,786,208,767,515,744,739],"./descope-text-area/index.js":[178,840,786,233,422,101,744,322],"./descope-text-field/index.js":[9357,840,786,208,233,422,725,789,744,447,934],"./descope-text/index.js":[1876,744,528]};function n(e){if(!t.o(s,e))return Promise.resolve().then((()=>{var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}));var o=s[e],n=o[0];return Promise.all(o.slice(1).map(t.e)).then((()=>t(n)))}n.keys=()=>Object.keys(s),n.id=534,e.exports=n},5561:(e,o,t)=>{"use strict";t.r(o),t.d(o,{componentsThemeManager:()=>s});const s=new class{static mountOnPropName="DescopeThemeManager";#e={};#o="light";#t=new Set;#s(){this.#t.forEach((e=>e?.()))}get currentThemeName(){return this.#o}set currentThemeName(e){this.#o=e,this.#s()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#t.add(e),()=>{this.#t.delete(e)}}set themes(e){this.#e=e,this.#s()}}},7507:(e,o,t)=>{const{componentsThemeManager:s}=t(5561),n=t(534);e.exports=n.keys().reduce(((e,o)=>(e[o.replace(/.*?([^\/]+)\/index\.js$/,"$1")]=()=>n(o),e)),{}),e.exports.componentsThemeManager=s}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var t=n[e]={exports:{}};return s[e](t,t.exports,r),t.exports}r.m=s,e=[],r.O=(o,t,s,n)=>{if(!t){var i=1/0;for(p=0;p<e.length;p++){for(var[t,s,n]=e[p],d=!0,c=0;c<t.length;c++)(!1&n||i>=n)&&Object.keys(r.O).every((e=>r.O[e](t[c])))?t.splice(c--,1):(d=!1,n<i&&(i=n));if(d){e.splice(p--,1);var a=s();void 0!==a&&(o=a)}}return o}n=n||0;for(var p=e.length;p>0&&e[p-1][2]>n;p--)e[p]=e[p-1];e[p]=[t,s,n]},r.F={},r.E=e=>{Object.keys(r.F).map((o=>{r.F[o](e)}))},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((o,t)=>(r.f[t](e,o),o)),[])),r.u=e=>(({17:"descope-date-picker-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",414:"descope-phone-field-index-js",453:"descope-loader-linear-index-js",483:"descope-combo-box-index-js",528:"descope-text-index-js",646:"descope-phone-field-descope-phone-field-internal-index-js",662:"descope-button-index-js",739:"descope-switch-toggle-index-js",760:"descope-email-field-index-js",761:"descope-checkbox-index-js",772:"descope-image-index-js",841:"descope-passcode-descope-passcode-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),o={},t="DescopeUI:",r.l=(e,s,n,i)=>{if(o[e])o[e].push(s);else{var d,c;if(void 0!==n)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==t+n){d=l;break}}d||(c=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,r.nc&&d.setAttribute("nonce",r.nc),d.setAttribute("data-webpack",t+n),d.src=e),o[e]=[s];var u=(t,s)=>{d.onerror=d.onload=null,clearTimeout(h);var n=o[e];if(delete o[e],d.parentNode&&d.parentNode.removeChild(d),n&&n.forEach((e=>e(s))),t)return t(s)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),c&&document.head.appendChild(d)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var o=r.g.document;if(!e&&o&&(o.currentScript&&(e=o.currentScript.src),!e)){var t=o.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={826:0};r.f.j=(o,t)=>{var s=r.o(e,o)?e[o]:void 0;if(0!==s)if(s)t.push(s[2]);else{var n=new Promise(((t,n)=>s=e[o]=[t,n]));t.push(s[2]=n);var i=r.p+r.u(o),d=new Error;r.l(i,(t=>{if(r.o(e,o)&&(0!==(s=e[o])&&(e[o]=void 0),s)){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;d.message="Loading chunk "+o+" failed.\n("+n+": "+i+")",d.name="ChunkLoadError",d.type=n,d.request=i,s[1](d)}}),"chunk-"+o,o)}},r.F.j=o=>{if(!r.o(e,o)||void 0===e[o]){e[o]=null;var t=document.createElement("link");r.nc&&t.setAttribute("nonce",r.nc),t.rel="prefetch",t.as="script",t.href=r.p+r.u(o),document.head.appendChild(t)}},r.O.j=o=>0===e[o];var o=(o,t)=>{var s,n,[i,d,c]=t,a=0;if(i.some((o=>0!==e[o]))){for(s in d)r.o(d,s)&&(r.m[s]=d[s]);if(c)var p=c(r)}for(o&&o(t);a<i.length;a++)n=i[a],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(p)},t=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];t.forEach(o.bind(null,0)),t.push=o.bind(null,t.push.bind(t))})(),r.O(0,[826],(()=>{[840,767,211,513,729,744,662,786,208,515,761,233,824,314,483,317,541,17,528,178,422,725,437,447,760,772,58,453,72,984,806,142,878,841,789,934,939,56,320,646,414,739,101,322].map(r.E)}),5);var i=r(7507);return r.O(i)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -11,33 +11,11 @@ import {
11
11
 
12
12
  export const componentName = getComponentName('combo-box');
13
13
 
14
- const selectors = {
15
- input: { selector: '::part(input-field)' },
16
- toggle: { selector: '::part(toggle-button)' }
17
- };
18
-
19
- const { input, toggle } = selectors;
20
-
21
- const borderRadius = {
22
- topRightRadius: {
23
- selector: input.selector,
24
- property: 'border-top-right-radius'
25
- },
26
- bottomRightRadius: {
27
- selector: input.selector,
28
- property: 'border-bottom-right-radius'
29
- },
30
- topLeftRadius: {
31
- selector: input.selector,
32
- property: 'border-top-left-radius'
33
- },
34
- bottomLeftRadius: {
35
- selector: input.selector,
36
- property: 'border-bottom-left-radius'
37
- }
38
- };
39
14
 
40
15
  const ComboBoxMixin = (superclass) => class ComboBoxMixinClass extends superclass {
16
+ constructor() {
17
+ super();
18
+ }
41
19
 
42
20
  // vaadin api is to set props on their combo box node,
43
21
  // in order to avoid it, we are passing the children of this component
@@ -47,15 +25,22 @@ const ComboBoxMixin = (superclass) => class ComboBoxMixinClass extends superclas
47
25
  const items = Array.from(this.children)
48
26
 
49
27
  // we want the data-name attribute to be accessible as an object attribute
50
- baseElement.items = items.map((node) =>
51
- Object.defineProperty(node, 'data-name', {
52
- value: node.getAttribute('data-name')
53
- })
54
- );
55
-
56
- baseElement.renderer = (root, combo, model) => {
57
- root.innerHTML = items[model.index].outerHTML;
58
- };
28
+ if (items.length) {
29
+ items.forEach((node) => {
30
+ Object.defineProperty(node, 'data-name', {
31
+ value: node.getAttribute('data-name'),
32
+ })
33
+ Object.defineProperty(node, 'data-id', {
34
+ value: node.getAttribute('data-id')
35
+ })
36
+ });
37
+
38
+ baseElement.items = items;
39
+
40
+ baseElement.renderer = (root, combo, model) => {
41
+ root.innerHTML = model.item.outerHTML;
42
+ };
43
+ }
59
44
  }
60
45
 
61
46
  // the default vaadin behavior is to attach the overlay to the body when opened
@@ -69,29 +54,57 @@ const ComboBoxMixin = (superclass) => class ComboBoxMixinClass extends superclas
69
54
  overlay._enterModalState = function () { }
70
55
  }
71
56
 
72
- init() {
73
- super.init?.()
57
+ connectedCallback() {
58
+ super.connectedCallback?.()
74
59
 
75
60
  this.#overrideOverlaySettings();
76
61
  observeChildren(this, this.#onChildrenChange.bind(this));
77
62
  }
78
63
  }
79
64
 
65
+ const { host, input, placeholder, toggle } = {
66
+ host: { selector: () => ':host' },
67
+ input: { selector: '::part(input-field)' },
68
+ placeholder: { selector: '> input:placeholder-shown' },
69
+ toggle: { selector: '::part(toggle-button)' }
70
+ }
71
+
72
+ // const { slotted, selected } = {
73
+ // slotted: { selector: () => '::slotted(*)' },
74
+ // selected: { selector: () => '::slotted([selected])' }
75
+ // }
76
+
80
77
  const ComboBox = compose(
81
78
  createStyleMixin({
82
79
  mappings: {
83
- ...borderRadius,
84
- backgroundColor: input,
85
- width: input,
86
- color: input,
80
+ width: host,
81
+ height: input,
87
82
  padding: input,
83
+
84
+ backgroundColor: input,
85
+ boxShadow: input,
86
+
88
87
  borderColor: input,
89
- borderStyle: input,
90
88
  borderWidth: input,
91
- cursor: toggle,
92
- height: input,
93
- // overlayBackground: { property: () => ComboBox.cssVarList.overlay.backgroundColor },
94
- // overlayBorder: { property: () => ComboBox.cssVarList.overlay.border }
89
+ borderStyle: input,
90
+ borderRadius: input,
91
+
92
+ color: input,
93
+
94
+ // we apply font-size also on the host so we can set its width with em
95
+ fontSize: [{}, host],
96
+
97
+ placeholderColor: { ...placeholder, property: 'color' },
98
+
99
+ toggleCursor: { ...toggle, property: 'cursor' },
100
+ toggleColor: { ...toggle, property: 'color' },
101
+
102
+ // we need to use the variables from the portal mixin
103
+ // so we need to use an arrow function on the selector
104
+ // for that to work, because ComboBox is not available
105
+ // at this time.
106
+ overlayBackground: { property: () => ComboBox.cssVarList.overlay.backgroundColor },
107
+ overlayBorder: { property: () => ComboBox.cssVarList.overlay.border }
95
108
  }
96
109
  }),
97
110
  draggableMixin,
@@ -99,9 +112,14 @@ const ComboBox = compose(
99
112
  name: 'overlay',
100
113
  selector: '',
101
114
  mappings: {
102
- // border: { selector: 'vaadin-combo-box-scroller' },
103
- // backgroundColor: { selector: 'vaadin-combo-box-item' },
104
- }
115
+ backgroundColor: { selector: 'vaadin-combo-box-scroller' },
116
+ // TODO: this mapping doesn't work, needs fixing.
117
+ cursor: { selector: 'vaadin-combo-box-item' },
118
+ },
119
+ forward: {
120
+ include: false,
121
+ attributes: ['size']
122
+ },
105
123
  }),
106
124
  proxyInputMixin,
107
125
  componentNameValidationMixin,
@@ -112,11 +130,28 @@ const ComboBox = compose(
112
130
  wrappedEleName: 'vaadin-combo-box',
113
131
  style: () => `
114
132
  :host {
133
+ display: inline-flex;
134
+ box-sizing: border-box;
135
+ -webkit-mask-image: none;
136
+ }
137
+ vaadin-combo-box {
138
+ padding: 0;
139
+ }
140
+ vaadin-combo-box [slot="input"] {
141
+ -webkit-mask-image: none;
142
+ min-height: 0;
143
+ }
144
+ vaadin-combo-box::part(input-field) {
115
145
  -webkit-mask-image: none;
146
+ border-radius: 0;
147
+ padding: 0;
116
148
  }
117
149
  `,
118
- excludeAttrsSync: ['tabindex'],
119
- includeAttrsSync: [],
150
+ // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property
151
+ // with the same name. Including it will cause Vaadin to calculate NaN size,
152
+ // and reset items to an empty array, and opening the list box with no items
153
+ // to display.
154
+ excludeAttrsSync: ['tabindex', 'size'],
120
155
  componentName,
121
156
  includeForwardProps: ['items', 'renderer']
122
157
  })
@@ -14,7 +14,7 @@ import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
14
14
  export const componentName = getComponentName('passcode');
15
15
 
16
16
  const customMixin = (superclass) =>
17
- class DraggableMixinClass extends superclass {
17
+ class PasscodeClass extends superclass {
18
18
  constructor() {
19
19
  super();
20
20
  }
@@ -40,18 +40,19 @@ const customMixin = (superclass) =>
40
40
 
41
41
  this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
42
42
 
43
- forwardAttrs(this.shadowRoot.host, this.inputElement, { includeAttrs: ['required', 'pattern'] })
44
-
43
+ forwardAttrs(this, this.inputElement, { includeAttrs: ['digits', 'size'] })
45
44
  }
46
45
  };
47
46
 
48
47
  const { borderStyle, borderWidth, ...restTextFieldMappings } =
49
48
  textFieldMappings;
50
49
 
51
- const { digitField, label, requiredIndicator } = {
50
+ const { digitField, label, requiredIndicator, internalWrapper, focusedValidDigitField } = {
51
+ focusedValidDigitField: { selector: () => `${TextField.componentName}[focused="true"]:not([invalid="true"])` },
52
52
  digitField: { selector: () => TextField.componentName },
53
53
  label: { selector: '> label' },
54
- requiredIndicator: { selector: '[required]::part(required-indicator)::after' }
54
+ requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
55
+ internalWrapper: { selector: 'descope-passcode-internal .wrapper' }
55
56
  }
56
57
 
57
58
  const textVars = TextField.cssVarList
@@ -61,7 +62,20 @@ const Passcode = compose(
61
62
  mappings: {
62
63
  ...restTextFieldMappings,
63
64
  borderColor: { ...digitField, property: textVars.borderColor },
65
+ outlineColor: { ...digitField, property: textVars.outlineColor },
66
+ outlineWidth: [
67
+ { ...digitField, property: textVars.outlineWidth },
68
+ // we want to leave enough space to the digits outline,
69
+ // ideally, this would be part of the text field
70
+ { ...internalWrapper, property: 'padding' }
71
+ ],
64
72
  color: [restTextFieldMappings.color, label, requiredIndicator],
73
+ padding: { ...digitField, property: textVars.padding },
74
+ margin: { ...digitField, property: textVars.margin },
75
+ textAlign: { ...digitField, property: textVars.textAlign },
76
+ caretColor: { ...digitField, property: textVars.caretColor },
77
+ digitsGap: { ...internalWrapper, property: 'gap' },
78
+ focusedValidDigitFieldBorderColor: { ...focusedValidDigitField, property: textVars.borderColor }
65
79
  },
66
80
  }),
67
81
  draggableMixin,
@@ -80,30 +94,47 @@ const Passcode = compose(
80
94
 
81
95
  descope-passcode-internal {
82
96
  -webkit-mask-image: none;
83
- display: flex;
84
- gap: 2px;
85
- align-items: center;
86
97
  padding: 0;
98
+ width: 100%;
99
+ height: 100%;
100
+ min-height: initial;
101
+ }
102
+
103
+ descope-passcode-internal .wrapper {
104
+ box-sizing: border-box;
105
+ min-height: initial;
106
+ height: 100%;
87
107
  }
108
+
109
+ descope-passcode-internal descope-text-field {
110
+ width: var(${textVars.height})
111
+ }
112
+
88
113
  vaadin-text-field::part(input-field) {
89
114
  background-color: transparent;
90
115
  padding: 0;
91
116
  overflow: hidden;
117
+ -webkit-mask-image: none;
92
118
  }
119
+
93
120
  vaadin-text-field {
94
121
  margin: 0;
95
122
  padding: 0;
123
+ width: 100%
124
+ }
125
+
126
+ vaadin-text-field::before {
127
+ height: initial;
96
128
  }
129
+
97
130
  vaadin-text-field[readonly] > input:placeholder-shown {
98
131
  opacity: 1;
99
132
  }
100
- vaadin-text-field > label,
101
- vaadin-text-field::part(input-field) {
102
- cursor: pointer;
103
- }
133
+
104
134
  vaadin-text-field::part(input-field):focus {
105
135
  cursor: text;
106
136
  }
137
+
107
138
  vaadin-text-field[required]::part(required-indicator)::after {
108
139
  font-size: "12px";
109
140
  content: "*";