@momentum-ui/web-components 2.23.7 → 2.23.9
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/3553.js +1 -1
- package/dist/6273.js +13 -13
- package/dist/6877.js +1 -0
- package/dist/7119.js +18 -0
- package/dist/76.js +1 -1
- package/dist/8028.js +19 -16
- package/dist/8923.js +1 -0
- package/dist/9130.js +1 -1
- package/dist/comp/md-avatar-entry.js +15 -12
- package/dist/comp/md-avatar.js +1 -1
- package/dist/comp/md-chat-message-entry.js +1 -1
- package/dist/comp/md-chat-message.js +1 -1
- package/dist/comp/md-coachmark-entry.js +1 -1
- package/dist/comp/md-coachmark.js +1 -1
- package/dist/comp/md-datepicker-entry.js +5 -5
- package/dist/comp/md-loading-entry.js +1 -1
- package/dist/comp/md-meeting-alert-entry.js +1 -1
- package/dist/comp/md-meeting-alert.js +1 -1
- package/dist/comp/md-modal-entry.js +1 -1
- package/dist/comp/md-modal.js +1 -1
- package/dist/comp/md-presence-entry.js +12 -0
- package/dist/comp/md-presence.js +1 -0
- package/dist/comp/md-task-item-entry.js +1 -1
- package/dist/comp/md-task-item.js +1 -1
- package/dist/index-entry.js +48 -27
- package/dist/index.js +1 -1
- package/dist/types/components/avatar/Avatar.d.ts +3 -4
- package/dist/types/components/datepicker/DatePicker.d.ts +2 -0
- package/dist/types/components/floating-button-bar/FloatingButtonBar.d.ts +1 -0
- package/dist/types/components/{avatar → presence}/Presence.d.ts +7 -1
- package/dist/types/components/{avatar → presence}/Presence.utils.d.ts +2 -2
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/528.js +0 -12
- package/dist/9788.js +0 -7
package/dist/8028.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[8028],{38028:(t,
|
|
2
|
-
<span class="md-avatar__letter ${(0,
|
|
1
|
+
"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[8028],{38028:(e,t,i)=>{i(61200),i(69788),i(15300);var n,a=i(31890),o=i(26283),s=i(26272),r=i(41488),c=i(40333),l=i(23968),h=i(97822),p=i(8229),d=i(37782),m=i(38923),y=i(3553),u=function(e,t,i,n){var a,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(s=(o<3?a(s):o>3?a(t,i,s):a(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};!function(e){let t=class extends r.LitElement{constructor(){super(...arguments),this._tabIndex=0,this.alt="",this.src="",this.label="",this.title="",this.color="",this.decrypting=!1,this.role="img",this.iconName="",this.failurePresence=!1,this.type="",this.newMomentum=!1,this.typing=!1,this.size=40,this.hasNotification=!1,this.clickable=!1,this.avatarStyle="default",this.state="rest",this.imageLoaded=!1,this.imageErrored=!1,this.presenceColor="",this.presenceIcon="",this.iconNameMap={"channel-chat":"chat-filled","channel-social":"sms-message-filled","channel-sms-inbound":"sms-filled","channel-sms-outbound":"sms-outgoing-filled","channel-email-inbound":"email-filled","channel-email-outbound":"email-outgoing-filled","channel-call":"handset-filled","channel-call-inbound":"incoming-call-legacy-filled","channel-callback":"outgoing-call-legacy-filled","channel-headset":"headset-filled","channel-campaign":"campaign-management-bold","channel-emoji":"emoji-happy-filled","channel-webex":"webex-app-icon-color-container","channel-fb-messenger":"social-fbmessenger-color","channel-facebook":"social-facebook-color","channel-apple-chat":"apple-business-chat-color","channel-line":"social-line-color","channel-twitter-x":"social-x","channel-viber":"social-viber-color","channel-whats-app":"social-whatsapp-color","channel-we-chat":"social-wechat-color","channel-spam":"participant-unknown-bold","channel-monitoring":"monitoring-bold"}}get tabIndex(){return this._tabIndex}set tabIndex(e){const t=this._tabIndex;this._tabIndex=e,this.requestUpdate("tabIndex",t)}static get styles(){return[s.A,y.A]}isPresenceType(e){return m.e.includes(e)}firstUpdated(){const e=this.presenceType||(this.isPresenceType(this.type)?this.type:"");if(e){const{presenceColor:t,presenceIcon:i}=(0,m.E)(e,this.failurePresence,this.newMomentum);this.presenceColor=t,this.presenceIcon=i}}updated(e){super.updated(e);const t=this.presenceType||(this.isPresenceType(this.type)?this.type:"");if(t&&(e.has("type")||e.has("presenceType")||e.has("newMomentum"))){const{presenceColor:e,presenceIcon:i}=(0,m.E)(t,this.failurePresence,this.newMomentum);this.presenceColor=e,this.presenceIcon=i}e.has("role")&&this.style.setProperty("--avatar-cursor","button"===this.role?"pointer":"default")}get avatarClassMap(){return Object.assign(Object.assign({},this.newMomentum&&"bot"!==this.type||!this.type?{}:{[`md-avatar--${this.type}`]:!0}),{[`md-avatar--${this.size}`]:!!this.size,[`md-avatar--${this.color}`]:!!this.color})}get avatarLetterClassMap(){return{"md-decrypting":this.decrypting,[`md-avatar--${this.color}`]:this.color,"new-momentum":this.newMomentum}}get avatarStyleMap(){return{[`md-avatar--${this.color}`]:this.color}}get pretifyTitle(){if(this.title.length){const e=this.title.trim().split(" ");return 1===e.length?e[0].charAt(0):e[0].charAt(0)+e[e.length-1].charAt(0)}return this.title}get chatIconName(){return"chat-filled"}getIconName(e){return this.iconNameMap[e]||""}get chatIconSize(){return this.iconSize}get presenceSize(){return this.size<=24?10.5:this.size<=32?14:this.size<=48?13.94:this.size<=64?18.58:this.size<=72?20.9:this.size<=88?25.55:36}get iconSize(){return 24===this.size?"16":28===this.size?"18":32===this.size?"20":36===this.size?"22":40===this.size?"24":48===this.size?"28":56===this.size?"32":64===this.size?"36":72===this.size?"40":Math.round(this.size/1.7).toString()}get renderIsTyping(){return"typing"===this.type||this.typing?r.html` <md-loading></md-loading> `:c.nothing}get avatarLetter(){return this.title?r.html`
|
|
2
|
+
<span class="md-avatar__letter ${(0,l.classMap)(this.avatarLetterClassMap)}">
|
|
3
3
|
${this.pretifyTitle}
|
|
4
4
|
<slot></slot>
|
|
5
5
|
${this.renderIsTyping}
|
|
6
6
|
</span>
|
|
7
|
-
`:
|
|
8
|
-
<span class="md-avatar__icon ${(0,
|
|
7
|
+
`:c.nothing}get avatarIcon(){return r.html`
|
|
8
|
+
<span class="md-avatar__icon ${(0,l.classMap)(this.avatarStyleMap)}">
|
|
9
9
|
<md-icon
|
|
10
10
|
.name=${this.iconName}
|
|
11
11
|
.iconSet=${this.newMomentum?"momentumDesign":"momentumUI"}
|
|
@@ -13,28 +13,31 @@
|
|
|
13
13
|
></md-icon>
|
|
14
14
|
</span>
|
|
15
15
|
`}get avatarImage(){return r.html`
|
|
16
|
-
${(0,d.until)(this.loadImage().then((
|
|
17
|
-
`}loadImage(){return
|
|
16
|
+
${(0,d.until)(this.loadImage().then((e=>(this.handleImageLoad(),r.html` ${e} `))).catch((()=>this.handleImageError())),r.html` ${this.iconName?this.avatarIcon:this.title?r.html` ${this.avatarLetter} `:c.nothing} `)}
|
|
17
|
+
`}loadImage(){return e=this,t=void 0,n=function*(){return new Promise(((e,t)=>{const i=document.createElement("img");i.src=this.src,i.alt=this.alt,i.onload=()=>e(i),i.onerror=e=>t(e),i.classList.add("md-avatar__img"),i.classList.toggle("md-avatar__img--hidden",!this.imageLoaded)}))},new((i=void 0)||(i=Promise))((function(a,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function r(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,r)}c((n=n.apply(e,t||[])).next())}));var e,t,i,n}handleImageLoad(){this.imageLoaded=!0}handleImageError(){this.imageErrored=!0}handleKeyDown(e){if(!this.clickable)return;const{code:t}=e;(0,o.o)(t)&&this.dispatchEvent(new CustomEvent("button-keydown",{composed:!0,bubbles:!0,detail:{srcEvent:e}}))}handleClick(e){var t;this.clickable&&(null===(t=this.clickFunction)||void 0===t||t.call(this),this.dispatchEvent(new CustomEvent("button-click",{composed:!0,bubbles:!0,detail:{srcEvent:e}})))}getBrandOrDesignIconSet(e){return new Set(["webex-app-icon-color-container","social-fbmessenger-color","social-facebook-color","apple-business-chat-color","social-line-color","social-viber-color","social-x","social-whatsapp-color","social-wechat-color"]).has(e)?"momentumBrandVisuals":"momentumDesign"}get avatarContent(){return this.src&&!this.imageErrored?this.avatarImage:this.iconName?this.avatarIcon:this.title?this.avatarLetter:c.nothing}renderPresence(){return this.newMomentum&&(this.presenceType||this.type)&&"self"!==this.type&&this.presenceIcon?r.html`
|
|
18
18
|
<md-presence
|
|
19
19
|
class="avatar-presence"
|
|
20
20
|
name="${this.presenceIcon}"
|
|
21
21
|
color="${this.presenceColor}"
|
|
22
|
-
size="${this.
|
|
22
|
+
size="${this.presenceSize}"
|
|
23
|
+
.failurePresence=${this.failurePresence}
|
|
24
|
+
.newMomentum=${this.newMomentum}
|
|
25
|
+
.avatarLinked=${!0}
|
|
23
26
|
>
|
|
24
27
|
</md-presence>
|
|
25
|
-
`:
|
|
28
|
+
`:c.nothing}renderAvatarContent(){const e=this.getIconName(this.type);if("channel-custom"===this.type)return r.html`
|
|
26
29
|
<span class="md-avatar__logo" data-channel-style=${this.avatarStyle} data-channel-state=${this.state}>
|
|
27
30
|
<slot></slot>
|
|
28
31
|
</span>
|
|
29
|
-
`;if(
|
|
32
|
+
`;if(e){const t=this.getBrandOrDesignIconSet(e);return r.html`
|
|
30
33
|
<span
|
|
31
34
|
class="md-avatar__logo ${this.type}"
|
|
32
35
|
data-channel-style=${this.avatarStyle}
|
|
33
36
|
data-channel-state=${this.state}
|
|
34
37
|
>
|
|
35
38
|
<md-icon
|
|
36
|
-
.name=${
|
|
37
|
-
.iconSet=${
|
|
39
|
+
.name=${e}
|
|
40
|
+
.iconSet=${t}
|
|
38
41
|
.size=${this.chatIconSize}
|
|
39
42
|
color="var(--icon-color-${this.type})"
|
|
40
43
|
></md-icon>
|
|
@@ -43,10 +46,10 @@
|
|
|
43
46
|
<div
|
|
44
47
|
part="avatar"
|
|
45
48
|
class="md-avatar
|
|
46
|
-
${(0,
|
|
49
|
+
${(0,l.classMap)(this.avatarClassMap)}"
|
|
47
50
|
role=${this.role}
|
|
48
|
-
@click=${
|
|
49
|
-
@keydown=${
|
|
51
|
+
@click=${e=>this.handleClick(e)}
|
|
52
|
+
@keydown=${e=>this.handleKeyDown(e)}
|
|
50
53
|
tabindex=${(0,h.ifDefined)(this.tabIndex||void 0)}
|
|
51
54
|
aria-label=${(0,h.ifDefined)(this.label)}
|
|
52
55
|
>
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
<md-icon .name=${this.chatIconName} .iconSet=${"momentumDesign"} .size=${this.chatIconSize}></md-icon>
|
|
56
59
|
</span>
|
|
57
60
|
`:this.renderAvatarContent()}
|
|
58
|
-
${this.hasNotification?r.html` <span class="md-avatar__notification-badge"></span> `:
|
|
61
|
+
${this.hasNotification?r.html` <span class="md-avatar__notification-badge"></span> `:c.nothing}
|
|
59
62
|
${this.renderPresence()}
|
|
60
63
|
</div>
|
|
61
|
-
`}};u([(0,r.property)({type:Number,attribute:"tab-index",reflect:!0})],
|
|
64
|
+
`}};u([(0,r.property)({type:Number,attribute:"tab-index",reflect:!0})],t.prototype,"tabIndex",null),u([(0,r.property)({type:String})],t.prototype,"alt",void 0),u([(0,r.property)({type:String})],t.prototype,"src",void 0),u([(0,r.property)({type:String})],t.prototype,"label",void 0),u([(0,r.property)({type:String})],t.prototype,"title",void 0),u([(0,r.property)({type:String})],t.prototype,"color",void 0),u([(0,r.property)({type:Boolean})],t.prototype,"decrypting",void 0),u([(0,r.property)({type:String})],t.prototype,"role",void 0),u([(0,r.property)({type:String,attribute:"icon-name"})],t.prototype,"iconName",void 0),u([(0,r.property)({type:Boolean})],t.prototype,"failurePresence",void 0),u([(0,r.property)({type:String})],t.prototype,"type",void 0),u([(0,r.property)({type:String,attribute:"presence-type"})],t.prototype,"presenceType",void 0),u([(0,r.property)({type:Boolean})],t.prototype,"newMomentum",void 0),u([(0,r.property)({type:Boolean})],t.prototype,"typing",void 0),u([(0,r.property)({type:Number})],t.prototype,"size",void 0),u([(0,r.property)({type:Boolean,attribute:"has-notification"})],t.prototype,"hasNotification",void 0),u([(0,r.property)({type:Boolean})],t.prototype,"clickable",void 0),u([(0,r.property)({attribute:!1})],t.prototype,"clickFunction",void 0),u([(0,r.property)({type:String,attribute:"avatar-style"})],t.prototype,"avatarStyle",void 0),u([(0,r.property)({type:String})],t.prototype,"state",void 0),u([(0,r.internalProperty)()],t.prototype,"imageLoaded",void 0),u([(0,r.internalProperty)()],t.prototype,"imageErrored",void 0),u([(0,r.internalProperty)()],t.prototype,"presenceColor",void 0),u([(0,r.internalProperty)()],t.prototype,"presenceIcon",void 0),t=u([(0,a.w)("md-avatar")],t),e.ELEMENT=t}(n||(n={}))}}]);
|
package/dist/8923.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[8923],{38923:(e,a,r)=>{r.d(a,{E:()=>s,e:()=>c});var n=r(31465);const c=["active","meeting","schedule","call","dnd","presenting","quiet-hours","away","idle","inactive","away-calling","ooo","busy","on-mobile","on-device","on-hold","engaged","rona",""],s=(e,a,r=!1)=>{let c="",s="";if(a)c="warning-badge-filled",s="var(--avatar-presence-warning)";else{if(!e)return{presenceIcon:void 0,presenceColor:void 0};switch(e){case"active":c="active-presence-small-filled",s="var(--avatar-presence-active)";break;case"meeting":c=r?"camera-presence-filled":"camera-presence_14",s="var(--avatar-presence-unstable)";break;case"schedule":c=r?"meetings-presence-badge-filled":"meetings-presence_14",s="var(--avatar-presence-unstable)";break;case"call":c=r?"handset-filled":"handset-active_16",s="var(--avatar-presence-unstable)";break;case"dnd":c=r?"dnd-presence-badge-filled":"dnd-presence_14",s="var(--avatar-presence-dnd)";break;case"presenting":c=r?"share-screen-badge-filled":"content-share_14",s="var(--avatar-presence-dnd)";break;case"quiet-hours":c="quiet-hours-presence-filled",s="var(--avatar-presence-inactive)";break;case"away":case"idle":case"inactive":c=r?"recents-presence-badge-filled":"recents-presence_14",s="var(--avatar-presence-inactive)";break;case"away-calling":c="away-calling-presence-filled",s="var(--avatar-presence-inactive)";break;case"ooo":c="pto-presence-filled",s="var(--avatar-presence-inactive)";break;case"busy":c="busy-presence-bold",s="var(--avatar-presence-unstable)";break;case"on-mobile":c="phone-filled",s="var(--avatar-presence-inactive)";break;case"on-device":c=r?"generic-device-video-filled":"generic-device-video_16",s="var(--avatar-presence-inactive)";break;case"on-hold":case n.j.HOLD:c="pause-badge-filled",s="var(--avatar-presence-inactive)";break;case"engaged":c="busy-presence-bold",s="var(--avatar-presence-engaged)";break;case"rona":c="dnd-presence-badge-filled",s="var(--avatar-presence-rona)";break;case n.j.CONSULTING:c="headset-bold",s="var(--avatar-presence-inactive)";break;case n.j.PLAY:c="play-bold",s="var(--avatar-presence-inactive)";break;case n.j.CONFERENCE:c="meet-bold",s="var(--avatar-presence-inactive)";break;case n.j.TRANSFERED:c="assign-privilege-bold",s="var(--avatar-presence-inactive)";break;case n.j.COURTESY_CALLBACK:c="callrate-bold",s="var(--avatar-presence-inactive)";break;case n.j.CAMPAIGN:c="announcement-bold",s="var(--avatar-presence-inactive)"}}return{presenceColor:s,presenceIcon:c}}}}]);
|