@descope/web-components-ui 1.0.100 → 1.0.102

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/dist/index.esm.js +124 -63
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/umd/0.js +1 -1
  4. package/dist/umd/890.js +1 -1
  5. package/dist/umd/descope-combo-box-index-js.js +1 -1
  6. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  7. package/dist/umd/descope-new-password-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 -1
  10. package/dist/umd/descope-phone-field-index-js.js +1 -1
  11. package/dist/umd/descope-text-field-index-js.js +1 -1
  12. package/package.json +1 -1
  13. package/src/components/descope-combo-box/ComboBox.js +17 -2
  14. package/src/components/descope-new-password/NewPassword.js +2 -1
  15. package/src/components/descope-new-password/index.js +2 -0
  16. package/src/components/descope-passcode/index.js +2 -0
  17. package/src/components/descope-password-field/PasswordField.js +3 -0
  18. package/src/components/descope-phone-field/PhoneField.js +20 -1
  19. package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +1 -0
  20. package/src/components/descope-text-field/TextField.js +1 -1
  21. package/src/index.js +20 -20
  22. package/src/mixins/createStyleMixin/index.js +4 -1
  23. package/src/mixins/normalizeBooleanAttributesMixin.js +29 -4
  24. package/src/theme/components/comboBox.js +6 -0
  25. package/src/theme/components/passwordField.js +1 -1
  26. package/src/theme/components/phoneField.js +12 -6
  27. package/src/theme/components/text.js +0 -2
  28. package/src/theme/components/textArea.js +5 -1
