@momentum-ui/web-components 2.10.2-dev → 2.10.2-dev2
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/chunks/md-24.js +1 -1
- package/dist/chunks/md-31.js +2 -2
- package/dist/chunks/md-32.js +1 -1
- package/dist/chunks/md-78.js +26 -23
- package/dist/index-entry.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/components/list/List.d.ts +7 -0
- package/dist/types/components/table-advanced/TableAdvanced.d.ts +1 -0
- package/package.json +1 -1
package/dist/chunks/md-24.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[24],{57:function(t,e,o){"use strict";var i=o(0);e.a=i.css`:host(:focus){box-shadow:none;outline:0}:host(md-list-item){box-sizing:border-box;cursor:pointer}:host(md-list-item) .md-list-item{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;box-sizing:border-box;color:var(--list-text-color,#121212);flex:1 1 auto;font-size:.875rem;line-height:1.125rem;min-height:2.25rem;padding:.5rem 1rem;position:relative}:host(md-list-item) .md-list-item .md-input-container{margin-bottom:0}:host(:hover:not([disabled])) .md-list-item{background-color:var(--list-hover-background,#91ebff);color:var(--list-hover-text-color,#121212)}:host(:active:not([disabled])) .md-list-item,:host([selected]:not([disabled])) .md-list-item{background-color:var(--list-active-background,#00a0d1);color:var(--list-active-text-color,#121212)}:host([focus-visible]
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[24],{57:function(t,e,o){"use strict";var i=o(0);e.a=i.css`:host(:focus){box-shadow:none;outline:0}:host(md-list-item){box-sizing:border-box;cursor:pointer}:host(md-list-item) .md-list-item{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;box-sizing:border-box;color:var(--list-text-color,#121212);flex:1 1 auto;font-size:.875rem;line-height:1.125rem;min-height:2.25rem;padding:.5rem 1rem;position:relative}:host(md-list-item) .md-list-item .md-input-container{margin-bottom:0}:host(:hover:not([disabled])) .md-list-item{background-color:var(--list-hover-background,#91ebff);color:var(--list-hover-text-color,#121212)}:host(:active:not([disabled])) .md-list-item,:host([selected]:not([disabled])) .md-list-item{background-color:var(--list-active-background,#00a0d1);color:var(--list-active-text-color,#121212)}:host([focus-visible]) .md-list-item{box-shadow:0 0 0 .125rem var(--list-focus-border-color,#005e7d)}:host(:active[disabled]) .md-list-item,:host([disabled]) .md-list-item{color:var(--list-disabled-text-color,#b2b2b2);pointer-events:none}:host(md-list) .md-list{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:center;list-style:none;margin:0;padding:0;position:relative;width:100%}:host([alignment=horizontal]) ul{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:stretch}:host([alignment=horizontal]) ::slotted(md-list-item){align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center;flex:1 1 auto}:host([alignment=vertical]){align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:center}`}}]);
|
package/dist/chunks/md-31.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[31],{66:function(t,e,s){"use strict";s.r(e),s.d(e,"List",(function(){return i}));var i,n=s(1),
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[31],{66:function(t,e,s){"use strict";s.r(e),s.d(e,"List",(function(){return i}));var i,n=s(1),r=s(7),c=s(6),d=s(5),l=s(0),o=s(57),a=function(t,e,s,i){var n,r=arguments.length,c=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,s,i);else for(var d=t.length-1;d>=0;d--)(n=t[d])&&(c=(r<3?n(c):r>3?n(e,s,c):n(e,s))||c);return r>3&&c&&Object.defineProperty(e,s,c),c};!function(t){let e=class extends(Object(r.d)(l.LitElement)){constructor(){super(...arguments),this.alignment="vertical",this.label="option",this.role="listbox",this.activated=-1}firstUpdated(t){super.firstUpdated(t),this.setAttribute("aria-label",this.label)}notifySelectedChange(){this.dispatchEvent(new CustomEvent("list-item-change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}isFocusable(t){return!t.hasAttribute("hidden")}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("click",this.handleClick)}findListItemIndex(t){const e=t.composedPath();return this.slotted.findIndex(t=>e.includes(t))}switchListItemOnArrowPress(t,e=1){const s=super.getAvailableSelectedIndex(t,e);-1!==s&&(this.selected=s)}setActivated(t){-1!==t&&(this.activated=t,this.selected=t,this.setSelected(t))}findSelectedListItemIndex(){return this.slotted.findIndex(t=>t.selected)}setSelected(t){const e=this.findSelectedListItemIndex();-1!==e&&e!==t&&(this.slotted[e].selected=!1),this.slotted[t]&&(this.slotted[t].selected=!0)}updated(t){super.updated(t),t.has("slotted")&&this.setActivated(this.activated),t.has("activated")&&this.setActivated(this.activated)}isListItemDisabled(t){return this.slotted[t].disabled}handleClick(t){const e=this.findListItemIndex(t);-1!==e&&(this.isListItemDisabled(e)||(this.setActivated(e),this.notifySelectedChange()))}handleKeyDown(t){const{code:e}=t;switch(e){case n.b.End:this.switchListItemOnArrowPress(this.slotted.length-1);break;case n.b.Home:this.switchListItemOnArrowPress(0);break;case n.b.ArrowUp:case n.b.ArrowLeft:t.preventDefault(),0===this.selected?this.switchListItemOnArrowPress(this.slotted.length-1,-1):this.switchListItemOnArrowPress(this.selected-1,-1);break;case n.b.ArrowDown:case n.b.ArrowRight:t.preventDefault(),this.selected===this.slotted.length-1?this.switchListItemOnArrowPress(0):this.switchListItemOnArrowPress(this.selected+1);break;case n.b.Enter:case n.b.Space:this.isListItemDisabled(this.selected)||(this.setActivated(this.selected),this.notifySelectedChange())}}get slotElement(){return this.listItemSlot}static get styles(){return[d.a,o.a]}render(){return l.html`
|
|
2
2
|
<ul class="md-list" part="list">
|
|
3
3
|
<slot name="list-item"></slot>
|
|
4
4
|
</ul>
|
|
5
|
-
`}};a([Object(
|
|
5
|
+
`}};a([Object(l.property)({type:String,reflect:!0})],e.prototype,"alignment",void 0),a([Object(l.property)({type:String})],e.prototype,"label",void 0),a([Object(l.property)({type:String,reflect:!0})],e.prototype,"role",void 0),a([Object(l.property)({type:Number,reflect:!0})],e.prototype,"activated",void 0),a([Object(l.query)("slot[name='list-item']")],e.prototype,"listItemSlot",void 0),e=a([Object(c.a)("md-list")],e),t.ELEMENT=e}(i||(i={}))}}]);
|
package/dist/chunks/md-32.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[32],{67:function(e,t,s){"use strict";s.r(t),s.d(t,"ListItem",(function(){return r}));var r,i=s(7),l=s(6),o=s(5),d=s(0),n=s(57),c=function(e,t,s,r){var i,l=arguments.length,o=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,r);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(o=(l<3?i(o):l>3?i(t,s,o):i(t,s))||o);return l>3&&o&&Object.defineProperty(t,s,o),o};!function(e){let t=class extends(Object(i.a)(d.LitElement)){constructor(){super(...arguments),this.role="option",this.tabIndex=-1,this._disabled=!1,this._selected=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.setAttribute("aria-disabled",""+e),this.
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[32],{67:function(e,t,s){"use strict";s.r(t),s.d(t,"ListItem",(function(){return r}));var r,i=s(7),l=s(6),o=s(5),d=s(0),n=s(57),c=function(e,t,s,r){var i,l=arguments.length,o=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,r);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(o=(l<3?i(o):l>3?i(t,s,o):i(t,s))||o);return l>3&&o&&Object.defineProperty(t,s,o),o};!function(e){let t=class extends(Object(i.a)(d.LitElement)){constructor(){super(...arguments),this.role="option",this.tabIndex=-1,this._disabled=!1,this._selected=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.setAttribute("aria-disabled",""+e),this.requestUpdate("disabled",t)}get selected(){return this._selected}set selected(e){const t=this._selected;this._selected=e,this.requestUpdate("selected",t)}static get styles(){return[o.a,n.a]}render(){return d.html`
|
|
2
2
|
<li class="md-list-item" part="list-item">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</li>
|
package/dist/chunks/md-78.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[78],{101:function(e,t,r){"use strict";r.r(t),r.d(t,"TableAdvanced",(function(){return w}));r(17),r(15),r(32);var o=r(6),i=r(34),a=r(5),l=r(0),d=r(2),s=r(4),n=r(3),c=r(81),h=r(31),p=r.n(h),b=l.css`:host{display:block}.md-table-advanced{width:100%}table{border-collapse:separate;border-spacing:0;max-width:100%;position:relative;width:100%}table.sticky-header{height:100%}table.sticky-header thead th:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border-left:0;border-top:0;position:sticky;top:0;z-index:1}table.sticky-header thead th::before{border-top:1px solid var(--table-advanced-border-color,#dedede);bottom:0;content:" ";left:0;position:absolute;top:0;width:100%}table.sticky-header thead tr:last-child th{top:2.5rem}table.sticky-header thead tr:last-child th::before{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-top:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead tr:first-child th{height:calc(2.5rem + .0625rem * 2);top:0}table.sticky-header thead tr:first-child th::before{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-top:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead tr:focus{outline:0}table.sticky-header thead tr:focus th:first-child{border-left:2px solid var(--md-focus-border-color)}table.sticky-header thead tr:focus th:last-child{border-right:2px solid var(--md-focus-border-color)}table.sticky-header thead tr:focus th::before{border-bottom:2px solid var(--md-focus-border-color);border-top:2px solid var(--md-focus-border-color)}thead th:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}thead th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border:1px solid var(--table-advanced-border-color,#dedede);border-left:0;color:var(--md-secondary-text-color);font-family:"CiscoSansTT Regular","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;height:2.5rem;max-width:0;padding:0 .375rem;position:relative;text-align:left}thead th .filter{display:inline-block;height:auto;margin-top:calc(.25rem / 2)}thead th .resize{background-color:rgba(0,0,0,0);cursor:col-resize;height:100%;left:calc(-.25rem / 2);position:absolute;top:0;width:.25rem;z-index:1}thead .head-inner-cell{align-items:center;display:flex;min-width:.875rem}thead .head-inner-cell .filter-wrap{align-items:center;display:inline-flex;flex:1;justify-content:flex-end}thead .head-inner-cell .filter-icon{color:var(--md-secondary-text-color);cursor:pointer;display:inline-block;height:1.5rem;min-width:1.25rem;position:relative;z-index:1}thead .head-inner-cell .filter-icon::part(button){padding:.25rem;text-align:center;width:1.5rem}thead .head-inner-cell .filter-icon:hover{background-color:var(--table-advanced-filter-hover-bg-color,#ededed)}thead .head-inner-cell .filter-icon:active{background-color:var(--table-advanced-filter-pressed-bg-color,#dedede)}thead .head-inner-cell span{display:inline-block;overflow:hidden;padding-right:calc(.25rem * 1.25);text-overflow:ellipsis;white-space:nowrap;width:100%}thead .head-inner-cell .sortable{background:rgba(0,0,0,0);border:0;color:var(--md-secondary-text-color);display:inline-block;min-width:calc(1rem * 2.5);overflow:hidden;padding-right:calc(.25rem * 4);text-overflow:ellipsis;white-space:nowrap;width:auto}thead md-menu-overlay::part(overlay){top:-.375rem;white-space:normal}@supports(-moz-appearance:none){thead md-menu-overlay::part(overlay){top:-.25rem;white-space:normal}}thead .drag-area-col{cursor:grab;display:block;height:calc(.25rem * 10);left:.25rem;position:absolute;right:.25rem;top:0;z-index:1}thead .drag-area-col.drag{border:2px dashed var(--table-advanced-filter-border-color,#ccc);opacity:1}thead .drag-area-col.over{background-color:#a87ff1;height:100%;opacity:.1}thead .sortable{cursor:pointer;position:relative;z-index:1}thead .sortable::after,thead .sortable::before{border:.25rem solid transparent;content:"";display:block;height:0;opacity:.3;position:absolute;right:.25rem;top:50%;width:0}thead .sortable::before{border-bottom-color:var(--md-secondary-text-color);margin-top:-9px}thead .sortable::after{border-top-color:var(--md-secondary-text-color);margin-top:1px}thead .sortable.ascending::after{opacity:1}thead .sortable.descending::before{opacity:1}.filter-active{display:inline-block;height:1.25rem;text-align:center;vertical-align:bottom;width:1.25rem}.filter-active::part(icon){line-height:.875rem}.filter-menu{background-color:var(--table-advanced-filter-bg-color,#fff);padding:calc(.25rem * 3);position:relative;z-index:1}.filter-menu select{background-color:var(--table-advanced-filter-bg-color,#fff);border:1px solid var(--table-advanced-filter-border-color,#ccc);color:var(--md-secondary-text-color);min-height:calc(.875rem * 1.8);width:100%}.filter-menu input{background-color:var(--table-advanced-filter-bg-color,#fff);border:1px solid var(--table-advanced-filter-border-color,#ccc);color:var(--md-secondary-text-color);margin-top:calc(.25rem * 2);width:100%}tbody tr{position:relative}tbody tr td:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}tbody tr td{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-right:1px solid var(--table-advanced-border-color,#dedede);font-size:14px;height:2.5rem;max-width:0;padding:calc(.25rem * 1.5);position:relative}tbody tr th:first-child{border-top:1px solid var(--table-advanced-border-color,#dedede)}tbody tr th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-right:1px solid var(--table-advanced-border-color,#dedede);font-size:14px;max-width:0;padding:0 calc(.25rem * 4);position:relative;text-align:left}tbody tr .inner-cell{display:flex;white-space:nowrap}tbody tr .inner-cell .warn-icon{display:inline-block;margin-left:.25rem;max-height:1.25rem;position:relative;vertical-align:middle;z-index:0}tbody tr .inner-cell md-icon::part(icon){line-height:1.25rem}tbody tr .inner-cell span{align-self:center;display:inline-block;flex:1;overflow:hidden;padding:0 .25rem;text-overflow:ellipsis;vertical-align:middle}tbody tr .drag-handle{cursor:grab;display:block;float:left;margin-right:calc(.25rem * 1.5)}tbody tr .drag-area{height:50%;left:0;opacity:.3;position:absolute;right:0}tbody tr .drag-area.top{top:0}tbody tr .drag-area.bottom{background-color:rgba(0,0,0,0);bottom:0}tbody tr.ghost{opacity:.3}tbody tr:hover{background-color:var(--table-advanced-hover-bg-color,#f7f7f7)}tbody tr:hover td,tbody tr:hover th{background-color:var(--table-advanced-hover-bg-color,#f7f7f7)}tbody tr.selected,tbody tr:active{background-color:var(--table-advanced-selected-bg-color,#ededed)}tbody tr.selected td,tbody tr.selected th,tbody tr:active td,tbody tr:active th{background-color:var(--table-advanced-selected-bg-color,#ededed)}md-button.row-collapsible{height:1.25rem;margin-right:calc(.25rem * 1.5);max-width:1.25rem;min-width:1.25rem}md-button.row-collapsible::part(button){border-radius:calc(.25rem / 2);padding:0 .25rem}md-button.row-collapsible md-icon::part(icon){line-height:calc(.25rem * 4)}`;function g(e=250){return function(t,r,o){let i;return function(e,t){if(e.descriptor=e.descriptor||Object.getOwnPropertyDescriptor(e.target,e.key),"function"!=typeof e.descriptor.value)return console.warn(e.key,"Decorator must be used on function"),e.descriptor;const r=e.descriptor.value,o=e.target.constructor.name;return e.descriptor.value=function(){const e=[];for(let t=0;t<arguments.length;t++)e[t]=arguments[t];return t.call(this,r,e,o)},e.descriptor}({target:t,key:r,descriptor:o},(function(t,r){clearTimeout(i),i=window.setTimeout(()=>{clearTimeout(i),t.apply(this,r)},e)}))}}class m{constructor(e,t){this.target=e,this.eventName=t}emit(e,t={bubbles:!0,composed:!0,cancelable:!1}){this.target.dispatchEvent(new CustomEvent(this.eventName,Object.assign({detail:e},t)))}}const u=new WeakMap,f=Object(d.directive)(e=>t=>{if(!(t instanceof d.NodePart))throw new Error("templateCallback can only be used in text bindings");const r=u.get(t);if(void 0!==r&&e.template===r.template&&t.value===r.fragment)return;const o=document.importNode(e.template.content,!0);e.cb({content:e.content,row:e.row,col:e.col,insertIndex:e.insertIndex,fragment:o}),t.setValue(o),u.set(t,{template:e.template,fragment:o})});var v;!function(e){const t={placeholder:"Filter..."};e.OPTIONS={equals:{label:"Equals",input:t,predicate:(e,t)=>e==t},notEqual:{label:"Not equal",input:t,predicate:(e,t)=>e!=t},contains:{label:"Contains",input:t,predicate:(e,t)=>e.includes(t)},notContains:{label:"Not contains",input:t,predicate:(e,t)=>!e.includes(t)},startsWith:{label:"Starts with",input:t,predicate:(e,t)=>e.startsWith(t)},endsWith:{label:"Ends with",input:t,predicate:(e,t)=>e.endsWith(t)},lessThan:{label:"Less than",input:t,predicate:(e,t)=>e<t},lessThanOrEquals:{label:"Less than or equals",input:t,predicate:(e,t)=>e<=t},greaterThan:{label:"Greater than",input:t,predicate:(e,t)=>e>t},greaterThanOrEquals:{label:"Greater than or equals",input:t,predicate:(e,t)=>e>=t}},e.optionsString=[e.OPTIONS.equals,e.OPTIONS.notEqual,e.OPTIONS.contains,e.OPTIONS.notContains,e.OPTIONS.startsWith,e.OPTIONS.endsWith],e.optionsNumber=[e.OPTIONS.equals,e.OPTIONS.notEqual,e.OPTIONS.lessThan,e.OPTIONS.lessThanOrEquals,e.OPTIONS.greaterThan,e.OPTIONS.greaterThanOrEquals]}(v||(v={}));var y=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};const x=document.createElement("img");var w;x.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(e){let t=class extends(Object(i.a)(l.LitElement)){constructor(){super(...arguments),this.error="",this.COLS=[],this.ROWS=[],this.updCols=()=>this.requestUpdate("COLS"),this.updRows=()=>this.requestUpdate("ROWS"),this.dragRow=-1,this.dropRow=-1,this.drops=[],this.dragRowElem=null,this.dragCol=-1,this.dropCol=-1,this.isResizing=!1,this.isSelectable=!1,this.selected={},this.expandedRowIdx={},this.dragover=e=>e.preventDefault(),this.eX=0,this.onResize=(e,t)=>{var r;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const o=e.target;null===(r=e.dataTransfer)||void 0===r||r.setDragImage(x,0,0);const i=this.COLS.map(e=>this.shadowRoot.querySelector("th.col-index-"+e.index));this.COLS.forEach((e,t)=>e.width=i[t].offsetWidth+"px"),this.updCols();const a=e.x;this.eX=e.x;let l=-1,d=-1,s=-1;const n=this.COLS[t.index-1],c=i[t.index],h=i[t.index-1],p=c.offsetWidth,b=h.offsetWidth,g=()=>{const e=this.eX;if(l!=e&&0!=e){l=e;const r=l-a;d=p-r,s=b+r,t.width=d+"px",n.width=s+"px",this.updCols()}},m=e=>this.eX=e.x,u=()=>{this.isResizing=!1,o.removeEventListener("drag",g),o.removeEventListener("dragend",u),document.removeEventListener("dragover",m)};o.addEventListener("drag",g),o.addEventListener("dragend",u),document.addEventListener("dragover",m)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}update(e){super.update(e),e.has("data")&&(this.updateTableData(),this.updateDataInTable())}updateTableData(){if("string"==typeof this.data)try{this.tableData=JSON.parse(this.data)}catch(e){console.error("[INVALID_JSON_FORMAT] Please recheck the config json")}else this.tableData=Object.assign({},this.data)}updateTableConfig(){if("string"==typeof this.config)try{this.tableConfig=JSON.parse(this.config)}catch(e){console.error("[INVALID_JSON_FORMAT] Please recheck the data json")}else this.tableConfig=Object.assign({},this.config)}populateColumns(){var e;let t=0;const r=(e,r)=>{var o,i,a,l;const d=e.filters||(null===(i=null===(o=this.tableConfig.default)||void 0===o?void 0:o.col)||void 0===i?void 0:i.filters),s=d?"forString"==d?v.optionsString:"forNumber"==d?v.optionsNumber:d.length?d:null:null;this.COLS.push({options:Object.assign({},e),index:t++,group:r,sort:"default",sorter:e.sorter||(null===(l=null===(a=this.tableConfig.default)||void 0===a?void 0:a.col)||void 0===l?void 0:l.sorter),isCollapsable:this.tableConfig.cols.collapse==e.id,filter:s?{list:s,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(e=>{"children"in e?e.children.forEach(t=>r(t,{name:e.groupName,length:e.children.length})):r(e)}),this.isSelectable=!!this.tableConfig.rows&&"none"!=(null===(e=this.tableConfig.rows)||void 0===e?void 0:e.selectable)}populateData(){const e=this.COLS.length;if("csv"in this.tableData){const e=p.a.parse(this.tableData.csv,{skipEmptyLines:!0,transform:e=>e.trim()});if(e.errors)return void(this.error="PARSE ERROR:\n"+JSON.stringify(e.errors,null,2));{const t=e.data;this.ROWS=t.map(e=>e.map(e=>({text:e})))}}else if("list2d"in this.tableData)this.ROWS=this.tableData.list2d.map(e=>e.map(e=>({text:e})));else{for(;this.tableData.list.length>e;)this.ROWS.push(this.tableData.list.splice(0,e).map(e=>({text:e})));0!=this.tableData.list.length&&this.ROWS.push(this.tableData.list.map(e=>({text:e})))}0!=this.ROWS.length||(this.error="DATA ERROR: Data is empty")}validateData(){const e=this.COLS.length;this.ROWS.reduce((e,t)=>e+t.length,0)%e==0?this.ROWS.forEach((t,r)=>{const o=t.length;o!=e&&(this.error=`DATA ERROR: Total number of cols (=${e}) and data[${r}] length (=${o}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const e=this.tableConfig.cellTemplates,t=Object.keys(e||{});e&&t.length&&this.ROWS.forEach((t,r)=>{t.forEach((t,o)=>{for(const i in e){const a=t.text.indexOf(i);if(-1!=a){const l=e[i],d=this.querySelector("#"+l.templateName);if(null==d){console.warn(`cellTemplates["${i}"]: Missing '${l.templateName}' template.`);continue}let s=t.text.replace(i,"");l.contentCb&&(s=l.contentCb({col:o,row:r,content:s,insertIndex:a})),this.ROWS[r][o]={text:s,template:{template:d,templateCb:l.templateCb,insertIndex:"replace"==l.contentUse?-1:a}};break}}})})}setDefaultFilterAndSort(){var e,t;const r=null===(e=this.tableConfig.default)||void 0===e?void 0:e.sort;if(r){const e=this.COLS.find(e=>e.options.id==r.colId);e?this.sort(e,r.order):console.warn(`Cant find ${r.colId} col - for sorting`)}const o=null===(t=this.tableConfig.default)||void 0===t?void 0:t.filter;if(o){const e=this.COLS.find(e=>e.options.id==o.colId);e?e.filter?(e.filter.selectedIndex=o.selectedIndex,e.filter.input=o.input,this.updCols(),this.filter(e)):console.warn(`Cant find filters on ${o.colId} col`):console.warn(`Cant find ${o.colId} col - for filtering`)}}populateTable(){this.populateColumns(),this.populateData(),this.validateData(),this.setDefaultFilterAndSort(),this.populateTemplate()}updateDataInTable(){this.populateData(),this.validateData(),this.populateTemplate()}onDropRow(){this.dragRow!=this.dropRow&&this.drops.push([this.dragRow,this.dropRow]),this.dragRow=-1,this.dropRow=-1,this.dragRowElem&&(this.dragRowElem.setAttribute("draggable","false"),this.dragRowElem=null)}onDropCol(){if(this.dragCol!=this.dropCol){const e=this.COLS[this.dragCol],t=this.COLS[this.dropCol],r=e.group,o=t.group,i=e.index,a=t.index;e.group=o,t.group=r,e.index=a,t.index=i,this.COLS[this.dragCol]=t,this.COLS[this.dropCol]=e,this.ROWS.forEach(e=>{const t=e[this.dragCol],r=e[this.dropCol];e[this.dragCol]=r,e[this.dropCol]=t}),this.updCols(),this.updRows()}this.dragCol=-1,this.dropCol=-1}sort(e,t){e.sorter&&(this.clearSelection(),this.drops=[],this.COLS.forEach(r=>{r.options.id==e.options.id?r.sort=t||("default"==r.sort?"ascending":"ascending"==r.sort?"descending":"default"):r.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:e.sort}))}filter(e){if(!e.filter)return;this.clearSelection(),this.drops=[];const t=e.filter.input.trim(),r=e.filter.list[e.filter.selectedIndex];e.filter.active=!!t,this.requestUpdate(),t?this["md-table-advanced-change"].emit({type:"filter-on",filter:r,input:t}):this["md-table-advanced-change"].emit({type:"filter-off",filter:e.filter.list[e.filter.selectedIndex]})}selectRow(e){var t;const r=e.row.idx,o=this.selected.hasOwnProperty(r);"multiple"==(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)?(e.metaKey?o?delete this.selected[r]:this.selected[r]=!0:e.shiftKey||(this.selected={[r]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(e=>+e)})):o?this.clearSelection():(this.selected={[r]:!0},this["md-table-advanced-change"].emit({type:"select",index:r})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(e,t){e.stopPropagation(),this.expandedRowIdx[t]?(delete this.expandedRowIdx[t],this["md-table-advanced-change"].emit({type:"collapse",row:t})):(this.expandedRowIdx[t]=!0,this["md-table-advanced-change"].emit({type:"expand",row:t})),this.clearSelection(),this.requestUpdate()}render(){if(this.error)return l.html`
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[78],{101:function(e,t,o){"use strict";o.r(t),o.d(t,"TableAdvanced",(function(){return w}));o(17),o(15),o(32);var r=o(6),i=o(34),a=o(5),l=o(0),d=o(2),s=o(4),n=o(3),c=o(81),h=o(31),p=o.n(h),b=l.css`:host{display:block}.md-table-advanced{width:100%}table{border-collapse:separate;border-spacing:0;max-width:100%;position:relative;width:100%}table.sticky-header{height:100%}table.sticky-header thead th:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border-left:0;border-top:0;position:sticky;top:0;z-index:1}table.sticky-header thead th::before{border-top:1px solid var(--table-advanced-border-color,#dedede);bottom:0;content:" ";left:0;position:absolute;top:0;width:100%}table.sticky-header thead tr:last-child th{top:2.5rem}table.sticky-header thead tr:last-child th::before{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-top:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead tr:first-child th{height:calc(2.5rem + .0625rem * 2);top:0}table.sticky-header thead tr:first-child th::before{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-top:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead tr:focus{outline:0}table.sticky-header thead tr:focus th:first-child{border-left:2px solid var(--md-focus-border-color)}table.sticky-header thead tr:focus th:last-child{border-right:2px solid var(--md-focus-border-color)}table.sticky-header thead tr:focus th::before{border-bottom:2px solid var(--md-focus-border-color);border-top:2px solid var(--md-focus-border-color)}thead th:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}thead th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border:1px solid var(--table-advanced-border-color,#dedede);border-left:0;color:var(--md-secondary-text-color);font-family:"CiscoSansTT Regular","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;height:2.5rem;max-width:0;padding:0 .375rem;position:relative;text-align:left}thead th .filter{display:inline-block;height:auto;margin-top:calc(.25rem / 2)}thead th .resize{background-color:rgba(0,0,0,0);cursor:col-resize;height:100%;left:calc(-.25rem / 2);position:absolute;top:0;width:.25rem;z-index:1}thead .head-inner-cell{align-items:center;display:flex;min-width:.875rem}thead .head-inner-cell .filter-wrap{align-items:center;display:inline-flex;flex:1;justify-content:flex-end}thead .head-inner-cell .filter-icon{color:var(--md-secondary-text-color);cursor:pointer;display:inline-block;height:1.5rem;min-width:1.25rem;position:relative;z-index:1}thead .head-inner-cell .filter-icon::part(button){padding:.25rem;text-align:center;width:1.5rem}thead .head-inner-cell .filter-icon:hover{background-color:var(--table-advanced-filter-hover-bg-color,#ededed)}thead .head-inner-cell .filter-icon:active{background-color:var(--table-advanced-filter-pressed-bg-color,#dedede)}thead .head-inner-cell span{display:inline-block;overflow:hidden;padding-right:calc(.25rem * 1.25);text-overflow:ellipsis;white-space:nowrap;width:100%}thead .head-inner-cell .sortable{background:rgba(0,0,0,0);border:0;color:var(--md-secondary-text-color);display:inline-block;min-width:calc(1rem * 2.5);overflow:hidden;padding-right:calc(.25rem * 4);text-overflow:ellipsis;white-space:nowrap;width:auto}thead md-menu-overlay::part(overlay){top:-.375rem;white-space:normal}@supports(-moz-appearance:none){thead md-menu-overlay::part(overlay){top:-.25rem;white-space:normal}}thead .drag-area-col{cursor:grab;display:block;height:calc(.25rem * 10);left:.25rem;position:absolute;right:.25rem;top:0;z-index:1}thead .drag-area-col.drag{border:2px dashed var(--table-advanced-filter-border-color,#ccc);opacity:1}thead .drag-area-col.over{background-color:#a87ff1;height:100%;opacity:.1}thead .sortable{cursor:pointer;position:relative;z-index:1}thead .sortable::after,thead .sortable::before{border:.25rem solid transparent;content:"";display:block;height:0;opacity:.3;position:absolute;right:.25rem;top:50%;width:0}thead .sortable::before{border-bottom-color:var(--md-secondary-text-color);margin-top:-9px}thead .sortable::after{border-top-color:var(--md-secondary-text-color);margin-top:1px}thead .sortable.ascending::after{opacity:1}thead .sortable.descending::before{opacity:1}.filter-active{display:inline-block;height:1.25rem;text-align:center;vertical-align:bottom;width:1.25rem}.filter-active::part(icon){line-height:.875rem}.filter-menu{background-color:var(--table-advanced-filter-bg-color,#fff);padding:calc(.25rem * 3);position:relative;z-index:1}.filter-menu select{background-color:var(--table-advanced-filter-bg-color,#fff);border:1px solid var(--table-advanced-filter-border-color,#ccc);color:var(--md-secondary-text-color);min-height:calc(.875rem * 1.8);width:100%}.filter-menu input{background-color:var(--table-advanced-filter-bg-color,#fff);border:1px solid var(--table-advanced-filter-border-color,#ccc);color:var(--md-secondary-text-color);margin-top:calc(.25rem * 2);width:100%}tbody tr{position:relative}tbody tr td:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}tbody tr td{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-right:1px solid var(--table-advanced-border-color,#dedede);font-size:14px;height:2.5rem;max-width:0;padding:calc(.25rem * 1.5);position:relative}tbody tr th:first-child{border-top:1px solid var(--table-advanced-border-color,#dedede)}tbody tr th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-right:1px solid var(--table-advanced-border-color,#dedede);font-size:14px;max-width:0;padding:0 calc(.25rem * 4);position:relative;text-align:left}tbody tr .inner-cell{display:flex;white-space:nowrap}tbody tr .inner-cell .warn-icon{display:inline-block;margin-left:.25rem;max-height:1.25rem;position:relative;vertical-align:middle;z-index:0}tbody tr .inner-cell md-icon::part(icon){line-height:1.25rem}tbody tr .inner-cell span{align-self:center;display:inline-block;flex:1;overflow:hidden;padding:0 .25rem;text-overflow:ellipsis;vertical-align:middle}tbody tr .drag-handle{cursor:grab;display:block;float:left;margin-right:calc(.25rem * 1.5)}tbody tr .drag-area{height:50%;left:0;opacity:.3;position:absolute;right:0}tbody tr .drag-area.top{top:0}tbody tr .drag-area.bottom{background-color:rgba(0,0,0,0);bottom:0}tbody tr.ghost{opacity:.3}tbody tr:hover{background-color:var(--table-advanced-hover-bg-color,#f7f7f7)}tbody tr:hover td,tbody tr:hover th{background-color:var(--table-advanced-hover-bg-color,#f7f7f7)}tbody tr.selected,tbody tr:active{background-color:var(--table-advanced-selected-bg-color,#ededed)}tbody tr.selected td,tbody tr.selected th,tbody tr:active td,tbody tr:active th{background-color:var(--table-advanced-selected-bg-color,#ededed)}md-button.row-collapsible{height:1.25rem;margin-right:calc(.25rem * 1.5);max-width:1.25rem;min-width:1.25rem}md-button.row-collapsible::part(button){border-radius:calc(.25rem / 2);padding:0 .25rem}md-button.row-collapsible md-icon::part(icon){line-height:calc(.25rem * 4)}`;function g(e=250){return function(t,o,r){let i;return function(e,t){if(e.descriptor=e.descriptor||Object.getOwnPropertyDescriptor(e.target,e.key),"function"!=typeof e.descriptor.value)return console.warn(e.key,"Decorator must be used on function"),e.descriptor;const o=e.descriptor.value,r=e.target.constructor.name;return e.descriptor.value=function(){const e=[];for(let t=0;t<arguments.length;t++)e[t]=arguments[t];return t.call(this,o,e,r)},e.descriptor}({target:t,key:o,descriptor:r},(function(t,o){clearTimeout(i),i=window.setTimeout(()=>{clearTimeout(i),t.apply(this,o)},e)}))}}class u{constructor(e,t){this.target=e,this.eventName=t}emit(e,t={bubbles:!0,composed:!0,cancelable:!1}){this.target.dispatchEvent(new CustomEvent(this.eventName,Object.assign({detail:e},t)))}}const m=new WeakMap,f=Object(d.directive)(e=>t=>{if(!(t instanceof d.NodePart))throw new Error("templateCallback can only be used in text bindings");const o=m.get(t);if(void 0!==o&&e.template===o.template&&t.value===o.fragment)return;const r=document.importNode(e.template.content,!0);e.cb({content:e.content,row:e.row,col:e.col,insertIndex:e.insertIndex,fragment:r}),t.setValue(r),m.set(t,{template:e.template,fragment:r})});var v;!function(e){const t={placeholder:"Filter..."};e.OPTIONS={equals:{label:"Equals",input:t,predicate:(e,t)=>e==t},notEqual:{label:"Not equal",input:t,predicate:(e,t)=>e!=t},contains:{label:"Contains",input:t,predicate:(e,t)=>e.includes(t)},notContains:{label:"Not contains",input:t,predicate:(e,t)=>!e.includes(t)},startsWith:{label:"Starts with",input:t,predicate:(e,t)=>e.startsWith(t)},endsWith:{label:"Ends with",input:t,predicate:(e,t)=>e.endsWith(t)},lessThan:{label:"Less than",input:t,predicate:(e,t)=>e<t},lessThanOrEquals:{label:"Less than or equals",input:t,predicate:(e,t)=>e<=t},greaterThan:{label:"Greater than",input:t,predicate:(e,t)=>e>t},greaterThanOrEquals:{label:"Greater than or equals",input:t,predicate:(e,t)=>e>=t}},e.optionsString=[e.OPTIONS.equals,e.OPTIONS.notEqual,e.OPTIONS.contains,e.OPTIONS.notContains,e.OPTIONS.startsWith,e.OPTIONS.endsWith],e.optionsNumber=[e.OPTIONS.equals,e.OPTIONS.notEqual,e.OPTIONS.lessThan,e.OPTIONS.lessThanOrEquals,e.OPTIONS.greaterThan,e.OPTIONS.greaterThanOrEquals]}(v||(v={}));var y=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};const x=document.createElement("img");var w;x.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(e){let t=class extends(Object(i.a)(l.LitElement)){constructor(){super(...arguments),this.isRowFocusable="true",this.error="",this.COLS=[],this.ROWS=[],this.updCols=()=>this.requestUpdate("COLS"),this.updRows=()=>this.requestUpdate("ROWS"),this.dragRow=-1,this.dropRow=-1,this.drops=[],this.dragRowElem=null,this.dragCol=-1,this.dropCol=-1,this.isResizing=!1,this.isSelectable=!1,this.selected={},this.expandedRowIdx={},this.dragover=e=>e.preventDefault(),this.eX=0,this.onResize=(e,t)=>{var o;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const r=e.target;null===(o=e.dataTransfer)||void 0===o||o.setDragImage(x,0,0);const i=this.COLS.map(e=>this.shadowRoot.querySelector("th.col-index-"+e.index));this.COLS.forEach((e,t)=>e.width=i[t].offsetWidth+"px"),this.updCols();const a=e.x;this.eX=e.x;let l=-1,d=-1,s=-1;const n=this.COLS[t.index-1],c=i[t.index],h=i[t.index-1],p=c.offsetWidth,b=h.offsetWidth,g=()=>{const e=this.eX;if(l!=e&&0!=e){l=e;const o=l-a;d=p-o,s=b+o,t.width=d+"px",n.width=s+"px",this.updCols()}},u=e=>this.eX=e.x,m=()=>{this.isResizing=!1,r.removeEventListener("drag",g),r.removeEventListener("dragend",m),document.removeEventListener("dragover",u)};r.addEventListener("drag",g),r.addEventListener("dragend",m),document.addEventListener("dragover",u)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}update(e){super.update(e),e.has("data")&&(this.updateTableData(),this.updateDataInTable())}updateTableData(){if("string"==typeof this.data)try{this.tableData=JSON.parse(this.data)}catch(e){console.error("[INVALID_JSON_FORMAT] Please recheck the config json")}else this.tableData=Object.assign({},this.data)}updateTableConfig(){if("string"==typeof this.config)try{this.tableConfig=JSON.parse(this.config)}catch(e){console.error("[INVALID_JSON_FORMAT] Please recheck the data json")}else this.tableConfig=Object.assign({},this.config)}populateColumns(){var e;let t=0;const o=(e,o)=>{var r,i,a,l;const d=e.filters||(null===(i=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===i?void 0:i.filters),s=d?"forString"==d?v.optionsString:"forNumber"==d?v.optionsNumber:d.length?d:null:null;this.COLS.push({options:Object.assign({},e),index:t++,group:o,sort:"default",sorter:e.sorter||(null===(l=null===(a=this.tableConfig.default)||void 0===a?void 0:a.col)||void 0===l?void 0:l.sorter),isCollapsable:this.tableConfig.cols.collapse==e.id,filter:s?{list:s,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(e=>{"children"in e?e.children.forEach(t=>o(t,{name:e.groupName,length:e.children.length})):o(e)}),this.isSelectable=!!this.tableConfig.rows&&"none"!=(null===(e=this.tableConfig.rows)||void 0===e?void 0:e.selectable)}populateData(){const e=this.COLS.length;if("csv"in this.tableData){const e=p.a.parse(this.tableData.csv,{skipEmptyLines:!0,transform:e=>e.trim()});if(e.errors)return void(this.error="PARSE ERROR:\n"+JSON.stringify(e.errors,null,2));{const t=e.data;this.ROWS=t.map(e=>e.map(e=>({text:e})))}}else if("list2d"in this.tableData)this.ROWS=this.tableData.list2d.map(e=>e.map(e=>({text:e})));else{for(;this.tableData.list.length>e;)this.ROWS.push(this.tableData.list.splice(0,e).map(e=>({text:e})));0!=this.tableData.list.length&&this.ROWS.push(this.tableData.list.map(e=>({text:e})))}0!=this.ROWS.length||(this.error="DATA ERROR: Data is empty")}validateData(){const e=this.COLS.length;this.ROWS.reduce((e,t)=>e+t.length,0)%e==0?this.ROWS.forEach((t,o)=>{const r=t.length;r!=e&&(this.error=`DATA ERROR: Total number of cols (=${e}) and data[${o}] length (=${r}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const e=this.tableConfig.cellTemplates,t=Object.keys(e||{});e&&t.length&&this.ROWS.forEach((t,o)=>{t.forEach((t,r)=>{for(const i in e){const a=t.text.indexOf(i);if(-1!=a){const l=e[i],d=this.querySelector("#"+l.templateName);if(null==d){console.warn(`cellTemplates["${i}"]: Missing '${l.templateName}' template.`);continue}let s=t.text.replace(i,"");l.contentCb&&(s=l.contentCb({col:r,row:o,content:s,insertIndex:a})),this.ROWS[o][r]={text:s,template:{template:d,templateCb:l.templateCb,insertIndex:"replace"==l.contentUse?-1:a}};break}}})})}setDefaultFilterAndSort(){var e,t;const o=null===(e=this.tableConfig.default)||void 0===e?void 0:e.sort;if(o){const e=this.COLS.find(e=>e.options.id==o.colId);e?this.sort(e,o.order):console.warn(`Cant find ${o.colId} col - for sorting`)}const r=null===(t=this.tableConfig.default)||void 0===t?void 0:t.filter;if(r){const e=this.COLS.find(e=>e.options.id==r.colId);e?e.filter?(e.filter.selectedIndex=r.selectedIndex,e.filter.input=r.input,this.updCols(),this.filter(e)):console.warn(`Cant find filters on ${r.colId} col`):console.warn(`Cant find ${r.colId} col - for filtering`)}}populateTable(){this.populateColumns(),this.populateData(),this.validateData(),this.setDefaultFilterAndSort(),this.populateTemplate()}updateDataInTable(){this.populateData(),this.validateData(),this.populateTemplate()}onDropRow(){this.dragRow!=this.dropRow&&this.drops.push([this.dragRow,this.dropRow]),this.dragRow=-1,this.dropRow=-1,this.dragRowElem&&(this.dragRowElem.setAttribute("draggable","false"),this.dragRowElem=null)}onDropCol(){if(this.dragCol!=this.dropCol){const e=this.COLS[this.dragCol],t=this.COLS[this.dropCol],o=e.group,r=t.group,i=e.index,a=t.index;e.group=r,t.group=o,e.index=a,t.index=i,this.COLS[this.dragCol]=t,this.COLS[this.dropCol]=e,this.ROWS.forEach(e=>{const t=e[this.dragCol],o=e[this.dropCol];e[this.dragCol]=o,e[this.dropCol]=t}),this.updCols(),this.updRows()}this.dragCol=-1,this.dropCol=-1}sort(e,t){e.sorter&&(this.clearSelection(),this.drops=[],this.COLS.forEach(o=>{o.options.id==e.options.id?o.sort=t||("default"==o.sort?"ascending":"ascending"==o.sort?"descending":"default"):o.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:e.sort}))}filter(e){if(!e.filter)return;this.clearSelection(),this.drops=[];const t=e.filter.input.trim(),o=e.filter.list[e.filter.selectedIndex];e.filter.active=!!t,this.requestUpdate(),t?this["md-table-advanced-change"].emit({type:"filter-on",filter:o,input:t}):this["md-table-advanced-change"].emit({type:"filter-off",filter:e.filter.list[e.filter.selectedIndex]})}selectRow(e){var t;const o=e.row.idx,r=this.selected.hasOwnProperty(o);"multiple"==(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)?(e.metaKey?r?delete this.selected[o]:this.selected[o]=!0:e.shiftKey||(this.selected={[o]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(e=>+e)})):r?this.clearSelection():(this.selected={[o]:!0},this["md-table-advanced-change"].emit({type:"select",index:o})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(e,t){e.stopPropagation(),this.expandedRowIdx[t]?(delete this.expandedRowIdx[t],this["md-table-advanced-change"].emit({type:"collapse",row:t})):(this.expandedRowIdx[t]=!0,this["md-table-advanced-change"].emit({type:"expand",row:t})),this.clearSelection(),this.requestUpdate()}render(){if(this.error)return l.html`
|
|
2
2
|
<div>${this.error}</div>
|
|
3
3
|
`;const{head:e}=this.tableConfig,t=Object(s.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return l.html`
|
|
4
4
|
<div class="md-table-advanced">
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
<table class=${t} summary=${Object(n.ifDefined)(null==e?void 0:e.summary)}>
|
|
7
7
|
${(null==e?void 0:e.caption)?l.html`
|
|
8
8
|
<caption>
|
|
9
|
-
${null==e?void 0:e.caption}
|
|
9
|
+
${null==e?void 0:e.caption}
|
|
10
|
+
${(null==e?void 0:e.tableDescription)?l.html`
|
|
11
|
+
<span style="position: absolute; top: -30em">${null==e?void 0:e.tableDescription}</span>
|
|
12
|
+
`:d.nothing}
|
|
10
13
|
</caption>
|
|
11
14
|
`:(null==e?void 0:e.tableDescription)?l.html`
|
|
12
15
|
<caption>
|
|
@@ -32,15 +35,15 @@
|
|
|
32
35
|
</th>
|
|
33
36
|
`):void 0:this.renderCol(e,2))}
|
|
34
37
|
</tr>
|
|
35
|
-
`}const
|
|
38
|
+
`}const o=l.html`
|
|
36
39
|
<tr tabindex="0">
|
|
37
40
|
${this.COLS.map(e=>t?e.group?this.renderCol(e):void 0:this.renderCol(e))}
|
|
38
41
|
</tr>
|
|
39
42
|
`;return l.html`
|
|
40
43
|
<thead>
|
|
41
|
-
${e} ${
|
|
44
|
+
${e} ${o}
|
|
42
45
|
</thead>
|
|
43
|
-
`}renderCol(e,t){var r
|
|
46
|
+
`}renderCol(e,t){var o,r;const i=null===(r=null===(o=e.filter)||void 0===o?void 0:o.list[e.filter.selectedIndex])||void 0===r?void 0:r.input,a=Object(s.classMap)({ascending:"ascending"==e.sort,descending:"descending"==e.sort});return l.html`
|
|
44
47
|
<th
|
|
45
48
|
rowspan=${Object(n.ifDefined)(t)}
|
|
46
49
|
width=${Object(n.ifDefined)(e.width?e.width:e.options.width)}
|
|
@@ -76,8 +79,8 @@
|
|
|
76
79
|
name="filter-type"
|
|
77
80
|
@change=${t=>{e.filter.selectedIndex=t.target.value,this.updCols(),this.filter(e)}}
|
|
78
81
|
>
|
|
79
|
-
${e.filter.list.map((t,
|
|
80
|
-
<option value=${
|
|
82
|
+
${e.filter.list.map((t,o)=>l.html`
|
|
83
|
+
<option value=${o} ?selected=${e.filter.selectedIndex==o}>${t.label}</option>
|
|
81
84
|
`)}
|
|
82
85
|
</select>
|
|
83
86
|
<input
|
|
@@ -109,27 +112,27 @@
|
|
|
109
112
|
${e.index>0?l.html`
|
|
110
113
|
<div class="resize" draggable="true" @dragstart=${t=>this.onResize(t,e)}></div>
|
|
111
114
|
`:d.nothing}
|
|
112
|
-
`:d.nothing}renderBody(){let e=this.ROWS.map((e,t)=>({cells:e,idx:t,idxDrag:t,collapse:"none",first:0===t,isGhost:!1,children:[]}));const t=this.COLS.length;e=e.filter(e=>{var
|
|
115
|
+
`:d.nothing}renderBody(){let e=this.ROWS.map((e,t)=>({cells:e,idx:t,idxDrag:t,collapse:"none",first:0===t,isGhost:!1,children:[]}));const t=this.COLS.length;e=e.filter(e=>{var o;for(let r=0;r<t;r++){const t=this.COLS[r];if(null===(o=t.filter)||void 0===o?void 0:o.active){if(!t.filter.list[t.filter.selectedIndex].predicate(e.cells[r].text,t.filter.input))return!1}}return!0});const o=this.COLS.find(e=>"default"!=e.sort);if(o){const t=this.ROWS.map((e,t)=>({v:e[o.index].text,i:t})),r="ascending"==o.sort?1:-1;let i=[];if("byNumber"==o.sorter)i=t.sort((e,t)=>1==r?+e.v-+t.v:+t.v-+e.v);else if("byString"==o.sorter)i=t.sort((e,t)=>e.v==t.v?0:e.v>t.v?r:-r);else if("function"==typeof o.sorter){const e=o.sorter;i=t.sort((t,o)=>e(t.v,o.v,r))}e=i.map(t=>e[t.i])}const r=this.COLS.find(e=>e.isCollapsable);if(r){const t=r.index,o=e.reduce((e,o)=>{const r=o.cells[t].text,i=e.find(e=>e.key==r);return i?(o.collapse="child",i.children.push(o)):e.push({key:r,root:o,children:[]}),e},[]);e=[],o.forEach(t=>{e.push(t.root),t.root.collapse=0==t.children.length?"none":this.expandedRowIdx[t.root.idx]?"expanded":"collapsed",t.root.children=t.children})}return this.drops.forEach(({0:t,1:o})=>{e.splice(o,0,e.splice(t,1)[0])}),e.forEach((e,t)=>e.idxDrag=t),-1!=this.dragRow&&(e[this.dragRow].isGhost=!0,-1!=this.dropRow&&e.splice(this.dropRow,0,e.splice(this.dragRow,1)[0])),l.html`
|
|
113
116
|
<tbody>
|
|
114
|
-
${e.map(t=>{const
|
|
115
|
-
${this.renderRow(t,
|
|
117
|
+
${e.map(t=>{const o=e.length,r=t.children.length>0&&"expanded"==t.collapse&&!t.isGhost;return l.html`
|
|
118
|
+
${this.renderRow(t,o)} ${r?t.children.map(e=>this.renderRow(e,o)):d.nothing}
|
|
116
119
|
`})}
|
|
117
120
|
</tbody>
|
|
118
|
-
`}renderRow(e,t){const
|
|
121
|
+
`}renderRow(e,t){const o=this.selected.hasOwnProperty(e.idx),r=Object(s.classMap)({selected:o,selectable:this.isSelectable&&!o,ghost:e.isGhost});return l.html`
|
|
119
122
|
<tr
|
|
120
|
-
class=${
|
|
121
|
-
tabindex
|
|
123
|
+
class=${r}
|
|
124
|
+
tabindex=${Object(n.ifDefined)("true"===this.isRowFocusable?"0":void 0)}
|
|
122
125
|
part=${e.first?"first-row":"row"}
|
|
123
|
-
@click=${({shiftKey:t,metaKey:
|
|
126
|
+
@click=${({shiftKey:t,metaKey:o})=>{this.isSelectable&&this.selectRow({row:e,shiftKey:t,metaKey:o})}}
|
|
124
127
|
>
|
|
125
|
-
${e.cells.map((r
|
|
126
|
-
${f({cb:n.templateCb,insertIndex:n.insertIndex,template:n.template,content:
|
|
128
|
+
${e.cells.map((o,r)=>{var i;const a=this.COLS[r];let s=o.text;const n=o.template;n&&(s=n.templateCb?l.html`
|
|
129
|
+
${f({cb:n.templateCb,insertIndex:n.insertIndex,template:n.template,content:o.text,row:e.idx,col:r})}
|
|
127
130
|
`:l.html`
|
|
128
131
|
${Object(c.templateContent)(n.template)}
|
|
129
132
|
`,-1!=n.insertIndex&&(s=l.html`
|
|
130
|
-
${n.insertIndex>0?
|
|
131
|
-
${n.insertIndex<
|
|
132
|
-
`));const h=(null===(i=this.tableConfig.rows)||void 0===i?void 0:i.isDraggable)&&"child"!=e.collapse,p=h&&-1!=this.dragRow&&this.dragRow!=e.idxDrag,b=h&&0==
|
|
133
|
+
${n.insertIndex>0?o.text.substring(0,n.insertIndex):d.nothing} ${s}
|
|
134
|
+
${n.insertIndex<o.text.length-1?o.text.substring(n.insertIndex):d.nothing}
|
|
135
|
+
`));const h=(null===(i=this.tableConfig.rows)||void 0===i?void 0:i.isDraggable)&&"child"!=e.collapse,p=h&&-1!=this.dragRow&&this.dragRow!=e.idxDrag,b=h&&0==r,g=l.html`
|
|
133
136
|
<div
|
|
134
137
|
class="inner-cell"
|
|
135
138
|
draggable="false"
|
|
@@ -143,7 +146,7 @@
|
|
|
143
146
|
></div>
|
|
144
147
|
<div
|
|
145
148
|
class="drag-area bottom"
|
|
146
|
-
@dragenter=${()=>{if(0==this.dragRow)this.dropRow=e.idxDrag;else{const
|
|
149
|
+
@dragenter=${()=>{if(0==this.dragRow)this.dropRow=e.idxDrag;else{const o=e.idxDrag+1;this.dropRow=o<t?o:t-1}}}
|
|
147
150
|
></div>
|
|
148
151
|
`:d.nothing}
|
|
149
152
|
${b?l.html`
|
|
@@ -176,9 +179,9 @@
|
|
|
176
179
|
`}
|
|
177
180
|
</div>
|
|
178
181
|
`;return a.options.isHeader?l.html`
|
|
179
|
-
<th part="cell-ishead" scope="row" title="${
|
|
182
|
+
<th part="cell-ishead" scope="row" title="${o.text}">${g}</th>
|
|
180
183
|
`:l.html`
|
|
181
|
-
<td part=${0===
|
|
184
|
+
<td part=${0===r?"first-cell":"cell"} title="${o.text}">${g}</td>
|
|
182
185
|
`})}
|
|
183
186
|
</tr>
|
|
184
|
-
`}static get styles(){return[a.a,b]}};y([Object(l.property)({attribute:"config"})],t.prototype,"config",void 0),y([Object(l.property)({attribute:"data"})],t.prototype,"data",void 0),y([(e,t)=>{const
|
|
187
|
+
`}static get styles(){return[a.a,b]}};y([Object(l.property)({attribute:"config"})],t.prototype,"config",void 0),y([Object(l.property)({attribute:"data"})],t.prototype,"data",void 0),y([Object(l.property)({type:String})],t.prototype,"isRowFocusable",void 0),y([(e,t)=>{const o={get(){return new u(this,void 0!==t?t:e.key)},enumerable:!0,configurable:!0};return void 0!==t?Object.defineProperty(e,t,o):{kind:"method",placement:"prototype",key:e.key,descriptor:o}}],t.prototype,"md-table-advanced-change",void 0),y([Object(l.internalProperty)()],t.prototype,"tableConfig",void 0),y([Object(l.internalProperty)()],t.prototype,"tableData",void 0),y([Object(l.internalProperty)()],t.prototype,"error",void 0),y([Object(l.internalProperty)()],t.prototype,"COLS",void 0),y([Object(l.internalProperty)()],t.prototype,"ROWS",void 0),y([Object(l.internalProperty)()],t.prototype,"dragRow",void 0),y([Object(l.internalProperty)()],t.prototype,"dropRow",void 0),y([Object(l.internalProperty)()],t.prototype,"drops",void 0),y([Object(l.internalProperty)()],t.prototype,"dragCol",void 0),y([Object(l.internalProperty)()],t.prototype,"dropCol",void 0),y([Object(l.queryAll)("tr[tabindex]")],t.prototype,"tableRaws",void 0),y([g(500)],t.prototype,"filter",null),t=y([Object(r.a)("md-table-advanced")],t),e.ELEMENT=t}(w||(w={}))}}]);
|
package/dist/index-entry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit-element"),require("lit-html"),require("lit-html/directives/if-defined"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("luxon"),require("lit-html/directives/class-map.js"),require("lit-html/directives/repeat"),require("@interactjs/interact/index"),require("@popperjs/core/lib/popper-lite"),require("nanoid"),require("highlight.js/lib/core"),require("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("sortablejs"),require("papaparse"),require("lit-html/directives/repeat.js"),require("@popperjs/core/lib"),require("lit-html/directives/until.js"),require("dompurify"),require("@interactjs/actions/drag"),require("@interactjs/actions/resize"),require("@interactjs/auto-start"),require("@interactjs/modifiers"),require("libphonenumber-js"),require("lit-html/directives/unsafe-html"),require("lit-virtualizer"),require("country-codes-list"),require("country-flags-svg"),require("lit-html/directives/template-content"));else if("function"==typeof define&&define.amd)define(["lit-element","lit-html","lit-html/directives/if-defined","lit-html/directives/class-map","lit-html/directives/style-map","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","luxon","lit-html/directives/class-map.js","lit-html/directives/repeat","@interactjs/interact/index","@popperjs/core/lib/popper-lite","nanoid","highlight.js/lib/core","@popperjs/core/lib/modifiers/arrow","@popperjs/core/lib/modifiers/flip","@popperjs/core/lib/modifiers/offset","@popperjs/core/lib/modifiers/preventOverflow","sortablejs","papaparse","lit-html/directives/repeat.js","@popperjs/core/lib","lit-html/directives/until.js","dompurify","@interactjs/actions/drag","@interactjs/actions/resize","@interactjs/auto-start","@interactjs/modifiers","libphonenumber-js","lit-html/directives/unsafe-html","lit-virtualizer","country-codes-list","country-flags-svg","lit-html/directives/template-content"],t);else{var o="object"==typeof exports?t(require("lit-element"),require("lit-html"),require("lit-html/directives/if-defined"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("luxon"),require("lit-html/directives/class-map.js"),require("lit-html/directives/repeat"),require("@interactjs/interact/index"),require("@popperjs/core/lib/popper-lite"),require("nanoid"),require("highlight.js/lib/core"),require("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("sortablejs"),require("papaparse"),require("lit-html/directives/repeat.js"),require("@popperjs/core/lib"),require("lit-html/directives/until.js"),require("dompurify"),require("@interactjs/actions/drag"),require("@interactjs/actions/resize"),require("@interactjs/auto-start"),require("@interactjs/modifiers"),require("libphonenumber-js"),require("lit-html/directives/unsafe-html"),require("lit-virtualizer"),require("country-codes-list"),require("country-flags-svg"),require("lit-html/directives/template-content")):t(e["lit-element"],e["lit-html"],e["lit-html/directives/if-defined"],e["lit-html/directives/class-map"],e["lit-html/directives/style-map"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.luxon,e["lit-html/directives/class-map.js"],e["lit-html/directives/repeat"],e["@interactjs/interact/index"],e["@popperjs/core/lib/popper-lite"],e.nanoid,e["highlight.js/lib/core"],e["@popperjs/core/lib/modifiers/arrow"],e["@popperjs/core/lib/modifiers/flip"],e["@popperjs/core/lib/modifiers/offset"],e["@popperjs/core/lib/modifiers/preventOverflow"],e.sortablejs,e.papaparse,e["lit-html/directives/repeat.js"],e["@popperjs/core/lib"],e["lit-html/directives/until.js"],e.dompurify,e["@interactjs/actions/drag"],e["@interactjs/actions/resize"],e["@interactjs/auto-start"],e["@interactjs/modifiers"],e["libphonenumber-js"],e["lit-html/directives/unsafe-html"],e["lit-virtualizer"],e["country-codes-list"],e["country-flags-svg"],e["lit-html/directives/template-content"]);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(window,(function(e,t,o,r,i,n,c,d,s,l,a,u,p,m,h,f,g,b,j,y,v,x,q,k,w,T,C,P,O,L,A,B,M,D){return function(e){function t(t){for(var r,c,d=t[0],s=t[1],l=t[2],u=0,p=[];u<d.length;u++)c=d[u],Object.prototype.hasOwnProperty.call(i,c)&&i[c]&&p.push(i[c][0]),i[c]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(a&&a(t);p.length;)p.shift()();return n.push.apply(n,l||[]),o()}function o(){for(var e,t=0;t<n.length;t++){for(var o=n[t],r=!0,d=1;d<o.length;d++){var s=o[d];0!==i[s]&&(r=!1)}r&&(n.splice(t--,1),e=c(c.s=o[0]))}return e}var r={},i={341:0,276:0,277:0,278:0,279:0,280:0,281:0,282:0,283:0,284:0,285:0,286:0,287:0,288:0,289:0,290:0,291:0,292:0,293:0,294:0,295:0,296:0,297:0,298:0,299:0,300:0,301:0,302:0,303:0,304:0,305:0,306:0,307:0,308:0,309:0,310:0,311:0,312:0,313:0,314:0,315:0,316:0,317:0,318:0,319:0,320:0,321:0,322:0,323:0,324:0,325:0,326:0,327:0,328:0,329:0,330:0,331:0,332:0,333:0,334:0,335:0,336:0,337:0,338:0,339:0,340:0},n=[];function c(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,c),o.l=!0,o.exports}c.e=function(e){var t=[],o=i[e];if(0!==o)if(o)t.push(o[2]);else{var r=new Promise((function(t,r){o=i[e]=[t,r]}));t.push(o[2]=r);var n,d=document.createElement("script");d.charset="utf-8",d.timeout=120,c.nc&&d.setAttribute("nonce",c.nc),d.src=function(e){return c.p+"chunks/md-"+e+".js"}(e);var s=new Error;n=function(t){d.onerror=d.onload=null,clearTimeout(l);var o=i[e];if(0!==o){if(o){var r=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+n+")",s.name="ChunkLoadError",s.type=r,s.request=n,o[1](s)}i[e]=void 0}};var l=setTimeout((function(){n({type:"timeout",target:d})}),12e4);d.onerror=d.onload=n,document.head.appendChild(d)}return Promise.all(t)},c.m=e,c.c=r,c.d=function(e,t,o){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(c.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(o,r,function(t){return e[t]}.bind(null,r));return o},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var d=window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[],s=d.push.bind(d);d.push=t,d=d.slice();for(var l=0;l<d.length;l++)t(d[l]);var a=s;return n.push([319,43,0,1,2,3,4,5,6,7,8,9,10,11,13,12,14,15,16,17,18,19,21,20,22,23,26,27,25,24,36,37,39,29,35,42,34,31,30,40,41,33,32,28,38,82,80,78,71,56,63,49,83,65,57,81,73,64,69,76,79,72,60,84,52,51,70,61,66,48,44,68,75,54,45,67,47,59,74,50,55,53,46,62,77,58]),o()}({0:function(t,o){t.exports=e},10:function(e,t){e.exports=n},11:function(e,t){e.exports=c},12:function(e,t){e.exports=d},13:function(e,t){e.exports=s},14:function(e,t){e.exports=l},2:function(e,o){e.exports=t},20:function(e,t){e.exports=a},21:function(e,t){e.exports=u},22:function(e,t){e.exports=p},23:function(e,t){e.exports=m},25:function(e,t){e.exports=h},26:function(e,t){e.exports=f},27:function(e,t){e.exports=g},28:function(e,t){e.exports=b},3:function(e,t){e.exports=o},30:function(e,t){e.exports=j},31:function(e,t){e.exports=y},319:function(e,t,o){"use strict";o.r(t),o.d(t,"Accordion",(function(){return i.Accordion})),o.d(t,"AccordionItem",(function(){return n.AccordionItem})),o.d(t,"ActivityButton",(function(){return c.ActivityButton})),o.d(t,"AlertBanner",(function(){return d.AlertBanner})),o.d(t,"Alert",(function(){return s.Alert})),o.d(t,"AudioPlayer",(function(){return l.AudioPlayer})),o.d(t,"Avatar",(function(){return a.Avatar})),o.d(t,"CompositeAvatar",(function(){return u.CompositeAvatar})),o.d(t,"Badge",(function(){return p.Badge})),o.d(t,"Breadcrumb",(function(){return m.Breadcrumb})),o.d(t,"ButtonGroup",(function(){return h.ButtonGroup})),o.d(t,"Button",(function(){return f.Button})),o.d(t,"Card",(function(){return g.Card})),o.d(t,"ChatMessage",(function(){return b.ChatMessage})),o.d(t,"Checkbox",(function(){return j.Checkbox})),o.d(t,"CheckboxGroup",(function(){return y.CheckboxGroup})),o.d(t,"Chip",(function(){return v.Chip})),o.d(t,"Coachmark",(function(){return x.Coachmark})),o.d(t,"CodeEditor",(function(){return r})),o.d(t,"ComboBox",(function(){return A.ComboBox})),o.d(t,"DateRangePicker",(function(){return B.DateRangePicker})),o.d(t,"DateTimePicker",(function(){return M.DateTimePicker})),o.d(t,"DatePicker",(function(){return D.DatePicker})),o.d(t,"DatePickerCalendar",(function(){return I.DatePickerCalendar})),o.d(t,"DatePickerDay",(function(){return S.DatePickerDay})),o.d(t,"DatePickerMonth",(function(){return z.DatePickerMonth})),o.d(t,"DatePickerWeek",(function(){return U.DatePickerWeek})),o.d(t,"Draggable",(function(){return N.Draggable})),o.d(t,"DraggableItem",(function(){return R.DraggableItem})),o.d(t,"Dropdown",(function(){return E.Dropdown})),o.d(t,"EditableTextfield",(function(){return F.EditableTextfield})),o.d(t,"Favorite",(function(){return _.Favorite})),o.d(t,"FloatingModal",(function(){return $.FloatingModal})),o.d(t,"FloatingMinimizedModal",(function(){return G.FloatingMinimizedModal})),o.d(t,"Form",(function(){return V.Form})),o.d(t,"HelpText",(function(){return H.HelpText})),o.d(t,"Icon",(function(){return W.Icon})),o.d(t,"InputFile",(function(){return J.InputFile})),o.d(t,"Input",(function(){return K.Input})),o.d(t,"Label",(function(){return Q.Label})),o.d(t,"Link",(function(){return X.Link})),o.d(t,"List",(function(){return Y.List})),o.d(t,"ListItem",(function(){return Z.ListItem})),o.d(t,"Loading",(function(){return ee.Loading})),o.d(t,"MeetingAlert",(function(){return te.MeetingAlert})),o.d(t,"MenuOverlay",(function(){return oe.MenuOverlay})),o.d(t,"Menu",(function(){return re.Menu})),o.d(t,"MenuItem",(function(){return ie.MenuItem})),o.d(t,"Modal",(function(){return ne.Modal})),o.d(t,"Pagination",(function(){return ce.Pagination})),o.d(t,"PhoneInput",(function(){return de.PhoneInput})),o.d(t,"ProgressBar",(function(){return se.ProgressBar})),o.d(t,"Radio",(function(){return le.Radio})),o.d(t,"RadioGroup",(function(){return ae.RadioGroup})),o.d(t,"Slider",(function(){return ue.Slider})),o.d(t,"Spinner",(function(){return pe.Spinner})),o.d(t,"Table",(function(){return me.Table})),o.d(t,"TableAdvanced",(function(){return he.TableAdvanced})),o.d(t,"Tab",(function(){return fe.Tab})),o.d(t,"TabPanel",(function(){return ge.TabPanel})),o.d(t,"Tabs",(function(){return be.Tabs})),o.d(t,"TaskItem",(function(){return je.TaskItem})),o.d(t,"Theme",(function(){return ye.Theme})),o.d(t,"TimePicker",(function(){return ve.TimePicker})),o.d(t,"ToggleSwitch",(function(){return xe.ToggleSwitch})),o.d(t,"Tooltip",(function(){return qe.Tooltip}));var r,i=o(82),n=o(83),c=o(84),d=o(103),s=o(104),l=o(105),a=o(43),u=o(85),p=o(49),m=o(106),h=o(107),f=o(17),g=o(108),b=o(109),j=o(86),y=o(87),v=o(110),x=o(111),q=o(7),k=o(5),w=o(23),T=o.n(w),C=o(0),P=C.css`:host(md-code-editor) .md-code-editor{background:#091e26;border-radius:.25rem;color:#fff;min-height:18.75rem;overflow:hidden}:host(md-code-editor) .md-code-editor-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:center;background:#092d3b;flex:0 0 auto;font-size:14px;padding:.625rem}:host(md-code-editor) .md-code-editor-name{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center}:host(md-code-editor) .md-code-editor md-badge::part(badge){border-radius:.25rem;height:1.25rem;margin-right:.625rem;padding:.25rem .375rem;text-transform:capitalize}:host(md-code-editor) .md-code-editor-copy{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center;line-height:1}:host(md-code-editor) .md-code-editor-copy-btn::part(button){background:0 0;color:#00a0d1;margin-left:.625rem}:host(md-code-editor) .md-code-editor-copy-btn[disabled]{cursor:not-allowed;opacity:.5}:host(md-code-editor) .hljs-comment,:host(md-code-editor) .hljs-quote{color:#ffecc2}:host(md-code-editor) .hljs-deletion,:host(md-code-editor) .hljs-name,:host(md-code-editor) .hljs-regexp,:host(md-code-editor) .hljs-selector-class,:host(md-code-editor) .hljs-selector-id,:host(md-code-editor) .hljs-tag,:host(md-code-editor) .hljs-template-variable,:host(md-code-editor) .hljs-variable{color:#ff9d52}:host(md-code-editor) .hljs-built_in,:host(md-code-editor) .hljs-builtin-name,:host(md-code-editor) .hljs-link,:host(md-code-editor) .hljs-literal,:host(md-code-editor) .hljs-meta,:host(md-code-editor) .hljs-number,:host(md-code-editor) .hljs-params,:host(md-code-editor) .hljs-type{color:#fc9d03}:host(md-code-editor) .hljs-attribute{color:#ebd460}:host(md-code-editor) .hljs-addition,:host(md-code-editor) .hljs-bullet,:host(md-code-editor) .hljs-string,:host(md-code-editor) .hljs-symbol{color:#93c437}:host(md-code-editor) .hljs-section,:host(md-code-editor) .hljs-title{color:#22c7d6}:host(md-code-editor) .hljs-keyword,:host(md-code-editor) .hljs-selector-tag{color:#f0e3fc}:host(md-code-editor) .hljs{background:rgba(0,0,0,0);color:#dedede;display:block;overflow-x:auto;padding:.5em}:host(md-code-editor) .hljs-emphasis{font-style:italic}:host(md-code-editor) .hljs-strong{font-weight:700}@media screen and (-ms-high-contrast:active){:host(md-code-editor) .hljs-addition,:host(md-code-editor) .hljs-attribute,:host(md-code-editor) .hljs-built_in,:host(md-code-editor) .hljs-builtin-name,:host(md-code-editor) .hljs-bullet,:host(md-code-editor) .hljs-comment,:host(md-code-editor) .hljs-link,:host(md-code-editor) .hljs-literal,:host(md-code-editor) .hljs-meta,:host(md-code-editor) .hljs-number,:host(md-code-editor) .hljs-params,:host(md-code-editor) .hljs-quote,:host(md-code-editor) .hljs-string,:host(md-code-editor) .hljs-symbol,:host(md-code-editor) .hljs-type{color:highlight}:host(md-code-editor) .hljs-keyword,:host(md-code-editor) .hljs-selector-tag{font-weight:700}}`,O=function(e,t,o,r){var i,n=arguments.length,c=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,o,r);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(c=(n<3?i(c):n>3?i(t,o,c):i(t,o))||c);return n>3&&c&&Object.defineProperty(t,o,c),c},L=function(e,t,o,r){return new(o||(o=Promise))((function(i,n){function c(e){try{s(r.next(e))}catch(e){n(e)}}function d(e){try{s(r.throw(e))}catch(e){n(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(c,d)}s((r=r.apply(e,t||[])).next())}))};!function(e){let t=class extends C.LitElement{constructor(){super(...arguments),this.copyLocalization="cURL",this.copiedLocalization="Copied",this.method="get",this.acceptLanguage="javascript",this.url="javascript",this.disableCopyButton=!0,this.acceptTypes="",this.copied=!1}static get styles(){return[k.a,P]}handleSlotChange(){if(this.slotNodes&&this.slotNodes.length){const e=this.slotNodes.find(e=>"CODE"===e.tagName);if(e){const t=e.textContent;t&&this.highlightBlock(t)}}}handleUrlSlotChange(){if(this.copied=!1,this.slotUrl&&this.slotUrl.length){const e=this.slotUrl.find(e=>e);if(e){const t=e.textContent;t&&this.copyUrl(t)}}}highlightBlock(e){e&&(this.codeBlock.innerText=e),T.a.highlightBlock(this.codeBlock)}copyUrl(e){this.codeUrl.innerText=e,this.disableCopyButton=!1}copyClipboard(){this.disableCopyButton||(this.codeUrl.innerText,this.selectTarget(this.codeUrl))}copyText(){try{document.execCommand("copy"),this.copied=!0}catch(e){console.warn("Copy text failed"),this.copied=!1}}select(e){const t=window.getSelection(),o=document.createRange();o.selectNodeContents(e),t&&(t.removeAllRanges(),t.addRange(o))}selectTarget(e){this.select(e),this.copyText()}importLanguage(e){return L(this,void 0,void 0,(function*(){try{const{default:t}=yield o(88)("./"+e);T.a.registerLanguage(""+e,t),this.setAcceptTypes()}catch(e){console.warn("Please set correct language name")}}))}getAllAcceptTypes(){const e=T.a.listLanguages();return e.length?e.map(e=>T.a.getLanguage(""+e).aliases).map(e=>e.map(e=>"."+e)).join(","):""}setAcceptTypes(){this.acceptTypes=this.getAllAcceptTypes()}updated(e){super.updated(e),e.has("acceptLanguage")&&this.importLanguage(this.acceptLanguage),e.has("acceptTypes")&&this.highlightBlock()}render(){return C.html`
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit-element"),require("lit-html"),require("lit-html/directives/if-defined"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("luxon"),require("lit-html/directives/class-map.js"),require("lit-html/directives/repeat"),require("@interactjs/interact/index"),require("@popperjs/core/lib/popper-lite"),require("nanoid"),require("highlight.js/lib/core"),require("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("sortablejs"),require("papaparse"),require("lit-html/directives/repeat.js"),require("@popperjs/core/lib"),require("lit-html/directives/until.js"),require("dompurify"),require("@interactjs/actions/drag"),require("@interactjs/actions/resize"),require("@interactjs/auto-start"),require("@interactjs/modifiers"),require("libphonenumber-js"),require("lit-html/directives/unsafe-html"),require("lit-virtualizer"),require("country-codes-list"),require("country-flags-svg"),require("lit-html/directives/template-content"));else if("function"==typeof define&&define.amd)define(["lit-element","lit-html","lit-html/directives/if-defined","lit-html/directives/class-map","lit-html/directives/style-map","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","luxon","lit-html/directives/class-map.js","lit-html/directives/repeat","@interactjs/interact/index","@popperjs/core/lib/popper-lite","nanoid","highlight.js/lib/core","@popperjs/core/lib/modifiers/arrow","@popperjs/core/lib/modifiers/flip","@popperjs/core/lib/modifiers/offset","@popperjs/core/lib/modifiers/preventOverflow","sortablejs","papaparse","lit-html/directives/repeat.js","@popperjs/core/lib","lit-html/directives/until.js","dompurify","@interactjs/actions/drag","@interactjs/actions/resize","@interactjs/auto-start","@interactjs/modifiers","libphonenumber-js","lit-html/directives/unsafe-html","lit-virtualizer","country-codes-list","country-flags-svg","lit-html/directives/template-content"],t);else{var o="object"==typeof exports?t(require("lit-element"),require("lit-html"),require("lit-html/directives/if-defined"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("luxon"),require("lit-html/directives/class-map.js"),require("lit-html/directives/repeat"),require("@interactjs/interact/index"),require("@popperjs/core/lib/popper-lite"),require("nanoid"),require("highlight.js/lib/core"),require("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("sortablejs"),require("papaparse"),require("lit-html/directives/repeat.js"),require("@popperjs/core/lib"),require("lit-html/directives/until.js"),require("dompurify"),require("@interactjs/actions/drag"),require("@interactjs/actions/resize"),require("@interactjs/auto-start"),require("@interactjs/modifiers"),require("libphonenumber-js"),require("lit-html/directives/unsafe-html"),require("lit-virtualizer"),require("country-codes-list"),require("country-flags-svg"),require("lit-html/directives/template-content")):t(e["lit-element"],e["lit-html"],e["lit-html/directives/if-defined"],e["lit-html/directives/class-map"],e["lit-html/directives/style-map"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.luxon,e["lit-html/directives/class-map.js"],e["lit-html/directives/repeat"],e["@interactjs/interact/index"],e["@popperjs/core/lib/popper-lite"],e.nanoid,e["highlight.js/lib/core"],e["@popperjs/core/lib/modifiers/arrow"],e["@popperjs/core/lib/modifiers/flip"],e["@popperjs/core/lib/modifiers/offset"],e["@popperjs/core/lib/modifiers/preventOverflow"],e.sortablejs,e.papaparse,e["lit-html/directives/repeat.js"],e["@popperjs/core/lib"],e["lit-html/directives/until.js"],e.dompurify,e["@interactjs/actions/drag"],e["@interactjs/actions/resize"],e["@interactjs/auto-start"],e["@interactjs/modifiers"],e["libphonenumber-js"],e["lit-html/directives/unsafe-html"],e["lit-virtualizer"],e["country-codes-list"],e["country-flags-svg"],e["lit-html/directives/template-content"]);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(window,(function(e,t,o,r,i,n,c,d,s,l,a,u,p,m,h,f,g,b,j,y,v,x,q,k,w,T,C,P,O,L,A,B,M,D){return function(e){function t(t){for(var r,c,d=t[0],s=t[1],l=t[2],u=0,p=[];u<d.length;u++)c=d[u],Object.prototype.hasOwnProperty.call(i,c)&&i[c]&&p.push(i[c][0]),i[c]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(a&&a(t);p.length;)p.shift()();return n.push.apply(n,l||[]),o()}function o(){for(var e,t=0;t<n.length;t++){for(var o=n[t],r=!0,d=1;d<o.length;d++){var s=o[d];0!==i[s]&&(r=!1)}r&&(n.splice(t--,1),e=c(c.s=o[0]))}return e}var r={},i={341:0,276:0,277:0,278:0,279:0,280:0,281:0,282:0,283:0,284:0,285:0,286:0,287:0,288:0,289:0,290:0,291:0,292:0,293:0,294:0,295:0,296:0,297:0,298:0,299:0,300:0,301:0,302:0,303:0,304:0,305:0,306:0,307:0,308:0,309:0,310:0,311:0,312:0,313:0,314:0,315:0,316:0,317:0,318:0,319:0,320:0,321:0,322:0,323:0,324:0,325:0,326:0,327:0,328:0,329:0,330:0,331:0,332:0,333:0,334:0,335:0,336:0,337:0,338:0,339:0,340:0},n=[];function c(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,c),o.l=!0,o.exports}c.e=function(e){var t=[],o=i[e];if(0!==o)if(o)t.push(o[2]);else{var r=new Promise((function(t,r){o=i[e]=[t,r]}));t.push(o[2]=r);var n,d=document.createElement("script");d.charset="utf-8",d.timeout=120,c.nc&&d.setAttribute("nonce",c.nc),d.src=function(e){return c.p+"chunks/md-"+e+".js"}(e);var s=new Error;n=function(t){d.onerror=d.onload=null,clearTimeout(l);var o=i[e];if(0!==o){if(o){var r=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+n+")",s.name="ChunkLoadError",s.type=r,s.request=n,o[1](s)}i[e]=void 0}};var l=setTimeout((function(){n({type:"timeout",target:d})}),12e4);d.onerror=d.onload=n,document.head.appendChild(d)}return Promise.all(t)},c.m=e,c.c=r,c.d=function(e,t,o){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(c.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(o,r,function(t){return e[t]}.bind(null,r));return o},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var d=window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[],s=d.push.bind(d);d.push=t,d=d.slice();for(var l=0;l<d.length;l++)t(d[l]);var a=s;return n.push([319,43,0,1,2,3,4,5,6,7,8,9,10,11,13,12,14,15,16,17,18,19,21,20,22,23,26,27,25,24,36,37,39,29,35,31,42,34,30,40,41,33,32,28,38,82,80,78,71,56,63,49,83,65,57,81,73,64,69,76,79,72,60,84,52,51,70,61,66,48,44,68,75,54,45,67,47,59,74,50,55,53,46,62,77,58]),o()}({0:function(t,o){t.exports=e},10:function(e,t){e.exports=n},11:function(e,t){e.exports=c},12:function(e,t){e.exports=d},13:function(e,t){e.exports=s},14:function(e,t){e.exports=l},2:function(e,o){e.exports=t},20:function(e,t){e.exports=a},21:function(e,t){e.exports=u},22:function(e,t){e.exports=p},23:function(e,t){e.exports=m},25:function(e,t){e.exports=h},26:function(e,t){e.exports=f},27:function(e,t){e.exports=g},28:function(e,t){e.exports=b},3:function(e,t){e.exports=o},30:function(e,t){e.exports=j},31:function(e,t){e.exports=y},319:function(e,t,o){"use strict";o.r(t),o.d(t,"Accordion",(function(){return i.Accordion})),o.d(t,"AccordionItem",(function(){return n.AccordionItem})),o.d(t,"ActivityButton",(function(){return c.ActivityButton})),o.d(t,"AlertBanner",(function(){return d.AlertBanner})),o.d(t,"Alert",(function(){return s.Alert})),o.d(t,"AudioPlayer",(function(){return l.AudioPlayer})),o.d(t,"Avatar",(function(){return a.Avatar})),o.d(t,"CompositeAvatar",(function(){return u.CompositeAvatar})),o.d(t,"Badge",(function(){return p.Badge})),o.d(t,"Breadcrumb",(function(){return m.Breadcrumb})),o.d(t,"ButtonGroup",(function(){return h.ButtonGroup})),o.d(t,"Button",(function(){return f.Button})),o.d(t,"Card",(function(){return g.Card})),o.d(t,"ChatMessage",(function(){return b.ChatMessage})),o.d(t,"Checkbox",(function(){return j.Checkbox})),o.d(t,"CheckboxGroup",(function(){return y.CheckboxGroup})),o.d(t,"Chip",(function(){return v.Chip})),o.d(t,"Coachmark",(function(){return x.Coachmark})),o.d(t,"CodeEditor",(function(){return r})),o.d(t,"ComboBox",(function(){return A.ComboBox})),o.d(t,"DateRangePicker",(function(){return B.DateRangePicker})),o.d(t,"DateTimePicker",(function(){return M.DateTimePicker})),o.d(t,"DatePicker",(function(){return D.DatePicker})),o.d(t,"DatePickerCalendar",(function(){return I.DatePickerCalendar})),o.d(t,"DatePickerDay",(function(){return S.DatePickerDay})),o.d(t,"DatePickerMonth",(function(){return z.DatePickerMonth})),o.d(t,"DatePickerWeek",(function(){return U.DatePickerWeek})),o.d(t,"Draggable",(function(){return N.Draggable})),o.d(t,"DraggableItem",(function(){return R.DraggableItem})),o.d(t,"Dropdown",(function(){return E.Dropdown})),o.d(t,"EditableTextfield",(function(){return F.EditableTextfield})),o.d(t,"Favorite",(function(){return _.Favorite})),o.d(t,"FloatingModal",(function(){return $.FloatingModal})),o.d(t,"FloatingMinimizedModal",(function(){return G.FloatingMinimizedModal})),o.d(t,"Form",(function(){return V.Form})),o.d(t,"HelpText",(function(){return H.HelpText})),o.d(t,"Icon",(function(){return W.Icon})),o.d(t,"InputFile",(function(){return J.InputFile})),o.d(t,"Input",(function(){return K.Input})),o.d(t,"Label",(function(){return Q.Label})),o.d(t,"Link",(function(){return X.Link})),o.d(t,"List",(function(){return Y.List})),o.d(t,"ListItem",(function(){return Z.ListItem})),o.d(t,"Loading",(function(){return ee.Loading})),o.d(t,"MeetingAlert",(function(){return te.MeetingAlert})),o.d(t,"MenuOverlay",(function(){return oe.MenuOverlay})),o.d(t,"Menu",(function(){return re.Menu})),o.d(t,"MenuItem",(function(){return ie.MenuItem})),o.d(t,"Modal",(function(){return ne.Modal})),o.d(t,"Pagination",(function(){return ce.Pagination})),o.d(t,"PhoneInput",(function(){return de.PhoneInput})),o.d(t,"ProgressBar",(function(){return se.ProgressBar})),o.d(t,"Radio",(function(){return le.Radio})),o.d(t,"RadioGroup",(function(){return ae.RadioGroup})),o.d(t,"Slider",(function(){return ue.Slider})),o.d(t,"Spinner",(function(){return pe.Spinner})),o.d(t,"Table",(function(){return me.Table})),o.d(t,"TableAdvanced",(function(){return he.TableAdvanced})),o.d(t,"Tab",(function(){return fe.Tab})),o.d(t,"TabPanel",(function(){return ge.TabPanel})),o.d(t,"Tabs",(function(){return be.Tabs})),o.d(t,"TaskItem",(function(){return je.TaskItem})),o.d(t,"Theme",(function(){return ye.Theme})),o.d(t,"TimePicker",(function(){return ve.TimePicker})),o.d(t,"ToggleSwitch",(function(){return xe.ToggleSwitch})),o.d(t,"Tooltip",(function(){return qe.Tooltip}));var r,i=o(82),n=o(83),c=o(84),d=o(103),s=o(104),l=o(105),a=o(43),u=o(85),p=o(49),m=o(106),h=o(107),f=o(17),g=o(108),b=o(109),j=o(86),y=o(87),v=o(110),x=o(111),q=o(7),k=o(5),w=o(23),T=o.n(w),C=o(0),P=C.css`:host(md-code-editor) .md-code-editor{background:#091e26;border-radius:.25rem;color:#fff;min-height:18.75rem;overflow:hidden}:host(md-code-editor) .md-code-editor-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:center;background:#092d3b;flex:0 0 auto;font-size:14px;padding:.625rem}:host(md-code-editor) .md-code-editor-name{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center}:host(md-code-editor) .md-code-editor md-badge::part(badge){border-radius:.25rem;height:1.25rem;margin-right:.625rem;padding:.25rem .375rem;text-transform:capitalize}:host(md-code-editor) .md-code-editor-copy{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center;line-height:1}:host(md-code-editor) .md-code-editor-copy-btn::part(button){background:0 0;color:#00a0d1;margin-left:.625rem}:host(md-code-editor) .md-code-editor-copy-btn[disabled]{cursor:not-allowed;opacity:.5}:host(md-code-editor) .hljs-comment,:host(md-code-editor) .hljs-quote{color:#ffecc2}:host(md-code-editor) .hljs-deletion,:host(md-code-editor) .hljs-name,:host(md-code-editor) .hljs-regexp,:host(md-code-editor) .hljs-selector-class,:host(md-code-editor) .hljs-selector-id,:host(md-code-editor) .hljs-tag,:host(md-code-editor) .hljs-template-variable,:host(md-code-editor) .hljs-variable{color:#ff9d52}:host(md-code-editor) .hljs-built_in,:host(md-code-editor) .hljs-builtin-name,:host(md-code-editor) .hljs-link,:host(md-code-editor) .hljs-literal,:host(md-code-editor) .hljs-meta,:host(md-code-editor) .hljs-number,:host(md-code-editor) .hljs-params,:host(md-code-editor) .hljs-type{color:#fc9d03}:host(md-code-editor) .hljs-attribute{color:#ebd460}:host(md-code-editor) .hljs-addition,:host(md-code-editor) .hljs-bullet,:host(md-code-editor) .hljs-string,:host(md-code-editor) .hljs-symbol{color:#93c437}:host(md-code-editor) .hljs-section,:host(md-code-editor) .hljs-title{color:#22c7d6}:host(md-code-editor) .hljs-keyword,:host(md-code-editor) .hljs-selector-tag{color:#f0e3fc}:host(md-code-editor) .hljs{background:rgba(0,0,0,0);color:#dedede;display:block;overflow-x:auto;padding:.5em}:host(md-code-editor) .hljs-emphasis{font-style:italic}:host(md-code-editor) .hljs-strong{font-weight:700}@media screen and (-ms-high-contrast:active){:host(md-code-editor) .hljs-addition,:host(md-code-editor) .hljs-attribute,:host(md-code-editor) .hljs-built_in,:host(md-code-editor) .hljs-builtin-name,:host(md-code-editor) .hljs-bullet,:host(md-code-editor) .hljs-comment,:host(md-code-editor) .hljs-link,:host(md-code-editor) .hljs-literal,:host(md-code-editor) .hljs-meta,:host(md-code-editor) .hljs-number,:host(md-code-editor) .hljs-params,:host(md-code-editor) .hljs-quote,:host(md-code-editor) .hljs-string,:host(md-code-editor) .hljs-symbol,:host(md-code-editor) .hljs-type{color:highlight}:host(md-code-editor) .hljs-keyword,:host(md-code-editor) .hljs-selector-tag{font-weight:700}}`,O=function(e,t,o,r){var i,n=arguments.length,c=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,o,r);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(c=(n<3?i(c):n>3?i(t,o,c):i(t,o))||c);return n>3&&c&&Object.defineProperty(t,o,c),c},L=function(e,t,o,r){return new(o||(o=Promise))((function(i,n){function c(e){try{s(r.next(e))}catch(e){n(e)}}function d(e){try{s(r.throw(e))}catch(e){n(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(c,d)}s((r=r.apply(e,t||[])).next())}))};!function(e){let t=class extends C.LitElement{constructor(){super(...arguments),this.copyLocalization="cURL",this.copiedLocalization="Copied",this.method="get",this.acceptLanguage="javascript",this.url="javascript",this.disableCopyButton=!0,this.acceptTypes="",this.copied=!1}static get styles(){return[k.a,P]}handleSlotChange(){if(this.slotNodes&&this.slotNodes.length){const e=this.slotNodes.find(e=>"CODE"===e.tagName);if(e){const t=e.textContent;t&&this.highlightBlock(t)}}}handleUrlSlotChange(){if(this.copied=!1,this.slotUrl&&this.slotUrl.length){const e=this.slotUrl.find(e=>e);if(e){const t=e.textContent;t&&this.copyUrl(t)}}}highlightBlock(e){e&&(this.codeBlock.innerText=e),T.a.highlightBlock(this.codeBlock)}copyUrl(e){this.codeUrl.innerText=e,this.disableCopyButton=!1}copyClipboard(){this.disableCopyButton||(this.codeUrl.innerText,this.selectTarget(this.codeUrl))}copyText(){try{document.execCommand("copy"),this.copied=!0}catch(e){console.warn("Copy text failed"),this.copied=!1}}select(e){const t=window.getSelection(),o=document.createRange();o.selectNodeContents(e),t&&(t.removeAllRanges(),t.addRange(o))}selectTarget(e){this.select(e),this.copyText()}importLanguage(e){return L(this,void 0,void 0,(function*(){try{const{default:t}=yield o(88)("./"+e);T.a.registerLanguage(""+e,t),this.setAcceptTypes()}catch(e){console.warn("Please set correct language name")}}))}getAllAcceptTypes(){const e=T.a.listLanguages();return e.length?e.map(e=>T.a.getLanguage(""+e).aliases).map(e=>e.map(e=>"."+e)).join(","):""}setAcceptTypes(){this.acceptTypes=this.getAllAcceptTypes()}updated(e){super.updated(e),e.has("acceptLanguage")&&this.importLanguage(this.acceptLanguage),e.has("acceptTypes")&&this.highlightBlock()}render(){return C.html`
|
|
2
2
|
<div class="md-code-editor" part="code-editor">
|
|
3
3
|
<div class="md-code-editor-header">
|
|
4
4
|
<div class="md-code-editor-name">
|
package/dist/index.js
CHANGED
|
@@ -32,9 +32,9 @@ require("./chunks/md-37");
|
|
|
32
32
|
require("./chunks/md-39");
|
|
33
33
|
require("./chunks/md-29");
|
|
34
34
|
require("./chunks/md-35");
|
|
35
|
+
require("./chunks/md-31");
|
|
35
36
|
require("./chunks/md-42");
|
|
36
37
|
require("./chunks/md-34");
|
|
37
|
-
require("./chunks/md-31");
|
|
38
38
|
require("./chunks/md-30");
|
|
39
39
|
require("./chunks/md-40");
|
|
40
40
|
require("./chunks/md-41");
|
|
@@ -16,6 +16,13 @@ export declare namespace List {
|
|
|
16
16
|
listItemSlot?: HTMLSlotElement;
|
|
17
17
|
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
18
18
|
private notifySelectedChange;
|
|
19
|
+
/**
|
|
20
|
+
* @override
|
|
21
|
+
* Overridden isFocusable method.
|
|
22
|
+
* @param {Element} slottedItem - The slotted item to check.
|
|
23
|
+
* @returns {boolean} - Returns true if the slotted item does not have the "hidden" attribute, false otherwise.
|
|
24
|
+
*/
|
|
25
|
+
private isFocusable;
|
|
19
26
|
connectedCallback(): void;
|
|
20
27
|
disconnectedCallback(): void;
|
|
21
28
|
private findListItemIndex;
|