@descope/web-components-ui 2.1.14 → 2.1.16

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 (111) hide show
  1. package/dist/cjs/index.cjs.js +26 -24
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +26 -24
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/7092.js +1 -1
  6. package/dist/umd/7092.js.map +1 -1
  7. package/dist/umd/9365.js +1 -1
  8. package/dist/umd/9365.js.map +1 -1
  9. package/dist/umd/DescopeDev.js +1 -1
  10. package/dist/umd/DescopeDev.js.map +1 -1
  11. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  12. package/dist/umd/boolean-fields-descope-checkbox-index-js.js.map +1 -1
  13. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  14. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
  15. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  16. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
  17. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  18. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
  19. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +2 -2
  20. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  21. package/dist/umd/descope-address-field.js +1 -1
  22. package/dist/umd/descope-address-field.js.map +1 -1
  23. package/dist/umd/descope-apps-list.js +1 -1
  24. package/dist/umd/descope-apps-list.js.map +1 -1
  25. package/dist/umd/descope-autocomplete-field.js +1 -1
  26. package/dist/umd/descope-autocomplete-field.js.map +1 -1
  27. package/dist/umd/descope-button.js +2 -2
  28. package/dist/umd/descope-button.js.map +1 -1
  29. package/dist/umd/descope-collapsible-container.js +1 -1
  30. package/dist/umd/descope-collapsible-container.js.map +1 -1
  31. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  32. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  33. package/dist/umd/descope-email-field-index-js.js +1 -1
  34. package/dist/umd/descope-email-field-index-js.js.map +1 -1
  35. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  36. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.map +1 -1
  37. package/dist/umd/descope-grid-index-js.js +1 -1
  38. package/dist/umd/descope-grid-index-js.js.map +1 -1
  39. package/dist/umd/descope-hybrid-field-index-js.js +2 -2
  40. package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
  41. package/dist/umd/descope-icon.js +1 -1
  42. package/dist/umd/descope-icon.js.map +1 -1
  43. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
  44. package/dist/umd/descope-multi-select-combo-box-index-js.js.map +1 -1
  45. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  46. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
  47. package/dist/umd/descope-new-password-index-js.js +1 -1
  48. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  49. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -1
  50. package/dist/umd/descope-notification-descope-notification-card-index-js.js.map +1 -1
  51. package/dist/umd/descope-notification-index-js.js +1 -1
  52. package/dist/umd/descope-notification-index-js.js.map +1 -1
  53. package/dist/umd/descope-number-field-index-js.js +1 -1
  54. package/dist/umd/descope-number-field-index-js.js.map +1 -1
  55. package/dist/umd/descope-outbound-app-button.js +2 -2
  56. package/dist/umd/descope-outbound-app-button.js.map +1 -1
  57. package/dist/umd/descope-outbound-apps.js +2 -2
  58. package/dist/umd/descope-outbound-apps.js.map +1 -1
  59. package/dist/umd/descope-passcode-index-js.js +1 -1
  60. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  61. package/dist/umd/descope-password-index-js.js +1 -1
  62. package/dist/umd/descope-password-index-js.js.map +1 -1
  63. package/dist/umd/descope-radio-group-index-js.js +1 -1
  64. package/dist/umd/descope-radio-group-index-js.js.map +1 -1
  65. package/dist/umd/descope-scopes-list-index-js.js +1 -1
  66. package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
  67. package/dist/umd/descope-text-area-index-js.js +1 -1
  68. package/dist/umd/descope-text-area-index-js.js.map +1 -1
  69. package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
  70. package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
  71. package/dist/umd/descope-timer-button.js +2 -2
  72. package/dist/umd/descope-timer-button.js.map +1 -1
  73. package/dist/umd/descope-timer.js +1 -1
  74. package/dist/umd/descope-timer.js.map +1 -1
  75. package/dist/umd/descope-trusted-devices.js +1 -1
  76. package/dist/umd/descope-trusted-devices.js.map +1 -1
  77. package/dist/umd/descope-upload-file-index-js.js +2 -2
  78. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  79. package/dist/umd/descope-user-attribute-index-js.js +2 -2
  80. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  81. package/dist/umd/descope-user-auth-method-index-js.js +2 -2
  82. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  83. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  84. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  85. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  86. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  87. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  88. package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
  89. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  90. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
  91. package/package.json +28 -28
  92. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +1 -1
  93. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +1 -1
  94. package/src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js +1 -1
  95. package/src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js +1 -1
  96. package/src/components/descope-email-field/EmailFieldClass.js +1 -1
  97. package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +1 -1
  98. package/src/components/descope-new-password/NewPasswordClass.js +1 -1
  99. package/src/components/descope-notification/NotificationClass.js +1 -1
  100. package/src/components/descope-notification/descope-notification-card/NotificationCardClass.js +1 -1
  101. package/src/components/descope-number-field/NumberFieldClass.js +1 -1
  102. package/src/components/descope-passcode/PasscodeClass.js +1 -1
  103. package/src/components/descope-password/PasswordClass.js +1 -1
  104. package/src/components/descope-radio-group/RadioButtonClass.js +1 -1
  105. package/src/components/descope-radio-group/RadioGroupClass.js +1 -1
  106. package/src/components/descope-text-area/TextAreaClass.js +1 -1
  107. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -0
  108. package/src/components/mapping-fields/descope-saml-group-mappings/SamlGroupMappingsClass.js +1 -0
  109. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
  110. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +1 -1
  111. package/src/mixins/createStyleMixin/index.js +1 -1
