@momentum-ui/web-components 3.2.14 → 3.2.16

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 (35) hide show
  1. package/dist/2273.js +2 -2
  2. package/dist/7137.js +1 -1
  3. package/dist/9189.js +5 -4
  4. package/dist/comp/md-card-alert-entry.js +30 -34
  5. package/dist/comp/md-combobox-entry.js +2 -2
  6. package/dist/comp/md-input-entry.js +5 -4
  7. package/dist/comp/md-table-advanced-entry.js +10 -10
  8. package/dist/esm/2273.js +2 -2
  9. package/dist/esm/4654.js +2 -2
  10. package/dist/esm/7137.js +1 -1
  11. package/dist/esm/9189.js +5 -4
  12. package/dist/esm/comp/md-card-alert-entry.js +26 -30
  13. package/dist/esm/comp/md-input-entry.js +5 -4
  14. package/dist/esm/comp/md-table-advanced-entry.js +1 -1
  15. package/dist/esm/index-entry.js +32 -35
  16. package/dist/esm/index.js +1 -1
  17. package/dist/index-entry.js +147 -150
  18. package/dist/index.js +1 -1
  19. package/dist/types/[sandbox]/examples/card-alert.d.ts +0 -1
  20. package/dist/types/[sandbox]/examples/editable-field.d.ts +1 -1
  21. package/dist/types/components/avatar/Avatar.d.ts +3 -3
  22. package/dist/types/components/badge/Badge.d.ts +1 -1
  23. package/dist/types/components/button/Button.d.ts +2 -2
  24. package/dist/types/components/card-alert/CardAlert.d.ts +8 -3
  25. package/dist/types/components/card-alert/CardAlert.stories.d.ts +1 -5
  26. package/dist/types/components/chip/Chip.d.ts +3 -3
  27. package/dist/types/components/combobox/ComboBox.d.ts +4 -4
  28. package/dist/types/components/dropdown/Dropdown.d.ts +2 -2
  29. package/dist/types/components/editable-textfield/EditableTextfield.d.ts +1 -1
  30. package/dist/types/components/input/Input.d.ts +10 -6
  31. package/dist/types/components/radio/Radio.d.ts +1 -1
  32. package/dist/types/components/table-advanced/TableAdvanced.d.ts +1 -0
  33. package/dist/types/components/taskitem/TaskItem.utils.d.ts +1 -1
  34. package/dist/types/internal-components/color-table/ColorTable.d.ts +1 -1
  35. package/package.json +1 -1
package/dist/esm/2273.js CHANGED
@@ -113,7 +113,7 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
113
113
  class="md-combobox-option"
114
114
  aria-posinset=${i}
115
115
  aria-setsize=${s}
116
- role=${this.isMulti?"checkbox":"listitem"}
116
+ role=${this.isMulti?"checkbox":"option"}
117
117
  aria-label="${this.isCustomContent?this.getOptionId(t):this.getOptionValue(t)}${o}"
118
118
  tabindex="-1"
119
119
  @click=${t=>this.handleListClick(t)}
