@momentum-ui/web-components 3.2.9 → 3.2.11

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 (74) hide show
  1. package/dist/2245.js +12 -11
  2. package/dist/2273.js +10 -7
  3. package/dist/3639.js +2 -3
  4. package/dist/378.js +18 -0
  5. package/dist/5057.js +1 -1
  6. package/dist/6005.js +1 -1
  7. package/dist/8663.js +5 -1
  8. package/dist/9189.js +3 -3
  9. package/dist/953.js +3 -5
  10. package/dist/comp/md-advance-list-entry.js +1 -1
  11. package/dist/comp/md-avatar-entry.js +5 -4
  12. package/dist/comp/md-avatar.js +1 -1
  13. package/dist/comp/md-chat-message-entry.js +1 -1
  14. package/dist/comp/md-chat-message.js +1 -1
  15. package/dist/comp/md-combobox-entry.js +24 -21
  16. package/dist/comp/md-date-range-picker-entry.js +1 -1
  17. package/dist/comp/md-datepicker-calendar-entry.js +4 -6
  18. package/dist/comp/md-datepicker-day-entry.js +2 -3
  19. package/dist/comp/md-datepicker-entry.js +7 -3
  20. package/dist/comp/md-dropdown-entry.js +32 -23
  21. package/dist/comp/md-floating-modal-entry.js +24 -13
  22. package/dist/comp/md-grabber-entry.js +12 -8
  23. package/dist/comp/md-input-entry.js +14 -14
  24. package/dist/comp/md-meeting-alert-entry.js +1 -1
  25. package/dist/comp/md-meeting-alert.js +1 -1
  26. package/dist/comp/md-tabs-entry.js +16 -16
  27. package/dist/comp/md-task-item-entry.js +1 -1
  28. package/dist/comp/md-task-item.js +1 -1
  29. package/dist/esm/2245.js +5 -4
  30. package/dist/esm/2273.js +36 -33
  31. package/dist/esm/3639.js +2 -3
  32. package/dist/esm/378.js +18 -0
  33. package/dist/esm/4626.js +12 -11
  34. package/dist/esm/4654.js +10 -7
  35. package/dist/esm/5057.js +1 -1
  36. package/dist/esm/6005.js +1 -1
  37. package/dist/esm/6020.js +2 -3
  38. package/dist/esm/837.js +6 -8
  39. package/dist/esm/8663.js +5 -1
  40. package/dist/esm/9189.js +5 -5
  41. package/dist/esm/953.js +3 -5
  42. package/dist/esm/comp/md-advance-list-entry.js +3 -3
  43. package/dist/esm/comp/md-avatar-entry.js +1 -1
  44. package/dist/esm/comp/md-avatar.js +1 -1
  45. package/dist/esm/comp/md-chat-message-entry.js +1 -1
  46. package/dist/esm/comp/md-chat-message.js +1 -1
  47. package/dist/esm/comp/md-date-range-picker-entry.js +1 -1
  48. package/dist/esm/comp/md-datepicker-entry.js +13 -9
  49. package/dist/esm/comp/md-dropdown-entry.js +36 -27
  50. package/dist/esm/comp/md-floating-modal-entry.js +24 -13
  51. package/dist/esm/comp/md-grabber-entry.js +10 -6
  52. package/dist/esm/comp/md-input-entry.js +4 -4
  53. package/dist/esm/comp/md-meeting-alert-entry.js +1 -1
  54. package/dist/esm/comp/md-meeting-alert.js +1 -1
  55. package/dist/esm/comp/md-tabs-entry.js +15 -15
  56. package/dist/esm/comp/md-task-item-entry.js +1 -1
  57. package/dist/esm/comp/md-task-item.js +1 -1
  58. package/dist/esm/index-entry.js +63 -39
  59. package/dist/esm/index.js +1 -1
  60. package/dist/index-entry.js +229 -204
  61. package/dist/index.js +1 -1
  62. package/dist/types/components/avatar/Avatar.constants.d.ts +2 -1
  63. package/dist/types/components/avatar/Avatar.d.ts +3 -0
  64. package/dist/types/components/combobox/ComboBox.d.ts +1 -1
  65. package/dist/types/components/date-range-picker/DateRangePicker.d.ts +1 -0
  66. package/dist/types/components/datepicker/DatePicker.d.ts +6 -0
  67. package/dist/types/components/dropdown/Dropdown.d.ts +1 -0
  68. package/dist/types/components/floating-modal/FloatingModal.d.ts +10 -1
  69. package/dist/types/components/grabber/Grabber.d.ts +1 -0
  70. package/dist/types/components/input/Input.d.ts +1 -0
  71. package/dist/types/components/tabs/Tabs.d.ts +1 -0
  72. package/package.json +1 -1
  73. package/dist/4621.js +0 -18
  74. package/dist/esm/4621.js +0 -18
