@momentum-ui/web-components 3.0.0-beta.6 → 3.0.0-beta.8
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/3739.js +1 -1
- package/dist/6408.js +25 -16
- package/dist/7833.js +1 -1
- package/dist/8161.js +1 -1
- package/dist/9409.js +1 -1
- package/dist/comp/md-advance-list-entry.js +19 -19
- package/dist/comp/md-chat-message-entry.js +13 -11
- package/dist/comp/md-editable-field-entry.js +5 -6
- package/dist/comp/md-input-entry.js +13 -4
- package/dist/index-entry.js +66 -56
- package/dist/index.js +1 -1
- package/dist/types/components/avatar/Avatar.d.ts +3 -3
- package/dist/types/components/badge/Badge.d.ts +1 -1
- package/dist/types/components/button/Button.d.ts +2 -2
- package/dist/types/components/chat-message/ChatMessage.d.ts +1 -0
- package/dist/types/components/chip/Chip.d.ts +3 -3
- package/dist/types/components/combobox/ComboBox.d.ts +4 -4
- package/dist/types/components/dropdown/Dropdown.d.ts +2 -2
- package/dist/types/components/editable-textfield/EditableTextfield.d.ts +1 -1
- package/dist/types/components/input/Input.d.ts +7 -5
- package/dist/types/components/taskitem/TaskItem.utils.d.ts +1 -1
- package/dist/types/internal-components/color-table/ColorTable.d.ts +1 -1
- package/package.json +1 -1
package/dist/9409.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[9409],{9409:(o,d,
|
|
1
|
+
"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[9409],{9409:(o,d,c)=>{c.d(d,{A:()=>r});const r=c(87161).css`:host(:focus){box-shadow:none;outline:0!important}:host(md-accordion){font-size:var(--font-size-body-midsize,14px)}:host(md-accordion) .md-accordion{width:100%;border-radius:.5rem}:host(md-accordion[focusable]) .md-accordion{box-shadow:0 0 0 .125rem var(--md-default-focus-outline-color)}:host(md-accordion[focusable]) .md-accordion-header{background:var(--accordion-bg-focus)}@media(forced-colors:active){:host(md-accordion[focusable]) .md-accordion{outline:1px solid Highlight}}:host(md-accordion-item){display:block}:host(md-accordion-item) .md-accordion-header{align-content:center;align-items:stretch;display:flex;flex-flow:row nowrap;justify-content:space-between}:host(md-accordion-item) .md-accordion-item{margin-bottom:.5rem;border-radius:.5rem;border:1px solid var(--accordion-border-color);background-color:var(--accordion-default-background)}:host(md-accordion-item) .md-accordion-expander{background:0 0;border:0;cursor:pointer;margin:0;outline:0;padding:0;align-content:center;align-items:stretch;display:flex;flex-flow:row nowrap;justify-content:flex-start;border-radius:.1875rem;flex:0 1 100%;padding:.5rem}:host(md-accordion-item) .md-accordion-expander md-icon{transition:all .15s linear;display:flex;margin:0;margin-inline-start:auto}:host(md-accordion-item) .md-accordion-expander-label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;font-family:var(--brand-font-bold);font-weight:var(--brand-font-weight-bold);color:var(--md-secondary-text-color);display:flex;flex:0 1 auto}:host(md-accordion-item) .md-accordion-panel{display:none;padding:.5rem}:host(md-accordion-item[expanded]) .md-accordion-item:hover .md-accordion-header{background-color:var(--accordion-default-background)}:host(md-accordion-item[expanded]) .md-accordion-header{background-color:var(--accordion-default-background)}:host(md-accordion-item[expanded]) .md-accordion-panel{display:block}:host(md-accordion-item[expanded]) .md-accordion-expander md-icon{transform:rotate(180deg)}:host(md-accordion-item[focus-visible]) .md-accordion-item{box-shadow:0 0 0 .125rem var(--md-default-focus-outline-color);border-radius:.5rem}:host(md-accordion-item[focus-visible]) .md-accordion-item .md-accordion-header{background-color:var(--accordion-active-background)}:host(md-accordion-item[focus-visible][expanded]) .md-accordion-header{background-color:var(--accordion-default-background)}:host(md-accordion-item) .md-accordion-item:hover .md-accordion-header{background-color:var(--accordion-hover-background)}:host(md-accordion-item[disabled]) .md-accordion-expander{color:var(--md-disabled-text-color);cursor:not-allowed}@media(forced-colors:active){:host(md-accordion-item[focus-visible]) .md-accordion-expander{outline:.125rem solid Highlight}:host(md-accordion-item) .md-accordion-item:hover .md-accordion-header{outline:.125rem solid Highlight}:host(md-accordion-item[disabled]) .md-accordion-expander{opacity:.5}}`}}]);
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
!function(t
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("@lit-labs/virtualizer"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","@lit-labs/virtualizer"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("@lit-labs/virtualizer")):t(e.lit,e["lit/decorators.js"],e["@lit-labs/virtualizer"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i)=>(()=>{"use strict";var s,r={28307:(e,t,i)=>{i.r(t),i.d(t,{AdvanceList:()=>s});var s,r=i(90195),l=i(31890),d=i(32972),a=i(4313),o=(i(83048),i(87161)),n=i(70429),h=i(89312),c=function(e,t,i,s){var r,l=arguments.length,d=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(d=(l<3?r(d):l>3?r(t,i,d):r(t,i))||d);return l>3&&d&&Object.defineProperty(t,i,d),d};!function(e){e.prefixId="item-";let t=class extends((0,d.y)(o.LitElement)){constructor(){super(...arguments),this.items=[],this.isLoading=!1,this.isMulti=!1,this.groupOnMultiSelect=!1,this.value=[],this.ariaRoleList="listbox",this.ariaRoleListItem="option",this.ariaLabelList="",this.isError=!1,this.containerHeight="292px",this.lastSelectedIdByOrder="",this.selectAllItems=!1,this.focusReset=!1,this.disabledItems=[],this.totalRecords=0,this.isNonSelectable=!1,this.scrollIndex=-1,this.activeId="",this.selectedItemsIds=[],this.isUserNavigated=!1,this.handleKeyDown=t=>{var i,s,l;const{ArrowDown:d,ArrowUp:a,Tab:o,Space:n,Enter:h}=r.Uz,{code:c}=t,p=c===d,u=c===a,v=c===o,m=c===n,b=c===h;if(p||u){if(t.preventDefault(),this.isUserNavigated=!0,""===this.activeId&&this.value.length>0&&""!==this.value[0])return void(this.activeId=this.value[0]);if(""===this.activeId&&!u&&this.items.length>0)return void(this.activeId=this.items[0].id);const e=this.items.findIndex(e=>e.id===this.activeId);p?e<this.items.length-1&&!this.isNextElemenentStatusIndicator(e)&&(this.scrollIndex=e+1,this.activeId=this.items[this.scrollIndex].id,null===(i=this.virtualizer)||void 0===i||i.scrollToIndex(this.scrollIndex,"start")):e>0&&(this.scrollIndex=e-1,this.activeId=this.items[this.scrollIndex].id,null===(s=this.virtualizer)||void 0===s||s.scrollToIndex(this.scrollIndex,"start"))}else if(v)""===this.activeId&&this.value.length>0&&(this.activeId=this.value[0]);else if((m||b)&&(t.preventDefault(),this.activeId)){const t=null===(l=this.shadowRoot)||void 0===l?void 0:l.querySelector(`#${e.prefixId}${this.activeId}`);t&&("true"===t.getAttribute("aria-disabled")||t.hasAttribute("disabled")||this.updateItemSelection(t))}},this.handleRangeChange=e=>{const{last:t}=e;this.updateSelectedState(),this.items.length<this.totalRecords&&t>=this.items.length-1&&!this.isLoading&&!this.isError&&this.dispatchEvent(new CustomEvent("load-more",{bubbles:!0,composed:!0})),this.isUserNavigated=!1},this.renderItem=(t,i)=>{if(!t)return o.html`<div class="default-wrapper-error">Invalid item</div>`;if(!t.id)return console.warn(`AdvanceList.renderItem: item missing id at index ${i}`,t),o.html`<div class="default-wrapper-error">Item missing ID</div>`;try{return"status-indicator"===t.id?o.html`
|
|
2
|
+
<div class="default-wrapper-status-indicator" id="status-indicator">${t.template(t,i)}</div>
|
|
3
|
+
`:o.html`
|
|
4
|
+
<div
|
|
5
|
+
class="default-wrapper ${t.id} ${this.isNonSelectable?"non-selectable":""}"
|
|
6
|
+
part="advance-list-item-wrapper"
|
|
7
|
+
aria-setsize="${this.totalRecords}"
|
|
8
|
+
aria-posinset="${i+1}"
|
|
9
|
+
role="${this.ariaRoleListItem}"
|
|
10
|
+
aria-label=${t.name||"Unknown item"}
|
|
11
|
+
id="${e.prefixId}${t.id}"
|
|
12
|
+
data-index="${i}"
|
|
13
|
+
>
|
|
14
|
+
${t.template(t,i)}
|
|
15
|
+
</div>
|
|
16
|
+
`}catch(e){return console.error(`AdvanceList.renderItem: Error rendering item ${t.id} at index ${i}:`,e,t),o.html`<div class="default-wrapper-error">Error rendering item</div>`}}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick)}static get styles(){return[a.A,h.A]}getStyles(){return o.html`
|
|
17
17
|
<style>
|
|
18
18
|
:host .virtual-scroll {
|
|
19
19
|
height: ${this.containerHeight};
|
|
20
20
|
}
|
|
21
21
|
</style>
|
|
22
|
-
`}disconnectedCallback(){var
|
|
22
|
+
`}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),null===(e=this.listContainer)||void 0===e||e.removeEventListener("keydown",this.handleKeyDown)}firstUpdated(e){var t;super.firstUpdated(e),null===(t=this.listContainer)||void 0===t||t.addEventListener("keydown",this.handleKeyDown)}willUpdate(e){var t;null===(t=super.willUpdate)||void 0===t||t.call(this,e),e.has("value")&&(void 0!==e.get("value")||this.value.length>0)&&(this.selectedItemsIds=this.value),e.has("selectAllItems")&&this.selectAllItems&&(this.selectedItemsIds=this.items.filter(e=>e&&e.id&&!this.disabledItems.includes(e.id)).map(e=>e.id)),e.has("focusReset")&&this.focusReset&&(this.activeId="")}updated(e){super.updated(e),e.has("value")&&(void 0!==e.get("value")||this.value.length>0)&&this.updateSelectedState(),e.has("selectAllItems")&&this.selectAllItems&&(this.updateSelectedState(),this.notifySelectedChange())}setCheckboxAttributes(e,t){var i,s,r,l;!e||(null===(i=t.firstElementChild)||void 0===i?void 0:i.hasAttribute("disabled"))&&"true"===(null===(s=t.firstElementChild)||void 0===s?void 0:s.getAttribute("aria-disabled"))?null===(l=t.querySelector("md-checkbox"))||void 0===l||l.removeAttribute("checked"):null===(r=t.querySelector("md-checkbox"))||void 0===r||r.setAttribute("checked","true")}updateWrapperAttributes(e,t){this.isMulti?this.setCheckboxAttributes(t,e):e.classList.toggle("selected",t),e.setAttribute("selected",t.toString()),e.setAttribute("aria-selected",t.toString()),e.setAttribute("tabindex",t?"0":"-1")}updateSelectedState(){var t;Array.from((null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".default-wrapper"))||[]).forEach(t=>{var i,s;const r=this.selectedItemsIds.some(i=>t.id===`${e.prefixId}${i}`);this.updateWrapperAttributes(t,r),this.groupOnMultiSelect&&this.value.length>0&&this.items.length!==this.value.length&&t.id===`${e.prefixId}${this.lastSelectedIdByOrder}`?t.classList.add("selected-border-bottom"):t.classList.remove("selected-border-bottom"),t.id===`${e.prefixId}${this.activeId}`?(t.setAttribute("tabindex","0"),t.focus()):t.setAttribute("tabindex","-1"),""==this.activeId&&t.id===`${e.prefixId}${this.value[0]}`&&t.setAttribute("tabindex","0"),(null===(i=t.firstElementChild)||void 0===i?void 0:i.hasAttribute("disabled"))||"true"===(null===(s=t.firstElementChild)||void 0===s?void 0:s.getAttribute("aria-disabled"))?(t.setAttribute("disabled",""),t.setAttribute("aria-disabled","true")):(t.removeAttribute("disabled"),t.removeAttribute("aria-disabled"))})}findClickedItem(e){var t;const i=Array.from((null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".default-wrapper"))||[]),s=e.composedPath(),r=i.find(e=>s.includes(e));if(r)return(null==r?void 0:r.hasAttribute("disabled"))||"true"===(null==r?void 0:r.getAttribute("aria-disabled"))?0:r}isNextElemenentStatusIndicator(e){return(this.isLoading||this.isError)&&e===this.items.length-2}updateItemForMultiSelect(e){const t=this.selectedItemsIds.indexOf(e);-1===t?(this.selectedItemsIds.push(this.activeId),this.selectedItemsIds.length===this.items.length-this.disabledItems.length&&(this.selectAllItems=!0)):(this.selectedItemsIds.splice(t,1),this.selectAllItems=!1)}updateItemSelection(e){e&&(this.activeId=e.id.substring(e.id.indexOf("-")+1),this.isMulti?this.updateItemForMultiSelect(this.activeId):this.selectedItemsIds=[this.activeId],this.updateSelectedState(),this.notifySelectedChange())}handleClick(e){e.preventDefault(),this.isUserNavigated=!1;const t=this.findClickedItem(e);t&&(this.scrollIndex=parseInt(t.getAttribute("index")||"0"),this.updateItemSelection(t))}notifySelectedChange(){this.dispatchEvent(new CustomEvent("list-item-change",{detail:{selected:this.selectedItemsIds},bubbles:!0,composed:!0}))}getActiveDescendant(){return this.activeId?`${e.prefixId}${this.activeId}`:this.value?`${e.prefixId}${this.value[0]}`:""}render(){return o.html`
|
|
23
23
|
${this.getStyles()}
|
|
24
24
|
<div
|
|
25
25
|
class="md-advance-list-wrapper virtual-scroll"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
>
|
|
33
33
|
<lit-virtualizer
|
|
34
34
|
.items=${this.items}
|
|
35
|
-
.renderItem=${(t
|
|
35
|
+
.renderItem=${(e,t)=>this.renderItem(e,t)}
|
|
36
36
|
></lit-virtualizer>
|
|
37
37
|
</div>
|
|
38
|
-
`}};c([(0,n.property)({type:Array})],
|
|
38
|
+
`}};c([(0,n.property)({type:Array})],t.prototype,"items",void 0),c([(0,n.property)({type:Boolean})],t.prototype,"isLoading",void 0),c([(0,n.property)({type:Boolean,attribute:"is-multi"})],t.prototype,"isMulti",void 0),c([(0,n.property)({type:Boolean})],t.prototype,"groupOnMultiSelect",void 0),c([(0,n.property)({type:Array})],t.prototype,"value",void 0),c([(0,n.property)({type:String})],t.prototype,"ariaRoleList",void 0),c([(0,n.property)({type:String})],t.prototype,"ariaRoleListItem",void 0),c([(0,n.property)({type:String})],t.prototype,"ariaLabelList",void 0),c([(0,n.property)({type:Boolean})],t.prototype,"isError",void 0),c([(0,n.property)({type:String})],t.prototype,"containerHeight",void 0),c([(0,n.property)({type:String})],t.prototype,"lastSelectedIdByOrder",void 0),c([(0,n.property)({type:Boolean})],t.prototype,"selectAllItems",void 0),c([(0,n.property)({type:Boolean})],t.prototype,"focusReset",void 0),c([(0,n.property)({type:Array})],t.prototype,"disabledItems",void 0),c([(0,n.property)({type:Number})],t.prototype,"totalRecords",void 0),c([(0,n.property)({type:Boolean})],t.prototype,"isNonSelectable",void 0),c([(0,n.query)(".virtual-scroll")],t.prototype,"listContainer",void 0),c([(0,n.query)("lit-virtualizer")],t.prototype,"virtualizer",void 0),c([(0,n.state)()],t.prototype,"scrollIndex",void 0),c([(0,n.state)()],t.prototype,"activeId",void 0),c([(0,n.state)()],t.prototype,"selectedItemsIds",void 0),c([(0,n.state)()],t.prototype,"isUserNavigated",void 0),t=c([(0,l.w)("md-advance-list")],t),e.ELEMENT=t}(s||(s={}))},70429:e=>{e.exports=t},83048:e=>{e.exports=i},87161:t=>{t.exports=e}},l={};function d(e){var t=l[e];if(void 0!==t)return t.exports;var i=l[e]={exports:{}};return r[e](i,i.exports,d),i.exports}d.m=r,s=[],d.O=(e,t,i,r)=>{if(!t){var l=1/0;for(h=0;h<s.length;h++){for(var[t,i,r]=s[h],a=!0,o=0;o<t.length;o++)(!1&r||l>=r)&&Object.keys(d.O).every(e=>d.O[e](t[o]))?t.splice(o--,1):(a=!1,r<l&&(l=r));if(a){s.splice(h--,1);var n=i();void 0!==n&&(e=n)}}return e}r=r||0;for(var h=s.length;h>0&&s[h-1][2]>r;h--)s[h]=s[h-1];s[h]=[t,i,r]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var i in t)d.o(t,i)&&!d.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={3079:0};d.O.j=t=>0===e[t];var t=(t,i)=>{var s,r,[l,a,o]=i,n=0;if(l.some(t=>0!==e[t])){for(s in a)d.o(a,s)&&(d.m[s]=a[s]);if(o)var h=o(d)}for(t&&t(i);n<l.length;n++)r=l[n],d.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return d.O(h)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var a=d.O(void 0,[1890,4313,2576,8210,1270,9312],()=>d(28307));return d.O(a)})());
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/until.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/until.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/until.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/until.js"]);for(var
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/until.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/until.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/until.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/until.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,r,o,a,l,p)=>(()=>{"use strict";var d,m={10318:e=>{e.exports=s},20291:e=>{e.exports=r},32022:e=>{e.exports=o},60554:e=>{e.exports=a},70429:e=>{e.exports=t},85125:e=>{e.exports=i},85314:e=>{e.exports=l},87161:t=>{t.exports=e},89756:e=>{e.exports=p},95281:(e,t,i)=>{i.r(t),i.d(t,{ChatMessage:()=>s}),i(38028);var s,r=i(31890),o=i(4313),a=i(87161),l=i(70429),p=i(20291),d=i(67833),m=function(e,t,i,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};!function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.title="",this.src="",this.time="",this.label="Avatar",this.status="",this.clickableTimestamp=!1,this.isSelected=!1,this.self=!1}get computedAvatarType(){return void 0!==this.avatarType?this.avatarType:this.self?"self":void 0}get computedYouLabel(){return this.selfLabel||"You"}get isSelfType(){return void 0===this.avatarType?this.self:"self"===this.avatarType}timeStampClicked(){this.dispatchEvent(new CustomEvent("timestamp-clicked",{bubbles:!0,composed:!0}))}static get styles(){return[o.A,d.A]}render(){return a.html`
|
|
2
2
|
<div class="md-chat-message">
|
|
3
|
-
<md-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
<div class="md-chat-message_avatar">
|
|
4
|
+
<md-avatar
|
|
5
|
+
type=${(0,p.ifDefined)(this.computedAvatarType)}
|
|
6
|
+
title=${this.self?"self":this.title}
|
|
7
|
+
label="${this.label}"
|
|
8
|
+
src=${(0,p.ifDefined)(this.self?void 0:this.src)}
|
|
9
|
+
color=${(0,p.ifDefined)(this.avatarColor)}
|
|
10
|
+
size=${(0,p.ifDefined)(this.avatarSize)}
|
|
11
|
+
></md-avatar>
|
|
12
|
+
</div>
|
|
11
13
|
|
|
12
|
-
<div class="md-chat-message_content">
|
|
14
|
+
<div class="md-chat-message_content ${this.isSelected?"selected":""}">
|
|
13
15
|
<div class="md-chat-message_heading">
|
|
14
16
|
<div class="md-chat-message_title">
|
|
15
17
|
<span>${this.isSelfType?this.computedYouLabel:this.title}</span>
|
|
@@ -29,4 +31,4 @@
|
|
|
29
31
|
</div>
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
|
-
`}};
|
|
34
|
+
`}};m([(0,l.property)({type:String})],t.prototype,"title",void 0),m([(0,l.property)({type:String})],t.prototype,"src",void 0),m([(0,l.property)({type:String})],t.prototype,"time",void 0),m([(0,l.property)({type:String})],t.prototype,"label",void 0),m([(0,l.property)({type:String})],t.prototype,"status",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"clickableTimestamp",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"isSelected",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"self-label"})],t.prototype,"selfLabel",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"self",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"avatar-color"})],t.prototype,"avatarColor",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"avatar-type"})],t.prototype,"avatarType",void 0),m([(0,l.property)({type:Number,reflect:!0,attribute:"avatar-size"})],t.prototype,"avatarSize",void 0),t=m([(0,r.w)("md-chat-message")],t),e.ELEMENT=t}(s||(s={}))}},n={};function c(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return m[e](i,i.exports,c),i.exports}c.m=m,d=[],c.O=(e,t,i,s)=>{if(!t){var r=1/0;for(p=0;p<d.length;p++){for(var[t,i,s]=d[p],o=!0,a=0;a<t.length;a++)(!1&s||r>=s)&&Object.keys(c.O).every(e=>c.O[e](t[a]))?t.splice(a--,1):(o=!1,s<r&&(r=s));if(o){d.splice(p--,1);var l=i();void 0!==l&&(e=l)}}return e}s=s||0;for(var p=d.length;p>0&&d[p-1][2]>s;p--)d[p]=d[p-1];d[p]=[t,i,s]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var i in t)c.o(t,i)&&!c.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={7684:0};c.O.j=t=>0===e[t];var t=(t,i)=>{var s,r,[o,a,l]=i,p=0;if(o.some(t=>0!==e[t])){for(s in a)c.o(a,s)&&(c.m[s]=a[s]);if(l)var d=l(c)}for(t&&t(i);p<o.length;p++)r=o[p],c.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return c.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var u=c.O(void 0,[8493,1890,4313,510,5087,6283,2176,6798,6865,1200,2576,7292,6188,15,8923,7119,1465,8028,7833],()=>c(95281));return c.O(u)})());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"),require("dompurify"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js","dompurify"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"),require("dompurify")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"],e.dompurify);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,r,l,o,a,
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"),require("dompurify"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js","dompurify"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"),require("dompurify")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"],e.dompurify);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,r,l,o,n,a,d)=>(()=>{"use strict";var p,c={10318:e=>{e.exports=s},20291:e=>{e.exports=r},31347:e=>{e.exports=d},32022:e=>{e.exports=l},50565:(e,t,i)=>{i.r(t),i.d(t,{EditableTextfield:()=>v,alignment:()=>u}),i(96408);var s=i(31890),r=i(74548),l=i(4313),o=i(31347),n=i.n(o),a=i(87161),d=i(70429),p=i(85125),c=i(20291),h=i(32093),m=function(e,t,i,s){var r,l=arguments.length,o=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(o=(l<3?r(o):l>3?r(t,i,o):r(t,i))||o);return l>3&&o&&Object.defineProperty(t,i,o),o};const u=["left","right","center"];var v;!function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.alignment="left",this.disabled=!1,this.isEditing=!1,this.maxLines="",this.content="Click to edit text",this.message={type:"error",message:"That is not a valid input."},this.alert=!1,this.hideMessage=!1,this.pattern="",this.type=null,this.ariaLabel="editable field",this.ariaDescribedBy="",this.reportValidity=()=>{this.dispatchEvent(new Event("invalid",{bubbles:!1,cancelable:!0,composed:!0}))},this.checkValidity=e=>{let t=!0;const i=i=>{null===e.match(i)&&(t=!1)};if(this.pattern)i(new RegExp(this.pattern));else if(e&&this.type)switch(this.type){case"integer":i(new RegExp(r.b.integerString));break;case"decimal":i(new RegExp(r.b.decimalString))}return t},this.handleFocus=()=>{this.disabled||(this.isEditing=!0,this.setRange())},this.handleKeydown=e=>{var t,i;const{key:s,code:r}=e;if(!["Tab","Meta","Shift","Delete","Backspace","Arrow"].some(e=>r.includes(e)))if("integer"===this.type&&(s.includes(".")||"-"===s&&(null===(t=this.editableField)||void 0===t?void 0:t.innerText.includes("-"))))e.preventDefault();else if("integer"!==this.type&&"decimal"!==this.type||!r.match("Space")){if(this.type&&1===s.length){const t=((null===(i=this.editableField)||void 0===i?void 0:i.innerText.trim())||"")+s;("integer"!==this.type||/^-?\d*$/.test(t))&&("decimal"!==this.type||/^-?\d*\.?\d*$/.test(t))||e.preventDefault()}}else e.preventDefault()},this.handleBlur=()=>{var e,t,i;this.isEditing=!1,this.maxLines.length>0&&(null===(e=this.editableField)||void 0===e||e.scrollTo(0,0));const s=(null===(i=null===(t=this.editableField)||void 0===t?void 0:t.innerText)||void 0===i?void 0:i.trim())||"",r=n().sanitize(s);r!==this.content&&(this.content=r),this.alert=!1,this.handleValidation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("focus",this.handleFocus)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus)}firstUpdated(e){super.firstUpdated(e),this.innerText&&this.innerText.trim().length>0&&this.innerText.trim()!==this.content&&(this.content=this.innerText.trim())}setRange(){var e;if(this.editableField){const t=document.createRange(),i=window.getSelection(),s=this.editableField.childNodes[0];if(!s||s.nodeType!==Node.TEXT_NODE)return;const r=(null===(e=s.nodeValue)||void 0===e?void 0:e.length)||0;t.setStart(s,r),t.collapse(!0),i&&0===i.toString().length&&(i.removeAllRanges(),i.addRange(t)),this.maxLines.length>0&&(this.editableField.scrollTop=this.editableField.scrollHeight)}}handleValidation(){var e;(this.type||this.pattern)&&((null===(e=this.checkValidity)||void 0===e?void 0:e.call(this,this.content))||(this.reportValidity(),this.showAlert()))}showAlert(){this.alert=!0}static get styles(){return[l.A,h.A]}get overflowStyles(){return this.maxLines.length&&this.maxLines.length>0&&`max-height: ${2*parseInt(this.maxLines)}rem; -webkit-line-clamp: ${this.maxLines}; word-break: break-all;`}messagesTemplate(){var e,t,i;return this.alert?a.html`
|
|
2
2
|
<div class="md-editable-textfield__messages" style="display: ${this.hideMessage?"none":"block"}">
|
|
3
3
|
<md-help-text
|
|
4
4
|
id="alert-message"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
${null===(i=this.message)||void 0===i?void 0:i.message}
|
|
11
11
|
</md-help-text>
|
|
12
12
|
</div>
|
|
13
|
-
`:
|
|
13
|
+
`:a.nothing}render(){var e;const t={[`md-editable-textfield--${this.alignment}`]:this.alignment,"md-editable-textfield--disabled":this.disabled,[`md-editable-textfield--${null===(e=this.message)||void 0===e?void 0:e.type}`]:this.alert&&!!this.message,"md-editable-textfield--textoverflow":this.maxLines.length>0&&!this.isEditing};return a.html`
|
|
14
14
|
<div
|
|
15
15
|
part="editable-textfield"
|
|
16
16
|
style="${this.overflowStyles}"
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
aria-invalid=${(0,c.ifDefined)(this.disabled?void 0:this.alert?"true":"false")}
|
|
25
25
|
aria-label=${(0,c.ifDefined)(this.disabled?void 0:this.ariaLabel)}
|
|
26
26
|
aria-describedby=${(0,c.ifDefined)(this.disabled?void 0:this.ariaDescribedBy)}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</div>
|
|
27
|
+
.innerText=${this.content}
|
|
28
|
+
></div>
|
|
30
29
|
${this.messagesTemplate()}
|
|
31
|
-
`}};m([(0,d.property)({type:String})],t.prototype,"alignment",void 0),m([(0,d.property)({type:Boolean})],t.prototype,"disabled",void 0),m([(0,d.property)({type:Boolean})],t.prototype,"isEditing",void 0),m([(0,d.property)({type:String,attribute:"max-lines",reflect:!0})],t.prototype,"maxLines",void 0),m([(0,d.property)({type:String,reflect:!0})],t.prototype,"content",void 0),m([(0,d.property)({type:Object})],t.prototype,"message",void 0),m([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"alert",void 0),m([(0,d.property)({type:Boolean})],t.prototype,"hideMessage",void 0),m([(0,d.property)({type:String})],t.prototype,"pattern",void 0),m([(0,d.property)({type:String})],t.prototype,"type",void 0),m([(0,d.property)({type:String})],t.prototype,"ariaLabel",void 0),m([(0,d.property)({type:String,attribute:"aria-described-by"})],t.prototype,"ariaDescribedBy",void 0),m([(0,d.query)(".md-editable-textfield")],t.prototype,"editableField",void 0),t=m([(0,s.w)("md-editable-field")],t),e.ELEMENT=t}(v||(v={}))},58175:e=>{e.exports=
|
|
30
|
+
`}};m([(0,d.property)({type:String})],t.prototype,"alignment",void 0),m([(0,d.property)({type:Boolean})],t.prototype,"disabled",void 0),m([(0,d.property)({type:Boolean})],t.prototype,"isEditing",void 0),m([(0,d.property)({type:String,attribute:"max-lines",reflect:!0})],t.prototype,"maxLines",void 0),m([(0,d.property)({type:String,reflect:!0})],t.prototype,"content",void 0),m([(0,d.property)({type:Object})],t.prototype,"message",void 0),m([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"alert",void 0),m([(0,d.property)({type:Boolean})],t.prototype,"hideMessage",void 0),m([(0,d.property)({type:String})],t.prototype,"pattern",void 0),m([(0,d.property)({type:String})],t.prototype,"type",void 0),m([(0,d.property)({type:String})],t.prototype,"ariaLabel",void 0),m([(0,d.property)({type:String,attribute:"aria-described-by"})],t.prototype,"ariaDescribedBy",void 0),m([(0,d.query)(".md-editable-textfield")],t.prototype,"editableField",void 0),t=m([(0,s.w)("md-editable-field")],t),e.ELEMENT=t}(v||(v={}))},58175:e=>{e.exports=a},60554:e=>{e.exports=o},70429:e=>{e.exports=t},85125:e=>{e.exports=i},85314:e=>{e.exports=n},87161:t=>{t.exports=e}},h={};function m(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return c[e](i,i.exports,m),i.exports}m.m=c,p=[],m.O=(e,t,i,s)=>{if(!t){var r=1/0;for(a=0;a<p.length;a++){for(var[t,i,s]=p[a],l=!0,o=0;o<t.length;o++)(!1&s||r>=s)&&Object.keys(m.O).every(e=>m.O[e](t[o]))?t.splice(o--,1):(l=!1,s<r&&(r=s));if(l){p.splice(a--,1);var n=i();void 0!==n&&(e=n)}}return e}s=s||0;for(var a=p.length;a>0&&p[a-1][2]>s;a--)p[a]=p[a-1];p[a]=[t,i,s]},m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},m.d=(e,t)=>{for(var i in t)m.o(t,i)&&!m.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={1807:0};m.O.j=t=>0===e[t];var t=(t,i)=>{var s,r,[l,o,n]=i,a=0;if(l.some(t=>0!==e[t])){for(s in o)m.o(o,s)&&(m.m[s]=o[s]);if(n)var d=n(m)}for(t&&t(i);a<l.length;a++)r=l[a],m.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return m.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var u=m.O(void 0,[8493,1890,4313,510,5087,6283,2176,6798,6865,1200,2576,8210,5630,1270,1013,109,3739,6396,6408,4548,2093],()=>m(50565));return m.O(u)})());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,o,
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,a,o,r,l,n)=>(()=>{"use strict";var p,d={10318:e=>{e.exports=s},20291:e=>{e.exports=a},32022:e=>{e.exports=o},58175:e=>{e.exports=n},60554:e=>{e.exports=r},70429:e=>{e.exports=t},85125:e=>{e.exports=i},85314:e=>{e.exports=l},87161:t=>{t.exports=e},96408:(e,t,i)=>{i.r(t),i.d(t,{Input:()=>S,ariaInvalidType:()=>C,containerSize:()=>v,iconNames:()=>$,iconPosition:()=>x,inputShape:()=>f,inputSize:()=>g,inputType:()=>b,nestedLevel:()=>w}),i(20109),i(61200),i(6396),i(12176);var s=i(90195),a=i(31890),o=i(32972),r=i(4313),l=i(32022),n=i(87161),p=i(70429),d=i(85125),h=i(20291),m=i(58175),u=i(10318),c=i(13739),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"],w=[0,1,2,3],C=["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="input",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.role="",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.displayCharacterCount=!1,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(){this.input.select()}focus(){this.input.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}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)}"
|
|
@@ -104,7 +104,11 @@
|
|
|
104
104
|
>
|
|
105
105
|
</md-icon>
|
|
106
106
|
</button>
|
|
107
|
-
`:n.nothing}
|
|
107
|
+
`:n.nothing}characterCountLabelTemplate(){return this.maxLength&&this.displayCharacterCount&&!this.disabled&&!this.readOnly?n.html`<div class="md-input__character-count-label-container">
|
|
108
|
+
<span class="md-input__character-count-label ${(0,d.classMap)({error:this.value.length>=this.maxLength})}"
|
|
109
|
+
>${this.value.length}/${this.maxLength}</span
|
|
110
|
+
>
|
|
111
|
+
</div> `:n.nothing}secondaryLabelTemplate(){return this.secondaryLabel?n.html`
|
|
108
112
|
<md-label
|
|
109
113
|
class="md-input__secondary-label ${(0,d.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
|
|
110
114
|
secondaryLabel
|
|
@@ -142,6 +146,11 @@
|
|
|
142
146
|
<div class="md-input__wrapper ${(0,d.classMap)(this.inputWrapperClassMap)}">
|
|
143
147
|
${this.inputLeftTemplate()} ${this.inputTemplate()} ${this.inputRightTemplate()}
|
|
144
148
|
</div>
|
|
145
|
-
|
|
149
|
+
<div class="md-input__all-sub-labels-container">
|
|
150
|
+
<div class="md-input__info-and-error-labels-container">
|
|
151
|
+
${this.messagesTemplate()} ${this.secondaryLabelTemplate()} ${this.helpTextTemplate()}
|
|
152
|
+
</div>
|
|
153
|
+
${this.characterCountLabelTemplate()}
|
|
154
|
+
</div>
|
|
146
155
|
</div>
|
|
147
|
-
`}};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,"role",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.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,
|
|
156
|
+
`}};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,"role",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:Boolean})],i.prototype,"displayCharacterCount",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={}))}},h={};function m(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return d[e](i,i.exports,m),i.exports}m.m=d,p=[],m.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(m.O).every(e=>m.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]},m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},m.d=(e,t)=>{for(var i in t)m.o(t,i)&&!m.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={1266:0,6408:0};m.O.j=t=>0===e[t];var t=(t,i)=>{var s,a,[o,r,l]=i,n=0;if(o.some(t=>0!==e[t])){for(s in r)m.o(r,s)&&(m.m[s]=r[s]);if(l)var p=l(m)}for(t&&t(i);n<o.length;n++)a=o[n],m.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return m.O(p)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var u=m.O(void 0,[8493,1890,4313,510,5087,6283,2176,6798,6865,1200,2576,8210,5630,1270,1013,109,3739,6396],()=>m(96408));return m.O(u)})());
|