@descope/web-components-ui 1.0.387 → 1.0.389

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/cjs/index.cjs.js +1318 -1209
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +1267 -1157
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/5459.js +1 -1
  6. package/dist/umd/DescopeDev.js +1 -1
  7. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  8. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  9. package/dist/umd/descope-apps-list-index-js.js +1 -1
  10. package/dist/umd/descope-date-field-index-js.js +1 -1
  11. package/dist/umd/descope-email-field-index-js.js +1 -1
  12. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  13. package/dist/umd/descope-grid-index-js.js +1 -1
  14. package/dist/umd/descope-new-password-index-js.js +1 -1
  15. package/dist/umd/descope-number-field-index-js.js +1 -1
  16. package/dist/umd/descope-passcode-index-js.js +1 -1
  17. package/dist/umd/descope-radio-group-index-js.js +1 -1
  18. package/dist/umd/descope-scopes-list-index-js.js +2 -0
  19. package/dist/umd/descope-scopes-list-index-js.js.LICENSE.txt +5 -0
  20. package/dist/umd/descope-text-field-index-js.js +1 -1
  21. package/dist/umd/index.js +1 -1
  22. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  23. package/package.json +1 -1
  24. package/src/components/boolean-fields/commonStyles.js +1 -2
  25. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +6 -0
  26. package/src/components/descope-date-field/DateFieldClass.js +6 -1
  27. package/src/components/descope-scopes-list/ScopesListClass.js +111 -0
  28. package/src/components/descope-scopes-list/index.js +7 -0
  29. package/src/components/descope-text-field/textFieldMappings.js +1 -0
  30. package/src/index.cjs.js +1 -0
  31. package/src/index.js +1 -0
  32. package/src/mixins/createDynamicDataMixin.js +9 -28
  33. package/src/theme/components/checkbox.js +1 -8
  34. package/src/theme/components/dateField.js +3 -1
  35. package/src/theme/components/index.js +2 -0
  36. package/src/theme/components/scopesList.js +15 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7095,171,2230,9522],{25827:(t,e,r)=>{r.d(e,{y:()=>a});var n=r(7138),i=r(94619),o=r(70263);const a=(...t)=>(0,n.Zz)(i.XX,i._$,i.yF,i.jd)((0,o.q)(...t))},83942:(t,e,r)=>{r.d(e,{J:()=>h,T:()=>s});var n=r(7138),i=r(14944),o=r(94619),a=r(55708),l=r(91805);const s=(0,i.xE)("button"),{host:p,label:d,slottedIcon:c}={host:{selector:()=>":host"},label:{selector:"::part(label)"},slottedIcon:{selector:()=>"::slotted(descope-icon)"}};let u;const h=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...p,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-right",fallback:"0.875em"},{property:"padding-left",fallback:"0.875em"}],labelTextColor:{property:"color"},iconColor:{selector:()=>`::slotted(${a.S.componentName})`,property:a.S.cssVarList.fill},labelTextDecoration:{...d,property:"text-decoration"},labelSpacing:{...d,property:"gap"},textAlign:{...d,property:"justify-content",fallback:"center"},iconSize:[{...c,property:"width"},{...c,property:"height"}]}}),l.G,o.VO,o.tQ)((0,o.tz)({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${u}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${h.cssVarList.outlineWidth}) + var(${h.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${h.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${h.cssVarList.hostHeight}) - var(${h.cssVarList.outlineWidth}) - var(${h.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${h.cssVarList.hostWidth}) - var(${h.cssVarList.outlineWidth}) - var(${h.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s})),{color:b,fontSize:m}=h.cssVarList;u=`\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(${b});\n\t\ttop: calc(50% - (var(${m}) / 2));\n\t\tleft: calc(50% - (var(${m}) / 2));\n\t\tborder-width: calc(var(${m}) / 10);\n\t\twidth: var(${m});\n\t\theight: var(${m});\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`},91805:(t,e,r)=>{r.d(e,{G:()=>n});const n=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},1058:(t,e,r)=>{r.r(e),r.d(e,{ButtonClass:()=>n.J}),r(97745);var n=r(83942);customElements.define(n.T,n.J)},78313:(t,e,r)=>{r.d(e,{C:()=>v,T:()=>l});var n=r(7138),i=r(14944),o=r(33177),a=r(94619);const l=(0,i.xE)("combo-box"),{host:s,inputField:p,inputElement:d,placeholder:c,toggle:u,clearButton:h,label:b,requiredIndicator:m,helperText:y,errorMessage:g}={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)"}},v=(0,n.Zz)((0,a.RF)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],fontFamily:[b,c,p,y,g],labelFontSize:{...b,property:"font-size"},labelFontWeight:{...b,property:"font-weight"},labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...g,property:"color"},inputHeight:{...p,property:"height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...m,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"}],labelPosition:{...b,property:"position"},labelTopPosition:{...b,property:"top"},labelHorizontalPosition:[{...b,property:"left"},{...b,property:"right"}],inputTransformY:{...b,property:"transform"},inputTransition:{...b,property:"transition"},marginInlineStart:{...b,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...p,property:"align-items"},valueInputHeight:{...d,property:"height"},valueInputMarginBottom:{...d,property:"margin-bottom"},overlayBackground:{property:()=>v.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>v.cssVarList.overlay.textColor},overlayBorder:{property:()=>v.cssVarList.overlay.border},overlayFontSize:{property:()=>v.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>v.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>v.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>v.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>v.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>v.cssVarList.overlay.itemPaddingInlineEnd}}}),a.VO,(0,a.mA)({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.OZ)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.tQ,(t=>class extends t{static get observedAttributes(){return["label-type"]}#t=({displayName:t,value:e,label:r})=>`<span data-name="${r}" data-id="${e}">${t||r}</span>`;#e;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}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(r){if(!e.baseElement.items?.length)return;const n=e.customValueTransformFn(r)||"";n!==this.value&&t.set.call(this,n)}}})}#r(){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,r)=>{t.innerHTML=r.item.outerHTML}}#n(){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.#n(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}onLabelClick(){this.isReadOnly||this.isDisabled||(this.focus(),this.setAttribute("opened","true"))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),e!==r&&"label-type"===t&&("floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick))}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"]||this.allowCustomValue)&&this.baseElement.__data.value||""}get allowCustomValue(){return"true"===this.getAttribute("allow-custom-value")}}))((0,a.tz)({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,o.cy)(v.cssVarList)}\n\t\t${(0,o.fu)("vaadin-combo-box")}\n\t\t${(0,o.lS)("vaadin-combo-box")}\n\t\t${(0,o.I4)("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\n vaadin-combo-box::part(toggle-button),\n vaadin-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n \n ${(0,o.$J)("vaadin-combo-box")}\n ${(0,o.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:l,includeForwardProps:["items","renderer","selectedItem"]}))},4480:(t,e,r)=>{r.r(e),r.d(e,{ComboBoxClass:()=>n.C}),r(31111);var n=r(78313);customElements.define(n.T,n.C)},55708:(t,e,r)=>{r.d(e,{S:()=>d,T:()=>s});var n=r(94619),i=r(70263),o=r(7138),a=r(14944),l=r(13390);const s=(0,a.xE)("icon");class p extends((0,i.q)({componentName:s,baseSelector:"slot"})){static get observedAttributes(){return["src"]}#i;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host > slot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t"}get src(){return this.getAttribute("src")}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach((t=>{t.setAttribute("fill",`var(${d.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)}))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),e!==r&&"src"===t&&(0,l.w)(this.src).then((t=>{if(this.innerHTML="",t){const e=t.cloneNode(!0);this.updateFillColor(e),this.appendChild(e)}}))}}const d=(0,o.Zz)((0,n.RF)({mappings:{fill:{}}}),n.VO,n.tQ)(p)},13390:(t,e,r)=>{r.d(e,{w:()=>a});var n=r(42838),i=r.n(n);const o=t=>{const e=i().sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0}});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},a=async t=>{try{let e;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const r=atob(t.slice(26));e=o(r)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const r=await fetch(t),n=await r.text();e=o(n)}else e=(t=>{const e=document.createElement("img");return e.setAttribute("src",t),e})(t);return e.style.setProperty("width","100%"),e.style.setProperty("height","100%"),e}catch{return null}}},69473:(t,e,r)=>{r.d(e,{T:()=>s,w:()=>d});var n=r(94619),i=r(93826),o=r(7138),a=r(14944),l=r(33177);const s=(0,a.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,n.RF)({mappings:i.A}),n.VO,(0,n.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),n.tQ,(t=>class extends t{static get observedAttributes(){return p.concat(t.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(t){if(!t)return void this.icon?.remove();const e={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},r={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...e}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,r),setTimeout((()=>{Object.assign(this.icon,e)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(t,e,r){super.attributeChangeCallback?.(t,e,r),"type"===t&&this.baseElement._setType(r),e!==r&&("label-type"===t?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===t&&this.renderCopyToClipboard("true"===r))}}))((0,n.tz)({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(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,l.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(d.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},89348:(t,e,r)=>{r.r(e),r.d(e,{TextFieldClass:()=>n.w}),r(39542),r(66418),r(56637);var n=r(69473);customElements.define(n.T,n.w)},93826:(t,e,r)=>{r.d(e,{A:()=>f});const{host:n,label:i,placeholder:o,requiredIndicator:a,inputField:l,input:s,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:b,externalInput:m,externalInputDisabled:y,externalPlaceholder:g,externalDisabledPlaceholder:v}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},f={fontSize:[{},n],fontFamily:[i,l,d,c],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...a,property:"color"},{...i,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],hostWidth:{...n,property:"width"},hostMinWidth:{...n,property:"min-width"},hostDirection:{...n,property:"direction"},inputBackgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...l,property:"color"},{...h,property:"-webkit-text-fill-color"},{...y,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...s,property:"caret-color"},{...m,property:"caret-color"}],labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},inputHeight:{...l,property:"height"},inputHorizontalPadding:[{...s,property:"padding-left"},{...s,property:"padding-right"},{...m,property:"padding-left"},{...m,property:"padding-right"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineOffset:{...l,property:"outline-offset"},textAlign:{},inputTextAlign:[{...s,property:"text-align"},{...m,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...g,property:"color"},{...o,property:"color"},{...u,property:"-webkit-text-fill-color"},{...v,property:"-webkit-text-fill-color"}],labelPosition:{...i,property:"position"},labelTopPosition:{...i,property:"top"},labelHorizontalPosition:[{...i,property:"left"},{...i,property:"right"}],inputTransformY:{...i,property:"transform"},inputTransition:{...i,property:"transition"},marginInlineStart:{...i,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...g,property:"opacity"}],inputVerticalAlignment:[{...l,property:"align-items"},{...m,property:"align-items"}],valueInputHeight:[{...s,property:"height"},{...m,property:"height"}],valueInputMarginBottom:[{...s,property:"margin-bottom"},{...m,property:"margin-bottom"}],inputIconOffset:[{...b,property:"margin-right"},{...b,property:"margin-left"}],inputIconSize:{...b,property:"font-size"},inputIconColor:{...b,property:"color"}}},85108:(t,e,r)=>{r.d(e,{T:()=>l,s:()=>p});var n=r(94619),i=r(7138),o=r(14944),a=r(70263);const l=(0,o.xE)("text");class s extends((0,a.q)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <style>\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n </style>\n <slot part="text-wrapper"></slot>\n '}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,o.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const p=(0,i.Zz)((0,n.RF)({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:{}}}),n.VO,n.tQ)(s)},16429:(t,e,r)=>{r.r(e),r.d(e,{TextClass:()=>n.s});var n=r(85108);customElements.define(n.T,n.s)},91491:(t,e,r)=>{var n=r(25827),i=r(14944);const o=(0,i.xE)("mapping-item"),a=["size","bordered","readonly","full-width","disabled"],l=(0,n.y)({componentName:o,baseSelector:"div"});customElements.define(o,class extends l{static get observedAttributes(){return[].concat(l.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,r]=Object.entries(t)[0];this.valueInput.value=r,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,i.EA)(this,this.valueInput,{includeAttrs:a}),(0,i.EA)(this,this.attributeInput,{includeAttrs:[...a,"options"],mapAttrs:{options:"data"}}),(0,i.EA)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed",{bubbles:!0,composed:!0}))))}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,r){super.attributeChangedCallback?.(t,e,r),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#o(r)}})},40154:(t,e,r)=>{r.d(e,{A:()=>l,T:()=>o});var n=r(25827),i=r(14944);const o=(0,i.xE)("mappings-field-internal"),a=(0,n.y)({componentName:o,baseSelector:"div"}),l=class extends a{#a;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,i.EA)(this,e,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),e.addEventListener("mapping-item-removed",(()=>{e===this.#a&&(this.resetInvalidIndication(),this.#a=void 0),e.remove(),this.setCustomValidity("")})),this.dispatchEvent(new CustomEvent("mapping-item-added",{bubbles:!0,composed:!0})),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 r=t.length;r<e.length;r++)this.mappingsContainerEle.removeChild(e[r]);t.forEach(((t,r)=>{const n=e[r];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,i.EA)(this,t,{includeAttrs:["disabled"]})}#l(){this.labelsEle.style.display=this.items.length?"grid":"none"}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#a||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#a)&&this.#a?.checkValidity()&&(this.resetInvalidIndication(),this.#a.removeAttribute("invalid"),this.#a=void 0)})),(0,i.Ge)(this.mappingsContainerEle,this.#l.bind(this))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#s(t){t&&(this.#a=this.items.find((t=>!t.checkValidity())),this.#a?.reportValidity(),this.#a?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#s("true"===r),"readonly"===t&&this.toggleAttribute("inert","true"===r)}}},88858:(t,e,r)=>{r.r(e);var n=r(40154);customElements.define(n.T,n.A)},64551:(t,e,r)=>{r.r(e),r.d(e,{MappingsFieldClass:()=>f}),r(61228),r(56637),r(66418);var n=r(94619),i=r(85108),o=r(7138),a=r(14944),l=r(40154);const s=(0,a.xE)("mappings-field"),{host:p,helperText:d,errorMessage:c,mappingItem:u,labels:h,labelsText:b,valueLabel:m,attrLabel:y,separator:g,labelsContainer:v}={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'},labelsText:{selector:'descope-mappings-field-internal [part="labels"] descope-text::part(text-wrapper)'},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"]'}},f=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:[{},p,{...g,property:"margin-top"}],fontFamily:[d,c,h],separatorFontSize:{...g,property:"font-size"},labelsFontSize:{...b,property:"font-size"},labelsLineHeight:[{...b,property:"line-height"},{...h,property:"line-height"}],labelTextColor:[{...h,property:i.s.cssVarList.textColor},{...g,property:"color"}],itemMarginBottom:{...u,property:"margin-bottom"},valueLabelMinWidth:{...m,property:"min-width"},attrLabelMinWidth:{...y,property:"min-width"},labelsMarginBottom:{...v,property:"margin-bottom"},separatorWidth:{},removeButtonWidth:{}}}),n.VO,(0,n.OZ)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),n.tQ,(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 <${l.T}\n tabindex="-1"\n ></${l.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(l.T),(0,a.EA)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),(0,a.Gh)(this,this.inputElement,{includeAttrs:["invalid"]}),this.setDefaultValues()}}))((0,n.tz)({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(${f.cssVarList.separatorWidth}) 1fr var(${f.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 ${i.s.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(${f.cssVarList.separatorWidth}) 1fr var(${f.cssVarList.removeButtonWidth});\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:s}));r(16429),r(1058),r(89348),r(4480),r(88858),r(91491),customElements.define(s,f)},33177:(t,e,r)=>{r.d(e,{$J:()=>u,I4:()=>a,Kl:()=>h,LJ:()=>c,Qv:()=>o,X6:()=>s,cy:()=>n,fu:()=>p,kG:()=>d,lS:()=>l,zm:()=>i});const n=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,i=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=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`,l=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,s=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,c=(t,e)=>`\n ${i(t)}\n ${a(t)}\n ${l(t)}\n ${o(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 ${d(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`,u=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`,h=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) [slot="label"] {\n padding: 0;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7095,171,2230,9522],{25827:(t,e,r)=>{r.d(e,{y:()=>a});var n=r(7138),i=r(94619),o=r(70263);const a=(...t)=>(0,n.Zz)(i.XX,i._$,i.yF,i.jd)((0,o.q)(...t))},83942:(t,e,r)=>{r.d(e,{J:()=>h,T:()=>s});var n=r(7138),i=r(14944),o=r(94619),a=r(55708),l=r(91805);const s=(0,i.xE)("button"),{host:p,label:d,slottedIcon:c}={host:{selector:()=>":host"},label:{selector:"::part(label)"},slottedIcon:{selector:()=>"::slotted(descope-icon)"}};let u;const h=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...p,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-right",fallback:"0.875em"},{property:"padding-left",fallback:"0.875em"}],labelTextColor:{property:"color"},iconColor:{selector:()=>`::slotted(${a.S.componentName})`,property:a.S.cssVarList.fill},labelTextDecoration:{...d,property:"text-decoration"},labelSpacing:{...d,property:"gap"},textAlign:{...d,property:"justify-content",fallback:"center"},iconSize:[{...c,property:"width"},{...c,property:"height"}]}}),l.G,o.VO,o.tQ)((0,o.tz)({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${u}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${h.cssVarList.outlineWidth}) + var(${h.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${h.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${h.cssVarList.hostHeight}) - var(${h.cssVarList.outlineWidth}) - var(${h.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${h.cssVarList.hostWidth}) - var(${h.cssVarList.outlineWidth}) - var(${h.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s})),{color:b,fontSize:m}=h.cssVarList;u=`\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(${b});\n\t\ttop: calc(50% - (var(${m}) / 2));\n\t\tleft: calc(50% - (var(${m}) / 2));\n\t\tborder-width: calc(var(${m}) / 10);\n\t\twidth: var(${m});\n\t\theight: var(${m});\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`},91805:(t,e,r)=>{r.d(e,{G:()=>n});const n=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},1058:(t,e,r)=>{r.r(e),r.d(e,{ButtonClass:()=>n.J}),r(97745);var n=r(83942);customElements.define(n.T,n.J)},78313:(t,e,r)=>{r.d(e,{C:()=>v,T:()=>l});var n=r(7138),i=r(14944),o=r(33177),a=r(94619);const l=(0,i.xE)("combo-box"),{host:s,inputField:p,inputElement:d,placeholder:c,toggle:u,clearButton:h,label:b,requiredIndicator:m,helperText:y,errorMessage:g}={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)"}},v=(0,n.Zz)((0,a.RF)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],fontFamily:[b,c,p,y,g],labelFontSize:{...b,property:"font-size"},labelFontWeight:{...b,property:"font-weight"},labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...g,property:"color"},inputHeight:{...p,property:"height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...m,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"}],labelPosition:{...b,property:"position"},labelTopPosition:{...b,property:"top"},labelHorizontalPosition:[{...b,property:"left"},{...b,property:"right"}],inputTransformY:{...b,property:"transform"},inputTransition:{...b,property:"transition"},marginInlineStart:{...b,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...p,property:"align-items"},valueInputHeight:{...d,property:"height"},valueInputMarginBottom:{...d,property:"margin-bottom"},overlayBackground:{property:()=>v.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>v.cssVarList.overlay.textColor},overlayBorder:{property:()=>v.cssVarList.overlay.border},overlayFontSize:{property:()=>v.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>v.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>v.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>v.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>v.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>v.cssVarList.overlay.itemPaddingInlineEnd}}}),a.VO,(0,a.mA)({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.OZ)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.tQ,(t=>class extends t{static get observedAttributes(){return["label-type"]}#t=({displayName:t,value:e,label:r})=>`<span data-name="${r}" data-id="${e}">${t||r}</span>`;#e;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}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(r){if(!e.baseElement.items?.length)return;const n=e.customValueTransformFn(r)||"";n!==this.value&&t.set.call(this,n)}}})}#r(){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,r)=>{t.innerHTML=r.item.outerHTML}}#n(){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.#n(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}onLabelClick(){this.isReadOnly||this.isDisabled||(this.focus(),this.setAttribute("opened","true"))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),e!==r&&"label-type"===t&&("floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick))}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"]||this.allowCustomValue)&&this.baseElement.__data.value||""}get allowCustomValue(){return"true"===this.getAttribute("allow-custom-value")}}))((0,a.tz)({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,o.cy)(v.cssVarList)}\n\t\t${(0,o.fu)("vaadin-combo-box")}\n\t\t${(0,o.lS)("vaadin-combo-box")}\n\t\t${(0,o.I4)("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\n vaadin-combo-box::part(toggle-button),\n vaadin-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n \n ${(0,o.$J)("vaadin-combo-box")}\n ${(0,o.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:l,includeForwardProps:["items","renderer","selectedItem"]}))},4480:(t,e,r)=>{r.r(e),r.d(e,{ComboBoxClass:()=>n.C}),r(31111);var n=r(78313);customElements.define(n.T,n.C)},55708:(t,e,r)=>{r.d(e,{S:()=>d,T:()=>s});var n=r(94619),i=r(70263),o=r(7138),a=r(14944),l=r(13390);const s=(0,a.xE)("icon");class p extends((0,i.q)({componentName:s,baseSelector:"slot"})){static get observedAttributes(){return["src"]}#i;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host > slot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t"}get src(){return this.getAttribute("src")}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach((t=>{t.setAttribute("fill",`var(${d.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)}))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),e!==r&&"src"===t&&(0,l.w)(this.src).then((t=>{if(this.innerHTML="",t){const e=t.cloneNode(!0);this.updateFillColor(e),this.appendChild(e)}}))}}const d=(0,o.Zz)((0,n.RF)({mappings:{fill:{}}}),n.VO,n.tQ)(p)},13390:(t,e,r)=>{r.d(e,{w:()=>a});var n=r(42838),i=r.n(n);const o=t=>{const e=i().sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0}});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},a=async t=>{try{let e;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const r=atob(t.slice(26));e=o(r)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const r=await fetch(t),n=await r.text();e=o(n)}else e=(t=>{const e=document.createElement("img");return e.setAttribute("src",t),e})(t);return e.style.setProperty("width","100%"),e.style.setProperty("height","100%"),e}catch{return null}}},69473:(t,e,r)=>{r.d(e,{T:()=>s,w:()=>d});var n=r(94619),i=r(93826),o=r(7138),a=r(14944),l=r(33177);const s=(0,a.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,n.RF)({mappings:i.A}),n.VO,(0,n.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),n.tQ,(t=>class extends t{static get observedAttributes(){return p.concat(t.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(t){if(!t)return void this.icon?.remove();const e={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},r={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...e}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,r),setTimeout((()=>{Object.assign(this.icon,e)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(t,e,r){super.attributeChangeCallback?.(t,e,r),"type"===t&&this.baseElement._setType(r),e!==r&&("label-type"===t?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===t&&this.renderCopyToClipboard("true"===r))}}))((0,n.tz)({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(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,l.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(d.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},89348:(t,e,r)=>{r.r(e),r.d(e,{TextFieldClass:()=>n.w}),r(39542),r(66418),r(56637);var n=r(69473);customElements.define(n.T,n.w)},93826:(t,e,r)=>{r.d(e,{A:()=>f});const{host:n,label:i,placeholder:o,requiredIndicator:a,inputField:l,input:s,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:u,inputDisabled:h,inputIcon:b,externalInput:m,externalInputDisabled:y,externalPlaceholder:g,externalDisabledPlaceholder:v}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},f={fontSize:[{},n],fontFamily:[i,l,d,c],labelFontSize:{...i,property:"font-size"},labelFontWeight:{...i,property:"font-weight"},labelTextColor:[{...i,property:"color"},{...a,property:"color"},{...i,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],hostWidth:{...n,property:"width"},hostMinWidth:{...n,property:"min-width"},hostDirection:{...n,property:"direction"},inputDirection:{...s,property:"direction"},inputBackgroundColor:[{...l,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...l,property:"color"},{...h,property:"-webkit-text-fill-color"},{...y,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...s,property:"caret-color"},{...m,property:"caret-color"}],labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},inputHeight:{...l,property:"height"},inputHorizontalPadding:[{...s,property:"padding-left"},{...s,property:"padding-right"},{...m,property:"padding-left"},{...m,property:"padding-right"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineOffset:{...l,property:"outline-offset"},textAlign:{},inputTextAlign:[{...s,property:"text-align"},{...m,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...g,property:"color"},{...o,property:"color"},{...u,property:"-webkit-text-fill-color"},{...v,property:"-webkit-text-fill-color"}],labelPosition:{...i,property:"position"},labelTopPosition:{...i,property:"top"},labelHorizontalPosition:[{...i,property:"left"},{...i,property:"right"}],inputTransformY:{...i,property:"transform"},inputTransition:{...i,property:"transition"},marginInlineStart:{...i,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...g,property:"opacity"}],inputVerticalAlignment:[{...l,property:"align-items"},{...m,property:"align-items"}],valueInputHeight:[{...s,property:"height"},{...m,property:"height"}],valueInputMarginBottom:[{...s,property:"margin-bottom"},{...m,property:"margin-bottom"}],inputIconOffset:[{...b,property:"margin-right"},{...b,property:"margin-left"}],inputIconSize:{...b,property:"font-size"},inputIconColor:{...b,property:"color"}}},85108:(t,e,r)=>{r.d(e,{T:()=>l,s:()=>p});var n=r(94619),i=r(7138),o=r(14944),a=r(70263);const l=(0,o.xE)("text");class s extends((0,a.q)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <style>\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n </style>\n <slot part="text-wrapper"></slot>\n '}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,o.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const p=(0,i.Zz)((0,n.RF)({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:{}}}),n.VO,n.tQ)(s)},16429:(t,e,r)=>{r.r(e),r.d(e,{TextClass:()=>n.s});var n=r(85108);customElements.define(n.T,n.s)},91491:(t,e,r)=>{var n=r(25827),i=r(14944);const o=(0,i.xE)("mapping-item"),a=["size","bordered","readonly","full-width","disabled"],l=(0,n.y)({componentName:o,baseSelector:"div"});customElements.define(o,class extends l{static get observedAttributes(){return[].concat(l.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,r]=Object.entries(t)[0];this.valueInput.value=r,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,i.EA)(this,this.valueInput,{includeAttrs:a}),(0,i.EA)(this,this.attributeInput,{includeAttrs:[...a,"options"],mapAttrs:{options:"data"}}),(0,i.EA)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed",{bubbles:!0,composed:!0}))))}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,r){super.attributeChangedCallback?.(t,e,r),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#o(r)}})},40154:(t,e,r)=>{r.d(e,{A:()=>l,T:()=>o});var n=r(25827),i=r(14944);const o=(0,i.xE)("mappings-field-internal"),a=(0,n.y)({componentName:o,baseSelector:"div"}),l=class extends a{#a;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,i.EA)(this,e,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),e.addEventListener("mapping-item-removed",(()=>{e===this.#a&&(this.resetInvalidIndication(),this.#a=void 0),e.remove(),this.setCustomValidity("")})),this.dispatchEvent(new CustomEvent("mapping-item-added",{bubbles:!0,composed:!0})),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 r=t.length;r<e.length;r++)this.mappingsContainerEle.removeChild(e[r]);t.forEach(((t,r)=>{const n=e[r];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,i.EA)(this,t,{includeAttrs:["disabled"]})}#l(){this.labelsEle.style.display=this.items.length?"grid":"none"}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#a||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#a)&&this.#a?.checkValidity()&&(this.resetInvalidIndication(),this.#a.removeAttribute("invalid"),this.#a=void 0)})),(0,i.Ge)(this.mappingsContainerEle,this.#l.bind(this))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#s(t){t&&(this.#a=this.items.find((t=>!t.checkValidity())),this.#a?.reportValidity(),this.#a?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#s("true"===r),"readonly"===t&&this.toggleAttribute("inert","true"===r)}}},88858:(t,e,r)=>{r.r(e);var n=r(40154);customElements.define(n.T,n.A)},64551:(t,e,r)=>{r.r(e),r.d(e,{MappingsFieldClass:()=>f}),r(61228),r(56637),r(66418);var n=r(94619),i=r(85108),o=r(7138),a=r(14944),l=r(40154);const s=(0,a.xE)("mappings-field"),{host:p,helperText:d,errorMessage:c,mappingItem:u,labels:h,labelsText:b,valueLabel:m,attrLabel:y,separator:g,labelsContainer:v}={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'},labelsText:{selector:'descope-mappings-field-internal [part="labels"] descope-text::part(text-wrapper)'},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"]'}},f=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:[{},p,{...g,property:"margin-top"}],fontFamily:[d,c,h],separatorFontSize:{...g,property:"font-size"},labelsFontSize:{...b,property:"font-size"},labelsLineHeight:[{...b,property:"line-height"},{...h,property:"line-height"}],labelTextColor:[{...h,property:i.s.cssVarList.textColor},{...g,property:"color"}],itemMarginBottom:{...u,property:"margin-bottom"},valueLabelMinWidth:{...m,property:"min-width"},attrLabelMinWidth:{...y,property:"min-width"},labelsMarginBottom:{...v,property:"margin-bottom"},separatorWidth:{},removeButtonWidth:{}}}),n.VO,(0,n.OZ)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),n.tQ,(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 <${l.T}\n tabindex="-1"\n ></${l.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(l.T),(0,a.EA)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),(0,a.Gh)(this,this.inputElement,{includeAttrs:["invalid"]}),this.setDefaultValues()}}))((0,n.tz)({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(${f.cssVarList.separatorWidth}) 1fr var(${f.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 ${i.s.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(${f.cssVarList.separatorWidth}) 1fr var(${f.cssVarList.removeButtonWidth});\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:s}));r(16429),r(1058),r(89348),r(4480),r(88858),r(91491),customElements.define(s,f)},33177:(t,e,r)=>{r.d(e,{$J:()=>u,I4:()=>a,Kl:()=>h,LJ:()=>c,Qv:()=>o,X6:()=>s,cy:()=>n,fu:()=>p,kG:()=>d,lS:()=>l,zm:()=>i});const n=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,i=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=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`,l=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,s=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,c=(t,e)=>`\n ${i(t)}\n ${a(t)}\n ${l(t)}\n ${o(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 ${d(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`,u=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`,h=()=>'\n :host([label-type="floating"]) {\n position: relative;\n }\n :host([label-type="floating"][has-label]) [slot="label"] {\n padding: 0;\n }\n :host([label-type="floating"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n '}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.387",
3
+ "version": "1.0.389",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -18,8 +18,7 @@ vaadin-text-field {
18
18
  align-items: flex-start;
19
19
  }
20
20
  vaadin-text-field::before {
21
- height: 0;
22
- margin: 0;
21
+ content: unset;
23
22
  }
24
23
  vaadin-text-field::part(label) {
25
24
  position: absolute;
@@ -87,6 +87,7 @@ export const CheckboxClass = compose(
87
87
  :host {
88
88
  display: inline-flex;
89
89
  max-width: 100%;
90
+ margin: 1px;
90
91
  }
91
92
 
92
93
  :host ::part(error-message) {
@@ -110,6 +111,11 @@ export const CheckboxClass = compose(
110
111
  vaadin-checkbox::part(checkbox)::after {
111
112
  top: 0;
112
113
  left: 0;
114
+ -webkit-text-fill-color: initial;
115
+ }
116
+
117
+ vaadin-checkbox label {
118
+ -webkit-text-fill-color: initial;
113
119
  }
114
120
 
115
121
  vaadin-text-field::part(input-field)::after {
@@ -21,6 +21,7 @@ import { formats } from './formats';
21
21
  import { calendarIcon } from './icons';
22
22
  import { counterConfig, DEFAULT_FORMAT, DIVIDER, NATIVE_FORMAT } from './consts';
23
23
  import { DateCounter } from './DateCounterClass';
24
+ import { TextFieldClass } from '../descope-text-field/TextFieldClass';
24
25
 
25
26
  export const componentName = getComponentName('date-field');
26
27
 
@@ -640,9 +641,11 @@ class RawDateFieldClass extends BaseInputClass {
640
641
  }
641
642
  }
642
643
 
643
- const { host, input, toggleButton, overlay, backdrop } = {
644
+ const textVars = TextFieldClass.cssVarList;
645
+ const { host, input, inputEleRTL, toggleButton, overlay, backdrop } = {
644
646
  host: { selector: () => ':host' },
645
647
  input: { selector: () => 'descope-text-field' },
648
+ inputEleRTL: { selector: () => ':host([st-host-direction="rtl"]) descope-text-field' },
646
649
  toggleButton: { selector: () => '.toggle-calendar' },
647
650
  overlay: { selector: 'vaadin-popover-overlay::part(overlay)' },
648
651
  backdrop: { selector: 'vaadin-popover-overlay::part(backdrop)' },
@@ -656,6 +659,8 @@ export const DateFieldClass = compose(
656
659
  hostWidth: { ...host, property: 'width' },
657
660
  hostDirection: { ...host, property: 'direction' },
658
661
  textAlign: { ...input, property: 'text-align' },
662
+ rtlInputDirection: { ...inputEleRTL, property: textVars.inputDirection },
663
+ rtlInputAlignment: { ...inputEleRTL, property: textVars.inputTextAlign },
659
664
  overlayGap: {
660
665
  property: () => DateFieldClass.cssVarList.overlayGap,
661
666
  },
@@ -0,0 +1,111 @@
1
+ import { createBaseClass } from '../../baseClasses/createBaseClass';
2
+ import { compose } from '../../helpers';
3
+ import { getComponentName } from '../../helpers/componentHelpers';
4
+ import { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../mixins';
5
+ import { createDynamicDataMixin } from '../../mixins/createDynamicDataMixin';
6
+ import { CheckboxClass } from '../boolean-fields/descope-checkbox/CheckboxClass';
7
+ import { SwitchToggleClass } from '../boolean-fields/descope-switch-toggle/SwitchToggleClass';
8
+
9
+ export const componentName = getComponentName('scopes-list');
10
+ const variants = ['checkbox', 'switch'];
11
+
12
+ const itemRenderer = ({ id, desc, required = false }, _, ref) => {
13
+ const ComponentClass = ref.variant === 'checkbox' ? CheckboxClass : SwitchToggleClass;
14
+
15
+ return `
16
+ <${ComponentClass.componentName}
17
+ bordered="true"
18
+ size=${ref.size}
19
+ label="${desc}"
20
+ data-id="${id}"
21
+ readonly="${required || ref.isReadOnly}"
22
+ required="${required}"
23
+ checked="true"
24
+ ></${ComponentClass.componentName}>
25
+ `;
26
+ };
27
+
28
+ class RawScopesList extends createBaseClass({ componentName, baseSelector: 'div' }) {
29
+ constructor() {
30
+ super();
31
+
32
+ this.attachShadow({ mode: 'open' }).innerHTML = `
33
+ <style>
34
+ :host {
35
+ display: inline-flex;
36
+ }
37
+
38
+ div {
39
+ display: flex;
40
+ flex-direction: column;
41
+ }
42
+
43
+ </style>
44
+ <div></div>
45
+ `;
46
+ }
47
+
48
+ get isReadOnly() {
49
+ return this.getAttribute('readonly') === 'true';
50
+ }
51
+
52
+ get size() {
53
+ return this.getAttribute('size') || 'sm';
54
+ }
55
+
56
+ get value() {
57
+ return Array.from(this.shadowRoot.querySelector('div').children).reduce(
58
+ (acc, el) => ({ ...acc, [el.getAttribute('data-id')]: el.checked }),
59
+ {}
60
+ );
61
+ }
62
+
63
+ get variant() {
64
+ const variant = this.getAttribute('variant');
65
+
66
+ return variants.includes(variant) ? variant : variants[0];
67
+ }
68
+ }
69
+
70
+ export const ScopesListClass = compose(
71
+ createStyleMixin({
72
+ mappings: {
73
+ hostWidth: { selector: () => ':host', property: 'width' },
74
+ hostDirection: [
75
+ { selector: () => ':host', property: 'direction' },
76
+ {
77
+ selector: () => CheckboxClass.componentName,
78
+ property: CheckboxClass.cssVarList.hostDirection,
79
+ },
80
+ {
81
+ selector: () => SwitchToggleClass.componentName,
82
+ property: SwitchToggleClass.cssVarList.hostDirection,
83
+ },
84
+ ],
85
+ gap: { selector: () => 'div', property: 'gap' },
86
+ requiredInputBorderColor: [
87
+ {
88
+ selector: `${CheckboxClass.componentName}[required="true"]`,
89
+ property: CheckboxClass.cssVarList.inputBorderColor,
90
+ },
91
+ {
92
+ selector: `${SwitchToggleClass.componentName}[required="true"]`,
93
+ property: SwitchToggleClass.cssVarList.inputBorderColor,
94
+ },
95
+ ],
96
+ requiredInputValueTextColor: [
97
+ {
98
+ selector: `${CheckboxClass.componentName}[required="true"]`,
99
+ property: CheckboxClass.cssVarList.inputValueTextColor,
100
+ },
101
+ {
102
+ selector: `${SwitchToggleClass.componentName}[required="true"]`,
103
+ property: SwitchToggleClass.cssVarList.knobColor,
104
+ },
105
+ ],
106
+ },
107
+ }),
108
+ createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size', 'variant'] }),
109
+ draggableMixin,
110
+ componentNameValidationMixin
111
+ )(RawScopesList);
@@ -0,0 +1,7 @@
1
+ import { componentName, ScopesListClass } from './ScopesListClass';
2
+ import '../descope-list';
3
+ import '../boolean-fields/descope-checkbox';
4
+
5
+ customElements.define(componentName, ScopesListClass);
6
+
7
+ export { ScopesListClass };
@@ -55,6 +55,7 @@ export default {
55
55
  hostWidth: { ...host, property: 'width' },
56
56
  hostMinWidth: { ...host, property: 'min-width' },
57
57
  hostDirection: { ...host, property: 'direction' },
58
+ inputDirection: { ...input, property: 'direction' },
58
59
 
59
60
  inputBackgroundColor: [
60
61
  { ...inputField, property: 'background-color' },
package/src/index.cjs.js CHANGED
@@ -52,3 +52,4 @@ export { CalendarClass } from './components/descope-date-field/descope-calendar/
52
52
  export { ListClass } from './components/descope-list/ListClass';
53
53
  export { ListItemClass } from './components/descope-list/ListItemClass';
54
54
  export { AppsListClass } from './components/descope-apps-list/AppsListClass';
55
+ export { ScopesListClass } from './components/descope-scopes-list/ScopesListClass';
package/src/index.js CHANGED
@@ -44,6 +44,7 @@ export * from './components/descope-code-snippet';
44
44
  export * from './components/descope-radio-group';
45
45
  export * from './components/descope-list';
46
46
  export * from './components/descope-apps-list';
47
+ export * from './components/descope-scopes-list';
47
48
 
48
49
  export {
49
50
  globalsThemeToStyle,
@@ -75,18 +75,14 @@ export const createDynamicDataMixin =
75
75
  init() {
76
76
  super.init?.();
77
77
 
78
- if (rerenderAttrsList.length) {
79
- observeAttributes(
80
- this,
81
- (attrs) => {
82
- if (attrs.includes('data')) this.#handleDataAttr();
83
- if (attrs.some((attr) => attr !== 'data')) this.#renderItems();
84
- },
85
- { includeAttrs: [...rerenderAttrsList, 'data'] }
86
- );
87
- } else {
88
- this.#renderItems();
89
- }
78
+ observeAttributes(
79
+ this,
80
+ (attrs) => {
81
+ if (attrs.includes('data')) this.#handleDataAttr();
82
+ else this.#renderItems();
83
+ },
84
+ { includeAttrs: [...rerenderAttrsList, 'data'] }
85
+ );
90
86
  }
91
87
 
92
88
  #handleDataAttr() {
@@ -95,25 +91,10 @@ export const createDynamicDataMixin =
95
91
  if (!dataAttr) return;
96
92
 
97
93
  try {
98
- this.#data = JSON.parse(dataAttr);
94
+ this.data = JSON.parse(dataAttr);
99
95
  } catch (e) {
100
96
  // eslint-disable-next-line no-console
101
97
  console.warn('Invalid JSON data', dataAttr);
102
98
  }
103
99
  }
104
-
105
- attributeChangedCallback(name, oldValue, newValue) {
106
- super.attributeChangedCallback?.(name, oldValue, newValue);
107
-
108
- if (newValue === oldValue) return;
109
-
110
- if (name === 'data') {
111
- try {
112
- this.data = JSON.parse(newValue);
113
- } catch (e) {
114
- // eslint-disable-next-line no-console
115
- console.warn('Invalid JSON data', newValue);
116
- }
117
- }
118
- }
119
100
  };
@@ -25,14 +25,7 @@ const checkbox = {
25
25
  [vars.inputBorderStyle]: refs.borderStyle,
26
26
  [vars.inputBackgroundColor]: refs.backgroundColor,
27
27
  [vars.inputSize]: checkboxSize,
28
-
29
- _checked: {
30
- [vars.inputValueTextColor]: refs.valueTextColor,
31
- },
32
-
33
- _disabled: {
34
- [vars.labelTextColor]: refs.labelTextColor,
35
- },
28
+ [vars.inputValueTextColor]: refs.valueTextColor,
36
29
  };
37
30
 
38
31
  export default checkbox;
@@ -4,7 +4,6 @@ import globals from '../globals';
4
4
  import { getThemeRefs } from '../../helpers/themeHelpers';
5
5
 
6
6
  const globalRefs = getThemeRefs(globals);
7
-
8
7
  const shadowColor = '#00000020';
9
8
  const { shadow } = globalRefs;
10
9
 
@@ -24,6 +23,9 @@ const dateField = {
24
23
  [vars.overlay.outlineColor]: 'transparent',
25
24
  [vars.overlay.outlineStyle]: 'none',
26
25
  [vars.overlay.padding]: '0',
26
+
27
+ [vars.rtlInputDirection]: 'ltr',
28
+ [vars.rtlInputAlignment]: 'right',
27
29
  };
28
30
 
29
31
  export default dateField;
@@ -46,6 +46,7 @@ import * as dateField from './dateField';
46
46
  import * as list from './list/list';
47
47
  import * as listItem from './list/listItem';
48
48
  import * as appsList from './appsList';
49
+ import * as scopesList from './scopesList';
49
50
 
50
51
  const components = {
51
52
  button,
@@ -97,6 +98,7 @@ const components = {
97
98
  list,
98
99
  listItem,
99
100
  appsList,
101
+ scopesList,
100
102
  };
101
103
 
102
104
  const theme = Object.keys(components).reduce(
@@ -0,0 +1,15 @@
1
+ import { ScopesListClass } from '../../components/descope-scopes-list/ScopesListClass';
2
+ import theme, { vars as inputVars } from './inputWrapper';
3
+
4
+ export const vars = ScopesListClass.cssVarList;
5
+
6
+ const scopesList = {
7
+ [vars.requiredInputBorderColor]: theme._disabled[inputVars.borderColor],
8
+ [vars.requiredInputValueTextColor]: theme._disabled[inputVars.valueTextColor],
9
+ [vars.hostWidth]: '280px',
10
+ _fullWidth: {
11
+ [vars.hostWidth]: '100%',
12
+ },
13
+ };
14
+
15
+ export default scopesList;