@descope/web-components-ui 1.0.391 → 1.0.392
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +24 -4
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +24 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-scopes-list-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-scopes-list/ScopesListClass.js +24 -4
@@ -1,2 +1,2 @@
|
|
1
1
|
/*! For license information please see descope-scopes-list-index-js.js.LICENSE.txt */
|
2
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1674,7362,4838,7640],{25827:(t,e,n)=>{n.d(e,{y:()=>a});var r=n(7138),o=n(94619),i=n(70263);const a=(...t)=>(0,r.Zz)(o.XX,o._$,o.yF,o.jd)((0,i.q)(...t))},38777:(t,e,n)=>{n.d(e,{A:()=>i});var r=n(14944),o=n(62751);const i=t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,r.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,r.q)(this.inputElement,this,["checked"]),(0,r.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},89345:(t,e,n)=>{n.d(e,{A:()=>r});const r=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,n(33177).X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`},62751:(t,e,n)=>{n.d(e,{A:()=>l,T:()=>i});var r=n(25827),o=n(14944);const i=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],s=(0,r.y)({componentName:i,baseSelector:"div"}),l=class extends s{static get observedAttributes(){return["readonly"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox")}get value(){return this.checkbox?.checked}set value(t){this.checkbox.checked=t}get checked(){return this.value}set checked(t){this.value=t}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.checkbox.focus()})),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:a}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"readonly"===t&&this.onReadOnlyChange(null!==n)}onReadOnlyChange(t){this.baseElement.setAttribute("inert",t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},53716:(t,e,n)=>{n.r(e);var r=n(62751);customElements.define(r.T,r.A)},16611:(t,e,n)=>{n.d(e,{T:()=>d,q:()=>f});var r=n(14944),o=n(7138),i=n(94619),a=n(38777),s=n(89345),l=n(33177);const d=(0,r.xE)("checkbox"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:m,helperText:y,errorMessage:x}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[c,h,b],fontFamily:[b,y,x],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...m,property:"content"},errorMessageTextColor:{...x,property:"color"},inputValueTextColor:{...u,property:"color"},inputBackgroundColor:{...h,property:"background-color"},inputBorderRadius:{...h,property:"border-radius"},inputBorderWidth:{...h,property:"border-width"},inputBorderOffset:{...h,property:"border-offset"},inputBorderColor:{...h,property:"border-color"},inputBorderStyle:{...h,property:"border-style"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"},inputSize:[{...h,property:"width"},{...h,property:"height"},{...u,property:"font-size"},{...p,property:"font-size"}]}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,a.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${s.A}\n ${(0,l.cy)(f.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n margin: 1px;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n height: 100%;\n }\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(checkbox)::after {\n top: 0;\n left: 0;\n -webkit-text-fill-color: initial;\n }\n\n vaadin-checkbox label {\n -webkit-text-fill-color: initial;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,excludeAttrsSync:["label","tabindex"],componentName:d}))},12388:(t,e,n)=>{n.r(e),n.d(e,{CheckboxClass:()=>r.q});var r=n(16611);n(94494),n(39542),n(53716),customElements.define(r.T,r.q)},93020:(t,e,n)=>{n.d(e,{H:()=>f,T:()=>d});var r=n(14944),o=n(7138),i=n(94619),a=n(38777),s=n(89345),l=n(33177);const d=(0,r.xE)("switch-toggle"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:m,helperText:y,errorMessage:x}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[p,b,b],fontFamily:[b,y,x],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...m,property:"content"},errorMessageTextColor:{...x,property:"color"},trackBorderWidth:{...h,property:"border-width"},trackBorderStyle:{...h,property:"border-style"},trackBorderColor:{...h,property:"border-color"},trackBackgroundColor:{...h,property:"background-color"},trackBorderRadius:{...h,property:"border-radius"},trackWidth:[{...h,property:"width"}],trackHeight:[{...u,property:"font-size"},{...h,property:"height"}],knobSize:[{...u,property:"width"},{...u,property:"height"}],knobTextColor:{...u,property:"color"},knobRadius:{...u,property:"border-radius"},knobTransitionDuration:{...u,property:"transition"},knobColor:{...u,property:"background-color"},knobTopOffset:{...u,property:"top"},knobLeftOffset:{...u,property:"left"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"}}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,a.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${s.A}\n\t\t\t${(0,l.cy)(f.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot="label"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,excludeAttrsSync:["label","tabindex"],componentName:d}))},36911:(t,e,n)=>{n.r(e),n.d(e,{ListClass:()=>p});var r=n(94619),o=n(70263),i=n(7138),a=n(14944);const s=(0,a.xE)("list-item"),l=(0,i.Zz)((0,r.RF)({mappings:{padding:{},backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),r.VO,r.tQ,(t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <style>\n /*css*/\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n\n /*!css*/\n </style>\n <slot></slot>\n "}}),(t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mousedown",(t=>{t.preventDefault(),this.setAttribute("active","true"),window.addEventListener("mouseup",(()=>this.removeAttribute("active")),{once:!0})}))}}))((0,o.q)({componentName:s,baseSelector:"slot"})),d=(0,a.xE)("list");class c extends((0,o.q)({componentName:d,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<style>\n\t /*css*/\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n /*!css*/\n\t\t</style>\n\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t'}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#t(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#e(){this.items.forEach((t=>{let e=t;e.localName!==l.componentName&&(e=t.querySelector(l.componentName));const n="tiles"===this.variant?"tile":"row";e.setAttribute("variant",n)}))}init(){super.init?.(),(0,a.Ge)(this,(()=>{this.#t(),this.#e(),this.#n()}))}get isReadOnly(){return"true"===this.getAttribute("readonly")}#n(){this.items.forEach((t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")}))}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("variant"===t?this.#e():"readonly"===t&&this.#n())}}const p=(0,i.Zz)((0,r.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),r.VO,r.tQ)(c);customElements.define(d,p),customElements.define(s,l)},78538:(t,e,n)=>{n.r(e),n.d(e,{ScopesListClass:()=>u});var r=n(70263),o=n(7138),i=n(14944),a=n(94619),s=n(84461),l=n(16611),d=n(93020);const c=(0,i.xE)("scopes-list"),p=["checkbox","switch"];class h extends((0,r.q)({componentName:c,baseSelector:"div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n :host {\n display: inline-flex;\n }\n\n div {\n display: flex;\n flex-direction: column;\n }\n\n\t\t</style>\n <div></div>\n\t\t"}get isReadOnly(){return"true"===this.getAttribute("readonly")}get size(){return this.getAttribute("size")||"sm"}get value(){return Array.from(this.shadowRoot.querySelector("div").children).reduce(((t,e)=>({...t,[e.getAttribute("data-id")]:e.checked})),{})}get variant(){const t=this.getAttribute("variant");return p.includes(t)?t:p[0]}}const u=(0,o.Zz)((0,a.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:[{selector:()=>":host",property:"direction"},{selector:()=>l.q.componentName,property:l.q.cssVarList.hostDirection},{selector:()=>d.H.componentName,property:d.H.cssVarList.hostDirection}],gap:{selector:()=>"div",property:"gap"},requiredInputBorderColor:[{selector:`${l.q.componentName}[required="true"]`,property:l.q.cssVarList.inputBorderColor},{selector:`${d.H.componentName}[required="true"]`,property:d.H.cssVarList.inputBorderColor}],requiredInputValueTextColor:[{selector:`${l.q.componentName}[required="true"]`,property:l.q.cssVarList.inputValueTextColor},{selector:`${d.H.componentName}[required="true"]`,property:d.H.cssVarList.knobColor}]}}),(0,s.t)({itemRenderer:({id:t,desc:e,required:n=!1},r,o)=>{const i="checkbox"===o.variant?l.q:d.H;return`\n <${i.componentName}\n bordered="true"\n size=${o.size}\n label="${e}"\n data-id="${t}"\n readonly="${n||o.isReadOnly}"\n required="${n}"\n checked="true"\n ></${i.componentName}>\n`},rerenderAttrsList:["size","variant"]}),a.VO,a.tQ)(h);n(36911),n(12388),customElements.define(c,u)},33177:(t,e,n)=>{n.d(e,{$J:()=>h,I4:()=>a,Kl:()=>u,LJ:()=>p,Qv:()=>i,X6:()=>l,cy:()=>r,fu:()=>d,kG:()=>c,lS:()=>s,zm:()=>o});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,o=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,i=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,c=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${o(t)}\n ${a(t)}\n ${s(t)}\n ${i(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${c(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,h=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`,u=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) [slot="label"] {\n padding: 0;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '},84461:(t,e,n)=>{n.d(e,{t:()=>a});var r=n(14944);const o=()=>!0,i=t=>`<pre>${JSON.stringify(t,null,4)}</pre>`,a=({itemRenderer:t=i,validateSchema:e=o,slotName:n,rerenderAttrsList:a=[]})=>o=>class extends o{#r=[];#o(t){if(!e)return!0;const n=e(t);return!0===n||(console.error("Data schema validation failed",n||""),!1)}#i(){const t=n?`*[slot="${n}"]`:":not([slot])";this.baseElement.querySelectorAll(t).forEach((t=>t.remove()))}#a(){this.#i(),this.data.forEach(((e,n)=>{const r="string"==typeof(o=t(e,n,this))?(t=>{const e=document.createElement("template");return e.innerHTML=t,e})(o).content:o instanceof HTMLTemplateElement?o.content:(console.error("Invalid template",o),null);var o;this.baseElement.appendChild(r?.cloneNode(!0))}))}set data(t){this.#o(t)&&(this.#r=t,this.#a())}get data(){return this.#r}init(){super.init?.(),(0,r.mx)(this,(t=>{t.includes("data")?this.#s():this.#a()}),{includeAttrs:[...a,"data"]})}#s(){const t=this.getAttribute("data");if(t)try{this.data=JSON.parse(t)}catch(e){console.warn("Invalid JSON data",t)}}}},15408:(t,e,n)=>{n.d(e,{f:()=>o});var r=n(32065);class o extends r.r{constructor(t,e){super(t,"input","input",{initializer:(t,n)=>{n.value&&(t.value=n.value),n.type&&t.setAttribute("type",n.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}}}]);
|
2
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1674,7362,4838,7640],{25827:(t,e,n)=>{n.d(e,{y:()=>a});var r=n(7138),o=n(94619),i=n(70263);const a=(...t)=>(0,r.Zz)(o.XX,o._$,o.yF,o.jd)((0,i.q)(...t))},38777:(t,e,n)=>{n.d(e,{A:()=>i});var r=n(14944),o=n(62751);const i=t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,r.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,r.q)(this.inputElement,this,["checked"]),(0,r.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},89345:(t,e,n)=>{n.d(e,{A:()=>r});const r=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,n(33177).X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n`},62751:(t,e,n)=>{n.d(e,{A:()=>l,T:()=>i});var r=n(25827),o=n(14944);const i=(0,o.xE)("boolean-field-internal"),a=["disabled","label","invalid","readonly"],s=(0,r.y)({componentName:i,baseSelector:"div"}),l=class extends s{static get observedAttributes(){return["readonly"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox></vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox")}get value(){return this.checkbox?.checked}set value(t){this.checkbox.checked=t}get checked(){return this.value}set checked(t){this.value=t}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.checkbox.focus()})),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:a}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"readonly"===t&&this.onReadOnlyChange(null!==n)}onReadOnlyChange(t){this.baseElement.setAttribute("inert",t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},53716:(t,e,n)=>{n.r(e);var r=n(62751);customElements.define(r.T,r.A)},16611:(t,e,n)=>{n.d(e,{T:()=>d,q:()=>f});var r=n(14944),o=n(7138),i=n(94619),a=n(38777),s=n(89345),l=n(33177);const d=(0,r.xE)("checkbox"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:m,helperText:y,errorMessage:x}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[c,h,b],fontFamily:[b,y,x],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...m,property:"content"},errorMessageTextColor:{...x,property:"color"},inputValueTextColor:{...u,property:"color"},inputBackgroundColor:{...h,property:"background-color"},inputBorderRadius:{...h,property:"border-radius"},inputBorderWidth:{...h,property:"border-width"},inputBorderOffset:{...h,property:"border-offset"},inputBorderColor:{...h,property:"border-color"},inputBorderStyle:{...h,property:"border-style"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"},inputSize:[{...h,property:"width"},{...h,property:"height"},{...u,property:"font-size"},{...p,property:"font-size"}]}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,a.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${s.A}\n ${(0,l.cy)(f.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n margin: 1px;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n height: 100%;\n }\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(checkbox)::after {\n top: 0;\n left: 0;\n -webkit-text-fill-color: initial;\n }\n\n vaadin-checkbox label {\n -webkit-text-fill-color: initial;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,excludeAttrsSync:["label","tabindex"],componentName:d}))},12388:(t,e,n)=>{n.r(e),n.d(e,{CheckboxClass:()=>r.q});var r=n(16611);n(94494),n(39542),n(53716),customElements.define(r.T,r.q)},93020:(t,e,n)=>{n.d(e,{H:()=>f,T:()=>d});var r=n(14944),o=n(7138),i=n(94619),a=n(38777),s=n(89345),l=n(33177);const d=(0,r.xE)("switch-toggle"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:b,requiredIndicator:m,helperText:y,errorMessage:x}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[p,b,b],fontFamily:[b,y,x],labelTextColor:{...b,property:"color"},labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...m,property:"content"},errorMessageTextColor:{...x,property:"color"},trackBorderWidth:{...h,property:"border-width"},trackBorderStyle:{...h,property:"border-style"},trackBorderColor:{...h,property:"border-color"},trackBackgroundColor:{...h,property:"background-color"},trackBorderRadius:{...h,property:"border-radius"},trackWidth:[{...h,property:"width"}],trackHeight:[{...u,property:"font-size"},{...h,property:"height"}],knobSize:[{...u,property:"width"},{...u,property:"height"}],knobTextColor:{...u,property:"color"},knobRadius:{...u,property:"border-radius"},knobTransitionDuration:{...u,property:"transition"},knobColor:{...u,property:"background-color"},knobTopOffset:{...u,property:"top"},knobLeftOffset:{...u,property:"left"},inputOutlineWidth:{...h,property:"outline-width"},inputOutlineOffset:{...h,property:"outline-offset"},inputOutlineColor:{...h,property:"outline-color"},inputOutlineStyle:{...h,property:"outline-style"}}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,a.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${s.A}\n\t\t\t${(0,l.cy)(f.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot="label"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,excludeAttrsSync:["label","tabindex"],componentName:d}))},36911:(t,e,n)=>{n.r(e),n.d(e,{ListClass:()=>p});var r=n(94619),o=n(70263),i=n(7138),a=n(14944);const s=(0,a.xE)("list-item"),l=(0,i.Zz)((0,r.RF)({mappings:{padding:{},backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),r.VO,r.tQ,(t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <style>\n /*css*/\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n\n /*!css*/\n </style>\n <slot></slot>\n "}}),(t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mousedown",(t=>{t.preventDefault(),this.setAttribute("active","true"),window.addEventListener("mouseup",(()=>this.removeAttribute("active")),{once:!0})}))}}))((0,o.q)({componentName:s,baseSelector:"slot"})),d=(0,a.xE)("list");class c extends((0,o.q)({componentName:d,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<style>\n\t /*css*/\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n /*!css*/\n\t\t</style>\n\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t'}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#t(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#e(){this.items.forEach((t=>{let e=t;e.localName!==l.componentName&&(e=t.querySelector(l.componentName));const n="tiles"===this.variant?"tile":"row";e.setAttribute("variant",n)}))}init(){super.init?.(),(0,a.Ge)(this,(()=>{this.#t(),this.#e(),this.#n()}))}get isReadOnly(){return"true"===this.getAttribute("readonly")}#n(){this.items.forEach((t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")}))}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("variant"===t?this.#e():"readonly"===t&&this.#n())}}const p=(0,i.Zz)((0,r.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),r.VO,r.tQ)(c);customElements.define(d,p),customElements.define(s,l)},78538:(t,e,n)=>{n.r(e),n.d(e,{ScopesListClass:()=>u});var r=n(70263),o=n(7138),i=n(14944),a=n(94619),s=n(84461),l=n(16611),d=n(93020);const c=(0,i.xE)("scopes-list"),p=["checkbox","switch"];class h extends((0,r.q)({componentName:c,baseSelector:"div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n :host {\n display: inline-flex;\n }\n\n div {\n display: flex;\n flex-direction: column;\n }\n\n\t\t</style>\n <div></div>\n\t\t"}get isReadOnly(){return"true"===this.getAttribute("readonly")}get size(){return this.getAttribute("size")||"sm"}#r(){return Array.from(this.shadowRoot.querySelector("div").children)}reportValidity(){this.checkValidity()}checkValidity(){return this.data.every((t=>!t.required||this.value.includes(t.id)))}get value(){return this.#r().filter((t=>t.checked)).map((t=>t.getAttribute("data-id")))}set value(t=[]){this.#r().forEach((e=>{e.checked=t.includes(e.getAttribute("data-id"))}))}get variant(){const t=this.getAttribute("variant");return p.includes(t)?t:p[0]}}const u=(0,o.Zz)((0,a.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:[{selector:()=>":host",property:"direction"},{selector:()=>l.q.componentName,property:l.q.cssVarList.hostDirection},{selector:()=>d.H.componentName,property:d.H.cssVarList.hostDirection}],gap:{selector:()=>"div",property:"gap"},requiredInputBorderColor:[{selector:`${l.q.componentName}[required="true"]`,property:l.q.cssVarList.inputBorderColor},{selector:`${d.H.componentName}[required="true"]`,property:d.H.cssVarList.inputBorderColor}],requiredInputValueTextColor:[{selector:`${l.q.componentName}[required="true"]`,property:l.q.cssVarList.inputValueTextColor},{selector:`${d.H.componentName}[required="true"]`,property:d.H.cssVarList.knobColor}]}}),(0,s.t)({itemRenderer:({id:t,desc:e,required:n=!1},r,o)=>{const i="checkbox"===o.variant?l.q:d.H;return`\n <${i.componentName}\n bordered="true"\n size=${o.size}\n label="${e}"\n data-id="${t}"\n readonly="${n||o.isReadOnly}"\n required="${n}"\n checked="true"\n ></${i.componentName}>\n`},rerenderAttrsList:["size","variant"]}),a.VO,a.tQ)(h);n(36911),n(12388),customElements.define(c,u)},33177:(t,e,n)=>{n.d(e,{$J:()=>h,I4:()=>a,Kl:()=>u,LJ:()=>p,Qv:()=>i,X6:()=>l,cy:()=>r,fu:()=>d,kG:()=>c,lS:()=>s,zm:()=>o});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,o=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,i=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,c=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${o(t)}\n ${a(t)}\n ${s(t)}\n ${i(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${c(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,h=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`,u=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) [slot="label"] {\n padding: 0;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '},84461:(t,e,n)=>{n.d(e,{t:()=>a});var r=n(14944);const o=()=>!0,i=t=>`<pre>${JSON.stringify(t,null,4)}</pre>`,a=({itemRenderer:t=i,validateSchema:e=o,slotName:n,rerenderAttrsList:a=[]})=>o=>class extends o{#o=[];#i(t){if(!e)return!0;const n=e(t);return!0===n||(console.error("Data schema validation failed",n||""),!1)}#a(){const t=n?`*[slot="${n}"]`:":not([slot])";this.baseElement.querySelectorAll(t).forEach((t=>t.remove()))}#s(){this.#a(),this.data.forEach(((e,n)=>{const r="string"==typeof(o=t(e,n,this))?(t=>{const e=document.createElement("template");return e.innerHTML=t,e})(o).content:o instanceof HTMLTemplateElement?o.content:(console.error("Invalid template",o),null);var o;this.baseElement.appendChild(r?.cloneNode(!0))}))}set data(t){this.#i(t)&&(this.#o=t,this.#s())}get data(){return this.#o}init(){super.init?.(),(0,r.mx)(this,(t=>{t.includes("data")?this.#l():this.#s()}),{includeAttrs:[...a,"data"]})}#l(){const t=this.getAttribute("data");if(t)try{this.data=JSON.parse(t)}catch(e){console.warn("Invalid JSON data",t)}}}},15408:(t,e,n)=>{n.d(e,{f:()=>o});var r=n(32065);class o extends r.r{constructor(t,e){super(t,"input","input",{initializer:(t,n)=>{n.value&&(t.value=n.value),n.type&&t.setAttribute("type",n.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}}}]);
|
package/package.json
CHANGED
@@ -53,11 +53,31 @@ class RawScopesList extends createBaseClass({ componentName, baseSelector: 'div'
|
|
53
53
|
return this.getAttribute('size') || 'sm';
|
54
54
|
}
|
55
55
|
|
56
|
+
#getChildNodes() {
|
57
|
+
return Array.from(this.shadowRoot.querySelector('div').children);
|
58
|
+
}
|
59
|
+
|
60
|
+
// eslint-disable-next-line class-methods-use-this
|
61
|
+
reportValidity() {
|
62
|
+
this.checkValidity();
|
63
|
+
}
|
64
|
+
|
65
|
+
// eslint-disable-next-line class-methods-use-this
|
66
|
+
checkValidity() {
|
67
|
+
return this.data.every((item) => !item.required || this.value.includes(item.id));
|
68
|
+
}
|
69
|
+
|
56
70
|
get value() {
|
57
|
-
return
|
58
|
-
(
|
59
|
-
|
60
|
-
|
71
|
+
return this.#getChildNodes()
|
72
|
+
.filter((node) => node.checked)
|
73
|
+
.map((node) => node.getAttribute('data-id'));
|
74
|
+
}
|
75
|
+
|
76
|
+
set value(val = []) {
|
77
|
+
this.#getChildNodes().forEach((node) => {
|
78
|
+
// eslint-disable-next-line no-param-reassign
|
79
|
+
node.checked = val.includes(node.getAttribute('data-id'));
|
80
|
+
});
|
61
81
|
}
|
62
82
|
|
63
83
|
get variant() {
|