@descope/web-components-ui 1.0.64 → 1.0.66

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/dist/cjs/index.cjs.js +6 -4
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +706 -464
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/233.js +5 -1
  6. package/dist/umd/314.js +283 -0
  7. package/dist/umd/314.js.LICENSE.txt +27 -0
  8. package/dist/umd/541.js +744 -0
  9. package/dist/umd/541.js.LICENSE.txt +21 -0
  10. package/dist/umd/725.js +37 -1
  11. package/dist/umd/786.js +1 -1
  12. package/dist/umd/824.js +229 -0
  13. package/dist/umd/{54.js.LICENSE.txt → 824.js.LICENSE.txt} +0 -6
  14. package/dist/umd/840.js +9 -9
  15. package/dist/umd/860.js +1 -0
  16. package/dist/umd/descope-button-index-js.js +1 -1
  17. package/dist/umd/descope-checkbox-index-js.js +1 -1
  18. package/dist/umd/descope-combo-box-index-js.js +1 -0
  19. package/dist/umd/descope-container-index-js.js +1 -1
  20. package/dist/umd/descope-date-picker-index-js.js +1 -1
  21. package/dist/umd/descope-divider-index-js.js +1 -1
  22. package/dist/umd/descope-email-field-index-js.js +1 -1
  23. package/dist/umd/descope-link-index-js.js +1 -1
  24. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  25. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  26. package/dist/umd/descope-logo-index-js.js +1 -1
  27. package/dist/umd/descope-number-field-index-js.js +1 -1
  28. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  29. package/dist/umd/descope-passcode-index-js.js +1 -1
  30. package/dist/umd/descope-password-field-index-js.js +1 -1
  31. package/dist/umd/descope-switch-toggle-index-js.js +1 -1
  32. package/dist/umd/descope-text-area-index-js.js +1 -1
  33. package/dist/umd/descope-text-field-index-js.js +1 -1
  34. package/dist/umd/descope-text-index-js.js +1 -1
  35. package/dist/umd/index.js +1 -1
  36. package/package.json +2 -1
  37. package/src/components/descope-combo-box/ComboBox.js +111 -0
  38. package/src/components/descope-combo-box/index.js +6 -0
  39. package/src/components/descope-passcode/Passcode.js +1 -0
  40. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +9 -5
  41. package/src/constants.js +3 -1
  42. package/src/helpers/componentHelpers.js +55 -36
  43. package/src/helpers/index.js +2 -1
  44. package/src/helpers/themeHelpers/index.js +3 -3
  45. package/src/mixins/createStyleMixin/index.js +116 -90
  46. package/src/mixins/index.js +1 -0
  47. package/src/mixins/inputMixin.js +12 -7
  48. package/src/mixins/portalMixin.js +62 -0
  49. package/src/mixins/proxyInputMixin.js +23 -22
  50. package/src/theme/components/comboBox.js +32 -0
  51. package/src/theme/components/index.js +3 -1
  52. package/dist/umd/54.js +0 -971
  53. package/dist/umd/666.js +0 -37
  54. /package/dist/umd/{666.js.LICENSE.txt → 725.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[453],{9929:(t,n,e)=>{e.r(n),e.d(n,{LoaderLinear:()=>p});var o=e(9725),a=e(9989),r=e(2061);const i=(0,e(4567).iY)("loader-linear");class s extends a.V{static get componentName(){return i}constructor(){super();const t=document.createElement("template");t.innerHTML="\n\t\t\t<style>\n\t\t\t\t@keyframes tilt {\n\t\t\t\t\t0% { transform: translateX(0); }\n\t\t\t\t\t50% { transform: translateX(400%); }\n\t\t\t\t}\n\t\t\t\t:host {\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tdisplay: inline-block\n\t\t\t\t}\n\t\t\t\tdiv::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tanimation-name: tilt;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tleft: 0;\n\t\t\t\t}\n\n\t\t\t\t:host > div {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div></div>\n\t\t",this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div"}}const{root:c,after:l,host:d}={root:{},after:{selector:"::after"},host:{selector:()=>":host"}},p=(0,r.qC)((0,o.yk)({mappings:{display:c,width:d,height:[c,l],borderRadius:[c,l],surfaceColor:[{property:"background-color"}],barColor:[{...l,property:"background-color"}],barWidth:{...l,property:"width"},animationDuration:[c,l],animationTimingFunction:[c,l],animationIterationCount:[c,l]}}),o.e4,o.Ae)(s);customElements.define(i,p)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[453],{9929:(t,n,e)=>{e.r(n),e.d(n,{LoaderLinear:()=>p});var o=e(6860),a=e(9989),r=e(2061);const i=(0,e(4567).iY)("loader-linear");class s extends a.V{static get componentName(){return i}constructor(){super();const t=document.createElement("template");t.innerHTML="\n\t\t\t<style>\n\t\t\t\t@keyframes tilt {\n\t\t\t\t\t0% { transform: translateX(0); }\n\t\t\t\t\t50% { transform: translateX(400%); }\n\t\t\t\t}\n\t\t\t\t:host {\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tdisplay: inline-block\n\t\t\t\t}\n\t\t\t\tdiv::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tanimation-name: tilt;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tleft: 0;\n\t\t\t\t}\n\n\t\t\t\t:host > div {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div></div>\n\t\t",this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div"}}const{root:c,after:l,host:d}={root:{},after:{selector:"::after"},host:{selector:()=>":host"}},p=(0,r.qC)((0,o.yk)({mappings:{display:c,width:d,height:[c,l],borderRadius:[c,l],surfaceColor:[{property:"background-color"}],barColor:[{...l,property:"background-color"}],barWidth:{...l,property:"width"},animationDuration:[c,l],animationTimingFunction:[c,l],animationIterationCount:[c,l]}}),o.e4,o.Ae)(s);customElements.define(i,p)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[72],{7603:(t,e,o)=>{o.r(e),o.d(e,{LoaderRadial:()=>p});var n=o(9725),r=o(9989),i=o(2061);const s=(0,o(4567).iY)("loader-radial");class a extends r.V{static get componentName(){return s}constructor(){super();const t=document.createElement("template");t.innerHTML="\n\t\t\t<style>\n\t\t\t\t@keyframes spin {\n\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t}\n\t\t\t\t:host {\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tanimation-name: spin;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div></div>\n\t\t",this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div"}}const p=(0,i.qC)((0,n.yk)({mappings:{display:{},width:{},height:{},spinnerWidth:{property:"border-width"},spinnerStyle:{property:"border-style"},spinnerRadius:{property:"border-radius"},spinnerTopColor:{property:"border-top-color"},spinnerBottomColor:{property:"border-bottom-color"},spinnerRightColor:{property:"border-right-color"},spinnerLeftColor:{property:"border-left-color"},color:{},animationDuration:{},animationTimingFunction:{},animationIterationCount:{}}}),n.e4,n.Ae)(a);customElements.define(s,p)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[72],{7603:(t,e,o)=>{o.r(e),o.d(e,{LoaderRadial:()=>p});var n=o(6860),r=o(9989),i=o(2061);const s=(0,o(4567).iY)("loader-radial");class a extends r.V{static get componentName(){return s}constructor(){super();const t=document.createElement("template");t.innerHTML="\n\t\t\t<style>\n\t\t\t\t@keyframes spin {\n\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t}\n\t\t\t\t:host {\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tanimation-name: spin;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div></div>\n\t\t",this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div"}}const p=(0,i.qC)((0,n.yk)({mappings:{display:{},width:{},height:{},spinnerWidth:{property:"border-width"},spinnerStyle:{property:"border-style"},spinnerRadius:{property:"border-radius"},spinnerTopColor:{property:"border-top-color"},spinnerBottomColor:{property:"border-bottom-color"},spinnerRightColor:{property:"border-right-color"},spinnerLeftColor:{property:"border-left-color"},color:{},animationDuration:{},animationTimingFunction:{},animationIterationCount:{}}}),n.e4,n.Ae)(a);customElements.define(s,p)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[984],{4641:(t,e,n)=>{n.r(e),n.d(e,{Logo:()=>d});var s=n(9725),o=n(9989),c=n(2061);const l=(0,n(4567).iY)("logo");let a;class i extends o.V{static get componentName(){return l}constructor(){super();const t=document.createElement("template");t.innerHTML=`\n\t\t<style>\n\t\t\t${a}\n\t\t</style>\n\t\t<div></div>`,this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div"}}const r=(0,c.qC)((0,s.yk)({mappings:{height:{},width:{},url:{},fallbackUrl:{}}}),s.e4,s.Ae)(i);a=`\n:host {\n\tdisplay: inline-flex;\n}\n:host > div {\n\tdisplay: inline-block;\n\tcontent: var(${r.cssVarList.url}, var(${r.cssVarList.fallbackUrl}));\n}\n`;const d=r;customElements.define(l,d)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[984],{4641:(t,e,n)=>{n.r(e),n.d(e,{Logo:()=>d});var s=n(6860),o=n(9989),c=n(2061);const l=(0,n(4567).iY)("logo");let a;class i extends o.V{static get componentName(){return l}constructor(){super();const t=document.createElement("template");t.innerHTML=`\n\t\t<style>\n\t\t\t${a}\n\t\t</style>\n\t\t<div></div>`,this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div"}}const r=(0,c.qC)((0,s.yk)({mappings:{height:{},width:{},url:{},fallbackUrl:{}}}),s.e4,s.Ae)(i);a=`\n:host {\n\tdisplay: inline-flex;\n}\n:host > div {\n\tdisplay: inline-block;\n\tcontent: var(${r.cssVarList.url}, var(${r.cssVarList.fallbackUrl}));\n}\n`;const d=r;customElements.define(l,d)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[142],{4951:(t,n,e)=>{e.r(n),e.d(n,{NumberField:()=>s}),e(5806);var i=e(9725),a=e(4447),r=e(2061);const l=(0,e(4567).iY)("number-field");let d="";const o=(0,r.qC)((0,i.yk)({mappings:{...a.Z}}),i.e4,i.dj,i.Ae)((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-number-field",style:()=>d,excludeAttrsSync:["tabindex"],componentName:l}));d=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\tvaadin-number-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\tvaadin-number-field::part(input-field) {\n\t\toverflow: hidden;\n\t}\n\tvaadin-number-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-number-field input:-webkit-autofill,\n\tvaadin-number-field input:-webkit-autofill::first-line,\n\tvaadin-number-field input:-webkit-autofill:hover,\n\tvaadin-number-field input:-webkit-autofill:active,\n\tvaadin-number-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${o.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${o.cssVarList.height}) var(${o.cssVarList.backgroundColor}) inset;\n\t}\n\tvaadin-number-field > label,\n\tvaadin-number-field::part(input-field) {\n\t\tcursor: pointer;\n\t\tcolor: var(${o.cssVarList.color});\n\t}\n\tvaadin-number-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-number-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${o.cssVarList.color});\n\t}\n\tvaadin-number-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n`;const s=o;customElements.define(l,s)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[142],{4951:(t,n,e)=>{e.r(n),e.d(n,{NumberField:()=>s}),e(5806);var i=e(6860),a=e(4447),r=e(2061);const l=(0,e(4567).iY)("number-field");let d="";const o=(0,r.qC)((0,i.yk)({mappings:{...a.Z}}),i.e4,i.dj,i.Ae)((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-number-field",style:()=>d,excludeAttrsSync:["tabindex"],componentName:l}));d=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\tvaadin-number-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\tvaadin-number-field::part(input-field) {\n\t\toverflow: hidden;\n\t}\n\tvaadin-number-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-number-field input:-webkit-autofill,\n\tvaadin-number-field input:-webkit-autofill::first-line,\n\tvaadin-number-field input:-webkit-autofill:hover,\n\tvaadin-number-field input:-webkit-autofill:active,\n\tvaadin-number-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${o.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${o.cssVarList.height}) var(${o.cssVarList.backgroundColor}) inset;\n\t}\n\tvaadin-number-field > label,\n\tvaadin-number-field::part(input-field) {\n\t\tcursor: pointer;\n\t\tcolor: var(${o.cssVarList.color});\n\t}\n\tvaadin-number-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-number-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${o.cssVarList.color});\n\t}\n\tvaadin-number-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n`;const s=o;customElements.define(l,s)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[841],{1079:(t,e,s)=>{s.d(e,{f:()=>r,Z:()=>l});const i=(0,s(9725).y7)(HTMLElement);var n=s(4567);const a=t=>{t?.focus(),t?.setSelectionRange(1,1)},u=t=>{const e=t.replace(/\s/g,"");return e.match(/^\d+$/)?[...e]:[]},r=(0,n.iY)("passcode-internal");class d extends i{static get observedAttributes(){return[...i.observedAttributes,"disabled","bordered","size"]}static get componentName(){return r}constructor(){super();const t=document.createElement("template"),e=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tst-width="35px"\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="none"\n\t\t></descope-text-field>\n\t`));t.innerHTML=`\n\t\t<div>\n\t\t\t${e.join("")}\n\t\t</div>\n\t\t`,this.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div",this.inputs=Array.from(this.querySelectorAll("descope-text-field"))}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}get value(){return this.inputs.map((({value:t})=>t)).join("")}set value(t){if(t===this.value)return;const e=u(t);e.length&&this.fillDigits(e,this.inputs[0])}get pattern(){return`^$|^\\d{${this.digits},}$`}handleInputsInvalid(){setTimeout((()=>{this.hasAttribute("invalid")&&this.inputs.forEach((t=>t.setAttribute("invalid","true")))}))}handleInputsValid(){this.inputs.forEach((t=>t.removeAttribute("invalid")))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}handleFocus(){this.inputs[0].focus()}async connectedCallback(){super.connectedCallback(),this.initInputs(),this.addEventListener("invalid",this.handleInputsInvalid),this.addEventListener("valid",this.handleInputsValid)}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),s=Math.min(e+1,this.inputs.length-1);return this.inputs[s]}getPrevInput(t){const e=this.getInputIdx(t),s=Math.max(e-1,0);return this.inputs[s]}fillDigits(t,e){for(let s=0;s<t.length;s+=1){e.value=t[s]??"";const i=this.getNextInput(e);if(i===e)break;e=i}!e.hasAttribute("focused")&&a(e)}handleBlur(){this.handleInputsInvalid()}initInputs(){this.inputs.forEach((t=>{t.addEventListener("blur",(()=>{const t=setTimeout((()=>{this.dispatchBlur()}));this.inputs.forEach((e=>e.addEventListener("focus",(()=>clearTimeout(t)),{once:!0})))})),t.oninput=()=>{const e=u(t.value);e.length?this.fillDigits(e,t):t.value="",this.dispatchInput()},t.onkeydown=({key:e})=>{if("Backspace"===e){t.value="";const e=this.getPrevInput(t);!e.hasAttribute("focused")&&setTimeout((()=>{a(e)})),this.dispatchInput()}else e.match(/^(\d)$/g)&&(t.value="")}}))}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),e!==s&&d.observedAttributes.includes(t)&&!i.observedAttributes.includes(t)&&this.inputs.forEach((e=>e.setAttribute(t,s)))}}const l=d},4775:(t,e,s)=>{s.r(e);var i=s(1079);customElements.define(i.f,i.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[841],{1079:(t,e,s)=>{s.d(e,{f:()=>r,Z:()=>l});const i=(0,s(6860).y7)(HTMLElement);var n=s(4567);const a=t=>{t?.focus(),t?.setSelectionRange(1,1)},u=t=>{const e=t.replace(/\s/g,"");return e.match(/^\d+$/)?[...e]:[]},r=(0,n.iY)("passcode-internal");class d extends i{static get observedAttributes(){return[...i.observedAttributes,"disabled","bordered","size","readonly"]}static get componentName(){return r}constructor(){super();const t=document.createElement("template"),e=[...Array(this.digits).keys()].map((t=>`\n\t\t<descope-text-field\n\t\t\tst-width="35px"\n\t\t\tdata-id=${t}\n\t\t\ttype="tel"\n\t\t\tautocomplete="none"\n\t\t></descope-text-field>\n\t`));t.innerHTML=`\n\t\t<div>\n\t\t\t${e.join("")}\n\t\t</div>\n\t\t`,this.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > div",this.inputs=Array.from(this.querySelectorAll("descope-text-field"))}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}get value(){return this.inputs.map((({value:t})=>t)).join("")}set value(t){if(t===this.value)return;const e=u(t);e.length&&this.fillDigits(e,this.inputs[0])}get pattern(){return`^$|^\\d{${this.digits},}$`}handleInputsInvalid(){setTimeout((()=>{this.hasAttribute("invalid")&&this.inputs.forEach((t=>t.setAttribute("invalid","true")))}))}handleInputsValid(){this.inputs.forEach((t=>t.removeAttribute("invalid")))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:this.pattern&&!new RegExp(this.pattern).test(this.value)?{patternMismatch:!0}:{}}handleFocus(){this.inputs[0].focus()}async connectedCallback(){super.connectedCallback(),this.initInputs(),this.addEventListener("invalid",this.handleInputsInvalid),this.addEventListener("valid",this.handleInputsValid)}getInputIdx(t){return Number.parseInt(t.getAttribute("data-id"),10)}getNextInput(t){const e=this.getInputIdx(t),s=Math.min(e+1,this.inputs.length-1);return this.inputs[s]}getPrevInput(t){const e=this.getInputIdx(t),s=Math.max(e-1,0);return this.inputs[s]}fillDigits(t,e){for(let s=0;s<t.length;s+=1){e.value=t[s]??"";const i=this.getNextInput(e);if(i===e)break;e=i}!e.hasAttribute("focused")&&a(e)}handleBlur(){this.handleInputsInvalid()}initInputs(){this.inputs.forEach((t=>{t.addEventListener("blur",(t=>{t.stopPropagation();const e=setTimeout((()=>{this.dispatchBlur()}));this.inputs.forEach((t=>t.addEventListener("focus",(()=>clearTimeout(e)),{once:!0})))})),t.oninput=e=>{e.stopPropagation();const s=u(t.value);s.length?this.fillDigits(s,t):t.value="",this.dispatchInput()},t.onkeydown=({key:e})=>{if("Backspace"===e){t.value="";const e=this.getPrevInput(t);!e.hasAttribute("focused")&&setTimeout((()=>{a(e)})),this.dispatchInput()}else e.match(/^(\d)$/g)&&(t.value="")}}))}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),e!==s&&d.observedAttributes.includes(t)&&!i.observedAttributes.includes(t)&&this.inputs.forEach((e=>e.setAttribute(t,s)))}}const l=d},4775:(t,e,s)=>{s.r(e);var i=s(1079);customElements.define(i.f,i.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[939],{7102:(t,e,n)=>{n.r(e);var i=n(9725),r=n(4447),d=n(1079),a=n(9063),o=n(2061),l=n(4567);const s=(0,l.iY)("passcode"),{borderStyle:p,borderWidth:c,...u}=r.Z,{digitField:f,label:m,requiredIndicator:b}={digitField:{selector:()=>a.Z.componentName},label:{selector:"> label"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"}},h=a.Z.cssVarList,x=(0,o.qC)((0,i.yk)({mappings:{...u,borderColor:{...f,property:h.borderColor},color:[u.color,m,b]}}),i.e4,i.dj,i.Ae,(t=>class extends t{constructor(){super()}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}connectedCallback(){super.connectedCallback?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${d.f} \n\t\t\t\tbordered="true" \n\t\t\t\tname="code" \n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${d.f}>\n\t\t\t`,this.proxyElement.appendChild(t.content.cloneNode(!0)),this.proxyElement._setFocused=()=>{},this.inputElement=this.shadowRoot.querySelector(d.f),(0,l.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["required","pattern"]}),this.inputElement.addEventListener("blur",(t=>{t.isTrusted||this.proxyElement.validate()}))}}))((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>'\n :host {\n --vaadin-field-default-width: auto;\n\t\t\tdisplay: inline-block;\n }\n descope-passcode-internal {\n -webkit-mask-image: none;\n display: flex;\n gap: 2px;\n align-items: center;\n padding: 0;\n }\n vaadin-text-field::part(input-field) {\n background-color: transparent;\n padding: 0;\n\t\t\toverflow: hidden;\n }\n\t\tvaadin-text-field {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\topacity: 1;\n\t\t}\n\t\tvaadin-text-field > label,\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tcursor: pointer;\n\t\t}\n\t\tvaadin-text-field::part(input-field):focus {\n\t\t\tcursor: text;\n\t\t}\n\t\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\t\tfont-size: "12px";\n\t\t\tcontent: "*";\n\t\t}\n\t\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\t\tborder: 0 solid;\n\t\t}\n ',excludeAttrsSync:["tabindex"],componentName:s}));n(9357),n(4775),customElements.define(s,x)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[939],{7102:(t,e,n)=>{n.r(e);var i=n(6860),r=n(4447),d=n(1079),a=n(9063),o=n(2061),l=n(4567);const s=(0,l.iY)("passcode"),{borderStyle:p,borderWidth:c,...u}=r.Z,{digitField:f,label:m,requiredIndicator:b}={digitField:{selector:()=>a.Z.componentName},label:{selector:"> label"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"}},h=a.Z.cssVarList,x=(0,o.qC)((0,i.yk)({mappings:{...u,borderColor:{...f,property:h.borderColor},color:[u.color,m,b]}}),i.e4,i.dj,i.Ae,(t=>class extends t{constructor(){super()}get digits(){return Number.parseInt(this.getAttribute("digits"))||6}connectedCallback(){super.connectedCallback?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t<${d.f} \n\t\t\t\tbordered="true" \n\t\t\t\tname="code" \n\t\t\t\ttabindex="-1"\n\t\t\t\tslot="input"\n\t\t\t></${d.f}>\n\t\t\t`,this.proxyElement.appendChild(t.content.cloneNode(!0)),this.proxyElement._setFocused=()=>{},this.inputElement=this.shadowRoot.querySelector(d.f),(0,l.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["required","pattern"]}),this.inputElement.addEventListener("blur",(t=>{t.isTrusted||this.proxyElement.validate()}))}}))((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>'\n :host {\n --vaadin-field-default-width: auto;\n\t\t\tdisplay: inline-block;\n }\n\n descope-passcode-internal {\n -webkit-mask-image: none;\n display: flex;\n gap: 2px;\n align-items: center;\n padding: 0;\n }\n vaadin-text-field::part(input-field) {\n background-color: transparent;\n padding: 0;\n\t\t\toverflow: hidden;\n }\n\t\tvaadin-text-field {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\topacity: 1;\n\t\t}\n\t\tvaadin-text-field > label,\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tcursor: pointer;\n\t\t}\n\t\tvaadin-text-field::part(input-field):focus {\n\t\t\tcursor: text;\n\t\t}\n\t\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\t\tfont-size: "12px";\n\t\t\tcontent: "*";\n\t\t}\n\t\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\t\tborder: 0 solid;\n\t\t}\n ',excludeAttrsSync:["tabindex"],componentName:s}));n(9357),n(4775),customElements.define(s,x)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[320],{1721:(t,n,a)=>{a.r(n),a.d(n,{PasswordField:()=>l}),a(7056);var i=a(9725),e=a(4447),s=a(2061);const r=(0,a(4567).iY)("password-field");let o="";const d=(0,s.qC)((0,i.yk)({mappings:{...e.Z,revealCursor:[{selector:"::part(reveal-button)::before",property:"cursor"}]}}),i.e4,i.dj,i.Ae)((0,i.DM)({slots:["suffix"],wrappedEleName:"vaadin-password-field",style:()=>o,excludeAttrsSync:["tabindex"],componentName:r}));o=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\tvaadin-password-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\tvaadin-password-field::part(input-field) {\n\t\toverflow: hidden;\n\t}\n\tvaadin-password-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-password-field input:-webkit-autofill,\n\tvaadin-password-field input:-webkit-autofill::first-line,\n\tvaadin-password-field input:-webkit-autofill:hover,\n\tvaadin-password-field input:-webkit-autofill:active,\n\tvaadin-password-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${d.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${d.cssVarList.height}) var(${d.cssVarList.backgroundColor}) inset;\n\t}\n\tvaadin-password-field > label,\n\tvaadin-password-field::part(input-field) {\n\t\tcursor: pointer;\n\t\tcolor: var(${d.cssVarList.color});\n\t}\n\tvaadin-password-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-password-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${d.cssVarList.color});\n\t}\n\tvaadin-password-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n`;const l=d;customElements.define(r,l)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[320],{1721:(t,n,a)=>{a.r(n),a.d(n,{PasswordField:()=>l}),a(7056);var i=a(6860),e=a(4447),s=a(2061);const r=(0,a(4567).iY)("password-field");let o="";const d=(0,s.qC)((0,i.yk)({mappings:{...e.Z,revealCursor:[{selector:"::part(reveal-button)::before",property:"cursor"}]}}),i.e4,i.dj,i.Ae)((0,i.DM)({slots:["suffix"],wrappedEleName:"vaadin-password-field",style:()=>o,excludeAttrsSync:["tabindex"],componentName:r}));o=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\tvaadin-password-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\tvaadin-password-field::part(input-field) {\n\t\toverflow: hidden;\n\t}\n\tvaadin-password-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-password-field input:-webkit-autofill,\n\tvaadin-password-field input:-webkit-autofill::first-line,\n\tvaadin-password-field input:-webkit-autofill:hover,\n\tvaadin-password-field input:-webkit-autofill:active,\n\tvaadin-password-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${d.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${d.cssVarList.height}) var(${d.cssVarList.backgroundColor}) inset;\n\t}\n\tvaadin-password-field > label,\n\tvaadin-password-field::part(input-field) {\n\t\tcursor: pointer;\n\t\tcolor: var(${d.cssVarList.color});\n\t}\n\tvaadin-password-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-password-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${d.cssVarList.color});\n\t}\n\tvaadin-password-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n`;const l=d;customElements.define(r,l)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[739],{3774:(t,n,e)=>{e.r(n),e.d(n,{SwitchToggle:()=>s}),e(9515);var a=e(9725),i=e(2061);const o=(0,e(4567).iY)("switch-toggle");let r="";const c=(0,i.qC)((0,a.yk)({mappings:{width:{selector:()=>":host"},cursor:[{},{selector:"> label"}]}}),a.e4,a.dj,a.Ae)((0,a.DM)({slots:[],wrappedEleName:"vaadin-checkbox",style:()=>r,excludeAttrsSync:["tabindex"],componentName:o}));r=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\t\n\t:host {\n\t\t--margin: 7px;\n\t\t--width: var(${c.cssVarList.width});\n\t\t--height: calc(var(--width) / 2);\n\t\t--radius: var(--height);\n\t\t--knobSize: calc(var(--height) - 5px);\n\t\t--bgColor: #fff;\n\t\t--knobBgColor: #000;\n\t}\n\tvaadin-checkbox : {\n\t\twidth: 100%;\n\t}\n\tvaadin-checkbox>label {\n\t\tcursor: pointer;\n\t\tborder: 1px solid;\n\t\ttext-indent: -99999px;\n\t\tdisplay: block;\n\t\tposition: relative;\t\t\t\n\t\twidth: var(--width);\n\t\theight: var(--height);\n\t\tbackground: var(--bgColor);\n\t\tborder-radius: var(--radius);\n\t}\n\tvaadin-checkbox>label::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\ttransition: 0.3s;\n\t\ttop: var(--margin);\n\t\tleft: var(--margin);\n\t\twidth: var(--knobSize);\n\t\theight: var(--knobSize);\n\t\tbackground: var(--knobBgColor);\n\t\tborder-radius: var(--knobSize);\n\t}\n\tvaadin-checkbox::part(checkbox) {\n\t\theight: 0;\n\t\twidth: 0;\n\t\tvisibility: hidden;\n\t\tmargin: 0;\n\t}\n\tvaadin-checkbox[checked]>label::after {\n\t\ttransform: translateX(-100%);\n\t\tleft: calc(100% - var(--margin));\n\t}\n\tvaadin-checkbox[active]>label::after {\n\t\twidth: calc(var(--knobSize) + 15px);\n\t}\n`;const s=c;customElements.define(o,s)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[739],{3774:(t,n,e)=>{e.r(n),e.d(n,{SwitchToggle:()=>s}),e(9515);var a=e(6860),i=e(2061);const o=(0,e(4567).iY)("switch-toggle");let r="";const c=(0,i.qC)((0,a.yk)({mappings:{width:{selector:()=>":host"},cursor:[{},{selector:"> label"}]}}),a.e4,a.dj,a.Ae)((0,a.DM)({slots:[],wrappedEleName:"vaadin-checkbox",style:()=>r,excludeAttrsSync:["tabindex"],componentName:o}));r=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\t\n\t:host {\n\t\t--margin: 7px;\n\t\t--width: var(${c.cssVarList.width});\n\t\t--height: calc(var(--width) / 2);\n\t\t--radius: var(--height);\n\t\t--knobSize: calc(var(--height) - 5px);\n\t\t--bgColor: #fff;\n\t\t--knobBgColor: #000;\n\t}\n\tvaadin-checkbox : {\n\t\twidth: 100%;\n\t}\n\tvaadin-checkbox>label {\n\t\tcursor: pointer;\n\t\tborder: 1px solid;\n\t\ttext-indent: -99999px;\n\t\tdisplay: block;\n\t\tposition: relative;\t\t\t\n\t\twidth: var(--width);\n\t\theight: var(--height);\n\t\tbackground: var(--bgColor);\n\t\tborder-radius: var(--radius);\n\t}\n\tvaadin-checkbox>label::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\ttransition: 0.3s;\n\t\ttop: var(--margin);\n\t\tleft: var(--margin);\n\t\twidth: var(--knobSize);\n\t\theight: var(--knobSize);\n\t\tbackground: var(--knobBgColor);\n\t\tborder-radius: var(--knobSize);\n\t}\n\tvaadin-checkbox::part(checkbox) {\n\t\theight: 0;\n\t\twidth: 0;\n\t\tvisibility: hidden;\n\t\tmargin: 0;\n\t}\n\tvaadin-checkbox[checked]>label::after {\n\t\ttransform: translateX(-100%);\n\t\tleft: calc(100% - var(--margin));\n\t}\n\tvaadin-checkbox[active]>label::after {\n\t\twidth: calc(var(--knobSize) + 15px);\n\t}\n`;const s=c;customElements.define(o,s)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[322],{178:(t,e,n)=>{n.r(e),n.d(e,{TextArea:()=>c}),n(7101);var r=n(9725),a=n(2061);const o=(0,n(4567).iY)("text-area"),i={label:"::part(label)",input:"::part(input-field)",required:"::part(required-indicator)::after",host:()=>":host"};let s="";const l=(0,a.qC)((0,r.yk)({mappings:{resize:{selector:"> textarea"},color:{selector:i.label},cursor:{},width:{selector:i.host},backgroundColor:{selector:i.input},borderWidth:{selector:i.input},borderStyle:{selector:i.input},borderColor:{selector:i.input},borderRadius:{selector:i.input},outline:{selector:i.input},outlineOffset:{selector:i.input}}}),r.e4,r.dj,r.Ae)((0,r.DM)({slots:[],wrappedEleName:"vaadin-text-area",style:()=>s,excludeAttrsSync:["tabindex"],componentName:o}));s='\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\tvaadin-text-area {\n\t\tmargin: 0;\n\t\twidth: 100%;\n\t}\n\tvaadin-text-area > label,\n\tvaadin-text-area::part(input-field) {\n\t\tcursor: pointer;\n\t}\n\tvaadin-text-area[focused]::part(input-field) {\n\t\tcursor: text;\n\t}\n\tvaadin-text-area::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t}\t\n';const c=l;customElements.define(o,c)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[322],{178:(t,e,n)=>{n.r(e),n.d(e,{TextArea:()=>c}),n(7101);var r=n(6860),a=n(2061);const o=(0,n(4567).iY)("text-area"),i={label:"::part(label)",input:"::part(input-field)",required:"::part(required-indicator)::after",host:()=>":host"};let s="";const l=(0,a.qC)((0,r.yk)({mappings:{resize:{selector:"> textarea"},color:{selector:i.label},cursor:{},width:{selector:i.host},backgroundColor:{selector:i.input},borderWidth:{selector:i.input},borderStyle:{selector:i.input},borderColor:{selector:i.input},borderRadius:{selector:i.input},outline:{selector:i.input},outlineOffset:{selector:i.input}}}),r.e4,r.dj,r.Ae)((0,r.DM)({slots:[],wrappedEleName:"vaadin-text-area",style:()=>s,excludeAttrsSync:["tabindex"],componentName:o}));s='\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\tvaadin-text-area {\n\t\tmargin: 0;\n\t\twidth: 100%;\n\t}\n\tvaadin-text-area > label,\n\tvaadin-text-area::part(input-field) {\n\t\tcursor: pointer;\n\t}\n\tvaadin-text-area[focused]::part(input-field) {\n\t\tcursor: text;\n\t}\n\tvaadin-text-area::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t}\t\n';const c=l;customElements.define(o,c)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[934],{9063:(t,e,n)=>{n.d(e,{Z:()=>s,f:()=>d});var i=n(9725),a=n(4447),l=n(2061);const d=(0,n(4567).iY)("text-field");let o="";const r=(0,l.qC)((0,i.yk)({mappings:a.Z}),i.e4,i.dj,i.Ae)((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>o,excludeAttrsSync:["tabindex"],componentName:d}));o=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\tvaadin-text-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\tvaadin-text-field::part(input-field) {\n\t\toverflow: hidden;\n\t}\n\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-text-field input:-webkit-autofill,\n\tvaadin-text-field input:-webkit-autofill::first-line,\n\tvaadin-text-field input:-webkit-autofill:hover,\n\tvaadin-text-field input:-webkit-autofill:active,\n\tvaadin-text-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${r.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${r.cssVarList.height}) var(${r.cssVarList.backgroundColor}) inset;\n\t}\n\tvaadin-text-field > label,\n\tvaadin-text-field::part(input-field) {\n\t\tcursor: pointer;\n\t\tcolor: var(${r.cssVarList.color});\n\t}\n\tvaadin-text-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${r.cssVarList.color});\n\t}\n\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n`;const s=r},9357:(t,e,n)=>{n.r(e),n.d(e,{TextField:()=>i.Z}),n(9789);var i=n(9063);customElements.define(i.f,i.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[934],{9063:(t,e,n)=>{n.d(e,{Z:()=>s,f:()=>d});var i=n(6860),a=n(4447),l=n(2061);const d=(0,n(4567).iY)("text-field");let o="";const r=(0,l.qC)((0,i.yk)({mappings:a.Z}),i.e4,i.dj,i.Ae)((0,i.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>o,excludeAttrsSync:["tabindex"],componentName:d}));o=`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\tvaadin-text-field {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\tvaadin-text-field::part(input-field) {\n\t\toverflow: hidden;\n\t}\n\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\topacity: 1;\n\t}\n\tvaadin-text-field input:-webkit-autofill,\n\tvaadin-text-field input:-webkit-autofill::first-line,\n\tvaadin-text-field input:-webkit-autofill:hover,\n\tvaadin-text-field input:-webkit-autofill:active,\n\tvaadin-text-field input:-webkit-autofill:focus {\n\t\t-webkit-text-fill-color: var(${r.cssVarList.color});\n\t\tbox-shadow: 0 0 0 var(${r.cssVarList.height}) var(${r.cssVarList.backgroundColor}) inset;\n\t}\n\tvaadin-text-field > label,\n\tvaadin-text-field::part(input-field) {\n\t\tcursor: pointer;\n\t\tcolor: var(${r.cssVarList.color});\n\t}\n\tvaadin-text-field::part(input-field):focus {\n\t\tcursor: text;\n\t}\n\tvaadin-text-field[required]::part(required-indicator)::after {\n\t\tfont-size: "12px";\n\t\tcontent: "*";\n\t\tcolor: var(${r.cssVarList.color});\n\t}\n\tvaadin-text-field[readonly]::part(input-field)::after {\n\t\tborder: 0 solid;\n\t}\n`;const s=r},9357:(t,e,n)=>{n.r(e),n.d(e,{TextField:()=>i.Z}),n(9789);var i=n(9063);customElements.define(i.f,i.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[528],{8801:(t,e,n)=>{n.d(e,{Z:()=>r,f:()=>i});var o=n(9725),s=n(9989),l=n(2061);const i=(0,n(4567).iY)("text");class c extends s.V{static get componentName(){return i}constructor(){super();const t=document.createElement("template");t.innerHTML="\n\t\t<style>\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t:host > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t\t",this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > slot"}}const r=(0,l.qC)((0,o.yk)({mappings:{fontFamily:{},lineHeight:{},fontStyle:{},fontSize:{},fontWeight:{},width:{selector:()=>":host"},color:{},letterSpacing:{},textShadow:{},borderWidth:{},borderStyle:{},borderColor:{},textTransform:{},textAlign:{}}}),o.e4,o.Ae)(c)},1876:(t,e,n)=>{n.r(e),n.d(e,{Text:()=>o.Z});var o=n(8801);customElements.define(o.f,o.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[528],{8801:(t,e,n)=>{n.d(e,{Z:()=>r,f:()=>i});var o=n(6860),s=n(9989),l=n(2061);const i=(0,n(4567).iY)("text");class c extends s.V{static get componentName(){return i}constructor(){super();const t=document.createElement("template");t.innerHTML="\n\t\t<style>\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t:host > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t\t",this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.baseSelector=":host > slot"}}const r=(0,l.qC)((0,o.yk)({mappings:{fontFamily:{},lineHeight:{},fontStyle:{},fontSize:{},fontWeight:{},width:{selector:()=>":host"},color:{},letterSpacing:{},textShadow:{},borderWidth:{},borderStyle:{},borderColor:{},textTransform:{},textAlign:{}}}),o.e4,o.Ae)(c)},1876:(t,e,n)=>{n.r(e),n.d(e,{Text:()=>o.Z});var o=n(8801);customElements.define(o.f,o.Z)}}]);
package/dist/umd/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DescopeUI=t():e.DescopeUI=t()}(self,(()=>(()=>{var e,t,r,o={534:(e,t,r)=>{var o={"./descope-button/index.js":[3029,840,767,211,513,729,725,662],"./descope-checkbox/index.js":[7904,840,786,208,767,515,725,761],"./descope-container/index.js":[147,725,317],"./descope-date-picker/index.js":[2552,840,786,208,233,767,211,513,54,725,17],"./descope-divider/index.js":[6446,725,528,178],"./descope-email-field/index.js":[689,840,786,208,233,422,666,437,725,447,760],"./descope-link/index.js":[8029,725,528,58],"./descope-loader-linear/index.js":[9929,725,453],"./descope-loader-radial/index.js":[7603,725,72],"./descope-logo/index.js":[4641,725,984],"./descope-number-field/index.js":[4951,840,786,208,233,422,806,725,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,725,841],"./descope-passcode/index.js":[7102,840,786,208,233,422,666,789,725,447,841,934,939],"./descope-password-field/index.js":[1721,840,786,208,233,422,767,666,211,56,725,447,320],"./descope-switch-toggle/index.js":[3774,840,786,208,767,515,725,739],"./descope-text-area/index.js":[178,840,786,233,422,101,725,322],"./descope-text-field/index.js":[9357,840,786,208,233,422,666,789,725,447,934],"./descope-text/index.js":[1876,725,528]};function s(e){if(!r.o(o,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=o[e],s=t[0];return Promise.all(t.slice(1).map(r.e)).then((()=>r(s)))}s.keys=()=>Object.keys(o),s.id=534,e.exports=s},5561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{componentsThemeManager:()=>o});const o=new class{static mountOnPropName="DescopeThemeManager";#e={};#t="light";#r=new Set;#o(){this.#r.forEach((e=>e?.()))}get currentThemeName(){return this.#t}set currentThemeName(e){this.#t=e,this.#o()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#r.add(e),()=>{this.#r.delete(e)}}set themes(e){this.#e=e,this.#o()}}},7507:(e,t,r)=>{const{componentsThemeManager:o}=r(5561),s=r(534);e.exports=s.keys().reduce(((e,t)=>(e[t.replace(/.*?([^\/]+)\/index\.js$/,"$1")]=()=>s(t),e)),{}),e.exports.componentsThemeManager=o}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,e=[],n.O=(t,r,o,s)=>{if(!r){var i=1/0;for(p=0;p<e.length;p++){for(var[r,o,s]=e[p],d=!0,c=0;c<r.length;c++)(!1&s||i>=s)&&Object.keys(n.O).every((e=>n.O[e](r[c])))?r.splice(c--,1):(d=!1,s<i&&(i=s));if(d){e.splice(p--,1);var a=o();void 0!==a&&(t=a)}}return t}s=s||0;for(var p=e.length;p>0&&e[p-1][2]>s;p--)e[p]=e[p-1];e[p]=[r,o,s]},n.F={},n.E=e=>{Object.keys(n.F).map((t=>{n.F[t](e)}))},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>(({17:"descope-date-picker-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",453:"descope-loader-linear-index-js",528:"descope-text-index-js",662:"descope-button-index-js",739:"descope-switch-toggle-index-js",760:"descope-email-field-index-js",761:"descope-checkbox-index-js",841:"descope-passcode-descope-passcode-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="DescopeUI:",n.l=(e,o,s,i)=>{if(t[e])t[e].push(o);else{var d,c;if(void 0!==s)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==r+s){d=l;break}}d||(c=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,n.nc&&d.setAttribute("nonce",n.nc),d.setAttribute("data-webpack",r+s),d.src=e),t[e]=[o];var u=(r,o)=>{d.onerror=d.onload=null,clearTimeout(h);var s=t[e];if(delete t[e],d.parentNode&&d.parentNode.removeChild(d),s&&s.forEach((e=>e(o))),r)return r(o)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),c&&document.head.appendChild(d)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={826:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var s=new Promise(((r,s)=>o=e[t]=[r,s]));r.push(o[2]=s);var i=n.p+n.u(t),d=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var s=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;d.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",d.name="ChunkLoadError",d.type=s,d.request=i,o[1](d)}}),"chunk-"+t,t)}},n.F.j=t=>{if(!n.o(e,t)||void 0===e[t]){e[t]=null;var r=document.createElement("link");n.nc&&r.setAttribute("nonce",n.nc),r.rel="prefetch",r.as="script",r.href=n.p+n.u(t),document.head.appendChild(r)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var o,s,[i,d,c]=r,a=0;if(i.some((t=>0!==e[t]))){for(o in d)n.o(d,o)&&(n.m[o]=d[o]);if(c)var p=c(n)}for(t&&t(r);a<i.length;a++)s=i[a],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(p)},r=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n.O(0,[826],(()=>{[840,767,211,513,729,725,662,786,208,515,761,317,233,54,17,528,178,422,666,437,447,760,58,453,72,984,806,142,841,789,934,939,56,320,739,101,322].map(n.E)}),5);var i=n(7507);return n.O(i)})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DescopeUI=t():e.DescopeUI=t()}(self,(()=>(()=>{var e,t,o,r={534:(e,t,o)=>{var r={"./descope-button/index.js":[3029,840,767,211,513,729,860,662],"./descope-checkbox/index.js":[7904,840,786,208,767,515,860,761],"./descope-combo-box/index.js":[9258,840,786,208,233,824,314,860,483],"./descope-container/index.js":[147,860,317],"./descope-date-picker/index.js":[2552,840,786,208,233,767,211,824,513,541,860,17],"./descope-divider/index.js":[6446,860,528,178],"./descope-email-field/index.js":[689,840,786,208,233,422,725,437,860,447,760],"./descope-link/index.js":[8029,860,528,58],"./descope-loader-linear/index.js":[9929,860,453],"./descope-loader-radial/index.js":[7603,860,72],"./descope-logo/index.js":[4641,860,984],"./descope-number-field/index.js":[4951,840,786,208,233,422,806,860,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,860,841],"./descope-passcode/index.js":[7102,840,786,208,233,422,725,789,860,447,841,934,939],"./descope-password-field/index.js":[1721,840,786,208,233,422,767,725,211,56,860,447,320],"./descope-switch-toggle/index.js":[3774,840,786,208,767,515,860,739],"./descope-text-area/index.js":[178,840,786,233,422,101,860,322],"./descope-text-field/index.js":[9357,840,786,208,233,422,725,789,860,447,934],"./descope-text/index.js":[1876,860,528]};function s(e){if(!o.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],s=t[0];return Promise.all(t.slice(1).map(o.e)).then((()=>o(s)))}s.keys=()=>Object.keys(r),s.id=534,e.exports=s},5561:(e,t,o)=>{"use strict";o.r(t),o.d(t,{componentsThemeManager:()=>r});const r=new class{static mountOnPropName="DescopeThemeManager";#e={};#t="light";#o=new Set;#r(){this.#o.forEach((e=>e?.()))}get currentThemeName(){return this.#t}set currentThemeName(e){this.#t=e,this.#r()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#o.add(e),()=>{this.#o.delete(e)}}set themes(e){this.#e=e,this.#r()}}},7507:(e,t,o)=>{const{componentsThemeManager:r}=o(5561),s=o(534);e.exports=s.keys().reduce(((e,t)=>(e[t.replace(/.*?([^\/]+)\/index\.js$/,"$1")]=()=>s(t),e)),{}),e.exports.componentsThemeManager=r}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,s)=>{if(!o){var i=1/0;for(p=0;p<e.length;p++){for(var[o,r,s]=e[p],d=!0,c=0;c<o.length;c++)(!1&s||i>=s)&&Object.keys(n.O).every((e=>n.O[e](o[c])))?o.splice(c--,1):(d=!1,s<i&&(i=s));if(d){e.splice(p--,1);var a=r();void 0!==a&&(t=a)}}return t}s=s||0;for(var p=e.length;p>0&&e[p-1][2]>s;p--)e[p]=e[p-1];e[p]=[o,r,s]},n.F={},n.E=e=>{Object.keys(n.F).map((t=>{n.F[t](e)}))},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,o)=>(n.f[o](e,t),t)),[])),n.u=e=>(({17:"descope-date-picker-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",453:"descope-loader-linear-index-js",483:"descope-combo-box-index-js",528:"descope-text-index-js",662:"descope-button-index-js",739:"descope-switch-toggle-index-js",760:"descope-email-field-index-js",761:"descope-checkbox-index-js",841:"descope-passcode-descope-passcode-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},o="DescopeUI:",n.l=(e,r,s,i)=>{if(t[e])t[e].push(r);else{var d,c;if(void 0!==s)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+s){d=l;break}}d||(c=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,n.nc&&d.setAttribute("nonce",n.nc),d.setAttribute("data-webpack",o+s),d.src=e),t[e]=[r];var u=(o,r)=>{d.onerror=d.onload=null,clearTimeout(m);var s=t[e];if(delete t[e],d.parentNode&&d.parentNode.removeChild(d),s&&s.forEach((e=>e(r))),o)return o(r)},m=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),c&&document.head.appendChild(d)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");o.length&&(e=o[o.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={826:0};n.f.j=(t,o)=>{var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{var s=new Promise(((o,s)=>r=e[t]=[o,s]));o.push(r[2]=s);var i=n.p+n.u(t),d=new Error;n.l(i,(o=>{if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var s=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;d.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",d.name="ChunkLoadError",d.type=s,d.request=i,r[1](d)}}),"chunk-"+t,t)}},n.F.j=t=>{if(!n.o(e,t)||void 0===e[t]){e[t]=null;var o=document.createElement("link");n.nc&&o.setAttribute("nonce",n.nc),o.rel="prefetch",o.as="script",o.href=n.p+n.u(t),document.head.appendChild(o)}},n.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[i,d,c]=o,a=0;if(i.some((t=>0!==e[t]))){for(r in d)n.o(d,r)&&(n.m[r]=d[r]);if(c)var p=c(n)}for(t&&t(o);a<i.length;a++)s=i[a],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(p)},o=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),n.O(0,[826],(()=>{[840,767,211,513,729,860,662,786,208,515,761,233,824,314,483,317,541,17,528,178,422,725,437,447,760,58,453,72,984,806,142,841,789,934,939,56,320,739,101,322].map(n.E)}),5);var i=n(7507);return n.O(i)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.64",
3
+ "version": "1.0.66",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -38,6 +38,7 @@
38
38
  "dependencies": {
39
39
  "@vaadin/button": "24.0.4",
40
40
  "@vaadin/checkbox": "24.0.4",
41
+ "@vaadin/combo-box": "24.0.4",
41
42
  "@vaadin/date-picker": "24.0.4",
42
43
  "@vaadin/email-field": "24.0.4",
43
44
  "@vaadin/number-field": "24.0.4",
@@ -0,0 +1,111 @@
1
+ import { compose } from '../../helpers';
2
+ import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
3
+ import {
4
+ createStyleMixin,
5
+ draggableMixin,
6
+ createProxy,
7
+ componentNameValidationMixin,
8
+ portalMixin,
9
+ proxyInputMixin
10
+ } from '../../mixins';
11
+
12
+ export const componentName = getComponentName('combo-box');
13
+
14
+ const selectors = {
15
+ input: { selector: '::part(input-field)' },
16
+ toggle: { selector: '::part(toggle-button)' }
17
+ };
18
+
19
+ const { input, toggle } = selectors;
20
+
21
+ const borderRadius = {
22
+ topRightRadius: {
23
+ selector: input.selector,
24
+ property: 'border-top-right-radius'
25
+ },
26
+ bottomRightRadius: {
27
+ selector: input.selector,
28
+ property: 'border-bottom-right-radius'
29
+ },
30
+ topLeftRadius: {
31
+ selector: input.selector,
32
+ property: 'border-top-left-radius'
33
+ },
34
+ bottomLeftRadius: {
35
+ selector: input.selector,
36
+ property: 'border-bottom-left-radius'
37
+ }
38
+ };
39
+
40
+ const ComboBoxMixin = (superclass) => class ComboBoxMixinClass extends superclass {
41
+
42
+ // vaadin api is to set props on their combo box node,
43
+ // in order to avoid it, we are passing the children of this component
44
+ // to the items & renderer props, so it will be used as the combo box items
45
+ #onChildrenChange() {
46
+ const baseElement = this.shadowRoot.querySelector(this.baseSelector)
47
+ const items = Array.from(this.children)
48
+
49
+ // we want the data-name attribute to be accessible as an object attribute
50
+ baseElement.items = items.map((node) =>
51
+ Object.defineProperty(node, 'data-name', {
52
+ value: node.getAttribute('data-name')
53
+ })
54
+ );
55
+
56
+ baseElement.renderer = (root, combo, model) => {
57
+ root.innerHTML = items[model.index].outerHTML;
58
+ };
59
+ }
60
+
61
+ connectedCallback() {
62
+ super.connectedCallback?.()
63
+
64
+ observeChildren(this, this.#onChildrenChange.bind(this))
65
+ }
66
+ }
67
+
68
+ const ComboBox = compose(
69
+ createStyleMixin({
70
+ mappings: {
71
+ ...borderRadius,
72
+ backgroundColor: input,
73
+ width: input,
74
+ color: input,
75
+ padding: input,
76
+ borderColor: input,
77
+ borderStyle: input,
78
+ borderWidth: input,
79
+ cursor: toggle,
80
+ height: input,
81
+ }
82
+ }),
83
+ draggableMixin,
84
+ portalMixin({
85
+ name: 'overlay',
86
+ selector: 'vaadin-combo-box-scroller',
87
+ mappings: {
88
+ border: { selector: () => '::slotted(*)' },
89
+ backgroundColor: {},
90
+ }
91
+ }),
92
+ proxyInputMixin,
93
+ componentNameValidationMixin,
94
+ ComboBoxMixin
95
+ )(
96
+ createProxy({
97
+ slots: ['prefix'],
98
+ wrappedEleName: 'vaadin-combo-box',
99
+ style: () => `
100
+ :host {
101
+ -webkit-mask-image: none;
102
+ }
103
+ `,
104
+ excludeAttrsSync: ['tabindex'],
105
+ includeAttrsSync: [],
106
+ componentName,
107
+ includeForwardProps: ['items', 'renderer']
108
+ })
109
+ );
110
+
111
+ export default ComboBox;
@@ -0,0 +1,6 @@
1
+ import '@vaadin/combo-box';
2
+ import ComboBox, { componentName } from './ComboBox';
3
+
4
+ customElements.define(componentName, ComboBox);
5
+
6
+ export { ComboBox };
@@ -88,6 +88,7 @@ const Passcode = compose(
88
88
  --vaadin-field-default-width: auto;
89
89
  display: inline-block;
90
90
  }
91
+
91
92
  descope-passcode-internal {
92
93
  -webkit-mask-image: none;
93
94
  display: flex;
@@ -10,7 +10,8 @@ class PasscodeInternal extends BaseInputClass {
10
10
  ...BaseInputClass.observedAttributes,
11
11
  'disabled',
12
12
  'bordered',
13
- 'size'
13
+ 'size',
14
+ 'readonly'
14
15
  ];
15
16
  }
16
17
 
@@ -53,7 +54,7 @@ class PasscodeInternal extends BaseInputClass {
53
54
  }
54
55
 
55
56
  set value(val) {
56
- if(val === this.value) return;
57
+ if (val === this.value) return;
57
58
 
58
59
  const charArr = getSanitizedCharacters(val);
59
60
 
@@ -96,6 +97,7 @@ class PasscodeInternal extends BaseInputClass {
96
97
 
97
98
  async connectedCallback() {
98
99
  super.connectedCallback();
100
+
99
101
  this.initInputs()
100
102
 
101
103
  this.addEventListener('invalid', this.handleInputsInvalid)
@@ -140,7 +142,8 @@ class PasscodeInternal extends BaseInputClass {
140
142
  // in order to simulate blur on the input
141
143
  // we are checking if focus on one of the digits happened immediately after blur on another digit
142
144
  // if not, the component is no longer focused and we should simulate blur
143
- input.addEventListener('blur', () => {
145
+ input.addEventListener('blur', (e) => {
146
+ e.stopPropagation()
144
147
  const timerId = setTimeout(() => {
145
148
  this.dispatchBlur()
146
149
  });
@@ -150,7 +153,8 @@ class PasscodeInternal extends BaseInputClass {
150
153
  );
151
154
  })
152
155
 
153
- input.oninput = () => {
156
+ input.oninput = (e) => {
157
+ e.stopPropagation()
154
158
  const charArr = getSanitizedCharacters(input.value);
155
159
 
156
160
  if (!charArr.length) input.value = ''; // if we got an invalid value we want to clear the input
@@ -169,7 +173,7 @@ class PasscodeInternal extends BaseInputClass {
169
173
  !prevInput.hasAttribute('focused') && setTimeout(() => {
170
174
  focusElement(prevInput);
171
175
  });
172
-
176
+
173
177
  this.dispatchInput()
174
178
  } else if (key.match(/^(\d)$/g)) { // if input is a digit
175
179
  input.value = ''; // we are clearing the previous value so we can override it with the new value
package/src/constants.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export const DESCOPE_PREFIX = 'descope';
2
- export const CSS_SELECTOR_SPECIFIER_MULTIPLY = 3
2
+ export const CSS_SELECTOR_SPECIFIER_MULTIPLY = 3
3
+ export const BASE_THEME_SECTION = 'host'
4
+ export const PORTAL_THEME_PREFIX = '@'
@@ -1,21 +1,20 @@
1
1
  import { kebabCaseJoin } from '.';
2
2
  import { DESCOPE_PREFIX } from '../constants';
3
3
 
4
- const observeAttributes = (
4
+ export const observeAttributes = (
5
5
  ele,
6
6
  callback,
7
7
  { excludeAttrs = [], includeAttrs = [] }
8
8
  ) => {
9
9
  // sync all attrs on init
10
- callback(
11
- ...Array.from(ele.attributes)
12
- .filter(
13
- (attr) =>
14
- !excludeAttrs.includes(attr.name) &&
15
- (!includeAttrs.length || includeAttrs.includes(attr.name))
16
- )
17
- .map((attr) => attr.name)
18
- );
10
+ const filteredAttrs = Array.from(ele.attributes)
11
+ .filter((attr) =>
12
+ !excludeAttrs.includes(attr.name) &&
13
+ (!includeAttrs.length || includeAttrs.includes(attr.name))
14
+ )
15
+ .map((attr) => attr.name)
16
+
17
+ callback(filteredAttrs);
19
18
 
20
19
  const observer = new MutationObserver((mutationsList) => {
21
20
  for (const mutation of mutationsList) {
@@ -32,21 +31,39 @@ const observeAttributes = (
32
31
  observer.observe(ele, { attributes: true });
33
32
  };
34
33
 
34
+ // calling the callback with this object: { addedNodes, removedNodes }
35
+ export const observeChildren = (
36
+ ele,
37
+ callback,
38
+ ) => {
39
+ callback({ addedNodes: Array.from(ele.children), removedNodes: [] });
40
+
41
+ const observer = new MutationObserver((mutationsList) => {
42
+ for (const mutation of mutationsList) {
43
+ if (mutation.type === 'childList') {
44
+ callback(mutation);
45
+ }
46
+ }
47
+ });
48
+
49
+ observer.observe(ele, { childList: true });
50
+ };
51
+
35
52
  const createSyncAttrsCb =
36
53
  (srcEle, targetEle, mapAttrs = {}) =>
37
- (...attrNames) => {
38
- attrNames.forEach((attrName) => {
39
- const targetAttrName = mapAttrs[attrName] || attrName;
40
- const srcAttrVal = srcEle.getAttribute(attrName);
41
- if (srcAttrVal !== null) {
42
- if (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {
43
- targetEle.setAttribute(targetAttrName, srcAttrVal);
54
+ (attrNames) => {
55
+ attrNames.forEach((attrName) => {
56
+ const targetAttrName = mapAttrs[attrName] || attrName;
57
+ const srcAttrVal = srcEle.getAttribute(attrName);
58
+ if (srcAttrVal !== null) {
59
+ if (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {
60
+ targetEle.setAttribute(targetAttrName, srcAttrVal);
61
+ }
62
+ } else {
63
+ targetEle.removeAttribute(targetAttrName);
44
64
  }
45
- } else {
46
- targetEle.removeAttribute(targetAttrName);
47
- }
48
- });
49
- };
65
+ });
66
+ };
50
67
 
51
68
  export const syncAttrs = (ele1, ele2, options) => {
52
69
  observeAttributes(ele1, createSyncAttrsCb(ele1, ele2), options);
@@ -56,27 +73,29 @@ export const syncAttrs = (ele1, ele2, options) => {
56
73
  export const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);
57
74
 
58
75
  export const getCssVarName = (...args) =>
59
- `--${kebabCaseJoin(...args.filter((arg) => !!arg))}`;
76
+ `--${kebabCaseJoin(...args)}`;
60
77
 
61
78
  export const forwardAttrs = (source, dest, options = {}) => {
62
- observeAttributes(
63
- source,
64
- createSyncAttrsCb(source, dest, options.mapAttrs),
65
- options
66
- );
79
+ observeAttributes(
80
+ source,
81
+ createSyncAttrsCb(source, dest, options.mapAttrs),
82
+ options
83
+ );
67
84
  };
68
85
 
69
86
  export const forwardProps = (src, target, props = []) => {
70
- if(!props.length) return;
87
+ if (!props.length) return;
71
88
 
72
- const config = props.reduce((acc, prop) => Object.assign(acc, {[prop] : {
73
- get () {
74
- return target[prop]
75
- },
76
- set (v) {
77
- target[prop] = v
89
+ const config = props.reduce((acc, prop) => Object.assign(acc, {
90
+ [prop]: {
91
+ get() {
92
+ return target[prop]
93
+ },
94
+ set(v) {
95
+ target[prop] = v
96
+ }
78
97
  }
79
- }}), {})
98
+ }), {})
80
99
 
81
100
  Object.defineProperties(src, config)
82
101
  }
@@ -5,9 +5,10 @@ export const kebabCase = (str) =>
5
5
  .replace(/[\s_.]+/g, '-')
6
6
  .toLowerCase();
7
7
 
8
- export const kebabCaseJoin = (...args) => kebabCase(args.join('-'));
8
+ export const kebabCaseJoin = (...args) => kebabCase(args.filter((arg) => !!arg).join('-'));
9
9
 
10
10
  export const compose = (...fns) =>
11
11
  (val) =>
12
12
  fns.reduceRight((res, fn) => fn(res), val);
13
13
 
14
+ export const upperFirst = (str) => str.charAt(0).toUpperCase() + str.slice(1)
@@ -1,6 +1,6 @@
1
1
  import merge from 'lodash.merge';
2
2
  import set from 'lodash.set';
3
- import { DESCOPE_PREFIX } from '../../constants';
3
+ import { BASE_THEME_SECTION, DESCOPE_PREFIX, PORTAL_THEME_PREFIX } from '../../constants';
4
4
  import { kebabCase } from '..';
5
5
  import { getComponentName, getCssVarName } from '../componentHelpers';
6
6
 
@@ -48,9 +48,9 @@ const componentsThemeToStyleObj = (componentsTheme) =>
48
48
  // this allows us to generate those themes under different sections
49
49
  // if the theme has root level attribute that starts with #
50
50
  // we are generating a new theme
51
- let themeName = 'theme'
51
+ let themeName = BASE_THEME_SECTION
52
52
 
53
- if (restPath[0] && restPath[0].startsWith('#')) {
53
+ if (restPath[0] && restPath[0].startsWith(PORTAL_THEME_PREFIX)) {
54
54
  themeName = restPath.shift();
55
55
  }
56
56