@descope/web-components-ui 1.0.285 → 1.0.287

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[5130],{7819:(t,e,i)=>{i.d(e,{Z:()=>l,f:()=>s});var n=i(3878),r=i(4567);const s=(0,r.iY)("mappings-field-internal"),a=(0,n.P)({componentName:s,baseSelector:"div"}),l=class extends a{#t;static get observedAttributes(){return[].concat(a.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(){const t=document.createElement("descope-mapping-item");return t.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(t),(0,r.oP)(this,t,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),t.addEventListener("mapping-item-removed",(e=>{t===this.#t&&(this.resetInvalidIndication(),this.#t=void 0),t.remove(),this.setCustomValidity(""),e.stopPropagation()}))}),0),t}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let i=t.length;i<e.length;i++)this.mappingsContainerEle.removeChild(e[i]);t.forEach(((t,i)=>{const n=e[i];if(n)n.value=t;else{const e=this.addNewMappingItem();setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem()},(0,r.oP)(this,t,{includeAttrs:["disabled"]})}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#t||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#t)&&this.#t?.checkValidity()&&(this.resetInvalidIndication(),this.#t.removeAttribute("invalid"),this.#t=void 0)}))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#e(t){t&&(this.#t=this.items.find((t=>!t.checkValidity())),this.#t?.reportValidity(),this.#t?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#e("true"===i),"readonly"===t&&this.toggleAttribute("inert","true"===i)}}},3820:(t,e,i)=>{i.r(e);var n=i(7819);customElements.define(n.f,n.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[5130],{7819:(t,e,i)=>{i.d(e,{Z:()=>l,f:()=>r});var n=i(3878),s=i(4567);const r=(0,s.iY)("mappings-field-internal"),a=(0,n.P)({componentName:r,baseSelector:"div"}),l=class extends a{#t;static get observedAttributes(){return[].concat(a.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(t){const e=document.createElement("descope-mapping-item");return e.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(e),(0,s.oP)(this,e,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),e.addEventListener("mapping-item-removed",(t=>{e===this.#t&&(this.resetInvalidIndication(),this.#t=void 0),e.remove(),this.setCustomValidity(""),t.stopPropagation()})),t&&e.focus()}),0),e}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let i=t.length;i<e.length;i++)this.mappingsContainerEle.removeChild(e[i]);t.forEach(((t,i)=>{const n=e[i];if(n)n.value=t;else{const e=this.addNewMappingItem(!1);setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem(!0)},(0,s.oP)(this,t,{includeAttrs:["disabled"]})}#e(){this.labelsEle.style.display=this.items.length?"grid":"none"}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#t||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#t)&&this.#t?.checkValidity()&&(this.resetInvalidIndication(),this.#t.removeAttribute("invalid"),this.#t=void 0)})),(0,s.P$)(this.mappingsContainerEle,this.#e.bind(this))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#i(t){t&&(this.#t=this.items.find((t=>!t.checkValidity())),this.#t?.reportValidity(),this.#t?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#i("true"===i),"readonly"===t&&this.toggleAttribute("inert","true"===i)}}},3820:(t,e,i)=>{i.r(e);var n=i(7819);customElements.define(n.f,n.Z)}}]);
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see mapping-fields-descope-mappings-field-index-js.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9299,9662,9483,2934,2528,3172,5130,4567,1e3,4201,3878,4447],{2561:(t,e,i)=>{i.d(e,{s:()=>d});var r=i(2061),n=i(357),s=i(7878);const a=t=>class extends t{#t=s.C.bind(this,"components-context");updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}};var o=i(2666),l=i(8084);const d=({componentName:t,baseSelector:e=""})=>{class i extends HTMLElement{static get componentName(){return t}#e;#i=!0;get baseSelector(){return e}get baseElement(){return this.#e??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#e||console.warn("missing base element for component",this.localName),this.#e}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#i&&(this.#i=!1,this.init?.())}}return(0,r.qC)(n.A,o._,l.Q,a)(i)}},3878:(t,e,i)=>{i.d(e,{P:()=>a});var r=i(2061),n=i(1e3),s=i(2561);const a=(...t)=>(0,r.qC)(n.wX,n.li,n.QT,n.mE)((0,s.s)(...t))},9690:(t,e,i)=>{i.d(e,{n:()=>u,f:()=>a});var r=i(2061),n=i(4567),s=i(1e3);const a=(0,n.iY)("button"),{host:o,label:l}={host:{selector:()=>":host"},label:{selector:"::part(label)"}};let d;const u=(0,r.qC)((0,s.yk)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...o,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],labelTextColor:{property:"color"},labelTextDecoration:{...l,property:"text-decoration"},labelSpacing:{...l,property:"gap"},textAlign:{...l,property:"justify-content",fallback:"center"}}}),(t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}),s.e4,s.Ae)((0,s.DM)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${d}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${u.cssVarList.outlineWidth}) + var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${u.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${u.cssVarList.hostHeight}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${u.cssVarList.hostWidth}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:a})),{color:p,fontSize:h}=u.cssVarList;d=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${p});\n\t\ttop: calc(50% - (var(${h}) / 2));\n\t\tleft: calc(50% - (var(${h}) / 2));\n\t\tborder-width: calc(var(${h}) / 10);\n\t\twidth: var(${h});\n\t\theight: var(${h});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"])::part(prefix),\n\t:host([loading="true"])::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},2018:(t,e,i)=>{i.r(e),i.d(e,{ButtonClass:()=>r.n}),i(1721);var r=i(9690);customElements.define(r.f,r.n)},4049:(t,e,i)=>{i.d(e,{H:()=>y,f:()=>o});var r=i(2061),n=i(4567),s=i(4201),a=i(1e3);const o=(0,n.iY)("combo-box"),{host:l,inputField:d,inputElement:u,placeholder:p,toggle:h,clearButton:c,label:m,requiredIndicator:b,helperText:g,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,r.qC)((0,a.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[m,p,d,g,v],labelTextColor:[{...m,property:"color"},{...b,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...d,property:"height"},inputBackgroundColor:{...d,property:"background-color"},inputBorderColor:{...d,property:"border-color"},inputBorderWidth:{...d,property:"border-width"},inputBorderStyle:{...d,property:"border-style"},inputBorderRadius:{...d,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...d,property:"color"},inputPlaceholderTextColor:{...p,property:"color"},inputDropdownButtonCursor:[{...h,property:"cursor"},{...c,property:"cursor"}],inputDropdownButtonColor:[{...h,property:"color"},{...c,property:"color"}],inputDropdownButtonSize:[{...h,property:"font-size"},{...c,property:"font-size"}],inputDropdownButtonOffset:[{...h,property:"margin-right"},{...h,property:"margin-left"}],inputOutlineColor:{...d,property:"outline-color"},inputOutlineWidth:{...d,property:"outline-width"},inputOutlineStyle:{...d,property:"outline-style"},inputOutlineOffset:{...d,property:"outline-offset"},inputHorizontalPadding:[{...u,property:"padding-left"},{...u,property:"padding-right"}],overlayBackground:{property:()=>y.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>y.cssVarList.overlay.textColor},overlayBorder:{property:()=>y.cssVarList.overlay.border},overlayFontSize:{property:()=>y.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>y.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>y.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>y.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>y.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>y.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(t=>class extends t{#r=({displayName:t,value:e,label:i})=>`<span data-name="${i}" data-id="${e}">${t||i}</span>`;#n;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#r}set renderItem(t){this.#r=t,this.renderItems()}get data(){if(this.#n)return this.#n;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#n=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(i){if(!e.baseElement.items?.length)return;const r=e.customValueTransformFn(i)||"";r!==this.value&&t.set.call(this,r)}}})}#s(){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"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,i)=>{t.innerHTML=i.item.outerHTML}}#a(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#a(),this.renderItems(),(0,n.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.P$)(this,this.#s.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((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\t${(0,s.bi)(y.cssVarList)}\n\t\t${(0,s.PH)("vaadin-combo-box")}\n\t\t${(0,s.jI)("vaadin-combo-box")}\n\t\t${(0,s.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\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\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,s.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:o,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,i)=>{i.r(e),i.d(e,{ComboBoxClass:()=>r.H}),i(7583);var r=i(4049);customElements.define(r.f,r.H)},6417:(t,e,i)=>{i.d(e,{f:()=>l,z:()=>u});var r=i(1e3),n=i(4447),s=i(2061),a=i(4567),o=i(4201);const l=(0,a.iY)("text-field"),d=["type"],u=(0,s.qC)((0,r.yk)({mappings:n.Z}),r.e4,(0,r.dj)({proxyProps:["value","selectionStart"]}),r.Ae,(t=>class extends t{static get observedAttributes(){return d.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangeCallback?.(t,e,i),"type"===t&&this.baseElement._setType(i)}}))((0,r.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${u.cssVarList.inputOutlineWidth}) + var(${u.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,o.Wf)("vaadin-text-field")}\n\t\t\t${(0,o.bi)(u.cssVarList)}\n\t\t\t${(0,o.wm)("vaadin-text-field",u.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(t,e,i)=>{i.r(e),i.d(e,{TextFieldClass:()=>r.z}),i(9789);var r=i(6417);customElements.define(r.f,r.z)},4447:(t,e,i)=>{i.d(e,{Z:()=>c});const{host:r,label:n,placeholder:s,requiredIndicator:a,inputField:o,input:l,helperText:d,errorMessage:u,disabledPlaceholder:p,inputDisabled:h}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},c={fontSize:[{},r],fontFamily:[n,o,d,u],hostWidth:{...r,property:"width"},hostMinWidth:{...r,property:"min-width"},hostDirection:{...r,property:"direction"},inputBackgroundColor:{...o,property:"background-color"},labelTextColor:[{...n,property:"color"},{...a,property:"color"},{...n,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...u,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...o,property:"color"},{...h,property:"-webkit-text-fill-color"}],inputCaretTextColor:{...l,property:"color"},labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...o,property:"border-color"},inputBorderWidth:{...o,property:"border-width"},inputBorderStyle:{...o,property:"border-style"},inputBorderRadius:{...o,property:"border-radius"},inputHeight:{...o,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"}],inputOutlineColor:{...o,property:"outline-color"},inputOutlineStyle:{...o,property:"outline-style"},inputOutlineWidth:{...o,property:"outline-width"},inputOutlineOffset:{...o,property:"outline-offset"},inputTextAlign:{...l,property:"text-align"},inputPlaceholderColor:[{...s,property:"color"},{...p,property:"-webkit-text-fill-color"}]}},2138:(t,e,i)=>{i.d(e,{f:()=>o,k:()=>d});var r=i(1e3),n=i(2561),s=i(2061),a=i(4567);const o=(0,a.iY)("text");class l extends((0,n.s)({componentName:o,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t:host > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t\t"}}const d=(0,s.qC)((0,r.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),r.e4,r.Ae,(t=>class extends t{get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,a.P$)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}))(l)},1876:(t,e,i)=>{i.r(e),i.d(e,{TextClass:()=>r.k});var r=i(2138);customElements.define(r.f,r.k)},6751:(t,e,i)=>{i.r(e);var r=i(3878),n=i(4567);const s=(0,n.iY)("mapping-item"),a=["size","bordered","readonly","full-width","disabled"],o=(0,r.P)({componentName:s,baseSelector:"div"});customElements.define(s,class extends o{static get observedAttributes(){return[].concat(o.observedAttributes||[],a,["separator","options","invalid","disabled"])}get separator(){return this.getAttribute("separator")||"map to"}get value(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{[t]:e}:null}set value(t){if(1!==Object.entries(t).length)return void console.error("descope-mapping item expected expects only one key-value pair in the value but received: ",t);const[e,i]=Object.entries(t)[0];this.valueInput.value=i,this.attributeInput.value=e,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n .wrapper {\n display: flex;\n }\n .separator {\n text-align: center;\n flex-shrink: 0;\n }\n </style>\n <div class="wrapper" part="wrapper">\n <descope-text-field required="true"></descope-text-field>\n <div class="separator" part="separator">${this.separator}</div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n required="true"\n >\n </descope-combo-box>\n <descope-button variant="link" mode="primary">\n <vaadin-icon icon="vaadin:minus"></vaadin-icon>\n </descope-button>\n </div>\n\t`,this.valueInput=this.shadowRoot.querySelector("descope-text-field"),this.attributeInput=this.shadowRoot.querySelector("descope-combo-box"),this.inputs=[this.valueInput,this.attributeInput],this.removeButton=this.shadowRoot.querySelector("descope-button"),(0,n.oP)(this,this.valueInput,{includeAttrs:a}),(0,n.oP)(this,this.attributeInput,{includeAttrs:[...a,"options"],mapAttrs:{options:"data"}}),(0,n.oP)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed"))))}init(){super.init?.(),this.initRemoveButton()}getValidity(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{}:{badInput:!0}}reportValidity(){this.inputs.forEach((t=>t.reportValidity()))}focus(){(this.checkValidity()||!this.valueInput.checkValidity()?this.valueInput:this.attributeInput).focus()}handleSeparatorChange(){this.shadowRoot.querySelector(".separator").textContent=this.separator}#o(t){"true"===t&&(this.valueInput.value||(this.valueInput.setAttribute("invalid","true"),this.valueInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)),this.attributeInput.value||(this.attributeInput.setAttribute("invalid","true"),this.attributeInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#o(i)}})},7819:(t,e,i)=>{i.d(e,{Z:()=>o,f:()=>s});var r=i(3878),n=i(4567);const s=(0,n.iY)("mappings-field-internal"),a=(0,r.P)({componentName:s,baseSelector:"div"}),o=class extends a{#l;static get observedAttributes(){return[].concat(a.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(){const t=document.createElement("descope-mapping-item");return t.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(t),(0,n.oP)(this,t,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),t.addEventListener("mapping-item-removed",(e=>{t===this.#l&&(this.resetInvalidIndication(),this.#l=void 0),t.remove(),this.setCustomValidity(""),e.stopPropagation()}))}),0),t}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let i=t.length;i<e.length;i++)this.mappingsContainerEle.removeChild(e[i]);t.forEach(((t,i)=>{const r=e[i];if(r)r.value=t;else{const e=this.addNewMappingItem();setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem()},(0,n.oP)(this,t,{includeAttrs:["disabled"]})}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#l||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#l)&&this.#l?.checkValidity()&&(this.resetInvalidIndication(),this.#l.removeAttribute("invalid"),this.#l=void 0)}))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#d(t){t&&(this.#l=this.items.find((t=>!t.checkValidity())),this.#l?.reportValidity(),this.#l?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#d("true"===i),"readonly"===t&&this.toggleAttribute("inert","true"===i)}}},3820:(t,e,i)=>{i.r(e);var r=i(7819);customElements.define(r.f,r.Z)},3325:(t,e,i)=>{i.r(e),i.d(e,{MappingsFieldClass:()=>q}),i(1195),i(9098),i(9416),i(4173);var r=i(2982),n=i(1251),s=i(6570);const a=s.iv`
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9299,9662,9483,2934,2528,3172,5130,4567,1e3,4201,3878,4447],{2561:(t,e,i)=>{i.d(e,{s:()=>d});var r=i(2061),n=i(357),s=i(7878);const a=t=>class extends t{#t=s.C.bind(this,"components-context");updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}};var o=i(2666),l=i(8084);const d=({componentName:t,baseSelector:e=""})=>{class i extends HTMLElement{static get componentName(){return t}#e;#i=!0;get baseSelector(){return e}get baseElement(){return this.#e??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#e||console.warn("missing base element for component",this.localName),this.#e}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#i&&(this.#i=!1,this.init?.())}}return(0,r.qC)(n.A,o._,l.Q,a)(i)}},3878:(t,e,i)=>{i.d(e,{P:()=>a});var r=i(2061),n=i(1e3),s=i(2561);const a=(...t)=>(0,r.qC)(n.wX,n.li,n.QT,n.mE)((0,s.s)(...t))},9690:(t,e,i)=>{i.d(e,{n:()=>p,f:()=>a});var r=i(2061),n=i(4567),s=i(1e3);const a=(0,n.iY)("button"),{host:o,label:l}={host:{selector:()=>":host"},label:{selector:"::part(label)"}};let d;const p=(0,r.qC)((0,s.yk)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...o,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],labelTextColor:{property:"color"},labelTextDecoration:{...l,property:"text-decoration"},labelSpacing:{...l,property:"gap"},textAlign:{...l,property:"justify-content",fallback:"center"}}}),(t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}),s.e4,s.Ae)((0,s.DM)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${d}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${p.cssVarList.outlineWidth}) + var(${p.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${p.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${p.cssVarList.hostHeight}) - var(${p.cssVarList.outlineWidth}) - var(${p.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${p.cssVarList.hostWidth}) - var(${p.cssVarList.outlineWidth}) - var(${p.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:a})),{color:u,fontSize:h}=p.cssVarList;d=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${u});\n\t\ttop: calc(50% - (var(${h}) / 2));\n\t\tleft: calc(50% - (var(${h}) / 2));\n\t\tborder-width: calc(var(${h}) / 10);\n\t\twidth: var(${h});\n\t\theight: var(${h});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"])::part(prefix),\n\t:host([loading="true"])::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},2018:(t,e,i)=>{i.r(e),i.d(e,{ButtonClass:()=>r.n}),i(1721);var r=i(9690);customElements.define(r.f,r.n)},4049:(t,e,i)=>{i.d(e,{H:()=>y,f:()=>o});var r=i(2061),n=i(4567),s=i(4201),a=i(1e3);const o=(0,n.iY)("combo-box"),{host:l,inputField:d,inputElement:p,placeholder:u,toggle:h,clearButton:c,label:m,requiredIndicator:b,helperText:g,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,r.qC)((0,a.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[m,u,d,g,v],labelTextColor:[{...m,property:"color"},{...b,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...d,property:"height"},inputBackgroundColor:{...d,property:"background-color"},inputBorderColor:{...d,property:"border-color"},inputBorderWidth:{...d,property:"border-width"},inputBorderStyle:{...d,property:"border-style"},inputBorderRadius:{...d,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...d,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},inputDropdownButtonCursor:[{...h,property:"cursor"},{...c,property:"cursor"}],inputDropdownButtonColor:[{...h,property:"color"},{...c,property:"color"}],inputDropdownButtonSize:[{...h,property:"font-size"},{...c,property:"font-size"}],inputDropdownButtonOffset:[{...h,property:"margin-right"},{...h,property:"margin-left"}],inputOutlineColor:{...d,property:"outline-color"},inputOutlineWidth:{...d,property:"outline-width"},inputOutlineStyle:{...d,property:"outline-style"},inputOutlineOffset:{...d,property:"outline-offset"},inputHorizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],overlayBackground:{property:()=>y.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>y.cssVarList.overlay.textColor},overlayBorder:{property:()=>y.cssVarList.overlay.border},overlayFontSize:{property:()=>y.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>y.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>y.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>y.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>y.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>y.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(t=>class extends t{#r=({displayName:t,value:e,label:i})=>`<span data-name="${i}" data-id="${e}">${t||i}</span>`;#n;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#r}set renderItem(t){this.#r=t,this.renderItems()}get data(){if(this.#n)return this.#n;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#n=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(i){if(!e.baseElement.items?.length)return;const r=e.customValueTransformFn(i)||"";r!==this.value&&t.set.call(this,r)}}})}#s(){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"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,i)=>{t.innerHTML=i.item.outerHTML}}#a(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#a(),this.renderItems(),(0,n.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.P$)(this,this.#s.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((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\t${(0,s.bi)(y.cssVarList)}\n\t\t${(0,s.PH)("vaadin-combo-box")}\n\t\t${(0,s.jI)("vaadin-combo-box")}\n\t\t${(0,s.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\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\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,s.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:o,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,i)=>{i.r(e),i.d(e,{ComboBoxClass:()=>r.H}),i(7583);var r=i(4049);customElements.define(r.f,r.H)},6417:(t,e,i)=>{i.d(e,{f:()=>l,z:()=>p});var r=i(1e3),n=i(4447),s=i(2061),a=i(4567),o=i(4201);const l=(0,a.iY)("text-field"),d=["type"],p=(0,s.qC)((0,r.yk)({mappings:n.Z}),r.e4,(0,r.dj)({proxyProps:["value","selectionStart"]}),r.Ae,(t=>class extends t{static get observedAttributes(){return d.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangeCallback?.(t,e,i),"type"===t&&this.baseElement._setType(i)}}))((0,r.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${p.cssVarList.inputOutlineWidth}) + var(${p.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,o.Wf)("vaadin-text-field")}\n\t\t\t${(0,o.bi)(p.cssVarList)}\n\t\t\t${(0,o.wm)("vaadin-text-field",p.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(t,e,i)=>{i.r(e),i.d(e,{TextFieldClass:()=>r.z}),i(9789);var r=i(6417);customElements.define(r.f,r.z)},4447:(t,e,i)=>{i.d(e,{Z:()=>c});const{host:r,label:n,placeholder:s,requiredIndicator:a,inputField:o,input:l,helperText:d,errorMessage:p,disabledPlaceholder:u,inputDisabled:h}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},c={fontSize:[{},r],fontFamily:[n,o,d,p],hostWidth:{...r,property:"width"},hostMinWidth:{...r,property:"min-width"},hostDirection:{...r,property:"direction"},inputBackgroundColor:{...o,property:"background-color"},labelTextColor:[{...n,property:"color"},{...a,property:"color"},{...n,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...p,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...o,property:"color"},{...h,property:"-webkit-text-fill-color"}],inputCaretTextColor:{...l,property:"color"},labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...o,property:"border-color"},inputBorderWidth:{...o,property:"border-width"},inputBorderStyle:{...o,property:"border-style"},inputBorderRadius:{...o,property:"border-radius"},inputHeight:{...o,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"}],inputOutlineColor:{...o,property:"outline-color"},inputOutlineStyle:{...o,property:"outline-style"},inputOutlineWidth:{...o,property:"outline-width"},inputOutlineOffset:{...o,property:"outline-offset"},inputTextAlign:{...l,property:"text-align"},inputPlaceholderColor:[{...s,property:"color"},{...u,property:"-webkit-text-fill-color"}]}},2138:(t,e,i)=>{i.d(e,{f:()=>o,k:()=>d});var r=i(1e3),n=i(2561),s=i(2061),a=i(4567);const o=(0,a.iY)("text");class l extends((0,n.s)({componentName:o,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t:host > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t\t"}}const d=(0,s.qC)((0,r.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),r.e4,r.Ae,(t=>class extends t{get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,a.P$)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}))(l)},1876:(t,e,i)=>{i.r(e),i.d(e,{TextClass:()=>r.k});var r=i(2138);customElements.define(r.f,r.k)},6751:(t,e,i)=>{i.r(e);var r=i(3878),n=i(4567);const s=(0,n.iY)("mapping-item"),a=["size","bordered","readonly","full-width","disabled"],o=(0,r.P)({componentName:s,baseSelector:"div"});customElements.define(s,class extends o{static get observedAttributes(){return[].concat(o.observedAttributes||[],a,["separator","options","invalid","disabled"])}get separator(){return this.getAttribute("separator")||"map to"}get value(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{[t]:e}:null}set value(t){if(1!==Object.entries(t).length)return void console.error("descope-mapping item expected expects only one key-value pair in the value but received: ",t);const[e,i]=Object.entries(t)[0];this.valueInput.value=i,this.attributeInput.value=e,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n .wrapper {\n display: flex;\n }\n .separator {\n text-align: center;\n flex-shrink: 0;\n }\n </style>\n <div class="wrapper" part="wrapper">\n <descope-text-field required="true"></descope-text-field>\n <div class="separator" part="separator">${this.separator}</div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n required="true"\n >\n </descope-combo-box>\n <descope-button variant="link" mode="primary">\n <vaadin-icon icon="vaadin:minus"></vaadin-icon>\n </descope-button>\n </div>\n\t`,this.valueInput=this.shadowRoot.querySelector("descope-text-field"),this.attributeInput=this.shadowRoot.querySelector("descope-combo-box"),this.inputs=[this.valueInput,this.attributeInput],this.removeButton=this.shadowRoot.querySelector("descope-button"),(0,n.oP)(this,this.valueInput,{includeAttrs:a}),(0,n.oP)(this,this.attributeInput,{includeAttrs:[...a,"options"],mapAttrs:{options:"data"}}),(0,n.oP)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed"))))}init(){super.init?.(),this.initRemoveButton()}getValidity(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{}:{badInput:!0}}reportValidity(){this.inputs.forEach((t=>t.reportValidity()))}focus(){(this.checkValidity()||!this.valueInput.checkValidity()?this.valueInput:this.attributeInput).focus()}handleSeparatorChange(){this.shadowRoot.querySelector(".separator").textContent=this.separator}#o(t){"true"===t&&(this.valueInput.value||(this.valueInput.setAttribute("invalid","true"),this.valueInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)),this.attributeInput.value||(this.attributeInput.setAttribute("invalid","true"),this.attributeInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#o(i)}})},7819:(t,e,i)=>{i.d(e,{Z:()=>o,f:()=>s});var r=i(3878),n=i(4567);const s=(0,n.iY)("mappings-field-internal"),a=(0,r.P)({componentName:s,baseSelector:"div"}),o=class extends a{#l;static get observedAttributes(){return[].concat(a.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(t){const e=document.createElement("descope-mapping-item");return e.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(e),(0,n.oP)(this,e,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),e.addEventListener("mapping-item-removed",(t=>{e===this.#l&&(this.resetInvalidIndication(),this.#l=void 0),e.remove(),this.setCustomValidity(""),t.stopPropagation()})),t&&e.focus()}),0),e}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let i=t.length;i<e.length;i++)this.mappingsContainerEle.removeChild(e[i]);t.forEach(((t,i)=>{const r=e[i];if(r)r.value=t;else{const e=this.addNewMappingItem(!1);setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem(!0)},(0,n.oP)(this,t,{includeAttrs:["disabled"]})}#d(){this.labelsEle.style.display=this.items.length?"grid":"none"}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#l||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#l)&&this.#l?.checkValidity()&&(this.resetInvalidIndication(),this.#l.removeAttribute("invalid"),this.#l=void 0)})),(0,n.P$)(this.mappingsContainerEle,this.#d.bind(this))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#p(t){t&&(this.#l=this.items.find((t=>!t.checkValidity())),this.#l?.reportValidity(),this.#l?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#p("true"===i),"readonly"===t&&this.toggleAttribute("inert","true"===i)}}},3820:(t,e,i)=>{i.r(e);var r=i(7819);customElements.define(r.f,r.Z)},3325:(t,e,i)=>{i.r(e),i.d(e,{MappingsFieldClass:()=>P}),i(1195),i(9098),i(9416),i(4173);var r=i(2982),n=i(1251),s=i(6570);const a=s.iv`
3
3
  :host {
4
4
  --lumo-text-field-size: var(--lumo-size-m);
5
5
  color: var(--lumo-body-text-color);
@@ -76,7 +76,7 @@
76
76
  :host([theme~='whitespace'][has-label]) [part='label'] {
77
77
  padding-bottom: 0.5em;
78
78
  }
79
- `;(0,s.hC)("vaadin-custom-field",[n.l,r._,a],{moduleId:"lumo-custom-field"});var o=i(4241),l=i(2807),d=i(2521),u=i(1360),p=i(2628),h=i(3726),c=i(4463),m=i(7412);const b=t=>t.split("\t"),g=t=>t.join("\t"),v=t=>class extends((0,m.f)((0,u.W)((0,p.L)(t)))){static get properties(){return{name:String,value:{type:String,observer:"__valueChanged",notify:!0},inputs:{type:Array,readOnly:!0},formatValue:{type:Function},parseValue:{type:Function}}}ready(){super.ready(),this.setAttribute("role","group"),this.ariaTarget=this,this.__childrenObserver=new MutationObserver((()=>{this.__setInputsFromSlot()})),this.__setInputsFromSlot(),this.$.slot.addEventListener("slotchange",(()=>{this.__setInputsFromSlot(),(0,h.xX)(this.$.slot).filter((t=>!this.__isInput(t))).forEach((t=>{this.__childrenObserver.observe(t,{childList:!0})}))})),this._tooltipController=new c.f(this),this.addController(this._tooltipController),this._tooltipController.setShouldShow((t=>!(t.inputs||[]).some((t=>t.opened))))}focus(){this.inputs&&this.inputs[0]&&this.inputs[0].focus()}_setFocused(t){super._setFocused(t),t||this.validate()}_shouldRemoveFocus(t){const{relatedTarget:e}=t;return!this.inputs.some((t=>e===(t.focusElement||t)))}checkValidity(){return!(this.inputs.filter((t=>!(t.validate||t.checkValidity).call(t))).length||this.required&&!this.value.trim())}_onKeyDown(t){"Tab"===t.key&&(this.inputs.indexOf(t.target)<this.inputs.length-1&&!t.shiftKey||this.inputs.indexOf(t.target)>0&&t.shiftKey?this.dispatchEvent(new CustomEvent("internal-tab")):this.__setValue())}_onInputChange(t){t.stopPropagation(),this.__setValue(),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))}__setValue(){this.__settingValue=!0;const t=this.formatValue||g;this.value=t.apply(this,[this.inputs.map((t=>t.value))]),this.__settingValue=!1}__isInput(t){return!("input"===t.getAttribute("slot")||"textarea"===t.getAttribute("slot"))&&(t.validate||t.checkValidity)}__getInputsFromSlot(){return(0,h.xX)(this.$.slot).filter((t=>this.__isInput(t)))}__setInputsFromSlot(){this._setInputs(this.__getInputsFromSlot()),this.__setValue()}__toggleHasValue(t){this.toggleAttribute("has-value",null!==t&&""!==t.trim())}__valueChanged(t,e){if(this.__settingValue||!this.inputs)return;this.__toggleHasValue(t);const i=(this.parseValue||b).apply(this,[t]);i&&0!==i.length?(this.inputs.forEach(((t,e)=>{t.value=i[e]})),void 0!==e&&this.validate()):console.warn("Value parser has not provided values array")}},y=i(9392).iv`
79
+ `;(0,s.hC)("vaadin-custom-field",[n.l,r._,a],{moduleId:"lumo-custom-field"});var o=i(4241),l=i(2807),d=i(2521),p=i(1360),u=i(2628),h=i(3726),c=i(4463),m=i(7412);const b=t=>t.split("\t"),g=t=>t.join("\t"),v=t=>class extends((0,m.f)((0,p.W)((0,u.L)(t)))){static get properties(){return{name:String,value:{type:String,observer:"__valueChanged",notify:!0},inputs:{type:Array,readOnly:!0},formatValue:{type:Function},parseValue:{type:Function}}}ready(){super.ready(),this.setAttribute("role","group"),this.ariaTarget=this,this.__childrenObserver=new MutationObserver((()=>{this.__setInputsFromSlot()})),this.__setInputsFromSlot(),this.$.slot.addEventListener("slotchange",(()=>{this.__setInputsFromSlot(),(0,h.xX)(this.$.slot).filter((t=>!this.__isInput(t))).forEach((t=>{this.__childrenObserver.observe(t,{childList:!0})}))})),this._tooltipController=new c.f(this),this.addController(this._tooltipController),this._tooltipController.setShouldShow((t=>!(t.inputs||[]).some((t=>t.opened))))}focus(){this.inputs&&this.inputs[0]&&this.inputs[0].focus()}_setFocused(t){super._setFocused(t),t||this.validate()}_shouldRemoveFocus(t){const{relatedTarget:e}=t;return!this.inputs.some((t=>e===(t.focusElement||t)))}checkValidity(){return!(this.inputs.filter((t=>!(t.validate||t.checkValidity).call(t))).length||this.required&&!this.value.trim())}_onKeyDown(t){"Tab"===t.key&&(this.inputs.indexOf(t.target)<this.inputs.length-1&&!t.shiftKey||this.inputs.indexOf(t.target)>0&&t.shiftKey?this.dispatchEvent(new CustomEvent("internal-tab")):this.__setValue())}_onInputChange(t){t.stopPropagation(),this.__setValue(),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))}__setValue(){this.__settingValue=!0;const t=this.formatValue||g;this.value=t.apply(this,[this.inputs.map((t=>t.value))]),this.__settingValue=!1}__isInput(t){return!("input"===t.getAttribute("slot")||"textarea"===t.getAttribute("slot"))&&(t.validate||t.checkValidity)}__getInputsFromSlot(){return(0,h.xX)(this.$.slot).filter((t=>this.__isInput(t)))}__setInputsFromSlot(){this._setInputs(this.__getInputsFromSlot()),this.__setValue()}__toggleHasValue(t){this.toggleAttribute("has-value",null!==t&&""!==t.trim())}__valueChanged(t,e){if(this.__settingValue||!this.inputs)return;this.__toggleHasValue(t);const i=(this.parseValue||b).apply(this,[t]);i&&0!==i.length?(this.inputs.forEach(((t,e)=>{t.value=i[e]})),void 0!==e&&this.validate()):console.warn("Value parser has not provided values array")}},y=i(9392).iv`
80
80
  :host {
81
81
  display: inline-flex;
82
82
  }
@@ -123,4 +123,4 @@
123
123
  </div>
124
124
 
125
125
  <slot name="tooltip"></slot>
126
- `}}(0,l.M)(f),i(7911),i(6594);var x=i(1e3),E=i(1876),w=i(2061),C=i(4567),A=i(7819);const S=(0,C.iY)("mappings-field"),I="80px",V="60px",{host:$,helperText:k,errorMessage:T,mappingItem:L,labels:M,valueLabel:_,attrLabel:O,separator:P}={host:{selector:()=>":host"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},mappingItem:{selector:"descope-mapping-item::part(wrapper)"},labels:{selector:'descope-mappings-field-internal [part="labels"] descope-text'},valueLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="value-label"]'},attrLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="attr-label"]'},separator:{selector:"descope-mapping-item::part(separator)"}},q=(0,w.qC)((0,x.yk)({mappings:{hostWidth:{...$,property:"width"},hostDirection:{...$,property:"direction"},fontSize:[{},$,{...P,property:"margin-top"}],fontFamily:[k,T,M],separatorFontSize:{...P,property:"font-size"},labelTextColor:{...M,property:E.TextClass.cssVarList.textColor},itemMarginBottom:{...L,property:"margin-bottom"},valueLabelMinWidth:{..._,property:"min-width"},attrLabelMinWidth:{...O,property:"min-width"}}}),x.e4,(0,x.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),x.Ae,(t=>class extends t{get defaultValues(){const t=this.getAttribute("default-values");if(t)try{return JSON.parse(t)}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){const t=this.defaultValues;Object.keys(t).length>0&&(this.inputElement.value=t)}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${A.f}\n tabindex="-1"\n ></${A.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(A.f),(0,C.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),this.setDefaultValues()}}))((0,x.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-mappings-field-internal [part="labels"] {\n margin-bottom: 0.5em;\n display: grid;\n grid-template-columns: 1fr ${I} 1fr ${V};\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"],\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n ${E.TextClass.cssVarList.fontWeight}: 500;\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"] {\n grid-column: 1 / span 1;\n }\n\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n grid-column: 3 / span 1;\n }\n\n descope-mapping-item::part(wrapper) {\n display: grid;\n grid-template-columns: 1fr ${I} 1fr ${V};\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:S}));i(2018),i(9357),i(1294),i(3820),i(6751),customElements.define(S,q)},5279:(t,e,i)=>{i.d(e,{gh:()=>r,k4:()=>n,qM:()=>a,qg:()=>s});const r="descope",n=3,s="host",a="@"},4567:(t,e,i)=>{i.d(e,{Db:()=>h,FX:()=>s,P$:()=>a,Tk:()=>u,iY:()=>d,oP:()=>p,tg:()=>l});var r=i(2061),n=i(5279);const s=(t,e,{excludeAttrs:i=[],includeAttrs:r=[]})=>{const n=Array.from(t.attributes).filter((t=>!i.includes(t.name)&&(!r.length||r.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{t.forEach((t=>{"attributes"!==t.type||i.includes(t.attributeName)||r.length&&!r.includes(t.attributeName)||e([t.attributeName])}))})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&e(t)}))})).observe(t,{childList:!0})},o=(t,e,i={})=>r=>{r.forEach((r=>{const n=i[r]||r,s=t.getAttribute(r);null!==s?e.getAttribute(n)!==s&&e.setAttribute(n,s):e.removeAttribute(n)}))},l=(t,e,i)=>{s(t,o(t,e),i),s(e,o(e,t),i)},d=t=>(0,r.E3)(n.gh,t),u=(...t)=>`--${(0,r.E3)(...t)}`,p=(t,e,i={})=>{s(t,o(t,e,i.mapAttrs),i)},h=(t,e,i=[])=>{if(!i.length)return;const r=i.reduce(((e,i)=>Object.assign(e,{[i]:{get:()=>t[i],set(e){t[i]=e}}})),{});Object.defineProperties(e,r)}},2061:(t,e,i)=>{i.d(e,{E3:()=>n,GL:()=>r,lo:()=>o,mf:()=>a,qC:()=>s});const r=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>r(t.filter((t=>!!t)).join("-")),s=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t,o=(t,e)=>{if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;const i=t.slice().sort(),r=e.slice().sort();for(let t=0;t<i.length;t++)if(i[t]!==r[t])return!1;return!0}},7878:(t,e,i)=>{function r(t,e={}){const i=new Event(t,e);this[`on${t}`]?.(i),this.dispatchEvent(i)}i.d(e,{C:()=>r})},4201:(t,e,i)=>{i.d(e,{B:()=>u,DY:()=>l,PH:()=>d,Pd:()=>a,TX:()=>n,Wf:()=>h,bi:()=>r,jI:()=>o,jl:()=>s,wm:()=>p});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,n=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,s=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`,o=(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`,u=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${n(t)}\n ${a(t)}\n ${o(t)}\n ${s(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 ${u(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`},357:(t,e,i)=>{i.d(e,{A:()=>r});const r=t=>class extends t{#u(){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.#u()}}},2666:(t,e,i)=>{i.d(e,{_:()=>r});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})}))}}},1e3:(t,e,i)=>{i.d(e,{li:()=>A,Ae:()=>x.A,DM:()=>c,yk:()=>d,e4:()=>u,_A:()=>E._,mE:()=>I,wX:()=>b,QT:()=>S.Q,Iw:()=>C,dj:()=>f});var r=i(5279),n=i(2061),s=i(4567),a=i(5561);class o{constructor(){this.styleMap=new Map}add(t,e,i){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:i}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,i])=>`${t}${e} { \n${i.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const l=(t,e)=>Object.keys(e).reduce(((e,i)=>Object.assign(e,{[i]:(0,s.Tk)(t,i)})),{}),d=({mappings:t={},componentNameOverride:e=""})=>i=>{const d=e||i.componentName;return class extends i{static get cssVarList(){return{...i.cssVarList,...l(d,{...t})}}#p;#h;#c;#m;#b;#g;#v;#y;#f;constructor({getRootElement:e,componentNameSuffix:i="",themeSection:s=r.qg,baseSelector:a}={}){super(),this.#m=i,this.#b=s,this.#v=a??this.baseSelector,this.#f=e,this.#y=Object.keys(t).map((t=>(0,n.E3)("st",i,t)))}get#x(){return a.componentsThemeManager.currentTheme?.[d]||""}#E(){this.#h.innerHTML=this.#x[this.#b]}#w(){this.#h=document.createElement("style"),this.#h.id=`style-mixin-theme__${d}`,this.#g.prepend(this.#h),this.#c=a.componentsThemeManager.onCurrentThemeChange(this.#E.bind(this)),this.#E()}#C(){if(this.#y.length){this.#p=document.createElement("style"),this.#p.id=`style-mixin-overrides__${d}`;const i=(t=d,e=r.k4,Array(e).fill(`.${t}`).join(""));this.#p.innerText=`:host(${i}) {}`,this.#g.append(this.#p)}var t,e}#A(t,e){const i=this.#p?.sheet?.cssRules[0].style;if(!i)return;const r=(0,s.Tk)(d,t.replace(new RegExp("^st-"),""));e?i?.setProperty(r,e):(i?.removeProperty(r),this.removeAttribute(t))}#S(t=[]){let e=!1;t.forEach((t=>{this.#y.includes(t)&&(this.#A(t,this.getAttribute(t)),e=!0)})),e&&(this.#p.innerHTML=this.#p?.sheet?.cssRules[0].cssText)}#I(){if(Object.keys(t).length){const e=document.createElement("style");e.id=`style-mixin-mappings__${d}`,e.innerHTML=((t,e,i)=>{const r=new o;return Object.keys(i).forEach((a=>{const o=((t,e)=>{const i={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...i,...t}))):[{...i,...e}]:[i]})(a,i[a]),l=(0,s.Tk)(t,a);o.forEach((({selector:t,property:i,important:s,fallback:a})=>{r.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(i)?i():i,((t,e)=>`var(${t}${e?`, ${e}`:""})`)(l,a)+(s?"!important":""))}))})),r.toString()})((0,n.E3)(d,this.#m),this.#v,t),this.#g.prepend(e)}}#V(t){(this.#g.classList||this.#g.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#g=await(this.#f?.(this))||this.shadowRoot,this.#V(d),this.#I(),this.#w(),this.#C(),(0,s.FX)(this,this.#S.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#c?.()}}},u=t=>class extends t{#$=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#$=document.createElement("style"),this.#$.innerText="* { cursor: inherit!important }"}#k(t){t?this.shadowRoot.appendChild(this.#$):this.#$.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const i=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",i),t.target.removeEventListener("dragend",i)};t.target.addEventListener("mouseup",i,{once:!0}),t.target.addEventListener("dragend",i,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"draggable"===t&&this.#k("true"===i)}};var p=i(2561),h=i(7878);const c=({componentName:t,wrappedEleName:e,slots:i=[],style:r,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[],delegatesFocus:d=!0})=>{class u extends((0,p.s)({componentName:t,baseSelector:e})){#T=h.C.bind(this,"blur");#L=h.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:d}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(r)?r():r}</style>\n\t\t\t<${e}>\n\t\t\t${i.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""} ></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#T()})),this.baseElement.addEventListener("focus",(t=>{this.#L()})),(0,s.Db)(this.baseElement,this,l),(0,s.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return u};i(5910);const m=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...m]}static get formAssociated(){return!0}#M;get internals(){return this.#M}set internals(t){this.#M=t}constructor(){super(),this.#M=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}getErrorMessage(t){const{valueMissing:e,patternMismatch:i,typeMismatch:r,stepMismatch:n,tooShort:s,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:d,customError:u}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case i||r||n||d:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case s:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case l:return this.defaultErrorMsgRangeUnderflow;case o:return this.defaultErrorMsgRangeOverflow;case u:return this.validationMessage;default:return""}}#_(){const t=this.isReadOnly?{}:this.getValidity();this.#M.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#M.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#M.validity.valid}reportValidity(){return this.#M.reportValidity()}get validity(){return this.#M.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#M.setValidity({customError:!0},t,this.validationTarget):(this.#M.setValidity({}),this.#_())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#M.form}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),m.includes(t)&&this.#_()}init(){super.init?.(),this.addEventListener("change",this.#_),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#_),setTimeout((()=>this.#_()))}},g=["invalid","required"],v=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e.localName)return e},y=({proxyProps:t=[],inputEvent:e="input",proxyParentValidation:i=!1})=>r=>class extends(b(r)){static get observedAttributes(){return[...r.observedAttributes||[],...g]}#O;#P=h.C.bind(this,"change");constructor(){super(),this.#O=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#O&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#O)return this.#O;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#O=v(t)||v(e),this.#O}set inputElement(t){this.#O=t}getValidity(){return this.inputElement?.validity||{}}#q(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#q(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},setTimeout((()=>{(Array.isArray(e)?e:[e]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#q()}))})),this.baseElement.addEventListener("change",(()=>{this.#P()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#q()})),t.forEach((t=>{var e,i;e=this.inputElement,i=t,Object.defineProperty(this,i,{set(t){e[i]=t},get:()=>e[i],configurable:!0})})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,s.oP)(this,this.inputElement,{includeAttrs:["inputmode"]})})),i){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,i)=>"function"==typeof t[i]&&"setValidity"===i?(...r)=>{if(3===r.length){const t=r.slice(0,r.length-1);t.push(e.inputElement),e.internals[i](...t)}else e.internals[i](...r);return t[i](...r)}:"function"==typeof t[i]?(...r)=>(e.internals[i](...r),t[i](...r)):t[i]})}}},f=t=>(0,n.qC)(y(t),d({componentNameOverride:(0,s.iY)("input-wrapper")}));var x=i(357),E=i(2666);const w=t=>async e=>{const i=await t(e);return new Promise((t=>{let e=0;const r=()=>{if(e>20)return console.error("could not get shadow root for element",i),void t(i);e++,i?.shadowRoot?t(i.shadowRoot):setTimeout(r)};r()}))},C=({name:t,selector:e,mappings:i={},forward:{attributes:a=[],include:o=!0}={}})=>u=>{const p=t||(t=>t.replace(/[^\w\s]/gi,""))(e),h=d({mappings:i})(u);return class extends h{static get cssVarList(){return{...h.cssVarList,[p]:l((0,n.E3)(u.componentName,"_"+p),i)}}#N;constructor(){const t=w((async t=>{const i=t.shadowRoot.querySelector(t.baseSelector);return e?(await w((()=>i))(t)).querySelector(e):i}));super({getRootElement:t,componentNameSuffix:"_"+p,themeSection:r.qM+p,baseSelector:":host"}),this.#N=t(this).then((t=>t.host))}async#z(){const t=await this.#N;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#N;(0,s.oP)(this,t,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#z()}}},A=t=>class extends t{#P=h.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.#P(),this.prevValue=this.value)}))}};var S=i(8084);const I=t=>class extends t{init(){this.#D(),super.init?.()}#D(){["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,h.C.call(this,"blur"),h.C.call(this,"focusout",{bubbles:!0})}))}));const i=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(h.C.call(this,"focus"),h.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",i),t?.addEventListener("focus",i)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,i)=>{i.d(e,{Q:()=>s});var r=i(4567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options"],s=t=>class extends t{init(){super.init?.(),(0,r.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.warn(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}}}]);
126
+ `}}(0,l.M)(f),i(7911),i(6594);var x=i(1e3),E=i(2138),w=i(2061),C=i(4567),A=i(7819);const S=(0,C.iY)("mappings-field"),{host:I,helperText:V,errorMessage:$,mappingItem:k,labels:L,valueLabel:M,attrLabel:T,separator:_,labelsContainer:O}={host:{selector:()=>":host"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},mappingItem:{selector:"descope-mapping-item::part(wrapper)"},labels:{selector:'descope-mappings-field-internal [part="labels"] descope-text'},valueLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="value-label"]'},attrLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="attr-label"]'},separator:{selector:"descope-mapping-item::part(separator)"},labelsContainer:{selector:'descope-mappings-field-internal [part="labels"]'}},P=(0,w.qC)((0,x.yk)({mappings:{hostWidth:{...I,property:"width"},hostDirection:{...I,property:"direction"},fontSize:[{},I,{..._,property:"margin-top"}],fontFamily:[V,$,L],separatorFontSize:{..._,property:"font-size"},labelTextColor:{...L,property:E.k.cssVarList.textColor},itemMarginBottom:{...k,property:"margin-bottom"},valueLabelMinWidth:{...M,property:"min-width"},attrLabelMinWidth:{...T,property:"min-width"},labelsMarginBottom:{...O,property:"margin-bottom"},separatorWidth:{},removeButtonWidth:{}}}),x.e4,(0,x.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),x.Ae,(t=>class extends t{get defaultValues(){const t=this.getAttribute("default-values");if(t)try{return JSON.parse(t)}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){const t=this.defaultValues;Object.keys(t).length>0&&(this.inputElement.value=t)}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${A.f}\n tabindex="-1"\n ></${A.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(A.f),(0,C.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),this.setDefaultValues()}}))((0,x.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-mappings-field-internal [part="labels"] {\n display: none;\n grid-template-columns: 1fr var(${P.cssVarList.separatorWidth}) 1fr var(${P.cssVarList.removeButtonWidth});\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"],\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n ${E.k.cssVarList.fontWeight}: 500;\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"] {\n grid-column: 1 / span 1;\n }\n\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n grid-column: 3 / span 1;\n }\n\n descope-mapping-item::part(wrapper) {\n display: grid;\n grid-template-columns: 1fr var(${P.cssVarList.separatorWidth}) 1fr var(${P.cssVarList.removeButtonWidth});\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:S}));i(1876),i(2018),i(9357),i(1294),i(3820),i(6751),customElements.define(S,P)},5279:(t,e,i)=>{i.d(e,{gh:()=>r,k4:()=>n,qM:()=>a,qg:()=>s});const r="descope",n=3,s="host",a="@"},4567:(t,e,i)=>{i.d(e,{Db:()=>h,FX:()=>s,P$:()=>a,Tk:()=>p,iY:()=>d,oP:()=>u,tg:()=>l});var r=i(2061),n=i(5279);const s=(t,e,{excludeAttrs:i=[],includeAttrs:r=[]})=>{const n=Array.from(t.attributes).filter((t=>!i.includes(t.name)&&(!r.length||r.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{t.forEach((t=>{"attributes"!==t.type||i.includes(t.attributeName)||r.length&&!r.includes(t.attributeName)||e([t.attributeName])}))})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&e(t)}))})).observe(t,{childList:!0})},o=(t,e,i={})=>r=>{r.forEach((r=>{const n=i[r]||r,s=t.getAttribute(r);null!==s?e.getAttribute(n)!==s&&e.setAttribute(n,s):e.removeAttribute(n)}))},l=(t,e,i)=>{s(t,o(t,e),i),s(e,o(e,t),i)},d=t=>(0,r.E3)(n.gh,t),p=(...t)=>`--${(0,r.E3)(...t)}`,u=(t,e,i={})=>{s(t,o(t,e,i.mapAttrs),i)},h=(t,e,i=[])=>{if(!i.length)return;const r=i.reduce(((e,i)=>Object.assign(e,{[i]:{get:()=>t[i],set(e){t[i]=e}}})),{});Object.defineProperties(e,r)}},2061:(t,e,i)=>{i.d(e,{E3:()=>n,GL:()=>r,lo:()=>o,mf:()=>a,qC:()=>s});const r=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>r(t.filter((t=>!!t)).join("-")),s=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t,o=(t,e)=>{if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;const i=t.slice().sort(),r=e.slice().sort();for(let t=0;t<i.length;t++)if(i[t]!==r[t])return!1;return!0}},7878:(t,e,i)=>{function r(t,e={}){const i=new Event(t,e);this[`on${t}`]?.(i),this.dispatchEvent(i)}i.d(e,{C:()=>r})},4201:(t,e,i)=>{i.d(e,{B:()=>p,DY:()=>l,PH:()=>d,Pd:()=>a,TX:()=>n,Wf:()=>h,bi:()=>r,jI:()=>o,jl:()=>s,wm:()=>u});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,n=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,s=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`,o=(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`,p=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${n(t)}\n ${a(t)}\n ${o(t)}\n ${s(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 ${p(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`},357:(t,e,i)=>{i.d(e,{A:()=>r});const r=t=>class extends t{#u(){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.#u()}}},2666:(t,e,i)=>{i.d(e,{_:()=>r});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})}))}}},1e3:(t,e,i)=>{i.d(e,{li:()=>A,Ae:()=>x.A,DM:()=>c,yk:()=>d,e4:()=>p,_A:()=>E._,mE:()=>I,wX:()=>b,QT:()=>S.Q,Iw:()=>C,dj:()=>f});var r=i(5279),n=i(2061),s=i(4567),a=i(5561);class o{constructor(){this.styleMap=new Map}add(t,e,i){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:i}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,i])=>`${t}${e} { \n${i.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const l=(t,e)=>Object.keys(e).reduce(((e,i)=>Object.assign(e,{[i]:(0,s.Tk)(t,i)})),{}),d=({mappings:t={},componentNameOverride:e=""})=>i=>{const d=e||i.componentName;return class extends i{static get cssVarList(){return{...i.cssVarList,...l(d,{...t})}}#h;#c;#m;#b;#g;#v;#y;#f;#x;constructor({getRootElement:e,componentNameSuffix:i="",themeSection:s=r.qg,baseSelector:a}={}){super(),this.#b=i,this.#g=s,this.#y=a??this.baseSelector,this.#x=e,this.#f=Object.keys(t).map((t=>(0,n.E3)("st",i,t)))}get#E(){return a.componentsThemeManager.currentTheme?.[d]||""}#w(){this.#c.innerHTML=this.#E[this.#g]}#C(){this.#c=document.createElement("style"),this.#c.id=`style-mixin-theme__${d}`,this.#v.prepend(this.#c),this.#m=a.componentsThemeManager.onCurrentThemeChange(this.#w.bind(this)),this.#w()}#A(){if(this.#f.length){this.#h=document.createElement("style"),this.#h.id=`style-mixin-overrides__${d}`;const i=(t=d,e=r.k4,Array(e).fill(`.${t}`).join(""));this.#h.innerText=`:host(${i}) {}`,this.#v.append(this.#h)}var t,e}#S(t,e){const i=this.#h?.sheet?.cssRules[0].style;if(!i)return;const r=(0,s.Tk)(d,t.replace(new RegExp("^st-"),""));e?i?.setProperty(r,e):(i?.removeProperty(r),this.removeAttribute(t))}#I(t=[]){let e=!1;t.forEach((t=>{this.#f.includes(t)&&(this.#S(t,this.getAttribute(t)),e=!0)})),e&&(this.#h.innerHTML=this.#h?.sheet?.cssRules[0].cssText)}#V(){if(Object.keys(t).length){const e=document.createElement("style");e.id=`style-mixin-mappings__${d}`,e.innerHTML=((t,e,i)=>{const r=new o;return Object.keys(i).forEach((a=>{const o=((t,e)=>{const i={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...i,...t}))):[{...i,...e}]:[i]})(a,i[a]),l=(0,s.Tk)(t,a);o.forEach((({selector:t,property:i,important:s,fallback:a})=>{r.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(i)?i():i,((t,e)=>`var(${t}${e?`, ${e}`:""})`)(l,a)+(s?"!important":""))}))})),r.toString()})((0,n.E3)(d,this.#b),this.#y,t),this.#v.prepend(e)}}#$(t){(this.#v.classList||this.#v.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#v=await(this.#x?.(this))||this.shadowRoot,this.#$(d),this.#V(),this.#C(),this.#A(),(0,s.FX)(this,this.#I.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#m?.()}}},p=t=>class extends t{#k=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#k=document.createElement("style"),this.#k.innerText="* { cursor: inherit!important }"}#L(t){t?this.shadowRoot.appendChild(this.#k):this.#k.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const i=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",i),t.target.removeEventListener("dragend",i)};t.target.addEventListener("mouseup",i,{once:!0}),t.target.addEventListener("dragend",i,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"draggable"===t&&this.#L("true"===i)}};var u=i(2561),h=i(7878);const c=({componentName:t,wrappedEleName:e,slots:i=[],style:r,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[],delegatesFocus:d=!0})=>{class p extends((0,u.s)({componentName:t,baseSelector:e})){#M=h.C.bind(this,"blur");#T=h.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:d}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(r)?r():r}</style>\n\t\t\t<${e}>\n\t\t\t${i.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""} ></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#M()})),this.baseElement.addEventListener("focus",(t=>{this.#T()})),(0,s.Db)(this.baseElement,this,l),(0,s.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return p};i(5910);const m=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...m]}static get formAssociated(){return!0}#_;get internals(){return this.#_}set internals(t){this.#_=t}constructor(){super(),this.#_=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}getErrorMessage(t){const{valueMissing:e,patternMismatch:i,typeMismatch:r,stepMismatch:n,tooShort:s,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:d,customError:p}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case i||r||n||d:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case s:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case l:return this.defaultErrorMsgRangeUnderflow;case o:return this.defaultErrorMsgRangeOverflow;case p:return this.validationMessage;default:return""}}#O(){const t=this.isReadOnly?{}:this.getValidity();this.#_.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#_.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#_.validity.valid}reportValidity(){return this.#_.reportValidity()}get validity(){return this.#_.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#_.setValidity({customError:!0},t,this.validationTarget):(this.#_.setValidity({}),this.#O())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#_.form}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),m.includes(t)&&this.#O()}init(){super.init?.(),this.addEventListener("change",this.#O),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#O),setTimeout((()=>this.#O()))}},g=["invalid","required"],v=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e.localName)return e},y=({proxyProps:t=[],inputEvent:e="input",proxyParentValidation:i=!1})=>r=>class extends(b(r)){static get observedAttributes(){return[...r.observedAttributes||[],...g]}#P;#q=h.C.bind(this,"change");constructor(){super(),this.#P=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#P&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#P)return this.#P;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#P=v(t)||v(e),this.#P}set inputElement(t){this.#P=t}getValidity(){return this.inputElement?.validity||{}}#N(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#N(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},setTimeout((()=>{(Array.isArray(e)?e:[e]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#N()}))})),this.baseElement.addEventListener("change",(()=>{this.#q()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#N()})),t.forEach((t=>{var e,i;e=this.inputElement,i=t,Object.defineProperty(this,i,{set(t){e[i]=t},get:()=>e[i],configurable:!0})})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,s.oP)(this,this.inputElement,{includeAttrs:["inputmode"]})})),i){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,i)=>"function"==typeof t[i]&&"setValidity"===i?(...r)=>{if(3===r.length){const t=r.slice(0,r.length-1);t.push(e.inputElement),e.internals[i](...t)}else e.internals[i](...r);return t[i](...r)}:"function"==typeof t[i]?(...r)=>(e.internals[i](...r),t[i](...r)):t[i]})}}},f=t=>(0,n.qC)(y(t),d({componentNameOverride:(0,s.iY)("input-wrapper")}));var x=i(357),E=i(2666);const w=t=>async e=>{const i=await t(e);return new Promise((t=>{let e=0;const r=()=>{if(e>20)return console.error("could not get shadow root for element",i),void t(i);e++,i?.shadowRoot?t(i.shadowRoot):setTimeout(r)};r()}))},C=({name:t,selector:e,mappings:i={},forward:{attributes:a=[],include:o=!0}={}})=>p=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),h=d({mappings:i})(p);return class extends h{static get cssVarList(){return{...h.cssVarList,[u]:l((0,n.E3)(p.componentName,"_"+u),i)}}#z;constructor(){const t=w((async t=>{const i=t.shadowRoot.querySelector(t.baseSelector);return e?(await w((()=>i))(t)).querySelector(e):i}));super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:r.qM+u,baseSelector:":host"}),this.#z=t(this).then((t=>t.host))}async#D(){const t=await this.#z;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#z;(0,s.oP)(this,t,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#D()}}},A=t=>class extends t{#q=h.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.#q(),this.prevValue=this.value)}))}};var S=i(8084);const I=t=>class extends t{init(){this.#R(),super.init?.()}#R(){["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,h.C.call(this,"blur"),h.C.call(this,"focusout",{bubbles:!0})}))}));const i=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(h.C.call(this,"focus"),h.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",i),t?.addEventListener("focus",i)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,i)=>{i.d(e,{Q:()=>s});var r=i(4567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options"],s=t=>class extends t{init(){super.init?.(),(0,r.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.warn(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.285",
3
+ "version": "1.0.287",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -5,16 +5,13 @@ import {
5
5
  proxyInputMixin,
6
6
  componentNameValidationMixin,
7
7
  } from '../../../mixins';
8
- import { TextClass } from '../../descope-text';
8
+ import { TextClass } from '../../descope-text/TextClass';
9
9
  import { compose } from '../../../helpers';
10
10
  import { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';
11
11
  import { componentName as descopeInternalComponentName } from './descope-mappings-field-internal/MappingsFieldInternal';
12
12
 
13
13
  export const componentName = getComponentName('mappings-field');
14
14
 
15
- const SEPARATOR_WIDTH = '80px';
16
- const REMOVE_BUTTON_WIDTH = '60px';
17
-
18
15
  const customMixin = (superclass) =>
19
16
  class MappingsFieldMixinClass extends superclass {
20
17
  get defaultValues() {
@@ -71,7 +68,17 @@ const customMixin = (superclass) =>
71
68
  }
72
69
  };
73
70
 
74
- const { host, helperText, errorMessage, mappingItem, labels, valueLabel, attrLabel, separator } = {
71
+ const {
72
+ host,
73
+ helperText,
74
+ errorMessage,
75
+ mappingItem,
76
+ labels,
77
+ valueLabel,
78
+ attrLabel,
79
+ separator,
80
+ labelsContainer,
81
+ } = {
75
82
  host: { selector: () => ':host' },
76
83
  helperText: { selector: '::part(helper-text)' },
77
84
  errorMessage: { selector: '::part(error-message)' },
@@ -80,6 +87,7 @@ const { host, helperText, errorMessage, mappingItem, labels, valueLabel, attrLab
80
87
  valueLabel: { selector: 'descope-mappings-field-internal [part="labels"] [part="value-label"]' },
81
88
  attrLabel: { selector: 'descope-mappings-field-internal [part="labels"] [part="attr-label"]' },
82
89
  separator: { selector: 'descope-mapping-item::part(separator)' },
90
+ labelsContainer: { selector: 'descope-mappings-field-internal [part="labels"]' },
83
91
  };
84
92
 
85
93
  export const MappingsFieldClass = compose(
@@ -95,6 +103,9 @@ export const MappingsFieldClass = compose(
95
103
  itemMarginBottom: { ...mappingItem, property: 'margin-bottom' },
96
104
  valueLabelMinWidth: { ...valueLabel, property: 'min-width' },
97
105
  attrLabelMinWidth: { ...attrLabel, property: 'min-width' },
106
+ labelsMarginBottom: { ...labelsContainer, property: 'margin-bottom' },
107
+ separatorWidth: {},
108
+ removeButtonWidth: {},
98
109
  },
99
110
  }),
100
111
  draggableMixin,
@@ -121,9 +132,8 @@ export const MappingsFieldClass = compose(
121
132
  }
122
133
 
123
134
  descope-mappings-field-internal [part="labels"] {
124
- margin-bottom: 0.5em;
125
- display: grid;
126
- grid-template-columns: 1fr ${SEPARATOR_WIDTH} 1fr ${REMOVE_BUTTON_WIDTH};
135
+ display: none;
136
+ grid-template-columns: 1fr var(${MappingsFieldClass.cssVarList.separatorWidth}) 1fr var(${MappingsFieldClass.cssVarList.removeButtonWidth});
127
137
  }
128
138
 
129
139
  descope-mappings-field-internal [part="labels"] [part="value-label"],
@@ -141,7 +151,7 @@ export const MappingsFieldClass = compose(
141
151
 
142
152
  descope-mapping-item::part(wrapper) {
143
153
  display: grid;
144
- grid-template-columns: 1fr ${SEPARATOR_WIDTH} 1fr ${REMOVE_BUTTON_WIDTH};
154
+ grid-template-columns: 1fr var(${MappingsFieldClass.cssVarList.separatorWidth}) 1fr var(${MappingsFieldClass.cssVarList.removeButtonWidth});
145
155
  }
146
156
  `,
147
157
  excludeAttrsSync: [
@@ -1,5 +1,9 @@
1
1
  import { createBaseInputClass } from '../../../../baseClasses/createBaseInputClass';
2
- import { getComponentName, forwardAttrs } from '../../../../helpers/componentHelpers';
2
+ import {
3
+ getComponentName,
4
+ forwardAttrs,
5
+ observeChildren,
6
+ } from '../../../../helpers/componentHelpers';
3
7
 
4
8
  export const componentName = getComponentName('mappings-field-internal');
5
9
 
@@ -51,7 +55,7 @@ class MappingsFieldInternal extends BaseInputClass {
51
55
  return this.getAttribute('options') || [];
52
56
  }
53
57
 
54
- addNewMappingItem() {
58
+ addNewMappingItem(focusNewItem) {
55
59
  const newMappingItem = document.createElement('descope-mapping-item');
56
60
  newMappingItem.setAttribute('bordered', 'true');
57
61
  this.mappingsContainerEle.appendChild(newMappingItem);
@@ -72,6 +76,9 @@ class MappingsFieldInternal extends BaseInputClass {
72
76
  this.setCustomValidity('');
73
77
  e.stopPropagation();
74
78
  });
79
+ if (focusNewItem) {
80
+ newMappingItem.focus();
81
+ }
75
82
  }, 0);
76
83
  return newMappingItem;
77
84
  }
@@ -116,7 +123,7 @@ class MappingsFieldInternal extends BaseInputClass {
116
123
  mappingItem.value = mapping;
117
124
  } else {
118
125
  // Add new item
119
- const newMappingItem = this.addNewMappingItem();
126
+ const newMappingItem = this.addNewMappingItem(false);
120
127
  // Setting the new item value needs to be done with the timeout,
121
128
  // otherwise the value is not set correctly
122
129
  setTimeout(() => {
@@ -156,13 +163,17 @@ class MappingsFieldInternal extends BaseInputClass {
156
163
  `;
157
164
  const button = this.querySelector('descope-button');
158
165
  button.onclick = () => {
159
- this.addNewMappingItem();
166
+ this.addNewMappingItem(true);
160
167
  };
161
168
  forwardAttrs(this, button, {
162
169
  includeAttrs: ['disabled'],
163
170
  });
164
171
  }
165
172
 
173
+ #onMappingsContainerChildrenChange() {
174
+ this.labelsEle.style.display = this.items.length ? 'grid' : 'none';
175
+ }
176
+
166
177
  init() {
167
178
  // This event listener needs to be placed before the super.init() call
168
179
  this.addEventListener('focus', (e) => {
@@ -189,6 +200,8 @@ class MappingsFieldInternal extends BaseInputClass {
189
200
  this.#errorItem = undefined;
190
201
  }
191
202
  });
203
+
204
+ observeChildren(this.mappingsContainerEle, this.#onMappingsContainerChildrenChange.bind(this));
192
205
  }
193
206
 
194
207
  resetInvalidIndication() {
@@ -19,6 +19,9 @@ export const mappingsField = {
19
19
  [vars.valueLabelMinWidth]: refs.minWidth,
20
20
  // To be positioned correctly, the min width has to match the combo box field min width
21
21
  [vars.attrLabelMinWidth]: `calc(12em + 2 * ${globalRefs.border.xs})`,
22
+ [vars.labelsMarginBottom]: `calc(${globalRefs.typography.body2.size} / 2)`,
23
+ [vars.separatorWidth]: '70px',
24
+ [vars.removeButtonWidth]: '60px',
22
25
  };
23
26
 
24
27
  export default mappingsField;