@descope/web-components-ui 3.18.2 → 3.18.3

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.
@@ -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))},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{#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: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 `},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}},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)){#n(){return this.items.filter(t=>t.hasAttribute("selected"))}onClick(t){t.target!==t.currentTarget&&(this.#n().includes(t.target)?t.target.removeAttribute("selected"):t.target.setAttribute("selected","true"),this.dispatchChange())}get value(){return this.#n().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}#r(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.#r(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))}}},91831(t,e,n){n.r(e),n.d(e,{ButtonMultiSelectionGroupInternalClass:()=>r.o});var r=n(5364);customElements.define(r.T,r.o)},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)}}]);
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))},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{#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: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 `},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}},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)){#n(){return this.items.filter(t=>t.hasAttribute("selected"))}onClick(t){t.target!==t.currentTarget&&(this.#n().includes(t.target)?t.target.removeAttribute("selected"):t.target.setAttribute("selected","true"),this.dispatchChange())}get value(){return this.#n().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}#r(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.#r(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))}}},91831(t,e,n){n.r(e),n.d(e,{ButtonMultiSelectionGroupInternalClass:()=>r.o});var r=n(5364);customElements.define(r.T,r.o)},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),this.inputElement.addEventListener("change",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),(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)}}]);
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":"+LASO,MAAAA,EAAA,IAAAC,KACL,EAAAC,EAAAC,IACEC,EAAAC,GACAD,EAAAE,GACAF,EAAAG,GACAH,EAAAI,GAJF,EAKE,EAAAC,EAAAC,MAAeT,gFCRZ,MAAAU,EAAAC,GACP,cAAAA,EACAC,GAAA,EAAqBC,QAAAC,WACrB,+CAAqDD,MAAUC,0CAE/DC,GAEA,cAAAH,GACA,OAAAI,MAAAJ,CACA,CAEA,cAAAA,CAAAK,GACAD,MAAAJ,EAAAK,EACAD,KAAAE,aACA,CAEA,QAAAC,GACA,OAAAH,KAAAI,cAAAD,IACA,CAEA,QAAAJ,GACA,GAAAC,MAAAD,EAAA,OAAAC,MAAAD,EAEA,MAAAM,EAAAL,KAAAM,aAAA,QAEA,GAAAD,EACA,IACA,MAAAN,EAAAQ,KAAAC,MAAAH,GACA,GAAAL,KAAAS,gBAAAV,GACA,OAAAA,CAEA,CAA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,CACAW,gBAAA,GAGA9G,KAAAqG,mBAAArG,KAAAH,MAAA+G,OAAA5G,KAAAqG,kBACA,CACAU,eAAA,GAGA,EACA,CAEA,IAAAxF,GACAC,MAAAD,OAEAvB,KAAAwG,mBAEAxG,KAAAsE,cAAA,QAAAW,iBAAA,QAAAjF,KAAA4F,QAAAjE,KAAA3B,MACA,8FCpGAgH,eAAAC,OAAsBC,EAAAC,EAAeD,EAAAE,mJCW9B,MAAAxD,GAAsB,EAAAyD,EAAAhC,IAAgB,gCA6BtCiC,GAAuC,EAAAC,EAAArI,KAC5C,EAAAsI,EAAAC,IAAgB,CAClBC,SAAA,IACSC,EAAAC,MAGPJ,EAAAK,IACA,EAAAL,EAAAM,IAAe,CAAGC,WAAA,6BAClBP,EAAAQ,GACAL,EAAAM,GApCFtI,GACA,cAAAA,EACA,IAAA4B,GACAC,MAAAD,SACA,MAAAF,EAAA6G,SAAAC,cAAA,YAEA9G,EAAAC,UAAA,YACSgE,EAAA6B,qKAOC7B,EAAA6B,aAGVnH,KAAAoI,YAAAC,YAAAhH,EAAAiH,QAAAC,WAAA,IAEAvI,KAAAI,aAAAJ,KAAAwI,WAAAlE,cAAwDgB,EAAA6B,IAElD,EAAAE,EAAAoB,IAAYzI,KAAAA,KAAAI,aAAA,CAClBwB,aAAA,uEAEA,GAG8C,EAY5C,EAAA4F,EAAAkB,IAAW,CACbC,MAAA,GACAC,eAAA,oBACAC,MAAA,IAAiBlB,EAAAmB,GACjBC,iBAAA,qBACAnF,qCC1DAoD,eAAAC,OAAsBrD,EAAe0D","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.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/createBaseButtonSelectionGroupInternalClass.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/descope-button-multi-selection-group-internal/index.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"],"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 { 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 #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 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 { 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\n get value() {\n // eslint-disable-next-line no-console\n console.warn('get value', 'is not implemented');\n }\n\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 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 { 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 #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 {\n componentName,\n ButtonMultiSelectionGroupInternalClass,\n} from './ButtonMultiSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonMultiSelectionGroupInternalClass);\n\nexport { ButtonMultiSelectionGroupInternalClass };\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"],"names":["createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","buttonSelectionGroupBaseMixin","superclass","renderItem","value","label","data","this","renderFn","renderItems","size","inputElement","dataAttr","getAttribute","JSON","parse","isValidDataType","e","console","error","message","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","init","super","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","mx","bind","includeAttrs","Ge","addedNodes","forEach","node","setAttribute","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_1__","X6","$J","I4","createBaseButtonSelectionGroupInternalClass","componentName","BaseButtonSelectionGroupInternalClass","_baseClasses_createBaseInputClass__WEBPACK_IMPORTED_MODULE_1__","y","baseSelector","constructor","dispatchChange","_helpers_mixinsHelpers__WEBPACK_IMPORTED_MODULE_3__","r","items","querySelector","assignedElements","isReadonly","warn","onSizeChange","onReadOnlyChange","toggleAttribute","getValidity","onObservedAttributeChange","attrs","attr","addEventListener","isTrusted","focus","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","xE","ButtonMultiSelectionGroupInternalClass","_createBaseButtonSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_1__","m","getSelectedNodes","filter","hasAttribute","onClick","target","currentTarget","includes","removeAttribute","map","values","minItemsSelection","parseInt","maxItemsSelection","defaultValues","defaultValuesAttr","setDefaultValues","setTimeout","setCustomValidity","isRequired","length","valueMissing","rangeUnderflow","rangeOverflow","customElements","define","_ButtonMultiSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_0__","T","o","componentHelpers","ButtonMultiSelectionGroupClass","helpers","mixins","RF","mappings","baseButtonSelectionGroup","$W","VO","OZ","proxyProps","tQ","_Z","document","createElement","baseElement","appendChild","content","cloneNode","shadowRoot","EA","tz","slots","wrappedEleName","style","S$","excludeAttrsSync"],"sourceRoot":""}
1
+ {"version":3,"file":"button-selection-group-fields-descope-button-multi-selection-group-index-js.js","mappings":"+LASO,MAAAA,EAAA,IAAAC,KACL,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AAJ,KAAAwI,WAAAlE,cAAwDgB,EAAA6B,GAKxDnH,KAAAI,aAAA6E,iBAAA,cACAjF,KAAAyI,cAAA,IAAAC,MAAA,SAAgDC,SAAA,EAAAC,UAAA,KAChD5I,KAAAyI,cAAA,IAAAC,MAAA,UAAiDC,SAAA,EAAAC,UAAA,QAG3C,EAAAvB,EAAAwB,IAAY7I,KAAAA,KAAAI,aAAA,CAClBwB,aAAA,uEAEA,GAG8C,EAY5C,EAAA4F,EAAAsB,IAAW,CACbC,MAAA,GACAC,eAAA,oBACAC,MAAA,IAAiBtB,EAAAuB,GACjBC,iBAAA,qBACAvF,qCClEAoD,eAAAC,OAAsBrD,EAAe0D","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.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/createBaseButtonSelectionGroupInternalClass.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/descope-button-multi-selection-group-internal/index.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"],"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 { 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 #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 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 { 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\n get value() {\n // eslint-disable-next-line no-console\n console.warn('get value', 'is not implemented');\n }\n\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 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 { 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 #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 {\n componentName,\n ButtonMultiSelectionGroupInternalClass,\n} from './ButtonMultiSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonMultiSelectionGroupInternalClass);\n\nexport { ButtonMultiSelectionGroupInternalClass };\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 // the inner *-internal dispatches a non-bubbling, non-composed `change`,\n // which never reaches the flow runtime. Re-emit standard input/change from\n // the host (bubbling + composed) so flow real-time conditions fire.\n this.inputElement.addEventListener('change', () => {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));\n });\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"],"names":["createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","buttonSelectionGroupBaseMixin","superclass","renderItem","value","label","data","this","renderFn","renderItems","size","inputElement","dataAttr","getAttribute","JSON","parse","isValidDataType","e","console","error","message","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","init","super","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","mx","bind","includeAttrs","Ge","addedNodes","forEach","node","setAttribute","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_1__","X6","$J","I4","createBaseButtonSelectionGroupInternalClass","componentName","BaseButtonSelectionGroupInternalClass","_baseClasses_createBaseInputClass__WEBPACK_IMPORTED_MODULE_1__","y","baseSelector","constructor","dispatchChange","_helpers_mixinsHelpers__WEBPACK_IMPORTED_MODULE_3__","r","items","querySelector","assignedElements","isReadonly","warn","onSizeChange","onReadOnlyChange","toggleAttribute","getValidity","onObservedAttributeChange","attrs","attr","addEventListener","isTrusted","focus","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","xE","ButtonMultiSelectionGroupInternalClass","_createBaseButtonSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_1__","m","getSelectedNodes","filter","hasAttribute","onClick","target","currentTarget","includes","removeAttribute","map","values","minItemsSelection","parseInt","maxItemsSelection","defaultValues","defaultValuesAttr","setDefaultValues","setTimeout","setCustomValidity","isRequired","length","valueMissing","rangeUnderflow","rangeOverflow","customElements","define","_ButtonMultiSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_0__","T","o","componentHelpers","ButtonMultiSelectionGroupClass","helpers","mixins","RF","mappings","baseButtonSelectionGroup","$W","VO","OZ","proxyProps","tQ","_Z","document","createElement","baseElement","appendChild","content","cloneNode","shadowRoot","dispatchEvent","Event","bubbles","composed","EA","tz","slots","wrappedEleName","style","S$","excludeAttrsSync"],"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))},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 `},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}},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))}}},72415(t,e,n){n.r(e),n.d(e,{ButtonSelectionGroupInternalClass:()=>r.n});var r=n(92491);customElements.define(r.T,r.n)},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)}}]);
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))},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 `},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}},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))}}},72415(t,e,n){n.r(e),n.d(e,{ButtonSelectionGroupInternalClass:()=>r.n});var r=n(92491);customElements.define(r.T,r.n)},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),this.inputElement.addEventListener("change",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),(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)}}]);
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":"+LASO,MAAAA,EAAA,IAAAC,KACL,EAAAC,EAAAC,IACEC,EAAAC,GACAD,EAAAE,GACAF,EAAAG,GACAH,EAAAI,GAJF,EAKE,EAAAC,EAAAC,MAAeT,gFCRZ,MAAAU,EAAAC,GACP,cAAAA,EACAC,GAAA,EAAqBC,QAAAC,WACrB,+CAAqDD,MAAUC,0CAE/DC,GAEA,cAAAH,GACA,OAAAI,MAAAJ,CACA,CAEA,cAAAA,CAAAK,GACAD,MAAAJ,EAAAK,EACAD,KAAAE,aACA,CAEA,QA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jF,KAAA+F,QAAApE,KAAA3B,MACA,0FCtEA0G,eAAAC,OAAsBC,EAAAC,EAAeD,EAAAE,+ICW9B,MAAAlD,GAAsB,EAAAmD,EAAA1B,IAAgB,0BA6BtC2B,GAAkC,EAAAC,EAAA/H,KACvC,EAAAgI,EAAAC,IAAgB,CAClBC,SAAA,IACSC,EAAAC,MAGPJ,EAAAK,IACA,EAAAL,EAAAM,IAAe,CAAGC,WAAA,6BAClBP,EAAAQ,GACAL,EAAAM,GApCFhI,GACA,cAAAA,EACA,IAAA4B,GACAC,MAAAD,SACA,MAAAF,EAAAuG,SAAAC,cAAA,YAEAxG,EAAAC,UAAA,YACSgE,EAAAuB,qKAOCvB,EAAAuB,aAGV7G,KAAA8H,YAAAC,YAAA1G,EAAA2G,QAAAC,WAAA,IAEAjI,KAAAI,aAAAJ,KAAAkI,WAAA5D,cAAwDgB,EAAAuB,IAElD,EAAAE,EAAAoB,IAAYnI,KAAAA,KAAAI,aAAA,CAClBwB,aAAA,2CAEA,GAGyC,EAYvC,EAAAsF,EAAAkB,IAAW,CACbC,MAAA,GACAC,eAAA,oBACAC,MAAA,IAAiBlB,EAAAmB,GACjBC,iBAAA,qBACA7E,qCC1DA8C,eAAAC,OAAsB/C,EAAeoD","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.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/createBaseButtonSelectionGroupInternalClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.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/descope-button-selection-group/ButtonSelectionGroupClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group/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 { 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 #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 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 { 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\n get value() {\n // eslint-disable-next-line no-console\n console.warn('get value', 'is not implemented');\n }\n\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 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 { 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","import {\n componentName,\n ButtonSelectionGroupInternalClass,\n} from './ButtonSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonSelectionGroupInternalClass);\n\nexport { ButtonSelectionGroupInternalClass };\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"],"names":["createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","buttonSelectionGroupBaseMixin","superclass","renderItem","value","label","data","this","renderFn","renderItems","size","inputElement","dataAttr","getAttribute","JSON","parse","isValidDataType","e","console","error","message","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","init","super","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","mx","bind","includeAttrs","Ge","addedNodes","forEach","node","setAttribute","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_1__","X6","$J","I4","createBaseButtonSelectionGroupInternalClass","componentName","BaseButtonSelectionGroupInternalClass","_baseClasses_createBaseInputClass__WEBPACK_IMPORTED_MODULE_1__","y","baseSelector","constructor","dispatchChange","_helpers_mixinsHelpers__WEBPACK_IMPORTED_MODULE_3__","r","items","querySelector","assignedElements","isReadonly","warn","onSizeChange","onReadOnlyChange","toggleAttribute","getValidity","onObservedAttributeChange","attrs","attr","addEventListener","isTrusted","focus","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","xE","ButtonSelectionGroupInternalClass","_createBaseButtonSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_1__","m","getSelectedNode","find","hasAttribute","allowDeselect","removeSelected","removeAttribute","onClick","target","currentTarget","setSelected","defaultValue","setDefaultValue","setTimeout","setCustomValidity","child","isRequired","valueMissing","customElements","define","_ButtonSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_0__","T","n","componentHelpers","ButtonSelectionGroupClass","helpers","mixins","RF","mappings","baseButtonSelectionGroup","$W","VO","OZ","proxyProps","tQ","_Z","document","createElement","baseElement","appendChild","content","cloneNode","shadowRoot","EA","tz","slots","wrappedEleName","style","S$","excludeAttrsSync"],"sourceRoot":""}
1
+ {"version":3,"file":"button-selection-group-fields-descope-button-selection-group-index-js.js","mappings":"+LASO,MAAAA,EAAA,IAAAC,KACL,EAAAC,EAAAC,IACEC,EAAAC,GACAD,EAAAE,GACAF,EAAAG,GACAH,EAAAI,GAJF,EAKE,EAAAC,EAAAC,MAAeT,gFCRZ,MAAAU,EAAAC,GACP,cAAAA,EACAC,GAAA,EAAqBC,QAAAC,WACrB,+CAAqDD,MAAUC,0CAE/DC,GAEA,cAAAH,GACA,OAAAI,MAAAJ,CACA,CAEA,cAAAA,CAAAK,GACAD,MAAAJ,EAAAK,EACAD,KAAAE,aACA,CAEA,QAAAC,GACA,OAAAH,KAAAI,cAAAD,IACA,CAEA,QAAAJ,GACA,GAAAC,MAAAD,EAAA,OAAAC,MAAAD,EAEA,MAAAM,EAAAL,KAAAM,aAAA,QAEA,GAAAD,EACA,IACA,MAAAN,EAAAQ,KAAAC,MAAAH,GACA,GAAAL,KAAAS,gBAAAV,GACA,OAAAA,CAEA,CAAU,MAAAW,GAEVC,QAAAC,MAAA,uDAAAF,EAAAG,QACA,CAGA,QACA,CAEA,QAAAd,CAAAA,GACAC,KAAAS,gBAAAV,KACAC,MAAAD,EAAAA,EACAC,KAAAE,cAEA,CAEA,eAAAO,CAAAV,GACA,MAAAe,EAAAC,MAAAC,QAAAjB,GAMA,OALAe,GAEAH,QAAAC,MAAA,mCAAAb,GAGAe,CACA,CAEA,gBAAAG,GACA,OAAAjB,KAAAD,MAAA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,KAAAkI,WAAA5D,cAAwDgB,EAAAuB,GAKxD7G,KAAAI,aAAA6E,iBAAA,cACAjF,KAAAmI,cAAA,IAAAC,MAAA,SAAgDC,SAAA,EAAAC,UAAA,KAChDtI,KAAAmI,cAAA,IAAAC,MAAA,UAAiDC,SAAA,EAAAC,UAAA,QAG3C,EAAAvB,EAAAwB,IAAYvI,KAAAA,KAAAI,aAAA,CAClBwB,aAAA,2CAEA,GAGyC,EAYvC,EAAAsF,EAAAsB,IAAW,CACbC,MAAA,GACAC,eAAA,oBACAC,MAAA,IAAiBtB,EAAAuB,GACjBC,iBAAA,qBACAjF,qCClEA8C,eAAAC,OAAsB/C,EAAeoD","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.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/createBaseButtonSelectionGroupInternalClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.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/descope-button-selection-group/ButtonSelectionGroupClass.js","webpack://@descope/web-components-ui/./src/components/button-selection-group-fields/descope-button-selection-group/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 { 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 #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 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 { 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\n get value() {\n // eslint-disable-next-line no-console\n console.warn('get value', 'is not implemented');\n }\n\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 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 { 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","import {\n componentName,\n ButtonSelectionGroupInternalClass,\n} from './ButtonSelectionGroupInternalClass';\n\ncustomElements.define(componentName, ButtonSelectionGroupInternalClass);\n\nexport { ButtonSelectionGroupInternalClass };\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 // the inner *-internal dispatches a non-bubbling, non-composed `change`,\n // which never reaches the flow runtime. Re-emit standard input/change from\n // the host (bubbling + composed) so flow real-time conditions fire.\n this.inputElement.addEventListener('change', () => {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));\n });\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"],"names":["createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","buttonSelectionGroupBaseMixin","superclass","renderItem","value","label","data","this","renderFn","renderItems","size","inputElement","dataAttr","getAttribute","JSON","parse","isValidDataType","e","console","error","message","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","init","super","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","mx","bind","includeAttrs","Ge","addedNodes","forEach","node","setAttribute","host","requiredIndicator","internalWrapper","errorMessage","selector","buttonSelectionGroupMappings","hostWidth","property","hostDirection","fontFamily","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","itemsSpacing","buttonSelectionGroupStyles","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_1__","X6","$J","I4","createBaseButtonSelectionGroupInternalClass","componentName","BaseButtonSelectionGroupInternalClass","_baseClasses_createBaseInputClass__WEBPACK_IMPORTED_MODULE_1__","y","baseSelector","constructor","dispatchChange","_helpers_mixinsHelpers__WEBPACK_IMPORTED_MODULE_3__","r","items","querySelector","assignedElements","isReadonly","warn","onSizeChange","onReadOnlyChange","toggleAttribute","getValidity","onObservedAttributeChange","attrs","attr","addEventListener","isTrusted","focus","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","xE","ButtonSelectionGroupInternalClass","_createBaseButtonSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_1__","m","getSelectedNode","find","hasAttribute","allowDeselect","removeSelected","removeAttribute","onClick","target","currentTarget","setSelected","defaultValue","setDefaultValue","setTimeout","setCustomValidity","child","isRequired","valueMissing","customElements","define","_ButtonSelectionGroupInternalClass__WEBPACK_IMPORTED_MODULE_0__","T","n","componentHelpers","ButtonSelectionGroupClass","helpers","mixins","RF","mappings","baseButtonSelectionGroup","$W","VO","OZ","proxyProps","tQ","_Z","document","createElement","baseElement","appendChild","content","cloneNode","shadowRoot","dispatchEvent","Event","bubbles","composed","EA","tz","slots","wrappedEleName","style","S$","excludeAttrsSync"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9018,9399],{47656(e,t,r){r.d(t,{A:()=>x});const{host:o,label:i,placeholder:l,requiredIndicator:p,inputField:a,input:n,inputMask:s,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:y,externalInput:b,externalInputDisabled:g,externalPlaceholder:m,externalDisabledPlaceholder:f}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},x={fontSize:[{},o],fontFamily:[i,a,d,c],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},inputValueFontWeight:[{...n,property:"font-weight"},{...b,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...m,property:"font-weight"}],helperTextFontWeight:{...d,property:"font-weight"},errorMessageFontWeight:{...c,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...p,property:"color"},{...i,property:"-webkit-text-fill-color"},{...p,property:"-webkit-text-fill-color"}],hostWidth:{...o,property:"width"},hostMinWidth:{...o,property:"min-width"},hostDirection:{...o,property:"direction"},inputDirection:{...n,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...s,property:"background-color"}],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"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...a,property:"color"},{...h,property:"-webkit-text-fill-color"},{...g,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...n,property:"caret-color"},{...b,property:"caret-color"}],labelRequiredIndicator:{...p,property:"content"},inputBorderColor:{...a,property:"border-color"},inputBorderWidth:{...a,property:"border-width"},inputBorderStyle:{...a,property:"border-style"},inputBorderRadius:{...a,property:"border-radius"},inputHeight:{...a,property:"height"},inputHorizontalPadding:[{...n,property:"padding-left"},{...n,property:"padding-right"},{...b,property:"padding-left"},{...b,property:"padding-right"}],inputOutlineColor:{...a,property:"outline-color"},inputOutlineStyle:{...a,property:"outline-style"},inputOutlineWidth:{...a,property:"outline-width"},inputOutlineOffset:{...a,property:"outline-offset"},textAlign:{},inputTextAlign:[{...n,property:"text-align"},{...b,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...m,property:"color"},{...l,property:"color"},{...u,property:"-webkit-text-fill-color"},{...f,property:"-webkit-text-fill-color"}],labelPosition:{...i,property:"position"},labelTopPosition:{...i,property:"top"},labelHorizontalPosition:[{...i,property:"left"},{...i,property:"right"}],inputTransformY:{...i,property:"transform"},inputTransition:{...i,property:"transition"},marginInlineStart:{...i,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...m,property:"opacity"}],inputVerticalAlignment:[{...a,property:"align-items"},{...b,property:"align-items"}],valueInputHeight:[{...n,property:"height"},{...b,property:"height"}],valueInputMarginBottom:[{...n,property:"margin-bottom"},{...b,property:"margin-bottom"}],inputIconOffset:[{...y,property:"margin-right"},{...y,property:"margin-left"}],inputIconSize:{...y,property:"font-size"},inputIconColor:{...y,property:"color"},inputTextSecurity:[{...n,property:"-webkit-text-security"},{...n,property:"text-security"},{...b,property:"-webkit-text-security"},{...b,property:"text-security"}]}},91995(e,t,r){r.d(t,{T:()=>p,u:()=>a});var o=r(9696),i=r(97810),l=r(79365);const p=(0,i.xE)("radio-button"),a=(0,o.Zz)((0,l.RF)({mappings:{cursor:[{},{selector:"label"}],fontSize:[{selector:"label"},{}],labelTextColor:{selector:"label",property:"color"},fontFamily:{selector:"label"},labelFontWeight:{selector:"label",property:"font-weight"},radioSize:[{selector:"::part(radio)",property:"height"},{selector:"::part(radio)",property:"width"}],radioBackgroundColor:{selector:"::part(radio)",property:"background-color"},radioMargin:{selector:"::part(radio)",property:"margin"},radioCheckedSize:{selector:"::part(radio)::after",property:"border-width"},radioCheckedColor:{selector:"::part(radio)::after",property:"border-color"},radioBorderColor:{selector:"::part(radio)",property:"border-color",fallback:"none"},radioBorderWidth:{selector:"::part(radio)",property:"border-width",fallback:0},radioBorderStyle:{selector:"::part(radio)",property:"border-style",fallback:"solid"}}}),(0,l.OZ)({proxyProps:["setSelectionRange"]}),l.tQ,e=>class extends e{constructor(){super(),this.baseElement.checkValidity=()=>{}}init(){this.baseElement.addEventListener("checked-changed",e=>{this.dispatchEvent(new CustomEvent("checked-changed",{detail:e.detail},{bubbles:!0,composed:!0}))}),super.init?.(),(0,i.Ge)(this,this.renderLabel.bind(this))}renderLabel(){this.baseElement.setAttribute("label",this.textContent)}get value(){return this.getAttribute("value")}})((0,l.tz)({slots:[""],wrappedEleName:"vaadin-radio-button",excludeAttrsSync:["tabindex","data","style"],includeForwardProps:["checked","name","disabled"],componentName:p}))},25140(e,t,r){r.r(t),r.d(t,{RadioButtonClass:()=>o.u,componentName:()=>o.T});var o=r(91995);r(54623),customElements.define(o.T,o.u)},86530(e,t,r){r.r(t),r.d(t,{RadioGroupClass:()=>d,componentName:()=>s});var o=r(47656),i=r(9696),l=r(97810),p=r(73551),a=r(79365),n=r(91995);const s=(0,l.xE)("radio-group"),d=(0,i.Zz)((0,a.RF)({mappings:{...o.A,buttonsSpacing:{selector:"::part(group-field)",property:"justify-content"},buttonsRowGap:{selector:"::part(group-field)",property:"row-gap"},buttonsColumnGap:{selector:"::part(group-field)",property:"column-gap"},itemsFontFamily:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.fontFamily},itemsLabelFontWeight:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.labelFontWeight},itemsLabelColor:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.labelTextColor},itemsRadioCheckedColor:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.radioCheckedColor},itemsRadioBackgroundColor:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.radioBackgroundColor},itemsRadioCheckedBackgroundColor:{selector:()=>`::slotted(${n.u.componentName}[checked="true"])`,property:n.u.cssVarList.radioBackgroundColor}}}),a.VO,(0,a.OZ)({proxyProps:["setSelectionRange"]}),a.tQ,e=>class extends e{#e=({value:e,label:t})=>`<descope-radio-button value="${e}">${t}</descope-radio-button>`;#t;constructor(){super(),Object.defineProperty(this.baseElement,"children",{get:()=>this.querySelectorAll(n.T)}),this.baseElement.__filterRadioButtons=e=>e.filter(e=>e.localName===n.T),this.baseElement.setCustomValidity=()=>{}}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}get size(){return this.getAttribute("size")}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" - ',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get defaultValue(){return this.getAttribute("default-value")}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.#e?.(t||{})||""),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}init(){super.init?.(),this.inputElement=this.baseElement,this.renderItems(),(0,l.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),Object.defineProperty(this.baseElement,"validity",{get:()=>({valueMissing:!this.baseElement.checkValidity()})}),(0,l.EA)(this,this.baseElement,{includeAttrs:["layout"],mapAttrs:{layout:"theme"}}),setTimeout(()=>{this.defaultValue&&(this.value=this.defaultValue)}),(0,l.Ge)(this,({addedNodes:e})=>{e.forEach(e=>{e.setAttribute("size",this.size)})}),(0,l.mx)(this,()=>{this.items.forEach(e=>{e.setAttribute("size",this.size)})},{includeAttrs:["size"]})}})((0,a.tz)({slots:["","prefix"],wrappedEleName:"vaadin-radio-group",style:()=>`\n :host {\n display: inline-block;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n vaadin-radio-group {\n padding: 0;\n width: 100%;\n }\n\n ${(0,p.$J)("vaadin-radio-group")}\n `,excludeAttrsSync:["tabindex","size","data","direction","style"],componentName:s,includeForwardProps:["value"]}));r(54623),r(25140),customElements.define(s,d)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9018,9399],{47656(e,t,r){r.d(t,{A:()=>x});const{host:o,label:i,placeholder:l,requiredIndicator:p,inputField:a,input:n,inputMask:s,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:y,externalInput:b,externalInputDisabled:g,externalPlaceholder:m,externalDisabledPlaceholder:f}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},x={fontSize:[{},o],fontFamily:[i,a,d,c],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},inputValueFontWeight:[{...n,property:"font-weight"},{...b,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...m,property:"font-weight"}],helperTextFontWeight:{...d,property:"font-weight"},errorMessageFontWeight:{...c,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...p,property:"color"},{...i,property:"-webkit-text-fill-color"},{...p,property:"-webkit-text-fill-color"}],hostWidth:{...o,property:"width"},hostMinWidth:{...o,property:"min-width"},hostDirection:{...o,property:"direction"},inputDirection:{...n,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...s,property:"background-color"}],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"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...a,property:"color"},{...h,property:"-webkit-text-fill-color"},{...g,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...n,property:"caret-color"},{...b,property:"caret-color"}],labelRequiredIndicator:{...p,property:"content"},inputBorderColor:{...a,property:"border-color"},inputBorderWidth:{...a,property:"border-width"},inputBorderStyle:{...a,property:"border-style"},inputBorderRadius:{...a,property:"border-radius"},inputHeight:{...a,property:"height"},inputHorizontalPadding:[{...n,property:"padding-left"},{...n,property:"padding-right"},{...b,property:"padding-left"},{...b,property:"padding-right"}],inputOutlineColor:{...a,property:"outline-color"},inputOutlineStyle:{...a,property:"outline-style"},inputOutlineWidth:{...a,property:"outline-width"},inputOutlineOffset:{...a,property:"outline-offset"},textAlign:{},inputTextAlign:[{...n,property:"text-align"},{...b,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...m,property:"color"},{...l,property:"color"},{...u,property:"-webkit-text-fill-color"},{...f,property:"-webkit-text-fill-color"}],labelPosition:{...i,property:"position"},labelTopPosition:{...i,property:"top"},labelHorizontalPosition:[{...i,property:"left"},{...i,property:"right"}],inputTransformY:{...i,property:"transform"},inputTransition:{...i,property:"transition"},marginInlineStart:{...i,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...m,property:"opacity"}],inputVerticalAlignment:[{...a,property:"align-items"},{...b,property:"align-items"}],valueInputHeight:[{...n,property:"height"},{...b,property:"height"}],valueInputMarginBottom:[{...n,property:"margin-bottom"},{...b,property:"margin-bottom"}],inputIconOffset:[{...y,property:"margin-right"},{...y,property:"margin-left"}],inputIconSize:{...y,property:"font-size"},inputIconColor:{...y,property:"color"},inputTextSecurity:[{...n,property:"-webkit-text-security"},{...n,property:"text-security"},{...b,property:"-webkit-text-security"},{...b,property:"text-security"}]}},91995(e,t,r){r.d(t,{T:()=>p,u:()=>a});var o=r(9696),i=r(97810),l=r(79365);const p=(0,i.xE)("radio-button"),a=(0,o.Zz)((0,l.RF)({mappings:{cursor:[{},{selector:"label"}],fontSize:[{selector:"label"},{}],labelTextColor:{selector:"label",property:"color"},fontFamily:{selector:"label"},labelFontWeight:{selector:"label",property:"font-weight"},radioSize:[{selector:"::part(radio)",property:"height"},{selector:"::part(radio)",property:"width"}],radioBackgroundColor:{selector:"::part(radio)",property:"background-color"},radioMargin:{selector:"::part(radio)",property:"margin"},radioCheckedSize:{selector:"::part(radio)::after",property:"border-width"},radioCheckedColor:{selector:"::part(radio)::after",property:"border-color"},radioBorderColor:{selector:"::part(radio)",property:"border-color",fallback:"none"},radioBorderWidth:{selector:"::part(radio)",property:"border-width",fallback:0},radioBorderStyle:{selector:"::part(radio)",property:"border-style",fallback:"solid"}}}),(0,l.OZ)({proxyProps:["setSelectionRange"]}),l.tQ,e=>class extends e{constructor(){super(),this.baseElement.checkValidity=()=>{}}init(){this.baseElement.addEventListener("checked-changed",e=>{this.dispatchEvent(new CustomEvent("checked-changed",{detail:e.detail},{bubbles:!0,composed:!0}))}),super.init?.(),(0,i.Ge)(this,this.renderLabel.bind(this))}renderLabel(){this.baseElement.setAttribute("label",this.textContent)}get value(){return this.getAttribute("value")}})((0,l.tz)({slots:[""],wrappedEleName:"vaadin-radio-button",excludeAttrsSync:["tabindex","data","style"],includeForwardProps:["checked","name","disabled"],componentName:p}))},25140(e,t,r){r.r(t),r.d(t,{RadioButtonClass:()=>o.u,componentName:()=>o.T});var o=r(91995);r(54623),customElements.define(o.T,o.u)},86530(e,t,r){r.r(t),r.d(t,{RadioGroupClass:()=>d,componentName:()=>s});var o=r(47656),i=r(9696),l=r(97810),p=r(73551),a=r(79365),n=r(91995);const s=(0,l.xE)("radio-group"),d=(0,i.Zz)((0,a.RF)({mappings:{...o.A,buttonsSpacing:{selector:"::part(group-field)",property:"justify-content"},buttonsRowGap:{selector:"::part(group-field)",property:"row-gap"},buttonsColumnGap:{selector:"::part(group-field)",property:"column-gap"},itemsFontFamily:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.fontFamily},itemsLabelFontWeight:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.labelFontWeight},itemsLabelColor:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.labelTextColor},itemsRadioCheckedColor:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.radioCheckedColor},itemsRadioBackgroundColor:{selector:()=>`::slotted(${n.u.componentName})`,property:n.u.cssVarList.radioBackgroundColor},itemsRadioCheckedBackgroundColor:{selector:()=>`::slotted(${n.u.componentName}[checked="true"])`,property:n.u.cssVarList.radioBackgroundColor}}}),a.VO,(0,a.OZ)({proxyProps:["setSelectionRange"]}),a.tQ,e=>class extends e{#e=({value:e,label:t})=>`<descope-radio-button value="${e}">${t}</descope-radio-button>`;#t;constructor(){super(),Object.defineProperty(this.baseElement,"children",{get:()=>this.querySelectorAll(n.T)}),this.baseElement.__filterRadioButtons=e=>e.filter(e=>e.localName===n.T),this.baseElement.setCustomValidity=()=>{}}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}get size(){return this.getAttribute("size")}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" - ',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get defaultValue(){return this.getAttribute("default-value")}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.#e?.(t||{})||""),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}init(){super.init?.(),this.inputElement=this.baseElement,this.baseElement.addEventListener("value-changed",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.renderItems(),(0,l.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),Object.defineProperty(this.baseElement,"validity",{get:()=>({valueMissing:!this.baseElement.checkValidity()})}),(0,l.EA)(this,this.baseElement,{includeAttrs:["layout"],mapAttrs:{layout:"theme"}}),setTimeout(()=>{this.defaultValue&&(this.value=this.defaultValue)}),(0,l.Ge)(this,({addedNodes:e})=>{e.forEach(e=>{e.setAttribute("size",this.size)})}),(0,l.mx)(this,()=>{this.items.forEach(e=>{e.setAttribute("size",this.size)})},{includeAttrs:["size"]})}})((0,a.tz)({slots:["","prefix"],wrappedEleName:"vaadin-radio-group",style:()=>`\n :host {\n display: inline-block;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n vaadin-radio-group {\n padding: 0;\n width: 100%;\n }\n\n ${(0,p.$J)("vaadin-radio-group")}\n `,excludeAttrsSync:["tabindex","size","data","direction","style"],componentName:s,includeForwardProps:["value"]}));r(54623),r(25140),customElements.define(s,d)}}]);
2
2
  //# sourceMappingURL=descope-radio-group-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-radio-group-index-js.js","mappings":"4JAAA,MAAAA,KACAA,EAAAC,MACAA,EAAAC,YACAA,EAAAC,kBACAA,EAAAC,WACAA,EAAAC,MACAA,EAAAC,UACAA,EAAAC,WACAA,EAAAC,aACAA,EAAAC,oBACAA,EAAAC,cACAA,EAAAC,UACAA,EAAAC,cACAA,EAAAC,sBACAA,EAAAC,oBACAA,EAAAC,4BACAA,GACE,CACFf,KAAA,CAAUgB,SAAA,aACVf,MAAA,CAAWe,SAAA,iBACXb,kBAAA,CACAa,SAAA,+CAEAd,YAAA,CACA,CAAMc,SAAA,6BACN,CAAMA,SAAA,gDAENP,oBAAA,CAAyBO,SAAA,iCACzBZ,WAAA,CAAgBY,SAAA,uBAChBX,MAAA,CAAWW,SAAA,SACXV,UAAA,CAAeU,SAAA,+BACfN,cAAA,CAAmBM,SAAA,kBACnBT,WAAA,CAAgBS,SAAA,uBAChBR,aAAA,CAAkBQ,SAAA,yBAClBL,UAAA,CAAeK,SAAA,eACfJ,cAAA,CAAmBI,SAAA,wBACnBH,sBAAA,CAA2BG,SAAA,iCAC3BF,oBAAA,CAAyBE,SAAA,0CACzBD,4BAAA,CACAC,SAAA,+CAIAC,EAAA,CAEAC,SAAA,IAAelB,GACfmB,WAAA,CAAAlB,EAAAG,EAAAG,EAAAC,GAEAY,cAAA,IAAmBnB,EAAAoB,SAAA,aACnBC,gBAAA,IAAqBrB,EAAAoB,SAAA,eAErBE,qB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AzC,EAAAqD,IAAiBjF,KAAAA,KAAAqE,YAAAxD,KAAAb,MAAA,CAAsCkF,aAAA,WAE7DnC,OAAAC,eAAAhD,KAAAC,YAAA,YACAgD,IAAA,MAAsBkC,cAAAnF,KAAAC,YAAAC,qBAGhB,EAAA0B,EAAAwD,IAAYpF,KAAAA,KAAAC,YAAA,CAClBiF,aAAA,WACAG,SAAA,CAAoBC,OAAA,WAGpBC,WAAA,KACAvF,KAAAsE,eACAtE,KAAAgB,MAAAhB,KAAAsE,iBAKM,EAAA1C,EAAAjB,IAAeX,KAAA,EAAUwF,iBAC/BA,EAAAC,QAAAnC,IACAA,EAAAxC,aAAA,OAAAd,KAAA6D,WAIM,EAAAjC,EAAAqD,IACNjF,KACA,KACAA,KAAAyD,MAAAgC,QAAAZ,IACAA,EAAA/D,aAAA,OAAAd,KAAA6D,SAGA,CACAqB,aAAA,UAGA,GAG+B,EAsC7B,EAAAnD,EAAAb,IAAW,CACbC,MAAA,cACAC,eAAA,qBACAsE,MAAA,mMAYM,EAAAC,EAAAC,IAAuB,8BAG7BvE,iBAAA,+CACA9C,gBACA+C,oBAAA,+BC3MAC,eAAAC,OAAsBjD,EAAoBsD","sources":["webpack://@descope/web-components-ui/../components/descope-text-field/src/component/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/descope-radio-button/RadioButtonClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/descope-radio-button/index.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/RadioGroupClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/index.js"],"sourcesContent":["const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: {\n selector: () => '::slotted(input:disabled::placeholder)',\n },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n inputValueFontWeight: [\n { ...input, property: 'font-weight' },\n { ...externalInput, property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n {\n selector: () => ':host input:placeholder-shown',\n property: 'font-weight',\n },\n { ...externalPlaceholder, property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n","import { compose } from '../../../helpers';\nimport { getComponentName, observeChildren } from '../../../helpers/componentHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n proxyInputMixin,\n} from '../../../mixins';\n\nexport const componentName = getComponentName('radio-button');\n\nconst customMixin = (superclass) =>\n class CustomMixin extends superclass {\n constructor() {\n super();\n\n this.baseElement.checkValidity = () => {};\n }\n\n init() {\n // we are forwarding vaadin checked-changed event\n this.baseElement.addEventListener('checked-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent(\n 'checked-changed',\n { detail: e.detail },\n { bubbles: true, composed: true }\n )\n );\n });\n\n super.init?.();\n\n observeChildren(this, this.renderLabel.bind(this));\n }\n\n renderLabel() {\n this.baseElement.setAttribute('label', this.textContent);\n }\n\n get value() {\n return this.getAttribute('value');\n }\n };\n\nexport const RadioButtonClass = compose(\n createStyleMixin({\n mappings: {\n cursor: [{}, { selector: 'label' }],\n fontSize: [{ selector: 'label' }, {}],\n labelTextColor: { selector: 'label', property: 'color' },\n fontFamily: { selector: 'label' },\n labelFontWeight: { selector: 'label', property: 'font-weight' },\n radioSize: [\n { selector: '::part(radio)', property: 'height' },\n { selector: '::part(radio)', property: 'width' },\n ],\n radioBackgroundColor: { selector: '::part(radio)', property: 'background-color' },\n radioMargin: { selector: '::part(radio)', property: 'margin' },\n radioCheckedSize: { selector: '::part(radio)::after', property: 'border-width' },\n radioCheckedColor: { selector: '::part(radio)::after', property: 'border-color' },\n radioBorderColor: { selector: '::part(radio)', property: 'border-color', fallback: 'none' },\n radioBorderWidth: { selector: '::part(radio)', property: 'border-width', fallback: 0 },\n radioBorderStyle: { selector: '::part(radio)', property: 'border-style', fallback: 'solid' },\n },\n }),\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: [''],\n wrappedEleName: 'vaadin-radio-button',\n excludeAttrsSync: ['tabindex', 'data', 'style'],\n includeForwardProps: ['checked', 'name', 'disabled'],\n componentName,\n })\n);\n","import { componentName, RadioButtonClass } from './RadioButtonClass';\nimport '@vaadin/radio-group';\n\ncustomElements.define(componentName, RadioButtonClass);\n\nexport { RadioButtonClass, componentName };\n","import textFieldMappings from '@descope-ui/descope-text-field/mappings';\nimport { compose } from '../../helpers';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '../../helpers/componentHelpers';\nimport { resetInputLabelPosition } from '../../helpers/themeHelpers/resetHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n proxyInputMixin,\n} from '../../mixins';\nimport {\n componentName as childNodeName,\n RadioButtonClass,\n} from './descope-radio-button/RadioButtonClass';\n\nexport const componentName = getComponentName('radio-group');\n\nconst RadioGroupMixin = (superclass) =>\n class RadioGroupMixinClass extends superclass {\n #renderItem = ({ value, label }) =>\n `<descope-radio-button value=\"${value}\">${label}</descope-radio-button>`;\n\n #data;\n\n constructor() {\n super();\n\n // we are overriding vaadin children getter so it will run on our custom elements\n Object.defineProperty(this.baseElement, 'children', {\n get: () => this.querySelectorAll(childNodeName),\n });\n\n // we are overriding vaadin __filterRadioButtons so it will run on our custom elements\n this.baseElement.__filterRadioButtons = (nodes) =>\n nodes.filter((node) => node.localName === childNodeName);\n\n // vaadin radio group missing some input properties\n this.baseElement.setCustomValidity = () => {};\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n get size() {\n return this.getAttribute('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 get defaultValue() {\n return this.getAttribute('default-value');\n }\n\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.inputElement = this.baseElement;\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n Object.defineProperty(this.baseElement, 'validity', {\n get: () => ({ valueMissing: !this.baseElement.checkValidity() }),\n });\n\n forwardAttrs(this, this.baseElement, {\n includeAttrs: ['layout'],\n mapAttrs: { layout: 'theme' },\n });\n\n setTimeout(() => {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n });\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 observeAttributes(\n this,\n () => {\n this.items.forEach((item) => {\n item.setAttribute('size', this.size);\n });\n },\n {\n includeAttrs: ['size'],\n }\n );\n }\n };\n\nexport const RadioGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...textFieldMappings,\n buttonsSpacing: { selector: '::part(group-field)', property: 'justify-content' },\n buttonsRowGap: { selector: '::part(group-field)', property: 'row-gap' },\n buttonsColumnGap: { selector: '::part(group-field)', property: 'column-gap' },\n itemsFontFamily: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.fontFamily,\n },\n itemsLabelFontWeight: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.labelFontWeight,\n },\n itemsLabelColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.labelTextColor,\n },\n itemsRadioCheckedColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.radioCheckedColor,\n },\n itemsRadioBackgroundColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.radioBackgroundColor,\n },\n itemsRadioCheckedBackgroundColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName}[checked=\"true\"])`,\n property: RadioButtonClass.cssVarList.radioBackgroundColor,\n },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n RadioGroupMixin\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-radio-group',\n style: () => `\n :host {\n display: inline-block;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n vaadin-radio-group {\n padding: 0;\n width: 100%;\n }\n\n ${resetInputLabelPosition('vaadin-radio-group')}\n `,\n\n excludeAttrsSync: ['tabindex', 'size', 'data', 'direction', 'style'],\n componentName,\n includeForwardProps: ['value'],\n })\n);\n","import { componentName as groupComponentName, RadioGroupClass } from './RadioGroupClass';\nimport '@vaadin/radio-group';\nimport './descope-radio-button';\n\ncustomElements.define(groupComponentName, RadioGroupClass);\n\nexport { RadioGroupClass, groupComponentName as componentName };\n"],"names":["host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","__WEBPACK_DEFAULT_EXPORT__","fontSize","fontFamily","labelFontSize","property","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity","componentName","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_1__","xE","RadioButtonClass","_helpers__WEBPACK_IMPORTED_MODULE_0__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_2__","RF","mappings","cursor","radioSize","radioBackgroundColor","radioMargin","radioCheckedSize","radioCheckedColor","radioBorderColor","fallback","radioBorderWidth","radioBorderStyle","OZ","proxyProps","tQ","superclass","constructor","super","this","baseElement","checkValidity","init","addEventListener","e","dispatchEvent","CustomEvent","detail","bubbles","composed","Ge","renderLabel","bind","setAttribute","textContent","value","getAttribute","tz","slots","wrappedEleName","excludeAttrsSync","includeForwardProps","customElements","define","_RadioButtonClass__WEBPACK_IMPORTED_MODULE_0__","T","u","componentHelpers","RadioGroupClass","helpers","mixins","textFieldMappings","A","buttonsSpacing","buttonsRowGap","buttonsColumnGap","itemsFontFamily","cssVarList","itemsLabelFontWeight","itemsLabelColor","itemsRadioCheckedColor","itemsRadioBackgroundColor","itemsRadioCheckedBackgroundColor","VO","renderItem","data","Object","defineProperty","get","querySelectorAll","__filterRadioButtons","nodes","filter","node","localName","setCustomValidity","items","shadowRoot","querySelector","assignedElements","size","dataAttr","JSON","parse","isValidDataType","console","error","message","renderItems","defaultValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","inputElement","mx","includeAttrs","valueMissing","EA","mapAttrs","layout","setTimeout","addedNodes","forEach","style","resetHelpers","$J"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-radio-group-index-js.js","mappings":"4JAAA,MAAAA,KACAA,EAAAC,MACAA,EAAAC,YACAA,EAAAC,kBACAA,EAAAC,WACAA,EAAAC,MACAA,EAAAC,UACAA,EAAAC,WACAA,EAAAC,aACAA,EAAAC,oBACAA,EAAAC,cACAA,EAAAC,UACAA,EAAAC,cACAA,EAAAC,sBACAA,EAAAC,oBACAA,EAAAC,4BACAA,GACE,CACFf,KAAA,CAAUgB,SAAA,aACVf,MAAA,CAAWe,SAAA,iBACXb,kBAAA,CACAa,SAAA,+CAEAd,YAAA,CACA,CAAMc,SAAA,6BACN,CAAMA,SAAA,gDAENP,oBAAA,CAAyBO,SAAA,iCACzBZ,WAAA,CAAgBY,SAAA,uBAChBX,MAAA,CAAWW,SAAA,SACXV,UAAA,CAAeU,SAAA,+BACfN,cAAA,CAAmBM,SAAA,kBACnBT,WAAA,CAAgBS,SAAA,uBAChBR,aAAA,CAAkBQ,SAAA,yBAClBL,UAAA,CAAeK,SAAA,eACfJ,cAAA,CAAmBI,SAAA,wBACnBH,sBAAA,CAA2BG,SAAA,iCAC3BF,oBAAA,CAAyBE,SAAA,0CACzBD,4BAAA,CACAC,SAAA,+CAIAC,EAAA,CAEAC,SAAA,IAAelB,GACfmB,WAAA,CAAAlB,EAAAG,EAAAG,EAAA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A,CAEA,IAAA3E,GACAJ,MAAAI,SAEAH,KAAAgF,aAAAhF,KAAAC,YAMAD,KAAAC,YAAAG,iBAAA,qBACAJ,KAAAM,cAAA,IAAA2E,MAAA,SAAgDxE,SAAA,EAAAC,UAAA,KAChDV,KAAAM,cAAA,IAAA2E,MAAA,UAAiDxE,SAAA,EAAAC,UAAA,OAGjDV,KAAAqE,eAEM,EAAAzC,EAAAsD,IAAiBlF,KAAAA,KAAAqE,YAAAxD,KAAAb,MAAA,CAAsCmF,aAAA,WAE7DpC,OAAAC,eAAAhD,KAAAC,YAAA,YACAgD,IAAA,MAAsBmC,cAAApF,KAAAC,YAAAC,qBAGhB,EAAA0B,EAAAyD,IAAYrF,KAAAA,KAAAC,YAAA,CAClBkF,aAAA,WACAG,SAAA,CAAoBC,OAAA,WAGpBC,WAAA,KACAxF,KAAAsE,eACAtE,KAAAgB,MAAAhB,KAAAsE,iBAKM,EAAA1C,EAAAjB,IAAeX,KAAA,EAAUyF,iBAC/BA,EAAAC,QAAApC,IACAA,EAAAxC,aAAA,OAAAd,KAAA6D,WAIM,EAAAjC,EAAAsD,IACNlF,KACA,KACAA,KAAAyD,MAAAiC,QAAAb,IACAA,EAAA/D,aAAA,OAAAd,KAAA6D,SAGA,CACAsB,aAAA,UAGA,GAG+B,EAsC7B,EAAApD,EAAAb,IAAW,CACbC,MAAA,cACAC,eAAA,qBACAuE,MAAA,mMAYM,EAAAC,EAAAC,IAAuB,8BAG7BxE,iBAAA,+CACA9C,gBACA+C,oBAAA,+BCpNAC,eAAAC,OAAsBjD,EAAoBsD","sources":["webpack://@descope/web-components-ui/../components/descope-text-field/src/component/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/descope-radio-button/RadioButtonClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/descope-radio-button/index.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/RadioGroupClass.js","webpack://@descope/web-components-ui/./src/components/descope-radio-group/index.js"],"sourcesContent":["const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: {\n selector: () => '::slotted(input:disabled::placeholder)',\n },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n inputValueFontWeight: [\n { ...input, property: 'font-weight' },\n { ...externalInput, property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n {\n selector: () => ':host input:placeholder-shown',\n property: 'font-weight',\n },\n { ...externalPlaceholder, property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n","import { compose } from '../../../helpers';\nimport { getComponentName, observeChildren } from '../../../helpers/componentHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n proxyInputMixin,\n} from '../../../mixins';\n\nexport const componentName = getComponentName('radio-button');\n\nconst customMixin = (superclass) =>\n class CustomMixin extends superclass {\n constructor() {\n super();\n\n this.baseElement.checkValidity = () => {};\n }\n\n init() {\n // we are forwarding vaadin checked-changed event\n this.baseElement.addEventListener('checked-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent(\n 'checked-changed',\n { detail: e.detail },\n { bubbles: true, composed: true }\n )\n );\n });\n\n super.init?.();\n\n observeChildren(this, this.renderLabel.bind(this));\n }\n\n renderLabel() {\n this.baseElement.setAttribute('label', this.textContent);\n }\n\n get value() {\n return this.getAttribute('value');\n }\n };\n\nexport const RadioButtonClass = compose(\n createStyleMixin({\n mappings: {\n cursor: [{}, { selector: 'label' }],\n fontSize: [{ selector: 'label' }, {}],\n labelTextColor: { selector: 'label', property: 'color' },\n fontFamily: { selector: 'label' },\n labelFontWeight: { selector: 'label', property: 'font-weight' },\n radioSize: [\n { selector: '::part(radio)', property: 'height' },\n { selector: '::part(radio)', property: 'width' },\n ],\n radioBackgroundColor: { selector: '::part(radio)', property: 'background-color' },\n radioMargin: { selector: '::part(radio)', property: 'margin' },\n radioCheckedSize: { selector: '::part(radio)::after', property: 'border-width' },\n radioCheckedColor: { selector: '::part(radio)::after', property: 'border-color' },\n radioBorderColor: { selector: '::part(radio)', property: 'border-color', fallback: 'none' },\n radioBorderWidth: { selector: '::part(radio)', property: 'border-width', fallback: 0 },\n radioBorderStyle: { selector: '::part(radio)', property: 'border-style', fallback: 'solid' },\n },\n }),\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: [''],\n wrappedEleName: 'vaadin-radio-button',\n excludeAttrsSync: ['tabindex', 'data', 'style'],\n includeForwardProps: ['checked', 'name', 'disabled'],\n componentName,\n })\n);\n","import { componentName, RadioButtonClass } from './RadioButtonClass';\nimport '@vaadin/radio-group';\n\ncustomElements.define(componentName, RadioButtonClass);\n\nexport { RadioButtonClass, componentName };\n","import textFieldMappings from '@descope-ui/descope-text-field/mappings';\nimport { compose } from '../../helpers';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '../../helpers/componentHelpers';\nimport { resetInputLabelPosition } from '../../helpers/themeHelpers/resetHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n proxyInputMixin,\n} from '../../mixins';\nimport {\n componentName as childNodeName,\n RadioButtonClass,\n} from './descope-radio-button/RadioButtonClass';\n\nexport const componentName = getComponentName('radio-group');\n\nconst RadioGroupMixin = (superclass) =>\n class RadioGroupMixinClass extends superclass {\n #renderItem = ({ value, label }) =>\n `<descope-radio-button value=\"${value}\">${label}</descope-radio-button>`;\n\n #data;\n\n constructor() {\n super();\n\n // we are overriding vaadin children getter so it will run on our custom elements\n Object.defineProperty(this.baseElement, 'children', {\n get: () => this.querySelectorAll(childNodeName),\n });\n\n // we are overriding vaadin __filterRadioButtons so it will run on our custom elements\n this.baseElement.__filterRadioButtons = (nodes) =>\n nodes.filter((node) => node.localName === childNodeName);\n\n // vaadin radio group missing some input properties\n this.baseElement.setCustomValidity = () => {};\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n get size() {\n return this.getAttribute('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 get defaultValue() {\n return this.getAttribute('default-value');\n }\n\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.inputElement = this.baseElement;\n\n // vaadin-radio-group emits `value-changed` on selection but no native\n // input/change events. Re-emit standard input/change from the host\n // (bubbling + composed) so flow real-time conditions fire, matching how\n // proxyInputMixin bridges input/change for other fields.\n this.baseElement.addEventListener('value-changed', () => {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));\n });\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });\n\n Object.defineProperty(this.baseElement, 'validity', {\n get: () => ({ valueMissing: !this.baseElement.checkValidity() }),\n });\n\n forwardAttrs(this, this.baseElement, {\n includeAttrs: ['layout'],\n mapAttrs: { layout: 'theme' },\n });\n\n setTimeout(() => {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n });\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 observeAttributes(\n this,\n () => {\n this.items.forEach((item) => {\n item.setAttribute('size', this.size);\n });\n },\n {\n includeAttrs: ['size'],\n }\n );\n }\n };\n\nexport const RadioGroupClass = compose(\n createStyleMixin({\n mappings: {\n ...textFieldMappings,\n buttonsSpacing: { selector: '::part(group-field)', property: 'justify-content' },\n buttonsRowGap: { selector: '::part(group-field)', property: 'row-gap' },\n buttonsColumnGap: { selector: '::part(group-field)', property: 'column-gap' },\n itemsFontFamily: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.fontFamily,\n },\n itemsLabelFontWeight: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.labelFontWeight,\n },\n itemsLabelColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.labelTextColor,\n },\n itemsRadioCheckedColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.radioCheckedColor,\n },\n itemsRadioBackgroundColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName})`,\n property: RadioButtonClass.cssVarList.radioBackgroundColor,\n },\n itemsRadioCheckedBackgroundColor: {\n selector: () => `::slotted(${RadioButtonClass.componentName}[checked=\"true\"])`,\n property: RadioButtonClass.cssVarList.radioBackgroundColor,\n },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['setSelectionRange'] }),\n componentNameValidationMixin,\n RadioGroupMixin\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-radio-group',\n style: () => `\n :host {\n display: inline-block;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n vaadin-radio-group {\n padding: 0;\n width: 100%;\n }\n\n ${resetInputLabelPosition('vaadin-radio-group')}\n `,\n\n excludeAttrsSync: ['tabindex', 'size', 'data', 'direction', 'style'],\n componentName,\n includeForwardProps: ['value'],\n })\n);\n","import { componentName as groupComponentName, RadioGroupClass } from './RadioGroupClass';\nimport '@vaadin/radio-group';\nimport './descope-radio-button';\n\ncustomElements.define(groupComponentName, RadioGroupClass);\n\nexport { RadioGroupClass, groupComponentName as componentName };\n"],"names":["host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","__WEBPACK_DEFAULT_EXPORT__","fontSize","fontFamily","labelFontSize","property","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity","componentName","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_1__","xE","RadioButtonClass","_helpers__WEBPACK_IMPORTED_MODULE_0__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_2__","RF","mappings","cursor","radioSize","radioBackgroundColor","radioMargin","radioCheckedSize","radioCheckedColor","radioBorderColor","fallback","radioBorderWidth","radioBorderStyle","OZ","proxyProps","tQ","superclass","constructor","super","this","baseElement","checkValidity","init","addEventListener","e","dispatchEvent","CustomEvent","detail","bubbles","composed","Ge","renderLabel","bind","setAttribute","textContent","value","getAttribute","tz","slots","wrappedEleName","excludeAttrsSync","includeForwardProps","customElements","define","_RadioButtonClass__WEBPACK_IMPORTED_MODULE_0__","T","u","componentHelpers","RadioGroupClass","helpers","mixins","textFieldMappings","A","buttonsSpacing","buttonsRowGap","buttonsColumnGap","itemsFontFamily","cssVarList","itemsLabelFontWeight","itemsLabelColor","itemsRadioCheckedColor","itemsRadioBackgroundColor","itemsRadioCheckedBackgroundColor","VO","renderItem","data","Object","defineProperty","get","querySelectorAll","__filterRadioButtons","nodes","filter","node","localName","setCustomValidity","items","shadowRoot","querySelector","assignedElements","size","dataAttr","JSON","parse","isValidDataType","console","error","message","renderItems","defaultValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","inputElement","Event","mx","includeAttrs","valueMissing","EA","mapAttrs","layout","setTimeout","addedNodes","forEach","style","resetHelpers","$J"],"sourceRoot":""}