@descope/web-components-ui 1.118.0 → 1.119.0

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.
Files changed (36) hide show
  1. package/dist/cjs/index.cjs.js +13 -1
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +13 -1
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/7092.js +1 -1
  6. package/dist/umd/7092.js.map +1 -1
  7. package/dist/umd/DescopeDev.js +1 -1
  8. package/dist/umd/DescopeDev.js.map +1 -1
  9. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  10. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
  11. package/dist/umd/descope-hybrid-field-index-js.js +1 -1
  12. package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
  13. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  14. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
  15. package/dist/umd/descope-new-password-index-js.js +1 -1
  16. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  17. package/dist/umd/descope-passcode-index-js.js +1 -1
  18. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  19. package/dist/umd/descope-password-index-js.js +1 -1
  20. package/dist/umd/descope-password-index-js.js.map +1 -1
  21. package/dist/umd/descope-scopes-list-index-js.js +1 -1
  22. package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
  23. package/dist/umd/descope-text-area-index-js.js +1 -1
  24. package/dist/umd/descope-text-area-index-js.js.map +1 -1
  25. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  26. package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
  27. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  28. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
  29. package/package.json +4 -4
  30. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +4 -1
  31. package/src/components/descope-new-password/NewPasswordClass.js +1 -0
  32. package/src/components/descope-passcode/PasscodeClass.js +2 -0
  33. package/src/components/descope-password/PasswordClass.js +2 -0
  34. package/src/components/descope-text-area/TextAreaClass.js +1 -0
  35. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -0
  36. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +1 -0
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],{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)},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:b,requiredIndicator:h,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:[b,c,d,y,g],labelFontSize:{...b,property:"font-size"},labelFontWeight:{...b,property:"font-weight"},labelTextColor:[{...b,property:"color"},{...h,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:{...h,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:{...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:{...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.tQ,(e=>class extends e{static get observedAttributes(){return["label-type"]}#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())}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=()=>{})}init(){super.init?.(),this.getValidity=function(){return!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"))}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))}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"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7092],{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)},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:b,requiredIndicator:h,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:[b,c,d,y,g],labelFontSize:{...b,property:"font-size"},labelFontWeight:{...b,property:"font-weight"},labelTextColor:[{...b,property:"color"},{...b,property:"-webkit-text-fill-color"},{...h,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:{...h,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:{...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:{...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.tQ,(e=>class extends e{static get observedAttributes(){return["label-type"]}#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())}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=()=>{})}init(){super.init?.(),this.getValidity=function(){return!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"))}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))}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"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))}}]);
2
2
  //# sourceMappingURL=7092.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"7092.js","mappings":"4NAGAA,eAAeC,OAAO,IAAe,EAAAC,E,2FCoB9B,MAAMC,GAAgB,QAAiB,cAqWxC,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,kBAAm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ZC,eAAgB,mBAChBC,MAAO,IAAM,2HAMb,QAAuB5M,EAAc8C,qBACrC,QAAwB,6BACxB,QAAsB,6BACtB,QAAiB,u2BAoCf,QAAwB,6BACxB,kBAMF+J,iBAAkB,CAAC,WAAY,OAAQ,OAAQ,WAC/C3N,gBACA4N,oBAAqB,CAAC,QAAS,WAAY,kB","sources":["webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/ComboBoxClass.js"],"sourcesContent":["import '@vaadin/combo-box';\nimport { componentName, ComboBoxClass } from './ComboBoxClass';\n\ncustomElements.define(componentName, ComboBoxClass);\n\nexport { ComboBoxClass, componentName };\n","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 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'];\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 // 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 init() {\n super.init?.();\n\n // eslint-disable-next-line func-names\n this.getValidity = function () {\n if (!this.value && this.isRequired) {\n return {\n valueMissing: true,\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 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 }\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 { ...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 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'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItem'],\n }),\n);\n"],"names":["customElements","define","C","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","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","hasDynamicData","shouldSelectItemOnItemsChange","allowCustomValue","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","init","super","getValidity","isRequired","valueMissing","bind","includeAttrs","addEventListener","dispatchEvent","Event","bubbles","composed","CustomEvent","detail","onLabelClick","isReadOnly","isDisabled","focus","autoOpenDisabled","attributeChangedCallback","attrName","oldValue","newValue","removeEventListener","find","selectedChild","stopImmediatePropagation","once","capture","undefined","__data","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps"],"sourceRoot":""}
1
+ {"version":3,"file":"7092.js","mappings":"4NAGAA,eAAeC,OAAO,IAAe,EAAAC,E,2FCoB9B,MAAMC,GAAgB,QAAiB,cAqWxC,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,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Y,OAAQ,OAAQ,WAC/C3N,gBACA4N,oBAAqB,CAAC,QAAS,WAAY,kB","sources":["webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/ComboBoxClass.js"],"sourcesContent":["import '@vaadin/combo-box';\nimport { componentName, ComboBoxClass } from './ComboBoxClass';\n\ncustomElements.define(componentName, ComboBoxClass);\n\nexport { ComboBoxClass, componentName };\n","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 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'];\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 // 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 init() {\n super.init?.();\n\n // eslint-disable-next-line func-names\n this.getValidity = function () {\n if (!this.value && this.isRequired) {\n return {\n valueMissing: true,\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 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 }\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 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'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItem'],\n }),\n);\n"],"names":["customElements","define","C","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","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","hasDynamicData","shouldSelectItemOnItemsChange","allowCustomValue","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","init","super","getValidity","isRequired","valueMissing","bind","includeAttrs","addEventListener","dispatchEvent","Event","bubbles","composed","CustomEvent","detail","onLabelClick","isReadOnly","isDisabled","focus","autoOpenDisabled","attributeChangedCallback","attrName","oldValue","newValue","removeEventListener","find","selectedChild","stopImmediatePropagation","once","capture","undefined","__data","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps"],"sourceRoot":""}