@descope/web-components-ui 1.0.246 → 1.0.248

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/dist/cjs/index.cjs.js +877 -658
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.esm.js +994 -769
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1000.js +1 -1
  7. package/dist/umd/9214.js +1 -0
  8. package/dist/umd/9434.js +1 -0
  9. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -0
  10. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -0
  11. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -0
  12. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -0
  13. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -0
  14. package/dist/umd/index.js +1 -1
  15. package/package.json +1 -1
  16. package/src/components/{descope-button-selection-group/ButtonSelectionGroupClass.js → button-selection-group-fields/baseButtonSelectionGroup.js} +19 -70
  17. package/src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js +101 -0
  18. package/src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js +67 -0
  19. package/src/components/button-selection-group-fields/descope-button-multi-selection-group/index.js +7 -0
  20. package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js +106 -0
  21. package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/index.js +8 -0
  22. package/src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js +67 -0
  23. package/src/components/{descope-button-selection-group → button-selection-group-fields/descope-button-selection-group}/index.js +2 -2
  24. package/src/components/button-selection-group-fields/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js +77 -0
  25. package/src/index.cjs.js +3 -2
  26. package/src/index.d.ts +2 -1
  27. package/src/index.js +3 -1
  28. package/src/mixins/inputValidationMixin.js +2 -2
  29. package/src/theme/components/buttonSelectionGroup/baseButtonSelectionGroup.js +15 -0
  30. package/src/theme/components/buttonSelectionGroup/buttonMultiSelectionGroup.js +11 -0
  31. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroup.js +3 -12
  32. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +1 -1
  33. package/src/theme/components/index.js +2 -0
  34. package/dist/umd/descope-button-selection-group-descope-button-selection-group-internal-index-js.js +0 -1
  35. package/dist/umd/descope-button-selection-group-descope-button-selection-group-item-index-js.js +0 -1
  36. package/dist/umd/descope-button-selection-group-index-js.js +0 -1
  37. package/src/components/descope-button-selection-group/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js +0 -145
  38. /package/src/components/{descope-button-selection-group → button-selection-group-fields}/descope-button-selection-group-internal/index.js +0 -0
  39. /package/src/components/{descope-button-selection-group → button-selection-group-fields}/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +0 -0
  40. /package/src/components/{descope-button-selection-group → button-selection-group-fields}/descope-button-selection-group-item/index.js +0 -0
