@descope/web-components-ui 1.0.363 → 1.0.364

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1841],{91296:(t,e,n)=>{var i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,p=u||l||Function("return this")(),c=Object.prototype.toString,d=Math.max,h=Math.min,f=function(){return p.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function g(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==c.call(t)}(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(i,"");var n=s.test(t);return n||a.test(t)?o(t.slice(2),n?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var i,r,s,a,o,u,l=0,p=!1,c=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(e){var n=i,s=r;return i=r=void 0,l=e,a=t.apply(s,n)}function y(t){var n=t-u;return void 0===u||n>=e||n<0||c&&t-l>=s}function I(){var t=f();if(y(t))return x(t);o=setTimeout(I,function(t){var n=e-(t-u);return c?h(n,s-(t-l)):n}(t))}function x(t){return o=void 0,m&&i?b(t):(i=r=void 0,a)}function w(){var t=f(),n=y(t);if(i=arguments,r=this,u=t,n){if(void 0===o)return function(t){return l=t,o=setTimeout(I,e),p?b(t):a}(u);if(c)return o=setTimeout(I,e),b(u)}return void 0===o&&(o=setTimeout(I,e)),a}return e=g(e)||0,v(n)&&(p=!!n.leading,s=(c="maxWait"in n)?d(g(n.maxWait)||0,e):s,m="trailing"in n?!!n.trailing:m),w.cancel=function(){void 0!==o&&clearTimeout(o),l=0,i=u=r=o=void 0},w.flush=function(){return void 0===o?a:x(f())},w}},73878:(t,e,n)=>{"use strict";n.d(e,{P:()=>a});var i=n(2061),r=n(94978),s=n(33346);const a=(...t)=>(0,i.qC)(r.wX,r.li,r.QT,r.mE)((0,s.s)(...t))},15512:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d,f:()=>u});var i=n(91296),r=n.n(i),s=n(73878),a=n(54567),o=n(58229);const u=(0,a.iY)("passcode-internal"),l=["digits","loading"],p=["disabled","bordered","size","invalid","readonly"],c=(0,s.P)({componentName:u,baseSelector:"div"}),d=class extends c{static get observedAttributes(){return l.concat(c.observedAttributes||[])}constructor(){super(),this.innerHTML='\n\t\t<div class="wrapper"></div>\n\t\t<div class="loader-container">\n <descope-loader-radial size="xs" mode="primary"></descope-loader-radial>\n </div>\n\t\t<style>\n\t\t\t.wrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\tjustify-content: space-between;\n direction: ltr;\n position: relative;\n\t\t\t}\n\n descope-text-field {\n direction: ltr;\n }\n\n .loader-container {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\t\t</style>\n\t\t',this.wrapperEle=this.querySelector(".wrapper"),this.loaderContainer=this.querySelector(".loader-container")}renderInputs(){const t=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="one-time-code"\n\t\t\tinputMode="numeric"\n\t\t></descope-text-field>\n\t`));this.wrapperEle.innerHTML=t.join(""),this.inputs=Array.from(this.querySelectorAll("descope-text-field")),this.initInputs()}handleLoadingState(t){t?this.setAttribute("inert","true"):this.removeAttribute("inert")}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}get value(){return this.inputs?.map((({value:t})=>t)).join("")||""}set value(t){t!==this.value&&this.parseInputValue(this.inputs[0],(0,o._h)(t))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[0].focus()})),super.init?.(),this.renderInputs()}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),n=Math.min(e+1,this.inputs.length-1);return this.inputs[n]}getPrevInput(t){const e=this.getInputIdx(t),n=Math.max(e-1,0);return this.inputs[n]}fillDigits(t,e){for(let n=0;n<t.length;n+=1){e.value=t[n]??"";const i=this.getNextInput(e);if(i===e)break;e=i}(0,o.C5)(e)}parseInputValue(t,e=""){const n=e.split("");n.length?this.fillDigits(n,t):t.value=""}initInputs(){let t;this.inputs.forEach((e=>{e.shadowRoot.appendChild((0,o.M4)()),e.addEventListener("change",(n=>{t!==n.target&&(this.parseInputValue(e,e.value),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))}));const n=r()((t=>{this.parseInputValue(e,t),(0,o.Yh)(e)}),20,{trailing:!0});e.addEventListener("input",(i=>{e.value=(0,o._h)(e.value),e.value&&(0,o.Yh)(e,e.value[0]),t=i.target,setTimeout((()=>{t=null,"deleteContentBackward"===i?.inputType&&(0,o.C5)(this.getPrevInput(e))})),n(e.value)})),e.onkeydown=({key:t})=>{"Backspace"===t?e.value?e.setSelectionRange(1,1):setTimeout((()=>(0,o.C5)(this.getPrevInput(e))),0):1===t.length&&(e.value="")},(0,a.oP)(this,e,{includeAttrs:p})})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&l.includes(t)&&("digits"===t&&this.renderInputs(),"loading"===t&&this.handleLoadingState("true"===n))}get pattern(){return`^$|^\\d{${this.digits},}$`}}},58229:(t,e,n)=>{"use strict";n.d(e,{C5:()=>a,M4:()=>u,Yh:()=>l,_h:()=>o});const i="--descope-input-mask-content",r="--descope-input-mask-display",s="--descope-input-mask-fallback",a=t=>{t?.focus(),t?.setSelectionRange?.(1,1)},o=t=>t.replace(/\D/g,"")||"",u=()=>{const t=document.createElement("style");return t.id="input-mask",t.innerHTML=`vaadin-text-field::part(input-field)::before {\n ${s}: '';\n content: var(${i}, var(${s}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${r}, none);\n align-items: center;\n justify-content: center;\n }`,t},l=(t,e)=>{e?(t.style.setProperty(i,`"${e}"`),t.style.setProperty(r,"flex")):(t.style.removeProperty(i),t.style.removeProperty(r))}},4775:(t,e,n)=>{"use strict";n.r(e);var i=n(15512);customElements.define(i.f,i.Z)}}]);
1
+ (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1841],{91296:(t,e,n)=>{var i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,p=u||l||Function("return this")(),c=Object.prototype.toString,d=Math.max,h=Math.min,f=function(){return p.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function g(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==c.call(t)}(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(i,"");var n=s.test(t);return n||a.test(t)?o(t.slice(2),n?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var i,r,s,a,o,u,l=0,p=!1,c=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=i,s=r;return i=r=void 0,l=e,a=t.apply(s,n)}function b(t){var n=t-u;return void 0===u||n>=e||n<0||c&&t-l>=s}function I(){var t=f();if(b(t))return x(t);o=setTimeout(I,function(t){var n=e-(t-u);return c?h(n,s-(t-l)):n}(t))}function x(t){return o=void 0,m&&i?y(t):(i=r=void 0,a)}function w(){var t=f(),n=b(t);if(i=arguments,r=this,u=t,n){if(void 0===o)return function(t){return l=t,o=setTimeout(I,e),p?y(t):a}(u);if(c)return o=setTimeout(I,e),y(u)}return void 0===o&&(o=setTimeout(I,e)),a}return e=g(e)||0,v(n)&&(p=!!n.leading,s=(c="maxWait"in n)?d(g(n.maxWait)||0,e):s,m="trailing"in n?!!n.trailing:m),w.cancel=function(){void 0!==o&&clearTimeout(o),l=0,i=u=r=o=void 0},w.flush=function(){return void 0===o?a:x(f())},w}},73878:(t,e,n)=>{"use strict";n.d(e,{P:()=>a});var i=n(2061),r=n(94978),s=n(33346);const a=(...t)=>(0,i.qC)(r.wX,r.li,r.QT,r.mE)((0,s.s)(...t))},15512:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d,f:()=>u});var i=n(91296),r=n.n(i),s=n(73878),a=n(54567),o=n(58229);const u=(0,a.iY)("passcode-internal"),l=["digits","loading"],p=["disabled","bordered","size","invalid","readonly"],c=(0,s.P)({componentName:u,baseSelector:"div"}),d=class extends c{static get observedAttributes(){return l.concat(c.observedAttributes||[])}constructor(){super(),this.innerHTML='\n\t\t<div class="wrapper"></div>\n\t\t<div class="loader-container">\n <descope-loader-radial size="xs" mode="primary"></descope-loader-radial>\n </div>\n\t\t<style>\n\t\t\t.wrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\tjustify-content: space-between;\n direction: ltr;\n position: relative;\n\t\t\t}\n\n descope-text-field {\n direction: ltr;\n }\n\n .loader-container {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\t\t</style>\n\t\t',this.wrapperEle=this.querySelector(".wrapper"),this.loaderContainer=this.querySelector(".loader-container")}renderInputs(){const t=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="one-time-code"\n\t\t\tinputMode="numeric"\n\t\t></descope-text-field>\n\t`));this.wrapperEle.innerHTML=t.join(""),this.inputs=Array.from(this.querySelectorAll("descope-text-field")),this.initInputs()}handleLoadingState(t){t?this.setAttribute("inert","true"):this.removeAttribute("inert")}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}get value(){return this.inputs?.map((({value:t})=>t)).join("")||""}set value(t){t!==this.value&&this.parseInputValue(this.inputs[0],(0,o._h)(t))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[0].focus()})),super.init?.(),this.renderInputs()}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),n=Math.min(e+1,this.inputs.length-1);return this.inputs[n]}getPrevInput(t){const e=this.getInputIdx(t),n=Math.max(e-1,0);return this.inputs[n]}fillDigits(t,e){for(let n=0;n<t.length;n+=1){e.value=t[n]??"";const i=this.getNextInput(e);if(i===e)break;e=i}(0,o.C5)(e)}parseInputValue(t,e=""){const n=e.split("");n.length?this.fillDigits(n,t):t.value=""}initInputs(){this.inputs.forEach((t=>{t.shadowRoot.appendChild((0,o.M4)());const e=r()((e=>{this.parseInputValue(t,e),(0,o.Yh)(t)}),20,{trailing:!0});t.addEventListener("input",(n=>{t.value=(0,o._h)(t.value),t.value&&(0,o.Yh)(t,t.value[0]),setTimeout((()=>{"deleteContentBackward"===n?.inputType&&(0,o.C5)(this.getPrevInput(t))})),e(t.value)})),t.onkeydown=({key:e})=>{"Backspace"===e?t.value?t.setSelectionRange(1,1):setTimeout((()=>(0,o.C5)(this.getPrevInput(t))),0):1===e.length&&(t.value="")},(0,a.oP)(this,t,{includeAttrs:p})})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&l.includes(t)&&("digits"===t&&this.renderInputs(),"loading"===t&&this.handleLoadingState("true"===n))}get pattern(){return`^$|^\\d{${this.digits},}$`}}},58229:(t,e,n)=>{"use strict";n.d(e,{C5:()=>a,M4:()=>u,Yh:()=>l,_h:()=>o});const i="--descope-input-mask-content",r="--descope-input-mask-display",s="--descope-input-mask-fallback",a=t=>{t?.focus(),t?.setSelectionRange?.(1,1)},o=t=>t.replace(/\D/g,"")||"",u=()=>{const t=document.createElement("style");return t.id="input-mask",t.innerHTML=`vaadin-text-field::part(input-field)::before {\n ${s}: '';\n content: var(${i}, var(${s}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${r}, none);\n align-items: center;\n justify-content: center;\n }`,t},l=(t,e)=>{e?(t.style.setProperty(i,`"${e}"`),t.style.setProperty(r,"flex")):(t.style.removeProperty(i),t.style.removeProperty(r))}},4775:(t,e,n)=>{"use strict";n.r(e);var i=n(15512);customElements.define(i.f,i.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[939,3072],{73878:(t,e,n)=>{n.d(e,{P:()=>a});var i=n(2061),r=n(94978),o=n(33346);const a=(...t)=>(0,i.qC)(r.wX,r.li,r.QT,r.mE)((0,o.s)(...t))},28660:(t,e,n)=>{n.d(e,{O:()=>s,f:()=>a});var i=n(94978),r=n(33346),o=n(2061);const a=(0,n(54567).iY)("loader-radial");class l extends((0,r.s)({componentName:a,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t@keyframes spin {\n\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\t:host > div {\n\t\t\t\tanimation-name: spin;\n\t\t\t}\n\t\t</style>\n\t\t<div></div>\n\t"}}const s=(0,o.qC)((0,i.yk)({mappings:{hostDisplay:{property:"display"},spinnerSize:[{property:"width"},{property:"height"}],spinnerBorderWidth:{property:"border-width"},spinnerBorderStyle:{property:"border-style"},spinnerBorderRadius:{property:"border-radius"},spinnerQuadrant1Color:{property:"border-top-color"},spinnerQuadrant2Color:{property:"border-bottom-color"},spinnerQuadrant3Color:{property:"border-right-color"},spinnerQuadrant4Color:{property:"border-left-color"},animationDuration:{},animationTimingFunction:{},animationIterationCount:{}}}),i.e4,i.Ae)(l)},65747:(t,e,n)=>{n.r(e),n.d(e,{LoaderRadialClass:()=>i.O});var i=n(28660);customElements.define(i.f,i.O)},15512:(t,e,n)=>{n.d(e,{Z:()=>u,f:()=>s});var i=n(91296),r=n.n(i),o=n(73878),a=n(54567),l=n(58229);const s=(0,a.iY)("passcode-internal"),p=["digits","loading"],d=["disabled","bordered","size","invalid","readonly"],c=(0,o.P)({componentName:s,baseSelector:"div"}),u=class extends c{static get observedAttributes(){return p.concat(c.observedAttributes||[])}constructor(){super(),this.innerHTML='\n\t\t<div class="wrapper"></div>\n\t\t<div class="loader-container">\n <descope-loader-radial size="xs" mode="primary"></descope-loader-radial>\n </div>\n\t\t<style>\n\t\t\t.wrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\tjustify-content: space-between;\n direction: ltr;\n position: relative;\n\t\t\t}\n\n descope-text-field {\n direction: ltr;\n }\n\n .loader-container {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\t\t</style>\n\t\t',this.wrapperEle=this.querySelector(".wrapper"),this.loaderContainer=this.querySelector(".loader-container")}renderInputs(){const t=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="one-time-code"\n\t\t\tinputMode="numeric"\n\t\t></descope-text-field>\n\t`));this.wrapperEle.innerHTML=t.join(""),this.inputs=Array.from(this.querySelectorAll("descope-text-field")),this.initInputs()}handleLoadingState(t){t?this.setAttribute("inert","true"):this.removeAttribute("inert")}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}get value(){return this.inputs?.map((({value:t})=>t)).join("")||""}set value(t){t!==this.value&&this.parseInputValue(this.inputs[0],(0,l._h)(t))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[0].focus()})),super.init?.(),this.renderInputs()}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),n=Math.min(e+1,this.inputs.length-1);return this.inputs[n]}getPrevInput(t){const e=this.getInputIdx(t),n=Math.max(e-1,0);return this.inputs[n]}fillDigits(t,e){for(let n=0;n<t.length;n+=1){e.value=t[n]??"";const i=this.getNextInput(e);if(i===e)break;e=i}(0,l.C5)(e)}parseInputValue(t,e=""){const n=e.split("");n.length?this.fillDigits(n,t):t.value=""}initInputs(){let t;this.inputs.forEach((e=>{e.shadowRoot.appendChild((0,l.M4)()),e.addEventListener("change",(n=>{t!==n.target&&(this.parseInputValue(e,e.value),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))}));const n=r()((t=>{this.parseInputValue(e,t),(0,l.Yh)(e)}),20,{trailing:!0});e.addEventListener("input",(i=>{e.value=(0,l._h)(e.value),e.value&&(0,l.Yh)(e,e.value[0]),t=i.target,setTimeout((()=>{t=null,"deleteContentBackward"===i?.inputType&&(0,l.C5)(this.getPrevInput(e))})),n(e.value)})),e.onkeydown=({key:t})=>{"Backspace"===t?e.value?e.setSelectionRange(1,1):setTimeout((()=>(0,l.C5)(this.getPrevInput(e))),0):1===t.length&&(e.value="")},(0,a.oP)(this,e,{includeAttrs:d})})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&p.includes(t)&&("digits"===t&&this.renderInputs(),"loading"===t&&this.handleLoadingState("true"===n))}get pattern(){return`^$|^\\d{${this.digits},}$`}}},58229:(t,e,n)=>{n.d(e,{C5:()=>a,M4:()=>s,Yh:()=>p,_h:()=>l});const i="--descope-input-mask-content",r="--descope-input-mask-display",o="--descope-input-mask-fallback",a=t=>{t?.focus(),t?.setSelectionRange?.(1,1)},l=t=>t.replace(/\D/g,"")||"",s=()=>{const t=document.createElement("style");return t.id="input-mask",t.innerHTML=`vaadin-text-field::part(input-field)::before {\n ${o}: '';\n content: var(${i}, var(${o}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${r}, none);\n align-items: center;\n justify-content: center;\n }`,t},p=(t,e)=>{e?(t.style.setProperty(i,`"${e}"`),t.style.setProperty(r,"flex")):(t.style.removeProperty(i),t.style.removeProperty(r))}},4775:(t,e,n)=>{n.r(e);var i=n(15512);customElements.define(i.f,i.Z)},64919:(t,e,n)=>{n.r(e),n.d(e,{PasscodeClass:()=>w});var i=n(94978),r=n(15512),o=n(56417),a=n(28660),l=n(2061),s=n(54567),p=n(54201);const d=(0,s.iY)("passcode"),c=["digits"],{host:u,digitField:h,label:g,requiredIndicator:y,internalWrapper:b,focusedDigitField:f,errorMessage:m}={host:{selector:()=>":host"},focusedDigitField:{selector:()=>`${o.z.componentName}[focused="true"]`},digitField:{selector:()=>o.z.componentName},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:"descope-passcode-internal .wrapper"},errorMessage:{selector:"::part(error-message)"}},v=o.z.cssVarList,x=a.O.cssVarList,w=(0,l.qC)((0,i.yk)({mappings:{fontSize:[{...h,property:v.fontSize},u],hostWidth:{property:"width"},hostDirection:{...u,property:"direction"},fontFamily:[u,{...g}],labelTextColor:[{...g,property:"color"},{...y,property:"color"}],labelRequiredIndicator:{...y,property:"content"},errorMessageTextColor:{...m,property:"color"},digitValueTextColor:{selector:o.z.componentName,property:v.inputValueTextColor},digitSize:[{...h,property:"height"},{...h,property:"width"}],digitPadding:{...h,property:v.inputHorizontalPadding},digitTextAlign:{...h,property:v.inputTextAlign},digitCaretTextColor:{...h,property:v.inputCaretTextColor},digitSpacing:{...b,property:"gap"},digitOutlineColor:{...h,property:v.inputOutlineColor},digitOutlineWidth:{...h,property:v.inputOutlineWidth},focusedDigitFieldOutlineColor:{...f,property:v.inputOutlineColor},overlayOpacity:{...b,property:"opacity"},spinnerSize:{selector:a.O.componentName,property:x.spinnerSize}}}),i.e4,(0,i.dj)({proxyProps:["value","selectionStart"]}),i.Ae,(t=>class extends t{static get observedAttributes(){return c.concat(t.observedAttributes||[])}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${r.f}\n bordered="true"\n name="code"\n tabindex="-1"\n slot="input"\n ><slot></slot></${r.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.f),(0,s.oP)(this,this.inputElement,{includeAttrs:["digits","size","loading"]})}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"digits"===t&&this.style.setProperty("--passcode-digits-count",n)}}))((0,i.DM)({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: calc(var(--passcode-digits-count) * 2em);\n\t\t\t}\n\t\t\t${(0,p.DY)()}\n\t\t\t:host::after {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t\t:host::part(input-field)::after {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\n :host([loading="true"]) descope-passcode-internal .loader-container {\n display: block;\n }\n\n\t\t\tdescope-passcode-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\t\t\t\tmin-height: initial;\n\t\t\t}\n\n\t\t\tdescope-passcode-internal .wrapper {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tmin-height: initial;\n\t\t\t\theight: 100%;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\n\t\t\tdescope-passcode-internal descope-text-field {\n\t\t\t\tmin-width: 2em;\n\t\t\t\tmax-width: var(${v.inputHeight});\n\t\t\t}\n\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tbackground-color: transparent;\n\t\t\t\tpadding: 0;\n\t\t\t\toverflow: hidden;\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t}\n\n /* safari */\n\t\t\tvaadin-text-field::part(input-field)::after {\n opacity: 0;\n }\n\n\t\t\tvaadin-text-field {\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\n\t\t\t}\n\n\t\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\n\t\t\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\t\t\tborder: 0 solid;\n\t\t\t}\n\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\n ${(0,p.Wf)("vaadin-text-field")}\n\t\t\t${(0,p.Pd)("vaadin-text-field")}\n \t`,excludeAttrsSync:["tabindex"],componentName:d}));n(19357),n(65747),n(4775),customElements.define(d,w)},56417:(t,e,n)=>{n.d(e,{f:()=>s,z:()=>d});var i=n(94978),r=n(4447),o=n(2061),a=n(54567),l=n(54201);const s=(0,a.iY)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.qC)((0,i.yk)({mappings:r.Z}),i.e4,(0,i.dj)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),i.Ae,(t=>class extends t{static get observedAttributes(){return p.concat(t.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(t){if(!t)return void this.icon?.remove();const e={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},n={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...e}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,n),setTimeout((()=>{Object.assign(this.icon,e)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(t,e,n){super.attributeChangeCallback?.(t,e,n),"type"===t&&this.baseElement._setType(n),e!==n&&("label-type"===t?"floating"===n?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===t&&this.renderCopyToClipboard("true"===n))}}))((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-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(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\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 ${(0,l.Wf)("vaadin-text-field")}\n\t\t\t${(0,l.bi)(d.cssVarList)}\n\t\t\t${(0,l.wm)("vaadin-text-field",d.cssVarList)}\n ${(0,l.bz)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},19357:(t,e,n)=>{n.r(e),n.d(e,{TextFieldClass:()=>i.z}),n(79789),n(56594),n(57911);var i=n(56417);customElements.define(i.f,i.z)},4447:(t,e,n)=>{n.d(e,{Z:()=>y});const{host:i,label:r,placeholder:o,requiredIndicator:a,inputField:l,input:s,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:g}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"}},y={fontSize:[{},i],fontFamily:[r,l,d,c],labelFontSize:{...r,property:"font-size"},labelFontWeight:{...r,property:"font-weight"},labelTextColor:[{...r,property:"color"},{...a,property:"color"},{...r,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],hostWidth:{...i,property:"width"},hostMinWidth:{...i,property:"min-width"},hostDirection:{...i,property:"direction"},inputBackgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...l,property:"color"},{...h,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...s,property:"color"}],labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},inputHeight:{...l,property:"height"},inputHorizontalPadding:[{...s,property:"padding-left"},{...s,property:"padding-right"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineOffset:{...l,property:"outline-offset"},inputTextAlign:[{...s,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...o,property:"color"},{...u,property:"-webkit-text-fill-color"}],labelPosition:{...r,property:"position"},labelTopPosition:{...r,property:"top"},labelHorizontalPosition:[{...r,property:"left"},{...r,property:"right"}],inputTransformY:{...r,property:"transform"},inputTransition:{...r,property:"transition"},marginInlineStart:{...r,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"}],inputVerticalAlignment:[{...l,property:"align-items"}],valueInputHeight:[{...s,property:"height"}],valueInputMarginBottom:[{...s,property:"margin-bottom"}],inputIconOffset:[{...g,property:"margin-right"},{...g,property:"margin-left"}],inputIconSize:{...g,property:"font-size"},inputIconColor:{...g,property:"color"}}},54201:(t,e,n)=>{n.d(e,{B:()=>d,DY:()=>s,PH:()=>p,Pd:()=>a,TX:()=>r,Wf:()=>u,bi:()=>i,bz:()=>h,jI:()=>l,jl:()=>o,wm:()=>c});const i=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,r=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,l=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,s=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,c=(t,e)=>`\n ${r(t)}\n ${a(t)}\n ${l(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${d(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,u=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`,h=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) [slot="label"] {\n padding: 0;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[939,3072],{73878:(t,e,n)=>{n.d(e,{P:()=>a});var i=n(2061),r=n(94978),o=n(33346);const a=(...t)=>(0,i.qC)(r.wX,r.li,r.QT,r.mE)((0,o.s)(...t))},28660:(t,e,n)=>{n.d(e,{O:()=>s,f:()=>a});var i=n(94978),r=n(33346),o=n(2061);const a=(0,n(54567).iY)("loader-radial");class l extends((0,r.s)({componentName:a,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t@keyframes spin {\n\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\t:host > div {\n\t\t\t\tanimation-name: spin;\n\t\t\t}\n\t\t</style>\n\t\t<div></div>\n\t"}}const s=(0,o.qC)((0,i.yk)({mappings:{hostDisplay:{property:"display"},spinnerSize:[{property:"width"},{property:"height"}],spinnerBorderWidth:{property:"border-width"},spinnerBorderStyle:{property:"border-style"},spinnerBorderRadius:{property:"border-radius"},spinnerQuadrant1Color:{property:"border-top-color"},spinnerQuadrant2Color:{property:"border-bottom-color"},spinnerQuadrant3Color:{property:"border-right-color"},spinnerQuadrant4Color:{property:"border-left-color"},animationDuration:{},animationTimingFunction:{},animationIterationCount:{}}}),i.e4,i.Ae)(l)},65747:(t,e,n)=>{n.r(e),n.d(e,{LoaderRadialClass:()=>i.O});var i=n(28660);customElements.define(i.f,i.O)},15512:(t,e,n)=>{n.d(e,{Z:()=>u,f:()=>s});var i=n(91296),r=n.n(i),o=n(73878),a=n(54567),l=n(58229);const s=(0,a.iY)("passcode-internal"),p=["digits","loading"],d=["disabled","bordered","size","invalid","readonly"],c=(0,o.P)({componentName:s,baseSelector:"div"}),u=class extends c{static get observedAttributes(){return p.concat(c.observedAttributes||[])}constructor(){super(),this.innerHTML='\n\t\t<div class="wrapper"></div>\n\t\t<div class="loader-container">\n <descope-loader-radial size="xs" mode="primary"></descope-loader-radial>\n </div>\n\t\t<style>\n\t\t\t.wrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\tjustify-content: space-between;\n direction: ltr;\n position: relative;\n\t\t\t}\n\n descope-text-field {\n direction: ltr;\n }\n\n .loader-container {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\t\t</style>\n\t\t',this.wrapperEle=this.querySelector(".wrapper"),this.loaderContainer=this.querySelector(".loader-container")}renderInputs(){const t=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="one-time-code"\n\t\t\tinputMode="numeric"\n\t\t></descope-text-field>\n\t`));this.wrapperEle.innerHTML=t.join(""),this.inputs=Array.from(this.querySelectorAll("descope-text-field")),this.initInputs()}handleLoadingState(t){t?this.setAttribute("inert","true"):this.removeAttribute("inert")}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}get value(){return this.inputs?.map((({value:t})=>t)).join("")||""}set value(t){t!==this.value&&this.parseInputValue(this.inputs[0],(0,l._h)(t))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[0].focus()})),super.init?.(),this.renderInputs()}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),n=Math.min(e+1,this.inputs.length-1);return this.inputs[n]}getPrevInput(t){const e=this.getInputIdx(t),n=Math.max(e-1,0);return this.inputs[n]}fillDigits(t,e){for(let n=0;n<t.length;n+=1){e.value=t[n]??"";const i=this.getNextInput(e);if(i===e)break;e=i}(0,l.C5)(e)}parseInputValue(t,e=""){const n=e.split("");n.length?this.fillDigits(n,t):t.value=""}initInputs(){this.inputs.forEach((t=>{t.shadowRoot.appendChild((0,l.M4)());const e=r()((e=>{this.parseInputValue(t,e),(0,l.Yh)(t)}),20,{trailing:!0});t.addEventListener("input",(n=>{t.value=(0,l._h)(t.value),t.value&&(0,l.Yh)(t,t.value[0]),setTimeout((()=>{"deleteContentBackward"===n?.inputType&&(0,l.C5)(this.getPrevInput(t))})),e(t.value)})),t.onkeydown=({key:e})=>{"Backspace"===e?t.value?t.setSelectionRange(1,1):setTimeout((()=>(0,l.C5)(this.getPrevInput(t))),0):1===e.length&&(t.value="")},(0,a.oP)(this,t,{includeAttrs:d})})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&p.includes(t)&&("digits"===t&&this.renderInputs(),"loading"===t&&this.handleLoadingState("true"===n))}get pattern(){return`^$|^\\d{${this.digits},}$`}}},58229:(t,e,n)=>{n.d(e,{C5:()=>a,M4:()=>s,Yh:()=>p,_h:()=>l});const i="--descope-input-mask-content",r="--descope-input-mask-display",o="--descope-input-mask-fallback",a=t=>{t?.focus(),t?.setSelectionRange?.(1,1)},l=t=>t.replace(/\D/g,"")||"",s=()=>{const t=document.createElement("style");return t.id="input-mask",t.innerHTML=`vaadin-text-field::part(input-field)::before {\n ${o}: '';\n content: var(${i}, var(${o}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${r}, none);\n align-items: center;\n justify-content: center;\n }`,t},p=(t,e)=>{e?(t.style.setProperty(i,`"${e}"`),t.style.setProperty(r,"flex")):(t.style.removeProperty(i),t.style.removeProperty(r))}},4775:(t,e,n)=>{n.r(e);var i=n(15512);customElements.define(i.f,i.Z)},64919:(t,e,n)=>{n.r(e),n.d(e,{PasscodeClass:()=>w});var i=n(94978),r=n(15512),o=n(56417),a=n(28660),l=n(2061),s=n(54567),p=n(54201);const d=(0,s.iY)("passcode"),c=["digits"],{host:u,digitField:h,label:y,requiredIndicator:g,internalWrapper:b,focusedDigitField:f,errorMessage:m}={host:{selector:()=>":host"},focusedDigitField:{selector:()=>`${o.z.componentName}[focused="true"]`},digitField:{selector:()=>o.z.componentName},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:"descope-passcode-internal .wrapper"},errorMessage:{selector:"::part(error-message)"}},v=o.z.cssVarList,x=a.O.cssVarList,w=(0,l.qC)((0,i.yk)({mappings:{fontSize:[{...h,property:v.fontSize},u],hostWidth:{property:"width"},hostDirection:{...u,property:"direction"},fontFamily:[u,{...y}],labelTextColor:[{...y,property:"color"},{...g,property:"color"}],labelRequiredIndicator:{...g,property:"content"},errorMessageTextColor:{...m,property:"color"},digitValueTextColor:{selector:o.z.componentName,property:v.inputValueTextColor},digitSize:[{...h,property:"height"},{...h,property:"width"}],digitPadding:{...h,property:v.inputHorizontalPadding},digitTextAlign:{...h,property:v.inputTextAlign},digitCaretTextColor:{...h,property:v.inputCaretTextColor},digitSpacing:{...b,property:"gap"},digitOutlineColor:{...h,property:v.inputOutlineColor},digitOutlineWidth:{...h,property:v.inputOutlineWidth},focusedDigitFieldOutlineColor:{...f,property:v.inputOutlineColor},overlayOpacity:{...b,property:"opacity"},spinnerSize:{selector:a.O.componentName,property:x.spinnerSize}}}),i.e4,(0,i.dj)({proxyProps:["value","selectionStart"]}),i.Ae,(t=>class extends t{static get observedAttributes(){return c.concat(t.observedAttributes||[])}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${r.f}\n bordered="true"\n name="code"\n tabindex="-1"\n slot="input"\n ><slot></slot></${r.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.f),(0,s.oP)(this,this.inputElement,{includeAttrs:["digits","size","loading"]})}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"digits"===t&&this.style.setProperty("--passcode-digits-count",n)}}))((0,i.DM)({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: calc(var(--passcode-digits-count) * 2em);\n\t\t\t}\n\t\t\t${(0,p.DY)()}\n\t\t\t:host::after {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t\t:host::part(input-field)::after {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\n :host([loading="true"]) descope-passcode-internal .loader-container {\n display: block;\n }\n\n\t\t\tdescope-passcode-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\t\t\t\tmin-height: initial;\n\t\t\t}\n\n\t\t\tdescope-passcode-internal .wrapper {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tmin-height: initial;\n\t\t\t\theight: 100%;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\n\t\t\tdescope-passcode-internal descope-text-field {\n\t\t\t\tmin-width: 2em;\n\t\t\t\tmax-width: var(${v.inputHeight});\n\t\t\t}\n\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tbackground-color: transparent;\n\t\t\t\tpadding: 0;\n\t\t\t\toverflow: hidden;\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t}\n\n /* safari */\n\t\t\tvaadin-text-field::part(input-field)::after {\n opacity: 0;\n }\n\n\t\t\tvaadin-text-field {\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\n\t\t\t}\n\n\t\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\n\t\t\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\t\t\tborder: 0 solid;\n\t\t\t}\n\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\n ${(0,p.Wf)("vaadin-text-field")}\n\t\t\t${(0,p.Pd)("vaadin-text-field")}\n \t`,excludeAttrsSync:["tabindex"],componentName:d}));n(19357),n(65747),n(4775),customElements.define(d,w)},56417:(t,e,n)=>{n.d(e,{f:()=>s,z:()=>d});var i=n(94978),r=n(4447),o=n(2061),a=n(54567),l=n(54201);const s=(0,a.iY)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.qC)((0,i.yk)({mappings:r.Z}),i.e4,(0,i.dj)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),i.Ae,(t=>class extends t{static get observedAttributes(){return p.concat(t.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(t){if(!t)return void this.icon?.remove();const e={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},n={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...e}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,n),setTimeout((()=>{Object.assign(this.icon,e)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(t,e,n){super.attributeChangeCallback?.(t,e,n),"type"===t&&this.baseElement._setType(n),e!==n&&("label-type"===t?"floating"===n?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===t&&this.renderCopyToClipboard("true"===n))}}))((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-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(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\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 ${(0,l.Wf)("vaadin-text-field")}\n\t\t\t${(0,l.bi)(d.cssVarList)}\n\t\t\t${(0,l.wm)("vaadin-text-field",d.cssVarList)}\n ${(0,l.bz)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},19357:(t,e,n)=>{n.r(e),n.d(e,{TextFieldClass:()=>i.z}),n(79789),n(56594),n(57911);var i=n(56417);customElements.define(i.f,i.z)},4447:(t,e,n)=>{n.d(e,{Z:()=>g});const{host:i,label:r,placeholder:o,requiredIndicator:a,inputField:l,input:s,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:y}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"}},g={fontSize:[{},i],fontFamily:[r,l,d,c],labelFontSize:{...r,property:"font-size"},labelFontWeight:{...r,property:"font-weight"},labelTextColor:[{...r,property:"color"},{...a,property:"color"},{...r,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],hostWidth:{...i,property:"width"},hostMinWidth:{...i,property:"min-width"},hostDirection:{...i,property:"direction"},inputBackgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...l,property:"color"},{...h,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...s,property:"color"}],labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},inputHeight:{...l,property:"height"},inputHorizontalPadding:[{...s,property:"padding-left"},{...s,property:"padding-right"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineOffset:{...l,property:"outline-offset"},inputTextAlign:[{...s,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...o,property:"color"},{...u,property:"-webkit-text-fill-color"}],labelPosition:{...r,property:"position"},labelTopPosition:{...r,property:"top"},labelHorizontalPosition:[{...r,property:"left"},{...r,property:"right"}],inputTransformY:{...r,property:"transform"},inputTransition:{...r,property:"transition"},marginInlineStart:{...r,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"}],inputVerticalAlignment:[{...l,property:"align-items"}],valueInputHeight:[{...s,property:"height"}],valueInputMarginBottom:[{...s,property:"margin-bottom"}],inputIconOffset:[{...y,property:"margin-right"},{...y,property:"margin-left"}],inputIconSize:{...y,property:"font-size"},inputIconColor:{...y,property:"color"}}},54201:(t,e,n)=>{n.d(e,{B:()=>d,DY:()=>s,PH:()=>p,Pd:()=>a,TX:()=>r,Wf:()=>u,bi:()=>i,bz:()=>h,jI:()=>l,jl:()=>o,wm:()=>c});const i=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,r=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,l=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,s=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,c=(t,e)=>`\n ${r(t)}\n ${a(t)}\n ${l(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${d(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,u=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`,h=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) [slot="label"] {\n padding: 0;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.363",
3
+ "version": "1.0.364",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -156,18 +156,9 @@ class PasscodeInternal extends BaseInputClass {
156
156
  }
157
157
 
158
158
  initInputs() {
159
- let currentInput;
160
-
161
159
  this.inputs.forEach((input) => {
162
160
  input.shadowRoot.appendChild(createInputMaskStyle());
163
161
 
164
- input.addEventListener('change', (e) => {
165
- if (currentInput !== e.target) {
166
- this.parseInputValue(input, input.value);
167
- this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
168
- }
169
- });
170
-
171
162
  const handleParseInput = (val) => {
172
163
  this.parseInputValue(input, val);
173
164
  toggleMaskVisibility(input);
@@ -183,16 +174,7 @@ class PasscodeInternal extends BaseInputClass {
183
174
  toggleMaskVisibility(input, input.value[0]);
184
175
  }
185
176
 
186
- // when using iPhone's code autofill we get only `change` events.
187
- // In other scenarios we get `input` AND `change` events.
188
- // In order to be parse the digits properly in iPhone, we need to listen to `change` event
189
- // and validate it was not preceeded by an `input` event.
190
- // To do so, we're keeping a reference to the input element in `input` events,
191
- // and only if there the reference is null, then we're assuming no `input` event was preceeding,
192
- // and we're parsing the digits.
193
- currentInput = e.target;
194
177
  setTimeout(() => {
195
- currentInput = null;
196
178
  if (e?.inputType === 'deleteContentBackward') {
197
179
  focusElement(this.getPrevInput(input));
198
180
  }