package/dist/umd/0.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[0],{693:(t,e,s)=>{s.d(e,{s:()=>o});var i=s(2061),n=s(357);const r=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})}))}};var a=s(8084);const o=({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.A,r,a.Q)(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:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,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)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,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})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#s(){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.#s()}}},1e3:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>A.A,DM:()=>p,yk:()=>c,e4:()=>u,mE:()=>L,wX:()=>b,QT:()=>C.Q,Iw:()=>S,dj:()=>f});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})}}#i;#n;#r;#a;#o;#l;#h;#c;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#a=s,this.#o=r,this.#l=e?.(this)||this.shadowRoot,this.#h=a??this.baseSelector,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t))),this.#u(),this.#d(),this.#m()}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#p(){this.#n.innerHTML=this.componentTheme[this.#o]}#d(){this.#n=document.createElement("style"),this.#n.id="style-mixin-theme",this.#l.prepend(this.#n),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#p.bind(this)),this.#p()}#m(){this.#i=document.createElement("style"),this.#i.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#i.innerText=`:host(${t}) {}`,this.#l.append(this.#i)}#g(t,s){const i=this.#i?.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)}#b(t=[]){for(const e of t)this.#c.includes(e)&&this.#g(e,this.getAttribute(e));this.#i.innerHTML=this.#i?.sheet?.cssRules[0].cssText}#u(){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.#a),this.#h,t),this.#l.prepend(s)}#E(t){(this.#l.classList||this.#l.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#E(e.componentName),(0,r.FX)(this,this.#b.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},u=t=>class extends t{#v=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#v=document.createElement("style"),this.#v.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#v):this.#v.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(693),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})){#f=m.C.bind(this,"blur");#A=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:!0}).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`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#f()})),this.baseElement.addEventListener("focus",(t=>{this.#A()})),(0,r.Db)(this.baseElement,this,l),(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}#S;constructor(){super(),this.#S=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""}}#M(){const t=this.isReadOnly?{}:this.getValidity();this.#S.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#S.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#S.validity.valid}reportValidity(){return this.#S.reportValidity()}get validity(){return this.#S.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#S.setValidity({customError:!0},t,this.validationTarget):(this.#S.setValidity({}),this.#M())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#S.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#M()}init(){super.init?.(),this.addEventListener("change",this.#M),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#M),setTimeout((()=>this.#M()))}},E=["invalid","required"],v=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},y=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;#L=m.C.bind(this,"change");constructor(){super(),this.#C=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#C&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#C??=y(t)||y(e),this.#C}set inputElement(t){this.#C=t}getValidity(){return this.inputElement?.validity||{}}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.#L()})),this.#C.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#T())})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#T()})),this.handleInternalInputErrorMessage(),v(this,this.inputElement,"value"),v(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}};var A=s(357);const S=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=c({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:h((0,n.E3)(l.componentName,"_"+u),s)}}#x;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:"_"+u,themeSection:i.qM+u,baseSelector:":host"}),this.#x=(s=t(this)).host||s}#N(){this.#x.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#x.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#x,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#N()}}},M=t=>class extends t{#L=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.#L(),this.prevValue=this.value)}))}};var C=s(8084);const L=t=>class extends t{init(){this.#w(),super.init?.()}#w(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,m.C.call(this,"blur"),m.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(m.C.call(this,"focus"),m.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>n});var i=s(4567);const n=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t)}))),{})}}}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[0],{693:(t,e,s)=>{s.d(e,{s:()=>o});var i=s(2061),n=s(357);const r=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})}))}};var a=s(8084);const o=({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.A,r,a.Q)(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:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,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)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,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})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#s(){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.#s()}}},1e3:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>A.A,DM:()=>p,yk:()=>c,e4:()=>u,mE:()=>L,wX:()=>b,QT:()=>C.Q,Iw:()=>S,dj:()=>f});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})}}#i;#n;#r;#a;#o;#l;#h;#c;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#a=s,this.#o=r,this.#l=e?.(this)||this.shadowRoot,this.#h=a??this.baseSelector,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t))),this.#u(),this.#d(),this.#m()}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#p(){this.#n.innerHTML=this.componentTheme[this.#o]}#d(){this.#n=document.createElement("style"),this.#n.id="style-mixin-theme",this.#l.prepend(this.#n),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#p.bind(this)),this.#p()}#m(){this.#i=document.createElement("style"),this.#i.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#i.innerText=`:host(${t}) {}`,this.#l.append(this.#i)}#g(t,s){const i=this.#i?.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),this.removeAttribute(t))}#b(t=[]){for(const e of t)this.#c.includes(e)&&this.#g(e,this.getAttribute(e));this.#i.innerHTML=this.#i?.sheet?.cssRules[0].cssText}#u(){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.#a),this.#h,t),this.#l.prepend(s)}#E(t){(this.#l.classList||this.#l.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#E(e.componentName),(0,r.FX)(this,this.#b.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},u=t=>class extends t{#v=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#v=document.createElement("style"),this.#v.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#v):this.#v.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(693),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})){#f=m.C.bind(this,"blur");#A=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:!0}).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`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#f()})),this.baseElement.addEventListener("focus",(t=>{this.#A()})),(0,r.Db)(this.baseElement,this,l),(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}#S;constructor(){super(),this.#S=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""}}#M(){const t=this.isReadOnly?{}:this.getValidity();this.#S.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#S.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#S.validity.valid}reportValidity(){return this.#S.reportValidity()}get validity(){return this.#S.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#S.setValidity({customError:!0},t,this.validationTarget):(this.#S.setValidity({}),this.#M())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#S.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#M()}init(){super.init?.(),this.addEventListener("change",this.#M),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#M),setTimeout((()=>this.#M()))}},E=["invalid","required"],v=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},y=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;#L=m.C.bind(this,"change");constructor(){super(),this.#C=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#C&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#C??=y(t)||y(e),this.#C}set inputElement(t){this.#C=t}getValidity(){return this.inputElement?.validity||{}}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.#L()})),this.#C.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#T())})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#T()})),this.handleInternalInputErrorMessage(),v(this,this.inputElement,"value"),v(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}};var A=s(357);const S=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=c({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:h((0,n.E3)(l.componentName,"_"+u),s)}}#x;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:"_"+u,themeSection:i.qM+u,baseSelector:":host"}),this.#x=(s=t(this)).host||s}#w(){this.#x.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#x.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#x,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#w()}}},M=t=>class extends t{#L=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.#L(),this.prevValue=this.value)}))}};var C=s(8084);const L=t=>class extends t{init(){this.#N(),super.init?.()}#N(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,m.C.call(this,"blur"),m.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(m.C.call(this,"focus"),m.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>r});var i=s(4567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active"],r=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.warn(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}}}]);
package/dist/umd/890.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[890],{7890:(t,e,r)=>{r.d(e,{f:()=>i,Z:()=>y});var o=r(1e3),n=r(2061);const i=(0,r(4567).iY)("password-field"),{host:a,inputWrapper:p,inputElement:d,inputElementPlaceholder:l,revealButton:s,revealButtonIcon:u,label:c,requiredIndicator:h}={host:()=>":host",inputWrapper:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:"> input:placeholder-shown"},revealButton:{selector:"vaadin-password-field-button"},revealButtonIcon:{selector:()=>"::part(reveal-button)::before"},label:{selector:"> label"},requiredIndicator:{selector:"::part(required-indicator)::after"}},y=(0,n.qC)((0,o.yk)({mappings:{width:{selector:a},wrapperBorderStyle:{...p,property:"border-style"},wrapperBorderWidth:{...p,property:"border-width"},wrapperBorderColor:{...p,property:"border-color"},wrapperBorderRadius:{...p,property:"border-radius"},labelTextColor:[{...c,property:"color"},{...h,property:"color"}],inputTextColor:[{...d,property:"color"},{...u,property:"color"}],placeholderTextColor:{...l,property:"color"},fontSize:[{},a],height:p,padding:p,pointerCursor:[{...s,property:"cursor"},{...c,property:"cursor"},{...h,property:"cursor"}],outlineColor:{...p},outlineStyle:{...p},outlineWidth:[{...p},{property:"padding"}],backgroundColor:p}}),o.e4,o.dj,o.Ae,(t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable&this.isReadOnly){const e=this.baseElement.querySelector("input"),r=e.getAttribute("type");e.setAttribute("type","text");const o=()=>{e.setAttribute("type",r),t.target.removeEventListener("mouseup",o),t.target.removeEventListener("dragend",o)};t.target.addEventListener("mouseup",o,{once:!0}),t.target.addEventListener("dragend",o,{once:!0})}})),super.init?.()}}))((0,o.DM)({slots:["suffix"],wrappedEleName:"vaadin-password-field",style:'\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\n\t\t\tvaadin-password-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\t\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\n\t\t\tvaadin-password-field[required]::part(required-indicator)::after {\n\t\t\t\tcontent: "*";\n\t\t\t}\n\t\t',excludeAttrsSync:["tabindex"],componentName:i}))}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[890],{7890:(t,e,r)=>{r.d(e,{f:()=>i,Z:()=>y});var o=r(1e3),n=r(2061);const i=(0,r(4567).iY)("password-field"),{host:a,inputWrapper:p,inputElement:d,inputElementPlaceholder:l,revealButton:s,revealButtonIcon:u,label:c,requiredIndicator:h}={host:()=>":host",inputWrapper:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:"> input:placeholder-shown"},revealButton:{selector:"vaadin-password-field-button"},revealButtonIcon:{selector:()=>"::part(reveal-button)::before"},label:{selector:"> label"},requiredIndicator:{selector:"::part(required-indicator)::after"}},y=(0,n.qC)((0,o.yk)({mappings:{width:{selector:a},wrapperBorderStyle:{...p,property:"border-style"},wrapperBorderWidth:{...p,property:"border-width"},wrapperBorderColor:{...p,property:"border-color"},wrapperBorderRadius:{...p,property:"border-radius"},labelTextColor:[{...c,property:"color"},{...h,property:"color"}],inputTextColor:[{...d,property:"color"},{...u,property:"color"}],placeholderTextColor:{...l,property:"color"},fontSize:[{},a],height:p,padding:p,pointerCursor:[{...s,property:"cursor"},{...c,property:"cursor"},{...h,property:"cursor"}],outlineColor:{...p},outlineStyle:{...p},outlineWidth:[{...p},{property:"padding"}],backgroundColor:p}}),o.e4,o.dj,o.Ae,(t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable&this.isReadOnly){const e=this.baseElement.querySelector("input"),r=e.getAttribute("type");e.setAttribute("type","text");const o=()=>{e.setAttribute("type",r),t.target.removeEventListener("mouseup",o),t.target.removeEventListener("dragend",o)};t.target.addEventListener("mouseup",o,{once:!0}),t.target.addEventListener("dragend",o,{once:!0})}})),super.init?.()}}))((0,o.DM)({slots:["suffix"],wrappedEleName:"vaadin-password-field",style:'\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\n\t\t\tvaadin-password-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\t\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\n\t\t\tvaadin-password-field[required]::part(required-indicator)::after {\n\t\t\t\tcontent: "*";\n\t\t\t}\n\t\t',excludeAttrsSync:["tabindex"],componentName:i}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[4],{3352:(e,t,o)=>{o.d(t,{Z:()=>h,f:()=>i});var r=o(2061),n=o(4567),a=o(1e3);const i=(0,n.iY)("combo-box"),{host:l,input:s,placeholder:d,toggle:c,label:b}={host:{selector:()=>":host"},input:{selector:"::part(input-field)"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},label:{selector:"::part(label)"}},p=(0,r.qC)((0,a.yk)({mappings:{width:l,height:s,padding:s,backgroundColor:s,boxShadow:s,borderColor:s,borderWidth:s,borderStyle:s,borderRadius:s,color:[b,s],fontSize:[{},l],placeholderColor:{...d,property:"color"},toggleCursor:{...c,property:"cursor"},toggleColor:{...c,property:"color"},overlayBackground:{property:()=>p.cssVarList.overlay.backgroundColor},overlayBorder:{property:()=>p.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(){}}init(){super.init?.(),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"]})),h=p},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
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[4],{3352:(t,e,o)=>{o.d(e,{Z:()=>u,f:()=>i});var r=o(2061),n=o(4567),a=o(1e3);const i=(0,n.iY)("combo-box"),{host:l,input:d,placeholder:s,toggle:c,label:p}={host:{selector:()=>":host"},input:{selector:"::part(input-field)"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},label:{selector:"::part(label)"}},b=(0,r.qC)((0,a.yk)({mappings:{width:l,height:d,padding:d,inputBackgroundColor:{...d,property:"background-color"},boxShadow:d,borderColor:d,borderWidth:d,borderStyle:d,borderRadius:d,color:[p,d],fontSize:[{},l],placeholderColor:{...s,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,(t=>class extends t{constructor(){super()}#t(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name")}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id")})})),t.items=e,t.renderer=(t,e,o)=>{t.innerHTML=o.item.outerHTML})}#e(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=function(){this.bringToFront()},t._detachOverlay=function(){},t._enterModalState=function(){}}init(){super.init?.(),this.#e(),(0,n.P$)(this,this.#t.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\tvaadin-combo-box::part(input-field)::after {\n\t\t\topacity: 0;\n\t\t}\n\t\tvaadin-combo-box[readonly]::part(input-field)::after {\n\t\t\tborder: none;\n\t\t}\n\t\tvaadin-combo-box[readonly] > input:placeholder-shown {\n\t\t\topacity: 1;\n\t\t}\t\t\n\t\t',excludeAttrsSync:["tabindex","size"],componentName:i,includeForwardProps:["items","renderer"]})),u=b},1294:(t,e,o)=>{o.r(e),o.d(e,{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([[842],{7194:(t,e,n)=>{n.d(e,{Z:()=>c,f:()=>d});var i=n(4567),s=n(2061),r=n(1e3),a=n(5857),o=n(7890);const d=(0,i.iY)("new-password"),{host:l,internalInputsWrapper:p}={host:{selector:()=>":host"},internalInputsWrapper:{selector:"descope-new-password-internal .wrapper"}},h=(0,s.qC)((0,r.yk)({mappings:{componentWidth:{...l,property:"width"},requiredContent:{...l,property:"content"},inputLabelTextColor:{selector:o.Z.componentName,property:o.Z.cssVarList.labelTextColor},inputTextColor:{selector:o.Z.componentName,property:o.Z.cssVarList.inputTextColor},inputsGap:{...p,property:"gap"}}}),r.e4,r.dj,(t=>class extends t{constructor(){super()}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${a.f} \n\t\t\t\tname="new-password" \n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${a.f}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(a.f),(0,i.oP)(this,this.inputElement,{includeAttrs:["password-label","password-placeholder","confirm-label","confirm-placeholder","full-width","size","bordered","label","has-confirm","invalid"]})}}))((0,r.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>u,excludeAttrsSync:["tabindex"],componentName:d})),u="\n\t:host {\n\t\t--vaadin-field-default-width: auto;\n\t\tdisplay: inline-block;\n\t}\n\tvaadin-text-field {\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\tvaadin-text-field::part(input-field) {\n\t\tmin-height: 0;\n\t\tbackground: transparent;\n\t\toverflow: hidden;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-text-field::part(input-field)::after {\n\t\tbackground: transparent;\n\t\topacity: 0;\n\t}\n\tdescope-new-password-internal {\n\t\t-webkit-mask-image: none;\n\t\tpadding: 0;\n\t\tmin-height: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\t\t\n\t}\n\tdescope-new-password-internal > .wrapper {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tdisplay: flex;\n flex-direction: column;\n\t}\n\tdescope-password-field {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t}\n\tdescope-new-password-internal vaadin-password-field::before {\n\t\theight: initial;\n\t}\n",c=h},5857:(t,e,n)=>{n.d(e,{f:()=>i});const i=(0,n(4567).iY)("new-password-internal")},1545:(t,e,n)=>{n.r(e);var i=n(3878),s=n(4567),r=n(7194),a=n(5857);const o=/^password-/,d=/^confirm-/,l=(t,e)=>t.replace(e,""),p=["password-label","password-placeholder"],h=["confirm-label","confirm-placeholder"],u=["disabled","bordered","size","full-width","maxlength","invalid"],c=[].concat(u,p,h),f=(0,i.P)({componentName:a.f,baseSelector:"div"});customElements.define(a.f,class extends f{static get observedAttributes(){return["has-confirm"].concat(f.observedAttributes||[],c)}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper"></div>\n\t\t',this.wrapperEle=this.querySelector(".wrapper")}get value(){return this.passwordInput?.value||""}set value(t){t!==this.value&&(this.value=t)}get hasConfirm(){return"true"===this.getAttribute("has-confirm")}getValidity(){if(this.isRequired&&!this.value)return{valueMissing:!0};if(this.hasConfirm&&this.confirmInput&&this.value!==this.confirmInput.value)return{patternMismatch:!0};const t=this.getAttribute("minlength"),e=parseInt(t,10)||0;return this.value.length>=e?{}:{tooShort:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.passwordInput.focus()})),super.init(),this.renderInputs(this.hasConfirm)}renderInputs(t){let e='<descope-password-field data-id="password"></descope-password-field>';t&&(e+='<descope-password-field data-id="confirm"></descope-password-field>'),this.wrapperEle.innerHTML=e,this.passwordInput=this.querySelector('[data-id="password"]'),this.confirmInput=this.querySelector('[data-id="confirm"]'),this.inputs=[this.passwordInput,this.confirmInput],this.initInputs(),[...p,...h,...u].forEach((t=>{this.attributeChangedCallback(t,null,this.getAttribute(t))}))}handleIndicatorStyle(){for(const t of this.inputs){const e=document.createElement("style");e.innerHTML=`\n\t\t\t\t:host::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${r.Z.cssVarList.requiredContent});\n\t\t\t\t}\n\t\t\t\t`,t?.shadowRoot.appendChild(e)}}get isInvalid(){return this.hasAttribute("invalid")&&"false"!==this.getAttribute("invalid")}handleInputsInvalidAttribute(){this.inputs.forEach((t=>{t&&(0,s.FX)(t,(e=>{if(e.includes("invalid")){const e=t.getAttribute("invalid"),n=this.getAttribute("invalid");this.isInvalid&&n!==e&&t.setAttribute("invalid","true")}}),{})}))}initInputs(){this.handleIndicatorStyle(),this.handleInputsInvalidAttribute(),this.handleFocusEventsDispatching(this.inputs)}toggleBooleanAttribute(t,e,n){null===n?t?.removeAttribute(e):t?.setAttribute(e,n)}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&("has-confirm"===t?this.renderInputs(null!==n&&"false"!==n):u.includes(t)?this.inputs.forEach((e=>this.toggleBooleanAttribute(e,t,n))):p.includes(t)?this.toggleBooleanAttribute(this.passwordInput,l(t,o),n):h.includes(t)&&this.toggleBooleanAttribute(this.confirmInput,l(t,d),n))}})}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[842],{7194:(t,e,n)=>{n.d(e,{Z:()=>c,f:()=>d});var i=n(4567),s=n(2061),r=n(1e3),a=n(5857),o=n(7890);const d=(0,i.iY)("new-password"),{host:l,internalInputsWrapper:p}={host:{selector:()=>":host"},internalInputsWrapper:{selector:"descope-new-password-internal .wrapper"}},h=(0,s.qC)((0,r.yk)({mappings:{componentWidth:{...l,property:"width"},requiredContent:{...l,property:"content"},inputLabelTextColor:{selector:o.Z.componentName,property:o.Z.cssVarList.labelTextColor},inputTextColor:{selector:o.Z.componentName,property:o.Z.cssVarList.inputTextColor},inputsGap:{...p,property:"gap"}}}),r.e4,r.dj,(t=>class extends t{constructor(){super()}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${a.f} \n\t\t\t\tname="new-password" \n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${a.f}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(a.f),(0,i.oP)(this,this.inputElement,{includeAttrs:["password-label","password-placeholder","confirm-label","confirm-placeholder","full-width","size","bordered","label","has-confirm","invalid"]})}}))((0,r.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>u,excludeAttrsSync:["tabindex"],componentName:d})),u="\n\t:host {\n\t\t--vaadin-field-default-width: auto;\n\t\tdisplay: inline-block;\n\t}\n\tvaadin-text-field {\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\tvaadin-text-field::part(input-field) {\n\t\tmin-height: 0;\n\t\tbackground: transparent;\n\t\toverflow: hidden;\n\t\tbox-shadow: none;\n\t\tpadding: 0;\n\t}\n\tvaadin-text-field::part(input-field)::after {\n\t\tbackground: transparent;\n\t\topacity: 0;\n\t}\n\tdescope-new-password-internal {\n\t\t-webkit-mask-image: none;\n\t\tpadding: 0;\n\t\tmin-height: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\t\t\n\t}\n\tdescope-new-password-internal > .wrapper {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tdisplay: flex;\n flex-direction: column;\n\t}\n\tdescope-password-field {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t}\n\tdescope-new-password-internal vaadin-password-field::before {\n\t\theight: initial;\n\t}\n",c=h},5857:(t,e,n)=>{n.d(e,{f:()=>i});const i=(0,n(4567).iY)("new-password-internal")},1545:(t,e,n)=>{n.r(e);var i=n(3878),s=n(4567),r=n(7194),a=n(5857);const o=/^password-/,d=/^confirm-/,l=(t,e)=>t.replace(e,""),p=["password-label","password-placeholder"],h=["confirm-label","confirm-placeholder"],u=["disabled","bordered","size","full-width","maxlength","invalid"],c=[].concat(u,p,h),f=(0,i.P)({componentName:a.f,baseSelector:"div"});customElements.define(a.f,class extends f{static get observedAttributes(){return["has-confirm"].concat(f.observedAttributes||[],c)}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper"></div>\n\t\t',this.wrapperEle=this.querySelector(".wrapper")}get value(){return this.passwordInput?.value||""}set value(t){t!==this.value&&(this.value=t)}get hasConfirm(){return"true"===this.getAttribute("has-confirm")}getValidity(){if(this.isRequired&&!this.value)return{valueMissing:!0};if(this.hasConfirm&&this.confirmInput&&this.value!==this.confirmInput.value)return{patternMismatch:!0};const t=this.getAttribute("minlength"),e=parseInt(t,10)||0;return this.value.length>=e?{}:{tooShort:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.passwordInput.focus()})),super.init(),this.renderInputs(this.hasConfirm)}renderInputs(t){let e='<descope-password-field data-id="password"></descope-password-field>';t&&(e+='<descope-password-field data-id="confirm"></descope-password-field>'),this.wrapperEle.innerHTML=e,this.passwordInput=this.querySelector('[data-id="password"]'),this.confirmInput=this.querySelector('[data-id="confirm"]'),this.inputs=[this.passwordInput,this.confirmInput],this.initInputs(),[...p,...h,...u].forEach((t=>{this.attributeChangedCallback(t,null,this.getAttribute(t))}))}handleIndicatorStyle(){for(const t of this.inputs){const e=document.createElement("style");e.innerHTML=`\n\t\t\t\t:host::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${r.Z.cssVarList.requiredContent});\n\t\t\t\t}\n\t\t\t\t`,t?.shadowRoot.appendChild(e)}}get isInvalid(){return this.hasAttribute("invalid")&&"false"!==this.getAttribute("invalid")}handleInputsInvalidAttribute(){this.inputs.forEach((t=>{t&&(0,s.FX)(t,(e=>{if(e.includes("invalid")){const e=t.getAttribute("invalid"),n=this.getAttribute("invalid");this.isInvalid&&n!==e&&t.setAttribute("invalid","true")}}),{})}))}initInputs(){this.handleIndicatorStyle(),this.handleInputsInvalidAttribute(),this.handleFocusEventsDispatching(this.inputs)}toggleBooleanAttribute(t,e,n){null===n?t?.removeAttribute(e):t?.setAttribute(e,n)}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&("has-confirm"===t?this.renderInputs(null!==n&&"false"!==n):u.includes(t)?this.inputs.forEach((e=>this.toggleBooleanAttribute(e,t,n))):p.includes(t)?this.toggleBooleanAttribute(this.passwordInput,l(t,o),n):h.includes(t)&&this.toggleBooleanAttribute(this.confirmInput,l(t,d),n))}})}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[55],{8974:(e,s,c)=>{c.r(s);var p=c(7194);c(9357),c(5702),c(1545),customElements.define(p.f,p.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[55],{8974:(e,s,c)=>{c.r(s),c.d(s,{NewPassword:()=>p.Z});var p=c(7194);c(9357),c(5702),c(1545),customElements.define(p.f,p.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[939],{7102:(t,e,n)=>{n.r(e);var r=n(1e3),i=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}=i.Z,{digitField:g,label:h,requiredIndicator:f,internalWrapper:b,focusedDigitField:m}={focusedDigitField:{selector:()=>`${d.Z.componentName}[focused="true"]`},digitField:{selector:()=>d.Z.componentName},label:{selector:"> label"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:"descope-passcode-internal .wrapper"}},y=d.Z.cssVarList,x=(0,a.qC)((0,r.yk)({mappings:{...u,borderColor:{...g,property:y.borderColor},outlineColor:{...g,property:y.outlineColor},outlineWidth:[{...g,property:y.outlineWidth},{...b,property:"padding"}],color:[u.color,h,f],padding:{...g,property:y.padding},margin:{...g,property:y.margin},textAlign:{...g,property:y.textAlign},caretColor:{...g,property:y.caretColor},digitsGap:{...b,property:"gap"},focusedDigitFieldBorderColor:[{...m,property:y.borderColor},{...m,property:y.outlineColor}]}}),r.e4,r.dj,r.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,r.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n --vaadin-field-default-width: auto;\n\t\t\tdisplay: inline-block;\n }\n\t:host::after {\n\t\tbackground-color: transparent;\n\t}\n\t:host::part(input-field)::after {\n\t\tbackground-color: transparent;\n\t}\n\n descope-passcode-internal {\n\t\t-webkit-mask-image: none;\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmin-height: initial;\n }\n\n\tdescope-passcode-internal .wrapper {\n\t\tbox-sizing: border-box;\n\t\tmin-height: initial;\n\t\theight: 100%;\n\t\tjustify-content: center;\n }\n\n\tdescope-passcode-internal descope-text-field {\n\t\twidth: var(${y.height})\t\t\t\n\t}\n\n vaadin-text-field::part(input-field) {\n\t\tbackground-color: transparent;\n\t\tpadding: 0;\n\t\toverflow: hidden;\n\t\t-webkit-mask-image: none;\n }\n\n\tvaadin-text-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%\n\t}\n\n\tvaadin-text-field::before {\n\t\theight: 0;\n\t}\n\n\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\n\tvaadin-text-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\n\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\tcontent: "*";\n\t}\n\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n `,excludeAttrsSync:["tabindex"],componentName:p}));n(9357),n(4775),customElements.define(p,x)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[939],{7102:(t,e,n)=>{n.r(e),n.d(e,{Passcode:()=>x});var r=n(1e3),i=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}=i.Z,{digitField:g,label:h,requiredIndicator:f,internalWrapper:b,focusedDigitField:m}={focusedDigitField:{selector:()=>`${d.Z.componentName}[focused="true"]`},digitField:{selector:()=>d.Z.componentName},label:{selector:"> label"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:"descope-passcode-internal .wrapper"}},y=d.Z.cssVarList,x=(0,a.qC)((0,r.yk)({mappings:{...u,borderColor:{...g,property:y.borderColor},outlineColor:{...g,property:y.outlineColor},outlineWidth:[{...g,property:y.outlineWidth},{...b,property:"padding"}],color:[u.color,h,f],padding:{...g,property:y.padding},margin:{...g,property:y.margin},textAlign:{...g,property:y.textAlign},caretColor:{...g,property:y.caretColor},digitsGap:{...b,property:"gap"},focusedDigitFieldBorderColor:[{...m,property:y.borderColor},{...m,property:y.outlineColor}]}}),r.e4,r.dj,r.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,r.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n --vaadin-field-default-width: auto;\n\t\t\tdisplay: inline-block;\n }\n\t:host::after {\n\t\tbackground-color: transparent;\n\t}\n\t:host::part(input-field)::after {\n\t\tbackground-color: transparent;\n\t}\n\n descope-passcode-internal {\n\t\t-webkit-mask-image: none;\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmin-height: initial;\n }\n\n\tdescope-passcode-internal .wrapper {\n\t\tbox-sizing: border-box;\n\t\tmin-height: initial;\n\t\theight: 100%;\n\t\tjustify-content: center;\n }\n\n\tdescope-passcode-internal descope-text-field {\n\t\twidth: var(${y.height})\t\t\t\n\t}\n\n vaadin-text-field::part(input-field) {\n\t\tbackground-color: transparent;\n\t\tpadding: 0;\n\t\toverflow: hidden;\n\t\t-webkit-mask-image: none;\n }\n\n\tvaadin-text-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%\n\t}\n\n\tvaadin-text-field::before {\n\t\theight: 0;\n\t}\n\n\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\n\tvaadin-text-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\n\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\tcontent: "*";\n\t}\n\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n `,excludeAttrsSync:["tabindex"],componentName:p}));n(9357),n(4775),customElements.define(p,x)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[646],{9859:(e,a,d)=>{d.d(a,{f:()=>l,Z:()=>u});var o=d(3878),n=d(4567);const i=[{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)),l=(0,n.iY)("phone-field-internal"),t=["disabled","size","bordered","invalid"],c=["country-input-placeholder","default-code"],m=["phone-input-placeholder","maxlength"],C={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},r=[].concat(t,c,m),s=(0,o.P)({componentName:l,baseSelector:"div"}),u=class extends s{static get observedAttributes(){return[].concat(s.observedAttributes||[],r)}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${i.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(){this.addEventListener("focus",(e=>{e.isTrusted&&this.inputs[0].focus()})),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(){this.phoneNumberInput.addEventListener("input",(e=>{const a=/^\d$/,d=e.target.value.split("").filter((e=>a.test(e))).join("");e.target.value=d})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(e,a,d){if(super.attributeChangedCallback(e,a,d),a!==d)if("default-code"===e&&d)this.handleDefaultCountryCode(d);else if(r.includes(e)){const a=C[e]||e;t.includes(e)?this.inputs.forEach((e=>e.setAttribute(a,d))):c.includes(e)?this.countryCodeInput.setAttribute(a,d):m.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)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[646],{6094:(e,a,d)=>{d.d(a,{Z:()=>o});const o=[{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))},5076:(e,a,d)=>{d.d(a,{f:()=>l,Z:()=>u});var o=d(3878),n=d(4567),i=d(6094);const l=(0,n.iY)("phone-field-internal"),t=["disabled","size","bordered","invalid","readonly"],c=["country-input-placeholder","default-code"],m=["phone-input-placeholder","maxlength"],C={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},r=[].concat(t,c,m),s=(0,o.P)({componentName:l,baseSelector:"div"}),u=class extends s{static get observedAttributes(){return[].concat(s.observedAttributes||[],r)}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${i.Z.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(){this.addEventListener("focus",(e=>{e.isTrusted&&this.inputs[0].focus()})),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(){this.phoneNumberInput.addEventListener("input",(e=>{const a=/^\d$/,d=e.target.value.split("").filter((e=>a.test(e))).join("");e.target.value=d})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(e,a,d){if(super.attributeChangedCallback(e,a,d),a!==d)if("default-code"===e&&d)this.handleDefaultCountryCode(d);else if(r.includes(e)){const a=C[e]||e;t.includes(e)?this.inputs.forEach((e=>e.setAttribute(a,d))):c.includes(e)?this.countryCodeInput.setAttribute(a,d):m.includes(e)&&this.phoneNumberInput.setAttribute(a,d)}}}},4772:(e,a,d)=>{d.r(a),d(1294),d(9357);var o=d(5076);customElements.define(o.f,o.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[414],{4840:(t,e,r)=>{r.r(e),r.d(e,{PhoneField:()=>g}),r(4772),r(1294),r(9357);var n=r(9859),o=r(4567),d=r(2061),i=r(1e3),p=r(9063),l=r(3352);const a=p.Z.cssVarList,s=l.Z.cssVarList,h=(0,o.iY)("phone-field"),{host:c,inputWrapper:u,countryCodeInput:y,phoneInput:f,label:b,requiredIndicator:m,separator:w}={host:{selector:()=>":host"},inputWrapper:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},separator:{selector:"descope-phone-field-internal .separator"}},g=(0,d.qC)((0,i.yk)({mappings:{componentWidth:{...c,property:"width"},wrapperBorderStyle:[{...u,property:"border-style"},{...w,property:"border-left-style"}],wrapperBorderWidth:[{...u,property:"border-width"},{...w,property:"border-left-width"}],wrapperBorderColor:[{...u,property:"border-color"},{...w,property:"border-left-color"}],wrapperBorderRadius:{...u,property:"border-radius"},inputHeight:{...u,property:"height"},countryCodeInputWidth:{...y,property:s.width},countryCodeDropdownWidth:{...y,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...f,property:"width"},color:[b,m,{...f,property:a.color},{...y,property:s.color}],placeholderColor:{...f,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<${n.f} \n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${n.f}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(n.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:h}));customElements.define(h,g)}}]);
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(5076),o=n(4567),i=n(2061),d=n(1e3),p=n(9063),l=n(3352),a=n(6094);const s=p.Z.cssVarList,h=l.Z.cssVarList,c=(0,o.iY)("phone-field"),{host:u,inputWrapper:f,countryCodeInput:y,phoneInput:b,label:m,requiredIndicator:x,separator:g}={host:{selector:()=>":host"},inputWrapper:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},separator:{selector:"descope-phone-field-internal .separator"}},w=(0,i.qC)((0,d.yk)({mappings:{componentWidth:{...u,property:"width"},wrapperBorderStyle:[{...f,property:"border-style"},{...g,property:"border-left-style"}],wrapperBorderWidth:[{...f,property:"border-width"},{...g,property:"border-left-width"}],wrapperBorderColor:[{...f,property:"border-color"},{...g,property:"border-left-color"}],wrapperBorderRadius:{...f,property:"border-radius"},inputHeight:{...f,property:"height"},countryCodeInputWidth:{...y,property:h.width},countryCodeDropdownWidth:{...y,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...b,property:"width"},color:[m,x,{...b,property:s.color},{...y,property:h.color}],placeholderColor:{...b,property:s.placeholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:h.overlayItemBackgroundColor},outlineStyle:f,outlineWidth:[f,{property:"padding"}],outlineColor:f}}),d.e4,d.dj,(t=>class extends t{static get CountryCodes(){return a.Z}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,d.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\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\tvaadin-text-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\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${h.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${s.outlineWidth}: 0;\n\t\t\t\t${s.borderWidth}: 0;\n\t\t\t\t${s.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\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\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([[934],{9063:(t,e,n)=>{n.d(e,{Z:()=>f,f:()=>l});var i=n(1e3),a=n(4447),d=n(2061);const l=(0,n(4567).iY)("text-field");let s="";const o=["type"],r=(0,d.qC)((0,i.yk)({mappings:a.Z}),i.e4,i.dj,i.Ae,(t=>class extends t{static get observedAttributes(){return o.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:()=>s,excludeAttrsSync:["tabindex"],componentName:l}));s=`\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\tbox-sizing: border-box;\n\t}\n\n\tvaadin-text-field::part(input-field) {\n\t\toverflow: hidden;\n\t\tpadding: 0;\n\t}\n\tvaadin-text-field[disabled] > input:placeholder-shown,\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\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(${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::part(input-field)::after {\n\t\topacity: 0 !important;\n\t}\n\n\n\tvaadin-text-field::before {\n\t\theight: unset;\n\t}\n`;const f=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(1e3),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\tbox-sizing: border-box;\n\t}\n\n\tvaadin-text-field::part(input-field) {\n\t\toverflow: hidden;\n\t\tpadding: 0;\n\t}\n\tvaadin-text-field[disabled] > input:placeholder-shown,\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\tmin-height: 0;\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\tcontent: "*";\n\t\tcolor: var(${o.cssVarList.color});\n\t}\n\tvaadin-text-field::part(input-field)::after {\n\t\topacity: 0 !important;\n\t}\n\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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.100",
3
+ "version": "1.0.102",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -62,7 +62,13 @@ const ComboBoxMixin = (superclass) => class ComboBoxMixinClass extends superclas
62
62
  }
63
63
  }
64
64
 
65
- const { host, input, placeholder, toggle, label } = {
65
+ const {
66
+ host,
67
+ input,
68
+ placeholder,
69
+ toggle,
70
+ label
71
+ } = {
66
72
  host: { selector: () => ':host' },
67
73
  input: { selector: '::part(input-field)' },
68
74
  placeholder: { selector: '> input:placeholder-shown' },
@@ -82,7 +88,7 @@ const ComboBox = compose(
82
88
  height: input,
83
89
  padding: input,
84
90
 
85
- backgroundColor: input,
91
+ inputBackgroundColor: { ...input, property: 'background-color' },
86
92
  boxShadow: input,
87
93
 
88
94
  borderColor: input,
@@ -147,6 +153,15 @@ const ComboBox = compose(
147
153
  border-radius: 0;
148
154
  padding: 0;
149
155
  }
156
+ vaadin-combo-box::part(input-field)::after {
157
+ opacity: 0;
158
+ }
159
+ vaadin-combo-box[readonly]::part(input-field)::after {
160
+ border: none;
161
+ }
162
+ vaadin-combo-box[readonly] > input:placeholder-shown {
163
+ opacity: 1;
164
+ }
150
165
  `,
151
166
  // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property
152
167
  // with the same name. Including it will cause Vaadin to calculate NaN size,
@@ -68,7 +68,7 @@ const NewPassword = compose(
68
68
  selector: PasswordField.componentName,
69
69
  property: PasswordField.cssVarList.inputTextColor
70
70
  },
71
- inputsGap: {...internalInputsWrapper, property: 'gap'}
71
+ inputsGap: { ...internalInputsWrapper, property: 'gap' }
72
72
  }
73
73
  }),
74
74
  draggableMixin,
@@ -99,6 +99,7 @@ const overrides = `
99
99
  background: transparent;
100
100
  overflow: hidden;
101
101
  box-shadow: none;
102
+ padding: 0;
102
103
  }
103
104
  vaadin-text-field::part(input-field)::after {
104
105
  background: transparent;
@@ -4,3 +4,5 @@ import '../descope-password-field'
4
4
  import './descope-new-password-internal'
5
5
 
6
6
  customElements.define(componentName, NewPassword);
7
+
8
+ export { NewPassword };
@@ -3,3 +3,5 @@ import '../descope-text-field'
3
3
  import './descope-passcode-internal'
4
4
 
5
5
  customElements.define(componentName, Passcode);
6
+
7
+ export { Passcode };
@@ -81,6 +81,9 @@ const PasswordField = compose(
81
81
  vaadin-password-field {
82
82
  width: 100%;
83
83
  }
84
+ vaadin-password-field::part(input-field) {
85
+ padding: 0;
86
+ }
84
87
  vaadin-password-field > input {
85
88
  min-height: 0;
86
89
  }
@@ -9,6 +9,7 @@ import {
9
9
  } from '../../mixins';
10
10
  import TextField from '../descope-text-field/TextField';
11
11
  import ComboBox from '../descope-combo-box/ComboBox';
12
+ import CountryCodes from './CountryCodes';
12
13
 
13
14
  const textVars = TextField.cssVarList;
14
15
  const comboVars = ComboBox.cssVarList;
@@ -17,6 +18,10 @@ export const componentName = getComponentName('phone-field');
17
18
 
18
19
  const customMixin = (superclass) =>
19
20
  class PhoneFieldClass extends superclass {
21
+ static get CountryCodes() {
22
+ return CountryCodes;
23
+ }
24
+
20
25
  constructor() {
21
26
  super();
22
27
  }
@@ -115,6 +120,10 @@ const PhoneField = compose(
115
120
  selector: 'descope-combo-box',
116
121
  property: comboVars.overlayItemBackgroundColor
117
122
  },
123
+
124
+ outlineStyle: inputWrapper,
125
+ outlineWidth: [inputWrapper, { property: 'padding' }],
126
+ outlineColor: inputWrapper,
118
127
  },
119
128
  }),
120
129
  draggableMixin,
@@ -133,9 +142,15 @@ const PhoneField = compose(
133
142
  display: inline-flex;
134
143
  }
135
144
  vaadin-text-field {
136
- padding: 0;
137
145
  width: 100%;
138
146
  height: 100%;
147
+ box-sizing: border-box;
148
+ }
149
+ vaadin-text-field[focus-ring]::part(input-field) {
150
+ box-shadow: none;
151
+ }
152
+ vaadin-text-field::before {
153
+ height: 0;
139
154
  }
140
155
  vaadin-text-field::part(input-field) {
141
156
  padding: 0;
@@ -167,6 +182,7 @@ const PhoneField = compose(
167
182
  flex-grow: 1;
168
183
  min-height: 0;
169
184
  height: 100%;
185
+ ${textVars.outlineWidth}: 0;
170
186
  ${textVars.borderWidth}: 0;
171
187
  ${textVars.borderRadius}: 0;
172
188
  }
@@ -176,6 +192,9 @@ const PhoneField = compose(
176
192
  vaadin-text-field[readonly] > input:placeholder-shown {
177
193
  opacity: 1;
178
194
  }
195
+ vaadin-text-field::part(input-field)::after {
196
+ border: none;
197
+ }
179
198
  `,
180
199
  excludeAttrsSync: ['tabindex'],
181
200
  componentName
@@ -10,6 +10,7 @@ const commonAttrs = [
10
10
  'size',
11
11
  'bordered',
12
12
  'invalid',
13
+ 'readonly',
13
14
  ];
14
15
  const countryAttrs = ['country-input-placeholder', 'default-code'];
15
16
  const phoneAttrs = ['phone-input-placeholder', 'maxlength'];
@@ -85,6 +85,7 @@ overrides = `
85
85
 
86
86
  vaadin-text-field input {
87
87
  -webkit-mask-image: none;
88
+ min-height: 0;
88
89
  }
89
90
 
90
91
  vaadin-text-field > label,
@@ -95,7 +96,6 @@ overrides = `
95
96
  cursor: text;
96
97
  }
97
98
  vaadin-text-field[required]::part(required-indicator)::after {
98
- font-size: "12px";
99
99
  content: "*";
100
100
  color: var(${TextField.cssVarList.color});
101
101
  }
package/src/index.js CHANGED
@@ -1,23 +1,23 @@
1
- import './components/descope-button';
2
- import './components/boolean-fields/descope-checkbox';
3
- import './components/boolean-fields/descope-switch-toggle';
4
- import './components/descope-loader-linear';
5
- import './components/descope-loader-radial';
6
- import './components/descope-container';
7
- import './components/descope-date-picker';
8
- import './components/descope-divider';
9
- import './components/descope-email-field';
10
- import './components/descope-link';
11
- import './components/descope-logo';
12
- import './components/descope-number-field';
13
- import './components/descope-passcode';
14
- import './components/descope-password-field';
15
- import './components/descope-text';
16
- import './components/descope-text-area';
17
- import './components/descope-text-field';
18
- import './components/descope-image';
19
- import './components/descope-phone-field';
20
- import './components/descope-new-password';
1
+ export * from './components/descope-button';
2
+ export * from './components/boolean-fields/descope-checkbox';
3
+ export * from './components/boolean-fields/descope-switch-toggle';
4
+ export * from './components/descope-loader-linear';
5
+ export * from './components/descope-loader-radial';
6
+ export * from './components/descope-container';
7
+ // export * from './components/descope-date-picker';
8
+ export * from './components/descope-divider';
9
+ export * from './components/descope-email-field';
10
+ export * from './components/descope-link';
11
+ export * from './components/descope-logo';
12
+ export * from './components/descope-number-field';
13
+ export * from './components/descope-passcode';
14
+ export * from './components/descope-password-field';
15
+ export * from './components/descope-text';
16
+ export * from './components/descope-text-area';
17
+ export * from './components/descope-text-field';
18
+ export * from './components/descope-image';
19
+ export * from './components/descope-phone-field';
20
+ export * from './components/descope-new-password';
21
21
 
22
22
  export {
23
23
  globalsThemeToStyle,
@@ -88,7 +88,10 @@ export const createStyleMixin =
88
88
  );
89
89
 
90
90
  if (value) style?.setProperty(varName, value);
91
- else style?.removeProperty(varName);
91
+ else {
92
+ style?.removeProperty(varName);
93
+ this.removeAttribute(attrName)
94
+ }
92
95
  }
93
96
 
94
97
  #updateOverridesStyle(attrs = []) {
@@ -1,5 +1,26 @@
1
1
  import { observeAttributes } from "../helpers/componentHelpers";
2
2
 
3
+ const booleanAttributesList = [
4
+ 'readonly',
5
+ 'focused',
6
+ 'invalid',
7
+ 'has-label',
8
+ 'required',
9
+ 'disabled',
10
+ 'checked',
11
+ 'has-helper',
12
+ 'has-value',
13
+ 'step-buttons-visible',
14
+ 'hover',
15
+ 'has-error-message',
16
+ 'focus-ring',
17
+ 'opened',
18
+ 'active'
19
+ ]
20
+
21
+ const isBooleanAttribute = (attr) => {
22
+ return booleanAttributesList.includes(attr)
23
+ }
3
24
  // we want all the valueless attributes to have "true" value
4
25
  // and all the falsy attribute to be removed
5
26
  export const normalizeBooleanAttributesMixin = (superclass) => class NormalizeBooleanAttributesMixinClass extends superclass {
@@ -10,10 +31,14 @@ export const normalizeBooleanAttributesMixin = (superclass) => class NormalizeBo
10
31
  attrs.forEach(attr => {
11
32
  const attrVal = this.getAttribute(attr)
12
33
 
13
- if (attrVal === '') {
14
- this.setAttribute(attr, 'true')
15
- } else if (attrVal === 'false') {
16
- this.removeAttribute(attr)
34
+ if (isBooleanAttribute(attr)) {
35
+ if (attrVal === '') {
36
+ this.setAttribute(attr, 'true')
37
+ } else if (attrVal === 'false') {
38
+ this.removeAttribute(attr)
39
+ }
40
+ } else if (!attrVal) {
41
+ console.warn(`attribute "${attr}" has no value, should it be added to the boolean attributes list?`)
17
42
  }
18
43
  }), {})
19
44
  }
@@ -15,6 +15,7 @@ export const comboBox = {
15
15
  [vars.placeholderColor]: globalRefs.colors.surface.main,
16
16
  [vars.toggleColor]: globalRefs.colors.surface.contrast,
17
17
  [vars.toggleCursor]: 'pointer',
18
+ [vars.inputBackgroundColor]: globalRefs.colors.surface.light,
18
19
  size: {
19
20
  xs: {
20
21
  [vars.height]: '14px',
@@ -42,6 +43,11 @@ export const comboBox = {
42
43
  [vars.padding]: `0 ${globalRefs.spacing.xl}`
43
44
  }
44
45
  },
46
+
47
+ _readonly: {
48
+ [vars.toggleCursor]: 'default',
49
+ },
50
+
45
51
  _invalid: {
46
52
  [vars.borderColor]: globalRefs.colors.error.main,
47
53
  [vars.placeholderColor]: globalRefs.colors.error.light,