@@ -198,7 +198,7 @@ export const __webpack_esm_id__=2273;export const __webpack_esm_ids__=[2273,4654
198
198
  part="combobox-options"
199
199
  aria-label=${this.ariaLabel||this.label}
200
200
  style=${this.addStyle()}
201
- role=${(0,u.ifDefined)(this.checkForVirtualScroll()?void 0:"list")}
201
+ role=${(0,u.ifDefined)(this.checkForVirtualScroll()?void 0:"listbox")}
202
202
  >
203
203
  ${this.isMulti&&this.allowSelectAll&&this.expanded?this.getSelectAllOption():a.nothing}
204
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()}
package/dist/esm/4654.js CHANGED
@@ -113,7 +113,7 @@ export const __webpack_esm_id__=4654;export const __webpack_esm_ids__=[2273,4654
113
113
  class="md-combobox-option"
114
114
  aria-posinset=${i}
115
115
  aria-setsize=${s}
116
- role=${this.isMulti?"checkbox":"listitem"}
116
+ role=${this.isMulti?"checkbox":"option"}
117
117
  aria-label="${this.isCustomContent?this.getOptionId(t):this.getOptionValue(t)}${o}"
118
118
  tabindex="-1"
119
119
  @click=${t=>this.handleListClick(t)}
@@ -198,7 +198,7 @@ export const __webpack_esm_id__=4654;export const __webpack_esm_ids__=[2273,4654
198
198
  part="combobox-options"
199
199
  aria-label=${this.ariaLabel||this.label}
200
200
  style=${this.addStyle()}
201
- role=${(0,u.ifDefined)(this.checkForVirtualScroll()?void 0:"list")}
201
+ role=${(0,u.ifDefined)(this.checkForVirtualScroll()?void 0:"listbox")}
202
202
  >
203
203
  ${this.isMulti&&this.allowSelectAll&&this.expanded?this.getSelectAllOption():a.nothing}
204
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()}
package/dist/esm/7137.js CHANGED
@@ -1 +1 @@
1
- export const __webpack_esm_id__=7137;export const __webpack_esm_ids__=[7137];export const __webpack_esm_modules__={7137(e,r,t){t.d(r,{A:()=>a});const a=t(2927).css`:host(md-card-alert){display:block}:host(md-card-alert) .md-card-alert{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-secondary-bg-color);border:1px solid var(--md-quaternary-bg-color);border-radius:.75rem;box-shadow:0 2px 8px rgba(0,0,0,.1);gap:.75rem;padding:.75rem;width:22.9375rem}:host(md-card-alert) .md-card-alert:focus{outline:0}:host(md-card-alert) .md-card-alert-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;flex-wrap:nowrap}:host(md-card-alert) .md-card-alert-chips{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.375rem}:host(md-card-alert) .md-card-alert-timestamp{color:var(--md-secondary-text-color);font-size:.875rem;font-weight:400;flex-shrink:0}:host(md-card-alert) .md-card-alert-live{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-secondary-text-color);font-size:.875rem;font-weight:400;gap:.25rem;flex-shrink:0}:host(md-card-alert) .md-card-alert-live-icon{color:var(--md-presence-active,#16a34a);animation:live-pulse 2s ease-in-out infinite}@keyframes live-pulse{0%,100%{opacity:1}50%{opacity:.3}}:host(md-card-alert) .md-card-alert-title-section{align-content:center;align-items:flex-start;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:.125rem}:host(md-card-alert) .md-card-alert-title{color:var(--md-primary-text-color);font-size:1rem;font-weight:700;margin:0;line-height:1.5rem}:host(md-card-alert) .md-card-alert-subtitle{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-secondary-text-color);font-size:.875rem;gap:.25rem;margin:0}:host(md-card-alert) .md-card-alert-subtitle-icon{flex-shrink:0;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-details{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-background-tertiary,#f3f4f6);border-radius:.5rem;gap:.1875rem;padding:.75rem}:host(md-card-alert) .md-card-alert-details-heading{color:var(--md-secondary-text-color);font-size:.875rem;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-row{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between}:host(md-card-alert) .md-card-alert-detail-label{color:var(--md-primary-text-color);font-size:.875rem;font-weight:700;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value{color:var(--md-primary-text-color);font-size:.875rem;text-align:right;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value--highlighted{color:var(--md-alert-error-text-color,#dc2626)}:host(md-card-alert) .md-card-alert-insight{align-content:center;align-items:flex-start;display:flex;flex-flow:row nowrap;justify-content:flex-start;background:var(--card-ai-blue-bg-color,#eff6ff);border-radius:.5rem;border:1px solid var(--badge-confidence-cobalt-border-color,#dbeafe);color:var(--md-primary-text-color);gap:.5rem;padding:.625rem .75rem}:host(md-card-alert) .md-card-alert-insight-icon{color:var(--badge-status-accent-text-color,#0284c7);flex-shrink:0;margin-top:.0625rem;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-insight-text{font-size:.875rem;line-height:1.25rem}:host(md-card-alert) .md-card-alert-actions{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.5rem}`}};
1
+ export const __webpack_esm_id__=7137;export const __webpack_esm_ids__=[7137];export const __webpack_esm_modules__={7137(e,t,r){r.d(t,{A:()=>a});const a=r(2927).css`:host(md-card-alert){display:block}:host(md-card-alert) .md-card-alert{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-secondary-bg-color);border:1px solid var(--md-quaternary-bg-color);border-radius:.75rem;box-sizing:border-box;box-shadow:0 2px 8px rgba(0,0,0,.1);gap:.75rem;padding:.75rem;width:22.9375rem}:host(md-card-alert) .md-card-alert--no-insight{height:329px;max-height:329px;min-height:329px}:host(md-card-alert) .md-card-alert:focus{outline:0}:host(md-card-alert) .md-card-alert-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;flex-wrap:nowrap}:host(md-card-alert) .md-card-alert-chips{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.375rem}:host(md-card-alert) .md-card-alert-timestamp{color:var(--md-secondary-text-color);font-size:.875rem;font-weight:400;flex-shrink:0}:host(md-card-alert) .md-card-alert-title-section{align-content:center;align-items:flex-start;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:.125rem;min-width:0;width:100%}:host(md-card-alert) .md-card-alert-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;color:var(--md-primary-text-color);display:-webkit-box;font-size:1rem;font-weight:700;height:3rem;line-height:1.5rem;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:normal;width:100%}:host(md-card-alert) .md-card-alert-subtitle{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-secondary-text-color);font-size:.875rem;gap:.25rem;margin:0}:host(md-card-alert) .md-card-alert-subtitle-icon{flex-shrink:0;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-details{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-background-tertiary,#f3f4f6);border-radius:.5rem;gap:.1875rem;padding:.75rem}:host(md-card-alert) .md-card-alert-details-heading{color:var(--md-secondary-text-color);font-size:.875rem;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-row{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between}:host(md-card-alert) .md-card-alert-detail-label{color:var(--md-primary-text-color);font-size:.875rem;font-weight:700;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value{color:var(--md-primary-text-color);font-size:.875rem;text-align:right;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value--highlighted{color:var(--md-alert-error-text-color,#dc2626)}:host(md-card-alert) .md-card-alert-insight{align-content:center;align-items:flex-start;display:flex;flex-flow:row nowrap;justify-content:flex-start;background:var(--card-ai-blue-bg-color,#eff6ff);border-radius:.5rem;border:1px solid var(--badge-confidence-cobalt-border-color,#dbeafe);color:var(--md-primary-text-color);gap:.5rem;padding:.625rem .75rem}:host(md-card-alert) .md-card-alert-insight-icon{color:var(--badge-status-accent-text-color,#0284c7);flex-shrink:0;margin-top:.0625rem;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-insight-text{font-size:.875rem;line-height:1.25rem}:host(md-card-alert) .md-card-alert-actions{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.5rem}`}};
package/dist/esm/9189.js CHANGED
@@ -1,4 +1,4 @@
1
- export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];export const __webpack_esm_modules__={9189(e,t,i){i(7906),i(1821),i(2369),i(9773);var s,a=i(2900),o=i(9609),n=i(3203),r=i(4084),l=(i(9500),i(2927)),p=i(8899),d=i(4955),h=i(3517),u=i(2577),c=i(1156),m=i(9336),y=function(e,t,i,s){var a,o=arguments.length,n=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(n=(o<3?a(n):o>3?a(t,i,n):a(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,n.y)(l.LitElement)){constructor(){super(...arguments),this.ariaDescribedBy="",this.ariaInvalid="false",this.ariaLabel="",this.autofocus=!1,this.auxiliaryContentPosition=null,this.clear=!1,this.clearAriaLabel="",this.compact=!1,this.containerSize="small-12",this.disabled=!1,this.id="",this.inputSize="",this.isFilled=!1,this.isLoading=!1,this.label="",this.helpText="",this.hideMessage=!1,this.htmlId="",this.ariaRole=void 0,this.messageArr=[],this.min=void 0,this.max=void 0,this.maxLength=void 0,this.multi=!1,this.multiline=!1,this.name="",this.nestedLevel=0,this.placeholder="",this.readOnly=!1,this.required=!1,this.searchable=!1,this.secondaryLabel="",this.selectWhenInFocus=!1,this.shape="",this.type="text",this.value="",this.ariaControls="",this.ariaExpanded="",this.newMomentum=!1,this.disableUserTextInput=!1,this.autocomplete=void 0,this.showDropdown=!1,this.dropdownExpanded=!1,this.dropdownAriaLabel="Show options",this.maxSuggestedLength=void 0,this.isEditing=!1,this.hasRightSlotContent=!1,this.messageController=new t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}select(){var e;null===(e=this.input)||void 0===e||e.select()}focus(){var e;null===(e=this.input)||void 0===e||e.focus()}handleOutsideClick(e){let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||(this.input.blur(),this.isEditing=!1))}handleKeyDown(e){this.dispatchEvent(new CustomEvent("input-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleFocus(e){this.disabled||(this.isEditing=!0,this.selectWhenInFocus&&this.select(),this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleMouseDown(e){this.disabled||(this.isEditing=!0,this.dispatchEvent(new CustomEvent("input-mousedown",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleChange(e){var t;this.value=e.target.value,null===(t=this.control)||void 0===t||t.setValue(this.value),this.dispatchEvent(new CustomEvent("input-change",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:this.value}}))}handleBlur(e){var t;null===(t=this.control)||void 0===t||t.markAsTouched(),this.isEditing=!1,this.dispatchEvent(new CustomEvent("input-blur",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleClear(e){if("keydown"===e.type){const{code:t}=e;if(t!==a.Uz.Space&&t!==a.Uz.Enter)return;e.preventDefault(),e.stopPropagation()}else"click"===e.type&&(e.preventDefault(),e.stopPropagation());this.input.focus(),this.dispatchEvent(new CustomEvent("input-clear",{bubbles:!0,composed:!0,detail:{srcEvent:e}})),document.dispatchEvent(new CustomEvent("on-widget-update")),this.handleChange(e)}handleLabelClick(){this.input.focus()}handleRighSlotChange(){var e;this.hasRightSlotContent=(null===(e=this.inputSectionRightSlot)||void 0===e?void 0:e.assignedNodes().length)>0}handleDropdownClick(e){e.preventDefault(),this.dropdownExpanded=!this.dropdownExpanded,this.dispatchEvent(new CustomEvent("input-dropdown-click",{bubbles:!0,composed:!0,detail:{srcEvent:e,expanded:this.dropdownExpanded}}))}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}get inputClassMap(){return{"md-input--filled":this.isFilled,colums:!!this.containerSize,[`${this.containerSize}`]:!!this.containerSize,"md-read-only":this.readOnly,"md-disabled":this.disabled,[`md-${this.messageType}`]:!!this.messageType,[`md-input--nested-${this.nestedLevel}`]:!!this.nestedLevel,"md-multi":this.multi,"md-new-momentum":this.newMomentum}}get inputWrapperClassMap(){return{columns:!!this.inputSize,[`${this.inputSize}`]:!!this.inputSize}}get inputTemplateClassMap(){return{"md-input--multiline":this.multiline,"md-input--multi":this.multi,[`md-input--${this.shape}`]:!!this.shape,"md-input--compact":this.compact,"md-input--before":"before"===this.auxiliaryContentPosition||this.searchable,"md-input--after":"after"===this.auxiliaryContentPosition,"md-active":this.isEditing,"md-focus":this.isEditing,"md-read-only":this.readOnly,"md-disable-user-text-input":this.disableUserTextInput,"md-disabled":this.disabled,"md-dirty":!!this.value,"md-has-right-icon":this.hasRightIcon}}get ariaExpandedValue(){return"true"===this.ariaExpanded||"false"===this.ariaExpanded?this.ariaExpanded:void 0}get hasRightIcon(){return!(!this.clear||this.disabled||!this.value||this.readOnly)||!!this.showDropdown||!this.compact&&this.hasRightSlotContent}get effectiveAriaLabel(){return this.ariaLabel||this.label||void 0}inputTemplate(){var e;return this.multiline?l.html`
1
+ export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];export const __webpack_esm_modules__={9189(e,t,i){i(7906),i(1821),i(2369),i(9773);var s,o=i(2900),a=i(9609),n=i(3203),r=i(4084),l=(i(9500),i(2927)),p=i(8899),d=i(4955),h=i(3517),u=i(2577),c=i(1156),m=i(9336),y=function(e,t,i,s){var o,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(o=e[r])&&(n=(a<3?o(n):a>3?o(t,i,n):o(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,n.y)(l.LitElement)){constructor(){super(...arguments),this.ariaDescribedBy="",this.ariaInvalid="false",this.ariaLabel="",this.autofocus=!1,this.auxiliaryContentPosition=null,this.clear=!1,this.clearAriaLabel="",this.compact=!1,this.containerSize="small-12",this.disabled=!1,this.id="",this.inputSize="",this.isFilled=!1,this.isLoading=!1,this.label="",this.helpText="",this.hideMessage=!1,this.htmlId="",this.ariaRole=void 0,this.ariaAutocomplete=void 0,this.messageArr=[],this.min=void 0,this.max=void 0,this.maxLength=void 0,this.multi=!1,this.multiline=!1,this.name="",this.nestedLevel=0,this.placeholder="",this.readOnly=!1,this.required=!1,this.searchable=!1,this.secondaryLabel="",this.selectWhenInFocus=!1,this.shape="",this.type="text",this.value="",this.ariaControls="",this.ariaExpanded="",this.newMomentum=!1,this.disableUserTextInput=!1,this.autocomplete=void 0,this.showDropdown=!1,this.dropdownExpanded=!1,this.dropdownAriaLabel="Show options",this.maxSuggestedLength=void 0,this.isEditing=!1,this.hasRightSlotContent=!1,this.messageController=new t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}select(){var e;null===(e=this.input)||void 0===e||e.select()}focus(){var e;null===(e=this.input)||void 0===e||e.focus()}handleOutsideClick(e){let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||(this.input.blur(),this.isEditing=!1))}handleKeyDown(e){this.dispatchEvent(new CustomEvent("input-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleFocus(e){this.disabled||(this.isEditing=!0,this.selectWhenInFocus&&this.select(),this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleMouseDown(e){this.disabled||(this.isEditing=!0,this.dispatchEvent(new CustomEvent("input-mousedown",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleChange(e){var t;this.value=e.target.value,null===(t=this.control)||void 0===t||t.setValue(this.value),this.dispatchEvent(new CustomEvent("input-change",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:this.value}}))}handleBlur(e){var t;null===(t=this.control)||void 0===t||t.markAsTouched(),this.isEditing=!1,this.dispatchEvent(new CustomEvent("input-blur",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleClear(e){if("keydown"===e.type){const{code:t}=e;if(t!==o.Uz.Space&&t!==o.Uz.Enter)return;e.preventDefault(),e.stopPropagation()}else"click"===e.type&&(e.preventDefault(),e.stopPropagation());this.input.focus(),this.dispatchEvent(new CustomEvent("input-clear",{bubbles:!0,composed:!0,detail:{srcEvent:e}})),document.dispatchEvent(new CustomEvent("on-widget-update")),this.handleChange(e)}handleLabelClick(){this.input.focus()}handleRighSlotChange(){var e;this.hasRightSlotContent=(null===(e=this.inputSectionRightSlot)||void 0===e?void 0:e.assignedNodes().length)>0}handleDropdownClick(e){e.preventDefault(),this.dropdownExpanded=!this.dropdownExpanded,this.dispatchEvent(new CustomEvent("input-dropdown-click",{bubbles:!0,composed:!0,detail:{srcEvent:e,expanded:this.dropdownExpanded}}))}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}get inputClassMap(){return{"md-input--filled":this.isFilled,colums:!!this.containerSize,[`${this.containerSize}`]:!!this.containerSize,"md-read-only":this.readOnly,"md-disabled":this.disabled,[`md-${this.messageType}`]:!!this.messageType,[`md-input--nested-${this.nestedLevel}`]:!!this.nestedLevel,"md-multi":this.multi,"md-new-momentum":this.newMomentum}}get inputWrapperClassMap(){return{columns:!!this.inputSize,[`${this.inputSize}`]:!!this.inputSize}}get inputTemplateClassMap(){return{"md-input--multiline":this.multiline,"md-input--multi":this.multi,[`md-input--${this.shape}`]:!!this.shape,"md-input--compact":this.compact,"md-input--before":"before"===this.auxiliaryContentPosition||this.searchable,"md-input--after":"after"===this.auxiliaryContentPosition,"md-active":this.isEditing,"md-focus":this.isEditing,"md-read-only":this.readOnly,"md-disable-user-text-input":this.disableUserTextInput,"md-disabled":this.disabled,"md-dirty":!!this.value,"md-has-right-icon":this.hasRightIcon}}get ariaExpandedValue(){return"true"===this.ariaExpanded||"false"===this.ariaExpanded?this.ariaExpanded:this.showDropdown?`${this.dropdownExpanded}`:void 0}get effectiveAriaAutocomplete(){return this.ariaAutocomplete||(this.showDropdown?"both":void 0)}get effectiveAriaRole(){return this.ariaRole||(this.showDropdown?"combobox":void 0)}get hasRightIcon(){return!(!this.clear||this.disabled||!this.value||this.readOnly)||!!this.showDropdown||!this.compact&&this.hasRightSlotContent}get effectiveAriaLabel(){return this.ariaLabel||this.label||void 0}inputTemplate(){var e;return this.multiline?l.html`
2
2
  <textarea
3
3
  part="input"
4
4
  class="md-input ${(0,d.classMap)(this.inputTemplateClassMap)}"
@@ -37,14 +37,15 @@ export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];exp
37
37
  type=${this.type}
38
38
  .value=${this.value}
39
39
  aria-describedby=${this.ariaDescribedBy}
40
- aria-controls=${this.ariaControls}
40
+ aria-controls=${(0,h.ifDefined)(this.ariaControls||void 0)}
41
+ aria-autocomplete=${(0,h.ifDefined)(this.effectiveAriaAutocomplete)}
41
42
  aria-expanded=${(0,h.ifDefined)(null!==(e=this.ariaExpandedValue)&&void 0!==e?e:void 0)}
42
43
  aria-label=${(0,h.ifDefined)(this.effectiveAriaLabel)}
43
44
  aria-invalid=${this.ariaInvalid}
44
45
  aria-errormessage=${`${this.htmlId}-message`}
45
46
  aria-disabled=${(0,h.ifDefined)(this.disabled||void 0)}
46
47
  id=${this.htmlId}
47
- role=${(0,h.ifDefined)(this.ariaRole)}
48
+ role=${(0,h.ifDefined)(this.effectiveAriaRole)}
48
49
  placeholder=${this.placeholder}
49
50
  ?readonly=${this.readOnly||this.disabled||this.disableUserTextInput}
50
51
  min=${(0,h.ifDefined)(this.min)}
@@ -154,4 +155,4 @@ export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];exp
154
155
  ${this.characterCountLabelTemplate()}
155
156
  </div>
156
157
  </div>
157
- `}};y([(0,p.property)({type:String})],i.prototype,"ariaDescribedBy",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"ariaInvalid",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaLabel",void 0),y([(0,p.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,p.property)({type:String})],i.prototype,"auxiliaryContentPosition",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"clear",void 0),y([(0,p.property)({type:String})],i.prototype,"clearAriaLabel",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"compact",void 0),y([(0,p.property)({type:String})],i.prototype,"containerSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disabled",void 0),y([(0,p.property)({type:String})],i.prototype,"id",void 0),y([(0,p.property)({type:String})],i.prototype,"inputSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isFilled",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isLoading",void 0),y([(0,p.property)({type:String})],i.prototype,"label",void 0),y([(0,p.property)({type:String})],i.prototype,"helpText",void 0),y([(0,p.property)({type:Boolean,attribute:"hide-message",reflect:!0})],i.prototype,"hideMessage",void 0),y([(0,p.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaRole",void 0),y([(0,p.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"min",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"max",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxLength",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multi",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multiline",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"name",void 0),y([(0,p.property)({type:Number})],i.prototype,"nestedLevel",void 0),y([(0,p.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"readOnly",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"required",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"searchable",void 0),y([(0,p.property)({type:String})],i.prototype,"secondaryLabel",void 0),y([(0,p.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),y([(0,p.property)({type:String})],i.prototype,"shape",void 0),y([(0,p.property)({type:String})],i.prototype,"type",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"value",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaControls",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaExpanded",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,p.property)({type:Object})],i.prototype,"control",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disableUserTextInput",void 0),y([(0,p.property)({type:String})],i.prototype,"autocomplete",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"showDropdown",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"dropdownExpanded",void 0),y([(0,p.property)({type:String})],i.prototype,"dropdownAriaLabel",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxSuggestedLength",void 0),y([(0,p.query)(".md-input")],i.prototype,"input",void 0),y([(0,p.state)()],i.prototype,"isEditing",void 0),y([(0,p.query)('slot[name="input-section-right"]')],i.prototype,"inputSectionRightSlot",void 0),y([(0,p.state)()],i.prototype,"hasRightSlotContent",void 0),i=y([(0,o.w)("md-input")],i),e.ELEMENT=i}(s||(s={}))}};
158
+ `}};y([(0,p.property)({type:String})],i.prototype,"ariaDescribedBy",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"ariaInvalid",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaLabel",void 0),y([(0,p.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,p.property)({type:String})],i.prototype,"auxiliaryContentPosition",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"clear",void 0),y([(0,p.property)({type:String})],i.prototype,"clearAriaLabel",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"compact",void 0),y([(0,p.property)({type:String})],i.prototype,"containerSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disabled",void 0),y([(0,p.property)({type:String})],i.prototype,"id",void 0),y([(0,p.property)({type:String})],i.prototype,"inputSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isFilled",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isLoading",void 0),y([(0,p.property)({type:String})],i.prototype,"label",void 0),y([(0,p.property)({type:String})],i.prototype,"helpText",void 0),y([(0,p.property)({type:Boolean,attribute:"hide-message",reflect:!0})],i.prototype,"hideMessage",void 0),y([(0,p.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaRole",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaAutocomplete",void 0),y([(0,p.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"min",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"max",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxLength",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multi",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multiline",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"name",void 0),y([(0,p.property)({type:Number})],i.prototype,"nestedLevel",void 0),y([(0,p.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"readOnly",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"required",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"searchable",void 0),y([(0,p.property)({type:String})],i.prototype,"secondaryLabel",void 0),y([(0,p.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),y([(0,p.property)({type:String})],i.prototype,"shape",void 0),y([(0,p.property)({type:String})],i.prototype,"type",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"value",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaControls",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaExpanded",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,p.property)({type:Object})],i.prototype,"control",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disableUserTextInput",void 0),y([(0,p.property)({type:String})],i.prototype,"autocomplete",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"showDropdown",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"dropdownExpanded",void 0),y([(0,p.property)({type:String})],i.prototype,"dropdownAriaLabel",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxSuggestedLength",void 0),y([(0,p.query)(".md-input")],i.prototype,"input",void 0),y([(0,p.state)()],i.prototype,"isEditing",void 0),y([(0,p.query)('slot[name="input-section-right"]')],i.prototype,"inputSectionRightSlot",void 0),y([(0,p.state)()],i.prototype,"hasRightSlotContent",void 0),i=y([(0,a.w)("md-input")],i),e.ELEMENT=i}(s||(s={}))}};
@@ -1,16 +1,8 @@
1
- var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=i(4084),s=i(2927),a=i(8899),n=i(4955),l=i(7137),p=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};const d={critical:{icon:"flag-filled",color:"negative"},warning:{icon:"warning-filled",color:"warning"}},h={live:"Live",dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var c;!function(t){let e=class extends s.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.timestamp="",this.live=!1,this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!0,this.expanded=!1,this.relativeTime=""}static get styles(){return[r.A,l.A]}get severityIcon(){var t,e;return null!==(e=null===(t=d[this.severity.toLowerCase()])||void 0===t?void 0:t.icon)&&void 0!==e?e:"info-circle-filled"}get severityColor(){var t,e;return null!==(e=null===(t=d[this.severity.toLowerCase()])||void 0===t?void 0:t.color)&&void 0!==e?e:"neutral"}updateRelativeTime(){this.timestamp&&!this.live&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&!this.live&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){(t.has("timestamp")||t.has("live"))&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.constructor.locale,i=Date.now(),o="number"==typeof t?t:new Date(t).getTime();if(isNaN(o))return"";const r=i-o;if(r<0)return e.justNow;const s=Math.floor(r/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const a=Math.floor(s/60);if(a<24)return e.hoursAgo(a);const n=Math.floor(a/24);return e.daysAgo(n)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){const t=this.constructor.locale;return this.live?s.html`<span class="md-card-alert-live"
2
- ><md-icon
3
- name="active-presence-small-filled"
4
- size="10"
5
- iconSet="momentumDesign"
6
- class="md-card-alert-live-icon"
7
- ></md-icon
8
- >${t.live}</span
9
- >`:this.relativeTime?s.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:s.nothing}renderHeader(){return this.severity||this.category||this.timestamp||this.live?s.html`
1
+ var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=i(9609),s=i(4084),a=i(2927),n=i(8899),l=i(4955),p=i(7137),d=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){t.CRITICAL="critical",t.MEDIUM="medium"}(o||(o={}));const h={[o.CRITICAL]:{icon:"flag-filled",color:"negative"},[o.MEDIUM]:{icon:"warning-filled",color:"warning"}},c={dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var m;!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.timestamp="",this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!1,this.expanded=!1,this.relativeTime=""}static get styles(){return[s.A,p.A]}get normalizedSeverity(){var t;const e=(null!==(t=this.severity)&&void 0!==t?t:"").toLowerCase();return Object.values(o).includes(e)?e:void 0}get severityIcon(){return this.normalizedSeverity?h[this.normalizedSeverity].icon:"info-circle-filled"}get severityColor(){return this.normalizedSeverity?h[this.normalizedSeverity].color:"neutral"}get hasInsight(){var t;return(null!==(t=this.insight)&&void 0!==t?t:"").trim().length>0}get detailRows(){return Array.isArray(this.details)?this.details:[]}updateRelativeTime(){this.timestamp&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){t.has("timestamp")&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.constructor.locale,i=Date.now(),o="number"==typeof t?t:new Date(t).getTime();if(isNaN(o))return"";const r=i-o;if(r<0)return e.justNow;const s=Math.floor(r/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const a=Math.floor(s/60);if(a<24)return e.hoursAgo(a);const n=Math.floor(a/24);return e.daysAgo(n)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){return this.relativeTime?a.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:a.nothing}renderHeader(){return this.severity||this.category||this.timestamp?a.html`
10
2
  <div class="md-card-alert-header">
11
3
  <div class="md-card-alert-chips">
12
- ${this.severity?s.html`
13
- <md-chip value=${this.severity} color=${this.severityColor} small>
4
+ ${this.severity?a.html`
5
+ <md-chip color=${this.severityColor} small>
14
6
  <md-icon
15
7
  name=${this.severityIcon}
16
8
  size="14"
@@ -18,15 +10,15 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
18
10
  slot="custom-left-content"
19
11
  ></md-icon>
20
12
  </md-chip>
21
- `:s.nothing}
22
- ${this.category?s.html`<md-chip value=${this.category} color="neutral" small></md-chip>`:s.nothing}
13
+ `:a.nothing}
14
+ ${this.category?a.html`<md-chip value=${this.category} color="neutral" small></md-chip>`:a.nothing}
23
15
  </div>
24
16
  ${this.renderTimestamp()}
25
17
  </div>
26
- `:s.nothing}renderTitleSection(){return this.title||this.queueName?s.html`
18
+ `:a.nothing}renderTitleSection(){return this.title||this.queueName?a.html`
27
19
  <div class="md-card-alert-title-section">
28
- ${this.title?s.html`<h3 class="md-card-alert-title">${this.title}</h3>`:s.nothing}
29
- ${this.queueName?s.html`
20
+ ${this.title?a.html`<h3 class="md-card-alert-title">${this.title}</h3>`:a.nothing}
21
+ ${this.queueName?a.html`
30
22
  <p class="md-card-alert-subtitle">
31
23
  <md-icon
32
24
  name="queue-contact-bold"
@@ -36,27 +28,27 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
36
28
  ></md-icon>
37
29
  ${this.queueName}
38
30
  </p>
39
- `:s.nothing}
31
+ `:a.nothing}
40
32
  </div>
41
- `:s.nothing}renderDetails(){return this.details&&0!==this.details.length?s.html`
33
+ `:a.nothing}renderDetails(){return 0===this.detailRows.length?a.nothing:a.html`
42
34
  <div class="md-card-alert-details">
43
35
  <span class="md-card-alert-details-heading">${this.detailsHeading}</span>
44
- ${this.details.map(t=>s.html`
36
+ ${this.detailRows.map(t=>a.html`
45
37
  <div class="md-card-alert-detail-row">
46
38
  <span class="md-card-alert-detail-label">${t.label}</span>
47
39
  <span
48
- class=${(0,n.classMap)({"md-card-alert-detail-value":!0,"md-card-alert-detail-value--highlighted":!!t.highlighted})}
40
+ class=${(0,l.classMap)({"md-card-alert-detail-value":!0,"md-card-alert-detail-value--highlighted":!!t.highlighted})}
49
41
  >${t.value}</span
50
42
  >
51
43
  </div>
52
44
  `)}
53
45
  </div>
54
- `:s.nothing}renderInsight(){return this.insight?s.html`
46
+ `}renderInsight(){return this.hasInsight?a.html`
55
47
  <div class="md-card-alert-insight">
56
48
  <md-icon name="sparkle-filled" iconSet="momentumDesign" class="md-card-alert-insight-icon"></md-icon>
57
49
  <span class="md-card-alert-insight-text">${this.insight}</span>
58
50
  </div>
59
- `:s.nothing}renderActions(){return s.html`
51
+ `:a.nothing}renderActions(){return a.html`
60
52
  <div class="md-card-alert-actions">
61
53
  <md-button
62
54
  size="32"
@@ -66,13 +58,13 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
66
58
  @click=${this.handlePrimaryAction}
67
59
  >
68
60
  <span slot="text">${this.primaryActionLabel}</span>
69
- ${this.primaryActionDropdown?s.html`<md-icon
61
+ ${this.primaryActionDropdown?a.html`<md-icon
70
62
  name=${this.expanded?"arrow-up-bold":"arrow-down-bold"}
71
63
  size="12"
72
64
  iconSet="momentumDesign"
73
- ></md-icon>`:s.nothing}
65
+ ></md-icon>`:a.nothing}
74
66
  </md-button>
75
- ${this.showDismiss?s.html`
67
+ ${this.showDismiss?a.html`
76
68
  <md-button
77
69
  size="32"
78
70
  variant="secondary"
@@ -83,14 +75,18 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
83
75
  >
84
76
  <span slot="text">${this.constructor.locale.dismiss}</span>
85
77
  </md-button>
86
- `:s.nothing}
78
+ `:a.nothing}
87
79
  </div>
88
- `}render(){return s.html`
89
- <div class="md-card-alert" part="card" tabindex="0">
80
+ `}render(){return a.html`
81
+ <div
82
+ class=${(0,l.classMap)({"md-card-alert":!0,"md-card-alert--no-insight":!this.hasInsight})}
83
+ part="card"
84
+ tabindex="0"
85
+ >
90
86
  ${this.renderHeader()} ${this.renderTitleSection()} ${this.renderDetails()} ${this.renderInsight()}
91
87
  ${this.renderActions()}
92
88
  </div>
93
- `}};e.locale=Object.assign({},h),p([(0,a.property)({type:String})],e.prototype,"severity",void 0),p([(0,a.property)({type:String})],e.prototype,"category",void 0),p([(0,a.property)({type:String})],e.prototype,"timestamp",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"live",void 0),p([(0,a.property)({type:String})],e.prototype,"title",void 0),p([(0,a.property)({type:String})],e.prototype,"queueName",void 0),p([(0,a.property)({type:Array})],e.prototype,"details",void 0),p([(0,a.property)({type:String})],e.prototype,"insight",void 0),p([(0,a.property)({type:String})],e.prototype,"primaryActionLabel",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),p([(0,a.property)({type:String})],e.prototype,"detailsHeading",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"showDismiss",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"expanded",void 0),p([(0,a.state)()],e.prototype,"relativeTime",void 0),e=p([(0,o.w)("md-card-alert")],e),t.ELEMENT=e}(c||(c={}))},2583(t,e,i){i(2708),i(9613);var o,r=i(2900),s=i(9609),a=i(4084),n=i(2927),l=i(8899),p=i(4955),d=i(3517),h=i(9558),c=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:n.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:n.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:n.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?n.html`
89
+ `}};e.locale=Object.assign({},c),d([(0,n.property)({type:String})],e.prototype,"severity",void 0),d([(0,n.property)({type:String})],e.prototype,"category",void 0),d([(0,n.property)({type:String})],e.prototype,"timestamp",void 0),d([(0,n.property)({type:String})],e.prototype,"title",void 0),d([(0,n.property)({type:String})],e.prototype,"queueName",void 0),d([(0,n.property)({type:Array})],e.prototype,"details",void 0),d([(0,n.property)({type:String})],e.prototype,"insight",void 0),d([(0,n.property)({type:String})],e.prototype,"primaryActionLabel",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),d([(0,n.property)({type:String})],e.prototype,"detailsHeading",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"showDismiss",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"expanded",void 0),d([(0,n.state)()],e.prototype,"relativeTime",void 0),e=d([(0,r.w)("md-card-alert")],e),t.ELEMENT=e}(m||(m={}))},2583(t,e,i){i(2708),i(9613);var o,r=i(2900),s=i(9609),a=i(4084),n=i(2927),l=i(8899),p=i(4955),d=i(3517),h=i(9558),c=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:n.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:n.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:n.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?n.html`
94
90
  <style>
95
91
  :host .md-chip {
96
92
  ${this.renderBgColor()};
@@ -141,4 +137,4 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
141
137
  <slot name="custom-right-content" part="chip-right"> </slot>
142
138
  </span>
143
139
  </md-tooltip>
144
- `}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,r),s.exports}r.m=i,t=[],r.O=(e,i,o,s)=>{if(!i){var a=1/0;for(d=0;d<t.length;d++){for(var[i,o,s]=t[d],n=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every(t=>r.O[t](i[l]))?i.splice(l--,1):(n=!1,s<a&&(a=s));if(n){t.splice(d--,1);var p=o();void 0!==p&&(e=p)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[i,o,s]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={2583:0,8619:0},r.C=t=>{var i,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)r.o(a,i)&&(r.m[i]=a[i]);for(n&&n(r);l<s.length;l++)o=s[l],r.o(e,o)&&e[o]&&e[o][0](),e[s[l]]=0;r.O()},r.O.j=t=>0===e[t];import*as s from"../9609.js";r.C(s);import*as a from"../4084.js";r.C(a);import*as n from"../4955.js";r.C(n);import*as l from"../3517.js";r.C(l);import*as p from"../1156.js";r.C(p);import*as d from"../3305.js";r.C(d);import*as h from"../4739.js";r.C(h);import*as c from"../7154.js";r.C(c);import*as m from"../9773.js";r.C(m);import*as v from"../5983.js";r.C(v);import*as u from"../7755.js";r.C(u);import*as y from"../1821.js";r.C(y);import*as g from"../2364.js";r.C(g);import*as f from"../4980.js";r.C(f);import*as C from"../5308.js";r.C(C);import*as b from"../9938.js";r.C(b);import*as $ from"../9500.js";r.C($);import*as x from"../4781.js";r.C(x);import*as T from"../5584.js";r.C(T);import*as w from"../8227.js";r.C(w);import*as j from"../2900.js";r.C(j);import*as S from"../2050.js";r.C(S);import*as D from"../1280.js";r.C(D);import*as A from"../6343.js";r.C(A);import*as O from"../7582.js";r.C(O);import*as E from"../9613.js";r.C(E);import*as M from"../5323.js";r.C(M);import*as P from"../6631.js";r.C(P);import*as k from"../9558.js";r.C(k);import*as _ from"../2708.js";r.C(_);import*as I from"../7137.js";r.C(I);var B=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,2364,4980,5308,9938,9500,4781,5584,8227,2900,2050,1280,6343,7582,9613,5323,6631,9558,2708,7137],()=>r(4882));const W=(B=r.O(B)).v;export{W as CardAlert};
140
+ `}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,r),s.exports}r.m=i,t=[],r.O=(e,i,o,s)=>{if(!i){var a=1/0;for(d=0;d<t.length;d++){for(var[i,o,s]=t[d],n=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every(t=>r.O[t](i[l]))?i.splice(l--,1):(n=!1,s<a&&(a=s));if(n){t.splice(d--,1);var p=o();void 0!==p&&(e=p)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[i,o,s]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={2583:0,8619:0},r.C=t=>{var i,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)r.o(a,i)&&(r.m[i]=a[i]);for(n&&n(r);l<s.length;l++)o=s[l],r.o(e,o)&&e[o]&&e[o][0](),e[s[l]]=0;r.O()},r.O.j=t=>0===e[t];import*as s from"../9609.js";r.C(s);import*as a from"../4084.js";r.C(a);import*as n from"../4955.js";r.C(n);import*as l from"../3517.js";r.C(l);import*as p from"../1156.js";r.C(p);import*as d from"../3305.js";r.C(d);import*as h from"../4739.js";r.C(h);import*as c from"../7154.js";r.C(c);import*as m from"../9773.js";r.C(m);import*as y from"../5983.js";r.C(y);import*as u from"../7755.js";r.C(u);import*as v from"../1821.js";r.C(v);import*as g from"../2364.js";r.C(g);import*as f from"../4980.js";r.C(f);import*as C from"../5308.js";r.C(C);import*as b from"../9938.js";r.C(b);import*as $ from"../9500.js";r.C($);import*as x from"../4781.js";r.C(x);import*as T from"../5584.js";r.C(T);import*as w from"../8227.js";r.C(w);import*as S from"../2900.js";r.C(S);import*as j from"../2050.js";r.C(j);import*as A from"../1280.js";r.C(A);import*as D from"../6343.js";r.C(D);import*as I from"../7582.js";r.C(I);import*as M from"../9613.js";r.C(M);import*as O from"../5323.js";r.C(O);import*as E from"../6631.js";r.C(E);import*as P from"../9558.js";r.C(P);import*as k from"../2708.js";r.C(k);import*as _ from"../7137.js";r.C(_);var R=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,2364,4980,5308,9938,9500,4781,5584,8227,2900,2050,1280,6343,7582,9613,5323,6631,9558,2708,7137],()=>r(4882));const z=(R=r.O(R)).v,W=R.I;export{z as CardAlert,W as CardAlertSeverity};
@@ -1,4 +1,4 @@
1
- import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9189(e,t,i){i.d(t,{$j:()=>g,IQ:()=>v,L2:()=>b,Nl:()=>C,OU:()=>f,We:()=>w,XO:()=>x,kj:()=>$,pd:()=>S}),i(7906),i(1821),i(2369),i(9773);var s=i(2900),a=i(9609),o=i(3203),r=i(4084),l=i(9500),n=i(2927),p=i(8899),d=i(4955),h=i(3517),m=i(2577),u=i(1156),c=i(9336),y=function(e,t,i,s){var a,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(o<3?a(r):o>3?a(t,i,r):a(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};const g=["small-1","small-2","small-3","small-4","small-5","small-6","small-7","small-8","small-9","small-10","small-11","small-12","medium-1","medium-2","medium-3","medium-4","medium-5","medium-6","medium-7","medium-8","medium-9","medium-10","medium-11","medium-12","large-1","large-2","large-3","large-4","large-5","large-6","large-7","large-8","large-9","large-10","large-11","large-12"],v=["small-1","small-2","small-3","small-4","small-5","small-6","small-7","small-8","small-9","small-10","small-11","small-12","medium-1","medium-2","medium-3","medium-4","medium-5","medium-6","medium-7","medium-8","medium-9","medium-10","medium-11","medium-12","large-1","large-2","large-3","large-4","large-5","large-6","large-7","large-8","large-9","large-10","large-11","large-12"],b=["text","number","password","email","tel","checkbox"],f=["none","pill"],$=l,C=["before","after"],w=[0,1,2,3],x=["grammar","false","spelling","true"];var S;!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,o.y)(n.LitElement)){constructor(){super(...arguments),this.ariaDescribedBy="",this.ariaInvalid="false",this.ariaLabel="",this.autofocus=!1,this.auxiliaryContentPosition=null,this.clear=!1,this.clearAriaLabel="",this.compact=!1,this.containerSize="small-12",this.disabled=!1,this.id="",this.inputSize="",this.isFilled=!1,this.isLoading=!1,this.label="",this.helpText="",this.hideMessage=!1,this.htmlId="",this.ariaRole=void 0,this.messageArr=[],this.min=void 0,this.max=void 0,this.maxLength=void 0,this.multi=!1,this.multiline=!1,this.name="",this.nestedLevel=0,this.placeholder="",this.readOnly=!1,this.required=!1,this.searchable=!1,this.secondaryLabel="",this.selectWhenInFocus=!1,this.shape="",this.type="text",this.value="",this.ariaControls="",this.ariaExpanded="",this.newMomentum=!1,this.disableUserTextInput=!1,this.autocomplete=void 0,this.showDropdown=!1,this.dropdownExpanded=!1,this.dropdownAriaLabel="Show options",this.maxSuggestedLength=void 0,this.isEditing=!1,this.hasRightSlotContent=!1,this.messageController=new t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}select(){var e;null===(e=this.input)||void 0===e||e.select()}focus(){var e;null===(e=this.input)||void 0===e||e.focus()}handleOutsideClick(e){let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||(this.input.blur(),this.isEditing=!1))}handleKeyDown(e){this.dispatchEvent(new CustomEvent("input-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleFocus(e){this.disabled||(this.isEditing=!0,this.selectWhenInFocus&&this.select(),this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleMouseDown(e){this.disabled||(this.isEditing=!0,this.dispatchEvent(new CustomEvent("input-mousedown",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleChange(e){var t;this.value=e.target.value,null===(t=this.control)||void 0===t||t.setValue(this.value),this.dispatchEvent(new CustomEvent("input-change",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:this.value}}))}handleBlur(e){var t;null===(t=this.control)||void 0===t||t.markAsTouched(),this.isEditing=!1,this.dispatchEvent(new CustomEvent("input-blur",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleClear(e){if("keydown"===e.type){const{code:t}=e;if(t!==s.Uz.Space&&t!==s.Uz.Enter)return;e.preventDefault(),e.stopPropagation()}else"click"===e.type&&(e.preventDefault(),e.stopPropagation());this.input.focus(),this.dispatchEvent(new CustomEvent("input-clear",{bubbles:!0,composed:!0,detail:{srcEvent:e}})),document.dispatchEvent(new CustomEvent("on-widget-update")),this.handleChange(e)}handleLabelClick(){this.input.focus()}handleRighSlotChange(){var e;this.hasRightSlotContent=(null===(e=this.inputSectionRightSlot)||void 0===e?void 0:e.assignedNodes().length)>0}handleDropdownClick(e){e.preventDefault(),this.dropdownExpanded=!this.dropdownExpanded,this.dispatchEvent(new CustomEvent("input-dropdown-click",{bubbles:!0,composed:!0,detail:{srcEvent:e,expanded:this.dropdownExpanded}}))}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}get inputClassMap(){return{"md-input--filled":this.isFilled,colums:!!this.containerSize,[`${this.containerSize}`]:!!this.containerSize,"md-read-only":this.readOnly,"md-disabled":this.disabled,[`md-${this.messageType}`]:!!this.messageType,[`md-input--nested-${this.nestedLevel}`]:!!this.nestedLevel,"md-multi":this.multi,"md-new-momentum":this.newMomentum}}get inputWrapperClassMap(){return{columns:!!this.inputSize,[`${this.inputSize}`]:!!this.inputSize}}get inputTemplateClassMap(){return{"md-input--multiline":this.multiline,"md-input--multi":this.multi,[`md-input--${this.shape}`]:!!this.shape,"md-input--compact":this.compact,"md-input--before":"before"===this.auxiliaryContentPosition||this.searchable,"md-input--after":"after"===this.auxiliaryContentPosition,"md-active":this.isEditing,"md-focus":this.isEditing,"md-read-only":this.readOnly,"md-disable-user-text-input":this.disableUserTextInput,"md-disabled":this.disabled,"md-dirty":!!this.value,"md-has-right-icon":this.hasRightIcon}}get ariaExpandedValue(){return"true"===this.ariaExpanded||"false"===this.ariaExpanded?this.ariaExpanded:void 0}get hasRightIcon(){return!(!this.clear||this.disabled||!this.value||this.readOnly)||!!this.showDropdown||!this.compact&&this.hasRightSlotContent}get effectiveAriaLabel(){return this.ariaLabel||this.label||void 0}inputTemplate(){var e;return this.multiline?n.html`
1
+ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9189(e,t,i){i.d(t,{$j:()=>v,IQ:()=>g,L2:()=>b,Nl:()=>C,OU:()=>f,We:()=>w,XO:()=>x,kj:()=>$,pd:()=>S}),i(7906),i(1821),i(2369),i(9773);var s=i(2900),a=i(9609),o=i(3203),r=i(4084),l=i(9500),n=i(2927),p=i(8899),d=i(4955),h=i(3517),m=i(2577),u=i(1156),c=i(9336),y=function(e,t,i,s){var a,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(o<3?a(r):o>3?a(t,i,r):a(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};const v=["small-1","small-2","small-3","small-4","small-5","small-6","small-7","small-8","small-9","small-10","small-11","small-12","medium-1","medium-2","medium-3","medium-4","medium-5","medium-6","medium-7","medium-8","medium-9","medium-10","medium-11","medium-12","large-1","large-2","large-3","large-4","large-5","large-6","large-7","large-8","large-9","large-10","large-11","large-12"],g=["small-1","small-2","small-3","small-4","small-5","small-6","small-7","small-8","small-9","small-10","small-11","small-12","medium-1","medium-2","medium-3","medium-4","medium-5","medium-6","medium-7","medium-8","medium-9","medium-10","medium-11","medium-12","large-1","large-2","large-3","large-4","large-5","large-6","large-7","large-8","large-9","large-10","large-11","large-12"],b=["text","number","password","email","tel","checkbox"],f=["none","pill"],$=l,C=["before","after"],w=[0,1,2,3],x=["grammar","false","spelling","true"];var S;!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,o.y)(n.LitElement)){constructor(){super(...arguments),this.ariaDescribedBy="",this.ariaInvalid="false",this.ariaLabel="",this.autofocus=!1,this.auxiliaryContentPosition=null,this.clear=!1,this.clearAriaLabel="",this.compact=!1,this.containerSize="small-12",this.disabled=!1,this.id="",this.inputSize="",this.isFilled=!1,this.isLoading=!1,this.label="",this.helpText="",this.hideMessage=!1,this.htmlId="",this.ariaRole=void 0,this.ariaAutocomplete=void 0,this.messageArr=[],this.min=void 0,this.max=void 0,this.maxLength=void 0,this.multi=!1,this.multiline=!1,this.name="",this.nestedLevel=0,this.placeholder="",this.readOnly=!1,this.required=!1,this.searchable=!1,this.secondaryLabel="",this.selectWhenInFocus=!1,this.shape="",this.type="text",this.value="",this.ariaControls="",this.ariaExpanded="",this.newMomentum=!1,this.disableUserTextInput=!1,this.autocomplete=void 0,this.showDropdown=!1,this.dropdownExpanded=!1,this.dropdownAriaLabel="Show options",this.maxSuggestedLength=void 0,this.isEditing=!1,this.hasRightSlotContent=!1,this.messageController=new t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}select(){var e;null===(e=this.input)||void 0===e||e.select()}focus(){var e;null===(e=this.input)||void 0===e||e.focus()}handleOutsideClick(e){let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||(this.input.blur(),this.isEditing=!1))}handleKeyDown(e){this.dispatchEvent(new CustomEvent("input-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleFocus(e){this.disabled||(this.isEditing=!0,this.selectWhenInFocus&&this.select(),this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleMouseDown(e){this.disabled||(this.isEditing=!0,this.dispatchEvent(new CustomEvent("input-mousedown",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleChange(e){var t;this.value=e.target.value,null===(t=this.control)||void 0===t||t.setValue(this.value),this.dispatchEvent(new CustomEvent("input-change",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:this.value}}))}handleBlur(e){var t;null===(t=this.control)||void 0===t||t.markAsTouched(),this.isEditing=!1,this.dispatchEvent(new CustomEvent("input-blur",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleClear(e){if("keydown"===e.type){const{code:t}=e;if(t!==s.Uz.Space&&t!==s.Uz.Enter)return;e.preventDefault(),e.stopPropagation()}else"click"===e.type&&(e.preventDefault(),e.stopPropagation());this.input.focus(),this.dispatchEvent(new CustomEvent("input-clear",{bubbles:!0,composed:!0,detail:{srcEvent:e}})),document.dispatchEvent(new CustomEvent("on-widget-update")),this.handleChange(e)}handleLabelClick(){this.input.focus()}handleRighSlotChange(){var e;this.hasRightSlotContent=(null===(e=this.inputSectionRightSlot)||void 0===e?void 0:e.assignedNodes().length)>0}handleDropdownClick(e){e.preventDefault(),this.dropdownExpanded=!this.dropdownExpanded,this.dispatchEvent(new CustomEvent("input-dropdown-click",{bubbles:!0,composed:!0,detail:{srcEvent:e,expanded:this.dropdownExpanded}}))}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}get inputClassMap(){return{"md-input--filled":this.isFilled,colums:!!this.containerSize,[`${this.containerSize}`]:!!this.containerSize,"md-read-only":this.readOnly,"md-disabled":this.disabled,[`md-${this.messageType}`]:!!this.messageType,[`md-input--nested-${this.nestedLevel}`]:!!this.nestedLevel,"md-multi":this.multi,"md-new-momentum":this.newMomentum}}get inputWrapperClassMap(){return{columns:!!this.inputSize,[`${this.inputSize}`]:!!this.inputSize}}get inputTemplateClassMap(){return{"md-input--multiline":this.multiline,"md-input--multi":this.multi,[`md-input--${this.shape}`]:!!this.shape,"md-input--compact":this.compact,"md-input--before":"before"===this.auxiliaryContentPosition||this.searchable,"md-input--after":"after"===this.auxiliaryContentPosition,"md-active":this.isEditing,"md-focus":this.isEditing,"md-read-only":this.readOnly,"md-disable-user-text-input":this.disableUserTextInput,"md-disabled":this.disabled,"md-dirty":!!this.value,"md-has-right-icon":this.hasRightIcon}}get ariaExpandedValue(){return"true"===this.ariaExpanded||"false"===this.ariaExpanded?this.ariaExpanded:this.showDropdown?`${this.dropdownExpanded}`:void 0}get effectiveAriaAutocomplete(){return this.ariaAutocomplete||(this.showDropdown?"both":void 0)}get effectiveAriaRole(){return this.ariaRole||(this.showDropdown?"combobox":void 0)}get hasRightIcon(){return!(!this.clear||this.disabled||!this.value||this.readOnly)||!!this.showDropdown||!this.compact&&this.hasRightSlotContent}get effectiveAriaLabel(){return this.ariaLabel||this.label||void 0}inputTemplate(){var e;return this.multiline?n.html`
2
2
  <textarea
3
3
  part="input"
4
4
  class="md-input ${(0,d.classMap)(this.inputTemplateClassMap)}"
@@ -37,14 +37,15 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9
37
37
  type=${this.type}
38
38
  .value=${this.value}
39
39
  aria-describedby=${this.ariaDescribedBy}
40
- aria-controls=${this.ariaControls}
40
+ aria-controls=${(0,h.ifDefined)(this.ariaControls||void 0)}
41
+ aria-autocomplete=${(0,h.ifDefined)(this.effectiveAriaAutocomplete)}
41
42
  aria-expanded=${(0,h.ifDefined)(null!==(e=this.ariaExpandedValue)&&void 0!==e?e:void 0)}
42
43
  aria-label=${(0,h.ifDefined)(this.effectiveAriaLabel)}
43
44
  aria-invalid=${this.ariaInvalid}
44
45
  aria-errormessage=${`${this.htmlId}-message`}
45
46
  aria-disabled=${(0,h.ifDefined)(this.disabled||void 0)}
46
47
  id=${this.htmlId}
47
- role=${(0,h.ifDefined)(this.ariaRole)}
48
+ role=${(0,h.ifDefined)(this.effectiveAriaRole)}
48
49
  placeholder=${this.placeholder}
49
50
  ?readonly=${this.readOnly||this.disabled||this.disableUserTextInput}
50
51
  min=${(0,h.ifDefined)(this.min)}
@@ -154,4 +155,4 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9
154
155
  ${this.characterCountLabelTemplate()}
155
156
  </div>
156
157
  </div>
157
- `}};y([(0,p.property)({type:String})],i.prototype,"ariaDescribedBy",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"ariaInvalid",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaLabel",void 0),y([(0,p.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,p.property)({type:String})],i.prototype,"auxiliaryContentPosition",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"clear",void 0),y([(0,p.property)({type:String})],i.prototype,"clearAriaLabel",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"compact",void 0),y([(0,p.property)({type:String})],i.prototype,"containerSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disabled",void 0),y([(0,p.property)({type:String})],i.prototype,"id",void 0),y([(0,p.property)({type:String})],i.prototype,"inputSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isFilled",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isLoading",void 0),y([(0,p.property)({type:String})],i.prototype,"label",void 0),y([(0,p.property)({type:String})],i.prototype,"helpText",void 0),y([(0,p.property)({type:Boolean,attribute:"hide-message",reflect:!0})],i.prototype,"hideMessage",void 0),y([(0,p.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaRole",void 0),y([(0,p.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"min",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"max",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxLength",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multi",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multiline",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"name",void 0),y([(0,p.property)({type:Number})],i.prototype,"nestedLevel",void 0),y([(0,p.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"readOnly",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"required",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"searchable",void 0),y([(0,p.property)({type:String})],i.prototype,"secondaryLabel",void 0),y([(0,p.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),y([(0,p.property)({type:String})],i.prototype,"shape",void 0),y([(0,p.property)({type:String})],i.prototype,"type",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"value",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaControls",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaExpanded",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,p.property)({type:Object})],i.prototype,"control",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disableUserTextInput",void 0),y([(0,p.property)({type:String})],i.prototype,"autocomplete",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"showDropdown",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"dropdownExpanded",void 0),y([(0,p.property)({type:String})],i.prototype,"dropdownAriaLabel",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxSuggestedLength",void 0),y([(0,p.query)(".md-input")],i.prototype,"input",void 0),y([(0,p.state)()],i.prototype,"isEditing",void 0),y([(0,p.query)('slot[name="input-section-right"]')],i.prototype,"inputSectionRightSlot",void 0),y([(0,p.state)()],i.prototype,"hasRightSlotContent",void 0),i=y([(0,a.w)("md-input")],i),e.ELEMENT=i}(S||(S={}))},9500(t){t.exports=e}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return s[e](i,i.exports,o),i.exports}o.m=s,t=[],o.O=(e,i,s,a)=>{if(!i){var r=1/0;for(d=0;d<t.length;d++){for(var[i,s,a]=t[d],l=!0,n=0;n<i.length;n++)(!1&a||r>=a)&&Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):(l=!1,a<r&&(r=a));if(l){t.splice(d--,1);var p=s();void 0!==p&&(e=p)}}return e}a=a||0;for(var d=t.length;d>0&&t[d-1][2]>a;d--)t[d]=t[d-1];t[d]=[i,s,a]},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{o as __webpack_require__};i={1266:0,7119:0,9189:0,9500:0},o.C=e=>{var t,s,{__webpack_esm_ids__:a,__webpack_esm_modules__:r,__webpack_esm_runtime__:l}=e,n=0;for(t in r)o.o(r,t)&&(o.m[t]=r[t]);for(l&&l(o);n<a.length;n++)s=a[n],o.o(i,s)&&i[s]&&i[s][0](),i[a[n]]=0;o.O()},o.O.j=e=>0===i[e];import*as r from"../9609.js";o.C(r);import*as l from"../4084.js";o.C(l);import*as n from"../4955.js";o.C(n);import*as p from"../3517.js";o.C(p);import*as d from"../1156.js";o.C(d);import*as h from"../3305.js";o.C(h);import*as m from"../4739.js";o.C(m);import*as u from"../7154.js";o.C(u);import*as c from"../9773.js";o.C(c);import*as y from"../5983.js";o.C(y);import*as g from"../7755.js";o.C(g);import*as v from"../1821.js";o.C(v);import*as b from"../4980.js";o.C(b);import*as f from"../5308.js";o.C(f);import*as $ from"../519.js";o.C($);import*as C from"../4137.js";o.C(C);import*as w from"../2577.js";o.C(w);import*as x from"../8441.js";o.C(x);import*as S from"../2797.js";o.C(S);import*as L from"../9983.js";o.C(L);import*as E from"../3970.js";o.C(E);import*as T from"../7906.js";o.C(T);import*as _ from"../9336.js";o.C(_);import*as M from"../2369.js";o.C(M);var D=o.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,4980,5308,519,4137,2577,8441,2797,9983,3970,7906,9336,2369],()=>o(9189));const j=(D=o.O(D)).pd,B=D.XO,k=D.$j,O=D.kj,I=D.Nl,R=D.OU,A=D.IQ,z=D.L2,P=D.We;export{j as Input,B as ariaInvalidType,k as containerSize,O as iconNames,I as iconPosition,R as inputShape,A as inputSize,z as inputType,P as nestedLevel};
158
+ `}};y([(0,p.property)({type:String})],i.prototype,"ariaDescribedBy",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"ariaInvalid",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaLabel",void 0),y([(0,p.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,p.property)({type:String})],i.prototype,"auxiliaryContentPosition",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"clear",void 0),y([(0,p.property)({type:String})],i.prototype,"clearAriaLabel",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"compact",void 0),y([(0,p.property)({type:String})],i.prototype,"containerSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disabled",void 0),y([(0,p.property)({type:String})],i.prototype,"id",void 0),y([(0,p.property)({type:String})],i.prototype,"inputSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isFilled",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isLoading",void 0),y([(0,p.property)({type:String})],i.prototype,"label",void 0),y([(0,p.property)({type:String})],i.prototype,"helpText",void 0),y([(0,p.property)({type:Boolean,attribute:"hide-message",reflect:!0})],i.prototype,"hideMessage",void 0),y([(0,p.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaRole",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaAutocomplete",void 0),y([(0,p.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"min",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"max",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxLength",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multi",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multiline",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"name",void 0),y([(0,p.property)({type:Number})],i.prototype,"nestedLevel",void 0),y([(0,p.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"readOnly",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"required",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"searchable",void 0),y([(0,p.property)({type:String})],i.prototype,"secondaryLabel",void 0),y([(0,p.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),y([(0,p.property)({type:String})],i.prototype,"shape",void 0),y([(0,p.property)({type:String})],i.prototype,"type",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"value",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaControls",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaExpanded",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,p.property)({type:Object})],i.prototype,"control",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disableUserTextInput",void 0),y([(0,p.property)({type:String})],i.prototype,"autocomplete",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"showDropdown",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"dropdownExpanded",void 0),y([(0,p.property)({type:String})],i.prototype,"dropdownAriaLabel",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxSuggestedLength",void 0),y([(0,p.query)(".md-input")],i.prototype,"input",void 0),y([(0,p.state)()],i.prototype,"isEditing",void 0),y([(0,p.query)('slot[name="input-section-right"]')],i.prototype,"inputSectionRightSlot",void 0),y([(0,p.state)()],i.prototype,"hasRightSlotContent",void 0),i=y([(0,a.w)("md-input")],i),e.ELEMENT=i}(S||(S={}))},9500(t){t.exports=e}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return s[e](i,i.exports,o),i.exports}o.m=s,t=[],o.O=(e,i,s,a)=>{if(!i){var r=1/0;for(d=0;d<t.length;d++){for(var[i,s,a]=t[d],l=!0,n=0;n<i.length;n++)(!1&a||r>=a)&&Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):(l=!1,a<r&&(r=a));if(l){t.splice(d--,1);var p=s();void 0!==p&&(e=p)}}return e}a=a||0;for(var d=t.length;d>0&&t[d-1][2]>a;d--)t[d]=t[d-1];t[d]=[i,s,a]},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{o as __webpack_require__};i={1266:0,7119:0,9189:0,9500:0},o.C=e=>{var t,s,{__webpack_esm_ids__:a,__webpack_esm_modules__:r,__webpack_esm_runtime__:l}=e,n=0;for(t in r)o.o(r,t)&&(o.m[t]=r[t]);for(l&&l(o);n<a.length;n++)s=a[n],o.o(i,s)&&i[s]&&i[s][0](),i[a[n]]=0;o.O()},o.O.j=e=>0===i[e];import*as r from"../9609.js";o.C(r);import*as l from"../4084.js";o.C(l);import*as n from"../4955.js";o.C(n);import*as p from"../3517.js";o.C(p);import*as d from"../1156.js";o.C(d);import*as h from"../3305.js";o.C(h);import*as m from"../4739.js";o.C(m);import*as u from"../7154.js";o.C(u);import*as c from"../9773.js";o.C(c);import*as y from"../5983.js";o.C(y);import*as v from"../7755.js";o.C(v);import*as g from"../1821.js";o.C(g);import*as b from"../4980.js";o.C(b);import*as f from"../5308.js";o.C(f);import*as $ from"../519.js";o.C($);import*as C from"../4137.js";o.C(C);import*as w from"../2577.js";o.C(w);import*as x from"../8441.js";o.C(x);import*as S from"../2797.js";o.C(S);import*as E from"../9983.js";o.C(E);import*as L from"../3970.js";o.C(L);import*as T from"../7906.js";o.C(T);import*as _ from"../9336.js";o.C(_);import*as D from"../2369.js";o.C(D);var M=o.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,4980,5308,519,4137,2577,8441,2797,9983,3970,7906,9336,2369],()=>o(9189));const j=(M=o.O(M)).pd,B=M.XO,k=M.$j,O=M.kj,A=M.Nl,I=M.OU,R=M.IQ,z=M.L2,P=M.We;export{j as Input,B as ariaInvalidType,k as containerSize,O as iconNames,A as iconPosition,I as inputShape,R as inputSize,z as inputType,P as nestedLevel};
@@ -1,4 +1,4 @@
1
- var t,e,i={7936(t,e,i){i.d(e,{v:()=>v}),i(5983),i(1821),i(708);var o=i(9609),s=i(9938),r=i(4084),a=i(2927),l=i(8899),n=i(4955),d=i(3517),h=i(7638),c=i(6897),p=i(4841),m=i(597),g=i(9125),u=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const f=document.createElement("img");var v;f.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(t){let e=class extends((0,s.d)(a.LitElement)){constructor(){super(...arguments),this.isRowFocusable="true",this.error="",this.COLS=[],this.ROWS=[],this.updCols=()=>this.requestUpdate("COLS"),this.updRows=()=>this.requestUpdate("ROWS"),this.dragRow=-1,this.dropRow=-1,this.drops=[],this.dragRowElem=null,this.dragCol=-1,this.dropCol=-1,this.isResizing=!1,this.isSelectable=!1,this.selected={},this.expandedRowIdx={},this.dragover=t=>t.preventDefault(),this.eX=0,this.onResize=(t,e)=>{var i;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const o=t.target;null===(i=t.dataTransfer)||void 0===i||i.setDragImage(f,0,0);const s=this.COLS.map(t=>this.shadowRoot.querySelector(`th.col-index-${t.index}`));this.COLS.forEach((t,e)=>t.width=s[e].offsetWidth+"px"),this.updCols();const r=t.x;this.eX=t.x;let a=-1,l=-1,n=-1;const d=this.COLS[e.index-1],h=s[e.index],c=s[e.index-1],p=h.offsetWidth,m=c.offsetWidth,g=()=>{const t=this.eX;if(a!=t&&0!=t){a=t;const i=a-r;l=p-i,n=m+i,e.width=l+"px",d.width=n+"px",this.updCols()}},u=t=>this.eX=t.x,v=()=>{this.isResizing=!1,o.removeEventListener("drag",g),o.removeEventListener("dragend",v),document.removeEventListener("dragover",u)};o.addEventListener("drag",g),o.addEventListener("dragend",v),document.addEventListener("dragover",u)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}update(t){super.update(t),t.has("data")&&(this.updateTableData(),this.updateDataInTable())}updateTableData(){if("string"==typeof this.data)try{this.tableData=JSON.parse(this.data)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the config json")}else this.tableData=Object.assign({},this.data)}updateTableConfig(){if("string"==typeof this.config)try{this.tableConfig=JSON.parse(this.config)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the data json")}else this.tableConfig=Object.assign({},this.config)}populateColumns(){var t;let e=0;const i=(t,i)=>{var o,s,r,a;const l=t.filters||(null===(s=null===(o=this.tableConfig.default)||void 0===o?void 0:o.col)||void 0===s?void 0:s.filters),n=l?"forString"==l?g.d.optionsString:"forNumber"==l?g.d.optionsNumber:l.length?l:null:null;this.COLS.push({options:Object.assign({},t),index:e++,group:i,sort:"default",sorter:t.sorter||(null===(a=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===a?void 0:a.sorter),isCollapsable:this.tableConfig.cols.collapse==t.id,filter:n?{list:n,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(t=>{"children"in t?t.children.forEach(e=>i(e,{name:t.groupName,length:t.children.length})):i(t)}),this.isSelectable=!!this.tableConfig.rows&&"none"!=(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)}populateData(){const t=this.COLS.length;if("csv"in this.tableData){const t=c.default.parse(this.tableData.csv,{skipEmptyLines:!0,transform:t=>t.trim()});if(t.errors)return void(this.error="PARSE ERROR:\n"+JSON.stringify(t.errors,null,2));{const e=t.data;this.ROWS=e.map(t=>t.map(t=>({text:t})))}}else if("list2d"in this.tableData)this.ROWS=this.tableData.list2d.map(t=>t.map(t=>({text:t})));else{for(;this.tableData.list.length>t;)this.ROWS.push(this.tableData.list.splice(0,t).map(t=>({text:t})));0!=this.tableData.list.length&&this.ROWS.push(this.tableData.list.map(t=>({text:t})))}0!=this.ROWS.length||(this.error="DATA ERROR: Data is empty")}validateData(){const t=this.COLS.length;this.ROWS.reduce((t,e)=>t+e.length,0)%t==0?this.ROWS.forEach((e,i)=>{const o=e.length;o!=t&&(this.error=`DATA ERROR: Total number of cols (=${t}) and data[${i}] length (=${o}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const t=this.tableConfig.cellTemplates,e=Object.keys(t||{});t&&e.length&&this.ROWS.forEach((e,i)=>{e.forEach((e,o)=>{for(const s in t){const r=e.text.indexOf(s);if(-1!=r){const a=t[s],l=this.querySelector(`#${a.templateName}`);if(null==l){console.warn(`cellTemplates["${s}"]: Missing '${a.templateName}' template.`);continue}let n=e.text.replace(s,"");a.contentCb&&(n=a.contentCb({col:o,row:i,content:n,insertIndex:r})),this.ROWS[i][o]={text:n,template:{template:l,templateCb:a.templateCb,insertIndex:"replace"==a.contentUse?-1:r}};break}}})})}setDefaultFilterAndSort(){var t,e;const i=null===(t=this.tableConfig.default)||void 0===t?void 0:t.sort;if(i){const t=this.COLS.find(t=>t.options.id==i.colId);t?this.sort(t,i.order):console.warn(`Cant find ${i.colId} col - for sorting`)}const o=null===(e=this.tableConfig.default)||void 0===e?void 0:e.filter;if(o){const t=this.COLS.find(t=>t.options.id==o.colId);t?t.filter?(t.filter.selectedIndex=o.selectedIndex,t.filter.input=o.input,this.updCols(),this.filter(t)):console.warn(`Cant find filters on ${o.colId} col`):console.warn(`Cant find ${o.colId} col - for filtering`)}}populateTable(){this.populateColumns(),this.populateData(),this.validateData(),this.setDefaultFilterAndSort(),this.populateTemplate()}updateDataInTable(){this.populateData(),this.validateData(),this.populateTemplate()}onDropRow(){this.dragRow!=this.dropRow&&this.drops.push([this.dragRow,this.dropRow]),this.dragRow=-1,this.dropRow=-1,this.dragRowElem&&(this.dragRowElem.setAttribute("draggable","false"),this.dragRowElem=null)}onDropCol(){if(this.dragCol!=this.dropCol){const t=this.COLS[this.dragCol],e=this.COLS[this.dropCol],i=t.group,o=e.group,s=t.index,r=e.index;t.group=o,e.group=i,t.index=r,e.index=s,this.COLS[this.dragCol]=e,this.COLS[this.dropCol]=t,this.ROWS.forEach(t=>{const e=t[this.dragCol],i=t[this.dropCol];t[this.dragCol]=i,t[this.dropCol]=e}),this.updCols(),this.updRows()}this.dragCol=-1,this.dropCol=-1}sort(t,e){t.sorter&&(this.clearSelection(),this.drops=[],this.COLS.forEach(i=>{i.options.id==t.options.id?i.sort=e||("default"==i.sort?"ascending":"ascending"==i.sort?"descending":"default"):i.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:t.sort}))}filter(t){if(!t.filter)return;this.clearSelection(),this.drops=[];const e=t.filter.input.trim(),i=t.filter.list[t.filter.selectedIndex];t.filter.active=!!e,this.requestUpdate(),e?this["md-table-advanced-change"].emit({type:"filter-on",filter:i,input:e}):this["md-table-advanced-change"].emit({type:"filter-off",filter:t.filter.list[t.filter.selectedIndex]})}selectRow(t){var e;const i=t.row.idx,o=Object.prototype.hasOwnProperty.call(this.selected,i);"multiple"==(null===(e=this.tableConfig.rows)||void 0===e?void 0:e.selectable)?(t.metaKey?o?delete this.selected[i]:this.selected[i]=!0:t.shiftKey||(this.selected={[i]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(t=>+t)})):o?this.clearSelection():(this.selected={[i]:!0},this["md-table-advanced-change"].emit({type:"select",index:i})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(t,e){t.stopPropagation(),this.expandedRowIdx[e]?(delete this.expandedRowIdx[e],this["md-table-advanced-change"].emit({type:"collapse",row:e})):(this.expandedRowIdx[e]=!0,this["md-table-advanced-change"].emit({type:"expand",row:e})),this.clearSelection(),this.requestUpdate()}render(){if(this.error)return a.html` <div>${this.error}</div> `;const{head:t}=this.tableConfig,e=(0,n.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return a.html`
1
+ var t,e,i={7936(t,e,i){i.d(e,{v:()=>v}),i(5983),i(1821),i(708);var o=i(9609),s=i(9938),r=i(4084),a=i(2927),l=i(8899),n=i(4955),d=i(3517),h=i(7638),c=i(6897),p=i(4841),m=i(597),g=i(9125),u=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const f=document.createElement("img");var v;f.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(t){let e=class extends((0,s.d)(a.LitElement)){constructor(){super(...arguments),this.isRowFocusable="true",this.error="",this.COLS=[],this.ROWS=[],this.updCols=()=>this.requestUpdate("COLS"),this.updRows=()=>this.requestUpdate("ROWS"),this.dragRow=-1,this.dropRow=-1,this.drops=[],this.dragRowElem=null,this.dragCol=-1,this.dropCol=-1,this.isResizing=!1,this.isSelectable=!1,this.selected={},this.expandedRowIdx={},this.dragover=t=>t.preventDefault(),this.eX=0,this.onResize=(t,e)=>{var i;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const o=t.target;null===(i=t.dataTransfer)||void 0===i||i.setDragImage(f,0,0);const s=this.COLS.map(t=>this.shadowRoot.querySelector(`th.col-index-${t.index}`));this.COLS.forEach((t,e)=>t.width=s[e].offsetWidth+"px"),this.updCols();const r=t.x;this.eX=t.x;let a=-1,l=-1,n=-1;const d=this.COLS[e.index-1],h=s[e.index],c=s[e.index-1],p=h.offsetWidth,m=c.offsetWidth,g=()=>{const t=this.eX;if(a!=t&&0!=t){a=t;const i=a-r;l=p-i,n=m+i,e.width=l+"px",d.width=n+"px",this.updCols()}},u=t=>this.eX=t.x,v=()=>{this.isResizing=!1,o.removeEventListener("drag",g),o.removeEventListener("dragend",v),document.removeEventListener("dragover",u)};o.addEventListener("drag",g),o.addEventListener("dragend",v),document.addEventListener("dragover",u)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}willUpdate(t){var e;null===(e=super.willUpdate)||void 0===e||e.call(this,t),t.has("data")&&void 0!==t.get("data")&&(this.error="")}update(t){super.update(t),t.has("data")&&(this.updateTableData(),this.updateDataInTable())}updateTableData(){if("string"==typeof this.data)try{this.tableData=JSON.parse(this.data)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the config json")}else this.tableData=Object.assign({},this.data)}updateTableConfig(){if("string"==typeof this.config)try{this.tableConfig=JSON.parse(this.config)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the data json")}else this.tableConfig=Object.assign({},this.config)}populateColumns(){var t;let e=0;const i=(t,i)=>{var o,s,r,a;const l=t.filters||(null===(s=null===(o=this.tableConfig.default)||void 0===o?void 0:o.col)||void 0===s?void 0:s.filters),n=l?"forString"==l?g.d.optionsString:"forNumber"==l?g.d.optionsNumber:l.length?l:null:null;this.COLS.push({options:Object.assign({},t),index:e++,group:i,sort:"default",sorter:t.sorter||(null===(a=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===a?void 0:a.sorter),isCollapsable:this.tableConfig.cols.collapse==t.id,filter:n?{list:n,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(t=>{"children"in t?t.children.forEach(e=>i(e,{name:t.groupName,length:t.children.length})):i(t)}),this.isSelectable=!!this.tableConfig.rows&&"none"!=(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)}populateData(){const t=this.COLS.length;if("csv"in this.tableData){const t=c.default.parse(this.tableData.csv,{skipEmptyLines:!0,transform:t=>t.trim()});if(t.errors)return void(this.error="PARSE ERROR:\n"+JSON.stringify(t.errors,null,2));{const e=t.data;this.ROWS=e.map(t=>t.map(t=>({text:t})))}}else if("list2d"in this.tableData)this.ROWS=this.tableData.list2d.map(t=>t.map(t=>({text:t})));else{for(;this.tableData.list.length>t;)this.ROWS.push(this.tableData.list.splice(0,t).map(t=>({text:t})));0!=this.tableData.list.length&&this.ROWS.push(this.tableData.list.map(t=>({text:t})))}0!=this.ROWS.length||(this.error="DATA ERROR: Data is empty")}validateData(){const t=this.COLS.length;this.ROWS.reduce((t,e)=>t+e.length,0)%t==0?this.ROWS.forEach((e,i)=>{const o=e.length;o!=t&&(this.error=`DATA ERROR: Total number of cols (=${t}) and data[${i}] length (=${o}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const t=this.tableConfig.cellTemplates,e=Object.keys(t||{});t&&e.length&&this.ROWS.forEach((e,i)=>{e.forEach((e,o)=>{for(const s in t){const r=e.text.indexOf(s);if(-1!=r){const a=t[s],l=this.querySelector(`#${a.templateName}`);if(null==l){console.warn(`cellTemplates["${s}"]: Missing '${a.templateName}' template.`);continue}let n=e.text.replace(s,"");a.contentCb&&(n=a.contentCb({col:o,row:i,content:n,insertIndex:r})),this.ROWS[i][o]={text:n,template:{template:l,templateCb:a.templateCb,insertIndex:"replace"==a.contentUse?-1:r}};break}}})})}setDefaultFilterAndSort(){var t,e;const i=null===(t=this.tableConfig.default)||void 0===t?void 0:t.sort;if(i){const t=this.COLS.find(t=>t.options.id==i.colId);t?this.sort(t,i.order):console.warn(`Cant find ${i.colId} col - for sorting`)}const o=null===(e=this.tableConfig.default)||void 0===e?void 0:e.filter;if(o){const t=this.COLS.find(t=>t.options.id==o.colId);t?t.filter?(t.filter.selectedIndex=o.selectedIndex,t.filter.input=o.input,this.updCols(),this.filter(t)):console.warn(`Cant find filters on ${o.colId} col`):console.warn(`Cant find ${o.colId} col - for filtering`)}}populateTable(){this.populateColumns(),this.populateData(),this.validateData(),this.setDefaultFilterAndSort(),this.populateTemplate()}updateDataInTable(){this.populateData(),this.validateData(),this.populateTemplate()}onDropRow(){this.dragRow!=this.dropRow&&this.drops.push([this.dragRow,this.dropRow]),this.dragRow=-1,this.dropRow=-1,this.dragRowElem&&(this.dragRowElem.setAttribute("draggable","false"),this.dragRowElem=null)}onDropCol(){if(this.dragCol!=this.dropCol){const t=this.COLS[this.dragCol],e=this.COLS[this.dropCol],i=t.group,o=e.group,s=t.index,r=e.index;t.group=o,e.group=i,t.index=r,e.index=s,this.COLS[this.dragCol]=e,this.COLS[this.dropCol]=t,this.ROWS.forEach(t=>{const e=t[this.dragCol],i=t[this.dropCol];t[this.dragCol]=i,t[this.dropCol]=e}),this.updCols(),this.updRows()}this.dragCol=-1,this.dropCol=-1}sort(t,e){t.sorter&&(this.clearSelection(),this.drops=[],this.COLS.forEach(i=>{i.options.id==t.options.id?i.sort=e||("default"==i.sort?"ascending":"ascending"==i.sort?"descending":"default"):i.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:t.sort}))}filter(t){if(!t.filter)return;this.clearSelection(),this.drops=[];const e=t.filter.input.trim(),i=t.filter.list[t.filter.selectedIndex];t.filter.active=!!e,this.requestUpdate(),e?this["md-table-advanced-change"].emit({type:"filter-on",filter:i,input:e}):this["md-table-advanced-change"].emit({type:"filter-off",filter:t.filter.list[t.filter.selectedIndex]})}selectRow(t){var e;const i=t.row.idx,o=Object.prototype.hasOwnProperty.call(this.selected,i);"multiple"==(null===(e=this.tableConfig.rows)||void 0===e?void 0:e.selectable)?(t.metaKey?o?delete this.selected[i]:this.selected[i]=!0:t.shiftKey||(this.selected={[i]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(t=>+t)})):o?this.clearSelection():(this.selected={[i]:!0},this["md-table-advanced-change"].emit({type:"select",index:i})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(t,e){t.stopPropagation(),this.expandedRowIdx[e]?(delete this.expandedRowIdx[e],this["md-table-advanced-change"].emit({type:"collapse",row:e})):(this.expandedRowIdx[e]=!0,this["md-table-advanced-change"].emit({type:"expand",row:e})),this.clearSelection(),this.requestUpdate()}render(){if(this.error)return a.html` <div>${this.error}</div> `;const{head:t}=this.tableConfig,e=(0,n.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return a.html`
2
2
  <div class="md-table-advanced">
3
3
  <slot></slot>
4
4
  <table class=${e} summary=${(0,d.ifDefined)(null==t?void 0:t.summary)}>