@momentum-ui/web-components 3.2.10 → 3.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2245.js +12 -11
- package/dist/2273.js +10 -7
- package/dist/3639.js +0 -1
- package/dist/378.js +18 -0
- package/dist/6005.js +1 -1
- package/dist/6325.js +1 -1
- package/dist/9189.js +3 -3
- package/dist/953.js +2 -2
- package/dist/comp/md-avatar-entry.js +5 -4
- package/dist/comp/md-avatar.js +1 -1
- package/dist/comp/md-chat-message-entry.js +1 -1
- package/dist/comp/md-chat-message.js +1 -1
- package/dist/comp/md-combobox-entry.js +24 -21
- package/dist/comp/md-datepicker-calendar-entry.js +2 -2
- package/dist/comp/md-datepicker-day-entry.js +0 -1
- package/dist/comp/md-dropdown-entry.js +2 -2
- package/dist/comp/md-floating-modal-entry.js +24 -13
- package/dist/comp/md-grabber-entry.js +12 -8
- package/dist/comp/md-input-entry.js +14 -14
- package/dist/comp/md-meeting-alert-entry.js +1 -1
- package/dist/comp/md-meeting-alert.js +1 -1
- package/dist/comp/md-tabs-entry.js +16 -16
- package/dist/comp/md-task-item-entry.js +1 -1
- package/dist/comp/md-task-item.js +1 -1
- package/dist/esm/2245.js +5 -4
- package/dist/esm/2273.js +36 -33
- package/dist/esm/3639.js +0 -1
- package/dist/esm/378.js +18 -0
- package/dist/esm/4626.js +12 -11
- package/dist/esm/4654.js +10 -7
- package/dist/esm/6005.js +1 -1
- package/dist/esm/6020.js +0 -1
- package/dist/esm/6325.js +1 -1
- package/dist/esm/837.js +2 -2
- package/dist/esm/9189.js +5 -5
- package/dist/esm/953.js +2 -2
- package/dist/esm/comp/md-avatar-entry.js +1 -1
- package/dist/esm/comp/md-avatar.js +1 -1
- package/dist/esm/comp/md-chat-message-entry.js +1 -1
- package/dist/esm/comp/md-chat-message.js +1 -1
- package/dist/esm/comp/md-dropdown-entry.js +1 -1
- package/dist/esm/comp/md-floating-modal-entry.js +24 -13
- package/dist/esm/comp/md-grabber-entry.js +10 -6
- package/dist/esm/comp/md-input-entry.js +4 -4
- package/dist/esm/comp/md-meeting-alert-entry.js +1 -1
- package/dist/esm/comp/md-meeting-alert.js +1 -1
- package/dist/esm/comp/md-tabs-entry.js +15 -15
- package/dist/esm/comp/md-task-item-entry.js +1 -1
- package/dist/esm/comp/md-task-item.js +1 -1
- package/dist/esm/index-entry.js +42 -27
- package/dist/index-entry.js +58 -40
- package/dist/types/components/avatar/Avatar.constants.d.ts +3 -2
- package/dist/types/components/avatar/Avatar.d.ts +3 -0
- package/dist/types/components/combobox/ComboBox.d.ts +1 -1
- package/dist/types/components/floating-modal/FloatingModal.d.ts +10 -1
- package/dist/types/components/grabber/Grabber.d.ts +1 -0
- package/dist/types/components/input/Input.d.ts +1 -0
- package/dist/types/components/tabs/Tabs.d.ts +1 -0
- package/package.json +1 -1
- package/dist/4621.js +0 -18
- package/dist/esm/4621.js +0 -18
package/dist/esm/837.js
CHANGED
|
@@ -9,7 +9,7 @@ export const __webpack_esm_id__=837;export const __webpack_esm_ids__=[837];expor
|
|
|
9
9
|
?disabled=${i}
|
|
10
10
|
@click=${!i&&this.decreaseMonth}
|
|
11
11
|
>
|
|
12
|
-
<md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
12
|
+
<md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
|
|
13
13
|
</md-button>
|
|
14
14
|
`},this.renderNextMonthButton=()=>{var e,t;const i=(null===(e=this.filterParams)||void 0===e?void 0:e.maxDate)&&(0,a.FO)(this.viewAnchorDate,null===(t=this.filterParams)||void 0===t?void 0:t.maxDate);return s.html`
|
|
15
15
|
<md-button
|
|
@@ -21,7 +21,7 @@ export const __webpack_esm_id__=837;export const __webpack_esm_ids__=[837];expor
|
|
|
21
21
|
title=${"next month"}
|
|
22
22
|
?disabled=${i}
|
|
23
23
|
@click=${!i&&this.increaseMonth}
|
|
24
|
-
><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
24
|
+
><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
|
|
25
25
|
</md-button>
|
|
26
26
|
`},this.header=()=>{var e;const t=(0,a.mK)(this.viewAnchorDate,null===(e=this.datePickerProps)||void 0===e?void 0:e.weekStart);return[].concat([0,1,2,3,4,5,6].map(e=>{var i;const r=(0,a.fi)((0,a.WV)(t,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en"),e),o=(0,a.XN)(r),n=this.getWeekDayName(o,r);return s.html` <div class="md-datepicker__day--name">${n}</div> `}))}}connectedCallback(){var e,t,i;super.connectedCallback(),this.viewAnchorDate=(null===(e=this.datePickerProps)||void 0===e?void 0:e.focused)||(null===(t=this.datePickerProps)||void 0===t?void 0:t.selected)||(0,a.tB)(),this.localeMonth=(0,a.WV)(this.viewAnchorDate,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en").toFormat(this.monthFormat)}updated(e){var t,i,r,o,n,s;if(super.updated(e),e.has("datePickerProps")){const n=e.get("datePickerProps"),s=null===(t=this.datePickerProps)||void 0===t?void 0:t.selected,d=null===(i=this.datePickerProps)||void 0===i?void 0:i.focused;if(null===(null==s?void 0:s.invalidReason)&&(!(null==n?void 0:n.selected)||!(0,a.ro)(n.selected,s))&&(this.viewAnchorDate=s||(0,a.tB)()),null==d?void 0:d.isValid){const e=!(null==n?void 0:n.focused)||!(0,a.ro)(n.focused,d),t=d.month!==this.viewAnchorDate.month||d.year!==this.viewAnchorDate.year;e&&t&&(this.viewAnchorDate=d)}this.localeMonth=((null===(r=this.datePickerProps)||void 0===r?void 0:r.locale)?(0,a.WV)(this.viewAnchorDate,null===(o=this.datePickerProps)||void 0===o?void 0:o.locale):this.viewAnchorDate).toFormat(this.monthFormat)}e.has("viewAnchorDate")&&(this.localeMonth=((null===(n=this.datePickerProps)||void 0===n?void 0:n.locale)?(0,a.WV)(this.viewAnchorDate,null===(s=this.datePickerProps)||void 0===s?void 0:s.locale):this.viewAnchorDate).toFormat(this.monthFormat))}getWeekDayName(e,t){return this.shortDay?(0,a.XY)(e,t):(0,a.DY)(e,t)}renderLoader(){return s.html`
|
|
27
27
|
<div class="md-datepicker__loading">
|
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),
|
|
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`
|
|
2
2
|
<textarea
|
|
3
3
|
part="input"
|
|
4
4
|
class="md-input ${(0,d.classMap)(this.inputTemplateClassMap)}"
|
|
@@ -12,7 +12,7 @@ export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];exp
|
|
|
12
12
|
aria-describedby=${this.ariaDescribedBy}
|
|
13
13
|
?required=${this.required}
|
|
14
14
|
?autofocus=${this.autofocus}
|
|
15
|
-
aria-label=${this.
|
|
15
|
+
aria-label=${(0,h.ifDefined)(this.effectiveAriaLabel)}
|
|
16
16
|
aria-invalid=${this.ariaInvalid}
|
|
17
17
|
aria-errormessage="${this.htmlId}-message"
|
|
18
18
|
aria-disabled=${(0,h.ifDefined)(this.disabled||void 0)}
|
|
@@ -39,7 +39,7 @@ export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];exp
|
|
|
39
39
|
aria-describedby=${this.ariaDescribedBy}
|
|
40
40
|
aria-controls=${this.ariaControls}
|
|
41
41
|
aria-expanded=${(0,h.ifDefined)(null!==(e=this.ariaExpandedValue)&&void 0!==e?e:void 0)}
|
|
42
|
-
aria-label=${this.
|
|
42
|
+
aria-label=${(0,h.ifDefined)(this.effectiveAriaLabel)}
|
|
43
43
|
aria-invalid=${this.ariaInvalid}
|
|
44
44
|
aria-errormessage=${`${this.htmlId}-message`}
|
|
45
45
|
aria-disabled=${(0,h.ifDefined)(this.disabled||void 0)}
|
|
@@ -121,7 +121,7 @@ export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];exp
|
|
|
121
121
|
<md-help-text
|
|
122
122
|
class="help-text ${(0,d.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
|
|
123
123
|
.message=${this.helpText}
|
|
124
|
-
style=${(0,
|
|
124
|
+
style=${(0,c.styleMap)({width:"100%"})}
|
|
125
125
|
></md-help-text>
|
|
126
126
|
`:l.nothing}messagesTemplate(){return!this.hideMessage&&this.messages&&this.messages.length?l.html`
|
|
127
127
|
<div id="${this.htmlId}-message" part="message" class="md-input__messages">
|
|
@@ -141,7 +141,7 @@ export const __webpack_esm_id__=9189;export const __webpack_esm_ids__=[9189];exp
|
|
|
141
141
|
.label=${this.label}
|
|
142
142
|
@label-click=${()=>this.handleLabelClick()}
|
|
143
143
|
></md-label>
|
|
144
|
-
`:l.nothing}static get styles(){return[r.A,
|
|
144
|
+
`:l.nothing}static get styles(){return[r.A,m.A]}render(){return l.html`
|
|
145
145
|
<div class="md-input-container ${(0,d.classMap)(this.inputClassMap)}" part="md-input-container">
|
|
146
146
|
${this.labelTemplate()}
|
|
147
147
|
<div class="md-input__wrapper ${(0,d.classMap)(this.inputWrapperClassMap)}">
|
package/dist/esm/953.js
CHANGED
|
@@ -9,7 +9,7 @@ export const __webpack_esm_id__=953;export const __webpack_esm_ids__=[405,837,95
|
|
|
9
9
|
?disabled=${i}
|
|
10
10
|
@click=${!i&&this.decreaseMonth}
|
|
11
11
|
>
|
|
12
|
-
<md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
12
|
+
<md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
|
|
13
13
|
</md-button>
|
|
14
14
|
`},this.renderNextMonthButton=()=>{var e,t;const i=(null===(e=this.filterParams)||void 0===e?void 0:e.maxDate)&&(0,s.FO)(this.viewAnchorDate,null===(t=this.filterParams)||void 0===t?void 0:t.maxDate);return l.html`
|
|
15
15
|
<md-button
|
|
@@ -21,7 +21,7 @@ export const __webpack_esm_id__=953;export const __webpack_esm_ids__=[405,837,95
|
|
|
21
21
|
title=${"next month"}
|
|
22
22
|
?disabled=${i}
|
|
23
23
|
@click=${!i&&this.increaseMonth}
|
|
24
|
-
><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
24
|
+
><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
|
|
25
25
|
</md-button>
|
|
26
26
|
`},this.header=()=>{var e;const t=(0,s.mK)(this.viewAnchorDate,null===(e=this.datePickerProps)||void 0===e?void 0:e.weekStart);return[].concat([0,1,2,3,4,5,6].map(e=>{var i;const o=(0,s.fi)((0,s.WV)(t,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en"),e),r=(0,s.XN)(o),n=this.getWeekDayName(r,o);return l.html` <div class="md-datepicker__day--name">${n}</div> `}))}}connectedCallback(){var e,t,i;super.connectedCallback(),this.viewAnchorDate=(null===(e=this.datePickerProps)||void 0===e?void 0:e.focused)||(null===(t=this.datePickerProps)||void 0===t?void 0:t.selected)||(0,s.tB)(),this.localeMonth=(0,s.WV)(this.viewAnchorDate,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en").toFormat(this.monthFormat)}updated(e){var t,i,o,r,n,l;if(super.updated(e),e.has("datePickerProps")){const n=e.get("datePickerProps"),l=null===(t=this.datePickerProps)||void 0===t?void 0:t.selected,h=null===(i=this.datePickerProps)||void 0===i?void 0:i.focused;if(null===(null==l?void 0:l.invalidReason)&&(!(null==n?void 0:n.selected)||!(0,s.ro)(n.selected,l))&&(this.viewAnchorDate=l||(0,s.tB)()),null==h?void 0:h.isValid){const e=!(null==n?void 0:n.focused)||!(0,s.ro)(n.focused,h),t=h.month!==this.viewAnchorDate.month||h.year!==this.viewAnchorDate.year;e&&t&&(this.viewAnchorDate=h)}this.localeMonth=((null===(o=this.datePickerProps)||void 0===o?void 0:o.locale)?(0,s.WV)(this.viewAnchorDate,null===(r=this.datePickerProps)||void 0===r?void 0:r.locale):this.viewAnchorDate).toFormat(this.monthFormat)}e.has("viewAnchorDate")&&(this.localeMonth=((null===(n=this.datePickerProps)||void 0===n?void 0:n.locale)?(0,s.WV)(this.viewAnchorDate,null===(l=this.datePickerProps)||void 0===l?void 0:l.locale):this.viewAnchorDate).toFormat(this.monthFormat))}getWeekDayName(e,t){return this.shortDay?(0,s.XY)(e,t):(0,s.DY)(e,t)}renderLoader(){return l.html`
|
|
27
27
|
<div class="md-datepicker__loading">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as r from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as o from"@momentum-ui/utils/lib/getColorValue";import*as t from"lit";import*as s from"lit/decorators.js";import*as e from"lit/directives/class-map.js";import*as a from"lit/directives/if-defined.js";import*as m from"lit/directives/style-map.js";import*as i from"lit/directives/until.js";import*as p from"mobx";var f,l,n={9500(o,t,s){var e,a;o.exports=(e={default:()=>r.default},a={},s.d(a,e),a)},3496(r,t,s){var e,a;r.exports=(e={default:()=>o.default},a={},s.d(a,e),a)},2927(r,o,s){var e,a;r.exports=(e={LitElement:()=>t.LitElement,css:()=>t.css,html:()=>t.html,nothing:()=>t.nothing},a={},s.d(a,e),a)},8899(r,o,t){var e,a;r.exports=(e={property:()=>s.property,query:()=>s.query,state:()=>s.state},a={},t.d(a,e),a)},4955(r,o,t){var s,a;r.exports=(s={classMap:()=>e.classMap},a={},t.d(a,s),a)},3517(r,o,t){var s,e;r.exports=(s={ifDefined:()=>a.ifDefined},e={},t.d(e,s),e)},1156(r,o,t){var s,e;r.exports=(s={styleMap:()=>m.styleMap},e={},t.d(e,s),e)},1666(r,o,t){var s,e;r.exports=(s={until:()=>i.until},e={},t.d(e,s),e)},4980(r,o,t){var s,e;r.exports=(s={action:()=>p.action,observable:()=>p.observable},e={},t.d(e,s),e)}},d={};function v(r){var o=d[r];if(void 0!==o)return o.exports;var t=d[r]={exports:{}};return n[r](t,t.exports,v),t.exports}v.m=n,f=[],v.O=(r,o,t,s)=>{if(!o){var e=1/0;for(p=0;p<f.length;p++){for(var[o,t,s]=f[p],a=!0,m=0;m<o.length;m++)(!1&s||e>=s)&&Object.keys(v.O).every(r=>v.O[r](o[m]))?o.splice(m--,1):(a=!1,s<e&&(e=s));if(a){f.splice(p--,1);var i=t();void 0!==i&&(r=i)}}return r}s=s||0;for(var p=f.length;p>0&&f[p-1][2]>s;p--)f[p]=f[p-1];f[p]=[o,t,s]},v.d=(r,o)=>{for(var t in o)v.o(o,t)&&!v.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:o[t]})},v.o=(r,o)=>Object.prototype.hasOwnProperty.call(r,o);export{v as __webpack_require__};l={502:0,1745:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8115:0,8442:0},v.C=r=>{var o,t,{__webpack_esm_ids__:s,__webpack_esm_modules__:e,__webpack_esm_runtime__:a}=r,m=0;for(o in e)v.o(e,o)&&(v.m[o]=e[o]);for(a&&a(v);m<s.length;m++)t=s[m],v.o(l,t)&&l[t]&&l[t][0](),l[s[m]]=0;v.O()},v.O.j=r=>0===l[r];import*as j from"../9609.js";v.C(j);import*as c from"../4084.js";v.C(c);import*as u from"../3305.js";v.C(u);import*as C from"../4739.js";v.C(C);import*as _ from"../7154.js";v.C(_);import*as x from"../9773.js";v.C(x);import*as b from"../5983.js";v.C(b);import*as y from"../9488.js";v.C(y);import*as O from"../1821.js";v.C(O);import*as h from"../519.js";v.C(h);import*as g from"../6325.js";v.C(g);import*as k from"../4449.js";v.C(k);import*as w from"../1392.js";v.C(w);import*as M from"../1618.js";v.C(M);import*as q from"../
|
|
1
|
+
import*as r from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as o from"@momentum-ui/utils/lib/getColorValue";import*as t from"lit";import*as s from"lit/decorators.js";import*as e from"lit/directives/class-map.js";import*as a from"lit/directives/if-defined.js";import*as m from"lit/directives/style-map.js";import*as i from"lit/directives/until.js";import*as p from"mobx";var f,l,n={9500(o,t,s){var e,a;o.exports=(e={default:()=>r.default},a={},s.d(a,e),a)},3496(r,t,s){var e,a;r.exports=(e={default:()=>o.default},a={},s.d(a,e),a)},2927(r,o,s){var e,a;r.exports=(e={LitElement:()=>t.LitElement,css:()=>t.css,html:()=>t.html,nothing:()=>t.nothing},a={},s.d(a,e),a)},8899(r,o,t){var e,a;r.exports=(e={property:()=>s.property,query:()=>s.query,state:()=>s.state},a={},t.d(a,e),a)},4955(r,o,t){var s,a;r.exports=(s={classMap:()=>e.classMap},a={},t.d(a,s),a)},3517(r,o,t){var s,e;r.exports=(s={ifDefined:()=>a.ifDefined},e={},t.d(e,s),e)},1156(r,o,t){var s,e;r.exports=(s={styleMap:()=>m.styleMap},e={},t.d(e,s),e)},1666(r,o,t){var s,e;r.exports=(s={until:()=>i.until},e={},t.d(e,s),e)},4980(r,o,t){var s,e;r.exports=(s={action:()=>p.action,observable:()=>p.observable},e={},t.d(e,s),e)}},d={};function v(r){var o=d[r];if(void 0!==o)return o.exports;var t=d[r]={exports:{}};return n[r](t,t.exports,v),t.exports}v.m=n,f=[],v.O=(r,o,t,s)=>{if(!o){var e=1/0;for(p=0;p<f.length;p++){for(var[o,t,s]=f[p],a=!0,m=0;m<o.length;m++)(!1&s||e>=s)&&Object.keys(v.O).every(r=>v.O[r](o[m]))?o.splice(m--,1):(a=!1,s<e&&(e=s));if(a){f.splice(p--,1);var i=t();void 0!==i&&(r=i)}}return r}s=s||0;for(var p=f.length;p>0&&f[p-1][2]>s;p--)f[p]=f[p-1];f[p]=[o,t,s]},v.d=(r,o)=>{for(var t in o)v.o(o,t)&&!v.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:o[t]})},v.o=(r,o)=>Object.prototype.hasOwnProperty.call(r,o);export{v as __webpack_require__};l={502:0,1745:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8115:0,8442:0},v.C=r=>{var o,t,{__webpack_esm_ids__:s,__webpack_esm_modules__:e,__webpack_esm_runtime__:a}=r,m=0;for(o in e)v.o(e,o)&&(v.m[o]=e[o]);for(a&&a(v);m<s.length;m++)t=s[m],v.o(l,t)&&l[t]&&l[t][0](),l[s[m]]=0;v.O()},v.O.j=r=>0===l[r];import*as j from"../9609.js";v.C(j);import*as c from"../4084.js";v.C(c);import*as u from"../3305.js";v.C(u);import*as C from"../4739.js";v.C(C);import*as _ from"../7154.js";v.C(_);import*as x from"../9773.js";v.C(x);import*as b from"../5983.js";v.C(b);import*as y from"../9488.js";v.C(y);import*as O from"../1821.js";v.C(O);import*as h from"../519.js";v.C(h);import*as g from"../6325.js";v.C(g);import*as k from"../4449.js";v.C(k);import*as w from"../1392.js";v.C(w);import*as M from"../1618.js";v.C(M);import*as q from"../378.js";v.C(q);import*as D from"../9244.js";v.C(D);import*as E from"../2245.js";v.C(E);var L=v.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,6325,4449,1392,1618,378,9244,2245],()=>v(2245));const P=(L=v.O(L)).e;export{P as Avatar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../9609.js";import"../4084.js";import"../3305.js";import"../4739.js";import"../7154.js";import"../9773.js";import"../5983.js";import"../9488.js";import"../1821.js";import"../519.js";import"../6325.js";import"../4449.js";import"../1392.js";import"../1618.js";import"../
|
|
1
|
+
import"../9609.js";import"../4084.js";import"../3305.js";import"../4739.js";import"../7154.js";import"../9773.js";import"../5983.js";import"../9488.js";import"../1821.js";import"../519.js";import"../6325.js";import"../4449.js";import"../1392.js";import"../1618.js";import"../378.js";import"../9244.js";import"../2245.js";export*from"../comp/md-avatar-entry.js";
|
|
@@ -31,4 +31,4 @@ import*as t from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as e
|
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
|
-
`}};d([(0,p.property)({type:String})],e.prototype,"title",void 0),d([(0,p.property)({type:String})],e.prototype,"src",void 0),d([(0,p.property)({type:String})],e.prototype,"time",void 0),d([(0,p.property)({type:String})],e.prototype,"label",void 0),d([(0,p.property)({type:String})],e.prototype,"status",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"clickableTimestamp",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"isSelected",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"self-label"})],e.prototype,"selfLabel",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"self",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"avatar-color"})],e.prototype,"avatarColor",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"avatar-type"})],e.prototype,"avatarType",void 0),d([(0,p.property)({type:Number,reflect:!0,attribute:"avatar-size"})],e.prototype,"avatarSize",void 0),e=d([(0,i.w)("md-chat-message")],e),t.ELEMENT=e}(r||(r={}))},9500(e,s,r){var i,o;e.exports=(i={default:()=>t.default},o={},r.d(o,i),o)},3496(t,s,r){var i,o;t.exports=(i={default:()=>e.default},o={},r.d(o,i),o)},2927(t,e,r){var i,o;t.exports=(i={LitElement:()=>s.LitElement,css:()=>s.css,html:()=>s.html,nothing:()=>s.nothing},o={},r.d(o,i),o)},8899(t,e,s){var i,o;t.exports=(i={property:()=>r.property,query:()=>r.query,state:()=>r.state},o={},s.d(o,i),o)},4955(t,e,s){var r,o;t.exports=(r={classMap:()=>i.classMap},o={},s.d(o,r),o)},3517(t,e,s){var r,i;t.exports=(r={ifDefined:()=>o.ifDefined},i={},s.d(i,r),i)},1156(t,e,s){var r,i;t.exports=(r={styleMap:()=>a.styleMap},i={},s.d(i,r),i)},1666(t,e,s){var r,i;t.exports=(r={until:()=>p.until},i={},s.d(i,r),i)},4980(t,e,s){var r,i;t.exports=(r={action:()=>m.action,observable:()=>m.observable},i={},s.d(i,r),i)}},n={};function v(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return c[t](s,s.exports,v),s.exports}v.m=c,l=[],v.O=(t,e,s,r)=>{if(!e){var i=1/0;for(m=0;m<l.length;m++){for(var[e,s,r]=l[m],o=!0,a=0;a<e.length;a++)(!1&r||i>=r)&&Object.keys(v.O).every(t=>v.O[t](e[a]))?e.splice(a--,1):(o=!1,r<i&&(i=r));if(o){l.splice(m--,1);var p=s();void 0!==p&&(t=p)}}return t}r=r||0;for(var m=l.length;m>0&&l[m-1][2]>r;m--)l[m]=l[m-1];l[m]=[e,s,r]},v.d=(t,e)=>{for(var s in e)v.o(e,s)&&!v.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},v.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{v as __webpack_require__};d={502:0,1745:0,4545:0,4928:0,5369:0,6060:0,6920:0,7684:0,8111:0,8115:0,8442:0},v.C=t=>{var e,s,{__webpack_esm_ids__:r,__webpack_esm_modules__:i,__webpack_esm_runtime__:o}=t,a=0;for(e in i)v.o(i,e)&&(v.m[e]=i[e]);for(o&&o(v);a<r.length;a++)s=r[a],v.o(d,s)&&d[s]&&d[s][0](),d[r[a]]=0;v.O()},v.O.j=t=>0===d[t];import*as f from"../9609.js";v.C(f);import*as y from"../4084.js";v.C(y);import*as h from"../3305.js";v.C(h);import*as u from"../4739.js";v.C(u);import*as g from"../7154.js";v.C(g);import*as b from"../9773.js";v.C(b);import*as j from"../5983.js";v.C(j);import*as _ from"../9488.js";v.C(_);import*as C from"../1821.js";v.C(C);import*as x from"../519.js";v.C(x);import*as S from"../6325.js";v.C(S);import*as O from"../4449.js";v.C(O);import*as k from"../1392.js";v.C(k);import*as T from"../1618.js";v.C(T);import*as $ from"../
|
|
34
|
+
`}};d([(0,p.property)({type:String})],e.prototype,"title",void 0),d([(0,p.property)({type:String})],e.prototype,"src",void 0),d([(0,p.property)({type:String})],e.prototype,"time",void 0),d([(0,p.property)({type:String})],e.prototype,"label",void 0),d([(0,p.property)({type:String})],e.prototype,"status",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"clickableTimestamp",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"isSelected",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"self-label"})],e.prototype,"selfLabel",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"self",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"avatar-color"})],e.prototype,"avatarColor",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"avatar-type"})],e.prototype,"avatarType",void 0),d([(0,p.property)({type:Number,reflect:!0,attribute:"avatar-size"})],e.prototype,"avatarSize",void 0),e=d([(0,i.w)("md-chat-message")],e),t.ELEMENT=e}(r||(r={}))},9500(e,s,r){var i,o;e.exports=(i={default:()=>t.default},o={},r.d(o,i),o)},3496(t,s,r){var i,o;t.exports=(i={default:()=>e.default},o={},r.d(o,i),o)},2927(t,e,r){var i,o;t.exports=(i={LitElement:()=>s.LitElement,css:()=>s.css,html:()=>s.html,nothing:()=>s.nothing},o={},r.d(o,i),o)},8899(t,e,s){var i,o;t.exports=(i={property:()=>r.property,query:()=>r.query,state:()=>r.state},o={},s.d(o,i),o)},4955(t,e,s){var r,o;t.exports=(r={classMap:()=>i.classMap},o={},s.d(o,r),o)},3517(t,e,s){var r,i;t.exports=(r={ifDefined:()=>o.ifDefined},i={},s.d(i,r),i)},1156(t,e,s){var r,i;t.exports=(r={styleMap:()=>a.styleMap},i={},s.d(i,r),i)},1666(t,e,s){var r,i;t.exports=(r={until:()=>p.until},i={},s.d(i,r),i)},4980(t,e,s){var r,i;t.exports=(r={action:()=>m.action,observable:()=>m.observable},i={},s.d(i,r),i)}},n={};function v(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return c[t](s,s.exports,v),s.exports}v.m=c,l=[],v.O=(t,e,s,r)=>{if(!e){var i=1/0;for(m=0;m<l.length;m++){for(var[e,s,r]=l[m],o=!0,a=0;a<e.length;a++)(!1&r||i>=r)&&Object.keys(v.O).every(t=>v.O[t](e[a]))?e.splice(a--,1):(o=!1,r<i&&(i=r));if(o){l.splice(m--,1);var p=s();void 0!==p&&(t=p)}}return t}r=r||0;for(var m=l.length;m>0&&l[m-1][2]>r;m--)l[m]=l[m-1];l[m]=[e,s,r]},v.d=(t,e)=>{for(var s in e)v.o(e,s)&&!v.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},v.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{v as __webpack_require__};d={502:0,1745:0,4545:0,4928:0,5369:0,6060:0,6920:0,7684:0,8111:0,8115:0,8442:0},v.C=t=>{var e,s,{__webpack_esm_ids__:r,__webpack_esm_modules__:i,__webpack_esm_runtime__:o}=t,a=0;for(e in i)v.o(i,e)&&(v.m[e]=i[e]);for(o&&o(v);a<r.length;a++)s=r[a],v.o(d,s)&&d[s]&&d[s][0](),d[r[a]]=0;v.O()},v.O.j=t=>0===d[t];import*as f from"../9609.js";v.C(f);import*as y from"../4084.js";v.C(y);import*as h from"../3305.js";v.C(h);import*as u from"../4739.js";v.C(u);import*as g from"../7154.js";v.C(g);import*as b from"../9773.js";v.C(b);import*as j from"../5983.js";v.C(j);import*as _ from"../9488.js";v.C(_);import*as C from"../1821.js";v.C(C);import*as x from"../519.js";v.C(x);import*as S from"../6325.js";v.C(S);import*as O from"../4449.js";v.C(O);import*as k from"../1392.js";v.C(k);import*as T from"../1618.js";v.C(T);import*as $ from"../378.js";v.C($);import*as D from"../9244.js";v.C(D);import*as E from"../4626.js";v.C(E);import*as L from"../9316.js";v.C(L);var w=v.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,6325,4449,1392,1618,378,9244,4626,9316],()=>v(5558));const M=(w=v.O(w)).c;export{M as ChatMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../9609.js";import"../4084.js";import"../3305.js";import"../4739.js";import"../7154.js";import"../9773.js";import"../5983.js";import"../9488.js";import"../1821.js";import"../519.js";import"../6325.js";import"../4449.js";import"../1392.js";import"../1618.js";import"../
|
|
1
|
+
import"../9609.js";import"../4084.js";import"../3305.js";import"../4739.js";import"../7154.js";import"../9773.js";import"../5983.js";import"../9488.js";import"../1821.js";import"../519.js";import"../6325.js";import"../4449.js";import"../1392.js";import"../1618.js";import"../378.js";import"../9244.js";import"../4626.js";import"../9316.js";export*from"../comp/md-chat-message-entry.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as i from"lit";import*as s from"lit/decorators.js";import*as o from"lit/directives/class-map.js";import*as n from"lit/directives/if-defined.js";import*as r from"lit/directives/repeat.js";import*as a from"lit/directives/style-map.js";import*as l from"mobx";var d,p,h={621(e,t,i){i.d(t,{m:()=>s}),i(1821);var s,o=i(2900),n=i(7704),r=i(2050),a=i(4084),l=i(2927),d=i(8899),p=i(4955),h=i(3517),c=i(2577),u=i(1156),m=i(5057),f=function(e,t,i,s){var o,n=arguments.length,r=n<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 a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},y=function(e,t,i,s){return new(i||(i=Promise))(function(o,n){function r(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((s=s.apply(e,t||[])).next())})};!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.yC)(l.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.pill=!1,this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.dropdownRenderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new t,this.lastMaxHeight="",this.onOutsideClick=e=>{let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||this.expanded&&this.collapse())},this.onKeyDown=e=>{var t;if(!this.disabled&&!this.readOnly)switch(e.code){case o.Uz.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case o.Uz.Space:case o.Uz.Enter:{const i=e.composedPath()[0];if(null===(t=i.closest)||void 0===t?void 0:t.call(i,".md-dropdown-button"))break;e.preventDefault(),this.expanded?(this.select(),this.collapse()):this.expand();break}case o.Uz.ArrowDown:e.preventDefault(),this.expanded?this.focusNext():this.expand();break;case o.Uz.ArrowUp:e.preventDefault(),this.expanded?this.focusPrev():this.expand();break;case o.Uz.Home:e.preventDefault(),this.expanded?this.focusFirst():this.expand();break;case o.Uz.End:e.preventDefault(),this.expanded?this.focusLast():this.expand();break;case o.Uz.Escape:case o.Uz.Backspace:this.expanded&&(e.preventDefault(),e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=(0,r.sg)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,t)=>{if("defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,t)=>{if("options"===t&&this.updateRenderOptions(),"selectedKey"===t&&this.dropdownRenderOptions.some(e=>e.key===this.selectedKey)){const e=this.filteredOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&this.focusToIndex(e),this.searchable&&this.setInitialValue()}if("expanded"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"focusedIndex"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const t=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey),i=null==t?void 0:t.option;if(i){const t=this.getOptionValue(i);this.inputValue=t,this.setInputValue(t),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(i)),this.notifyInputValueChanged(t)}}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const t=this.options.reduce((t,i)=>{const{key:s,value:o}=this.getOptionKeyValuePair(i);return-1!==e.indexOf(s)?console.error(`Dropdown already have option key: "${s}". Ignoring `):s?(e.push(s),t.push({key:s,value:o,option:i})):console.error(`Dropdown key is not defined: "${s}". (value: "${o}"). Ignoring `),t},[]);this.allowUnselected&&t.unshift({key:"",value:this.title}),this.dropdownRenderOptions=t}updateActiveDescendant(){const e=this.searchable?this.input:this.label;if(e){const t=this.expanded&&-1!==this.focusedIndex?`combo-${this.focusedIndex}`:"";e.setAttribute("aria-activedescendant",t)}}updateListDOM(){return y(this,void 0,void 0,function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))})}resizeDropdownList(){return y(this,void 0,void 0,function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=`${[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,t)=>e+t.offsetHeight,0)}px`;this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))})}handleFocusIn(e){var t;this.disabled||null===(t=super.handleFocusIn)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){var t;null===(t=super.handleFocusOut)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[a.A,m.A]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.dropdownRenderOptions;const t=this.dropdownRenderOptions.filter(t=>t.value.toLowerCase().includes(e.toLowerCase()));return 0===t.length?[{key:"no-result",value:"No Result",disabled:!0}]:t}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}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var t,i;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const s=null===(i=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.parentElement;if(s){const e=s.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.collapse():(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.expand()),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){this.expanded=!0,document.dispatchEvent(new CustomEvent("on-widget-update")),!this.searchable&&this.label&&this.label.focus(),-1===this.focusedIndex&&this.focusNext()}collapse(){if(this.expanded=!1,this.searchable&&this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(null==e?void 0:e.option){const t=this.getOptionValue(e.option);this.inputValue=t,this.setInputValue(t)}}}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.filteredOptions[this.focusedIndex];if(!e||"no-result"===e.key)return;const t=e.key;t!==this.selectedKey&&(this.selectedKey=t,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:"option"in e&&e.option||e.key}})))}}onLabelClick(){this.label.focus(),this.readOnly||this.toggle()}focusFirst(){this.filteredOptions.length&&(this.focusedIndex=0)}focusLast(){this.filteredOptions.length&&(this.focusedIndex=this.filteredOptions.length-1)}focusNext(){this.filteredOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.filteredOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.filteredOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.filteredOptions.length&&e>=0&&e<=this.filteredOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const t=this.filteredOptions.findIndex(t=>t.key===e.key);this.filteredOptions.length&&t>=0&&t<=this.filteredOptions.length-1&&(this.focusedIndex=t)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return y(this,void 0,void 0,function*(){yield new Promise(t=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let t=0;const{top:i,bottom:s}=this.optionsList.getBoundingClientRect(),o=this.optionsListItems[e],n=this.optionsListItems[e+1]||o,r=this.optionsListItems[e-1]||o,a=n.getBoundingClientRect(),l=r.getBoundingClientRect();a.bottom>s?t=a.bottom-s+2:l.top<i&&(t=l.top-i-2),this.optionsList.scrollTop+=t}t()})})})}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const t=Object.keys(e),i=Object.values(e);if(t.length){if(1===t.length||!this.optionId)return{key:t[0],value:i[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,[`md-${this.messageType}`]:!!this.messageType,"md-new-dropdown":this.newMomentum,"md-dropdown--pill":!0===this.pill}}handleInput(e){const t=e.target.value;this.inputValue=t.trim(),this.notifyInputValueChanged(t.trim())}helpTextTemplate(){return this.helpText?l.html`
|
|
1
|
+
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as i from"lit";import*as s from"lit/decorators.js";import*as o from"lit/directives/class-map.js";import*as n from"lit/directives/if-defined.js";import*as r from"lit/directives/repeat.js";import*as a from"lit/directives/style-map.js";import*as l from"mobx";var d,p,h={621(e,t,i){i.d(t,{m:()=>s}),i(1821);var s,o=i(2900),n=i(7704),r=i(2050),a=i(4084),l=i(2927),d=i(8899),p=i(4955),h=i(3517),c=i(2577),u=i(1156),m=i(5057),f=function(e,t,i,s){var o,n=arguments.length,r=n<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 a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},y=function(e,t,i,s){return new(i||(i=Promise))(function(o,n){function r(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((s=s.apply(e,t||[])).next())})};!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.yC)(l.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.pill=!1,this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.dropdownRenderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new t,this.lastMaxHeight="",this.onOutsideClick=e=>{let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||this.expanded&&this.collapse())},this.onKeyDown=e=>{var t;if(!this.disabled&&!this.readOnly)switch(e.code){case o.Uz.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case o.Uz.Space:case o.Uz.Enter:{const i=e.composedPath()[0];if(null===(t=i.closest)||void 0===t?void 0:t.call(i,".md-dropdown-button"))break;e.preventDefault(),this.expanded?(this.select(),this.collapse()):this.expand();break}case o.Uz.ArrowDown:e.preventDefault(),this.expanded?this.focusNext():this.expand();break;case o.Uz.ArrowUp:e.preventDefault(),this.expanded?this.focusPrev():this.expand();break;case o.Uz.Home:e.preventDefault(),this.expanded?this.focusFirst():this.expand();break;case o.Uz.End:e.preventDefault(),this.expanded?this.focusLast():this.expand();break;case o.Uz.Escape:case o.Uz.Backspace:this.expanded&&(e.preventDefault(),e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=(0,r.sg)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,t)=>{if("defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,t)=>{if("options"===t&&this.updateRenderOptions(),"selectedKey"===t&&this.dropdownRenderOptions.some(e=>e.key===this.selectedKey)){const e=this.filteredOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&this.focusToIndex(e),this.searchable&&this.setInitialValue()}if("expanded"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"focusedIndex"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const t=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey),i=null==t?void 0:t.option;if(i){const t=this.getOptionValue(i);this.inputValue=t,this.setInputValue(t),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(i)),this.notifyInputValueChanged(t)}}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const t=this.options.reduce((t,i)=>{const{key:s,value:o}=this.getOptionKeyValuePair(i);return-1!==e.indexOf(s)?console.error(`Dropdown already have option key: "${s}". Ignoring `):s?(e.push(s),t.push({key:s,value:o,option:i})):console.error(`Dropdown key is not defined: "${s}". (value: "${o}"). Ignoring `),t},[]);this.allowUnselected&&t.unshift({key:"",value:this.title}),this.dropdownRenderOptions=t}updateActiveDescendant(){const e=this.searchable?this.input:this.label;if(e){const t=this.expanded&&-1!==this.focusedIndex?`combo-${this.focusedIndex}`:"";e.setAttribute("aria-activedescendant",t)}}updateListDOM(){return y(this,void 0,void 0,function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))})}resizeDropdownList(){return y(this,void 0,void 0,function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=`${[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,t)=>e+t.offsetHeight,0)}px`;this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))})}handleFocusIn(e){var t;this.disabled||null===(t=super.handleFocusIn)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){var t;null===(t=super.handleFocusOut)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[a.A,m.A]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.dropdownRenderOptions;const t=this.dropdownRenderOptions.filter(t=>t.value.toLowerCase().includes(e.toLowerCase()));return 0===t.length?[{key:"no-result",value:"No Result",disabled:!0}]:t}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}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var t,i;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const s=null===(i=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.parentElement;if(s){const e=s.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.collapse():(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.expand()),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){if(this.expanded=!0,document.dispatchEvent(new CustomEvent("on-widget-update")),!this.searchable&&this.label&&this.label.focus(),-1===this.focusedIndex)if(this.selectedKey){const e=this.filteredOptions.findIndex(e=>e.key===this.selectedKey);-1!==e?this.focusedIndex=e:this.focusNext()}else this.focusNext()}collapse(){if(this.expanded=!1,this.searchable&&this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(null==e?void 0:e.option){const t=this.getOptionValue(e.option);this.inputValue=t,this.setInputValue(t)}}}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.filteredOptions[this.focusedIndex];if(!e||"no-result"===e.key)return;const t=e.key;t!==this.selectedKey&&(this.selectedKey=t,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:"option"in e&&e.option||e.key}})))}}onLabelClick(){this.label.focus(),this.readOnly||this.toggle()}focusFirst(){this.filteredOptions.length&&(this.focusedIndex=0)}focusLast(){this.filteredOptions.length&&(this.focusedIndex=this.filteredOptions.length-1)}focusNext(){this.filteredOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.filteredOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.filteredOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.filteredOptions.length&&e>=0&&e<=this.filteredOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const t=this.filteredOptions.findIndex(t=>t.key===e.key);this.filteredOptions.length&&t>=0&&t<=this.filteredOptions.length-1&&(this.focusedIndex=t)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return y(this,void 0,void 0,function*(){yield new Promise(t=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let t=0;const{top:i,bottom:s}=this.optionsList.getBoundingClientRect(),o=this.optionsListItems[e],n=this.optionsListItems[e+1]||o,r=this.optionsListItems[e-1]||o,a=n.getBoundingClientRect(),l=r.getBoundingClientRect();a.bottom>s?t=a.bottom-s+2:l.top<i&&(t=l.top-i-2),this.optionsList.scrollTop+=t}t()})})})}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const t=Object.keys(e),i=Object.values(e);if(t.length){if(1===t.length||!this.optionId)return{key:t[0],value:i[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,[`md-${this.messageType}`]:!!this.messageType,"md-new-dropdown":this.newMomentum,"md-dropdown--pill":!0===this.pill}}handleInput(e){const t=e.target.value;this.inputValue=t.trim(),this.notifyInputValueChanged(t.trim())}helpTextTemplate(){return this.helpText?l.html`
|
|
2
2
|
<md-help-text
|
|
3
3
|
class="help-text ${(0,p.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
|
|
4
4
|
.message=${this.helpText}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as t from"@interactjs/actions/drag";import*as i from"@interactjs/actions/resize";import*as e from"@interactjs/auto-start";import*as o from"@interactjs/interact/index";import*as n from"@interactjs/modifiers";import*as a from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as
|
|
1
|
+
import*as t from"@interactjs/actions/drag";import*as i from"@interactjs/actions/resize";import*as e from"@interactjs/auto-start";import*as o from"@interactjs/interact/index";import*as n from"@interactjs/modifiers";import*as a from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as s from"@momentum-ui/utils/lib/getColorValue";import*as r from"lit";import*as l from"lit/decorators.js";import*as d from"lit/directives/class-map.js";import*as m from"lit/directives/if-defined.js";import*as c from"lit/directives/style-map.js";import*as h from"mobx";var p,u,f={5958(t,i,e){e(5983),e(1821);var o,n=e(2900),a=e(7704),s=e(9609),r=e(2050),l=e(4084),d=(e(4358),e(1660),e(4886),e(5109)),m=(e(6014),e(2927)),c=e(8899),h=e(3517),p=e(7262),u=function(t,i,e,o){var n,a=arguments.length,s=a<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,e,o);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(s=(a<3?n(s):a>3?n(i,e,s):n(i,e))||s);return a>3&&s&&Object.defineProperty(i,e,s),s};!function(t){let i=class extends((0,a.yC)(m.LitElement)){constructor(){super(...arguments),this.heading="",this.label="",this.show=!1,this.closeAriaLabel="Close Modal",this.minimize=!1,this.maximizeIconAriaLabel="Maximize Modal",this.dragOccured=!1,this.containerTransform="",this.applyInitialPosition=!0,this.getInitialPosition=()=>{var t,i;return this.applyInitialPosition&&this.minPosition?{initialX:Number(null===(t=this.minPosition)||void 0===t?void 0:t.x),initialY:Number(null===(i=this.minPosition)||void 0===i?void 0:i.y)}:{initialX:0,initialY:0}},this.dragMoveListener=t=>{const{target:i}=t,{x:e,y:o}=this.getTransformValues(t);this.setTargetPosition(i,e,o),this.applyInitialPosition=!1},this.dragEndListener=()=>{this.dragOccured=!0,this.setContainerRect()}}static get styles(){return[l.A,p.A]}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",(0,r.sg)(()=>this.setInteractInstance(),250))}updated(t){super.updated(t),t.has("show")&&(this.container&&this.show?(this.applyInitialPosition=!0,this.setContainerRect(),this.setInteractInstance(),this.setFocusOnContainer()):(this.cleanContainerStyles(),this.destroyInteractInstance())),this.container&&t.has("minPosition")&&!t.has("show")&&this.setInitialTargetPosition(),t.has("minimize")&&void 0!==t.get("minimize")&&this.setFocusOnContainer()}isNewPositionNotSame(){var t,i,e,o;if(this.container)return Number(null===(t=this.container)||void 0===t?void 0:t.getAttribute("data-x"))!==(null===(i=this.minPosition)||void 0===i?void 0:i.x)||Number(null===(e=this.container)||void 0===e?void 0:e.getAttribute("data-y"))!==(null===(o=this.minPosition)||void 0===o?void 0:o.y)}setInitialTargetPosition(){var t,i;this.container&&this.isNewPositionNotSame()&&this.setTargetPosition(this.container,Number(null===(t=this.minPosition)||void 0===t?void 0:t.x),Number(null===(i=this.minPosition)||void 0===i?void 0:i.y))}setFocusOnContainer(){this.container&&(this.container.setAttribute("tabindex","0"),this.container.focus())}cleanContainerStyles(){this.containerTransform=""}getContainerTransform(){const t=this.container.getAttribute("data-x"),i=this.container.getAttribute("data-y");return t&&i?(this.dispatchEvent(new CustomEvent("floating-modal-minimize-location",{composed:!0,bubbles:!0,detail:{transform:{x:t,y:i}}})),`translate(${t}px, ${i}px)`):this.container.style.transform}setContainerRect(){requestAnimationFrame(()=>{return t=this,i=void 0,o=function*(){yield this.updateComplete,this.containerTransform=this.getContainerTransform()},new((e=void 0)||(e=Promise))(function(n,a){function s(t){try{l(o.next(t))}catch(t){a(t)}}function r(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(s,r)}l((o=o.apply(t,i||[])).next())});var t,i,e,o})}setInteractInstance(){requestAnimationFrame(()=>{this.container&&(0,d.default)(this.container).draggable({autoScroll:!0,allowFrom:this.header,listeners:{move:this.dragMoveListener,end:this.dragEndListener},modifiers:[d.default.modifiers.restrictRect({restriction:document.body.getBoundingClientRect(),endOnly:!0})]})})}handleKeyDown(t){t.code!==n.Uz.Enter&&t.code!==n.Uz.Space||this.handleMinimize(t)}handleKeyDownClose(t){t.code!==n.Uz.Enter&&t.code!==n.Uz.Space||this.handleClose(t)}handleClose(t){this.show=!1,this.dispatchEvent(new CustomEvent("floating-modal-close",{composed:!0,bubbles:!0,detail:{srcEvent:t}})),t.stopPropagation()}handleMinimize(t){t.preventDefault(),t.stopPropagation(),this.dragOccured||this.dispatchEvent(new CustomEvent("floating-min-modal-minimize",{composed:!0,bubbles:!0,detail:{srcEvent:t}})),this.dragOccured=!1}getTransformValues(t){const{target:i,dx:e,dy:o}=t,{initialX:n,initialY:a}=this.getInitialPosition();return{x:(parseFloat(i.getAttribute("data-x"))||0)+e+n,y:(parseFloat(i.getAttribute("data-y"))||0)+o+a}}setTargetPosition(t,i,e){t.style.transform=`translate(${i}px, ${e}px)`,t.setAttribute("data-x",`${i}`),t.setAttribute("data-y",`${e}`)}destroyInteractInstance(){this.container&&d.default.isSet(this.container)&&(0,d.default)(this.container).unset()}disconnectedCallback(){super.disconnectedCallback(),this.destroyInteractInstance(),window.removeEventListener("resize",(0,r.sg)(()=>this.setInteractInstance(),250))}render(){return m.html`
|
|
2
2
|
${this.show?m.html`
|
|
3
3
|
<div
|
|
4
4
|
class="md-floating ${this.minimize?"":"hide"} md-floating-minimize"
|
|
@@ -40,24 +40,35 @@ import*as t from"@interactjs/actions/drag";import*as i from"@interactjs/actions/
|
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
42
|
`:m.nothing}
|
|
43
|
-
`}};u([(0,c.property)({type:String})],i.prototype,"heading",void 0),u([(0,c.property)({type:String})],i.prototype,"label",void 0),u([(0,c.property)({type:Boolean,reflect:!0})],i.prototype,"show",void 0),u([(0,c.property)({type:String,attribute:"close-aria-label"})],i.prototype,"closeAriaLabel",void 0),u([(0,c.property)({type:Boolean,reflect:!0})],i.prototype,"minimize",void 0),u([(0,c.property)({type:String,attribute:"maximize-icon-aria-label"})],i.prototype,"maximizeIconAriaLabel",void 0),u([(0,c.property)({type:Object})],i.prototype,"minPosition",void 0),u([(0,c.query)(".md-floating")],i.prototype,"container",void 0),u([(0,c.query)(".md-floating__header")],i.prototype,"header",void 0),u([(0,c.state)()],i.prototype,"dragOccured",void 0),u([(0,c.state)()],i.prototype,"containerTransform",void 0),i=u([(0,
|
|
44
|
-
${this.show?
|
|
43
|
+
`}};u([(0,c.property)({type:String})],i.prototype,"heading",void 0),u([(0,c.property)({type:String})],i.prototype,"label",void 0),u([(0,c.property)({type:Boolean,reflect:!0})],i.prototype,"show",void 0),u([(0,c.property)({type:String,attribute:"close-aria-label"})],i.prototype,"closeAriaLabel",void 0),u([(0,c.property)({type:Boolean,reflect:!0})],i.prototype,"minimize",void 0),u([(0,c.property)({type:String,attribute:"maximize-icon-aria-label"})],i.prototype,"maximizeIconAriaLabel",void 0),u([(0,c.property)({type:Object})],i.prototype,"minPosition",void 0),u([(0,c.query)(".md-floating")],i.prototype,"container",void 0),u([(0,c.query)(".md-floating__header")],i.prototype,"header",void 0),u([(0,c.state)()],i.prototype,"dragOccured",void 0),u([(0,c.state)()],i.prototype,"containerTransform",void 0),i=u([(0,s.w)("md-floating-modal-minimized")],i),t.ELEMENT=i}(o||(o={}))},4262(t,i,e){e.d(i,{o:()=>o}),e(5983),e(1821);var o,n=e(2900),a=e(7704),s=e(9609),r=e(4084),l=(e(4358),e(1660),e(4886),e(5109)),d=(e(6014),e(2927)),m=e(8899),c=e(3517),h=(e(5958),e(7262)),p=function(t,i,e,o){var n,a=arguments.length,s=a<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,e,o);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(s=(a<3?n(s):a>3?n(i,e,s):n(i,e))||s);return a>3&&s&&Object.defineProperty(i,e,s),s};!function(t){let i=class extends((0,a.yC)((0,a.TS)(d.LitElement))){constructor(){super(...arguments),this.heading="",this.label="",this.show=!1,this.aspectRatio=!1,this.centered=!1,this.fixed=!1,this.full=!1,this.closeAriaLabel="Close Modal",this.resizeAriaLabel="Resize Modal",this.maximizeScreenLabel="Maximize Modal",this.minimizeAriaLabel="Minimize Modal",this.moveAriaLabel="Move Modal",this.maximizable=!0,this.resizable=!0,this.minimize=!1,this.minimizable=!1,this.containerRect=null,this.dragOccured=!1,this.containerTransform="",this.previouslyFocusedElement=null,this.applyInitialPosition=!0,this.handleModalKeyDown=t=>{this.show&&t.code===n.Uz.Escape&&(t.preventDefault(),t.stopPropagation(),this.handleClose(t))},this.resizeMoveListener=t=>{const{target:i}=t;let e=parseFloat(i.getAttribute("data-x"))||0,o=parseFloat(i.getAttribute("data-y"))||0;i.style.setProperty("width",`${t.rect.width}px`,"important"),i.style.setProperty("height",`${t.rect.height}px`,"important");const{initialX:n,initialY:a}=this.getInitialPosition();e+=t.deltaRect.left+n,o+=t.deltaRect.top+a,this.setTargetPosition(i,e,o),this.applyInitialPosition=!1},this.resizeEndListener=()=>{this.setContainerRect()},this.getInitialPosition=()=>{var t,i;return this.applyInitialPosition&&this.position?{initialX:Number(null===(t=this.position)||void 0===t?void 0:t.x),initialY:Number(null===(i=this.position)||void 0===i?void 0:i.y)}:{initialX:0,initialY:0}},this.dragMoveListener=t=>{const{target:i}=t,{x:e,y:o}=this.getTransformValues(t);this.setTargetPosition(i,e,o),this.applyInitialPosition=!1},this.dragEndListener=()=>{this.dragOccured=!0,this.setContainerRect()},this.MOVE_STEP=10,this.handleMoveKeyDown=t=>{if(!this.container)return;const{code:i}=t;let e=0,o=0;switch(i){case"ArrowUp":o=-this.MOVE_STEP;break;case"ArrowDown":o=this.MOVE_STEP;break;case"ArrowLeft":e=-this.MOVE_STEP;break;case"ArrowRight":e=this.MOVE_STEP;break;default:return}t.preventDefault(),t.stopPropagation();const n=parseFloat(this.container.getAttribute("data-x")||"0")+e,a=parseFloat(this.container.getAttribute("data-y")||"0")+o;this.setTargetPosition(this.container,n,a),this.containerTransform=`translate(${n}px, ${a}px)`,this.dispatchEvent(new CustomEvent("floating-modal-location",{composed:!0,bubbles:!0,detail:{transform:{x:`${n}`,y:`${a}`}}}))}}static get styles(){return[r.A,h.A]}updated(t){super.updated(t),t.has("show")&&(this.container&&this.show?(this.capturePreviouslyFocusedElement(),this.applyInitialPosition=!0,this.setContainerRect(),this.setInteractInstance(),this.focusModalOnOpen()):(this.cleanContainerStyles(),this.destroyInteractInstance(),this.restoreFocusAfterClose())),this.container&&t.has("position")&&!t.has("show")&&this.setInitialTargetPosition(),t.has("minimize")&&!0===t.get("minimize")&&!1===this.minimize&&this.show&&this.focusModalOnOpen()}getDeepActiveElementFromDocument(){var t;let i=document.activeElement;for(;null===(t=null==i?void 0:i.shadowRoot)||void 0===t?void 0:t.activeElement;)i=i.shadowRoot.activeElement;return i}capturePreviouslyFocusedElement(){var t;const i=this.getDeepActiveElementFromDocument();i&&i!==document.body?(null===(t=this.shadowRoot)||void 0===t?void 0:t.contains(i))||this.contains(i)||(this.previouslyFocusedElement=i):this.previouslyFocusedElement=null}focusModalOnOpen(){requestAnimationFrame(()=>{var t;if(!this.show||!this.container)return;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".md-floating__header md-button.md-floating__header-button");i?i.focus():(this.container.setAttribute("tabindex","-1"),this.container.focus())})}restoreFocusAfterClose(){const t=this.previouslyFocusedElement;this.previouslyFocusedElement=null,t&&t.isConnected&&requestAnimationFrame(()=>{t.isConnected&&t.focus()})}isNewPositionNotSame(){var t,i,e,o;if(this.container)return Number(null===(t=this.container)||void 0===t?void 0:t.getAttribute("data-x"))!==(null===(i=this.position)||void 0===i?void 0:i.x)||Number(null===(e=this.container)||void 0===e?void 0:e.getAttribute("data-y"))!==(null===(o=this.position)||void 0===o?void 0:o.y)}setInitialTargetPosition(){var t,i;this.container&&this.isNewPositionNotSame()&&this.setTargetPosition(this.container,Number(null===(t=this.position)||void 0===t?void 0:t.x),Number(null===(i=this.position)||void 0===i?void 0:i.y))}cleanContainerStyles(){this.containerTransform=""}getContainerTransform(){const t=this.container.getAttribute("data-x"),i=this.container.getAttribute("data-y");return t&&i?(this.dispatchEvent(new CustomEvent("floating-modal-location",{composed:!0,bubbles:!0,detail:{transform:{x:t,y:i}}})),`translate(${t}px, ${i}px)`):this.container.style.transform}setContainerRect(){requestAnimationFrame(()=>{return t=this,i=void 0,o=function*(){yield this.updateComplete,this.containerRect=this.container.getBoundingClientRect(),this.dispatchEvent(new CustomEvent("floating-modal-resize",{composed:!0,bubbles:!0,detail:{size:this.containerRect}})),this.containerTransform=this.getContainerTransform()},new((e=void 0)||(e=Promise))(function(n,a){function s(t){try{l(o.next(t))}catch(t){a(t)}}function r(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(s,r)}l((o=o.apply(t,i||[])).next())});var t,i,e,o})}setInteractInstance(){requestAnimationFrame(()=>{this.container&&((0,l.default)(this.container).draggable({autoScroll:!0,allowFrom:this.header,ignoreFrom:this.body,listeners:{move:this.dragMoveListener,end:this.dragEndListener}}),this.resizable&&(0,l.default)(this.container).resizable({edges:{left:!0,right:!0,bottom:!0,top:!0},listeners:{end:this.resizeEndListener,move:this.resizeMoveListener},modifiers:this.aspectRatio?[l.default.modifiers.aspectRatio({ratio:"preserve",equalDelta:!0,modifiers:[l.default.modifiers.restrictSize({max:"parent"})]})]:void 0}))})}handleClose(t){this.show=!1,this.full=!1,this.dispatchEvent(new CustomEvent("floating-modal-close",{composed:!0,bubbles:!0,detail:{srcEvent:t}}))}handleMinimize(){this.minimizable&&(this.dragOccured||(this.minimize=!this.minimize,this.dispatchEvent(new CustomEvent("floating-modal-minimize",{composed:!0,bubbles:!0,detail:{minimize:this.minimize}}))),this.dragOccured=!1)}handleToggleExpandCollapse(){this.full=!this.full}getTransformValues(t){const{target:i,dx:e,dy:o}=t,{initialX:n,initialY:a}=this.getInitialPosition();return{x:(parseFloat(i.getAttribute("data-x"))||0)+e+n,y:(parseFloat(i.getAttribute("data-y"))||0)+o+a}}setTargetPosition(t,i,e){t.style.transform=`translate(${i}px, ${e}px)`,t.setAttribute("data-x",`${i}`),t.setAttribute("data-y",`${e}`)}destroyInteractInstance(){this.container&&l.default.isSet(this.container)&&(0,l.default)(this.container).unset()}disconnectedCallback(){super.disconnectedCallback(),this.destroyInteractInstance()}renderedCallback(){this.containerTransform=this.position?`translate(${this.position.x}px, ${this.position.y}px)`:""}render(){return d.html`
|
|
44
|
+
${this.show?d.html`
|
|
45
45
|
<div
|
|
46
46
|
class="md-floating ${this.fixed?"fixed":""} ${this.minimize?"hide":""}"
|
|
47
47
|
part="floating"
|
|
48
48
|
role="dialog"
|
|
49
|
-
aria-label=${(0,
|
|
49
|
+
aria-label=${(0,c.ifDefined)(this.label||void 0)}
|
|
50
50
|
aria-modal="true"
|
|
51
|
-
|
|
51
|
+
@keydown=${this.handleModalKeyDown}
|
|
52
|
+
style=${(0,c.ifDefined)(this.containerRect?this.centered?`\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n ${this.full?"width: 100% !important; height: 100% !important;":""}\n `:`width: ${this.full?"100% !important":`${this.containerRect.width}px !important`};\n height: ${this.full?"100% !important":`${this.containerRect.height}px !important`};\n top: ${this.full?"0 !important":""};\n left: ${this.full?"0 !important":""};\n bottom: ${this.full?"0 !important":""};\n right: ${this.full?"0 !important":""};\n ${this.full?"transform: none !important":""};\n ${this.full?"":`transform: ${this.position?`translate(${this.position.x}px, ${this.position.y}px)`:this.containerTransform} !important`};`:void 0)}
|
|
52
53
|
>
|
|
53
54
|
<div class="md-floating__header">
|
|
54
55
|
<div class="md-floating__header-text">
|
|
55
|
-
${this.heading?
|
|
56
|
+
${this.heading?d.html` ${this.heading} `:d.html`
|
|
56
57
|
${!this.minimize&&this.headerSlot}
|
|
57
58
|
<slot name="header"></slot>
|
|
58
59
|
`}
|
|
59
60
|
</div>
|
|
60
|
-
${this.
|
|
61
|
+
${this.full?d.nothing:d.html` <md-button
|
|
62
|
+
color="color-none"
|
|
63
|
+
size="20"
|
|
64
|
+
class="md-floating__move md-floating__header-button"
|
|
65
|
+
ariaLabel="${this.moveAriaLabel}"
|
|
66
|
+
circle
|
|
67
|
+
@keydown=${this.handleMoveKeyDown}
|
|
68
|
+
>
|
|
69
|
+
<md-icon name="drag-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
|
|
70
|
+
</md-button>`}
|
|
71
|
+
${this.minimizable?d.html` <md-button
|
|
61
72
|
color="color-none"
|
|
62
73
|
size="20"
|
|
63
74
|
class="md-floating__minimize md-floating__header-button"
|
|
@@ -66,8 +77,8 @@ import*as t from"@interactjs/actions/drag";import*as i from"@interactjs/actions/
|
|
|
66
77
|
@click=${this.handleMinimize}
|
|
67
78
|
>
|
|
68
79
|
<md-icon name="minus-bold" size="16" iconSet="momentumDesign" ariaHidden="true"></md-icon>
|
|
69
|
-
</md-button>`:
|
|
70
|
-
${!this.minimize&&this.maximizable?
|
|
80
|
+
</md-button>`:d.nothing}
|
|
81
|
+
${!this.minimize&&this.maximizable?d.html` <md-button
|
|
71
82
|
color="color-none"
|
|
72
83
|
size="20"
|
|
73
84
|
class="md-floating__resize md-floating__header-button"
|
|
@@ -97,7 +108,7 @@ import*as t from"@interactjs/actions/drag";import*as i from"@interactjs/actions/
|
|
|
97
108
|
<slot></slot>
|
|
98
109
|
</div>
|
|
99
110
|
</div>
|
|
100
|
-
${this.minimizable?
|
|
111
|
+
${this.minimizable?d.html` <div class="md-floating-min-parent" part="minimize-floating" tabindex="-1">
|
|
101
112
|
<md-floating-modal-minimized
|
|
102
113
|
class="float-modal-min"
|
|
103
114
|
part="floating-minimized"
|
|
@@ -112,6 +123,6 @@ import*as t from"@interactjs/actions/drag";import*as i from"@interactjs/actions/
|
|
|
112
123
|
>
|
|
113
124
|
${this.minimize&&this.headerSlot}
|
|
114
125
|
</md-floating-modal-minimized>
|
|
115
|
-
</div>`:
|
|
116
|
-
`:
|
|
117
|
-
`}};
|
|
126
|
+
</div>`:d.nothing}
|
|
127
|
+
`:d.nothing}
|
|
128
|
+
`}};p([(0,m.property)({type:String})],i.prototype,"heading",void 0),p([(0,m.property)({type:String})],i.prototype,"label",void 0),p([(0,m.property)({type:Boolean,reflect:!0})],i.prototype,"show",void 0),p([(0,m.property)({type:Boolean,reflect:!0,attribute:"aspect-ratio"})],i.prototype,"aspectRatio",void 0),p([(0,m.property)({type:Boolean,reflect:!0,attribute:"centered"})],i.prototype,"centered",void 0),p([(0,m.property)({type:Boolean,reflect:!0,attribute:"fixed-strategy"})],i.prototype,"fixed",void 0),p([(0,m.property)({type:Boolean,reflect:!0,attribute:"full-screen"})],i.prototype,"full",void 0),p([(0,m.property)({type:String,attribute:"close-aria-label"})],i.prototype,"closeAriaLabel",void 0),p([(0,m.property)({type:String,attribute:"resize-aria-label"})],i.prototype,"resizeAriaLabel",void 0),p([(0,m.property)({type:String,attribute:"maximize-aria-label"})],i.prototype,"maximizeScreenLabel",void 0),p([(0,m.property)({type:String,attribute:"minimize-aria-label"})],i.prototype,"minimizeAriaLabel",void 0),p([(0,m.property)({type:String,attribute:"move-aria-label"})],i.prototype,"moveAriaLabel",void 0),p([(0,m.property)({type:Boolean,reflect:!0})],i.prototype,"maximizable",void 0),p([(0,m.property)({type:Boolean,reflect:!0})],i.prototype,"resizable",void 0),p([(0,m.property)({type:Boolean,reflect:!0})],i.prototype,"minimize",void 0),p([(0,m.property)({type:Object})],i.prototype,"position",void 0),p([(0,m.property)({type:Object})],i.prototype,"minPosition",void 0),p([(0,m.property)({type:Boolean,reflect:!0})],i.prototype,"minimizable",void 0),p([(0,m.property)({type:Object})],i.prototype,"containerRect",void 0),p([(0,m.state)()],i.prototype,"dragOccured",void 0),p([(0,m.query)(".md-floating")],i.prototype,"container",void 0),p([(0,m.query)(".md-floating__body")],i.prototype,"body",void 0),p([(0,m.query)(".md-floating__header")],i.prototype,"header",void 0),p([(0,m.query)(".md-floating-min-parent")],i.prototype,"minimizedHeader",void 0),p([(0,m.query)('slot[name="header"]')],i.prototype,"headerSlot",void 0),i=p([(0,s.w)("md-floating-modal")],i),t.ELEMENT=i}(o||(o={}))},7704(t,i,e){e.d(i,{TS:()=>n.T,yC:()=>o.y}),e(2364);var o=e(3203),n=(e(9938),e(5201),e(4781),e(608))},4358(t,i,e){var o;t.exports=(o={},e.d(o,{}),o)},1660(t,i,e){var o;t.exports=(o={},e.d(o,{}),o)},4886(t,i,e){var o;t.exports=(o={},e.d(o,{}),o)},5109(t,i,e){var n,a;t.exports=(n={default:()=>o.default},a={},e.d(a,n),a)},6014(t,i,e){var o;t.exports=(o={},e.d(o,{}),o)},9500(t,i,e){var o,n;t.exports=(o={default:()=>a.default},n={},e.d(n,o),n)},3496(t,i,e){var o,n;t.exports=(o={default:()=>s.default},n={},e.d(n,o),n)},2927(t,i,e){var o,n;t.exports=(o={LitElement:()=>r.LitElement,css:()=>r.css,html:()=>r.html,nothing:()=>r.nothing},n={},e.d(n,o),n)},8899(t,i,e){var o,n;t.exports=(o={property:()=>l.property,query:()=>l.query,state:()=>l.state},n={},e.d(n,o),n)},4955(t,i,e){var o,n;t.exports=(o={classMap:()=>d.classMap},n={},e.d(n,o),n)},3517(t,i,e){var o,n;t.exports=(o={ifDefined:()=>m.ifDefined},n={},e.d(n,o),n)},1156(t,i,e){var o,n;t.exports=(o={styleMap:()=>c.styleMap},n={},e.d(n,o),n)},4980(t,i,e){var o,n;t.exports=(o={action:()=>h.action,observable:()=>h.observable},n={},e.d(n,o),n)}},y={};function v(t){var i=y[t];if(void 0!==i)return i.exports;var e=y[t]={exports:{}};return f[t](e,e.exports,v),e.exports}v.m=f,p=[],v.O=(t,i,e,o)=>{if(!i){var n=1/0;for(l=0;l<p.length;l++){for(var[i,e,o]=p[l],a=!0,s=0;s<i.length;s++)(!1&o||n>=o)&&Object.keys(v.O).every(t=>v.O[t](i[s]))?i.splice(s--,1):(a=!1,o<n&&(n=o));if(a){p.splice(l--,1);var r=e();void 0!==r&&(t=r)}}return t}o=o||0;for(var l=p.length;l>0&&p[l-1][2]>o;l--)p[l]=p[l-1];p[l]=[i,e,o]},v.d=(t,i)=>{for(var e in i)v.o(i,e)&&!v.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},v.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i);export{v as __webpack_require__};u={502:0,561:0,762:0,1745:0,2942:0,4545:0,4928:0,5323:0,5369:0,5958:0,6060:0,6920:0,7704:0,8111:0,8180:0,8442:0,9237:0},v.C=t=>{var i,e,{__webpack_esm_ids__:o,__webpack_esm_modules__:n,__webpack_esm_runtime__:a}=t,s=0;for(i in n)v.o(n,i)&&(v.m[i]=n[i]);for(a&&a(v);s<o.length;s++)e=o[s],v.o(u,e)&&u[e]&&u[e][0](),u[o[s]]=0;v.O()},v.O.j=t=>0===u[t];import*as b from"../9609.js";v.C(b);import*as g from"../4084.js";v.C(g);import*as z from"../3305.js";v.C(z);import*as x from"../4739.js";v.C(x);import*as $ from"../7154.js";v.C($);import*as w from"../9773.js";v.C(w);import*as C from"../5983.js";v.C(C);import*as _ from"../9488.js";v.C(_);import*as P from"../1821.js";v.C(P);import*as E from"../2364.js";v.C(E);import*as A from"../9938.js";v.C(A);import*as L from"../4781.js";v.C(L);import*as I from"../5201.js";v.C(I);import*as S from"../5584.js";v.C(S);import*as O from"../2900.js";v.C(O);import*as M from"../2050.js";v.C(M);import*as T from"../608.js";v.C(T);import*as j from"../7262.js";v.C(j);var R=v.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,2900,2050,608,7262],()=>v(4262));const F=(R=v.O(R)).o;export{F as FloatingModal};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as r from"lit";import*as o from"lit/decorators.js";import*as s from"lit/directives/class-map.js";import*as i from"lit/directives/if-defined.js";import*as a from"lit/directives/style-map.js";import*as l from"mobx";var n,d,p={8637(e,t,r){r.d(t,{I:()=>o}),r(1821);var o,s=r(3876),i=r(7704),a=r(9609),l=r(7154),n=r(4084),d=r(2927),p=r(8899),c=r(4955),h=r(3517),m=r(7155),b=function(e,t,r,o){var s,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(i<3?s(a):i>3?s(t,r,a):s(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};!function(e){let t=class extends((0,i.yC)(d.LitElement)){constructor(){super(...arguments),this.label="Expand",this.checkedLabel="Collapse",this.hovered=!1,this.disabled=!1,this.checked=!1,this.visible=!0,this.focused=!1,this.disableClickToggle=!1,this.alignment="leading",this.dragger=!1,this.shadow=!1}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}static get styles(){return[n.A,m.A]}toggleGrabber(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("grabber-toggled",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}handleMouseDown(){this.disableClickToggle||this.toggleGrabber()}handleKeyDown(e){this.disableClickToggle||(0,l.o)(e.code)&&(e.preventDefault(),this.toggleGrabber())}handleMouseEnter(){this.hovered=!0,this.dispatchHoverEvent()}handleMouseLeave(){this.hovered=!1,this.dispatchHoverEvent()}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}dispatchHoverEvent(){this.dispatchEvent(new CustomEvent("grabber-hover-changed",{bubbles:!0,composed:!0,detail:{hovered:this.hovered}}))}get collapsed(){return!this.checked}get grabberClassMap(){return{"md-grabber--active":this.checked,"md-grabber--disabled":this.disabled,"md-grabber--dragger":this.dragger,[`md-grabber--${this.alignment}`]:this.alignment,visible:this.visible||this.focused,"md-grabber--rtl":this.isRtl}}get grabberContainerClassMap(){return{[`${this.alignment}`]:!0,shadow:this.shadow&&(this.visible||this.checked)}}get isRtl(){return"rtl"===getComputedStyle(this).direction}get iconName(){if(this.dragger)return"list-menu-bold";if("leading"===this.alignment||"trailing"===this.alignment){const e=this.isRtl?"arrow-right-bold":"arrow-left-bold",t=this.isRtl?"arrow-left-bold":"arrow-right-bold";return this.checked?e:t}return this.checked?"arrow-up-bold":"arrow-down-bold"}get iconSize(){return this.dragger||!1===s.vz.isMomentumV2Enabled?"10":"12"}render(){return d.html`
|
|
1
|
+
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as r from"lit";import*as o from"lit/decorators.js";import*as s from"lit/directives/class-map.js";import*as i from"lit/directives/if-defined.js";import*as a from"lit/directives/style-map.js";import*as l from"mobx";var n,d,p={8637(e,t,r){r.d(t,{I:()=>o}),r(1821);var o,s=r(3876),i=r(7704),a=r(9609),l=r(7154),n=r(4084),d=r(2927),p=r(8899),c=r(4955),h=r(3517),m=r(7155),b=function(e,t,r,o){var s,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(i<3?s(a):i>3?s(t,r,a):s(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};!function(e){let t=class extends((0,i.yC)(d.LitElement)){constructor(){super(...arguments),this.label="Expand",this.checkedLabel="Collapse",this.hovered=!1,this.disabled=!1,this.checked=!1,this.visible=!0,this.focused=!1,this.disableClickToggle=!1,this.alignment="leading",this.dragger=!1,this.shadow=!1}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}static get styles(){return[n.A,m.A]}toggleGrabber(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("grabber-toggled",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}handleMouseDown(){this.disableClickToggle||this.toggleGrabber()}handleKeyDown(e){this.disableClickToggle||(0,l.o)(e.code)&&(e.preventDefault(),this.toggleGrabber())}handleMouseEnter(){this.hovered=!0,this.dispatchHoverEvent()}handleMouseLeave(){this.hovered=!1,this.dispatchHoverEvent()}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}dispatchHoverEvent(){this.dispatchEvent(new CustomEvent("grabber-hover-changed",{bubbles:!0,composed:!0,detail:{hovered:this.hovered}}))}get currentLabel(){return this.checked?this.checkedLabel:this.label}get collapsed(){return!this.checked}get grabberClassMap(){return{"md-grabber--active":this.checked,"md-grabber--disabled":this.disabled,"md-grabber--dragger":this.dragger,[`md-grabber--${this.alignment}`]:this.alignment,visible:this.visible||this.focused,"md-grabber--rtl":this.isRtl}}get grabberContainerClassMap(){return{[`${this.alignment}`]:!0,shadow:this.shadow&&(this.visible||this.checked)}}get isRtl(){return"rtl"===getComputedStyle(this).direction}get iconName(){if(this.dragger)return"list-menu-bold";if("leading"===this.alignment||"trailing"===this.alignment){const e=this.isRtl?"arrow-right-bold":"arrow-left-bold",t=this.isRtl?"arrow-left-bold":"arrow-right-bold";return this.checked?e:t}return this.checked?"arrow-up-bold":"arrow-down-bold"}get iconSize(){return this.dragger||!1===s.vz.isMomentumV2Enabled?"10":"12"}render(){return d.html`
|
|
2
2
|
<div class="md-grabber__container ${(0,c.classMap)(this.grabberContainerClassMap)}">
|
|
3
3
|
<button
|
|
4
4
|
class="md-grabber ${(0,c.classMap)(this.grabberClassMap)}"
|
|
5
5
|
part="grabber"
|
|
6
|
-
aria-
|
|
6
|
+
aria-expanded=${this.checked}
|
|
7
7
|
?disabled=${this.disabled}
|
|
8
8
|
tabindex="0"
|
|
9
|
-
aria-label=${(0,h.ifDefined)(this.
|
|
9
|
+
aria-label=${(0,h.ifDefined)(this.currentLabel.length?this.currentLabel:void 0)}
|
|
10
10
|
type="button"
|
|
11
|
-
role="button"
|
|
12
11
|
@click=${this.handleMouseDown}
|
|
13
12
|
@keydown=${this.handleKeyDown}
|
|
14
13
|
@mouseenter=${this.handleMouseEnter}
|
|
@@ -16,7 +15,12 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t
|
|
|
16
15
|
@focus=${this.handleFocus}
|
|
17
16
|
@blur=${this.handleBlur}
|
|
18
17
|
>
|
|
19
|
-
<md-icon
|
|
18
|
+
<md-icon
|
|
19
|
+
name="${this.iconName}"
|
|
20
|
+
size="${this.iconSize}"
|
|
21
|
+
iconSet="momentumDesign"
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
></md-icon>
|
|
20
24
|
</button>
|
|
21
25
|
</div>
|
|
22
|
-
`}};b([(0,p.property)({type:String})],t.prototype,"label",void 0),b([(0,p.property)({type:String})],t.prototype,"checkedLabel",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"hovered",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"disabled",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"checked",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"visible",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"focused",void 0),b([(0,p.property)({type:Boolean,attribute:"disable-click-toggle"})],t.prototype,"disableClickToggle",void 0),b([(0,p.property)({type:String,reflect:!0})],t.prototype,"alignment",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"dragger",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"shadow",void 0),t=b([(0,a.w)("md-grabber")],t),e.ELEMENT=t}(o||(o={}))},9500(t,r,o){var s,i;t.exports=(s={default:()=>e.default},i={},o.d(i,s),i)},3496(e,r,o){var s,i;e.exports=(s={default:()=>t.default},i={},o.d(i,s),i)},2927(e,t,o){var s,i;e.exports=(s={LitElement:()=>r.LitElement,css:()=>r.css,html:()=>r.html,nothing:()=>r.nothing},i={},o.d(i,s),i)},8899(e,t,r){var s,i;e.exports=(s={property:()=>o.property,query:()=>o.query,state:()=>o.state},i={},r.d(i,s),i)},4955(e,t,r){var o,i;e.exports=(o={classMap:()=>s.classMap},i={},r.d(i,o),i)},3517(e,t,r){var o,s;e.exports=(o={ifDefined:()=>i.ifDefined},s={},r.d(s,o),s)},1156(e,t,r){var o,s;e.exports=(o={styleMap:()=>a.styleMap},s={},r.d(s,o),s)},4980(e,t,r){var o,s;e.exports=(o={action:()=>l.action,computed:()=>l.computed,makeObservable:()=>l.makeObservable,observable:()=>l.observable},s={},r.d(s,o),s)}},c={};function h(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return p[e](r,r.exports,h),r.exports}h.m=p,n=[],h.O=(e,t,r,o)=>{if(!t){var s=1/0;for(d=0;d<n.length;d++){for(var[t,r,o]=n[d],i=!0,a=0;a<t.length;a++)(!1&o||s>=o)&&Object.keys(h.O).every(e=>h.O[e](t[a]))?t.splice(a--,1):(i=!1,o<s&&(s=o));if(i){n.splice(d--,1);var l=r();void 0!==l&&(e=l)}}return e}o=o||0;for(var d=n.length;d>0&&n[d-1][2]>o;d--)n[d]=n[d-1];n[d]=[t,r,o]},h.d=(e,t)=>{for(var r in t)h.o(t,r)&&!h.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),h.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{h as __webpack_require__};d={502:0,1745:0,3747:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8442:0},h.C=e=>{var t,r,{__webpack_esm_ids__:o,__webpack_esm_modules__:s,__webpack_esm_runtime__:i}=e,a=0;for(t in s)h.o(s,t)&&(h.m[t]=s[t]);for(i&&i(h);a<o.length;a++)r=o[a],h.o(d,r)&&d[r]&&d[r][0](),d[o[a]]=0;h.O()},h.O.j=e=>0===d[e];import*as m from"../9609.js";h.C(m);import*as b from"../4084.js";h.C(b);import*as g from"../3305.js";h.C(g);import*as u from"../4739.js";h.C(u);import*as f from"../7154.js";h.C(f);import*as v from"../9773.js";h.C(v);import*as y from"../5983.js";h.C(y);import*as C from"../9488.js";h.C(C);import*as j from"../1821.js";h.C(j);import*as k from"../2364.js";h.C(k);import*as w from"../9938.js";h.C(w);import*as _ from"../4781.js";h.C(_);import*as x from"../5201.js";h.C(x);import*as M from"../5584.js";h.C(M);import*as E from"../8227.js";h.C(E);import*as O from"../2900.js";h.C(O);import*as $ from"../7704.js";h.C($);import*as
|
|
26
|
+
`}};b([(0,p.property)({type:String})],t.prototype,"label",void 0),b([(0,p.property)({type:String})],t.prototype,"checkedLabel",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"hovered",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"disabled",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"checked",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"visible",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"focused",void 0),b([(0,p.property)({type:Boolean,attribute:"disable-click-toggle"})],t.prototype,"disableClickToggle",void 0),b([(0,p.property)({type:String,reflect:!0})],t.prototype,"alignment",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"dragger",void 0),b([(0,p.property)({type:Boolean})],t.prototype,"shadow",void 0),t=b([(0,a.w)("md-grabber")],t),e.ELEMENT=t}(o||(o={}))},9500(t,r,o){var s,i;t.exports=(s={default:()=>e.default},i={},o.d(i,s),i)},3496(e,r,o){var s,i;e.exports=(s={default:()=>t.default},i={},o.d(i,s),i)},2927(e,t,o){var s,i;e.exports=(s={LitElement:()=>r.LitElement,css:()=>r.css,html:()=>r.html,nothing:()=>r.nothing},i={},o.d(i,s),i)},8899(e,t,r){var s,i;e.exports=(s={property:()=>o.property,query:()=>o.query,state:()=>o.state},i={},r.d(i,s),i)},4955(e,t,r){var o,i;e.exports=(o={classMap:()=>s.classMap},i={},r.d(i,o),i)},3517(e,t,r){var o,s;e.exports=(o={ifDefined:()=>i.ifDefined},s={},r.d(s,o),s)},1156(e,t,r){var o,s;e.exports=(o={styleMap:()=>a.styleMap},s={},r.d(s,o),s)},4980(e,t,r){var o,s;e.exports=(o={action:()=>l.action,computed:()=>l.computed,makeObservable:()=>l.makeObservable,observable:()=>l.observable},s={},r.d(s,o),s)}},c={};function h(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return p[e](r,r.exports,h),r.exports}h.m=p,n=[],h.O=(e,t,r,o)=>{if(!t){var s=1/0;for(d=0;d<n.length;d++){for(var[t,r,o]=n[d],i=!0,a=0;a<t.length;a++)(!1&o||s>=o)&&Object.keys(h.O).every(e=>h.O[e](t[a]))?t.splice(a--,1):(i=!1,o<s&&(s=o));if(i){n.splice(d--,1);var l=r();void 0!==l&&(e=l)}}return e}o=o||0;for(var d=n.length;d>0&&n[d-1][2]>o;d--)n[d]=n[d-1];n[d]=[t,r,o]},h.d=(e,t)=>{for(var r in t)h.o(t,r)&&!h.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),h.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{h as __webpack_require__};d={502:0,1745:0,3747:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8442:0},h.C=e=>{var t,r,{__webpack_esm_ids__:o,__webpack_esm_modules__:s,__webpack_esm_runtime__:i}=e,a=0;for(t in s)h.o(s,t)&&(h.m[t]=s[t]);for(i&&i(h);a<o.length;a++)r=o[a],h.o(d,r)&&d[r]&&d[r][0](),d[o[a]]=0;h.O()},h.O.j=e=>0===d[e];import*as m from"../9609.js";h.C(m);import*as b from"../4084.js";h.C(b);import*as g from"../3305.js";h.C(g);import*as u from"../4739.js";h.C(u);import*as f from"../7154.js";h.C(f);import*as v from"../9773.js";h.C(v);import*as y from"../5983.js";h.C(y);import*as C from"../9488.js";h.C(C);import*as j from"../1821.js";h.C(j);import*as k from"../2364.js";h.C(k);import*as w from"../9938.js";h.C(w);import*as _ from"../4781.js";h.C(_);import*as x from"../5201.js";h.C(x);import*as M from"../5584.js";h.C(M);import*as E from"../8227.js";h.C(E);import*as O from"../2900.js";h.C(O);import*as $ from"../7704.js";h.C($);import*as L from"../3876.js";h.C(L);import*as B from"../7155.js";h.C(B);var D=h.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,2900,7704,3876,7155],()=>h(8637));const R=(D=h.O(D)).I;export{R as Grabber};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as i from"lit";import*as s from"lit/decorators.js";import*as a from"lit/directives/class-map.js";import*as o from"lit/directives/if-defined.js";import*as r from"lit/directives/repeat.js";import*as l from"lit/directives/style-map.js";import*as n from"mobx";var p,d,h={9189(e,t,i){i.d(t,{$j:()=>v,IQ:()=>g,L2:()=>b,Nl:()=>x,OU:()=>f,We:()=>C,XO:()=>w,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,x=["before","after"],C=[0,1,2,3],w=["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="
|
|
1
|
+
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as i from"lit";import*as s from"lit/decorators.js";import*as a from"lit/directives/class-map.js";import*as o from"lit/directives/if-defined.js";import*as r from"lit/directives/repeat.js";import*as l from"lit/directives/style-map.js";import*as n from"mobx";var p,d,h={9189(e,t,i){i.d(t,{$j:()=>v,IQ:()=>g,L2:()=>b,Nl:()=>x,OU:()=>f,We:()=>C,XO:()=>w,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,x=["before","after"],C=[0,1,2,3],w=["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`
|
|
2
2
|
<textarea
|
|
3
3
|
part="input"
|
|
4
4
|
class="md-input ${(0,d.classMap)(this.inputTemplateClassMap)}"
|
|
@@ -12,7 +12,7 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t
|
|
|
12
12
|
aria-describedby=${this.ariaDescribedBy}
|
|
13
13
|
?required=${this.required}
|
|
14
14
|
?autofocus=${this.autofocus}
|
|
15
|
-
aria-label=${this.
|
|
15
|
+
aria-label=${(0,h.ifDefined)(this.effectiveAriaLabel)}
|
|
16
16
|
aria-invalid=${this.ariaInvalid}
|
|
17
17
|
aria-errormessage="${this.htmlId}-message"
|
|
18
18
|
aria-disabled=${(0,h.ifDefined)(this.disabled||void 0)}
|
|
@@ -39,7 +39,7 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t
|
|
|
39
39
|
aria-describedby=${this.ariaDescribedBy}
|
|
40
40
|
aria-controls=${this.ariaControls}
|
|
41
41
|
aria-expanded=${(0,h.ifDefined)(null!==(e=this.ariaExpandedValue)&&void 0!==e?e:void 0)}
|
|
42
|
-
aria-label=${this.
|
|
42
|
+
aria-label=${(0,h.ifDefined)(this.effectiveAriaLabel)}
|
|
43
43
|
aria-invalid=${this.ariaInvalid}
|
|
44
44
|
aria-errormessage=${`${this.htmlId}-message`}
|
|
45
45
|
aria-disabled=${(0,h.ifDefined)(this.disabled||void 0)}
|
|
@@ -154,4 +154,4 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t
|
|
|
154
154
|
${this.characterCountLabelTemplate()}
|
|
155
155
|
</div>
|
|
156
156
|
</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},3496(e,i,s){var a,o;e.exports=(a={default:()=>t.default},o={},s.d(o,a),o)},2927(e,t,s){var a,o;e.exports=(a={LitElement:()=>i.LitElement,css:()=>i.css,html:()=>i.html,nothing:()=>i.nothing},o={},s.d(o,a),o)},8899(e,t,i){var a,o;e.exports=(a={property:()=>s.property,query:()=>s.query,state:()=>s.state},o={},i.d(o,a),o)},4955(e,t,i){var s,o;e.exports=(s={classMap:()=>a.classMap},o={},i.d(o,s),o)},3517(e,t,i){var s,a;e.exports=(s={ifDefined:()=>o.ifDefined},a={},i.d(a,s),a)},2577(e,t,i){var s,a;e.exports=(s={repeat:()=>r.repeat},a={},i.d(a,s),a)},1156(e,t,i){var s,a;e.exports=(s={styleMap:()=>l.styleMap},a={},i.d(a,s),a)},4980(e,t,i){var s,a;e.exports=(s={action:()=>n.action,observable:()=>n.observable},a={},i.d(a,s),a)}},m={};function u(e){var t=m[e];if(void 0!==t)return t.exports;var i=m[e]={exports:{}};return h[e](i,i.exports,u),i.exports}u.m=h,p=[],u.O=(e,t,i,s)=>{if(!t){var a=1/0;for(n=0;n<p.length;n++){for(var[t,i,s]=p[n],o=!0,r=0;r<t.length;r++)(!1&s||a>=s)&&Object.keys(u.O).every(e=>u.O[e](t[r]))?t.splice(r--,1):(o=!1,s<a&&(a=s));if(o){p.splice(n--,1);var l=i();void 0!==l&&(e=l)}}return e}s=s||0;for(var n=p.length;n>0&&p[n-1][2]>s;n--)p[n]=p[n-1];p[n]=[t,i,s]},u.d=(e,t)=>{for(var i in t)u.o(t,i)&&!u.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{u as __webpack_require__};d={502:0,1266:0,1745:0,2169:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8442:0,9189:0},u.C=e=>{var t,i,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:o}=e,r=0;for(t in a)u.o(a,t)&&(u.m[t]=a[t]);for(o&&o(u);r<s.length;r++)i=s[r],u.o(d,i)&&d[i]&&d[i][0](),d[s[r]]=0;u.O()},u.O.j=e=>0===d[e];import*as c from"../9609.js";u.C(c);import*as y from"../4084.js";u.C(y);import*as v from"../3305.js";u.C(v);import*as g from"../4739.js";u.C(g);import*as b from"../7154.js";u.C(b);import*as f from"../9773.js";u.C(f);import*as $ from"../5983.js";u.C($);import*as x from"../9488.js";u.C(x);import*as C from"../1821.js";u.C(C);import*as w from"../519.js";u.C(w);import*as S from"../8441.js";u.C(S);import*as
|
|
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},3496(e,i,s){var a,o;e.exports=(a={default:()=>t.default},o={},s.d(o,a),o)},2927(e,t,s){var a,o;e.exports=(a={LitElement:()=>i.LitElement,css:()=>i.css,html:()=>i.html,nothing:()=>i.nothing},o={},s.d(o,a),o)},8899(e,t,i){var a,o;e.exports=(a={property:()=>s.property,query:()=>s.query,state:()=>s.state},o={},i.d(o,a),o)},4955(e,t,i){var s,o;e.exports=(s={classMap:()=>a.classMap},o={},i.d(o,s),o)},3517(e,t,i){var s,a;e.exports=(s={ifDefined:()=>o.ifDefined},a={},i.d(a,s),a)},2577(e,t,i){var s,a;e.exports=(s={repeat:()=>r.repeat},a={},i.d(a,s),a)},1156(e,t,i){var s,a;e.exports=(s={styleMap:()=>l.styleMap},a={},i.d(a,s),a)},4980(e,t,i){var s,a;e.exports=(s={action:()=>n.action,observable:()=>n.observable},a={},i.d(a,s),a)}},m={};function u(e){var t=m[e];if(void 0!==t)return t.exports;var i=m[e]={exports:{}};return h[e](i,i.exports,u),i.exports}u.m=h,p=[],u.O=(e,t,i,s)=>{if(!t){var a=1/0;for(n=0;n<p.length;n++){for(var[t,i,s]=p[n],o=!0,r=0;r<t.length;r++)(!1&s||a>=s)&&Object.keys(u.O).every(e=>u.O[e](t[r]))?t.splice(r--,1):(o=!1,s<a&&(a=s));if(o){p.splice(n--,1);var l=i();void 0!==l&&(e=l)}}return e}s=s||0;for(var n=p.length;n>0&&p[n-1][2]>s;n--)p[n]=p[n-1];p[n]=[t,i,s]},u.d=(e,t)=>{for(var i in t)u.o(t,i)&&!u.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{u as __webpack_require__};d={502:0,1266:0,1745:0,2169:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8442:0,9189:0},u.C=e=>{var t,i,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:o}=e,r=0;for(t in a)u.o(a,t)&&(u.m[t]=a[t]);for(o&&o(u);r<s.length;r++)i=s[r],u.o(d,i)&&d[i]&&d[i][0](),d[s[r]]=0;u.O()},u.O.j=e=>0===d[e];import*as c from"../9609.js";u.C(c);import*as y from"../4084.js";u.C(y);import*as v from"../3305.js";u.C(v);import*as g from"../4739.js";u.C(g);import*as b from"../7154.js";u.C(b);import*as f from"../9773.js";u.C(f);import*as $ from"../5983.js";u.C($);import*as x from"../9488.js";u.C(x);import*as C from"../1821.js";u.C(C);import*as w from"../519.js";u.C(w);import*as S from"../8441.js";u.C(S);import*as L from"../2797.js";u.C(L);import*as E from"../9983.js";u.C(E);import*as T from"../3970.js";u.C(T);import*as _ from"../7906.js";u.C(_);import*as M from"../9336.js";u.C(M);import*as D from"../2369.js";u.C(D);var j=u.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,8441,2797,9983,3970,7906,9336,2369],()=>u(9189));const B=(j=u.O(j)).pd,k=j.XO,O=j.$j,I=j.kj,R=j.Nl,A=j.OU,z=j.IQ,P=j.L2,F=j.We;export{B as Input,k as ariaInvalidType,O as containerSize,I as iconNames,R as iconPosition,A as inputShape,z as inputSize,P as inputType,F as nestedLevel};
|