@momentum-ui/web-components 3.2.14 → 3.2.15
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/2273.js +2 -2
- package/dist/7137.js +1 -1
- package/dist/9189.js +5 -4
- package/dist/comp/md-card-alert-entry.js +30 -34
- package/dist/comp/md-combobox-entry.js +2 -2
- package/dist/comp/md-input-entry.js +5 -4
- package/dist/esm/2273.js +2 -2
- package/dist/esm/4654.js +2 -2
- package/dist/esm/7137.js +1 -1
- package/dist/esm/9189.js +5 -4
- package/dist/esm/comp/md-card-alert-entry.js +26 -30
- package/dist/esm/comp/md-input-entry.js +5 -4
- package/dist/esm/index-entry.js +31 -34
- package/dist/esm/index.js +1 -1
- package/dist/index-entry.js +147 -150
- package/dist/index.js +1 -1
- package/dist/types/[sandbox]/examples/card-alert.d.ts +0 -1
- package/dist/types/components/card-alert/CardAlert.d.ts +8 -3
- package/dist/types/components/card-alert/CardAlert.stories.d.ts +1 -5
- package/dist/types/components/combobox/ComboBox.d.ts +1 -1
- package/dist/types/components/input/Input.d.ts +5 -1
- package/package.json +1 -1
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
var t,e,i={4882(t,e,i){i.d(e,{v:()=>
|
|
2
|
-
><md-icon
|
|
3
|
-
name="active-presence-small-filled"
|
|
4
|
-
size="10"
|
|
5
|
-
iconSet="momentumDesign"
|
|
6
|
-
class="md-card-alert-live-icon"
|
|
7
|
-
></md-icon
|
|
8
|
-
>${t.live}</span
|
|
9
|
-
>`:this.relativeTime?s.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:s.nothing}renderHeader(){return this.severity||this.category||this.timestamp||this.live?s.html`
|
|
1
|
+
var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=i(9609),s=i(4084),a=i(2927),n=i(8899),l=i(4955),p=i(7137),d=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){t.CRITICAL="critical",t.MEDIUM="medium"}(o||(o={}));const h={[o.CRITICAL]:{icon:"flag-filled",color:"negative"},[o.MEDIUM]:{icon:"warning-filled",color:"warning"}},c={dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var m;!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.timestamp="",this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!1,this.expanded=!1,this.relativeTime=""}static get styles(){return[s.A,p.A]}get normalizedSeverity(){var t;const e=(null!==(t=this.severity)&&void 0!==t?t:"").toLowerCase();return Object.values(o).includes(e)?e:void 0}get severityIcon(){return this.normalizedSeverity?h[this.normalizedSeverity].icon:"info-circle-filled"}get severityColor(){return this.normalizedSeverity?h[this.normalizedSeverity].color:"neutral"}get hasInsight(){var t;return(null!==(t=this.insight)&&void 0!==t?t:"").trim().length>0}get detailRows(){return Array.isArray(this.details)?this.details:[]}updateRelativeTime(){this.timestamp&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){t.has("timestamp")&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.constructor.locale,i=Date.now(),o="number"==typeof t?t:new Date(t).getTime();if(isNaN(o))return"";const r=i-o;if(r<0)return e.justNow;const s=Math.floor(r/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const a=Math.floor(s/60);if(a<24)return e.hoursAgo(a);const n=Math.floor(a/24);return e.daysAgo(n)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){return this.relativeTime?a.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:a.nothing}renderHeader(){return this.severity||this.category||this.timestamp?a.html`
|
|
10
2
|
<div class="md-card-alert-header">
|
|
11
3
|
<div class="md-card-alert-chips">
|
|
12
|
-
${this.severity?
|
|
13
|
-
<md-chip
|
|
4
|
+
${this.severity?a.html`
|
|
5
|
+
<md-chip color=${this.severityColor} small>
|
|
14
6
|
<md-icon
|
|
15
7
|
name=${this.severityIcon}
|
|
16
8
|
size="14"
|
|
@@ -18,15 +10,15 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
|
|
|
18
10
|
slot="custom-left-content"
|
|
19
11
|
></md-icon>
|
|
20
12
|
</md-chip>
|
|
21
|
-
`:
|
|
22
|
-
${this.category?
|
|
13
|
+
`:a.nothing}
|
|
14
|
+
${this.category?a.html`<md-chip value=${this.category} color="neutral" small></md-chip>`:a.nothing}
|
|
23
15
|
</div>
|
|
24
16
|
${this.renderTimestamp()}
|
|
25
17
|
</div>
|
|
26
|
-
`:
|
|
18
|
+
`:a.nothing}renderTitleSection(){return this.title||this.queueName?a.html`
|
|
27
19
|
<div class="md-card-alert-title-section">
|
|
28
|
-
${this.title?
|
|
29
|
-
${this.queueName?
|
|
20
|
+
${this.title?a.html`<h3 class="md-card-alert-title">${this.title}</h3>`:a.nothing}
|
|
21
|
+
${this.queueName?a.html`
|
|
30
22
|
<p class="md-card-alert-subtitle">
|
|
31
23
|
<md-icon
|
|
32
24
|
name="queue-contact-bold"
|
|
@@ -36,27 +28,27 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
|
|
|
36
28
|
></md-icon>
|
|
37
29
|
${this.queueName}
|
|
38
30
|
</p>
|
|
39
|
-
`:
|
|
31
|
+
`:a.nothing}
|
|
40
32
|
</div>
|
|
41
|
-
`:
|
|
33
|
+
`:a.nothing}renderDetails(){return 0===this.detailRows.length?a.nothing:a.html`
|
|
42
34
|
<div class="md-card-alert-details">
|
|
43
35
|
<span class="md-card-alert-details-heading">${this.detailsHeading}</span>
|
|
44
|
-
${this.
|
|
36
|
+
${this.detailRows.map(t=>a.html`
|
|
45
37
|
<div class="md-card-alert-detail-row">
|
|
46
38
|
<span class="md-card-alert-detail-label">${t.label}</span>
|
|
47
39
|
<span
|
|
48
|
-
class=${(0,
|
|
40
|
+
class=${(0,l.classMap)({"md-card-alert-detail-value":!0,"md-card-alert-detail-value--highlighted":!!t.highlighted})}
|
|
49
41
|
>${t.value}</span
|
|
50
42
|
>
|
|
51
43
|
</div>
|
|
52
44
|
`)}
|
|
53
45
|
</div>
|
|
54
|
-
|
|
46
|
+
`}renderInsight(){return this.hasInsight?a.html`
|
|
55
47
|
<div class="md-card-alert-insight">
|
|
56
48
|
<md-icon name="sparkle-filled" iconSet="momentumDesign" class="md-card-alert-insight-icon"></md-icon>
|
|
57
49
|
<span class="md-card-alert-insight-text">${this.insight}</span>
|
|
58
50
|
</div>
|
|
59
|
-
`:
|
|
51
|
+
`:a.nothing}renderActions(){return a.html`
|
|
60
52
|
<div class="md-card-alert-actions">
|
|
61
53
|
<md-button
|
|
62
54
|
size="32"
|
|
@@ -66,13 +58,13 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
|
|
|
66
58
|
@click=${this.handlePrimaryAction}
|
|
67
59
|
>
|
|
68
60
|
<span slot="text">${this.primaryActionLabel}</span>
|
|
69
|
-
${this.primaryActionDropdown?
|
|
61
|
+
${this.primaryActionDropdown?a.html`<md-icon
|
|
70
62
|
name=${this.expanded?"arrow-up-bold":"arrow-down-bold"}
|
|
71
63
|
size="12"
|
|
72
64
|
iconSet="momentumDesign"
|
|
73
|
-
></md-icon>`:
|
|
65
|
+
></md-icon>`:a.nothing}
|
|
74
66
|
</md-button>
|
|
75
|
-
${this.showDismiss?
|
|
67
|
+
${this.showDismiss?a.html`
|
|
76
68
|
<md-button
|
|
77
69
|
size="32"
|
|
78
70
|
variant="secondary"
|
|
@@ -83,14 +75,18 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
|
|
|
83
75
|
>
|
|
84
76
|
<span slot="text">${this.constructor.locale.dismiss}</span>
|
|
85
77
|
</md-button>
|
|
86
|
-
`:
|
|
78
|
+
`:a.nothing}
|
|
87
79
|
</div>
|
|
88
|
-
`}render(){return
|
|
89
|
-
<div
|
|
80
|
+
`}render(){return a.html`
|
|
81
|
+
<div
|
|
82
|
+
class=${(0,l.classMap)({"md-card-alert":!0,"md-card-alert--no-insight":!this.hasInsight})}
|
|
83
|
+
part="card"
|
|
84
|
+
tabindex="0"
|
|
85
|
+
>
|
|
90
86
|
${this.renderHeader()} ${this.renderTitleSection()} ${this.renderDetails()} ${this.renderInsight()}
|
|
91
87
|
${this.renderActions()}
|
|
92
88
|
</div>
|
|
93
|
-
`}};e.locale=Object.assign({},
|
|
89
|
+
`}};e.locale=Object.assign({},c),d([(0,n.property)({type:String})],e.prototype,"severity",void 0),d([(0,n.property)({type:String})],e.prototype,"category",void 0),d([(0,n.property)({type:String})],e.prototype,"timestamp",void 0),d([(0,n.property)({type:String})],e.prototype,"title",void 0),d([(0,n.property)({type:String})],e.prototype,"queueName",void 0),d([(0,n.property)({type:Array})],e.prototype,"details",void 0),d([(0,n.property)({type:String})],e.prototype,"insight",void 0),d([(0,n.property)({type:String})],e.prototype,"primaryActionLabel",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),d([(0,n.property)({type:String})],e.prototype,"detailsHeading",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"showDismiss",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"expanded",void 0),d([(0,n.state)()],e.prototype,"relativeTime",void 0),e=d([(0,r.w)("md-card-alert")],e),t.ELEMENT=e}(m||(m={}))},2583(t,e,i){i(2708),i(9613);var o,r=i(2900),s=i(9609),a=i(4084),n=i(2927),l=i(8899),p=i(4955),d=i(3517),h=i(9558),c=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:n.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:n.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:n.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?n.html`
|
|
94
90
|
<style>
|
|
95
91
|
:host .md-chip {
|
|
96
92
|
${this.renderBgColor()};
|
|
@@ -141,4 +137,4 @@ var t,e,i={4882(t,e,i){i.d(e,{v:()=>c}),i(5983),i(2583),i(1821);var o=i(9609),r=
|
|
|
141
137
|
<slot name="custom-right-content" part="chip-right"> </slot>
|
|
142
138
|
</span>
|
|
143
139
|
</md-tooltip>
|
|
144
|
-
`}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,r),s.exports}r.m=i,t=[],r.O=(e,i,o,s)=>{if(!i){var a=1/0;for(d=0;d<t.length;d++){for(var[i,o,s]=t[d],n=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every(t=>r.O[t](i[l]))?i.splice(l--,1):(n=!1,s<a&&(a=s));if(n){t.splice(d--,1);var p=o();void 0!==p&&(e=p)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[i,o,s]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={2583:0,8619:0},r.C=t=>{var i,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)r.o(a,i)&&(r.m[i]=a[i]);for(n&&n(r);l<s.length;l++)o=s[l],r.o(e,o)&&e[o]&&e[o][0](),e[s[l]]=0;r.O()},r.O.j=t=>0===e[t];import*as s from"../9609.js";r.C(s);import*as a from"../4084.js";r.C(a);import*as n from"../4955.js";r.C(n);import*as l from"../3517.js";r.C(l);import*as p from"../1156.js";r.C(p);import*as d from"../3305.js";r.C(d);import*as h from"../4739.js";r.C(h);import*as c from"../7154.js";r.C(c);import*as m from"../9773.js";r.C(m);import*as
|
|
140
|
+
`}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,r),s.exports}r.m=i,t=[],r.O=(e,i,o,s)=>{if(!i){var a=1/0;for(d=0;d<t.length;d++){for(var[i,o,s]=t[d],n=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every(t=>r.O[t](i[l]))?i.splice(l--,1):(n=!1,s<a&&(a=s));if(n){t.splice(d--,1);var p=o();void 0!==p&&(e=p)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[i,o,s]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={2583:0,8619:0},r.C=t=>{var i,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)r.o(a,i)&&(r.m[i]=a[i]);for(n&&n(r);l<s.length;l++)o=s[l],r.o(e,o)&&e[o]&&e[o][0](),e[s[l]]=0;r.O()},r.O.j=t=>0===e[t];import*as s from"../9609.js";r.C(s);import*as a from"../4084.js";r.C(a);import*as n from"../4955.js";r.C(n);import*as l from"../3517.js";r.C(l);import*as p from"../1156.js";r.C(p);import*as d from"../3305.js";r.C(d);import*as h from"../4739.js";r.C(h);import*as c from"../7154.js";r.C(c);import*as m from"../9773.js";r.C(m);import*as y from"../5983.js";r.C(y);import*as u from"../7755.js";r.C(u);import*as v from"../1821.js";r.C(v);import*as g from"../2364.js";r.C(g);import*as f from"../4980.js";r.C(f);import*as C from"../5308.js";r.C(C);import*as b from"../9938.js";r.C(b);import*as $ from"../9500.js";r.C($);import*as x from"../4781.js";r.C(x);import*as T from"../5584.js";r.C(T);import*as w from"../8227.js";r.C(w);import*as S from"../2900.js";r.C(S);import*as j from"../2050.js";r.C(j);import*as A from"../1280.js";r.C(A);import*as D from"../6343.js";r.C(D);import*as I from"../7582.js";r.C(I);import*as M from"../9613.js";r.C(M);import*as O from"../5323.js";r.C(O);import*as E from"../6631.js";r.C(E);import*as P from"../9558.js";r.C(P);import*as k from"../2708.js";r.C(k);import*as _ from"../7137.js";r.C(_);var R=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,2364,4980,5308,9938,9500,4781,5584,8227,2900,2050,1280,6343,7582,9613,5323,6631,9558,2708,7137],()=>r(4882));const z=(R=r.O(R)).v,W=R.I;export{z as CardAlert,W as CardAlertSeverity};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9189(e,t,i){i.d(t,{$j:()=>
|
|
1
|
+
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9189(e,t,i){i.d(t,{$j:()=>v,IQ:()=>g,L2:()=>b,Nl:()=>C,OU:()=>f,We:()=>w,XO:()=>x,kj:()=>$,pd:()=>S}),i(7906),i(1821),i(2369),i(9773);var s=i(2900),a=i(9609),o=i(3203),r=i(4084),l=i(9500),n=i(2927),p=i(8899),d=i(4955),h=i(3517),m=i(2577),u=i(1156),c=i(9336),y=function(e,t,i,s){var a,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(o<3?a(r):o>3?a(t,i,r):a(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};const v=["small-1","small-2","small-3","small-4","small-5","small-6","small-7","small-8","small-9","small-10","small-11","small-12","medium-1","medium-2","medium-3","medium-4","medium-5","medium-6","medium-7","medium-8","medium-9","medium-10","medium-11","medium-12","large-1","large-2","large-3","large-4","large-5","large-6","large-7","large-8","large-9","large-10","large-11","large-12"],g=["small-1","small-2","small-3","small-4","small-5","small-6","small-7","small-8","small-9","small-10","small-11","small-12","medium-1","medium-2","medium-3","medium-4","medium-5","medium-6","medium-7","medium-8","medium-9","medium-10","medium-11","medium-12","large-1","large-2","large-3","large-4","large-5","large-6","large-7","large-8","large-9","large-10","large-11","large-12"],b=["text","number","password","email","tel","checkbox"],f=["none","pill"],$=l,C=["before","after"],w=[0,1,2,3],x=["grammar","false","spelling","true"];var S;!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,o.y)(n.LitElement)){constructor(){super(...arguments),this.ariaDescribedBy="",this.ariaInvalid="false",this.ariaLabel="",this.autofocus=!1,this.auxiliaryContentPosition=null,this.clear=!1,this.clearAriaLabel="",this.compact=!1,this.containerSize="small-12",this.disabled=!1,this.id="",this.inputSize="",this.isFilled=!1,this.isLoading=!1,this.label="",this.helpText="",this.hideMessage=!1,this.htmlId="",this.ariaRole=void 0,this.ariaAutocomplete=void 0,this.messageArr=[],this.min=void 0,this.max=void 0,this.maxLength=void 0,this.multi=!1,this.multiline=!1,this.name="",this.nestedLevel=0,this.placeholder="",this.readOnly=!1,this.required=!1,this.searchable=!1,this.secondaryLabel="",this.selectWhenInFocus=!1,this.shape="",this.type="text",this.value="",this.ariaControls="",this.ariaExpanded="",this.newMomentum=!1,this.disableUserTextInput=!1,this.autocomplete=void 0,this.showDropdown=!1,this.dropdownExpanded=!1,this.dropdownAriaLabel="Show options",this.maxSuggestedLength=void 0,this.isEditing=!1,this.hasRightSlotContent=!1,this.messageController=new t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}select(){var e;null===(e=this.input)||void 0===e||e.select()}focus(){var e;null===(e=this.input)||void 0===e||e.focus()}handleOutsideClick(e){let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||(this.input.blur(),this.isEditing=!1))}handleKeyDown(e){this.dispatchEvent(new CustomEvent("input-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleFocus(e){this.disabled||(this.isEditing=!0,this.selectWhenInFocus&&this.select(),this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleMouseDown(e){this.disabled||(this.isEditing=!0,this.dispatchEvent(new CustomEvent("input-mousedown",{bubbles:!0,composed:!0,detail:{srcEvent:e}})))}handleChange(e){var t;this.value=e.target.value,null===(t=this.control)||void 0===t||t.setValue(this.value),this.dispatchEvent(new CustomEvent("input-change",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:this.value}}))}handleBlur(e){var t;null===(t=this.control)||void 0===t||t.markAsTouched(),this.isEditing=!1,this.dispatchEvent(new CustomEvent("input-blur",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}handleClear(e){if("keydown"===e.type){const{code:t}=e;if(t!==s.Uz.Space&&t!==s.Uz.Enter)return;e.preventDefault(),e.stopPropagation()}else"click"===e.type&&(e.preventDefault(),e.stopPropagation());this.input.focus(),this.dispatchEvent(new CustomEvent("input-clear",{bubbles:!0,composed:!0,detail:{srcEvent:e}})),document.dispatchEvent(new CustomEvent("on-widget-update")),this.handleChange(e)}handleLabelClick(){this.input.focus()}handleRighSlotChange(){var e;this.hasRightSlotContent=(null===(e=this.inputSectionRightSlot)||void 0===e?void 0:e.assignedNodes().length)>0}handleDropdownClick(e){e.preventDefault(),this.dropdownExpanded=!this.dropdownExpanded,this.dispatchEvent(new CustomEvent("input-dropdown-click",{bubbles:!0,composed:!0,detail:{srcEvent:e,expanded:this.dropdownExpanded}}))}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}get inputClassMap(){return{"md-input--filled":this.isFilled,colums:!!this.containerSize,[`${this.containerSize}`]:!!this.containerSize,"md-read-only":this.readOnly,"md-disabled":this.disabled,[`md-${this.messageType}`]:!!this.messageType,[`md-input--nested-${this.nestedLevel}`]:!!this.nestedLevel,"md-multi":this.multi,"md-new-momentum":this.newMomentum}}get inputWrapperClassMap(){return{columns:!!this.inputSize,[`${this.inputSize}`]:!!this.inputSize}}get inputTemplateClassMap(){return{"md-input--multiline":this.multiline,"md-input--multi":this.multi,[`md-input--${this.shape}`]:!!this.shape,"md-input--compact":this.compact,"md-input--before":"before"===this.auxiliaryContentPosition||this.searchable,"md-input--after":"after"===this.auxiliaryContentPosition,"md-active":this.isEditing,"md-focus":this.isEditing,"md-read-only":this.readOnly,"md-disable-user-text-input":this.disableUserTextInput,"md-disabled":this.disabled,"md-dirty":!!this.value,"md-has-right-icon":this.hasRightIcon}}get ariaExpandedValue(){return"true"===this.ariaExpanded||"false"===this.ariaExpanded?this.ariaExpanded:this.showDropdown?`${this.dropdownExpanded}`:void 0}get effectiveAriaAutocomplete(){return this.ariaAutocomplete||(this.showDropdown?"both":void 0)}get effectiveAriaRole(){return this.ariaRole||(this.showDropdown?"combobox":void 0)}get hasRightIcon(){return!(!this.clear||this.disabled||!this.value||this.readOnly)||!!this.showDropdown||!this.compact&&this.hasRightSlotContent}get effectiveAriaLabel(){return this.ariaLabel||this.label||void 0}inputTemplate(){var e;return this.multiline?n.html`
|
|
2
2
|
<textarea
|
|
3
3
|
part="input"
|
|
4
4
|
class="md-input ${(0,d.classMap)(this.inputTemplateClassMap)}"
|
|
@@ -37,14 +37,15 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9
|
|
|
37
37
|
type=${this.type}
|
|
38
38
|
.value=${this.value}
|
|
39
39
|
aria-describedby=${this.ariaDescribedBy}
|
|
40
|
-
aria-controls=${this.ariaControls}
|
|
40
|
+
aria-controls=${(0,h.ifDefined)(this.ariaControls||void 0)}
|
|
41
|
+
aria-autocomplete=${(0,h.ifDefined)(this.effectiveAriaAutocomplete)}
|
|
41
42
|
aria-expanded=${(0,h.ifDefined)(null!==(e=this.ariaExpandedValue)&&void 0!==e?e:void 0)}
|
|
42
43
|
aria-label=${(0,h.ifDefined)(this.effectiveAriaLabel)}
|
|
43
44
|
aria-invalid=${this.ariaInvalid}
|
|
44
45
|
aria-errormessage=${`${this.htmlId}-message`}
|
|
45
46
|
aria-disabled=${(0,h.ifDefined)(this.disabled||void 0)}
|
|
46
47
|
id=${this.htmlId}
|
|
47
|
-
role=${(0,h.ifDefined)(this.
|
|
48
|
+
role=${(0,h.ifDefined)(this.effectiveAriaRole)}
|
|
48
49
|
placeholder=${this.placeholder}
|
|
49
50
|
?readonly=${this.readOnly||this.disabled||this.disableUserTextInput}
|
|
50
51
|
min=${(0,h.ifDefined)(this.min)}
|
|
@@ -154,4 +155,4 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";var t,i,s={9
|
|
|
154
155
|
${this.characterCountLabelTemplate()}
|
|
155
156
|
</div>
|
|
156
157
|
</div>
|
|
157
|
-
`}};y([(0,p.property)({type:String})],i.prototype,"ariaDescribedBy",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"ariaInvalid",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaLabel",void 0),y([(0,p.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,p.property)({type:String})],i.prototype,"auxiliaryContentPosition",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"clear",void 0),y([(0,p.property)({type:String})],i.prototype,"clearAriaLabel",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"compact",void 0),y([(0,p.property)({type:String})],i.prototype,"containerSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disabled",void 0),y([(0,p.property)({type:String})],i.prototype,"id",void 0),y([(0,p.property)({type:String})],i.prototype,"inputSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isFilled",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isLoading",void 0),y([(0,p.property)({type:String})],i.prototype,"label",void 0),y([(0,p.property)({type:String})],i.prototype,"helpText",void 0),y([(0,p.property)({type:Boolean,attribute:"hide-message",reflect:!0})],i.prototype,"hideMessage",void 0),y([(0,p.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaRole",void 0),y([(0,p.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"min",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"max",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxLength",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multi",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multiline",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"name",void 0),y([(0,p.property)({type:Number})],i.prototype,"nestedLevel",void 0),y([(0,p.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"readOnly",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"required",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"searchable",void 0),y([(0,p.property)({type:String})],i.prototype,"secondaryLabel",void 0),y([(0,p.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),y([(0,p.property)({type:String})],i.prototype,"shape",void 0),y([(0,p.property)({type:String})],i.prototype,"type",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"value",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaControls",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaExpanded",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,p.property)({type:Object})],i.prototype,"control",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disableUserTextInput",void 0),y([(0,p.property)({type:String})],i.prototype,"autocomplete",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"showDropdown",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"dropdownExpanded",void 0),y([(0,p.property)({type:String})],i.prototype,"dropdownAriaLabel",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxSuggestedLength",void 0),y([(0,p.query)(".md-input")],i.prototype,"input",void 0),y([(0,p.state)()],i.prototype,"isEditing",void 0),y([(0,p.query)('slot[name="input-section-right"]')],i.prototype,"inputSectionRightSlot",void 0),y([(0,p.state)()],i.prototype,"hasRightSlotContent",void 0),i=y([(0,a.w)("md-input")],i),e.ELEMENT=i}(S||(S={}))},9500(t){t.exports=e}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return s[e](i,i.exports,o),i.exports}o.m=s,t=[],o.O=(e,i,s,a)=>{if(!i){var r=1/0;for(d=0;d<t.length;d++){for(var[i,s,a]=t[d],l=!0,n=0;n<i.length;n++)(!1&a||r>=a)&&Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):(l=!1,a<r&&(r=a));if(l){t.splice(d--,1);var p=s();void 0!==p&&(e=p)}}return e}a=a||0;for(var d=t.length;d>0&&t[d-1][2]>a;d--)t[d]=t[d-1];t[d]=[i,s,a]},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{o as __webpack_require__};i={1266:0,7119:0,9189:0,9500:0},o.C=e=>{var t,s,{__webpack_esm_ids__:a,__webpack_esm_modules__:r,__webpack_esm_runtime__:l}=e,n=0;for(t in r)o.o(r,t)&&(o.m[t]=r[t]);for(l&&l(o);n<a.length;n++)s=a[n],o.o(i,s)&&i[s]&&i[s][0](),i[a[n]]=0;o.O()},o.O.j=e=>0===i[e];import*as r from"../9609.js";o.C(r);import*as l from"../4084.js";o.C(l);import*as n from"../4955.js";o.C(n);import*as p from"../3517.js";o.C(p);import*as d from"../1156.js";o.C(d);import*as h from"../3305.js";o.C(h);import*as m from"../4739.js";o.C(m);import*as u from"../7154.js";o.C(u);import*as c from"../9773.js";o.C(c);import*as y from"../5983.js";o.C(y);import*as
|
|
158
|
+
`}};y([(0,p.property)({type:String})],i.prototype,"ariaDescribedBy",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"ariaInvalid",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaLabel",void 0),y([(0,p.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,p.property)({type:String})],i.prototype,"auxiliaryContentPosition",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"clear",void 0),y([(0,p.property)({type:String})],i.prototype,"clearAriaLabel",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"compact",void 0),y([(0,p.property)({type:String})],i.prototype,"containerSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disabled",void 0),y([(0,p.property)({type:String})],i.prototype,"id",void 0),y([(0,p.property)({type:String})],i.prototype,"inputSize",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isFilled",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"isLoading",void 0),y([(0,p.property)({type:String})],i.prototype,"label",void 0),y([(0,p.property)({type:String})],i.prototype,"helpText",void 0),y([(0,p.property)({type:Boolean,attribute:"hide-message",reflect:!0})],i.prototype,"hideMessage",void 0),y([(0,p.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaRole",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaAutocomplete",void 0),y([(0,p.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"min",void 0),y([(0,p.property)({type:Number,reflect:!0})],i.prototype,"max",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxLength",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multi",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"multiline",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"name",void 0),y([(0,p.property)({type:Number})],i.prototype,"nestedLevel",void 0),y([(0,p.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"readOnly",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"required",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"searchable",void 0),y([(0,p.property)({type:String})],i.prototype,"secondaryLabel",void 0),y([(0,p.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),y([(0,p.property)({type:String})],i.prototype,"shape",void 0),y([(0,p.property)({type:String})],i.prototype,"type",void 0),y([(0,p.property)({type:String,reflect:!0})],i.prototype,"value",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaControls",void 0),y([(0,p.property)({type:String})],i.prototype,"ariaExpanded",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,p.property)({type:Object})],i.prototype,"control",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"disableUserTextInput",void 0),y([(0,p.property)({type:String})],i.prototype,"autocomplete",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"showDropdown",void 0),y([(0,p.property)({type:Boolean})],i.prototype,"dropdownExpanded",void 0),y([(0,p.property)({type:String})],i.prototype,"dropdownAriaLabel",void 0),y([(0,p.property)({type:Number})],i.prototype,"maxSuggestedLength",void 0),y([(0,p.query)(".md-input")],i.prototype,"input",void 0),y([(0,p.state)()],i.prototype,"isEditing",void 0),y([(0,p.query)('slot[name="input-section-right"]')],i.prototype,"inputSectionRightSlot",void 0),y([(0,p.state)()],i.prototype,"hasRightSlotContent",void 0),i=y([(0,a.w)("md-input")],i),e.ELEMENT=i}(S||(S={}))},9500(t){t.exports=e}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return s[e](i,i.exports,o),i.exports}o.m=s,t=[],o.O=(e,i,s,a)=>{if(!i){var r=1/0;for(d=0;d<t.length;d++){for(var[i,s,a]=t[d],l=!0,n=0;n<i.length;n++)(!1&a||r>=a)&&Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):(l=!1,a<r&&(r=a));if(l){t.splice(d--,1);var p=s();void 0!==p&&(e=p)}}return e}a=a||0;for(var d=t.length;d>0&&t[d-1][2]>a;d--)t[d]=t[d-1];t[d]=[i,s,a]},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{o as __webpack_require__};i={1266:0,7119:0,9189:0,9500:0},o.C=e=>{var t,s,{__webpack_esm_ids__:a,__webpack_esm_modules__:r,__webpack_esm_runtime__:l}=e,n=0;for(t in r)o.o(r,t)&&(o.m[t]=r[t]);for(l&&l(o);n<a.length;n++)s=a[n],o.o(i,s)&&i[s]&&i[s][0](),i[a[n]]=0;o.O()},o.O.j=e=>0===i[e];import*as r from"../9609.js";o.C(r);import*as l from"../4084.js";o.C(l);import*as n from"../4955.js";o.C(n);import*as p from"../3517.js";o.C(p);import*as d from"../1156.js";o.C(d);import*as h from"../3305.js";o.C(h);import*as m from"../4739.js";o.C(m);import*as u from"../7154.js";o.C(u);import*as c from"../9773.js";o.C(c);import*as y from"../5983.js";o.C(y);import*as v from"../7755.js";o.C(v);import*as g from"../1821.js";o.C(g);import*as b from"../4980.js";o.C(b);import*as f from"../5308.js";o.C(f);import*as $ from"../519.js";o.C($);import*as C from"../4137.js";o.C(C);import*as w from"../2577.js";o.C(w);import*as x from"../8441.js";o.C(x);import*as S from"../2797.js";o.C(S);import*as E from"../9983.js";o.C(E);import*as L from"../3970.js";o.C(L);import*as T from"../7906.js";o.C(T);import*as _ from"../9336.js";o.C(_);import*as D from"../2369.js";o.C(D);var M=o.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,4980,5308,519,4137,2577,8441,2797,9983,3970,7906,9336,2369],()=>o(9189));const j=(M=o.O(M)).pd,B=M.XO,k=M.$j,O=M.kj,A=M.Nl,I=M.OU,R=M.IQ,z=M.L2,P=M.We;export{j as Input,B as ariaInvalidType,k as containerSize,O as iconNames,A as iconPosition,I as inputShape,R as inputSize,z as inputType,P as nestedLevel};
|