@descope/web-components-ui 2.2.56 → 2.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/7092.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7092],{86365(e,t,r){r.d(t,{C:()=>x,T:()=>s});var o=r(63200),a=r(25964),i=r(79673),n=r(88961);const s=(0,a.xE)("combo-box"),{host:l,inputField:d,inputElement:p,placeholder:c,toggle:u,clearButton:m,label:h,requiredIndicator:b,helperText:y,errorMessage:g,loader:v,overlayContent:f}={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)"},loader:{selector:"vaadin-combo-box-overlay::part(loader)"},overlayContent:{selector:"vaadin-combo-box-overlay::part(content)"}},x=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[h,c,d,y,g],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...h,property:"-webkit-text-fill-color"},{...b,property:"color"}],errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},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:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...m,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...m,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...m,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,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"}],labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...d,property:"align-items"},valueInputHeight:{...p,property:"height"},valueInputMarginBottom:{...p,property:"margin-bottom"},overlayBackground:{property:()=>x.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>x.cssVarList.overlay.textColor},overlayBorder:{property:()=>x.cssVarList.overlay.border},overlayFontSize:{property:()=>x.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>x.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>x.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>x.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>x.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>x.cssVarList.overlay.itemPaddingInlineEnd},overlayCheckmarkDisplay:{property:()=>x.cssVarList.overlay.checkmarkDisplay},overlaySelectedItemBackground:{property:()=>x.cssVarList.overlay.selectedItemBackground},overlaySelectedItemHoverBackground:{property:()=>x.cssVarList.overlay.selectedItemHoverBackground},overlaySelectedItemFocusBackground:{property:()=>x.cssVarList.overlay.selectedItemFocusBackground},overlayItemHoverBackground:{property:()=>x.cssVarList.overlay.itemHoverBackground},overlayItemFocusBackground:{property:()=>x.cssVarList.overlay.itemFocusBackground}}}),n.VO,(0,n.mA)({name:"overlay",selector:"",mappings:{backgroundColor:[{selector:"vaadin-combo-box-scroller"},{selector:"vaadin-combo-box-overlay::part(overlay)"}],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"},checkmarkDisplay:{selector:"vaadin-combo-box-item::part(checkmark)",property:"display"},selectedItemBackground:{selector:"vaadin-combo-box-item[selected]",property:"background-color"},selectedItemHoverBackground:{selector:"vaadin-combo-box-item[selected]:hover:not([disabled])",property:"background-color"},selectedItemFocusBackground:{selector:"vaadin-combo-box-item[selected][focused]:not([disabled])",property:"background-color"},itemHoverBackground:{selector:"vaadin-combo-box-item:hover:not([selected]):not([disabled])",property:"background-color"},itemFocusBackground:{selector:"vaadin-combo-box-item[focused]:not([selected]):not([disabled])",property:"background-color"},loaderTop:{...v,property:"top"},loaderLeft:{...v,property:"left"},loaderRight:{...v,property:"right"},loaderMargin:{...v,property:"margin"},loaderWidth:{...v,property:"width"},loaderHeight:{...v,property:"height"},loaderBorder:{...v,property:"border"},loaderBorderColor:{...v,property:"border-color"},loaderBorderRadius:{...v,property:"border-radius"},contentHeight:{...f,property:"height"},contentOpacity:{...f,property:"opacity"},scrollerMinHeight:{selector:"vaadin-combo-box-scroller",property:"min-height"}},forward:{include:!1,attributes:["size"]}}),(0,n.OZ)({proxyProps:["selectionStart"],inputEvent:"value-changed"}),n.Yg,n.tQ,e=>class extends e{static get observedAttributes(){return["label-type","require-match"]}#e=({displayName:e,value:t,label:r})=>`<span data-name="${r}" data-id="${t}">${e||r}</span>`;#t;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}set renderer(e){this.baseElement.renderer=e}get loading(){return"true"===this.getAttribute("loading")}set loading(e){e?this.setAttribute("loading","true"):this.removeAttribute("loading")}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" -',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get requireMatch(){return"true"===this.getAttribute("require-match")&&!this.allowCustomValue}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.renderItem?.(t||{})||""),"")}renderItems(){if(this.#t||this.getAttribute("data")){const e=this.getItemsTemplate();this.innerHTML=e}}get hasDynamicData(){return"true"===this.getAttribute("has-dynamic-data")}get shouldSelectItemOnItemsChange(){return!this.hasDynamicData||this.allowCustomValue}handleSelectedItem(){const{selectedItem:e}=this.baseElement,t=e?.["data-id"];e&&Array.from(this.children).includes(e)||(t&&this.shouldSelectItemOnItemsChange&&(this.value=t),this.value||this.setDefaultValue())}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(r){if(!t.baseElement.items?.length&&!t.allowCustomValue)return;const o=t.customValueTransformFn(r)||"";o!==this.value&&e.set.call(this,o)}}})}#r(){const e=Array.from(this.children);e.forEach(e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})}),this.baseElement.items=e,setTimeout(()=>{this.handleSelectedItem()},0)}#o(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#a(){this.baseElement.renderer=(e,t,r)=>{e.innerHTML=r.item.outerHTML}}#i(){this.hasDynamicData&&(this.baseElement._dataProviderFilterChanged=()=>{})}isValueMatch(){return this.baseElement.items.some(e=>e.getAttribute("data-id")===this.baseElement.querySelector("input").value)}init(){super.init?.(),this.getValidity=function(){return this.requireMatch&&!this.isValueMatch()?{patternMismatch:!0}:!this.value&&this.isRequired?{valueMissing:!0}:{}},this.#a(),this.#i(),setTimeout(()=>{this.setComboBoxDescriptor(),this.#o()}),(0,a.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,a.Ge)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("value-changed",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}),this.baseElement.addEventListener("filter-changed",e=>{this.dispatchEvent(new CustomEvent("filter-changed",{bubbles:!0,composed:!0,detail:e.detail}))})}onLabelClick(){this.isReadOnly||this.isDisabled||(this.focus(),this.autoOpenDisabled||this.setAttribute("opened","true"))}handleRequireMatchChange(e){this.baseElement.allowCustomValue=e||this.allowCustomValue}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"require-match"===e&&this.handleRequireMatchChange("true"===r))}setDefaultValue(){this.defaultValue&&(this.value=this.defaultValue)}#n(e){return this.baseElement.items?.find(t=>t["data-id"]===e)}#s(e,t){e===this.value&&t!==this.baseElement.selectedItem&&this.baseElement.addEventListener("selected-item-changed",e=>{e.stopImmediatePropagation()},{once:!0,capture:!0})}set value(e){const t=this.#n(e);this.#s(e,t),e&&t?this.baseElement.selectedItem=t:!t&&this.allowCustomValue?this.baseElement.value=e: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")}get autoOpenDisabled(){return"true"===this.getAttribute("auto-open-disabled")}})((0,n.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,i.cy)(x.cssVarList)}\n\t\t${(0,i.fu)("vaadin-combo-box")}\n\t\t${(0,i.lS)("vaadin-combo-box")}\n\t\t${(0,i.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[hide-toggle-button="true"]::part(toggle-button) {\n display: none;\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,i.$J)("vaadin-combo-box")}\n ${(0,i.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","size","data","loading","style"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},27092(e,t,r){r.r(t),r.d(t,{ComboBoxClass:()=>o.C,componentName:()=>o.T}),r(1632);var o=r(86365);customElements.define(o.T,o.C)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7092],{86365(e,t,r){r.d(t,{C:()=>x,T:()=>s});var o=r(63200),a=r(25964),i=r(79673),n=r(88961);const s=(0,a.xE)("combo-box"),{host:l,inputField:d,inputElement:p,placeholder:c,toggle:u,clearButton:m,label:h,requiredIndicator:b,helperText:y,errorMessage:g,loader:v,overlayContent:f}={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)"},loader:{selector:"vaadin-combo-box-overlay::part(loader)"},overlayContent:{selector:"vaadin-combo-box-overlay::part(content)"}},x=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[h,c,d,y,g],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...h,property:"-webkit-text-fill-color"},{...b,property:"color"}],errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},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:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...m,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...m,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...m,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,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"}],labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...d,property:"align-items"},valueInputHeight:{...p,property:"height"},valueInputMarginBottom:{...p,property:"margin-bottom"},overlayBackground:{property:()=>x.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>x.cssVarList.overlay.textColor},overlayBorder:{property:()=>x.cssVarList.overlay.border},overlayFontSize:{property:()=>x.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>x.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>x.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>x.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>x.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>x.cssVarList.overlay.itemPaddingInlineEnd},overlayCheckmarkDisplay:{property:()=>x.cssVarList.overlay.checkmarkDisplay},overlaySelectedItemBackground:{property:()=>x.cssVarList.overlay.selectedItemBackground},overlaySelectedItemHoverBackground:{property:()=>x.cssVarList.overlay.selectedItemHoverBackground},overlaySelectedItemFocusBackground:{property:()=>x.cssVarList.overlay.selectedItemFocusBackground},overlayItemHoverBackground:{property:()=>x.cssVarList.overlay.itemHoverBackground},overlayItemFocusBackground:{property:()=>x.cssVarList.overlay.itemFocusBackground}}}),n.VO,(0,n.mA)({name:"overlay",selector:"",mappings:{backgroundColor:[{selector:"vaadin-combo-box-scroller"},{selector:"vaadin-combo-box-overlay::part(overlay)"}],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"},checkmarkDisplay:{selector:"vaadin-combo-box-item::part(checkmark)",property:"display"},selectedItemBackground:{selector:"vaadin-combo-box-item[selected]",property:"background-color"},selectedItemHoverBackground:{selector:"vaadin-combo-box-item[selected]:hover:not([disabled])",property:"background-color"},selectedItemFocusBackground:{selector:"vaadin-combo-box-item[selected][focused]:not([disabled])",property:"background-color"},itemHoverBackground:{selector:"vaadin-combo-box-item:hover:not([selected]):not([disabled])",property:"background-color"},itemFocusBackground:{selector:"vaadin-combo-box-item[focused]:not([selected]):not([disabled])",property:"background-color"},loaderTop:{...v,property:"top"},loaderLeft:{...v,property:"left"},loaderRight:{...v,property:"right"},loaderMargin:{...v,property:"margin"},loaderWidth:{...v,property:"width"},loaderHeight:{...v,property:"height"},loaderBorder:{...v,property:"border"},loaderBorderColor:{...v,property:"border-color"},loaderBorderRadius:{...v,property:"border-radius"},contentHeight:{...f,property:"height"},contentOpacity:{...f,property:"opacity"},scrollerMinHeight:{selector:"vaadin-combo-box-scroller",property:"min-height"}},forward:{include:!1,attributes:["size"]}}),(0,n.OZ)({proxyProps:["selectionStart"],inputEvent:"value-changed"}),n.Yg,n.tQ,e=>class extends e{static get observedAttributes(){return["label-type","require-match"]}#e=({displayName:e,value:t,label:r})=>`<span data-name="${r}" data-id="${t}">${e||r}</span>`;#t;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}set renderer(e){this.baseElement.renderer=e}get loading(){return"true"===this.getAttribute("loading")}set loading(e){e?this.setAttribute("loading","true"):this.removeAttribute("loading")}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" -',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get requireMatch(){return"true"===this.getAttribute("require-match")&&!this.allowCustomValue}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.renderItem?.(t||{})||""),"")}renderItems(){if(this.#t||this.getAttribute("data")){const e=this.getItemsTemplate();this.innerHTML=e}}get hasDynamicData(){return"true"===this.getAttribute("has-dynamic-data")}get shouldSelectItemOnItemsChange(){return!this.hasDynamicData||this.allowCustomValue}handleSelectedItem(){const{selectedItem:e}=this.baseElement,t=e?.["data-id"];e&&Array.from(this.children).includes(e)||(t&&this.shouldSelectItemOnItemsChange&&(this.value=t),this.value||this.setDefaultValue())}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(r){if(!t.baseElement.items?.length&&!t.allowCustomValue)return;const o=t.customValueTransformFn(r)||"";o!==this.value&&e.set.call(this,o)}}})}#r(){const e=Array.from(this.children);e.forEach(e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})}),this.baseElement.items=e,setTimeout(()=>{this.handleSelectedItem()},0)}#o(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#a(){this.baseElement.renderer=(e,t,r)=>{e.innerHTML=r.item.outerHTML}}#i(){this.hasDynamicData&&(this.baseElement._dataProviderFilterChanged=()=>{})}isValueMatch(){const e=this.baseElement.querySelector("input").value;return!e||this.baseElement.items.some(t=>t.dataset.name===e||t.dataset.id===e)}init(){super.init?.(),this.getValidity=function(){return this.requireMatch&&!this.isValueMatch()?{patternMismatch:!0}:!this.value&&this.isRequired?{valueMissing:!0}:{}},this.#a(),this.#i(),setTimeout(()=>{this.setComboBoxDescriptor(),this.#o()}),(0,a.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,a.Ge)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("value-changed",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}),this.baseElement.addEventListener("filter-changed",e=>{this.dispatchEvent(new CustomEvent("filter-changed",{bubbles:!0,composed:!0,detail:e.detail}))})}onLabelClick(){this.isReadOnly||this.isDisabled||(this.focus(),this.autoOpenDisabled||this.setAttribute("opened","true"))}handleRequireMatchChange(e){this.baseElement.allowCustomValue=e||this.allowCustomValue}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"require-match"===e&&this.handleRequireMatchChange("true"===r))}setDefaultValue(){this.defaultValue&&(this.value=this.defaultValue)}#n(e){return this.baseElement.items?.find(t=>t["data-id"]===e)}#s(e,t){e===this.value&&t!==this.baseElement.selectedItem&&this.baseElement.addEventListener("selected-item-changed",e=>{e.stopImmediatePropagation()},{once:!0,capture:!0})}set value(e){const t=this.#n(e);this.#s(e,t),e&&t?this.baseElement.selectedItem=t:!t&&this.allowCustomValue?this.baseElement.value=e: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")}get autoOpenDisabled(){return"true"===this.getAttribute("auto-open-disabled")}})((0,n.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,i.cy)(x.cssVarList)}\n\t\t${(0,i.fu)("vaadin-combo-box")}\n\t\t${(0,i.lS)("vaadin-combo-box")}\n\t\t${(0,i.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[hide-toggle-button="true"]::part(toggle-button) {\n display: none;\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,i.$J)("vaadin-combo-box")}\n ${(0,i.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","size","data","loading","style"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},27092(e,t,r){r.r(t),r.d(t,{ComboBoxClass:()=>o.C,componentName:()=>o.T}),r(1632);var o=r(86365);customElements.define(o.T,o.C)}}]);
2
2
  //# sourceMappingURL=7092.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"7092.js","mappings":"+MAwBO,MAAMA,GAAgB,QAAiB,cA0XxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,YACZC,EAAW,OACXC,EAAM,YACNC,EAA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,GAIzC7F,IAAQT,KAAKF,OAASwG,IAAkBtG,KAAKO,YAAY4B,cAEzDnC,KAAKO,YAAY2E,iBACf,wBACCjE,IACCA,EAAEsF,4BAEJ,CAAEC,MAAM,EAAMC,SAAS,GAG7B,CAEA,SAAI3G,CAAMW,GACR,MAAM6F,EAAgBtG,MAAK,EAAkBS,GAC7CT,MAAK,EAAwCS,EAAK6F,GAC9C7F,GAAO6F,EACTtG,KAAKO,YAAY4B,aAAemE,GACtBA,GAAiBtG,KAAKsB,iBAChCtB,KAAKO,YAAYT,MAAQW,EAEzBT,KAAKO,YAAY4B,kBAAeuE,CAEpC,CAEA,SAAI5G,GACF,OAAOE,KAAKO,YAAY4B,eAAe,YAAcnC,KAAKsB,mBACtDtB,KAAKO,YAAYoG,OAAO7G,OACxB,EACN,CAEA,oBAAIwB,GACF,MAAmD,SAA5CtB,KAAKC,aAAa,qBAC3B,CAEA,oBAAI4F,GACF,MAAmD,SAA5C7F,KAAKC,aAAa,qBAC3B,GAiCyB,EAsN3B,QAAY,CACV2G,MAAO,CAAC,GAAI,UACZC,eAAgB,mBAChBC,MAAO,IAAM,2HAMb,QAAuBlN,EAAc8C,qBACrC,QAAwB,6BACxB,QAAsB,6BACtB,QAAiB,u2BAoCf,QAAwB,6BACxB,kBAMFqK,iBAAkB,CAAC,WAAY,OAAQ,OAAQ,UAAW,SAC1DjO,gBACAkO,oBAAqB,CAAC,QAAS,WAAY,kB,kGC5rB/CC,eAAeC,OAAO,IAAe,EAAAC,E","sources":["webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/ComboBoxClass.js","webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/index.js"],"sourcesContent":["import { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputPlaceholder,\n resetInputReadonlyStyle,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '@descope-ui/common/theme-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n inputOverrideValidConstraintsMixin,\n portalMixin,\n proxyInputMixin,\n} from '@descope-ui/common/components-mixins';\n\nexport const componentName = getComponentName('combo-box');\n\nconst ComboBoxMixin = (superclass) =>\n class ComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['label-type', 'require-match'];\n }\n\n // eslint-disable-next-line class-methods-use-this\n #renderItem = ({ displayName, value, label }) => {\n return `<span data-name=\"${label}\" data-id=\"${value}\">${\n displayName || label\n }</span>`;\n };\n\n #data;\n\n get defaultValue() {\n return this.getAttribute('default-value');\n }\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n set renderer(fn) {\n // fn takes (root, comboBox, model) as arguments\n this.baseElement.renderer = fn;\n }\n\n get loading() {\n return this.getAttribute('loading') === 'true';\n }\n\n set loading(val) {\n if (val) {\n this.setAttribute('loading', 'true');\n } else {\n this.removeAttribute('loading');\n }\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\n 'could not parse data string from attribute \"data\" -',\n e.message,\n );\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n get requireMatch() {\n return this.getAttribute('require-match') === 'true' && !this.allowCustomValue;\n }\n\n // eslint-disable-next-line class-methods-use-this\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data must be an array, received:', data);\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.(\n (acc, item) => acc + (this.renderItem?.(item || {}) || ''),\n '',\n );\n }\n\n renderItems() {\n if (this.#data || this.getAttribute('data')) {\n const template = this.getItemsTemplate();\n this.innerHTML = template;\n }\n }\n\n get hasDynamicData() {\n return this.getAttribute('has-dynamic-data') === 'true';\n }\n\n get shouldSelectItemOnItemsChange() {\n return !this.hasDynamicData || this.allowCustomValue;\n }\n\n handleSelectedItem() {\n const { selectedItem } = this.baseElement;\n const currentSelected = selectedItem?.['data-id'];\n\n // If the selected item is still a child, there's no need to update the value\n if (selectedItem && Array.from(this.children).includes(selectedItem)) {\n return;\n }\n\n // if previously selected item ID exists in current children, set it as selected\n if (currentSelected && this.shouldSelectItemOnItemsChange) {\n this.value = currentSelected;\n }\n\n // otherwise, if default value is specified, set default value as selected item\n if (!this.value) {\n this.setDefaultValue();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n customValueTransformFn(val) {\n return val;\n }\n\n // We want to override Vaadin's Combo Box value setter. This is needed since Vaadin couples between the\n // field that it searches the value, and the finaly display value of the input.\n // We provide a custom transform function to override that behavior.\n setComboBoxDescriptor() {\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value',\n );\n\n const comboBox = this;\n\n Object.defineProperties(this.inputElement, {\n value: {\n ...valueDescriptor,\n set(val) {\n if (\n !comboBox.baseElement.items?.length &&\n !comboBox.allowCustomValue\n ) {\n return;\n }\n\n const transformedValue = comboBox.customValueTransformFn(val) || '';\n\n if (transformedValue === this.value) {\n return;\n }\n\n valueDescriptor.set.call(this, transformedValue);\n },\n },\n });\n }\n\n // vaadin api is to set props on their combo box node,\n // in order to avoid it, we are passing the children of this component\n // to the items & renderer props, so it will be used as the combo box items\n #onChildrenChange() {\n const items = Array.from(this.children);\n\n // we want the data-name attribute to be accessible as an object attribute\n items.forEach((node) => {\n Object.defineProperty(node, 'data-name', {\n value: node.getAttribute('data-name'),\n configurable: true,\n writable: true,\n });\n Object.defineProperty(node, 'data-id', {\n value: node.getAttribute('data-id'),\n configurable: true,\n writable: true,\n });\n });\n\n this.baseElement.items = items;\n setTimeout(() => {\n // set timeout to ensure this runs after customValueTransformFn had the chance to be overriden\n this.handleSelectedItem();\n }, 0);\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot.querySelector(\n 'vaadin-combo-box-overlay',\n );\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #overrideRenderer() {\n // use vaadin combobox custom renderer to render options as HTML\n // and not via default renderer, which renders only the data-name's value\n // in its own HTML template\n this.baseElement.renderer = (root, combo, model) => {\n // eslint-disable-next-line no-param-reassign\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n #disableDataProviderFilterEventIfNeeded() {\n if (this.hasDynamicData) {\n // For the autocomplete field, we don't want to trigger the data provider filter changed event\n // because it changes the loading state on every keystroke, making the overlay open and close\n // on every keystroke, causing a flickering effect in the loading state.\n this.baseElement._dataProviderFilterChanged = () => {};\n }\n }\n\n isValueMatch() {\n return this.baseElement.items.some(val => val.getAttribute('data-id') === this.baseElement.querySelector('input').value);\n }\n\n init() {\n super.init?.();\n\n // eslint-disable-next-line func-names\n this.getValidity = function () {\n if (this.requireMatch && !this.isValueMatch()) {\n return {\n patternMismatch: true,\n };\n }\n\n if (!this.value && this.isRequired) {\n return {\n valueMissing: true,\n };\n }\n\n return {};\n };\n\n this.#overrideRenderer();\n this.#disableDataProviderFilterEventIfNeeded();\n\n // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to\n // set the component's descriptor and override the overlay settings.\n // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n // Set up observers - order matters here since renderItems can clear innerHTML\n observeAttributes(this, this.renderItems.bind(this), {\n includeAttrs: ['data'],\n });\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n this.setDefaultValue();\n\n // Using \"value-changed\" event instead of \"selected-item-changed\" event to avoid\n // the issue of the value not being updated in the input field when the user enter a custom value\n this.baseElement.addEventListener('value-changed', () => {\n this.dispatchEvent(\n new Event('input', { bubbles: true, composed: true }),\n );\n });\n\n this.baseElement.addEventListener('filter-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent('filter-changed', {\n bubbles: true,\n composed: true,\n detail: e.detail,\n }),\n );\n });\n }\n\n onLabelClick() {\n if (this.isReadOnly || this.isDisabled) {\n return;\n }\n this.focus();\n if (!this.autoOpenDisabled) {\n this.setAttribute('opened', 'true');\n }\n }\n\n handleRequireMatchChange(shouldValidate) {\n this.baseElement.allowCustomValue = shouldValidate || this.allowCustomValue;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'label-type') {\n if (newValue === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'require-match') {\n this.handleRequireMatchChange(newValue === 'true');\n }\n }\n }\n\n setDefaultValue() {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n }\n\n #getChildToSelect(val) {\n return this.baseElement.items?.find((item) => item['data-id'] === val);\n }\n\n #preventSelectedItemChangeEventIfNeeded(val, selectedChild) {\n // If the actual value didn't change, but the selected item did (the element changed),\n // we want to stop the event propagation since it's not a real change\n const shouldPreventItemChangeEvent =\n val === this.value && selectedChild !== this.baseElement.selectedItem;\n if (shouldPreventItemChangeEvent) {\n this.baseElement.addEventListener(\n 'selected-item-changed',\n (e) => {\n e.stopImmediatePropagation();\n },\n { once: true, capture: true },\n );\n }\n }\n\n set value(val) {\n const selectedChild = this.#getChildToSelect(val);\n this.#preventSelectedItemChangeEventIfNeeded(val, selectedChild);\n if (val && selectedChild) {\n this.baseElement.selectedItem = selectedChild;\n } else if (!selectedChild && this.allowCustomValue) {\n this.baseElement.value = val;\n } else {\n this.baseElement.selectedItem = undefined;\n }\n }\n\n get value() {\n return this.baseElement.selectedItem?.['data-id'] || this.allowCustomValue\n ? this.baseElement.__data.value || ''\n : '';\n }\n\n get allowCustomValue() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get autoOpenDisabled() {\n return this.getAttribute('auto-open-disabled') === 'true';\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n placeholder,\n toggle,\n clearButton,\n label,\n requiredIndicator,\n helperText,\n errorMessage,\n loader,\n overlayContent,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: 'input' },\n placeholder: { selector: '> input:placeholder-shown' },\n toggle: { selector: '::part(toggle-button)' },\n clearButton: { selector: '::part(clear-button)' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n loader: { selector: 'vaadin-combo-box-overlay::part(loader)' },\n overlayContent: { selector: 'vaadin-combo-box-overlay::part(content)' },\n};\n\nexport const ComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, placeholder, inputField, helperText, errorMessage],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n ],\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: {\n ...errorMessage,\n property: 'background-repeat',\n },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n inputHeight: { ...inputField, property: 'height' },\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n inputValueTextColor: { ...inputField, property: 'color' },\n inputPlaceholderTextColor: { ...placeholder, property: 'color' },\n inputDropdownButtonCursor: [\n { ...toggle, property: 'cursor' },\n { ...clearButton, property: 'cursor' },\n ],\n inputDropdownButtonColor: [\n { ...toggle, property: 'color' },\n { ...clearButton, property: 'color' },\n ],\n inputDropdownButtonSize: [\n { ...toggle, property: 'font-size' },\n { ...clearButton, property: 'font-size' },\n ],\n inputDropdownButtonOffset: [\n { ...toggle, property: 'margin-right' },\n { ...toggle, property: 'margin-left' },\n ],\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n valueInputMarginBottom: { ...inputElement, property: 'margin-bottom' },\n\n // we need to use the variables from the portal mixin\n // so we need to use an arrow function on the selector\n // for that to work, because ComboBox is not available\n // at this time.\n overlayBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => ComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: {\n property: () => ComboBoxClass.cssVarList.overlay.border,\n },\n overlayFontSize: {\n property: () => ComboBoxClass.cssVarList.overlay.fontSize,\n },\n overlayFontFamily: {\n property: () => ComboBoxClass.cssVarList.overlay.fontFamily,\n },\n overlayCursor: {\n property: () => ComboBoxClass.cssVarList.overlay.cursor,\n },\n overlayItemBoxShadow: {\n property: () => ComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n overlayCheckmarkDisplay: {\n property: () => ComboBoxClass.cssVarList.overlay.checkmarkDisplay,\n },\n overlaySelectedItemBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.selectedItemBackground,\n },\n overlaySelectedItemHoverBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemHoverBackground,\n },\n overlaySelectedItemFocusBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemFocusBackground,\n },\n overlayItemHoverBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemHoverBackground,\n },\n overlayItemFocusBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemFocusBackground,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n backgroundColor: [\n { selector: 'vaadin-combo-box-scroller' },\n { selector: 'vaadin-combo-box-overlay::part(overlay)' },\n ],\n minHeight: { selector: 'vaadin-combo-box-overlay' },\n margin: { selector: 'vaadin-combo-box-overlay' },\n cursor: { selector: 'vaadin-combo-box-item' },\n fontFamily: { selector: 'vaadin-combo-box-item' },\n textColor: { selector: 'vaadin-combo-box-item', property: 'color' },\n fontSize: { selector: 'vaadin-combo-box-item' },\n itemBoxShadow: {\n selector: 'vaadin-combo-box-item',\n property: 'box-shadow',\n },\n itemPaddingInlineStart: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-end',\n },\n checkmarkDisplay: {\n selector: 'vaadin-combo-box-item::part(checkmark)',\n property: 'display',\n },\n selectedItemBackground: {\n selector: 'vaadin-combo-box-item[selected]',\n property: 'background-color',\n },\n selectedItemHoverBackground: {\n selector: 'vaadin-combo-box-item[selected]:hover:not([disabled])',\n property: 'background-color',\n },\n selectedItemFocusBackground: {\n selector: 'vaadin-combo-box-item[selected][focused]:not([disabled])',\n property: 'background-color',\n },\n itemHoverBackground: {\n selector: 'vaadin-combo-box-item:hover:not([selected]):not([disabled])',\n property: 'background-color',\n },\n itemFocusBackground: {\n selector:\n 'vaadin-combo-box-item[focused]:not([selected]):not([disabled])',\n property: 'background-color',\n },\n\n loaderTop: { ...loader, property: 'top' },\n loaderLeft: { ...loader, property: 'left' },\n loaderRight: { ...loader, property: 'right' },\n loaderMargin: { ...loader, property: 'margin' },\n loaderWidth: { ...loader, property: 'width' },\n loaderHeight: { ...loader, property: 'height' },\n loaderBorder: { ...loader, property: 'border' },\n loaderBorderColor: { ...loader, property: 'border-color' },\n loaderBorderRadius: { ...loader, property: 'border-radius' },\n contentHeight: { ...overlayContent, property: 'height' },\n contentOpacity: { ...overlayContent, property: 'opacity' },\n scrollerMinHeight: {\n selector: 'vaadin-combo-box-scroller',\n property: 'min-height',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({\n proxyProps: ['selectionStart'],\n inputEvent: 'value-changed',\n }),\n inputOverrideValidConstraintsMixin,\n componentNameValidationMixin,\n ComboBoxMixin,\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-combo-box',\n 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${useHostExternalPadding(ComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-combo-box')}\n\t\t${resetInputCursor('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[hide-toggle-button=\"true\"]::part(toggle-button) {\n display: none;\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 ${resetInputLabelPosition('vaadin-combo-box')}\n ${inputFloatingLabelStyle()}\n\t\t`,\n // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property\n // with the same name. Including it will cause Vaadin to calculate NaN size,\n // and reset items to an empty array, and opening the list box with no items\n // to display.\n excludeAttrsSync: ['tabindex', 'size', 'data', 'loading', 'style'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItem'],\n }),\n);\n","import '@vaadin/combo-box';\nimport { componentName, ComboBoxClass } from './ComboBoxClass';\n\ncustomElements.define(componentName, ComboBoxClass);\n\nexport { ComboBoxClass, componentName };\n"],"names":["componentName","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","loader","overlayContent","selector","ComboBoxClass","mappings","hostWidth","property","hostDirection","fontSize","fontFamily","labelFontSize","labelFontWeight","labelTextColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputHeight","inputBackgroundColor","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","labelRequiredIndicator","inputValueTextColor","inputPlaceholderTextColor","inputDropdownButtonCursor","inputDropdownButtonColor","inputDropdownButtonSize","inputDropdownButtonOffset","inputOutlineColor","inputOutlineWidth","inputOutlineStyle","inputOutlineOffset","inputHorizontalPadding","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","overlayCheckmarkDisplay","checkmarkDisplay","overlaySelectedItemBackground","selectedItemBackground","overlaySelectedItemHoverBackground","selectedItemHoverBackground","overlaySelectedItemFocusBackground","selectedItemFocusBackground","overlayItemHoverBackground","itemHoverBackground","overlayItemFocusBackground","itemFocusBackground","name","minHeight","margin","loaderTop","loaderLeft","loaderRight","loaderMargin","loaderWidth","loaderHeight","loaderBorder","loaderBorderColor","loaderBorderRadius","contentHeight","contentOpacity","scrollerMinHeight","forward","include","attributes","proxyProps","inputEvent","superclass","observedAttributes","displayName","value","defaultValue","this","getAttribute","renderItem","renderFn","renderItems","renderer","fn","baseElement","loading","val","setAttribute","removeAttribute","data","dataAttr","JSON","parse","isValidDataType","e","console","error","message","requireMatch","allowCustomValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","hasDynamicData","shouldSelectItemOnItemsChange","handleSelectedItem","selectedItem","currentSelected","from","children","includes","setDefaultValue","customValueTransformFn","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","items","length","transformedValue","call","forEach","node","defineProperty","configurable","writable","setTimeout","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","root","combo","model","outerHTML","_dataProviderFilterChanged","isValueMatch","some","init","super","getValidity","patternMismatch","isRequired","valueMissing","bind","includeAttrs","addEventListener","dispatchEvent","Event","bubbles","composed","CustomEvent","detail","onLabelClick","isReadOnly","isDisabled","focus","autoOpenDisabled","handleRequireMatchChange","shouldValidate","attributeChangedCallback","attrName","oldValue","newValue","removeEventListener","find","selectedChild","stopImmediatePropagation","once","capture","undefined","__data","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps","customElements","define","C"],"sourceRoot":""}
1
+ {"version":3,"file":"7092.js","mappings":"+MAwBO,MAAMA,GAAgB,QAAiB,cAgYxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,YACZC,EAAW,OACXC,EAAM,YACNC,EAAW,MACXC,EAAK,kBACLC,EAAiB,WACjBC,EAAU,aACVC,EAAY,OACZC,EAAM,eACNC,GACE,CACFX,KAAM,CAAEY,SAAU,IAAM,SACxBX,WAAY,CAAEW,SAAU,uBACxBV,aAAc,CAAEU,SAAU,SAC1BT,YAAa,CAAES,SAAU,6BACzBR,OAAQ,CAAEQ,SAAU,yBACpBP,YAAa,CAAEO,SAAU,wBACzBN,MAAO,CAAEM,SAAU,iBACnBL,kBAAmB,CACjBK,SAAU,+CAEZJ,WAAY,CAAEI,SAAU,uBACxBH,aAAc,CAAEG,SAAU,yBAC1BF,OAAQ,CAAEE,SAAU,0CACpBD,eAAgB,CAAEC,SAAU,4CAGjBC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKf,EAAMgB,SAAU,SAChCC,cAAe,IAAKjB,EAAMgB,SAAU,aAEpCE,SAAU,CAAC,CAAC,EAAGlB,GACfmB,WAAY,CA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GACF,MAAmD,SAA5CtB,KAAKC,aAAa,qBAC3B,CAEA,oBAAI8F,GACF,MAAmD,SAA5C/F,KAAKC,aAAa,qBAC3B,GAiCyB,EAsN3B,QAAY,CACV6G,MAAO,CAAC,GAAI,UACZC,eAAgB,mBAChBC,MAAO,IAAM,2HAMb,QAAuBpN,EAAc8C,qBACrC,QAAwB,6BACxB,QAAsB,6BACtB,QAAiB,u2BAoCf,QAAwB,6BACxB,kBAMFuK,iBAAkB,CAAC,WAAY,OAAQ,OAAQ,UAAW,SAC1DnO,gBACAoO,oBAAqB,CAAC,QAAS,WAAY,kB,kGClsB/CC,eAAeC,OAAO,IAAe,EAAAC,E","sources":["webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/ComboBoxClass.js","webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/index.js"],"sourcesContent":["import { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputPlaceholder,\n resetInputReadonlyStyle,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '@descope-ui/common/theme-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n inputOverrideValidConstraintsMixin,\n portalMixin,\n proxyInputMixin,\n} from '@descope-ui/common/components-mixins';\n\nexport const componentName = getComponentName('combo-box');\n\nconst ComboBoxMixin = (superclass) =>\n class ComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['label-type', 'require-match'];\n }\n\n // eslint-disable-next-line class-methods-use-this\n #renderItem = ({ displayName, value, label }) => {\n return `<span data-name=\"${label}\" data-id=\"${value}\">${\n displayName || label\n }</span>`;\n };\n\n #data;\n\n get defaultValue() {\n return this.getAttribute('default-value');\n }\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n set renderer(fn) {\n // fn takes (root, comboBox, model) as arguments\n this.baseElement.renderer = fn;\n }\n\n get loading() {\n return this.getAttribute('loading') === 'true';\n }\n\n set loading(val) {\n if (val) {\n this.setAttribute('loading', 'true');\n } else {\n this.removeAttribute('loading');\n }\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\n 'could not parse data string from attribute \"data\" -',\n e.message,\n );\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n get requireMatch() {\n return this.getAttribute('require-match') === 'true' && !this.allowCustomValue;\n }\n\n // eslint-disable-next-line class-methods-use-this\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data must be an array, received:', data);\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.(\n (acc, item) => acc + (this.renderItem?.(item || {}) || ''),\n '',\n );\n }\n\n renderItems() {\n if (this.#data || this.getAttribute('data')) {\n const template = this.getItemsTemplate();\n this.innerHTML = template;\n }\n }\n\n get hasDynamicData() {\n return this.getAttribute('has-dynamic-data') === 'true';\n }\n\n get shouldSelectItemOnItemsChange() {\n return !this.hasDynamicData || this.allowCustomValue;\n }\n\n handleSelectedItem() {\n const { selectedItem } = this.baseElement;\n const currentSelected = selectedItem?.['data-id'];\n\n // If the selected item is still a child, there's no need to update the value\n if (selectedItem && Array.from(this.children).includes(selectedItem)) {\n return;\n }\n\n // if previously selected item ID exists in current children, set it as selected\n if (currentSelected && this.shouldSelectItemOnItemsChange) {\n this.value = currentSelected;\n }\n\n // otherwise, if default value is specified, set default value as selected item\n if (!this.value) {\n this.setDefaultValue();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n customValueTransformFn(val) {\n return val;\n }\n\n // We want to override Vaadin's Combo Box value setter. This is needed since Vaadin couples between the\n // field that it searches the value, and the finaly display value of the input.\n // We provide a custom transform function to override that behavior.\n setComboBoxDescriptor() {\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value',\n );\n\n const comboBox = this;\n\n Object.defineProperties(this.inputElement, {\n value: {\n ...valueDescriptor,\n set(val) {\n if (\n !comboBox.baseElement.items?.length &&\n !comboBox.allowCustomValue\n ) {\n return;\n }\n\n const transformedValue = comboBox.customValueTransformFn(val) || '';\n\n if (transformedValue === this.value) {\n return;\n }\n\n valueDescriptor.set.call(this, transformedValue);\n },\n },\n });\n }\n\n // vaadin api is to set props on their combo box node,\n // in order to avoid it, we are passing the children of this component\n // to the items & renderer props, so it will be used as the combo box items\n #onChildrenChange() {\n const items = Array.from(this.children);\n\n // we want the data-name attribute to be accessible as an object attribute\n items.forEach((node) => {\n Object.defineProperty(node, 'data-name', {\n value: node.getAttribute('data-name'),\n configurable: true,\n writable: true,\n });\n Object.defineProperty(node, 'data-id', {\n value: node.getAttribute('data-id'),\n configurable: true,\n writable: true,\n });\n });\n\n this.baseElement.items = items;\n setTimeout(() => {\n // set timeout to ensure this runs after customValueTransformFn had the chance to be overriden\n this.handleSelectedItem();\n }, 0);\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot.querySelector(\n 'vaadin-combo-box-overlay',\n );\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #overrideRenderer() {\n // use vaadin combobox custom renderer to render options as HTML\n // and not via default renderer, which renders only the data-name's value\n // in its own HTML template\n this.baseElement.renderer = (root, combo, model) => {\n // eslint-disable-next-line no-param-reassign\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n #disableDataProviderFilterEventIfNeeded() {\n if (this.hasDynamicData) {\n // For the autocomplete field, we don't want to trigger the data provider filter changed event\n // because it changes the loading state on every keystroke, making the overlay open and close\n // on every keystroke, causing a flickering effect in the loading state.\n this.baseElement._dataProviderFilterChanged = () => {};\n }\n }\n\n isValueMatch() {\n const val = this.baseElement.querySelector('input').value;\n\n if (val) {\n return this.baseElement.items.some(item => item.dataset.name === val || item.dataset.id === val);\n }\n\n return true;\n }\n\n init() {\n super.init?.();\n\n // eslint-disable-next-line func-names\n this.getValidity = function () {\n if (this.requireMatch && !this.isValueMatch()) {\n return {\n patternMismatch: true,\n };\n }\n\n if (!this.value && this.isRequired) {\n return {\n valueMissing: true,\n };\n }\n\n return {};\n };\n\n this.#overrideRenderer();\n this.#disableDataProviderFilterEventIfNeeded();\n\n // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to\n // set the component's descriptor and override the overlay settings.\n // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n // Set up observers - order matters here since renderItems can clear innerHTML\n observeAttributes(this, this.renderItems.bind(this), {\n includeAttrs: ['data'],\n });\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n this.setDefaultValue();\n\n // Using \"value-changed\" event instead of \"selected-item-changed\" event to avoid\n // the issue of the value not being updated in the input field when the user enter a custom value\n this.baseElement.addEventListener('value-changed', () => {\n this.dispatchEvent(\n new Event('input', { bubbles: true, composed: true }),\n );\n });\n\n this.baseElement.addEventListener('filter-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent('filter-changed', {\n bubbles: true,\n composed: true,\n detail: e.detail,\n }),\n );\n });\n }\n\n onLabelClick() {\n if (this.isReadOnly || this.isDisabled) {\n return;\n }\n this.focus();\n if (!this.autoOpenDisabled) {\n this.setAttribute('opened', 'true');\n }\n }\n\n handleRequireMatchChange(shouldValidate) {\n this.baseElement.allowCustomValue = shouldValidate || this.allowCustomValue;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'label-type') {\n if (newValue === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'require-match') {\n this.handleRequireMatchChange(newValue === 'true');\n }\n }\n }\n\n setDefaultValue() {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n }\n\n #getChildToSelect(val) {\n return this.baseElement.items?.find((item) => item['data-id'] === val);\n }\n\n #preventSelectedItemChangeEventIfNeeded(val, selectedChild) {\n // If the actual value didn't change, but the selected item did (the element changed),\n // we want to stop the event propagation since it's not a real change\n const shouldPreventItemChangeEvent =\n val === this.value && selectedChild !== this.baseElement.selectedItem;\n if (shouldPreventItemChangeEvent) {\n this.baseElement.addEventListener(\n 'selected-item-changed',\n (e) => {\n e.stopImmediatePropagation();\n },\n { once: true, capture: true },\n );\n }\n }\n\n set value(val) {\n const selectedChild = this.#getChildToSelect(val);\n this.#preventSelectedItemChangeEventIfNeeded(val, selectedChild);\n if (val && selectedChild) {\n this.baseElement.selectedItem = selectedChild;\n } else if (!selectedChild && this.allowCustomValue) {\n this.baseElement.value = val;\n } else {\n this.baseElement.selectedItem = undefined;\n }\n }\n\n get value() {\n return this.baseElement.selectedItem?.['data-id'] || this.allowCustomValue\n ? this.baseElement.__data.value || ''\n : '';\n }\n\n get allowCustomValue() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get autoOpenDisabled() {\n return this.getAttribute('auto-open-disabled') === 'true';\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n placeholder,\n toggle,\n clearButton,\n label,\n requiredIndicator,\n helperText,\n errorMessage,\n loader,\n overlayContent,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: 'input' },\n placeholder: { selector: '> input:placeholder-shown' },\n toggle: { selector: '::part(toggle-button)' },\n clearButton: { selector: '::part(clear-button)' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n loader: { selector: 'vaadin-combo-box-overlay::part(loader)' },\n overlayContent: { selector: 'vaadin-combo-box-overlay::part(content)' },\n};\n\nexport const ComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, placeholder, inputField, helperText, errorMessage],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n ],\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: {\n ...errorMessage,\n property: 'background-repeat',\n },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n inputHeight: { ...inputField, property: 'height' },\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n inputValueTextColor: { ...inputField, property: 'color' },\n inputPlaceholderTextColor: { ...placeholder, property: 'color' },\n inputDropdownButtonCursor: [\n { ...toggle, property: 'cursor' },\n { ...clearButton, property: 'cursor' },\n ],\n inputDropdownButtonColor: [\n { ...toggle, property: 'color' },\n { ...clearButton, property: 'color' },\n ],\n inputDropdownButtonSize: [\n { ...toggle, property: 'font-size' },\n { ...clearButton, property: 'font-size' },\n ],\n inputDropdownButtonOffset: [\n { ...toggle, property: 'margin-right' },\n { ...toggle, property: 'margin-left' },\n ],\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n valueInputMarginBottom: { ...inputElement, property: 'margin-bottom' },\n\n // we need to use the variables from the portal mixin\n // so we need to use an arrow function on the selector\n // for that to work, because ComboBox is not available\n // at this time.\n overlayBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => ComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: {\n property: () => ComboBoxClass.cssVarList.overlay.border,\n },\n overlayFontSize: {\n property: () => ComboBoxClass.cssVarList.overlay.fontSize,\n },\n overlayFontFamily: {\n property: () => ComboBoxClass.cssVarList.overlay.fontFamily,\n },\n overlayCursor: {\n property: () => ComboBoxClass.cssVarList.overlay.cursor,\n },\n overlayItemBoxShadow: {\n property: () => ComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n overlayCheckmarkDisplay: {\n property: () => ComboBoxClass.cssVarList.overlay.checkmarkDisplay,\n },\n overlaySelectedItemBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.selectedItemBackground,\n },\n overlaySelectedItemHoverBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemHoverBackground,\n },\n overlaySelectedItemFocusBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemFocusBackground,\n },\n overlayItemHoverBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemHoverBackground,\n },\n overlayItemFocusBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemFocusBackground,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n backgroundColor: [\n { selector: 'vaadin-combo-box-scroller' },\n { selector: 'vaadin-combo-box-overlay::part(overlay)' },\n ],\n minHeight: { selector: 'vaadin-combo-box-overlay' },\n margin: { selector: 'vaadin-combo-box-overlay' },\n cursor: { selector: 'vaadin-combo-box-item' },\n fontFamily: { selector: 'vaadin-combo-box-item' },\n textColor: { selector: 'vaadin-combo-box-item', property: 'color' },\n fontSize: { selector: 'vaadin-combo-box-item' },\n itemBoxShadow: {\n selector: 'vaadin-combo-box-item',\n property: 'box-shadow',\n },\n itemPaddingInlineStart: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-end',\n },\n checkmarkDisplay: {\n selector: 'vaadin-combo-box-item::part(checkmark)',\n property: 'display',\n },\n selectedItemBackground: {\n selector: 'vaadin-combo-box-item[selected]',\n property: 'background-color',\n },\n selectedItemHoverBackground: {\n selector: 'vaadin-combo-box-item[selected]:hover:not([disabled])',\n property: 'background-color',\n },\n selectedItemFocusBackground: {\n selector: 'vaadin-combo-box-item[selected][focused]:not([disabled])',\n property: 'background-color',\n },\n itemHoverBackground: {\n selector: 'vaadin-combo-box-item:hover:not([selected]):not([disabled])',\n property: 'background-color',\n },\n itemFocusBackground: {\n selector:\n 'vaadin-combo-box-item[focused]:not([selected]):not([disabled])',\n property: 'background-color',\n },\n\n loaderTop: { ...loader, property: 'top' },\n loaderLeft: { ...loader, property: 'left' },\n loaderRight: { ...loader, property: 'right' },\n loaderMargin: { ...loader, property: 'margin' },\n loaderWidth: { ...loader, property: 'width' },\n loaderHeight: { ...loader, property: 'height' },\n loaderBorder: { ...loader, property: 'border' },\n loaderBorderColor: { ...loader, property: 'border-color' },\n loaderBorderRadius: { ...loader, property: 'border-radius' },\n contentHeight: { ...overlayContent, property: 'height' },\n contentOpacity: { ...overlayContent, property: 'opacity' },\n scrollerMinHeight: {\n selector: 'vaadin-combo-box-scroller',\n property: 'min-height',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({\n proxyProps: ['selectionStart'],\n inputEvent: 'value-changed',\n }),\n inputOverrideValidConstraintsMixin,\n componentNameValidationMixin,\n ComboBoxMixin,\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-combo-box',\n 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${useHostExternalPadding(ComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-combo-box')}\n\t\t${resetInputCursor('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[hide-toggle-button=\"true\"]::part(toggle-button) {\n display: none;\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 ${resetInputLabelPosition('vaadin-combo-box')}\n ${inputFloatingLabelStyle()}\n\t\t`,\n // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property\n // with the same name. Including it will cause Vaadin to calculate NaN size,\n // and reset items to an empty array, and opening the list box with no items\n // to display.\n excludeAttrsSync: ['tabindex', 'size', 'data', 'loading', 'style'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItem'],\n }),\n);\n","import '@vaadin/combo-box';\nimport { componentName, ComboBoxClass } from './ComboBoxClass';\n\ncustomElements.define(componentName, ComboBoxClass);\n\nexport { ComboBoxClass, componentName };\n"],"names":["componentName","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","loader","overlayContent","selector","ComboBoxClass","mappings","hostWidth","property","hostDirection","fontSize","fontFamily","labelFontSize","labelFontWeight","labelTextColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputHeight","inputBackgroundColor","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","labelRequiredIndicator","inputValueTextColor","inputPlaceholderTextColor","inputDropdownButtonCursor","inputDropdownButtonColor","inputDropdownButtonSize","inputDropdownButtonOffset","inputOutlineColor","inputOutlineWidth","inputOutlineStyle","inputOutlineOffset","inputHorizontalPadding","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","overlayCheckmarkDisplay","checkmarkDisplay","overlaySelectedItemBackground","selectedItemBackground","overlaySelectedItemHoverBackground","selectedItemHoverBackground","overlaySelectedItemFocusBackground","selectedItemFocusBackground","overlayItemHoverBackground","itemHoverBackground","overlayItemFocusBackground","itemFocusBackground","name","minHeight","margin","loaderTop","loaderLeft","loaderRight","loaderMargin","loaderWidth","loaderHeight","loaderBorder","loaderBorderColor","loaderBorderRadius","contentHeight","contentOpacity","scrollerMinHeight","forward","include","attributes","proxyProps","inputEvent","superclass","observedAttributes","displayName","value","defaultValue","this","getAttribute","renderItem","renderFn","renderItems","renderer","fn","baseElement","loading","val","setAttribute","removeAttribute","data","dataAttr","JSON","parse","isValidDataType","e","console","error","message","requireMatch","allowCustomValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","hasDynamicData","shouldSelectItemOnItemsChange","handleSelectedItem","selectedItem","currentSelected","from","children","includes","setDefaultValue","customValueTransformFn","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","items","length","transformedValue","call","forEach","node","defineProperty","configurable","writable","setTimeout","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","root","combo","model","outerHTML","_dataProviderFilterChanged","isValueMatch","some","dataset","id","init","super","getValidity","patternMismatch","isRequired","valueMissing","bind","includeAttrs","addEventListener","dispatchEvent","Event","bubbles","composed","CustomEvent","detail","onLabelClick","isReadOnly","isDisabled","focus","autoOpenDisabled","handleRequireMatchChange","shouldValidate","attributeChangedCallback","attrName","oldValue","newValue","removeEventListener","find","selectedChild","stopImmediatePropagation","once","capture","undefined","__data","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps","customElements","define","C"],"sourceRoot":""}