@descope/web-components-ui 1.0.83 → 1.0.85

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/dist/index.esm.js +417 -313
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/umd/18.js +577 -0
  4. package/dist/umd/{233.js.LICENSE.txt → 18.js.LICENSE.txt} +6 -0
  5. package/dist/umd/803.js +1 -0
  6. package/dist/umd/988.js +1 -1
  7. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -0
  8. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -0
  9. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -0
  10. package/dist/umd/descope-combo-box-index-js.js +1 -1
  11. package/dist/umd/descope-container-index-js.js +1 -1
  12. package/dist/umd/index.js +1 -1
  13. package/package.json +1 -1
  14. package/src/components/boolean-fields/booleanFieldMixin.js +38 -0
  15. package/src/components/boolean-fields/commonStyles.js +59 -0
  16. package/src/components/{descope-checkbox/descope-checkbox-internal/CheckboxInternal.js → boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js} +3 -3
  17. package/src/components/boolean-fields/descope-boolean-field-internal/index.js +3 -0
  18. package/src/components/{descope-checkbox → boolean-fields/descope-checkbox}/Checkbox.js +7 -95
  19. package/src/components/{descope-checkbox → boolean-fields/descope-checkbox}/index.js +3 -1
  20. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggle.js +124 -0
  21. package/src/components/boolean-fields/descope-switch-toggle/index.js +8 -0
  22. package/src/components/descope-container/Container.js +2 -1
  23. package/src/index.js +2 -2
  24. package/src/index.umd.js +5 -0
  25. package/src/mixins/proxyInputMixin.js +2 -2
  26. package/src/theme/components/checkbox.js +3 -6
  27. package/src/theme/components/container.js +1 -0
  28. package/src/theme/components/switchToggle.js +71 -4
  29. package/dist/umd/233.js +0 -577
  30. package/dist/umd/786.js +0 -2
  31. package/dist/umd/786.js.LICENSE.txt +0 -17
  32. package/dist/umd/descope-checkbox-descope-checkbox-internal-index-js.js +0 -1
  33. package/dist/umd/descope-checkbox-index-js.js +0 -1
  34. package/dist/umd/descope-switch-toggle-index-js.js +0 -1
  35. package/src/components/descope-checkbox/descope-checkbox-internal/index.js +0 -3
  36. package/src/components/descope-switch-toggle/SwitchToggle.js +0 -89
  37. package/src/components/descope-switch-toggle/index.js +0 -6
