@momentum-ui/web-components 3.2.15 → 3.2.17

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/7137.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[7137],{7137(e,t,r){r.d(t,{A:()=>a});const a=r(7161).css`:host(md-card-alert){display:block}:host(md-card-alert) .md-card-alert{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-secondary-bg-color);border:1px solid var(--md-quaternary-bg-color);border-radius:.75rem;box-sizing:border-box;box-shadow:0 2px 8px rgba(0,0,0,.1);gap:.75rem;padding:.75rem;width:22.9375rem}:host(md-card-alert) .md-card-alert--no-insight{height:329px;max-height:329px;min-height:329px}:host(md-card-alert) .md-card-alert:focus{outline:0}:host(md-card-alert) .md-card-alert-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;flex-wrap:nowrap}:host(md-card-alert) .md-card-alert-chips{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.375rem}:host(md-card-alert) .md-card-alert-timestamp{color:var(--md-secondary-text-color);font-size:.875rem;font-weight:400;flex-shrink:0}:host(md-card-alert) .md-card-alert-title-section{align-content:center;align-items:flex-start;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:.125rem;min-width:0;width:100%}:host(md-card-alert) .md-card-alert-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;color:var(--md-primary-text-color);display:-webkit-box;font-size:1rem;font-weight:700;height:3rem;line-height:1.5rem;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:normal;width:100%}:host(md-card-alert) .md-card-alert-subtitle{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-secondary-text-color);font-size:.875rem;gap:.25rem;margin:0}:host(md-card-alert) .md-card-alert-subtitle-icon{flex-shrink:0;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-details{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-background-tertiary,#f3f4f6);border-radius:.5rem;gap:.1875rem;padding:.75rem}:host(md-card-alert) .md-card-alert-details-heading{color:var(--md-secondary-text-color);font-size:.875rem;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-row{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between}:host(md-card-alert) .md-card-alert-detail-label{color:var(--md-primary-text-color);font-size:.875rem;font-weight:700;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value{color:var(--md-primary-text-color);font-size:.875rem;text-align:right;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value--highlighted{color:var(--md-alert-error-text-color,#dc2626)}:host(md-card-alert) .md-card-alert-insight{align-content:center;align-items:flex-start;display:flex;flex-flow:row nowrap;justify-content:flex-start;background:var(--card-ai-blue-bg-color,#eff6ff);border-radius:.5rem;border:1px solid var(--badge-confidence-cobalt-border-color,#dbeafe);color:var(--md-primary-text-color);gap:.5rem;padding:.625rem .75rem}:host(md-card-alert) .md-card-alert-insight-icon{color:var(--badge-status-accent-text-color,#0284c7);flex-shrink:0;margin-top:.0625rem;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-insight-text{font-size:.875rem;line-height:1.25rem}:host(md-card-alert) .md-card-alert-actions{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.5rem}`}}]);
1
+ "use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[7137],{7137(r,e,t){t.d(e,{A:()=>a});const a=t(7161).css`:host(md-card-alert){display:block}:host(md-card-alert) .md-card-alert{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-glass-overlay-bg-color);border:1px solid var(--md-quaternary-bg-color);border-radius:.75rem;box-sizing:border-box;box-shadow:0 2px 8px rgba(0,0,0,.1);gap:.75rem;padding:.75rem;width:19.5625rem}:host(md-card-alert) .md-card-alert--no-insight{height:329px;max-height:329px;min-height:329px}:host(md-card-alert) .md-card-alert:hover{background:var(--md-card-v2-background-hover,var(--md-glass-overlay-bg-color));border:1px solid var(--card-v2-border-hover,var(--md-quaternary-bg-color))}:host(md-card-alert) .md-card-alert--expanded{border:1px solid var(--md-primary-text-color)}:host(md-card-alert) .md-card-alert:focus{outline:0}:host(md-card-alert) .md-card-alert-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;flex-wrap:nowrap}:host(md-card-alert) .md-card-alert-chips{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.375rem;min-width:0;overflow:hidden}:host(md-card-alert) .md-card-alert-timestamp{color:var(--md-secondary-text-color);font-size:.875rem;font-weight:400;flex-shrink:0}:host(md-card-alert) .md-card-alert-title-section{align-content:center;align-items:flex-start;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:.125rem;min-width:0;width:100%}:host(md-card-alert) .md-card-alert-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;color:var(--md-primary-text-color);display:-webkit-box;font-size:1rem;font-weight:700;max-height:3rem;line-height:1.5rem;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:normal;width:100%}:host(md-card-alert) .md-card-alert-subtitle{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-secondary-text-color);font-size:.875rem;gap:.25rem;margin:0}:host(md-card-alert) .md-card-alert-subtitle-icon{flex-shrink:0;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-details{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;margin-top:auto;background:var(--md-subtle-bg-color,#f3f4f6);border-radius:.5rem;gap:.1875rem;padding:.75rem}:host(md-card-alert) .md-card-alert-details-heading{color:var(--md-secondary-text-color);font-size:.875rem;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-row{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between}:host(md-card-alert) .md-card-alert-detail-label{color:var(--md-primary-text-color);font-size:.875rem;font-weight:700;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value{color:var(--md-primary-text-color);font-size:.875rem;text-align:right;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value--highlighted{color:var(--md-alert-error-text-color,#dc2626)}:host(md-card-alert) .md-card-alert-insight{align-content:center;align-items:flex-start;display:flex;flex-flow:row nowrap;justify-content:flex-start;background:var(--card-ai-blue-bg-color,#eff6ff);border-radius:.5rem;border:1px solid var(--badge-confidence-cobalt-border-color,#dbeafe);color:var(--md-primary-text-color);gap:.5rem;padding:.625rem .75rem}:host(md-card-alert) .md-card-alert-insight-icon{color:var(--badge-status-accent-text-color,#0284c7);flex-shrink:0;margin-top:.0625rem;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-insight-text{font-size:.875rem;line-height:1.25rem}:host(md-card-alert) .md-card-alert-actions{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.5rem}`}}]);
@@ -1,17 +1,15 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(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"));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"],e);else{var i="object"==typeof exports?e(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")):e(t.lit,t["lit/decorators.js"],t["lit/directives/class-map.js"],t["lit/directives/style-map.js"],t["lit/directives/if-defined.js"],t["@momentum-ui/icons/data/momentumUiIconsNames.json"],t["@momentum-ui/utils/lib/getColorValue"],t.mobx);for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(self,(t,e,i,r,o,s,n,a)=>(()=>{"use strict";var l,d={4882(t,e,i){i.r(e),i.d(e,{CardAlert:()=>m,CardAlertSeverity:()=>r}),i(5983),i(2583),i(1821);var r,o=i(9609),s=i(4084),n=i(7161),a=i(429),l=i(5125),d=i(7137),p=function(t,e,i,r){var o,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};!function(t){t.CRITICAL="critical",t.MEDIUM="medium"}(r||(r={}));const h={[r.CRITICAL]:{icon:"flag-filled",color:"negative"},[r.MEDIUM]:{icon:"warning-filled",color:"warning"}},c={dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var m;!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.timestamp="",this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!1,this.expanded=!1,this.relativeTime=""}static get styles(){return[s.A,d.A]}get normalizedSeverity(){var t;const e=(null!==(t=this.severity)&&void 0!==t?t:"").toLowerCase();return Object.values(r).includes(e)?e:void 0}get severityIcon(){return this.normalizedSeverity?h[this.normalizedSeverity].icon:"info-circle-filled"}get severityColor(){return this.normalizedSeverity?h[this.normalizedSeverity].color:"neutral"}get hasInsight(){var t;return(null!==(t=this.insight)&&void 0!==t?t:"").trim().length>0}get detailRows(){return Array.isArray(this.details)?this.details:[]}updateRelativeTime(){this.timestamp&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){t.has("timestamp")&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.constructor.locale,i=Date.now(),r="number"==typeof t?t:new Date(t).getTime();if(isNaN(r))return"";const o=i-r;if(o<0)return e.justNow;const s=Math.floor(o/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const n=Math.floor(s/60);if(n<24)return e.hoursAgo(n);const a=Math.floor(n/24);return e.daysAgo(a)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){return this.relativeTime?n.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:n.nothing}renderHeader(){return this.severity||this.category||this.timestamp?n.html`
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(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"));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"],e);else{var i="object"==typeof exports?e(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")):e(t.lit,t["lit/decorators.js"],t["lit/directives/class-map.js"],t["lit/directives/style-map.js"],t["lit/directives/if-defined.js"],t["@momentum-ui/icons/data/momentumUiIconsNames.json"],t["@momentum-ui/utils/lib/getColorValue"],t.mobx);for(var o in i)("object"==typeof exports?exports:t)[o]=i[o]}}(self,(t,e,i,o,r,s,n,a)=>(()=>{"use strict";var l,d={4882(t,e,i){i.r(e),i.d(e,{CardAlert:()=>m,CardAlertSeverity:()=>o}),i(5983),i(2583),i(1821);var o,r=i(9609),s=i(4084),n=i(7161),a=i(429),l=i(5125),d=i(7137),p=function(t,e,i,o){var r,s=arguments.length,n=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};!function(t){t.CRITICAL="critical",t.MEDIUM="medium"}(o||(o={}));const h={[o.CRITICAL]:{icon:"flag-filled",color:"negative"},[o.MEDIUM]:{icon:"warning-filled",color:"warning"}},c={dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var m;!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.secondaryChip="",this.timestamp="",this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!1,this.expanded=!1,this.relativeTime=""}static get styles(){return[s.A,d.A]}get normalizedSeverity(){var t;const e=(null!==(t=this.severity)&&void 0!==t?t:"").toLowerCase();return Object.values(o).includes(e)?e:void 0}get severityIcon(){return this.normalizedSeverity?h[this.normalizedSeverity].icon:"plus-circle-filled"}get severityColor(){return this.normalizedSeverity?h[this.normalizedSeverity].color:"neutral"}get hasInsight(){var t;return(null!==(t=this.insight)&&void 0!==t?t:"").trim().length>0}get detailRows(){return Array.isArray(this.details)?this.details:[]}get resolvedLocale(){return t=this.constructor.locale,Object.assign(Object.assign(Object.assign({},c),t),{dismiss:null!==(e=null==t?void 0:t.dismiss)&&void 0!==e?e:c.dismiss});var t,e}updateRelativeTime(){this.timestamp&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){t.has("timestamp")&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.resolvedLocale,i=Date.now(),o="number"==typeof t?t:new Date(t).getTime();if(isNaN(o))return"";const r=i-o;if(r<0)return e.justNow;const s=Math.floor(r/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const n=Math.floor(s/60);if(n<24)return e.hoursAgo(n);const a=Math.floor(n/24);return e.daysAgo(a)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){return this.relativeTime?n.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:n.nothing}renderHeader(){return this.severity||this.category||this.timestamp?n.html`
2
2
  <div class="md-card-alert-header">
3
3
  <div class="md-card-alert-chips">
4
- ${this.severity?n.html`
5
- <md-chip color=${this.severityColor} small>
6
- <md-icon
7
- name=${this.severityIcon}
8
- size="14"
9
- iconSet="momentumDesign"
10
- slot="custom-left-content"
11
- ></md-icon>
12
- </md-chip>
13
- `:n.nothing}
14
- ${this.category?n.html`<md-chip value=${this.category} color="neutral" small></md-chip>`:n.nothing}
4
+ <md-chip color=${this.severityColor} value=${this.category} small>
5
+ <md-icon
6
+ name=${this.severityIcon}
7
+ size="14"
8
+ iconSet="momentumDesign"
9
+ slot="custom-left-content"
10
+ ></md-icon>
11
+ </md-chip>
12
+ ${this.secondaryChip?n.html`<md-chip color="confidence-cobalt" value=${this.secondaryChip} small></md-chip>`:n.nothing}
15
13
  </div>
16
14
  ${this.renderTimestamp()}
17
15
  </div>
@@ -48,11 +46,11 @@
48
46
  <md-icon name="sparkle-filled" iconSet="momentumDesign" class="md-card-alert-insight-icon"></md-icon>
49
47
  <span class="md-card-alert-insight-text">${this.insight}</span>
50
48
  </div>
51
- `:n.nothing}renderActions(){return n.html`
49
+ `:n.nothing}renderActions(){const t=this.resolvedLocale.dismiss;return n.html`
52
50
  <div class="md-card-alert-actions">
53
51
  <md-button
54
52
  size="32"
55
- variant="primary"
53
+ variant="secondary"
56
54
  class="md-card-alert-primary-action"
57
55
  ariaLabel=${this.primaryActionLabel}
58
56
  @click=${this.handlePrimaryAction}
@@ -68,25 +66,24 @@
68
66
  <md-button
69
67
  size="32"
70
68
  variant="secondary"
71
- outline
72
69
  class="md-card-alert-dismiss"
73
- ariaLabel=${this.constructor.locale.dismiss}
70
+ ariaLabel=${t}
74
71
  @click=${this.handleDismiss}
75
72
  >
76
- <span slot="text">${this.constructor.locale.dismiss}</span>
73
+ <span slot="text">${t}</span>
77
74
  </md-button>
78
75
  `:n.nothing}
79
76
  </div>
80
77
  `}render(){return n.html`
81
78
  <div
82
- class=${(0,l.classMap)({"md-card-alert":!0,"md-card-alert--no-insight":!this.hasInsight})}
79
+ class=${(0,l.classMap)({"md-card-alert":!0,"md-card-alert--no-insight":!this.hasInsight,"md-card-alert--expanded":this.expanded})}
83
80
  part="card"
84
81
  tabindex="0"
85
82
  >
86
83
  ${this.renderHeader()} ${this.renderTitleSection()} ${this.renderDetails()} ${this.renderInsight()}
87
84
  ${this.renderActions()}
88
85
  </div>
89
- `}};e.locale=Object.assign({},c),p([(0,a.property)({type:String})],e.prototype,"severity",void 0),p([(0,a.property)({type:String})],e.prototype,"category",void 0),p([(0,a.property)({type:String})],e.prototype,"timestamp",void 0),p([(0,a.property)({type:String})],e.prototype,"title",void 0),p([(0,a.property)({type:String})],e.prototype,"queueName",void 0),p([(0,a.property)({type:Array})],e.prototype,"details",void 0),p([(0,a.property)({type:String})],e.prototype,"insight",void 0),p([(0,a.property)({type:String})],e.prototype,"primaryActionLabel",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),p([(0,a.property)({type:String})],e.prototype,"detailsHeading",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"showDismiss",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"expanded",void 0),p([(0,a.state)()],e.prototype,"relativeTime",void 0),e=p([(0,o.w)("md-card-alert")],e),t.ELEMENT=e}(m||(m={}))},2583(t,e,i){i(2708),i(9613);var r,o=i(2900),s=i(9609),n=i(4084),a=i(7161),l=i(429),d=i(5125),p=i(291),h=i(9558),c=function(t,e,i,r){var o,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:a.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:a.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:a.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?a.html`
86
+ `}};e.locale=Object.assign({},c),p([(0,a.property)({type:String})],e.prototype,"severity",void 0),p([(0,a.property)({type:String})],e.prototype,"category",void 0),p([(0,a.property)({type:String})],e.prototype,"secondaryChip",void 0),p([(0,a.property)({type:String})],e.prototype,"timestamp",void 0),p([(0,a.property)({type:String})],e.prototype,"title",void 0),p([(0,a.property)({type:String})],e.prototype,"queueName",void 0),p([(0,a.property)({type:Array})],e.prototype,"details",void 0),p([(0,a.property)({type:String})],e.prototype,"insight",void 0),p([(0,a.property)({type:String})],e.prototype,"primaryActionLabel",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),p([(0,a.property)({type:String})],e.prototype,"detailsHeading",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"showDismiss",void 0),p([(0,a.property)({type:Boolean})],e.prototype,"expanded",void 0),p([(0,a.state)()],e.prototype,"relativeTime",void 0),e=p([(0,r.w)("md-card-alert")],e),t.ELEMENT=e}(m||(m={}))},2583(t,e,i){i(2708),i(9613);var o,r=i(2900),s=i(9609),n=i(4084),a=i(7161),l=i(429),d=i(5125),p=i(291),h=i(9558),c=function(t,e,i,o){var r,s=arguments.length,n=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:a.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:a.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:a.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?a.html`
90
87
  <style>
91
88
  :host .md-chip {
92
89
  ${this.renderBgColor()};
@@ -94,7 +91,7 @@
94
91
  ${this.renderHeight()};
95
92
  }
96
93
  </style>
97
- `:a.nothing}connectedCallback(){super.connectedCallback(),this.truncStringPortion(this.value),this.setAttribute("role",this.role)}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("shouldTruncateValue"))&&this.truncStringPortion(this.value)}getTextWidth(t,e){const i=null!=e?e:getComputedStyle(this).font,r=document.createElement("canvas").getContext("2d");return r?(r.font=i,r.measureText(t).width):0}truncStringPortion(t){const e=this.getTextWidth(t);if(!this.shouldTruncateValue||e<this.MAXWIDTH)return this.renderedText=t,void(this.textOverflow=!1);const i=Array.from(t);let r=Math.min(4,i.length),o=Math.min(5,Math.max(0,i.length-r-1)),s=i.slice(0,r).join(""),n=i.slice(-o).join(""),a=`${s}…${n}`;if(this.getTextWidth(a)>this.MAXWIDTH)return this.renderedText=a,void(this.textOverflow=!0);for(;r+o<i.length;){let t=!1;if(r+o<i.length){const e=s+i[r],o=`${e}…${n}`;this.getTextWidth(o)<=this.MAXWIDTH&&(s=e,r+=1,a=o,t=!0)}if(r+o<i.length){const e=i[i.length-o-1]+n,r=`${s}…${e}`;this.getTextWidth(r)<=this.MAXWIDTH&&(n=e,o+=1,a=r,t=!0)}if(!t)break}this.renderedText=a,this.textOverflow=!0}handleClick(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("md-tooltip");null==e||e.dispatchEvent(new CustomEvent("tooltip-destroy",{bubbles:!0,composed:!0,detail:{placement:null==e?void 0:e.placement,reference:null==e?void 0:e.reference,popper:null==e?void 0:e.popper}})),this.dispatchEvent(new CustomEvent("chip-interaction",{composed:!0,bubbles:!0,detail:{id:this.id}}))}handleKeydown(t){switch(t.code){case o.Uz.Space:case o.Uz.Enter:this.handleSelect(),this.handleClick()}}static get styles(){return[n.A,h.A]}loadingTemplate(){return this.determinateProgress||this.indeterminateProgress?this.determinateProgress?a.html`
94
+ `:a.nothing}connectedCallback(){super.connectedCallback(),this.truncStringPortion(this.value),this.setAttribute("role",this.role)}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("shouldTruncateValue"))&&this.truncStringPortion(this.value)}getTextWidth(t,e){const i=null!=e?e:getComputedStyle(this).font,o=document.createElement("canvas").getContext("2d");return o?(o.font=i,o.measureText(t).width):0}truncStringPortion(t){const e=this.getTextWidth(t);if(!this.shouldTruncateValue||e<this.MAXWIDTH)return this.renderedText=t,void(this.textOverflow=!1);const i=Array.from(t);let o=Math.min(4,i.length),r=Math.min(5,Math.max(0,i.length-o-1)),s=i.slice(0,o).join(""),n=i.slice(-r).join(""),a=`${s}…${n}`;if(this.getTextWidth(a)>this.MAXWIDTH)return this.renderedText=a,void(this.textOverflow=!0);for(;o+r<i.length;){let t=!1;if(o+r<i.length){const e=s+i[o],r=`${e}…${n}`;this.getTextWidth(r)<=this.MAXWIDTH&&(s=e,o+=1,a=r,t=!0)}if(o+r<i.length){const e=i[i.length-r-1]+n,o=`${s}…${e}`;this.getTextWidth(o)<=this.MAXWIDTH&&(n=e,r+=1,a=o,t=!0)}if(!t)break}this.renderedText=a,this.textOverflow=!0}handleClick(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("md-tooltip");null==e||e.dispatchEvent(new CustomEvent("tooltip-destroy",{bubbles:!0,composed:!0,detail:{placement:null==e?void 0:e.placement,reference:null==e?void 0:e.reference,popper:null==e?void 0:e.popper}})),this.dispatchEvent(new CustomEvent("chip-interaction",{composed:!0,bubbles:!0,detail:{id:this.id}}))}handleKeydown(t){switch(t.code){case r.Uz.Space:case r.Uz.Enter:this.handleSelect(),this.handleClick()}}static get styles(){return[n.A,h.A]}loadingTemplate(){return this.determinateProgress||this.indeterminateProgress?this.determinateProgress?a.html`
98
95
  <md-progress-bar
99
96
  class="md-chip--loading"
100
97
  type="determinate"
@@ -137,4 +134,4 @@
137
134
  <slot name="custom-right-content" part="chip-right"> </slot>
138
135
  </span>
139
136
  </md-tooltip>
140
- `}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(r||(r={}))},2022(t){t.exports=s},554(t){t.exports=n},7161(e){e.exports=t},429(t){t.exports=e},5125(t){t.exports=i},291(t){t.exports=o},318(t){t.exports=r},5314(t){t.exports=a}},p={};function h(t){var e=p[t];if(void 0!==e)return e.exports;var i=p[t]={exports:{}};return d[t](i,i.exports,h),i.exports}h.m=d,l=[],h.O=(t,e,i,r)=>{if(!e){var o=1/0;for(d=0;d<l.length;d++){for(var[e,i,r]=l[d],s=!0,n=0;n<e.length;n++)(!1&r||o>=r)&&Object.keys(h.O).every(t=>h.O[t](e[n]))?e.splice(n--,1):(s=!1,r<o&&(o=r));if(s){l.splice(d--,1);var a=i();void 0!==a&&(t=a)}}return t}r=r||0;for(var d=l.length;d>0&&l[d-1][2]>r;d--)l[d]=l[d-1];l[d]=[e,i,r]},h.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return h.d(e,{a:e}),e},h.d=(t,e)=>{for(var i in e)h.o(e,i)&&!h.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),h.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={8619:0,8894:0};h.O.j=e=>0===t[e];var e=(e,i)=>{var r,o,[s,n,a]=i,l=0;if(s.some(e=>0!==t[e])){for(r in n)h.o(n,r)&&(h.m[r]=n[r]);if(a)var d=a(h)}for(e&&e(i);l<s.length;l++)o=s[l],h.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return h.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();var c=h.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5584,8227,2900,2050,6343,7582,9613,5323,6631,9558,2708,7137],()=>h(4882));return h.O(c)})());
137
+ `}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))},2022(t){t.exports=s},554(t){t.exports=n},7161(e){e.exports=t},429(t){t.exports=e},5125(t){t.exports=i},291(t){t.exports=r},318(t){t.exports=o},5314(t){t.exports=a}},p={};function h(t){var e=p[t];if(void 0!==e)return e.exports;var i=p[t]={exports:{}};return d[t](i,i.exports,h),i.exports}h.m=d,l=[],h.O=(t,e,i,o)=>{if(!e){var r=1/0;for(d=0;d<l.length;d++){for(var[e,i,o]=l[d],s=!0,n=0;n<e.length;n++)(!1&o||r>=o)&&Object.keys(h.O).every(t=>h.O[t](e[n]))?e.splice(n--,1):(s=!1,o<r&&(r=o));if(s){l.splice(d--,1);var a=i();void 0!==a&&(t=a)}}return t}o=o||0;for(var d=l.length;d>0&&l[d-1][2]>o;d--)l[d]=l[d-1];l[d]=[e,i,o]},h.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return h.d(e,{a:e}),e},h.d=(t,e)=>{for(var i in e)h.o(e,i)&&!h.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),h.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={8619:0,8894:0};h.O.j=e=>0===t[e];var e=(e,i)=>{var o,r,[s,n,a]=i,l=0;if(s.some(e=>0!==t[e])){for(o in n)h.o(n,o)&&(h.m[o]=n[o]);if(a)var d=a(h)}for(e&&e(i);l<s.length;l++)r=s[l],h.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return h.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();var c=h.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5584,8227,2900,2050,6343,7582,9613,5323,6631,9558,2708,7137],()=>h(4882));return h.O(c)})());
@@ -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("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("@popperjs/core/lib/popper-lite"),require("lit/directives/unsafe-html.js"),require("papaparse"));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","@popperjs/core/lib/modifiers/arrow","@popperjs/core/lib/modifiers/flip","@popperjs/core/lib/modifiers/offset","@popperjs/core/lib/modifiers/preventOverflow","@popperjs/core/lib/popper-lite","lit/directives/unsafe-html.js","papaparse"],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("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("@popperjs/core/lib/popper-lite"),require("lit/directives/unsafe-html.js"),require("papaparse")):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["@popperjs/core/lib/modifiers/arrow"],e["@popperjs/core/lib/modifiers/flip"],e["@popperjs/core/lib/modifiers/offset"],e["@popperjs/core/lib/modifiers/preventOverflow"],e["@popperjs/core/lib/popper-lite"],e["lit/directives/unsafe-html.js"],e.papaparse);for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}}(self,(e,t,i,o,s,r,l,n,a,d,p,c,h,m,u)=>(()=>{"use strict";var f,g={7936(e,t,i){i.r(t),i.d(t,{TableAdvanced:()=>b}),i(5983),i(1821),i(708);var o=i(9609),s=i(9938),r=i(4084),l=i(7161),n=i(429),a=i(5125),d=i(291),p=i(6968),c=i(8187),h=i.n(c),m=i(4841),u=i(597),f=i(9125),g=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};const v=document.createElement("img");var b;v.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(e){let t=class extends((0,s.d)(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 i;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const o=e.target;null===(i=e.dataTransfer)||void 0===i||i.setDragImage(v,0,0);const s=this.COLS.map(e=>this.shadowRoot.querySelector(`th.col-index-${e.index}`));this.COLS.forEach((e,t)=>e.width=s[t].offsetWidth+"px"),this.updCols();const r=e.x;this.eX=e.x;let l=-1,n=-1,a=-1;const d=this.COLS[t.index-1],p=s[t.index],c=s[t.index-1],h=p.offsetWidth,m=c.offsetWidth,u=()=>{const e=this.eX;if(l!=e&&0!=e){l=e;const i=l-r;n=h-i,a=m+i,t.width=n+"px",d.width=a+"px",this.updCols()}},f=e=>this.eX=e.x,g=()=>{this.isResizing=!1,o.removeEventListener("drag",u),o.removeEventListener("dragend",g),document.removeEventListener("dragover",f)};o.addEventListener("drag",u),o.addEventListener("dragend",g),document.addEventListener("dragover",f)}}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 i=(e,i)=>{var o,s,r,l;const n=e.filters||(null===(s=null===(o=this.tableConfig.default)||void 0===o?void 0:o.col)||void 0===s?void 0:s.filters),a=n?"forString"==n?f.d.optionsString:"forNumber"==n?f.d.optionsNumber:n.length?n:null:null;this.COLS.push({options:Object.assign({},e),index:t++,group:i,sort:"default",sorter:e.sorter||(null===(l=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===l?void 0:l.sorter),isCollapsable:this.tableConfig.cols.collapse==e.id,filter:a?{list:a,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(e=>{"children"in e?e.children.forEach(t=>i(t,{name:e.groupName,length:e.children.length})):i(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=h().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,i)=>{const o=t.length;o!=e&&(this.error=`DATA ERROR: Total number of cols (=${e}) and data[${i}] length (=${o}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const e=this.tableConfig.cellTemplates,t=Object.keys(e||{});e&&t.length&&this.ROWS.forEach((t,i)=>{t.forEach((t,o)=>{for(const s in e){const r=t.text.indexOf(s);if(-1!=r){const l=e[s],n=this.querySelector(`#${l.templateName}`);if(null==n){console.warn(`cellTemplates["${s}"]: Missing '${l.templateName}' template.`);continue}let a=t.text.replace(s,"");l.contentCb&&(a=l.contentCb({col:o,row:i,content:a,insertIndex:r})),this.ROWS[i][o]={text:a,template:{template:n,templateCb:l.templateCb,insertIndex:"replace"==l.contentUse?-1:r}};break}}})})}setDefaultFilterAndSort(){var e,t;const i=null===(e=this.tableConfig.default)||void 0===e?void 0:e.sort;if(i){const e=this.COLS.find(e=>e.options.id==i.colId);e?this.sort(e,i.order):console.warn(`Cant find ${i.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],i=e.group,o=t.group,s=e.index,r=t.index;e.group=o,t.group=i,e.index=r,t.index=s,this.COLS[this.dragCol]=t,this.COLS[this.dropCol]=e,this.ROWS.forEach(e=>{const t=e[this.dragCol],i=e[this.dropCol];e[this.dragCol]=i,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(i=>{i.options.id==e.options.id?i.sort=t||("default"==i.sort?"ascending":"ascending"==i.sort?"descending":"default"):i.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:e.sort}))}filter(e){if(!e.filter)return;this.clearSelection(),this.drops=[];const t=e.filter.input.trim(),i=e.filter.list[e.filter.selectedIndex];e.filter.active=!!t,this.requestUpdate(),t?this["md-table-advanced-change"].emit({type:"filter-on",filter:i,input:t}):this["md-table-advanced-change"].emit({type:"filter-off",filter:e.filter.list[e.filter.selectedIndex]})}selectRow(e){var t;const i=e.row.idx,o=Object.prototype.hasOwnProperty.call(this.selected,i);"multiple"==(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)?(e.metaKey?o?delete this.selected[i]:this.selected[i]=!0:e.shiftKey||(this.selected={[i]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(e=>+e)})):o?this.clearSelection():(this.selected={[i]:!0},this["md-table-advanced-change"].emit({type:"select",index:i})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(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` <div>${this.error}</div> `;const{head:e}=this.tableConfig,t=(0,a.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return l.html`
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("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("@popperjs/core/lib/popper-lite"),require("lit/directives/unsafe-html.js"),require("papaparse"));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","@popperjs/core/lib/modifiers/arrow","@popperjs/core/lib/modifiers/flip","@popperjs/core/lib/modifiers/offset","@popperjs/core/lib/modifiers/preventOverflow","@popperjs/core/lib/popper-lite","lit/directives/unsafe-html.js","papaparse"],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("@popperjs/core/lib/modifiers/arrow"),require("@popperjs/core/lib/modifiers/flip"),require("@popperjs/core/lib/modifiers/offset"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("@popperjs/core/lib/popper-lite"),require("lit/directives/unsafe-html.js"),require("papaparse")):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["@popperjs/core/lib/modifiers/arrow"],e["@popperjs/core/lib/modifiers/flip"],e["@popperjs/core/lib/modifiers/offset"],e["@popperjs/core/lib/modifiers/preventOverflow"],e["@popperjs/core/lib/popper-lite"],e["lit/directives/unsafe-html.js"],e.papaparse);for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}}(self,(e,t,i,o,s,r,l,a,n,d,p,c,h,m,u)=>(()=>{"use strict";var f,g={7936(e,t,i){i.r(t),i.d(t,{TableAdvanced:()=>b}),i(5983),i(1821),i(708);var o=i(9609),s=i(9938),r=i(4084),l=i(7161),a=i(429),n=i(5125),d=i(291),p=i(6968),c=i(8187),h=i.n(c),m=i(4841),u=i(597),f=i(9125),g=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};const v=document.createElement("img");var b;v.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(e){let t=class extends((0,s.d)(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 i;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const o=e.target;null===(i=e.dataTransfer)||void 0===i||i.setDragImage(v,0,0);const s=this.COLS.map(e=>this.shadowRoot.querySelector(`th.col-index-${e.index}`));this.COLS.forEach((e,t)=>e.width=s[t].offsetWidth+"px"),this.updCols();const r=e.x;this.eX=e.x;let l=-1,a=-1,n=-1;const d=this.COLS[t.index-1],p=s[t.index],c=s[t.index-1],h=p.offsetWidth,m=c.offsetWidth,u=()=>{const e=this.eX;if(l!=e&&0!=e){l=e;const i=l-r;a=h-i,n=m+i,t.width=a+"px",d.width=n+"px",this.updCols()}},f=e=>this.eX=e.x,g=()=>{this.isResizing=!1,o.removeEventListener("drag",u),o.removeEventListener("dragend",g),document.removeEventListener("dragover",f)};o.addEventListener("drag",u),o.addEventListener("dragend",g),document.addEventListener("dragover",f)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}willUpdate(e){var t;null===(t=super.willUpdate)||void 0===t||t.call(this,e),e.has("data")&&void 0!==e.get("data")&&(this.error="")}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 i=(e,i)=>{var o,s,r,l;const a=e.filters||(null===(s=null===(o=this.tableConfig.default)||void 0===o?void 0:o.col)||void 0===s?void 0:s.filters),n=a?"forString"==a?f.d.optionsString:"forNumber"==a?f.d.optionsNumber:a.length?a:null:null;this.COLS.push({options:Object.assign({},e),index:t++,group:i,sort:"default",sorter:e.sorter||(null===(l=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===l?void 0:l.sorter),isCollapsable:this.tableConfig.cols.collapse==e.id,filter:n?{list:n,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(e=>{"children"in e?e.children.forEach(t=>i(t,{name:e.groupName,length:e.children.length})):i(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=h().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,i)=>{const o=t.length;o!=e&&(this.error=`DATA ERROR: Total number of cols (=${e}) and data[${i}] length (=${o}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const e=this.tableConfig.cellTemplates,t=Object.keys(e||{});e&&t.length&&this.ROWS.forEach((t,i)=>{t.forEach((t,o)=>{for(const s in e){const r=t.text.indexOf(s);if(-1!=r){const l=e[s],a=this.querySelector(`#${l.templateName}`);if(null==a){console.warn(`cellTemplates["${s}"]: Missing '${l.templateName}' template.`);continue}let n=t.text.replace(s,"");l.contentCb&&(n=l.contentCb({col:o,row:i,content:n,insertIndex:r})),this.ROWS[i][o]={text:n,template:{template:a,templateCb:l.templateCb,insertIndex:"replace"==l.contentUse?-1:r}};break}}})})}setDefaultFilterAndSort(){var e,t;const i=null===(e=this.tableConfig.default)||void 0===e?void 0:e.sort;if(i){const e=this.COLS.find(e=>e.options.id==i.colId);e?this.sort(e,i.order):console.warn(`Cant find ${i.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],i=e.group,o=t.group,s=e.index,r=t.index;e.group=o,t.group=i,e.index=r,t.index=s,this.COLS[this.dragCol]=t,this.COLS[this.dropCol]=e,this.ROWS.forEach(e=>{const t=e[this.dragCol],i=e[this.dropCol];e[this.dragCol]=i,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(i=>{i.options.id==e.options.id?i.sort=t||("default"==i.sort?"ascending":"ascending"==i.sort?"descending":"default"):i.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:e.sort}))}filter(e){if(!e.filter)return;this.clearSelection(),this.drops=[];const t=e.filter.input.trim(),i=e.filter.list[e.filter.selectedIndex];e.filter.active=!!t,this.requestUpdate(),t?this["md-table-advanced-change"].emit({type:"filter-on",filter:i,input:t}):this["md-table-advanced-change"].emit({type:"filter-off",filter:e.filter.list[e.filter.selectedIndex]})}selectRow(e){var t;const i=e.row.idx,o=Object.prototype.hasOwnProperty.call(this.selected,i);"multiple"==(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)?(e.metaKey?o?delete this.selected[i]:this.selected[i]=!0:e.shiftKey||(this.selected={[i]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(e=>+e)})):o?this.clearSelection():(this.selected={[i]:!0},this["md-table-advanced-change"].emit({type:"select",index:i})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(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` <div>${this.error}</div> `;const{head:e}=this.tableConfig,t=(0,n.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return l.html`
2
2
  <div class="md-table-advanced">
3
3
  <slot></slot>
4
4
  <table class=${t} summary=${(0,d.ifDefined)(null==e?void 0:e.summary)}>
@@ -35,7 +35,7 @@
35
35
  <thead>
36
36
  ${e} ${i}
37
37
  </thead>
38
- `}sortIconTemplate(e){return"ascending"===e?l.html`<md-icon name="sort-descending-bold" size="16" iconSet="momentumDesign"></md-icon>`:"descending"===e?l.html`<md-icon name="sort-ascending-bold" size="16" iconSet="momentumDesign"></md-icon>`:l.html`<md-icon name="unsorted-bold" size="16" iconSet="momentumDesign"></md-icon>`}renderCol(e,t){var i,o;const s=null===(o=null===(i=e.filter)||void 0===i?void 0:i.list[e.filter.selectedIndex])||void 0===o?void 0:o.input,r=(0,a.classMap)({ascending:"ascending"==e.sort,descending:"descending"==e.sort});return l.html`
38
+ `}sortIconTemplate(e){return"ascending"===e?l.html`<md-icon name="sort-descending-bold" size="16" iconSet="momentumDesign"></md-icon>`:"descending"===e?l.html`<md-icon name="sort-ascending-bold" size="16" iconSet="momentumDesign"></md-icon>`:l.html`<md-icon name="unsorted-bold" size="16" iconSet="momentumDesign"></md-icon>`}renderCol(e,t){var i,o;const s=null===(o=null===(i=e.filter)||void 0===i?void 0:i.list[e.filter.selectedIndex])||void 0===o?void 0:o.input,r=(0,n.classMap)({ascending:"ascending"==e.sort,descending:"descending"==e.sort});return l.html`
39
39
  <th
40
40
  rowspan=${(0,d.ifDefined)(t)}
41
41
  width=${(0,d.ifDefined)(e.width?e.width:e.options.width)}
@@ -100,7 +100,7 @@
100
100
  `}renderColDrag(e){return this.tableConfig.cols.isDraggable?l.html`
101
101
  <div
102
102
  draggable="true"
103
- class="drag-area-col ${(0,a.classMap)({drag:-1!=this.dragCol,over:this.dropCol==e.index&&this.dropCol!=this.dragCol})}"
103
+ class="drag-area-col ${(0,n.classMap)({drag:-1!=this.dragCol,over:this.dropCol==e.index&&this.dropCol!=this.dragCol})}"
104
104
  @dragstart=${t=>{this.isResizing||-1!=this.dragRow||(this.dragCol=e.index,t.dataTransfer.setDragImage(t.target.parentNode,0,0))}}
105
105
  @dragenter=${()=>{this.isResizing||-1!=this.dragRow||(this.dropCol=e.index)}}
106
106
  @dragend=${()=>this.onDropCol()}
@@ -115,16 +115,16 @@
115
115
  ${this.renderRow(t,i)} ${o?t.children.map(e=>this.renderRow(e,i)):l.nothing}
116
116
  `})}
117
117
  </tbody>
118
- `}processTemplate(e){const t=document.importNode(e.content,!0);return Array.from(t.childNodes).map(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.nodeType===Node.TEXT_NODE&&e.textContent||"").join("")}processTemplateCallback(e){const t=document.importNode(e.template.content,!0);return e.cb({content:e.content,row:e.row,col:e.col,insertIndex:e.insertIndex,fragment:t}),Array.from(t.childNodes).map(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.nodeType===Node.TEXT_NODE&&e.textContent||"").join("")}renderRow(e,t){const i=Object.prototype.hasOwnProperty.call(this.selected,e.idx),o=(0,a.classMap)({selected:i,selectable:this.isSelectable&&!i,ghost:e.isGhost});return l.html`
118
+ `}processTemplate(e){const t=document.importNode(e.content,!0);return Array.from(t.childNodes).map(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.nodeType===Node.TEXT_NODE&&e.textContent||"").join("")}processTemplateCallback(e){const t=document.importNode(e.template.content,!0);return e.cb({content:e.content,row:e.row,col:e.col,insertIndex:e.insertIndex,fragment:t}),Array.from(t.childNodes).map(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.nodeType===Node.TEXT_NODE&&e.textContent||"").join("")}renderRow(e,t){const i=Object.prototype.hasOwnProperty.call(this.selected,e.idx),o=(0,n.classMap)({selected:i,selectable:this.isSelectable&&!i,ghost:e.isGhost});return l.html`
119
119
  <tr
120
120
  class=${o}
121
121
  tabindex=${(0,d.ifDefined)("true"===this.isRowFocusable?"0":void 0)}
122
122
  part=${e.first?"first-row":"row"}
123
123
  @click=${({shiftKey:t,metaKey:i})=>{this.isSelectable&&this.selectRow({row:e,shiftKey:t,metaKey:i})}}
124
124
  >
125
- ${e.cells.map((i,o)=>{var s;const r=this.COLS[o];let n=i.text;const a=i.template;a&&(n=a.templateCb?l.html`${(0,p.unsafeHTML)(this.processTemplateCallback({cb:a.templateCb,insertIndex:a.insertIndex,template:a.template,content:i.text,row:e.idx,col:o}))}`:l.html`${(0,p.unsafeHTML)(this.processTemplate(a.template))}`,-1!=a.insertIndex&&(n=l.html`
126
- ${a.insertIndex>0?i.text.substring(0,a.insertIndex):l.nothing} ${n}
127
- ${a.insertIndex<i.text.length-1?i.text.substring(a.insertIndex):l.nothing}
125
+ ${e.cells.map((i,o)=>{var s;const r=this.COLS[o];let a=i.text;const n=i.template;n&&(a=n.templateCb?l.html`${(0,p.unsafeHTML)(this.processTemplateCallback({cb:n.templateCb,insertIndex:n.insertIndex,template:n.template,content:i.text,row:e.idx,col:o}))}`:l.html`${(0,p.unsafeHTML)(this.processTemplate(n.template))}`,-1!=n.insertIndex&&(a=l.html`
126
+ ${n.insertIndex>0?i.text.substring(0,n.insertIndex):l.nothing} ${a}
127
+ ${n.insertIndex<i.text.length-1?i.text.substring(n.insertIndex):l.nothing}
128
128
  `));const d=(null===(s=this.tableConfig.rows)||void 0===s?void 0:s.isDraggable)&&"child"!=e.collapse,c=d&&-1!=this.dragRow&&this.dragRow!=e.idxDrag,h=d&&0==o,m=l.html`
129
129
  <div
130
130
  class="inner-cell"
@@ -158,9 +158,9 @@
158
158
  ${"collapsed"==e.collapse?l.html` <md-icon name="plus-bold" size="12" iconSet="momentumDesign"></md-icon> `:l.html` <md-icon name="minus-bold" size="12" iconSet="momentumDesign"></md-icon> `}
159
159
  </button>
160
160
  `:l.nothing}
161
- <span>${"child"==e.collapse?l.nothing:n}</span>
162
- `:l.html` <span>${n}</span> `}
161
+ <span>${"child"==e.collapse?l.nothing:a}</span>
162
+ `:l.html` <span>${a}</span> `}
163
163
  </div>
164
164
  `;return r.options.isHeader?l.html` <th part="cell-ishead" scope="row" title="${i.text}">${m}</th> `:l.html` <td part=${0===o?"first-cell":"cell"} title="${i.text}">${m}</td> `})}
165
165
  </tr>
166
- `}static get styles(){return[r.A,m.A]}};g([(0,n.property)({attribute:"config"})],t.prototype,"config",void 0),g([(0,n.property)({attribute:"data"})],t.prototype,"data",void 0),g([(0,n.property)({type:String})],t.prototype,"isRowFocusable",void 0),g([(0,u.Wj)()],t.prototype,"md-table-advanced-change",void 0),g([(0,n.state)()],t.prototype,"tableConfig",void 0),g([(0,n.state)()],t.prototype,"tableData",void 0),g([(0,n.state)()],t.prototype,"error",void 0),g([(0,n.state)()],t.prototype,"COLS",void 0),g([(0,n.state)()],t.prototype,"ROWS",void 0),g([(0,n.state)()],t.prototype,"dragRow",void 0),g([(0,n.state)()],t.prototype,"dropRow",void 0),g([(0,n.state)()],t.prototype,"drops",void 0),g([(0,n.state)()],t.prototype,"dragCol",void 0),g([(0,n.state)()],t.prototype,"dropCol",void 0),g([(0,n.queryAll)("tr[tabindex]")],t.prototype,"tableRaws",void 0),g([(0,u.sg)(500)],t.prototype,"filter",null),t=g([(0,o.w)("md-table-advanced")],t),e.ELEMENT=t}(b||(b={}))},2022(e){e.exports=r},554(e){e.exports=l},2962(e){e.exports=a},6538(e){e.exports=d},8250(e){e.exports=p},9371(e){e.exports=c},4863(e){e.exports=h},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=s},318(e){e.exports=o},6968(e){e.exports=m},5314(e){e.exports=n},8187(e){e.exports=u}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var i=v[e]={exports:{}};return g[e](i,i.exports,b),i.exports}b.m=g,f=[],b.O=(e,t,i,o)=>{if(!t){var s=1/0;for(a=0;a<f.length;a++){for(var[t,i,o]=f[a],r=!0,l=0;l<t.length;l++)(!1&o||s>=o)&&Object.keys(b.O).every(e=>b.O[e](t[l]))?t.splice(l--,1):(r=!1,o<s&&(s=o));if(r){f.splice(a--,1);var n=i();void 0!==n&&(e=n)}}return e}o=o||0;for(var a=f.length;a>0&&f[a-1][2]>o;a--)f[a]=f[a-1];f[a]=[t,i,o]},b.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return b.d(t,{a:t}),t},b.d=(e,t)=>{for(var i in t)b.o(t,i)&&!b.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},b.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),b.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={4139:0};b.O.j=t=>0===e[t];var t=(t,i)=>{var o,s,[r,l,n]=i,a=0;if(r.some(t=>0!==e[t])){for(o in l)b.o(l,o)&&(b.m[o]=l[o]);if(n)var d=n(b)}for(t&&t(i);a<r.length;a++)s=r[a],b.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return b.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 x=b.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,2050,8441,9983,4700,9146,708,8881],()=>b(7936));return b.O(x)})());
166
+ `}static get styles(){return[r.A,m.A]}};g([(0,a.property)({attribute:"config"})],t.prototype,"config",void 0),g([(0,a.property)({attribute:"data"})],t.prototype,"data",void 0),g([(0,a.property)({type:String})],t.prototype,"isRowFocusable",void 0),g([(0,u.Wj)()],t.prototype,"md-table-advanced-change",void 0),g([(0,a.state)()],t.prototype,"tableConfig",void 0),g([(0,a.state)()],t.prototype,"tableData",void 0),g([(0,a.state)()],t.prototype,"error",void 0),g([(0,a.state)()],t.prototype,"COLS",void 0),g([(0,a.state)()],t.prototype,"ROWS",void 0),g([(0,a.state)()],t.prototype,"dragRow",void 0),g([(0,a.state)()],t.prototype,"dropRow",void 0),g([(0,a.state)()],t.prototype,"drops",void 0),g([(0,a.state)()],t.prototype,"dragCol",void 0),g([(0,a.state)()],t.prototype,"dropCol",void 0),g([(0,a.queryAll)("tr[tabindex]")],t.prototype,"tableRaws",void 0),g([(0,u.sg)(500)],t.prototype,"filter",null),t=g([(0,o.w)("md-table-advanced")],t),e.ELEMENT=t}(b||(b={}))},2022(e){e.exports=r},554(e){e.exports=l},2962(e){e.exports=n},6538(e){e.exports=d},8250(e){e.exports=p},9371(e){e.exports=c},4863(e){e.exports=h},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=s},318(e){e.exports=o},6968(e){e.exports=m},5314(e){e.exports=a},8187(e){e.exports=u}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var i=v[e]={exports:{}};return g[e](i,i.exports,b),i.exports}b.m=g,f=[],b.O=(e,t,i,o)=>{if(!t){var s=1/0;for(n=0;n<f.length;n++){for(var[t,i,o]=f[n],r=!0,l=0;l<t.length;l++)(!1&o||s>=o)&&Object.keys(b.O).every(e=>b.O[e](t[l]))?t.splice(l--,1):(r=!1,o<s&&(s=o));if(r){f.splice(n--,1);var a=i();void 0!==a&&(e=a)}}return e}o=o||0;for(var n=f.length;n>0&&f[n-1][2]>o;n--)f[n]=f[n-1];f[n]=[t,i,o]},b.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return b.d(t,{a:t}),t},b.d=(e,t)=>{for(var i in t)b.o(t,i)&&!b.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},b.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),b.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={4139:0};b.O.j=t=>0===e[t];var t=(t,i)=>{var o,s,[r,l,a]=i,n=0;if(r.some(t=>0!==e[t])){for(o in l)b.o(l,o)&&(b.m[o]=l[o]);if(a)var d=a(b)}for(t&&t(i);n<r.length;n++)s=r[n],b.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return b.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 x=b.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,2050,8441,9983,4700,9146,708,8881],()=>b(7936));return b.O(x)})());
package/dist/esm/7137.js CHANGED
@@ -1 +1 @@
1
- export const __webpack_esm_id__=7137;export const __webpack_esm_ids__=[7137];export const __webpack_esm_modules__={7137(e,t,r){r.d(t,{A:()=>a});const a=r(2927).css`:host(md-card-alert){display:block}:host(md-card-alert) .md-card-alert{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-secondary-bg-color);border:1px solid var(--md-quaternary-bg-color);border-radius:.75rem;box-sizing:border-box;box-shadow:0 2px 8px rgba(0,0,0,.1);gap:.75rem;padding:.75rem;width:22.9375rem}:host(md-card-alert) .md-card-alert--no-insight{height:329px;max-height:329px;min-height:329px}:host(md-card-alert) .md-card-alert:focus{outline:0}:host(md-card-alert) .md-card-alert-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;flex-wrap:nowrap}:host(md-card-alert) .md-card-alert-chips{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.375rem}:host(md-card-alert) .md-card-alert-timestamp{color:var(--md-secondary-text-color);font-size:.875rem;font-weight:400;flex-shrink:0}:host(md-card-alert) .md-card-alert-title-section{align-content:center;align-items:flex-start;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:.125rem;min-width:0;width:100%}:host(md-card-alert) .md-card-alert-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;color:var(--md-primary-text-color);display:-webkit-box;font-size:1rem;font-weight:700;height:3rem;line-height:1.5rem;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:normal;width:100%}:host(md-card-alert) .md-card-alert-subtitle{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-secondary-text-color);font-size:.875rem;gap:.25rem;margin:0}:host(md-card-alert) .md-card-alert-subtitle-icon{flex-shrink:0;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-details{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-background-tertiary,#f3f4f6);border-radius:.5rem;gap:.1875rem;padding:.75rem}:host(md-card-alert) .md-card-alert-details-heading{color:var(--md-secondary-text-color);font-size:.875rem;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-row{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between}:host(md-card-alert) .md-card-alert-detail-label{color:var(--md-primary-text-color);font-size:.875rem;font-weight:700;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value{color:var(--md-primary-text-color);font-size:.875rem;text-align:right;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value--highlighted{color:var(--md-alert-error-text-color,#dc2626)}:host(md-card-alert) .md-card-alert-insight{align-content:center;align-items:flex-start;display:flex;flex-flow:row nowrap;justify-content:flex-start;background:var(--card-ai-blue-bg-color,#eff6ff);border-radius:.5rem;border:1px solid var(--badge-confidence-cobalt-border-color,#dbeafe);color:var(--md-primary-text-color);gap:.5rem;padding:.625rem .75rem}:host(md-card-alert) .md-card-alert-insight-icon{color:var(--badge-status-accent-text-color,#0284c7);flex-shrink:0;margin-top:.0625rem;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-insight-text{font-size:.875rem;line-height:1.25rem}:host(md-card-alert) .md-card-alert-actions{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.5rem}`}};
1
+ export const __webpack_esm_id__=7137;export const __webpack_esm_ids__=[7137];export const __webpack_esm_modules__={7137(r,e,t){t.d(e,{A:()=>a});const a=t(2927).css`:host(md-card-alert){display:block}:host(md-card-alert) .md-card-alert{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;background:var(--md-glass-overlay-bg-color);border:1px solid var(--md-quaternary-bg-color);border-radius:.75rem;box-sizing:border-box;box-shadow:0 2px 8px rgba(0,0,0,.1);gap:.75rem;padding:.75rem;width:19.5625rem}:host(md-card-alert) .md-card-alert--no-insight{height:329px;max-height:329px;min-height:329px}:host(md-card-alert) .md-card-alert:hover{background:var(--md-card-v2-background-hover,var(--md-glass-overlay-bg-color));border:1px solid var(--card-v2-border-hover,var(--md-quaternary-bg-color))}:host(md-card-alert) .md-card-alert--expanded{border:1px solid var(--md-primary-text-color)}:host(md-card-alert) .md-card-alert:focus{outline:0}:host(md-card-alert) .md-card-alert-header{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;flex-wrap:nowrap}:host(md-card-alert) .md-card-alert-chips{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.375rem;min-width:0;overflow:hidden}:host(md-card-alert) .md-card-alert-timestamp{color:var(--md-secondary-text-color);font-size:.875rem;font-weight:400;flex-shrink:0}:host(md-card-alert) .md-card-alert-title-section{align-content:center;align-items:flex-start;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:.125rem;min-width:0;width:100%}:host(md-card-alert) .md-card-alert-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;color:var(--md-primary-text-color);display:-webkit-box;font-size:1rem;font-weight:700;max-height:3rem;line-height:1.5rem;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:normal;width:100%}:host(md-card-alert) .md-card-alert-subtitle{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-secondary-text-color);font-size:.875rem;gap:.25rem;margin:0}:host(md-card-alert) .md-card-alert-subtitle-icon{flex-shrink:0;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-details{align-content:center;align-items:stretch;display:flex;flex-flow:column nowrap;justify-content:flex-start;margin-top:auto;background:var(--md-subtle-bg-color,#f3f4f6);border-radius:.5rem;gap:.1875rem;padding:.75rem}:host(md-card-alert) .md-card-alert-details-heading{color:var(--md-secondary-text-color);font-size:.875rem;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-row{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between}:host(md-card-alert) .md-card-alert-detail-label{color:var(--md-primary-text-color);font-size:.875rem;font-weight:700;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value{color:var(--md-primary-text-color);font-size:.875rem;text-align:right;margin-bottom:.125rem}:host(md-card-alert) .md-card-alert-detail-value--highlighted{color:var(--md-alert-error-text-color,#dc2626)}:host(md-card-alert) .md-card-alert-insight{align-content:center;align-items:flex-start;display:flex;flex-flow:row nowrap;justify-content:flex-start;background:var(--card-ai-blue-bg-color,#eff6ff);border-radius:.5rem;border:1px solid var(--badge-confidence-cobalt-border-color,#dbeafe);color:var(--md-primary-text-color);gap:.5rem;padding:.625rem .75rem}:host(md-card-alert) .md-card-alert-insight-icon{color:var(--badge-status-accent-text-color,#0284c7);flex-shrink:0;margin-top:.0625rem;--md-icon-size:1rem}:host(md-card-alert) .md-card-alert-insight-text{font-size:.875rem;line-height:1.25rem}:host(md-card-alert) .md-card-alert-actions{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;gap:.5rem}`}};
@@ -1,17 +1,15 @@
1
- var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=i(9609),s=i(4084),a=i(2927),n=i(8899),l=i(4955),p=i(7137),d=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){t.CRITICAL="critical",t.MEDIUM="medium"}(o||(o={}));const h={[o.CRITICAL]:{icon:"flag-filled",color:"negative"},[o.MEDIUM]:{icon:"warning-filled",color:"warning"}},c={dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var m;!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.timestamp="",this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!1,this.expanded=!1,this.relativeTime=""}static get styles(){return[s.A,p.A]}get normalizedSeverity(){var t;const e=(null!==(t=this.severity)&&void 0!==t?t:"").toLowerCase();return Object.values(o).includes(e)?e:void 0}get severityIcon(){return this.normalizedSeverity?h[this.normalizedSeverity].icon:"info-circle-filled"}get severityColor(){return this.normalizedSeverity?h[this.normalizedSeverity].color:"neutral"}get hasInsight(){var t;return(null!==(t=this.insight)&&void 0!==t?t:"").trim().length>0}get detailRows(){return Array.isArray(this.details)?this.details:[]}updateRelativeTime(){this.timestamp&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){t.has("timestamp")&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.constructor.locale,i=Date.now(),o="number"==typeof t?t:new Date(t).getTime();if(isNaN(o))return"";const r=i-o;if(r<0)return e.justNow;const s=Math.floor(r/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const a=Math.floor(s/60);if(a<24)return e.hoursAgo(a);const n=Math.floor(a/24);return e.daysAgo(n)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){return this.relativeTime?a.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:a.nothing}renderHeader(){return this.severity||this.category||this.timestamp?a.html`
1
+ var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=i(9609),s=i(4084),a=i(2927),n=i(8899),l=i(4955),p=i(7137),d=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){t.CRITICAL="critical",t.MEDIUM="medium"}(o||(o={}));const h={[o.CRITICAL]:{icon:"flag-filled",color:"negative"},[o.MEDIUM]:{icon:"warning-filled",color:"warning"}},c={dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var m;!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.secondaryChip="",this.timestamp="",this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!1,this.expanded=!1,this.relativeTime=""}static get styles(){return[s.A,p.A]}get normalizedSeverity(){var t;const e=(null!==(t=this.severity)&&void 0!==t?t:"").toLowerCase();return Object.values(o).includes(e)?e:void 0}get severityIcon(){return this.normalizedSeverity?h[this.normalizedSeverity].icon:"plus-circle-filled"}get severityColor(){return this.normalizedSeverity?h[this.normalizedSeverity].color:"neutral"}get hasInsight(){var t;return(null!==(t=this.insight)&&void 0!==t?t:"").trim().length>0}get detailRows(){return Array.isArray(this.details)?this.details:[]}get resolvedLocale(){return t=this.constructor.locale,Object.assign(Object.assign(Object.assign({},c),t),{dismiss:null!==(e=null==t?void 0:t.dismiss)&&void 0!==e?e:c.dismiss});var t,e}updateRelativeTime(){this.timestamp&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){t.has("timestamp")&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.resolvedLocale,i=Date.now(),o="number"==typeof t?t:new Date(t).getTime();if(isNaN(o))return"";const r=i-o;if(r<0)return e.justNow;const s=Math.floor(r/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const a=Math.floor(s/60);if(a<24)return e.hoursAgo(a);const n=Math.floor(a/24);return e.daysAgo(n)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){return this.relativeTime?a.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:a.nothing}renderHeader(){return this.severity||this.category||this.timestamp?a.html`
2
2
  <div class="md-card-alert-header">
3
3
  <div class="md-card-alert-chips">
4
- ${this.severity?a.html`
5
- <md-chip color=${this.severityColor} small>
6
- <md-icon
7
- name=${this.severityIcon}
8
- size="14"
9
- iconSet="momentumDesign"
10
- slot="custom-left-content"
11
- ></md-icon>
12
- </md-chip>
13
- `:a.nothing}
14
- ${this.category?a.html`<md-chip value=${this.category} color="neutral" small></md-chip>`:a.nothing}
4
+ <md-chip color=${this.severityColor} value=${this.category} small>
5
+ <md-icon
6
+ name=${this.severityIcon}
7
+ size="14"
8
+ iconSet="momentumDesign"
9
+ slot="custom-left-content"
10
+ ></md-icon>
11
+ </md-chip>
12
+ ${this.secondaryChip?a.html`<md-chip color="confidence-cobalt" value=${this.secondaryChip} small></md-chip>`:a.nothing}
15
13
  </div>
16
14
  ${this.renderTimestamp()}
17
15
  </div>
@@ -48,11 +46,11 @@ var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=
48
46
  <md-icon name="sparkle-filled" iconSet="momentumDesign" class="md-card-alert-insight-icon"></md-icon>
49
47
  <span class="md-card-alert-insight-text">${this.insight}</span>
50
48
  </div>
51
- `:a.nothing}renderActions(){return a.html`
49
+ `:a.nothing}renderActions(){const t=this.resolvedLocale.dismiss;return a.html`
52
50
  <div class="md-card-alert-actions">
53
51
  <md-button
54
52
  size="32"
55
- variant="primary"
53
+ variant="secondary"
56
54
  class="md-card-alert-primary-action"
57
55
  ariaLabel=${this.primaryActionLabel}
58
56
  @click=${this.handlePrimaryAction}
@@ -68,25 +66,24 @@ var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=
68
66
  <md-button
69
67
  size="32"
70
68
  variant="secondary"
71
- outline
72
69
  class="md-card-alert-dismiss"
73
- ariaLabel=${this.constructor.locale.dismiss}
70
+ ariaLabel=${t}
74
71
  @click=${this.handleDismiss}
75
72
  >
76
- <span slot="text">${this.constructor.locale.dismiss}</span>
73
+ <span slot="text">${t}</span>
77
74
  </md-button>
78
75
  `:a.nothing}
79
76
  </div>
80
77
  `}render(){return a.html`
81
78
  <div
82
- class=${(0,l.classMap)({"md-card-alert":!0,"md-card-alert--no-insight":!this.hasInsight})}
79
+ class=${(0,l.classMap)({"md-card-alert":!0,"md-card-alert--no-insight":!this.hasInsight,"md-card-alert--expanded":this.expanded})}
83
80
  part="card"
84
81
  tabindex="0"
85
82
  >
86
83
  ${this.renderHeader()} ${this.renderTitleSection()} ${this.renderDetails()} ${this.renderInsight()}
87
84
  ${this.renderActions()}
88
85
  </div>
89
- `}};e.locale=Object.assign({},c),d([(0,n.property)({type:String})],e.prototype,"severity",void 0),d([(0,n.property)({type:String})],e.prototype,"category",void 0),d([(0,n.property)({type:String})],e.prototype,"timestamp",void 0),d([(0,n.property)({type:String})],e.prototype,"title",void 0),d([(0,n.property)({type:String})],e.prototype,"queueName",void 0),d([(0,n.property)({type:Array})],e.prototype,"details",void 0),d([(0,n.property)({type:String})],e.prototype,"insight",void 0),d([(0,n.property)({type:String})],e.prototype,"primaryActionLabel",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),d([(0,n.property)({type:String})],e.prototype,"detailsHeading",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"showDismiss",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"expanded",void 0),d([(0,n.state)()],e.prototype,"relativeTime",void 0),e=d([(0,r.w)("md-card-alert")],e),t.ELEMENT=e}(m||(m={}))},2583(t,e,i){i(2708),i(9613);var o,r=i(2900),s=i(9609),a=i(4084),n=i(2927),l=i(8899),p=i(4955),d=i(3517),h=i(9558),c=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:n.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:n.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:n.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?n.html`
86
+ `}};e.locale=Object.assign({},c),d([(0,n.property)({type:String})],e.prototype,"severity",void 0),d([(0,n.property)({type:String})],e.prototype,"category",void 0),d([(0,n.property)({type:String})],e.prototype,"secondaryChip",void 0),d([(0,n.property)({type:String})],e.prototype,"timestamp",void 0),d([(0,n.property)({type:String})],e.prototype,"title",void 0),d([(0,n.property)({type:String})],e.prototype,"queueName",void 0),d([(0,n.property)({type:Array})],e.prototype,"details",void 0),d([(0,n.property)({type:String})],e.prototype,"insight",void 0),d([(0,n.property)({type:String})],e.prototype,"primaryActionLabel",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),d([(0,n.property)({type:String})],e.prototype,"detailsHeading",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"showDismiss",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"expanded",void 0),d([(0,n.state)()],e.prototype,"relativeTime",void 0),e=d([(0,r.w)("md-card-alert")],e),t.ELEMENT=e}(m||(m={}))},2583(t,e,i){i(2708),i(9613);var o,r=i(2900),s=i(9609),a=i(4084),n=i(2927),l=i(8899),p=i(4955),d=i(3517),h=i(9558),c=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:n.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:n.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:n.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?n.html`
90
87
  <style>
91
88
  :host .md-chip {
92
89
  ${this.renderBgColor()};
@@ -137,4 +134,4 @@ var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=
137
134
  <slot name="custom-right-content" part="chip-right"> </slot>
138
135
  </span>
139
136
  </md-tooltip>
140
- `}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,r),s.exports}r.m=i,t=[],r.O=(e,i,o,s)=>{if(!i){var a=1/0;for(d=0;d<t.length;d++){for(var[i,o,s]=t[d],n=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every(t=>r.O[t](i[l]))?i.splice(l--,1):(n=!1,s<a&&(a=s));if(n){t.splice(d--,1);var p=o();void 0!==p&&(e=p)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[i,o,s]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={2583:0,8619:0},r.C=t=>{var i,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)r.o(a,i)&&(r.m[i]=a[i]);for(n&&n(r);l<s.length;l++)o=s[l],r.o(e,o)&&e[o]&&e[o][0](),e[s[l]]=0;r.O()},r.O.j=t=>0===e[t];import*as s from"../9609.js";r.C(s);import*as a from"../4084.js";r.C(a);import*as n from"../4955.js";r.C(n);import*as l from"../3517.js";r.C(l);import*as p from"../1156.js";r.C(p);import*as d from"../3305.js";r.C(d);import*as h from"../4739.js";r.C(h);import*as c from"../7154.js";r.C(c);import*as m from"../9773.js";r.C(m);import*as y from"../5983.js";r.C(y);import*as u from"../7755.js";r.C(u);import*as v from"../1821.js";r.C(v);import*as g from"../2364.js";r.C(g);import*as f from"../4980.js";r.C(f);import*as C from"../5308.js";r.C(C);import*as b from"../9938.js";r.C(b);import*as $ from"../9500.js";r.C($);import*as x from"../4781.js";r.C(x);import*as T from"../5584.js";r.C(T);import*as w from"../8227.js";r.C(w);import*as S from"../2900.js";r.C(S);import*as j from"../2050.js";r.C(j);import*as A from"../1280.js";r.C(A);import*as D from"../6343.js";r.C(D);import*as I from"../7582.js";r.C(I);import*as M from"../9613.js";r.C(M);import*as O from"../5323.js";r.C(O);import*as E from"../6631.js";r.C(E);import*as P from"../9558.js";r.C(P);import*as k from"../2708.js";r.C(k);import*as _ from"../7137.js";r.C(_);var R=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,2364,4980,5308,9938,9500,4781,5584,8227,2900,2050,1280,6343,7582,9613,5323,6631,9558,2708,7137],()=>r(4882));const z=(R=r.O(R)).v,W=R.I;export{z as CardAlert,W as CardAlertSeverity};
137
+ `}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,r),s.exports}r.m=i,t=[],r.O=(e,i,o,s)=>{if(!i){var a=1/0;for(d=0;d<t.length;d++){for(var[i,o,s]=t[d],n=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every(t=>r.O[t](i[l]))?i.splice(l--,1):(n=!1,s<a&&(a=s));if(n){t.splice(d--,1);var p=o();void 0!==p&&(e=p)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[i,o,s]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={2583:0,8619:0},r.C=t=>{var i,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)r.o(a,i)&&(r.m[i]=a[i]);for(n&&n(r);l<s.length;l++)o=s[l],r.o(e,o)&&e[o]&&e[o][0](),e[s[l]]=0;r.O()},r.O.j=t=>0===e[t];import*as s from"../9609.js";r.C(s);import*as a from"../4084.js";r.C(a);import*as n from"../4955.js";r.C(n);import*as l from"../3517.js";r.C(l);import*as p from"../1156.js";r.C(p);import*as d from"../3305.js";r.C(d);import*as h from"../4739.js";r.C(h);import*as c from"../7154.js";r.C(c);import*as m from"../9773.js";r.C(m);import*as y from"../5983.js";r.C(y);import*as u from"../7755.js";r.C(u);import*as v from"../1821.js";r.C(v);import*as g from"../2364.js";r.C(g);import*as f from"../4980.js";r.C(f);import*as C from"../5308.js";r.C(C);import*as b from"../9938.js";r.C(b);import*as $ from"../9500.js";r.C($);import*as x from"../4781.js";r.C(x);import*as T from"../5584.js";r.C(T);import*as w from"../8227.js";r.C(w);import*as S from"../2900.js";r.C(S);import*as j from"../2050.js";r.C(j);import*as A from"../1280.js";r.C(A);import*as D from"../6343.js";r.C(D);import*as O from"../7582.js";r.C(O);import*as I from"../9613.js";r.C(I);import*as M from"../5323.js";r.C(M);import*as E from"../6631.js";r.C(E);import*as P from"../9558.js";r.C(P);import*as k from"../2708.js";r.C(k);import*as _ from"../7137.js";r.C(_);var R=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,2364,4980,5308,9938,9500,4781,5584,8227,2900,2050,1280,6343,7582,9613,5323,6631,9558,2708,7137],()=>r(4882));const z=(R=r.O(R)).v,L=R.I;export{z as CardAlert,L as CardAlertSeverity};
@@ -1,4 +1,4 @@
1
- var t,e,i={7936(t,e,i){i.d(e,{v:()=>v}),i(5983),i(1821),i(708);var o=i(9609),s=i(9938),r=i(4084),a=i(2927),l=i(8899),n=i(4955),d=i(3517),h=i(7638),c=i(6897),p=i(4841),m=i(597),g=i(9125),u=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const f=document.createElement("img");var v;f.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(t){let e=class extends((0,s.d)(a.LitElement)){constructor(){super(...arguments),this.isRowFocusable="true",this.error="",this.COLS=[],this.ROWS=[],this.updCols=()=>this.requestUpdate("COLS"),this.updRows=()=>this.requestUpdate("ROWS"),this.dragRow=-1,this.dropRow=-1,this.drops=[],this.dragRowElem=null,this.dragCol=-1,this.dropCol=-1,this.isResizing=!1,this.isSelectable=!1,this.selected={},this.expandedRowIdx={},this.dragover=t=>t.preventDefault(),this.eX=0,this.onResize=(t,e)=>{var i;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const o=t.target;null===(i=t.dataTransfer)||void 0===i||i.setDragImage(f,0,0);const s=this.COLS.map(t=>this.shadowRoot.querySelector(`th.col-index-${t.index}`));this.COLS.forEach((t,e)=>t.width=s[e].offsetWidth+"px"),this.updCols();const r=t.x;this.eX=t.x;let a=-1,l=-1,n=-1;const d=this.COLS[e.index-1],h=s[e.index],c=s[e.index-1],p=h.offsetWidth,m=c.offsetWidth,g=()=>{const t=this.eX;if(a!=t&&0!=t){a=t;const i=a-r;l=p-i,n=m+i,e.width=l+"px",d.width=n+"px",this.updCols()}},u=t=>this.eX=t.x,v=()=>{this.isResizing=!1,o.removeEventListener("drag",g),o.removeEventListener("dragend",v),document.removeEventListener("dragover",u)};o.addEventListener("drag",g),o.addEventListener("dragend",v),document.addEventListener("dragover",u)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}update(t){super.update(t),t.has("data")&&(this.updateTableData(),this.updateDataInTable())}updateTableData(){if("string"==typeof this.data)try{this.tableData=JSON.parse(this.data)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the config json")}else this.tableData=Object.assign({},this.data)}updateTableConfig(){if("string"==typeof this.config)try{this.tableConfig=JSON.parse(this.config)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the data json")}else this.tableConfig=Object.assign({},this.config)}populateColumns(){var t;let e=0;const i=(t,i)=>{var o,s,r,a;const l=t.filters||(null===(s=null===(o=this.tableConfig.default)||void 0===o?void 0:o.col)||void 0===s?void 0:s.filters),n=l?"forString"==l?g.d.optionsString:"forNumber"==l?g.d.optionsNumber:l.length?l:null:null;this.COLS.push({options:Object.assign({},t),index:e++,group:i,sort:"default",sorter:t.sorter||(null===(a=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===a?void 0:a.sorter),isCollapsable:this.tableConfig.cols.collapse==t.id,filter:n?{list:n,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(t=>{"children"in t?t.children.forEach(e=>i(e,{name:t.groupName,length:t.children.length})):i(t)}),this.isSelectable=!!this.tableConfig.rows&&"none"!=(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)}populateData(){const t=this.COLS.length;if("csv"in this.tableData){const t=c.default.parse(this.tableData.csv,{skipEmptyLines:!0,transform:t=>t.trim()});if(t.errors)return void(this.error="PARSE ERROR:\n"+JSON.stringify(t.errors,null,2));{const e=t.data;this.ROWS=e.map(t=>t.map(t=>({text:t})))}}else if("list2d"in this.tableData)this.ROWS=this.tableData.list2d.map(t=>t.map(t=>({text:t})));else{for(;this.tableData.list.length>t;)this.ROWS.push(this.tableData.list.splice(0,t).map(t=>({text:t})));0!=this.tableData.list.length&&this.ROWS.push(this.tableData.list.map(t=>({text:t})))}0!=this.ROWS.length||(this.error="DATA ERROR: Data is empty")}validateData(){const t=this.COLS.length;this.ROWS.reduce((t,e)=>t+e.length,0)%t==0?this.ROWS.forEach((e,i)=>{const o=e.length;o!=t&&(this.error=`DATA ERROR: Total number of cols (=${t}) and data[${i}] length (=${o}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const t=this.tableConfig.cellTemplates,e=Object.keys(t||{});t&&e.length&&this.ROWS.forEach((e,i)=>{e.forEach((e,o)=>{for(const s in t){const r=e.text.indexOf(s);if(-1!=r){const a=t[s],l=this.querySelector(`#${a.templateName}`);if(null==l){console.warn(`cellTemplates["${s}"]: Missing '${a.templateName}' template.`);continue}let n=e.text.replace(s,"");a.contentCb&&(n=a.contentCb({col:o,row:i,content:n,insertIndex:r})),this.ROWS[i][o]={text:n,template:{template:l,templateCb:a.templateCb,insertIndex:"replace"==a.contentUse?-1:r}};break}}})})}setDefaultFilterAndSort(){var t,e;const i=null===(t=this.tableConfig.default)||void 0===t?void 0:t.sort;if(i){const t=this.COLS.find(t=>t.options.id==i.colId);t?this.sort(t,i.order):console.warn(`Cant find ${i.colId} col - for sorting`)}const o=null===(e=this.tableConfig.default)||void 0===e?void 0:e.filter;if(o){const t=this.COLS.find(t=>t.options.id==o.colId);t?t.filter?(t.filter.selectedIndex=o.selectedIndex,t.filter.input=o.input,this.updCols(),this.filter(t)):console.warn(`Cant find filters on ${o.colId} col`):console.warn(`Cant find ${o.colId} col - for filtering`)}}populateTable(){this.populateColumns(),this.populateData(),this.validateData(),this.setDefaultFilterAndSort(),this.populateTemplate()}updateDataInTable(){this.populateData(),this.validateData(),this.populateTemplate()}onDropRow(){this.dragRow!=this.dropRow&&this.drops.push([this.dragRow,this.dropRow]),this.dragRow=-1,this.dropRow=-1,this.dragRowElem&&(this.dragRowElem.setAttribute("draggable","false"),this.dragRowElem=null)}onDropCol(){if(this.dragCol!=this.dropCol){const t=this.COLS[this.dragCol],e=this.COLS[this.dropCol],i=t.group,o=e.group,s=t.index,r=e.index;t.group=o,e.group=i,t.index=r,e.index=s,this.COLS[this.dragCol]=e,this.COLS[this.dropCol]=t,this.ROWS.forEach(t=>{const e=t[this.dragCol],i=t[this.dropCol];t[this.dragCol]=i,t[this.dropCol]=e}),this.updCols(),this.updRows()}this.dragCol=-1,this.dropCol=-1}sort(t,e){t.sorter&&(this.clearSelection(),this.drops=[],this.COLS.forEach(i=>{i.options.id==t.options.id?i.sort=e||("default"==i.sort?"ascending":"ascending"==i.sort?"descending":"default"):i.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:t.sort}))}filter(t){if(!t.filter)return;this.clearSelection(),this.drops=[];const e=t.filter.input.trim(),i=t.filter.list[t.filter.selectedIndex];t.filter.active=!!e,this.requestUpdate(),e?this["md-table-advanced-change"].emit({type:"filter-on",filter:i,input:e}):this["md-table-advanced-change"].emit({type:"filter-off",filter:t.filter.list[t.filter.selectedIndex]})}selectRow(t){var e;const i=t.row.idx,o=Object.prototype.hasOwnProperty.call(this.selected,i);"multiple"==(null===(e=this.tableConfig.rows)||void 0===e?void 0:e.selectable)?(t.metaKey?o?delete this.selected[i]:this.selected[i]=!0:t.shiftKey||(this.selected={[i]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(t=>+t)})):o?this.clearSelection():(this.selected={[i]:!0},this["md-table-advanced-change"].emit({type:"select",index:i})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(t,e){t.stopPropagation(),this.expandedRowIdx[e]?(delete this.expandedRowIdx[e],this["md-table-advanced-change"].emit({type:"collapse",row:e})):(this.expandedRowIdx[e]=!0,this["md-table-advanced-change"].emit({type:"expand",row:e})),this.clearSelection(),this.requestUpdate()}render(){if(this.error)return a.html` <div>${this.error}</div> `;const{head:t}=this.tableConfig,e=(0,n.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return a.html`
1
+ var t,e,i={7936(t,e,i){i.d(e,{v:()=>v}),i(5983),i(1821),i(708);var o=i(9609),s=i(9938),r=i(4084),a=i(2927),l=i(8899),n=i(4955),d=i(3517),h=i(7638),c=i(6897),p=i(4841),m=i(597),g=i(9125),u=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const f=document.createElement("img");var v;f.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(t){let e=class extends((0,s.d)(a.LitElement)){constructor(){super(...arguments),this.isRowFocusable="true",this.error="",this.COLS=[],this.ROWS=[],this.updCols=()=>this.requestUpdate("COLS"),this.updRows=()=>this.requestUpdate("ROWS"),this.dragRow=-1,this.dropRow=-1,this.drops=[],this.dragRowElem=null,this.dragCol=-1,this.dropCol=-1,this.isResizing=!1,this.isSelectable=!1,this.selected={},this.expandedRowIdx={},this.dragover=t=>t.preventDefault(),this.eX=0,this.onResize=(t,e)=>{var i;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const o=t.target;null===(i=t.dataTransfer)||void 0===i||i.setDragImage(f,0,0);const s=this.COLS.map(t=>this.shadowRoot.querySelector(`th.col-index-${t.index}`));this.COLS.forEach((t,e)=>t.width=s[e].offsetWidth+"px"),this.updCols();const r=t.x;this.eX=t.x;let a=-1,l=-1,n=-1;const d=this.COLS[e.index-1],h=s[e.index],c=s[e.index-1],p=h.offsetWidth,m=c.offsetWidth,g=()=>{const t=this.eX;if(a!=t&&0!=t){a=t;const i=a-r;l=p-i,n=m+i,e.width=l+"px",d.width=n+"px",this.updCols()}},u=t=>this.eX=t.x,v=()=>{this.isResizing=!1,o.removeEventListener("drag",g),o.removeEventListener("dragend",v),document.removeEventListener("dragover",u)};o.addEventListener("drag",g),o.addEventListener("dragend",v),document.addEventListener("dragover",u)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}willUpdate(t){var e;null===(e=super.willUpdate)||void 0===e||e.call(this,t),t.has("data")&&void 0!==t.get("data")&&(this.error="")}update(t){super.update(t),t.has("data")&&(this.updateTableData(),this.updateDataInTable())}updateTableData(){if("string"==typeof this.data)try{this.tableData=JSON.parse(this.data)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the config json")}else this.tableData=Object.assign({},this.data)}updateTableConfig(){if("string"==typeof this.config)try{this.tableConfig=JSON.parse(this.config)}catch(t){console.error("[INVALID_JSON_FORMAT] Please recheck the data json")}else this.tableConfig=Object.assign({},this.config)}populateColumns(){var t;let e=0;const i=(t,i)=>{var o,s,r,a;const l=t.filters||(null===(s=null===(o=this.tableConfig.default)||void 0===o?void 0:o.col)||void 0===s?void 0:s.filters),n=l?"forString"==l?g.d.optionsString:"forNumber"==l?g.d.optionsNumber:l.length?l:null:null;this.COLS.push({options:Object.assign({},t),index:e++,group:i,sort:"default",sorter:t.sorter||(null===(a=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===a?void 0:a.sorter),isCollapsable:this.tableConfig.cols.collapse==t.id,filter:n?{list:n,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(t=>{"children"in t?t.children.forEach(e=>i(e,{name:t.groupName,length:t.children.length})):i(t)}),this.isSelectable=!!this.tableConfig.rows&&"none"!=(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)}populateData(){const t=this.COLS.length;if("csv"in this.tableData){const t=c.default.parse(this.tableData.csv,{skipEmptyLines:!0,transform:t=>t.trim()});if(t.errors)return void(this.error="PARSE ERROR:\n"+JSON.stringify(t.errors,null,2));{const e=t.data;this.ROWS=e.map(t=>t.map(t=>({text:t})))}}else if("list2d"in this.tableData)this.ROWS=this.tableData.list2d.map(t=>t.map(t=>({text:t})));else{for(;this.tableData.list.length>t;)this.ROWS.push(this.tableData.list.splice(0,t).map(t=>({text:t})));0!=this.tableData.list.length&&this.ROWS.push(this.tableData.list.map(t=>({text:t})))}0!=this.ROWS.length||(this.error="DATA ERROR: Data is empty")}validateData(){const t=this.COLS.length;this.ROWS.reduce((t,e)=>t+e.length,0)%t==0?this.ROWS.forEach((e,i)=>{const o=e.length;o!=t&&(this.error=`DATA ERROR: Total number of cols (=${t}) and data[${i}] length (=${o}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const t=this.tableConfig.cellTemplates,e=Object.keys(t||{});t&&e.length&&this.ROWS.forEach((e,i)=>{e.forEach((e,o)=>{for(const s in t){const r=e.text.indexOf(s);if(-1!=r){const a=t[s],l=this.querySelector(`#${a.templateName}`);if(null==l){console.warn(`cellTemplates["${s}"]: Missing '${a.templateName}' template.`);continue}let n=e.text.replace(s,"");a.contentCb&&(n=a.contentCb({col:o,row:i,content:n,insertIndex:r})),this.ROWS[i][o]={text:n,template:{template:l,templateCb:a.templateCb,insertIndex:"replace"==a.contentUse?-1:r}};break}}})})}setDefaultFilterAndSort(){var t,e;const i=null===(t=this.tableConfig.default)||void 0===t?void 0:t.sort;if(i){const t=this.COLS.find(t=>t.options.id==i.colId);t?this.sort(t,i.order):console.warn(`Cant find ${i.colId} col - for sorting`)}const o=null===(e=this.tableConfig.default)||void 0===e?void 0:e.filter;if(o){const t=this.COLS.find(t=>t.options.id==o.colId);t?t.filter?(t.filter.selectedIndex=o.selectedIndex,t.filter.input=o.input,this.updCols(),this.filter(t)):console.warn(`Cant find filters on ${o.colId} col`):console.warn(`Cant find ${o.colId} col - for filtering`)}}populateTable(){this.populateColumns(),this.populateData(),this.validateData(),this.setDefaultFilterAndSort(),this.populateTemplate()}updateDataInTable(){this.populateData(),this.validateData(),this.populateTemplate()}onDropRow(){this.dragRow!=this.dropRow&&this.drops.push([this.dragRow,this.dropRow]),this.dragRow=-1,this.dropRow=-1,this.dragRowElem&&(this.dragRowElem.setAttribute("draggable","false"),this.dragRowElem=null)}onDropCol(){if(this.dragCol!=this.dropCol){const t=this.COLS[this.dragCol],e=this.COLS[this.dropCol],i=t.group,o=e.group,s=t.index,r=e.index;t.group=o,e.group=i,t.index=r,e.index=s,this.COLS[this.dragCol]=e,this.COLS[this.dropCol]=t,this.ROWS.forEach(t=>{const e=t[this.dragCol],i=t[this.dropCol];t[this.dragCol]=i,t[this.dropCol]=e}),this.updCols(),this.updRows()}this.dragCol=-1,this.dropCol=-1}sort(t,e){t.sorter&&(this.clearSelection(),this.drops=[],this.COLS.forEach(i=>{i.options.id==t.options.id?i.sort=e||("default"==i.sort?"ascending":"ascending"==i.sort?"descending":"default"):i.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:t.sort}))}filter(t){if(!t.filter)return;this.clearSelection(),this.drops=[];const e=t.filter.input.trim(),i=t.filter.list[t.filter.selectedIndex];t.filter.active=!!e,this.requestUpdate(),e?this["md-table-advanced-change"].emit({type:"filter-on",filter:i,input:e}):this["md-table-advanced-change"].emit({type:"filter-off",filter:t.filter.list[t.filter.selectedIndex]})}selectRow(t){var e;const i=t.row.idx,o=Object.prototype.hasOwnProperty.call(this.selected,i);"multiple"==(null===(e=this.tableConfig.rows)||void 0===e?void 0:e.selectable)?(t.metaKey?o?delete this.selected[i]:this.selected[i]=!0:t.shiftKey||(this.selected={[i]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(t=>+t)})):o?this.clearSelection():(this.selected={[i]:!0},this["md-table-advanced-change"].emit({type:"select",index:i})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(t,e){t.stopPropagation(),this.expandedRowIdx[e]?(delete this.expandedRowIdx[e],this["md-table-advanced-change"].emit({type:"collapse",row:e})):(this.expandedRowIdx[e]=!0,this["md-table-advanced-change"].emit({type:"expand",row:e})),this.clearSelection(),this.requestUpdate()}render(){if(this.error)return a.html` <div>${this.error}</div> `;const{head:t}=this.tableConfig,e=(0,n.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return a.html`
2
2
  <div class="md-table-advanced">
3
3
  <slot></slot>
4
4
  <table class=${e} summary=${(0,d.ifDefined)(null==t?void 0:t.summary)}>