@descope/web-components-ui 1.70.0 → 1.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js.map +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js.map +1 -1
- package/package.json +1 -1
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +1 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3359],{3393:(t,e,i)=>{i.d(e,{y:()=>a});var n=i(9696),s=i(79365),r=i(81365);const a=(...t)=>(0,n.Zz)(s.XX,s._$,s.yF,s.jd)((0,r.q)(...t))},18280:(t,e,i)=>{i.d(e,{Z:()=>l,_B:()=>n,n6:()=>s,pW:()=>a,vz:()=>r,zj:()=>u});const n="--descope-input-mask-content",s="--descope-input-mask-display",r="--descope-input-mask-fallback",a=t=>{t?.focus(),t?.setSelectionRange?.(1,1)},u=t=>t.replace(/\D/g,"")||"",l=(t,e)=>{e?(t.style.setProperty(n,`"${e}"`),t.style.setProperty(s,"flex")):(t.style.removeProperty(n),t.style.removeProperty(s))}},47168:(t,e,i)=>{i.d(e,{A:()=>h,T:()=>p});var n=i(68049),s=i.n(n),r=i(3393),a=i(97810),u=i(18280),l=i(25964);const p=(0,a.xE)("passcode-internal"),d=["digits","loading"],o=["disabled","bordered","size","invalid","readonly","aria-labelledby"],c=(0,r.y)({componentName:p,baseSelector:"div"}),h=class extends c{static get observedAttributes(){return d.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',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,u.zj)(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),i=Math.min(e+1,this.inputs.length-1);return this.inputs[i]}getPrevInput(t){const e=this.getInputIdx(t),i=Math.max(e-1,0);return this.inputs[i]}fillDigits(t,e){for(let i=0;i<t.length;i+=1){e.value=t[i]??"";const n=this.getNextInput(e);if(n===e)break;e=n}(0,u.pW)(e)}parseInputValue(t,e=""){const i=e.split("");i.length?this.fillDigits(i,t):t.value=""}initInputs(){this.inputs.forEach((t=>{(0,l.fz)(`\n vaadin-text-field::part(input-field)::before {\n ${u.vz}: '';\n content: var(${u._B}, var(${u.vz}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${u.n6}, none);\n align-items: center;\n justify-content: center;\n }`,t);const e=s()((e=>{this.parseInputValue(t,e),(0,u.Z)(t)}),
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3359],{3393:(t,e,i)=>{i.d(e,{y:()=>a});var n=i(9696),s=i(79365),r=i(81365);const a=(...t)=>(0,n.Zz)(s.XX,s._$,s.yF,s.jd)((0,r.q)(...t))},18280:(t,e,i)=>{i.d(e,{Z:()=>l,_B:()=>n,n6:()=>s,pW:()=>a,vz:()=>r,zj:()=>u});const n="--descope-input-mask-content",s="--descope-input-mask-display",r="--descope-input-mask-fallback",a=t=>{t?.focus(),t?.setSelectionRange?.(1,1)},u=t=>t.replace(/\D/g,"")||"",l=(t,e)=>{e?(t.style.setProperty(n,`"${e}"`),t.style.setProperty(s,"flex")):(t.style.removeProperty(n),t.style.removeProperty(s))}},47168:(t,e,i)=>{i.d(e,{A:()=>h,T:()=>p});var n=i(68049),s=i.n(n),r=i(3393),a=i(97810),u=i(18280),l=i(25964);const p=(0,a.xE)("passcode-internal"),d=["digits","loading"],o=["disabled","bordered","size","invalid","readonly","aria-labelledby"],c=(0,r.y)({componentName:p,baseSelector:"div"}),h=class extends c{static get observedAttributes(){return d.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',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,u.zj)(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),i=Math.min(e+1,this.inputs.length-1);return this.inputs[i]}getPrevInput(t){const e=this.getInputIdx(t),i=Math.max(e-1,0);return this.inputs[i]}fillDigits(t,e){for(let i=0;i<t.length;i+=1){e.value=t[i]??"";const n=this.getNextInput(e);if(n===e)break;e=n}(0,u.pW)(e)}parseInputValue(t,e=""){const i=e.split("");i.length?this.fillDigits(i,t):t.value=""}initInputs(){this.inputs.forEach((t=>{(0,l.fz)(`\n vaadin-text-field::part(input-field)::before {\n ${u.vz}: '';\n content: var(${u._B}, var(${u.vz}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${u.n6}, none);\n align-items: center;\n justify-content: center;\n }`,t);const e=s()((e=>{this.parseInputValue(t,e),(0,u.Z)(t)}),0,{trailing:!0});t.addEventListener("input",(i=>{t.value=(0,u.zj)(t.value),t.value&&(0,u.Z)(t,t.value[0]),setTimeout((()=>{"deleteContentBackward"===i?.inputType&&(0,u.pW)(this.getPrevInput(t))})),e(t.value)})),t.onkeydown=({key:e})=>{"Backspace"===e?t.value?t.setSelectionRange(1,1):setTimeout((()=>(0,u.pW)(this.getPrevInput(t))),0):1===e.length&&(t.value="")},(0,a.EA)(this,t,{includeAttrs:o}),t.shadowRoot.querySelector("input").setAttribute("aria-label","passcode digit")})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),e!==i&&d.includes(t)&&("digits"===t&&this.renderInputs(),"loading"===t&&this.handleLoadingState("true"===i))}get pattern(){return`^$|^\\d{${this.digits},}$`}}},59053:(t,e,i)=>{i.r(e);var n=i(47168);customElements.define(n.T,n.A)}}]);
|
2
2
|
//# sourceMappingURL=descope-passcode-descope-passcode-internal-index-js.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"descope-passcode-descope-passcode-internal-index-js.js","mappings":"6LASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,gFCfhB,MAAMC,EAAuB,+BACvBC,EAA0B,+BAC1BC,EAA2B,gCAE3BC,EAAgBC,IAC3BA,GAAKC,QACLD,GAAKE,oBAAoB,EAAG,EAAE,EAGnBC,EAAeC,GACnBA,EAAIC,QAAQ,MAAO,KAAO,GAGtBC,EAAuB,CAACC,EAAOC,KACtCA,GACFD,EAAME,MAAMC,YAAYd,EAAsB,IAAIY,MAClDD,EAAME,MAAMC,YAAYb,EAAyB,UAEjDU,EAAME,MAAME,eAAef,GAC3BW,EAAME,MAAME,eAAed,GAC7B,C,8GCNK,MAAMe,GAAgB,QAAiB,qBAExCC,EAAqB,CAAC,SAAU,WAEhCC,EAAoB,CACxB,WACA,WACA,OACA,UACA,WACA,mBAGIC,GAAiB,OAAqB,CAAEH,gBAAeI,aAAc,QAsN3E,EApNA,cAA+BD,EAC7B,6BAAWF,GACT,OAAOA,EAAmBI,OAAOF,EAAeF,oBAAsB,GACxE,CAEA,WAAAK,GACEC,QAEAC,KAAKC,UAAY,0KAOjBD,KAAKE,WAAaF,KAAKG,cAAc,YACrCH,KAAKI,gBAAkBJ,KAAKG,cAAc,oBAC5C,CAEA,YAAAE,GACE,MAAMC,EAAS,IAAIC,MAAMP,KAAKQ,QAAQC,QAAQC,KAC3CC,GAAQ,4CAEFA,uHAQTX,KAAKE,WAAWD,UAAYK,EAAOM,KAAK,IAExCZ,KAAKM,OAASC,MAAMM,KAAKb,KAAKc,iBAAiB,uBAE/Cd,KAAKe,YACP,CAEA,kBAAAC,CAAmBC,GACbA,EACFjB,KAAKkB,aAAa,QAAS,QAE3BlB,KAAKmB,gBAAgB,Q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ass.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/index.js"],"sourcesContent":["import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","export const INPUT_MASK_TEXT_PROP = '--descope-input-mask-content';\nexport const INPUT_MASK_DISPLAY_PROP = '--descope-input-mask-display';\nexport const INPUT_MASK_FALLBACK_PROP = '--descope-input-mask-fallback';\n\nexport const focusElement = (ele) => {\n ele?.focus();\n ele?.setSelectionRange?.(1, 1);\n};\n\nexport const sanitizeStr = (str) => {\n return str.replace(/\\D/g, '') || '';\n};\n\nexport const toggleMaskVisibility = (input, value) => {\n if (value) {\n input.style.setProperty(INPUT_MASK_TEXT_PROP, `\"${value}\"`);\n input.style.setProperty(INPUT_MASK_DISPLAY_PROP, 'flex');\n } else {\n input.style.removeProperty(INPUT_MASK_TEXT_PROP);\n input.style.removeProperty(INPUT_MASK_DISPLAY_PROP);\n }\n};\n","/* eslint-disable no-param-reassign */\nimport debounce from 'lodash.debounce';\nimport { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';\nimport {\n sanitizeStr,\n focusElement,\n toggleMaskVisibility,\n INPUT_MASK_FALLBACK_PROP,\n INPUT_MASK_TEXT_PROP,\n INPUT_MASK_DISPLAY_PROP,\n} from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('passcode-internal');\n\nconst observedAttributes = ['digits', 'loading'];\n\nconst forwardAttributes = [\n 'disabled',\n 'bordered',\n 'size',\n 'invalid',\n 'readonly',\n 'aria-labelledby',\n];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass PasscodeInternal extends BaseInputClass {\n static get observedAttributes() {\n return observedAttributes.concat(BaseInputClass.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n 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`;\n\n this.wrapperEle = this.querySelector('.wrapper');\n this.loaderContainer = this.querySelector('.loader-container');\n }\n\n renderInputs() {\n const inputs = [...Array(this.digits).keys()].map(\n (idx) => `\n\t\t<descope-text-field\n\t\t\tdata-id=${idx}\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`\n );\n\n this.wrapperEle.innerHTML = inputs.join('');\n\n this.inputs = Array.from(this.querySelectorAll('descope-text-field'));\n\n this.initInputs();\n }\n\n handleLoadingState(isLoading) {\n if (isLoading) {\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n get digits() {\n return Number.parseInt(this.getAttribute('digits'), 10) || 6;\n }\n\n get value() {\n return this.inputs?.map(({ value }) => value).join('') || '';\n }\n\n set value(val) {\n if (val === this.value) return;\n\n this.parseInputValue(this.inputs[0], sanitizeStr(val));\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n if (this.pattern && !new RegExp(this.pattern).test(this.value)) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n init() {\n // we are adding listeners before calling to super because it's stopping the events\n this.addEventListener('focus', (e) => {\n // we want to ignore focus events we are dispatching\n if (e.isTrusted) this.inputs[0].focus();\n });\n\n super.init?.();\n\n this.renderInputs();\n }\n\n // eslint-disable-next-line class-methods-use-this\n getInputIdx(inputEle) {\n return Number.parseInt(inputEle.getAttribute('data-id'), 10);\n }\n\n getNextInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.min(currentIdx + 1, this.inputs.length - 1);\n return this.inputs[newIdx];\n }\n\n getPrevInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.max(currentIdx - 1, 0);\n return this.inputs[newIdx];\n }\n\n fillDigits(charArr, currentInput) {\n for (let i = 0; i < charArr.length; i += 1) {\n currentInput.value = charArr[i] ?? '';\n\n const nextInput = this.getNextInput(currentInput);\n\n if (nextInput === currentInput) break;\n currentInput = nextInput;\n }\n\n focusElement(currentInput);\n }\n\n parseInputValue(input, value = '') {\n const charArr = value.split('');\n\n if (!charArr.length) {\n // if we got an invalid value we want to clear the input\n input.value = '';\n } else this.fillDigits(charArr, input);\n }\n\n initInputs() {\n this.inputs.forEach((input) => {\n // During debounced input we hide the value with a mask.\n // This allows us to hide the multiple population of the first input\n // in case of an automated input (e.g. Safari OTP Autofill or paste).\n injectStyle(\n `\n vaadin-text-field::part(input-field)::before {\n ${INPUT_MASK_FALLBACK_PROP}: '';\n content: var(${INPUT_MASK_TEXT_PROP}, var(${INPUT_MASK_FALLBACK_PROP}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${INPUT_MASK_DISPLAY_PROP}, none);\n align-items: center;\n justify-content: center;\n }`,\n input\n );\n\n const handleParseInput = (val) => {\n this.parseInputValue(input, val);\n toggleMaskVisibility(input);\n };\n\n const debouncedHandleParseInput = debounce(handleParseInput, 20, { trailing: true });\n\n // sanitize the input\n input.addEventListener('input', (e) => {\n input.value = sanitizeStr(input.value);\n\n if (input.value) {\n toggleMaskVisibility(input, input.value[0]);\n }\n\n setTimeout(() => {\n if (e?.inputType === 'deleteContentBackward') {\n focusElement(this.getPrevInput(input));\n }\n });\n debouncedHandleParseInput(input.value);\n });\n\n // we want backspace to focus on the previous digit\n input.onkeydown = ({ key }) => {\n // when user deletes a digit, we want to focus the previous digit\n if (key === 'Backspace') {\n // if value is empty then the input element does not fire `input` event\n // if this is the case, we focus the element here.\n // otherwise, the focusElement occurs as part of the `input` event listener\n if (!input.value) {\n setTimeout(() => focusElement(this.getPrevInput(input)), 0);\n } else {\n input.setSelectionRange(1, 1);\n }\n } else if (key.length === 1) {\n // we want only characters and not command keys\n input.value = ''; // we are clearing the previous value so we can override it with the new value\n }\n };\n\n forwardAttrs(this, input, { includeAttrs: forwardAttributes });\n input.shadowRoot.querySelector('input').setAttribute('aria-label', 'passcode digit');\n });\n\n this.handleFocusEventsDispatching(this.inputs);\n this.handleInputEventDispatching();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n // sync attributes to inputs\n if (oldValue !== newValue) {\n if (observedAttributes.includes(attrName)) {\n if (attrName === 'digits') {\n this.renderInputs();\n }\n if (attrName === 'loading') {\n this.handleLoadingState(newValue === 'true');\n }\n }\n }\n }\n\n get pattern() {\n return `^$|^\\\\d{${this.digits},}$`;\n }\n}\n\nexport default PasscodeInternal;\n","import PasscodeInternal, { componentName } from './PasscodeInternal';\n\ncustomElements.define(componentName, PasscodeInternal);\n"],"names":["createBaseInputClass","args","INPUT_MASK_TEXT_PROP","INPUT_MASK_DISPLAY_PROP","INPUT_MASK_FALLBACK_PROP","focusElement","ele","focus","setSelectionRange","sanitizeStr","str","replace","toggleMaskVisibility","input","value","style","setProperty","removeProperty","componentName","observedAttributes","forwardAttributes","BaseInputClass","baseSelector","concat","constructor","super","this","innerHTML","wrapperEle","querySelector","loaderContainer","renderInputs","inputs","Array","digits","keys","map","idx","join","from","querySelectorAll","initInputs","handleLoadingState","isLoading","setAttribute","removeAttribute","Number","parseInt","getAttribute","val","parseInputValue","getValidity","isRequired","valueMissing","pattern","RegExp","test","patternMismatch","init","addEventListener","e","isTrusted","getInputIdx","inputEle","getNextInput","currInput","currentIdx","newIdx","Math","min","length","getPrevInput","max","fillDigits","charArr","currentInput","i","nextInput","split","forEach","debouncedHandleParseInput","trailing","setTimeout","inputType","onkeydown","key","includeAttrs","shadowRoot","handleFocusEventsDispatching","handleInputEventDispatching","attributeChangedCallback","attrName","oldValue","newValue","includes","customElements","define"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"descope-passcode-descope-passcode-internal-index-js.js","mappings":"6LASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,gFCfhB,MAAMC,EAAuB,+BACvBC,EAA0B,+BAC1BC,EAA2B,gCAE3BC,EAAgBC,IAC3BA,GAAKC,QACLD,GAAKE,oBAAoB,EAAG,EAAE,EAGnBC,EAAeC,GACnBA,EAAIC,QAAQ,MAAO,KAAO,GAGtBC,EAAuB,CAACC,EAAOC,KACtCA,GACFD,EAAME,MAAMC,YAAYd,EAAsB,IAAIY,MAClDD,EAAME,MAAMC,YAAYb,EAAyB,UAEjDU,EAAME,MAAME,eAAef,GAC3BW,EAAME,MAAME,eAAed,GAC7B,C,8GCNK,MAAMe,GAAgB,QAAiB,qBAExCC,EAAqB,CAAC,SAAU,WAEhCC,EAAoB,CACxB,WACA,WACA,OACA,UACA,WACA,mBAGIC,GAAiB,OAAqB,CAAEH,gBAAeI,aAAc,QAsN3E,EApNA,cAA+BD,EAC7B,6BAAWF,GACT,OAAOA,EAAmBI,OAAOF,EAAeF,oBAAsB,GACxE,CAEA,WAAAK,GACEC,QAEAC,KAAKC,UAAY,0KAOjBD,KAAKE,WAAaF,KAAKG,cAAc,YACrCH,KAAKI,gBAAkBJ,KAAKG,cAAc,oBAC5C,CAEA,YAAAE,GACE,MAAMC,EAAS,IAAIC,MAAMP,KAAKQ,QAAQC,QAAQC,KAC3CC,GAAQ,4CAEFA,uHAQTX,KAAKE,WAAWD,UAAYK,EAAOM,KAAK,IAExCZ,KAAKM,OAASC,MAAMM,KAAKb,KAAKc,iBAAiB,uBAE/Cd,KAAKe,YACP,CAEA,kBAAAC,CAAmBC,GACbA,EACFjB,KAAKkB,aA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webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/index.js"],"sourcesContent":["import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","export const INPUT_MASK_TEXT_PROP = '--descope-input-mask-content';\nexport const INPUT_MASK_DISPLAY_PROP = '--descope-input-mask-display';\nexport const INPUT_MASK_FALLBACK_PROP = '--descope-input-mask-fallback';\n\nexport const focusElement = (ele) => {\n ele?.focus();\n ele?.setSelectionRange?.(1, 1);\n};\n\nexport const sanitizeStr = (str) => {\n return str.replace(/\\D/g, '') || '';\n};\n\nexport const toggleMaskVisibility = (input, value) => {\n if (value) {\n input.style.setProperty(INPUT_MASK_TEXT_PROP, `\"${value}\"`);\n input.style.setProperty(INPUT_MASK_DISPLAY_PROP, 'flex');\n } else {\n input.style.removeProperty(INPUT_MASK_TEXT_PROP);\n input.style.removeProperty(INPUT_MASK_DISPLAY_PROP);\n }\n};\n","/* eslint-disable no-param-reassign */\nimport debounce from 'lodash.debounce';\nimport { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';\nimport {\n sanitizeStr,\n focusElement,\n toggleMaskVisibility,\n INPUT_MASK_FALLBACK_PROP,\n INPUT_MASK_TEXT_PROP,\n INPUT_MASK_DISPLAY_PROP,\n} from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('passcode-internal');\n\nconst observedAttributes = ['digits', 'loading'];\n\nconst forwardAttributes = [\n 'disabled',\n 'bordered',\n 'size',\n 'invalid',\n 'readonly',\n 'aria-labelledby',\n];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass PasscodeInternal extends BaseInputClass {\n static get observedAttributes() {\n return observedAttributes.concat(BaseInputClass.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n 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`;\n\n this.wrapperEle = this.querySelector('.wrapper');\n this.loaderContainer = this.querySelector('.loader-container');\n }\n\n renderInputs() {\n const inputs = [...Array(this.digits).keys()].map(\n (idx) => `\n\t\t<descope-text-field\n\t\t\tdata-id=${idx}\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`\n );\n\n this.wrapperEle.innerHTML = inputs.join('');\n\n this.inputs = Array.from(this.querySelectorAll('descope-text-field'));\n\n this.initInputs();\n }\n\n handleLoadingState(isLoading) {\n if (isLoading) {\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n get digits() {\n return Number.parseInt(this.getAttribute('digits'), 10) || 6;\n }\n\n get value() {\n return this.inputs?.map(({ value }) => value).join('') || '';\n }\n\n set value(val) {\n if (val === this.value) return;\n\n this.parseInputValue(this.inputs[0], sanitizeStr(val));\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n if (this.pattern && !new RegExp(this.pattern).test(this.value)) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n init() {\n // we are adding listeners before calling to super because it's stopping the events\n this.addEventListener('focus', (e) => {\n // we want to ignore focus events we are dispatching\n if (e.isTrusted) this.inputs[0].focus();\n });\n\n super.init?.();\n\n this.renderInputs();\n }\n\n // eslint-disable-next-line class-methods-use-this\n getInputIdx(inputEle) {\n return Number.parseInt(inputEle.getAttribute('data-id'), 10);\n }\n\n getNextInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.min(currentIdx + 1, this.inputs.length - 1);\n return this.inputs[newIdx];\n }\n\n getPrevInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.max(currentIdx - 1, 0);\n return this.inputs[newIdx];\n }\n\n fillDigits(charArr, currentInput) {\n for (let i = 0; i < charArr.length; i += 1) {\n currentInput.value = charArr[i] ?? '';\n\n const nextInput = this.getNextInput(currentInput);\n\n if (nextInput === currentInput) break;\n currentInput = nextInput;\n }\n\n focusElement(currentInput);\n }\n\n parseInputValue(input, value = '') {\n const charArr = value.split('');\n\n if (!charArr.length) {\n // if we got an invalid value we want to clear the input\n input.value = '';\n } else this.fillDigits(charArr, input);\n }\n\n initInputs() {\n this.inputs.forEach((input) => {\n // During debounced input we hide the value with a mask.\n // This allows us to hide the multiple population of the first input\n // in case of an automated input (e.g. Safari OTP Autofill or paste).\n injectStyle(\n `\n vaadin-text-field::part(input-field)::before {\n ${INPUT_MASK_FALLBACK_PROP}: '';\n content: var(${INPUT_MASK_TEXT_PROP}, var(${INPUT_MASK_FALLBACK_PROP}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${INPUT_MASK_DISPLAY_PROP}, none);\n align-items: center;\n justify-content: center;\n }`,\n input\n );\n\n const handleParseInput = (val) => {\n this.parseInputValue(input, val);\n toggleMaskVisibility(input);\n };\n\n const debouncedHandleParseInput = debounce(handleParseInput, 0, { trailing: true });\n\n // sanitize the input\n input.addEventListener('input', (e) => {\n input.value = sanitizeStr(input.value);\n\n if (input.value) {\n toggleMaskVisibility(input, input.value[0]);\n }\n\n setTimeout(() => {\n if (e?.inputType === 'deleteContentBackward') {\n focusElement(this.getPrevInput(input));\n }\n });\n debouncedHandleParseInput(input.value);\n });\n\n // we want backspace to focus on the previous digit\n input.onkeydown = ({ key }) => {\n // when user deletes a digit, we want to focus the previous digit\n if (key === 'Backspace') {\n // if value is empty then the input element does not fire `input` event\n // if this is the case, we focus the element here.\n // otherwise, the focusElement occurs as part of the `input` event listener\n if (!input.value) {\n setTimeout(() => focusElement(this.getPrevInput(input)), 0);\n } else {\n input.setSelectionRange(1, 1);\n }\n } else if (key.length === 1) {\n // we want only characters and not command keys\n input.value = ''; // we are clearing the previous value so we can override it with the new value\n }\n };\n\n forwardAttrs(this, input, { includeAttrs: forwardAttributes });\n input.shadowRoot.querySelector('input').setAttribute('aria-label', 'passcode digit');\n });\n\n this.handleFocusEventsDispatching(this.inputs);\n this.handleInputEventDispatching();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n // sync attributes to inputs\n if (oldValue !== newValue) {\n if (observedAttributes.includes(attrName)) {\n if (attrName === 'digits') {\n this.renderInputs();\n }\n if (attrName === 'loading') {\n this.handleLoadingState(newValue === 'true');\n }\n }\n }\n }\n\n get pattern() {\n return `^$|^\\\\d{${this.digits},}$`;\n }\n}\n\nexport default PasscodeInternal;\n","import PasscodeInternal, { componentName } from './PasscodeInternal';\n\ncustomElements.define(componentName, PasscodeInternal);\n"],"names":["createBaseInputClass","args","INPUT_MASK_TEXT_PROP","INPUT_MASK_DISPLAY_PROP","INPUT_MASK_FALLBACK_PROP","focusElement","ele","focus","setSelectionRange","sanitizeStr","str","replace","toggleMaskVisibility","input","value","style","setProperty","removeProperty","componentName","observedAttributes","forwardAttributes","BaseInputClass","baseSelector","concat","constructor","super","this","innerHTML","wrapperEle","querySelector","loaderContainer","renderInputs","inputs","Array","digits","keys","map","idx","join","from","querySelectorAll","initInputs","handleLoadingState","isLoading","setAttribute","removeAttribute","Number","parseInt","getAttribute","val","parseInputValue","getValidity","isRequired","valueMissing","pattern","RegExp","test","patternMismatch","init","addEventListener","e","isTrusted","getInputIdx","inputEle","getNextInput","currInput","currentIdx","newIdx","Math","min","length","getPrevInput","max","fillDigits","charArr","currentInput","i","nextInput","split","forEach","debouncedHandleParseInput","trailing","setTimeout","inputType","onkeydown","key","includeAttrs","shadowRoot","handleFocusEventsDispatching","handleInputEventDispatching","attributeChangedCallback","attrName","oldValue","newValue","includes","customElements","define"],"sourceRoot":""}
|
@@ -34,5 +34,5 @@
|
|
34
34
|
</div>
|
35
35
|
</div>
|
36
36
|
<slot name="tooltip"></slot>
|
37
|
-
`}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new a.I(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,r.X)(h)},37436:(t,e,n)=>{n.d(e,{a:()=>r});var i=n(44218);const r=t=>class extends((0,i.R)(t)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}},47168:(t,e,n)=>{n.d(e,{A:()=>h,T:()=>p});var i=n(68049),r=n.n(i),o=n(3393),a=n(97810),l=n(18280),s=n(25964);const p=(0,a.xE)("passcode-internal"),d=["digits","loading"],c=["disabled","bordered","size","invalid","readonly","aria-labelledby"],u=(0,o.y)({componentName:p,baseSelector:"div"}),h=class extends u{static get observedAttributes(){return d.concat(u.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',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.zj)(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.pW)(e)}parseInputValue(t,e=""){const n=e.split("");n.length?this.fillDigits(n,t):t.value=""}initInputs(){this.inputs.forEach((t=>{(0,s.fz)(`\n vaadin-text-field::part(input-field)::before {\n ${l.vz}: '';\n content: var(${l._B}, var(${l.vz}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${l.n6}, none);\n align-items: center;\n justify-content: center;\n }`,t);const e=r()((e=>{this.parseInputValue(t,e),(0,l.Z)(t)}),20,{trailing:!0});t.addEventListener("input",(n=>{t.value=(0,l.zj)(t.value),t.value&&(0,l.Z)(t,t.value[0]),setTimeout((()=>{"deleteContentBackward"===n?.inputType&&(0,l.pW)(this.getPrevInput(t))})),e(t.value)})),t.onkeydown=({key:e})=>{"Backspace"===e?t.value?t.setSelectionRange(1,1):setTimeout((()=>(0,l.pW)(this.getPrevInput(t))),0):1===e.length&&(t.value="")},(0,a.EA)(this,t,{includeAttrs:c}),t.shadowRoot.querySelector("input").setAttribute("aria-label","passcode digit")})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&d.includes(t)&&("digits"===t&&this.renderInputs(),"loading"===t&&this.handleLoadingState("true"===n))}get pattern(){return`^$|^\\d{${this.digits},}$`}}},52733:(t,e,n)=>{n(27397);var i=n(47642);(0,n(87550).SF)("vaadin-text-field",i.k,{moduleId:"lumo-text-field-styles"}),n(27136)},54249:(t,e,n)=>{n.r(e),n.d(e,{LoaderRadialClass:()=>i.l,componentName:()=>i.T});var i=n(74713);customElements.define(i.T,i.l)},54690:(t,e,n)=>{n.r(e),n.d(e,{PasscodeClass:()=>C,componentName:()=>c});var i=n(79365),r=n(47168),o=n(79275),a=n(74713),l=n(9696),s=n(97810),p=n(73551),d=n(25964);const c=(0,s.xE)("passcode"),u=["digits"],{host:h,digitField:g,label:y,requiredIndicator:b,internalWrapper:f,focusedDigitField:m,errorMessage:v}={host:{selector:()=>":host"},focusedDigitField:{selector:()=>`${o.w.componentName}[focused="true"]`},digitField:{selector:()=>o.w.componentName},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:"descope-passcode-internal .wrapper"},errorMessage:{selector:"::part(error-message)"}},x=o.w.cssVarList,w=a.l.cssVarList,C=(0,l.Zz)((0,i.RF)({mappings:{fontSize:[{...g,property:x.fontSize},h],hostWidth:{property:"width"},hostDirection:{...h,property:"direction"},fontFamily:[h,{...y}],labelTextColor:[{...y,property:"color"},{...b,property:"color"}],labelRequiredIndicator:{...b,property:"content"},errorMessageTextColor:{...v,property:"color"},errorMessageIcon:{...v,property:"background-image"},errorMessageIconSize:{...v,property:"background-size"},errorMessageIconPadding:{...v,property:"padding-inline-start"},errorMessageIconRepeat:{...v,property:"background-repeat"},errorMessageIconPosition:{...v,property:"background-position"},digitValueTextColor:{selector:o.w.componentName,property:x.inputValueTextColor},digitSize:[{...g,property:"height"},{...g,property:"width"}],digitPadding:{...g,property:x.inputHorizontalPadding},digitTextAlign:{...g,property:x.inputTextAlign},digitCaretTextColor:{...g,property:x.inputCaretTextColor},digitSpacing:{...f,property:"gap"},digitOutlineColor:{...g,property:x.inputOutlineColor},digitOutlineWidth:{...g,property:x.inputOutlineWidth},focusedDigitFieldOutlineColor:{...m,property:x.inputOutlineColor},overlayOpacity:{...f,property:"opacity"},spinnerSize:{selector:a.l.componentName,property:w.spinnerSize}}}),i.VO,i.Yg,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,(t=>class extends t{static get observedAttributes(){return u.concat(t.observedAttributes||[])}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}init(){super.init?.(),(0,d.fz)("\n .wrapper {\n display: flex;\n width: 100%;\n justify-content: space-between;\n direction: ltr;\n position: relative;\n }\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 ",this);const t=document.createElement("template");t.innerHTML=`\n <${r.T}\n bordered="true"\n name="code"\n tabindex="-1"\n slot="input"\n role="textbox"\n ><slot></slot></${r.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.T),(0,s.EA)(this,this.inputElement,{includeAttrs:["digits","size","loading"]})}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"digits"===t&&(this.style["--passcode-digits-count"]=n)}}))((0,i.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: calc(var(--passcode-digits-count) * 2em);\n\t\t\t}\n\t\t\t${(0,p.X6)()}\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(${x.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.$J)("vaadin-text-field")}\n\t\t\t${(0,p.I4)("vaadin-text-field")}\n \t`,excludeAttrsSync:["tabindex"],componentName:c}));n(21374),n(54249),n(59053),customElements.define(c,C)},59053:(t,e,n)=>{n.r(e);var i=n(47168);customElements.define(i.T,i.A)},73551:(t,e,n)=>{n.d(e,{$J:()=>u,I4:()=>a,Kl:()=>h,LJ:()=>c,Qv:()=>o,X6:()=>s,cy:()=>i,fu:()=>p,kG:()=>d,lS:()=>l,zm:()=>r});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 '},74713:(t,e,n)=>{n.d(e,{T:()=>s,l:()=>d});var i=n(79365),r=n(81365),o=n(9696),a=n(97810),l=n(25964);const s=(0,a.xE)("loader-radial");class p extends((0,r.q)({componentName:s,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div></div>\n\t",(0,l.fz)("\n @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 ",this)}}const d=(0,o.Zz)((0,i.RF)({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.VO,i.tQ)(p)},79275:(t,e,n)=>{n.d(e,{T:()=>s,w:()=>d});var i=n(79365),r=n(6424),o=n(9696),a=n(97810),l=n(73551);const s=(0,a.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,i.RF)({mappings:r.A}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),i.tQ,(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.tz)({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.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(d.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:s}))}}]);
|
37
|
+
`}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new a.I(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,r.X)(h)},37436:(t,e,n)=>{n.d(e,{a:()=>r});var i=n(44218);const r=t=>class extends((0,i.R)(t)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}},47168:(t,e,n)=>{n.d(e,{A:()=>h,T:()=>p});var i=n(68049),r=n.n(i),o=n(3393),a=n(97810),l=n(18280),s=n(25964);const p=(0,a.xE)("passcode-internal"),d=["digits","loading"],c=["disabled","bordered","size","invalid","readonly","aria-labelledby"],u=(0,o.y)({componentName:p,baseSelector:"div"}),h=class extends u{static get observedAttributes(){return d.concat(u.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',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.zj)(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.pW)(e)}parseInputValue(t,e=""){const n=e.split("");n.length?this.fillDigits(n,t):t.value=""}initInputs(){this.inputs.forEach((t=>{(0,s.fz)(`\n vaadin-text-field::part(input-field)::before {\n ${l.vz}: '';\n content: var(${l._B}, var(${l.vz}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${l.n6}, none);\n align-items: center;\n justify-content: center;\n }`,t);const e=r()((e=>{this.parseInputValue(t,e),(0,l.Z)(t)}),0,{trailing:!0});t.addEventListener("input",(n=>{t.value=(0,l.zj)(t.value),t.value&&(0,l.Z)(t,t.value[0]),setTimeout((()=>{"deleteContentBackward"===n?.inputType&&(0,l.pW)(this.getPrevInput(t))})),e(t.value)})),t.onkeydown=({key:e})=>{"Backspace"===e?t.value?t.setSelectionRange(1,1):setTimeout((()=>(0,l.pW)(this.getPrevInput(t))),0):1===e.length&&(t.value="")},(0,a.EA)(this,t,{includeAttrs:c}),t.shadowRoot.querySelector("input").setAttribute("aria-label","passcode digit")})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&d.includes(t)&&("digits"===t&&this.renderInputs(),"loading"===t&&this.handleLoadingState("true"===n))}get pattern(){return`^$|^\\d{${this.digits},}$`}}},52733:(t,e,n)=>{n(27397);var i=n(47642);(0,n(87550).SF)("vaadin-text-field",i.k,{moduleId:"lumo-text-field-styles"}),n(27136)},54249:(t,e,n)=>{n.r(e),n.d(e,{LoaderRadialClass:()=>i.l,componentName:()=>i.T});var i=n(74713);customElements.define(i.T,i.l)},54690:(t,e,n)=>{n.r(e),n.d(e,{PasscodeClass:()=>C,componentName:()=>c});var i=n(79365),r=n(47168),o=n(79275),a=n(74713),l=n(9696),s=n(97810),p=n(73551),d=n(25964);const c=(0,s.xE)("passcode"),u=["digits"],{host:h,digitField:g,label:y,requiredIndicator:b,internalWrapper:f,focusedDigitField:m,errorMessage:v}={host:{selector:()=>":host"},focusedDigitField:{selector:()=>`${o.w.componentName}[focused="true"]`},digitField:{selector:()=>o.w.componentName},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:"descope-passcode-internal .wrapper"},errorMessage:{selector:"::part(error-message)"}},x=o.w.cssVarList,w=a.l.cssVarList,C=(0,l.Zz)((0,i.RF)({mappings:{fontSize:[{...g,property:x.fontSize},h],hostWidth:{property:"width"},hostDirection:{...h,property:"direction"},fontFamily:[h,{...y}],labelTextColor:[{...y,property:"color"},{...b,property:"color"}],labelRequiredIndicator:{...b,property:"content"},errorMessageTextColor:{...v,property:"color"},errorMessageIcon:{...v,property:"background-image"},errorMessageIconSize:{...v,property:"background-size"},errorMessageIconPadding:{...v,property:"padding-inline-start"},errorMessageIconRepeat:{...v,property:"background-repeat"},errorMessageIconPosition:{...v,property:"background-position"},digitValueTextColor:{selector:o.w.componentName,property:x.inputValueTextColor},digitSize:[{...g,property:"height"},{...g,property:"width"}],digitPadding:{...g,property:x.inputHorizontalPadding},digitTextAlign:{...g,property:x.inputTextAlign},digitCaretTextColor:{...g,property:x.inputCaretTextColor},digitSpacing:{...f,property:"gap"},digitOutlineColor:{...g,property:x.inputOutlineColor},digitOutlineWidth:{...g,property:x.inputOutlineWidth},focusedDigitFieldOutlineColor:{...m,property:x.inputOutlineColor},overlayOpacity:{...f,property:"opacity"},spinnerSize:{selector:a.l.componentName,property:w.spinnerSize}}}),i.VO,i.Yg,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,(t=>class extends t{static get observedAttributes(){return u.concat(t.observedAttributes||[])}get digits(){return Number.parseInt(this.getAttribute("digits"),10)||6}init(){super.init?.(),(0,d.fz)("\n .wrapper {\n display: flex;\n width: 100%;\n justify-content: space-between;\n direction: ltr;\n position: relative;\n }\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 ",this);const t=document.createElement("template");t.innerHTML=`\n <${r.T}\n bordered="true"\n name="code"\n tabindex="-1"\n slot="input"\n role="textbox"\n ><slot></slot></${r.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.T),(0,s.EA)(this,this.inputElement,{includeAttrs:["digits","size","loading"]})}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"digits"===t&&(this.style["--passcode-digits-count"]=n)}}))((0,i.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: calc(var(--passcode-digits-count) * 2em);\n\t\t\t}\n\t\t\t${(0,p.X6)()}\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(${x.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.$J)("vaadin-text-field")}\n\t\t\t${(0,p.I4)("vaadin-text-field")}\n \t`,excludeAttrsSync:["tabindex"],componentName:c}));n(21374),n(54249),n(59053),customElements.define(c,C)},59053:(t,e,n)=>{n.r(e);var i=n(47168);customElements.define(i.T,i.A)},73551:(t,e,n)=>{n.d(e,{$J:()=>u,I4:()=>a,Kl:()=>h,LJ:()=>c,Qv:()=>o,X6:()=>s,cy:()=>i,fu:()=>p,kG:()=>d,lS:()=>l,zm:()=>r});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 '},74713:(t,e,n)=>{n.d(e,{T:()=>s,l:()=>d});var i=n(79365),r=n(81365),o=n(9696),a=n(97810),l=n(25964);const s=(0,a.xE)("loader-radial");class p extends((0,r.q)({componentName:s,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div></div>\n\t",(0,l.fz)("\n @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 ",this)}}const d=(0,o.Zz)((0,i.RF)({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.VO,i.tQ)(p)},79275:(t,e,n)=>{n.d(e,{T:()=>s,w:()=>d});var i=n(79365),r=n(6424),o=n(9696),a=n(97810),l=n(73551);const s=(0,a.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,i.RF)({mappings:r.A}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),i.tQ,(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.tz)({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.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(d.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:s}))}}]);
|
38
38
|
//# sourceMappingURL=descope-passcode-index-js.js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EAEH,YADA/L,KAAK6L,MAAMG,SAIb,MAAMC,EAAiB,CACrBJ,KAAM,gBACNK,MAAO,OACP9M,MAAO,mBAGH+M,EAAmB,CACvBN,KAAM,wBACNK,MAAO,SACP9M,MAAO,mBAGTY,KAAK6L,KAAOO,OAAOC,OAAOrJ,SAASqG,cAAc,eAAgB,CAC/DiD,KAAM,YACHL,IAGLjM,KAAKsJ,YAAYC,YAAYvJ,KAAK6L,MAClC7L,KAAK6L,KAAKhG,iBAAiB,SAAS,KAClC0G,UAAUC,UAAUC,UAAUzM,KAAKb,OACnCiN,OAAOC,OAAOrM,KAAK6L,KAAMM,GAGzB/E,YAAW,KACTgF,OAAOC,OAAOrM,KAAK6L,KAAMI,EAAe,GACvC,IAAK,GAEZ,CAEA,YAAAS,GACE1M,KAAKnB,OACP,CAEA,wBAAA+I,CAAyBC,EAAU8E,EAAQC,GACzClN,MAAMmN,0BAA0BhF,EAAU8E,EAAQC,GAOjC,SAAb/E,GACF7H,KAAKsJ,YAAYvI,SAAS6L,GAGxBD,IAAWC,IACI,eAAb/E,EACa,aAAX+E,EACF5M,KAAK6F,iBAAiB,QAAS7F,KAAK0M,cAEpC1M,KAAK8M,oBAAoB,QAAS9M,KAAK0M,cAEnB,sBAAb7E,GACT7H,KAAK8L,sBAAiC,SAAXc,GAGjC,IAG0B,EAS5B,QAAY,CACVlD,MAAO,CAAC,SAAU,UAClBC,eAAgB,oBAChBvK,MAAO,IAAM,wGAIO8I,EAAeE,WAAW9K,4BACxC4K,EAAeE,WAAW7K,+cAc5B,QAAwB,gCAC3B,QAAuB2K,EAAeE,uBACtC,QAAoB,oBAAqBF,EAAeE,uBACrD,iGAMJwB,iBAAkB,CAAC,WAAY,SAC/BlG","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/helpers.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-field-mixin.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/theme/lumo/vaadin-text-field-styles.js","webpack://@descope/web-components-ui/./src/components/descope-loader-radial/index.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/PasscodeClass.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/index.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js","webpack://@descope/web-components-ui/./src/components/descope-loader-radial/LoaderRadialClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js"],"sourcesContent":["import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n};\n","export const INPUT_MASK_TEXT_PROP = '--descope-input-mask-content';\nexport const INPUT_MASK_DISPLAY_PROP = '--descope-input-mask-display';\nexport const INPUT_MASK_FALLBACK_PROP = '--descope-input-mask-fallback';\n\nexport const focusElement = (ele) => {\n ele?.focus();\n ele?.setSelectionRange?.(1, 1);\n};\n\nexport const sanitizeStr = (str) => {\n return str.replace(/\\D/g, '') || '';\n};\n\nexport const toggleMaskVisibility = (input, value) => {\n if (value) {\n input.style.setProperty(INPUT_MASK_TEXT_PROP, `\"${value}\"`);\n input.style.setProperty(INPUT_MASK_DISPLAY_PROP, 'flex');\n } else {\n input.style.removeProperty(INPUT_MASK_TEXT_PROP);\n input.style.removeProperty(INPUT_MASK_DISPLAY_PROP);\n }\n};\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<input>` element.\n */\nexport class InputController extends SlotController {\n constructor(host, callback) {\n super(host, 'input', 'input', {\n initializer: (node, host) => {\n if (host.value) {\n node.value = host.value;\n }\n if (host.type) {\n node.setAttribute('type', host.type);\n }\n\n // Ensure every instance has unique ID\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputController } from '@vaadin/field-base/src/input-controller.js';\nimport { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';\nimport { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';\n\n/**\n * A mixin providing common text field functionality.\n *\n * @polymerMixin\n * @mixes InputFieldMixin\n */\nexport const TextFieldMixin = (superClass) =>\n class TextFieldMixinClass extends InputFieldMixin(superClass) {\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'maxlength', 'minlength', 'pattern'];\n }\n\n static get constraints() {\n return [...super.constraints, 'maxlength', 'minlength', 'pattern'];\n }\n\n constructor() {\n super();\n this._setType('text');\n }\n\n /** @protected */\n get clearElement() {\n return this.$.clearButton;\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(\n new InputController(this, (input) => {\n this._setInputElement(input);\n this._setFocusElement(input);\n this.stateTarget = input;\n this.ariaTarget = input;\n }),\n );\n this.addController(new LabelledInputController(this.inputElement, this._labelController));\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/src/vaadin-input-container.js';\nimport { html, PolymerElement } from '@polymer/polymer';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { TextFieldMixin } from './vaadin-text-field-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-field-styles' });\n\n/**\n * `<vaadin-text-field>` is a web component that allows the user to input and edit text.\n *\n * ```html\n * <vaadin-text-field label=\"First Name\"></vaadin-text-field>\n * ```\n *\n * ### Prefixes and suffixes\n *\n * These are child elements of a `<vaadin-text-field>` that are displayed\n * inline with the input, before or after.\n * In order for an element to be considered as a prefix, it must have the slot\n * attribute set to `prefix` (and similarly for `suffix`).\n *\n * ```html\n * <vaadin-text-field label=\"Email address\">\n * <div slot=\"prefix\">Sent to:</div>\n * <div slot=\"suffix\">@vaadin.com</div>\n * </vaadin-text-field>\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * -------------------------------|----------------------------|---------\n * `--vaadin-field-default-width` | Default width of the field | `12em`\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ---------------------|----------------\n * `label` | The label element\n * `input-field` | The element that wraps prefix, value and suffix\n * `clear-button` | The clear button\n * `error-message` | The error message element\n * `helper-text` | The helper text element wrapper\n * `required-indicator` | The `required` state indicator element\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description | Part name\n * --------------------|-------------|------------\n * `disabled` | Set to a disabled text field | :host\n * `has-value` | Set when the element has a value | :host\n * `has-label` | Set when the element has a label | :host\n * `has-helper` | Set when the element has helper text or slot | :host\n * `has-error-message` | Set when the element has an error message | :host\n * `invalid` | Set when the element is invalid | :host\n * `input-prevented` | Temporarily set when invalid input is prevented | :host\n * `focused` | Set when the element is focused | :host\n * `focus-ring` | Set when the element is keyboard focused | :host\n * `readonly` | Set to a readonly text field | :host\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.\n * @fires {Event} change - Fired when the user commits a value change.\n * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.\n * @fires {CustomEvent} value-changed - Fired when the `value` property changes.\n * @fires {CustomEvent} validated - Fired whenever the field is validated.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes ThemableMixin\n * @mixes TextFieldMixin\n */\nexport class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolymerElement))) {\n static get is() {\n return 'vaadin-text-field';\n }\n\n static get template() {\n return html`\n <style>\n [part='input-field'] {\n flex-grow: 0;\n }\n </style>\n\n <div class=\"vaadin-field-container\">\n <div part=\"label\">\n <slot name=\"label\"></slot>\n <span part=\"required-indicator\" aria-hidden=\"true\" on-click=\"focus\"></span>\n </div>\n\n <vaadin-input-container\n part=\"input-field\"\n readonly=\"[[readonly]]\"\n disabled=\"[[disabled]]\"\n invalid=\"[[invalid]]\"\n theme$=\"[[_theme]]\"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <slot name=\"input\"></slot>\n <slot name=\"suffix\" slot=\"suffix\"></slot>\n <div id=\"clearButton\" part=\"clear-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n </vaadin-input-container>\n\n <div part=\"helper-text\">\n <slot name=\"helper\"></slot>\n </div>\n\n <div part=\"error-message\">\n <slot name=\"error-message\"></slot>\n </div>\n </div>\n <slot name=\"tooltip\"></slot>\n `;\n }\n\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n };\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this._tooltipController.setPosition('top');\n this._tooltipController.setAriaTarget(this.inputElement);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(TextField);\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputControlMixin } from './input-control-mixin.js';\n\n/**\n * A mixin to provide logic for vaadin-text-field and related components.\n *\n * @polymerMixin\n * @mixes InputControlMixin\n */\nexport const InputFieldMixin = (superclass) =>\n class InputFieldMixinClass extends InputControlMixin(superclass) {\n static get properties() {\n return {\n /**\n * Whether the value of the control can be automatically completed by the browser.\n * List of available options at:\n * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete\n */\n autocomplete: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari that is used to control whether\n * autocorrection should be enabled when the user is entering/editing the text.\n * Possible values are:\n * on: Enable autocorrection.\n * off: Disable autocorrection.\n */\n autocorrect: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari and Chrome that is used to control whether\n * autocapitalization should be enabled when the user is entering/editing the text.\n * Possible values are:\n * characters: Characters capitalization.\n * words: Words capitalization.\n * sentences: Sentences capitalization.\n * none: No capitalization.\n */\n autocapitalize: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'autocapitalize', 'autocomplete', 'autocorrect'];\n }\n\n // Workaround for https://github.com/Polymer/polymer/issues/5259\n get __data() {\n return this.__dataValue || {};\n }\n\n set __data(value) {\n this.__dataValue = value;\n }\n\n /**\n * @param {HTMLElement} input\n * @protected\n * @override\n */\n _inputElementChanged(input) {\n super._inputElementChanged(input);\n\n if (input) {\n // Discard value set on the custom slotted input.\n if (input.value && input.value !== this.value) {\n console.warn(`Please define value on the <${this.localName}> component!`);\n input.value = '';\n }\n\n if (this.value) {\n input.value = this.value;\n }\n }\n }\n\n /**\n * Override an event listener from `FocusMixin`.\n * @param {boolean} focused\n * @protected\n * @override\n */\n _setFocused(focused) {\n super._setFocused(focused);\n\n // Do not validate when focusout is caused by document\n // losing focus, which happens on browser tab switch.\n if (!focused && document.hasFocus()) {\n this.validate();\n }\n }\n\n /**\n * Override an event listener from `InputMixin`\n * to mark as valid after user started typing.\n * @param {Event} event\n * @protected\n * @override\n */\n _onInput(event) {\n super._onInput(event);\n\n if (this.invalid) {\n this.validate();\n }\n }\n\n /**\n * Override an observer from `InputMixin` to validate the field\n * when a new value is set programmatically.\n *\n * @param {string | undefined} newValue\n * @param {string | undefined} oldValue\n * @protected\n * @override\n */\n _valueChanged(newValue, oldValue) {\n super._valueChanged(newValue, oldValue);\n\n if (oldValue === undefined) {\n return;\n }\n\n if (this.invalid) {\n this.validate();\n }\n }\n };\n","/* eslint-disable no-param-reassign */\nimport debounce from 'lodash.debounce';\nimport { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';\nimport {\n sanitizeStr,\n focusElement,\n toggleMaskVisibility,\n INPUT_MASK_FALLBACK_PROP,\n INPUT_MASK_TEXT_PROP,\n INPUT_MASK_DISPLAY_PROP,\n} from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('passcode-internal');\n\nconst observedAttributes = ['digits', 'loading'];\n\nconst forwardAttributes = [\n 'disabled',\n 'bordered',\n 'size',\n 'invalid',\n 'readonly',\n 'aria-labelledby',\n];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass PasscodeInternal extends BaseInputClass {\n static get observedAttributes() {\n return observedAttributes.concat(BaseInputClass.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n 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`;\n\n this.wrapperEle = this.querySelector('.wrapper');\n this.loaderContainer = this.querySelector('.loader-container');\n }\n\n renderInputs() {\n const inputs = [...Array(this.digits).keys()].map(\n (idx) => `\n\t\t<descope-text-field\n\t\t\tdata-id=${idx}\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`\n );\n\n this.wrapperEle.innerHTML = inputs.join('');\n\n this.inputs = Array.from(this.querySelectorAll('descope-text-field'));\n\n this.initInputs();\n }\n\n handleLoadingState(isLoading) {\n if (isLoading) {\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n get digits() {\n return Number.parseInt(this.getAttribute('digits'), 10) || 6;\n }\n\n get value() {\n return this.inputs?.map(({ value }) => value).join('') || '';\n }\n\n set value(val) {\n if (val === this.value) return;\n\n this.parseInputValue(this.inputs[0], sanitizeStr(val));\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n if (this.pattern && !new RegExp(this.pattern).test(this.value)) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n init() {\n // we are adding listeners before calling to super because it's stopping the events\n this.addEventListener('focus', (e) => {\n // we want to ignore focus events we are dispatching\n if (e.isTrusted) this.inputs[0].focus();\n });\n\n super.init?.();\n\n this.renderInputs();\n }\n\n // eslint-disable-next-line class-methods-use-this\n getInputIdx(inputEle) {\n return Number.parseInt(inputEle.getAttribute('data-id'), 10);\n }\n\n getNextInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.min(currentIdx + 1, this.inputs.length - 1);\n return this.inputs[newIdx];\n }\n\n getPrevInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.max(currentIdx - 1, 0);\n return this.inputs[newIdx];\n }\n\n fillDigits(charArr, currentInput) {\n for (let i = 0; i < charArr.length; i += 1) {\n currentInput.value = charArr[i] ?? '';\n\n const nextInput = this.getNextInput(currentInput);\n\n if (nextInput === currentInput) break;\n currentInput = nextInput;\n }\n\n focusElement(currentInput);\n }\n\n parseInputValue(input, value = '') {\n const charArr = value.split('');\n\n if (!charArr.length) {\n // if we got an invalid value we want to clear the input\n input.value = '';\n } else this.fillDigits(charArr, input);\n }\n\n initInputs() {\n this.inputs.forEach((input) => {\n // During debounced input we hide the value with a mask.\n // This allows us to hide the multiple population of the first input\n // in case of an automated input (e.g. Safari OTP Autofill or paste).\n injectStyle(\n `\n vaadin-text-field::part(input-field)::before {\n ${INPUT_MASK_FALLBACK_PROP}: '';\n content: var(${INPUT_MASK_TEXT_PROP}, var(${INPUT_MASK_FALLBACK_PROP}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${INPUT_MASK_DISPLAY_PROP}, none);\n align-items: center;\n justify-content: center;\n }`,\n input\n );\n\n const handleParseInput = (val) => {\n this.parseInputValue(input, val);\n toggleMaskVisibility(input);\n };\n\n const debouncedHandleParseInput = debounce(handleParseInput, 20, { trailing: true });\n\n // sanitize the input\n input.addEventListener('input', (e) => {\n input.value = sanitizeStr(input.value);\n\n if (input.value) {\n toggleMaskVisibility(input, input.value[0]);\n }\n\n setTimeout(() => {\n if (e?.inputType === 'deleteContentBackward') {\n focusElement(this.getPrevInput(input));\n }\n });\n debouncedHandleParseInput(input.value);\n });\n\n // we want backspace to focus on the previous digit\n input.onkeydown = ({ key }) => {\n // when user deletes a digit, we want to focus the previous digit\n if (key === 'Backspace') {\n // if value is empty then the input element does not fire `input` event\n // if this is the case, we focus the element here.\n // otherwise, the focusElement occurs as part of the `input` event listener\n if (!input.value) {\n setTimeout(() => focusElement(this.getPrevInput(input)), 0);\n } else {\n input.setSelectionRange(1, 1);\n }\n } else if (key.length === 1) {\n // we want only characters and not command keys\n input.value = ''; // we are clearing the previous value so we can override it with the new value\n }\n };\n\n forwardAttrs(this, input, { includeAttrs: forwardAttributes });\n input.shadowRoot.querySelector('input').setAttribute('aria-label', 'passcode digit');\n });\n\n this.handleFocusEventsDispatching(this.inputs);\n this.handleInputEventDispatching();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n // sync attributes to inputs\n if (oldValue !== newValue) {\n if (observedAttributes.includes(attrName)) {\n if (attrName === 'digits') {\n this.renderInputs();\n }\n if (attrName === 'loading') {\n this.handleLoadingState(newValue === 'true');\n }\n }\n }\n }\n\n get pattern() {\n return `^$|^\\\\d{${this.digits},}$`;\n }\n}\n\nexport default PasscodeInternal;\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';\nimport { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';\nimport { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, {\n moduleId: 'lumo-text-field-styles',\n});\n","import { componentName, LoaderRadialClass } from './LoaderRadialClass';\n\ncustomElements.define(componentName, LoaderRadialClass);\n\nexport { LoaderRadialClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n inputOverrideValidConstraintsMixin,\n} from '../../mixins';\nimport { componentName as descopeInternalComponentName } from './descope-passcode-internal/PasscodeInternal';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { LoaderRadialClass } from '../descope-loader-radial/LoaderRadialClass';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport {\n resetInputCursor,\n resetInputLabelPosition,\n resetInputFieldDefaultWidth,\n} from '../../helpers/themeHelpers/resetHelpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('passcode');\n\nconst observedAttributes = ['digits'];\n\nconst customMixin = (superclass) =>\n class PasscodeMixinClass extends superclass {\n static get observedAttributes() {\n return observedAttributes.concat(superclass.observedAttributes || []);\n }\n\n get digits() {\n return Number.parseInt(this.getAttribute('digits'), 10) || 6;\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n .wrapper {\n display: flex;\n width: 100%;\n justify-content: space-between;\n direction: ltr;\n position: relative;\n }\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 `,\n this\n );\n\n const template = document.createElement('template');\n\n template.innerHTML = `\n <${descopeInternalComponentName}\n bordered=\"true\"\n name=\"code\"\n tabindex=\"-1\"\n slot=\"input\"\n role=\"textbox\"\n ><slot></slot></${descopeInternalComponentName}>\n `;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n\n forwardAttrs(this, this.inputElement, { includeAttrs: ['digits', 'size', 'loading'] });\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'digits') {\n this.style['--passcode-digits-count'] = newValue;\n }\n }\n };\n\nconst {\n host,\n digitField,\n label,\n requiredIndicator,\n internalWrapper,\n focusedDigitField,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n focusedDigitField: { selector: () => `${TextFieldClass.componentName}[focused=\"true\"]` },\n digitField: { selector: () => TextFieldClass.componentName },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n internalWrapper: { selector: 'descope-passcode-internal .wrapper' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nconst textVars = TextFieldClass.cssVarList;\nconst loaderVars = LoaderRadialClass.cssVarList;\n\nexport const PasscodeClass = compose(\n createStyleMixin({\n mappings: {\n fontSize: [{ ...digitField, property: textVars.fontSize }, host],\n hostWidth: { property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontFamily: [host, { ...label }],\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n digitValueTextColor: {\n selector: TextFieldClass.componentName,\n property: textVars.inputValueTextColor,\n },\n digitSize: [\n { ...digitField, property: 'height' },\n { ...digitField, property: 'width' },\n ],\n digitPadding: { ...digitField, property: textVars.inputHorizontalPadding },\n digitTextAlign: { ...digitField, property: textVars.inputTextAlign },\n digitCaretTextColor: { ...digitField, property: textVars.inputCaretTextColor },\n digitSpacing: { ...internalWrapper, property: 'gap' },\n digitOutlineColor: { ...digitField, property: textVars.inputOutlineColor },\n digitOutlineWidth: { ...digitField, property: textVars.inputOutlineWidth },\n\n focusedDigitFieldOutlineColor: { ...focusedDigitField, property: textVars.inputOutlineColor },\n overlayOpacity: { ...internalWrapper, property: 'opacity' },\n spinnerSize: { selector: LoaderRadialClass.componentName, property: loaderVars.spinnerSize },\n },\n }),\n draggableMixin,\n inputOverrideValidConstraintsMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n 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${resetInputFieldDefaultWidth()}\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(${textVars.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 ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${resetInputCursor('vaadin-text-field')}\n \t`,\n excludeAttrsSync: ['tabindex'],\n componentName,\n })\n);\n\nexport default PasscodeClass;\n","import { componentName, PasscodeClass } from './PasscodeClass';\nimport '../descope-text-field';\nimport '../descope-loader-radial';\nimport './descope-passcode-internal';\n\ncustomElements.define(componentName, PasscodeClass);\n\nexport { PasscodeClass, componentName };\n","import PasscodeInternal, { componentName } from './PasscodeInternal';\n\ncustomElements.define(componentName, PasscodeInternal);\n","export const useHostExternalPadding = (cssVarList) => `\n :host {\n padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))\n }\n`;\n\nexport const resetInputFieldUnderlayingBorder = (name) => `\n ${name}::part(input-field)::after {\n border: none;\n }\n`;\n\nexport const resetInitialHeight = (name) => `\n ${name}::before {\n\t\theight: unset;\n\t}\n`;\n\nexport const resetInputElement = (name) => `\n ${name} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputContainer = (name) => `\n ${name} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputField = (name) => `\n ${name}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`;\n\nexport const resetInputCursor = (name) => `\n ${name} > label,\n ${name}::part(label),\n ${name}::part(required-indicator) {\n cursor: pointer;\n }\n`;\n\nexport const resetInputPlaceholder = (name, ele = 'input') => `\n ${name}[disabled] > ${ele}:placeholder-shown,\n\t${name}[readonly] > ${ele}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`;\n\nexport const resetInputAutoFill = (name, cssVarList) => `\n ${name} input:-webkit-autofill,\n ${name} input:-webkit-autofill::first-line,\n ${name} input:-webkit-autofill:hover,\n ${name} input:-webkit-autofill:active,\n ${name} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${cssVarList.inputValueTextColor});\n box-shadow: 0 0 0 var(${cssVarList.inputHeight}) var(${cssVarList.inputBackgroundColor}) inset;\n }\n`;\n\nexport const resetInputFieldDefaultWidth = () => `\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputReadonlyStyle = (name) => `\n ${name}::part(input-field)::after {\n opacity: 0;\n }\n`;\n\nexport const resetInputFieldInvalidBackgroundColor = (name) => `\n ${name}::part(input-field)::after {\n background: none;\n }\n`;\n\nexport const resetInputOverrides = (name, cssVarList) => `\n ${resetInputContainer(name)}\n ${resetInputCursor(name)}\n ${resetInputPlaceholder(name)}\n ${resetInputField(name)}\n ${resetInputAutoFill(name, cssVarList)}\n ${resetInputFieldInvalidBackgroundColor(name)}\n ${resetInitialHeight(name)}\n ${resetInputElement(name)}\n ${resetInputFieldUnderlayingBorder(name)}\n`;\n\n// This function is used to support RTL correctly for input components.\n// It also fixes the error message to be displayed LTR since we currently\n// don't support RTL for error messages.\nexport const resetInputLabelPosition = (name) => `\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 ${name} [slot=\"label\"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`;\n\nexport const inputFloatingLabelStyle = () => {\n return `\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 `;\n};\n","import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('loader-radial');\n\nclass RawLoaderRadial extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div></div>\n\t`;\n\n injectStyle(\n `\n @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 `,\n this\n );\n }\n}\n\nexport const LoaderRadialClass = compose(\n createStyleMixin({\n mappings: {\n hostDisplay: { property: 'display' },\n spinnerSize: [{ property: 'width' }, { property: 'height' }],\n spinnerBorderWidth: { property: 'border-width' },\n spinnerBorderStyle: { property: 'border-style' },\n spinnerBorderRadius: { property: 'border-radius' },\n spinnerQuadrant1Color: { property: 'border-top-color' },\n spinnerQuadrant2Color: { property: 'border-bottom-color' },\n spinnerQuadrant3Color: { property: 'border-right-color' },\n spinnerQuadrant4Color: { property: 'border-left-color' },\n animationDuration: {},\n animationTimingFunction: {},\n animationIterationCount: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLoaderRadial);\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n 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(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\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 ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n"],"names":["createBaseInputClass","args","host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","fontSize","fontFamily","labelFontSize","property","labelFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","INPUT_MASK_TEXT_PROP","INPUT_MASK_DISPLAY_PROP","INPUT_MASK_FALLBACK_PROP","focusElement","ele","focus","setSelectionRange","sanitizeStr","str","replace","toggleMaskVisibility","value","style","setProperty","removeProperty","InputController","constructor","callback","super","initializer","node","type","setAttribute","id","this","defaultId","useUniqueId","customElements","define","TextFieldMixin","superClass","properties","maxlength","Number","minlength","pattern","String","delegateAttrs","constraints","_setType","clearElement","$","clearButton","ready","addController","_setInputElement","_setFocusElement","stateTarget","ariaTarget","inputElement","_labelController","moduleId","TextField","is","template","_tooltipController","setPosition","setAriaTarget","InputFieldMixin","superclass","autocomplete","autocorrect","autocapitalize","reflectToAttribute","__data","__dataValue","_inputElementChanged","console","warn","localName","_setFocused","focused","document","hasFocus","validate","_onInput","event","invalid","_valueChanged","newValue","oldValue","undefined","componentName","observedAttributes","forwardAttributes","BaseInputClass","baseSelector","concat","innerHTML","wrapperEle","querySelector","loaderContainer","renderInputs","inputs","Array","digits","keys","map","idx","join","from","querySelectorAll","initInputs","handleLoadingState","isLoading","removeAttribute","parseInt","getAttribute","val","parseInputValue","getValidity","isRequired","valueMissing","RegExp","test","patternMismatch","init","addEventListener","e","isTrusted","getInputIdx","inputEle","getNextInput","currInput","currentIdx","newIdx","Math","min","length","getPrevInput","max","fillDigits","charArr","currentInput","i","nextInput","split","forEach","debouncedHandleParseInput","trailing","setTimeout","inputType","onkeydown","key","includeAttrs","shadowRoot","handleFocusEventsDispatching","handleInputEventDispatching","attributeChangedCallback","attrName","includes","digitField","internalWrapper","focusedDigitField","TextFieldClass","textVars","cssVarList","loaderVars","LoaderRadialClass","PasscodeClass","mappings","digitValueTextColor","digitSize","digitPadding","digitTextAlign","digitCaretTextColor","digitSpacing","digitOutlineColor","digitOutlineWidth","focusedDigitFieldOutlineColor","overlayOpacity","spinnerSize","proxyProps","createElement","baseElement","appendChild","content","cloneNode","slots","wrappedEleName","excludeAttrsSync","useHostExternalPadding","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","RawLoaderRadial","attachShadow","mode","hostDisplay","spinnerBorderWidth","spinnerBorderStyle","spinnerBorderRadius","spinnerQuadrant1Color","spinnerQuadrant2Color","spinnerQuadrant3Color","spinnerQuadrant4Color","animationDuration","animationTimingFunction","animationIterationCount","observedAttrs","useProxyTargets","icon","renderCopyToClipboard","shouldRender","remove","iconInitConfig","title","iconCopiedConfig","Object","assign","slot","navigator","clipboard","writeText","onLabelClick","oldVal","newVal","attributeChangeCallback","removeEventListener"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"descope-passcode-index-js.js","mappings":";4MASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,qCCfvB,MAAM,KACJC,EAAI,MACJC,EAAK,YACLC,EAAW,kBACXC,EAAiB,WACjBC,EAAU,MACVC,EAAK,UACLC,EAAS,WACTC,EAAU,aACVC,EAAY,oBACZC,EAAmB,cACnBC,EAAa,UACbC,EAAS,cACTC,EAAa,sBACbC,EAAqB,oBACr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AAUzM,KAAKb,OACnCiN,OAAOC,OAAOrM,KAAK6L,KAAMM,GAGzB/E,YAAW,KACTgF,OAAOC,OAAOrM,KAAK6L,KAAMI,EAAe,GACvC,IAAK,GAEZ,CAEA,YAAAS,GACE1M,KAAKnB,OACP,CAEA,wBAAA+I,CAAyBC,EAAU8E,EAAQC,GACzClN,MAAMmN,0BAA0BhF,EAAU8E,EAAQC,GAOjC,SAAb/E,GACF7H,KAAKsJ,YAAYvI,SAAS6L,GAGxBD,IAAWC,IACI,eAAb/E,EACa,aAAX+E,EACF5M,KAAK6F,iBAAiB,QAAS7F,KAAK0M,cAEpC1M,KAAK8M,oBAAoB,QAAS9M,KAAK0M,cAEnB,sBAAb7E,GACT7H,KAAK8L,sBAAiC,SAAXc,GAGjC,IAG0B,EAS5B,QAAY,CACVlD,MAAO,CAAC,SAAU,UAClBC,eAAgB,oBAChBvK,MAAO,IAAM,wGAIO8I,EAAeE,WAAW9K,4BACxC4K,EAAeE,WAAW7K,+cAc5B,QAAwB,gCAC3B,QAAuB2K,EAAeE,uBACtC,QAAoB,oBAAqBF,EAAeE,uBACrD,iGAMJwB,iBAAkB,CAAC,WAAY,SAC/BlG","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/helpers.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-field-mixin.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/theme/lumo/vaadin-text-field-styles.js","webpack://@descope/web-components-ui/./src/components/descope-loader-radial/index.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/PasscodeClass.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/index.js","webpack://@descope/web-components-ui/./src/components/descope-passcode/descope-passcode-internal/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js","webpack://@descope/web-components-ui/./src/components/descope-loader-radial/LoaderRadialClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js"],"sourcesContent":["import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n};\n","export const INPUT_MASK_TEXT_PROP = '--descope-input-mask-content';\nexport const INPUT_MASK_DISPLAY_PROP = '--descope-input-mask-display';\nexport const INPUT_MASK_FALLBACK_PROP = '--descope-input-mask-fallback';\n\nexport const focusElement = (ele) => {\n ele?.focus();\n ele?.setSelectionRange?.(1, 1);\n};\n\nexport const sanitizeStr = (str) => {\n return str.replace(/\\D/g, '') || '';\n};\n\nexport const toggleMaskVisibility = (input, value) => {\n if (value) {\n input.style.setProperty(INPUT_MASK_TEXT_PROP, `\"${value}\"`);\n input.style.setProperty(INPUT_MASK_DISPLAY_PROP, 'flex');\n } else {\n input.style.removeProperty(INPUT_MASK_TEXT_PROP);\n input.style.removeProperty(INPUT_MASK_DISPLAY_PROP);\n }\n};\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<input>` element.\n */\nexport class InputController extends SlotController {\n constructor(host, callback) {\n super(host, 'input', 'input', {\n initializer: (node, host) => {\n if (host.value) {\n node.value = host.value;\n }\n if (host.type) {\n node.setAttribute('type', host.type);\n }\n\n // Ensure every instance has unique ID\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputController } from '@vaadin/field-base/src/input-controller.js';\nimport { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';\nimport { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';\n\n/**\n * A mixin providing common text field functionality.\n *\n * @polymerMixin\n * @mixes InputFieldMixin\n */\nexport const TextFieldMixin = (superClass) =>\n class TextFieldMixinClass extends InputFieldMixin(superClass) {\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'maxlength', 'minlength', 'pattern'];\n }\n\n static get constraints() {\n return [...super.constraints, 'maxlength', 'minlength', 'pattern'];\n }\n\n constructor() {\n super();\n this._setType('text');\n }\n\n /** @protected */\n get clearElement() {\n return this.$.clearButton;\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(\n new InputController(this, (input) => {\n this._setInputElement(input);\n this._setFocusElement(input);\n this.stateTarget = input;\n this.ariaTarget = input;\n }),\n );\n this.addController(new LabelledInputController(this.inputElement, this._labelController));\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/src/vaadin-input-container.js';\nimport { html, PolymerElement } from '@polymer/polymer';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { TextFieldMixin } from './vaadin-text-field-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-field-styles' });\n\n/**\n * `<vaadin-text-field>` is a web component that allows the user to input and edit text.\n *\n * ```html\n * <vaadin-text-field label=\"First Name\"></vaadin-text-field>\n * ```\n *\n * ### Prefixes and suffixes\n *\n * These are child elements of a `<vaadin-text-field>` that are displayed\n * inline with the input, before or after.\n * In order for an element to be considered as a prefix, it must have the slot\n * attribute set to `prefix` (and similarly for `suffix`).\n *\n * ```html\n * <vaadin-text-field label=\"Email address\">\n * <div slot=\"prefix\">Sent to:</div>\n * <div slot=\"suffix\">@vaadin.com</div>\n * </vaadin-text-field>\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * -------------------------------|----------------------------|---------\n * `--vaadin-field-default-width` | Default width of the field | `12em`\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ---------------------|----------------\n * `label` | The label element\n * `input-field` | The element that wraps prefix, value and suffix\n * `clear-button` | The clear button\n * `error-message` | The error message element\n * `helper-text` | The helper text element wrapper\n * `required-indicator` | The `required` state indicator element\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description | Part name\n * --------------------|-------------|------------\n * `disabled` | Set to a disabled text field | :host\n * `has-value` | Set when the element has a value | :host\n * `has-label` | Set when the element has a label | :host\n * `has-helper` | Set when the element has helper text or slot | :host\n * `has-error-message` | Set when the element has an error message | :host\n * `invalid` | Set when the element is invalid | :host\n * `input-prevented` | Temporarily set when invalid input is prevented | :host\n * `focused` | Set when the element is focused | :host\n * `focus-ring` | Set when the element is keyboard focused | :host\n * `readonly` | Set to a readonly text field | :host\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.\n * @fires {Event} change - Fired when the user commits a value change.\n * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.\n * @fires {CustomEvent} value-changed - Fired when the `value` property changes.\n * @fires {CustomEvent} validated - Fired whenever the field is validated.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes ThemableMixin\n * @mixes TextFieldMixin\n */\nexport class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolymerElement))) {\n static get is() {\n return 'vaadin-text-field';\n }\n\n static get template() {\n return html`\n <style>\n [part='input-field'] {\n flex-grow: 0;\n }\n </style>\n\n <div class=\"vaadin-field-container\">\n <div part=\"label\">\n <slot name=\"label\"></slot>\n <span part=\"required-indicator\" aria-hidden=\"true\" on-click=\"focus\"></span>\n </div>\n\n <vaadin-input-container\n part=\"input-field\"\n readonly=\"[[readonly]]\"\n disabled=\"[[disabled]]\"\n invalid=\"[[invalid]]\"\n theme$=\"[[_theme]]\"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <slot name=\"input\"></slot>\n <slot name=\"suffix\" slot=\"suffix\"></slot>\n <div id=\"clearButton\" part=\"clear-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n </vaadin-input-container>\n\n <div part=\"helper-text\">\n <slot name=\"helper\"></slot>\n </div>\n\n <div part=\"error-message\">\n <slot name=\"error-message\"></slot>\n </div>\n </div>\n <slot name=\"tooltip\"></slot>\n `;\n }\n\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n };\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this._tooltipController.setPosition('top');\n this._tooltipController.setAriaTarget(this.inputElement);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(TextField);\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputControlMixin } from './input-control-mixin.js';\n\n/**\n * A mixin to provide logic for vaadin-text-field and related components.\n *\n * @polymerMixin\n * @mixes InputControlMixin\n */\nexport const InputFieldMixin = (superclass) =>\n class InputFieldMixinClass extends InputControlMixin(superclass) {\n static get properties() {\n return {\n /**\n * Whether the value of the control can be automatically completed by the browser.\n * List of available options at:\n * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete\n */\n autocomplete: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari that is used to control whether\n * autocorrection should be enabled when the user is entering/editing the text.\n * Possible values are:\n * on: Enable autocorrection.\n * off: Disable autocorrection.\n */\n autocorrect: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari and Chrome that is used to control whether\n * autocapitalization should be enabled when the user is entering/editing the text.\n * Possible values are:\n * characters: Characters capitalization.\n * words: Words capitalization.\n * sentences: Sentences capitalization.\n * none: No capitalization.\n */\n autocapitalize: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'autocapitalize', 'autocomplete', 'autocorrect'];\n }\n\n // Workaround for https://github.com/Polymer/polymer/issues/5259\n get __data() {\n return this.__dataValue || {};\n }\n\n set __data(value) {\n this.__dataValue = value;\n }\n\n /**\n * @param {HTMLElement} input\n * @protected\n * @override\n */\n _inputElementChanged(input) {\n super._inputElementChanged(input);\n\n if (input) {\n // Discard value set on the custom slotted input.\n if (input.value && input.value !== this.value) {\n console.warn(`Please define value on the <${this.localName}> component!`);\n input.value = '';\n }\n\n if (this.value) {\n input.value = this.value;\n }\n }\n }\n\n /**\n * Override an event listener from `FocusMixin`.\n * @param {boolean} focused\n * @protected\n * @override\n */\n _setFocused(focused) {\n super._setFocused(focused);\n\n // Do not validate when focusout is caused by document\n // losing focus, which happens on browser tab switch.\n if (!focused && document.hasFocus()) {\n this.validate();\n }\n }\n\n /**\n * Override an event listener from `InputMixin`\n * to mark as valid after user started typing.\n * @param {Event} event\n * @protected\n * @override\n */\n _onInput(event) {\n super._onInput(event);\n\n if (this.invalid) {\n this.validate();\n }\n }\n\n /**\n * Override an observer from `InputMixin` to validate the field\n * when a new value is set programmatically.\n *\n * @param {string | undefined} newValue\n * @param {string | undefined} oldValue\n * @protected\n * @override\n */\n _valueChanged(newValue, oldValue) {\n super._valueChanged(newValue, oldValue);\n\n if (oldValue === undefined) {\n return;\n }\n\n if (this.invalid) {\n this.validate();\n }\n }\n };\n","/* eslint-disable no-param-reassign */\nimport debounce from 'lodash.debounce';\nimport { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';\nimport {\n sanitizeStr,\n focusElement,\n toggleMaskVisibility,\n INPUT_MASK_FALLBACK_PROP,\n INPUT_MASK_TEXT_PROP,\n INPUT_MASK_DISPLAY_PROP,\n} from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('passcode-internal');\n\nconst observedAttributes = ['digits', 'loading'];\n\nconst forwardAttributes = [\n 'disabled',\n 'bordered',\n 'size',\n 'invalid',\n 'readonly',\n 'aria-labelledby',\n];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass PasscodeInternal extends BaseInputClass {\n static get observedAttributes() {\n return observedAttributes.concat(BaseInputClass.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n 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`;\n\n this.wrapperEle = this.querySelector('.wrapper');\n this.loaderContainer = this.querySelector('.loader-container');\n }\n\n renderInputs() {\n const inputs = [...Array(this.digits).keys()].map(\n (idx) => `\n\t\t<descope-text-field\n\t\t\tdata-id=${idx}\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`\n );\n\n this.wrapperEle.innerHTML = inputs.join('');\n\n this.inputs = Array.from(this.querySelectorAll('descope-text-field'));\n\n this.initInputs();\n }\n\n handleLoadingState(isLoading) {\n if (isLoading) {\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n get digits() {\n return Number.parseInt(this.getAttribute('digits'), 10) || 6;\n }\n\n get value() {\n return this.inputs?.map(({ value }) => value).join('') || '';\n }\n\n set value(val) {\n if (val === this.value) return;\n\n this.parseInputValue(this.inputs[0], sanitizeStr(val));\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n if (this.pattern && !new RegExp(this.pattern).test(this.value)) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n init() {\n // we are adding listeners before calling to super because it's stopping the events\n this.addEventListener('focus', (e) => {\n // we want to ignore focus events we are dispatching\n if (e.isTrusted) this.inputs[0].focus();\n });\n\n super.init?.();\n\n this.renderInputs();\n }\n\n // eslint-disable-next-line class-methods-use-this\n getInputIdx(inputEle) {\n return Number.parseInt(inputEle.getAttribute('data-id'), 10);\n }\n\n getNextInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.min(currentIdx + 1, this.inputs.length - 1);\n return this.inputs[newIdx];\n }\n\n getPrevInput(currInput) {\n const currentIdx = this.getInputIdx(currInput);\n const newIdx = Math.max(currentIdx - 1, 0);\n return this.inputs[newIdx];\n }\n\n fillDigits(charArr, currentInput) {\n for (let i = 0; i < charArr.length; i += 1) {\n currentInput.value = charArr[i] ?? '';\n\n const nextInput = this.getNextInput(currentInput);\n\n if (nextInput === currentInput) break;\n currentInput = nextInput;\n }\n\n focusElement(currentInput);\n }\n\n parseInputValue(input, value = '') {\n const charArr = value.split('');\n\n if (!charArr.length) {\n // if we got an invalid value we want to clear the input\n input.value = '';\n } else this.fillDigits(charArr, input);\n }\n\n initInputs() {\n this.inputs.forEach((input) => {\n // During debounced input we hide the value with a mask.\n // This allows us to hide the multiple population of the first input\n // in case of an automated input (e.g. Safari OTP Autofill or paste).\n injectStyle(\n `\n vaadin-text-field::part(input-field)::before {\n ${INPUT_MASK_FALLBACK_PROP}: '';\n content: var(${INPUT_MASK_TEXT_PROP}, var(${INPUT_MASK_FALLBACK_PROP}));\n position: absolute;\n width: 100%;\n height: 100%;\n display: var(${INPUT_MASK_DISPLAY_PROP}, none);\n align-items: center;\n justify-content: center;\n }`,\n input\n );\n\n const handleParseInput = (val) => {\n this.parseInputValue(input, val);\n toggleMaskVisibility(input);\n };\n\n const debouncedHandleParseInput = debounce(handleParseInput, 0, { trailing: true });\n\n // sanitize the input\n input.addEventListener('input', (e) => {\n input.value = sanitizeStr(input.value);\n\n if (input.value) {\n toggleMaskVisibility(input, input.value[0]);\n }\n\n setTimeout(() => {\n if (e?.inputType === 'deleteContentBackward') {\n focusElement(this.getPrevInput(input));\n }\n });\n debouncedHandleParseInput(input.value);\n });\n\n // we want backspace to focus on the previous digit\n input.onkeydown = ({ key }) => {\n // when user deletes a digit, we want to focus the previous digit\n if (key === 'Backspace') {\n // if value is empty then the input element does not fire `input` event\n // if this is the case, we focus the element here.\n // otherwise, the focusElement occurs as part of the `input` event listener\n if (!input.value) {\n setTimeout(() => focusElement(this.getPrevInput(input)), 0);\n } else {\n input.setSelectionRange(1, 1);\n }\n } else if (key.length === 1) {\n // we want only characters and not command keys\n input.value = ''; // we are clearing the previous value so we can override it with the new value\n }\n };\n\n forwardAttrs(this, input, { includeAttrs: forwardAttributes });\n input.shadowRoot.querySelector('input').setAttribute('aria-label', 'passcode digit');\n });\n\n this.handleFocusEventsDispatching(this.inputs);\n this.handleInputEventDispatching();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n // sync attributes to inputs\n if (oldValue !== newValue) {\n if (observedAttributes.includes(attrName)) {\n if (attrName === 'digits') {\n this.renderInputs();\n }\n if (attrName === 'loading') {\n this.handleLoadingState(newValue === 'true');\n }\n }\n }\n }\n\n get pattern() {\n return `^$|^\\\\d{${this.digits},}$`;\n }\n}\n\nexport default PasscodeInternal;\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';\nimport { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';\nimport { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, {\n moduleId: 'lumo-text-field-styles',\n});\n","import { componentName, LoaderRadialClass } from './LoaderRadialClass';\n\ncustomElements.define(componentName, LoaderRadialClass);\n\nexport { LoaderRadialClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n inputOverrideValidConstraintsMixin,\n} from '../../mixins';\nimport { componentName as descopeInternalComponentName } from './descope-passcode-internal/PasscodeInternal';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { LoaderRadialClass } from '../descope-loader-radial/LoaderRadialClass';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport {\n resetInputCursor,\n resetInputLabelPosition,\n resetInputFieldDefaultWidth,\n} from '../../helpers/themeHelpers/resetHelpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('passcode');\n\nconst observedAttributes = ['digits'];\n\nconst customMixin = (superclass) =>\n class PasscodeMixinClass extends superclass {\n static get observedAttributes() {\n return observedAttributes.concat(superclass.observedAttributes || []);\n }\n\n get digits() {\n return Number.parseInt(this.getAttribute('digits'), 10) || 6;\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n .wrapper {\n display: flex;\n width: 100%;\n justify-content: space-between;\n direction: ltr;\n position: relative;\n }\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 `,\n this\n );\n\n const template = document.createElement('template');\n\n template.innerHTML = `\n <${descopeInternalComponentName}\n bordered=\"true\"\n name=\"code\"\n tabindex=\"-1\"\n slot=\"input\"\n role=\"textbox\"\n ><slot></slot></${descopeInternalComponentName}>\n `;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n\n forwardAttrs(this, this.inputElement, { includeAttrs: ['digits', 'size', 'loading'] });\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'digits') {\n this.style['--passcode-digits-count'] = newValue;\n }\n }\n };\n\nconst {\n host,\n digitField,\n label,\n requiredIndicator,\n internalWrapper,\n focusedDigitField,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n focusedDigitField: { selector: () => `${TextFieldClass.componentName}[focused=\"true\"]` },\n digitField: { selector: () => TextFieldClass.componentName },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n internalWrapper: { selector: 'descope-passcode-internal .wrapper' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nconst textVars = TextFieldClass.cssVarList;\nconst loaderVars = LoaderRadialClass.cssVarList;\n\nexport const PasscodeClass = compose(\n createStyleMixin({\n mappings: {\n fontSize: [{ ...digitField, property: textVars.fontSize }, host],\n hostWidth: { property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontFamily: [host, { ...label }],\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n digitValueTextColor: {\n selector: TextFieldClass.componentName,\n property: textVars.inputValueTextColor,\n },\n digitSize: [\n { ...digitField, property: 'height' },\n { ...digitField, property: 'width' },\n ],\n digitPadding: { ...digitField, property: textVars.inputHorizontalPadding },\n digitTextAlign: { ...digitField, property: textVars.inputTextAlign },\n digitCaretTextColor: { ...digitField, property: textVars.inputCaretTextColor },\n digitSpacing: { ...internalWrapper, property: 'gap' },\n digitOutlineColor: { ...digitField, property: textVars.inputOutlineColor },\n digitOutlineWidth: { ...digitField, property: textVars.inputOutlineWidth },\n\n focusedDigitFieldOutlineColor: { ...focusedDigitField, property: textVars.inputOutlineColor },\n overlayOpacity: { ...internalWrapper, property: 'opacity' },\n spinnerSize: { selector: LoaderRadialClass.componentName, property: loaderVars.spinnerSize },\n },\n }),\n draggableMixin,\n inputOverrideValidConstraintsMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n 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${resetInputFieldDefaultWidth()}\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(${textVars.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 ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${resetInputCursor('vaadin-text-field')}\n \t`,\n excludeAttrsSync: ['tabindex'],\n componentName,\n })\n);\n\nexport default PasscodeClass;\n","import { componentName, PasscodeClass } from './PasscodeClass';\nimport '../descope-text-field';\nimport '../descope-loader-radial';\nimport './descope-passcode-internal';\n\ncustomElements.define(componentName, PasscodeClass);\n\nexport { PasscodeClass, componentName };\n","import PasscodeInternal, { componentName } from './PasscodeInternal';\n\ncustomElements.define(componentName, PasscodeInternal);\n","export const useHostExternalPadding = (cssVarList) => `\n :host {\n padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))\n }\n`;\n\nexport const resetInputFieldUnderlayingBorder = (name) => `\n ${name}::part(input-field)::after {\n border: none;\n }\n`;\n\nexport const resetInitialHeight = (name) => `\n ${name}::before {\n\t\theight: unset;\n\t}\n`;\n\nexport const resetInputElement = (name) => `\n ${name} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputContainer = (name) => `\n ${name} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputField = (name) => `\n ${name}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`;\n\nexport const resetInputCursor = (name) => `\n ${name} > label,\n ${name}::part(label),\n ${name}::part(required-indicator) {\n cursor: pointer;\n }\n`;\n\nexport const resetInputPlaceholder = (name, ele = 'input') => `\n ${name}[disabled] > ${ele}:placeholder-shown,\n\t${name}[readonly] > ${ele}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`;\n\nexport const resetInputAutoFill = (name, cssVarList) => `\n ${name} input:-webkit-autofill,\n ${name} input:-webkit-autofill::first-line,\n ${name} input:-webkit-autofill:hover,\n ${name} input:-webkit-autofill:active,\n ${name} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${cssVarList.inputValueTextColor});\n box-shadow: 0 0 0 var(${cssVarList.inputHeight}) var(${cssVarList.inputBackgroundColor}) inset;\n }\n`;\n\nexport const resetInputFieldDefaultWidth = () => `\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputReadonlyStyle = (name) => `\n ${name}::part(input-field)::after {\n opacity: 0;\n }\n`;\n\nexport const resetInputFieldInvalidBackgroundColor = (name) => `\n ${name}::part(input-field)::after {\n background: none;\n }\n`;\n\nexport const resetInputOverrides = (name, cssVarList) => `\n ${resetInputContainer(name)}\n ${resetInputCursor(name)}\n ${resetInputPlaceholder(name)}\n ${resetInputField(name)}\n ${resetInputAutoFill(name, cssVarList)}\n ${resetInputFieldInvalidBackgroundColor(name)}\n ${resetInitialHeight(name)}\n ${resetInputElement(name)}\n ${resetInputFieldUnderlayingBorder(name)}\n`;\n\n// This function is used to support RTL correctly for input components.\n// It also fixes the error message to be displayed LTR since we currently\n// don't support RTL for error messages.\nexport const resetInputLabelPosition = (name) => `\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 ${name} [slot=\"label\"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`;\n\nexport const inputFloatingLabelStyle = () => {\n return `\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 `;\n};\n","import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('loader-radial');\n\nclass RawLoaderRadial extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div></div>\n\t`;\n\n injectStyle(\n `\n @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 `,\n this\n );\n }\n}\n\nexport const LoaderRadialClass = compose(\n createStyleMixin({\n mappings: {\n hostDisplay: { property: 'display' },\n spinnerSize: [{ property: 'width' }, { property: 'height' }],\n spinnerBorderWidth: { property: 'border-width' },\n spinnerBorderStyle: { property: 'border-style' },\n spinnerBorderRadius: { property: 'border-radius' },\n spinnerQuadrant1Color: { property: 'border-top-color' },\n spinnerQuadrant2Color: { property: 'border-bottom-color' },\n spinnerQuadrant3Color: { property: 'border-right-color' },\n spinnerQuadrant4Color: { property: 'border-left-color' },\n animationDuration: {},\n animationTimingFunction: {},\n animationIterationCount: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLoaderRadial);\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n 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(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\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 ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n"],"names":["createBaseInputClass","args","host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","fontSize","fontFamily","labelFontSize","property","labelFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","INPUT_MASK_TEXT_PROP","INPUT_MASK_DISPLAY_PROP","INPUT_MASK_FALLBACK_PROP","focusElement","ele","focus","setSelectionRange","sanitizeStr","str","replace","toggleMaskVisibility","value","style","setProperty","removeProperty","InputController","constructor","callback","super","initializer","node","type","setAttribute","id","this","defaultId","useUniqueId","customElements","define","TextFieldMixin","superClass","properties","maxlength","Number","minlength","pattern","String","delegateAttrs","constraints","_setType","clearElement","$","clearButton","ready","addController","_setInputElement","_setFocusElement","stateTarget","ariaTarget","inputElement","_labelController","moduleId","TextField","is","template","_tooltipController","setPosition","setAriaTarget","InputFieldMixin","superclass","autocomplete","autocorrect","autocapitalize","reflectToAttribute","__data","__dataValue","_inputElementChanged","console","warn","localName","_setFocused","focused","document","hasFocus","validate","_onInput","event","invalid","_valueChanged","newValue","oldValue","undefined","componentName","observedAttributes","forwardAttributes","BaseInputClass","baseSelector","concat","innerHTML","wrapperEle","querySelector","loaderContainer","renderInputs","inputs","Array","digits","keys","map","idx","join","from","querySelectorAll","initInputs","handleLoadingState","isLoading","removeAttribute","parseInt","getAttribute","val","parseInputValue","getValidity","isRequired","valueMissing","RegExp","test","patternMismatch","init","addEventListener","e","isTrusted","getInputIdx","inputEle","getNextInput","currInput","currentIdx","newIdx","Math","min","length","getPrevInput","max","fillDigits","charArr","currentInput","i","nextInput","split","forEach","debouncedHandleParseInput","trailing","setTimeout","inputType","onkeydown","key","includeAttrs","shadowRoot","handleFocusEventsDispatching","handleInputEventDispatching","attributeChangedCallback","attrName","includes","digitField","internalWrapper","focusedDigitField","TextFieldClass","textVars","cssVarList","loaderVars","LoaderRadialClass","PasscodeClass","mappings","digitValueTextColor","digitSize","digitPadding","digitTextAlign","digitCaretTextColor","digitSpacing","digitOutlineColor","digitOutlineWidth","focusedDigitFieldOutlineColor","overlayOpacity","spinnerSize","proxyProps","createElement","baseElement","appendChild","content","cloneNode","slots","wrappedEleName","excludeAttrsSync","useHostExternalPadding","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","RawLoaderRadial","attachShadow","mode","hostDisplay","spinnerBorderWidth","spinnerBorderStyle","spinnerBorderRadius","spinnerQuadrant1Color","spinnerQuadrant2Color","spinnerQuadrant3Color","spinnerQuadrant4Color","animationDuration","animationTimingFunction","animationIterationCount","observedAttrs","useProxyTargets","icon","renderCopyToClipboard","shouldRender","remove","iconInitConfig","title","iconCopiedConfig","Object","assign","slot","navigator","clipboard","writeText","onLabelClick","oldVal","newVal","attributeChangeCallback","removeEventListener"],"sourceRoot":""}
|
package/package.json
CHANGED
@@ -174,7 +174,7 @@ class PasscodeInternal extends BaseInputClass {
|
|
174
174
|
toggleMaskVisibility(input);
|
175
175
|
};
|
176
176
|
|
177
|
-
const debouncedHandleParseInput = debounce(handleParseInput,
|
177
|
+
const debouncedHandleParseInput = debounce(handleParseInput, 0, { trailing: true });
|
178
178
|
|
179
179
|
// sanitize the input
|
180
180
|
input.addEventListener('input', (e) => {
|