@descope/web-components-ui 1.108.0 → 1.110.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.
Files changed (78) hide show
  1. package/dist/cjs/index.cjs.js +330 -336
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +393 -399
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/2739.js +1 -1
  6. package/dist/umd/2739.js.map +1 -1
  7. package/dist/umd/DescopeDev.js +1 -1
  8. package/dist/umd/DescopeDev.js.map +1 -1
  9. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  10. package/dist/umd/boolean-fields-descope-checkbox-index-js.js.map +1 -1
  11. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  12. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
  13. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  14. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
  15. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  16. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
  17. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +3 -3
  18. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  19. package/dist/umd/descope-button.js +4 -4
  20. package/dist/umd/descope-button.js.map +1 -1
  21. package/dist/umd/descope-collapsible-container.js +1 -1
  22. package/dist/umd/descope-collapsible-container.js.map +1 -1
  23. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  24. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  25. package/dist/umd/descope-email-field-index-js.js +1 -1
  26. package/dist/umd/descope-email-field-index-js.js.map +1 -1
  27. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  28. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.map +1 -1
  29. package/dist/umd/descope-grid-index-js.js +1 -1
  30. package/dist/umd/descope-grid-index-js.js.map +1 -1
  31. package/dist/umd/descope-icon.js +1 -1
  32. package/dist/umd/descope-icon.js.map +1 -1
  33. package/dist/umd/descope-image.js +1 -1
  34. package/dist/umd/descope-image.js.map +1 -1
  35. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
  36. package/dist/umd/descope-multi-select-combo-box-index-js.js.map +1 -1
  37. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  38. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
  39. package/dist/umd/descope-new-password-index-js.js +1 -1
  40. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  41. package/dist/umd/descope-number-field-index-js.js +1 -1
  42. package/dist/umd/descope-number-field-index-js.js.map +1 -1
  43. package/dist/umd/descope-passcode-index-js.js +1 -1
  44. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  45. package/dist/umd/descope-password-index-js.js +1 -1
  46. package/dist/umd/descope-password-index-js.js.map +1 -1
  47. package/dist/umd/descope-radio-group-index-js.js +1 -1
  48. package/dist/umd/descope-radio-group-index-js.js.map +1 -1
  49. package/dist/umd/descope-scopes-list-index-js.js +1 -1
  50. package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
  51. package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
  52. package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
  53. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  54. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  55. package/dist/umd/descope-text-area-index-js.js +1 -1
  56. package/dist/umd/descope-text-area-index-js.js.map +1 -1
  57. package/dist/umd/descope-text-field-index-js.js +1 -1
  58. package/dist/umd/descope-text-field-index-js.js.map +1 -1
  59. package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
  60. package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
  61. package/dist/umd/descope-timer-button.js +2 -2
  62. package/dist/umd/descope-timer-button.js.map +1 -1
  63. package/dist/umd/descope-timer.js +1 -1
  64. package/dist/umd/descope-timer.js.map +1 -1
  65. package/dist/umd/descope-upload-file-index-js.js +3 -3
  66. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  67. package/dist/umd/descope-user-attribute-index-js.js +4 -4
  68. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  69. package/dist/umd/descope-user-auth-method-index-js.js +2 -2
  70. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  71. package/dist/umd/index.js +1 -1
  72. package/dist/umd/index.js.map +1 -1
  73. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  74. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  75. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  76. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  77. package/package.json +17 -17
  78. package/src/helpers/themeHelpers/resetHelpers.js +0 -3
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see boolean-fields-descope-checkbox-index-js.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[4838,7362],{3274:(e,t,n)=>{n.r(t);var i=n(41813);customElements.define(i.T,i.A)},3393:(e,t,n)=>{n.d(t,{y:()=>a});var i=n(9696),o=n(79365),r=n(81365);const a=(...e)=>(0,i.Zz)(o.XX,o._$,o.yF,o.jd)((0,r.q)(...e))},18330:(e,t,n)=>{n.d(t,{f:()=>o});var i=n(44099);class o extends i.r{constructor(e,t){super(e,"input","input",{initializer:(e,n)=>{n.value&&(e.value=n.value),n.type&&e.setAttribute("type",n.type),e.id=this.defaultId,"function"==typeof t&&t(e)},useUniqueId:!0})}}},19847:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(97810),o=n(41813);const r=e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,i.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,i.q)(this.inputElement,this,["checked"]),(0,i.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},41813:(e,t,n)=>{n.d(t,{A:()=>d,T:()=>r});var i=n(3393),o=n(97810);const r=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],l=(0,i.y)({componentName:r,baseSelector:"div"}),d=class extends l{static get observedAttributes(){return["readonly"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox")}get value(){return this.checkbox?.checked}set value(e){this.checkbox.checked=e}get checked(){return this.value}set checked(e){this.value=e}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.checkbox.focus()})),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:a}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(e,t,n){super.attributeChangedCallback?.(e,t,n),"readonly"===e&&this.onReadOnlyChange(null!==n)}onReadOnlyChange(e){this.baseElement.setAttribute("inert",e)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},47507:(e,t,n)=>{n.d(t,{A:()=>i});const i=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,n(73551).X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`},49582:(e,t,n)=>{n.r(t),n.d(t,{CheckboxClass:()=>i.q,componentName:()=>i.T});var i=n(64321);n(67468),n(11284),n(3274),customElements.define(i.T,i.q)},64321:(e,t,n)=>{n.d(t,{T:()=>s,q:()=>y});var i=n(97810),o=n(9696),r=n(79365),a=n(19847),l=n(47507),d=n(73551);const s=(0,i.xE)("checkbox"),{host:p,component:c,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:f,helperText:x,errorMessage:g}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:[p,h,b],fontFamily:[b,x,g],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},inputValueTextColor:{...u,property:"color"},inputBackgroundColor:{...h,property:"background-color"},inputBorderRadius:{...h,property:"border-radius"},inputBorderWidth:{...h,property:"border-width"},inputBorderOffset:{...h,property:"border-offset"},inputBorderColor:{...h,property:"border-color"},inputBorderStyle:{...h,property:"border-style"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"},inputSize:[{...h,property:"width"},{...h,property:"height"},{...u,property:"font-size"},{...c,property:"font-size"}]}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,a.A)((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${l.A}\n ${(0,d.cy)(y.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n margin: 1px;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n height: 100%;\n }\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(checkbox)::after {\n top: 0;\n left: 0;\n -webkit-text-fill-color: initial;\n }\n\n vaadin-checkbox label {\n -webkit-text-fill-color: initial;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,excludeAttrsSync:["label","tabindex"],componentName:s}))},73551:(e,t,n)=>{n.d(t,{$J:()=>h,I4:()=>a,Kl:()=>u,LJ:()=>c,Qv:()=>r,X6:()=>d,cy:()=>i,fu:()=>s,kG:()=>p,lS:()=>l,zm:()=>o});const i=e=>`\n :host {\n padding: calc(var(${e.inputOutlineWidth}) + var(${e.inputOutlineOffset}))\n }\n`,o=e=>`\n ${e} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,r=e=>`\n ${e}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=e=>`\n ${e} > label,\n ${e}::part(label),\n ${e}::part(required-indicator) {\n cursor: pointer;\n }\n`,l=(e,t="input")=>`\n ${e}[disabled] > ${t}:placeholder-shown,\n\t${e}[readonly] > ${t}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,d=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",s=e=>`\n ${e}::part(input-field)::after {\n opacity: 0;\n }\n`,p=e=>`\n ${e}::part(input-field)::after {\n background: none;\n }\n`,c=(e,t)=>`\n ${o(e)}\n ${a(e)}\n ${l(e)}\n ${r(e)}\n ${((e,t)=>`\n ${e} input:-webkit-autofill,\n ${e} input:-webkit-autofill::first-line,\n ${e} input:-webkit-autofill:hover,\n ${e} input:-webkit-autofill:active,\n ${e} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${t.inputValueTextColor});\n box-shadow: 0 0 0 var(${t.inputHeight}) var(${t.inputBackgroundColor}) inset;\n }\n`)(e,t)}\n ${p(e)}\n ${(e=>`\n ${e}::before {\n\t\theight: unset;\n\t}\n`)(e)}\n ${(e=>`\n ${e} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(e)}\n ${(e=>`\n ${e}::part(input-field)::after {\n border: none;\n }\n`)(e)}\n`,h=e=>`\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 ${e} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`,u=()=>'\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 '}}]);
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[4838,7362],{3274:(e,t,n)=>{n.r(t);var i=n(41813);customElements.define(i.T,i.A)},3393:(e,t,n)=>{n.d(t,{y:()=>a});var i=n(9696),o=n(79365),r=n(81365);const a=(...e)=>(0,i.Zz)(o.XX,o._$,o.yF,o.jd)((0,r.q)(...e))},18330:(e,t,n)=>{n.d(t,{f:()=>o});var i=n(44099);class o extends i.r{constructor(e,t){super(e,"input","input",{initializer:(e,n)=>{n.value&&(e.value=n.value),n.type&&e.setAttribute("type",n.type),e.id=this.defaultId,"function"==typeof t&&t(e)},useUniqueId:!0})}}},19847:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(97810),o=n(41813);const r=e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,i.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,i.q)(this.inputElement,this,["checked"]),(0,i.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},41813:(e,t,n)=>{n.d(t,{A:()=>d,T:()=>r});var i=n(3393),o=n(97810);const r=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],l=(0,i.y)({componentName:r,baseSelector:"div"}),d=class extends l{static get observedAttributes(){return["readonly"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox")}get value(){return this.checkbox?.checked}set value(e){this.checkbox.checked=e}get checked(){return this.value}set checked(e){this.value=e}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.checkbox.focus()})),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:a}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(e,t,n){super.attributeChangedCallback?.(e,t,n),"readonly"===e&&this.onReadOnlyChange(null!==n)}onReadOnlyChange(e){this.baseElement.setAttribute("inert",e)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},47507:(e,t,n)=>{n.d(t,{A:()=>i});const i=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,n(73551).X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`},49582:(e,t,n)=>{n.r(t),n.d(t,{CheckboxClass:()=>i.q,componentName:()=>i.T});var i=n(64321);n(67468),n(11284),n(3274),customElements.define(i.T,i.q)},64321:(e,t,n)=>{n.d(t,{T:()=>s,q:()=>y});var i=n(97810),o=n(9696),r=n(79365),a=n(19847),l=n(47507),d=n(73551);const s=(0,i.xE)("checkbox"),{host:p,component:c,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:f,helperText:x,errorMessage:g}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:[p,h,b],fontFamily:[b,x,g],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},inputValueTextColor:{...u,property:"color"},inputBackgroundColor:{...h,property:"background-color"},inputBorderRadius:{...h,property:"border-radius"},inputBorderWidth:{...h,property:"border-width"},inputBorderOffset:{...h,property:"border-offset"},inputBorderColor:{...h,property:"border-color"},inputBorderStyle:{...h,property:"border-style"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"},inputSize:[{...h,property:"width"},{...h,property:"height"},{...u,property:"font-size"},{...c,property:"font-size"}]}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,a.A)((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${l.A}\n ${(0,d.cy)(y.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n margin: 1px;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n height: 100%;\n }\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(checkbox)::after {\n top: 0;\n left: 0;\n -webkit-text-fill-color: initial;\n }\n\n vaadin-checkbox label {\n -webkit-text-fill-color: initial;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,excludeAttrsSync:["label","tabindex"],componentName:s}))},73551:(e,t,n)=>{n.d(t,{$J:()=>h,I4:()=>a,Kl:()=>u,LJ:()=>c,Qv:()=>r,X6:()=>d,cy:()=>i,fu:()=>s,kG:()=>p,lS:()=>l,zm:()=>o});const i=e=>`\n :host {\n padding: calc(var(${e.inputOutlineWidth}) + var(${e.inputOutlineOffset}))\n }\n`,o=e=>`\n ${e} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,r=e=>`\n ${e}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=e=>`\n ${e} > label,\n ${e}::part(label),\n ${e}::part(required-indicator) {\n cursor: pointer;\n }\n`,l=(e,t="input")=>`\n ${e}[disabled] > ${t}:placeholder-shown,\n\t${e}[readonly] > ${t}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,d=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",s=e=>`\n ${e}::part(input-field)::after {\n opacity: 0;\n }\n`,p=e=>`\n ${e}::part(input-field)::after {\n background: none;\n }\n`,c=(e,t)=>`\n ${o(e)}\n ${a(e)}\n ${l(e)}\n ${r(e)}\n ${((e,t)=>`\n ${e} input:-webkit-autofill,\n ${e} input:-webkit-autofill::first-line,\n ${e} input:-webkit-autofill:hover,\n ${e} input:-webkit-autofill:active,\n ${e} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${t.inputValueTextColor});\n box-shadow: 0 0 0 var(${t.inputHeight}) var(${t.inputBackgroundColor}) inset;\n }\n`)(e,t)}\n ${p(e)}\n ${(e=>`\n ${e}::before {\n\t\theight: unset;\n\t}\n`)(e)}\n ${(e=>`\n ${e} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(e)}\n ${(e=>`\n ${e}::part(input-field)::after {\n border: none;\n }\n`)(e)}\n`,h=e=>`\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 ${e} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`,u=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '}}]);
3
3
  //# sourceMappingURL=boolean-fields-descope-checkbox-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"boolean-fields-descope-checkbox-index-js.js","mappings":";mKAEAA,eAAeC,OAAO,IAAe,0ECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,qDCLhB,MAAMC,UAAwB,IACnC,WAAAC,CAAYC,EAAMC,GAChBC,MAAMF,EAAM,QAAS,QAAS,CAC5BG,YAAa,CAACC,EAAMJ,KACdA,EAAKK,QACPD,EAAKC,MAAQL,EAAKK,OAEhBL,EAAKM,MACPF,EAAKG,aAAa,O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8B,IAAM,uGAOpCC,EAA2BN,GAAS,SAC3CA,8DAKOO,EAAyCP,GAAS,SACzDA,oEAKOQ,EAAsB,CAACR,EAAMJ,IAAe,SACnDG,EAAoBC,WACpBE,EAAiBF,WACjBG,EAAsBH,WACtBC,EAAgBD,WAlCY,EAACA,EAAMJ,IAAe,SAClDI,kCACAA,8CACAA,wCACAA,yCACAA,0EACiCJ,EAAWhB,wDAClBgB,EAAWa,oBAAoBb,EAAWf,wCA4BpE6B,CAAmBV,EAAMJ,WACzBW,EAAsCP,WAnFV,CAACA,GAAS,SACtCA,yCAmFAW,CAAmBX,WA9EQ,CAACA,GAAS,SACrCA,mHA8EAY,CAAkBZ,WA3FwB,CAACA,GAAS,SACpDA,gEA2FAa,CAAiCb,OAM1Bc,EAA2Bd,GAAS,4ZAiB3CA,yJAQOe,EAA0B,IAC9B","sources":["webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/index.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/booleanFieldMixin.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/commonStyles.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-checkbox/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-checkbox/CheckboxClass.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js"],"sourcesContent":["import BooleanFieldInternal, { componentName } from './BooleanFieldInternal';\n\ncustomElements.define(componentName, BooleanFieldInternal);\n","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","/**\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 { forwardAttrs, forwardProps, syncAttrs } from '../../helpers/componentHelpers';\nimport { componentName as descopeInternalComponentName } from './descope-boolean-field-internal/BooleanFieldInternal';\n\nexport const booleanFieldMixin = (superclass) =>\n class BooleanFieldMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n template.innerHTML = `\n\t\t\t\t<${descopeInternalComponentName}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tslot=\"input\"\n\t\t\t\t></${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n this.checkbox = this.inputElement.querySelector('vaadin-checkbox');\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'required',\n 'full-width',\n 'size',\n 'label',\n 'invalid',\n 'disabled',\n 'readonly',\n ],\n });\n\n forwardProps(this.inputElement, this, ['checked']);\n syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });\n }\n };\n","import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('boolean-field-internal');\n\nconst forwardAttributes = ['disabled', 'label', 'invalid', 'readonly'];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass BooleanInputInternal extends BaseInputClass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n constructor() {\n super();\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t`;\n this.wrapperEle = this.querySelector('div');\n this.checkbox = this.querySelector('vaadin-checkbox');\n }\n\n get value() {\n return this.checkbox?.checked;\n }\n\n set value(val) {\n this.checkbox.checked = val;\n }\n\n get checked() {\n return this.value;\n }\n\n set checked(val) {\n this.value = val;\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n if (e.isTrusted) {\n this.checkbox.focus();\n }\n });\n super.init?.();\n\n forwardAttrs(this, this.checkbox, { includeAttrs: forwardAttributes });\n syncAttrs(this, this.checkbox, { includeAttrs: ['checked'] });\n\n // we need it in order to set the focus ring and trigger validation on descope-checkbox\n this.handleFocusEventsDispatching([this.checkbox]);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null);\n }\n }\n\n onReadOnlyChange(val) {\n this.baseElement.setAttribute('inert', val);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n return {};\n }\n}\n\nexport default BooleanInputInternal;\n","import { resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';\n\nexport default `\n:host {\n\tdisplay: inline-flex;\n}\n\n${resetInputFieldDefaultWidth()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot=\"label\"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot=\"label\"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`;\n","import { componentName, CheckboxClass } from './CheckboxClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, CheckboxClass);\n\nexport { CheckboxClass, componentName };\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('checkbox');\n\nconst {\n host,\n component,\n checkboxElement,\n checkboxSurface,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: { selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::after' },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const CheckboxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [host, checkboxElement, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: { ...checkboxLabel, property: 'color' },\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\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 errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n inputValueTextColor: { ...checkboxSurface, property: 'color' },\n inputBackgroundColor: { ...checkboxElement, property: 'background-color' },\n\n inputBorderRadius: { ...checkboxElement, property: 'border-radius' },\n inputBorderWidth: { ...checkboxElement, property: 'border-width' },\n inputBorderOffset: { ...checkboxElement, property: 'border-offset' },\n inputBorderColor: { ...checkboxElement, property: 'border-color' },\n inputBorderStyle: { ...checkboxElement, property: 'border-style' },\n\n inputOutlineWidth: { ...checkboxElement, property: 'outline-width' },\n inputOutlineOffset: { ...checkboxElement, property: 'outline-offset' },\n inputOutlineColor: { ...checkboxElement, property: 'outline-color' },\n inputOutlineStyle: { ...checkboxElement, property: 'outline-style' },\n\n inputSize: [\n { ...checkboxElement, property: 'width' },\n { ...checkboxElement, property: 'height' },\n { ...checkboxSurface, property: 'font-size' },\n { ...component, property: 'font-size' },\n ],\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles}\n ${useHostExternalPadding(CheckboxClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n margin: 1px;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n height: 100%;\n }\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(checkbox)::after {\n top: 0;\n left: 0;\n -webkit-text-fill-color: initial;\n }\n\n vaadin-checkbox label {\n -webkit-text-fill-color: initial;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,\n excludeAttrsSync: ['label', 'tabindex'],\n componentName,\n })\n);\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"],"names":["customElements","define","createBaseInputClass","args","InputController","constructor","host","callback","super","initializer","node","value","type","setAttribute","id","this","defaultId","useUniqueId","booleanFieldMixin","superclass","init","template","document","createElement","innerHTML","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","querySelector","checkbox","includeAttrs","componentName","forwardAttributes","BaseInputClass","baseSelector","observedAttributes","wrapperEle","checked","val","addEventListener","e","isTrusted","focus","handleFocusEventsDispatching","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","getValidity","isRequired","valueMissing","component","checkboxElement","checkboxSurface","checkboxLabel","requiredIndicator","helperText","errorMessage","selector","CheckboxClass","mappings","hostWidth","property","hostDirection","fontSize","fontFamily","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputValueTextColor","inputBackgroundColor","inputBorderRadius","inputBorderWidth","inputBorderOffset","inputBorderColor","inputBorderStyle","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","inputSize","proxyProps","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","useHostExternalPadding","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","ele","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","inputHeight","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle"],"sourceRoot":""}
1
+ {"version":3,"file":"boolean-fields-descope-checkbox-index-js.js","mappings":";mKAEAA,eAAeC,OAAO,IAAe,0ECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,qDCLhB,MAAMC,UAAwB,IACnC,WAAAC,CAAYC,EAAMC,GAChBC,MAAMF,EAAM,QAAS,QAAS,CAC5BG,YAAa,CAACC,EAAMJ,KACdA,EAAKK,QACPD,EAAKC,MAAQL,EAAKK,OAEhBL,EAAKM,MACPF,EAAKG,aAAa,OAAQP,EAAKM,MAIjCF,EAAKI,GAAKC,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C3CA,8DAKOO,EAAyCP,GAAS,SACzDA,oEAKOQ,EAAsB,CAACR,EAAMJ,IAAe,SACnDG,EAAoBC,WACpBE,EAAiBF,WACjBG,EAAsBH,WACtBC,EAAgBD,WAlCY,EAACA,EAAMJ,IAAe,SAClDI,kCACAA,8CACAA,wCACAA,yCACAA,0EACiCJ,EAAWhB,wDAClBgB,EAAWa,oBAAoBb,EAAWf,wCA4BpE6B,CAAmBV,EAAMJ,WACzBW,EAAsCP,WAnFV,CAACA,GAAS,SACtCA,yCAmFAW,CAAmBX,WA9EQ,CAACA,GAAS,SACrCA,mHA8EAY,CAAkBZ,WA3FwB,CAACA,GAAS,SACpDA,gEA2FAa,CAAiCb,OAM1Bc,EAA2Bd,GAAS,4ZAiB3CA,yJAQOe,EAA0B,IAC9B","sources":["webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/index.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/booleanFieldMixin.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/commonStyles.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-checkbox/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-checkbox/CheckboxClass.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js"],"sourcesContent":["import BooleanFieldInternal, { componentName } from './BooleanFieldInternal';\n\ncustomElements.define(componentName, BooleanFieldInternal);\n","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","/**\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 { forwardAttrs, forwardProps, syncAttrs } from '../../helpers/componentHelpers';\nimport { componentName as descopeInternalComponentName } from './descope-boolean-field-internal/BooleanFieldInternal';\n\nexport const booleanFieldMixin = (superclass) =>\n class BooleanFieldMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n template.innerHTML = `\n\t\t\t\t<${descopeInternalComponentName}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tslot=\"input\"\n\t\t\t\t></${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n this.checkbox = this.inputElement.querySelector('vaadin-checkbox');\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'required',\n 'full-width',\n 'size',\n 'label',\n 'invalid',\n 'disabled',\n 'readonly',\n ],\n });\n\n forwardProps(this.inputElement, this, ['checked']);\n syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });\n }\n };\n","import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('boolean-field-internal');\n\nconst forwardAttributes = ['disabled', 'label', 'invalid', 'readonly'];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass BooleanInputInternal extends BaseInputClass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n constructor() {\n super();\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t`;\n this.wrapperEle = this.querySelector('div');\n this.checkbox = this.querySelector('vaadin-checkbox');\n }\n\n get value() {\n return this.checkbox?.checked;\n }\n\n set value(val) {\n this.checkbox.checked = val;\n }\n\n get checked() {\n return this.value;\n }\n\n set checked(val) {\n this.value = val;\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n if (e.isTrusted) {\n this.checkbox.focus();\n }\n });\n super.init?.();\n\n forwardAttrs(this, this.checkbox, { includeAttrs: forwardAttributes });\n syncAttrs(this, this.checkbox, { includeAttrs: ['checked'] });\n\n // we need it in order to set the focus ring and trigger validation on descope-checkbox\n this.handleFocusEventsDispatching([this.checkbox]);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null);\n }\n }\n\n onReadOnlyChange(val) {\n this.baseElement.setAttribute('inert', val);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n return {};\n }\n}\n\nexport default BooleanInputInternal;\n","import { resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';\n\nexport default `\n:host {\n\tdisplay: inline-flex;\n}\n\n${resetInputFieldDefaultWidth()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot=\"label\"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot=\"label\"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`;\n","import { componentName, CheckboxClass } from './CheckboxClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, CheckboxClass);\n\nexport { CheckboxClass, componentName };\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('checkbox');\n\nconst {\n host,\n component,\n checkboxElement,\n checkboxSurface,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: { selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::after' },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const CheckboxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [host, checkboxElement, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: { ...checkboxLabel, property: 'color' },\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\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 errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n inputValueTextColor: { ...checkboxSurface, property: 'color' },\n inputBackgroundColor: { ...checkboxElement, property: 'background-color' },\n\n inputBorderRadius: { ...checkboxElement, property: 'border-radius' },\n inputBorderWidth: { ...checkboxElement, property: 'border-width' },\n inputBorderOffset: { ...checkboxElement, property: 'border-offset' },\n inputBorderColor: { ...checkboxElement, property: 'border-color' },\n inputBorderStyle: { ...checkboxElement, property: 'border-style' },\n\n inputOutlineWidth: { ...checkboxElement, property: 'outline-width' },\n inputOutlineOffset: { ...checkboxElement, property: 'outline-offset' },\n inputOutlineColor: { ...checkboxElement, property: 'outline-color' },\n inputOutlineStyle: { ...checkboxElement, property: 'outline-style' },\n\n inputSize: [\n { ...checkboxElement, property: 'width' },\n { ...checkboxElement, property: 'height' },\n { ...checkboxSurface, property: 'font-size' },\n { ...component, property: 'font-size' },\n ],\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles}\n ${useHostExternalPadding(CheckboxClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n margin: 1px;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n height: 100%;\n }\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(checkbox)::after {\n top: 0;\n left: 0;\n -webkit-text-fill-color: initial;\n }\n\n vaadin-checkbox label {\n -webkit-text-fill-color: initial;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,\n excludeAttrsSync: ['label', 'tabindex'],\n componentName,\n })\n);\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]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n `;\n};\n"],"names":["customElements","define","createBaseInputClass","args","InputController","constructor","host","callback","super","initializer","node","value","type","setAttribute","id","this","defaultId","useUniqueId","booleanFieldMixin","superclass","init","template","document","createElement","innerHTML","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","querySelector","checkbox","includeAttrs","componentName","forwardAttributes","BaseInputClass","baseSelector","observedAttributes","wrapperEle","checked","val","addEventListener","e","isTrusted","focus","handleFocusEventsDispatching","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","getValidity","isRequired","valueMissing","component","checkboxElement","checkboxSurface","checkboxLabel","requiredIndicator","helperText","errorMessage","selector","CheckboxClass","mappings","hostWidth","property","hostDirection","fontSize","fontFamily","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputValueTextColor","inputBackgroundColor","inputBorderRadius","inputBorderWidth","inputBorderOffset","inputBorderColor","inputBorderStyle","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","inputSize","proxyProps","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","useHostExternalPadding","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","ele","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","inputHeight","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1448,7362],{3274:(t,e,n)=>{n.r(e);var i=n(41813);customElements.define(i.T,i.A)},3393:(t,e,n)=>{n.d(e,{y:()=>a});var i=n(9696),o=n(79365),r=n(81365);const a=(...t)=>(0,i.Zz)(o.XX,o._$,o.yF,o.jd)((0,r.q)(...t))},18330:(t,e,n)=>{n.d(e,{f:()=>o});var i=n(44099);class o extends i.r{constructor(t,e){super(t,"input","input",{initializer:(t,n)=>{n.value&&(t.value=n.value),n.type&&t.setAttribute("type",n.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}},19847:(t,e,n)=>{n.d(e,{A:()=>r});var i=n(97810),o=n(41813);const r=t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,i.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,i.q)(this.inputElement,this,["checked"]),(0,i.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},21934:(t,e,n)=>{n.r(e),n.d(e,{SwitchToggleClass:()=>i.H,componentName:()=>i.T});var i=n(83150);n(67468),n(11284),n(3274),customElements.define(i.T,i.H)},41813:(t,e,n)=>{n.d(e,{A:()=>d,T:()=>r});var i=n(3393),o=n(97810);const r=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],l=(0,i.y)({componentName:r,baseSelector:"div"}),d=class extends l{static get observedAttributes(){return["readonly"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox")}get value(){return this.checkbox?.checked}set value(t){this.checkbox.checked=t}get checked(){return this.value}set checked(t){this.value=t}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.checkbox.focus()})),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:a}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"readonly"===t&&this.onReadOnlyChange(null!==n)}onReadOnlyChange(t){this.baseElement.setAttribute("inert",t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},47507:(t,e,n)=>{n.d(e,{A:()=>i});const i=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,n(73551).X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`},73551:(t,e,n)=>{n.d(e,{$J:()=>h,I4:()=>a,Kl:()=>u,LJ:()=>p,Qv:()=>r,X6:()=>d,cy:()=>i,fu:()=>s,kG:()=>c,lS:()=>l,zm:()=>o});const i=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,o=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,r=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`,d=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",s=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,c=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${o(t)}\n ${a(t)}\n ${l(t)}\n ${r(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 ${c(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`,h=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`,u=()=>'\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 '},83150:(t,e,n)=>{n.d(e,{H:()=>g,T:()=>s});var i=n(97810),o=n(9696),r=n(79365),a=n(19847),l=n(47507),d=n(73551);const s=(0,i.xE)("switch-toggle"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:f,helperText:x,errorMessage:k}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},g=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[p,b,b],fontFamily:[b,x,k],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...k,property:"color"},errorMessageIcon:{...k,property:"background-image"},errorMessageIconSize:{...k,property:"background-size"},errorMessageIconPadding:{...k,property:"padding-inline-start"},errorMessageIconRepeat:{...k,property:"background-repeat"},errorMessageIconPosition:{...k,property:"background-position"},errorMessageFontSize:{...k,property:"font-size"},trackBorderWidth:{...h,property:"border-width"},trackBorderStyle:{...h,property:"border-style"},trackBorderColor:{...h,property:"border-color"},trackBackgroundColor:{...h,property:"background-color"},trackBorderRadius:{...h,property:"border-radius"},trackWidth:[{...h,property:"width"}],trackHeight:[{...u,property:"font-size"},{...h,property:"height"}],knobSize:[{...u,property:"width"},{...u,property:"height"}],knobTextColor:{...u,property:"color"},knobRadius:{...u,property:"border-radius"},knobTransitionDuration:{...u,property:"transition"},knobColor:{...u,property:"background-color"},knobTopOffset:{...u,property:"top"},knobLeftOffset:{...u,property:"left"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"}}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,a.A)((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${l.A}\n\t\t\t${(0,d.cy)(g.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot="label"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,excludeAttrsSync:["label","tabindex"],componentName:s}))}}]);
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1448,7362],{3274:(t,e,n)=>{n.r(e);var i=n(41813);customElements.define(i.T,i.A)},3393:(t,e,n)=>{n.d(e,{y:()=>a});var i=n(9696),o=n(79365),r=n(81365);const a=(...t)=>(0,i.Zz)(o.XX,o._$,o.yF,o.jd)((0,r.q)(...t))},18330:(t,e,n)=>{n.d(e,{f:()=>o});var i=n(44099);class o extends i.r{constructor(t,e){super(t,"input","input",{initializer:(t,n)=>{n.value&&(t.value=n.value),n.type&&t.setAttribute("type",n.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}},19847:(t,e,n)=>{n.d(e,{A:()=>r});var i=n(97810),o=n(41813);const r=t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,i.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,i.q)(this.inputElement,this,["checked"]),(0,i.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},21934:(t,e,n)=>{n.r(e),n.d(e,{SwitchToggleClass:()=>i.H,componentName:()=>i.T});var i=n(83150);n(67468),n(11284),n(3274),customElements.define(i.T,i.H)},41813:(t,e,n)=>{n.d(e,{A:()=>d,T:()=>r});var i=n(3393),o=n(97810);const r=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],l=(0,i.y)({componentName:r,baseSelector:"div"}),d=class extends l{static get observedAttributes(){return["readonly"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox")}get value(){return this.checkbox?.checked}set value(t){this.checkbox.checked=t}get checked(){return this.value}set checked(t){this.value=t}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.checkbox.focus()})),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:a}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"readonly"===t&&this.onReadOnlyChange(null!==n)}onReadOnlyChange(t){this.baseElement.setAttribute("inert",t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},47507:(t,e,n)=>{n.d(e,{A:()=>i});const i=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,n(73551).X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`},73551:(t,e,n)=>{n.d(e,{$J:()=>h,I4:()=>a,Kl:()=>u,LJ:()=>p,Qv:()=>r,X6:()=>d,cy:()=>i,fu:()=>s,kG:()=>c,lS:()=>l,zm:()=>o});const i=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,o=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,r=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`,d=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",s=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,c=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${o(t)}\n ${a(t)}\n ${l(t)}\n ${r(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 ${c(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`,h=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`,u=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '},83150:(t,e,n)=>{n.d(e,{H:()=>g,T:()=>s});var i=n(97810),o=n(9696),r=n(79365),a=n(19847),l=n(47507),d=n(73551);const s=(0,i.xE)("switch-toggle"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:f,helperText:x,errorMessage:k}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},g=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[p,b,b],fontFamily:[b,x,k],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...f,property:"content"},errorMessageTextColor:{...k,property:"color"},errorMessageIcon:{...k,property:"background-image"},errorMessageIconSize:{...k,property:"background-size"},errorMessageIconPadding:{...k,property:"padding-inline-start"},errorMessageIconRepeat:{...k,property:"background-repeat"},errorMessageIconPosition:{...k,property:"background-position"},errorMessageFontSize:{...k,property:"font-size"},trackBorderWidth:{...h,property:"border-width"},trackBorderStyle:{...h,property:"border-style"},trackBorderColor:{...h,property:"border-color"},trackBackgroundColor:{...h,property:"background-color"},trackBorderRadius:{...h,property:"border-radius"},trackWidth:[{...h,property:"width"}],trackHeight:[{...u,property:"font-size"},{...h,property:"height"}],knobSize:[{...u,property:"width"},{...u,property:"height"}],knobTextColor:{...u,property:"color"},knobRadius:{...u,property:"border-radius"},knobTransitionDuration:{...u,property:"transition"},knobColor:{...u,property:"background-color"},knobTopOffset:{...u,property:"top"},knobLeftOffset:{...u,property:"left"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"}}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,a.A)((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${l.A}\n\t\t\t${(0,d.cy)(g.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot="label"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,excludeAttrsSync:["label","tabindex"],componentName:s}))}}]);
3
3
  //# sourceMappingURL=boolean-fields-descope-switch-toggle-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"boolean-fields-descope-switch-toggle-index-js.js","mappings":";mKAEAA,eAAeC,OAAO,IAAe,0ECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,qDCLhB,MAAMC,UAAwB,IACnC,WAAAC,CAAYC,EAAMC,GAChBC,MAAMF,EAAM,QAAS,QAAS,CAC5BG,YAAa,CAACC,EAAMJ,KACdA,EAAKK,QACPD,EAAKC,MAAQL,EAAKK,OAEhBL,EAAKM,MACPF,EAAKG,aAAa,OAAQP,EAAKM,MAIjCF,EAAKI,GAAKC,KAAKC,UAES,mBAAbT,GACTA,EAASG,EACX,EAEFO,aAAa,GAEjB,+DC3BK,MAAMC,EAAqBC,GAChC,cAAqCA,EACnC,IAAAC,GACEZ,MAAMY,SAEN,MAAMC,EAAWC,SAASC,cAAc,YACxCF,EAASG,UAAY,cACpB,oEAGE,eAGHT,KAAKU,YAAYC,YAAYL,EAASM,QAAQC,WAAU,IACxDb,KAAKc,aAAed,KAAKe,WAAWC,cAAc,KAClDhB,KAAKiB,SAAWjB,KAAKc,aAAaE,cAAc,oBAEhD,QAAahB,KAAMA,KAAKc,aAAc,CACpCI,aAAc,CACZ,WACA,aACA,OACA,QACA,UACA,WACA,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C8B,kBAAmB,IAAKzC,EAAOW,SAAU,iBACzC+B,kBAAmB,IAAK1C,EAAOW,SAAU,oBAG7C,MACA,QAAgB,CAAEgC,WAAY,CAAC,QAAS,oBACxC,KACA,IAvD+B,EAyD/B,QAAY,CACVC,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,WACZ,eACA,QAAuBtC,EAAkBhC,+/BAsD1CuE,iBAAkB,CAAC,QAAS,YAC5B7F","sources":["webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/index.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/booleanFieldMixin.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/commonStyles.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js"],"sourcesContent":["import BooleanFieldInternal, { componentName } from './BooleanFieldInternal';\n\ncustomElements.define(componentName, BooleanFieldInternal);\n","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","/**\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 { forwardAttrs, forwardProps, syncAttrs } from '../../helpers/componentHelpers';\nimport { componentName as descopeInternalComponentName } from './descope-boolean-field-internal/BooleanFieldInternal';\n\nexport const booleanFieldMixin = (superclass) =>\n class BooleanFieldMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n template.innerHTML = `\n\t\t\t\t<${descopeInternalComponentName}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tslot=\"input\"\n\t\t\t\t></${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n this.checkbox = this.inputElement.querySelector('vaadin-checkbox');\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'required',\n 'full-width',\n 'size',\n 'label',\n 'invalid',\n 'disabled',\n 'readonly',\n ],\n });\n\n forwardProps(this.inputElement, this, ['checked']);\n syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });\n }\n };\n","import { componentName, SwitchToggleClass } from './SwitchToggleClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, SwitchToggleClass);\n\nexport { SwitchToggleClass, componentName };\n","import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('boolean-field-internal');\n\nconst forwardAttributes = ['disabled', 'label', 'invalid', 'readonly'];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass BooleanInputInternal extends BaseInputClass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n constructor() {\n super();\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t`;\n this.wrapperEle = this.querySelector('div');\n this.checkbox = this.querySelector('vaadin-checkbox');\n }\n\n get value() {\n return this.checkbox?.checked;\n }\n\n set value(val) {\n this.checkbox.checked = val;\n }\n\n get checked() {\n return this.value;\n }\n\n set checked(val) {\n this.value = val;\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n if (e.isTrusted) {\n this.checkbox.focus();\n }\n });\n super.init?.();\n\n forwardAttrs(this, this.checkbox, { includeAttrs: forwardAttributes });\n syncAttrs(this, this.checkbox, { includeAttrs: ['checked'] });\n\n // we need it in order to set the focus ring and trigger validation on descope-checkbox\n this.handleFocusEventsDispatching([this.checkbox]);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null);\n }\n }\n\n onReadOnlyChange(val) {\n this.baseElement.setAttribute('inert', val);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n return {};\n }\n}\n\nexport default BooleanInputInternal;\n","import { resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';\n\nexport default `\n:host {\n\tdisplay: inline-flex;\n}\n\n${resetInputFieldDefaultWidth()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot=\"label\"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot=\"label\"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`;\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 { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('switch-toggle');\n\nconst {\n host,\n component,\n checkboxElement: track,\n checkboxSurface: knob,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: { selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::after' },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const SwitchToggleClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [component, checkboxLabel, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: { ...checkboxLabel, property: 'color' },\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n\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 errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n trackBorderWidth: { ...track, property: 'border-width' },\n trackBorderStyle: { ...track, property: 'border-style' },\n trackBorderColor: { ...track, property: 'border-color' },\n trackBackgroundColor: { ...track, property: 'background-color' },\n trackBorderRadius: { ...track, property: 'border-radius' },\n trackWidth: [{ ...track, property: 'width' }],\n trackHeight: [\n { ...knob, property: 'font-size' },\n { ...track, property: 'height' },\n ],\n\n knobSize: [\n { ...knob, property: 'width' },\n { ...knob, property: 'height' },\n ],\n knobTextColor: { ...knob, property: 'color' },\n knobRadius: { ...knob, property: 'border-radius' },\n knobTransitionDuration: { ...knob, property: 'transition' },\n knobColor: { ...knob, property: 'background-color' },\n knobTopOffset: { ...knob, property: 'top' },\n knobLeftOffset: { ...knob, property: 'left' },\n\n inputOutlineWidth: { ...track, property: 'outline-width' },\n inputOutlineOffset: { ...track, property: 'outline-offset' },\n inputOutlineColor: { ...track, property: 'outline-color' },\n inputOutlineStyle: { ...track, property: 'outline-style' },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles}\n\t\t\t${useHostExternalPadding(SwitchToggleClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot=\"label\"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['label', 'tabindex'],\n componentName,\n })\n);\n"],"names":["customElements","define","createBaseInputClass","args","InputController","constructor","host","callback","super","initializer","node","value","type","setAttribute","id","this","defaultId","useUniqueId","booleanFieldMixin","superclass","init","template","document","createElement","innerHTML","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","querySelector","checkbox","includeAttrs","componentName","forwardAttributes","BaseInputClass","baseSelector","observedAttributes","wrapperEle","checked","val","addEventListener","e","isTrusted","focus","handleFocusEventsDispatching","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","getValidity","isRequired","valueMissing","useHostExternalPadding","cssVarList","inputOutlineWidth","inputOutlineOffset","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","ele","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","inputValueTextColor","inputHeight","inputBackgroundColor","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","component","checkboxElement","track","checkboxSurface","knob","checkboxLabel","requiredIndicator","helperText","errorMessage","selector","SwitchToggleClass","mappings","hostWidth","property","hostDirection","fontSize","fontFamily","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","trackBorderWidth","trackBorderStyle","trackBorderColor","trackBackgroundColor","trackBorderRadius","trackWidth","trackHeight","knobSize","knobTextColor","knobRadius","knobTransitionDuration","knobColor","knobTopOffset","knobLeftOffset","inputOutlineColor","inputOutlineStyle","proxyProps","slots","wrappedEleName","style","excludeAttrsSync"],"sourceRoot":""}
1
+ {"version":3,"file":"boolean-fields-descope-switch-toggle-index-js.js","mappings":";mKAEAA,eAAeC,OAAO,IAAe,0ECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,qDCLhB,MAAMC,UAAwB,IACnC,WAAAC,CAAYC,EAAMC,GAChBC,MAAMF,EAAM,QAAS,QAAS,CA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AK9B,EAAOW,SAAU,oBAC5CoB,kBAAmB,IAAK/B,EAAOW,SAAU,iBACzCqB,WAAY,CAAC,IAAKhC,EAAOW,SAAU,UACnCsB,YAAa,CACX,IAAK/B,EAAMS,SAAU,aACrB,IAAKX,EAAOW,SAAU,WAGxBuB,SAAU,CACR,IAAKhC,EAAMS,SAAU,SACrB,IAAKT,EAAMS,SAAU,WAEvBwB,cAAe,IAAKjC,EAAMS,SAAU,SACpCyB,WAAY,IAAKlC,EAAMS,SAAU,iBACjC0B,uBAAwB,IAAKnC,EAAMS,SAAU,cAC7C2B,UAAW,IAAKpC,EAAMS,SAAU,oBAChC4B,cAAe,IAAKrC,EAAMS,SAAU,OACpC6B,eAAgB,IAAKtC,EAAMS,SAAU,QAErClC,kBAAmB,IAAKuB,EAAOW,SAAU,iBACzCjC,mBAAoB,IAAKsB,EAAOW,SAAU,kBAC1C8B,kBAAmB,IAAKzC,EAAOW,SAAU,iBACzC+B,kBAAmB,IAAK1C,EAAOW,SAAU,oBAG7C,MACA,QAAgB,CAAEgC,WAAY,CAAC,QAAS,oBACxC,KACA,IAvD+B,EAyD/B,QAAY,CACVC,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,WACZ,eACA,QAAuBtC,EAAkBhC,+/BAsD1CuE,iBAAkB,CAAC,QAAS,YAC5B7F","sources":["webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/index.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-controller.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/booleanFieldMixin.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/commonStyles.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js"],"sourcesContent":["import BooleanFieldInternal, { componentName } from './BooleanFieldInternal';\n\ncustomElements.define(componentName, BooleanFieldInternal);\n","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","/**\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 { forwardAttrs, forwardProps, syncAttrs } from '../../helpers/componentHelpers';\nimport { componentName as descopeInternalComponentName } from './descope-boolean-field-internal/BooleanFieldInternal';\n\nexport const booleanFieldMixin = (superclass) =>\n class BooleanFieldMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n template.innerHTML = `\n\t\t\t\t<${descopeInternalComponentName}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tslot=\"input\"\n\t\t\t\t></${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n this.checkbox = this.inputElement.querySelector('vaadin-checkbox');\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'required',\n 'full-width',\n 'size',\n 'label',\n 'invalid',\n 'disabled',\n 'readonly',\n ],\n });\n\n forwardProps(this.inputElement, this, ['checked']);\n syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });\n }\n };\n","import { componentName, SwitchToggleClass } from './SwitchToggleClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, SwitchToggleClass);\n\nexport { SwitchToggleClass, componentName };\n","import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('boolean-field-internal');\n\nconst forwardAttributes = ['disabled', 'label', 'invalid', 'readonly'];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass BooleanInputInternal extends BaseInputClass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n constructor() {\n super();\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t`;\n this.wrapperEle = this.querySelector('div');\n this.checkbox = this.querySelector('vaadin-checkbox');\n }\n\n get value() {\n return this.checkbox?.checked;\n }\n\n set value(val) {\n this.checkbox.checked = val;\n }\n\n get checked() {\n return this.value;\n }\n\n set checked(val) {\n this.value = val;\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n if (e.isTrusted) {\n this.checkbox.focus();\n }\n });\n super.init?.();\n\n forwardAttrs(this, this.checkbox, { includeAttrs: forwardAttributes });\n syncAttrs(this, this.checkbox, { includeAttrs: ['checked'] });\n\n // we need it in order to set the focus ring and trigger validation on descope-checkbox\n this.handleFocusEventsDispatching([this.checkbox]);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null);\n }\n }\n\n onReadOnlyChange(val) {\n this.baseElement.setAttribute('inert', val);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n return {};\n }\n}\n\nexport default BooleanInputInternal;\n","import { resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';\n\nexport default `\n:host {\n\tdisplay: inline-flex;\n}\n\n${resetInputFieldDefaultWidth()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot=\"label\"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot=\"label\"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`;\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]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n `;\n};\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('switch-toggle');\n\nconst {\n host,\n component,\n checkboxElement: track,\n checkboxSurface: knob,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: { selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::after' },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const SwitchToggleClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [component, checkboxLabel, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: { ...checkboxLabel, property: 'color' },\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n\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 errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n trackBorderWidth: { ...track, property: 'border-width' },\n trackBorderStyle: { ...track, property: 'border-style' },\n trackBorderColor: { ...track, property: 'border-color' },\n trackBackgroundColor: { ...track, property: 'background-color' },\n trackBorderRadius: { ...track, property: 'border-radius' },\n trackWidth: [{ ...track, property: 'width' }],\n trackHeight: [\n { ...knob, property: 'font-size' },\n { ...track, property: 'height' },\n ],\n\n knobSize: [\n { ...knob, property: 'width' },\n { ...knob, property: 'height' },\n ],\n knobTextColor: { ...knob, property: 'color' },\n knobRadius: { ...knob, property: 'border-radius' },\n knobTransitionDuration: { ...knob, property: 'transition' },\n knobColor: { ...knob, property: 'background-color' },\n knobTopOffset: { ...knob, property: 'top' },\n knobLeftOffset: { ...knob, property: 'left' },\n\n inputOutlineWidth: { ...track, property: 'outline-width' },\n inputOutlineOffset: { ...track, property: 'outline-offset' },\n inputOutlineColor: { ...track, property: 'outline-color' },\n inputOutlineStyle: { ...track, property: 'outline-style' },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles}\n\t\t\t${useHostExternalPadding(SwitchToggleClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot=\"label\"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['label', 'tabindex'],\n componentName,\n })\n);\n"],"names":["customElements","define","createBaseInputClass","args","InputController","constructor","host","callback","super","initializer","node","value","type","setAttribute","id","this","defaultId","useUniqueId","booleanFieldMixin","superclass","init","template","document","createElement","innerHTML","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","querySelector","checkbox","includeAttrs","componentName","forwardAttributes","BaseInputClass","baseSelector","observedAttributes","wrapperEle","checked","val","addEventListener","e","isTrusted","focus","handleFocusEventsDispatching","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","getValidity","isRequired","valueMissing","useHostExternalPadding","cssVarList","inputOutlineWidth","inputOutlineOffset","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","ele","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","inputValueTextColor","inputHeight","inputBackgroundColor","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","component","checkboxElement","track","checkboxSurface","knob","checkboxLabel","requiredIndicator","helperText","errorMessage","selector","SwitchToggleClass","mappings","hostWidth","property","hostDirection","fontSize","fontFamily","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","trackBorderWidth","trackBorderStyle","trackBorderColor","trackBackgroundColor","trackBorderRadius","trackWidth","trackHeight","knobSize","knobTextColor","knobRadius","knobTransitionDuration","knobColor","knobTopOffset","knobLeftOffset","inputOutlineColor","inputOutlineStyle","proxyProps","slots","wrappedEleName","style","excludeAttrsSync"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3829,8399],{3393:(t,e,n)=>{n.d(e,{y:()=>s});var i=n(9696),r=n(79365),a=n(81365);const s=(...t)=>(0,i.Zz)(r.XX,r._$,r.yF,r.jd)((0,a.q)(...t))},5364:(t,e,n)=>{n.d(e,{T:()=>a,o:()=>s});var i=n(97810),r=n(51298);const a=(0,i.xE)("button-multi-selection-group-internal");class s extends((0,r.m)(a)){#t(){return this.items.filter((t=>t.hasAttribute("selected")))}onClick(t){t.target!==t.currentTarget&&(this.#t().includes(t.target)?t.target.removeAttribute("selected"):t.target.setAttribute("selected","true"),this.dispatchChange())}get value(){return this.#t().map((t=>t.value))}set value(t){this.items.forEach((e=>{t.includes(e.value)?e.setAttribute("selected","true"):e.removeAttribute("selected")}))}get minItemsSelection(){return parseInt(this.getAttribute("min-items-selection"),10)||0}get maxItemsSelection(){return parseInt(this.getAttribute("max-items-selection"),10)||0}#e(t){const e=Array.isArray(t);return e||console.error("default-values must be an array, received:",t),e}get defaultValues(){const t=this.getAttribute("default-values");if(t)try{const e=JSON.parse(t);if(this.#e(e))return e}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){setTimeout((()=>{this.defaultValues&&(this.value=this.defaultValues,this.setCustomValidity())}))}getValidity(){return this.isRequired&&!this.value.length?{valueMissing:!0}:this.isRequired&&this.minItemsSelection&&this.value.length<this.minItemsSelection?{rangeUnderflow:!0}:this.maxItemsSelection&&this.value.length>this.maxItemsSelection?{rangeOverflow:!0}:{}}init(){super.init(),this.setDefaultValues(),this.querySelector("slot").addEventListener("click",this.onClick.bind(this))}}},51298:(t,e,n)=>{n.d(e,{m:()=>s}),n(25964);var i=n(3393),r=n(97810),a=n(13011);const s=t=>{class e extends((0,i.y)({componentName:t,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n <slot part="wrapper"></slot>\n '}dispatchChange=a.r.bind(this,"change");get items(){return this.querySelector("slot").assignedElements()}get isReadonly(){return"true"===this.getAttribute("readonly")}get size(){return this.getAttribute("size")||"md"}get value(){console.warn("get value","is not implemented")}set value(t){console.warn("set value","is not implemented")}onSizeChange(){this.items.forEach((t=>{t.setAttribute("size",this.size)}))}onReadOnlyChange(){this.querySelector("slot").toggleAttribute("inert",this.isReadonly)}getValidity(){console.warn("getValidity","is not implemented")}onObservedAttributeChange(t){t.forEach((t=>{switch(t){case"size":this.onSizeChange();break;case"readonly":this.onReadOnlyChange()}}))}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.items[0]?.focus()})),super.init?.(),(0,r.mx)(this,this.onObservedAttributeChange.bind(this),{includeAttrs:["size","readonly"]})}}return e}},55162:(t,e,n)=>{n.r(e),n.d(e,{ButtonMultiSelectionGroupClass:()=>d,componentName:()=>l});var i=n(79365),r=n(5364),a=n(9696),s=n(97810),o=n(80001);const l=(0,s.xE)("button-multi-selection-group"),d=(0,a.Zz)((0,i.RF)({mappings:{...o.$W}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,o._Z,(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${r.T}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${r.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.T),(0,s.EA)(this,this.inputElement,{includeAttrs:["size","default-values","min-items-selection","max-items-selection"]})}}))((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>o.S$,excludeAttrsSync:["tabindex"],componentName:l}));n(91831),n(15450),customElements.define(l,d)},73551:(t,e,n)=>{n.d(e,{$J:()=>c,I4:()=>s,Kl:()=>h,LJ:()=>p,Qv:()=>a,X6:()=>l,cy:()=>i,fu:()=>d,kG:()=>u,lS:()=>o,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`,a=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,s=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,o=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,u=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${r(t)}\n ${s(t)}\n ${o(t)}\n ${a(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 ${u(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`,c=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 '},80001:(t,e,n)=>{n.d(e,{$W:()=>p,S$:()=>c,_Z:()=>a});var i=n(97810),r=n(73551);const a=t=>class extends t{#n=({value:t,label:e})=>`<descope-button-selection-group-item value="${t}">${e}</descope-button-selection-group-item>`;#i;get renderItem(){return this.#n}set renderItem(t){this.#n=t,this.renderItems()}get size(){return this.inputElement?.size}get data(){if(this.#i)return this.#i;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" - ',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#i=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}init(){super.init?.(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,(({addedNodes:t})=>{t.forEach((t=>{t.setAttribute("size",this.size)}))}))}},{host:s,label:o,requiredIndicator:l,internalWrapper:d,errorMessage:u}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:()=>':host [part="internal-component"] slot'},errorMessage:{selector:"::part(error-message)"}},p={hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontFamily:s,labelTextColor:[{...o,property:"color"},{...l,property:"color"}],labelRequiredIndicator:{...l,property:"content"},errorMessageTextColor:{...u,property:"color"},errorMessageIcon:{...u,property:"background-image"},errorMessageIconSize:{...u,property:"background-size"},errorMessageIconPadding:{...u,property:"padding-inline-start"},errorMessageIconRepeat:{...u,property:"background-repeat"},errorMessageIconPosition:{...u,property:"background-position"},errorMessageFontSize:{...u,property:"font-size"},itemsSpacing:{...d,property:"gap"}},c=`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t\t${(0,r.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 [part="internal-component"] {\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 display: inline-block;\n\t\t\t\tmin-height: initial;\n\t\t\t}\n\n [part="internal-component"] slot {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n flex-wrap: wrap;\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\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,r.$J)("vaadin-text-field")}\n\t\t\t${(0,r.I4)("vaadin-text-field")}\n `},91831:(t,e,n)=>{n.r(e),n.d(e,{ButtonMultiSelectionGroupInternalClass:()=>i.o});var i=n(5364);customElements.define(i.T,i.o)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[3829,8399],{3393:(t,e,n)=>{n.d(e,{y:()=>s});var i=n(9696),r=n(79365),a=n(81365);const s=(...t)=>(0,i.Zz)(r.XX,r._$,r.yF,r.jd)((0,a.q)(...t))},5364:(t,e,n)=>{n.d(e,{T:()=>a,o:()=>s});var i=n(97810),r=n(51298);const a=(0,i.xE)("button-multi-selection-group-internal");class s extends((0,r.m)(a)){#t(){return this.items.filter((t=>t.hasAttribute("selected")))}onClick(t){t.target!==t.currentTarget&&(this.#t().includes(t.target)?t.target.removeAttribute("selected"):t.target.setAttribute("selected","true"),this.dispatchChange())}get value(){return this.#t().map((t=>t.value))}set value(t){this.items.forEach((e=>{t.includes(e.value)?e.setAttribute("selected","true"):e.removeAttribute("selected")}))}get minItemsSelection(){return parseInt(this.getAttribute("min-items-selection"),10)||0}get maxItemsSelection(){return parseInt(this.getAttribute("max-items-selection"),10)||0}#e(t){const e=Array.isArray(t);return e||console.error("default-values must be an array, received:",t),e}get defaultValues(){const t=this.getAttribute("default-values");if(t)try{const e=JSON.parse(t);if(this.#e(e))return e}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){setTimeout((()=>{this.defaultValues&&(this.value=this.defaultValues,this.setCustomValidity())}))}getValidity(){return this.isRequired&&!this.value.length?{valueMissing:!0}:this.isRequired&&this.minItemsSelection&&this.value.length<this.minItemsSelection?{rangeUnderflow:!0}:this.maxItemsSelection&&this.value.length>this.maxItemsSelection?{rangeOverflow:!0}:{}}init(){super.init(),this.setDefaultValues(),this.querySelector("slot").addEventListener("click",this.onClick.bind(this))}}},51298:(t,e,n)=>{n.d(e,{m:()=>s}),n(25964);var i=n(3393),r=n(97810),a=n(13011);const s=t=>{class e extends((0,i.y)({componentName:t,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n <slot part="wrapper"></slot>\n '}dispatchChange=a.r.bind(this,"change");get items(){return this.querySelector("slot").assignedElements()}get isReadonly(){return"true"===this.getAttribute("readonly")}get size(){return this.getAttribute("size")||"md"}get value(){console.warn("get value","is not implemented")}set value(t){console.warn("set value","is not implemented")}onSizeChange(){this.items.forEach((t=>{t.setAttribute("size",this.size)}))}onReadOnlyChange(){this.querySelector("slot").toggleAttribute("inert",this.isReadonly)}getValidity(){console.warn("getValidity","is not implemented")}onObservedAttributeChange(t){t.forEach((t=>{switch(t){case"size":this.onSizeChange();break;case"readonly":this.onReadOnlyChange()}}))}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.items[0]?.focus()})),super.init?.(),(0,r.mx)(this,this.onObservedAttributeChange.bind(this),{includeAttrs:["size","readonly"]})}}return e}},55162:(t,e,n)=>{n.r(e),n.d(e,{ButtonMultiSelectionGroupClass:()=>d,componentName:()=>l});var i=n(79365),r=n(5364),a=n(9696),s=n(97810),o=n(80001);const l=(0,s.xE)("button-multi-selection-group"),d=(0,a.Zz)((0,i.RF)({mappings:{...o.$W}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,o._Z,(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${r.T}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${r.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.T),(0,s.EA)(this,this.inputElement,{includeAttrs:["size","default-values","min-items-selection","max-items-selection"]})}}))((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>o.S$,excludeAttrsSync:["tabindex"],componentName:l}));n(91831),n(15450),customElements.define(l,d)},73551:(t,e,n)=>{n.d(e,{$J:()=>c,I4:()=>s,Kl:()=>h,LJ:()=>p,Qv:()=>a,X6:()=>l,cy:()=>i,fu:()=>d,kG:()=>u,lS:()=>o,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`,a=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,s=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,o=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,u=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${r(t)}\n ${s(t)}\n ${o(t)}\n ${a(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 ${u(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`,c=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]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '},80001:(t,e,n)=>{n.d(e,{$W:()=>p,S$:()=>c,_Z:()=>a});var i=n(97810),r=n(73551);const a=t=>class extends t{#n=({value:t,label:e})=>`<descope-button-selection-group-item value="${t}">${e}</descope-button-selection-group-item>`;#i;get renderItem(){return this.#n}set renderItem(t){this.#n=t,this.renderItems()}get size(){return this.inputElement?.size}get data(){if(this.#i)return this.#i;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" - ',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#i=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}init(){super.init?.(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,(({addedNodes:t})=>{t.forEach((t=>{t.setAttribute("size",this.size)}))}))}},{host:s,label:o,requiredIndicator:l,internalWrapper:d,errorMessage:u}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},internalWrapper:{selector:()=>':host [part="internal-component"] slot'},errorMessage:{selector:"::part(error-message)"}},p={hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontFamily:s,labelTextColor:[{...o,property:"color"},{...l,property:"color"}],labelRequiredIndicator:{...l,property:"content"},errorMessageTextColor:{...u,property:"color"},errorMessageIcon:{...u,property:"background-image"},errorMessageIconSize:{...u,property:"background-size"},errorMessageIconPadding:{...u,property:"padding-inline-start"},errorMessageIconRepeat:{...u,property:"background-repeat"},errorMessageIconPosition:{...u,property:"background-position"},errorMessageFontSize:{...u,property:"font-size"},itemsSpacing:{...d,property:"gap"}},c=`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t\t${(0,r.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 [part="internal-component"] {\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 display: inline-block;\n\t\t\t\tmin-height: initial;\n\t\t\t}\n\n [part="internal-component"] slot {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n flex-wrap: wrap;\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\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,r.$J)("vaadin-text-field")}\n\t\t\t${(0,r.I4)("vaadin-text-field")}\n `},91831:(t,e,n)=>{n.r(e),n.d(e,{ButtonMultiSelectionGroupInternalClass:()=>i.o});var i=n(5364);customElements.define(i.T,i.o)}}]);
2
2
  //# sourceMappingURL=button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-selection-group-fields-descope-button-multi-selection-group-index-js.js","mappings":"kMASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,oECZhB,MAAMC,GAAgB,QAAiB,yCAEvC,MAAMC,WAA+C,OAC1DD,IAEA,KACE,OAAOE,KAAKC,MAAMC,QAAQC,GAASA,EAAKC,aAAa,aACvD,CAEA,OAAAC,CAAQC,GACFA,EAAEC,SAAWD,EAAEE,gBACbR,MAAK,IAAoBS,SAASH,EAAEC,QACtCD,EAAEC,OAAOG,gBAAgB,YAEzBJ,EAAEC,OAAOI,aAAa,WAAY,QAEpCX,KAAKY,iBAET,CAEA,SAAIC,GACF,OAAOb,MAAK,IAAoBc,KAAKC,GAASA,EAAKF,OACrD,CAEA,SAAIA,CAAMG,GACRhB,KAAKC,MAAMgB,SAASd,IACda,EAAOP,SAASN,EAAKU,OACvBV,EAAKQ,aAAa,WAAY,QAE9BR,EAAKO,gBAAgB,WACvB,GAEJ,CAEA,qBAAIQ,GACF,OAAOC,SAASnB,KAAKoB,aAAa,uBAAwB,KAAO,CACnE,CAEA,qBAAIC,GACF,OAAOF,SAASnB,KAAKoB,aAAa,uBAAwB,KAAO,CACnE,CAGA,GAAiBE,GACf,MAAMC,EAAUC,MAAMC,QAAQH,GAM9B,OALKC,GAEHG,QAAQC,MAAM,6CAA8CL,GAGvDC,CACT,CAEA,iBAAIK,GACF,MAAMC,EAAoB7B,KAAKoB,aAAa,kBAC5C,GAAIS,EACF,IACE,MAAMD,EAAgBE,KAAKC,MAAMF,GACjC,GAAI7B,MAAK,EAAiB4B,GACxB,OAAOA,CAEX,CAAE,MAAOtB,GAEPoB,QAAQC,MAAM,gEAA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xD,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/baseButtonSelectionGroup.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group-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","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { createBaseButtonSelectionGroupInternalClass } from '../createBaseButtonSelectionGroupInternalClass';\n\nexport const componentName = getComponentName('button-multi-selection-group-internal');\n\nexport class ButtonMultiSelectionGroupInternalClass extends createBaseButtonSelectionGroupInternalClass(\n componentName\n) {\n #getSelectedNodes() {\n return this.items.filter((item) => item.hasAttribute('selected'));\n }\n\n onClick(e) {\n if (e.target !== e.currentTarget) {\n if (this.#getSelectedNodes().includes(e.target)) {\n e.target.removeAttribute('selected');\n } else {\n e.target.setAttribute('selected', 'true');\n }\n this.dispatchChange();\n }\n }\n\n get value() {\n return this.#getSelectedNodes().map((node) => node.value);\n }\n\n set value(values) {\n this.items.forEach((item) => {\n if (values.includes(item.value)) {\n item.setAttribute('selected', 'true');\n } else {\n item.removeAttribute('selected');\n }\n });\n }\n\n get minItemsSelection() {\n return parseInt(this.getAttribute('min-items-selection'), 10) || 0;\n }\n\n get maxItemsSelection() {\n return parseInt(this.getAttribute('max-items-selection'), 10) || 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n #isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('default-values must be an array, received:', data);\n }\n\n return isValid;\n }\n\n get defaultValues() {\n const defaultValuesAttr = this.getAttribute('default-values');\n if (defaultValuesAttr) {\n try {\n const defaultValues = JSON.parse(defaultValuesAttr);\n if (this.#isValidDataType(defaultValues)) {\n return defaultValues;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"default-values\" -', e.message);\n }\n }\n return [];\n }\n\n setDefaultValues() {\n // we want to defer this action until all attributes are synced\n setTimeout(() => {\n if (this.defaultValues) {\n this.value = this.defaultValues;\n this.setCustomValidity();\n }\n });\n }\n\n getValidity() {\n if (this.isRequired && !this.value.length) {\n return { valueMissing: true };\n }\n // If the field is not required, no minimum selection can be set\n if (this.isRequired && this.minItemsSelection && this.value.length < this.minItemsSelection) {\n return {\n rangeUnderflow: true,\n };\n }\n if (this.maxItemsSelection && this.value.length > this.maxItemsSelection) {\n return {\n rangeOverflow: true,\n };\n }\n return {};\n }\n\n init() {\n super.init();\n\n this.setDefaultValues();\n\n this.querySelector('slot').addEventListener('click', this.onClick.bind(this));\n }\n}\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseInputClass } from '../../baseClasses/createBaseInputClass';\nimport { observeAttributes } from '../../helpers/componentHelpers';\nimport { createDispatchEvent } from '../../helpers/mixinsHelpers';\n\nexport const createBaseButtonSelectionGroupInternalClass = (componentName) => {\n class BaseButtonSelectionGroupInternalClass extends createBaseInputClass({\n componentName,\n baseSelector: 'slot',\n }) {\n constructor() {\n super();\n\n this.innerHTML = `\n <slot part=\"wrapper\"></slot>\n `;\n }\n\n dispatchChange = createDispatchEvent.bind(this, 'change');\n\n get items() {\n return this.querySelector('slot').assignedElements();\n }\n\n get isReadonly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n get size() {\n return this.getAttribute('size') || 'md';\n }\n\n // eslint-disable-next-line getter-return, class-methods-use-this\n get value() {\n // eslint-disable-next-line no-console\n console.warn('get value', 'is not implemented');\n }\n\n // eslint-disable-next-line class-methods-use-this\n set value(value) {\n // eslint-disable-next-line no-console\n console.warn('set value', 'is not implemented');\n }\n\n onSizeChange() {\n this.items.forEach((item) => {\n item.setAttribute('size', this.size);\n });\n }\n\n onReadOnlyChange() {\n this.querySelector('slot').toggleAttribute('inert', this.isReadonly);\n }\n\n // eslint-disable-next-line class-methods-use-this\n getValidity() {\n // eslint-disable-next-line no-console\n console.warn('getValidity', 'is not implemented');\n }\n\n onObservedAttributeChange(attrs) {\n attrs.forEach((attr) => {\n switch (attr) {\n case 'size':\n this.onSizeChange();\n break;\n case 'readonly':\n this.onReadOnlyChange();\n break;\n default:\n break;\n }\n });\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) {\n this.items[0]?.focus();\n }\n });\n\n super.init?.();\n\n observeAttributes(this, this.onObservedAttributeChange.bind(this), {\n includeAttrs: ['size', 'readonly'],\n });\n }\n }\n\n return BaseButtonSelectionGroupInternalClass;\n};\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../../mixins';\nimport { componentName as descopeInternalComponentName } from '../descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass';\nimport { compose } from '../../../helpers';\nimport { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';\nimport {\n buttonSelectionGroupBaseMixin,\n buttonSelectionGroupMappings,\n buttonSelectionGroupStyles,\n} from '../baseButtonSelectionGroup';\n\nexport const componentName = getComponentName('button-multi-selection-group');\n\nconst buttonMultiSelectionGroupMixin = (superclass) =>\n class ButtonMultiSelectionGroupMixinClass extends superclass {\n init() {\n super.init?.();\n const template = document.createElement('template');\n\n template.innerHTML = `\n <${descopeInternalComponentName}\n \tname=\"button-selection-group\"\n \tslot=\"input\"\n tabindex=\"-1\"\n part=\"internal-component\"\n >\n <slot></slot>\n </${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, {\n includeAttrs: ['size', 'default-values', 'min-items-selection', 'max-items-selection'],\n });\n }\n };\n\nexport const ButtonMultiSelectionGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...buttonSelectionGroupMappings,\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n buttonSelectionGroupBaseMixin,\n buttonMultiSelectionGroupMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => buttonSelectionGroupStyles,\n excludeAttrsSync: ['tabindex'],\n componentName,\n })\n);\n\nexport default ButtonMultiSelectionGroupClass;\n","import { componentName, ButtonMultiSelectionGroupClass } from './ButtonMultiSelectionGroupClass';\nimport '../descope-button-multi-selection-group-internal';\nimport '../descope-button-selection-group-item';\n\ncustomElements.define(componentName, ButtonMultiSelectionGroupClass);\n\nexport { ButtonMultiSelectionGroupClass, componentName };\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 { observeAttributes, observeChildren } from '../../helpers/componentHelpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputFieldDefaultWidth,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const buttonSelectionGroupBaseMixin = (superclass) =>\n class ButtonSelectionGroupMixinClass extends superclass {\n // eslint-disable-next-line class-methods-use-this\n #renderItem = ({ value, label }) =>\n `<descope-button-selection-group-item value=\"${value}\">${label}</descope-button-selection-group-item>`;\n\n #data;\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n get size() {\n return this.inputElement?.size;\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"data\" - ', e.message);\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data must be an array, received:', data);\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.((acc, item) => acc + (this.renderItem?.(item || {}) || ''), '');\n }\n\n renderItems() {\n const template = this.getItemsTemplate();\n if (template) this.innerHTML = template;\n }\n\n init() {\n super.init?.();\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n // we want new items to get the size\n observeChildren(this, ({ addedNodes }) => {\n addedNodes.forEach((node) => {\n node.setAttribute('size', this.size);\n });\n });\n }\n };\n\nconst { host, label, requiredIndicator, internalWrapper, errorMessage } = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n internalWrapper: { selector: () => ':host [part=\"internal-component\"] slot' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const buttonSelectionGroupMappings = {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontFamily: host,\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 errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n itemsSpacing: { ...internalWrapper, property: 'gap' },\n};\n\nexport const buttonSelectionGroupStyles = `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\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 [part=\"internal-component\"] {\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 display: inline-block;\n\t\t\t\tmin-height: initial;\n\t\t\t}\n\n [part=\"internal-component\"] slot {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n flex-wrap: wrap;\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\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 `;\n","import {\n componentName,\n ButtonMultiSelectionGroupInternalClass,\n} from './ButtonMultiSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonMultiSelectionGroupInternalClass);\n\nexport { ButtonMultiSelectionGroupInternalClass };\n"],"names":["createBaseInputClass","args","componentName","ButtonMultiSelectionGroupInternalClass","this","items","filter","item","hasAttribute","onClick","e","target","currentTarget","includes","removeAttribute","setAttribute","dispatchChange","value","map","node","values","forEach","minItemsSelection","parseInt","getAttribute","maxItemsSelection","data","isValid","Array","isArray","console","error","defaultValues","defaultValuesAttr","JSON","parse","message","setDefaultValues","setTimeout","setCustomValidity","getValidity","isRequired","length","valueMissing","rangeUnderflow","rangeOverflow","init","super","querySelector","addEventListener","bind","createBaseButtonSelectionGroupInternalClass","BaseButtonSelectionGroupInternalClass","baseSelector","constructor","innerHTML","assignedElements","isReadonly","size","warn","onSizeChange","onReadOnlyChange","toggleAttribute","onObservedAttributeChange","attrs","attr","isTrusted","focus","includeAttrs","ButtonMultiSelectionGroupClass","mappings","proxyProps","superclass","template","document","createElement","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","useHostExternalPadding","cssVarList","inputOutlineWidth","inputOutlineOffset","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","ele","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","inputValueTextColor","inputHeight","inputBackgroundColor","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","buttonSelectionGroupBaseMixin","label","renderItem","renderFn","renderItems","dataAttr","isValidDataType","getItemsTemplate","reduce","acc","addedNodes","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles"],"sourceRoot":""}
1
+ {"version":3,"file":"button-selection-group-fields-descope-button-multi-selection-group-index-js.js","mappings":"kMASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,oECZhB,MAAMC,GAAgB,QAAiB,yCAEvC,MAAMC,WAA+C,OAC1DD,IAEA,KACE,OAAOE,KAAKC,MAAMC,QAAQC,GAASA,EAAKC,aAAa,aACvD,CAEA,OAAAC,CAAQC,GACFA,EAAEC,SAAWD,EAAEE,gBACbR,MAAK,IAAoBS,SAASH,EAAEC,QACtCD,EAAEC,OAAOG,gBAAgB,YAEzBJ,EAAEC,OA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,CAAEc,SAAU,iBACnBH,kBAAmB,CAAEG,SAAU,+CAC/BF,gBAAiB,CAAEE,SAAU,IAAM,0CACnCD,aAAc,CAAEC,SAAU,0BAGfC,EAA+B,CAC1CC,UAAW,IAAKN,EAAMO,SAAU,SAChCC,cAAe,IAAKR,EAAMO,SAAU,aACpCE,WAAYT,EACZU,eAAgB,CACd,IAAKpB,EAAOiB,SAAU,SACtB,IAAKN,EAAmBM,SAAU,UAEpCI,uBAAwB,IAAKV,EAAmBM,SAAU,WAC1DK,sBAAuB,IAAKT,EAAcI,SAAU,SACpDM,iBAAkB,IAAKV,EAAcI,SAAU,oBAC/CO,qBAAsB,IAAKX,EAAcI,SAAU,mBACnDQ,wBAAyB,IAAKZ,EAAcI,SAAU,wBACtDS,uBAAwB,IAAKb,EAAcI,SAAU,qBACrDU,yBAA0B,IAAKd,EAAcI,SAAU,uBACvDW,qBAAsB,IAAKf,EAAcI,SAAU,aACnDY,aAAc,IAAKjB,EAAiBK,SAAU,QAGnCa,EAA6B,6FAKrC,0pCAqDG,QAAwB,gCAC3B,QAAiB,4B,+FC5KtBxD,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/baseButtonSelectionGroup.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-multi-selection-group-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","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { createBaseButtonSelectionGroupInternalClass } from '../createBaseButtonSelectionGroupInternalClass';\n\nexport const componentName = getComponentName('button-multi-selection-group-internal');\n\nexport class ButtonMultiSelectionGroupInternalClass extends createBaseButtonSelectionGroupInternalClass(\n componentName\n) {\n #getSelectedNodes() {\n return this.items.filter((item) => item.hasAttribute('selected'));\n }\n\n onClick(e) {\n if (e.target !== e.currentTarget) {\n if (this.#getSelectedNodes().includes(e.target)) {\n e.target.removeAttribute('selected');\n } else {\n e.target.setAttribute('selected', 'true');\n }\n this.dispatchChange();\n }\n }\n\n get value() {\n return this.#getSelectedNodes().map((node) => node.value);\n }\n\n set value(values) {\n this.items.forEach((item) => {\n if (values.includes(item.value)) {\n item.setAttribute('selected', 'true');\n } else {\n item.removeAttribute('selected');\n }\n });\n }\n\n get minItemsSelection() {\n return parseInt(this.getAttribute('min-items-selection'), 10) || 0;\n }\n\n get maxItemsSelection() {\n return parseInt(this.getAttribute('max-items-selection'), 10) || 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n #isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('default-values must be an array, received:', data);\n }\n\n return isValid;\n }\n\n get defaultValues() {\n const defaultValuesAttr = this.getAttribute('default-values');\n if (defaultValuesAttr) {\n try {\n const defaultValues = JSON.parse(defaultValuesAttr);\n if (this.#isValidDataType(defaultValues)) {\n return defaultValues;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"default-values\" -', e.message);\n }\n }\n return [];\n }\n\n setDefaultValues() {\n // we want to defer this action until all attributes are synced\n setTimeout(() => {\n if (this.defaultValues) {\n this.value = this.defaultValues;\n this.setCustomValidity();\n }\n });\n }\n\n getValidity() {\n if (this.isRequired && !this.value.length) {\n return { valueMissing: true };\n }\n // If the field is not required, no minimum selection can be set\n if (this.isRequired && this.minItemsSelection && this.value.length < this.minItemsSelection) {\n return {\n rangeUnderflow: true,\n };\n }\n if (this.maxItemsSelection && this.value.length > this.maxItemsSelection) {\n return {\n rangeOverflow: true,\n };\n }\n return {};\n }\n\n init() {\n super.init();\n\n this.setDefaultValues();\n\n this.querySelector('slot').addEventListener('click', this.onClick.bind(this));\n }\n}\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseInputClass } from '../../baseClasses/createBaseInputClass';\nimport { observeAttributes } from '../../helpers/componentHelpers';\nimport { createDispatchEvent } from '../../helpers/mixinsHelpers';\n\nexport const createBaseButtonSelectionGroupInternalClass = (componentName) => {\n class BaseButtonSelectionGroupInternalClass extends createBaseInputClass({\n componentName,\n baseSelector: 'slot',\n }) {\n constructor() {\n super();\n\n this.innerHTML = `\n <slot part=\"wrapper\"></slot>\n `;\n }\n\n dispatchChange = createDispatchEvent.bind(this, 'change');\n\n get items() {\n return this.querySelector('slot').assignedElements();\n }\n\n get isReadonly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n get size() {\n return this.getAttribute('size') || 'md';\n }\n\n // eslint-disable-next-line getter-return, class-methods-use-this\n get value() {\n // eslint-disable-next-line no-console\n console.warn('get value', 'is not implemented');\n }\n\n // eslint-disable-next-line class-methods-use-this\n set value(value) {\n // eslint-disable-next-line no-console\n console.warn('set value', 'is not implemented');\n }\n\n onSizeChange() {\n this.items.forEach((item) => {\n item.setAttribute('size', this.size);\n });\n }\n\n onReadOnlyChange() {\n this.querySelector('slot').toggleAttribute('inert', this.isReadonly);\n }\n\n // eslint-disable-next-line class-methods-use-this\n getValidity() {\n // eslint-disable-next-line no-console\n console.warn('getValidity', 'is not implemented');\n }\n\n onObservedAttributeChange(attrs) {\n attrs.forEach((attr) => {\n switch (attr) {\n case 'size':\n this.onSizeChange();\n break;\n case 'readonly':\n this.onReadOnlyChange();\n break;\n default:\n break;\n }\n });\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) {\n this.items[0]?.focus();\n }\n });\n\n super.init?.();\n\n observeAttributes(this, this.onObservedAttributeChange.bind(this), {\n includeAttrs: ['size', 'readonly'],\n });\n }\n }\n\n return BaseButtonSelectionGroupInternalClass;\n};\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../../mixins';\nimport { componentName as descopeInternalComponentName } from '../descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass';\nimport { compose } from '../../../helpers';\nimport { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';\nimport {\n buttonSelectionGroupBaseMixin,\n buttonSelectionGroupMappings,\n buttonSelectionGroupStyles,\n} from '../baseButtonSelectionGroup';\n\nexport const componentName = getComponentName('button-multi-selection-group');\n\nconst buttonMultiSelectionGroupMixin = (superclass) =>\n class ButtonMultiSelectionGroupMixinClass extends superclass {\n init() {\n super.init?.();\n const template = document.createElement('template');\n\n template.innerHTML = `\n <${descopeInternalComponentName}\n \tname=\"button-selection-group\"\n \tslot=\"input\"\n tabindex=\"-1\"\n part=\"internal-component\"\n >\n <slot></slot>\n </${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, {\n includeAttrs: ['size', 'default-values', 'min-items-selection', 'max-items-selection'],\n });\n }\n };\n\nexport const ButtonMultiSelectionGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...buttonSelectionGroupMappings,\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n buttonSelectionGroupBaseMixin,\n buttonMultiSelectionGroupMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => buttonSelectionGroupStyles,\n excludeAttrsSync: ['tabindex'],\n componentName,\n })\n);\n\nexport default ButtonMultiSelectionGroupClass;\n","import { componentName, ButtonMultiSelectionGroupClass } from './ButtonMultiSelectionGroupClass';\nimport '../descope-button-multi-selection-group-internal';\nimport '../descope-button-selection-group-item';\n\ncustomElements.define(componentName, ButtonMultiSelectionGroupClass);\n\nexport { ButtonMultiSelectionGroupClass, componentName };\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]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n `;\n};\n","import { observeAttributes, observeChildren } from '../../helpers/componentHelpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputFieldDefaultWidth,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const buttonSelectionGroupBaseMixin = (superclass) =>\n class ButtonSelectionGroupMixinClass extends superclass {\n // eslint-disable-next-line class-methods-use-this\n #renderItem = ({ value, label }) =>\n `<descope-button-selection-group-item value=\"${value}\">${label}</descope-button-selection-group-item>`;\n\n #data;\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n get size() {\n return this.inputElement?.size;\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"data\" - ', e.message);\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data must be an array, received:', data);\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.((acc, item) => acc + (this.renderItem?.(item || {}) || ''), '');\n }\n\n renderItems() {\n const template = this.getItemsTemplate();\n if (template) this.innerHTML = template;\n }\n\n init() {\n super.init?.();\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n // we want new items to get the size\n observeChildren(this, ({ addedNodes }) => {\n addedNodes.forEach((node) => {\n node.setAttribute('size', this.size);\n });\n });\n }\n };\n\nconst { host, label, requiredIndicator, internalWrapper, errorMessage } = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n internalWrapper: { selector: () => ':host [part=\"internal-component\"] slot' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const buttonSelectionGroupMappings = {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontFamily: host,\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 errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n itemsSpacing: { ...internalWrapper, property: 'gap' },\n};\n\nexport const buttonSelectionGroupStyles = `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\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 [part=\"internal-component\"] {\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 display: inline-block;\n\t\t\t\tmin-height: initial;\n\t\t\t}\n\n [part=\"internal-component\"] slot {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n flex-wrap: wrap;\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\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 `;\n","import {\n componentName,\n ButtonMultiSelectionGroupInternalClass,\n} from './ButtonMultiSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonMultiSelectionGroupInternalClass);\n\nexport { ButtonMultiSelectionGroupInternalClass };\n"],"names":["createBaseInputClass","args","componentName","ButtonMultiSelectionGroupInternalClass","this","items","filter","item","hasAttribute","onClick","e","target","currentTarget","includes","removeAttribute","setAttribute","dispatchChange","value","map","node","values","forEach","minItemsSelection","parseInt","getAttribute","maxItemsSelection","data","isValid","Array","isArray","console","error","defaultValues","defaultValuesAttr","JSON","parse","message","setDefaultValues","setTimeout","setCustomValidity","getValidity","isRequired","length","valueMissing","rangeUnderflow","rangeOverflow","init","super","querySelector","addEventListener","bind","createBaseButtonSelectionGroupInternalClass","BaseButtonSelectionGroupInternalClass","baseSelector","constructor","innerHTML","assignedElements","isReadonly","size","warn","onSizeChange","onReadOnlyChange","toggleAttribute","onObservedAttributeChange","attrs","attr","isTrusted","focus","includeAttrs","ButtonMultiSelectionGroupClass","mappings","proxyProps","superclass","template","document","createElement","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","useHostExternalPadding","cssVarList","inputOutlineWidth","inputOutlineOffset","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","ele","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","inputValueTextColor","inputHeight","inputBackgroundColor","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","buttonSelectionGroupBaseMixin","label","renderItem","renderFn","renderItems","dataAttr","isValidDataType","getItemsTemplate","reduce","acc","addedNodes","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles"],"sourceRoot":""}