@descope/web-components-ui 1.0.404 → 1.0.405
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +8 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +8 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-hybrid-field/HybridFieldClass.js +8 -6
@@ -16,4 +16,4 @@
|
|
16
16
|
direction: rtl;
|
17
17
|
text-align: left;
|
18
18
|
}
|
19
|
-
`;(0,r.SF)("vaadin-email-field",p,{moduleId:"vaadin-email-field-styles"});class s extends a.A{static get is(){return"vaadin-email-field"}constructor(){super(),this._setType("email"),this.pattern="^([a-zA-Z0-9_\\.\\-+])+@[a-zA-Z0-9\\-.]+\\.[a-zA-Z0-9\\-]{2,}$"}ready(){super.ready(),this.inputElement&&(this.inputElement.autocapitalize="off")}}(0,l.X)(s);var d=n(94619),u=n(93826),h=n(7138),c=n(14944),m=n(33177);const f=(0,c.xE)("email-field"),y=(0,h.Zz)((0,d.RF)({mappings:u.A}),d.VO,(0,d.RV)({inputType:"email",inputName:"email",autocompleteType:"username",includeAttrs:["disabled","readonly","pattern"]}),(0,d.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),d.tQ,(t=>class extends t{init(){super.init?.(),this.baseElement.setAttribute("pattern","^[\\w\\.\\%\\+\\-']+@[\\w\\.\\-]+\\.[A-Za-z]{2,}$"),this.getAttribute("autocomplete")||this.setAttribute("autocomplete","username"),this.createExternalInput()}}))((0,d.tz)({slots:["","suffix"],wrappedEleName:"vaadin-email-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${y.cssVarList.inputOutlineWidth}) + var(${y.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,m.$J)("vaadin-email-field")}\n\t\t\t${(0,m.cy)(y.cssVarList)}\n\t\t\t${(0,m.LJ)("vaadin-email-field",y.cssVarList)}\n ${(0,m.Kl)()}\n\n vaadin-email-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-email-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n :host ::slotted(*) {\n -webkit-mask-image: none;\n }\n\n vaadin-email-field[external-input="true"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:f}));customElements.define(f,y)},56614:(t,e,n)=>{n.r(e),n.d(e,{HybridFieldClass:()=>c}),n(91046),n(18638),n(65636);var i=n(94619),r=n(70263),o=n(7138),l=n(14944);const a=/^\d+$/,p=(0,l.xE)("hybrid-field"),s={shared:["label","placeholder","bordered","full-width","label-type","size","disabled","readonly","required","st-host-direction"],email:["data-errormessage-value-missing-email","data-errormessage-pattern-mismatch-email","external-input"],phone:{countryCode:["country-input-label","country-input-placeholder","restrict-countries","default-code","phone-minlength","data-errormessage-value-missing-phone"],inputBox:["restrict-countries","default-code","phone-minlength","data-errormessage-value-missing-phone"]}},d={email:{"data-errormessage-value-missing-email":"data-errormessage-value-missing","data-errormessage-pattern-mismatch-email":"data-errormessage-pattern-mismatch"},phone:{placeholder:"phone-input-placeholder","phone-minlength":"minlength","data-errormessage-value-missing-phone":"data-errormessage-value-missing"}},u="descope-phone-field",h=(0,r.q)({componentName:p,baseSelector:"div"}),c=(0,o.Zz)((0,i.RF)({componentNameOverride:(0,l.xE)("input-wrapper")}),(0,i.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:[{selector:()=>"descope-email-field",property:"direction"},{selector:()=>"descope-phone-field",property:"direction"},{selector:()=>"descope-phone-input-box-field",property:"direction"}]}}),i.VO,i.tQ)(class extends h{#t=!1;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n\t\t<style>\n\t\t :host {\n display: inline-flex;\n box-sizing: border-box;\n padding: 0;\n gap: 0;\n }\n .wrapper {\n display: grid;\n place-content: center;\n }\n descope-email-field,\n descope-phone-field,\n descope-phone-input-box-field {\n grid-area: 1/1;\n width: 100%;\n height: 100%;\n }\n .hidden {\n visibility: hidden;\n } \n\t\t</style>\n <div class="wrapper">\n <descope-email-field external-input="${this.isExternalInput}"></descope-email-field>\n <descope-phone-field allow-alphanumeric-input="true"></descope-phone-field>\n <descope-phone-input-box-field allow-alphanumeric-input="true"></descope-phone-input-box-field>\n </div>\n\t\t`}get isExternalInput(){return"true"===this.getAttribute("external-input")}get emailInputEle(){return this.isExternalInput?this.emailInput.externalInput:this.emailInput.inputElement}get phoneVariant(){return"inputBox"===this.getAttribute("phone-variant")?this.phoneInputBoxInput:this.phoneCountryCodeInput}get defaultCode(){const t=this.phoneCountryCodeInput.countryCodes?.[0]||"";return this.getAttribute("default-code")||t}get activeInputEle(){return this.activeInput===this.emailInput?this.emailInputEle:this.phoneVariant.phoneNumberInputEle}get value(){return this.activeInput?.value||""}set value(t){this.handleActiveInput(t),this.activeInput.value=t}async init(){super.init?.(),this.initInputs(),this.updateAttrs(),this.toggleInputVisibility(),await this.waitForInputs(),this.initInputEles(),this.overrideEmailInputType(),this.overrideEmailSetAttribute()}waitForInputs(){return new Promise((t=>{const e=setInterval((()=>{this.emailInputEle&&(clearInterval(e),t())}))}))}initInputs(){this.emailInput=this.shadowRoot.querySelector("descope-email-field"),this.phoneCountryCodeInput=this.shadowRoot.querySelector(u),this.phoneInputBoxInput=this.shadowRoot.querySelector("descope-phone-input-box-field"),this.inputs=[this.emailInput,this.phoneCountryCodeInput,this.phoneInputBoxInput],this.activeInput=this.emailInput}initInputEles(){[this.emailInputEle,this.phoneCountryCodeInput.phoneNumberInputEle,this.phoneInputBoxInput.phoneNumberInputEle].forEach((t=>{t.addEventListener("input",this.onValueChange.bind(this))}))}overrideEmailInputType(){this.emailInputEle.addEventListener("focus",(()=>{this.emailInputEle.setAttribute("type","text")})),this.emailInputEle.addEventListener("blur",(()=>{setTimeout((()=>{this.emailInputEle.setAttribute("type","email")}))}))}overrideEmailSetAttribute(){const t=this.emailInput.setAttribute.bind(this.emailInputEle);this.emailInputEle.setAttribute=(e,n)=>("type"!==e||"email"!==n||!this.emailInput.hasAttribute("focused"))&&t(e,n)}updateAttrs(){this.inputs.forEach((t=>(0,l.EA)(this,t,{includeAttrs:s.shared}))),(0,l.EA)(this,this.emailInput,{includeAttrs:s.email,mapAttrs:d.email}),(0,l.EA)(this,this.phoneCountryCodeInput,{includeAttrs:s.phone.countryCode,mapAttrs:d.phone}),(0,l.EA)(this,this.phoneInputBoxInput,{includeAttrs:s.phone.inputBox,mapAttrs:d.phone}),setTimeout((()=>this.phoneCountryCodeInput.setAttribute("default-code",this.defaultCode)))}onValueChange(){this.#e=this.activeInputEle.selectionStart,this.handleActiveInput(this.activeInput.value)}handleActiveInput(t){const e=(t=>a.test(t.replaceAll("+","").replaceAll("-","")))(t)?this.phoneVariant:this.emailInput;this.activeInput!==e&&this.setActiveInput(e)}setActiveInput(t){const e=this.activeInput.value;this.activeInput=t,this.setActiveInputValue(e),this.#t&&this.activeInput.reportValidity(),this.setActiveInputSelectionStart(),this.toggleInputVisibility()}setActiveInputSelectionStart(){setTimeout((()=>{this.activeInputEle.focus(),this.activeInputEle.setSelectionRange?.(this.#e,this.#e)}))}setActiveInputValue(t){const e=(t=>t.replace(/\+\d+-/,""))(t),n=this.activeInput.localName===u?`${this.phoneCountryCodeInput.countryCodeItems}-${e}`:e;this.activeInput.value=n}toggleInputVisibility(){this.inputs.forEach((t=>{t!==this.activeInput?t.classList.add("hidden"):t.classList.remove("hidden")}))}reportValidity(){this.#t=!0;const t=this.activeInputEle;return setTimeout((()=>{t.setSelectionRange?.(t.value.length,t.value.length)})),this.activeInput.reportValidity()}checkValidity(){return this.activeInput.checkValidity()}});customElements.define(p,c)},18638:(t,e,n)=>{n.r(e),n.d(e,{PhoneFieldClass:()=>E}),n(54930),n(4480),n(89348);var i=n(32413),r=n(14944),o=n(7138),l=n(94619),a=n(69473),p=n(78313),s=n(44066),d=n(33177);const u=a.w.cssVarList,h=p.C.cssVarList,c=(0,r.xE)("phone-field"),{host:m,label:f,requiredIndicator:y,inputField:g,internalAfter:b,countryCodeInput:v,phoneInput:x,separator:I,errorMessage:w,helperText:C}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},internalAfter:{selector:"descope-phone-field-internal::after"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},separator:{selector:"descope-phone-field-internal .separator"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},E=(0,o.Zz)((0,l.RF)({mappings:{fontSize:[m,g,{selector:a.w.componentName,property:a.w.cssVarList.fontSize},{selector:p.C.componentName,property:p.C.cssVarList.fontSize}],fontFamily:[f,w,C,{...v,property:p.C.cssVarList.overlay.fontFamily}],hostWidth:[{...m,property:"width"},{...x,property:"width"},{...v,property:"--vaadin-combo-box-overlay-width"}],hostDirection:{...m,property:"direction"},inputBorderStyle:[{...b,property:"outline-style"},{...I,property:"border-left-style"}],inputBorderWidth:[{...b,property:"outline-width"},{...I,property:"border-left-width"}],inputBorderColor:[{...b,property:"outline-color"},{...I,property:"border-left-color"}],inputBorderRadius:[{...g,property:"border-radius"},{...b,property:"border-radius"}],countryCodeInputWidth:{...v,property:h.hostWidth},countryCodeDropdownWidth:{...v,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...x,property:"width"},horizontalPadding:[{...x,property:"padding-left"},{...x,property:"padding-right"},{...v,property:"padding-left"},{...v,property:"padding-right"}],labelTextColor:[{...f,property:"color"},{...y,property:"color"}],labelRequiredIndicator:{...y,property:"content"},errorMessageTextColor:{...w,property:"color"},inputValueTextColor:[{...x,property:u.inputValueTextColor},{...v,property:h.inputValueTextColor}],inputPlaceholderTextColor:{...x,property:u.inputPlaceholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:h.overlayItemBackgroundColor},inputOutlineStyle:{...g,property:"outline-style"},inputOutlineColor:{...g,property:"outline-color"},inputOutlineWidth:{...g,property:"outline-width"},inputOutlineOffset:{...g,property:"outline-offset"},valueInputHeight:[{...v,property:h.valueInputHeight}],valueInputMarginBottom:[{...x,property:u.valueInputMarginBottom}],marginInlineStart:[{...x,property:u.marginInlineStart},{...v,property:h.marginInlineStart}]}}),l.VO,(0,l.OZ)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return s.A}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${i.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${i.T}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,r.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder","disabled","restrict-countries","country-input-label","readonly","label","label-type","allow-alphanumeric-input"]})}get countryCodeItems(){return this.inputElement?.countryCodeValue}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}get countryCodeInputData(){return this.inputElement?.countryCodeInputData}get countryCodes(){return Array.from(this.inputElement.countryCodeInputData).map((t=>t.getAttribute("data-country-code")))}}))((0,l.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 15em;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,d.cy)(E.cssVarList)}\n\t\t\t${(0,d.I4)("vaadin-text-field")}\n\t\t\t${(0,d.kG)("vaadin-text-field")}\n\t\t\t${(0,d.X6)()}\n\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\tpadding: 0;\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(label) {\n margin-left: 0;\n margin-right: 0;\n }\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 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\twidth: 100%;\n\t\t\t\theight: 100%;\n direction: ltr;\n position: relative;\n\t\t\t}\n descope-phone-field-internal::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n box-sizing: border-box;\n outline-offset: calc(var(${E.cssVarList.inputBorderWidth}) * -1);\n pointer-events: none;\n }\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 min-width: 5.75em;\n\t\t\t\t${h.inputOutlineWidth}: 0;\n\t\t\t\t${h.inputOutlineOffset}: 0;\n\t\t\t\t${h.inputBorderWidth}: 0;\n\t\t\t\t${h.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\t${u.inputOutlineWidth}: 0;\n\t\t\t\t${u.inputOutlineOffset}: 0;\n\t\t\t\t${u.inputBorderWidth}: 0;\n\t\t\t\t${u.inputBorderRadius}: 0;\n }\n\n :host([label-type="floating"]) vaadin-text-field::part(label) {\n display: none;\n }\n descope-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n descope-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\n\t\t\t}\n ${(0,d.$J)("vaadin-text-field")}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:c}));customElements.define(c,E)},43945:(t,e,n)=>{n.d(e,{A:()=>d,T:()=>l});var i=n(25827),r=n(14944),o=n(63789);const l=(0,r.xE)("phone-field-internal-input-box"),a=["disabled","size","bordered","invalid","readonly","phone-input-placeholder","name","autocomplete","label-type","allow-alphanumeric-input"],p={"phone-input-placeholder":"placeholder"},s=(0,i.y)({componentName:l,baseSelector:"div"}),d=class extends s{static get observedAttributes(){return[].concat(s.observedAttributes||[],a)}constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1"></descope-text-field>\n </div>\n ',this.phoneNumberInput=this.querySelector("descope-text-field")}get defaultCountryCode(){return(0,o.Q)(this.getAttribute("default-code"))}get hasDefaultCode(){return!!this.getAttribute("default-code")}get allowAlphanumericInput(){return"true"===this.getAttribute("allow-alphanumeric-input")}get value(){if(!this.phoneNumberValue)return"";if(this.hasDefaultCode){const t=new RegExp(`\\+?${parseInt(this.defaultCountryCode,10)}--?`);return`${this.defaultCountryCode}-${this.phoneNumberInput.value.replace(t,"")}`}return this.phoneNumberInput.value}set value(t){this.phoneNumberInput.value=t}get phoneNumberValue(){return this.phoneNumberInput.value}get phoneNumberInputEle(){return this.phoneNumberInput.shadowRoot.querySelector("input")}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}getValidity(){const t=this.value.replace(/\D/g,"");return this.isRequired&&!this.value?{valueMissing:!0}:t.length<this.minLength?{tooShort:!0}:t.length>this.maxLength?{tooLong:!0}:/^\+?\d{1,4}-?(?:\d-?){1,15}$/.test(this.value)?{}:{patternMismatch:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.phoneNumberInput.focus()})),super.init?.(),this.initInputs()}getCountryByDialCode(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-country-code")===t))}initInputs(){this.phoneNumberInput.addEventListener("input",(t=>{1===t.target.value.length&&"-"===t.target.value&&(t.target.value=""),t.target.value=t.target.value.replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+");let e=t.target.value;if(!this.allowAlphanumericInput){const n=/^[+\d-]+$/;e=t.target.value.split("").filter((t=>n.test(t))).join("")}t.target.value=e})),this.handleFocusEventsDispatching([this.phoneNumberInput]),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),e!==n&&a.includes(t)){const e=p[t]||t;this.phoneNumberInput.setAttribute(e,n)}}}},46633:(t,e,n)=>{n.r(e),n(89348);var i=n(43945);customElements.define(i.T,i.A)},65636:(t,e,n)=>{n.r(e),n.d(e,{PhoneFieldInputBoxClass:()=>I}),n(46633),n(4480),n(89348);var i=n(43945),r=n(14944),o=n(7138),l=n(94619),a=n(69473),p=n(44066),s=n(33177);const d=a.w.cssVarList,u=(0,r.xE)("phone-input-box-field"),{host:h,label:c,inputElement:m,requiredIndicator:f,inputField:y,inputFieldInternal:g,phoneInput:b,errorMessage:v,helperText:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:()=>"vaadin-text-field::part(input-field)"},inputFieldInternal:{selector:()=>"descope-phone-field-internal-input-box vaadin-text-field::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},I=(0,o.Zz)((0,l.RF)({mappings:{fontSize:[h,y,{selector:a.w.componentName,property:a.w.cssVarList.fontSize}],fontFamily:[c,v,x],hostWidth:{...h,property:"width"},hostMinWidth:{...h,property:"min-width"},hostDirection:{...h,property:"direction"},inputBorderStyle:{...g,property:"border-style"},inputBorderWidth:{...g,property:"border-width"},inputBorderColor:{...g,property:"border-color"},inputBorderRadius:[{...y,property:"border-radius"},{...g,property:"border-radius"}],inputHorizontalPadding:[{...b,property:"padding-left"},{...b,property:"padding-right"}],labelFontSize:{...c,property:"font-size"},labelFontWeight:{...c,property:"font-weight"},labelTextColor:[{...c,property:"color"},{...f,property:"color"}],labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...v,property:"color"},inputValueTextColor:{...b,property:d.inputValueTextColor},inputPlaceholderTextColor:{...b,property:d.inputPlaceholderColor},inputOutlineStyle:{...y,property:"outline-style"},inputOutlineColor:{...y,property:"outline-color"},inputOutlineWidth:{...y,property:"outline-width"},inputOutlineOffset:{...y,property:"outline-offset"},labelPosition:{...c,property:"position"},labelTopPosition:{...c,property:"top"},labelHorizontalPosition:[{...c,property:"left"},{...c,property:"right"}],inputTransformY:{...c,property:"transform"},inputTransition:{...c,property:"transition"},marginInlineStart:{...c,property:"margin-inline-start"},valueInputHeight:{...m,property:"height"},valueInputMarginBottom:{selector:a.w.componentName,property:d.valueInputMarginBottom}}}),l.VO,(0,l.OZ)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return p.A}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${i.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${i.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,r.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type","allow-alphanumeric-input"]})}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}}))((0,l.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,s.cy)(I.cssVarList)}\n ${(0,s.I4)("vaadin-text-field")}\n ${(0,s.kG)("vaadin-text-field")}\n ${(0,s.X6)()}\n\n vaadin-text-field {\n width: 100%;\n box-sizing: border-box;\n padding: 0;\n }\n vaadin-text-field[focus-ring]::part(input-field) {\n box-shadow: none;\n }\n vaadin-text-field::before {\n height: 0;\n }\n vaadin-text-field::part(input-field) {\n padding: 0;\n background: transparent;\n overflow: hidden;\n -webkit-mask-image: none;\n }\n descope-phone-field-internal-input-box {\n -webkit-mask-image: none;\n padding: 0;\n width: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n }\n descope-phone-field-internal-input-box .separator {\n flex: 0;\n border: none;\n }\n descope-phone-field-internal-input-box descope-text-field {\n ${d.inputOutlineWidth}: 0;\n ${d.inputOutlineOffset}: 0;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n direction: ltr;\n }\n vaadin-text-field[readonly] > input:placeholder-shown {\n opacity: 1;\n }\n vaadin-text-field::part(input-field)::after {\n border: none;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,s.$J)("vaadin-text-field")}\n ${(0,s.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:u}));customElements.define(u,I)},63789:(t,e,n)=>{n.d(e,{Q:()=>r});var i=n(44066);const r=t=>i.A.find((e=>e.code===t))?.dialCode}}]);
|
19
|
+
`;(0,r.SF)("vaadin-email-field",p,{moduleId:"vaadin-email-field-styles"});class s extends a.A{static get is(){return"vaadin-email-field"}constructor(){super(),this._setType("email"),this.pattern="^([a-zA-Z0-9_\\.\\-+])+@[a-zA-Z0-9\\-.]+\\.[a-zA-Z0-9\\-]{2,}$"}ready(){super.ready(),this.inputElement&&(this.inputElement.autocapitalize="off")}}(0,l.X)(s);var d=n(94619),u=n(93826),h=n(7138),c=n(14944),m=n(33177);const f=(0,c.xE)("email-field"),y=(0,h.Zz)((0,d.RF)({mappings:u.A}),d.VO,(0,d.RV)({inputType:"email",inputName:"email",autocompleteType:"username",includeAttrs:["disabled","readonly","pattern"]}),(0,d.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),d.tQ,(t=>class extends t{init(){super.init?.(),this.baseElement.setAttribute("pattern","^[\\w\\.\\%\\+\\-']+@[\\w\\.\\-]+\\.[A-Za-z]{2,}$"),this.getAttribute("autocomplete")||this.setAttribute("autocomplete","username"),this.createExternalInput()}}))((0,d.tz)({slots:["","suffix"],wrappedEleName:"vaadin-email-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${y.cssVarList.inputOutlineWidth}) + var(${y.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,m.$J)("vaadin-email-field")}\n\t\t\t${(0,m.cy)(y.cssVarList)}\n\t\t\t${(0,m.LJ)("vaadin-email-field",y.cssVarList)}\n ${(0,m.Kl)()}\n\n vaadin-email-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-email-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n :host ::slotted(*) {\n -webkit-mask-image: none;\n }\n\n vaadin-email-field[external-input="true"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:f}));customElements.define(f,y)},56614:(t,e,n)=>{n.r(e),n.d(e,{HybridFieldClass:()=>c}),n(91046),n(18638),n(65636);var i=n(94619),r=n(70263),o=n(7138),l=n(14944);const a=/^\d+$/,p=(0,l.xE)("hybrid-field"),s={shared:["bordered","full-width","label-type","size","disabled","readonly","required","st-host-direction"],email:["label","placeholder","data-errormessage-value-missing-email","data-errormessage-pattern-mismatch-email","external-input"],phone:{countryCode:["phone-input-label","country-input-label","country-input-placeholder","restrict-countries","default-code","phone-minlength","data-errormessage-value-missing-phone"],inputBox:["label","restrict-countries","default-code","phone-minlength","data-errormessage-value-missing-phone"]}},d={email:{"data-errormessage-value-missing-email":"data-errormessage-value-missing","data-errormessage-pattern-mismatch-email":"data-errormessage-pattern-mismatch"},phone:{"phone-input-label":"label","phone-minlength":"minlength","data-errormessage-value-missing-phone":"data-errormessage-value-missing"}},u="descope-phone-field",h=(0,r.q)({componentName:p,baseSelector:"div"}),c=(0,o.Zz)((0,i.RF)({componentNameOverride:(0,l.xE)("input-wrapper")}),(0,i.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:[{selector:()=>"descope-email-field",property:"direction"},{selector:()=>"descope-phone-field",property:"direction"},{selector:()=>"descope-phone-input-box-field",property:"direction"}]}}),i.VO,i.tQ)(class extends h{#t=!1;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n\t\t<style>\n\t\t :host {\n display: inline-flex;\n box-sizing: border-box;\n padding: 0;\n gap: 0;\n }\n .wrapper {\n display: grid;\n width: 100%;\n }\n descope-email-field,\n descope-phone-field,\n descope-phone-input-box-field {\n grid-area: 1/1;\n width: 100%;\n height: 100%;\n }\n .hidden {\n visibility: hidden;\n } \n\t\t</style>\n <div class="wrapper">\n <descope-email-field external-input="${this.isExternalInput}"></descope-email-field>\n <descope-phone-field allow-alphanumeric-input="true"></descope-phone-field>\n <descope-phone-input-box-field allow-alphanumeric-input="true"></descope-phone-input-box-field>\n </div>\n\t\t`}get isExternalInput(){return"true"===this.getAttribute("external-input")}get emailInputEle(){return this.isExternalInput?this.emailInput.externalInput:this.emailInput.inputElement}get phoneVariant(){return"inputBox"===this.getAttribute("phone-variant")?this.phoneInputBoxInput:this.phoneCountryCodeInput}get defaultCode(){const t=this.phoneCountryCodeInput.countryCodes?.[0]||"";return this.getAttribute("default-code")||t}get activeInputEle(){return this.activeInput===this.emailInput?this.emailInputEle:this.phoneVariant.phoneNumberInputEle}get value(){return this.activeInput?.value||""}set value(t){this.handleActiveInput(t),this.activeInput.value=t}async init(){super.init?.(),this.initInputs(),this.updateAttrs(),this.toggleInputVisibility(),await this.waitForInputs(),this.initInputEles(),this.overrideEmailInputType(),this.overrideEmailSetAttribute()}waitForInputs(){return new Promise((t=>{const e=setInterval((()=>{this.emailInputEle&&(clearInterval(e),t())}))}))}initInputs(){this.emailInput=this.shadowRoot.querySelector("descope-email-field"),this.phoneCountryCodeInput=this.shadowRoot.querySelector(u),this.phoneInputBoxInput=this.shadowRoot.querySelector("descope-phone-input-box-field"),this.inputs=[this.emailInput,this.phoneCountryCodeInput,this.phoneInputBoxInput],this.activeInput=this.emailInput}initInputEles(){[this.emailInputEle,this.phoneCountryCodeInput.phoneNumberInputEle,this.phoneInputBoxInput.phoneNumberInputEle].forEach((t=>{t.addEventListener("input",this.onValueChange.bind(this))}))}overrideEmailInputType(){this.emailInputEle.addEventListener("focus",(()=>{this.emailInputEle.setAttribute("type","text")})),this.emailInputEle.addEventListener("blur",(()=>{setTimeout((()=>{this.emailInputEle.setAttribute("type","email")}))}))}overrideEmailSetAttribute(){const t=this.emailInput.setAttribute.bind(this.emailInputEle);this.emailInputEle.setAttribute=(e,n)=>("type"!==e||"email"!==n||!this.emailInput.hasAttribute("focused"))&&t(e,n)}updateAttrs(){(0,l.EA)(this,this.emailInput,{includeAttrs:s.email,mapAttrs:d.email}),(0,l.EA)(this,this.phoneCountryCodeInput,{includeAttrs:s.phone.countryCode,mapAttrs:d.phone}),(0,l.EA)(this,this.phoneInputBoxInput,{includeAttrs:s.phone.inputBox,mapAttrs:d.phone}),this.inputs.forEach((t=>(0,l.EA)(this,t,{includeAttrs:s.shared}))),setTimeout((()=>this.phoneCountryCodeInput.setAttribute("default-code",this.defaultCode)))}onValueChange(){this.#e=this.activeInputEle.selectionStart,this.handleActiveInput(this.activeInput.value)}handleActiveInput(t){const e=(t=>a.test(t.replaceAll("+","").replaceAll("-","")))(t)?this.phoneVariant:this.emailInput;this.activeInput!==e&&this.setActiveInput(e)}setActiveInput(t){const e=this.activeInput.value;this.activeInput=t,this.setActiveInputValue(e),this.#t&&this.activeInput.reportValidity(),this.setActiveInputSelectionStart(),this.toggleInputVisibility()}setActiveInputSelectionStart(){setTimeout((()=>{this.activeInputEle.focus(),this.activeInputEle.setSelectionRange?.(this.#e,this.#e)}))}setActiveInputValue(t){const e=(t=>t.replace(/\+\d+-/,""))(t),n=this.activeInput.localName===u?`${this.phoneCountryCodeInput.countryCodeItems}-${e}`:e;this.activeInput.value=n}toggleInputVisibility(){this.inputs.forEach((t=>{t!==this.activeInput?t.classList.add("hidden"):t.classList.remove("hidden")}))}reportValidity(){this.#t=!0;const t=this.activeInputEle;return setTimeout((()=>{t.setSelectionRange?.(t.value.length,t.value.length)})),this.activeInput.reportValidity()}checkValidity(){return this.activeInput.checkValidity()}});customElements.define(p,c)},18638:(t,e,n)=>{n.r(e),n.d(e,{PhoneFieldClass:()=>E}),n(54930),n(4480),n(89348);var i=n(32413),r=n(14944),o=n(7138),l=n(94619),a=n(69473),p=n(78313),s=n(44066),d=n(33177);const u=a.w.cssVarList,h=p.C.cssVarList,c=(0,r.xE)("phone-field"),{host:m,label:f,requiredIndicator:y,inputField:b,internalAfter:g,countryCodeInput:v,phoneInput:x,separator:I,errorMessage:w,helperText:C}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},internalAfter:{selector:"descope-phone-field-internal::after"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},separator:{selector:"descope-phone-field-internal .separator"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},E=(0,o.Zz)((0,l.RF)({mappings:{fontSize:[m,b,{selector:a.w.componentName,property:a.w.cssVarList.fontSize},{selector:p.C.componentName,property:p.C.cssVarList.fontSize}],fontFamily:[f,w,C,{...v,property:p.C.cssVarList.overlay.fontFamily}],hostWidth:[{...m,property:"width"},{...x,property:"width"},{...v,property:"--vaadin-combo-box-overlay-width"}],hostDirection:{...m,property:"direction"},inputBorderStyle:[{...g,property:"outline-style"},{...I,property:"border-left-style"}],inputBorderWidth:[{...g,property:"outline-width"},{...I,property:"border-left-width"}],inputBorderColor:[{...g,property:"outline-color"},{...I,property:"border-left-color"}],inputBorderRadius:[{...b,property:"border-radius"},{...g,property:"border-radius"}],countryCodeInputWidth:{...v,property:h.hostWidth},countryCodeDropdownWidth:{...v,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...x,property:"width"},horizontalPadding:[{...x,property:"padding-left"},{...x,property:"padding-right"},{...v,property:"padding-left"},{...v,property:"padding-right"}],labelTextColor:[{...f,property:"color"},{...y,property:"color"}],labelRequiredIndicator:{...y,property:"content"},errorMessageTextColor:{...w,property:"color"},inputValueTextColor:[{...x,property:u.inputValueTextColor},{...v,property:h.inputValueTextColor}],inputPlaceholderTextColor:{...x,property:u.inputPlaceholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:h.overlayItemBackgroundColor},inputOutlineStyle:{...b,property:"outline-style"},inputOutlineColor:{...b,property:"outline-color"},inputOutlineWidth:{...b,property:"outline-width"},inputOutlineOffset:{...b,property:"outline-offset"},valueInputHeight:[{...v,property:h.valueInputHeight}],valueInputMarginBottom:[{...x,property:u.valueInputMarginBottom}],marginInlineStart:[{...x,property:u.marginInlineStart},{...v,property:h.marginInlineStart}]}}),l.VO,(0,l.OZ)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return s.A}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${i.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${i.T}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,r.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder","disabled","restrict-countries","country-input-label","readonly","label","label-type","allow-alphanumeric-input"]})}get countryCodeItems(){return this.inputElement?.countryCodeValue}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}get countryCodeInputData(){return this.inputElement?.countryCodeInputData}get countryCodes(){return Array.from(this.inputElement.countryCodeInputData).map((t=>t.getAttribute("data-country-code")))}}))((0,l.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 15em;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,d.cy)(E.cssVarList)}\n\t\t\t${(0,d.I4)("vaadin-text-field")}\n\t\t\t${(0,d.kG)("vaadin-text-field")}\n\t\t\t${(0,d.X6)()}\n\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\tpadding: 0;\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(label) {\n margin-left: 0;\n margin-right: 0;\n }\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 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\twidth: 100%;\n\t\t\t\theight: 100%;\n direction: ltr;\n position: relative;\n\t\t\t}\n descope-phone-field-internal::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n box-sizing: border-box;\n outline-offset: calc(var(${E.cssVarList.inputBorderWidth}) * -1);\n pointer-events: none;\n }\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 min-width: 5.75em;\n\t\t\t\t${h.inputOutlineWidth}: 0;\n\t\t\t\t${h.inputOutlineOffset}: 0;\n\t\t\t\t${h.inputBorderWidth}: 0;\n\t\t\t\t${h.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\t${u.inputOutlineWidth}: 0;\n\t\t\t\t${u.inputOutlineOffset}: 0;\n\t\t\t\t${u.inputBorderWidth}: 0;\n\t\t\t\t${u.inputBorderRadius}: 0;\n }\n\n :host([label-type="floating"]) vaadin-text-field::part(label) {\n display: none;\n }\n descope-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n descope-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\n\t\t\t}\n ${(0,d.$J)("vaadin-text-field")}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:c}));customElements.define(c,E)},43945:(t,e,n)=>{n.d(e,{A:()=>d,T:()=>l});var i=n(25827),r=n(14944),o=n(63789);const l=(0,r.xE)("phone-field-internal-input-box"),a=["disabled","size","bordered","invalid","readonly","phone-input-placeholder","name","autocomplete","label-type","allow-alphanumeric-input"],p={"phone-input-placeholder":"placeholder"},s=(0,i.y)({componentName:l,baseSelector:"div"}),d=class extends s{static get observedAttributes(){return[].concat(s.observedAttributes||[],a)}constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1"></descope-text-field>\n </div>\n ',this.phoneNumberInput=this.querySelector("descope-text-field")}get defaultCountryCode(){return(0,o.Q)(this.getAttribute("default-code"))}get hasDefaultCode(){return!!this.getAttribute("default-code")}get allowAlphanumericInput(){return"true"===this.getAttribute("allow-alphanumeric-input")}get value(){if(!this.phoneNumberValue)return"";if(this.hasDefaultCode){const t=new RegExp(`\\+?${parseInt(this.defaultCountryCode,10)}--?`);return`${this.defaultCountryCode}-${this.phoneNumberInput.value.replace(t,"")}`}return this.phoneNumberInput.value}set value(t){this.phoneNumberInput.value=t}get phoneNumberValue(){return this.phoneNumberInput.value}get phoneNumberInputEle(){return this.phoneNumberInput.shadowRoot.querySelector("input")}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}getValidity(){const t=this.value.replace(/\D/g,"");return this.isRequired&&!this.value?{valueMissing:!0}:t.length<this.minLength?{tooShort:!0}:t.length>this.maxLength?{tooLong:!0}:/^\+?\d{1,4}-?(?:\d-?){1,15}$/.test(this.value)?{}:{patternMismatch:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.phoneNumberInput.focus()})),super.init?.(),this.initInputs()}getCountryByDialCode(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-country-code")===t))}initInputs(){this.phoneNumberInput.addEventListener("input",(t=>{1===t.target.value.length&&"-"===t.target.value&&(t.target.value=""),t.target.value=t.target.value.replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+");let e=t.target.value;if(!this.allowAlphanumericInput){const n=/^[+\d-]+$/;e=t.target.value.split("").filter((t=>n.test(t))).join("")}t.target.value=e})),this.handleFocusEventsDispatching([this.phoneNumberInput]),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),e!==n&&a.includes(t)){const e=p[t]||t;this.phoneNumberInput.setAttribute(e,n)}}}},46633:(t,e,n)=>{n.r(e),n(89348);var i=n(43945);customElements.define(i.T,i.A)},65636:(t,e,n)=>{n.r(e),n.d(e,{PhoneFieldInputBoxClass:()=>I}),n(46633),n(4480),n(89348);var i=n(43945),r=n(14944),o=n(7138),l=n(94619),a=n(69473),p=n(44066),s=n(33177);const d=a.w.cssVarList,u=(0,r.xE)("phone-input-box-field"),{host:h,label:c,inputElement:m,requiredIndicator:f,inputField:y,inputFieldInternal:b,phoneInput:g,errorMessage:v,helperText:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:()=>"vaadin-text-field::part(input-field)"},inputFieldInternal:{selector:()=>"descope-phone-field-internal-input-box vaadin-text-field::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},I=(0,o.Zz)((0,l.RF)({mappings:{fontSize:[h,y,{selector:a.w.componentName,property:a.w.cssVarList.fontSize}],fontFamily:[c,v,x],hostWidth:{...h,property:"width"},hostMinWidth:{...h,property:"min-width"},hostDirection:{...h,property:"direction"},inputBorderStyle:{...b,property:"border-style"},inputBorderWidth:{...b,property:"border-width"},inputBorderColor:{...b,property:"border-color"},inputBorderRadius:[{...y,property:"border-radius"},{...b,property:"border-radius"}],inputHorizontalPadding:[{...g,property:"padding-left"},{...g,property:"padding-right"}],labelFontSize:{...c,property:"font-size"},labelFontWeight:{...c,property:"font-weight"},labelTextColor:[{...c,property:"color"},{...f,property:"color"}],labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...v,property:"color"},inputValueTextColor:{...g,property:d.inputValueTextColor},inputPlaceholderTextColor:{...g,property:d.inputPlaceholderColor},inputOutlineStyle:{...y,property:"outline-style"},inputOutlineColor:{...y,property:"outline-color"},inputOutlineWidth:{...y,property:"outline-width"},inputOutlineOffset:{...y,property:"outline-offset"},labelPosition:{...c,property:"position"},labelTopPosition:{...c,property:"top"},labelHorizontalPosition:[{...c,property:"left"},{...c,property:"right"}],inputTransformY:{...c,property:"transform"},inputTransition:{...c,property:"transition"},marginInlineStart:{...c,property:"margin-inline-start"},valueInputHeight:{...m,property:"height"},valueInputMarginBottom:{selector:a.w.componentName,property:d.valueInputMarginBottom}}}),l.VO,(0,l.OZ)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return p.A}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${i.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${i.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,r.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type","allow-alphanumeric-input"]})}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}}))((0,l.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,s.cy)(I.cssVarList)}\n ${(0,s.I4)("vaadin-text-field")}\n ${(0,s.kG)("vaadin-text-field")}\n ${(0,s.X6)()}\n\n vaadin-text-field {\n width: 100%;\n box-sizing: border-box;\n padding: 0;\n }\n vaadin-text-field[focus-ring]::part(input-field) {\n box-shadow: none;\n }\n vaadin-text-field::before {\n height: 0;\n }\n vaadin-text-field::part(input-field) {\n padding: 0;\n background: transparent;\n overflow: hidden;\n -webkit-mask-image: none;\n }\n descope-phone-field-internal-input-box {\n -webkit-mask-image: none;\n padding: 0;\n width: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n }\n descope-phone-field-internal-input-box .separator {\n flex: 0;\n border: none;\n }\n descope-phone-field-internal-input-box descope-text-field {\n ${d.inputOutlineWidth}: 0;\n ${d.inputOutlineOffset}: 0;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n direction: ltr;\n }\n vaadin-text-field[readonly] > input:placeholder-shown {\n opacity: 1;\n }\n vaadin-text-field::part(input-field)::after {\n border: none;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,s.$J)("vaadin-text-field")}\n ${(0,s.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:u}));customElements.define(u,I)},63789:(t,e,n)=>{n.d(e,{Q:()=>r});var i=n(44066);const r=t=>i.A.find((e=>e.code===t))?.dialCode}}]);
|
package/package.json
CHANGED
@@ -8,8 +8,6 @@ export const componentName = getComponentName('hybrid-field');
|
|
8
8
|
|
9
9
|
const attrs = {
|
10
10
|
shared: [
|
11
|
-
'label',
|
12
|
-
'placeholder',
|
13
11
|
'bordered',
|
14
12
|
'full-width',
|
15
13
|
'label-type',
|
@@ -20,12 +18,15 @@ const attrs = {
|
|
20
18
|
'st-host-direction',
|
21
19
|
],
|
22
20
|
email: [
|
21
|
+
'label',
|
22
|
+
'placeholder',
|
23
23
|
'data-errormessage-value-missing-email',
|
24
24
|
'data-errormessage-pattern-mismatch-email',
|
25
25
|
'external-input',
|
26
26
|
],
|
27
27
|
phone: {
|
28
28
|
countryCode: [
|
29
|
+
'phone-input-label',
|
29
30
|
'country-input-label',
|
30
31
|
'country-input-placeholder',
|
31
32
|
'restrict-countries',
|
@@ -34,6 +35,7 @@ const attrs = {
|
|
34
35
|
'data-errormessage-value-missing-phone',
|
35
36
|
],
|
36
37
|
inputBox: [
|
38
|
+
'label',
|
37
39
|
'restrict-countries',
|
38
40
|
'default-code',
|
39
41
|
'phone-minlength',
|
@@ -48,7 +50,7 @@ const attrMap = {
|
|
48
50
|
'data-errormessage-pattern-mismatch-email': 'data-errormessage-pattern-mismatch',
|
49
51
|
},
|
50
52
|
phone: {
|
51
|
-
|
53
|
+
'phone-input-label': 'label',
|
52
54
|
'phone-minlength': 'minlength',
|
53
55
|
'data-errormessage-value-missing-phone': 'data-errormessage-value-missing',
|
54
56
|
},
|
@@ -81,7 +83,7 @@ class RawHybridField extends BaseClass {
|
|
81
83
|
}
|
82
84
|
.wrapper {
|
83
85
|
display: grid;
|
84
|
-
|
86
|
+
width: 100%;
|
85
87
|
}
|
86
88
|
descope-email-field,
|
87
89
|
descope-phone-field,
|
@@ -208,8 +210,6 @@ class RawHybridField extends BaseClass {
|
|
208
210
|
}
|
209
211
|
|
210
212
|
updateAttrs() {
|
211
|
-
this.inputs.forEach((input) => forwardAttrs(this, input, { includeAttrs: attrs.shared }));
|
212
|
-
|
213
213
|
forwardAttrs(this, this.emailInput, { includeAttrs: attrs.email, mapAttrs: attrMap.email });
|
214
214
|
|
215
215
|
forwardAttrs(this, this.phoneCountryCodeInput, {
|
@@ -222,6 +222,8 @@ class RawHybridField extends BaseClass {
|
|
222
222
|
mapAttrs: attrMap.phone,
|
223
223
|
});
|
224
224
|
|
225
|
+
this.inputs.forEach((input) => forwardAttrs(this, input, { includeAttrs: attrs.shared }));
|
226
|
+
|
225
227
|
setTimeout(() => this.phoneCountryCodeInput.setAttribute('default-code', this.defaultCode));
|
226
228
|
}
|
227
229
|
|