@momentum-ui/web-components 2.7.19 → 2.7.20

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.
@@ -1,4 +1,4 @@
1
- (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[36],{78:function(t,e,o){"use strict";o.r(e),o.d(e,"ComboBox",(function(){return i}));o(50),o(15);var i,s=o(1),l=o(7),n=o(5),r=o(18),c=o(4),a=o(0),d=o(2),h=o(3),p=o(6),u=o(14),b=o(9),m=(o(69),o(124)),x=a.css`:host{--combobox-input-clear-bg:var(--combobox-group-button-bg-color, $lm-combobox-group-button-bg-color-light)}:host() .group{background:var(--combobox-bg-color,#fff)}:host(:focus){box-shadow:none!important;outline:0!important}:host([focus-visible]) .group{border-color:var(--combobox-focus-border-color,#005e7d);box-shadow:none}:host([disabled]) .group,:host([disabled]) .group:active,:host([disabled]) .group:hover{background:var(--combobox-disabled-bg-color,#ededed);pointer-events:none}:host([disabled]) .group:active>md-icon,:host([disabled]) .group:hover>md-icon,:host([disabled]) .group>md-icon{opacity:.3}:host([expanded]) .md-combobox-button.arrow-down{transform:rotate(180deg)}:host([invalid]) .group,:host([invalid]) .group:active,:host([invalid]) .group:hover{background:var(--combobox-invalid-bg-color,#ffe8e3);border-color:var(--combobox-invalid-border-color,#f7644a)}:host([invalid]) .md-combobox-error{padding:.1875rem 0 0 .75rem}.md-combobox-list{position:relative;height:2rem}.md-combobox .group{align-items:start;background:var(--combobox-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:var(--combobox-group-radius,.25rem);display:flex;padding:0 .75rem;height:2.125rem}.md-combobox .group md-icon{color:var(--md-secondary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:1.75rem;padding:calc(.25rem / 2)}.md-combobox .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#91ebff)}.md-combobox .group:hover{background:var(--combobox-hover-bg-color,#dedede)}.md-combobox .group:active{background:var(--combobox-pressed-bg-color,#ccc)}.md-combobox .group.multiselect:hover{background:var(--combobox-bg-color,#fff)}.md-combobox .group.multiselect:active{background:var(--combobox-bg-color,#fff)}.md-combobox .md-combobox-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}.md-combobox--pill .group{border-radius:18px}.md-combobox-button{transition:all .15s linear;background:0 0;border:0;cursor:pointer;margin:0;margin-left:calc(.25rem * 2);outline:0;padding:0;padding-top:calc(.25rem / 2);position:relative;vertical-align:bottom;height:inherit;display:flex}.md-combobox-button .md-input__icon-clear{display:flex;align-items:center;height:inherit}.md-combobox-button md-icon{color:var(--combobox-dropdown-item-icon-color,#121212)}.md-combobox-button.arrow-down:focus,.md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color,#007aa3)}ul{background-color:var(--combobox-dropdown-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);box-sizing:border-box;font-size:14px;left:0;list-style:none;margin:0;overflow:auto;overflow-x:hidden;padding:0;position:absolute;top:calc(100% + .25rem);width:100%}ul .no-result{padding:.4375rem .75rem .5rem}ul:has(>.virtual-scroll){overflow:hidden}.md-combobox-multi-input{width:initial}.highlight-text{font-weight:700}.selected-label-text{white-space:pre-wrap}.group-label{justify-content:space-between;font-weight:400;font-size:14px;line-height:19px;color:var(--combobox-group-label-color);padding:.4375rem .75rem .5rem;border-bottom:1px solid var(--combobox-group-label-border-color);display:flex;width:100%;background-color:var(--combobox-group-label-bg-color)}.group-label:hover{background:unset}.group-label[focused]{background:var(--combobox-dropdown-item-focus-bg-color,#91ebff)}.md-combobox-option{align-items:center;color:var(--md-primary-text-color,#f7f7f7);display:flex;margin:0;outline:0;padding:.4375rem .75rem .5rem;width:100%}.md-combobox-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;display:block;letter-spacing:normal;width:calc(100% - 1.25rem)}.md-combobox-option .select-label span{margin-right:-.25rem;white-space:nowrap}.md-combobox-option .select-option{background:var(--combobox-dropdown-item-select-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:calc(.5rem / 2);box-sizing:border-box;cursor:pointer;display:inline-block;height:1.25rem;margin-right:1rem;min-width:1.25rem;position:relative}.md-combobox-option .select-option md-icon{height:1.125rem;left:.125rem;position:absolute;top:-.1875rem;vertical-align:top;visibility:hidden}.md-combobox-option .indeterminate{background:var(--combobox-dropdown-item-checked-bg-color,#00a0d1);border:1px solid var(--combobox-dropdown-item-checked-bg-color,#00a0d1)}.md-combobox-option .indeterminate md-icon{color:var(--combobox-dropdown-item-checked-icon-color,#fff);visibility:visible}.md-combobox-option:hover{background:var(--combobox-dropdown-item-hover-bg-color,#c9f4ff)}.md-combobox-option.md-combobox-multiselect{border-bottom:1px solid var(--md-button-tertiary-outline-color,#545454)}.md-combobox-option[aria-checked=true] .select-option{background:var(--combobox-dropdown-item-checked-bg-color,#00a0d1);border:1px solid var(--combobox-dropdown-item-checked-bg-color,#00a0d1)}.md-combobox-option[aria-checked=true] .select-option md-icon{color:var(--combobox-dropdown-item-checked-icon-color,#fff);visibility:visible}.md-combobox-option[focused]{background:var(--combobox-dropdown-item-focus-bg-color,#91ebff)}.md-combobox__multiwrap{align-items:center;display:inline-flex;flex:1 1 auto;margin-left:0;max-height:calc(1.25rem * 4.5)}.md-combobox__multiwrap .selected-count{color:var(--md-primary-text-color,#f7f7f7)}.md-combobox__multiwrap .md-combobox-selected-item{align-items:center;background:var(--combobox-selected-bg-color,#dedede);border:1px solid var(--combobox-selected-border-color,#ccc);border-radius:.875rem;box-sizing:border-box;cursor:pointer;display:flex;font-size:12px;margin-bottom:calc(.25rem / 2);margin-right:.25rem;margin-top:.25rem;max-height:1.5rem;padding:0 .75rem}.md-combobox__multiwrap .md-combobox-selected-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;max-width:calc(1.25rem * 4)}.md-combobox__multiwrap .md-combobox-selected-item .remove-item{height:1.5rem}.md-combobox__multiwrap .md-combobox-selected-item:hover{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap .md-combobox-selected-item[selected]{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;color:var(--md-secondary-text-color,#545454);display:inline-block;flex:1 1 auto;height:2rem;outline:0}.md-combobox__multiwrap ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:calc(100%)}.md-combobox__multiwrap .remove-item{padding-left:calc(.25rem * 3)}.md-combobox-searchable .md-combobox__multiwrap{margin-left:calc(.25rem * 3)}`,g=function(t,e,o,i){var s,l=arguments.length,n=l<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,i);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,o,n):s(e,o))||n);return l>3&&n&&Object.defineProperty(e,o,n),n},f=function(t,e,o,i){return new(o||(o=Promise))((function(s,l){function n(t){try{c(i.next(t))}catch(t){l(t)}}function r(t){try{c(i.throw(t))}catch(t){l(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(n,r)}c((i=i.apply(t,e||[])).next())}))};!function(t){let e=class extends(Object(l.a)(a.LitElement)){constructor(){super(...arguments),this._focusedIndex=-1,this._focusedGroupIndex=-1,this.label="Options",this.options=[],this.customOptions=[],this.placeholder="",this.isMulti=!1,this.useVirtualScroll=!1,this.disabled=!1,this.ordered=!1,this.expanded=!1,this.groupExpandedList=[],this.searchItem=!1,this.compact=!1,this.noClearIcon=!1,this.selectWhenInFocus=!1,this.selectedOptions=[],this.visibleOptions=8,this.optionId="",this.optionValue="",this.isCustomContent=!1,this.searchable=!1,this.shape="none",this.value=[],this.inputValue="",this.allowCustomValue=!1,this.autofocus=!1,this.resultsTextLocalization="No Results",this.optionsTextLocalization="No Options",this.trimSpace=!1,this.invalid=!1,this.invalidText="",this.ariaLabel="Combobox Input",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=Object(r.b)(t=>{this.dispatchEvent(new CustomEvent("change-selected",{composed:!0,bubbles:!0,detail:t}))},0),this.handleGroupFilter=t=>{const e=t.filter(t=>{if("string"!=typeof t&&"true"===t.isLabel)return t.groupName});return this.searchItem=!0,this.groupExpandedList=e.map(t=>{if("string"!=typeof t)return t.groupName}),t.filter(e=>{if("string"!=typeof e&&"true"===e.isLabel){return!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel})}return!0})},this.notifyInputValueChanged=Object(r.b)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const o=t.composedPath();o.length&&(e=!!o.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){var e;const o=this._focusedIndex;if(this.checkForVirtualScroll()){const o=this.getOptionId(this.filteredOptions[t]),i=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===o):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),i&&(null==i||i.toggleAttribute("focused",!0))}else if(this.lists){const e=this.lists[o];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",o)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const o=this.labels[e];o&&o.toggleAttribute("focused",!1);const i=this.labels[t];i&&(i.toggleAttribute("focused",!0),i.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}firstUpdated(t){super.firstUpdated(t),this.setAttribute("tabindex","0"),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){var e;super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()?null===(e=this.virtualizer)||void 0===e||e.scrollToIndex(this.focusedIndex,"center"):this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("customOptions")&&this.isCustomContent&&(this.setOptionCustomContent(),this.resizeListbox()),t.has("showCustomError")&&this.resizeListbox(),t.has("showLoader")&&this.resizeListbox(),t.has("searchItem")&&this.resizeListbox()}handleFocusIn(t){this.disabled||(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select(),super.handleFocusIn&&super.handleFocusIn(t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){super.handleFocusOut&&super.handleFocusOut(t),this.dispatchEvent(new CustomEvent("combobox-focus-out",{composed:!0,bubbles:!0}))}findFilteredOption(t){return this.isOptionObject(t)?this.filteredOptions.findIndex(e=>this.getOptionId(e)===this.getOptionId(t)&&this.getOptionValue(e)===this.getOptionValue(t)):this.filteredOptions.indexOf(t)}setInitialValue(){var t;if(this.value.length)if(this.isMulti)this.value.forEach(t=>{-1!==this.findFilteredOption(t)&&this.setSelectedOption(t)});else{const e=this.value[0],o=this.findFilteredOption(e);-1!==o&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),this.focusedIndex=o,null===(t=this.virtualizer)||void 0===t||t.scrollToIndex(this.focusedIndex,"center"),this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const o of t){const t=o.getAttribute("label"),i=[...o.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const o of i){const i=o.getAttribute("aria-label"),s=o.getAttribute("display-value"),l=o.getAttribute("slot");i&&s&&e.push({[this.optionId]:i,[this.optionValue]:s,isLabel:"false",groupName:t,slot:l})}}this.options=e}else this.customContent=[...this.querySelectorAll("[slot]")],this.customContent&&this.customContent.length?this.options=this.customContent.map(t=>{const e=t.getAttribute("aria-label"),o=t.getAttribute("display-value");if(e&&o)return{[this.optionId]:e,[this.optionValue]:o}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?t[this.optionValue]:t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?t[this.optionId]:t}getFocusedItem(t){if(t>=0)return this.filteredOptions[t]}setupEvents(){document.addEventListener("click",this.handleOutsideClick),this.addEventListener("remove-all-selected",this.removeAllSelected),this.addEventListener("selected-changed",this.selectedChange)}teardownEvents(){document.removeEventListener("click",this.handleOutsideClick),this.removeEventListener("remove-all-selected",this.removeAllSelected),this.removeEventListener("selected-changed",this.selectedChange)}setVisualListbox(t){this.expanded=t}setGroupList(t){this.groupExpandedList.includes(t)?(this.groupExpandedList.splice(this.groupExpandedList.indexOf(t),1),this.groupExpandedList=[...this.groupExpandedList]):this.searchItem?this.groupExpandedList.push(t):this.groupExpandedList=[t]}findSelectedOption(t){return this.optionId&&t?this.selectedOptions.findIndex(e=>e&&e[this.optionId]===t[this.optionId]):this.selectedOptions.indexOf(t)}findOptionIndex(t){const e=t.composedPath();if(this.checkForVirtualScroll()){let t="";return[...this.lists].forEach(o=>{e.includes(o)&&(t=o.id)}),this.filteredOptions.findIndex(e=>this.getOptionId(e)===t)}return[...this.lists].findIndex(t=>e.includes(t))}checkSelectedOptions(){if(this.checkForVirtualScroll()){const t=this.selectedOptions.map(t=>this.getOptionId(t)),e=[...this.lists].filter(t=>"selectAll"!==t.id);null==e||e.forEach(e=>{t.includes(e.id)?(this.isMulti&&(null==e||e.setAttribute("aria-checked","true")),null==e||e.setAttribute("aria-selected","true")):this.isMulti&&(null==e||e.setAttribute("aria-checked","false"))})}}unCheckAllOptions(){var t;this.checkForVirtualScroll()&&this.isMulti&&(null===(t=[...this.lists])||void 0===t||t.forEach(t=>{"selectAll"!==(null==t?void 0:t.id)&&(null==t||t.setAttribute("aria-checked","false"))}))}setSelectedOption(t){this.isMulti||(this.selectedOptions=[]);const e=this.findSelectedOption(t);if(-1!==e){const t=this.selectedOptions[e];this.selectedOptions.splice(e,1),this.notifySelectedChange({value:t,selected:this.selectedOptions})}else this.selectedOptions.push(t),this.notifySelectedChange({value:t,selected:this.selectedOptions});this.checkSelectedOptions(),this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()),this.requestUpdate()}filterOptions(t){if(t&&t.length){const e=this.options.filter(e=>this.isOptGroup&&"string"!=typeof e&&"true"===e.isLabel?e:(this.isCustomContent?this.getOptionId(e):this.getOptionValue(e)).toLowerCase().includes(t.toLowerCase()));return this.isOptGroup?this.handleGroupFilter(e):e}return this.searchItem=!1,this.options}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,o=0;if(this.lists){e=(this.checkForVirtualScroll()?[...this.lists].filter(t=>0!==t.offsetHeight):[...this.lists]).slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)}if(this.labels&&(o=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=e+o+10+"px"),this.virtualizer&&(this.virtualizer.style.height=e+10+"px"),this.showCustomError||this.showLoader){const e=null===(t=this.listBox)||void 0===t?void 0:t.querySelector("[slot]");this.listBox&&e&&(this.listBox.style.height=e.clientHeight+2+"px",this.listBox.style.maxHeight=e.clientHeight+2+"px")}})}setInputValue(t=""){this.input.value=t}updateOnNextFrame(t){requestAnimationFrame(t)}unCheckedAllOptions(){this.isMulti&&(this.lists.forEach((t,e)=>this.unCheckedOption(e)),this.isSelectAllChecked=!1)}unCheckedOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","false"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}checkAllOptions(){this.isMulti&&this.lists.forEach((t,e)=>this.checkOption(e))}checkOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","true"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}isSelectAllSelected(){return this.selectedOptions.length===this.options.length}setFocusOnHost(t){this.setFocus&&this.setFocus(t)}isOptionFocused(t){return this.focusedIndex===t}getAriaState(t){return this.isOptionFocused(t)}scrollToOption(){var t,e;let o=0;const{top:i,bottom:s}=this.listBox.getBoundingClientRect(),l=this.lists[this.focusedIndex],n=null===(t=this.lists[this.focusedIndex+1]||l)||void 0===t?void 0:t.getBoundingClientRect(),r=null===(e=this.lists[this.focusedIndex-1]||l)||void 0===e?void 0:e.getBoundingClientRect();(null==n?void 0:n.bottom)>s?o=n.bottom-s+2:(null==r?void 0:r.top)<i&&(o=r.top-i-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=o})}getCustomContentName(t){const e=this.options.indexOf(t);if(this.isOptGroup){const t=this.options[e];if(t&&"string"!=typeof t)return t.slot}else if(-1!==e)return this.customContent[e].slot}setInputSelectionRange(t,e){this.input.setSelectionRange(t,e)}isOptionChecked(t){return-1!==this.findSelectedOption(t)?"true":"false"}getInputSelection(){return this.input.selectionStart}canMultiSelect(){return 0===this.getInputSelection()&&0!==this.selectedOptions.length&&this.isMulti}removeMultiTag(){this.selected&&this.multiSelected.forEach(t=>{const e=this.selected[t];e&&e.hasAttribute("selected")&&this.removeSelected(this.selectedOptions[t])})}unselectedAllMultiTag(){this.selected&&this.selected.forEach(t=>t.removeAttribute("selected")),this.multiSelectedIndex=-1}findLastMultiSelected(){return this.selected[this.multiSelectedIndex]}toggleMultiSelectedTag(t,e){t&&t.toggleAttribute("selected",e)}selectMultiTag(t){if(this.canMultiSelect()){if(!t){this.multiSelected=[];const t=this.findLastMultiSelected();this.toggleMultiSelectedTag(t,!1)}this.multiSelectedIndex<=0?this.multiSelectedIndex=this.selectedOptions.length-1:this.multiSelectedIndex--,this.multiSelected.push(this.multiSelectedIndex);const e=this.findLastMultiSelected();this.toggleMultiSelectedTag(e,!0)}}handleListClick(t){return f(this,void 0,void 0,(function*(){this.dispatchEvent(new CustomEvent("selected-changed",{detail:{event:t}})),yield this.updateComplete,this.isMulti?this.setVisualListbox(!0):this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}))}handleSelectAll(){return f(this,void 0,void 0,(function*(){(0===this.selectedOptions.length||this.isSelectAllSelected())&&(this.isSelectAllChecked=!this.isSelectAllChecked,this.isSelectAllChecked?(this.selectedOptions=[...this.options],this.checkAllOptions()):(this.selectedOptions=[],this.unCheckedAllOptions()),yield this.updateComplete,this.setVisualListbox(!0),this.notifySelectedChange({selected:this.selectedOptions}))}))}handleInputKeyUp(t){switch(t.code){case s.a.Escape:break;case s.a.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case s.a.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;""!==e.trim()&&(this.inputValue=e,this.notifyInputValueChanged(e))}removeAllSelected(){this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),o=this.filteredOptions.indexOf(t);-1!==o&&this.unCheckedOption(o),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){const{event:e}=t.detail;let o=this.findOptionIndex(e);if(-1!==o){this.focusedIndex=o,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(o-=1);const t=this.getFocusedItem(o);t&&(this.setSelectedOption(t),this.isMulti?this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()):this.setInputValue(this.getOptionValue(t)))}}shouldChangeButton(){return this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{this.focusedIndex=this.filteredOptions.length-1;const t=this.getFocusedItem(this.focusedIndex);t&&this.setInputValue(this.getOptionValue(t))}),this.dispatchEvent(new CustomEvent("custom-value-add",{composed:!0,bubbles:!0,detail:{value:this.inputValue}}))),this.inputValue=""}handleGroupFocus(){this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.filteredGroupOptions.length>0&&-1===this.focusedGroupIndex&&(this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===this.groupExpandedList[0])),this.updateOnNextFrame(()=>{-1===this.focusedGroupIndex||!this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length-1||this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length?this.focusedGroupIndex=0:this.focusedGroupIndex++}),this.focusedIndex=-1}handleInputKeyDown(t){switch(t.code){case s.a.Backspace:this.focusedIndex=-1;break;case s.a.Tab:case s.a.Enter:if(this.setFocusOnHost(!0),this.setVisualListbox(!1),t.code===s.a.Tab&&this.isMulti)return;this.updateOnNextFrame(()=>{const t=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);if(this.allowCustomValue&&this.input&&this.input.value.length){if(-1===this.findFilteredOption(this.inputValue))return void this.setCustomValue()}t&&(this.setSelectedOption(t),this.showSelectedCount||this.setInputValue(this.getOptionValue(t))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()});break;case s.a.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],!this.showSelectedCount&&t&&this.setInputValue(this.getOptionValue(t)),this.focusedGroupIndex=-1});break;case s.a.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],t&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(t)),this.focusedGroupIndex=-1)});break;case s.a.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected());break;case s.a.Home:this.setInputSelectionRange(0,0);break;case s.a.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case s.a.Space:if(this.toggleVisualListBox(t),this.isMulti){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||this.setInputValue()),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}}}handleGroupLabelKeyDown(t,e){switch(t.code){case s.a.Tab:this.handleGroupFocus();break;case s.a.Enter:case s.a.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{const t=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);t&&(this.setSelectedOption(t),this.showSelectedCount||(this.setInputValue(this.getOptionValue(t)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case s.a.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],!this.showSelectedCount&&t&&this.setInputValue(this.getOptionValue(t)),this.focusedGroupIndex=-1});break;case s.a.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],t&&!this.showSelectedCount&&this.setInputValue(this.getOptionValue(t))});break;case s.a.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,o;if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const i=null===(o=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===o?void 0:o.parentElement;if(i){const t=i.querySelector(".md-combobox-listbox");Object(m.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.setVisualListbox(!0)),this.input.focus(),this.setGroupList(""),this.focusedGroupIndex=-1}toggleGroupListBox(t,e){t.stopPropagation(),this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===e),this.setGroupList(e),this.resizeListbox()}handleRemoveAll(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}connectedCallback(){super.connectedCallback(),this.setupEvents();this.querySelector("optgroup")&&(this.isOptGroup=!0)}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}static get styles(){return[c.a,x]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti}}get filteredOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t&&this.groupExpandedList.includes(this.getOptionGroupName(t))?"false"===t.isLabel:void 0))}get filteredGroupOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t?"true"===t.isLabel:void 0))}get comboBoxTemplateClassMap(){return{["md-combobox--"+this.shape]:!!this.shape,"md-combobox-searchable":this.searchable}}searchIconTemplate(){return a.html`
1
+ (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[36],{78:function(t,e,o){"use strict";o.r(e),o.d(e,"ComboBox",(function(){return i}));o(50),o(15);var i,s=o(1),l=o(7),n=o(5),r=o(18),c=o(4),a=o(0),d=o(2),h=o(3),p=o(6),u=o(14),b=o(9),m=(o(69),o(124)),g=a.css`:host{--combobox-input-clear-bg:var(--combobox-group-button-bg-color, $lm-combobox-group-button-bg-color-light)}:host() .group{background:var(--combobox-bg-color,#fff)}:host(:focus){box-shadow:none!important;outline:0!important}:host([focus-visible]) .group{border-color:var(--combobox-focus-border-color,#005e7d);box-shadow:none}:host([disabled]) .group,:host([disabled]) .group:active,:host([disabled]) .group:hover{background:var(--combobox-disabled-bg-color,#ededed);pointer-events:none}:host([disabled]) .group:active>md-icon,:host([disabled]) .group:hover>md-icon,:host([disabled]) .group>md-icon{opacity:.3}:host([expanded]) .md-combobox-button.arrow-down{transform:rotate(180deg)}:host([invalid]) .group,:host([invalid]) .group:active,:host([invalid]) .group:hover{background:var(--combobox-invalid-bg-color,#ffe8e3);border-color:var(--combobox-invalid-border-color,#f7644a)}:host([invalid]) .md-combobox-error{padding:.1875rem 0 0 .75rem}.md-combobox-list{position:relative;height:2rem}.md-combobox .group{align-items:start;background:var(--combobox-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:var(--combobox-group-radius,.25rem);display:flex;padding:0 .75rem;height:2.125rem}.md-combobox .group md-icon{color:var(--md-secondary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:1.75rem;padding:calc(.25rem / 2)}.md-combobox .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#91ebff)}.md-combobox .group:hover{background:var(--combobox-hover-bg-color,#dedede)}.md-combobox .group:active{background:var(--combobox-pressed-bg-color,#ccc)}.md-combobox .group.multiselect:hover{background:var(--combobox-bg-color,#fff)}.md-combobox .group.multiselect:active{background:var(--combobox-bg-color,#fff)}.md-combobox .md-combobox-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}.md-combobox--pill .group{border-radius:18px}.md-combobox-button{transition:all .15s linear;background:0 0;border:0;cursor:pointer;margin:0;margin-left:calc(.25rem * 2);outline:0;padding:0;padding-top:calc(.25rem / 2);position:relative;vertical-align:bottom;height:inherit;display:flex}.md-combobox-button .md-input__icon-clear{display:flex;align-items:center;height:inherit}.md-combobox-button md-icon{color:var(--combobox-dropdown-item-icon-color,#121212)}.md-combobox-button.arrow-down:focus,.md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color,#007aa3)}ul{background-color:var(--combobox-dropdown-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);box-sizing:border-box;font-size:14px;left:0;list-style:none;margin:0;overflow:auto;overflow-x:hidden;padding:0;position:absolute;top:calc(100% + .25rem);width:100%}ul .no-result{padding:.4375rem .75rem .5rem}ul:has(>.virtual-scroll){overflow:hidden}.md-combobox-multi-input{width:initial}.highlight-text{font-weight:700}.selected-label-text{white-space:pre-wrap}.group-label{justify-content:space-between;font-weight:400;font-size:14px;line-height:19px;color:var(--combobox-group-label-color);padding:.4375rem .75rem .5rem;border-bottom:1px solid var(--combobox-group-label-border-color);display:flex;width:100%;background-color:var(--combobox-group-label-bg-color)}.group-label:hover{background:unset}.group-label[focused]{background:var(--combobox-dropdown-item-focus-bg-color,#91ebff)}.md-combobox-option{align-items:center;color:var(--md-primary-text-color,#f7f7f7);display:flex;margin:0;outline:0;padding:.4375rem .75rem .5rem;width:100%}.md-combobox-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;display:block;letter-spacing:normal;width:calc(100% - 1.25rem)}.md-combobox-option .select-label span{margin-right:-.25rem;white-space:nowrap}.md-combobox-option .select-option{background:var(--combobox-dropdown-item-select-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:calc(.5rem / 2);box-sizing:border-box;cursor:pointer;display:inline-block;height:1.25rem;margin-right:1rem;min-width:1.25rem;position:relative}.md-combobox-option .select-option md-icon{height:1.125rem;left:.125rem;position:absolute;top:-.1875rem;vertical-align:top;visibility:hidden}.md-combobox-option .indeterminate{background:var(--combobox-dropdown-item-checked-bg-color,#00a0d1);border:1px solid var(--combobox-dropdown-item-checked-bg-color,#00a0d1)}.md-combobox-option .indeterminate md-icon{color:var(--combobox-dropdown-item-checked-icon-color,#fff);visibility:visible}.md-combobox-option:hover{background:var(--combobox-dropdown-item-hover-bg-color,#c9f4ff)}.md-combobox-option.md-combobox-multiselect{border-bottom:1px solid var(--md-button-tertiary-outline-color,#545454)}.md-combobox-option[aria-checked=true] .select-option{background:var(--combobox-dropdown-item-checked-bg-color,#00a0d1);border:1px solid var(--combobox-dropdown-item-checked-bg-color,#00a0d1)}.md-combobox-option[aria-checked=true] .select-option md-icon{color:var(--combobox-dropdown-item-checked-icon-color,#fff);visibility:visible}.md-combobox-option[focused]{background:var(--combobox-dropdown-item-focus-bg-color,#91ebff)}.md-combobox__multiwrap{align-items:center;display:inline-flex;flex:1 1 auto;margin-left:0;max-height:calc(1.25rem * 4.5)}.md-combobox__multiwrap .selected-count{color:var(--md-primary-text-color,#f7f7f7)}.md-combobox__multiwrap .md-combobox-selected-item{align-items:center;background:var(--combobox-selected-bg-color,#dedede);border:1px solid var(--combobox-selected-border-color,#ccc);border-radius:.875rem;box-sizing:border-box;cursor:pointer;display:flex;font-size:12px;margin-bottom:calc(.25rem / 2);margin-right:.25rem;margin-top:.25rem;max-height:1.5rem;padding:0 .75rem}.md-combobox__multiwrap .md-combobox-selected-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;max-width:calc(1.25rem * 4)}.md-combobox__multiwrap .md-combobox-selected-item .remove-item{height:1.5rem}.md-combobox__multiwrap .md-combobox-selected-item:hover{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap .md-combobox-selected-item[selected]{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;color:var(--md-secondary-text-color,#545454);display:inline-block;flex:1 1 auto;height:2rem;outline:0}.md-combobox__multiwrap ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:calc(100%)}.md-combobox__multiwrap .remove-item{padding-left:calc(.25rem * 3)}.md-combobox-searchable .md-combobox__multiwrap{margin-left:calc(.25rem * 3)}`,x=function(t,e,o,i){var s,l=arguments.length,n=l<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,i);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,o,n):s(e,o))||n);return l>3&&n&&Object.defineProperty(e,o,n),n},f=function(t,e,o,i){return new(o||(o=Promise))((function(s,l){function n(t){try{c(i.next(t))}catch(t){l(t)}}function r(t){try{c(i.throw(t))}catch(t){l(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(n,r)}c((i=i.apply(t,e||[])).next())}))};!function(t){let e=class extends(Object(l.a)(a.LitElement)){constructor(){super(...arguments),this._focusedIndex=-1,this._focusedGroupIndex=-1,this.label="Options",this.options=[],this.customOptions=[],this.placeholder="",this.isMulti=!1,this.useVirtualScroll=!1,this.disabled=!1,this.ordered=!1,this.expanded=!1,this.groupExpandedList=[],this.searchItem=!1,this.compact=!1,this.noClearIcon=!1,this.selectWhenInFocus=!1,this.selectedOptions=[],this.visibleOptions=8,this.optionId="",this.optionValue="",this.isCustomContent=!1,this.searchable=!1,this.shape="none",this.value=[],this.inputValue="",this.allowCustomValue=!1,this.autofocus=!1,this.resultsTextLocalization="No Results",this.optionsTextLocalization="No Options",this.trimSpace=!1,this.invalid=!1,this.invalidText="",this.ariaLabel="Combobox Input",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=Object(r.b)(t=>{this.dispatchEvent(new CustomEvent("change-selected",{composed:!0,bubbles:!0,detail:t}))},0),this.handleGroupFilter=t=>{const e=t.filter(t=>{if("string"!=typeof t&&"true"===t.isLabel)return t.groupName});return this.searchItem=!0,this.groupExpandedList=e.map(t=>{if("string"!=typeof t)return t.groupName}),t.filter(e=>{if("string"!=typeof e&&"true"===e.isLabel){return!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel})}return!0})},this.notifyInputValueChanged=Object(r.b)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const o=t.composedPath();o.length&&(e=!!o.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){var e;const o=this._focusedIndex;if(this.checkForVirtualScroll()){const o=this.getOptionId(this.filteredOptions[t]),i=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===o):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),i&&(null==i||i.toggleAttribute("focused",!0))}else if(this.lists){const e=this.lists[o];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",o)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const o=this.labels[e];o&&o.toggleAttribute("focused",!1);const i=this.labels[t];i&&(i.toggleAttribute("focused",!0),i.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}firstUpdated(t){super.firstUpdated(t),this.setAttribute("tabindex","0"),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){var e;super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()?null===(e=this.virtualizer)||void 0===e||e.scrollToIndex(this.focusedIndex,"center"):this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("customOptions")&&this.isCustomContent&&(this.setOptionCustomContent(),this.resizeListbox()),t.has("showCustomError")&&this.resizeListbox(),t.has("showLoader")&&this.resizeListbox(),t.has("searchItem")&&this.resizeListbox()}handleFocusIn(t){this.disabled||(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select(),super.handleFocusIn&&super.handleFocusIn(t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){super.handleFocusOut&&super.handleFocusOut(t),this.dispatchEvent(new CustomEvent("combobox-focus-out",{composed:!0,bubbles:!0}))}findFilteredOption(t){return this.isOptionObject(t)?this.filteredOptions.findIndex(e=>this.getOptionId(e)===this.getOptionId(t)&&this.getOptionValue(e)===this.getOptionValue(t)):this.filteredOptions.indexOf(t)}setInitialValue(){var t;if(this.value.length)if(this.isMulti)this.value.forEach(t=>{-1!==this.findFilteredOption(t)&&this.setSelectedOption(t)});else{const e=this.value[0],o=this.findFilteredOption(e);-1!==o&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),this.focusedIndex=o,null===(t=this.virtualizer)||void 0===t||t.scrollToIndex(this.focusedIndex,"center"),this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const o of t){const t=o.getAttribute("label"),i=[...o.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const o of i){const i=o.getAttribute("aria-label"),s=o.getAttribute("display-value"),l=o.getAttribute("slot");i&&s&&e.push({[this.optionId]:i,[this.optionValue]:s,isLabel:"false",groupName:t,slot:l})}}this.options=e}else this.customContent=[...this.querySelectorAll("[slot]")],this.customContent&&this.customContent.length?this.options=this.customContent.map(t=>{const e=t.getAttribute("aria-label"),o=t.getAttribute("display-value");if(e&&o)return{[this.optionId]:e,[this.optionValue]:o}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?t[this.optionValue]:t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?t[this.optionId]:t}getFocusedItem(t){if(t>=0)return this.filteredOptions[t]}setupEvents(){document.addEventListener("click",this.handleOutsideClick),this.addEventListener("remove-all-selected",this.removeAllSelected),this.addEventListener("selected-changed",this.selectedChange)}teardownEvents(){document.removeEventListener("click",this.handleOutsideClick),this.removeEventListener("remove-all-selected",this.removeAllSelected),this.removeEventListener("selected-changed",this.selectedChange)}setVisualListbox(t){this.expanded=t}setGroupList(t){this.groupExpandedList.includes(t)?(this.groupExpandedList.splice(this.groupExpandedList.indexOf(t),1),this.groupExpandedList=[...this.groupExpandedList]):this.searchItem?this.groupExpandedList.push(t):this.groupExpandedList=[t]}findSelectedOption(t){return this.optionId&&t?this.selectedOptions.findIndex(e=>e&&e[this.optionId]===t[this.optionId]):this.selectedOptions.indexOf(t)}findOptionIndex(t){const e=t.composedPath();if(this.checkForVirtualScroll()){let t="";return[...this.lists].forEach(o=>{e.includes(o)&&(t=o.id)}),this.filteredOptions.findIndex(e=>this.getOptionId(e)===t)}return[...this.lists].findIndex(t=>e.includes(t))}checkSelectedOptions(){if(this.checkForVirtualScroll()){const t=this.selectedOptions.map(t=>this.getOptionId(t)),e=[...this.lists].filter(t=>"selectAll"!==t.id);null==e||e.forEach(e=>{t.includes(e.id)?(this.isMulti&&(null==e||e.setAttribute("aria-checked","true")),null==e||e.setAttribute("aria-selected","true")):this.isMulti&&(null==e||e.setAttribute("aria-checked","false"))})}}unCheckAllOptions(){var t;this.checkForVirtualScroll()&&this.isMulti&&(null===(t=[...this.lists])||void 0===t||t.forEach(t=>{"selectAll"!==(null==t?void 0:t.id)&&(null==t||t.setAttribute("aria-checked","false"))}))}setSelectedOption(t){this.isMulti||(this.selectedOptions=[]);const e=this.findSelectedOption(t);if(-1!==e){const t=this.selectedOptions[e];this.selectedOptions.splice(e,1),this.notifySelectedChange({value:t,selected:this.selectedOptions})}else this.selectedOptions.push(t),this.notifySelectedChange({value:t,selected:this.selectedOptions});this.checkSelectedOptions(),this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()),this.requestUpdate()}filterOptions(t){if(t&&t.length){const e=this.options.filter(e=>this.isOptGroup&&"string"!=typeof e&&"true"===e.isLabel?e:(this.isCustomContent?this.getOptionId(e):this.getOptionValue(e)).toLowerCase().includes(t.toLowerCase()));return this.isOptGroup?this.handleGroupFilter(e):e}return this.searchItem=!1,this.options}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,o=0,i=0;if(this.lists){const t=this.checkForVirtualScroll()?[...this.lists].filter(t=>0!==t.offsetHeight):[...this.lists];e=t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0),i=this.checkForVirtualScroll()&&this.allowSelectAll?t.slice(1,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0):t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)}if(this.labels&&(o=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=e+o+10+"px"),this.virtualizer&&(this.virtualizer.style.height=i+10+"px"),this.showCustomError||this.showLoader){const e=null===(t=this.listBox)||void 0===t?void 0:t.querySelector("[slot]");this.listBox&&e&&(this.listBox.style.height=e.clientHeight+2+"px",this.listBox.style.maxHeight=e.clientHeight+2+"px")}})}setInputValue(t=""){this.input.value=t}updateOnNextFrame(t){requestAnimationFrame(t)}unCheckedAllOptions(){this.isMulti&&(this.lists.forEach((t,e)=>this.unCheckedOption(e)),this.isSelectAllChecked=!1)}unCheckedOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","false"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}checkAllOptions(){this.isMulti&&this.lists.forEach((t,e)=>this.checkOption(e))}checkOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","true"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}isSelectAllSelected(){return this.selectedOptions.length===this.options.length}setFocusOnHost(t){this.setFocus&&this.setFocus(t)}isOptionFocused(t){return this.focusedIndex===t}getAriaState(t){return this.isOptionFocused(t)}scrollToOption(){var t,e;let o=0;const{top:i,bottom:s}=this.listBox.getBoundingClientRect(),l=this.lists[this.focusedIndex],n=null===(t=this.lists[this.focusedIndex+1]||l)||void 0===t?void 0:t.getBoundingClientRect(),r=null===(e=this.lists[this.focusedIndex-1]||l)||void 0===e?void 0:e.getBoundingClientRect();(null==n?void 0:n.bottom)>s?o=n.bottom-s+2:(null==r?void 0:r.top)<i&&(o=r.top-i-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=o})}getCustomContentName(t){const e=this.options.indexOf(t);if(this.isOptGroup){const t=this.options[e];if(t&&"string"!=typeof t)return t.slot}else if(-1!==e)return this.customContent[e].slot}setInputSelectionRange(t,e){this.input.setSelectionRange(t,e)}isOptionChecked(t){return-1!==this.findSelectedOption(t)?"true":"false"}getInputSelection(){return this.input.selectionStart}canMultiSelect(){return 0===this.getInputSelection()&&0!==this.selectedOptions.length&&this.isMulti}removeMultiTag(){this.selected&&this.multiSelected.forEach(t=>{const e=this.selected[t];e&&e.hasAttribute("selected")&&this.removeSelected(this.selectedOptions[t])})}unselectedAllMultiTag(){this.selected&&this.selected.forEach(t=>t.removeAttribute("selected")),this.multiSelectedIndex=-1}findLastMultiSelected(){return this.selected[this.multiSelectedIndex]}toggleMultiSelectedTag(t,e){t&&t.toggleAttribute("selected",e)}selectMultiTag(t){if(this.canMultiSelect()){if(!t){this.multiSelected=[];const t=this.findLastMultiSelected();this.toggleMultiSelectedTag(t,!1)}this.multiSelectedIndex<=0?this.multiSelectedIndex=this.selectedOptions.length-1:this.multiSelectedIndex--,this.multiSelected.push(this.multiSelectedIndex);const e=this.findLastMultiSelected();this.toggleMultiSelectedTag(e,!0)}}handleListClick(t){return f(this,void 0,void 0,(function*(){this.dispatchEvent(new CustomEvent("selected-changed",{detail:{event:t}})),yield this.updateComplete,this.isMulti?this.setVisualListbox(!0):this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}))}handleSelectAll(){return f(this,void 0,void 0,(function*(){(0===this.selectedOptions.length||this.isSelectAllSelected())&&(this.isSelectAllChecked=!this.isSelectAllChecked,this.isSelectAllChecked?(this.selectedOptions=[...this.options],this.checkAllOptions()):(this.selectedOptions=[],this.unCheckedAllOptions()),yield this.updateComplete,this.setVisualListbox(!0),this.notifySelectedChange({selected:this.selectedOptions}))}))}handleInputKeyUp(t){switch(t.code){case s.a.Escape:break;case s.a.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case s.a.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;""!==e.trim()&&(this.inputValue=e,this.notifyInputValueChanged(e))}removeAllSelected(){this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),o=this.filteredOptions.indexOf(t);-1!==o&&this.unCheckedOption(o),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){const{event:e}=t.detail;let o=this.findOptionIndex(e);if(-1!==o){this.focusedIndex=o,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(o-=1);const t=this.getFocusedItem(o);t&&(this.setSelectedOption(t),this.isMulti?this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()):this.setInputValue(this.getOptionValue(t)))}}shouldChangeButton(){return this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{this.focusedIndex=this.filteredOptions.length-1;const t=this.getFocusedItem(this.focusedIndex);t&&this.setInputValue(this.getOptionValue(t))}),this.dispatchEvent(new CustomEvent("custom-value-add",{composed:!0,bubbles:!0,detail:{value:this.inputValue}}))),this.inputValue=""}handleGroupFocus(){this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.filteredGroupOptions.length>0&&-1===this.focusedGroupIndex&&(this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===this.groupExpandedList[0])),this.updateOnNextFrame(()=>{-1===this.focusedGroupIndex||!this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length-1||this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length?this.focusedGroupIndex=0:this.focusedGroupIndex++}),this.focusedIndex=-1}handleInputKeyDown(t){switch(t.code){case s.a.Backspace:this.focusedIndex=-1;break;case s.a.Tab:case s.a.Enter:if(this.setFocusOnHost(!0),this.setVisualListbox(!1),t.code===s.a.Tab&&this.isMulti)return;this.updateOnNextFrame(()=>{const t=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);if(this.allowCustomValue&&this.input&&this.input.value.length){if(-1===this.findFilteredOption(this.inputValue))return void this.setCustomValue()}t&&(this.setSelectedOption(t),this.showSelectedCount||this.setInputValue(this.getOptionValue(t))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()});break;case s.a.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],!this.showSelectedCount&&t&&this.setInputValue(this.getOptionValue(t)),this.focusedGroupIndex=-1});break;case s.a.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],t&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(t)),this.focusedGroupIndex=-1)});break;case s.a.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected());break;case s.a.Home:this.setInputSelectionRange(0,0);break;case s.a.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case s.a.Space:if(this.toggleVisualListBox(t),this.isMulti){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||this.setInputValue()),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}}}handleGroupLabelKeyDown(t,e){switch(t.code){case s.a.Tab:this.handleGroupFocus();break;case s.a.Enter:case s.a.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{const t=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);t&&(this.setSelectedOption(t),this.showSelectedCount||(this.setInputValue(this.getOptionValue(t)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case s.a.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],!this.showSelectedCount&&t&&this.setInputValue(this.getOptionValue(t)),this.focusedGroupIndex=-1});break;case s.a.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const t=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(t)],t&&!this.showSelectedCount&&this.setInputValue(this.getOptionValue(t))});break;case s.a.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,o;if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const i=null===(o=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===o?void 0:o.parentElement;if(i){const t=i.querySelector(".md-combobox-listbox");Object(m.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.setVisualListbox(!0)),this.input.focus(),this.setGroupList(""),this.focusedGroupIndex=-1}toggleGroupListBox(t,e){t.stopPropagation(),this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===e),this.setGroupList(e),this.resizeListbox()}handleRemoveAll(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}connectedCallback(){super.connectedCallback(),this.setupEvents();this.querySelector("optgroup")&&(this.isOptGroup=!0)}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}static get styles(){return[c.a,g]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti}}get filteredOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t&&this.groupExpandedList.includes(this.getOptionGroupName(t))?"false"===t.isLabel:void 0))}get filteredGroupOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t?"true"===t.isLabel:void 0))}get comboBoxTemplateClassMap(){return{["md-combobox--"+this.shape]:!!this.shape,"md-combobox-searchable":this.searchable}}searchIconTemplate(){return a.html`
2
2
  <md-icon name="icon-search_16" @click=${this.toggleVisualListBox}></md-icon>
3
3
  `}selectedOptionTemplate(t){return a.html`
4
4
  <div class="md-combobox-selected-item">
@@ -188,4 +188,4 @@
188
188
  <md-help-text .message=${this.invalidText} messageType="error"></md-help-text>
189
189
  </div>
190
190
  `:d.nothing}
191
- `}};g([Object(a.property)({type:String})],e.prototype,"label",void 0),g([Object(a.property)({type:Array})],e.prototype,"options",void 0),g([Object(a.property)({type:Array,attribute:"custom-options"})],e.prototype,"customOptions",void 0),g([Object(a.property)({type:String})],e.prototype,"placeholder",void 0),g([Object(a.property)({type:Boolean,attribute:"is-multi"})],e.prototype,"isMulti",void 0),g([Object(a.property)({type:Boolean,attribute:"use-virtual-scroll"})],e.prototype,"useVirtualScroll",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"ordered",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"expanded",void 0),g([Object(a.property)({type:Array,reflect:!0})],e.prototype,"groupExpandedList",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"searchItem",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"compact",void 0),g([Object(a.property)({type:Boolean,attribute:"no-clear-icon"})],e.prototype,"noClearIcon",void 0),g([Object(a.property)({type:Boolean,attribute:"select-when-in-focus"})],e.prototype,"selectWhenInFocus",void 0),g([Object(a.property)({type:Array})],e.prototype,"selectedOptions",void 0),g([Object(a.property)({type:Number,attribute:"visible-option",reflect:!0})],e.prototype,"visibleOptions",void 0),g([Object(a.property)({type:String,attribute:"option-id",reflect:!0})],e.prototype,"optionId",void 0),g([Object(a.property)({type:String,attribute:"option-value",reflect:!0})],e.prototype,"optionValue",void 0),g([Object(a.property)({type:Boolean,attribute:"with-custom-content"})],e.prototype,"isCustomContent",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"searchable",void 0),g([Object(a.property)({type:String})],e.prototype,"shape",void 0),g([Object(a.property)({type:Array})],e.prototype,"value",void 0),g([Object(a.property)({type:String,attribute:"input-value",reflect:!0})],e.prototype,"inputValue",void 0),g([Object(a.property)({type:Boolean,attribute:"allow-custom-value",reflect:!0})],e.prototype,"allowCustomValue",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"autofocus",void 0),g([Object(a.property)({type:String,attribute:"no-results-i18n"})],e.prototype,"resultsTextLocalization",void 0),g([Object(a.property)({type:String,attribute:"no-options-i18n"})],e.prototype,"optionsTextLocalization",void 0),g([Object(a.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],e.prototype,"trimSpace",void 0),g([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"invalid",void 0),g([Object(a.property)({type:String,reflect:!0,attribute:"invalid-text-i18n"})],e.prototype,"invalidText",void 0),g([Object(a.property)({type:String,attribute:"aria-label"})],e.prototype,"ariaLabel",void 0),g([Object(a.property)({type:String,attribute:"clear-aria-label"})],e.prototype,"clearAriaLabel",void 0),g([Object(a.property)({type:String,attribute:"arrow-aria-label"})],e.prototype,"arrowAriaLabel",void 0),g([Object(a.property)({type:String,attribute:"all-i18n"})],e.prototype,"allTextLocalization",void 0),g([Object(a.property)({type:String,attribute:"select-all-i18n"})],e.prototype,"selectAllTextLocalization",void 0),g([Object(a.property)({type:String,attribute:"selected-all-i18n"})],e.prototype,"selectedTextLocalization",void 0),g([Object(a.property)({type:Boolean,attribute:"allow-select-all",reflect:!0})],e.prototype,"allowSelectAll",void 0),g([Object(a.property)({type:Boolean,attribute:"show-custom-error",reflect:!0})],e.prototype,"showCustomError",void 0),g([Object(a.property)({type:Boolean,attribute:"show-loader",reflect:!0})],e.prototype,"showLoader",void 0),g([Object(a.property)({type:Boolean,attribute:"show-selected-count",reflect:!0})],e.prototype,"showSelectedCount",void 0),g([Object(a.property)({type:Number,attribute:!1}),Object(a.internalProperty)()],e.prototype,"isOptGroup",void 0),g([Object(a.internalProperty)()],e.prototype,"isSelectAllChecked",void 0),g([Object(a.query)(".group")],e.prototype,"group",void 0),g([Object(a.query)(".md-combobox-listbox")],e.prototype,"input",void 0),g([Object(a.query)(".md-combobox-button")],e.prototype,"button",void 0),g([Object(a.query)("ul[role='listbox'")],e.prototype,"listBox",void 0),g([Object(a.query)(".virtual-scroll")],e.prototype,"virtualizer",void 0),g([Object(a.queryAll)("li[role='option']")],e.prototype,"lists",void 0),g([Object(a.queryAll)(".group-label")],e.prototype,"labels",void 0),g([Object(a.queryAll)(".md-combobox-selected-item")],e.prototype,"selected",void 0),e=g([Object(n.a)("md-combobox")],e),t.ELEMENT=e}(i||(i={}))}}]);
191
+ `}};x([Object(a.property)({type:String})],e.prototype,"label",void 0),x([Object(a.property)({type:Array})],e.prototype,"options",void 0),x([Object(a.property)({type:Array,attribute:"custom-options"})],e.prototype,"customOptions",void 0),x([Object(a.property)({type:String})],e.prototype,"placeholder",void 0),x([Object(a.property)({type:Boolean,attribute:"is-multi"})],e.prototype,"isMulti",void 0),x([Object(a.property)({type:Boolean,attribute:"use-virtual-scroll"})],e.prototype,"useVirtualScroll",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"ordered",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"expanded",void 0),x([Object(a.property)({type:Array,reflect:!0})],e.prototype,"groupExpandedList",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"searchItem",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"compact",void 0),x([Object(a.property)({type:Boolean,attribute:"no-clear-icon"})],e.prototype,"noClearIcon",void 0),x([Object(a.property)({type:Boolean,attribute:"select-when-in-focus"})],e.prototype,"selectWhenInFocus",void 0),x([Object(a.property)({type:Array})],e.prototype,"selectedOptions",void 0),x([Object(a.property)({type:Number,attribute:"visible-option",reflect:!0})],e.prototype,"visibleOptions",void 0),x([Object(a.property)({type:String,attribute:"option-id",reflect:!0})],e.prototype,"optionId",void 0),x([Object(a.property)({type:String,attribute:"option-value",reflect:!0})],e.prototype,"optionValue",void 0),x([Object(a.property)({type:Boolean,attribute:"with-custom-content"})],e.prototype,"isCustomContent",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"searchable",void 0),x([Object(a.property)({type:String})],e.prototype,"shape",void 0),x([Object(a.property)({type:Array})],e.prototype,"value",void 0),x([Object(a.property)({type:String,attribute:"input-value",reflect:!0})],e.prototype,"inputValue",void 0),x([Object(a.property)({type:Boolean,attribute:"allow-custom-value",reflect:!0})],e.prototype,"allowCustomValue",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"autofocus",void 0),x([Object(a.property)({type:String,attribute:"no-results-i18n"})],e.prototype,"resultsTextLocalization",void 0),x([Object(a.property)({type:String,attribute:"no-options-i18n"})],e.prototype,"optionsTextLocalization",void 0),x([Object(a.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],e.prototype,"trimSpace",void 0),x([Object(a.property)({type:Boolean,reflect:!0})],e.prototype,"invalid",void 0),x([Object(a.property)({type:String,reflect:!0,attribute:"invalid-text-i18n"})],e.prototype,"invalidText",void 0),x([Object(a.property)({type:String,attribute:"aria-label"})],e.prototype,"ariaLabel",void 0),x([Object(a.property)({type:String,attribute:"clear-aria-label"})],e.prototype,"clearAriaLabel",void 0),x([Object(a.property)({type:String,attribute:"arrow-aria-label"})],e.prototype,"arrowAriaLabel",void 0),x([Object(a.property)({type:String,attribute:"all-i18n"})],e.prototype,"allTextLocalization",void 0),x([Object(a.property)({type:String,attribute:"select-all-i18n"})],e.prototype,"selectAllTextLocalization",void 0),x([Object(a.property)({type:String,attribute:"selected-all-i18n"})],e.prototype,"selectedTextLocalization",void 0),x([Object(a.property)({type:Boolean,attribute:"allow-select-all",reflect:!0})],e.prototype,"allowSelectAll",void 0),x([Object(a.property)({type:Boolean,attribute:"show-custom-error",reflect:!0})],e.prototype,"showCustomError",void 0),x([Object(a.property)({type:Boolean,attribute:"show-loader",reflect:!0})],e.prototype,"showLoader",void 0),x([Object(a.property)({type:Boolean,attribute:"show-selected-count",reflect:!0})],e.prototype,"showSelectedCount",void 0),x([Object(a.property)({type:Number,attribute:!1}),Object(a.internalProperty)()],e.prototype,"isOptGroup",void 0),x([Object(a.internalProperty)()],e.prototype,"isSelectAllChecked",void 0),x([Object(a.query)(".group")],e.prototype,"group",void 0),x([Object(a.query)(".md-combobox-listbox")],e.prototype,"input",void 0),x([Object(a.query)(".md-combobox-button")],e.prototype,"button",void 0),x([Object(a.query)("ul[role='listbox'")],e.prototype,"listBox",void 0),x([Object(a.query)(".virtual-scroll")],e.prototype,"virtualizer",void 0),x([Object(a.queryAll)("li[role='option']")],e.prototype,"lists",void 0),x([Object(a.queryAll)(".group-label")],e.prototype,"labels",void 0),x([Object(a.queryAll)(".md-combobox-selected-item")],e.prototype,"selected",void 0),e=x([Object(n.a)("md-combobox")],e),t.ELEMENT=e}(i||(i={}))}}]);
@@ -1,4 +1,4 @@
1
- (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[74],{97:function(e,t,s){"use strict";s.r(t),s.d(t,"RadioGroup",(function(){return i}));var i,d=s(1),c=s(7),o=s(4),n=s(5),r=s(0),h=s(64),a=function(e,t,s,i){var d,c=arguments.length,o=c<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,i);else for(var n=e.length-1;n>=0;n--)(d=e[n])&&(o=(c<3?d(o):c>3?d(t,s,o):d(t,s))||o);return c>3&&o&&Object.defineProperty(t,s,o),o};!function(e){let t=class extends(Object(c.d)(r.LitElement)){constructor(){super(...arguments),this.label="group",this.checked=-1,this.alignment="vertical"}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","radiogroup"),this.setAttribute("aria-label",this.label)}updated(e){super.updated(e),(e.has("slotted")||e.has("checked"))&&this.setFirstChecked()}get selectedRadioValue(){return this.slotted[this.selected].value}notifySelectedChange(){this.dispatchEvent(new CustomEvent("radio-change",{detail:{selected:this.selectedRadioValue},bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("click",this.handleClick)}setFirstChecked(){-1!==this.checked&&(this.selected=this.checked,this.setChecked(this.checked))}findRadioIndex(e){const t=e.composedPath();return this.slotted.findIndex(e=>t.includes(e))}findCheckedRadioIndex(){return this.slotted.findIndex(e=>e.checked)}setChecked(e){const t=this.findCheckedRadioIndex();-1!==t&&t!==e&&(this.slotted[t].checked=!1),this.slotted[e].checked=!0}switchRadioOnArrowPress(e,t=1){const s=super.getAvailableSelectedIndex(e,t);-1!==s&&(this.selected=s,this.setChecked(s),this.notifySelectedChange())}isRadioDisabled(e){return this.slotted[e].disabled}handleClick(e){const t=this.findRadioIndex(e);-1!==t&&(this.isRadioDisabled(t)||(this.selected=t,this.setChecked(t),this.notifySelectedChange()))}handleKeyDown(e){const{code:t}=e;switch(t){case d.a.Enter:case d.a.Space:this.isRadioDisabled(this.selected)||(this.setChecked(this.selected),this.notifySelectedChange());break;case d.a.ArrowUp:case d.a.ArrowLeft:0===this.selected?this.switchRadioOnArrowPress(this.slotted.length-1,-1):this.switchRadioOnArrowPress(this.selected-1,-1);break;case d.a.ArrowDown:case d.a.ArrowRight:this.selected===this.slotted.length-1?this.switchRadioOnArrowPress(0):this.switchRadioOnArrowPress(this.selected+1)}}get slotElement(){return this.radioSlot}static get styles(){return[o.a,h.a]}render(){return r.html`
1
+ (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[74],{97:function(e,t,s){"use strict";s.r(t),s.d(t,"RadioGroup",(function(){return i}));var i,d=s(1),o=s(7),c=s(4),n=s(5),r=s(0),h=s(64),a=function(e,t,s,i){var d,o=arguments.length,c=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,s,i);else for(var n=e.length-1;n>=0;n--)(d=e[n])&&(c=(o<3?d(c):o>3?d(t,s,c):d(t,s))||c);return o>3&&c&&Object.defineProperty(t,s,c),c};!function(e){let t=class extends(Object(o.d)(r.LitElement)){constructor(){super(...arguments),this.label="group",this.checked=-1,this.alignment="vertical"}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","radiogroup"),this.setAttribute("aria-label",this.label)}updated(e){super.updated(e),(e.has("slotted")||e.has("checked"))&&this.setFirstChecked()}get selectedRadioValue(){return this.slotted[this.selected].value}notifySelectedChange(){this.dispatchEvent(new CustomEvent("radio-change",{detail:{selected:this.selectedRadioValue},bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("click",this.handleClick)}setFirstChecked(){-1!==this.checked&&(this.selected=this.checked,this.setChecked(this.checked))}findRadioIndex(e){const t=e.composedPath();return this.slotted.findIndex(e=>t.includes(e))}findCheckedRadioIndex(){return this.slotted.findIndex(e=>e.checked)}setChecked(e){const t=this.findCheckedRadioIndex();-1!==t&&t!==e&&this.slotted[t]&&(this.slotted[t].checked=!1),this.slotted[e]&&(this.slotted[e].checked=!0)}switchRadioOnArrowPress(e,t=1){const s=super.getAvailableSelectedIndex(e,t);-1!==s&&(this.selected=s,this.setChecked(s),this.notifySelectedChange())}isRadioDisabled(e){return this.slotted[e].disabled}handleClick(e){const t=this.findRadioIndex(e);-1!==t&&(this.isRadioDisabled(t)||(this.selected=t,this.setChecked(t),this.notifySelectedChange()))}handleKeyDown(e){const{code:t}=e;switch(t){case d.a.Enter:case d.a.Space:this.isRadioDisabled(this.selected)||(this.setChecked(this.selected),this.notifySelectedChange());break;case d.a.ArrowUp:case d.a.ArrowLeft:0===this.selected?this.switchRadioOnArrowPress(this.slotted.length-1,-1):this.switchRadioOnArrowPress(this.selected-1,-1);break;case d.a.ArrowDown:case d.a.ArrowRight:this.selected===this.slotted.length-1?this.switchRadioOnArrowPress(0):this.switchRadioOnArrowPress(this.selected+1)}}get slotElement(){return this.radioSlot}static get styles(){return[c.a,h.a]}render(){return r.html`
2
2
  <div>
3
3
  <slot name="radio"></slot>
4
4
  </div>
@@ -159,7 +159,7 @@ export declare namespace ComboBox {
159
159
  checkForVirtualScroll(): boolean;
160
160
  rangeChanged(): void;
161
161
  getCustomErrorContent(): DocumentFragment;
162
- getCustomContent(option: string | OptionMember): import("lit-element").TemplateResult | DocumentFragment;
162
+ getCustomContent(option: string | OptionMember): DocumentFragment | import("lit-element").TemplateResult;
163
163
  renderGroupLabelHeader(option: OptionMember, optionIndex: number): import("lit-element").TemplateResult;
164
164
  renderWithoutVirtualScroll(): import("lit-html").DirectiveFn;
165
165
  highlightingSearchedText(option: OptionMember | string): import("lit-element").TemplateResult[];
@@ -36,7 +36,7 @@ export declare namespace TimePicker {
36
36
  handleTimeBlur(event: CustomEvent, unit: TimePicker.TimeUnit): void;
37
37
  static get styles(): import("lit-element").CSSResult[];
38
38
  formatTimeUnit: (unit: TimePicker.TimeUnit) => void;
39
- messageType: (isValid: boolean) => "" | "error";
39
+ messageType: (isValid: boolean) => "error" | "";
40
40
  generateTimeBox: (unit: TimePicker.TimeUnit) => import("lit-element").TemplateResult;
41
41
  generateAmPmComboBox: () => import("lit-element").TemplateResult;
42
42
  render(): import("lit-element").TemplateResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momentum-ui/web-components",
3
- "version": "2.7.19",
3
+ "version": "2.7.20",
4
4
  "author": "Yana Harris",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/momentum-design/momentum-ui.git",