@descope/web-components-ui 1.0.272 → 1.0.273

Sign up to get free protection for your applications and to get access to all the features.
package/dist/umd/7044.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[7044],{7044:(e,r,t)=>{t.d(r,{C:()=>a});var s=t(322);class a extends s.n{get sortable(){return"true"===this.getAttribute("sortable")}_defaultRenderer(e,r,t){const s=t.item[this.path]||"";e.innerHTML=s,Array.isArray(s)&&(e.innerHTML=s.join(", "))}_defaultHeaderRenderer(e,r){this.sortable?super._defaultHeaderRenderer(e,r):e.innerHTML=this.__getHeader(this.header,this.path)}}}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[7044],{7044:(e,t,r)=>{r.d(t,{C:()=>a});var s=r(322);class a extends s.n{get sortable(){return"true"===this.getAttribute("sortable")}_defaultRenderer(e,t,r){const s=r.item[this.path]||"";e.innerHTML=s,e.title=s,Array.isArray(s)&&(e.innerHTML=s.join(", "))}_defaultHeaderRenderer(e,t){this.sortable?super._defaultHeaderRenderer(e,t):e.innerHTML=this.__getHeader(this.header,this.path)}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9461,3726,5988,7487,3705,4803,7044],{818:(e,t,r)=>{r.d(t,{h:()=>i});var n=r(4567),o=r(1250);const i=e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n\t\t\t`,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,n.oP)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,n.Db)(this.inputElement,this,["checked"]),(0,n.tg)(this,this.inputElement,{includeAttrs:["checked"]})}}},6882:(e,t,r)=>{r.d(t,{Z:()=>n});const n=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,r(4201).DY)()}\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\theight: 0;\n\tmargin: 0;\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`},3483:(e,t,r)=>{r.r(t),r.d(t,{CheckboxClass:()=>f});var n=r(4567),o=r(2061),i=r(1e3),s=r(818),a=r(6882),l=r(4201);const d=(0,n.iY)("checkbox"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:m,requiredIndicator:g,helperText:b,errorMessage:y}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.qC)((0,i.yk)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[c,h,m],fontFamily:[m,b,y],labelTextColor:{...m,property:"color"},labelSpacing:{...m,property:"padding-inline-start"},labelLineHeight:{...m,property:"line-height"},labelFontWeight:{...m,property:"font-weight"},labelRequiredIndicator:{...g,property:"content"},errorMessageTextColor:{...y,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.e4,(0,i.dj)({proxyProps:["value","selectionStart"]}),i.Ae,s.h)((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${a.Z}\n ${(0,l.bi)(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 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 }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,excludeAttrsSync:["label","tabindex"],componentName:d}));r(3092),r(9789),r(6676),customElements.define(d,f)},9278:(e,t,r)=>{r.r(t),r.d(t,{componentName:()=>s});var n=r(4567),o=r(7044);class i extends o.C{_defaultRenderer(e,t,r){const n=r.item[this.path]||"",o=Array.from(this.children).find((e=>{const t=e.getAttribute("data-pattern");return!t||new RegExp(t).test(n)}));if(!o)return void(e.innerHTML=r.item[this.path]||"");const i=o.cloneNode(!0);i.innerHTML=n||"",e.innerHTML="",e.append(i)}}const s=(0,n.iY)("grid-custom-column");customElements.define(s,i)},2238:(e,t,r)=>{r.r(t),r.d(t,{componentName:()=>l}),r(3483);var n=r(4567),o=r(8623);const i=()=>{const e=document.createElement("descope-checkbox");return e.setAttribute("bordered","true"),e.setAttribute("size","xs"),e},s=e=>!!e.items?.length&&e.selectedItems.length===e.items.length;class a extends o.w{_onHeaderRendererOrBindingChanged(){}_headerRenderer(e){const t=e.parentNode;let r=e.querySelector("descope-checkbox");r||(r=i(),r.addEventListener("input",(()=>{const e=s(t);t.selectedItems=e?[]:t.items})),e.appendChild(r)),r.setAttribute("checked",s(t))}_defaultRenderer(e,t,r){const n=e.parentNode;let o=e.querySelector("descope-checkbox");o||(o=i(),e.appendChild(o)),o.onchange=()=>{o.checked?n.selectItem(r.item):n.deselectItem(r.item)},o.setAttribute("checked",r.selected)}}const l=(0,n.iY)("grid-selection-column");customElements.define(l,a)},7044:(e,t,r)=>{r.d(t,{C:()=>o});var n=r(322);class o extends n.n{get sortable(){return"true"===this.getAttribute("sortable")}_defaultRenderer(e,t,r){const n=r.item[this.path]||"";e.innerHTML=n,Array.isArray(n)&&(e.innerHTML=n.join(", "))}_defaultHeaderRenderer(e,t){this.sortable?super._defaultHeaderRenderer(e,t):e.innerHTML=this.__getHeader(this.header,this.path)}}},2356:(e,t,r)=>{r.r(t),r.d(t,{componentName:()=>i});var n=r(4567),o=r(7044);const i=(0,n.iY)("grid-text-column");customElements.define(i,o.C)},9950:(e,t,r)=>{r.r(t),r.d(t,{GridClass:()=>f}),r(4595),r(2356),r(9278),r(2238);var n=r(2061),o=r(4567),i=r(1e3);const s=e=>{const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t},a=(0,o.iY)("grid"),{host:l,headerRow:d,headerRowCell:c,contentRow:p,firstRow:h,sortIndicators:u,activeSortIndicator:m,selectedRow:g,rowSeparator:b,resizeHandle:y}={host:{selector:()=>"vaadin-grid"},headerRow:{selector:()=>"::part(header-cell)"},headerRowCell:{selector:()=>"vaadin-grid::part(header-cell)"},contentRow:{selector:()=>"::part(cell)"},firstRow:{selector:()=>"::part(first-header-row-cell)"},selectedRow:{selector:()=>"::part(selected-row-cell)"},sortIndicators:{selector:()=>"vaadin-grid-sorter::part(indicators)"},activeSortIndicator:{selector:()=>"vaadin-grid-sorter[direction]"},rowSeparator:{selector:()=>"vaadin-grid::part(body-cell)"},resizeHandle:{selector:()=>"::part(resize-handle)"}},f=(0,n.qC)((0,i.yk)({componentNameOverride:(0,o.iY)("input-wrapper")}),(0,i.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostHeight:{selector:()=>":host",property:"height"},hostMinHeight:{selector:()=>":host",property:"min-height"},fontFamily:[{...d},{...p}],fontSize:[{...d},{...p}],fontWeight:{...p},valueTextColor:{...p,property:"color"},backgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],sortIndicatorsColor:{...u,property:"color"},activeSortIndicator:{...m,property:"color"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},selectedBackgroundColor:{...g,property:"background-color"},selectedTextColor:{...g,property:"color"},headerRowTextColor:{...c,property:"color"},separatorColor:[{...h,property:"border-bottom-color"},{...b,property:"border-top-color"}],resizeHandleColor:{...y,property:"background-color"}}}),i.e4,i.Ae,(e=>class extends e{#e;init(){super.init?.(),this.handleColumns(),this.forwardSelectedItemsChange(),this.baseElement._mapSorters=()=>{}}forwardSelectedItemsChange(){this.baseElement.addEventListener("selected-items-changed",(e=>{this.dispatchEvent(new CustomEvent("selected-items-changed",{bubbles:!0,composed:!0,detail:e.detail}))}))}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),"columns"===e&&this.setColumnsDataFromAttr()}handleColumns(){this.columnsAttr?this.setColumnsDataFromAttr():this.children.length&&this.setColumnsFromChildren()}setColumnsFromChildren(){this.#e=Array.from(this.children).map((e=>({path:e.getAttribute("path"),header:e.getAttribute("header"),type:e.localName.match("^descope-grid-(\\w+)-column$")?.[1]||"text",attrs:["frozen","resizable","auto-width","status"].reduce(((t,r)=>{const n=e.getAttribute(r);return n&&(t[r]=n),t}),{})})))}get columnsAttr(){return this.getAttribute("columns")}setColumnsDataFromAttr(){try{const e=JSON.parse(this.columnsAttr);s(e)&&(this.columns=e)}catch(e){console.error('could not parse data string from attribute "columns" -',e.message)}}#t=({path:e,header:t,type:r,attrs:n})=>{const o=`descope-grid-${r}-column`;return`<${o} header="${t}" path="${e}" ${Object.entries(n).map((([e,t])=>`${e}="${t}"`)).join(" ")}></${o}>`};get renderColumn(){return this.#t}set renderColumn(e){this.#t=e,this.renderColumns()}getColumnsTemplate(){return this.#e?.reduce?.(((e,t)=>e+(this.renderColumn?.(t||{})||"")),"")}renderColumns(){const e=this.getColumnsTemplate();e&&(this.innerHTML=e)}get grid(){return this.shadowRoot.querySelector("vaadin-grid")}get data(){return this.grid.items}set data(e){if(s(e)&&this.grid.items!==e&&(this.grid.items=e,this.grid.selectedItems)){const e=new Set(this.grid.items.map((e=>e[this.uniqueColumnId]??e))),t=this.grid.selectedItems.filter((t=>e.has(t[this.uniqueColumnId]??t)));this.grid.selectedItems.length!==t.length&&(this.grid.selectedItems=t)}}get columns(){return this.#e}set columns(e){this.#e=e,this.renderColumns()}get paths(){return this.columns.map((e=>e.path))}get uniqueColumnId(){return this.getAttribute("unique-column-id")}}))((0,i.DM)({delegatesFocus:!1,slots:[""],wrappedEleName:"vaadin-grid",style:()=>"\n vaadin-grid {\n overflow: hidden;\n height: 100%;\n min-height: 300px;\n }\n vaadin-grid-cell-content {\n display: flex;\n }\n\t\t",excludeAttrsSync:["columns","tabindex"],componentName:a}));customElements.define(a,f)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9461,3726,5988,7487,3705,4803,7044],{818:(e,t,r)=>{r.d(t,{h:()=>i});var n=r(4567),o=r(1250);const i=e=>class extends e{init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n\t\t\t`,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,n.oP)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,n.Db)(this.inputElement,this,["checked"]),(0,n.tg)(this,this.inputElement,{includeAttrs:["checked"]})}}},6882:(e,t,r)=>{r.d(t,{Z:()=>n});const n=`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,r(4201).DY)()}\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\theight: 0;\n\tmargin: 0;\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`},3483:(e,t,r)=>{r.r(t),r.d(t,{CheckboxClass:()=>f});var n=r(4567),o=r(2061),i=r(1e3),s=r(818),a=r(6882),l=r(4201);const d=(0,n.iY)("checkbox"),{host:c,component:p,checkboxElement:h,checkboxSurface:u,checkboxLabel:m,requiredIndicator:g,helperText:b,errorMessage:y}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.qC)((0,i.yk)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:[c,h,m],fontFamily:[m,b,y],labelTextColor:{...m,property:"color"},labelSpacing:{...m,property:"padding-inline-start"},labelLineHeight:{...m,property:"line-height"},labelFontWeight:{...m,property:"font-weight"},labelRequiredIndicator:{...g,property:"content"},errorMessageTextColor:{...y,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.e4,(0,i.dj)({proxyProps:["value","selectionStart"]}),i.Ae,s.h)((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${a.Z}\n ${(0,l.bi)(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 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 }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n `,excludeAttrsSync:["label","tabindex"],componentName:d}));r(3092),r(9789),r(6676),customElements.define(d,f)},9278:(e,t,r)=>{r.r(t),r.d(t,{componentName:()=>s});var n=r(4567),o=r(7044);class i extends o.C{_defaultRenderer(e,t,r){const n=r.item[this.path]||"",o=Array.from(this.children).find((e=>{const t=e.getAttribute("data-pattern");return!t||new RegExp(t).test(n)}));if(!o)return void(e.innerHTML=r.item[this.path]||"");const i=o.cloneNode(!0);i.innerHTML=n||"",e.innerHTML="",e.append(i)}}const s=(0,n.iY)("grid-custom-column");customElements.define(s,i)},2238:(e,t,r)=>{r.r(t),r.d(t,{componentName:()=>l}),r(3483);var n=r(4567),o=r(8623);const i=()=>{const e=document.createElement("descope-checkbox");return e.setAttribute("bordered","true"),e.setAttribute("size","xs"),e},s=e=>!!e.items?.length&&e.selectedItems.length===e.items.length;class a extends o.w{_onHeaderRendererOrBindingChanged(){}_headerRenderer(e){const t=e.parentNode;let r=e.querySelector("descope-checkbox");r||(r=i(),r.addEventListener("input",(()=>{const e=s(t);t.selectedItems=e?[]:t.items})),e.appendChild(r)),r.setAttribute("checked",s(t))}_defaultRenderer(e,t,r){const n=e.parentNode;let o=e.querySelector("descope-checkbox");o||(o=i(),e.appendChild(o)),o.onchange=()=>{o.checked?n.selectItem(r.item):n.deselectItem(r.item)},o.setAttribute("checked",r.selected)}}const l=(0,n.iY)("grid-selection-column");customElements.define(l,a)},7044:(e,t,r)=>{r.d(t,{C:()=>o});var n=r(322);class o extends n.n{get sortable(){return"true"===this.getAttribute("sortable")}_defaultRenderer(e,t,r){const n=r.item[this.path]||"";e.innerHTML=n,e.title=n,Array.isArray(n)&&(e.innerHTML=n.join(", "))}_defaultHeaderRenderer(e,t){this.sortable?super._defaultHeaderRenderer(e,t):e.innerHTML=this.__getHeader(this.header,this.path)}}},2356:(e,t,r)=>{r.r(t),r.d(t,{componentName:()=>i});var n=r(4567),o=r(7044);const i=(0,n.iY)("grid-text-column");customElements.define(i,o.C)},9950:(e,t,r)=>{r.r(t),r.d(t,{GridClass:()=>f}),r(4595),r(2356),r(9278),r(2238);var n=r(2061),o=r(4567),i=r(1e3);const s=e=>{const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t},a=(0,o.iY)("grid"),{host:l,headerRow:d,headerRowCell:c,contentRow:p,firstRow:h,sortIndicators:u,activeSortIndicator:m,selectedRow:g,rowSeparator:b,resizeHandle:y}={host:{selector:()=>"vaadin-grid"},headerRow:{selector:()=>"::part(header-cell)"},headerRowCell:{selector:()=>"vaadin-grid::part(header-cell)"},contentRow:{selector:()=>"::part(cell)"},firstRow:{selector:()=>"::part(first-header-row-cell)"},selectedRow:{selector:()=>"::part(selected-row-cell)"},sortIndicators:{selector:()=>"vaadin-grid-sorter::part(indicators)"},activeSortIndicator:{selector:()=>"vaadin-grid-sorter[direction]"},rowSeparator:{selector:()=>"vaadin-grid::part(body-cell)"},resizeHandle:{selector:()=>"::part(resize-handle)"}},f=(0,n.qC)((0,i.yk)({componentNameOverride:(0,o.iY)("input-wrapper")}),(0,i.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostHeight:{selector:()=>":host",property:"height"},hostMinHeight:{selector:()=>":host",property:"min-height"},fontFamily:[{...d},{...p}],fontSize:[{...d},{...p}],fontWeight:{...p},valueTextColor:{...p,property:"color"},backgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],sortIndicatorsColor:{...u,property:"color"},activeSortIndicator:{...m,property:"color"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},selectedBackgroundColor:{...g,property:"background-color"},selectedTextColor:{...g,property:"color"},headerRowTextColor:{...c,property:"color"},separatorColor:[{...h,property:"border-bottom-color"},{...b,property:"border-top-color"}],resizeHandleColor:{...y,property:"background-color"}}}),i.e4,i.Ae,(e=>class extends e{#e;init(){super.init?.(),this.handleColumns(),this.forwardSelectedItemsChange(),this.baseElement._mapSorters=()=>{}}forwardSelectedItemsChange(){this.baseElement.addEventListener("selected-items-changed",(e=>{this.dispatchEvent(new CustomEvent("selected-items-changed",{bubbles:!0,composed:!0,detail:e.detail}))}))}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),"columns"===e&&this.setColumnsDataFromAttr()}handleColumns(){this.columnsAttr?this.setColumnsDataFromAttr():this.children.length&&this.setColumnsFromChildren()}setColumnsFromChildren(){this.#e=Array.from(this.children).map((e=>({path:e.getAttribute("path"),header:e.getAttribute("header"),type:e.localName.match("^descope-grid-(\\w+)-column$")?.[1]||"text",attrs:["frozen","resizable","auto-width","status"].reduce(((t,r)=>{const n=e.getAttribute(r);return n&&(t[r]=n),t}),{})})))}get columnsAttr(){return this.getAttribute("columns")}setColumnsDataFromAttr(){try{const e=JSON.parse(this.columnsAttr);s(e)&&(this.columns=e)}catch(e){console.error('could not parse data string from attribute "columns" -',e.message)}}#t=({path:e,header:t,type:r,attrs:n})=>{const o=`descope-grid-${r}-column`;return`<${o} header="${t}" path="${e}" ${Object.entries(n).map((([e,t])=>`${e}="${t}"`)).join(" ")}></${o}>`};get renderColumn(){return this.#t}set renderColumn(e){this.#t=e,this.renderColumns()}getColumnsTemplate(){return this.#e?.reduce?.(((e,t)=>e+(this.renderColumn?.(t||{})||"")),"")}renderColumns(){const e=this.getColumnsTemplate();e&&(this.innerHTML=e)}get grid(){return this.shadowRoot.querySelector("vaadin-grid")}get data(){return this.grid.items}set data(e){if(s(e)&&this.grid.items!==e&&(this.grid.items=e,this.grid.selectedItems)){const e=new Set(this.grid.items.map((e=>e[this.uniqueColumnId]??e))),t=this.grid.selectedItems.filter((t=>e.has(t[this.uniqueColumnId]??t)));this.grid.selectedItems.length!==t.length&&(this.grid.selectedItems=t)}}get columns(){return this.#e}set columns(e){this.#e=e,this.renderColumns()}get paths(){return this.columns.map((e=>e.path))}get uniqueColumnId(){return this.getAttribute("unique-column-id")}}))((0,i.DM)({delegatesFocus:!1,slots:[""],wrappedEleName:"vaadin-grid",style:()=>"\n vaadin-grid {\n overflow: hidden;\n height: 100%;\n min-height: 300px;\n }\n vaadin-grid-cell-content {\n display: flex;\n }\n\t\t",excludeAttrsSync:["columns","tabindex"],componentName:a}));customElements.define(a,f)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9655],{1845:(e,t,n)=>{n.r(t),n.d(t,{NotificationClass:()=>s}),n(6542);var i=n(4567);const o=window.customElements.get("vaadin-notification-container");if(!o)throw new Error("could not get vaadin-notification-container class");customElements.define((0,i.iY)("notification-container"),class extends o{}),n(5400);var a=n(2061),c=n(1e3);const r=(0,i.iY)("notification"),s=(0,a.qC)(c.e4,c.Ae,c._A,(e=>class t extends e{#e;constructor(){super();const e=this;Object.defineProperty(this.baseElement,"_container",{get:()=>(t._container||(t._container=document.createElement("descope-notification-container"),document.body.appendChild(t._container)),t._container.isConnected||setTimeout((()=>e.parentNode.appendChild(t._container))),t._container)}),Object.defineProperty(this.baseElement,"_card",{get:()=>e.#e}),this.baseElement._removeNotificationCard=this.close.bind(this)}close(){this.#e.close()}init(){super.init?.(),this.createCard(),(0,i.oP)(this,this.#e),(0,i.tg)(this.#e,this,{includeAttrs:["opened"]}),this.baseElement.renderer=e=>{Array.from(this.childNodes).forEach((t=>e.appendChild(t)))}}get isContainerEmpty(){return!t._container.children.length}removeContainer(){t._container.remove()}removeNotification(){this.remove(),this.isContainerEmpty&&this.removeContainer()}createCard(){this.#e=document.createElement("descope-notification-card"),this.#e.addEventListener("card-closed",this.removeNotification.bind(this))}}))((0,c.DM)({wrappedEleName:"vaadin-notification",excludeAttrsSync:["tabindex"],componentName:r}));customElements.define(r,s)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9655],{1845:(e,t,n)=>{n.r(t),n.d(t,{NotificationClass:()=>s}),n(6542);var i=n(4567);const o=window.customElements.get("vaadin-notification-container");if(!o)throw new Error("could not get vaadin-notification-container class");customElements.define((0,i.iY)("notification-container"),class extends o{}),n(5400);var a=n(2061),c=n(1e3);const r=(0,i.iY)("notification"),s=(0,a.qC)(c.e4,c.Ae,c._A,(e=>class t extends e{#e;constructor(){super();const e=this;Object.defineProperty(this.baseElement,"_container",{get:()=>(t._container||(t._container=document.createElement("descope-notification-container"),t._container.style.position="absolute",document.body.appendChild(t._container)),t._container.isConnected||setTimeout((()=>e.parentNode.appendChild(t._container))),t._container)}),Object.defineProperty(this.baseElement,"_card",{get:()=>e.#e}),this.baseElement._removeNotificationCard=this.close.bind(this)}close(){this.#e.close()}init(){super.init?.(),this.createCard(),(0,i.oP)(this,this.#e),(0,i.tg)(this.#e,this,{includeAttrs:["opened"]}),this.baseElement.renderer=e=>{Array.from(this.childNodes).forEach((t=>e.appendChild(t)))}}get isContainerEmpty(){return!t._container.children.length}removeContainer(){t._container.remove()}removeNotification(){this.remove(),this.isContainerEmpty&&this.removeContainer()}createCard(){this.#e=document.createElement("descope-notification-card"),this.#e.addEventListener("card-closed",this.removeNotification.bind(this))}}))((0,c.DM)({wrappedEleName:"vaadin-notification",excludeAttrsSync:["tabindex"],componentName:r}));customElements.define(r,s)}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.272",
3
+ "version": "1.0.273",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -9,6 +9,7 @@ export class GridTextColumnClass extends GridSortColumn {
9
9
  _defaultRenderer(cell, _col, model) {
10
10
  const content = model.item[this.path] || '';
11
11
  cell.innerHTML = content;
12
+ cell.title = content;
12
13
  if (Array.isArray(content)) {
13
14
  cell.innerHTML = content.join(', ');
14
15
  }
@@ -25,6 +25,9 @@ const NotificationMixin = (superclass) =>
25
25
  'descope-notification-container'
26
26
  );
27
27
 
28
+ // we are overriding the container position to be absolute because we want to keep in inside the flow/widget boundaries
29
+ NotificationMixinClass._container.style.position = 'absolute';
30
+
28
31
  // we're adding the container to body to avoid Vaadin's container's `openChanged`
29
32
  // from breaking when trying to remove it directly from the body.
30
33
  document.body.appendChild(NotificationMixinClass._container);
@@ -72,7 +72,7 @@ const button = {
72
72
  [helperVars.main]: globalRefs.colors.surface.main,
73
73
  [helperVars.dark]: globalRefs.colors.surface.dark,
74
74
  [helperVars.light]: globalRefs.colors.surface.light,
75
- [helperVars.contrast]: globalRefs.colors.surface.contrast,
75
+ [helperVars.contrast]: globalRefs.colors.surface.light,
76
76
  },
77
77
 
78
78
  variant: {
@@ -68,7 +68,7 @@ const [theme, refs, vars] = createHelperVars(
68
68
  borderColor: globalRefs.colors.surface.main,
69
69
  valueTextColor: globalRefs.colors.surface.dark,
70
70
  placeholderTextColor: globalRefs.colors.surface.dark,
71
- backgroundColor: globalRefs.colors.surface.main,
71
+ backgroundColor: globalRefs.colors.surface.light,
72
72
  },
73
73
  },
74
74
  componentName