package/dist/esm/2273.js CHANGED
@@ -1,12 +1,13 @@
1
- export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654];export const __webpack_esm_modules__={2273(t,e,i){i.d(e,{a:()=>s}),i(7906),i(1821);var s,o=i(2900),l=i(7704),n=i(9609),r=i(2050),a=i(4084),h=i(2927),d=i(8899),p=i(4955),u=i(3517),c=i(2577),m=i(1156),b=i(7103),g=i(4047),f=function(t,e,i,s){var o,l=arguments.length,n=l<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(n=(l<3?o(n):l>3?o(e,i,n):o(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n},x=function(t,e,i,s){return new(i||(i=Promise))(function(o,l){function n(t){try{a(s.next(t))}catch(t){l(t)}}function r(t){try{a(s.throw(t))}catch(t){l(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,r)}a((s=s.apply(t,e||[])).next())})};!function(t){class e{determineMessageType(t){return t.reduce((t,e)=>"error"===e?t:e.type,"")}filterMessagesByType(t,e){return t.reduce((t,i)=>i.type===e?t.concat(i.message):t,[])}}t.MessageController=e;let i=class extends((0,l.yC)(h.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="",this.searchResultAriaLabel="",this.ariaLabelForComboBox="",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.clearIconHeight="auto",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.popupChevronAriaHidden="true",this.newMomentum=!1,this.showFilterIcon=!1,this.preventFilter=!1,this.isDropdownArrow=!1,this.comboboxId="",this.helpText="",this.messageArr=[],this.htmlId="",this.readOnly=!1,this.messageController=new e,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=(0,r.sg)(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=>"string"==typeof e||"true"!==e.isLabel||!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel}))},this.notifyInputValueChanged=(0,r.sg)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.notifySearchResultCount(),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const i=t.composedPath();i.length&&(e=!!i.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){this.updateFocusedIndex(t)}updateFocusedIndex(t){var e,i,s,o;const l=this._focusedIndex;if(this.checkForVirtualScroll()){let l;l=this.allowSelectAll?0===t?"selectAll":this.getOptionId(this.filteredOptions[t-1]):this.getOptionId(this.filteredOptions[t]);const n=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===l):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),n&&(null==n||n.toggleAttribute("focused",!0));const r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("lit-virtualizer");r&&(-1===t?null===(s=r.element(t))||void 0===s||s.scrollIntoView({block:"start"}):null===(o=r.element(t))||void 0===o||o.scrollIntoView({block:"center"}))}else if(this.lists){const e=this.lists[l];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",l)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const i=this.labels[e];i&&i.toggleAttribute("focused",!1);const s=this.labels[t];s&&(s.toggleAttribute("focused",!0),s.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}notifySearchResultCount(){if(this.searchResultAriaLabel){const t=/{{.*?}}/g;this.ariaLabelForComboBox=this.searchResultAriaLabel.replace(t,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForComboBox=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForComboBox=`ComboBox Element, ${this.filteredOptions.length} results found.`}firstUpdated(t){this.ariaLabelForComboBox=this.ariaLabel?this.ariaLabel:"ComboBox Element",super.firstUpdated(t),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()||this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("options")&&this.expanded&&this.checkForVirtualScroll()&&this.updateOnNextFrame(()=>{this.resizeListbox()}),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){var e;this.disabled&&!this.readOnly||(this.noClearIcon&&(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select()),null===(e=super.handleFocusIn)||void 0===e||e.call(this,t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){var e;null===(e=super.handleFocusOut)||void 0===e||e.call(this,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],i=this.findFilteredOption(e);-1!==i&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedIndex=i,this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const i of t){const t=i.getAttribute("label"),s=[...i.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const i of s){const s=i.getAttribute("aria-label"),o=i.getAttribute("display-value"),l=i.getAttribute("slot");s&&o&&e.push({[this.optionId]:s,[this.optionValue]:o,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"),i=t.getAttribute("display-value");if(e&&i)return{[this.optionId]:e,[this.optionValue]:i}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?String(t[this.optionValue]):t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?String(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(i=>{e.includes(i)&&(t=i.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(this.preventFilter)return this.searchItem=!1,this.options;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}getListBoxVerticalPadding(){if(this.listBox){const t=window.getComputedStyle(this.listBox,null),e=parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"));if(!isNaN(e))return e+2}return 10}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,i=0,s=0;const o=this.getListBoxVerticalPadding();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),s=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&&(i=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=`${e+i+o}px`),this.virtualizer&&(this.virtualizer.style.height=`${s+o}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+o}px`,this.listBox.style.maxHeight=`${e.clientHeight+o}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 i=0;const{top:s,bottom:o}=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)>o?i=n.bottom-o+2:(null==r?void 0:r.top)<s&&(i=r.top-s-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=i})}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 x(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 x(this,void 0,void 0,function*(){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 o.Uz.Escape:break;case o.Uz.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case o.Uz.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;this.inputValue=e.trim(),this.notifyInputValueChanged(e.trim())}removeAllSelected(){var t;this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.setSelectedAttribute(void 0),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),i=this.filteredOptions.indexOf(t);-1!==i&&this.unCheckedOption(i),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){var e;const{event:i}=t.detail;let s=this.findOptionIndex(i);if(-1!==s){this.focusedIndex=this.allowSelectAll&&this.checkForVirtualScroll()?s+1:s,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(s-=1);const t=this.getFocusedItem(s);this.setSelectedAttribute(t),t&&(this.setSelectedOption(t),this.isMulti?this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()):(this.setInputValue(this.getOptionValue(t)),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(t))))}}setSelectedAttribute(t){var e;let i="";t&&(i=this.getOptionId(t)),null===(e=this.lists)||void 0===e||e.forEach((t,e)=>{(null==t?void 0:t.id)===i?null==t||t.setAttribute("selected","true"):null==t||t.setAttribute("selected","false")})}shouldChangeButton(){const t=this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon;return t&&document.dispatchEvent(new CustomEvent("on-widget-update")),t}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{var t;this.focusedIndex=this.filteredOptions.length-1;const e=this.getFocusedItem(this.focusedIndex);e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))}),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){var e,i;switch(t.code){case o.Uz.Backspace:this.focusedIndex=-1;break;case o.Uz.Tab:case o.Uz.Enter:if(this.setFocusOnHost(!0),this.expanded&&this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);this.allowCustomValue&&this.input&&this.input.value.length&&-1===this.findFilteredOption(this.inputValue)?this.setCustomValue():(e&&(this.setSelectedAttribute(e),this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll())}),this.setVisualListbox(!1),t.code===o.Uz.Tab&&this.isMulti)return;break;case o.Uz.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedGroupIndex=-1)});break;case o.Uz.ArrowLeft:case o.Uz.ArrowRight:t.stopPropagation();break;case o.Uz.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected(),this.setSelectedAttribute(void 0));break;case o.Uz.Home:this.setInputSelectionRange(0,0);break;case o.Uz.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case o.Uz.Space:if(this.isMulti&&this.expanded){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.setSelectedAttribute(e),this.showSelectedCount||(this.setInputValue(),null===(i=this.input)||void 0===i||i.setAttribute(o.iw.AriaActivedescendant,""))),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}this.expanded=!0}}handleGroupLabelKeyDown(t,e){switch(t.code){case o.Uz.Tab:this.handleGroupFocus();break;case o.Uz.Enter:case o.Uz.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case o.Uz.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))});break;case o.Uz.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,i;if(!this.readOnly){if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const s=null===(i=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.parentElement;if(s){const t=s.querySelector(".md-combobox-listbox");(0,b.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),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[a.A,g.A]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti,compact:this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}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,"md-combobox-has-leading-icon":this.searchable||this.showFilterIcon,"md-new-combobox":this.newMomentum,[`md-${this.messageType}`]:!!this.messageType,"md-combobox-readonly":this.readOnly,"md-combobox-compact":this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}searchIconTemplate(){return this.leadingIconTemplate("search-bold","search-icon")}filterIconTemplate(){return this.leadingIconTemplate("filter-bold","filter-icon")}leadingIconTemplate(t,e){return h.html`
1
+ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654];export const __webpack_esm_modules__={2273(t,e,i){i.d(e,{a:()=>s}),i(7906),i(1821);var s,o=i(2900),l=i(7704),n=i(9609),r=i(2050),h=i(4084),a=i(2927),d=i(8899),p=i(4955),u=i(3517),c=i(2577),m=i(1156),b=i(7103),g=i(4047),f=function(t,e,i,s){var o,l=arguments.length,n=l<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(n=(l<3?o(n):l>3?o(e,i,n):o(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n},x=function(t,e,i,s){return new(i||(i=Promise))(function(o,l){function n(t){try{h(s.next(t))}catch(t){l(t)}}function r(t){try{h(s.throw(t))}catch(t){l(t)}}function h(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,r)}h((s=s.apply(t,e||[])).next())})};!function(t){class e{determineMessageType(t){return t.reduce((t,e)=>"error"===e?t:e.type,"")}filterMessagesByType(t,e){return t.reduce((t,i)=>i.type===e?t.concat(i.message):t,[])}}t.MessageController=e;let i=class extends((0,l.yC)(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="",this.searchResultAriaLabel="",this.ariaLabelForComboBox="",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.clearIconHeight="auto",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.popupChevronAriaHidden="true",this.newMomentum=!1,this.showFilterIcon=!1,this.preventFilter=!1,this.isDropdownArrow=!1,this.comboboxId="",this.helpText="",this.messageArr=[],this.htmlId="",this.readOnly=!1,this.messageController=new e,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=(0,r.sg)(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=>"string"==typeof e||"true"!==e.isLabel||!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel}))},this.notifyInputValueChanged=(0,r.sg)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.notifySearchResultCount(),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const i=t.composedPath();i.length&&(e=!!i.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){this.updateFocusedIndex(t)}updateFocusedIndex(t){var e,i,s,o;const l=this._focusedIndex;if(this.checkForVirtualScroll()){let l;l=this.allowSelectAll?0===t?"selectAll":this.getOptionId(this.filteredOptions[t-1]):this.getOptionId(this.filteredOptions[t]);const n=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===l):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),n&&(null==n||n.toggleAttribute("focused",!0));const r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("lit-virtualizer");r&&(-1===t?null===(s=r.element(t))||void 0===s||s.scrollIntoView({block:"start"}):null===(o=r.element(t))||void 0===o||o.scrollIntoView({block:"center"}))}else if(this.lists){const e=this.lists[l];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",l)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const i=this.labels[e];i&&i.toggleAttribute("focused",!1);const s=this.labels[t];s&&(s.toggleAttribute("focused",!0),s.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}notifySearchResultCount(){if(this.searchResultAriaLabel){const t=/{{.*?}}/g;this.ariaLabelForComboBox=this.searchResultAriaLabel.replace(t,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForComboBox=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForComboBox=`ComboBox Element, ${this.filteredOptions.length} results found.`}firstUpdated(t){this.ariaLabelForComboBox=this.ariaLabel?this.ariaLabel:"ComboBox Element",super.firstUpdated(t),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()||this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("options")&&this.expanded&&this.checkForVirtualScroll()&&this.updateOnNextFrame(()=>{this.resizeListbox()}),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){var e;this.disabled&&!this.readOnly||(this.noClearIcon&&(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select()),null===(e=super.handleFocusIn)||void 0===e||e.call(this,t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){var e;null===(e=super.handleFocusOut)||void 0===e||e.call(this,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],i=this.findFilteredOption(e);-1!==i&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedIndex=i,this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const i of t){const t=i.getAttribute("label"),s=[...i.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const i of s){const s=i.getAttribute("aria-label"),o=i.getAttribute("display-value"),l=i.getAttribute("slot");s&&o&&e.push({[this.optionId]:s,[this.optionValue]:o,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"),i=t.getAttribute("display-value");if(e&&i)return{[this.optionId]:e,[this.optionValue]:i}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?String(t[this.optionValue]):t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?String(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(i=>{e.includes(i)&&(t=i.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(this.preventFilter)return this.searchItem=!1,this.options;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}getListBoxVerticalPadding(){if(this.listBox){const t=window.getComputedStyle(this.listBox,null),e=parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"));if(!isNaN(e))return e+2}return 10}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,i=0,s=0;const o=this.getListBoxVerticalPadding();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),s=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&&(i=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=`${e+i+o}px`),this.virtualizer&&(this.virtualizer.style.height=`${s+o}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+o}px`,this.listBox.style.maxHeight=`${e.clientHeight+o}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 i=0;const{top:s,bottom:o}=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)>o?i=n.bottom-o+2:(null==r?void 0:r.top)<s&&(i=r.top-s-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=i})}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 x(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 x(this,void 0,void 0,function*(){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 o.Uz.Escape:break;case o.Uz.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case o.Uz.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;this.inputValue=e.trim(),this.notifyInputValueChanged(e.trim())}removeAllSelected(){var t;this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.setSelectedAttribute(void 0),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),i=this.filteredOptions.indexOf(t);-1!==i&&this.unCheckedOption(i),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){var e;const{event:i}=t.detail;let s=this.findOptionIndex(i);if(-1!==s){this.focusedIndex=this.allowSelectAll&&this.checkForVirtualScroll()?s+1:s,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(s-=1);const t=this.getFocusedItem(s);if(this.setSelectedAttribute(t),t)if(this.setSelectedOption(t),this.isMulti)this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected());else{const i=this.getOptionValue(t);this.inputValue=i,this.setInputValue(i),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(t))}}}setSelectedAttribute(t){var e;let i="";t&&(i=this.getOptionId(t)),null===(e=this.lists)||void 0===e||e.forEach((t,e)=>{(null==t?void 0:t.id)===i?null==t||t.setAttribute("selected","true"):null==t||t.setAttribute("selected","false")})}shouldChangeButton(){const t=this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon;return t&&document.dispatchEvent(new CustomEvent("on-widget-update")),t}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{var t;this.focusedIndex=this.filteredOptions.length-1;const e=this.getFocusedItem(this.focusedIndex);e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))}),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){var e,i;if(!this.readOnly)switch(t.code){case o.Uz.Backspace:this.focusedIndex=-1;break;case o.Uz.Tab:case o.Uz.Enter:if(this.setFocusOnHost(!0),this.expanded){if(this.allowCustomValue&&this.input&&this.input.value.length&&-1===this.findFilteredOption(this.inputValue))return void this.setCustomValue();this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);!e||this.showSelectedCount||this.isMulti||(this.inputValue=this.getOptionValue(e)),e&&(this.setSelectedAttribute(e),this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()})}if(this.setVisualListbox(!1),t.code===o.Uz.Tab&&this.isMulti)return;break;case o.Uz.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedGroupIndex=-1)});break;case o.Uz.ArrowLeft:case o.Uz.ArrowRight:t.stopPropagation();break;case o.Uz.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected(),this.setSelectedAttribute(void 0));break;case o.Uz.Home:this.setInputSelectionRange(0,0);break;case o.Uz.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case o.Uz.Space:if(this.isMulti&&this.expanded){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.setSelectedAttribute(e),this.showSelectedCount||(this.setInputValue(),null===(i=this.input)||void 0===i||i.setAttribute(o.iw.AriaActivedescendant,""))),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}this.expanded=!0}}handleGroupLabelKeyDown(t,e){switch(t.code){case o.Uz.Tab:this.handleGroupFocus();break;case o.Uz.Enter:case o.Uz.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case o.Uz.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))});break;case o.Uz.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,i;if(!this.readOnly){if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const s=null===(i=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.parentElement;if(s){const t=s.querySelector(".md-combobox-listbox");(0,b.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),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[h.A,g.A]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti,compact:this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}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,"md-combobox-has-leading-icon":this.searchable||this.showFilterIcon,"md-new-combobox":this.newMomentum,[`md-${this.messageType}`]:!!this.messageType,"md-combobox-readonly":this.readOnly,"md-combobox-compact":this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}searchIconTemplate(){return this.leadingIconTemplate("search-bold","search-icon")}filterIconTemplate(){return this.leadingIconTemplate("filter-bold","filter-icon")}leadingIconTemplate(t,e){return a.html`
2
2
  <md-icon
3
3
  name=${t}
4
4
  class=${e}
5
5
  size="16"
6
6
  iconSet="momentumDesign"
7
+ aria-hidden="true"
7
8
  @click=${this.toggleVisualListBox}
8
9
  ></md-icon>
9
- `}selectedOptionTemplate(t){return h.html`
10
+ `}selectedOptionTemplate(t){return a.html`
10
11
  <div class="md-combobox-selected-item">
11
12
  <span>${this.getOptionValue(t)}</span>
12
13
  <md-icon
@@ -14,10 +15,11 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
14
15
  name="cancel-bold"
15
16
  size=${this.newMomentum?"16":"8"}
16
17
  iconSet="momentumDesign"
18
+ aria-hidden="true"
17
19
  @click=${()=>this.removeSelected(t)}
18
20
  ></md-icon>
19
21
  </div>
20
- `}clearButtonTemplate(){return h.html`
22
+ `}clearButtonTemplate(){return a.html`
21
23
  <button
22
24
  type="button"
23
25
  class="md-combobox-button clear"
@@ -33,10 +35,11 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
33
35
  name="cancel-bold"
34
36
  size="14"
35
37
  iconSet="momentumDesign"
38
+ aria-hidden="true"
36
39
  style="height: ${this.clearIconHeight};"
37
40
  ></md-icon>
38
41
  </button>
39
- `}arrowButtonTemplate(){return h.html`
42
+ `}arrowButtonTemplate(){return a.html`
40
43
  <button
41
44
  type="button"
42
45
  class="md-combobox-button arrow-down"
@@ -50,9 +53,9 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
50
53
  ?readonly=${this.readOnly}
51
54
  @click=${this.toggleVisualListBox}
52
55
  >
53
- <md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign"></md-icon>
56
+ <md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
54
57
  </button>
55
- `}groupArrowButtonTemplate(t){const e=this.groupExpandedList.includes(t)?"arrow-up-bold":"arrow-down-bold";return h.html`
58
+ `}groupArrowButtonTemplate(t){const e=this.groupExpandedList.includes(t)?"arrow-up-bold":"arrow-down-bold";return a.html`
56
59
  <button
57
60
  type="button"
58
61
  class="md-combobox-button"
@@ -66,10 +69,10 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
66
69
  @click=${e=>this.toggleGroupListBox(e,t)}
67
70
  >
68
71
  <span>
69
- <md-icon name=${e} size="12" iconSet="momentumDesign"></md-icon>
72
+ <md-icon name=${e} size="12" iconSet="momentumDesign" aria-hidden="true"></md-icon>
70
73
  </span>
71
74
  </button>
72
- `}getSelectAllOption(){const t=this.checkForVirtualScroll()?`, 1 of ${this.options.length+1}`:"";return h.html`
75
+ `}getSelectAllOption(){const t=this.checkForVirtualScroll()?`, 1 of ${this.options.length+1}`:"";return a.html`
73
76
  <div
74
77
  id="selectAll"
75
78
  part="combobox-option"
@@ -85,9 +88,9 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
85
88
 
86
89
  <span part="label" class="select-label" aria-hidden="true">${this.selectAllTextLocalization}</span>
87
90
  </div>
88
- `}getSelctedCount(){return 0===this.selectedOptions.length?h.nothing:this.isSelectAllSelected()?h.html` <span class="selected-count">${this.allTextLocalization}</span> `:h.html`
91
+ `}getSelctedCount(){return 0===this.selectedOptions.length?a.nothing:this.isSelectAllSelected()?a.html` <span class="selected-count">${this.allTextLocalization}</span> `:a.html`
89
92
  <span class="selected-count">${this.selectedOptions.length} ${this.selectedTextLocalization}</span>
90
- `}checkForVirtualScroll(){return this.useVirtualScroll&&!this.isOptGroup}rangeChanged(){this.updateFocusedIndex(this.focusedIndex),this.checkSelectedOptions(),this.resizeListbox()}getCustomErrorContent(){const t=this.querySelector("[slot]")||this.shadowRoot.querySelector("[slot]");return document.createRange().createContextualFragment(`${null==t?void 0:t.outerHTML}`)}getCustomContent(t){const e=this.getCustomContentName(t);if(this.isOptGroup){const t=[...this.querySelectorAll("[slot]")].find(t=>t.slot===e);return t?document.createRange().createContextualFragment(`${t.outerHTML}`):h.html``}return h.html` <slot name=${(0,u.ifDefined)(e)}></slot> `}renderGroupLabelHeader(t,e){return h.html`
93
+ `}checkForVirtualScroll(){return this.useVirtualScroll&&!this.isOptGroup}rangeChanged(){this.updateFocusedIndex(this.focusedIndex),this.checkSelectedOptions(),this.resizeListbox()}getCustomErrorContent(){const t=this.querySelector("[slot]")||this.shadowRoot.querySelector("[slot]");return document.createRange().createContextualFragment(`${null==t?void 0:t.outerHTML}`)}getCustomContent(t){const e=this.getCustomContentName(t);if(this.isOptGroup){const t=[...this.querySelectorAll("[slot]")].find(t=>t.slot===e);return t?document.createRange().createContextualFragment(`${t.outerHTML}`):a.html``}return a.html` <slot name=${(0,u.ifDefined)(e)}></slot> `}renderGroupLabelHeader(t,e){return a.html`
91
94
  <div
92
95
  part="group-label"
93
96
  class="group-label"
@@ -102,7 +105,7 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
102
105
  <span part="group-label">${t.value}</span>
103
106
  ${this.groupArrowButtonTemplate(t.value)}
104
107
  </div>
105
- `}renderWithoutVirtualScroll(){return(0,c.repeat)(this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue),t=>this.getOptionId(t),(t,e)=>"string"!=typeof t&&this.isOptGroup&&"true"===t.isLabel?this.renderGroupLabelHeader(t,e):!this.isOptGroup||this.groupExpandedList.includes(this.getOptionGroupName(t))?this.renderItem(t,e):void 0)}highlightingSearchedText(t){return(0,r.ws)(this.getOptionValue(t),this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).map(({text:t,matching:e})=>e?h.html` <span class="highlight-text" part="select-label">${t}</span> `:h.html` <span class="selected-label-text" part="select-label">${t}</span> `)}addStyle(){const t=!this.expanded||this.options.length&&0===this.filteredOptions.length&&this.inputValue&&this.allowCustomValue;return this.checkForVirtualScroll()?(0,m.styleMap)({visibility:t?"hidden":"visible","z-index":t?"-1":"99",overflow:"hidden"}):(0,m.styleMap)({display:t?"none":"block","z-index":"99",overflow:"auto"})}renderItem(t,e){const i=this.allowSelectAll?e+2:e+1,s=this.allowSelectAll?this.options.length+1:this.options.length,o=this.checkForVirtualScroll()?`, ${i} of ${s}`:"";return h.html`
108
+ `}renderWithoutVirtualScroll(){return(0,c.repeat)(this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue),t=>this.getOptionId(t),(t,e)=>"string"!=typeof t&&this.isOptGroup&&"true"===t.isLabel?this.renderGroupLabelHeader(t,e):!this.isOptGroup||this.groupExpandedList.includes(this.getOptionGroupName(t))?this.renderItem(t,e):void 0)}highlightingSearchedText(t){return(0,r.ws)(this.getOptionValue(t),this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).map(({text:t,matching:e})=>e?a.html` <span class="highlight-text" part="select-label">${t}</span> `:a.html` <span class="selected-label-text" part="select-label">${t}</span> `)}addStyle(){const t=!this.expanded||this.options.length&&0===this.filteredOptions.length&&this.inputValue&&this.allowCustomValue;return this.checkForVirtualScroll()?(0,m.styleMap)({visibility:t?"hidden":"visible","z-index":t?"-1":"99",overflow:"hidden"}):(0,m.styleMap)({display:t?"none":"block","z-index":"99",overflow:"auto"})}renderItem(t,e){const i=this.allowSelectAll?e+2:e+1,s=this.allowSelectAll?this.options.length+1:this.options.length,o=this.checkForVirtualScroll()?`, ${i} of ${s}`:"";return a.html`
106
109
  <div
107
110
  id=${this.getOptionId(t)}
108
111
  title="${this.getOptionValue(t)}"
@@ -116,24 +119,24 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
116
119
  @click=${t=>this.handleListClick(t)}
117
120
  aria-checked=${(0,u.ifDefined)(this.isMulti?this.isOptionChecked.call(this,t):void 0)}
118
121
  >
119
- ${this.isMulti?h.html`
122
+ ${this.isMulti?a.html`
120
123
  <span class="select-option" aria-hidden="true">
121
124
  <md-icon name="check-bold" size="14" iconSet="momentumDesign"></md-icon>
122
125
  </span>
123
- `:h.nothing}
126
+ `:a.nothing}
124
127
  <span part="label" class="select-label" aria-hidden="true">
125
128
  ${this.isCustomContent?this.getCustomContent(t):this.highlightingSearchedText(t)}
126
129
  </span>
127
130
  </div>
128
- `}inputTitle(){return this.isMulti?this.selectedOptions.length>0?`${this.selectedOptions.length} ${this.selectedTextLocalization}`:this.placeholder:this.selectedOptions.length>0?this.getOptionValue(this.selectedOptions[0]):this.placeholder}helpTextTemplate(){return this.helpText?h.html`
131
+ `}inputTitle(){return this.isMulti?this.selectedOptions.length>0?`${this.selectedOptions.length} ${this.selectedTextLocalization}`:this.placeholder:this.selectedOptions.length>0?this.getOptionValue(this.selectedOptions[0]):this.placeholder}helpTextTemplate(){return this.helpText?a.html`
129
132
  <md-help-text
130
133
  class="help-text ${(0,p.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
131
134
  .message=${this.helpText}
132
135
  style=${(0,m.styleMap)({width:"100%"})}
133
136
  ></md-help-text>
134
- `:h.nothing}messagesTemplate(){return this.messages&&this.messages.length?h.html`
137
+ `:a.nothing}messagesTemplate(){return this.messages&&this.messages.length?a.html`
135
138
  <div id="${this.htmlId}-message" part="message" class="md-combobox__messages">
136
- ${(0,c.repeat)(this.messages,(t,e)=>h.html`
139
+ ${(0,c.repeat)(this.messages,(t,e)=>a.html`
137
140
  <md-help-text
138
141
  .message=${t}
139
142
  .id=${this.messageArr[e].id||""}
@@ -142,34 +145,34 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
142
145
  ></md-help-text>
143
146
  `)}
144
147
  </div>
145
- `:h.nothing}get newArrowButtonTemplate(){return h.html`<div class="md-combobox-right-arrow">${this.arrowButtonTemplate()}</div>`}get renderNewMomentumArrow(){return h.html` ${this.isDropdownArrow?this.arrowButtonTemplate():this.newArrowButtonTemplate} `}get renderTrailingInputControls(){const t=this.shouldChangeButton();return this.newMomentum?t&&this.isDropdownArrow?h.html`${this.clearButtonTemplate()}`:t?h.html`${this.clearButtonTemplate()} ${this.renderNewMomentumArrow}`:this.renderNewMomentumArrow:this.compact?h.html`${h.nothing}`:h.html`${t?this.clearButtonTemplate():this.arrowButtonTemplate()}`}get renderVirtualScroll(){return h.html`
148
+ `:a.nothing}get newArrowButtonTemplate(){return a.html`<div class="md-combobox-right-arrow">${this.arrowButtonTemplate()}</div>`}get renderNewMomentumArrow(){return a.html` ${this.isDropdownArrow?this.arrowButtonTemplate():this.newArrowButtonTemplate} `}get renderTrailingInputControls(){const t=!this.readOnly&&this.shouldChangeButton();return this.newMomentum?t&&this.isDropdownArrow?a.html`${this.clearButtonTemplate()}`:t?a.html`${this.clearButtonTemplate()} ${this.renderNewMomentumArrow}`:this.renderNewMomentumArrow:this.compact?a.html`${a.nothing}`:a.html`${t?this.clearButtonTemplate():this.arrowButtonTemplate()}`}get renderVirtualScroll(){return a.html`
146
149
  <div class="virtual-scroll" @rangeChanged=${this.rangeChanged}>
147
150
  <lit-virtualizer
148
151
  .items=${this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue)}
149
152
  .renderItem=${(t,e)=>this.renderItem(t,e)}
150
153
  ></lit-virtualizer>
151
154
  </div>
152
- `}render(){return h.html`
155
+ `}render(){return a.html`
153
156
  <div part="combobox" class="md-combobox md-combobox-list ${(0,p.classMap)(this.comboBoxTemplateClassMap)}">
154
157
  <div part="group" class="group ${(0,p.classMap)(this.listItemOptionMap)}">
155
- ${this.searchable?this.searchIconTemplate():this.showFilterIcon?this.filterIconTemplate():h.nothing}
158
+ ${this.searchable?this.searchIconTemplate():this.showFilterIcon?this.filterIconTemplate():a.nothing}
156
159
  <div class="md-combobox__multiwrap" part="multiwrap">
157
- ${this.isMulti?this.isMulti&&!this.showSelectedCount?(0,c.repeat)(this.selectedOptions,t=>this.selectedOptionTemplate(t)):this.getSelctedCount():h.nothing}
160
+ ${this.isMulti?this.isMulti&&!this.showSelectedCount?(0,c.repeat)(this.selectedOptions,t=>this.selectedOptionTemplate(t)):this.getSelctedCount():a.nothing}
158
161
  <input
159
162
  id=${(0,u.ifDefined)(this.comboboxId||void 0)}
160
163
  class="md-combobox-listbox"
161
164
  type="text"
162
165
  role="combobox"
163
166
  aria-autocomplete="both"
164
- aria-label=${this.ariaLabelForComboBox}
167
+ aria-label=${(0,u.ifDefined)(this.inputValue&&this.selectedOptions.length>0?void 0:this.ariaLabelForComboBox)}
165
168
  part="multiwrap-input"
166
169
  aria-expanded=${this.expanded}
167
- placeholder=${this.isMulti&&this.showSelectedCount&&0!==this.selectedOptions.length?"":this.placeholder}
170
+ placeholder=${this.inputValue&&this.selectedOptions.length>0||this.isMulti&&this.showSelectedCount&&0!==this.selectedOptions.length?"":this.placeholder}
168
171
  aria-controls="md-combobox-listbox"
169
172
  ?readonly=${this.allowSelectAll||this.readOnly}
170
173
  ?disabled=${this.disabled}
171
174
  ?autofocus=${this.autofocus}
172
- title=${(0,u.ifDefined)(this.inputTitle())}
175
+ title=${(0,u.ifDefined)(this.inputValue&&this.selectedOptions.length>0?void 0:this.inputTitle())}
173
176
  .value=${this.inputValue}
174
177
  @click=${this.toggleVisualListBox}
175
178
  @input=${this.handleInput}
@@ -180,7 +183,7 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
180
183
  ${this.renderTrailingInputControls}
181
184
  </div>
182
185
 
183
- ${this.showLoader||this.showCustomError?h.html`
186
+ ${this.showLoader||this.showCustomError?a.html`
184
187
  <div
185
188
  id="md-combobox-listbox"
186
189
  part="combobox-options"
@@ -189,7 +192,7 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
189
192
  >
190
193
  ${this.getCustomErrorContent()}
191
194
  </div>
192
- `:h.html`
195
+ `:a.html`
193
196
  <div
194
197
  id="md-combobox-listbox"
195
198
  part="combobox-options"
@@ -197,25 +200,25 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
197
200
  style=${this.addStyle()}
198
201
  role=${(0,u.ifDefined)(this.checkForVirtualScroll()?void 0:"list")}
199
202
  >
200
- ${this.isMulti&&this.allowSelectAll&&this.expanded?this.getSelectAllOption():h.nothing}
201
- ${this.checkForVirtualScroll()?0!==this.options.length&&this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).length>0?this.renderVirtualScroll:h.nothing:this.renderWithoutVirtualScroll()}
202
- ${this.options.length&&0===this.filteredOptions.length&&this.inputValue&&!this.allowCustomValue?h.html`
203
+ ${this.isMulti&&this.allowSelectAll&&this.expanded?this.getSelectAllOption():a.nothing}
204
+ ${this.checkForVirtualScroll()?0!==this.options.length&&this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).length>0?this.renderVirtualScroll:a.nothing:this.renderWithoutVirtualScroll()}
205
+ ${this.options.length&&0===this.filteredOptions.length&&this.inputValue&&!this.allowCustomValue?a.html`
203
206
  <div class="no-result md-combobox-option" role="option" aria-selected="false" tabindex="-1">
204
207
  ${this.resultsTextLocalization.trim()}
205
208
  </div>
206
- `:h.nothing}
207
- ${0===this.options.length?h.html`
209
+ `:a.nothing}
210
+ ${0===this.options.length?a.html`
208
211
  <div class="no-result md-combobox-option" role="option" aria-selected="false" tabindex="-1">
209
212
  ${this.optionsTextLocalization.trim()}
210
213
  </div>
211
- `:h.nothing}
214
+ `:a.nothing}
212
215
  </div>
213
216
  `}
214
217
  </div>
215
- ${this.invalid?h.html`
218
+ ${this.invalid?a.html`
216
219
  <div part="message" class="md-combobox-error ${(0,p.classMap)({"md-new-combobox-error":this.newMomentum})}">
217
220
  <md-help-text .message=${this.invalidText} messageType="error"></md-help-text>
218
221
  </div>
219
- `:h.nothing}
222
+ `:a.nothing}
220
223
  ${this.messagesTemplate()} ${this.helpTextTemplate()}
221
224
  `}};f([(0,d.property)({type:String})],i.prototype,"label",void 0),f([(0,d.property)({type:Array})],i.prototype,"options",void 0),f([(0,d.property)({type:Array,attribute:"custom-options"})],i.prototype,"customOptions",void 0),f([(0,d.property)({type:String})],i.prototype,"placeholder",void 0),f([(0,d.property)({type:Boolean,attribute:"is-multi"})],i.prototype,"isMulti",void 0),f([(0,d.property)({type:Boolean,attribute:"use-virtual-scroll"})],i.prototype,"useVirtualScroll",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"ordered",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"expanded",void 0),f([(0,d.property)({type:Array,reflect:!0})],i.prototype,"groupExpandedList",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchItem",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"compact",void 0),f([(0,d.property)({type:Boolean,attribute:"no-clear-icon"})],i.prototype,"noClearIcon",void 0),f([(0,d.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),f([(0,d.property)({type:Array})],i.prototype,"selectedOptions",void 0),f([(0,d.property)({type:Number,attribute:"visible-option",reflect:!0})],i.prototype,"visibleOptions",void 0),f([(0,d.property)({type:String,attribute:"option-id",reflect:!0})],i.prototype,"optionId",void 0),f([(0,d.property)({type:String,attribute:"option-value",reflect:!0})],i.prototype,"optionValue",void 0),f([(0,d.property)({type:Boolean,attribute:"with-custom-content"})],i.prototype,"isCustomContent",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchable",void 0),f([(0,d.property)({type:String})],i.prototype,"shape",void 0),f([(0,d.property)({type:Array})],i.prototype,"value",void 0),f([(0,d.property)({type:String,attribute:"input-value",reflect:!0})],i.prototype,"inputValue",void 0),f([(0,d.property)({type:Boolean,attribute:"allow-custom-value",reflect:!0})],i.prototype,"allowCustomValue",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),f([(0,d.property)({type:String,attribute:"no-results-i18n"})],i.prototype,"resultsTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"no-options-i18n"})],i.prototype,"optionsTextLocalization",void 0),f([(0,d.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],i.prototype,"trimSpace",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"invalid",void 0),f([(0,d.property)({type:String,reflect:!0,attribute:"invalid-text-i18n"})],i.prototype,"invalidText",void 0),f([(0,d.property)({type:String,reflect:!0})],i.prototype,"ariaLabel",void 0),f([(0,d.property)({type:String,attribute:"search-result-aria-label"})],i.prototype,"searchResultAriaLabel",void 0),f([(0,d.state)()],i.prototype,"ariaLabelForComboBox",void 0),f([(0,d.property)({type:String,attribute:"clear-aria-label"})],i.prototype,"clearAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"arrow-aria-label"})],i.prototype,"arrowAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"clear-icon-height"})],i.prototype,"clearIconHeight",void 0),f([(0,d.property)({type:String,attribute:"all-i18n"})],i.prototype,"allTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"select-all-i18n"})],i.prototype,"selectAllTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"selected-all-i18n"})],i.prototype,"selectedTextLocalization",void 0),f([(0,d.property)({type:Boolean,attribute:"allow-select-all",reflect:!0})],i.prototype,"allowSelectAll",void 0),f([(0,d.property)({type:Boolean,attribute:"show-custom-error",reflect:!0})],i.prototype,"showCustomError",void 0),f([(0,d.property)({type:Boolean,attribute:"show-loader",reflect:!0})],i.prototype,"showLoader",void 0),f([(0,d.property)({type:Boolean,attribute:"show-selected-count",reflect:!0})],i.prototype,"showSelectedCount",void 0),f([(0,d.property)({type:String,attribute:"popup-chevron-aria-hidden"})],i.prototype,"popupChevronAriaHidden",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"newMomentum",void 0),f([(0,d.property)({type:Boolean,attribute:"show-filter-icon"})],i.prototype,"showFilterIcon",void 0),f([(0,d.property)({type:Boolean,attribute:"prevent-filter"})],i.prototype,"preventFilter",void 0),f([(0,d.property)({type:Boolean,attribute:"is-dropdown-arrow"})],i.prototype,"isDropdownArrow",void 0),f([(0,d.property)({type:String})],i.prototype,"comboboxId",void 0),f([(0,d.property)({type:String})],i.prototype,"helpText",void 0),f([(0,d.property)({type:Array})],i.prototype,"messageArr",void 0),f([(0,d.property)({type:String})],i.prototype,"htmlId",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"readOnly",void 0),f([(0,d.state)()],i.prototype,"isOptGroup",void 0),f([(0,d.state)()],i.prototype,"isSelectAllChecked",void 0),f([(0,d.query)(".group")],i.prototype,"group",void 0),f([(0,d.query)(".md-combobox-listbox")],i.prototype,"input",void 0),f([(0,d.query)(".md-combobox-button")],i.prototype,"button",void 0),f([(0,d.query)("div#md-combobox-listbox")],i.prototype,"listBox",void 0),f([(0,d.query)(".virtual-scroll")],i.prototype,"virtualizer",void 0),f([(0,d.queryAll)("div.md-combobox-option")],i.prototype,"lists",void 0),f([(0,d.queryAll)(".group-label")],i.prototype,"labels",void 0),f([(0,d.queryAll)(".md-combobox-selected-item")],i.prototype,"selected",void 0),i=f([(0,n.w)("md-combobox")],i),t.ELEMENT=i}(s||(s={}))}};
package/dist/esm/3639.js CHANGED
@@ -1,4 +1,4 @@
1
- export const __webpack_esm_id__=3639;export const __webpack_esm_ids__=[3639,6020];export const __webpack_esm_modules__={3639(t,e,i){i(5983);var s,a=i(9609),d=i(878),r=i(2050),o=i(4084),n=i(2927),h=i(8899),c=i(4955),l=i(3517),p=i(3842),y=function(t,e,i,s){var a,d=arguments.length,r=d<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(d<3?a(r):d>3?a(e,i,r):a(e,i))||r);return d>3&&r&&Object.defineProperty(e,i,r),r};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.focused=!1,this.selected=!1,this.disabled=!1,this.day=(0,d.tB)(),this.viewAnchorMonth=void 0,this.filterParams=void 0,this.datePickerProps=void 0,this.isOutsideMonth=!1,this.isToday=!1,this.parentRangePicker=null,this.dateIsInRange=!1,this.handleClick=t=>{this.dispatchEvent(new CustomEvent("day-select",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))},this.isDateInRange=()=>{var t;const e=this.parentRangePicker,i=null==e?void 0:e.startDate,s=null==e?void 0:e.endDate;if(!i||!s)return!1;const a=(null===(t=this.day)||void 0===t?void 0:t.isValid)?this.day.toSQLDate():null;if(!a)return!1;const d=a>i&&a<s,r=a===i,o=a===s;return!this.isPrimarySelection()&&(d||r||o)},this.handleKeyDown=t=>{this.dispatchEvent(new CustomEvent("day-key-event",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))}}connectedCallback(){super.connectedCallback(),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.parentRangePicker=(0,r.QZ)("md-date-range-picker",this)}updated(t){var e,i;super.updated(t),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.focused&&this.button&&(null===(i=null===(e=this.button.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===i||i.focus()),this.parentRangePicker&&(this.dateIsInRange=this.isDateInRange())}isPrimarySelection(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)&&void 0===this.parentRangePicker.endDate}isLeadingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.firstElementChild)}isEndingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.lastElementChild)}isStartDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)===this.day.toSQLDate()&&!this.isPrimarySelection()}isEndDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.endDate)===this.day.toSQLDate()}get getDayClassMap(){return{"md-datepicker__day--selected":this.selected,"md-datepicker__day--focus":this.focused,"md-datepicker__day--today":this.isToday,"md-datepicker__day--outside-month":this.isOutsideMonth,"md-datepicker__day--in-range":this.dateIsInRange,"md-datepicker__day--week-first":this.isLeadingRangeEdge(),"md-datepicker__day--week-last":this.isEndingRangeEdge(),"md-datepicker__day--start-date":this.isStartDate(),"md-datepicker__day--end-date":this.isEndDate()}}static get styles(){return[o.A,p.A]}render(){var t;const e=(0,d.WV)(this.day,(null===(t=this.datePickerProps)||void 0===t?void 0:t.locale)||"en").toFormat("D, dd MMMM yyyy");return n.html`
1
+ export const __webpack_esm_id__=3639;export const __webpack_esm_ids__=[3639,6020];export const __webpack_esm_modules__={3639(t,e,i){i(5983);var s,a=i(9609),d=i(878),r=i(2050),o=i(4084),n=i(2927),h=i(8899),c=i(4955),l=i(3517),p=i(3842),y=function(t,e,i,s){var a,d=arguments.length,r=d<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(d<3?a(r):d>3?a(e,i,r):a(e,i))||r);return d>3&&r&&Object.defineProperty(e,i,r),r};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.focused=!1,this.selected=!1,this.disabled=!1,this.day=(0,d.tB)(),this.viewAnchorMonth=void 0,this.filterParams=void 0,this.datePickerProps=void 0,this.isOutsideMonth=!1,this.isToday=!1,this.parentRangePicker=null,this.dateIsInRange=!1,this.handleClick=t=>{this.dispatchEvent(new CustomEvent("day-select",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))},this.isDateInRange=()=>{var t;const e=this.parentRangePicker,i=null==e?void 0:e.startDate,s=null==e?void 0:e.endDate;if(!i||!s)return!1;const a=(null===(t=this.day)||void 0===t?void 0:t.isValid)?this.day.toSQLDate():null;if(!a)return!1;const d=a>i&&a<s,r=a===i,o=a===s;return!this.isPrimarySelection()&&(d||r||o)},this.handleKeyDown=t=>{this.dispatchEvent(new CustomEvent("day-key-event",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))}}connectedCallback(){super.connectedCallback(),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.parentRangePicker=(0,r.QZ)("md-date-range-picker",this)}updated(t){var e,i;super.updated(t),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.focused&&this.button&&(null===(i=null===(e=this.button.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===i||i.focus()),this.parentRangePicker&&(this.dateIsInRange=this.isDateInRange())}isPrimarySelection(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)&&void 0===this.parentRangePicker.endDate}isLeadingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.firstElementChild)}isEndingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.lastElementChild)}isStartDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)===this.day.toSQLDate()&&!this.isPrimarySelection()}isEndDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.endDate)===this.day.toSQLDate()}get getDayClassMap(){return{"md-datepicker__day--selected":this.selected,"md-datepicker__day--focus":this.focused,"md-datepicker__day--today":this.isToday,"md-datepicker__day--outside-month":this.isOutsideMonth,"md-datepicker__day--in-range":this.dateIsInRange,"md-datepicker__day--week-first":this.isLeadingRangeEdge(),"md-datepicker__day--week-last":this.isEndingRangeEdge(),"md-datepicker__day--start-date":this.isStartDate(),"md-datepicker__day--end-date":this.isEndDate()}}static get styles(){return[o.A,p.A]}render(){var t;const e=(0,d.WV)(this.day,(null===(t=this.datePickerProps)||void 0===t?void 0:t.locale)||"en").toFormat("dd MMMM yyyy"),i=this.selected||this.isStartDate()||this.isEndDate()?`${e}, selected`:e;return n.html`
2
2
  <md-button
3
3
  circle
4
4
  size=${32}
@@ -7,8 +7,7 @@ export const __webpack_esm_id__=3639;export const __webpack_esm_ids__=[3639,6020
7
7
  class="md-datepicker__day ${(0,c.classMap)(this.getDayClassMap)}"
8
8
  @click=${t=>{this.disabled||this.handleClick(t)}}
9
9
  @keydown=${t=>this.handleKeyDown(t)}
10
- ariaLabel=${`${e}`}
11
- title=${`${e}`}
10
+ ariaLabel=${i}
12
11
  aria-selected=${(0,l.ifDefined)(this.selected)}
13
12
  tab-index=${this.focused?"0":"-1"}
14
13
  >
@@ -0,0 +1,18 @@
1
+ export const __webpack_esm_id__=378;export const __webpack_esm_ids__=[378,1161,3477];export const __webpack_esm_modules__={4470(e,t,i){i.d(t,{mS:()=>n});const n={active:"Available",meeting:"In a meeting",schedule:"Scheduled",call:"On a call",dnd:"Do not disturb",presenting:"Presenting","quiet-hours":"Quiet hours",away:"Away",idle:"Idle",inactive:"Inactive","away-calling":"Away",ooo:"Out of office",busy:"Busy","on-mobile":"On mobile","on-device":"On device","on-hold":"On hold",engaged:"Engaged",rona:"Unavailable",wrapup:"Wrap up"}},1161(e,t,i){var n,s=i(9609),o=i(4084),a=i(2927),r=i(8899),l=i(4955),c=i(1392),p=function(e,t,i,n){var s,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};!function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.size="",this.isAnimating=!1,this.animationFrameId=null}static get styles(){return[o.A,c.A]}firstUpdated(e){super.firstUpdated(e),this.isAnimating=!0,this.startAnimation()}disconnectedCallback(){super.disconnectedCallback(),this.isAnimating=!1,this.stopAnimation()}startAnimation(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".md-loading__icon");if(!t)return;let i=null;const n=1400,s=e=>{if(!this.isAnimating)return;i||(i=e);const o=(e-i)%n;t.forEach((e,t)=>{const i=(o-200*t+n)%n;let s=0,a=.1;if(i<280){const e=.1+i/280*.9;s=e,a=e}else if(i<1400){const e=Math.min((i-280)/1120*2,1);s=Math.max(1-.9*e,.9),a=Math.max(1-.9*e,.2)}e.style.transform=`scale(${s})`,e.style.opacity=`${a}`}),this.animationFrameId=requestAnimationFrame(s)};this.animationFrameId=requestAnimationFrame(s)}stopAnimation(){var e;null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null);const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".md-loading__icon");t&&t.forEach(e=>{e.style.transform="scale(0, 0)",e.style.opacity="0.1"})}get loadingClassMap(){return{[`md-loading--${this.size}`]:!!this.size}}get loadingIconClassMap(){return{"md-loading__icon":!0}}render(){return a.html`
2
+ <div class="md-loading ${(0,l.classMap)(this.loadingClassMap)}">
3
+ <span class=${(0,l.classMap)(this.loadingIconClassMap)}></span>
4
+ <span class=${(0,l.classMap)(this.loadingIconClassMap)}></span>
5
+ <span class=${(0,l.classMap)(this.loadingIconClassMap)}></span>
6
+ </div>
7
+ `}};p([(0,r.property)({type:String})],t.prototype,"size",void 0),t=p([(0,s.w)("md-loading")],t),e.ELEMENT=t}(n||(n={}))},3477(e,t,i){i(1821);var n,s=i(9609),o=i(4084),a=i(2927),r=i(8899),l=i(4955),c=i(1618),p=i(4449),d=function(e,t,i,n){var s,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};!function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.name="",this.size=48,this.title="",this.color="",this.presenceType="",this.newMomentum=!1,this.failurePresence=!1,this.avatarLinked=!1}static get styles(){return[o.A,p.A]}get presenceClassMap(){return{"avatar-presence-wrapper":this.avatarLinked}}render(){if(this.presenceType){const{presenceIcon:e,presenceColor:t}=(0,c.E)(this.presenceType,this.failurePresence,this.newMomentum);this.name=e,this.color=t}return a.html`
8
+ <div class="${(0,l.classMap)(this.presenceClassMap)}" data-size=${this.size} data-icon-size=${this.size}>
9
+ <md-icon
10
+ name="${this.name}"
11
+ color="${this.color}"
12
+ size=${this.size}
13
+ title="${this.title}"
14
+ .iconSet=${"momentumDesign"}
15
+ >
16
+ </md-icon>
17
+ </div>
18
+ `}};d([(0,r.property)({type:String})],t.prototype,"name",void 0),d([(0,r.property)({type:Number})],t.prototype,"size",void 0),d([(0,r.property)({type:String})],t.prototype,"title",void 0),d([(0,r.property)({type:String})],t.prototype,"color",void 0),d([(0,r.property)({type:String,attribute:"presence-type"})],t.prototype,"presenceType",void 0),d([(0,r.property)({type:Boolean})],t.prototype,"newMomentum",void 0),d([(0,r.property)({type:Boolean})],t.prototype,"failurePresence",void 0),d([(0,r.property)({type:Boolean})],t.prototype,"avatarLinked",void 0),t=d([(0,s.w)("md-presence")],t),e.ELEMENT=t}(n||(n={}))}};
package/dist/esm/4626.js CHANGED
@@ -1,4 +1,4 @@
1
- export const __webpack_esm_id__=4626;export const __webpack_esm_ids__=[2245,4626];export const __webpack_esm_modules__={2245(t,e,a){a(1821),a(1161),a(3477);var i,n=a(1618),s=a(9609),o=a(7154),r=a(4084),c=a(2927),l=a(8899),h=a(4955),p=a(3517),d=a(1156),m=a(1666),y=a(6325),u=function(t,e,a,i){var n,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,a,i);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(s<3?n(o):s>3?n(e,a,o):n(e,a))||o);return s>3&&o&&Object.defineProperty(e,a,o),o};!function(t){let e=class extends c.LitElement{constructor(){super(...arguments),this._tabIndex=0,this.alt="",this.src="",this.label="",this.title="",this.color="",this.decrypting=!1,this.role="img",this.iconName="",this.failurePresence=!1,this.type="",this.newMomentum=!1,this.typing=!1,this.size=40,this.hasNotification=!1,this.clickable=!1,this.avatarStyle="default",this.state="rest",this.imageLoaded=!1,this.imageErrored=!1,this.presenceColor="",this.presenceIcon="",this.iconNameMap={"channel-chat":"chat-filled","channel-chat-outbound":"chat-outbound-filled","channel-social":"sms-message-filled","channel-sms-inbound":"sms-filled","channel-sms-outbound":"sms-outgoing-filled","channel-email-inbound":"email-filled","channel-email-outbound":"email-outgoing-filled","channel-call":"handset-filled","channel-call-inbound":"incoming-call-legacy-filled","channel-callback":"outgoing-call-legacy-filled","channel-callback-v2":"outgoing-call-legacy-bold","channel-headset":"headset-filled","channel-campaign":"campaign-management-bold","channel-emoji":"emoji-happy-filled","channel-webex":"webex-app-icon-color-container","channel-fb-messenger":"social-fbmessenger-color","channel-facebook":"social-facebook-color","channel-apple-chat":"apple-business-chat-color","channel-line":"social-line-color","channel-twitter-x":"social-x","channel-viber":"social-viber-color","channel-whats-app":"social-whatsapp-color","channel-we-chat":"social-wechat-color","channel-spam":"participant-unknown-bold","channel-monitoring":"monitoring-bold","channel-work-item":"custom-task-ind-regular"}}get tabIndex(){return this._tabIndex}set tabIndex(t){const e=this._tabIndex;this._tabIndex=t,this.requestUpdate("tabIndex",e)}static get styles(){return[r.A,y.A]}isPresenceType(t){return n.e.includes(t)}firstUpdated(){const t=this.presenceType||(this.isPresenceType(this.type)?this.type:"");if(t){const{presenceColor:e,presenceIcon:a}=(0,n.E)(t,this.failurePresence,this.newMomentum);this.presenceColor=e,this.presenceIcon=a}}willUpdate(t){var e;null===(e=super.willUpdate)||void 0===e||e.call(this,t);const a=this.presenceType||(this.isPresenceType(this.type)?this.type:"");if(a&&(t.has("type")||t.has("presenceType")||t.has("newMomentum"))){const{presenceColor:t,presenceIcon:e}=(0,n.E)(a,this.failurePresence,this.newMomentum);this.presenceColor=t,this.presenceIcon=e}}updated(t){super.updated(t),t.has("role")&&this.style.setProperty("--avatar-cursor","button"===this.role?"pointer":"default")}get avatarClassMap(){return Object.assign(Object.assign({},this.newMomentum&&"bot"!==this.type||!this.type?{}:{[`md-avatar--${this.type}`]:!0}),{[`md-avatar--${this.size}`]:!!this.size,[`md-avatar--${this.color}`]:!!this.color,active:"active"===this.state})}get avatarLetterClassMap(){return{"md-decrypting":this.decrypting,[`md-avatar--${this.color}`]:this.color,"new-momentum":this.newMomentum,active:"active"===this.state}}get avatarStyleMap(){return{[`md-avatar--${this.color}`]:this.color}}get pretifyTitle(){if(this.title.length){const t=this.title.trim().split(" ");return 1===t.length?t[0].charAt(0):t[0].charAt(0)+t[t.length-1].charAt(0)}return this.title}get chatIconName(){return"chat-filled"}getIconName(t){return this.iconNameMap[t]||""}get chatIconSize(){return this.iconSize}get presenceSize(){return this.size<=24?10.5:this.size<=32?14:this.size<=48?13.94:this.size<=64?18.58:this.size<=72?20.9:this.size<=88?25.55:36}get iconSize(){return 24===this.size?"16":28===this.size?"18":32===this.size?"20":36===this.size?"22":40===this.size?"24":48===this.size?"28":56===this.size?"32":64===this.size?"36":72===this.size?"40":Math.round(this.size/1.7).toString()}get renderIsTyping(){return"typing"===this.type||this.typing?c.html` <md-loading></md-loading> `:c.nothing}get avatarLetter(){return this.title?c.html`
1
+ export const __webpack_esm_id__=4626;export const __webpack_esm_ids__=[2245,4626];export const __webpack_esm_modules__={2245(e,t,i){i(1821),i(1161),i(3477);var a,n=i(1618),s=i(9609),o=i(7154),r=i(4084),c=i(2927),l=i(8899),h=i(4955),p=i(3517),d=i(1156),m=i(1666),y=i(4470),u=i(6325),g=function(e,t,i,a){var n,s=arguments.length,o=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o};!function(e){let t=class extends c.LitElement{constructor(){super(...arguments),this._tabIndex=0,this.alt="",this.src="",this.label="",this.title="",this.color="",this.decrypting=!1,this.role="img",this.iconName="",this.failurePresence=!1,this.type="",this.presenceAriaLabel="",this.newMomentum=!1,this.typing=!1,this.size=40,this.hasNotification=!1,this.clickable=!1,this.avatarStyle="default",this.state="rest",this.imageLoaded=!1,this.imageErrored=!1,this.presenceColor="",this.presenceIcon="",this.iconNameMap={"channel-chat":"chat-filled","channel-chat-outbound":"chat-outbound-filled","channel-social":"sms-message-filled","channel-sms-inbound":"sms-filled","channel-sms-outbound":"sms-outgoing-filled","channel-email-inbound":"email-filled","channel-email-outbound":"email-outgoing-filled","channel-call":"handset-filled","channel-call-inbound":"incoming-call-legacy-filled","channel-callback":"outgoing-call-legacy-filled","channel-callback-v2":"outgoing-call-legacy-bold","channel-headset":"headset-filled","channel-campaign":"campaign-management-bold","channel-emoji":"emoji-happy-filled","channel-webex":"webex-app-icon-color-container","channel-fb-messenger":"social-fbmessenger-color","channel-facebook":"social-facebook-color","channel-apple-chat":"apple-business-chat-color","channel-line":"social-line-color","channel-twitter-x":"social-x","channel-viber":"social-viber-color","channel-whats-app":"social-whatsapp-color","channel-we-chat":"social-wechat-color","channel-spam":"participant-unknown-bold","channel-monitoring":"monitoring-bold","channel-work-item":"custom-task-ind-regular"}}get tabIndex(){return this._tabIndex}set tabIndex(e){const t=this._tabIndex;this._tabIndex=e,this.requestUpdate("tabIndex",t)}static get styles(){return[r.A,u.A]}isPresenceType(e){return n.e.includes(e)}get presenceLabel(){if(this.presenceAriaLabel)return this.presenceAriaLabel;const e=this.presenceType||(this.isPresenceType(this.type)?this.type:"");return y.mS[e]||""}get computedAriaLabel(){const e=this.label||this.title,t=this.presenceLabel;return e&&t?`${e}, ${t}`:t||e||void 0}firstUpdated(){const e=this.presenceType||(this.isPresenceType(this.type)?this.type:"");if(e){const{presenceColor:t,presenceIcon:i}=(0,n.E)(e,this.failurePresence,this.newMomentum);this.presenceColor=t,this.presenceIcon=i}}willUpdate(e){var t;null===(t=super.willUpdate)||void 0===t||t.call(this,e);const i=this.presenceType||(this.isPresenceType(this.type)?this.type:"");if(i&&(e.has("type")||e.has("presenceType")||e.has("newMomentum"))){const{presenceColor:e,presenceIcon:t}=(0,n.E)(i,this.failurePresence,this.newMomentum);this.presenceColor=e,this.presenceIcon=t}}updated(e){super.updated(e),e.has("role")&&this.style.setProperty("--avatar-cursor","button"===this.role?"pointer":"default")}get avatarClassMap(){return Object.assign(Object.assign({},this.newMomentum&&"bot"!==this.type||!this.type?{}:{[`md-avatar--${this.type}`]:!0}),{[`md-avatar--${this.size}`]:!!this.size,[`md-avatar--${this.color}`]:!!this.color,active:"active"===this.state})}get avatarLetterClassMap(){return{"md-decrypting":this.decrypting,[`md-avatar--${this.color}`]:this.color,"new-momentum":this.newMomentum,active:"active"===this.state}}get avatarStyleMap(){return{[`md-avatar--${this.color}`]:this.color}}get pretifyTitle(){if(this.title.length){const e=this.title.trim().split(" ");return 1===e.length?e[0].charAt(0):e[0].charAt(0)+e[e.length-1].charAt(0)}return this.title}get chatIconName(){return"chat-filled"}getIconName(e){return this.iconNameMap[e]||""}get chatIconSize(){return this.iconSize}get presenceSize(){return this.size<=24?10.5:this.size<=32?14:this.size<=48?13.94:this.size<=64?18.58:this.size<=72?20.9:this.size<=88?25.55:36}get iconSize(){return 24===this.size?"16":28===this.size?"18":32===this.size?"20":36===this.size?"22":40===this.size?"24":48===this.size?"28":56===this.size?"32":64===this.size?"36":72===this.size?"40":Math.round(this.size/1.7).toString()}get renderIsTyping(){return"typing"===this.type||this.typing?c.html` <md-loading></md-loading> `:c.nothing}get avatarLetter(){return this.title?c.html`
2
2
  <span class="md-avatar__letter ${(0,h.classMap)(this.avatarLetterClassMap)}">
3
3
  ${this.pretifyTitle}
4
4
  <slot></slot>
@@ -13,8 +13,8 @@ export const __webpack_esm_id__=4626;export const __webpack_esm_ids__=[2245,4626
13
13
  ></md-icon>
14
14
  </span>
15
15
  `}get avatarImage(){return c.html`
16
- ${(0,m.until)(this.loadImage().then(t=>(this.handleImageLoad(),c.html` ${t} `)).catch(()=>this.handleImageError()),c.html` ${this.iconName?this.avatarIcon:this.title?c.html` ${this.avatarLetter} `:c.nothing} `)}
17
- `}loadImage(){return t=this,e=void 0,i=function*(){return new Promise((t,e)=>{const a=document.createElement("img");a.src=this.src,a.alt=this.alt,a.onload=()=>t(a),a.onerror=t=>e(t),a.classList.add("md-avatar__img"),a.classList.toggle("md-avatar__img--hidden",!this.imageLoaded)})},new((a=void 0)||(a=Promise))(function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function r(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(o,r)}c((i=i.apply(t,e||[])).next())});var t,e,a,i}handleImageLoad(){this.imageLoaded=!0}handleImageError(){this.imageErrored=!0}handleKeyDown(t){if(!this.clickable)return;const{code:e}=t;(0,o.o)(e)&&this.dispatchEvent(new CustomEvent("button-keydown",{composed:!0,bubbles:!0,detail:{srcEvent:t}}))}handleClick(t){var e;this.clickable&&(null===(e=this.clickFunction)||void 0===e||e.call(this),this.dispatchEvent(new CustomEvent("button-click",{composed:!0,bubbles:!0,detail:{srcEvent:t}})))}getBrandOrDesignIconSet(t){return new Set(["webex-app-icon-color-container","social-fbmessenger-color","social-facebook-color","apple-business-chat-color","social-line-color","social-viber-color","social-x","social-whatsapp-color","social-wechat-color"]).has(t)?"momentumBrandVisuals":"momentumDesign"}get avatarContent(){return this.src&&!this.imageErrored?this.avatarImage:this.iconName?this.avatarIcon:this.title?this.avatarLetter:c.nothing}renderPresence(){return this.newMomentum&&(this.presenceType||this.type)&&"self"!==this.type&&this.presenceIcon?c.html`
16
+ ${(0,m.until)(this.loadImage().then(e=>(this.handleImageLoad(),c.html` ${e} `)).catch(()=>this.handleImageError()),c.html` ${this.iconName?this.avatarIcon:this.title?c.html` ${this.avatarLetter} `:c.nothing} `)}
17
+ `}loadImage(){return e=this,t=void 0,a=function*(){return new Promise((e,t)=>{const i=document.createElement("img");i.src=this.src,i.alt=this.alt,i.onload=()=>e(i),i.onerror=e=>t(e),i.classList.add("md-avatar__img"),i.classList.toggle("md-avatar__img--hidden",!this.imageLoaded)})},new((i=void 0)||(i=Promise))(function(n,s){function o(e){try{c(a.next(e))}catch(e){s(e)}}function r(e){try{c(a.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,r)}c((a=a.apply(e,t||[])).next())});var e,t,i,a}handleImageLoad(){this.imageLoaded=!0}handleImageError(){this.imageErrored=!0}handleKeyDown(e){if(!this.clickable)return;const{code:t}=e;(0,o.o)(t)&&this.dispatchEvent(new CustomEvent("button-keydown",{composed:!0,bubbles:!0,detail:{srcEvent:e}}))}handleClick(e){var t;this.clickable&&(null===(t=this.clickFunction)||void 0===t||t.call(this),this.dispatchEvent(new CustomEvent("button-click",{composed:!0,bubbles:!0,detail:{srcEvent:e}})))}getBrandOrDesignIconSet(e){return new Set(["webex-app-icon-color-container","social-fbmessenger-color","social-facebook-color","apple-business-chat-color","social-line-color","social-viber-color","social-x","social-whatsapp-color","social-wechat-color"]).has(e)?"momentumBrandVisuals":"momentumDesign"}get avatarContent(){return this.src&&!this.imageErrored?this.avatarImage:this.iconName?this.avatarIcon:this.title?this.avatarLetter:c.nothing}renderPresence(){return this.newMomentum&&(this.presenceType||this.type)&&"self"!==this.type&&this.presenceIcon?c.html`
18
18
  <md-presence
19
19
  class="avatar-presence"
20
20
  name="${this.presenceIcon}"
@@ -23,21 +23,22 @@ export const __webpack_esm_id__=4626;export const __webpack_esm_ids__=[2245,4626
23
23
  .failurePresence=${this.failurePresence}
24
24
  .newMomentum=${this.newMomentum}
25
25
  .avatarLinked=${!0}
26
+ aria-hidden="true"
26
27
  >
27
28
  </md-presence>
28
- `:c.nothing}renderAvatarContent(){const t=this.getIconName(this.type);if("channel-custom"===this.type)return c.html`
29
+ `:c.nothing}renderAvatarContent(){const e=this.getIconName(this.type);if("channel-custom"===this.type)return c.html`
29
30
  <span class="md-avatar__logo" data-channel-style=${this.avatarStyle} data-channel-state=${this.state}>
30
31
  <slot></slot>
31
32
  </span>
32
- `;if(t){const e=this.getBrandOrDesignIconSet(t);return c.html`
33
+ `;if(e){const t=this.getBrandOrDesignIconSet(e);return c.html`
33
34
  <span
34
35
  class="md-avatar__logo ${this.type}"
35
36
  data-channel-style=${this.avatarStyle}
36
37
  data-channel-state=${this.state}
37
38
  >
38
39
  <md-icon
39
- .name=${t}
40
- .iconSet=${e}
40
+ .name=${e}
41
+ .iconSet=${t}
41
42
  .size=${this.chatIconSize}
42
43
  color="var(--icon-color-${this.type})"
43
44
  ></md-icon>
@@ -48,10 +49,10 @@ export const __webpack_esm_id__=4626;export const __webpack_esm_ids__=[2245,4626
48
49
  class="md-avatar
49
50
  ${(0,h.classMap)(this.avatarClassMap)}"
50
51
  role=${this.role}
51
- @click=${t=>this.handleClick(t)}
52
- @keydown=${t=>this.handleKeyDown(t)}
52
+ @click=${e=>this.handleClick(e)}
53
+ @keydown=${e=>this.handleKeyDown(e)}
53
54
  tabindex=${(0,p.ifDefined)(this.tabIndex||void 0)}
54
- aria-label=${(0,p.ifDefined)(this.label)}
55
+ aria-label=${(0,p.ifDefined)(this.computedAriaLabel)}
55
56
  >
56
57
  ${"self"===this.type?c.html`
57
58
  <span class="md-avatar__self" style=${(0,d.styleMap)(this.avatarStyleMap)}>
@@ -61,4 +62,4 @@ export const __webpack_esm_id__=4626;export const __webpack_esm_ids__=[2245,4626
61
62
  ${this.hasNotification?c.html` <span class="md-avatar__notification-badge"></span> `:c.nothing}
62
63
  ${this.renderPresence()}
63
64
  </div>
64
- `}};u([(0,l.property)({type:Number,attribute:"tab-index",reflect:!0})],e.prototype,"tabIndex",null),u([(0,l.property)({type:String})],e.prototype,"alt",void 0),u([(0,l.property)({type:String})],e.prototype,"src",void 0),u([(0,l.property)({type:String})],e.prototype,"label",void 0),u([(0,l.property)({type:String})],e.prototype,"title",void 0),u([(0,l.property)({type:String})],e.prototype,"color",void 0),u([(0,l.property)({type:Boolean})],e.prototype,"decrypting",void 0),u([(0,l.property)({type:String})],e.prototype,"role",void 0),u([(0,l.property)({type:String,attribute:"icon-name"})],e.prototype,"iconName",void 0),u([(0,l.property)({type:Boolean})],e.prototype,"failurePresence",void 0),u([(0,l.property)({type:String})],e.prototype,"type",void 0),u([(0,l.property)({type:String,attribute:"presence-type"})],e.prototype,"presenceType",void 0),u([(0,l.property)({type:Boolean})],e.prototype,"newMomentum",void 0),u([(0,l.property)({type:Boolean})],e.prototype,"typing",void 0),u([(0,l.property)({type:Number})],e.prototype,"size",void 0),u([(0,l.property)({type:Boolean,attribute:"has-notification"})],e.prototype,"hasNotification",void 0),u([(0,l.property)({type:Boolean})],e.prototype,"clickable",void 0),u([(0,l.property)({attribute:!1})],e.prototype,"clickFunction",void 0),u([(0,l.property)({type:String,attribute:"avatar-style"})],e.prototype,"avatarStyle",void 0),u([(0,l.property)({type:String})],e.prototype,"state",void 0),u([(0,l.state)()],e.prototype,"imageLoaded",void 0),u([(0,l.state)()],e.prototype,"imageErrored",void 0),u([(0,l.state)()],e.prototype,"presenceColor",void 0),u([(0,l.state)()],e.prototype,"presenceIcon",void 0),e=u([(0,s.w)("md-avatar")],e),t.ELEMENT=e}(i||(i={}))}};
65
+ `}};g([(0,l.property)({type:Number,attribute:"tab-index",reflect:!0})],t.prototype,"tabIndex",null),g([(0,l.property)({type:String})],t.prototype,"alt",void 0),g([(0,l.property)({type:String})],t.prototype,"src",void 0),g([(0,l.property)({type:String})],t.prototype,"label",void 0),g([(0,l.property)({type:String})],t.prototype,"title",void 0),g([(0,l.property)({type:String})],t.prototype,"color",void 0),g([(0,l.property)({type:Boolean})],t.prototype,"decrypting",void 0),g([(0,l.property)({type:String})],t.prototype,"role",void 0),g([(0,l.property)({type:String,attribute:"icon-name"})],t.prototype,"iconName",void 0),g([(0,l.property)({type:Boolean})],t.prototype,"failurePresence",void 0),g([(0,l.property)({type:String})],t.prototype,"type",void 0),g([(0,l.property)({type:String,attribute:"presence-type"})],t.prototype,"presenceType",void 0),g([(0,l.property)({type:String,attribute:"presence-aria-label"})],t.prototype,"presenceAriaLabel",void 0),g([(0,l.property)({type:Boolean})],t.prototype,"newMomentum",void 0),g([(0,l.property)({type:Boolean})],t.prototype,"typing",void 0),g([(0,l.property)({type:Number})],t.prototype,"size",void 0),g([(0,l.property)({type:Boolean,attribute:"has-notification"})],t.prototype,"hasNotification",void 0),g([(0,l.property)({type:Boolean})],t.prototype,"clickable",void 0),g([(0,l.property)({attribute:!1})],t.prototype,"clickFunction",void 0),g([(0,l.property)({type:String,attribute:"avatar-style"})],t.prototype,"avatarStyle",void 0),g([(0,l.property)({type:String})],t.prototype,"state",void 0),g([(0,l.state)()],t.prototype,"imageLoaded",void 0),g([(0,l.state)()],t.prototype,"imageErrored",void 0),g([(0,l.state)()],t.prototype,"presenceColor",void 0),g([(0,l.state)()],t.prototype,"presenceIcon",void 0),t=g([(0,s.w)("md-avatar")],t),e.ELEMENT=t}(a||(a={}))}};