package/dist/umd/988.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[988],{693:(t,e,s)=>{s.d(e,{s:()=>o});var i=s(2061),n=s(357);const r=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})}))}};var a=s(8084);const o=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(n.A,r,a.Q)(s)}},5279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>n,qM:()=>a,qg:()=>r});const i="descope",n=3,r="host",a="@"},4567:(t,e,s)=>{s.d(e,{Db:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,tg:()=>l});var i=s(2061),n=s(5279);const r=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const n=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{for(const n of t)"attributes"!==n.type||s.includes(n.attributeName)||i.length&&!i.includes(n.attributeName)||e([n.attributeName])})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{for(const s of t)"childList"===s.type&&e(s)})).observe(t,{childList:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const n=s[i]||i,r=t.getAttribute(i);null!==r?e.getAttribute(n)!==r&&e.setAttribute(n,r):e.removeAttribute(n)}))},l=(t,e,s)=>{r(t,o(t,e),s),r(e,o(e,t),s)},h=t=>(0,i.E3)(n.gh,t),c=(...t)=>`--${(0,i.E3)(...t)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>n,GL:()=>i,mf:()=>a,qC:()=>r});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>i(t.filter((t=>!!t)).join("-")),r=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t},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{#s(){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.#s()}}},4988:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>A.A,DM:()=>p,yk:()=>c,e4:()=>u,mE:()=>T,wX:()=>E,QT:()=>C.Q,Iw:()=>S,dj:()=>f,P4:()=>L});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)})),{}),c=({mappings:t={}})=>e=>class extends e{static get cssVarList(){return{...e.cssVarList,...h(e.componentName,{...t})}}#i;#n;#r;#a;#o;#l;#h;#c;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#a=s,this.#o=r,this.#l=e?.(this)||this.shadowRoot,this.#h=a??this.baseSelector,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#u(){this.#n.innerHTML=this.componentTheme[this.#o]}#d(){this.#n=document.createElement("style"),this.#n.id="style-mixin-theme",this.#l.prepend(this.#n),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#u.bind(this)),this.#u()}#m(){this.#i=document.createElement("style"),this.#i.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#i.innerText=`:host(${t}) {}`,this.#l.append(this.#i)}#p(t,s){const i=this.#i?.sheet?.cssRules[0].style;if(!i)return;const n=(0,r.Tk)(e.componentName,t.replace(new RegExp("^st-"),""));s?i?.setProperty(n,s):i?.removeProperty(n)}#g(t=[]){for(const e of t)this.#c.includes(e)&&this.#p(e,this.getAttribute(e));this.#i.innerHTML=this.#i?.sheet?.cssRules[0].cssText}#E(){const s=document.createElement("style");s.id="style-mixin-mappings",s.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=>Object.assign({},s,t))):[Object.assign({},s,e)]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s})=>{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))}))})),i.toString()})((0,n.E3)(e.componentName,this.#a),this.#h,t),this.#l.prepend(s)}#b(t){(this.#l.classList||this.#l.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#b(e.componentName),this.#E(),this.#d(),this.#m(),(0,r.FX)(this,this.#g.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},u=t=>class extends t{#v=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#v=document.createElement("style"),this.#v.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#v):this.#v.remove()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(693),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})){#f=m.C.bind(this,"blur");#A=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<slot></slot>\n\t\t\t${s.map((t=>`<slot name="${t}" slot="${t}"></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#f()})),this.baseElement.addEventListener("focus",(t=>{this.#A()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h},g=["required","pattern"],E=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#S;constructor(){super(),this.#S=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")}. `}getErrorMessage(t){switch(!0){case t.valueMissing:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case t.patternMismatch||t.typeMismatch:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case t.tooShort:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case t.tooLong:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case t.customError:return this.validationMessage;default:return""}}#M(){const t=this.getValidity();this.#S.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#S.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#S.validity.valid}reportValidity(){return this.#S.reportValidity()}get validity(){return this.#S.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#S.setValidity({customError:!0},t,this.validationTarget):(this.#S.setValidity({}),this.#M())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#S.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#M()}init(){super.init?.(),this.addEventListener("change",this.#M),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#M),setTimeout((()=>this.#M()))}},b=["invalid","required"],v=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},y=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if(e=e.assignedElements()[0],"slot"!==e.localName)return e},f=t=>class extends(E(t)){static get observedAttributes(){return[...t.observedAttributes||[],...b]}#C;#L=m.C.bind(this,"change");constructor(){super(),this.#C=super.inputElement}get inputElement(){const t=this.baseElement.shadowRoot.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot.querySelector('slot[name="textarea"]');if(this.#C??=y(t)||y(e),!this.#C)throw Error("no input was found");return this.#C}set inputElement(t){this.#C=t}getValidity(){return this.inputElement.validity}handleInternalInputErrorMessage(){this.inputElement.checkValidity()||this.inputElement.setCustomValidity(this.validationMessage)}#T(){this.handleInternalInputErrorMessage(),this.setAttribute("error-message",this.validationMessage)}init(){super.init?.(),this.inputElement.addEventListener("input",(t=>{this.inputElement.checkValidity()||(this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.baseElement.__onInput(t),this.#T())})),this.baseElement.addEventListener("change",(()=>{this.#L()})),this.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#T())})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#T()})),this.handleInternalInputErrorMessage(),v(this,this.inputElement,"value"),v(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}};var A=s(357);const S=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=c({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:h((0,n.E3)(l.componentName,"_"+u),s)}}#N;constructor(){const t=t=>{const s=t.shadowRoot.querySelector(t.baseSelector),i=e?s.shadowRoot.querySelector(e):s;return i.shadowRoot||i};var s;super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:i.qM+u,baseSelector:":host"}),this.#N=(s=t(this)).host||s}#x(){this.#N.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#N.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#N,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#x()}}},M=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 C=s(8084);const L=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){["focus","blur"].forEach((t=>{this.addEventListener(t,(t=>{this.isReadOnly&&(t.stopImmediatePropagation(),t.preventDefault())}),!0)})),super.init?.()}},T=t=>class extends t{init(){this.#k(),super.init?.()}#k(){["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:()=>n});var i=s(4567);const n=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t)}))),{})}}}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[988],{693:(t,e,s)=>{s.d(e,{s:()=>o});var i=s(2061),n=s(357);const r=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})}))}};var a=s(8084);const o=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(n.A,r,a.Q)(s)}},5279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>n,qM:()=>a,qg:()=>r});const i="descope",n=3,r="host",a="@"},4567:(t,e,s)=>{s.d(e,{Db:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,tg:()=>l});var i=s(2061),n=s(5279);const r=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const n=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{for(const n of t)"attributes"!==n.type||s.includes(n.attributeName)||i.length&&!i.includes(n.attributeName)||e([n.attributeName])})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{for(const s of t)"childList"===s.type&&e(s)})).observe(t,{childList:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const n=s[i]||i,r=t.getAttribute(i);null!==r?e.getAttribute(n)!==r&&e.setAttribute(n,r):e.removeAttribute(n)}))},l=(t,e,s)=>{r(t,o(t,e),s),r(e,o(e,t),s)},h=t=>(0,i.E3)(n.gh,t),c=(...t)=>`--${(0,i.E3)(...t)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>n,GL:()=>i,mf:()=>a,qC:()=>r});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>i(t.filter((t=>!!t)).join("-")),r=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t},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{#s(){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.#s()}}},4988:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>A.A,DM:()=>p,yk:()=>c,e4:()=>u,mE:()=>T,wX:()=>E,QT:()=>C.Q,Iw:()=>S,dj:()=>f,P4:()=>L});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)})),{}),c=({mappings:t={}})=>e=>class extends e{static get cssVarList(){return{...e.cssVarList,...h(e.componentName,{...t})}}#i;#n;#r;#a;#o;#l;#h;#c;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#a=s,this.#o=r,this.#l=e?.(this)||this.shadowRoot,this.#h=a??this.baseSelector,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#u(){this.#n.innerHTML=this.componentTheme[this.#o]}#d(){this.#n=document.createElement("style"),this.#n.id="style-mixin-theme",this.#l.prepend(this.#n),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#u.bind(this)),this.#u()}#m(){this.#i=document.createElement("style"),this.#i.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#i.innerText=`:host(${t}) {}`,this.#l.append(this.#i)}#p(t,s){const i=this.#i?.sheet?.cssRules[0].style;if(!i)return;const n=(0,r.Tk)(e.componentName,t.replace(new RegExp("^st-"),""));s?i?.setProperty(n,s):i?.removeProperty(n)}#g(t=[]){for(const e of t)this.#c.includes(e)&&this.#p(e,this.getAttribute(e));this.#i.innerHTML=this.#i?.sheet?.cssRules[0].cssText}#E(){const s=document.createElement("style");s.id="style-mixin-mappings",s.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=>Object.assign({},s,t))):[Object.assign({},s,e)]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s})=>{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))}))})),i.toString()})((0,n.E3)(e.componentName,this.#a),this.#h,t),this.#l.prepend(s)}#b(t){(this.#l.classList||this.#l.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#b(e.componentName),this.#E(),this.#d(),this.#m(),(0,r.FX)(this,this.#g.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},u=t=>class extends t{#v=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#v=document.createElement("style"),this.#v.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#v):this.#v.remove()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(693),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})){#f=m.C.bind(this,"blur");#A=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<slot></slot>\n\t\t\t${s.map((t=>`<slot name="${t}" slot="${t}"></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#f()})),this.baseElement.addEventListener("focus",(t=>{this.#A()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h},g=["required","pattern"],E=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#S;constructor(){super(),this.#S=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")}. `}getErrorMessage(t){switch(!0){case t.valueMissing:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case t.patternMismatch||t.typeMismatch:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case t.tooShort:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case t.tooLong:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case t.customError:return this.validationMessage;default:return""}}#M(){const t=this.getValidity();this.#S.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#S.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#S.validity.valid}reportValidity(){return this.#S.reportValidity()}get validity(){return this.#S.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#S.setValidity({customError:!0},t,this.validationTarget):(this.#S.setValidity({}),this.#M())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#S.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#M()}init(){super.init?.(),this.addEventListener("change",this.#M),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#M),setTimeout((()=>this.#M()))}},b=["invalid","required"],v=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},y=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if(e=e.assignedElements()[0],"slot"!==e.localName)return e},f=t=>class extends(E(t)){static get observedAttributes(){return[...t.observedAttributes||[],...b]}#C;#L=m.C.bind(this,"change");constructor(){super(),this.#C=super.inputElement}get inputElement(){const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');if(this.#C??=y(t)||y(e),!this.#C)throw Error("no input was found");return this.#C}set inputElement(t){this.#C=t}getValidity(){return this.inputElement.validity}handleInternalInputErrorMessage(){this.inputElement.checkValidity()||this.inputElement.setCustomValidity(this.validationMessage)}#T(){this.handleInternalInputErrorMessage(),this.setAttribute("error-message",this.validationMessage)}init(){super.init?.(),this.inputElement.addEventListener("input",(t=>{this.inputElement.checkValidity()||(this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.baseElement.__onInput(t),this.#T())})),this.baseElement.addEventListener("change",(()=>{this.#L()})),this.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#T())})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#T()})),this.handleInternalInputErrorMessage(),v(this,this.inputElement,"value"),v(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}};var A=s(357);const S=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=c({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:h((0,n.E3)(l.componentName,"_"+u),s)}}#N;constructor(){const t=t=>{const s=t.shadowRoot.querySelector(t.baseSelector),i=e?s.shadowRoot.querySelector(e):s;return i.shadowRoot||i};var s;super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:i.qM+u,baseSelector:":host"}),this.#N=(s=t(this)).host||s}#x(){this.#N.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#N.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#N,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#x()}}},M=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 C=s(8084);const L=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){["focus","blur"].forEach((t=>{this.addEventListener(t,(t=>{this.isReadOnly&&(t.stopImmediatePropagation(),t.preventDefault())}),!0)})),super.init?.()}},T=t=>class extends t{init(){this.#k(),super.init?.()}#k(){["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:()=>n});var i=s(4567);const n=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t)}))),{})}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[769],{1250:(e,t,s)=>{s.d(t,{Z:()=>r,f:()=>h});var c=s(3878),i=s(4567);const h=(0,i.iY)("boolean-field-internal"),n=["disabled","label","invalid","readonly"],a=(0,c.P)({componentName:h,baseSelector:"div"}),r=class extends a{constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox")}get value(){return this.checkbox?.checked}set value(e){this.checkbox.checked=e}get checked(){return this.value}set checked(e){this.value=e}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.checkbox.focus()})),super.init?.(),(0,i.oP)(this,this.checkbox,{includeAttrs:n}),(0,i.tg)(this,this.checkbox,{includeAttrs:["checked"]}),this.handleFocusEventsDispatching([this.checkbox])}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},6676:(e,t,s)=>{s.r(t);var c=s(1250);customElements.define(c.f,c.Z)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[726],{3570:(e,t,o)=>{o.r(t),o.d(t,{Checkbox:()=>y});var r=o(4567),c=o(2061),l=o(4988),p=o(818),n=o(6882);const i=(0,r.iY)("checkbox"),{host:a,component:h,checkboxElement:b,checkboxSurface:s,checkboxHiddenLabel:d,label:k,requiredIndicator:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"::part(required-indicator)::after"},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxHiddenLabel:{selector:'vaadin-checkbox [slot="label"]'}},y=(0,c.qC)((0,l.yk)({mappings:{width:a,cursor:h,checkboxBackgroundColor:{...b,property:"background-color"},checkboxRadius:{...b,property:"border-radius"},checkboxWidth:[{...b,property:"width"},{...k,property:"margin-left"}],checkboxHeight:{...b,property:"height"},checkboxOutlineWidth:{...b,property:"outline-width"},checkboxOutlineOffset:{...b,property:"outline-offset"},checkboxOutlineColor:{...b,property:"outline-color"},checkboxOutlineStyle:{...b,property:"outline-style"},checkmarkSize:[{...s,property:"font-size"},{...h,property:"font-size"}],checkmarkTextColor:{...s,property:"color"},labelFontSize:[{...k,property:"font-size"},{...d,property:"font-size"}],labelLineHeight:[{...k,property:"line-height"},{...d,property:"line-height"}],labelFontWeight:[{...k,property:"font-weight"},{...d,property:"font-weight"}],labelMargin:[{...k,property:"left"},{...d,property:"padding-left"}],labelTextColor:[{...k,property:"color"},{...x,property:"color"}]}}),l.e4,l.dj,l.Ae,p.h)((0,l.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:`\n\t\t${n.Z}\n\n\t\tvaadin-checkbox [slot="label"] {\n\t\t\theight: 100%;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:i}));o(9515),o(9789),o(6676),customElements.define(i,y)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[483],{4332:(t,e,r)=>{r.r(e),r.d(e,{SwitchToggle:()=>f});var o=r(4567),c=r(2061),n=r(4988),a=r(818),i=r(6882);const p=(0,o.iY)("switch-toggle"),{host:l,component:d,checkboxElement:h,checkboxSurface:s,checkboxHiddenLabel:b,label:k,requiredIndicator:y}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"::part(required-indicator)::after"},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxHiddenLabel:{selector:'vaadin-checkbox [slot="label"]'}},u=(0,c.qC)((0,n.yk)({mappings:{width:l,cursor:[d,b,h],fontSize:[d,k,b],trackBorderWidth:{...h,property:"border-width"},trackBorderStyle:{...h,property:"border-style"},trackBorderColor:{...h,property:"border-color"},trackBackgroundColor:{...h,property:"background-color"},trackRadius:{...h,property:"border-radius"},trackWidth:[{...h,property:"width"}],trackHeight:[{...s,property:"font-size"},{...h,property:"height"}],switchOutlineWidth:{...h,property:"outline-width"},switchOutlineOffset:{...h,property:"outline-offset"},switchOutlineColor:{...h,property:"outline-color"},switchOutlineStyle:{...h,property:"outline-style"},knobSize:[{...s,property:"width"},{...s,property:"height"}],knobTextColor:{...s,property:"color"},knobRadius:{...s,property:"border-radius"},knobTransition:{...s,property:"transition"},knobColor:{...s,property:"background-color"},knobTopOffset:{...s,property:"top"},knobPosition:{...s,property:"left"},labelMargin:[{...k,property:"padding-left"},{...b,property:"padding-left"}],labelLineHeight:[{...k,property:"line-height"},{...b,property:"line-height"}],labelFontWeight:[{...k,property:"font-weight"},{...b,property:"font-weight"}],labelTextColor:[{...k,property:"color"},{...y,property:"color"}]}}),n.e4,n.dj,n.Ae,a.h)((0,n.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t${i.Z}\n\n\t\tvaadin-text-field::part(label) {\n\t\t\tleft: calc(var(${u.cssVarList.trackWidth}) + var(${u.cssVarList.trackBorderWidth}) * 2);\n\t\t}\n\n\t\tvaadin-checkbox[active]::part(checkbox) {\n\t\t\ttransform: none;\n\t\t}\n\t\tvaadin-checkbox[checked]::part(checkbox) {\n\t\t\tbackground: none;\n\t\t}\n\t\tvaadin-checkbox::part(checkbox)::after {\n\t\t\tposition: absolute;\n\t\t\topacity: 1;\n\t\t\tcontent: '';\n\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:p})),f=u;r(9515),r(9789),r(6676),customElements.define(p,f)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[483],{3352:(t,e,o)=>{o.d(e,{Z:()=>p,f:()=>i});var r=o(2061),n=o(4567),a=o(4988);const i=(0,n.iY)("combo-box"),{host:s,input:d,placeholder:l,toggle:c}={host:{selector:()=>":host"},input:{selector:"::part(input-field)"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"}},b=(0,r.qC)((0,a.yk)({mappings:{width:s,height:d,padding:d,backgroundColor:d,boxShadow:d,borderColor:d,borderWidth:d,borderStyle:d,borderRadius:d,color:d,fontSize:[{},s],placeholderColor:{...l,property:"color"},toggleCursor:{...c,property:"cursor"},toggleColor:{...c,property:"color"},overlayBackground:{property:()=>b.cssVarList.overlay.backgroundColor},overlayBorder:{property:()=>b.cssVarList.overlay.border}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},cursor:{selector:"vaadin-combo-box-item"}},forward:{include:!1,attributes:["size"]}}),a.dj,a.Ae,(t=>class extends t{constructor(){super()}#t(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name")}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id")})})),t.items=e,t.renderer=(t,e,o)=>{t.innerHTML=o.item.outerHTML})}#e(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=function(){this.bringToFront()},t._detachOverlay=function(){},t._enterModalState=function(){}}init(){super.init?.(),this.#e(),(0,n.P$)(this,this.#t.bind(this))}}))((0,a.DM)({slots:["prefix"],wrappedEleName:"vaadin-combo-box",style:()=>'\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t}\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\t-webkit-mask-image: none;\n\t\t\tborder-radius: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t',excludeAttrsSync:["tabindex","size"],componentName:i,includeForwardProps:["items","renderer"]})),p=b},1294:(t,e,o)=>{o.r(e),o.d(e,{ComboBox:()=>r.Z}),o(9314);var r=o(3352);customElements.define(r.f,r.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[4],{3352:(t,e,o)=>{o.d(e,{Z:()=>p,f:()=>i});var r=o(2061),n=o(4567),a=o(4988);const i=(0,n.iY)("combo-box"),{host:s,input:d,placeholder:l,toggle:c}={host:{selector:()=>":host"},input:{selector:"::part(input-field)"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"}},b=(0,r.qC)((0,a.yk)({mappings:{width:s,height:d,padding:d,backgroundColor:d,boxShadow:d,borderColor:d,borderWidth:d,borderStyle:d,borderRadius:d,color:d,fontSize:[{},s],placeholderColor:{...l,property:"color"},toggleCursor:{...c,property:"cursor"},toggleColor:{...c,property:"color"},overlayBackground:{property:()=>b.cssVarList.overlay.backgroundColor},overlayBorder:{property:()=>b.cssVarList.overlay.border}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},cursor:{selector:"vaadin-combo-box-item"}},forward:{include:!1,attributes:["size"]}}),a.dj,a.Ae,(t=>class extends t{constructor(){super()}#t(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name")}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id")})})),t.items=e,t.renderer=(t,e,o)=>{t.innerHTML=o.item.outerHTML})}#e(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=function(){this.bringToFront()},t._detachOverlay=function(){},t._enterModalState=function(){}}init(){super.init?.(),this.#e(),(0,n.P$)(this,this.#t.bind(this))}}))((0,a.DM)({slots:["prefix"],wrappedEleName:"vaadin-combo-box",style:()=>'\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t}\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\t-webkit-mask-image: none;\n\t\t\tborder-radius: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t',excludeAttrsSync:["tabindex","size"],componentName:i,includeForwardProps:["items","renderer"]})),p=b},1294:(t,e,o)=>{o.r(e),o.d(e,{ComboBox:()=>r.Z}),o(9314);var r=o(3352);customElements.define(r.f,r.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[317],{147:(t,e,o)=>{o.r(e),o.d(e,{Container:()=>a});var n=o(4988),s=o(693),r=o(2061);const i=(0,o(4567).iY)("container");class d extends((0,s.s)({componentName:i,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host > slot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: auto;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t"}}const a=(0,r.qC)((0,n.yk)({mappings:{height:{selector:()=>":host"},width:{selector:()=>":host"},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{}}}),n.e4,n.Ae)(d);customElements.define(i,a)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[317],{147:(t,e,o)=>{o.r(e),o.d(e,{Container:()=>a});var n=o(4988),r=o(693),s=o(2061);const i=(0,o(4567).iY)("container");class d extends((0,r.s)({componentName:i,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host > slot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: auto;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t"}}const a=(0,s.qC)((0,n.yk)({mappings:{height:{selector:()=>":host"},width:{selector:()=>":host"},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:{},flexWrap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{}}}),n.e4,n.Ae)(d);customElements.define(i,a)}}]);
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={"./descope-button/index.js":[3029,840,767,211,513,729,988,662],"./descope-checkbox/descope-checkbox-internal/index.js":[3537,988,878,409],"./descope-checkbox/index.js":[7904,840,786,233,208,422,725,767,789,515,988,878,409,761],"./descope-combo-box/index.js":[1294,840,786,233,208,824,314,988,483],"./descope-container/index.js":[147,988,317],"./descope-date-picker/index.js":[2552,840,786,233,208,767,824,211,513,541,988,17],"./descope-divider/index.js":[6446,988,528,178],"./descope-email-field/index.js":[689,840,786,233,208,422,725,437,988,447,760],"./descope-image/index.js":[8116,988,772],"./descope-link/index.js":[8029,988,528,58],"./descope-loader-linear/index.js":[9929,988,453],"./descope-loader-radial/index.js":[7603,988,72],"./descope-logo/index.js":[4641,988,984],"./descope-new-password/descope-new-password-internal/index.js":[1545,988,878,387,842],"./descope-new-password/index.js":[8974,840,786,233,208,422,725,767,789,211,56,988,878,447,934,387,842,320,55],"./descope-number-field/index.js":[4951,840,786,233,208,422,806,988,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,988,878,841],"./descope-passcode/index.js":[7102,840,786,233,208,422,725,789,988,878,447,934,841,939],"./descope-password-field/index.js":[5702,840,786,233,208,422,725,767,211,56,988,387,320],"./descope-phone-field/descope-phone-field-internal/index.js":[4772,840,786,233,208,422,725,789,824,314,988,878,447,934,483,646],"./descope-phone-field/index.js":[4840,840,786,233,208,422,725,789,824,314,988,878,447,934,483,646,414],"./descope-switch-toggle/index.js":[3774,840,786,208,767,515,988,739],"./descope-text-area/index.js":[178,840,786,233,422,101,988,322],"./descope-text-field/index.js":[9357,840,786,233,208,422,725,789,988,447,934],"./descope-text/index.js":[1876,988,528]};function t(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],t=o[0];return Promise.all(o.slice(1).map(s.e)).then((()=>s(t)))}t.keys=()=>Object.keys(n),t.id=534,e.exports=t},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),t=s(534);e.exports=t.keys().reduce(((e,o)=>(e[o.replace(/.*?([^\/]+)\/index\.js$/,"$1")]=()=>t(o),e)),{}),e.exports.componentsThemeManager=n}},t={};function r(e){var o=t[e];if(void 0!==o)return o.exports;var s=t[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.m=n,e=[],r.O=(o,s,n,t)=>{if(!s){var d=1/0;for(p=0;p<e.length;p++){for(var[s,n,t]=e[p],i=!0,c=0;c<s.length;c++)(!1&t||d>=t)&&Object.keys(r.O).every((e=>r.O[e](s[c])))?s.splice(c--,1):(i=!1,t<d&&(d=t));if(i){e.splice(p--,1);var a=n();void 0!==a&&(o=a)}}return o}t=t||0;for(var p=e.length;p>0&&e[p-1][2]>t;p--)e[p]=e[p-1];e[p]=[s,n,t]},r.F={},r.E=e=>{Object.keys(r.F).map((o=>{r.F[o](e)}))},r.d=(e,o)=>{for(var s in o)r.o(o,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((o,s)=>(r.f[s](e,o),o)),[])),r.u=e=>(({17:"descope-date-picker-index-js",55:"descope-new-password-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",409:"descope-checkbox-descope-checkbox-internal-index-js",414:"descope-phone-field-index-js",453:"descope-loader-linear-index-js",483:"descope-combo-box-index-js",528:"descope-text-index-js",646:"descope-phone-field-descope-phone-field-internal-index-js",662:"descope-button-index-js",739:"descope-switch-toggle-index-js",760:"descope-email-field-index-js",761:"descope-checkbox-index-js",772:"descope-image-index-js",841:"descope-passcode-descope-passcode-internal-index-js",842:"descope-new-password-descope-new-password-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),o={},s="DescopeUI:",r.l=(e,n,t,d)=>{if(o[e])o[e].push(n);else{var i,c;if(void 0!==t)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==s+t){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,r.nc&&i.setAttribute("nonce",r.nc),i.setAttribute("data-webpack",s+t),i.src=e),o[e]=[n];var u=(s,n)=>{i.onerror=i.onload=null,clearTimeout(h);var t=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),t&&t.forEach((e=>e(n))),s)return s(n)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),c&&document.head.appendChild(i)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var o=r.g.document;if(!e&&o&&(o.currentScript&&(e=o.currentScript.src),!e)){var s=o.getElementsByTagName("script");s.length&&(e=s[s.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={826:0};r.f.j=(o,s)=>{var n=r.o(e,o)?e[o]:void 0;if(0!==n)if(n)s.push(n[2]);else{var t=new Promise(((s,t)=>n=e[o]=[s,t]));s.push(n[2]=t);var d=r.p+r.u(o),i=new Error;r.l(d,(s=>{if(r.o(e,o)&&(0!==(n=e[o])&&(e[o]=void 0),n)){var t=s&&("load"===s.type?"missing":s.type),d=s&&s.target&&s.target.src;i.message="Loading chunk "+o+" failed.\n("+t+": "+d+")",i.name="ChunkLoadError",i.type=t,i.request=d,n[1](i)}}),"chunk-"+o,o)}},r.F.j=o=>{if(!r.o(e,o)||void 0===e[o]){e[o]=null;var s=document.createElement("link");r.nc&&s.setAttribute("nonce",r.nc),s.rel="prefetch",s.as="script",s.href=r.p+r.u(o),document.head.appendChild(s)}},r.O.j=o=>0===e[o];var o=(o,s)=>{var n,t,[d,i,c]=s,a=0;if(d.some((o=>0!==e[o]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(c)var p=c(r)}for(o&&o(s);a<d.length;a++)t=d[a],r.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return r.O(p)},s=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];s.forEach(o.bind(null,0)),s.push=o.bind(null,s.push.bind(s))})(),r.O(0,[826],(()=>{[840,767,211,513,729,988,662,878,409,786,233,208,422,725,789,515,761,824,314,483,317,541,17,528,178,437,447,760,772,58,453,72,984,387,842,56,934,320,55,806,142,841,939,646,414,739,101,322].map(r.E)}),5);var d=r(7507);return r.O(d)})()));
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,988,878,769],"./boolean-fields/descope-checkbox/index.js":[3570,840,18,208,422,725,789,767,515,988,878,769,803,726],"./boolean-fields/descope-switch-toggle/index.js":[4332,840,18,208,422,725,789,767,515,988,878,769,803,483],"./descope-button/index.js":[3029,840,767,211,513,729,988,662],"./descope-combo-box/index.js":[1294,840,18,208,824,314,988,4],"./descope-container/index.js":[147,988,317],"./descope-date-picker/index.js":[2552,840,18,208,767,824,211,513,541,988,17],"./descope-divider/index.js":[6446,988,528,178],"./descope-email-field/index.js":[689,840,18,208,422,725,437,988,447,760],"./descope-image/index.js":[8116,988,772],"./descope-link/index.js":[8029,988,528,58],"./descope-loader-linear/index.js":[9929,988,453],"./descope-loader-radial/index.js":[7603,988,72],"./descope-logo/index.js":[4641,988,984],"./descope-new-password/descope-new-password-internal/index.js":[1545,988,878,387,842],"./descope-new-password/index.js":[8974,840,18,208,422,725,789,767,211,56,988,878,447,934,387,842,320,55],"./descope-number-field/index.js":[4951,840,18,208,422,806,988,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,988,878,841],"./descope-passcode/index.js":[7102,840,18,208,422,725,789,988,878,447,934,841,939],"./descope-password-field/index.js":[5702,840,18,208,422,725,767,211,56,988,387,320],"./descope-phone-field/descope-phone-field-internal/index.js":[4772,840,18,208,422,725,789,824,314,988,878,447,934,4,646],"./descope-phone-field/index.js":[4840,840,18,208,422,725,789,824,314,988,878,447,934,4,646,414],"./descope-text-area/index.js":[178,840,18,422,101,988,322],"./descope-text-field/index.js":[9357,840,18,208,422,725,789,988,447,934],"./descope-text/index.js":[1876,988,528]};function t(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],t=o[0];return Promise.all(o.slice(1).map(s.e)).then((()=>s(t)))}t.keys=()=>Object.keys(n),t.id=534,e.exports=t},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),t=s(534);e.exports=t.keys().reduce(((e,o)=>{const s=o.replace(/.*?([^\/]+)\/index\.js$/,"$1");return s.endsWith("-internal")||(e[s]=()=>t(o)),e}),{}),e.exports.componentsThemeManager=n}},t={};function r(e){var o=t[e];if(void 0!==o)return o.exports;var s=t[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.m=n,e=[],r.O=(o,s,n,t)=>{if(!s){var d=1/0;for(p=0;p<e.length;p++){for(var[s,n,t]=e[p],i=!0,c=0;c<s.length;c++)(!1&t||d>=t)&&Object.keys(r.O).every((e=>r.O[e](s[c])))?s.splice(c--,1):(i=!1,t<d&&(d=t));if(i){e.splice(p--,1);var a=n();void 0!==a&&(o=a)}}return o}t=t||0;for(var p=e.length;p>0&&e[p-1][2]>t;p--)e[p]=e[p-1];e[p]=[s,n,t]},r.F={},r.E=e=>{Object.keys(r.F).map((o=>{r.F[o](e)}))},r.d=(e,o)=>{for(var s in o)r.o(o,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((o,s)=>(r.f[s](e,o),o)),[])),r.u=e=>(({4:"descope-combo-box-index-js",17:"descope-date-picker-index-js",55:"descope-new-password-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",414:"descope-phone-field-index-js",453:"descope-loader-linear-index-js",483:"boolean-fields-descope-switch-toggle-index-js",528:"descope-text-index-js",646:"descope-phone-field-descope-phone-field-internal-index-js",662:"descope-button-index-js",726:"boolean-fields-descope-checkbox-index-js",760:"descope-email-field-index-js",769:"boolean-fields-descope-boolean-field-internal-index-js",772:"descope-image-index-js",841:"descope-passcode-descope-passcode-internal-index-js",842:"descope-new-password-descope-new-password-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),o={},s="DescopeUI:",r.l=(e,n,t,d)=>{if(o[e])o[e].push(n);else{var i,c;if(void 0!==t)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==s+t){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,r.nc&&i.setAttribute("nonce",r.nc),i.setAttribute("data-webpack",s+t),i.src=e),o[e]=[n];var u=(s,n)=>{i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),t&&t.forEach((e=>e(n))),s)return s(n)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),c&&document.head.appendChild(i)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var o=r.g.document;if(!e&&o&&(o.currentScript&&(e=o.currentScript.src),!e)){var s=o.getElementsByTagName("script");s.length&&(e=s[s.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={826:0};r.f.j=(o,s)=>{var n=r.o(e,o)?e[o]:void 0;if(0!==n)if(n)s.push(n[2]);else{var t=new Promise(((s,t)=>n=e[o]=[s,t]));s.push(n[2]=t);var d=r.p+r.u(o),i=new Error;r.l(d,(s=>{if(r.o(e,o)&&(0!==(n=e[o])&&(e[o]=void 0),n)){var t=s&&("load"===s.type?"missing":s.type),d=s&&s.target&&s.target.src;i.message="Loading chunk "+o+" failed.\n("+t+": "+d+")",i.name="ChunkLoadError",i.type=t,i.request=d,n[1](i)}}),"chunk-"+o,o)}},r.F.j=o=>{if(!r.o(e,o)||void 0===e[o]){e[o]=null;var s=document.createElement("link");r.nc&&s.setAttribute("nonce",r.nc),s.rel="prefetch",s.as="script",s.href=r.p+r.u(o),document.head.appendChild(s)}},r.O.j=o=>0===e[o];var o=(o,s)=>{var n,t,[d,i,c]=s,a=0;if(d.some((o=>0!==e[o]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(c)var p=c(r)}for(o&&o(s);a<d.length;a++)t=d[a],r.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return r.O(p)},s=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];s.forEach(o.bind(null,0)),s.push=o.bind(null,s.push.bind(s))})(),r.O(0,[826],(()=>{[988,878,769,840,18,208,422,725,789,767,515,803,726,483,211,513,729,662,824,314,4,317,541,17,528,178,437,447,760,772,58,453,72,984,387,842,56,934,320,55,806,142,841,939,646,414,101,322].map(r.E)}),5);var d=r(7507);return r.O(d)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.83",
3
+ "version": "1.0.85",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,38 @@
1
+ import { forwardAttrs, forwardProps, syncAttrs } from "../../helpers/componentHelpers";
2
+ import { componentName as descopeInternalComponentName } from './descope-boolean-field-internal/BooleanFieldInternal'
3
+
4
+ export const booleanFieldMixin = (superclass) =>
5
+ class BooleanFieldMixinClass extends superclass {
6
+ constructor() {
7
+ super();
8
+ }
9
+
10
+ init() {
11
+ super.init?.();
12
+
13
+ const template = document.createElement('template');
14
+ template.innerHTML = `
15
+ <${descopeInternalComponentName}
16
+ tabindex="-1"
17
+ slot="input"
18
+ ></${descopeInternalComponentName}>
19
+ `;
20
+
21
+ this.baseElement.appendChild(template.content.cloneNode(true));
22
+ this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
23
+ this.checkbox = this.inputElement.querySelector('vaadin-checkbox');
24
+
25
+ forwardAttrs(this, this.inputElement, {
26
+ includeAttrs: [
27
+ 'required',
28
+ 'full-width',
29
+ 'size',
30
+ 'label',
31
+ 'invalid',
32
+ ]
33
+ });
34
+
35
+ forwardProps(this.inputElement, this, ['checked']);
36
+ syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });
37
+ }
38
+ };
@@ -0,0 +1,59 @@
1
+ export default `
2
+ :host {
3
+ --vaadin-field-default-width: auto;
4
+ display: inline-flex;
5
+ }
6
+ .wrapper {
7
+ display: flex;
8
+ }
9
+
10
+ vaadin-text-field {
11
+ position: relative;
12
+ padding: 0;
13
+ display: inline-flex;
14
+ align-items: flex-start;
15
+ }
16
+ vaadin-text-field::before {
17
+ height: 0;
18
+ margin: 0;
19
+ }
20
+ vaadin-text-field::part(label) {
21
+ position: absolute;
22
+ top: 0;
23
+ }
24
+ vaadin-text-field::part(input-field) {
25
+ padding: 0;
26
+ background: none;
27
+ min-height: 0;
28
+ }
29
+ vaadin-text-field::part(input-field)::after {
30
+ background: none;
31
+ }
32
+ vaadin-text-field[focus-ring]::part(input-field) {
33
+ box-shadow: none;
34
+ }
35
+ vaadin-text-field[required]::part(required-indicator)::after {
36
+ content: "*";
37
+ }
38
+
39
+ vaadin-checkbox [slot="label"] {
40
+ align-self: flex-start;
41
+ opacity: 0;
42
+ padding: 0;
43
+ }
44
+ [required] vaadin-checkbox [slot="label"] {
45
+ padding-right: 1em;
46
+ }
47
+ vaadin-checkbox::part(checkbox) {
48
+ margin: 0;
49
+ }
50
+ vaadin-checkbox[focus-ring]::part(checkbox) {
51
+ box-shadow: none;
52
+ }
53
+
54
+ descope-boolean-field-internal {
55
+ -webkit-mask-image: none;
56
+ min-height: 0;
57
+ padding: 0;
58
+ }
59
+ `;
@@ -1,7 +1,7 @@
1
1
  import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';
2
2
  import { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';
3
3
 
4
- export const componentName = getComponentName('checkbox-internal');
4
+ export const componentName = getComponentName('boolean-field-internal');
5
5
 
6
6
  const forwardAttributes = [
7
7
  'disabled',
@@ -12,7 +12,7 @@ const forwardAttributes = [
12
12
 
13
13
  const BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' })
14
14
 
15
- class CheckboxInternal extends BaseInputClass {
15
+ class BooleanInputInternal extends BaseInputClass {
16
16
  constructor() {
17
17
  super();
18
18
  this.innerHTML = `
@@ -63,4 +63,4 @@ class CheckboxInternal extends BaseInputClass {
63
63
  };
64
64
  }
65
65
 
66
- export default CheckboxInternal;
66
+ export default BooleanInputInternal;
@@ -0,0 +1,3 @@
1
+ import BooleanFieldInternal, { componentName } from "./BooleanFieldInternal"
2
+
3
+ customElements.define(componentName, BooleanFieldInternal);
@@ -1,52 +1,17 @@
1
- import { getComponentName, forwardAttrs, syncAttrs, forwardProps } from '../../helpers/componentHelpers';
2
- import { componentName as descopeInternalComponentName } from './descope-checkbox-internal/CheckboxInternal';
3
- import { compose } from '../../helpers';
1
+ import { getComponentName } from '../../../helpers/componentHelpers';
2
+ import { compose } from '../../../helpers';
4
3
  import {
5
4
  createStyleMixin,
6
5
  proxyInputMixin,
7
6
  draggableMixin,
8
7
  componentNameValidationMixin,
9
8
  createProxy
10
- } from '../../mixins';
9
+ } from '../../../mixins';
10
+ import { booleanFieldMixin } from '../booleanFieldMixin';
11
+ import commonStyles from '../commonStyles';
11
12
 
12
13
  export const componentName = getComponentName('checkbox');
13
14
 
14
- const customMixin = (superclass) =>
15
- class CheckboxMixinClass extends superclass {
16
- constructor() {
17
- super();
18
- }
19
-
20
- init() {
21
- super.init?.();
22
-
23
- const template = document.createElement('template');
24
- template.innerHTML = `
25
- <${descopeInternalComponentName}
26
- tabindex="-1"
27
- slot="input"
28
- ></${descopeInternalComponentName}>
29
- `;
30
-
31
- this.baseElement.appendChild(template.content.cloneNode(true));
32
- this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
33
- this.checkbox = this.inputElement.querySelector('vaadin-checkbox');
34
-
35
- forwardAttrs(this, this.inputElement, {
36
- includeAttrs: [
37
- 'required',
38
- 'full-width',
39
- 'size',
40
- 'label',
41
- 'invalid',
42
- ]
43
- });
44
-
45
- forwardProps(this.inputElement, this, ['checked']);
46
- syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });
47
- }
48
- };
49
-
50
15
  const {
51
16
  host,
52
17
  component,
@@ -115,71 +80,18 @@ const Checkbox = compose(
115
80
  draggableMixin,
116
81
  proxyInputMixin,
117
82
  componentNameValidationMixin,
118
- customMixin
83
+ booleanFieldMixin
119
84
  )(
120
85
  createProxy({
121
86
  slots: [],
122
87
  wrappedEleName: 'vaadin-text-field',
123
88
  style: `
124
- :host {
125
- --vaadin-field-default-width: auto;
126
- display: inline-flex;
127
- }
128
- .wrapper {
129
- display: flex;
130
- }
131
-
132
- vaadin-text-field {
133
- position: relative;
134
- padding: 0;
135
- display: inline-flex;
136
- align-items: flex-start;
137
- }
138
- vaadin-text-field[focus-ring]::part(input-field) {
139
- box-shadow: none;
140
- }
141
- vaadin-text-field::before {
142
- height: auto;
143
- margin: 0;
144
- }
145
- vaadin-text-field::part(input-field) {
146
- padding: 0;
147
- background: none;
148
- min-height: 0;
149
- }
150
- vaadin-text-field::part(input-field)::after {
151
- background: none;
152
- }
153
- vaadin-text-field::part(label) {
154
- position: absolute;
155
- top: 0;
156
- }
157
- vaadin-text-field[required]::part(required-indicator)::after {
158
- content: "*";
159
- }
89
+ ${commonStyles}
160
90
 
161
91
  vaadin-checkbox [slot="label"] {
162
- opacity: 0;
163
92
  height: 100%;
164
- align-self: flex-start;
165
- padding: 0;
166
93
  cursor: pointer;
167
94
  }
168
- [required] vaadin-checkbox [slot="label"] {
169
- padding-right: 1em;
170
- }
171
- vaadin-checkbox::part(checkbox) {
172
- margin: 0;
173
- }
174
- vaadin-checkbox[focus-ring]::part(checkbox) {
175
- box-shadow: none;
176
- }
177
-
178
- descope-checkbox-internal {
179
- -webkit-mask-image: none;
180
- min-height: 0;
181
- padding: 0;
182
- }
183
95
  `,
184
96
  excludeAttrsSync: ['tabindex'],
185
97
  componentName
@@ -1,6 +1,8 @@
1
1
  import Checkbox, { componentName } from './Checkbox';
2
2
  import '@vaadin/checkbox'
3
3
  import '@vaadin/text-field'
4
- import './descope-checkbox-internal'
4
+ import '../descope-boolean-field-internal';
5
5
 
6
6
  customElements.define(componentName, Checkbox);
7
+
8
+ export { Checkbox };
@@ -0,0 +1,124 @@
1
+ import { getComponentName } from '../../../helpers/componentHelpers'
2
+ import { compose } from '../../../helpers';
3
+ import {
4
+ createStyleMixin,
5
+ proxyInputMixin,
6
+ draggableMixin,
7
+ componentNameValidationMixin,
8
+ createProxy
9
+ } from '../../../mixins';
10
+ import { booleanFieldMixin } from '../booleanFieldMixin';
11
+ import commonStyles from '../commonStyles';
12
+
13
+ export const componentName = getComponentName('switch-toggle');
14
+
15
+ const {
16
+ host,
17
+ component,
18
+ checkboxElement: track,
19
+ checkboxSurface: knob,
20
+ checkboxHiddenLabel,
21
+ label,
22
+ requiredIndicator,
23
+ } = {
24
+ host: { selector: () => ':host' },
25
+ label: { selector: '::part(label)' },
26
+ requiredIndicator: { selector: '::part(required-indicator)::after' },
27
+ component: { selector: 'vaadin-checkbox' },
28
+ checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },
29
+ checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },
30
+ checkboxHiddenLabel: { selector: 'vaadin-checkbox [slot="label"]' },
31
+ };
32
+
33
+ const SwitchToggle = compose(
34
+ createStyleMixin({
35
+ mappings: {
36
+ width: host,
37
+ cursor: [component, checkboxHiddenLabel, track],
38
+ fontSize: [component, label, checkboxHiddenLabel],
39
+
40
+ // Track
41
+ trackBorderWidth: { ...track, property: 'border-width' },
42
+ trackBorderStyle: { ...track, property: 'border-style' },
43
+ trackBorderColor: { ...track, property: 'border-color' },
44
+
45
+ // Checkbox
46
+ trackBackgroundColor: { ...track, property: 'background-color' },
47
+ trackRadius: { ...track, property: 'border-radius' },
48
+
49
+ trackWidth: [
50
+ { ...track, property: 'width' },
51
+ ],
52
+ trackHeight: [
53
+ { ...knob, property: 'font-size' },
54
+ { ...track, property: 'height' }
55
+ ],
56
+ switchOutlineWidth: { ...track, property: 'outline-width' },
57
+ switchOutlineOffset: { ...track, property: 'outline-offset' },
58
+ switchOutlineColor: { ...track, property: 'outline-color' },
59
+ switchOutlineStyle: { ...track, property: 'outline-style' },
60
+
61
+ // Knob
62
+ knobSize: [
63
+ { ...knob, property: 'width' },
64
+ { ...knob, property: 'height' },
65
+ ],
66
+ knobTextColor: { ...knob, property: 'color' },
67
+ knobRadius: { ...knob, property: 'border-radius' },
68
+ knobTransition: { ...knob, property: 'transition' },
69
+ knobColor: { ...knob, property: 'background-color' },
70
+ knobTopOffset: { ...knob, property: 'top' },
71
+ knobPosition: { ...knob, property: 'left' },
72
+
73
+ // Label
74
+ labelMargin: [
75
+ { ...label, property: 'padding-left' },
76
+ { ...checkboxHiddenLabel, property: 'padding-left' }
77
+ ],
78
+ labelLineHeight: [
79
+ { ...label, property: 'line-height' },
80
+ { ...checkboxHiddenLabel, property: 'line-height' }
81
+ ],
82
+ labelFontWeight: [
83
+ { ...label, property: 'font-weight' },
84
+ { ...checkboxHiddenLabel, property: 'font-weight' }
85
+ ],
86
+ labelTextColor: [
87
+ { ...label, property: 'color' },
88
+ { ...requiredIndicator, property: 'color' },
89
+ ],
90
+ },
91
+ }),
92
+ draggableMixin,
93
+ proxyInputMixin,
94
+ componentNameValidationMixin,
95
+ booleanFieldMixin
96
+ )(
97
+ createProxy({
98
+ slots: [],
99
+ wrappedEleName: 'vaadin-text-field',
100
+ style: () => `
101
+ ${commonStyles}
102
+
103
+ vaadin-text-field::part(label) {
104
+ left: calc(var(${SwitchToggle.cssVarList.trackWidth}) + var(${SwitchToggle.cssVarList.trackBorderWidth}) * 2);
105
+ }
106
+
107
+ vaadin-checkbox[active]::part(checkbox) {
108
+ transform: none;
109
+ }
110
+ vaadin-checkbox[checked]::part(checkbox) {
111
+ background: none;
112
+ }
113
+ vaadin-checkbox::part(checkbox)::after {
114
+ position: absolute;
115
+ opacity: 1;
116
+ content: '';
117
+ }
118
+ `,
119
+ excludeAttrsSync: ['tabindex'],
120
+ componentName
121
+ })
122
+ );
123
+
124
+ export default SwitchToggle;
@@ -0,0 +1,8 @@
1
+ import SwitchToggle, { componentName } from './SwitchToggle';
2
+ import '@vaadin/checkbox'
3
+ import '@vaadin/text-field'
4
+ import '../descope-boolean-field-internal';
5
+
6
+ customElements.define(componentName, SwitchToggle);
7
+
8
+ export { SwitchToggle };
@@ -9,7 +9,7 @@ import { getComponentName } from '../../helpers/componentHelpers';
9
9
 
10
10
  export const componentName = getComponentName('container');
11
11
 
12
- class RawContainer extends createBaseClass({componentName, baseSelector: ':host > slot'}) {
12
+ class RawContainer extends createBaseClass({ componentName, baseSelector: ':host > slot' }) {
13
13
  constructor() {
14
14
  super();
15
15
 
@@ -50,6 +50,7 @@ const Container = compose(
50
50
  justifyContent: {},
51
51
  alignItems: {},
52
52
  gap: {},
53
+ flexWrap: {},
53
54
 
54
55
  backgroundColor: {},
55
56
  borderRadius: {},
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import './components/descope-button';
2
- import './components/descope-checkbox';
2
+ import './components/boolean-fields/descope-checkbox';
3
+ import './components/boolean-fields/descope-switch-toggle';
3
4
  import './components/descope-loader-linear';
4
5
  import './components/descope-loader-radial';
5
6
  import './components/descope-container';
@@ -11,7 +12,6 @@ import './components/descope-logo';
11
12
  import './components/descope-number-field';
12
13
  import './components/descope-passcode';
13
14
  import './components/descope-password-field';
14
- import './components/descope-switch-toggle';
15
15
  import './components/descope-text';
16
16
  import './components/descope-text-area';
17
17
  import './components/descope-text-field';
package/src/index.umd.js CHANGED
@@ -12,6 +12,11 @@ const components = import.meta.webpackContext('./components', {
12
12
  // e.g. ./descope-button/index.js
13
13
  module.exports = components.keys().reduce((acc, key) => {
14
14
  const componentName = key.replace(/.*?([^\/]+)\/index\.js$/, '$1');
15
+
16
+ if (componentName.endsWith('-internal')) {
17
+ return acc;
18
+ }
19
+
15
20
  acc[componentName] = () => components(key);
16
21
 
17
22
  return acc;
@@ -46,8 +46,8 @@ export const proxyInputMixin = (superclass) =>
46
46
  }
47
47
 
48
48
  get inputElement() {
49
- const inputSlot = this.baseElement.shadowRoot.querySelector('slot[name="input"]')
50
- const textAreaSlot = this.baseElement.shadowRoot.querySelector('slot[name="textarea"]')
49
+ const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name="input"]')
50
+ const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]')
51
51
 
52
52
  this.#inputElement ??= getNestedInput(inputSlot) || getNestedInput(textAreaSlot)
53
53