package/dist/umd/1000.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[1e3],{2561:(t,e,s)=>{s.d(e,{s:()=>h});var i=s(2061),n=s(357),r=s(7878);const a=t=>class extends t{#t=r.C.bind(this,"components-context");updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}};var o=s(2666),l=s(8084);const h=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#e;#s=!0;get baseSelector(){return e}get baseElement(){return this.#e??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#e||console.warn("missing base element for component",this.localName),this.#e}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#s&&(this.#s=!1,this.init?.())}}return(0,i.qC)(n.A,o._,l.Q,a)(s)}},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},2666:(t,e,s)=>{s.d(e,{_:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},1e3:(t,e,s)=>{s.d(e,{li:()=>w,Ae:()=>A.A,DM:()=>p,yk:()=>u,e4:()=>c,_A:()=>S._,mE:()=>T,wX:()=>b,QT:()=>x.Q,Iw:()=>M,dj:()=>f});var i=s(5279),n=s(2061),r=s(4567),a=s(5561);const o=(t,...e)=>`var(${t}${e.length?` , ${o(...e)}`:""})`;class l{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const h=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,r.Tk)(t,s)})),{}),u=({mappings:t={},componentNameOverride:e=""})=>s=>{const u=e||s.componentName;return class extends s{static get cssVarList(){return{...s.cssVarList,...h(u,{...t})}}#n;#r;#a;#o;#l;#h;#u;#c;#d;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#o=s,this.#l=r,this.#u=a??this.baseSelector,this.#d=e,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get#m(){return a.componentsThemeManager.currentTheme?.[u]||""}#p(){this.#r.innerHTML=this.#m[this.#l]}#g(){this.#r=document.createElement("style"),this.#r.id=`style-mixin-theme__${u}`,this.#h.prepend(this.#r),this.#a=a.componentsThemeManager.onCurrentThemeChange(this.#p.bind(this)),this.#p()}#b(){if(this.#c.length){this.#n=document.createElement("style"),this.#n.id=`style-mixin-overrides__${u}`;const s=(t=u,e=i.k4,Array(e).fill(`.${t}`).join(""));this.#n.innerText=`:host(${s}) {}`,this.#h.append(this.#n)}var t,e}#E(t,e){const s=this.#n?.sheet?.cssRules[0].style;if(!s)return;const i=(0,r.Tk)(u,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#v(t=[]){let e=!1;t.forEach((t=>{this.#c.includes(t)&&(this.#E(t,this.getAttribute(t)),e=!0)})),e&&(this.#n.innerHTML=this.#n?.sheet?.cssRules[0].cssText)}#y(){if(Object.keys(t).length){const e=document.createElement("style");e.id=`style-mixin-mappings__${u}`,e.innerHTML=((t,e,s)=>{const i=new l;return Object.keys(s).forEach((a=>{const l=((t,e)=>{const s={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s,important:r})=>{i.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(s)?s():s,o(h)+(r?"!important":""))}))})),i.toString()})((0,n.E3)(u,this.#o),this.#u,t),this.#h.prepend(e)}}#f(t){(this.#h.classList||this.#h.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#h=await(this.#d?.(this))||this.shadowRoot,this.#f(u),this.#y(),this.#g(),this.#b(),(0,r.FX)(this,this.#v.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#a?.()}}},c=t=>class extends t{#A=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#A=document.createElement("style"),this.#A.innerText="* { cursor: inherit!important }"}#S(t){t?this.shadowRoot.appendChild(this.#A):this.#A.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#S("true"===s)}};var d=s(2561),m=s(7878);const p=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[]})=>{class h extends((0,d.s)({componentName:t,baseSelector:e})){#C=m.C.bind(this,"blur");#M=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:!0}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""} ></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#C()})),this.baseElement.addEventListener("focus",(t=>{this.#M()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h};s(5910);const g=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#w;constructor(){super(),this.#w=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.minItemsSelection} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.maxItemsSelection} items are allowed.`}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:r,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:h,customError:u}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||i||n||h:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case r:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case l:return this.defaultErrorMsgRangeUnderflow;case o:return this.defaultErrorMsgRangeOverflow;case u:return this.validationMessage;default:return""}}#x(){const t=this.isReadOnly?{}:this.getValidity();this.#w.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#w.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#w.validity.valid}reportValidity(){return this.#w.reportValidity()}get validity(){return this.#w.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#w.setValidity({customError:!0},t,this.validationTarget):(this.#w.setValidity({}),this.#x())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#w.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#x()}init(){super.init?.(),this.addEventListener("change",this.#x),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#x),setTimeout((()=>this.#x()))}},E=["invalid","required"],v=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e.localName)return e},y=({proxyProps:t=[],inputEvent:e="input"})=>s=>class extends(b(s)){static get observedAttributes(){return[...s.observedAttributes||[],...E]}#T;#L=m.C.bind(this,"change");constructor(){super(),this.#T=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#T&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#T)return this.#T;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#T=v(t)||v(e),this.#T}set inputElement(t){this.#T=t}getValidity(){return this.inputElement?.validity||{}}#V(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#V(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},setTimeout((()=>{this.baseElement?.addEventListener(e,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#V()})),this.baseElement.addEventListener("change",(()=>{this.#L()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#V()})),t.forEach((t=>{var e,s;e=this.inputElement,s=t,Object.defineProperty(this,s,{set(t){e[s]=t},get:()=>e[s],configurable:!0})})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,r.oP)(this,this.inputElement,{includeAttrs:["inputmode"]})}))}},f=t=>(0,n.qC)(y(t),u({componentNameOverride:(0,r.iY)("input-wrapper")}));var A=s(357),S=s(2666);const C=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},M=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const c=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=u({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[c]:h((0,n.E3)(l.componentName,"_"+c),s)}}#k;constructor(){const t=C((async t=>{const s=t.shadowRoot.querySelector(t.baseSelector);return e?(await C((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+c,themeSection:i.qM+c,baseSelector:":host"}),this.#k=t(this).then((t=>t.host))}async#$(){const t=await this.#k;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#k;(0,r.oP)(this,t,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#$()}}},w=t=>class extends t{#L=m.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#L(),this.prevValue=this.value)}))}};var x=s(8084);const T=t=>class extends t{init(){this.#N(),super.init?.()}#N(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,m.C.call(this,"blur"),m.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(m.C.call(this,"focus"),m.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>r});var i=s(4567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing"],r=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.warn(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[1e3],{2561:(t,e,s)=>{s.d(e,{s:()=>h});var i=s(2061),n=s(357),r=s(7878);const a=t=>class extends t{#t=r.C.bind(this,"components-context");updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}};var o=s(2666),l=s(8084);const h=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#e;#s=!0;get baseSelector(){return e}get baseElement(){return this.#e??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#e||console.warn("missing base element for component",this.localName),this.#e}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#s&&(this.#s=!1,this.init?.())}}return(0,i.qC)(n.A,o._,l.Q,a)(s)}},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},2666:(t,e,s)=>{s.d(e,{_:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},1e3:(t,e,s)=>{s.d(e,{li:()=>w,Ae:()=>A.A,DM:()=>p,yk:()=>u,e4:()=>c,_A:()=>S._,mE:()=>T,wX:()=>b,QT:()=>x.Q,Iw:()=>M,dj:()=>f});var i=s(5279),n=s(2061),r=s(4567),a=s(5561);const o=(t,...e)=>`var(${t}${e.length?` , ${o(...e)}`:""})`;class l{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const h=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,r.Tk)(t,s)})),{}),u=({mappings:t={},componentNameOverride:e=""})=>s=>{const u=e||s.componentName;return class extends s{static get cssVarList(){return{...s.cssVarList,...h(u,{...t})}}#n;#r;#a;#o;#l;#h;#u;#c;#d;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#o=s,this.#l=r,this.#u=a??this.baseSelector,this.#d=e,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get#m(){return a.componentsThemeManager.currentTheme?.[u]||""}#p(){this.#r.innerHTML=this.#m[this.#l]}#g(){this.#r=document.createElement("style"),this.#r.id=`style-mixin-theme__${u}`,this.#h.prepend(this.#r),this.#a=a.componentsThemeManager.onCurrentThemeChange(this.#p.bind(this)),this.#p()}#b(){if(this.#c.length){this.#n=document.createElement("style"),this.#n.id=`style-mixin-overrides__${u}`;const s=(t=u,e=i.k4,Array(e).fill(`.${t}`).join(""));this.#n.innerText=`:host(${s}) {}`,this.#h.append(this.#n)}var t,e}#E(t,e){const s=this.#n?.sheet?.cssRules[0].style;if(!s)return;const i=(0,r.Tk)(u,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#v(t=[]){let e=!1;t.forEach((t=>{this.#c.includes(t)&&(this.#E(t,this.getAttribute(t)),e=!0)})),e&&(this.#n.innerHTML=this.#n?.sheet?.cssRules[0].cssText)}#y(){if(Object.keys(t).length){const e=document.createElement("style");e.id=`style-mixin-mappings__${u}`,e.innerHTML=((t,e,s)=>{const i=new l;return Object.keys(s).forEach((a=>{const l=((t,e)=>{const s={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s,important:r})=>{i.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(s)?s():s,o(h)+(r?"!important":""))}))})),i.toString()})((0,n.E3)(u,this.#o),this.#u,t),this.#h.prepend(e)}}#f(t){(this.#h.classList||this.#h.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#h=await(this.#d?.(this))||this.shadowRoot,this.#f(u),this.#y(),this.#g(),this.#b(),(0,r.FX)(this,this.#v.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#a?.()}}},c=t=>class extends t{#A=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#A=document.createElement("style"),this.#A.innerText="* { cursor: inherit!important }"}#S(t){t?this.shadowRoot.appendChild(this.#A):this.#A.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#S("true"===s)}};var d=s(2561),m=s(7878);const p=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[]})=>{class h extends((0,d.s)({componentName:t,baseSelector:e})){#C=m.C.bind(this,"blur");#M=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:!0}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""} ></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#C()})),this.baseElement.addEventListener("focus",(t=>{this.#M()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h};s(5910);const g=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#w;constructor(){super(),this.#w=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:r,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:h,customError:u}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||i||n||h:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case r:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case l:return this.defaultErrorMsgRangeUnderflow;case o:return this.defaultErrorMsgRangeOverflow;case u:return this.validationMessage;default:return""}}#x(){const t=this.isReadOnly?{}:this.getValidity();this.#w.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#w.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#w.validity.valid}reportValidity(){return this.#w.reportValidity()}get validity(){return this.#w.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#w.setValidity({customError:!0},t,this.validationTarget):(this.#w.setValidity({}),this.#x())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#w.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#x()}init(){super.init?.(),this.addEventListener("change",this.#x),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#x),setTimeout((()=>this.#x()))}},E=["invalid","required"],v=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e.localName)return e},y=({proxyProps:t=[],inputEvent:e="input"})=>s=>class extends(b(s)){static get observedAttributes(){return[...s.observedAttributes||[],...E]}#T;#L=m.C.bind(this,"change");constructor(){super(),this.#T=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#T&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#T)return this.#T;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#T=v(t)||v(e),this.#T}set inputElement(t){this.#T=t}getValidity(){return this.inputElement?.validity||{}}#V(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#V(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},setTimeout((()=>{this.baseElement?.addEventListener(e,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#V()})),this.baseElement.addEventListener("change",(()=>{this.#L()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#V()})),t.forEach((t=>{var e,s;e=this.inputElement,s=t,Object.defineProperty(this,s,{set(t){e[s]=t},get:()=>e[s],configurable:!0})})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,r.oP)(this,this.inputElement,{includeAttrs:["inputmode"]})}))}},f=t=>(0,n.qC)(y(t),u({componentNameOverride:(0,r.iY)("input-wrapper")}));var A=s(357),S=s(2666);const C=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},M=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const c=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=u({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[c]:h((0,n.E3)(l.componentName,"_"+c),s)}}#k;constructor(){const t=C((async t=>{const s=t.shadowRoot.querySelector(t.baseSelector);return e?(await C((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+c,themeSection:i.qM+c,baseSelector:":host"}),this.#k=t(this).then((t=>t.host))}async#$(){const t=await this.#k;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#k;(0,r.oP)(this,t,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#$()}}},w=t=>class extends t{#L=m.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#L(),this.prevValue=this.value)}))}};var x=s(8084);const T=t=>class extends t{init(){this.#N(),super.init?.()}#N(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,m.C.call(this,"blur"),m.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(m.C.call(this,"focus"),m.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>r});var i=s(4567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing"],r=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.warn(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9214],{9214:(e,t,s)=>{s.d(t,{D:()=>o});var n=s(3878),i=s(4567),r=s(7878);const o=e=>{class t extends((0,n.P)({componentName:e,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n <style>\n slot {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n }\n </style>\n <slot part="wrapper"></slot>\n '}dispatchChange=r.C.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(e){console.warn("set value","is not implemented")}onSizeChange(){this.items.forEach((e=>{e.setAttribute("size",this.size)}))}onReadOnlyChange(){this.querySelector("slot").toggleAttribute("inert",this.isReadonly)}getValidity(){console.warn("getValidity","is not implemented")}onObservedAttributeChange(e){e.forEach((e=>{switch(e){case"size":this.onSizeChange();break;case"readonly":this.onReadOnlyChange()}}))}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.items[0]?.focus()})),super.init?.(),(0,i.FX)(this,this.onObservedAttributeChange.bind(this),{includeAttrs:["size","readonly"]})}}return t}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9434],{9434:(t,e,n)=>{n.d(e,{Mc:()=>h,W2:()=>c,Xm:()=>i});var r=n(4567),a=n(4201);const i=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.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,r.P$)(this,(({addedNodes:t})=>{t.forEach((t=>{t.setAttribute("size",this.size)}))}))}},{host:s,label:o,requiredIndicator:d,internalWrapper:l,errorMessage:p}={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:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontFamily:s,labelTextColor:[{...o,property:"color"},{...d,property:"color"}],labelRequiredIndicator:{...d,property:"content"},errorMessageTextColor:{...p,property:"color"},itemsSpacing:{...l,property:"gap"}},h=`\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,a.DY)()}\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\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,a.Wf)("vaadin-text-field")}\n\t\t\t${(0,a.Pd)("vaadin-text-field")}\n `}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[5263],{3795:(e,t,n)=>{n.r(t),n.d(t,{ButtonMultiSelectionGroupClass:()=>p});var s=n(1e3),i=n(8292),o=n(2061),l=n(4567),a=n(9434);const c=(0,l.iY)("button-multi-selection-group"),p=(0,o.qC)((0,s.yk)({mappings:{...a.W2}}),s.e4,(0,s.dj)({proxyProps:["value","selectionStart"]}),s.Ae,a.Xm,(e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n <${i.G}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${i.G}>\n `,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.G),(0,l.oP)(this,this.inputElement,{includeAttrs:["size","default-values","min-items-selection","max-items-selection"]})}}))((0,s.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>a.Mc,excludeAttrsSync:["tabindex"],componentName:c}));n(6793),n(4873),customElements.define(c,p)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9122],{8292:(e,t,s)=>{s.d(t,{G:()=>a,f:()=>l});var i=s(4567),r=s(9214);const a=(0,i.iY)("button-multi-selection-group-internal");class l extends((0,r.D)(a)){#e(){return this.items.filter((e=>e.hasAttribute("selected")))}onClick(e){e.target!==e.currentTarget&&(this.#e().includes(e.target)?e.target.removeAttribute("selected"):e.target.setAttribute("selected","true"),this.dispatchChange())}get value(){return this.#e().map((e=>e.value))}set value(e){this.items.forEach((t=>{e.includes(t.value)&&t.setAttribute("selected","true")}))}get minItemsSelection(){return parseInt(this.getAttribute("min-items-selection"),10)||0}get maxItemsSelection(){return parseInt(this.getAttribute("max-items-selection"),10)||0}#t(e){const t=Array.isArray(e);return t||console.error("default-values must be an array, received:",e),t}get defaultValues(){const e=this.getAttribute("default-values");if(e)try{const t=JSON.parse(e);if(this.#t(t))return t}catch(e){console.error('could not parse data string from attribute "default-values" -',e.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))}}},6793:(e,t,s)=>{s.r(t),s.d(t,{ButtonMultiSelectionGroupInternalClass:()=>i.f});var i=s(8292);customElements.define(i.G,i.f)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[2861],{4887:(e,t,n)=>{n.r(t),n.d(t,{ButtonSelectionGroupClass:()=>p});var s=n(1e3),o=n(8284),l=n(2061),i=n(4567),a=n(9434);const c=(0,i.iY)("button-selection-group"),p=(0,l.qC)((0,s.yk)({mappings:{...a.W2}}),s.e4,(0,s.dj)({proxyProps:["value","selectionStart"]}),s.Ae,a.Xm,(e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n <${o.f}\n \tname="button-selection-group"\n \tslot="input"\n tabindex="-1"\n part="internal-component"\n >\n <slot></slot>\n </${o.f}>\n `,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,i.oP)(this,this.inputElement,{includeAttrs:["size","default-value","allow-deselect"]})}}))((0,s.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>a.Mc,excludeAttrsSync:["tabindex"],componentName:c}));n(8901),n(4873),customElements.define(c,p)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[2313],{8284:(e,t,s)=>{s.d(t,{B:()=>a,f:()=>u});var i=s(4567),l=s(9214);const u=(0,i.iY)("button-selection-group-internal");class a extends((0,l.D)(u)){getSelectedNode(){return this.items.find((e=>e.hasAttribute("selected")))}get allowDeselect(){return"true"===this.getAttribute("allow-deselect")}removeSelected(){this.getSelectedNode()?.removeAttribute("selected")}onClick(e){e.target!==e.currentTarget&&(e.target===this.getSelectedNode()&&this.allowDeselect?this.removeSelected():this.setSelected(e.target),this.dispatchChange())}setSelected(e){e!==this.getSelectedNode()&&(this.removeSelected(),e?.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(e){const t=this.items.find((t=>t.value===e));this.setSelected(t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}init(){super.init(),this.setDefaultValue(),this.querySelector("slot").addEventListener("click",this.onClick.bind(this))}}},8901:(e,t,s)=>{s.r(t),s.d(t,{ButtonSelectionGroupInternalClass:()=>i.B});var i=s(8284);customElements.define(i.f,i.B)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[6656],{4873:(t,e,o)=>{o.r(e),o.d(e,{ButtonSelectionGroupItemClass:()=>u});var s=o(1e3),n=o(2561),r=o(2061),i=o(4567),a=o(9690);const c=(0,i.iY)("button-selection-group-item");class l extends((0,n.s)({componentName:c,baseSelector:":host > descope-button"})){get size(){return this.getAttribute("size")||"md"}get variant(){return this.getAttribute("variant")||"contained"}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n\t\t<style>\n descope-button {\n max-width: 100%;\n }\n\t\t\tdescope-button > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\toverflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n max-width: 100%\n\t\t\t}\n\t\t</style>\n <descope-button variant="${this.variant}" size="${this.size}" mode="primary">\n <slot></slot>\n </descope-button>\n\t`,(0,i.oP)(this,this.baseElement,{includeAttrs:["size","variant"]})}handleFocus(){this.shadowRoot.querySelector("descope-button")?.focus()}focus(){this.handleFocus()}init(){super.init(),this.addEventListener("focus",(t=>{t.isTrusted&&this.handleFocus()}))}}const u=(0,r.qC)((0,s.yk)({mappings:{hostDirection:{selector:()=>a.n.componentName,property:a.n.cssVarList.hostDirection},backgroundColor:{selector:()=>a.n.componentName,property:a.n.cssVarList.backgroundColor},labelTextColor:{selector:()=>a.n.componentName,property:a.n.cssVarList.labelTextColor},borderColor:{selector:()=>a.n.componentName,property:a.n.cssVarList.borderColor},borderStyle:{selector:()=>a.n.componentName,property:a.n.cssVarList.borderStyle},borderRadius:{selector:()=>a.n.componentName,property:a.n.cssVarList.borderRadius}}}),s.e4,s.Ae)(l);o(2018),customElements.define(c,u)}}]);
package/dist/umd/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.DescopeUI=o():e.DescopeUI=o()}(self,(()=>(()=>{var e,o,s,n={534:(e,o,s)=>{var n={"./boolean-fields/descope-boolean-field-internal/index.js":[6676,5910,4567,1e3,3878,769],"./boolean-fields/descope-checkbox/index.js":[3483,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,3092,4567,1e3,4201,3878,769,4803,3726],"./boolean-fields/descope-switch-toggle/index.js":[9203,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,3092,4567,1e3,4201,3878,769,4803,4483],"./descope-badge/index.js":[8506,5910,4567,1e3,8012],"./descope-button-selection-group/descope-button-selection-group-internal/index.js":[8460,5910,4567,1e3,3878,1348],"./descope-button-selection-group/descope-button-selection-group-item/index.js":[7901,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,9662,206],"./descope-button-selection-group/index.js":[8086,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,4201,3878,9662,1348,206,6699],"./descope-button/index.js":[2018,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,9662],"./descope-combo-box/index.js":[1294,5910,7531,4226,2066,2269,3660,1037,9558,3208,262,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,9483],"./descope-container/index.js":[7107,5910,4567,1e3,7317],"./descope-date-picker/index.js":[2552,5910,7531,4226,2066,2269,3660,1037,9558,3208,1224,9320,9189,6091,9211,5345,9092,4567,1e3,8017],"./descope-divider/index.js":[6162,5910,4567,1e3,2528,4178],"./descope-email-field/index.js":[1272,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9437,4567,1e3,4201,4447,9760],"./descope-grid/descope-grid-custom-column/index.js":[9278,7531,2066,262,4905,5517,322,4567,7044,5988],"./descope-grid/descope-grid-selection-column/index.js":[2238,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,1224,9789,4905,5517,3092,8623,4567,1e3,4201,3878,769,4803,3726,7487],"./descope-grid/descope-grid-text-column/index.js":[2356,7531,2066,262,4905,5517,322,4567,7044,3705],"./descope-grid/index.js":[9950,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,1224,9789,4905,9189,3003,5517,3092,322,9680,8623,63,4595,4567,1e3,4201,3878,769,9461],"./descope-image/index.js":[8278,5910,4567,1e3,6772],"./descope-link/index.js":[5846,5910,4567,1e3,2528,58],"./descope-loader-linear/index.js":[7845,5910,4567,1e3,6453],"./descope-loader-radial/index.js":[5747,5910,4567,1e3,3072],"./descope-logo/index.js":[1034,5910,4567,1e3,3585,1984],"./descope-modal/index.js":[958,5910,7531,4226,2269,1037,262,9320,9189,6091,6687,1940,4567,1e3,4641],"./descope-multi-select-combo-box/index.js":[9393,5910,7531,4226,2066,2269,3660,1037,9558,3208,262,9320,4905,9189,6091,3003,5345,8866,9680,6687,63,1438,4567,1e3,4201,3840],"./descope-new-password/descope-new-password-internal/index.js":[1545,5910,4567,1e3,4201,3878,2481,1842],"./descope-new-password/index.js":[8974,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,9211,7056,4567,1e3,4201,3878,4447,2934,2481,1842,8106,7055],"./descope-notification/descope-notification-card/index.js":[5400,5910,7531,4226,1037,262,9320,6542,4567,1e3,7401],"./descope-notification/index.js":[1845,5910,7531,4226,1037,262,9320,6542,4567,1e3,7401,9655],"./descope-number-field/index.js":[6916,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,5806,4567,1e3,4201,4447,2142],"./descope-passcode/descope-passcode-internal/index.js":[4775,5910,4567,1e3,3878,1841],"./descope-passcode/index.js":[4919,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9789,4567,1e3,4201,3878,4447,2934,1841,3072,939],"./descope-password/index.js":[9279,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9211,7056,4567,1e3,4201,2481,8106],"./descope-recaptcha/index.js":[8164,5910,4567,1e3,964],"./descope-text-area/index.js":[1962,5910,7531,4226,2066,2269,3660,1037,9558,422,9680,6770,4567,1e3,4201,3322],"./descope-text-field/index.js":[9357,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9789,4567,1e3,4201,4447,2934],"./descope-text/index.js":[1876,5910,4567,1e3,2528],"./descope-totp-image/index.js":[1331,5910,4567,1e3,3585,5364],"./descope-upload-file/index.js":[6667,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,3878,9662,5874],"./phone-fields/descope-phone-field/descope-phone-field-internal/index.js":[9240,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,9789,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,3878,4447,2934,7262,9483,9288],"./phone-fields/descope-phone-field/index.js":[6581,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,9789,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,3878,4447,2934,7262,9483,9806],"./phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js":[3067,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9789,4567,1e3,4201,3878,4447,2934,7262,4981],"./phone-fields/descope-phone-input-box-field/index.js":[9423,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,9789,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,3878,4447,2934,7262,9483,5119]};function d(e){if(!s.o(n,e))return Promise.resolve().then((()=>{var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}));var o=n[e],d=o[0];return Promise.all(o.slice(1).map(s.e)).then((()=>s(d)))}d.keys=()=>Object.keys(n),d.id=534,e.exports=d},5561:(e,o,s)=>{"use strict";s.r(o),s.d(o,{componentsThemeManager:()=>n});const n=new class{static mountOnPropName="DescopeThemeManager";#e={};#o="light";#s=new Set;#n(){this.#s.forEach((e=>e?.()))}get currentThemeName(){return this.#o}set currentThemeName(e){this.#o=e,this.#n()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#s.add(e),()=>{this.#s.delete(e)}}set themes(e){this.#e=e,this.#n()}}},7507:(e,o,s)=>{const{componentsThemeManager:n}=s(5561),d=s(534);e.exports=d.keys().reduce(((e,o)=>{const s=o.replace(/.*?([^\/]+)\/index\.js$/,"$1");return s.endsWith("-internal")||(e[s]=()=>d(o)),e}),{}),e.exports.componentsThemeManager=n}},d={};function i(e){var o=d[e];if(void 0!==o)return o.exports;var s=d[e]={exports:{}};return n[e](s,s.exports,i),s.exports}i.m=n,e=[],i.O=(o,s,n,d)=>{if(!s){var t=1/0;for(a=0;a<e.length;a++){for(var[s,n,d]=e[a],c=!0,r=0;r<s.length;r++)(!1&d||t>=d)&&Object.keys(i.O).every((e=>i.O[e](s[r])))?s.splice(r--,1):(c=!1,d<t&&(t=d));if(c){e.splice(a--,1);var p=n();void 0!==p&&(o=p)}}return o}d=d||0;for(var a=e.length;a>0&&e[a-1][2]>d;a--)e[a]=e[a-1];e[a]=[s,n,d]},i.F={},i.E=e=>{Object.keys(i.F).map((o=>{i.F[o](e)}))},i.d=(e,o)=>{for(var s in o)i.o(o,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((o,s)=>(i.f[s](e,o),o)),[])),i.u=e=>(({58:"descope-link-index-js",206:"descope-button-selection-group-descope-button-selection-group-item-index-js",769:"boolean-fields-descope-boolean-field-internal-index-js",939:"descope-passcode-index-js",964:"descope-recaptcha-index-js",1348:"descope-button-selection-group-descope-button-selection-group-internal-index-js",1841:"descope-passcode-descope-passcode-internal-index-js",1842:"descope-new-password-descope-new-password-internal-index-js",1984:"descope-logo-index-js",2142:"descope-number-field-index-js",2528:"descope-text-index-js",2934:"descope-text-field-index-js",3072:"descope-loader-radial-index-js",3322:"descope-text-area-index-js",3705:"descope-grid-descope-grid-text-column-index-js",3726:"boolean-fields-descope-checkbox-index-js",3840:"descope-multi-select-combo-box-index-js",4178:"descope-divider-index-js",4483:"boolean-fields-descope-switch-toggle-index-js",4641:"descope-modal-index-js",4981:"phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js",5119:"phone-fields-descope-phone-input-box-field-index-js",5364:"descope-totp-image-index-js",5874:"descope-upload-file-index-js",5988:"descope-grid-descope-grid-custom-column-index-js",6453:"descope-loader-linear-index-js",6699:"descope-button-selection-group-index-js",6772:"descope-image-index-js",7055:"descope-new-password-index-js",7317:"descope-container-index-js",7401:"descope-notification-descope-notification-card-index-js",7487:"descope-grid-descope-grid-selection-column-index-js",8012:"descope-badge-index-js",8017:"descope-date-picker-index-js",8106:"descope-password-index-js",9288:"phone-fields-descope-phone-field-descope-phone-field-internal-index-js",9461:"descope-grid-index-js",9483:"descope-combo-box-index-js",9655:"descope-notification-index-js",9662:"descope-button-index-js",9760:"descope-email-field-index-js",9806:"phone-fields-descope-phone-field-index-js"}[e]||e)+".js"),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),o={},s="DescopeUI:",i.l=(e,n,d,t)=>{if(o[e])o[e].push(n);else{var c,r;if(void 0!==d)for(var p=document.getElementsByTagName("script"),a=0;a<p.length;a++){var l=p[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==s+d){c=l;break}}c||(r=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,i.nc&&c.setAttribute("nonce",i.nc),c.setAttribute("data-webpack",s+d),c.src=e),o[e]=[n];var u=(s,n)=>{c.onerror=c.onload=null,clearTimeout(x);var d=o[e];if(delete o[e],c.parentNode&&c.parentNode.removeChild(c),d&&d.forEach((e=>e(n))),s)return s(n)},x=setTimeout(u.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=u.bind(null,c.onerror),c.onload=u.bind(null,c.onload),r&&document.head.appendChild(c)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var o=i.g.document;if(!e&&o&&(o.currentScript&&(e=o.currentScript.src),!e)){var s=o.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&!e;)e=s[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={4826:0};i.f.j=(o,s)=>{var n=i.o(e,o)?e[o]:void 0;if(0!==n)if(n)s.push(n[2]);else{var d=new Promise(((s,d)=>n=e[o]=[s,d]));s.push(n[2]=d);var t=i.p+i.u(o),c=new Error;i.l(t,(s=>{if(i.o(e,o)&&(0!==(n=e[o])&&(e[o]=void 0),n)){var d=s&&("load"===s.type?"missing":s.type),t=s&&s.target&&s.target.src;c.message="Loading chunk "+o+" failed.\n("+d+": "+t+")",c.name="ChunkLoadError",c.type=d,c.request=t,n[1](c)}}),"chunk-"+o,o)}},i.F.j=o=>{if(!i.o(e,o)||void 0===e[o]){e[o]=null;var s=document.createElement("link");i.nc&&s.setAttribute("nonce",i.nc),s.rel="prefetch",s.as="script",s.href=i.p+i.u(o),document.head.appendChild(s)}},i.O.j=o=>0===e[o];var o=(o,s)=>{var n,d,[t,c,r]=s,p=0;if(t.some((o=>0!==e[o]))){for(n in c)i.o(c,n)&&(i.m[n]=c[n]);if(r)var a=r(i)}for(o&&o(s);p<t.length;p++)d=t[p],i.o(e,d)&&e[d]&&e[d][0](),e[d]=0;return i.O(a)},s=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];s.forEach(o.bind(null,0)),s.push=o.bind(null,s.push.bind(s))})(),i.O(0,[4826],(()=>{[5910,4567,1e3,3878,769,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,3092,4201,4803,3726,4483,8012,1348,9211,1721,9662,206,6699,262,9320,4905,9189,6091,3003,5345,8866,7583,9483,7317,9092,8017,2528,4178,9437,4447,9760,5517,322,7044,5988,8623,7487,3705,9680,63,4595,9461,6772,58,6453,3072,3585,1984,6687,1940,4641,1438,3840,2481,1842,7056,2934,8106,7055,6542,7401,9655,5806,2142,1841,939,964,6770,3322,5364,5874,7262,9288,9806,4981,5119].map(i.E)}),5);var t=i(7507);return i.O(t)})()));
1
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.DescopeUI=o():e.DescopeUI=o()}(self,(()=>(()=>{var e,o,s,n={534:(e,o,s)=>{var n={"./boolean-fields/descope-boolean-field-internal/index.js":[6676,5910,4567,1e3,3878,769],"./boolean-fields/descope-checkbox/index.js":[3483,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,3092,4567,1e3,4201,3878,769,4803,3726],"./boolean-fields/descope-switch-toggle/index.js":[9203,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,3092,4567,1e3,4201,3878,769,4803,4483],"./button-selection-group-fields/descope-button-multi-selection-group-internal/index.js":[6793,5910,4567,1e3,3878,9214,9122],"./button-selection-group-fields/descope-button-multi-selection-group/index.js":[3795,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,4201,3878,9662,9214,6656,9434,9122,5263],"./button-selection-group-fields/descope-button-selection-group-internal/index.js":[8901,5910,4567,1e3,3878,9214,2313],"./button-selection-group-fields/descope-button-selection-group-item/index.js":[4873,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,9662,6656],"./button-selection-group-fields/descope-button-selection-group/index.js":[4887,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,4201,3878,9662,9214,6656,9434,2313,2861],"./descope-badge/index.js":[8506,5910,4567,1e3,8012],"./descope-button/index.js":[2018,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,9662],"./descope-combo-box/index.js":[1294,5910,7531,4226,2066,2269,3660,1037,9558,3208,262,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,9483],"./descope-container/index.js":[7107,5910,4567,1e3,7317],"./descope-date-picker/index.js":[2552,5910,7531,4226,2066,2269,3660,1037,9558,3208,1224,9320,9211,9189,6091,5345,9092,4567,1e3,8017],"./descope-divider/index.js":[6162,5910,4567,1e3,2528,4178],"./descope-email-field/index.js":[1272,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9437,4567,1e3,4201,4447,9760],"./descope-grid/descope-grid-custom-column/index.js":[9278,7531,2066,262,4905,5517,322,4567,7044,5988],"./descope-grid/descope-grid-selection-column/index.js":[2238,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,262,9789,4905,5517,3092,8623,4567,1e3,4201,3878,769,4803,3726,7487],"./descope-grid/descope-grid-text-column/index.js":[2356,7531,2066,262,4905,5517,322,4567,7044,3705],"./descope-grid/index.js":[9950,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,262,9789,4905,9189,3003,5517,3092,322,9680,8623,63,4595,4567,1e3,4201,3878,769,9461],"./descope-image/index.js":[8278,5910,4567,1e3,6772],"./descope-link/index.js":[5846,5910,4567,1e3,2528,58],"./descope-loader-linear/index.js":[7845,5910,4567,1e3,6453],"./descope-loader-radial/index.js":[5747,5910,4567,1e3,3072],"./descope-logo/index.js":[1034,5910,4567,1e3,3585,1984],"./descope-modal/index.js":[958,5910,7531,4226,2269,1037,262,9320,9189,6091,6687,1940,4567,1e3,4641],"./descope-multi-select-combo-box/index.js":[9393,5910,7531,4226,2066,2269,3660,1037,9558,3208,262,9320,4905,9189,6091,3003,5345,8866,9680,6687,63,1438,4567,1e3,4201,3840],"./descope-new-password/descope-new-password-internal/index.js":[1545,5910,4567,1e3,4201,3878,2481,1842],"./descope-new-password/index.js":[8974,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,9211,7056,4567,1e3,4201,3878,4447,2934,2481,1842,8106,7055],"./descope-notification/descope-notification-card/index.js":[5400,5910,7531,4226,1037,262,9320,6542,4567,1e3,7401],"./descope-notification/index.js":[1845,5910,7531,4226,1037,262,9320,6542,4567,1e3,7401,9655],"./descope-number-field/index.js":[6916,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,5806,4567,1e3,4201,4447,2142],"./descope-passcode/descope-passcode-internal/index.js":[4775,5910,4567,1e3,3878,1841],"./descope-passcode/index.js":[4919,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9789,4567,1e3,4201,3878,4447,2934,1841,3072,939],"./descope-password/index.js":[9279,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9211,7056,4567,1e3,4201,2481,8106],"./descope-recaptcha/index.js":[8164,5910,4567,1e3,964],"./descope-text-area/index.js":[1962,5910,7531,4226,2066,2269,3660,1037,9558,422,9680,6770,4567,1e3,4201,3322],"./descope-text-field/index.js":[9357,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9789,4567,1e3,4201,4447,2934],"./descope-text/index.js":[1876,5910,4567,1e3,2528],"./descope-totp-image/index.js":[1331,5910,4567,1e3,3585,5364],"./descope-upload-file/index.js":[6667,5910,7531,4226,2066,2269,3660,1224,9211,1721,4567,1e3,3878,9662,5874],"./phone-fields/descope-phone-field/descope-phone-field-internal/index.js":[9240,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,9789,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,3878,4447,2934,7262,9483,9288],"./phone-fields/descope-phone-field/index.js":[6581,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,9789,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,3878,4447,2934,7262,9483,9806],"./phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js":[3067,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,9789,4567,1e3,4201,3878,4447,2934,7262,4981],"./phone-fields/descope-phone-input-box-field/index.js":[9423,5910,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,262,9789,9320,4905,9189,6091,3003,5345,8866,7583,4567,1e3,4201,3878,4447,2934,7262,9483,5119]};function i(e){if(!s.o(n,e))return Promise.resolve().then((()=>{var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}));var o=n[e],i=o[0];return Promise.all(o.slice(1).map(s.e)).then((()=>s(i)))}i.keys=()=>Object.keys(n),i.id=534,e.exports=i},5561:(e,o,s)=>{"use strict";s.r(o),s.d(o,{componentsThemeManager:()=>n});const n=new class{static mountOnPropName="DescopeThemeManager";#e={};#o="light";#s=new Set;#n(){this.#s.forEach((e=>e?.()))}get currentThemeName(){return this.#o}set currentThemeName(e){this.#o=e,this.#n()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#s.add(e),()=>{this.#s.delete(e)}}set themes(e){this.#e=e,this.#n()}}},7507:(e,o,s)=>{const{componentsThemeManager:n}=s(5561),i=s(534);e.exports=i.keys().reduce(((e,o)=>{const s=o.replace(/.*?([^\/]+)\/index\.js$/,"$1");return s.endsWith("-internal")||(e[s]=()=>i(o)),e}),{}),e.exports.componentsThemeManager=n}},i={};function d(e){var o=i[e];if(void 0!==o)return o.exports;var s=i[e]={exports:{}};return n[e](s,s.exports,d),s.exports}d.m=n,e=[],d.O=(o,s,n,i)=>{if(!s){var t=1/0;for(l=0;l<e.length;l++){for(var[s,n,i]=e[l],r=!0,c=0;c<s.length;c++)(!1&i||t>=i)&&Object.keys(d.O).every((e=>d.O[e](s[c])))?s.splice(c--,1):(r=!1,i<t&&(t=i));if(r){e.splice(l--,1);var p=n();void 0!==p&&(o=p)}}return o}i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[s,n,i]},d.F={},d.E=e=>{Object.keys(d.F).map((o=>{d.F[o](e)}))},d.d=(e,o)=>{for(var s in o)d.o(o,s)&&!d.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((o,s)=>(d.f[s](e,o),o)),[])),d.u=e=>(({58:"descope-link-index-js",769:"boolean-fields-descope-boolean-field-internal-index-js",939:"descope-passcode-index-js",964:"descope-recaptcha-index-js",1841:"descope-passcode-descope-passcode-internal-index-js",1842:"descope-new-password-descope-new-password-internal-index-js",1984:"descope-logo-index-js",2142:"descope-number-field-index-js",2313:"button-selection-group-fields-descope-button-selection-group-internal-index-js",2528:"descope-text-index-js",2861:"button-selection-group-fields-descope-button-selection-group-index-js",2934:"descope-text-field-index-js",3072:"descope-loader-radial-index-js",3322:"descope-text-area-index-js",3705:"descope-grid-descope-grid-text-column-index-js",3726:"boolean-fields-descope-checkbox-index-js",3840:"descope-multi-select-combo-box-index-js",4178:"descope-divider-index-js",4483:"boolean-fields-descope-switch-toggle-index-js",4641:"descope-modal-index-js",4981:"phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js",5119:"phone-fields-descope-phone-input-box-field-index-js",5263:"button-selection-group-fields-descope-button-multi-selection-group-index-js",5364:"descope-totp-image-index-js",5874:"descope-upload-file-index-js",5988:"descope-grid-descope-grid-custom-column-index-js",6453:"descope-loader-linear-index-js",6656:"button-selection-group-fields-descope-button-selection-group-item-index-js",6772:"descope-image-index-js",7055:"descope-new-password-index-js",7317:"descope-container-index-js",7401:"descope-notification-descope-notification-card-index-js",7487:"descope-grid-descope-grid-selection-column-index-js",8012:"descope-badge-index-js",8017:"descope-date-picker-index-js",8106:"descope-password-index-js",9122:"button-selection-group-fields-descope-button-multi-selection-group-internal-index-js",9288:"phone-fields-descope-phone-field-descope-phone-field-internal-index-js",9461:"descope-grid-index-js",9483:"descope-combo-box-index-js",9655:"descope-notification-index-js",9662:"descope-button-index-js",9760:"descope-email-field-index-js",9806:"phone-fields-descope-phone-field-index-js"}[e]||e)+".js"),d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),o={},s="DescopeUI:",d.l=(e,n,i,t)=>{if(o[e])o[e].push(n);else{var r,c;if(void 0!==i)for(var p=document.getElementsByTagName("script"),l=0;l<p.length;l++){var a=p[l];if(a.getAttribute("src")==e||a.getAttribute("data-webpack")==s+i){r=a;break}}r||(c=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,d.nc&&r.setAttribute("nonce",d.nc),r.setAttribute("data-webpack",s+i),r.src=e),o[e]=[n];var u=(s,n)=>{r.onerror=r.onload=null,clearTimeout(x);var i=o[e];if(delete o[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((e=>e(n))),s)return s(n)},x=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),c&&document.head.appendChild(r)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;d.g.importScripts&&(e=d.g.location+"");var o=d.g.document;if(!e&&o&&(o.currentScript&&(e=o.currentScript.src),!e)){var s=o.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&!e;)e=s[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),d.p=e})(),(()=>{var e={4826:0};d.f.j=(o,s)=>{var n=d.o(e,o)?e[o]:void 0;if(0!==n)if(n)s.push(n[2]);else{var i=new Promise(((s,i)=>n=e[o]=[s,i]));s.push(n[2]=i);var t=d.p+d.u(o),r=new Error;d.l(t,(s=>{if(d.o(e,o)&&(0!==(n=e[o])&&(e[o]=void 0),n)){var i=s&&("load"===s.type?"missing":s.type),t=s&&s.target&&s.target.src;r.message="Loading chunk "+o+" failed.\n("+i+": "+t+")",r.name="ChunkLoadError",r.type=i,r.request=t,n[1](r)}}),"chunk-"+o,o)}},d.F.j=o=>{if(!d.o(e,o)||void 0===e[o]){e[o]=null;var s=document.createElement("link");d.nc&&s.setAttribute("nonce",d.nc),s.rel="prefetch",s.as="script",s.href=d.p+d.u(o),document.head.appendChild(s)}},d.O.j=o=>0===e[o];var o=(o,s)=>{var n,i,[t,r,c]=s,p=0;if(t.some((o=>0!==e[o]))){for(n in r)d.o(r,n)&&(d.m[n]=r[n]);if(c)var l=c(d)}for(o&&o(s);p<t.length;p++)i=t[p],d.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return d.O(l)},s=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];s.forEach(o.bind(null,0)),s.push=o.bind(null,s.push.bind(s))})(),d.O(0,[4826],(()=>{[5910,4567,1e3,3878,769,7531,4226,2066,2269,3660,1037,9558,3208,422,8725,1224,9789,3092,4201,4803,3726,4483,9214,9122,9211,1721,9662,6656,9434,5263,2313,2861,8012,262,9320,4905,9189,6091,3003,5345,8866,7583,9483,7317,9092,8017,2528,4178,9437,4447,9760,5517,322,7044,5988,8623,7487,3705,9680,63,4595,9461,6772,58,6453,3072,3585,1984,6687,1940,4641,1438,3840,2481,1842,7056,2934,8106,7055,6542,7401,9655,5806,2142,1841,939,964,6770,3322,5364,5874,7262,9288,9806,4981,5119].map(d.E)}),5);var t=d(7507);return d.O(t)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.246",
3
+ "version": "1.0.248",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,27 +1,11 @@
1
- import {
2
- createStyleMixin,
3
- draggableMixin,
4
- createProxy,
5
- proxyInputMixin,
6
- componentNameValidationMixin,
7
- } from '../../mixins';
8
- import { componentName as descopeInternalComponentName } from './descope-button-selection-group-internal/ButtonSelectionGroupInternalClass';
9
- import { compose } from '../../helpers';
10
- import {
11
- forwardAttrs,
12
- getComponentName,
13
- observeAttributes,
14
- observeChildren,
15
- } from '../../helpers/componentHelpers';
1
+ import { observeAttributes, observeChildren } from '../../helpers/componentHelpers';
16
2
  import {
17
3
  resetInputLabelPosition,
18
4
  resetInputCursor,
19
5
  resetInputFieldDefaultWidth,
20
6
  } from '../../helpers/themeHelpers/resetHelpers';
21
7
 
22
- export const componentName = getComponentName('button-selection-group');
23
-
24
- const customMixin = (superclass) =>
8
+ export const buttonSelectionGroupBaseMixin = (superclass) =>
25
9
  class ButtonSelectionGroupMixinClass extends superclass {
26
10
  // eslint-disable-next-line class-methods-use-this
27
11
  #renderItem = ({ value, label }) =>
@@ -91,25 +75,6 @@ const customMixin = (superclass) =>
91
75
 
92
76
  init() {
93
77
  super.init?.();
94
- const template = document.createElement('template');
95
-
96
- template.innerHTML = `
97
- <${descopeInternalComponentName}
98
- name="button-selection-group"
99
- slot="input"
100
- tabindex="-1"
101
- >
102
- <slot></slot>
103
- </${descopeInternalComponentName}>
104
- `;
105
-
106
- this.baseElement.appendChild(template.content.cloneNode(true));
107
-
108
- this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
109
-
110
- forwardAttrs(this, this.inputElement, {
111
- includeAttrs: ['size', 'default-value', 'allow-deselect'],
112
- });
113
78
 
114
79
  this.renderItems();
115
80
 
@@ -128,34 +93,24 @@ const { host, label, requiredIndicator, internalWrapper, errorMessage } = {
128
93
  host: { selector: () => ':host' },
129
94
  label: { selector: '::part(label)' },
130
95
  requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
131
- internalWrapper: { selector: 'descope-button-selection-group-internal slot' },
96
+ internalWrapper: { selector: () => ':host [part="internal-component"] slot' },
132
97
  errorMessage: { selector: '::part(error-message)' },
133
98
  };
134
99
 
135
- export const ButtonSelectionGroupClass = compose(
136
- createStyleMixin({
137
- mappings: {
138
- hostWidth: { ...host, property: 'width' },
139
- hostDirection: { ...host, property: 'direction' },
140
- fontFamily: host,
141
- labelTextColor: [
142
- { ...label, property: 'color' },
143
- { ...requiredIndicator, property: 'color' },
144
- ],
145
- labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
146
- errorMessageTextColor: { ...errorMessage, property: 'color' },
147
- itemsSpacing: { ...internalWrapper, property: 'gap' },
148
- },
149
- }),
150
- draggableMixin,
151
- proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
152
- componentNameValidationMixin,
153
- customMixin
154
- )(
155
- createProxy({
156
- slots: [],
157
- wrappedEleName: 'vaadin-text-field',
158
- style: () => `
100
+ export const buttonSelectionGroupMappings = {
101
+ hostWidth: { ...host, property: 'width' },
102
+ hostDirection: { ...host, property: 'direction' },
103
+ fontFamily: host,
104
+ labelTextColor: [
105
+ { ...label, property: 'color' },
106
+ { ...requiredIndicator, property: 'color' },
107
+ ],
108
+ labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
109
+ errorMessageTextColor: { ...errorMessage, property: 'color' },
110
+ itemsSpacing: { ...internalWrapper, property: 'gap' },
111
+ };
112
+
113
+ export const buttonSelectionGroupStyles = `
159
114
  :host {
160
115
  display: inline-flex;
161
116
  max-width: 100%;
@@ -168,7 +123,7 @@ export const ButtonSelectionGroupClass = compose(
168
123
  background-color: transparent;
169
124
  }
170
125
 
171
- descope-button-selection-group-internal {
126
+ [part="internal-component"] {
172
127
  -webkit-mask-image: none;
173
128
  padding: 0;
174
129
  width: 100%;
@@ -208,10 +163,4 @@ export const ButtonSelectionGroupClass = compose(
208
163
 
209
164
  ${resetInputLabelPosition('vaadin-text-field')}
210
165
  ${resetInputCursor('vaadin-text-field')}
211
- `,
212
- excludeAttrsSync: ['tabindex'],
213
- componentName,
214
- })
215
- );
216
-
217
- export default ButtonSelectionGroupClass;
166
+ `;
@@ -0,0 +1,101 @@
1
+ import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';
2
+ import { observeAttributes } from '../../helpers/componentHelpers';
3
+ import { createDispatchEvent } from '../../helpers/mixinsHelpers';
4
+
5
+ export const createBaseButtonSelectionGroupInternalClass = (componentName) => {
6
+ class BaseButtonSelectionGroupInternalClass extends createBaseInputClass({
7
+ componentName,
8
+ baseSelector: 'slot',
9
+ }) {
10
+ constructor() {
11
+ super();
12
+
13
+ this.innerHTML = `
14
+ <style>
15
+ slot {
16
+ box-sizing: border-box;
17
+ width: 100%;
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ }
21
+ </style>
22
+ <slot part="wrapper"></slot>
23
+ `;
24
+ }
25
+
26
+ dispatchChange = createDispatchEvent.bind(this, 'change');
27
+
28
+ get items() {
29
+ return this.querySelector('slot').assignedElements();
30
+ }
31
+
32
+ get isReadonly() {
33
+ return this.getAttribute('readonly') === 'true';
34
+ }
35
+
36
+ get size() {
37
+ return this.getAttribute('size') || 'md';
38
+ }
39
+
40
+ // eslint-disable-next-line getter-return, class-methods-use-this
41
+ get value() {
42
+ // eslint-disable-next-line no-console
43
+ console.warn('get value', 'is not implemented');
44
+ }
45
+
46
+ // eslint-disable-next-line class-methods-use-this
47
+ set value(value) {
48
+ // eslint-disable-next-line no-console
49
+ console.warn('set value', 'is not implemented');
50
+ }
51
+
52
+ onSizeChange() {
53
+ this.items.forEach((item) => {
54
+ item.setAttribute('size', this.size);
55
+ });
56
+ }
57
+
58
+ onReadOnlyChange() {
59
+ this.querySelector('slot').toggleAttribute('inert', this.isReadonly);
60
+ }
61
+
62
+ // eslint-disable-next-line class-methods-use-this
63
+ getValidity() {
64
+ // eslint-disable-next-line no-console
65
+ console.warn('getValidity', 'is not implemented');
66
+ }
67
+
68
+ onObservedAttributeChange(attrs) {
69
+ attrs.forEach((attr) => {
70
+ switch (attr) {
71
+ case 'size':
72
+ this.onSizeChange();
73
+ break;
74
+ case 'readonly':
75
+ this.onReadOnlyChange();
76
+ break;
77
+ default:
78
+ break;
79
+ }
80
+ });
81
+ }
82
+
83
+ init() {
84
+ // we are adding listeners before calling to super because it's stopping the events
85
+ this.addEventListener('focus', (e) => {
86
+ // we want to ignore focus events we are dispatching
87
+ if (e.isTrusted) {
88
+ this.items[0]?.focus();
89
+ }
90
+ });
91
+
92
+ super.init?.();
93
+
94
+ observeAttributes(this, this.onObservedAttributeChange.bind(this), {
95
+ includeAttrs: ['size', 'readonly'],
96
+ });
97
+ }
98
+ }
99
+
100
+ return BaseButtonSelectionGroupInternalClass;
101
+ };
@@ -0,0 +1,67 @@
1
+ import {
2
+ createStyleMixin,
3
+ draggableMixin,
4
+ createProxy,
5
+ proxyInputMixin,
6
+ componentNameValidationMixin,
7
+ } from '../../../mixins';
8
+ import { componentName as descopeInternalComponentName } from '../descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass';
9
+ import { compose } from '../../../helpers';
10
+ import { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';
11
+ import {
12
+ buttonSelectionGroupBaseMixin,
13
+ buttonSelectionGroupMappings,
14
+ buttonSelectionGroupStyles,
15
+ } from '../baseButtonSelectionGroup';
16
+
17
+ export const componentName = getComponentName('button-multi-selection-group');
18
+
19
+ const buttonMultiSelectionGroupMixin = (superclass) =>
20
+ class ButtonMultiSelectionGroupMixinClass extends superclass {
21
+ init() {
22
+ super.init?.();
23
+ const template = document.createElement('template');
24
+
25
+ template.innerHTML = `
26
+ <${descopeInternalComponentName}
27
+ name="button-selection-group"
28
+ slot="input"
29
+ tabindex="-1"
30
+ part="internal-component"
31
+ >
32
+ <slot></slot>
33
+ </${descopeInternalComponentName}>
34
+ `;
35
+
36
+ this.baseElement.appendChild(template.content.cloneNode(true));
37
+
38
+ this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
39
+
40
+ forwardAttrs(this, this.inputElement, {
41
+ includeAttrs: ['size', 'default-values', 'min-items-selection', 'max-items-selection'],
42
+ });
43
+ }
44
+ };
45
+
46
+ export const ButtonMultiSelectionGroupClass = compose(
47
+ createStyleMixin({
48
+ mappings: {
49
+ ...buttonSelectionGroupMappings,
50
+ },
51
+ }),
52
+ draggableMixin,
53
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
54
+ componentNameValidationMixin,
55
+ buttonSelectionGroupBaseMixin,
56
+ buttonMultiSelectionGroupMixin
57
+ )(
58
+ createProxy({
59
+ slots: [],
60
+ wrappedEleName: 'vaadin-text-field',
61
+ style: () => buttonSelectionGroupStyles,
62
+ excludeAttrsSync: ['tabindex'],
63
+ componentName,
64
+ })
65
+ );
66
+
67
+ export default ButtonMultiSelectionGroupClass;
@@ -0,0 +1,7 @@
1
+ import { componentName, ButtonMultiSelectionGroupClass } from './ButtonMultiSelectionGroupClass';
2
+ import '../descope-button-multi-selection-group-internal';
3
+ import '../descope-button-selection-group-item';
4
+
5
+ customElements.define(componentName, ButtonMultiSelectionGroupClass);
6
+
7
+ export { ButtonMultiSelectionGroupClass };
@@ -0,0 +1,106 @@
1
+ import { getComponentName } from '../../../helpers/componentHelpers';
2
+ import { createBaseButtonSelectionGroupInternalClass } from '../createBaseButtonSelectionGroupInternalClass';
3
+
4
+ export const componentName = getComponentName('button-multi-selection-group-internal');
5
+
6
+ export class ButtonMultiSelectionGroupInternalClass extends createBaseButtonSelectionGroupInternalClass(
7
+ componentName
8
+ ) {
9
+ #getSelectedNodes() {
10
+ return this.items.filter((item) => item.hasAttribute('selected'));
11
+ }
12
+
13
+ onClick(e) {
14
+ if (e.target !== e.currentTarget) {
15
+ if (this.#getSelectedNodes().includes(e.target)) {
16
+ e.target.removeAttribute('selected');
17
+ } else {
18
+ e.target.setAttribute('selected', 'true');
19
+ }
20
+ this.dispatchChange();
21
+ }
22
+ }
23
+
24
+ get value() {
25
+ return this.#getSelectedNodes().map((node) => node.value);
26
+ }
27
+
28
+ set value(values) {
29
+ this.items.forEach((item) => {
30
+ if (values.includes(item.value)) {
31
+ item.setAttribute('selected', 'true');
32
+ }
33
+ });
34
+ }
35
+
36
+ get minItemsSelection() {
37
+ return parseInt(this.getAttribute('min-items-selection'), 10) || 0;
38
+ }
39
+
40
+ get maxItemsSelection() {
41
+ return parseInt(this.getAttribute('max-items-selection'), 10) || 0;
42
+ }
43
+
44
+ // eslint-disable-next-line class-methods-use-this
45
+ #isValidDataType(data) {
46
+ const isValid = Array.isArray(data);
47
+ if (!isValid) {
48
+ // eslint-disable-next-line no-console
49
+ console.error('default-values must be an array, received:', data);
50
+ }
51
+
52
+ return isValid;
53
+ }
54
+
55
+ get defaultValues() {
56
+ const defaultValuesAttr = this.getAttribute('default-values');
57
+ if (defaultValuesAttr) {
58
+ try {
59
+ const defaultValues = JSON.parse(defaultValuesAttr);
60
+ if (this.#isValidDataType(defaultValues)) {
61
+ return defaultValues;
62
+ }
63
+ } catch (e) {
64
+ // eslint-disable-next-line no-console
65
+ console.error('could not parse data string from attribute "default-values" -', e.message);
66
+ }
67
+ }
68
+ return [];
69
+ }
70
+
71
+ setDefaultValues() {
72
+ // we want to defer this action until all attributes are synced
73
+ setTimeout(() => {
74
+ if (this.defaultValues) {
75
+ this.value = this.defaultValues;
76
+ this.setCustomValidity();
77
+ }
78
+ });
79
+ }
80
+
81
+ getValidity() {
82
+ if (this.isRequired && !this.value.length) {
83
+ return { valueMissing: true };
84
+ }
85
+ // If the field is not required, no minimum selection can be set
86
+ if (this.isRequired && this.minItemsSelection && this.value.length < this.minItemsSelection) {
87
+ return {
88
+ rangeUnderflow: true,
89
+ };
90
+ }
91
+ if (this.maxItemsSelection && this.value.length > this.maxItemsSelection) {
92
+ return {
93
+ rangeOverflow: true,
94
+ };
95
+ }
96
+ return {};
97
+ }
98
+
99
+ init() {
100
+ super.init();
101
+
102
+ this.setDefaultValues();
103
+
104
+ this.querySelector('slot').addEventListener('click', this.onClick.bind(this));
105
+ }
106
+ }
@@ -0,0 +1,8 @@
1
+ import {
2
+ componentName,
3
+ ButtonMultiSelectionGroupInternalClass,
4
+ } from './ButtonMultiSelectionGroupInternalClass';
5
+
6
+ customElements.define(componentName, ButtonMultiSelectionGroupInternalClass);
7
+
8
+ export { ButtonMultiSelectionGroupInternalClass };