@kyndryl-design-system/shidoka-applications 2.103.2 → 2.104.0
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/components/reusable/notification/notification.d.ts +1 -1
- package/components/reusable/notification/notification.d.ts.map +1 -1
- package/components/reusable/notification/notification.js +26 -16
- package/components/reusable/notification/notification.js.map +1 -1
- package/components/reusable/overflowMenu/overflowMenuItem.d.ts.map +1 -1
- package/components/reusable/overflowMenu/overflowMenuItem.js +5 -2
- package/components/reusable/overflowMenu/overflowMenuItem.js.map +1 -1
- package/package.json +2 -2
|
@@ -59,7 +59,7 @@ export declare class Notification extends LitElement {
|
|
|
59
59
|
* @internal
|
|
60
60
|
*/
|
|
61
61
|
accessor _badgeColor: any;
|
|
62
|
-
/** Set notification
|
|
62
|
+
/** Set notification unread state. Applies to `type: 'normal'` and `type: 'clickable'`. */
|
|
63
63
|
accessor unRead: boolean;
|
|
64
64
|
/** Hide close (x) button. Useful only for `type='toast'`. This required `timeout > 0` otherwise toast remain as it is when `hideCloseButton` is set true. */
|
|
65
65
|
accessor hideCloseButton: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/notification/notification.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAKlD,OAAO,WAAW,CAAC;AAInB,OAAO,SAAS,CAAC;AAMjB,OAAO,UAAU,CAAC;AAElB,KAAK,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7E,KAAK,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;AAGpE,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,E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AC,MAAM,UAAS;IAExB,6JAA6J;IAE7J,QAAQ,CAAC,eAAe,UAAS;IAEjC,uJAAuJ;IAEvJ,QAAQ,CAAC,OAAO,SAAK;IAErB;;OAEG;IAEH,QAAQ,CAAC,0BAA0B,UAAS;IAEnC,MAAM;IAsEf,OAAO,CAAC,aAAa;IA2FZ,OAAO,CAAC,iBAAiB,EAAE,GAAG;IAcvC,OAAO,CAAC,MAAM;IAed,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;CA4B1B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,YAAY,CAAC;KAClC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__setFunctionName as t,__esDecorate as i,__runInitializers as e,__classPrivateFieldGet as a,__classPrivateFieldSet as n}from"tslib";import{unsafeSVG as o}from"lit-html/directives/unsafe-svg.js";import{css as r,LitElement as s,unsafeCSS as
|
|
1
|
+
import{__setFunctionName as t,__esDecorate as i,__runInitializers as e,__classPrivateFieldGet as a,__classPrivateFieldSet as n}from"tslib";import{unsafeSVG as o}from"lit-html/directives/unsafe-svg.js";import{css as r,LitElement as s,unsafeCSS as c,html as l}from"lit";import{customElement as d,property as f,state as p}from"lit/decorators.js";import{classMap as h}from"lit/directives/class-map.js";import{ifDefined as g}from"lit/directives/if-defined.js";import"../button/button.js";import{s as u,A as m,w as k,e as v,c as b}from"../../../vendor/@kyndryl-design-system/shidoka-icons-CELtE-gh.js";import"../card/card.js";import"../card/vitalCard.skeleton.js";import"../card/informationalCard.skeleton.js";import"../badge/badge.js";import"lit-html/directives/class-map.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../inlineConfirm/inlineConfirm.js";import"../loaders/skeleton.js";import"../../../cardSample-BCIwY1rJ.js";import"lit/directives/unsafe-svg.js";var y=r`*,
|
|
2
2
|
*::before,
|
|
3
3
|
*::after {
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -152,6 +152,17 @@ kyn-card.notification-normal::part(card-wrapper) {
|
|
|
152
152
|
background-color: var(--kd-color-background-card-background);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
kyn-card.notification-normal.notification-read::part(card-wrapper),
|
|
156
|
+
kyn-card.notification-clickable.notification-read::part(card-wrapper) {
|
|
157
|
+
background-color: var(--kd-color-temporary-background-read);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
kyn-card.notification-normal.notification-unread::part(card-wrapper),
|
|
161
|
+
kyn-card.notification-clickable.notification-unread::part(card-wrapper) {
|
|
162
|
+
background-color: var(--kd-color-temporary-background-unread);
|
|
163
|
+
border-color: var(--kd-color-temporary-border-unread);
|
|
164
|
+
}
|
|
165
|
+
|
|
155
166
|
kyn-link::part(link) {
|
|
156
167
|
color: red;
|
|
157
168
|
}
|
|
@@ -461,10 +472,9 @@ kyn-link::part(link) {
|
|
|
461
472
|
text-indent: 200%;
|
|
462
473
|
white-space: nowrap;
|
|
463
474
|
width: 1px;
|
|
464
|
-
}`;let x=(()=>{var r,x,w,S,z,C,$,T,_,j,D,B,M,W,N,
|
|
465
|
-
${"clickable"===this.type?
|
|
466
|
-
class
|
|
467
|
-
?highlight=${this.unRead}
|
|
475
|
+
}`;let x=(()=>{var r,x,w,S,z,C,$,T,_,j,D,B,M,R,W,N,E;let I,L,O,U,X,q,A,P,Y,F,G,H,J,K,Q,V,Z,tt,it,et=[d("kyn-notification")],at=[],nt=s,ot=[],rt=[],st=[],ct=[],lt=[],dt=[],ft=[],pt=[],ht=[],gt=[],ut=[],mt=[],kt=[],vt=[],bt=[],yt=[],xt=[],wt=[],St=[],zt=[],Ct=[],$t=[],Tt=[],_t=[],jt=[],Dt=[],Bt=[],Mt=[],Rt=[],Wt=[],Nt=[],Et=[],It=[],Lt=[];return L=class extends nt{get notificationTitle(){return a(this,r,"f")}set notificationTitle(t){n(this,r,t,"f")}get notificationSubtitle(){return a(this,x,"f")}set notificationSubtitle(t){n(this,x,t,"f")}get timeStamp(){return a(this,w,"f")}set timeStamp(t){n(this,w,t,"f")}get href(){return a(this,S,"f")}set href(t){n(this,S,t,"f")}get target(){return a(this,z,"f")}set target(t){n(this,z,t,"f")}get tagStatus(){return a(this,C,"f")}set tagStatus(t){n(this,C,t,"f")}get type(){return a(this,$,"f")}set type(t){n(this,$,t,"f")}get textStrings(){return a(this,T,"f")}set textStrings(t){n(this,T,t,"f")}get closeBtnDescription(){return a(this,_,"f")}set closeBtnDescription(t){n(this,_,t,"f")}get assistiveNotificationTypeText(){return a(this,j,"f")}set assistiveNotificationTypeText(t){n(this,j,t,"f")}get notificationRole(){return a(this,D,"f")}set notificationRole(t){n(this,D,t,"f")}get statusLabel(){return a(this,B,"f")}set statusLabel(t){n(this,B,t,"f")}get _badgeColor(){return a(this,M,"f")}set _badgeColor(t){n(this,M,t,"f")}get unRead(){return a(this,R,"f")}set unRead(t){n(this,R,t,"f")}get hideCloseButton(){return a(this,W,"f")}set hideCloseButton(t){n(this,W,t,"f")}get timeout(){return a(this,N,"f")}set timeout(t){n(this,N,t,"f")}get _hasDescriptionSlotContent(){return a(this,E,"f")}set _hasDescriptionSlotContent(t){n(this,E,t,"f")}render(){const t={"notification-normal":"normal"===this.type,"notification-inline":"inline"===this.type,"notification-toast":"toast"===this.type,"notification-error":("inline"===this.type||"toast"===this.type)&&"error"===this.tagStatus,"notification-success":("inline"===this.type||"toast"===this.type)&&"success"===this.tagStatus,"notification-warning":("inline"===this.type||"toast"===this.type)&&"warning"===this.tagStatus,"notification-info":("inline"===this.type||"toast"===this.type)&&"info"===this.tagStatus,"notification-ai":("inline"===this.type||"toast"===this.type)&&"ai"===this.tagStatus,"notification-default":("inline"===this.type||"toast"===this.type)&&"default"===this.tagStatus,"notification-no-description":!this._hasDescriptionSlotContent,"notification-read":("normal"===this.type||"clickable"===this.type)&&!this.unRead,"notification-unread":("normal"===this.type||"clickable"===this.type)&&this.unRead},i="clickable"===this.type?"clickable":"normal";return l`
|
|
476
|
+
${"clickable"===this.type?l`<kyn-card
|
|
477
|
+
class=${h({...t,"notification-clickable":!0})}
|
|
468
478
|
.type=${i}
|
|
469
479
|
href=${g(this.href||void 0)}
|
|
470
480
|
target=${g(this.target||void 0)}
|
|
@@ -477,20 +487,20 @@ kyn-link::part(link) {
|
|
|
477
487
|
>${this.assistiveNotificationTypeText}</span
|
|
478
488
|
>
|
|
479
489
|
${this.renderInnerUI()}
|
|
480
|
-
</kyn-card>`:
|
|
490
|
+
</kyn-card>`:l` <kyn-card
|
|
481
491
|
.type=${i}
|
|
482
492
|
role=${g(this.notificationRole)}
|
|
483
|
-
class
|
|
493
|
+
class=${h(t)}
|
|
484
494
|
>
|
|
485
|
-
${"inline"===this.type||"toast"===this.type?
|
|
495
|
+
${"inline"===this.type||"toast"===this.type?l`<span id="notificationType"
|
|
486
496
|
>${this.assistiveNotificationTypeText}</span
|
|
487
497
|
>`:null}
|
|
488
498
|
${this.renderInnerUI()}
|
|
489
499
|
</kyn-card>`}
|
|
490
|
-
`}renderInnerUI(){const t={success:u,error:v,warning:k,info:m,ai:u,default:u};return
|
|
500
|
+
`}renderInnerUI(){const t={success:u,error:v,warning:k,info:m,ai:u,default:u};return l`<div class="notification-wrapper">
|
|
491
501
|
<div class="notification-title-wrap">
|
|
492
502
|
<div class="notification-head">
|
|
493
|
-
${"inline"===this.type||"toast"===this.type?
|
|
503
|
+
${"inline"===this.type||"toast"===this.type?l` <span
|
|
494
504
|
class="notification-state-icon ${this.tagStatus}"
|
|
495
505
|
role="img"
|
|
496
506
|
aria-label=${`${this.textStrings[this.tagStatus]} icon`}
|
|
@@ -502,7 +512,7 @@ kyn-link::part(link) {
|
|
|
502
512
|
|
|
503
513
|
<div class="notification-title">${this.notificationTitle}</div>
|
|
504
514
|
|
|
505
|
-
${""===this.notificationSubtitle||"normal"!==this.type&&"clickable"!==this.type?null:
|
|
515
|
+
${""===this.notificationSubtitle||"normal"!==this.type&&"clickable"!==this.type?null:l`
|
|
506
516
|
<div class="notification-subtitle">
|
|
507
517
|
${this.notificationSubtitle}
|
|
508
518
|
</div>
|
|
@@ -510,7 +520,7 @@ kyn-link::part(link) {
|
|
|
510
520
|
</div>
|
|
511
521
|
|
|
512
522
|
<div>
|
|
513
|
-
${"toast"!==this.type&&"inline"!==this.type||this.hideCloseButton?null:
|
|
523
|
+
${"toast"!==this.type&&"inline"!==this.type||this.hideCloseButton?null:l` <kyn-button
|
|
514
524
|
class="notification-toast-close-btn"
|
|
515
525
|
kind=${"ai"===this.tagStatus?"ghost-ai":"ghost"}
|
|
516
526
|
size="small"
|
|
@@ -529,16 +539,16 @@ kyn-link::part(link) {
|
|
|
529
539
|
</div>
|
|
530
540
|
</div>
|
|
531
541
|
|
|
532
|
-
${this._hasDescriptionSlotContent?
|
|
542
|
+
${this._hasDescriptionSlotContent?l`<div class="notification-description">
|
|
533
543
|
<slot @slotchange="${this._handleSlotChange}"></slot>
|
|
534
|
-
</div>`:
|
|
544
|
+
</div>`:l`<slot
|
|
535
545
|
@slotchange="${this._handleSlotChange}"
|
|
536
546
|
style="display: none;"
|
|
537
547
|
></slot>`}
|
|
538
548
|
|
|
539
549
|
<div class="notification-content-wrapper">
|
|
540
550
|
<div class="status-tag">
|
|
541
|
-
${"default"===this.tagStatus||"normal"!==this.type&&"clickable"!==this.type?null:
|
|
551
|
+
${"default"===this.tagStatus||"normal"!==this.type&&"clickable"!==this.type?null:l`
|
|
542
552
|
<span id="statusLabel">${this.statusLabel}</span>
|
|
543
553
|
<kyn-badge
|
|
544
554
|
type=${"heavy"}
|
|
@@ -552,5 +562,5 @@ kyn-link::part(link) {
|
|
|
552
562
|
<div class="timestamp-text">${this.timeStamp}</div>
|
|
553
563
|
</div>
|
|
554
564
|
</div>
|
|
555
|
-
</div>`}updated(t){"toast"===this.type&&t.has("timeout")&&this.timeout>0&&setTimeout((()=>{this._close()}),1e3*this.timeout)}_close(){this.animate([{opacity:"1"},{opacity:"0"}],{duration:500,easing:"ease-in-out",fill:"forwards"}).onfinish=()=>{var t;null===(t=this.parentNode)||void 0===t||t.removeChild(this)};const t=new CustomEvent("on-close");this.dispatchEvent(t)}_handleClose(){this._close()}_handleCardClick(t){const i=new CustomEvent("on-notification-click",{detail:{origEvent:t.detail.origEvent}});this.dispatchEvent(i)}_handleSlotChange(){this._checkSlotContent()}_checkSlotContent(){var t;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot:not([name])");if(!i)return void(this._hasDescriptionSlotContent=!1);const e=i.assignedNodes().some((t=>{if(t.nodeType===Node.ELEMENT_NODE)return!0;if(t.nodeType===Node.TEXT_NODE){const i=t.textContent;return null!=i&&""!==i.trim()}return!1}));this._hasDescriptionSlotContent=e}constructor(){super(...arguments),r.set(this,e(this,ot,"")),x.set(this,(e(this,rt),e(this,st,""))),w.set(this,(e(this,
|
|
565
|
+
</div>`}updated(t){"toast"===this.type&&t.has("timeout")&&this.timeout>0&&setTimeout((()=>{this._close()}),1e3*this.timeout)}_close(){this.animate([{opacity:"1"},{opacity:"0"}],{duration:500,easing:"ease-in-out",fill:"forwards"}).onfinish=()=>{var t;null===(t=this.parentNode)||void 0===t||t.removeChild(this)};const t=new CustomEvent("on-close");this.dispatchEvent(t)}_handleClose(){this._close()}_handleCardClick(t){const i=new CustomEvent("on-notification-click",{detail:{origEvent:t.detail.origEvent}});this.dispatchEvent(i)}_handleSlotChange(){this._checkSlotContent()}_checkSlotContent(){var t;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot:not([name])");if(!i)return void(this._hasDescriptionSlotContent=!1);const e=i.assignedNodes().some((t=>{if(t.nodeType===Node.ELEMENT_NODE)return!0;if(t.nodeType===Node.TEXT_NODE){const i=t.textContent;return null!=i&&""!==i.trim()}return!1}));this._hasDescriptionSlotContent=e}constructor(){super(...arguments),r.set(this,e(this,ot,"")),x.set(this,(e(this,rt),e(this,st,""))),w.set(this,(e(this,ct),e(this,lt,""))),S.set(this,(e(this,dt),e(this,ft,""))),z.set(this,(e(this,pt),e(this,ht,""))),C.set(this,(e(this,gt),e(this,ut,"default"))),$.set(this,(e(this,mt),e(this,kt,"normal"))),T.set(this,(e(this,vt),e(this,bt,{success:"Success",warning:"Warning",info:"Information",error:"Error"}))),_.set(this,(e(this,yt),e(this,xt,"Close"))),j.set(this,(e(this,wt),e(this,St,""))),D.set(this,(e(this,zt),e(this,Ct,void 0))),B.set(this,(e(this,$t),e(this,Tt,"Status"))),M.set(this,(e(this,_t),e(this,jt,{success:"success",warning:"warning",info:"information",error:"error"}))),R.set(this,(e(this,Dt),e(this,Bt,!1))),W.set(this,(e(this,Mt),e(this,Rt,!1))),N.set(this,(e(this,Wt),e(this,Nt,8))),E.set(this,(e(this,Et),e(this,It,!1))),e(this,Lt)}},r=new WeakMap,x=new WeakMap,w=new WeakMap,S=new WeakMap,z=new WeakMap,C=new WeakMap,$=new WeakMap,T=new WeakMap,_=new WeakMap,j=new WeakMap,D=new WeakMap,B=new WeakMap,M=new WeakMap,R=new WeakMap,W=new WeakMap,N=new WeakMap,E=new WeakMap,t(L,"Notification"),(()=>{var t;const e="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=nt[Symbol.metadata])&&void 0!==t?t:null):void 0;O=[f({type:String})],U=[f({type:String})],X=[f({type:String})],q=[f({type:String})],A=[f({type:String})],P=[f({type:String})],Y=[f({type:String})],F=[f({type:Object})],G=[f({type:String})],H=[f({type:String})],J=[f({type:String})],K=[f({type:String})],Q=[p()],V=[f({type:Boolean,reflect:!0})],Z=[f({type:Boolean})],tt=[f({type:Number})],it=[p()],i(L,null,O,{kind:"accessor",name:"notificationTitle",static:!1,private:!1,access:{has:t=>"notificationTitle"in t,get:t=>t.notificationTitle,set:(t,i)=>{t.notificationTitle=i}},metadata:e},ot,rt),i(L,null,U,{kind:"accessor",name:"notificationSubtitle",static:!1,private:!1,access:{has:t=>"notificationSubtitle"in t,get:t=>t.notificationSubtitle,set:(t,i)=>{t.notificationSubtitle=i}},metadata:e},st,ct),i(L,null,X,{kind:"accessor",name:"timeStamp",static:!1,private:!1,access:{has:t=>"timeStamp"in t,get:t=>t.timeStamp,set:(t,i)=>{t.timeStamp=i}},metadata:e},lt,dt),i(L,null,q,{kind:"accessor",name:"href",static:!1,private:!1,access:{has:t=>"href"in t,get:t=>t.href,set:(t,i)=>{t.href=i}},metadata:e},ft,pt),i(L,null,A,{kind:"accessor",name:"target",static:!1,private:!1,access:{has:t=>"target"in t,get:t=>t.target,set:(t,i)=>{t.target=i}},metadata:e},ht,gt),i(L,null,P,{kind:"accessor",name:"tagStatus",static:!1,private:!1,access:{has:t=>"tagStatus"in t,get:t=>t.tagStatus,set:(t,i)=>{t.tagStatus=i}},metadata:e},ut,mt),i(L,null,Y,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,i)=>{t.type=i}},metadata:e},kt,vt),i(L,null,F,{kind:"accessor",name:"textStrings",static:!1,private:!1,access:{has:t=>"textStrings"in t,get:t=>t.textStrings,set:(t,i)=>{t.textStrings=i}},metadata:e},bt,yt),i(L,null,G,{kind:"accessor",name:"closeBtnDescription",static:!1,private:!1,access:{has:t=>"closeBtnDescription"in t,get:t=>t.closeBtnDescription,set:(t,i)=>{t.closeBtnDescription=i}},metadata:e},xt,wt),i(L,null,H,{kind:"accessor",name:"assistiveNotificationTypeText",static:!1,private:!1,access:{has:t=>"assistiveNotificationTypeText"in t,get:t=>t.assistiveNotificationTypeText,set:(t,i)=>{t.assistiveNotificationTypeText=i}},metadata:e},St,zt),i(L,null,J,{kind:"accessor",name:"notificationRole",static:!1,private:!1,access:{has:t=>"notificationRole"in t,get:t=>t.notificationRole,set:(t,i)=>{t.notificationRole=i}},metadata:e},Ct,$t),i(L,null,K,{kind:"accessor",name:"statusLabel",static:!1,private:!1,access:{has:t=>"statusLabel"in t,get:t=>t.statusLabel,set:(t,i)=>{t.statusLabel=i}},metadata:e},Tt,_t),i(L,null,Q,{kind:"accessor",name:"_badgeColor",static:!1,private:!1,access:{has:t=>"_badgeColor"in t,get:t=>t._badgeColor,set:(t,i)=>{t._badgeColor=i}},metadata:e},jt,Dt),i(L,null,V,{kind:"accessor",name:"unRead",static:!1,private:!1,access:{has:t=>"unRead"in t,get:t=>t.unRead,set:(t,i)=>{t.unRead=i}},metadata:e},Bt,Mt),i(L,null,Z,{kind:"accessor",name:"hideCloseButton",static:!1,private:!1,access:{has:t=>"hideCloseButton"in t,get:t=>t.hideCloseButton,set:(t,i)=>{t.hideCloseButton=i}},metadata:e},Rt,Wt),i(L,null,tt,{kind:"accessor",name:"timeout",static:!1,private:!1,access:{has:t=>"timeout"in t,get:t=>t.timeout,set:(t,i)=>{t.timeout=i}},metadata:e},Nt,Et),i(L,null,it,{kind:"accessor",name:"_hasDescriptionSlotContent",static:!1,private:!1,access:{has:t=>"_hasDescriptionSlotContent"in t,get:t=>t._hasDescriptionSlotContent,set:(t,i)=>{t._hasDescriptionSlotContent=i}},metadata:e},It,Lt),i(null,I={value:L},et,{kind:"class",name:L.name,metadata:e},null,at),L=I.value,e&&Object.defineProperty(L,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})})(),L.styles=c(y),e(L,at),L})();export{x as Notification};
|
|
556
566
|
//# sourceMappingURL=notification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","sources":["../../../../src/components/reusable/notification/notification.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport '../button';\nimport closeIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/close-simple.svg';\n\nimport NotificationScss from './notification.scss?inline';\nimport '../card';\nimport successIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/checkmark-filled.svg';\nimport warningIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/warning-filled.svg';\nimport errorIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/error-filled.svg';\nimport infoIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/information-filled.svg';\n\nimport '../badge';\n\ntype TagStatus = 'default' | 'info' | 'warning' | 'success' | 'error' | 'ai';\ntype NotificationType = 'normal' | 'inline' | 'toast' | 'clickable';\ntype CardType = 'normal' | 'clickable';\n\ninterface TextStrings {\n success: string;\n warning: string;\n info: string;\n error: string;\n ai?: string;\n default?: string;\n}\n\n/**\n * Notification component.\n * @slot unnamed - Slot for notification message body.\n * @slot actions - Slot for menu.\n * @slot icon - Slot for an icon.\n * @fires on-notification-click - Emit event for clickable notification.`detail:{ origEvent: PointerEvent }`\n * @fires on-close - Emits when an inline/toast notification closes.\n */\n\n@customElement('kyn-notification')\nexport class Notification extends LitElement {\n static override styles = unsafeCSS(NotificationScss);\n\n /** Notification Title (Required). */\n @property({ type: String })\n accessor notificationTitle = '';\n\n /** Notification subtitle.(optional) */\n @property({ type: String })\n accessor notificationSubtitle = '';\n\n /**\n * Timestamp of notification.\n * It is recommended to add the context along with the timestamp. Example: `Updated 2 mins ago`.\n */\n @property({ type: String })\n accessor timeStamp = '';\n\n /** Card href link. */\n @property({ type: String })\n accessor href = '';\n\n /** Card link target. */\n @property({ type: String })\n accessor target: '_self' | '_blank' | '_parent' | '_top' | '' = '';\n\n /** Notification status / tag type. `'default'`, `'info'`, `'warning'`, `'success'` & `'error'`. */\n @property({ type: String })\n accessor tagStatus: TagStatus = 'default'; // Need to change the name to badgeStatus, once old tags are removed.\n\n /** Notification type. `'normal'`, `'inline'`, `'toast'` and `'clickable'`. Clickable type can be use inside notification panel */\n @property({ type: String })\n accessor type: NotificationType = 'normal';\n\n /** Customizable text strings. */\n @property({ type: Object })\n accessor textStrings: TextStrings = {\n success: 'Success',\n warning: 'Warning',\n info: 'Information',\n error: 'Error',\n };\n\n /** Close button description (Required to support accessibility). */\n @property({ type: String })\n accessor closeBtnDescription = 'Close';\n\n /**\n * Assistive text for notification type.\n * Required for `'clickable'`, `'inline'` and `'toast'` notification types.\n * */\n @property({ type: String })\n accessor assistiveNotificationTypeText = '';\n\n /** Notification role (Required to support accessibility). */\n @property({ type: String })\n accessor notificationRole: 'alert' | 'log' | 'status' | undefined;\n\n /**\n * Status label (Required to support accessibility).\n * Assign the localized string value for the word **Status**.\n * */\n @property({ type: String })\n accessor statusLabel = 'Status';\n\n /** Set badgeColor based on provided tagStatus.\n * @internal\n */\n @state()\n accessor _badgeColor: any = {\n success: 'success',\n warning: 'warning',\n info: 'information',\n error: 'error',\n };\n\n /** Set notification mark read prop. Required ony for `type: 'clickable'`.*/\n @property({ type: Boolean, reflect: true })\n accessor unRead = false;\n\n /** Hide close (x) button. Useful only for `type='toast'`. This required `timeout > 0` otherwise toast remain as it is when `hideCloseButton` is set true. */\n @property({ type: Boolean })\n accessor hideCloseButton = false;\n\n /** Timeout (Default 8 seconds for Toast). Specify an optional duration the toast notification should be closed in. Only apply with `type = 'toast'` */\n @property({ type: Number })\n accessor timeout = 8;\n\n /** Track if slot has content to conditionally render description div\n * @internal\n */\n @state()\n accessor _hasDescriptionSlotContent = false;\n\n override render() {\n const cardBgClasses = {\n 'notification-normal': this.type === 'normal',\n 'notification-inline': this.type === 'inline',\n 'notification-toast': this.type === 'toast',\n 'notification-error':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'error',\n 'notification-success':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'success',\n 'notification-warning':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'warning',\n 'notification-info':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'info',\n 'notification-ai':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'ai',\n 'notification-default':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'default',\n 'notification-no-description': !this._hasDescriptionSlotContent,\n };\n\n const cardType: CardType =\n this.type === 'clickable' ? 'clickable' : 'normal';\n\n return html`\n ${this.type === 'clickable'\n ? html`<kyn-card\n class=\"notification-clickable\"\n ?highlight=${this.unRead}\n .type=${cardType}\n href=${ifDefined(this.href || undefined)}\n target=${ifDefined(this.target || undefined)}\n rel=${ifDefined(\n this.target === '_blank' ? 'noopener noreferrer' : undefined\n )}\n @on-card-click=${(e: any) => this._handleCardClick(e)}\n hideBorder\n role=${ifDefined(this.notificationRole)}\n >\n <span id=\"notificationType\"\n >${this.assistiveNotificationTypeText}</span\n >\n ${this.renderInnerUI()}\n </kyn-card>`\n : html` <kyn-card\n .type=${cardType}\n role=${ifDefined(this.notificationRole)}\n class=\"${classMap(cardBgClasses)}\"\n >\n ${this.type === 'inline' || this.type === 'toast'\n ? html`<span id=\"notificationType\"\n >${this.assistiveNotificationTypeText}</span\n >`\n : null}\n ${this.renderInnerUI()}\n </kyn-card>`}\n `;\n }\n\n private renderInnerUI() {\n const notificationIcon: any = {\n success: successIcon,\n error: errorIcon,\n warning: warningIcon,\n info: infoIcon,\n ai: successIcon,\n default: successIcon,\n };\n\n return html`<div class=\"notification-wrapper\">\n <div class=\"notification-title-wrap\">\n <div class=\"notification-head\">\n ${this.type === 'inline' || this.type === 'toast'\n ? html` <span\n class=\"notification-state-icon ${this.tagStatus}\"\n role=\"img\"\n aria-label=${`${this.textStrings[this.tagStatus]} icon`}\n >\n <slot name=\"icon\">\n ${unsafeSVG(notificationIcon[this.tagStatus])}\n </slot>\n </span>`\n : null}\n\n <div class=\"notification-title\">${this.notificationTitle}</div>\n\n ${this.notificationSubtitle !== '' &&\n (this.type === 'normal' || this.type === 'clickable')\n ? html`\n <div class=\"notification-subtitle\">\n ${this.notificationSubtitle}\n </div>\n `\n : null}\n </div>\n\n <div>\n ${(this.type === 'toast' || this.type === 'inline') &&\n !this.hideCloseButton\n ? html` <kyn-button\n class=\"notification-toast-close-btn\"\n kind=${this.tagStatus === 'ai' ? 'ghost-ai' : 'ghost'}\n size=\"small\"\n description=${ifDefined(this.closeBtnDescription)}\n @on-click=\"${() => this._handleClose()}\"\n >\n <span\n slot=\"icon\"\n role=\"img\"\n aria-label=${ifDefined(this.closeBtnDescription)}\n >${unsafeSVG(closeIcon)}</span\n >\n </kyn-button>`\n : null}\n <!-- actions slot could be an overflow menu, close icon (for other notification types) etc. -->\n <slot name=\"actions\"></slot>\n </div>\n </div>\n\n ${this._hasDescriptionSlotContent\n ? html`<div class=\"notification-description\">\n <slot @slotchange=\"${this._handleSlotChange}\"></slot>\n </div>`\n : html`<slot\n @slotchange=\"${this._handleSlotChange}\"\n style=\"display: none;\"\n ></slot>`}\n\n <div class=\"notification-content-wrapper\">\n <div class=\"status-tag\">\n ${this.tagStatus !== 'default' &&\n (this.type === 'normal' || this.type === 'clickable')\n ? html`\n <span id=\"statusLabel\">${this.statusLabel}</span>\n <kyn-badge\n type=${'heavy'}\n ?hideIcon=${true}\n label=${ifDefined(this.textStrings[this.tagStatus])}\n status=${this._badgeColor[this.tagStatus]}\n ></kyn-badge>\n `\n : null}\n </div>\n <div class=\"timestamp-wrapper\">\n <div class=\"timestamp-text\">${this.timeStamp}</div>\n </div>\n </div>\n </div>`;\n }\n\n override updated(changedProperties: any) {\n // Close toast notification if timeout > 0\n if (\n this.type === 'toast' &&\n changedProperties.has('timeout') &&\n this.timeout > 0\n ) {\n setTimeout(() => {\n this._close();\n }, this.timeout * 1000);\n }\n }\n\n // Remove toast from DOM\n private _close() {\n const animation = this.animate([{ opacity: '1' }, { opacity: '0' }], {\n duration: 500,\n easing: 'ease-in-out',\n fill: 'forwards',\n });\n animation.onfinish = () => {\n this.parentNode?.removeChild(this);\n };\n\n // emit on-close event\n const event = new CustomEvent('on-close');\n this.dispatchEvent(event);\n }\n\n private _handleClose() {\n this._close();\n }\n\n private _handleCardClick(e: any) {\n const event = new CustomEvent('on-notification-click', {\n detail: { origEvent: e.detail.origEvent },\n });\n this.dispatchEvent(event);\n }\n\n private _handleSlotChange() {\n this._checkSlotContent();\n }\n\n private _checkSlotContent() {\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name])'\n ) as HTMLSlotElement;\n if (!slot) {\n this._hasDescriptionSlotContent = false;\n return;\n }\n\n const assignedNodes = slot.assignedNodes();\n\n const hasContent = assignedNodes.some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n if (node.nodeType === Node.TEXT_NODE) {\n const textContent = node.textContent;\n return (\n textContent !== null &&\n textContent !== undefined &&\n textContent.trim() !== ''\n );\n }\n return false;\n });\n\n this._hasDescriptionSlotContent = hasContent;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-notification': Notification;\n }\n}\n"],"names":["Notification","customElement","LitElement","_classThis","_classSuper","notificationTitle","__classPrivateFieldGet","this","_Notification_notificationTitle_accessor_storage","value","__classPrivateFieldSet","notificationSubtitle","_Notification_notificationSubtitle_accessor_storage","timeStamp","_Notification_timeStamp_accessor_storage","href","_Notification_href_accessor_storage","target","_Notification_target_accessor_storage","tagStatus","_Notification_tagStatus_accessor_storage","type","_Notification_type_accessor_storage","textStrings","_Notification_textStrings_accessor_storage","closeBtnDescription","_Notification_closeBtnDescription_accessor_storage","assistiveNotificationTypeText","_Notification_assistiveNotificationTypeText_accessor_storage","notificationRole","_Notification_notificationRole_accessor_storage","statusLabel","_Notification_statusLabel_accessor_storage","_badgeColor","_Notification__badgeColor_accessor_storage","unRead","_Notification_unRead_accessor_storage","hideCloseButton","_Notification_hideCloseButton_accessor_storage","timeout","_Notification_timeout_accessor_storage","_hasDescriptionSlotContent","_Notification__hasDescriptionSlotContent_accessor_storage","render","cardBgClasses","cardType","html","ifDefined","undefined","e","_handleCardClick","renderInnerUI","classMap","notificationIcon","success","successIcon","error","errorIcon","warning","warningIcon","info","infoIcon","ai","default","unsafeSVG","_handleClose","closeIcon","_handleSlotChange","updated","changedProperties","has","setTimeout","_close","animate","opacity","duration","easing","fill","onfinish","_a","parentNode","removeChild","event","CustomEvent","dispatchEvent","detail","origEvent","_checkSlotContent","slot","shadowRoot","querySelector","hasContent","assignedNodes","some","node","nodeType","Node","ELEMENT_NODE","TEXT_NODE","textContent","trim","set","__runInitializers","_notificationTitle_initializers","_notificationTitle_extraInitializers","_notificationSubtitle_initializers","_notificationSubtitle_extraInitializers","_timeStamp_initializers","_timeStamp_extraInitializers","_href_initializers","_href_extraInitializers","_target_initializers","_target_extraInitializers","_tagStatus_initializers","_tagStatus_extraInitializers","_type_initializers","_type_extraInitializers","_textStrings_initializers","_textStrings_extraInitializers","_closeBtnDescription_initializers","_closeBtnDescription_extraInitializers","_assistiveNotificationTypeText_initializers","_assistiveNotificationTypeText_extraInitializers","_notificationRole_initializers","_notificationRole_extraInitializers","_statusLabel_initializers","_statusLabel_extraInitializers","__badgeColor_initializers","__badgeColor_extraInitializers","_unRead_initializers","_unRead_extraInitializers","_hideCloseButton_initializers","_hideCloseButton_extraInitializers","_timeout_initializers","_timeout_extraInitializers","__hasDescriptionSlotContent_initializers","_notificationTitle_decorators","property","String","_notificationSubtitle_decorators","_timeStamp_decorators","_href_decorators","_target_decorators","_tagStatus_decorators","_type_decorators","_textStrings_decorators","Object","_closeBtnDescription_decorators","_assistiveNotificationTypeText_decorators","_notificationRole_decorators","_statusLabel_decorators","__badgeColor_decorators","state","Boolean","reflect","_hideCloseButton_decorators","_timeout_decorators","Number","__hasDescriptionSlotContent_decorators","__esDecorate","kind","name","static","private","access","obj","get","metadata","_metadata","_unRead_decorators","__hasDescriptionSlotContent_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","NotificationScss"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GADxB1E,EAAAnG,EAAA0K,OAAY"}
|
|
1
|
+
{"version":3,"file":"notification.js","sources":["../../../../src/components/reusable/notification/notification.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport '../button';\nimport closeIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/close-simple.svg';\n\nimport NotificationScss from './notification.scss?inline';\nimport '../card';\nimport successIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/checkmark-filled.svg';\nimport warningIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/warning-filled.svg';\nimport errorIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/error-filled.svg';\nimport infoIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/information-filled.svg';\n\nimport '../badge';\n\ntype TagStatus = 'default' | 'info' | 'warning' | 'success' | 'error' | 'ai';\ntype NotificationType = 'normal' | 'inline' | 'toast' | 'clickable';\ntype CardType = 'normal' | 'clickable';\n\ninterface TextStrings {\n success: string;\n warning: string;\n info: string;\n error: string;\n ai?: string;\n default?: string;\n}\n\n/**\n * Notification component.\n * @slot unnamed - Slot for notification message body.\n * @slot actions - Slot for menu.\n * @slot icon - Slot for an icon.\n * @fires on-notification-click - Emit event for clickable notification.`detail:{ origEvent: PointerEvent }`\n * @fires on-close - Emits when an inline/toast notification closes.\n */\n\n@customElement('kyn-notification')\nexport class Notification extends LitElement {\n static override styles = unsafeCSS(NotificationScss);\n\n /** Notification Title (Required). */\n @property({ type: String })\n accessor notificationTitle = '';\n\n /** Notification subtitle.(optional) */\n @property({ type: String })\n accessor notificationSubtitle = '';\n\n /**\n * Timestamp of notification.\n * It is recommended to add the context along with the timestamp. Example: `Updated 2 mins ago`.\n */\n @property({ type: String })\n accessor timeStamp = '';\n\n /** Card href link. */\n @property({ type: String })\n accessor href = '';\n\n /** Card link target. */\n @property({ type: String })\n accessor target: '_self' | '_blank' | '_parent' | '_top' | '' = '';\n\n /** Notification status / tag type. `'default'`, `'info'`, `'warning'`, `'success'` & `'error'`. */\n @property({ type: String })\n accessor tagStatus: TagStatus = 'default'; // Need to change the name to badgeStatus, once old tags are removed.\n\n /** Notification type. `'normal'`, `'inline'`, `'toast'` and `'clickable'`. Clickable type can be use inside notification panel */\n @property({ type: String })\n accessor type: NotificationType = 'normal';\n\n /** Customizable text strings. */\n @property({ type: Object })\n accessor textStrings: TextStrings = {\n success: 'Success',\n warning: 'Warning',\n info: 'Information',\n error: 'Error',\n };\n\n /** Close button description (Required to support accessibility). */\n @property({ type: String })\n accessor closeBtnDescription = 'Close';\n\n /**\n * Assistive text for notification type.\n * Required for `'clickable'`, `'inline'` and `'toast'` notification types.\n * */\n @property({ type: String })\n accessor assistiveNotificationTypeText = '';\n\n /** Notification role (Required to support accessibility). */\n @property({ type: String })\n accessor notificationRole: 'alert' | 'log' | 'status' | undefined;\n\n /**\n * Status label (Required to support accessibility).\n * Assign the localized string value for the word **Status**.\n * */\n @property({ type: String })\n accessor statusLabel = 'Status';\n\n /** Set badgeColor based on provided tagStatus.\n * @internal\n */\n @state()\n accessor _badgeColor: any = {\n success: 'success',\n warning: 'warning',\n info: 'information',\n error: 'error',\n };\n\n /** Set notification unread state. Applies to `type: 'normal'` and `type: 'clickable'`. */\n @property({ type: Boolean, reflect: true })\n accessor unRead = false;\n\n /** Hide close (x) button. Useful only for `type='toast'`. This required `timeout > 0` otherwise toast remain as it is when `hideCloseButton` is set true. */\n @property({ type: Boolean })\n accessor hideCloseButton = false;\n\n /** Timeout (Default 8 seconds for Toast). Specify an optional duration the toast notification should be closed in. Only apply with `type = 'toast'` */\n @property({ type: Number })\n accessor timeout = 8;\n\n /** Track if slot has content to conditionally render description div\n * @internal\n */\n @state()\n accessor _hasDescriptionSlotContent = false;\n\n override render() {\n const cardBgClasses = {\n 'notification-normal': this.type === 'normal',\n 'notification-inline': this.type === 'inline',\n 'notification-toast': this.type === 'toast',\n 'notification-error':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'error',\n 'notification-success':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'success',\n 'notification-warning':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'warning',\n 'notification-info':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'info',\n 'notification-ai':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'ai',\n 'notification-default':\n (this.type === 'inline' || this.type === 'toast') &&\n this.tagStatus === 'default',\n 'notification-no-description': !this._hasDescriptionSlotContent,\n 'notification-read':\n (this.type === 'normal' || this.type === 'clickable') && !this.unRead,\n 'notification-unread':\n (this.type === 'normal' || this.type === 'clickable') && this.unRead,\n };\n\n const cardType: CardType =\n this.type === 'clickable' ? 'clickable' : 'normal';\n\n return html`\n ${this.type === 'clickable'\n ? html`<kyn-card\n class=${classMap({\n ...cardBgClasses,\n 'notification-clickable': true,\n })}\n .type=${cardType}\n href=${ifDefined(this.href || undefined)}\n target=${ifDefined(this.target || undefined)}\n rel=${ifDefined(\n this.target === '_blank' ? 'noopener noreferrer' : undefined\n )}\n @on-card-click=${(e: any) => this._handleCardClick(e)}\n hideBorder\n role=${ifDefined(this.notificationRole)}\n >\n <span id=\"notificationType\"\n >${this.assistiveNotificationTypeText}</span\n >\n ${this.renderInnerUI()}\n </kyn-card>`\n : html` <kyn-card\n .type=${cardType}\n role=${ifDefined(this.notificationRole)}\n class=${classMap(cardBgClasses)}\n >\n ${this.type === 'inline' || this.type === 'toast'\n ? html`<span id=\"notificationType\"\n >${this.assistiveNotificationTypeText}</span\n >`\n : null}\n ${this.renderInnerUI()}\n </kyn-card>`}\n `;\n }\n\n private renderInnerUI() {\n const notificationIcon: any = {\n success: successIcon,\n error: errorIcon,\n warning: warningIcon,\n info: infoIcon,\n ai: successIcon,\n default: successIcon,\n };\n\n return html`<div class=\"notification-wrapper\">\n <div class=\"notification-title-wrap\">\n <div class=\"notification-head\">\n ${this.type === 'inline' || this.type === 'toast'\n ? html` <span\n class=\"notification-state-icon ${this.tagStatus}\"\n role=\"img\"\n aria-label=${`${this.textStrings[this.tagStatus]} icon`}\n >\n <slot name=\"icon\">\n ${unsafeSVG(notificationIcon[this.tagStatus])}\n </slot>\n </span>`\n : null}\n\n <div class=\"notification-title\">${this.notificationTitle}</div>\n\n ${this.notificationSubtitle !== '' &&\n (this.type === 'normal' || this.type === 'clickable')\n ? html`\n <div class=\"notification-subtitle\">\n ${this.notificationSubtitle}\n </div>\n `\n : null}\n </div>\n\n <div>\n ${(this.type === 'toast' || this.type === 'inline') &&\n !this.hideCloseButton\n ? html` <kyn-button\n class=\"notification-toast-close-btn\"\n kind=${this.tagStatus === 'ai' ? 'ghost-ai' : 'ghost'}\n size=\"small\"\n description=${ifDefined(this.closeBtnDescription)}\n @on-click=\"${() => this._handleClose()}\"\n >\n <span\n slot=\"icon\"\n role=\"img\"\n aria-label=${ifDefined(this.closeBtnDescription)}\n >${unsafeSVG(closeIcon)}</span\n >\n </kyn-button>`\n : null}\n <!-- actions slot could be an overflow menu, close icon (for other notification types) etc. -->\n <slot name=\"actions\"></slot>\n </div>\n </div>\n\n ${this._hasDescriptionSlotContent\n ? html`<div class=\"notification-description\">\n <slot @slotchange=\"${this._handleSlotChange}\"></slot>\n </div>`\n : html`<slot\n @slotchange=\"${this._handleSlotChange}\"\n style=\"display: none;\"\n ></slot>`}\n\n <div class=\"notification-content-wrapper\">\n <div class=\"status-tag\">\n ${this.tagStatus !== 'default' &&\n (this.type === 'normal' || this.type === 'clickable')\n ? html`\n <span id=\"statusLabel\">${this.statusLabel}</span>\n <kyn-badge\n type=${'heavy'}\n ?hideIcon=${true}\n label=${ifDefined(this.textStrings[this.tagStatus])}\n status=${this._badgeColor[this.tagStatus]}\n ></kyn-badge>\n `\n : null}\n </div>\n <div class=\"timestamp-wrapper\">\n <div class=\"timestamp-text\">${this.timeStamp}</div>\n </div>\n </div>\n </div>`;\n }\n\n override updated(changedProperties: any) {\n // Close toast notification if timeout > 0\n if (\n this.type === 'toast' &&\n changedProperties.has('timeout') &&\n this.timeout > 0\n ) {\n setTimeout(() => {\n this._close();\n }, this.timeout * 1000);\n }\n }\n\n // Remove toast from DOM\n private _close() {\n const animation = this.animate([{ opacity: '1' }, { opacity: '0' }], {\n duration: 500,\n easing: 'ease-in-out',\n fill: 'forwards',\n });\n animation.onfinish = () => {\n this.parentNode?.removeChild(this);\n };\n\n // emit on-close event\n const event = new CustomEvent('on-close');\n this.dispatchEvent(event);\n }\n\n private _handleClose() {\n this._close();\n }\n\n private _handleCardClick(e: any) {\n const event = new CustomEvent('on-notification-click', {\n detail: { origEvent: e.detail.origEvent },\n });\n this.dispatchEvent(event);\n }\n\n private _handleSlotChange() {\n this._checkSlotContent();\n }\n\n private _checkSlotContent() {\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name])'\n ) as HTMLSlotElement;\n if (!slot) {\n this._hasDescriptionSlotContent = false;\n return;\n }\n\n const assignedNodes = slot.assignedNodes();\n\n const hasContent = assignedNodes.some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n if (node.nodeType === Node.TEXT_NODE) {\n const textContent = node.textContent;\n return (\n textContent !== null &&\n textContent !== undefined &&\n textContent.trim() !== ''\n );\n }\n return false;\n });\n\n this._hasDescriptionSlotContent = hasContent;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-notification': Notification;\n }\n}\n"],"names":["Notification","customElement","LitElement","_classThis","_classSuper","notificationTitle","__classPrivateFieldGet","this","_Notification_notificationTitle_accessor_storage","value","__classPrivateFieldSet","notificationSubtitle","_Notification_notificationSubtitle_accessor_storage","timeStamp","_Notification_timeStamp_accessor_storage","href","_Notification_href_accessor_storage","target","_Notification_target_accessor_storage","tagStatus","_Notification_tagStatus_accessor_storage","type","_Notification_type_accessor_storage","textStrings","_Notification_textStrings_accessor_storage","closeBtnDescription","_Notification_closeBtnDescription_accessor_storage","assistiveNotificationTypeText","_Notification_assistiveNotificationTypeText_accessor_storage","notificationRole","_Notification_notificationRole_accessor_storage","statusLabel","_Notification_statusLabel_accessor_storage","_badgeColor","_Notification__badgeColor_accessor_storage","unRead","_Notification_unRead_accessor_storage","hideCloseButton","_Notification_hideCloseButton_accessor_storage","timeout","_Notification_timeout_accessor_storage","_hasDescriptionSlotContent","_Notification__hasDescriptionSlotContent_accessor_storage","render","cardBgClasses","cardType","html","classMap","ifDefined","undefined","e","_handleCardClick","renderInnerUI","notificationIcon","success","successIcon","error","errorIcon","warning","warningIcon","info","infoIcon","ai","default","unsafeSVG","_handleClose","closeIcon","_handleSlotChange","updated","changedProperties","has","setTimeout","_close","animate","opacity","duration","easing","fill","onfinish","_a","parentNode","removeChild","event","CustomEvent","dispatchEvent","detail","origEvent","_checkSlotContent","slot","shadowRoot","querySelector","hasContent","assignedNodes","some","node","nodeType","Node","ELEMENT_NODE","TEXT_NODE","textContent","trim","set","__runInitializers","_notificationTitle_initializers","_notificationTitle_extraInitializers","_notificationSubtitle_initializers","_notificationSubtitle_extraInitializers","_timeStamp_initializers","_timeStamp_extraInitializers","_href_initializers","_href_extraInitializers","_target_initializers","_target_extraInitializers","_tagStatus_initializers","_tagStatus_extraInitializers","_type_initializers","_type_extraInitializers","_textStrings_initializers","_textStrings_extraInitializers","_closeBtnDescription_initializers","_closeBtnDescription_extraInitializers","_assistiveNotificationTypeText_initializers","_assistiveNotificationTypeText_extraInitializers","_notificationRole_initializers","_notificationRole_extraInitializers","_statusLabel_initializers","_statusLabel_extraInitializers","__badgeColor_initializers","__badgeColor_extraInitializers","_unRead_initializers","_unRead_extraInitializers","_hideCloseButton_initializers","_hideCloseButton_extraInitializers","_timeout_initializers","_timeout_extraInitializers","__hasDescriptionSlotContent_initializers","_notificationTitle_decorators","property","String","_notificationSubtitle_decorators","_timeStamp_decorators","_href_decorators","_target_decorators","_tagStatus_decorators","_type_decorators","_textStrings_decorators","Object","_closeBtnDescription_decorators","_assistiveNotificationTypeText_decorators","_notificationRole_decorators","_statusLabel_decorators","__badgeColor_decorators","state","Boolean","reflect","_hideCloseButton_decorators","_timeout_decorators","Number","__hasDescriptionSlotContent_decorators","__esDecorate","kind","name","static","private","access","obj","get","metadata","_metadata","_unRead_decorators","__hasDescriptionSlotContent_extraInitializers","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","NotificationScss"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCaA,EAAY,4FADxBC,EAAc,8BACmBC,qNAARC,EAAA,cAAQC,GAKhC,qBAASC,GAAiB,OAAAC,EAAAC,KAAAC,EAAA,IAAA,CAA1B,qBAASH,CAAiBI,GAAAC,EAAAH,KAAAC,EAAAC,EAAA,IAAA,CAI1B,wBAASE,GAAoB,OAAAL,EAAAC,KAAAK,EAAA,IAAA,CAA7B,wBAASD,CAAoBF,GAAAC,EAAAH,KAAAK,EAAAH,EAAA,IAAA,CAO7B,aAASI,GAAS,OAAAP,EAAAC,KA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;IAEH,QAAQ,CAAC,WAAW,SAAM;IAE1B;;OAEG;IAEH,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAa;IAE5D;;;OAGG;IAEH,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/C,OAAO,CAAC,GAAG,CAAiC;IAE5C,4CAA4C;IAC5C,OAAO,KAAK,UAAU,GAIrB;IACD,OAAO,KAAK,UAAU,GAErB;IAEQ,iBAAiB,IAAI,IAAI;IAYzB,oBAAoB,IAAI,IAAI;IAM5B,MAAM;IA6DN,YAAY;IAwBrB,OAAO,CAAC,WAAW;IAiCnB,OAAO,CAAC,aAAa;IA0CrB,OAAO,CAAC,aAAa;CAgCtB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,gBAAgB,CAAC;KAC5C;CACF"}
|
|
@@ -312,6 +312,9 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as n,__classPr
|
|
|
312
312
|
text-overflow: ellipsis;
|
|
313
313
|
transition: background-color 0.15s ease-out, outline-color 0.15s ease-out;
|
|
314
314
|
}
|
|
315
|
+
.overflow-menu-item.has-submenu {
|
|
316
|
+
padding-right: 30px;
|
|
317
|
+
}
|
|
315
318
|
|
|
316
319
|
.sr-only {
|
|
317
320
|
border: 0;
|
|
@@ -335,7 +338,7 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as n,__classPr
|
|
|
335
338
|
width: 16px;
|
|
336
339
|
height: 16px;
|
|
337
340
|
pointer-events: none;
|
|
338
|
-
}`;let p=(()=>{var d,p,k,g,y,f,w,x,_
|
|
341
|
+
}`;let p=(()=>{var d,p,k,g,y,f,w,x,T,_;let S,M,$,E,O,I,q,W,C,j,N,R,A=[c("kyn-overflow-menu-item")],D=[],L=a,K=[],B=[],F=[],H=[],P=[],U=[],X=[],z=[],Y=[],G=[],J=[],Q=[],V=[],Z=[],ee=[],te=[],ne=[],oe=[],ie=[],de=[];return M=class extends L{constructor(){super(...arguments),d.set(this,n(this,K,"")),p.set(this,(n(this,B),n(this,F,!1))),k.set(this,(n(this,H),n(this,P,!1))),g.set(this,(n(this,U),n(this,X,""))),y.set(this,(n(this,z),n(this,Y,[]))),f.set(this,(n(this,G),n(this,J,null))),w.set(this,(n(this,Q),n(this,V,!1))),x.set(this,(n(this,Z),n(this,ee,""))),T.set(this,(n(this,te),n(this,ne,"default"))),_.set(this,(n(this,oe),n(this,ie,void 0))),this._mo=(n(this,de),null)}get href(){return o(this,d,"f")}set href(e){i(this,d,e,"f")}get destructive(){return o(this,p,"f")}set destructive(e){i(this,p,e,"f")}get disabled(){return o(this,k,"f")}set disabled(e){i(this,k,e,"f")}get description(){return o(this,g,"f")}set description(e){i(this,g,e,"f")}get _menuItems(){return o(this,y,"f")}set _menuItems(e){i(this,y,e,"f")}get _menu(){return o(this,f,"f")}set _menu(e){i(this,f,e,"f")}get isTruncated(){return o(this,w,"f")}set isTruncated(e){i(this,w,e,"f")}get tooltipText(){return o(this,x,"f")}set tooltipText(e){i(this,x,e,"f")}get kind(){return o(this,T,"f")}set kind(e){i(this,T,e,"f")}get _submenuOpenTimer(){return o(this,_,"f")}set _submenuOpenTimer(e){i(this,_,e,"f")}get submenuEls(){return Array.from(this.querySelectorAll(':scope > [slot="submenu"]'))}get hasSubmenu(){return this.submenuEls.length>0}connectedCallback(){super.connectedCallback(),this._mo=new MutationObserver((()=>this.requestUpdate())),this._mo.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){var e;null===(e=this._mo)||void 0===e||e.disconnect(),this._mo=null,super.disconnectedCallback()}render(){const e={"overflow-menu-item":!0,"menu-item":!0,"ai-connected":"ai"===this.kind,destructive:this.destructive,"has-submenu":this.hasSubmenu},t=this.isTruncated?this.tooltipText:"";return""!==this.href?s`
|
|
339
342
|
<a
|
|
340
343
|
class=${m(e)}
|
|
341
344
|
href=${this.href}
|
|
@@ -370,5 +373,5 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as n,__classPr
|
|
|
370
373
|
${v(h)}
|
|
371
374
|
</span>`:null}
|
|
372
375
|
</button>
|
|
373
|
-
`}firstUpdated(){const e=this.closest("kyn-overflow-menu");e&&(this._menuItems=e.getMenuItems?e.getMenuItems():[],this._menu=e.getMenu?e.getMenu():null,"string"==typeof e.kind&&(this.kind=e.kind),e.addEventListener("kind-changed",(e=>{const t=e;requestAnimationFrame((()=>{this.kind=t.detail}))}))),this.checkOverflow()}handleClick(e){var t;const n=this.querySelector(':scope > [slot="submenu"]:not(kyn-overflow-menu-item)'),o=Array.from(this.querySelectorAll(':scope > kyn-overflow-menu-item[slot="submenu"]'));if(this.hasSubmenu){e.stopPropagation();const i=null!==(t=null==n?void 0:n.innerHTML)&&void 0!==t?t:o.map((e=>e.outerHTML)).join("");this.dispatchEvent(new CustomEvent("open-submenu",{detail:{html:i},bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent("on-click",{detail:{origEvent:e},bubbles:!0,composed:!0}))}handleKeyDown(e){var t,n,o,i,d,a,r,s;const c=this._menuItems,l=this.getRootNode().activeElement,u=c.findIndex((e=>{if(e===l)return!0;const t=e.shadowRoot;return!!(t&&l&&t.contains(l))}));switch(e.keyCode){case 40:if(u<c.length-1&&u>=0){const e=c[u+1],i=null===(t=e.shadowRoot)||void 0===t?void 0:t.querySelector("button"),d=null===(n=e.shadowRoot)||void 0===n?void 0:n.querySelector("a");null===(o=null!=i?i:d)||void 0===o||o.focus()}return;case 38:if(u>0){const e=c[u-1],t=null===(i=e.shadowRoot)||void 0===i?void 0:i.querySelector("button"),n=null===(d=e.shadowRoot)||void 0===d?void 0:d.querySelector("a");null===(a=null!=t?t:n)||void 0===a||a.focus()}else 0===u&&(null===(s=null===(r=this._menu)||void 0===r?void 0:r.querySelector("button"))||void 0===s||s.focus());return;default:return}}checkOverflow(){var e,t;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("button, a");n&&(this.isTruncated=n.scrollWidth>n.offsetWidth,this.isTruncated
|
|
376
|
+
`}firstUpdated(){const e=this.closest("kyn-overflow-menu");e&&(this._menuItems=e.getMenuItems?e.getMenuItems():[],this._menu=e.getMenu?e.getMenu():null,"string"==typeof e.kind&&(this.kind=e.kind),e.addEventListener("kind-changed",(e=>{const t=e;requestAnimationFrame((()=>{this.kind=t.detail}))}))),this.checkOverflow()}handleClick(e){var t;const n=this.querySelector(':scope > [slot="submenu"]:not(kyn-overflow-menu-item)'),o=Array.from(this.querySelectorAll(':scope > kyn-overflow-menu-item[slot="submenu"]'));if(this.hasSubmenu){e.stopPropagation();const i=null!==(t=null==n?void 0:n.innerHTML)&&void 0!==t?t:o.map((e=>e.outerHTML)).join("");this.dispatchEvent(new CustomEvent("open-submenu",{detail:{html:i},bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent("on-click",{detail:{origEvent:e},bubbles:!0,composed:!0}))}handleKeyDown(e){var t,n,o,i,d,a,r,s;const c=this._menuItems,l=this.getRootNode().activeElement,u=c.findIndex((e=>{if(e===l)return!0;const t=e.shadowRoot;return!!(t&&l&&t.contains(l))}));switch(e.keyCode){case 40:if(u<c.length-1&&u>=0){const e=c[u+1],i=null===(t=e.shadowRoot)||void 0===t?void 0:t.querySelector("button"),d=null===(n=e.shadowRoot)||void 0===n?void 0:n.querySelector("a");null===(o=null!=i?i:d)||void 0===o||o.focus()}return;case 38:if(u>0){const e=c[u-1],t=null===(i=e.shadowRoot)||void 0===i?void 0:i.querySelector("button"),n=null===(d=e.shadowRoot)||void 0===d?void 0:d.querySelector("a");null===(a=null!=t?t:n)||void 0===a||a.focus()}else 0===u&&(null===(s=null===(r=this._menu)||void 0===r?void 0:r.querySelector("button"))||void 0===s||s.focus());return;default:return}}checkOverflow(){var e,t;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("button, a");if(n&&(this.isTruncated=n.scrollWidth>n.offsetWidth,this.isTruncated)){const e=(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".text slot")).assignedNodes({flatten:!1}).filter((e=>e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE&&!e.hasAttribute("slot"))).map((e=>e.nodeType===Node.TEXT_NODE?e.textContent||"":e.innerText||"")).join("").trim();this.tooltipText=e}}},d=new WeakMap,p=new WeakMap,k=new WeakMap,g=new WeakMap,y=new WeakMap,f=new WeakMap,w=new WeakMap,x=new WeakMap,T=new WeakMap,_=new WeakMap,e(M,"OverflowMenuItem"),(()=>{var e;const n="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=L[Symbol.metadata])&&void 0!==e?e:null):void 0;$=[l({type:String})],E=[l({type:Boolean})],O=[l({type:Boolean})],I=[l({type:String})],q=[u()],W=[u()],C=[u()],j=[u()],N=[l({type:String,reflect:!0})],R=[u()],t(M,null,$,{kind:"accessor",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:n},K,B),t(M,null,E,{kind:"accessor",name:"destructive",static:!1,private:!1,access:{has:e=>"destructive"in e,get:e=>e.destructive,set:(e,t)=>{e.destructive=t}},metadata:n},F,H),t(M,null,O,{kind:"accessor",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:n},P,U),t(M,null,I,{kind:"accessor",name:"description",static:!1,private:!1,access:{has:e=>"description"in e,get:e=>e.description,set:(e,t)=>{e.description=t}},metadata:n},X,z),t(M,null,q,{kind:"accessor",name:"_menuItems",static:!1,private:!1,access:{has:e=>"_menuItems"in e,get:e=>e._menuItems,set:(e,t)=>{e._menuItems=t}},metadata:n},Y,G),t(M,null,W,{kind:"accessor",name:"_menu",static:!1,private:!1,access:{has:e=>"_menu"in e,get:e=>e._menu,set:(e,t)=>{e._menu=t}},metadata:n},J,Q),t(M,null,C,{kind:"accessor",name:"isTruncated",static:!1,private:!1,access:{has:e=>"isTruncated"in e,get:e=>e.isTruncated,set:(e,t)=>{e.isTruncated=t}},metadata:n},V,Z),t(M,null,j,{kind:"accessor",name:"tooltipText",static:!1,private:!1,access:{has:e=>"tooltipText"in e,get:e=>e.tooltipText,set:(e,t)=>{e.tooltipText=t}},metadata:n},ee,te),t(M,null,N,{kind:"accessor",name:"kind",static:!1,private:!1,access:{has:e=>"kind"in e,get:e=>e.kind,set:(e,t)=>{e.kind=t}},metadata:n},ne,oe),t(M,null,R,{kind:"accessor",name:"_submenuOpenTimer",static:!1,private:!1,access:{has:e=>"_submenuOpenTimer"in e,get:e=>e._submenuOpenTimer,set:(e,t)=>{e._submenuOpenTimer=t}},metadata:n},ie,de),t(null,S={value:M},A,{kind:"class",name:M.name,metadata:n},null,D),M=S.value,n&&Object.defineProperty(M,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),M.styles=r(b),n(M,D),M})();export{p as OverflowMenuItem};
|
|
374
377
|
//# sourceMappingURL=overflowMenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overflowMenuItem.js","sources":["../../../../src/components/reusable/overflowMenu/overflowMenuItem.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport SCSS from './overflowMenuItem.scss?inline';\nimport '../tooltip';\nimport chevronRightIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/chevron-right.svg';\n\n/**\n * Overflow Menu Item.\n * @fires on-click - Captures the click event and emits the original event details.`detail:{ origEvent: PointerEvent }`\n * @slot unnamed - Slot for menu item text.\n * @slot submenu - Provide a nested submenu's markup here (light DOM). Presence auto-detects nesting.\n * @prop {'ai'|'default'|string} kind - Visual variant inherited from parent menu.\n */\n@customElement('kyn-overflow-menu-item')\nexport class OverflowMenuItem extends LitElement {\n static override styles = unsafeCSS(SCSS);\n\n /** Makes the item a link. */\n @property({ type: String })\n accessor href = '';\n\n /** Adds destructive styles. */\n @property({ type: Boolean })\n accessor destructive = false;\n\n /** Item disabled state. */\n @property({ type: Boolean })\n accessor disabled = false;\n\n /** Item description text for screen readers. */\n @property({ type: String })\n accessor description = '';\n\n /**\n * Has the menu items in the current oveflow menu.\n * @ignore\n */\n @state()\n accessor _menuItems: HTMLElement[] = [];\n\n /**\n * Has the current oveflow menu.\n * @ignore\n */\n @state()\n accessor _menu: HTMLElement | null = null;\n\n /**\n * Tracks if the item content is overflowing and needs a tooltip.\n * @ignore\n */\n @state()\n accessor isTruncated = false;\n\n /** Holds the text content for the title tooltip.\n * @ignore\n */\n @state()\n accessor tooltipText = '';\n\n /** Kind of the item, derived from parent.\n * @ignore\n */\n @property({ type: String, reflect: true })\n accessor kind: 'ai' | 'default' | (string & {}) = 'default';\n\n /**\n * Timer id used to debounce opening of nested submenu on hover/focus.\n * @ignore\n */\n @state()\n accessor _submenuOpenTimer: number | undefined;\n\n private _mo: MutationObserver | null = null;\n\n /** True when a light-DOM submenu exists. */\n private get submenuEls(): HTMLElement[] {\n return Array.from(\n this.querySelectorAll<HTMLElement>(':scope > [slot=\"submenu\"]')\n );\n }\n private get hasSubmenu(): boolean {\n return this.submenuEls.length > 0;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Observe for submenu add/remove or slot attr changes and re-render.\n this._mo = new MutationObserver(() => this.requestUpdate());\n this._mo.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n override disconnectedCallback(): void {\n this._mo?.disconnect();\n this._mo = null;\n super.disconnectedCallback();\n }\n\n override render() {\n const classes = {\n 'overflow-menu-item': true,\n 'menu-item': true,\n 'ai-connected': this.kind === 'ai',\n destructive: this.destructive,\n };\n\n const itemText = this.isTruncated ? this.tooltipText : '';\n\n if (this.href !== '') {\n return html`\n <a\n class=${classMap(classes)}\n href=${this.href}\n ?disabled=${this.disabled}\n @click=${(e: Event) => this.handleClick(e)}\n @keydown=${(e: KeyboardEvent) => this.handleKeyDown(e)}\n title=${itemText}\n >\n <span class=\"menu-item-inner-el text\"><slot></slot></span>\n ${this.destructive\n ? html`<span class=\"sr-only\">${this.description}</span>`\n : null}\n ${this.hasSubmenu\n ? html`<span\n class=\"menu-item-inner-el submenu-arrow\"\n aria-hidden=\"true\"\n >\n ${unsafeSVG(chevronRightIcon)}\n </span>`\n : null}\n </a>\n `;\n }\n\n return html`\n <button\n class=${classMap(classes)}\n ?disabled=${this.disabled}\n @click=${(e: Event) => this.handleClick(e)}\n @keydown=${(e: KeyboardEvent) => this.handleKeyDown(e)}\n title=${itemText}\n >\n <span class=\"menu-item-inner-el text\"><slot></slot></span>\n ${this.destructive\n ? html`<span class=\"sr-only\">${this.description}</span>`\n : null}\n ${this.hasSubmenu\n ? html`<span\n class=\"menu-item-inner-el submenu-arrow\"\n aria-hidden=\"true\"\n >\n ${unsafeSVG(chevronRightIcon)}\n </span>`\n : null}\n </button>\n `;\n }\n\n override firstUpdated() {\n const parent = this.closest('kyn-overflow-menu') as\n | (HTMLElement & {\n getMenuItems?: () => HTMLElement[];\n getMenu?: () => HTMLElement;\n kind?: string;\n })\n | null;\n\n if (parent) {\n this._menuItems = parent.getMenuItems ? parent.getMenuItems() : [];\n this._menu = parent.getMenu ? parent.getMenu() : null;\n if (typeof parent.kind === 'string') this.kind = parent.kind as any;\n\n parent.addEventListener('kind-changed', (e: Event) => {\n const customEvent = e as CustomEvent<'ai' | 'default' | (string & {})>;\n requestAnimationFrame(() => {\n this.kind = customEvent.detail;\n });\n });\n }\n\n this.checkOverflow();\n }\n\n private handleClick(e: Event) {\n const wrapper = this.querySelector<HTMLElement>(\n ':scope > [slot=\"submenu\"]:not(kyn-overflow-menu-item)'\n );\n const directItems = Array.from(\n this.querySelectorAll<HTMLElement>(\n ':scope > kyn-overflow-menu-item[slot=\"submenu\"]'\n )\n );\n\n if (this.hasSubmenu) {\n e.stopPropagation();\n const html =\n wrapper?.innerHTML ?? directItems.map((el) => el.outerHTML).join('');\n this.dispatchEvent(\n new CustomEvent('open-submenu', {\n detail: { html },\n bubbles: true,\n composed: true,\n })\n );\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('on-click', {\n detail: { origEvent: e },\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private handleKeyDown(e: KeyboardEvent) {\n const DOWN = 40;\n const UP = 38;\n\n const items = this._menuItems;\n const activeEl = (this.getRootNode() as Document | ShadowRoot)\n .activeElement as Element | null;\n\n const idx = items.findIndex((item) => {\n if (item === activeEl) return true;\n const sr = (item as HTMLElement).shadowRoot;\n return !!(sr && activeEl && sr.contains(activeEl));\n });\n\n switch (e.keyCode) {\n case DOWN: {\n if (idx < items.length - 1 && idx >= 0) {\n const next = items[idx + 1];\n const btn =\n next.shadowRoot?.querySelector<HTMLButtonElement>('button');\n const anchor = next.shadowRoot?.querySelector<HTMLAnchorElement>('a');\n (btn ?? anchor)?.focus();\n }\n return;\n }\n case UP: {\n if (idx > 0) {\n const prev = items[idx - 1];\n const btn =\n prev.shadowRoot?.querySelector<HTMLButtonElement>('button');\n const anchor = prev.shadowRoot?.querySelector<HTMLAnchorElement>('a');\n (btn ?? anchor)?.focus();\n } else if (idx === 0) {\n this._menu?.querySelector<HTMLButtonElement>('button')?.focus();\n }\n return;\n }\n default:\n return;\n }\n }\n\n private checkOverflow() {\n const contentElement =\n this.shadowRoot?.querySelector<HTMLElement>('button, a');\n if (contentElement) {\n this.isTruncated =\n contentElement.scrollWidth > contentElement.offsetWidth;\n if (this.isTruncated) {\n this.tooltipText = (this.textContent ?? '').trim();\n }\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-overflow-menu-item': OverflowMenuItem;\n }\n}\n"],"names":["OverflowMenuItem","customElement","LitElement","_classThis","_classSuper","_OverflowMenuItem_href_accessor_storage","set","this","__runInitializers","_href_initializers","_OverflowMenuItem_destructive_accessor_storage","_href_extraInitializers","_destructive_initializers","_OverflowMenuItem_disabled_accessor_storage","_destructive_extraInitializers","_disabled_initializers","_OverflowMenuItem_description_accessor_storage","_disabled_extraInitializers","_description_initializers","_OverflowMenuItem__menuItems_accessor_storage","_description_extraInitializers","__menuItems_initializers","_OverflowMenuItem__menu_accessor_storage","__menuItems_extraInitializers","__menu_initializers","_OverflowMenuItem_isTruncated_accessor_storage","__menu_extraInitializers","_isTruncated_initializers","_OverflowMenuItem_tooltipText_accessor_storage","_isTruncated_extraInitializers","_tooltipText_initializers","_OverflowMenuItem_kind_accessor_storage","_tooltipText_extraInitializers","_kind_initializers","_OverflowMenuItem__submenuOpenTimer_accessor_storage","_kind_extraInitializers","__submenuOpenTimer_initializers","_mo","__submenuOpenTimer_extraInitializers","href","__classPrivateFieldGet","value","__classPrivateFieldSet","destructive","disabled","description","_menuItems","_menu","isTruncated","tooltipText","kind","_submenuOpenTimer","submenuEls","Array","from","querySelectorAll","hasSubmenu","length","connectedCallback","super","MutationObserver","requestUpdate","observe","childList","subtree","attributes","attributeFilter","disconnectedCallback","_a","disconnect","render","classes","itemText","html","classMap","e","handleClick","handleKeyDown","unsafeSVG","chevronRightIcon","firstUpdated","parent","closest","getMenuItems","getMenu","addEventListener","customEvent","requestAnimationFrame","detail","checkOverflow","wrapper","querySelector","directItems","stopPropagation","innerHTML","map","el","outerHTML","join","dispatchEvent","CustomEvent","bubbles","composed","origEvent","items","activeEl","getRootNode","activeElement","idx","findIndex","item","sr","shadowRoot","contains","keyCode","next","btn","anchor","_b","_c","focus","prev","_d","_e","_f","_h","_g","contentElement","scrollWidth","offsetWidth","textContent","trim","_href_decorators","property","type","String","_destructive_decorators","Boolean","_disabled_decorators","_description_decorators","__menuItems_decorators","state","__menu_decorators","_isTruncated_decorators","_tooltipText_decorators","reflect","__submenuOpenTimer_decorators","__esDecorate","name","static","private","access","has","obj","get","metadata","_metadata","_kind_decorators","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","SCSS"],"mappings":";;;;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,EAAA,KAAAW,EAAA,CAAArH,MAAAtC,GAAA4J,EAAA,CAAA7G,KAAA,QAAAkG,KAAAjJ,EAAAiJ,KAAAO,SAAAC,GAAA,KAAAI,iHACkB7J,EAAA8J,OAASC,EAAUC,GADxB3J,EAAAL,EAAA6J,MAAgB"}
|
|
1
|
+
{"version":3,"file":"overflowMenuItem.js","sources":["../../../../src/components/reusable/overflowMenu/overflowMenuItem.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport SCSS from './overflowMenuItem.scss?inline';\nimport '../tooltip';\nimport chevronRightIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/chevron-right.svg';\n\n/**\n * Overflow Menu Item.\n * @fires on-click - Captures the click event and emits the original event details.`detail:{ origEvent: PointerEvent }`\n * @slot unnamed - Slot for menu item text.\n * @slot submenu - Provide a nested submenu's markup here (light DOM). Presence auto-detects nesting.\n * @prop {'ai'|'default'|string} kind - Visual variant inherited from parent menu.\n */\n@customElement('kyn-overflow-menu-item')\nexport class OverflowMenuItem extends LitElement {\n static override styles = unsafeCSS(SCSS);\n\n /** Makes the item a link. */\n @property({ type: String })\n accessor href = '';\n\n /** Adds destructive styles. */\n @property({ type: Boolean })\n accessor destructive = false;\n\n /** Item disabled state. */\n @property({ type: Boolean })\n accessor disabled = false;\n\n /** Item description text for screen readers. */\n @property({ type: String })\n accessor description = '';\n\n /**\n * Has the menu items in the current oveflow menu.\n * @ignore\n */\n @state()\n accessor _menuItems: HTMLElement[] = [];\n\n /**\n * Has the current oveflow menu.\n * @ignore\n */\n @state()\n accessor _menu: HTMLElement | null = null;\n\n /**\n * Tracks if the item content is overflowing and needs a tooltip.\n * @ignore\n */\n @state()\n accessor isTruncated = false;\n\n /** Holds the text content for the title tooltip.\n * @ignore\n */\n @state()\n accessor tooltipText = '';\n\n /** Kind of the item, derived from parent.\n * @ignore\n */\n @property({ type: String, reflect: true })\n accessor kind: 'ai' | 'default' | (string & {}) = 'default';\n\n /**\n * Timer id used to debounce opening of nested submenu on hover/focus.\n * @ignore\n */\n @state()\n accessor _submenuOpenTimer: number | undefined;\n\n private _mo: MutationObserver | null = null;\n\n /** True when a light-DOM submenu exists. */\n private get submenuEls(): HTMLElement[] {\n return Array.from(\n this.querySelectorAll<HTMLElement>(':scope > [slot=\"submenu\"]')\n );\n }\n private get hasSubmenu(): boolean {\n return this.submenuEls.length > 0;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Observe for submenu add/remove or slot attr changes and re-render.\n this._mo = new MutationObserver(() => this.requestUpdate());\n this._mo.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n override disconnectedCallback(): void {\n this._mo?.disconnect();\n this._mo = null;\n super.disconnectedCallback();\n }\n\n override render() {\n const classes = {\n 'overflow-menu-item': true,\n 'menu-item': true,\n 'ai-connected': this.kind === 'ai',\n destructive: this.destructive,\n 'has-submenu': this.hasSubmenu,\n };\n\n const itemText = this.isTruncated ? this.tooltipText : '';\n\n if (this.href !== '') {\n return html`\n <a\n class=${classMap(classes)}\n href=${this.href}\n ?disabled=${this.disabled}\n @click=${(e: Event) => this.handleClick(e)}\n @keydown=${(e: KeyboardEvent) => this.handleKeyDown(e)}\n title=${itemText}\n >\n <span class=\"menu-item-inner-el text\"><slot></slot></span>\n ${this.destructive\n ? html`<span class=\"sr-only\">${this.description}</span>`\n : null}\n ${this.hasSubmenu\n ? html`<span\n class=\"menu-item-inner-el submenu-arrow\"\n aria-hidden=\"true\"\n >\n ${unsafeSVG(chevronRightIcon)}\n </span>`\n : null}\n </a>\n `;\n }\n\n return html`\n <button\n class=${classMap(classes)}\n ?disabled=${this.disabled}\n @click=${(e: Event) => this.handleClick(e)}\n @keydown=${(e: KeyboardEvent) => this.handleKeyDown(e)}\n title=${itemText}\n >\n <span class=\"menu-item-inner-el text\"><slot></slot></span>\n ${this.destructive\n ? html`<span class=\"sr-only\">${this.description}</span>`\n : null}\n ${this.hasSubmenu\n ? html`<span\n class=\"menu-item-inner-el submenu-arrow\"\n aria-hidden=\"true\"\n >\n ${unsafeSVG(chevronRightIcon)}\n </span>`\n : null}\n </button>\n `;\n }\n\n override firstUpdated() {\n const parent = this.closest('kyn-overflow-menu') as\n | (HTMLElement & {\n getMenuItems?: () => HTMLElement[];\n getMenu?: () => HTMLElement;\n kind?: string;\n })\n | null;\n\n if (parent) {\n this._menuItems = parent.getMenuItems ? parent.getMenuItems() : [];\n this._menu = parent.getMenu ? parent.getMenu() : null;\n if (typeof parent.kind === 'string') this.kind = parent.kind as any;\n\n parent.addEventListener('kind-changed', (e: Event) => {\n const customEvent = e as CustomEvent<'ai' | 'default' | (string & {})>;\n requestAnimationFrame(() => {\n this.kind = customEvent.detail;\n });\n });\n }\n this.checkOverflow();\n }\n\n private handleClick(e: Event) {\n const wrapper = this.querySelector<HTMLElement>(\n ':scope > [slot=\"submenu\"]:not(kyn-overflow-menu-item)'\n );\n const directItems = Array.from(\n this.querySelectorAll<HTMLElement>(\n ':scope > kyn-overflow-menu-item[slot=\"submenu\"]'\n )\n );\n\n if (this.hasSubmenu) {\n e.stopPropagation();\n const html =\n wrapper?.innerHTML ?? directItems.map((el) => el.outerHTML).join('');\n this.dispatchEvent(\n new CustomEvent('open-submenu', {\n detail: { html },\n bubbles: true,\n composed: true,\n })\n );\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('on-click', {\n detail: { origEvent: e },\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private handleKeyDown(e: KeyboardEvent) {\n const DOWN = 40;\n const UP = 38;\n\n const items = this._menuItems;\n const activeEl = (this.getRootNode() as Document | ShadowRoot)\n .activeElement as Element | null;\n\n const idx = items.findIndex((item) => {\n if (item === activeEl) return true;\n const sr = (item as HTMLElement).shadowRoot;\n return !!(sr && activeEl && sr.contains(activeEl));\n });\n\n switch (e.keyCode) {\n case DOWN: {\n if (idx < items.length - 1 && idx >= 0) {\n const next = items[idx + 1];\n const btn =\n next.shadowRoot?.querySelector<HTMLButtonElement>('button');\n const anchor = next.shadowRoot?.querySelector<HTMLAnchorElement>('a');\n (btn ?? anchor)?.focus();\n }\n return;\n }\n case UP: {\n if (idx > 0) {\n const prev = items[idx - 1];\n const btn =\n prev.shadowRoot?.querySelector<HTMLButtonElement>('button');\n const anchor = prev.shadowRoot?.querySelector<HTMLAnchorElement>('a');\n (btn ?? anchor)?.focus();\n } else if (idx === 0) {\n this._menu?.querySelector<HTMLButtonElement>('button')?.focus();\n }\n return;\n }\n default:\n return;\n }\n }\n\n private checkOverflow() {\n const contentElement =\n this.shadowRoot?.querySelector<HTMLElement>('button, a');\n if (contentElement) {\n this.isTruncated =\n contentElement.scrollWidth > contentElement.offsetWidth;\n if (this.isTruncated) {\n const slot = this.shadowRoot?.querySelector(\n '.text slot'\n ) as HTMLSlotElement;\n const nodes = slot.assignedNodes({ flatten: false });\n\n const text = nodes //get all text content from the slot,but ignore any nested submenu content\n .filter((node) => {\n return (\n node.nodeType === Node.TEXT_NODE ||\n (node.nodeType === Node.ELEMENT_NODE &&\n !(node as HTMLElement).hasAttribute('slot'))\n );\n })\n .map((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n return node.textContent || '';\n }\n return (node as HTMLElement).innerText || '';\n })\n .join('')\n .trim();\n this.tooltipText = text;\n }\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-overflow-menu-item': OverflowMenuItem;\n }\n}\n"],"names":["OverflowMenuItem","customElement","LitElement","_classThis","_classSuper","_OverflowMenuItem_href_accessor_storage","set","this","__runInitializers","_href_initializers","_OverflowMenuItem_destructive_accessor_storage","_href_extraInitializers","_destructive_initializers","_OverflowMenuItem_disabled_accessor_storage","_destructive_extraInitializers","_disabled_initializers","_OverflowMenuItem_description_accessor_storage","_disabled_extraInitializers","_description_initializers","_OverflowMenuItem__menuItems_accessor_storage","_description_extraInitializers","__menuItems_initializers","_OverflowMenuItem__menu_accessor_storage","__menuItems_extraInitializers","__menu_initializers","_OverflowMenuItem_isTruncated_accessor_storage","__menu_extraInitializers","_isTruncated_initializers","_OverflowMenuItem_tooltipText_accessor_storage","_isTruncated_extraInitializers","_tooltipText_initializers","_OverflowMenuItem_kind_accessor_storage","_tooltipText_extraInitializers","_kind_initializers","_OverflowMenuItem__submenuOpenTimer_accessor_storage","_kind_extraInitializers","__submenuOpenTimer_initializers","_mo","__submenuOpenTimer_extraInitializers","href","__classPrivateFieldGet","value","__classPrivateFieldSet","destructive","disabled","description","_menuItems","_menu","isTruncated","tooltipText","kind","_submenuOpenTimer","submenuEls","Array","from","querySelectorAll","hasSubmenu","length","connectedCallback","super","MutationObserver","requestUpdate","observe","childList","subtree","attributes","attributeFilter","disconnectedCallback","_a","disconnect","render","classes","itemText","html","classMap","e","handleClick","handleKeyDown","unsafeSVG","chevronRightIcon","firstUpdated","parent","closest","getMenuItems","getMenu","addEventListener","customEvent","requestAnimationFrame","detail","checkOverflow","wrapper","querySelector","directItems","stopPropagation","innerHTML","map","el","outerHTML","join","dispatchEvent","CustomEvent","bubbles","composed","origEvent","items","activeEl","getRootNode","activeElement","idx","findIndex","item","sr","shadowRoot","contains","keyCode","next","btn","anchor","_b","_c","focus","prev","_d","_e","_f","_h","_g","contentElement","scrollWidth","offsetWidth","text","assignedNodes","flatten","filter","node","nodeType","Node","TEXT_NODE","ELEMENT_NODE","hasAttribute","textContent","innerText","trim","_href_decorators","property","type","String","_destructive_decorators","Boolean","_disabled_decorators","_description_decorators","__menuItems_decorators","state","__menu_decorators","_isTruncated_decorators","_tooltipText_decorators","reflect","__submenuOpenTimer_decorators","__esDecorate","name","static","private","access","has","obj","get","metadata","_metadata","_kind_decorators","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","SCSS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A3G,KAAA,WAAA6G,KAAA,oBAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAC,IAAAC,GAAA,sBAAAA,EAAAC,IAAAD,GAAAA,EAASjH,kBAAiB7C,IAAA,CAAA8J,EAAA3H,KAAA2H,EAAjBjH,kBAAiBV,CAAA,GAAA6H,SAAAC,GAAAnI,GAAAE,IAzD5BwH,EAAA,KAAAW,EAAA,CAAAhI,MAAAtC,GAAAuK,EAAA,CAAAxH,KAAA,QAAA6G,KAAA5J,EAAA4J,KAAAO,SAAAC,GAAA,KAAAI,iHACkBxK,EAAAyK,OAASC,EAAUC,GADxBtK,EAAAL,EAAAwK,MAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyndryl-design-system/shidoka-applications",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.104.0",
|
|
4
4
|
"description": "Shidoka Web Components for Applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@floating-ui/dom": "^1.7.1",
|
|
37
|
-
"@kyndryl-design-system/shidoka-foundation": "^2.8.
|
|
37
|
+
"@kyndryl-design-system/shidoka-foundation": "^2.8.16",
|
|
38
38
|
"@kyndryl-design-system/shidoka-icons": "^2.22.0",
|
|
39
39
|
"@lit/context": "^1.1.0",
|
|
40
40
|
"deepmerge-ts": "^7.1.0",
|