@@ -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),r=n(79365),o=n(81365);const a=(...e)=>(0,i.Zz)(r.XX,r._$,r.yF,r.jd)((0,o.q)(...e))},18330:(e,t,n)=>{n.d(t,{f:()=>r});var i=n(44099);class r 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:()=>o});var i=n(97810),r=n(41813);const o=e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${r.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${r.T}>\n\t\t\t`,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.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:()=>s,T:()=>o});var i=n(3393),r=n(97810);const o=(0,r.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],l=(0,i.y)({componentName:o,baseSelector:"div"}),s=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,r.EA)(this,this.checkbox,{includeAttrs:a}),(0,r.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:()=>c,q:()=>k});var i=n(97810),r=n(9696),o=n(79365),a=n(19847),l=n(47507),s=n(73551);const c=(0,i.xE)("checkbox"),{host:d,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:x,helperText:y,errorMessage:f}={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)"}},k=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[d,h,b],fontFamily:[b,y,f],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...x,property:"content"},errorMessageTextColor:{...f,property:"color"},errorMessageIcon:{...f,property:"background-image"},errorMessageIconSize:{...f,property:"background-size"},errorMessageIconPadding:{...f,property:"padding-inline-start"},errorMessageIconRepeat:{...f,property:"background-repeat"},errorMessageIconPosition:{...f,property:"background-position"},errorMessageFontSize:{...f,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"},{...p,property:"font-size"}]}}),o.VO,(0,o.OZ)({proxyProps:["value","selectionStart"]}),o.tQ,a.A)((0,o.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${l.A}\n ${(0,s.cy)(k.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:c}))}}]);
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),r=n(79365),o=n(81365);const a=(...e)=>(0,i.Zz)(r.XX,r._$,r.yF,r.jd)((0,o.q)(...e))},18330:(e,t,n)=>{n.d(t,{f:()=>r});var i=n(44099);class r 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:()=>o});var i=n(97810),r=n(41813);const o=e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${r.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${r.T}>\n\t\t\t`,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.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:()=>s,T:()=>o});var i=n(3393),r=n(97810);const o=(0,r.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],l=(0,i.y)({componentName:o,baseSelector:"div"}),s=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,r.EA)(this,this.checkbox,{includeAttrs:a}),(0,r.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:()=>c,q:()=>k});var i=n(97810),r=n(9696),o=n(79365),a=n(19847),l=n(47507),s=n(73551);const c=(0,i.xE)("checkbox"),{host:d,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:x,helperText:y,errorMessage:f}={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)"}},k=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[d,h,b],fontFamily:[b,y,f],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...x,property:"content"},errorMessageTextColor:{...f,property:"color"},errorMessageIcon:{...f,property:"background-image"},errorMessageIconSize:{...f,property:"background-size"},errorMessageIconPadding:{...f,property:"padding-inline-start"},errorMessageIconRepeat:{...f,property:"background-repeat"},errorMessageIconPosition:{...f,property:"background-position"},errorMessageFontSize:{...f,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"},{...p,property:"font-size"}]}}),o.VO,(0,o.OZ)({proxyProps:["value","selectionStart"]}),o.tQ,a.A)((0,o.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${l.A}\n ${(0,s.cy)(k.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","style"],componentName:c}))}}]);
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,I,sECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,kDCLhB,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,IAGbO,aAAa,GAEjB,E,6DC3BK,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,eAIJ,OAAalB,KAAKc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B,iBAAkB,IAAKhC,EAAiBU,SAAU,gBAElDuB,kBAAmB,IAAKjC,EAAiBU,SAAU,iBACnDwB,mBAAoB,IAAKlC,EAAiBU,SAAU,kBACpDyB,kBAAmB,IAAKnC,EAAiBU,SAAU,iBACnD0B,kBAAmB,IAAKpC,EAAiBU,SAAU,iBAEnD2B,UAAW,CACT,IAAKrC,EAAiBU,SAAU,SAChC,IAAKV,EAAiBU,SAAU,UAChC,IAAKT,EAAiBS,SAAU,aAChC,IAAKX,EAAWW,SAAU,iBAIhC,MACA,QAAgB,CAAE4B,WAAY,CAAC,QAAS,oBACxC,KACA,IAhD2B,EAkD3B,QAAY,CACVC,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,WACZ,eACG,QAAuBlC,EAAcmC,svBAwCzCC,iBAAkB,CAAC,QAAS,YAC5BjE,kB","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"],"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"],"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"],"sourceRoot":""}
1
+ {"version":3,"file":"boolean-fields-descope-checkbox-index-js.js","mappings":";mKAEAA,eAAeC,OAAO,IAAe,I,sECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,kDCLhB,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AAU,wBAC5CM,gBAAiB,IAAKd,EAAeQ,SAAU,eAC/CO,gBAAiB,IAAKf,EAAeQ,SAAU,eAC/CQ,uBAAwB,IAAKf,EAAmBO,SAAU,WAE1DS,sBAAuB,IAAKd,EAAcK,SAAU,SACpDU,iBAAkB,IAAKf,EAAcK,SAAU,oBAC/CW,qBAAsB,IAAKhB,EAAcK,SAAU,mBACnDY,wBAAyB,IAAKjB,EAAcK,SAAU,wBACtDa,uBAAwB,IAAKlB,EAAcK,SAAU,qBACrDc,yBAA0B,IAAKnB,EAAcK,SAAU,uBACvDe,qBAAsB,IAAKpB,EAAcK,SAAU,aAEnDgB,oBAAqB,IAAKzB,EAAiBS,SAAU,SACrDiB,qBAAsB,IAAK3B,EAAiBU,SAAU,oBAEtDkB,kBAAmB,IAAK5B,EAAiBU,SAAU,iBACnDmB,iBAAkB,IAAK7B,EAAiBU,SAAU,gBAClDoB,kBAAmB,IAAK9B,EAAiBU,SAAU,iBACnDqB,iBAAkB,IAAK/B,EAAiBU,SAAU,gBAClDsB,iBAAkB,IAAKhC,EAAiBU,SAAU,gBAElDuB,kBAAmB,IAAKjC,EAAiBU,SAAU,iBACnDwB,mBAAoB,IAAKlC,EAAiBU,SAAU,kBACpDyB,kBAAmB,IAAKnC,EAAiBU,SAAU,iBACnD0B,kBAAmB,IAAKpC,EAAiBU,SAAU,iBAEnD2B,UAAW,CACT,IAAKrC,EAAiBU,SAAU,SAChC,IAAKV,EAAiBU,SAAU,UAChC,IAAKT,EAAiBS,SAAU,aAChC,IAAKX,EAAWW,SAAU,iBAIhC,MACA,QAAgB,CAAE4B,WAAY,CAAC,QAAS,oBACxC,KACA,IAhD2B,EAkD3B,QAAY,CACVC,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,WACZ,eACG,QAAuBlC,EAAcmC,svBAwCzCC,iBAAkB,CAAC,QAAS,WAAY,SACxCjE,kB","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"],"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', 'style'],\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","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"],"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:(e,t,n)=>{n.r(t);var r=n(41813);customElements.define(r.T,r.A)},3393:(e,t,n)=>{n.d(t,{y:()=>a});var r=n(9696),o=n(79365),i=n(81365);const a=(...e)=>(0,r.Zz)(o.XX,o._$,o.yF,o.jd)((0,i.q)(...e))},18330:(e,t,n)=>{n.d(t,{f:()=>o});var r=n(44099);class o extends r.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:()=>i});var r=n(97810),o=n(41813);const i=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,r.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,r.q)(this.inputElement,this,["checked"]),(0,r.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},21934:(e,t,n)=>{n.r(t),n.d(t,{SwitchToggleClass:()=>r.H,componentName:()=>r.T});var r=n(83150);n(67468),n(11284),n(3274),customElements.define(r.T,r.H)},41813:(e,t,n)=>{n.d(t,{A:()=>s,T:()=>i});var r=n(3393),o=n(97810);const i=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],c=(0,r.y)({componentName:i,baseSelector:"div"}),s=class extends c{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:()=>r});const r=`\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`},83150:(e,t,n)=>{n.d(t,{H:()=>f,T:()=>l});var r=n(97810),o=n(9696),i=n(79365),a=n(19847),c=n(47507),s=n(73551);const l=(0,r.xE)("switch-toggle"),{host:d,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:k,helperText:x,errorMessage:y}={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)"}},f=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[p,b,b],fontFamily:[b,x,y],labelTextColor:[{...b,property:"color"},{...b,property:"-webkit-text-fill-color"}],labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...k,property:"content"},errorMessageTextColor:{...y,property:"color"},errorMessageIcon:{...y,property:"background-image"},errorMessageIconSize:{...y,property:"background-size"},errorMessageIconPadding:{...y,property:"padding-inline-start"},errorMessageIconRepeat:{...y,property:"background-repeat"},errorMessageIconPosition:{...y,property:"background-position"},errorMessageFontSize:{...y,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"}}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,a.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${c.A}\n\t\t\t${(0,s.cy)(f.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:l}))}}]);
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1448,7362],{3274:(e,t,n)=>{n.r(t);var r=n(41813);customElements.define(r.T,r.A)},3393:(e,t,n)=>{n.d(t,{y:()=>a});var r=n(9696),o=n(79365),i=n(81365);const a=(...e)=>(0,r.Zz)(o.XX,o._$,o.yF,o.jd)((0,i.q)(...e))},18330:(e,t,n)=>{n.d(t,{f:()=>o});var r=n(44099);class o extends r.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:()=>i});var r=n(97810),o=n(41813);const i=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,r.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,r.q)(this.inputElement,this,["checked"]),(0,r.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},21934:(e,t,n)=>{n.r(t),n.d(t,{SwitchToggleClass:()=>r.H,componentName:()=>r.T});var r=n(83150);n(67468),n(11284),n(3274),customElements.define(r.T,r.H)},41813:(e,t,n)=>{n.d(t,{A:()=>s,T:()=>i});var r=n(3393),o=n(97810);const i=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],c=(0,r.y)({componentName:i,baseSelector:"div"}),s=class extends c{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:()=>r});const r=`\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`},83150:(e,t,n)=>{n.d(t,{H:()=>f,T:()=>l});var r=n(97810),o=n(9696),i=n(79365),a=n(19847),c=n(47507),s=n(73551);const l=(0,r.xE)("switch-toggle"),{host:d,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:k,helperText:x,errorMessage:y}={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)"}},f=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[p,b,b],fontFamily:[b,x,y],labelTextColor:[{...b,property:"color"},{...b,property:"-webkit-text-fill-color"}],labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...k,property:"content"},errorMessageTextColor:{...y,property:"color"},errorMessageIcon:{...y,property:"background-image"},errorMessageIconSize:{...y,property:"background-size"},errorMessageIconPadding:{...y,property:"padding-inline-start"},errorMessageIconRepeat:{...y,property:"background-repeat"},errorMessageIconPosition:{...y,property:"background-position"},errorMessageFontSize:{...y,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"}}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,a.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${c.A}\n\t\t\t${(0,s.cy)(f.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","style"],componentName:l}))}}]);
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,I,sECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,kDCLhB,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,IAGbO,aAAa,GAEjB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SAAU,mBACnDY,wBAAyB,IAAKjB,EAAcK,SAAU,wBACtDa,uBAAwB,IAAKlB,EAAcK,SAAU,qBACrDc,yBAA0B,IAAKnB,EAAcK,SAAU,uBACvDe,qBAAsB,IAAKpB,EAAcK,SAAU,aAEnDgB,iBAAkB,IAAK3B,EAAOW,SAAU,gBACxCiB,iBAAkB,IAAK5B,EAAOW,SAAU,gBACxCkB,iBAAkB,IAAK7B,EAAOW,SAAU,gBACxCmB,qBAAsB,IAAK9B,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,QAErC8B,kBAAmB,IAAKzC,EAAOW,SAAU,iBACzC+B,mBAAoB,IAAK1C,EAAOW,SAAU,kBAC1CgC,kBAAmB,IAAK3C,EAAOW,SAAU,iBACzCiC,kBAAmB,IAAK5C,EAAOW,SAAU,oBAG7C,MACA,QAAgB,CAAEkC,WAAY,CAAC,QAAS,oBACxC,KACA,IA1D+B,EA4D/B,QAAY,CACVC,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,WACZ,eACA,QAAuBxC,EAAkByC,+/BAsD1CC,iBAAkB,CAAC,QAAS,YAC5BzE,kB","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/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","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: [\n { ...checkboxLabel, property: 'color' },\n { ...checkboxLabel, property: '-webkit-text-fill-color' },\n ],\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","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","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","proxyProps","slots","wrappedEleName","style","cssVarList","excludeAttrsSync"],"sourceRoot":""}
1
+ {"version":3,"file":"boolean-fields-descope-switch-toggle-index-js.js","mappings":";mKAEAA,eAAeC,OAAO,IAAe,I,sECO9B,MAAMC,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,kDCLhB,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,K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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/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","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: [\n { ...checkboxLabel, property: 'color' },\n { ...checkboxLabel, property: '-webkit-text-fill-color' },\n ],\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', 'style'],\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","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","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","proxyProps","slots","wrappedEleName","style","cssVarList","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:()=>a});var r=n(9696),i=n(79365),s=n(81365);const a=(...t)=>(0,r.Zz)(i.XX,i._$,i.yF,i.jd)((0,s.q)(...t))},5364:(t,e,n)=>{n.d(e,{T:()=>s,o:()=>a});var r=n(97810),i=n(51298);const s=(0,r.xE)("button-multi-selection-group-internal");class a extends((0,i.m)(s)){#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:()=>a}),n(25964);var r=n(3393),i=n(97810),s=n(13011);const a=t=>{class e extends((0,r.y)({componentName:t,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n <slot part="wrapper"></slot>\n '}dispatchChange=s.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,i.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 r=n(79365),i=n(5364),s=n(9696),a=n(97810),o=n(80001);const l=(0,a.xE)("button-multi-selection-group"),d=(0,s.Zz)((0,r.RF)({mappings:{...o.$W}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,o._Z,t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${i.T}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${i.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,a.EA)(this,this.inputElement,{includeAttrs:["size","default-values","min-items-selection","max-items-selection"]})}})((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>o.S$,excludeAttrsSync:["tabindex"],componentName:l}));n(91831),n(15450),customElements.define(l,d)},80001:(t,e,n)=>{n.d(e,{$W:()=>c,S$:()=>p,_Z:()=>s});var r=n(97810),i=n(73551);const s=t=>class extends t{#n=({value:t,label:e})=>`<descope-button-selection-group-item value="${t}">${e}</descope-button-selection-group-item>`;#r;get renderItem(){return this.#n}set renderItem(t){this.#n=t,this.renderItems()}get size(){return this.inputElement?.size}get data(){if(this.#r)return this.#r;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.#r=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,r.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,r.Ge)(this,({addedNodes:t})=>{t.forEach(t=>{t.setAttribute("size",this.size)})})}},{host:a,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)"}},c={hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontFamily:a,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"}},p=`\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,i.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,i.$J)("vaadin-text-field")}\n\t\t\t${(0,i.I4)("vaadin-text-field")}\n `},91831:(t,e,n)=>{n.r(e),n.d(e,{ButtonMultiSelectionGroupInternalClass:()=>r.o});var r=n(5364);customElements.define(r.T,r.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:()=>a});var r=n(9696),i=n(79365),s=n(81365);const a=(...t)=>(0,r.Zz)(i.XX,i._$,i.yF,i.jd)((0,s.q)(...t))},5364:(t,e,n)=>{n.d(e,{T:()=>s,o:()=>a});var r=n(97810),i=n(51298);const s=(0,r.xE)("button-multi-selection-group-internal");class a extends((0,i.m)(s)){#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:()=>a}),n(25964);var r=n(3393),i=n(97810),s=n(13011);const a=t=>{class e extends((0,r.y)({componentName:t,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n <slot part="wrapper"></slot>\n '}dispatchChange=s.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,i.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 r=n(79365),i=n(5364),s=n(9696),a=n(97810),o=n(80001);const l=(0,a.xE)("button-multi-selection-group"),d=(0,s.Zz)((0,r.RF)({mappings:{...o.$W}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,o._Z,t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${i.T}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${i.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,a.EA)(this,this.inputElement,{includeAttrs:["size","default-values","min-items-selection","max-items-selection"]})}})((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>o.S$,excludeAttrsSync:["tabindex","style"],componentName:l}));n(91831),n(15450),customElements.define(l,d)},80001:(t,e,n)=>{n.d(e,{$W:()=>c,S$:()=>p,_Z:()=>s});var r=n(97810),i=n(73551);const s=t=>class extends t{#n=({value:t,label:e})=>`<descope-button-selection-group-item value="${t}">${e}</descope-button-selection-group-item>`;#r;get renderItem(){return this.#n}set renderItem(t){this.#n=t,this.renderItems()}get size(){return this.inputElement?.size}get data(){if(this.#r)return this.#r;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.#r=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,r.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,r.Ge)(this,({addedNodes:t})=>{t.forEach(t=>{t.setAttribute("size",this.size)})})}},{host:a,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)"}},c={hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontFamily:a,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"}},p=`\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,i.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,i.$J)("vaadin-text-field")}\n\t\t\t${(0,i.I4)("vaadin-text-field")}\n `},91831:(t,e,n)=>{n.r(e),n.d(e,{ButtonMultiSelectionGroupInternalClass:()=>r.o});var r=n(5364);customElements.define(r.T,r.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,OAAQC,GAASA,EAAKC,aAAa,YACvD,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,IAAKC,GAASA,EAAKF,MACrD,CAEA,SAAIA,CAAMG,GACRhB,KAAKC,MAAMgB,QAASd,IACda,EAAOP,SAASN,EAAKU,OACvBV,EAAKQ,aAAa,WAAY,QAE9BR,EAAKO,gBAAgB,aAG3B,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,gEAAiErB,EAAE0B,QACnF,CAEF,MAAO,EAC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,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,+FC5KtBjC,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/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","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","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,OAAQC,GAASA,EAAKC,aAAa,YACvD,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,IAAKC,GAASA,EAAKF,MACrD,CAEA,SAAIA,CAAMG,GACRhB,KAAKC,MAAMgB,QAASd,IACda,EAAOP,SAASN,EAAKU,OACvBV,EAAKQ,aAAa,WAAY,QAE9BR,EAAKO,gBAAgB,aAG3B,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,gEAAiErB,EAAE0B,QACnF,CAEF,MAAO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AU,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,+FC5KtBjC,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/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', 'style'],\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","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","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,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2141,7079],{3393:(t,e,n)=>{n.d(e,{y:()=>a});var r=n(9696),i=n(79365),s=n(81365);const a=(...t)=>(0,r.Zz)(i.XX,i._$,i.yF,i.jd)((0,s.q)(...t))},27926:(t,e,n)=>{n.r(e),n.d(e,{ButtonSelectionGroupClass:()=>d,componentName:()=>l});var r=n(79365),i=n(92491),s=n(9696),a=n(97810),o=n(80001);const l=(0,a.xE)("button-selection-group"),d=(0,s.Zz)((0,r.RF)({mappings:{...o.$W}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,o._Z,t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${i.T}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${i.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,a.EA)(this,this.inputElement,{includeAttrs:["size","default-value","allow-deselect"]})}})((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>o.S$,excludeAttrsSync:["tabindex"],componentName:l}));n(72415),n(15450),customElements.define(l,d)},51298:(t,e,n)=>{n.d(e,{m:()=>a}),n(25964);var r=n(3393),i=n(97810),s=n(13011);const a=t=>{class e extends((0,r.y)({componentName:t,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n <slot part="wrapper"></slot>\n '}dispatchChange=s.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,i.mx)(this,this.onObservedAttributeChange.bind(this),{includeAttrs:["size","readonly"]})}}return e}},72415:(t,e,n)=>{n.r(e),n.d(e,{ButtonSelectionGroupInternalClass:()=>r.n});var r=n(92491);customElements.define(r.T,r.n)},80001:(t,e,n)=>{n.d(e,{$W:()=>u,S$:()=>p,_Z:()=>s});var r=n(97810),i=n(73551);const s=t=>class extends t{#t=({value:t,label:e})=>`<descope-button-selection-group-item value="${t}">${e}</descope-button-selection-group-item>`;#e;get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get size(){return this.inputElement?.size}get data(){if(this.#e)return this.#e;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.#e=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,r.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,r.Ge)(this,({addedNodes:t})=>{t.forEach(t=>{t.setAttribute("size",this.size)})})}},{host:a,label:o,requiredIndicator:l,internalWrapper:d,errorMessage:c}={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)"}},u={hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontFamily:a,labelTextColor:[{...o,property:"color"},{...l,property:"color"}],labelRequiredIndicator:{...l,property:"content"},errorMessageTextColor:{...c,property:"color"},errorMessageIcon:{...c,property:"background-image"},errorMessageIconSize:{...c,property:"background-size"},errorMessageIconPadding:{...c,property:"padding-inline-start"},errorMessageIconRepeat:{...c,property:"background-repeat"},errorMessageIconPosition:{...c,property:"background-position"},errorMessageFontSize:{...c,property:"font-size"},itemsSpacing:{...d,property:"gap"}},p=`\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,i.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,i.$J)("vaadin-text-field")}\n\t\t\t${(0,i.I4)("vaadin-text-field")}\n `},92491:(t,e,n)=>{n.d(e,{T:()=>s,n:()=>a});var r=n(97810),i=n(51298);const s=(0,r.xE)("button-selection-group-internal");class a extends((0,i.m)(s)){getSelectedNode(){return this.items.find(t=>t.hasAttribute("selected"))}get allowDeselect(){return"true"===this.getAttribute("allow-deselect")}removeSelected(){this.getSelectedNode()?.removeAttribute("selected")}onClick(t){t.target!==t.currentTarget&&(t.target===this.getSelectedNode()&&this.allowDeselect?this.removeSelected():this.setSelected(t.target),this.dispatchChange())}setSelected(t){t!==this.getSelectedNode()&&(this.removeSelected(),t?.setAttribute("selected","true"))}get defaultValue(){return this.getAttribute("default-value")}setDefaultValue(){setTimeout(()=>{this.defaultValue&&(this.value=this.defaultValue,this.setCustomValidity())})}get value(){return this.getSelectedNode()?.value||""}set value(t){const e=this.items.find(e=>e.value===t);this.setSelected(e)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}init(){super.init(),this.setDefaultValue(),this.querySelector("slot").addEventListener("click",this.onClick.bind(this))}}}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2141,7079],{3393:(t,e,n)=>{n.d(e,{y:()=>a});var r=n(9696),i=n(79365),s=n(81365);const a=(...t)=>(0,r.Zz)(i.XX,i._$,i.yF,i.jd)((0,s.q)(...t))},27926:(t,e,n)=>{n.r(e),n.d(e,{ButtonSelectionGroupClass:()=>d,componentName:()=>l});var r=n(79365),i=n(92491),s=n(9696),a=n(97810),o=n(80001);const l=(0,a.xE)("button-selection-group"),d=(0,s.Zz)((0,r.RF)({mappings:{...o.$W}}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"]}),r.tQ,o._Z,t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${i.T}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${i.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,a.EA)(this,this.inputElement,{includeAttrs:["size","default-value","allow-deselect"]})}})((0,r.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>o.S$,excludeAttrsSync:["tabindex","style"],componentName:l}));n(72415),n(15450),customElements.define(l,d)},51298:(t,e,n)=>{n.d(e,{m:()=>a}),n(25964);var r=n(3393),i=n(97810),s=n(13011);const a=t=>{class e extends((0,r.y)({componentName:t,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n <slot part="wrapper"></slot>\n '}dispatchChange=s.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,i.mx)(this,this.onObservedAttributeChange.bind(this),{includeAttrs:["size","readonly"]})}}return e}},72415:(t,e,n)=>{n.r(e),n.d(e,{ButtonSelectionGroupInternalClass:()=>r.n});var r=n(92491);customElements.define(r.T,r.n)},80001:(t,e,n)=>{n.d(e,{$W:()=>u,S$:()=>p,_Z:()=>s});var r=n(97810),i=n(73551);const s=t=>class extends t{#t=({value:t,label:e})=>`<descope-button-selection-group-item value="${t}">${e}</descope-button-selection-group-item>`;#e;get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get size(){return this.inputElement?.size}get data(){if(this.#e)return this.#e;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.#e=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,r.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,r.Ge)(this,({addedNodes:t})=>{t.forEach(t=>{t.setAttribute("size",this.size)})})}},{host:a,label:o,requiredIndicator:l,internalWrapper:d,errorMessage:c}={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)"}},u={hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontFamily:a,labelTextColor:[{...o,property:"color"},{...l,property:"color"}],labelRequiredIndicator:{...l,property:"content"},errorMessageTextColor:{...c,property:"color"},errorMessageIcon:{...c,property:"background-image"},errorMessageIconSize:{...c,property:"background-size"},errorMessageIconPadding:{...c,property:"padding-inline-start"},errorMessageIconRepeat:{...c,property:"background-repeat"},errorMessageIconPosition:{...c,property:"background-position"},errorMessageFontSize:{...c,property:"font-size"},itemsSpacing:{...d,property:"gap"}},p=`\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,i.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,i.$J)("vaadin-text-field")}\n\t\t\t${(0,i.I4)("vaadin-text-field")}\n `},92491:(t,e,n)=>{n.d(e,{T:()=>s,n:()=>a});var r=n(97810),i=n(51298);const s=(0,r.xE)("button-selection-group-internal");class a extends((0,i.m)(s)){getSelectedNode(){return this.items.find(t=>t.hasAttribute("selected"))}get allowDeselect(){return"true"===this.getAttribute("allow-deselect")}removeSelected(){this.getSelectedNode()?.removeAttribute("selected")}onClick(t){t.target!==t.currentTarget&&(t.target===this.getSelectedNode()&&this.allowDeselect?this.removeSelected():this.setSelected(t.target),this.dispatchChange())}setSelected(t){t!==this.getSelectedNode()&&(this.removeSelected(),t?.setAttribute("selected","true"))}get defaultValue(){return this.getAttribute("default-value")}setDefaultValue(){setTimeout(()=>{this.defaultValue&&(this.value=this.defaultValue,this.setCustomValidity())})}get value(){return this.getSelectedNode()?.value||""}set value(t){const e=this.items.find(e=>e.value===t);this.setSelected(e)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}init(){super.init(),this.setDefaultValue(),this.querySelector("slot").addEventListener("click",this.onClick.bind(this))}}}}]);
2
2
  //# sourceMappingURL=button-selection-group-fields-descope-button-selection-group-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-selection-group-fields-descope-button-selection-group-index-js.js","mappings":"kMASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,gJCChB,MAAMC,GAAgB,QAAiB,0BA6BjCC,GAA4B,SACvC,QAAiB,CACfC,SAAU,IACL,QAGP,MACA,QAAgB,CAAEC,WAAY,CAAC,QAAS,oBACxC,KACA,KApCiCC,GACjC,cAAkDA,EAChD,IAAAC,GACEC,MAAMD,SACN,MAAME,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,YAClB,uKAOC,eAGJC,KAAKC,YAAYC,YAAYN,EAASO,QAAQC,WAAU,IAExDJ,KAAKK,aAAeL,KAAKM,WAAWC,cAAc,MAElD,QAAaP,KAAMA,KAAKK,aAAc,CACpCG,aAAc,CAAC,OAAQ,gBAAiB,mBAE5C,GAGqC,EAYvC,QAAY,CACVC,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,KACbC,iBAAkB,CAAC,YACnBvB,mB,kBC1DJwB,eAAeC,OAAOzB,EAAeC,E,gFCC9B,MAAMyB,EAA+C1B,IAC1D,MAAM2B,WAA8C,OAAqB,CACvE3B,gBACA4B,aAAc,UAEd,WAAAC,GACEvB,QAEAK,KAAKD,UAAY,4CAGnB,CAEAoB,eAAiB,IAAoBC,KAAKpB,KAAM,UAEhD,SAAIqB,GACF,OAAOrB,KAAKO,cAAc,QAAQe,kBACpC,CAEA,cAAIC,GACF,MAAyC,SAAlCvB,KAAKwB,aAAa,WAC3B,CAEA,QAAIC,GACF,OAAOzB,KAAKwB,aAAa,SAAW,IACtC,CAGA,SAAIE,GAEFC,QAAQC,KAAK,YAAa,qBAC5B,CAGA,SAAIF,CAAMA,GAERC,QAAQC,KAAK,YAAa,qBAC5B,CAE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EAAiBK,SAAU,QAGnCa,EAA6B,6FAKrC,0pCAqDG,QAAwB,gCAC3B,QAAiB,4B,qEC9Kf,MAAM9F,GAAgB,QAAiB,mCAEvC,MAAM+F,WAA0C,OACrD/F,IAEA,eAAAgG,GACE,OAAOrF,KAAKqB,MAAMiE,KAAMvD,GAASA,EAAKwD,aAAa,YACrD,CAEA,iBAAIC,GACF,MAA+C,SAAxCxF,KAAKwB,aAAa,iBAC3B,CAEA,cAAAiE,GACEzF,KAAKqF,mBAAmBK,gBAAgB,WAC1C,CAEA,OAAAC,CAAQnD,GACFA,EAAEoD,SAAWpD,EAAEqD,gBACbrD,EAAEoD,SAAW5F,KAAKqF,mBAAqBrF,KAAKwF,cAC9CxF,KAAKyF,iBAELzF,KAAK8F,YAAYtD,EAAEoD,QAErB5F,KAAKmB,iBAET,CAEA,WAAA2E,CAAYhC,GACNA,IAAS9D,KAAKqF,oBAChBrF,KAAKyF,iBACL3B,GAAM9B,aAAa,WAAY,QAEnC,CAEA,gBAAI+D,GACF,OAAO/F,KAAKwB,aAAa,gBAC3B,CAEA,eAAAwE,GAEEC,WAAW,KACLjG,KAAK+F,eACP/F,KAAK0B,MAAQ1B,KAAK+F,aAClB/F,KAAKkG,sBAGX,CAEA,SAAIxE,GACF,OAAO1B,KAAKqF,mBAAmB3D,OAAS,EAC1C,CAEA,SAAIA,CAAMA,GACR,MAAMoC,EAAO9D,KAAKqB,MAAMiE,KAAMa,GAAUA,EAAMzE,QAAUA,GACxD1B,KAAK8F,YAAYhC,EACnB,CAEA,WAAA3B,GACE,OAAInC,KAAKoG,aAAepG,KAAK0B,MACpB,CAAE2E,cAAc,GAGlB,CAAC,CACV,CAEA,IAAA3G,GACEC,MAAMD,OAENM,KAAKgG,kBAELhG,KAAKO,cAAc,QAAQgC,iBAAiB,QAASvC,KAAK2F,QAAQvE,KAAKpB,MACzE,E","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group/index.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-selection-group-internal/index.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-selection-group-internal/ButtonSelectionGroupInternalClass.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 {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../../mixins';\nimport { componentName as descopeInternalComponentName } from '../descope-button-selection-group-internal/ButtonSelectionGroupInternalClass';\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-selection-group');\n\nconst buttonSelectionGroupMixin = (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-value', 'allow-deselect'],\n });\n }\n };\n\nexport const ButtonSelectionGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...buttonSelectionGroupMappings,\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n buttonSelectionGroupBaseMixin,\n buttonSelectionGroupMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => buttonSelectionGroupStyles,\n excludeAttrsSync: ['tabindex'],\n componentName,\n })\n);\n\nexport default ButtonSelectionGroupClass;\n","import { componentName, ButtonSelectionGroupClass } from './ButtonSelectionGroupClass';\nimport '../descope-button-selection-group-internal';\nimport '../descope-button-selection-group-item';\n\ncustomElements.define(componentName, ButtonSelectionGroupClass);\n\nexport { ButtonSelectionGroupClass, componentName };\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 componentName,\n ButtonSelectionGroupInternalClass,\n} from './ButtonSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonSelectionGroupInternalClass);\n\nexport { ButtonSelectionGroupInternalClass };\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 { getComponentName } from '../../../helpers/componentHelpers';\nimport { createBaseButtonSelectionGroupInternalClass } from '../createBaseButtonSelectionGroupInternalClass';\n\nexport const componentName = getComponentName('button-selection-group-internal');\n\nexport class ButtonSelectionGroupInternalClass extends createBaseButtonSelectionGroupInternalClass(\n componentName\n) {\n getSelectedNode() {\n return this.items.find((item) => item.hasAttribute('selected'));\n }\n\n get allowDeselect() {\n return this.getAttribute('allow-deselect') === 'true';\n }\n\n removeSelected() {\n this.getSelectedNode()?.removeAttribute('selected');\n }\n\n onClick(e) {\n if (e.target !== e.currentTarget) {\n if (e.target === this.getSelectedNode() && this.allowDeselect) {\n this.removeSelected();\n } else {\n this.setSelected(e.target);\n }\n this.dispatchChange();\n }\n }\n\n setSelected(node) {\n if (node !== this.getSelectedNode()) {\n this.removeSelected();\n node?.setAttribute('selected', 'true');\n }\n }\n\n get defaultValue() {\n return this.getAttribute('default-value');\n }\n\n setDefaultValue() {\n // we want to defer this action until all attributes are synched\n setTimeout(() => {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n this.setCustomValidity();\n }\n });\n }\n\n get value() {\n return this.getSelectedNode()?.value || '';\n }\n\n set value(value) {\n const node = this.items.find((child) => child.value === value);\n this.setSelected(node);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n\n return {};\n }\n\n init() {\n super.init();\n\n this.setDefaultValue();\n\n this.querySelector('slot').addEventListener('click', this.onClick.bind(this));\n }\n}\n"],"names":["createBaseInputClass","args","componentName","ButtonSelectionGroupClass","mappings","proxyProps","superclass","init","super","template","document","createElement","innerHTML","this","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","querySelector","includeAttrs","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","createBaseButtonSelectionGroupInternalClass","BaseButtonSelectionGroupInternalClass","baseSelector","constructor","dispatchChange","bind","items","assignedElements","isReadonly","getAttribute","size","value","console","warn","onSizeChange","forEach","item","setAttribute","onReadOnlyChange","toggleAttribute","getValidity","onObservedAttributeChange","attrs","attr","addEventListener","e","isTrusted","focus","buttonSelectionGroupBaseMixin","label","renderItem","renderFn","renderItems","data","dataAttr","JSON","parse","isValidDataType","error","message","isValid","Array","isArray","getItemsTemplate","reduce","acc","addedNodes","node","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles","ButtonSelectionGroupInternalClass","getSelectedNode","find","hasAttribute","allowDeselect","removeSelected","removeAttribute","onClick","target","currentTarget","setSelected","defaultValue","setDefaultValue","setTimeout","setCustomValidity","child","isRequired","valueMissing"],"sourceRoot":""}
1
+ {"version":3,"file":"button-selection-group-fields-descope-button-selection-group-index-js.js","mappings":"kMASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,gJCChB,MAAMC,GAAgB,QAAiB,0BA6BjCC,GAA4B,SACvC,QAAiB,CACfC,SAAU,IACL,QAGP,MACA,QAAgB,CAAEC,WAAY,CAAC,QAAS,oBACxC,KACA,KApCiCC,GACjC,cAAkDA,EAChD,IAAAC,GACEC,MAAMD,SACN,MAAME,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,YAClB,uKAOC,eAGJC,KAAKC,YAAYC,YAAYN,EAASO,QAAQC,WAAU,IAExDJ,KAAKK,aAAeL,KAAKM,WAAWC,cAAc,MAElD,QAAaP,KAAMA,KAAKK,aAAc,CACpCG,aAAc,CAAC,OAAQ,gBAAiB,mBAE5C,GAGqC,EAYvC,QAAY,CACVC,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,KACbC,iBAAkB,CAAC,WAAY,SAC/BvB,mB,kBC1DJwB,eAAeC,OAAOzB,EAAeC,E,gFCC9B,MAAMyB,EAA+C1B,IAC1D,MAAM2B,WAA8C,OAAqB,CACvE3B,gBACA4B,aAAc,UAEd,WAAAC,GACEvB,QAEAK,KAAKD,UAAY,4CAGnB,CAEAoB,eAAiB,IAAoBC,KAAKpB,KAAM,UAEhD,SAAIqB,GACF,OAAOrB,KAAKO,cAAc,QAAQe,kBACpC,CAEA,cAAIC,GACF,MAAyC,SAAlCvB,KAAKwB,aAAa,WAC3B,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KgG,kBAELhG,KAAKO,cAAc,QAAQgC,iBAAiB,QAASvC,KAAK2F,QAAQvE,KAAKpB,MACzE,E","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group/index.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-selection-group-internal/index.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-selection-group-internal/ButtonSelectionGroupInternalClass.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 {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../../mixins';\nimport { componentName as descopeInternalComponentName } from '../descope-button-selection-group-internal/ButtonSelectionGroupInternalClass';\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-selection-group');\n\nconst buttonSelectionGroupMixin = (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-value', 'allow-deselect'],\n });\n }\n };\n\nexport const ButtonSelectionGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...buttonSelectionGroupMappings,\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n buttonSelectionGroupBaseMixin,\n buttonSelectionGroupMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => buttonSelectionGroupStyles,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n\nexport default ButtonSelectionGroupClass;\n","import { componentName, ButtonSelectionGroupClass } from './ButtonSelectionGroupClass';\nimport '../descope-button-selection-group-internal';\nimport '../descope-button-selection-group-item';\n\ncustomElements.define(componentName, ButtonSelectionGroupClass);\n\nexport { ButtonSelectionGroupClass, componentName };\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 componentName,\n ButtonSelectionGroupInternalClass,\n} from './ButtonSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonSelectionGroupInternalClass);\n\nexport { ButtonSelectionGroupInternalClass };\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 { getComponentName } from '../../../helpers/componentHelpers';\nimport { createBaseButtonSelectionGroupInternalClass } from '../createBaseButtonSelectionGroupInternalClass';\n\nexport const componentName = getComponentName('button-selection-group-internal');\n\nexport class ButtonSelectionGroupInternalClass extends createBaseButtonSelectionGroupInternalClass(\n componentName\n) {\n getSelectedNode() {\n return this.items.find((item) => item.hasAttribute('selected'));\n }\n\n get allowDeselect() {\n return this.getAttribute('allow-deselect') === 'true';\n }\n\n removeSelected() {\n this.getSelectedNode()?.removeAttribute('selected');\n }\n\n onClick(e) {\n if (e.target !== e.currentTarget) {\n if (e.target === this.getSelectedNode() && this.allowDeselect) {\n this.removeSelected();\n } else {\n this.setSelected(e.target);\n }\n this.dispatchChange();\n }\n }\n\n setSelected(node) {\n if (node !== this.getSelectedNode()) {\n this.removeSelected();\n node?.setAttribute('selected', 'true');\n }\n }\n\n get defaultValue() {\n return this.getAttribute('default-value');\n }\n\n setDefaultValue() {\n // we want to defer this action until all attributes are synched\n setTimeout(() => {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n this.setCustomValidity();\n }\n });\n }\n\n get value() {\n return this.getSelectedNode()?.value || '';\n }\n\n set value(value) {\n const node = this.items.find((child) => child.value === value);\n this.setSelected(node);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n\n return {};\n }\n\n init() {\n super.init();\n\n this.setDefaultValue();\n\n this.querySelector('slot').addEventListener('click', this.onClick.bind(this));\n }\n}\n"],"names":["createBaseInputClass","args","componentName","ButtonSelectionGroupClass","mappings","proxyProps","superclass","init","super","template","document","createElement","innerHTML","this","baseElement","appendChild","content","cloneNode","inputElement","shadowRoot","querySelector","includeAttrs","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","createBaseButtonSelectionGroupInternalClass","BaseButtonSelectionGroupInternalClass","baseSelector","constructor","dispatchChange","bind","items","assignedElements","isReadonly","getAttribute","size","value","console","warn","onSizeChange","forEach","item","setAttribute","onReadOnlyChange","toggleAttribute","getValidity","onObservedAttributeChange","attrs","attr","addEventListener","e","isTrusted","focus","buttonSelectionGroupBaseMixin","label","renderItem","renderFn","renderItems","data","dataAttr","JSON","parse","isValidDataType","error","message","isValid","Array","isArray","getItemsTemplate","reduce","acc","addedNodes","node","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles","ButtonSelectionGroupInternalClass","getSelectedNode","find","hasAttribute","allowDeselect","removeSelected","removeAttribute","onClick","target","currentTarget","setSelected","defaultValue","setDefaultValue","setTimeout","setCustomValidity","child","isRequired","valueMissing"],"sourceRoot":""}