@kyndryl-design-system/shidoka-applications 2.106.2 → 2.106.4
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/global/header/headerLink.js +60 -15
- package/components/global/header/headerLink.js.map +1 -1
- package/components/global/header/headerNav.js +33 -12
- package/components/global/header/headerNav.js.map +1 -1
- package/components/reusable/popover/popover.js +1 -1
- package/package.json +8 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPrivateFieldGet as n,__classPrivateFieldSet as a}from"tslib";import{unsafeSVG as o}from"lit-html/directives/unsafe-svg.js";import{css as
|
|
1
|
+
import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPrivateFieldGet as n,__classPrivateFieldSet as a}from"tslib";import{unsafeSVG as o}from"lit-html/directives/unsafe-svg.js";import{css as r,LitElement as s,unsafeCSS as l,html as d}from"lit";import{customElement as h,property as c,state as u,queryAssignedElements as m}from"lit/decorators.js";import{classMap as p}from"lit/directives/class-map.js";import{styleMap as v}from"lit/directives/style-map.js";import{ifDefined as k}from"lit/directives/if-defined.js";import{debounce as g}from"../../../common/helpers/helpers.js";import"../../reusable/textInput/textInput.js";import{d as f,f as y,g as x}from"../../../vendor/@kyndryl-design-system/shidoka-icons-CfQBgr8V.js";import"deepmerge-ts";import"../../reusable/button/button.js";import"lit-html/directives/class-map.js";import"../../reusable/button/defs.js";import"../../../common/mixins/form-input.js";var w=r`*,
|
|
2
2
|
*::before,
|
|
3
3
|
*::after {
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -250,6 +250,38 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPr
|
|
|
250
250
|
display: block;
|
|
251
251
|
position: relative;
|
|
252
252
|
min-width: 0;
|
|
253
|
+
--kyn-header-link-flyout-background: var(
|
|
254
|
+
--kd-color-background-menu-state-default
|
|
255
|
+
);
|
|
256
|
+
--kyn-header-link-wrapper-background: var(--kd-color-background-opacity-1);
|
|
257
|
+
--kyn-header-link-wrapper-padding: 16px;
|
|
258
|
+
--kyn-header-link-wrapper-border-radius: 8px;
|
|
259
|
+
--kyn-header-link-flyout-padding: 8px 8px 8px 230px;
|
|
260
|
+
--kyn-header-link-single-categorical-width: min(
|
|
261
|
+
calc(230px + 350px + 8px),
|
|
262
|
+
calc(100vw - 16px)
|
|
263
|
+
);
|
|
264
|
+
--kyn-header-link-two-column-width: min(
|
|
265
|
+
calc(230px + 2 * 350px + 32px + 16px),
|
|
266
|
+
calc(100vw - 16px)
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
:host-context(.global-switcher-nav) {
|
|
271
|
+
--kyn-header-link-flyout-background: var(
|
|
272
|
+
--kd-color-background-container-overlay-background
|
|
273
|
+
);
|
|
274
|
+
--kyn-header-link-wrapper-background: transparent;
|
|
275
|
+
--kyn-header-link-wrapper-border-radius: 0;
|
|
276
|
+
--kyn-header-link-flyout-padding: 0 0 0 246px;
|
|
277
|
+
--kyn-header-link-single-categorical-width: min(
|
|
278
|
+
calc(246px + 350px),
|
|
279
|
+
calc(100vw - 16px)
|
|
280
|
+
);
|
|
281
|
+
--kyn-header-link-two-column-width: min(
|
|
282
|
+
calc(246px + 2 * 350px + 32px),
|
|
283
|
+
calc(100vw - 16px)
|
|
284
|
+
);
|
|
253
285
|
}
|
|
254
286
|
|
|
255
287
|
:host([hidden]) {
|
|
@@ -328,7 +360,7 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPr
|
|
|
328
360
|
height: 16px;
|
|
329
361
|
flex: 0 0 auto;
|
|
330
362
|
}
|
|
331
|
-
.nav-link ::slotted(span:first-child:not([slot])) {
|
|
363
|
+
.nav-link ::slotted(span:first-child:not([slot]):has(> svg)) {
|
|
332
364
|
display: flex;
|
|
333
365
|
align-items: center;
|
|
334
366
|
}
|
|
@@ -475,7 +507,7 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPr
|
|
|
475
507
|
}
|
|
476
508
|
.menu__content {
|
|
477
509
|
display: none;
|
|
478
|
-
background: var(--kyn-header-link-flyout-background
|
|
510
|
+
background: var(--kyn-header-link-flyout-background);
|
|
479
511
|
box-sizing: border-box;
|
|
480
512
|
}
|
|
481
513
|
.menu__content.slotted:not(.no-padding) {
|
|
@@ -631,22 +663,22 @@ kyn-text-input {
|
|
|
631
663
|
|
|
632
664
|
@media (min-width: 42rem) {
|
|
633
665
|
.menu.level--1 .wrapper {
|
|
634
|
-
padding: var(--kyn-header-link-wrapper-padding
|
|
635
|
-
background-color: var(--kyn-header-link-wrapper-background
|
|
636
|
-
border-radius: var(--kyn-header-link-wrapper-border-radius
|
|
666
|
+
padding: var(--kyn-header-link-wrapper-padding);
|
|
667
|
+
background-color: var(--kyn-header-link-wrapper-background);
|
|
668
|
+
border-radius: var(--kyn-header-link-wrapper-border-radius);
|
|
637
669
|
}
|
|
638
670
|
.menu.level--1 .menu__content.slotted:not(.no-padding) {
|
|
639
|
-
padding: var(--kyn-header-link-flyout-padding
|
|
671
|
+
padding: var(--kyn-header-link-flyout-padding);
|
|
640
672
|
}
|
|
641
673
|
:host([has-multi-column]) .menu.open .menu__content.slotted,
|
|
642
674
|
.menu.full-width-flyout.open .menu__content.slotted {
|
|
643
|
-
padding: var(--kyn-header-link-flyout-padding
|
|
675
|
+
padding: var(--kyn-header-link-flyout-padding);
|
|
644
676
|
}
|
|
645
677
|
:host([has-categorical]:not([has-multi-column])) .menu.level--1 .menu__content.slotted {
|
|
646
|
-
width: var(--kyn-header-link-single-categorical-width
|
|
678
|
+
width: var(--kyn-header-link-single-categorical-width);
|
|
647
679
|
}
|
|
648
680
|
:host([has-multi-column][data-flyout-columns="2"]) .menu.open .menu__content.slotted {
|
|
649
|
-
width: var(--kyn-header-link-two-column-width
|
|
681
|
+
width: var(--kyn-header-link-two-column-width);
|
|
650
682
|
}
|
|
651
683
|
}
|
|
652
684
|
/* --- TRUNCATION --- */
|
|
@@ -660,7 +692,20 @@ kyn-text-input {
|
|
|
660
692
|
--kyn-header-span-only-overflow: hidden;
|
|
661
693
|
--kyn-header-span-only-text-overflow: ellipsis;
|
|
662
694
|
--kyn-header-span-only-white-space: nowrap;
|
|
663
|
-
}
|
|
695
|
+
}
|
|
696
|
+
.nav-link.truncate ::slotted(span:first-child:not([slot])) {
|
|
697
|
+
display: block;
|
|
698
|
+
overflow: hidden;
|
|
699
|
+
text-overflow: ellipsis;
|
|
700
|
+
white-space: nowrap;
|
|
701
|
+
}
|
|
702
|
+
.nav-link.truncate ::slotted(span:first-child:not([slot]):has(> svg)) {
|
|
703
|
+
display: flex;
|
|
704
|
+
flex-shrink: 0;
|
|
705
|
+
overflow: visible;
|
|
706
|
+
text-overflow: clip;
|
|
707
|
+
white-space: normal;
|
|
708
|
+
}`;let b=(()=>{var r,b,_,T,C,L,W,M,S,z,E,P,N,O,A,$,j,q,B,F,R,I,D,H,K,U,Y;let V,X,G,J,Q,Z,ee,te,ie,ne,ae,oe,re,se,le,de,he,ce,ue,me,pe,ve,ke,ge,fe,ye,xe,we,be,_e=[h("kyn-header-link")],Te=[],Ce=s,Le=[],We=[],Me=[],Se=[],ze=[],Ee=[],Pe=[],Ne=[],Oe=[],Ae=[],$e=[],je=[],qe=[],Be=[],Fe=[],Re=[],Ie=[],De=[],He=[],Ke=[],Ue=[],Ye=[],Ve=[],Xe=[],Ge=[],Je=[],Qe=[],Ze=[],et=[],tt=[],it=[],nt=[],at=[],ot=[],rt=[],st=[],lt=[],dt=[],ht=[],ct=[],ut=[],mt=[],pt=[],vt=[],kt=[],gt=[],ft=[],yt=[],xt=[],wt=[],bt=[],_t=[],Tt=[],Ct=[];return X=class extends Ce{constructor(){super(...arguments),r.set(this,i(this,Le,!1)),b.set(this,(i(this,We),i(this,Me,""))),_.set(this,(i(this,Se),i(this,ze,"_self"))),T.set(this,(i(this,Ee),i(this,Pe,""))),C.set(this,(i(this,Ne),i(this,Oe,!1))),L.set(this,(i(this,Ae),i(this,$e,1))),W.set(this,(i(this,je),i(this,qe,!1))),M.set(this,(i(this,Be),i(this,Fe,"Search"))),S.set(this,(i(this,Re),i(this,Ie,6))),z.set(this,(i(this,De),i(this,He,0))),E.set(this,(i(this,Ke),i(this,Ue,!1))),P.set(this,(i(this,Ye),i(this,Ve,"Back"))),N.set(this,(i(this,Xe),i(this,Ge,!1))),O.set(this,(i(this,Je),i(this,Qe,""))),A.set(this,(i(this,Ze),i(this,et,!1))),$.set(this,(i(this,tt),i(this,it,""))),j.set(this,(i(this,nt),i(this,at,!1))),q.set(this,(i(this,ot),i(this,rt,!1))),B.set(this,(i(this,st),i(this,lt,0))),F.set(this,(i(this,dt),i(this,ht,!1))),R.set(this,(i(this,ct),i(this,ut,!1))),I.set(this,(i(this,mt),i(this,pt,""))),D.set(this,(i(this,vt),i(this,kt,0))),H.set(this,(i(this,gt),i(this,ft,void 0))),this._enterTimer=i(this,yt),K.set(this,i(this,xt,void 0)),this._viewChangeInProgress=(i(this,wt),!1),U.set(this,i(this,bt,!1)),this._truncateObserver=i(this,_t),this._observedNav=null,Y.set(this,i(this,Tt,{})),this._handleColumnCountChange=(i(this,Ct),e=>{const t=e.detail;void 0!==(null==t?void 0:t.columnCount)&&(this.flyoutColumns=t.columnCount,this.fixedColumnWidths=Boolean(t.fixedColumnWidths))}),this._debounceResize=g((()=>{this.determineLevel(),this.open&&this._positionMenu()})),this._handleDocumentClick=e=>this.handleClickOut(e),this._handleNavChange=()=>{this._viewChangeInProgress=!0,clearTimeout(this._viewChangeTimer),this._viewChangeTimer=setTimeout((()=>{this._viewChangeInProgress=!1}),500)},this._syncInheritedTruncate=()=>{this._inheritedTruncate=this._isInTruncatingNav()}}get open(){return n(this,r,"f")}set open(e){a(this,r,e,"f")}get href(){return n(this,b,"f")}set href(e){a(this,b,e,"f")}get target(){return n(this,_,"f")}set target(e){a(this,_,e,"f")}get rel(){return n(this,T,"f")}set rel(e){a(this,T,e,"f")}get isActive(){return n(this,C,"f")}set isActive(e){a(this,C,e,"f")}get level(){return n(this,L,"f")}set level(e){a(this,L,e,"f")}get divider(){return n(this,W,"f")}set divider(e){a(this,W,e,"f")}get searchLabel(){return n(this,M,"f")}set searchLabel(e){a(this,M,e,"f")}get searchThreshold(){return n(this,S,"f")}set searchThreshold(e){a(this,S,e,"f")}get linksPerColumn(){return n(this,z,"f")}set linksPerColumn(e){a(this,z,e,"f")}get hideSearch(){return n(this,E,"f")}set hideSearch(e){a(this,E,e,"f")}get backText(){return n(this,P,"f")}set backText(e){a(this,P,e,"f")}get leftPadding(){return n(this,N,"f")}set leftPadding(e){a(this,N,e,"f")}get linkTitle(){return n(this,O,"f")}set linkTitle(e){a(this,O,e,"f")}get truncate(){return n(this,A,"f")}set truncate(e){a(this,A,e,"f")}get _autoTitle(){return n(this,$,"f")}set _autoTitle(e){a(this,$,e,"f")}get hasCategorical(){return n(this,j,"f")}set hasCategorical(e){a(this,j,e,"f")}get hasMultiColumn(){return n(this,q,"f")}set hasMultiColumn(e){a(this,q,e,"f")}get flyoutColumns(){return n(this,B,"f")}set flyoutColumns(e){a(this,B,e,"f")}get fixedColumnWidths(){return n(this,F,"f")}set fixedColumnWidths(e){a(this,F,e,"f")}get fullWidthFlyout(){return n(this,R,"f")}set fullWidthFlyout(e){a(this,R,e,"f")}get _searchTerm(){return n(this,I,"f")}set _searchTerm(e){a(this,I,e,"f")}get _slottedLinkCount(){return n(this,D,"f")}set _slottedLinkCount(e){a(this,D,e,"f")}get slottedEls(){return n(this,H,"f")}set slottedEls(e){a(this,H,e,"f")}get _leaveTimer(){return n(this,K,"f")}set _leaveTimer(e){a(this,K,e,"f")}get _inheritedTruncate(){return n(this,U,"f")}set _inheritedTruncate(e){a(this,U,e,"f")}get menuPosition(){return n(this,Y,"f")}set menuPosition(e){a(this,Y,e,"f")}render(){const e={menu:this.slottedEls.length,[`level--${this.level}`]:!0,divider:this.divider,"full-width-flyout":this.fullWidthFlyout,open:this.open||1===this.level&&this.isActive},t=this.truncate||this._inheritedTruncate,i={"nav-link":!0,active:this.isActive,interactive:1==this.level,"padding-left":this.leftPadding,truncate:t},n={menu__content:!0,slotted:this.slottedEls.length},a=this.querySelectorAll(":scope > kyn-header-link, :scope > kyn-header-category > kyn-header-link"),r=!this.hideSearch&&a.length>=this.searchThreshold,s={wrapper:!0,"no-search":!r};return d`
|
|
664
709
|
<div
|
|
665
710
|
class="${p(e)}"
|
|
666
711
|
@pointerleave=${e=>this.handlePointerLeave(e)}
|
|
@@ -678,14 +723,14 @@ kyn-text-input {
|
|
|
678
723
|
<slot name="icon"></slot>
|
|
679
724
|
<slot @slotchange=${this._handleDefaultSlotChange}></slot>
|
|
680
725
|
|
|
681
|
-
${this.slottedEls.length?
|
|
726
|
+
${this.slottedEls.length?d` <span class="arrow">${o(f)}</span> `:null}
|
|
682
727
|
</a>
|
|
683
728
|
|
|
684
729
|
<div
|
|
685
730
|
class=${p(n)}
|
|
686
731
|
style=${v(this.menuPosition)}
|
|
687
732
|
>
|
|
688
|
-
<div class=${p(
|
|
733
|
+
<div class=${p(s)}>
|
|
689
734
|
<button
|
|
690
735
|
class="go-back"
|
|
691
736
|
type="button"
|
|
@@ -694,7 +739,7 @@ kyn-text-input {
|
|
|
694
739
|
<span>${o(y)}</span>
|
|
695
740
|
${this.backText}
|
|
696
741
|
</button>
|
|
697
|
-
${
|
|
742
|
+
${r?d`
|
|
698
743
|
<kyn-text-input
|
|
699
744
|
hideLabel
|
|
700
745
|
size="sm"
|
|
@@ -723,5 +768,5 @@ kyn-text-input {
|
|
|
723
768
|
</div>
|
|
724
769
|
</div>
|
|
725
770
|
</div>
|
|
726
|
-
`}get _linksColumnStyles(){if(!this.hasCategorical&&this.linksPerColumn>0&&this._slottedLinkCount>this.linksPerColumn){return{"column-count":Math.ceil(this._slottedLinkCount/this.linksPerColumn).toString()}}return{}}_handleSearch(e){this._searchTerm=e.detail.value.toLowerCase(),this._searchFilter()}_searchFilter(){this.querySelectorAll(":scope > kyn-header-link, :scope > kyn-header-category > kyn-header-link").forEach((e=>{var t,i;const n=null===(t=e.shadowRoot)||void 0===t?void 0:t.querySelector("slot:not([name])"),a=null!==(i=null==n?void 0:n.assignedNodes({flatten:!0}))&&void 0!==i?i:[];let o="";for(let e=0;e<a.length;e++)o+=a[e].textContent.trim();o.toLowerCase().includes(this._searchTerm)?e.style.display="block":e.style.display="none"})),this._positionMenu()}_handleDefaultSlotChange(e){var t,i;const n=e.target.assignedNodes({flatten:!0});let a="";for(const e of n)a+=null!==(i=null===(t=e.textContent)||void 0===t?void 0:t.trim())&&void 0!==i?i:"";this._autoTitle=a.trim()}_handleBack(e){var t;e&&(e.preventDefault(),e.stopPropagation());const i=this.closest("kyn-header-categories");if(null==i?void 0:i.handleBackClick){i.handleBackClick(e);return(null!==(t=this.closest("kyn-header-nav"))&&void 0!==t?t:i).querySelectorAll("kyn-header-link[open]").forEach((e=>{e.removeAttribute("open"),"open"in e&&(e.open=!1)})),this._searchTerm="",void this._searchFilter()}this.open=!1,this._searchTerm="",this._searchFilter()}_handleLinksSlotChange(){var e;const t=null!==this.querySelector("kyn-header-categories"),i=null!==this.querySelector("kyn-header-category"),n=this.querySelector("kyn-tab-panel[visible] kyn-header-categories")||this.querySelector("kyn-header-categories");if(this.hasCategorical=t||i,this.hasMultiColumn=t,this.fixedColumnWidths=null!==(e=null==n?void 0:n.hasAttribute("fixed-column-widths"))&&void 0!==e&&e,n){const e=n.getAttribute("data-columns");this.flyoutColumns=e&&parseInt(e,10)||0}else this.flyoutColumns=0;const a=this.querySelectorAll(":scope > kyn-header-link");this._slottedLinkCount=a.length,this.requestUpdate()}get _isDesktopViewport(){return"undefined"==typeof window||window.innerWidth>=672}handlePointerEnter(e){"mouse"===e.pointerType&&this.slottedEls.length&&this._isDesktopViewport&&(clearTimeout(this._leaveTimer),this._closeOtherOpenLinks(),this._enterTimer=setTimeout((()=>{this._closeOtherOpenLinks(),this.open=!0}),150))}_closeOtherOpenLinks(){if(1===this.level){const e=this.parentElement;if(e){e.querySelectorAll(":scope > kyn-header-link").forEach((e=>{var t,i;e!==this&&(e._enterTimer&&(clearTimeout(e._enterTimer),e._enterTimer=void 0),e._leaveTimer&&(clearTimeout(e._leaveTimer),e._leaveTimer=void 0),e.open&&(e.open=!1,e.removeAttribute("open"),null===(i=(t=e).requestUpdate)||void 0===i||i.call(t)))}))}return}const e=this.closest("kyn-header-nav")||this.closest("kyn-tab-panel")||this.closest(".menu__content");if(e){e.querySelectorAll("kyn-header-link").forEach((e=>{var t,i;e!==this&&e.level===this.level&&(e._enterTimer&&(clearTimeout(e._enterTimer),e._enterTimer=void 0),e._leaveTimer&&(clearTimeout(e._leaveTimer),e._leaveTimer=void 0),e.open&&(e.open=!1,e.removeAttribute("open"),null===(i=(t=e).requestUpdate)||void 0===i||i.call(t)))}))}}handlePointerLeave(e){if(this._viewChangeInProgress)return;this._shouldAutoCollapse()&&"mouse"===e.pointerType&&this.slottedEls.length&&""===this._searchTerm&&this._isDesktopViewport&&(clearTimeout(this._enterTimer),this._leaveTimer=setTimeout((()=>{this.open=!1}),150))}_shouldAutoCollapse(){if(!this.hasCategorical&&!this.fullWidthFlyout)return!0;const e=this.closest("kyn-header-nav");return!(null==e?void 0:e.autoOpenFlyout)}handleClick(e){let t=!1;this.slottedEls.length?(t=!0,e.preventDefault(),this.open||this._closeOtherOpenLinks(),this.open=!this.open):this._closeOtherOpenLinks();const i=new CustomEvent("on-click",{detail:{origEvent:e,defaultPrevented:t}});this.dispatchEvent(i)}handleClickOut(e){e.composedPath().includes(this)||(this.open=!1,this._searchTerm="",this._searchFilter())}determineLevel(){var e,t,i;let n=1,a=this.parentNode;for(;a;){if("KYN-HEADER-LINK"===a.nodeName){n=(null!==(e=a.level)&&void 0!==e?e:1)+1;break}if("KYN-HEADER-CATEGORY"===a.nodeName&&"KYN-HEADER-LINK"===(null===(t=a.parentNode)||void 0===t?void 0:t.nodeName)){n=(null!==(i=a.parentNode.level)&&void 0!==i?i:1)+1;break}if(window.innerWidth<672&&"KYN-HEADER-FLYOUT"===a.nodeName){n=2;break}a=a.parentNode}this.level=n}_positionMenu(){var e,t,i,n;const a=null===(e=this.getBoundingClientRect)||void 0===e?void 0:e.call(this),o=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".menu__content"),s=null===(i=null==o?void 0:o.getBoundingClientRect)||void 0===i?void 0:i.call(o);if(!a||!s)return;const r=a.top+a.height/2,l=s.height/2,h=r+l>window.innerHeight?r-l-(r+l-window.innerHeight)-16:r-l;if(1===this.level){let e=0;const t=this.closest("kyn-header-nav");if(t){const i=null===(n=t.shadowRoot)||void 0===n?void 0:n.querySelector(".menu__content");i&&(e=i.offsetHeight)}this.menuPosition={top:"64px",left:"0px",minHeight:e+"px"}}else{const e=h<64?64:h;this.menuPosition={top:e+"px",left:a.right+12+"px"}}}firstUpdated(){this.determineLevel(),this._handleLinksSlotChange()}updated(e){e.has("open")&&this.open&&requestAnimationFrame((()=>{this._positionMenu()})),e.has("flyoutColumns")&&this.open&&requestAnimationFrame((()=>{this._positionMenu()}))}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),window.addEventListener("resize",this._debounceResize),this.addEventListener("on-column-count-change",this._handleColumnCountChange),this.addEventListener("on-nav-change",this._handleNavChange),queueMicrotask((()=>{this._observeParentNavTruncate()}))}_resolveOwningNav(){var e,t;const i=this.closest("kyn-header-nav");if(i)return i;let n=this.getRootNode();for(;n instanceof ShadowRoot;){const i=null===(t=(e=n.host).closest)||void 0===t?void 0:t.call(e,"kyn-header-nav");if(i)return i;n=n.host.getRootNode()}return null}_observeParentNavTruncate(){const e=this._resolveOwningNav();this._observedNav!==e?(this._truncateObserver&&(this._truncateObserver.disconnect(),this._truncateObserver=void 0),this._observedNav=e,e&&(this._truncateObserver=new MutationObserver((()=>{this._syncInheritedTruncate()})),this._truncateObserver.observe(e,{attributes:!0,attributeFilter:["truncate-links"]})),this._syncInheritedTruncate()):this._syncInheritedTruncate()}_isInTruncatingNav(){var e,t;return null!==(t=null===(e=this._resolveOwningNav())||void 0===e?void 0:e.hasAttribute("truncate-links"))&&void 0!==t&&t}disconnectedCallback(){this._enterTimer&&(clearTimeout(this._enterTimer),this._enterTimer=void 0),this._leaveTimer&&(clearTimeout(this._leaveTimer),this._leaveTimer=void 0),this._viewChangeTimer&&(clearTimeout(this._viewChangeTimer),this._viewChangeTimer=void 0),document.removeEventListener("click",this._handleDocumentClick),window.removeEventListener("resize",this._debounceResize),this.removeEventListener("on-column-count-change",this._handleColumnCountChange),this.removeEventListener("on-nav-change",this._handleNavChange),this._truncateObserver&&(this._truncateObserver.disconnect(),this._truncateObserver=void 0),this._observedNav=null,super.disconnectedCallback()}},s=new WeakMap,w=new WeakMap,_=new WeakMap,T=new WeakMap,C=new WeakMap,L=new WeakMap,W=new WeakMap,M=new WeakMap,S=new WeakMap,z=new WeakMap,E=new WeakMap,P=new WeakMap,N=new WeakMap,O=new WeakMap,A=new WeakMap,$=new WeakMap,j=new WeakMap,q=new WeakMap,B=new WeakMap,F=new WeakMap,R=new WeakMap,I=new WeakMap,D=new WeakMap,H=new WeakMap,K=new WeakMap,U=new WeakMap,Y=new WeakMap,e(X,"HeaderLink"),(()=>{var e;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=Ce[Symbol.metadata])&&void 0!==e?e:null):void 0;G=[c({type:Boolean,reflect:!0})],J=[c({type:String})],Q=[c({type:String})],Z=[c({type:String})],ee=[c({type:Boolean})],te=[u()],ie=[c({type:Boolean})],ne=[c({type:String})],ae=[c({type:Number})],oe=[c({type:Number})],se=[c({type:Boolean})],re=[c({type:String})],le=[c({type:Boolean})],he=[c({type:String,attribute:"link-title"})],de=[c({type:Boolean,reflect:!0})],ce=[u()],ue=[c({type:Boolean,reflect:!0,attribute:"has-categorical"})],me=[c({type:Boolean,reflect:!0,attribute:"has-multi-column"})],pe=[c({type:Number,reflect:!0,attribute:"data-flyout-columns"})],ve=[c({type:Boolean,reflect:!0,attribute:"fixed-column-widths"})],ke=[c({type:Boolean,reflect:!0,attribute:"full-width-flyout"})],ge=[u()],fe=[u()],ye=[m({slot:"links"})],xe=[u()],be=[u()],we=[u()],t(X,null,G,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:i},Le,We),t(X,null,J,{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:i},Me,Se),t(X,null,Q,{kind:"accessor",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:i},ze,Ee),t(X,null,Z,{kind:"accessor",name:"rel",static:!1,private:!1,access:{has:e=>"rel"in e,get:e=>e.rel,set:(e,t)=>{e.rel=t}},metadata:i},Pe,Ne),t(X,null,ee,{kind:"accessor",name:"isActive",static:!1,private:!1,access:{has:e=>"isActive"in e,get:e=>e.isActive,set:(e,t)=>{e.isActive=t}},metadata:i},Oe,Ae),t(X,null,te,{kind:"accessor",name:"level",static:!1,private:!1,access:{has:e=>"level"in e,get:e=>e.level,set:(e,t)=>{e.level=t}},metadata:i},$e,je),t(X,null,ie,{kind:"accessor",name:"divider",static:!1,private:!1,access:{has:e=>"divider"in e,get:e=>e.divider,set:(e,t)=>{e.divider=t}},metadata:i},qe,Be),t(X,null,ne,{kind:"accessor",name:"searchLabel",static:!1,private:!1,access:{has:e=>"searchLabel"in e,get:e=>e.searchLabel,set:(e,t)=>{e.searchLabel=t}},metadata:i},Fe,Re),t(X,null,ae,{kind:"accessor",name:"searchThreshold",static:!1,private:!1,access:{has:e=>"searchThreshold"in e,get:e=>e.searchThreshold,set:(e,t)=>{e.searchThreshold=t}},metadata:i},Ie,De),t(X,null,oe,{kind:"accessor",name:"linksPerColumn",static:!1,private:!1,access:{has:e=>"linksPerColumn"in e,get:e=>e.linksPerColumn,set:(e,t)=>{e.linksPerColumn=t}},metadata:i},He,Ke),t(X,null,se,{kind:"accessor",name:"hideSearch",static:!1,private:!1,access:{has:e=>"hideSearch"in e,get:e=>e.hideSearch,set:(e,t)=>{e.hideSearch=t}},metadata:i},Ue,Ye),t(X,null,re,{kind:"accessor",name:"backText",static:!1,private:!1,access:{has:e=>"backText"in e,get:e=>e.backText,set:(e,t)=>{e.backText=t}},metadata:i},Ve,Xe),t(X,null,le,{kind:"accessor",name:"leftPadding",static:!1,private:!1,access:{has:e=>"leftPadding"in e,get:e=>e.leftPadding,set:(e,t)=>{e.leftPadding=t}},metadata:i},Ge,Je),t(X,null,he,{kind:"accessor",name:"linkTitle",static:!1,private:!1,access:{has:e=>"linkTitle"in e,get:e=>e.linkTitle,set:(e,t)=>{e.linkTitle=t}},metadata:i},Qe,Ze),t(X,null,de,{kind:"accessor",name:"truncate",static:!1,private:!1,access:{has:e=>"truncate"in e,get:e=>e.truncate,set:(e,t)=>{e.truncate=t}},metadata:i},et,tt),t(X,null,ce,{kind:"accessor",name:"_autoTitle",static:!1,private:!1,access:{has:e=>"_autoTitle"in e,get:e=>e._autoTitle,set:(e,t)=>{e._autoTitle=t}},metadata:i},it,nt),t(X,null,ue,{kind:"accessor",name:"hasCategorical",static:!1,private:!1,access:{has:e=>"hasCategorical"in e,get:e=>e.hasCategorical,set:(e,t)=>{e.hasCategorical=t}},metadata:i},at,ot),t(X,null,me,{kind:"accessor",name:"hasMultiColumn",static:!1,private:!1,access:{has:e=>"hasMultiColumn"in e,get:e=>e.hasMultiColumn,set:(e,t)=>{e.hasMultiColumn=t}},metadata:i},st,rt),t(X,null,pe,{kind:"accessor",name:"flyoutColumns",static:!1,private:!1,access:{has:e=>"flyoutColumns"in e,get:e=>e.flyoutColumns,set:(e,t)=>{e.flyoutColumns=t}},metadata:i},lt,ht),t(X,null,ve,{kind:"accessor",name:"fixedColumnWidths",static:!1,private:!1,access:{has:e=>"fixedColumnWidths"in e,get:e=>e.fixedColumnWidths,set:(e,t)=>{e.fixedColumnWidths=t}},metadata:i},dt,ct),t(X,null,ke,{kind:"accessor",name:"fullWidthFlyout",static:!1,private:!1,access:{has:e=>"fullWidthFlyout"in e,get:e=>e.fullWidthFlyout,set:(e,t)=>{e.fullWidthFlyout=t}},metadata:i},ut,mt),t(X,null,ge,{kind:"accessor",name:"_searchTerm",static:!1,private:!1,access:{has:e=>"_searchTerm"in e,get:e=>e._searchTerm,set:(e,t)=>{e._searchTerm=t}},metadata:i},pt,vt),t(X,null,fe,{kind:"accessor",name:"_slottedLinkCount",static:!1,private:!1,access:{has:e=>"_slottedLinkCount"in e,get:e=>e._slottedLinkCount,set:(e,t)=>{e._slottedLinkCount=t}},metadata:i},kt,gt),t(X,null,ye,{kind:"accessor",name:"slottedEls",static:!1,private:!1,access:{has:e=>"slottedEls"in e,get:e=>e.slottedEls,set:(e,t)=>{e.slottedEls=t}},metadata:i},ft,yt),t(X,null,xe,{kind:"accessor",name:"_leaveTimer",static:!1,private:!1,access:{has:e=>"_leaveTimer"in e,get:e=>e._leaveTimer,set:(e,t)=>{e._leaveTimer=t}},metadata:i},xt,bt),t(X,null,be,{kind:"accessor",name:"_inheritedTruncate",static:!1,private:!1,access:{has:e=>"_inheritedTruncate"in e,get:e=>e._inheritedTruncate,set:(e,t)=>{e._inheritedTruncate=t}},metadata:i},wt,_t),t(X,null,we,{kind:"accessor",name:"menuPosition",static:!1,private:!1,access:{has:e=>"menuPosition"in e,get:e=>e.menuPosition,set:(e,t)=>{e.menuPosition=t}},metadata:i},Tt,Ct),t(null,V={value:X},_e,{kind:"class",name:X.name,metadata:i},null,Te),X=V.value,i&&Object.defineProperty(X,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),X.styles=l(b),i(X,Te),X})();export{w as HeaderLink};
|
|
771
|
+
`}get _linksColumnStyles(){if(!this.hasCategorical&&this.linksPerColumn>0&&this._slottedLinkCount>this.linksPerColumn){return{"column-count":Math.ceil(this._slottedLinkCount/this.linksPerColumn).toString()}}return{}}_handleSearch(e){this._searchTerm=e.detail.value.toLowerCase(),this._searchFilter()}_searchFilter(){this.querySelectorAll(":scope > kyn-header-link, :scope > kyn-header-category > kyn-header-link").forEach((e=>{var t,i;const n=null===(t=e.shadowRoot)||void 0===t?void 0:t.querySelector("slot:not([name])"),a=null!==(i=null==n?void 0:n.assignedNodes({flatten:!0}))&&void 0!==i?i:[];let o="";for(let e=0;e<a.length;e++)o+=a[e].textContent.trim();o.toLowerCase().includes(this._searchTerm)?e.style.display="block":e.style.display="none"})),this._positionMenu()}_handleDefaultSlotChange(e){var t,i;const n=e.target.assignedNodes({flatten:!0});let a="";for(const e of n)a+=null!==(i=null===(t=e.textContent)||void 0===t?void 0:t.trim())&&void 0!==i?i:"";this._autoTitle=a.trim()}_handleBack(e){var t;e&&(e.preventDefault(),e.stopPropagation());const i=this.closest("kyn-header-categories");if(null==i?void 0:i.handleBackClick){i.handleBackClick(e);return(null!==(t=this.closest("kyn-header-nav"))&&void 0!==t?t:i).querySelectorAll("kyn-header-link[open]").forEach((e=>{e.removeAttribute("open"),"open"in e&&(e.open=!1)})),this._searchTerm="",void this._searchFilter()}this.open=!1,this._searchTerm="",this._searchFilter()}_handleLinksSlotChange(){var e;const t=null!==this.querySelector("kyn-header-categories"),i=null!==this.querySelector("kyn-header-category"),n=this.querySelector("kyn-tab-panel[visible] kyn-header-categories")||this.querySelector("kyn-header-categories");if(this.hasCategorical=t||i,this.hasMultiColumn=t,this.fixedColumnWidths=null!==(e=null==n?void 0:n.hasAttribute("fixed-column-widths"))&&void 0!==e&&e,n){const e=n.getAttribute("data-columns");this.flyoutColumns=e&&parseInt(e,10)||0}else this.flyoutColumns=0;const a=this.querySelectorAll(":scope > kyn-header-link");this._slottedLinkCount=a.length,this.requestUpdate()}get _isDesktopViewport(){return"undefined"==typeof window||window.innerWidth>=672}handlePointerEnter(e){"mouse"===e.pointerType&&this.slottedEls.length&&this._isDesktopViewport&&(clearTimeout(this._leaveTimer),this._closeOtherOpenLinks(),this._enterTimer=setTimeout((()=>{this._closeOtherOpenLinks(),this.open=!0}),150))}_closeOtherOpenLinks(){if(1===this.level){const e=this.parentElement;if(e){e.querySelectorAll(":scope > kyn-header-link").forEach((e=>{var t,i;e!==this&&(e._enterTimer&&(clearTimeout(e._enterTimer),e._enterTimer=void 0),e._leaveTimer&&(clearTimeout(e._leaveTimer),e._leaveTimer=void 0),e.open&&(e.open=!1,e.removeAttribute("open"),null===(i=(t=e).requestUpdate)||void 0===i||i.call(t)))}))}return}const e=this.closest("kyn-header-nav")||this.closest("kyn-tab-panel")||this.closest(".menu__content");if(e){e.querySelectorAll("kyn-header-link").forEach((e=>{var t,i;e!==this&&e.level===this.level&&(e._enterTimer&&(clearTimeout(e._enterTimer),e._enterTimer=void 0),e._leaveTimer&&(clearTimeout(e._leaveTimer),e._leaveTimer=void 0),e.open&&(e.open=!1,e.removeAttribute("open"),null===(i=(t=e).requestUpdate)||void 0===i||i.call(t)))}))}}handlePointerLeave(e){if(this._viewChangeInProgress)return;this._shouldAutoCollapse()&&"mouse"===e.pointerType&&this.slottedEls.length&&""===this._searchTerm&&this._isDesktopViewport&&(clearTimeout(this._enterTimer),this._leaveTimer=setTimeout((()=>{this.open=!1}),150))}_shouldAutoCollapse(){if(!this.hasCategorical&&!this.fullWidthFlyout)return!0;const e=this.closest("kyn-header-nav");return!(null==e?void 0:e.autoOpenFlyout)}handleClick(e){let t=!1;this.slottedEls.length?(t=!0,e.preventDefault(),this.open||this._closeOtherOpenLinks(),this.open=!this.open):this._closeOtherOpenLinks();const i=new CustomEvent("on-click",{detail:{origEvent:e,defaultPrevented:t}});this.dispatchEvent(i)}handleClickOut(e){e.composedPath().includes(this)||(this.open=!1,this._searchTerm="",this._searchFilter())}determineLevel(){var e,t,i;let n=1,a=this.parentNode;for(;a;){if("KYN-HEADER-LINK"===a.nodeName){n=(null!==(e=a.level)&&void 0!==e?e:1)+1;break}if("KYN-HEADER-CATEGORY"===a.nodeName&&"KYN-HEADER-LINK"===(null===(t=a.parentNode)||void 0===t?void 0:t.nodeName)){n=(null!==(i=a.parentNode.level)&&void 0!==i?i:1)+1;break}if(window.innerWidth<672&&"KYN-HEADER-FLYOUT"===a.nodeName){n=2;break}a=a.parentNode}this.level=n}_positionMenu(){var e,t,i,n;const a=null===(e=this.getBoundingClientRect)||void 0===e?void 0:e.call(this),o=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".menu__content"),r=null===(i=null==o?void 0:o.getBoundingClientRect)||void 0===i?void 0:i.call(o);if(!a||!r)return;const s=a.top+a.height/2,l=r.height/2,d=s+l>window.innerHeight?s-l-(s+l-window.innerHeight)-16:s-l;if(1===this.level){let e=0;const t=this.closest("kyn-header-nav");if(t){const i=null===(n=t.shadowRoot)||void 0===n?void 0:n.querySelector(".menu__content");i&&(e=i.offsetHeight)}this.menuPosition={top:"64px",left:"0px",minHeight:e+"px"}}else{const e=d<64?64:d;this.menuPosition={top:e+"px",left:a.right+12+"px"}}}firstUpdated(){this.determineLevel(),this._handleLinksSlotChange()}updated(e){e.has("open")&&this.open&&requestAnimationFrame((()=>{this._positionMenu()})),e.has("flyoutColumns")&&this.open&&requestAnimationFrame((()=>{this._positionMenu()}))}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),window.addEventListener("resize",this._debounceResize),this.addEventListener("on-column-count-change",this._handleColumnCountChange),this.addEventListener("on-nav-change",this._handleNavChange),queueMicrotask((()=>{this._observeParentNavTruncate()}))}_resolveOwningNav(){var e,t;const i=this.closest("kyn-header-nav");if(i)return i;let n=this.getRootNode();for(;n instanceof ShadowRoot;){const i=null===(t=(e=n.host).closest)||void 0===t?void 0:t.call(e,"kyn-header-nav");if(i)return i;n=n.host.getRootNode()}return null}_observeParentNavTruncate(){const e=this._resolveOwningNav();this._observedNav!==e?(this._truncateObserver&&(this._truncateObserver.disconnect(),this._truncateObserver=void 0),this._observedNav=e,e&&(this._truncateObserver=new MutationObserver((()=>{this._syncInheritedTruncate()})),this._truncateObserver.observe(e,{attributes:!0,attributeFilter:["truncate-links"]})),this._syncInheritedTruncate()):this._syncInheritedTruncate()}_isInTruncatingNav(){var e,t;return null!==(t=null===(e=this._resolveOwningNav())||void 0===e?void 0:e.hasAttribute("truncate-links"))&&void 0!==t&&t}disconnectedCallback(){this._enterTimer&&(clearTimeout(this._enterTimer),this._enterTimer=void 0),this._leaveTimer&&(clearTimeout(this._leaveTimer),this._leaveTimer=void 0),this._viewChangeTimer&&(clearTimeout(this._viewChangeTimer),this._viewChangeTimer=void 0),document.removeEventListener("click",this._handleDocumentClick),window.removeEventListener("resize",this._debounceResize),this.removeEventListener("on-column-count-change",this._handleColumnCountChange),this.removeEventListener("on-nav-change",this._handleNavChange),this._truncateObserver&&(this._truncateObserver.disconnect(),this._truncateObserver=void 0),this._observedNav=null,super.disconnectedCallback()}},r=new WeakMap,b=new WeakMap,_=new WeakMap,T=new WeakMap,C=new WeakMap,L=new WeakMap,W=new WeakMap,M=new WeakMap,S=new WeakMap,z=new WeakMap,E=new WeakMap,P=new WeakMap,N=new WeakMap,O=new WeakMap,A=new WeakMap,$=new WeakMap,j=new WeakMap,q=new WeakMap,B=new WeakMap,F=new WeakMap,R=new WeakMap,I=new WeakMap,D=new WeakMap,H=new WeakMap,K=new WeakMap,U=new WeakMap,Y=new WeakMap,e(X,"HeaderLink"),(()=>{var e;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=Ce[Symbol.metadata])&&void 0!==e?e:null):void 0;G=[c({type:Boolean,reflect:!0})],J=[c({type:String})],Q=[c({type:String})],Z=[c({type:String})],ee=[c({type:Boolean})],te=[u()],ie=[c({type:Boolean})],ne=[c({type:String})],ae=[c({type:Number})],oe=[c({type:Number})],re=[c({type:Boolean})],se=[c({type:String})],le=[c({type:Boolean})],de=[c({type:String,attribute:"link-title"})],he=[c({type:Boolean,reflect:!0})],ce=[u()],ue=[c({type:Boolean,reflect:!0,attribute:"has-categorical"})],me=[c({type:Boolean,reflect:!0,attribute:"has-multi-column"})],pe=[c({type:Number,reflect:!0,attribute:"data-flyout-columns"})],ve=[c({type:Boolean,reflect:!0,attribute:"fixed-column-widths"})],ke=[c({type:Boolean,reflect:!0,attribute:"full-width-flyout"})],ge=[u()],fe=[u()],ye=[m({slot:"links"})],xe=[u()],we=[u()],be=[u()],t(X,null,G,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:i},Le,We),t(X,null,J,{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:i},Me,Se),t(X,null,Q,{kind:"accessor",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:i},ze,Ee),t(X,null,Z,{kind:"accessor",name:"rel",static:!1,private:!1,access:{has:e=>"rel"in e,get:e=>e.rel,set:(e,t)=>{e.rel=t}},metadata:i},Pe,Ne),t(X,null,ee,{kind:"accessor",name:"isActive",static:!1,private:!1,access:{has:e=>"isActive"in e,get:e=>e.isActive,set:(e,t)=>{e.isActive=t}},metadata:i},Oe,Ae),t(X,null,te,{kind:"accessor",name:"level",static:!1,private:!1,access:{has:e=>"level"in e,get:e=>e.level,set:(e,t)=>{e.level=t}},metadata:i},$e,je),t(X,null,ie,{kind:"accessor",name:"divider",static:!1,private:!1,access:{has:e=>"divider"in e,get:e=>e.divider,set:(e,t)=>{e.divider=t}},metadata:i},qe,Be),t(X,null,ne,{kind:"accessor",name:"searchLabel",static:!1,private:!1,access:{has:e=>"searchLabel"in e,get:e=>e.searchLabel,set:(e,t)=>{e.searchLabel=t}},metadata:i},Fe,Re),t(X,null,ae,{kind:"accessor",name:"searchThreshold",static:!1,private:!1,access:{has:e=>"searchThreshold"in e,get:e=>e.searchThreshold,set:(e,t)=>{e.searchThreshold=t}},metadata:i},Ie,De),t(X,null,oe,{kind:"accessor",name:"linksPerColumn",static:!1,private:!1,access:{has:e=>"linksPerColumn"in e,get:e=>e.linksPerColumn,set:(e,t)=>{e.linksPerColumn=t}},metadata:i},He,Ke),t(X,null,re,{kind:"accessor",name:"hideSearch",static:!1,private:!1,access:{has:e=>"hideSearch"in e,get:e=>e.hideSearch,set:(e,t)=>{e.hideSearch=t}},metadata:i},Ue,Ye),t(X,null,se,{kind:"accessor",name:"backText",static:!1,private:!1,access:{has:e=>"backText"in e,get:e=>e.backText,set:(e,t)=>{e.backText=t}},metadata:i},Ve,Xe),t(X,null,le,{kind:"accessor",name:"leftPadding",static:!1,private:!1,access:{has:e=>"leftPadding"in e,get:e=>e.leftPadding,set:(e,t)=>{e.leftPadding=t}},metadata:i},Ge,Je),t(X,null,de,{kind:"accessor",name:"linkTitle",static:!1,private:!1,access:{has:e=>"linkTitle"in e,get:e=>e.linkTitle,set:(e,t)=>{e.linkTitle=t}},metadata:i},Qe,Ze),t(X,null,he,{kind:"accessor",name:"truncate",static:!1,private:!1,access:{has:e=>"truncate"in e,get:e=>e.truncate,set:(e,t)=>{e.truncate=t}},metadata:i},et,tt),t(X,null,ce,{kind:"accessor",name:"_autoTitle",static:!1,private:!1,access:{has:e=>"_autoTitle"in e,get:e=>e._autoTitle,set:(e,t)=>{e._autoTitle=t}},metadata:i},it,nt),t(X,null,ue,{kind:"accessor",name:"hasCategorical",static:!1,private:!1,access:{has:e=>"hasCategorical"in e,get:e=>e.hasCategorical,set:(e,t)=>{e.hasCategorical=t}},metadata:i},at,ot),t(X,null,me,{kind:"accessor",name:"hasMultiColumn",static:!1,private:!1,access:{has:e=>"hasMultiColumn"in e,get:e=>e.hasMultiColumn,set:(e,t)=>{e.hasMultiColumn=t}},metadata:i},rt,st),t(X,null,pe,{kind:"accessor",name:"flyoutColumns",static:!1,private:!1,access:{has:e=>"flyoutColumns"in e,get:e=>e.flyoutColumns,set:(e,t)=>{e.flyoutColumns=t}},metadata:i},lt,dt),t(X,null,ve,{kind:"accessor",name:"fixedColumnWidths",static:!1,private:!1,access:{has:e=>"fixedColumnWidths"in e,get:e=>e.fixedColumnWidths,set:(e,t)=>{e.fixedColumnWidths=t}},metadata:i},ht,ct),t(X,null,ke,{kind:"accessor",name:"fullWidthFlyout",static:!1,private:!1,access:{has:e=>"fullWidthFlyout"in e,get:e=>e.fullWidthFlyout,set:(e,t)=>{e.fullWidthFlyout=t}},metadata:i},ut,mt),t(X,null,ge,{kind:"accessor",name:"_searchTerm",static:!1,private:!1,access:{has:e=>"_searchTerm"in e,get:e=>e._searchTerm,set:(e,t)=>{e._searchTerm=t}},metadata:i},pt,vt),t(X,null,fe,{kind:"accessor",name:"_slottedLinkCount",static:!1,private:!1,access:{has:e=>"_slottedLinkCount"in e,get:e=>e._slottedLinkCount,set:(e,t)=>{e._slottedLinkCount=t}},metadata:i},kt,gt),t(X,null,ye,{kind:"accessor",name:"slottedEls",static:!1,private:!1,access:{has:e=>"slottedEls"in e,get:e=>e.slottedEls,set:(e,t)=>{e.slottedEls=t}},metadata:i},ft,yt),t(X,null,xe,{kind:"accessor",name:"_leaveTimer",static:!1,private:!1,access:{has:e=>"_leaveTimer"in e,get:e=>e._leaveTimer,set:(e,t)=>{e._leaveTimer=t}},metadata:i},xt,wt),t(X,null,we,{kind:"accessor",name:"_inheritedTruncate",static:!1,private:!1,access:{has:e=>"_inheritedTruncate"in e,get:e=>e._inheritedTruncate,set:(e,t)=>{e._inheritedTruncate=t}},metadata:i},bt,_t),t(X,null,be,{kind:"accessor",name:"menuPosition",static:!1,private:!1,access:{has:e=>"menuPosition"in e,get:e=>e.menuPosition,set:(e,t)=>{e.menuPosition=t}},metadata:i},Tt,Ct),t(null,V={value:X},_e,{kind:"class",name:X.name,metadata:i},null,Te),X=V.value,i&&Object.defineProperty(X,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),X.styles=l(w),i(X,Te),X})();export{b as HeaderLink};
|
|
727
772
|
//# sourceMappingURL=headerLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headerLink.js","sources":["../../../../src/components/global/header/headerLink.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS } from 'lit';\nimport {\n customElement,\n property,\n state,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { debounce } from '../../../common/helpers/helpers';\nimport HeaderLinkScss from './headerLink.scss?inline';\nimport '../../reusable/textInput';\nimport arrowIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/chevron-right.svg';\nimport backIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/arrow-left.svg';\nimport searchIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/search.svg';\n\nexport type HeaderLinkTarget = '_self' | '_blank' | '_parent' | '_top';\n\n/**\n * Component for navigation links within the Header.\n * @fires on-click - Captures the click event and emits the original event details. `detail:{ origEvent: Event ,defaultPrevented: boolean}`\n * @slot unnamed - Slot for link text/content.\n * @slot links - Slot for sublinks (up to two levels).\n * @slot icon - Slot for icon.\n */\n@customElement('kyn-header-link')\nexport class HeaderLink extends LitElement {\n static override styles = unsafeCSS(HeaderLinkScss);\n\n /** Link open state.\n * @internal\n */\n @property({ type: Boolean, reflect: true })\n accessor open = false;\n\n /** Link url. */\n @property({ type: String })\n accessor href = '';\n\n /** Defines a target attribute for where to load the URL. Possible options include \"_self\" (default), \"_blank\", \"_parent\", \"_top\" */\n @property({ type: String })\n accessor target: HeaderLinkTarget = '_self';\n\n /** Defines a relationship between a linked resource and the document. An empty string (default) means no particular relationship */\n @property({ type: String })\n accessor rel = '';\n\n /** Link active state, for example when URL path matches link href. */\n @property({ type: Boolean })\n accessor isActive = false;\n\n /** Link level, supports two levels.\n * @ignore\n */\n @state()\n accessor level = 1;\n\n /** DEPRECATED. Adds a 1px shadow to the bottom of the link. */\n @property({ type: Boolean })\n accessor divider = false;\n\n /** Label for sub-menu link search input, which is visible with > 5 sub-links. */\n @property({ type: String })\n accessor searchLabel = 'Search';\n\n /** Number of child links required to show search input. */\n @property({ type: Number })\n accessor searchThreshold = 6;\n\n /** Maximum number of links per column in plain (non-categorical) flyouts.\n * When set to a positive number and the slotted link count exceeds this value,\n * additional columns are created automatically. Default 0 (auto — no column splitting).\n */\n @property({ type: Number })\n accessor linksPerColumn = 0;\n\n /** Hide the search input regardless of the number of child links. */\n @property({ type: Boolean })\n accessor hideSearch = false;\n\n /** Text for mobile \"Back\" button. */\n @property({ type: String })\n accessor backText = 'Back';\n\n /** Add left padding when icon is not provided to align text with links that do have icons. */\n @property({ type: Boolean })\n accessor leftPadding = false;\n\n /** Title attribute for the link, shown as a tooltip on hover. Useful for truncated text.\n * @internal\n */\n @property({ type: String, attribute: 'link-title' })\n accessor linkTitle = '';\n\n /** When true, long text truncates with ellipsis. Default: false (text wraps normally). */\n @property({ type: Boolean, reflect: true })\n accessor truncate = false;\n\n /** Auto-derived title from slot content, used if linkTitle is not set.\n * @internal\n */\n @state()\n accessor _autoTitle = '';\n\n /** Indicates whether this link contains categorical navigation (kyn-header-categories or kyn-header-category).\n * @internal\n */\n @property({ type: Boolean, reflect: true, attribute: 'has-categorical' })\n accessor hasCategorical = false;\n\n /** Indicates whether this link contains multi-column categorical navigation (kyn-header-categories wrapper).\n * Used to distinguish multi-column flyouts from single-column category lists.\n * @internal\n */\n @property({ type: Boolean, reflect: true, attribute: 'has-multi-column' })\n accessor hasMultiColumn = false;\n\n /** Number of columns in the categorical flyout (for width adjustment).\n * @internal\n */\n @property({ type: Number, reflect: true, attribute: 'data-flyout-columns' })\n accessor flyoutColumns = 0;\n\n /** Mirrors `fixed-column-widths` from nested kyn-header-categories.\n * @internal\n */\n @property({ type: Boolean, reflect: true, attribute: 'fixed-column-widths' })\n accessor fixedColumnWidths = false;\n\n /** Forces the desktop flyout to use the full-width categorical Global Switcher layout. */\n @property({ type: Boolean, reflect: true, attribute: 'full-width-flyout' })\n accessor fullWidthFlyout = false;\n\n /** Current search term for filtering links in the flyout.\n * @internal\n */\n @state()\n accessor _searchTerm = '';\n\n /** Number of slotted plain links (non-categorical), used for column calculation.\n * @internal\n */\n @state()\n accessor _slottedLinkCount = 0;\n\n /**\n * Queries any slotted HTML elements.\n * @ignore\n */\n @queryAssignedElements({ slot: 'links' })\n accessor slottedEls!: Array<HTMLElement>;\n\n /** Timeout function to delay flyout open.\n * @internal\n */\n _enterTimer: any;\n\n /** Timeout function to delay flyout close.\n * @internal\n */\n @state()\n accessor _leaveTimer: any;\n\n /** Suppresses pointer-leave close during internal view transitions (e.g. \"More\" click).\n * @internal\n */\n private _viewChangeInProgress = false;\n\n /**\n * @internal\n */\n private _viewChangeTimer: any;\n\n /** Cached truncation state from parent nav\n * @internal\n */\n @state()\n accessor _inheritedTruncate = false;\n\n /** Observer for `truncate-links` changes on the owning nav.\n * @internal\n */\n private _truncateObserver?: MutationObserver;\n\n /**\n * @internal\n */\n private _observedNav: HTMLElement | null = null;\n\n /** Menu positioning\n * @internal\n */\n @state()\n accessor menuPosition: any = {};\n\n override render() {\n const classes = {\n menu: this.slottedEls.length,\n [`level--${this.level}`]: true,\n divider: this.divider,\n 'full-width-flyout': this.fullWidthFlyout,\n open: this.open || (this.level === 1 && this.isActive),\n };\n\n // Check if truncation should be applied (individual prop or inherited from nav)\n const shouldTruncate = this.truncate || this._inheritedTruncate;\n\n const linkClasses = {\n 'nav-link': true,\n active: this.isActive,\n interactive: this.level == 1,\n 'padding-left': this.leftPadding,\n truncate: shouldTruncate,\n };\n\n const menuClasses = {\n menu__content: true,\n slotted: this.slottedEls.length,\n };\n\n const Links = this.querySelectorAll(\n ':scope > kyn-header-link, :scope > kyn-header-category > kyn-header-link'\n );\n\n const showSearch = !this.hideSearch && Links.length >= this.searchThreshold;\n\n const wrapperClasses = {\n wrapper: true,\n 'no-search': !showSearch,\n };\n\n return html`\n <div\n class=\"${classMap(classes)}\"\n @pointerleave=${(e: PointerEvent) => this.handlePointerLeave(e)}\n @pointerenter=${(e: PointerEvent) => this.handlePointerEnter(e)}\n >\n <a\n target=${this.target}\n rel=${this.rel}\n href=${this.href}\n title=${ifDefined(\n this.linkTitle ||\n (this.slottedEls.length === 0 ? this._autoTitle : '') ||\n undefined\n )}\n class=${classMap(linkClasses)}\n @click=${(e: Event) => this.handleClick(e)}\n @pointerenter=${(e: PointerEvent) => this.handlePointerEnter(e)}\n >\n <slot name=\"icon\"></slot>\n <slot @slotchange=${this._handleDefaultSlotChange}></slot>\n\n ${this.slottedEls.length\n ? html` <span class=\"arrow\">${unsafeSVG(arrowIcon)}</span> `\n : null}\n </a>\n\n <div\n class=${classMap(menuClasses)}\n style=${styleMap(this.menuPosition)}\n >\n <div class=${classMap(wrapperClasses)}>\n <button\n class=\"go-back\"\n type=\"button\"\n @click=${(e: Event) => this._handleBack(e)}\n >\n <span>${unsafeSVG(backIcon)}</span>\n ${this.backText}\n </button>\n ${showSearch\n ? html`\n <kyn-text-input\n hideLabel\n size=\"sm\"\n type=\"search\"\n label=${this.searchLabel}\n placeholder=${this.searchLabel}\n value=${this._searchTerm}\n @on-input=${(e: Event) => this._handleSearch(e)}\n >\n <span slot=\"icon\" class=\"search-icon\">\n ${unsafeSVG(searchIcon)}\n </span>\n ${this.searchLabel}\n </kyn-text-input>\n `\n : null}\n\n <div\n class=\"links-columns\"\n style=${styleMap(this._linksColumnStyles)}\n >\n <slot\n name=\"links\"\n @slotchange=${this._handleLinksSlotChange}\n ></slot>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n /** Compute inline styles for the links-columns wrapper.\n * Only applies multi-column layout for plain (non-categorical) flyouts\n * when the number of links exceeds linksPerColumn.\n * @internal\n */\n private get _linksColumnStyles() {\n if (\n !this.hasCategorical &&\n this.linksPerColumn > 0 &&\n this._slottedLinkCount > this.linksPerColumn\n ) {\n const columnCount = Math.ceil(\n this._slottedLinkCount / this.linksPerColumn\n );\n return { 'column-count': columnCount.toString() };\n }\n return {};\n }\n\n private _handleSearch(e: any) {\n this._searchTerm = e.detail.value.toLowerCase();\n this._searchFilter();\n }\n\n private _searchFilter() {\n const Links: any = this.querySelectorAll(\n ':scope > kyn-header-link, :scope > kyn-header-category > kyn-header-link'\n );\n\n Links.forEach((link: any) => {\n // get link text\n const textSlot = link.shadowRoot?.querySelector(\n 'slot:not([name])'\n ) as HTMLSlotElement | null;\n const nodes: any = textSlot?.assignedNodes({ flatten: true }) ?? [];\n let linkText = '';\n for (let i = 0; i < nodes.length; i++) {\n linkText += nodes[i].textContent.trim();\n }\n\n if (linkText.toLowerCase().includes(this._searchTerm)) {\n link.style.display = 'block';\n } else {\n link.style.display = 'none';\n }\n });\n\n this._positionMenu();\n }\n\n /** Extract text content from the default slot to use as auto-title */\n private _handleDefaultSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n const nodes = slot.assignedNodes({ flatten: true });\n let textContent = '';\n for (const node of nodes) {\n textContent += node.textContent?.trim() ?? '';\n }\n this._autoTitle = textContent.trim();\n }\n\n private _handleBack(e?: Event) {\n if (e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n // detect if we're inside the categorized/mega nav variant\n const headerCategories = this.closest('kyn-header-categories') as\n | (HTMLElement & { handleBackClick?: (evt?: Event) => void })\n | null;\n\n if (headerCategories?.handleBackClick) {\n headerCategories.handleBackClick(e);\n\n // Close any open header links under this nav\n const navRoot =\n (this.closest('kyn-header-nav') as HTMLElement | null) ??\n headerCategories;\n\n const links = navRoot.querySelectorAll<HTMLElement & { open?: boolean }>(\n 'kyn-header-link[open]'\n );\n\n links.forEach((link) => {\n link.removeAttribute('open');\n if ('open' in link) {\n (link as any).open = false;\n }\n });\n\n // Clear local search for this column\n this._searchTerm = '';\n this._searchFilter();\n\n return;\n }\n\n // BASIC NAV:\n // Preserve original behavior: go up one level\n this.open = false;\n this._searchTerm = '';\n this._searchFilter();\n }\n\n private _handleLinksSlotChange() {\n // Detect if this link contains categorical navigation\n const hasCategories = this.querySelector('kyn-header-categories') !== null;\n const hasCategory = this.querySelector('kyn-header-category') !== null;\n const categoriesEl =\n this.querySelector('kyn-tab-panel[visible] kyn-header-categories') ||\n this.querySelector('kyn-header-categories');\n\n this.hasCategorical = hasCategories || hasCategory;\n this.hasMultiColumn = hasCategories; // Only true for multi-column wrapper\n this.fixedColumnWidths =\n categoriesEl?.hasAttribute('fixed-column-widths') ?? false;\n\n // Prime flyout column count before open so width/layout CSS can apply\n // without a second-pass visual snap.\n if (categoriesEl) {\n const dataCol = categoriesEl.getAttribute('data-columns');\n this.flyoutColumns = dataCol ? parseInt(dataCol, 10) || 0 : 0;\n } else {\n this.flyoutColumns = 0;\n }\n\n // Count direct child plain links for column wrapping\n const plainLinks = this.querySelectorAll(':scope > kyn-header-link');\n this._slottedLinkCount = plainLinks.length;\n\n this.requestUpdate();\n }\n\n /** Handle column count changes from slotted kyn-header-categories\n * @internal\n */\n private _handleColumnCountChange = (e: Event) => {\n const detail = (\n e as CustomEvent<{\n columnCount: number;\n fixedColumnWidths?: boolean;\n }>\n ).detail;\n if (detail?.columnCount !== undefined) {\n this.flyoutColumns = detail.columnCount;\n this.fixedColumnWidths = Boolean(detail.fixedColumnWidths);\n }\n };\n\n /**\n * @internal\n */\n private get _isDesktopViewport(): boolean {\n if (typeof window === 'undefined') return true;\n return window.innerWidth >= 672;\n }\n\n private handlePointerEnter(e: PointerEvent) {\n if (\n e.pointerType === 'mouse' &&\n this.slottedEls.length &&\n this._isDesktopViewport\n ) {\n clearTimeout(this._leaveTimer);\n\n // close other open sibling links immediately when entering any link with submenus\n this._closeOtherOpenLinks();\n\n this._enterTimer = setTimeout(() => {\n // Close siblings again right before opening to prevent race conditions\n this._closeOtherOpenLinks();\n this.open = true;\n }, 150);\n }\n }\n\n /** close other open header links at the same level\n * @internal\n */\n private _closeOtherOpenLinks(): void {\n // Strategy: Close all sibling header-links that are currently open\n // This handles the sidebar nav where links are direct children of header-nav\n\n // For level 1 links (main sidebar), find siblings via parent\n if (this.level === 1) {\n const parent = this.parentElement;\n if (parent) {\n // Find ALL level 1 links (not just open ones) to clear pending timers\n const siblingLinks = parent.querySelectorAll<\n HTMLElement & { open?: boolean; _enterTimer?: any }\n >(':scope > kyn-header-link');\n\n siblingLinks.forEach((link) => {\n if (link !== this) {\n // Clear any pending timers\n if ((link as any)._enterTimer) {\n clearTimeout((link as any)._enterTimer);\n (link as any)._enterTimer = undefined;\n }\n if ((link as any)._leaveTimer) {\n clearTimeout((link as any)._leaveTimer);\n (link as any)._leaveTimer = undefined;\n }\n // Force close - set property, remove attribute, and force re-render\n if ((link as any).open) {\n (link as any).open = false;\n link.removeAttribute('open');\n (link as any).requestUpdate?.();\n }\n }\n });\n }\n return;\n }\n\n // For nested links, find the nearest container and close same-level links\n const navContainer =\n this.closest('kyn-header-nav') ||\n this.closest('kyn-tab-panel') ||\n this.closest('.menu__content');\n\n if (navContainer) {\n const allLinks = navContainer.querySelectorAll<\n HTMLElement & { open?: boolean; level?: number; _enterTimer?: any }\n >('kyn-header-link');\n\n allLinks.forEach((link) => {\n if (link !== this && (link as any).level === this.level) {\n // Clear any pending timers\n if ((link as any)._enterTimer) {\n clearTimeout((link as any)._enterTimer);\n (link as any)._enterTimer = undefined;\n }\n if ((link as any)._leaveTimer) {\n clearTimeout((link as any)._leaveTimer);\n (link as any)._leaveTimer = undefined;\n }\n // Force close - set property, remove attribute, and force re-render\n if ((link as any).open) {\n (link as any).open = false;\n link.removeAttribute('open');\n (link as any).requestUpdate?.();\n }\n }\n });\n }\n }\n\n private handlePointerLeave(e: PointerEvent) {\n // Suppress close during internal view transitions (e.g. \"More\" → detail view).\n // The flyout resizes and the cursor may end up outside, but the user's intent\n // was to drill in — not to leave.\n if (this._viewChangeInProgress) {\n return;\n }\n\n // check both the link's own prop and parent nav's prop\n // if either is false, don't auto-close the flyout\n const shouldAutoCollapse = this._shouldAutoCollapse();\n if (!shouldAutoCollapse) {\n return;\n }\n\n if (\n e.pointerType === 'mouse' &&\n this.slottedEls.length &&\n this._searchTerm === '' &&\n this._isDesktopViewport\n ) {\n clearTimeout(this._enterTimer);\n this._leaveTimer = setTimeout(() => {\n this.open = false;\n }, 150);\n }\n }\n\n /** Check if flyout should auto-collapse based on parent nav's autoOpenFlyout.\n * Only applies to links containing categorical nav (kyn-header-categories).\n * @internal\n */\n private _shouldAutoCollapse(): boolean {\n // Non-categorical links always auto-collapse (preserve original behavior)\n if (!this.hasCategorical && !this.fullWidthFlyout) {\n return true;\n }\n\n const parentNav = this.closest('kyn-header-nav') as\n | (HTMLElement & { autoOpenFlyout?: string })\n | null;\n\n // If parent nav has autoOpenFlyout set (truthy), don't auto-collapse\n if (parentNav?.autoOpenFlyout) {\n return false;\n }\n\n return true;\n }\n\n private handleClick(e: Event) {\n let preventDefault = false;\n\n if (this.slottedEls.length) {\n preventDefault = true;\n e.preventDefault();\n // Close other open links before toggling this one\n if (!this.open) {\n this._closeOtherOpenLinks();\n }\n this.open = !this.open;\n } else {\n this._closeOtherOpenLinks();\n }\n\n const event = new CustomEvent('on-click', {\n detail: { origEvent: e, defaultPrevented: preventDefault },\n });\n this.dispatchEvent(event);\n }\n\n private handleClickOut(e: Event) {\n if (!e.composedPath().includes(this)) {\n this.open = false;\n this._searchTerm = '';\n this._searchFilter();\n }\n }\n\n private determineLevel() {\n let level = 1;\n let node: any = this.parentNode;\n\n // Traverse up the DOM tree\n while (node) {\n if (node.nodeName === 'KYN-HEADER-LINK') {\n level = (node.level ?? 1) + 1;\n break;\n } else if (\n node.nodeName === 'KYN-HEADER-CATEGORY' &&\n node.parentNode?.nodeName === 'KYN-HEADER-LINK'\n ) {\n level = (node.parentNode.level ?? 1) + 1;\n break;\n } else if (\n window.innerWidth < 672 &&\n node.nodeName === 'KYN-HEADER-FLYOUT'\n ) {\n level = 2;\n break;\n }\n node = node.parentNode;\n }\n\n this.level = level;\n }\n\n private _positionMenu() {\n const linkBounds = this.getBoundingClientRect?.();\n const menuEl =\n this.shadowRoot?.querySelector<HTMLElement>('.menu__content');\n const menuBounds = menuEl?.getBoundingClientRect?.();\n\n if (!linkBounds || !menuBounds) {\n return;\n }\n\n const Padding = 12;\n const HeaderHeight = 64;\n\n const linkHalf = linkBounds.top + linkBounds.height / 2;\n const menuHalf = menuBounds.height / 2;\n\n const topCandidate =\n linkHalf + menuHalf > window.innerHeight\n ? linkHalf - menuHalf - (linkHalf + menuHalf - window.innerHeight) - 16\n : linkHalf - menuHalf;\n\n if (this.level === 1) {\n // Keep level-1 flyouts pinned to the nav rail origin (legacy behavior).\n // This avoids viewport/header bound drift and keeps panels consistently aligned.\n let navMenuHeight = 0;\n const headerNav = this.closest('kyn-header-nav') as HTMLElement | null;\n if (headerNav) {\n const navMenu = headerNav.shadowRoot?.querySelector(\n '.menu__content'\n ) as HTMLElement | null;\n if (navMenu) {\n navMenuHeight = navMenu.offsetHeight;\n }\n }\n\n this.menuPosition = {\n top: HeaderHeight + 'px',\n left: '0px',\n minHeight: navMenuHeight + 'px',\n };\n } else {\n const top = topCandidate < HeaderHeight ? HeaderHeight : topCandidate;\n this.menuPosition = {\n top: top + 'px',\n left: linkBounds.right + Padding + 'px',\n };\n }\n }\n\n /** @internal */\n private _debounceResize = debounce(() => {\n this.determineLevel();\n if (this.open) {\n this._positionMenu();\n }\n });\n\n override firstUpdated() {\n this.determineLevel();\n this._handleLinksSlotChange();\n }\n\n override updated(changedProps: any) {\n // Re-position after render when the menu has its actual dimensions\n if (changedProps.has('open') && this.open) {\n // Use rAF to ensure the DOM has painted\n requestAnimationFrame(() => {\n this._positionMenu();\n });\n }\n\n // Re-position when column count changes (categories may render after flyout opens)\n if (changedProps.has('flyoutColumns') && this.open) {\n requestAnimationFrame(() => {\n this._positionMenu();\n });\n }\n }\n\n /**\n * @internal\n */\n private _handleDocumentClick = (e: Event) => this.handleClickOut(e);\n\n /** Suppress pointer-leave close when categories switch views (root ↔ detail).\n * @internal\n */\n private _handleNavChange = () => {\n this._viewChangeInProgress = true;\n clearTimeout(this._viewChangeTimer);\n // Allow enough time for the flyout to finish resizing before re-enabling close\n this._viewChangeTimer = setTimeout(() => {\n this._viewChangeInProgress = false;\n }, 500);\n };\n\n override connectedCallback() {\n super.connectedCallback();\n document.addEventListener('click', this._handleDocumentClick);\n window.addEventListener('resize', this._debounceResize);\n // Listen for column count changes from slotted kyn-header-categories\n this.addEventListener(\n 'on-column-count-change',\n this._handleColumnCountChange\n );\n // Suppress flyout close during internal view transitions (e.g. \"More\" click)\n this.addEventListener('on-nav-change', this._handleNavChange);\n // Check for truncation inheritance after DOM is ready\n queueMicrotask(() => {\n this._observeParentNavTruncate();\n });\n }\n\n /** Find the closest owning nav across shadow boundaries.\n * @internal\n */\n private _resolveOwningNav(): HTMLElement | null {\n const parentNav = this.closest('kyn-header-nav');\n if (parentNav) return parentNav as HTMLElement;\n\n let root = this.getRootNode();\n while (root instanceof ShadowRoot) {\n const nav = root.host.closest?.('kyn-header-nav');\n if (nav) {\n return nav as HTMLElement;\n }\n root = root.host.getRootNode();\n }\n\n return null;\n }\n\n /** Sync inherited truncate state with the owning nav.\n * @internal\n */\n private _syncInheritedTruncate = (): void => {\n this._inheritedTruncate = this._isInTruncatingNav();\n };\n\n /** Observe `truncate-links` changes on the owning nav.\n * @internal\n */\n private _observeParentNavTruncate(): void {\n const nav = this._resolveOwningNav();\n\n if (this._observedNav === nav) {\n this._syncInheritedTruncate();\n return;\n }\n\n if (this._truncateObserver) {\n this._truncateObserver.disconnect();\n this._truncateObserver = undefined;\n }\n\n this._observedNav = nav;\n\n if (nav) {\n this._truncateObserver = new MutationObserver(() => {\n this._syncInheritedTruncate();\n });\n this._truncateObserver.observe(nav, {\n attributes: true,\n attributeFilter: ['truncate-links'],\n });\n }\n\n this._syncInheritedTruncate();\n }\n\n /** Check if this link is inside a nav with truncate-links attribute\n * Uses getRootNode to traverse up through shadow DOM boundaries\n * @internal\n */\n private _isInTruncatingNav(): boolean {\n return this._resolveOwningNav()?.hasAttribute('truncate-links') ?? false;\n }\n\n override disconnectedCallback() {\n // clear timers to avoid callbacks after unmount\n if (this._enterTimer) {\n clearTimeout(this._enterTimer);\n this._enterTimer = undefined;\n }\n if (this._leaveTimer) {\n clearTimeout(this._leaveTimer);\n this._leaveTimer = undefined;\n }\n\n if (this._viewChangeTimer) {\n clearTimeout(this._viewChangeTimer);\n this._viewChangeTimer = undefined;\n }\n\n document.removeEventListener('click', this._handleDocumentClick);\n window.removeEventListener('resize', this._debounceResize);\n this.removeEventListener(\n 'on-column-count-change',\n this._handleColumnCountChange\n );\n this.removeEventListener('on-nav-change', this._handleNavChange);\n if (this._truncateObserver) {\n this._truncateObserver.disconnect();\n this._truncateObserver = undefined;\n }\n this._observedNav = null;\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-header-link': HeaderLink;\n }\n}\n"],"names":["HeaderLink","customElement","LitElement","_classThis","_classSuper","_HeaderLink_open_accessor_storage","set","this","__runInitializers","_open_initializers","_HeaderLink_href_accessor_storage","_open_extraInitializers","_href_initializers","_HeaderLink_target_accessor_storage","_href_extraInitializers","_target_initializers","_HeaderLink_rel_accessor_storage","_target_extraInitializers","_rel_initializers","_HeaderLink_isActive_accessor_storage","_rel_extraInitializers","_isActive_initializers","_HeaderLink_level_accessor_storage","_isActive_extraInitializers","_level_initializers","_HeaderLink_divider_accessor_storage","_level_extraInitializers","_divider_initializers","_HeaderLink_searchLabel_accessor_storage","_divider_extraInitializers","_searchLabel_initializers","_HeaderLink_searchThreshold_accessor_storage","_searchLabel_extraInitializers","_searchThreshold_initializers","_HeaderLink_linksPerColumn_accessor_storage","_searchThreshold_extraInitializers","_linksPerColumn_initializers","_HeaderLink_hideSearch_accessor_storage","_linksPerColumn_extraInitializers","_hideSearch_initializers","_HeaderLink_backText_accessor_storage","_hideSearch_extraInitializers","_backText_initializers","_HeaderLink_leftPadding_accessor_storage","_backText_extraInitializers","_leftPadding_initializers","_HeaderLink_linkTitle_accessor_storage","_leftPadding_extraInitializers","_linkTitle_initializers","_HeaderLink_truncate_accessor_storage","_linkTitle_extraInitializers","_truncate_initializers","_HeaderLink__autoTitle_accessor_storage","_truncate_extraInitializers","__autoTitle_initializers","_HeaderLink_hasCategorical_accessor_storage","__autoTitle_extraInitializers","_hasCategorical_initializers","_HeaderLink_hasMultiColumn_accessor_storage","_hasCategorical_extraInitializers","_hasMultiColumn_initializers","_HeaderLink_flyoutColumns_accessor_storage","_hasMultiColumn_extraInitializers","_flyoutColumns_initializers","_HeaderLink_fixedColumnWidths_accessor_storage","_flyoutColumns_extraInitializers","_fixedColumnWidths_initializers","_HeaderLink_fullWidthFlyout_accessor_storage","_fixedColumnWidths_extraInitializers","_fullWidthFlyout_initializers","_HeaderLink__searchTerm_accessor_storage","_fullWidthFlyout_extraInitializers","__searchTerm_initializers","_HeaderLink__slottedLinkCount_accessor_storage","__searchTerm_extraInitializers","__slottedLinkCount_initializers","_HeaderLink_slottedEls_accessor_storage","__slottedLinkCount_extraInitializers","_slottedEls_initializers","_enterTimer","_slottedEls_extraInitializers","_HeaderLink__leaveTimer_accessor_storage","__leaveTimer_initializers","_viewChangeInProgress","__leaveTimer_extraInitializers","_HeaderLink__inheritedTruncate_accessor_storage","__inheritedTruncate_initializers","_truncateObserver","__inheritedTruncate_extraInitializers","_observedNav","_HeaderLink_menuPosition_accessor_storage","_menuPosition_initializers","_handleColumnCountChange","_menuPosition_extraInitializers","e","detail","undefined","columnCount","flyoutColumns","fixedColumnWidths","Boolean","_debounceResize","debounce","determineLevel","open","_positionMenu","_handleDocumentClick","handleClickOut","_handleNavChange","clearTimeout","_viewChangeTimer","setTimeout","_syncInheritedTruncate","_inheritedTruncate","_isInTruncatingNav","__classPrivateFieldGet","value","__classPrivateFieldSet","href","target","rel","isActive","level","divider","searchLabel","searchThreshold","linksPerColumn","hideSearch","backText","leftPadding","linkTitle","truncate","_autoTitle","hasCategorical","hasMultiColumn","fullWidthFlyout","_searchTerm","_slottedLinkCount","slottedEls","_leaveTimer","menuPosition","render","classes","menu","length","shouldTruncate","linkClasses","active","interactive","menuClasses","menu__content","slotted","Links","querySelectorAll","showSearch","wrapperClasses","wrapper","html","classMap","handlePointerLeave","handlePointerEnter","ifDefined","handleClick","_handleDefaultSlotChange","unsafeSVG","arrowIcon","styleMap","_handleBack","backIcon","_handleSearch","searchIcon","_linksColumnStyles","_handleLinksSlotChange","Math","ceil","toString","toLowerCase","_searchFilter","forEach","link","textSlot","_a","shadowRoot","querySelector","nodes","_b","assignedNodes","flatten","linkText","i","textContent","trim","includes","style","display","node","preventDefault","stopPropagation","headerCategories","closest","handleBackClick","removeAttribute","hasCategories","hasCategory","categoriesEl","hasAttribute","dataCol","getAttribute","parseInt","plainLinks","requestUpdate","_isDesktopViewport","window","innerWidth","pointerType","_closeOtherOpenLinks","parent","parentElement","navContainer","_shouldAutoCollapse","parentNav","autoOpenFlyout","event","CustomEvent","origEvent","defaultPrevented","dispatchEvent","composedPath","parentNode","nodeName","_c","linkBounds","getBoundingClientRect","menuEl","menuBounds","call","linkHalf","top","height","menuHalf","topCandidate","innerHeight","navMenuHeight","headerNav","navMenu","_d","offsetHeight","HeaderHeight","left","minHeight","right","firstUpdated","updated","changedProps","has","requestAnimationFrame","connectedCallback","super","document","addEventListener","queueMicrotask","_observeParentNavTruncate","_resolveOwningNav","root","getRootNode","ShadowRoot","nav","host","disconnect","MutationObserver","observe","attributes","attributeFilter","disconnectedCallback","removeEventListener","property","type","reflect","_href_decorators","String","_target_decorators","_rel_decorators","_isActive_decorators","_level_decorators","state","_divider_decorators","_searchLabel_decorators","_searchThreshold_decorators","Number","_linksPerColumn_decorators","_hideSearch_decorators","_backText_decorators","_leftPadding_decorators","attribute","__autoTitle_decorators","_hasCategorical_decorators","_hasMultiColumn_decorators","_flyoutColumns_decorators","_fixedColumnWidths_decorators","_fullWidthFlyout_decorators","__searchTerm_decorators","__slottedLinkCount_decorators","_slottedEls_decorators","queryAssignedElements","slot","__leaveTimer_decorators","__inheritedTruncate_decorators","_menuPosition_decorators","__esDecorate","_open_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","_linkTitle_decorators","_truncate_decorators","_classDescript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,uBAAAA,EAAAC,IAAAD,GAAAA,EAAS1M,mBAAkB3G,IAAA,CAAAqT,EAAAvM,KAAAuM,EAAlB1M,mBAAkBG,CAAA,GAAAyM,SAAAC,GAAAxO,GAAAE,IAgB3B4N,EAAAjT,EAAA,KAAAgT,GAAA,CAAAG,KAAA,WAAAC,KAAA,eAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAA5D,IAAA6D,GAAA,iBAAAA,EAAAC,IAAAD,GAAAA,EAAS/K,aAAYtI,IAAA,CAAAqT,EAAAvM,KAAAuM,EAAZ/K,aAAYxB,CAAA,GAAAyM,SAAAC,GAAAnO,GAAAE,IAvKvBuN,EAAA,KAAAa,EAAA,CAAA7M,MAAAjH,GAAA+T,GAAA,CAAAZ,KAAA,QAAAC,KAAApT,EAAAoT,KAAAM,SAAAC,GAAA,KAAAK,kHACkBhU,EAAAiU,OAASC,EAAUC,GADxB9T,EAAAL,EAAAgU,OAAU"}
|
|
1
|
+
{"version":3,"file":"headerLink.js","sources":["../../../../src/components/global/header/headerLink.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS } from 'lit';\nimport {\n customElement,\n property,\n state,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { debounce } from '../../../common/helpers/helpers';\nimport HeaderLinkScss from './headerLink.scss?inline';\nimport '../../reusable/textInput';\nimport arrowIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/chevron-right.svg';\nimport backIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/arrow-left.svg';\nimport searchIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/search.svg';\n\nexport type HeaderLinkTarget = '_self' | '_blank' | '_parent' | '_top';\n\n/**\n * Component for navigation links within the Header.\n * @fires on-click - Captures the click event and emits the original event details. `detail:{ origEvent: Event ,defaultPrevented: boolean}`\n * @slot unnamed - Slot for link text/content.\n * @slot links - Slot for sublinks (up to two levels).\n * @slot icon - Slot for icon.\n */\n@customElement('kyn-header-link')\nexport class HeaderLink extends LitElement {\n static override styles = unsafeCSS(HeaderLinkScss);\n\n /** Link open state.\n * @internal\n */\n @property({ type: Boolean, reflect: true })\n accessor open = false;\n\n /** Link url. */\n @property({ type: String })\n accessor href = '';\n\n /** Defines a target attribute for where to load the URL. Possible options include \"_self\" (default), \"_blank\", \"_parent\", \"_top\" */\n @property({ type: String })\n accessor target: HeaderLinkTarget = '_self';\n\n /** Defines a relationship between a linked resource and the document. An empty string (default) means no particular relationship */\n @property({ type: String })\n accessor rel = '';\n\n /** Link active state, for example when URL path matches link href. */\n @property({ type: Boolean })\n accessor isActive = false;\n\n /** Link level, supports two levels.\n * @ignore\n */\n @state()\n accessor level = 1;\n\n /** DEPRECATED. Adds a 1px shadow to the bottom of the link. */\n @property({ type: Boolean })\n accessor divider = false;\n\n /** Label for sub-menu link search input, which is visible with > 5 sub-links. */\n @property({ type: String })\n accessor searchLabel = 'Search';\n\n /** Number of child links required to show search input. */\n @property({ type: Number })\n accessor searchThreshold = 6;\n\n /** Maximum number of links per column in plain (non-categorical) flyouts.\n * When set to a positive number and the slotted link count exceeds this value,\n * additional columns are created automatically. Default 0 (auto — no column splitting).\n */\n @property({ type: Number })\n accessor linksPerColumn = 0;\n\n /** Hide the search input regardless of the number of child links. */\n @property({ type: Boolean })\n accessor hideSearch = false;\n\n /** Text for mobile \"Back\" button. */\n @property({ type: String })\n accessor backText = 'Back';\n\n /** Add left padding when icon is not provided to align text with links that do have icons. */\n @property({ type: Boolean })\n accessor leftPadding = false;\n\n /** Title attribute for the link, shown as a tooltip on hover. Useful for truncated text.\n * @internal\n */\n @property({ type: String, attribute: 'link-title' })\n accessor linkTitle = '';\n\n /** When true, long text truncates with ellipsis. Default: false (text wraps normally). */\n @property({ type: Boolean, reflect: true })\n accessor truncate = false;\n\n /** Auto-derived title from slot content, used if linkTitle is not set.\n * @internal\n */\n @state()\n accessor _autoTitle = '';\n\n /** Indicates whether this link contains categorical navigation (kyn-header-categories or kyn-header-category).\n * @internal\n */\n @property({ type: Boolean, reflect: true, attribute: 'has-categorical' })\n accessor hasCategorical = false;\n\n /** Indicates whether this link contains multi-column categorical navigation (kyn-header-categories wrapper).\n * Used to distinguish multi-column flyouts from single-column category lists.\n * @internal\n */\n @property({ type: Boolean, reflect: true, attribute: 'has-multi-column' })\n accessor hasMultiColumn = false;\n\n /** Number of columns in the categorical flyout (for width adjustment).\n * @internal\n */\n @property({ type: Number, reflect: true, attribute: 'data-flyout-columns' })\n accessor flyoutColumns = 0;\n\n /** Mirrors `fixed-column-widths` from nested kyn-header-categories.\n * @internal\n */\n @property({ type: Boolean, reflect: true, attribute: 'fixed-column-widths' })\n accessor fixedColumnWidths = false;\n\n /** Forces the desktop flyout to use the full-width categorical Global Switcher layout. */\n @property({ type: Boolean, reflect: true, attribute: 'full-width-flyout' })\n accessor fullWidthFlyout = false;\n\n /** Current search term for filtering links in the flyout.\n * @internal\n */\n @state()\n accessor _searchTerm = '';\n\n /** Number of slotted plain links (non-categorical), used for column calculation.\n * @internal\n */\n @state()\n accessor _slottedLinkCount = 0;\n\n /**\n * Queries any slotted HTML elements.\n * @ignore\n */\n @queryAssignedElements({ slot: 'links' })\n accessor slottedEls!: Array<HTMLElement>;\n\n /** Timeout function to delay flyout open.\n * @internal\n */\n _enterTimer: any;\n\n /** Timeout function to delay flyout close.\n * @internal\n */\n @state()\n accessor _leaveTimer: any;\n\n /** Suppresses pointer-leave close during internal view transitions (e.g. \"More\" click).\n * @internal\n */\n private _viewChangeInProgress = false;\n\n /**\n * @internal\n */\n private _viewChangeTimer: any;\n\n /** Cached truncation state from parent nav\n * @internal\n */\n @state()\n accessor _inheritedTruncate = false;\n\n /** Observer for `truncate-links` changes on the owning nav.\n * @internal\n */\n private _truncateObserver?: MutationObserver;\n\n /**\n * @internal\n */\n private _observedNav: HTMLElement | null = null;\n\n /** Menu positioning\n * @internal\n */\n @state()\n accessor menuPosition: any = {};\n\n override render() {\n const classes = {\n menu: this.slottedEls.length,\n [`level--${this.level}`]: true,\n divider: this.divider,\n 'full-width-flyout': this.fullWidthFlyout,\n open: this.open || (this.level === 1 && this.isActive),\n };\n\n // Check if truncation should be applied (individual prop or inherited from nav)\n const shouldTruncate = this.truncate || this._inheritedTruncate;\n\n const linkClasses = {\n 'nav-link': true,\n active: this.isActive,\n interactive: this.level == 1,\n 'padding-left': this.leftPadding,\n truncate: shouldTruncate,\n };\n\n const menuClasses = {\n menu__content: true,\n slotted: this.slottedEls.length,\n };\n\n const Links = this.querySelectorAll(\n ':scope > kyn-header-link, :scope > kyn-header-category > kyn-header-link'\n );\n\n const showSearch = !this.hideSearch && Links.length >= this.searchThreshold;\n\n const wrapperClasses = {\n wrapper: true,\n 'no-search': !showSearch,\n };\n\n return html`\n <div\n class=\"${classMap(classes)}\"\n @pointerleave=${(e: PointerEvent) => this.handlePointerLeave(e)}\n @pointerenter=${(e: PointerEvent) => this.handlePointerEnter(e)}\n >\n <a\n target=${this.target}\n rel=${this.rel}\n href=${this.href}\n title=${ifDefined(\n this.linkTitle ||\n (this.slottedEls.length === 0 ? this._autoTitle : '') ||\n undefined\n )}\n class=${classMap(linkClasses)}\n @click=${(e: Event) => this.handleClick(e)}\n @pointerenter=${(e: PointerEvent) => this.handlePointerEnter(e)}\n >\n <slot name=\"icon\"></slot>\n <slot @slotchange=${this._handleDefaultSlotChange}></slot>\n\n ${this.slottedEls.length\n ? html` <span class=\"arrow\">${unsafeSVG(arrowIcon)}</span> `\n : null}\n </a>\n\n <div\n class=${classMap(menuClasses)}\n style=${styleMap(this.menuPosition)}\n >\n <div class=${classMap(wrapperClasses)}>\n <button\n class=\"go-back\"\n type=\"button\"\n @click=${(e: Event) => this._handleBack(e)}\n >\n <span>${unsafeSVG(backIcon)}</span>\n ${this.backText}\n </button>\n ${showSearch\n ? html`\n <kyn-text-input\n hideLabel\n size=\"sm\"\n type=\"search\"\n label=${this.searchLabel}\n placeholder=${this.searchLabel}\n value=${this._searchTerm}\n @on-input=${(e: Event) => this._handleSearch(e)}\n >\n <span slot=\"icon\" class=\"search-icon\">\n ${unsafeSVG(searchIcon)}\n </span>\n ${this.searchLabel}\n </kyn-text-input>\n `\n : null}\n\n <div\n class=\"links-columns\"\n style=${styleMap(this._linksColumnStyles)}\n >\n <slot\n name=\"links\"\n @slotchange=${this._handleLinksSlotChange}\n ></slot>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n /** Compute inline styles for the links-columns wrapper.\n * Only applies multi-column layout for plain (non-categorical) flyouts\n * when the number of links exceeds linksPerColumn.\n * @internal\n */\n private get _linksColumnStyles() {\n if (\n !this.hasCategorical &&\n this.linksPerColumn > 0 &&\n this._slottedLinkCount > this.linksPerColumn\n ) {\n const columnCount = Math.ceil(\n this._slottedLinkCount / this.linksPerColumn\n );\n return { 'column-count': columnCount.toString() };\n }\n return {};\n }\n\n private _handleSearch(e: any) {\n this._searchTerm = e.detail.value.toLowerCase();\n this._searchFilter();\n }\n\n private _searchFilter() {\n const Links: any = this.querySelectorAll(\n ':scope > kyn-header-link, :scope > kyn-header-category > kyn-header-link'\n );\n\n Links.forEach((link: any) => {\n // get link text\n const textSlot = link.shadowRoot?.querySelector(\n 'slot:not([name])'\n ) as HTMLSlotElement | null;\n const nodes: any = textSlot?.assignedNodes({ flatten: true }) ?? [];\n let linkText = '';\n for (let i = 0; i < nodes.length; i++) {\n linkText += nodes[i].textContent.trim();\n }\n\n if (linkText.toLowerCase().includes(this._searchTerm)) {\n link.style.display = 'block';\n } else {\n link.style.display = 'none';\n }\n });\n\n this._positionMenu();\n }\n\n /** Extract text content from the default slot to use as auto-title */\n private _handleDefaultSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n const nodes = slot.assignedNodes({ flatten: true });\n let textContent = '';\n for (const node of nodes) {\n textContent += node.textContent?.trim() ?? '';\n }\n this._autoTitle = textContent.trim();\n }\n\n private _handleBack(e?: Event) {\n if (e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n // detect if we're inside the categorized/mega nav variant\n const headerCategories = this.closest('kyn-header-categories') as\n | (HTMLElement & { handleBackClick?: (evt?: Event) => void })\n | null;\n\n if (headerCategories?.handleBackClick) {\n headerCategories.handleBackClick(e);\n\n // Close any open header links under this nav\n const navRoot =\n (this.closest('kyn-header-nav') as HTMLElement | null) ??\n headerCategories;\n\n const links = navRoot.querySelectorAll<HTMLElement & { open?: boolean }>(\n 'kyn-header-link[open]'\n );\n\n links.forEach((link) => {\n link.removeAttribute('open');\n if ('open' in link) {\n (link as any).open = false;\n }\n });\n\n // Clear local search for this column\n this._searchTerm = '';\n this._searchFilter();\n\n return;\n }\n\n // BASIC NAV:\n // Preserve original behavior: go up one level\n this.open = false;\n this._searchTerm = '';\n this._searchFilter();\n }\n\n private _handleLinksSlotChange() {\n // Detect if this link contains categorical navigation\n const hasCategories = this.querySelector('kyn-header-categories') !== null;\n const hasCategory = this.querySelector('kyn-header-category') !== null;\n const categoriesEl =\n this.querySelector('kyn-tab-panel[visible] kyn-header-categories') ||\n this.querySelector('kyn-header-categories');\n\n this.hasCategorical = hasCategories || hasCategory;\n this.hasMultiColumn = hasCategories; // Only true for multi-column wrapper\n this.fixedColumnWidths =\n categoriesEl?.hasAttribute('fixed-column-widths') ?? false;\n\n // Prime flyout column count before open so width/layout CSS can apply\n // without a second-pass visual snap.\n if (categoriesEl) {\n const dataCol = categoriesEl.getAttribute('data-columns');\n this.flyoutColumns = dataCol ? parseInt(dataCol, 10) || 0 : 0;\n } else {\n this.flyoutColumns = 0;\n }\n\n // Count direct child plain links for column wrapping\n const plainLinks = this.querySelectorAll(':scope > kyn-header-link');\n this._slottedLinkCount = plainLinks.length;\n\n this.requestUpdate();\n }\n\n /** Handle column count changes from slotted kyn-header-categories\n * @internal\n */\n private _handleColumnCountChange = (e: Event) => {\n const detail = (\n e as CustomEvent<{\n columnCount: number;\n fixedColumnWidths?: boolean;\n }>\n ).detail;\n if (detail?.columnCount !== undefined) {\n this.flyoutColumns = detail.columnCount;\n this.fixedColumnWidths = Boolean(detail.fixedColumnWidths);\n }\n };\n\n /**\n * @internal\n */\n private get _isDesktopViewport(): boolean {\n if (typeof window === 'undefined') return true;\n return window.innerWidth >= 672;\n }\n\n private handlePointerEnter(e: PointerEvent) {\n if (\n e.pointerType === 'mouse' &&\n this.slottedEls.length &&\n this._isDesktopViewport\n ) {\n clearTimeout(this._leaveTimer);\n\n // close other open sibling links immediately when entering any link with submenus\n this._closeOtherOpenLinks();\n\n this._enterTimer = setTimeout(() => {\n // Close siblings again right before opening to prevent race conditions\n this._closeOtherOpenLinks();\n this.open = true;\n }, 150);\n }\n }\n\n /** close other open header links at the same level\n * @internal\n */\n private _closeOtherOpenLinks(): void {\n // Strategy: Close all sibling header-links that are currently open\n // This handles the sidebar nav where links are direct children of header-nav\n\n // For level 1 links (main sidebar), find siblings via parent\n if (this.level === 1) {\n const parent = this.parentElement;\n if (parent) {\n // Find ALL level 1 links (not just open ones) to clear pending timers\n const siblingLinks = parent.querySelectorAll<\n HTMLElement & { open?: boolean; _enterTimer?: any }\n >(':scope > kyn-header-link');\n\n siblingLinks.forEach((link) => {\n if (link !== this) {\n // Clear any pending timers\n if ((link as any)._enterTimer) {\n clearTimeout((link as any)._enterTimer);\n (link as any)._enterTimer = undefined;\n }\n if ((link as any)._leaveTimer) {\n clearTimeout((link as any)._leaveTimer);\n (link as any)._leaveTimer = undefined;\n }\n // Force close - set property, remove attribute, and force re-render\n if ((link as any).open) {\n (link as any).open = false;\n link.removeAttribute('open');\n (link as any).requestUpdate?.();\n }\n }\n });\n }\n return;\n }\n\n // For nested links, find the nearest container and close same-level links\n const navContainer =\n this.closest('kyn-header-nav') ||\n this.closest('kyn-tab-panel') ||\n this.closest('.menu__content');\n\n if (navContainer) {\n const allLinks = navContainer.querySelectorAll<\n HTMLElement & { open?: boolean; level?: number; _enterTimer?: any }\n >('kyn-header-link');\n\n allLinks.forEach((link) => {\n if (link !== this && (link as any).level === this.level) {\n // Clear any pending timers\n if ((link as any)._enterTimer) {\n clearTimeout((link as any)._enterTimer);\n (link as any)._enterTimer = undefined;\n }\n if ((link as any)._leaveTimer) {\n clearTimeout((link as any)._leaveTimer);\n (link as any)._leaveTimer = undefined;\n }\n // Force close - set property, remove attribute, and force re-render\n if ((link as any).open) {\n (link as any).open = false;\n link.removeAttribute('open');\n (link as any).requestUpdate?.();\n }\n }\n });\n }\n }\n\n private handlePointerLeave(e: PointerEvent) {\n // Suppress close during internal view transitions (e.g. \"More\" → detail view).\n // The flyout resizes and the cursor may end up outside, but the user's intent\n // was to drill in — not to leave.\n if (this._viewChangeInProgress) {\n return;\n }\n\n // check both the link's own prop and parent nav's prop\n // if either is false, don't auto-close the flyout\n const shouldAutoCollapse = this._shouldAutoCollapse();\n if (!shouldAutoCollapse) {\n return;\n }\n\n if (\n e.pointerType === 'mouse' &&\n this.slottedEls.length &&\n this._searchTerm === '' &&\n this._isDesktopViewport\n ) {\n clearTimeout(this._enterTimer);\n this._leaveTimer = setTimeout(() => {\n this.open = false;\n }, 150);\n }\n }\n\n /** Check if flyout should auto-collapse based on parent nav's autoOpenFlyout.\n * Only applies to links containing categorical nav (kyn-header-categories).\n * @internal\n */\n private _shouldAutoCollapse(): boolean {\n // Non-categorical links always auto-collapse (preserve original behavior)\n if (!this.hasCategorical && !this.fullWidthFlyout) {\n return true;\n }\n\n const parentNav = this.closest('kyn-header-nav') as\n | (HTMLElement & { autoOpenFlyout?: string })\n | null;\n\n // If parent nav has autoOpenFlyout set (truthy), don't auto-collapse\n if (parentNav?.autoOpenFlyout) {\n return false;\n }\n\n return true;\n }\n\n private handleClick(e: Event) {\n let preventDefault = false;\n\n if (this.slottedEls.length) {\n preventDefault = true;\n e.preventDefault();\n // Close other open links before toggling this one\n if (!this.open) {\n this._closeOtherOpenLinks();\n }\n this.open = !this.open;\n } else {\n this._closeOtherOpenLinks();\n }\n\n const event = new CustomEvent('on-click', {\n detail: { origEvent: e, defaultPrevented: preventDefault },\n });\n this.dispatchEvent(event);\n }\n\n private handleClickOut(e: Event) {\n if (!e.composedPath().includes(this)) {\n this.open = false;\n this._searchTerm = '';\n this._searchFilter();\n }\n }\n\n private determineLevel() {\n let level = 1;\n let node: any = this.parentNode;\n\n // Traverse up the DOM tree\n while (node) {\n if (node.nodeName === 'KYN-HEADER-LINK') {\n level = (node.level ?? 1) + 1;\n break;\n } else if (\n node.nodeName === 'KYN-HEADER-CATEGORY' &&\n node.parentNode?.nodeName === 'KYN-HEADER-LINK'\n ) {\n level = (node.parentNode.level ?? 1) + 1;\n break;\n } else if (\n window.innerWidth < 672 &&\n node.nodeName === 'KYN-HEADER-FLYOUT'\n ) {\n level = 2;\n break;\n }\n node = node.parentNode;\n }\n\n this.level = level;\n }\n\n private _positionMenu() {\n const linkBounds = this.getBoundingClientRect?.();\n const menuEl =\n this.shadowRoot?.querySelector<HTMLElement>('.menu__content');\n const menuBounds = menuEl?.getBoundingClientRect?.();\n\n if (!linkBounds || !menuBounds) {\n return;\n }\n\n const Padding = 12;\n const HeaderHeight = 64;\n\n const linkHalf = linkBounds.top + linkBounds.height / 2;\n const menuHalf = menuBounds.height / 2;\n\n const topCandidate =\n linkHalf + menuHalf > window.innerHeight\n ? linkHalf - menuHalf - (linkHalf + menuHalf - window.innerHeight) - 16\n : linkHalf - menuHalf;\n\n if (this.level === 1) {\n // Keep level-1 flyouts pinned to the nav rail origin (legacy behavior).\n // This avoids viewport/header bound drift and keeps panels consistently aligned.\n let navMenuHeight = 0;\n const headerNav = this.closest('kyn-header-nav') as HTMLElement | null;\n if (headerNav) {\n const navMenu = headerNav.shadowRoot?.querySelector(\n '.menu__content'\n ) as HTMLElement | null;\n if (navMenu) {\n navMenuHeight = navMenu.offsetHeight;\n }\n }\n\n this.menuPosition = {\n top: HeaderHeight + 'px',\n left: '0px',\n minHeight: navMenuHeight + 'px',\n };\n } else {\n const top = topCandidate < HeaderHeight ? HeaderHeight : topCandidate;\n this.menuPosition = {\n top: top + 'px',\n left: linkBounds.right + Padding + 'px',\n };\n }\n }\n\n /** @internal */\n private _debounceResize = debounce(() => {\n this.determineLevel();\n if (this.open) {\n this._positionMenu();\n }\n });\n\n override firstUpdated() {\n this.determineLevel();\n this._handleLinksSlotChange();\n }\n\n override updated(changedProps: any) {\n // Re-position after render when the menu has its actual dimensions\n if (changedProps.has('open') && this.open) {\n // Use rAF to ensure the DOM has painted\n requestAnimationFrame(() => {\n this._positionMenu();\n });\n }\n\n // Re-position when column count changes (categories may render after flyout opens)\n if (changedProps.has('flyoutColumns') && this.open) {\n requestAnimationFrame(() => {\n this._positionMenu();\n });\n }\n }\n\n /**\n * @internal\n */\n private _handleDocumentClick = (e: Event) => this.handleClickOut(e);\n\n /** Suppress pointer-leave close when categories switch views (root ↔ detail).\n * @internal\n */\n private _handleNavChange = () => {\n this._viewChangeInProgress = true;\n clearTimeout(this._viewChangeTimer);\n // Allow enough time for the flyout to finish resizing before re-enabling close\n this._viewChangeTimer = setTimeout(() => {\n this._viewChangeInProgress = false;\n }, 500);\n };\n\n override connectedCallback() {\n super.connectedCallback();\n document.addEventListener('click', this._handleDocumentClick);\n window.addEventListener('resize', this._debounceResize);\n // Listen for column count changes from slotted kyn-header-categories\n this.addEventListener(\n 'on-column-count-change',\n this._handleColumnCountChange\n );\n // Suppress flyout close during internal view transitions (e.g. \"More\" click)\n this.addEventListener('on-nav-change', this._handleNavChange);\n // Check for truncation inheritance after DOM is ready\n queueMicrotask(() => {\n this._observeParentNavTruncate();\n });\n }\n\n /** Find the closest owning nav across shadow boundaries.\n * @internal\n */\n private _resolveOwningNav(): HTMLElement | null {\n const parentNav = this.closest('kyn-header-nav');\n if (parentNav) return parentNav as HTMLElement;\n\n let root = this.getRootNode();\n while (root instanceof ShadowRoot) {\n const nav = root.host.closest?.('kyn-header-nav');\n if (nav) {\n return nav as HTMLElement;\n }\n root = root.host.getRootNode();\n }\n\n return null;\n }\n\n /** Sync inherited truncate state with the owning nav.\n * @internal\n */\n private _syncInheritedTruncate = (): void => {\n this._inheritedTruncate = this._isInTruncatingNav();\n };\n\n /** Observe `truncate-links` changes on the owning nav.\n * @internal\n */\n private _observeParentNavTruncate(): void {\n const nav = this._resolveOwningNav();\n\n if (this._observedNav === nav) {\n this._syncInheritedTruncate();\n return;\n }\n\n if (this._truncateObserver) {\n this._truncateObserver.disconnect();\n this._truncateObserver = undefined;\n }\n\n this._observedNav = nav;\n\n if (nav) {\n this._truncateObserver = new MutationObserver(() => {\n this._syncInheritedTruncate();\n });\n this._truncateObserver.observe(nav, {\n attributes: true,\n attributeFilter: ['truncate-links'],\n });\n }\n\n this._syncInheritedTruncate();\n }\n\n /** Check if this link is inside a nav with truncate-links attribute\n * Uses getRootNode to traverse up through shadow DOM boundaries\n * @internal\n */\n private _isInTruncatingNav(): boolean {\n return this._resolveOwningNav()?.hasAttribute('truncate-links') ?? false;\n }\n\n override disconnectedCallback() {\n // clear timers to avoid callbacks after unmount\n if (this._enterTimer) {\n clearTimeout(this._enterTimer);\n this._enterTimer = undefined;\n }\n if (this._leaveTimer) {\n clearTimeout(this._leaveTimer);\n this._leaveTimer = undefined;\n }\n\n if (this._viewChangeTimer) {\n clearTimeout(this._viewChangeTimer);\n this._viewChangeTimer = undefined;\n }\n\n document.removeEventListener('click', this._handleDocumentClick);\n window.removeEventListener('resize', this._debounceResize);\n this.removeEventListener(\n 'on-column-count-change',\n this._handleColumnCountChange\n );\n this.removeEventListener('on-nav-change', this._handleNavChange);\n if (this._truncateObserver) {\n this._truncateObserver.disconnect();\n this._truncateObserver = undefined;\n }\n this._observedNav = null;\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-header-link': HeaderLink;\n }\n}\n"],"names":["HeaderLink","customElement","LitElement","_classThis","_classSuper","_HeaderLink_open_accessor_storage","set","this","__runInitializers","_open_initializers","_HeaderLink_href_accessor_storage","_open_extraInitializers","_href_initializers","_HeaderLink_target_accessor_storage","_href_extraInitializers","_target_initializers","_HeaderLink_rel_accessor_storage","_target_extraInitializers","_rel_initializers","_HeaderLink_isActive_accessor_storage","_rel_extraInitializers","_isActive_initializers","_HeaderLink_level_accessor_storage","_isActive_extraInitializers","_level_initializers","_HeaderLink_divider_accessor_storage","_level_extraInitializers","_divider_initializers","_HeaderLink_searchLabel_accessor_storage","_divider_extraInitializers","_searchLabel_initializers","_HeaderLink_searchThreshold_accessor_storage","_searchLabel_extraInitializers","_searchThreshold_initializers","_HeaderLink_linksPerColumn_accessor_storage","_searchThreshold_extraInitializers","_linksPerColumn_initializers","_HeaderLink_hideSearch_accessor_storage","_linksPerColumn_extraInitializers","_hideSearch_initializers","_HeaderLink_backText_accessor_storage","_hideSearch_extraInitializers","_backText_initializers","_HeaderLink_leftPadding_accessor_storage","_backText_extraInitializers","_leftPadding_initializers","_HeaderLink_linkTitle_accessor_storage","_leftPadding_extraInitializers","_linkTitle_initializers","_HeaderLink_truncate_accessor_storage","_linkTitle_extraInitializers","_truncate_initializers","_HeaderLink__autoTitle_accessor_storage","_truncate_extraInitializers","__autoTitle_initializers","_HeaderLink_hasCategorical_accessor_storage","__autoTitle_extraInitializers","_hasCategorical_initializers","_HeaderLink_hasMultiColumn_accessor_storage","_hasCategorical_extraInitializers","_hasMultiColumn_initializers","_HeaderLink_flyoutColumns_accessor_storage","_hasMultiColumn_extraInitializers","_flyoutColumns_initializers","_HeaderLink_fixedColumnWidths_accessor_storage","_flyoutColumns_extraInitializers","_fixedColumnWidths_initializers","_HeaderLink_fullWidthFlyout_accessor_storage","_fixedColumnWidths_extraInitializers","_fullWidthFlyout_initializers","_HeaderLink__searchTerm_accessor_storage","_fullWidthFlyout_extraInitializers","__searchTerm_initializers","_HeaderLink__slottedLinkCount_accessor_storage","__searchTerm_extraInitializers","__slottedLinkCount_initializers","_HeaderLink_slottedEls_accessor_storage","__slottedLinkCount_extraInitializers","_slottedEls_initializers","_enterTimer","_slottedEls_extraInitializers","_HeaderLink__leaveTimer_accessor_storage","__leaveTimer_initializers","_viewChangeInProgress","__leaveTimer_extraInitializers","_HeaderLink__inheritedTruncate_accessor_storage","__inheritedTruncate_initializers","_truncateObserver","__inheritedTruncate_extraInitializers","_observedNav","_HeaderLink_menuPosition_accessor_storage","_menuPosition_initializers","_handleColumnCountChange","_menuPosition_extraInitializers","e","detail","undefined","columnCount","flyoutColumns","fixedColumnWidths","Boolean","_debounceResize","debounce","determineLevel","open","_positionMenu","_handleDocumentClick","handleClickOut","_handleNavChange","clearTimeout","_viewChangeTimer","setTimeout","_syncInheritedTruncate","_inheritedTruncate","_isInTruncatingNav","__classPrivateFieldGet","value","__classPrivateFieldSet","href","target","rel","isActive","level","divider","searchLabel","searchThreshold","linksPerColumn","hideSearch","backText","leftPadding","linkTitle","truncate","_autoTitle","hasCategorical","hasMultiColumn","fullWidthFlyout","_searchTerm","_slottedLinkCount","slottedEls","_leaveTimer","menuPosition","render","classes","menu","length","shouldTruncate","linkClasses","active","interactive","menuClasses","menu__content","slotted","Links","querySelectorAll","showSearch","wrapperClasses","wrapper","html","classMap","handlePointerLeave","handlePointerEnter","ifDefined","handleClick","_handleDefaultSlotChange","unsafeSVG","arrowIcon","styleMap","_handleBack","backIcon","_handleSearch","searchIcon","_linksColumnStyles","_handleLinksSlotChange","Math","ceil","toString","toLowerCase","_searchFilter","forEach","link","textSlot","_a","shadowRoot","querySelector","nodes","_b","assignedNodes","flatten","linkText","i","textContent","trim","includes","style","display","node","preventDefault","stopPropagation","headerCategories","closest","handleBackClick","removeAttribute","hasCategories","hasCategory","categoriesEl","hasAttribute","dataCol","getAttribute","parseInt","plainLinks","requestUpdate","_isDesktopViewport","window","innerWidth","pointerType","_closeOtherOpenLinks","parent","parentElement","navContainer","_shouldAutoCollapse","parentNav","autoOpenFlyout","event","CustomEvent","origEvent","defaultPrevented","dispatchEvent","composedPath","parentNode","nodeName","_c","linkBounds","getBoundingClientRect","menuEl","menuBounds","call","linkHalf","top","height","menuHalf","topCandidate","innerHeight","navMenuHeight","headerNav","navMenu","_d","offsetHeight","HeaderHeight","left","minHeight","right","firstUpdated","updated","changedProps","has","requestAnimationFrame","connectedCallback","super","document","addEventListener","queueMicrotask","_observeParentNavTruncate","_resolveOwningNav","root","getRootNode","ShadowRoot","nav","host","disconnect","MutationObserver","observe","attributes","attributeFilter","disconnectedCallback","removeEventListener","property","type","reflect","_href_decorators","String","_target_decorators","_rel_decorators","_isActive_decorators","_level_decorators","state","_divider_decorators","_searchLabel_decorators","_searchThreshold_decorators","Number","_linksPerColumn_decorators","_hideSearch_decorators","_backText_decorators","_leftPadding_decorators","attribute","__autoTitle_decorators","_hasCategorical_decorators","_hasMultiColumn_decorators","_flyoutColumns_decorators","_fixedColumnWidths_decorators","_fullWidthFlyout_decorators","__searchTerm_decorators","__slottedLinkCount_decorators","_slottedEls_decorators","queryAssignedElements","slot","__leaveTimer_decorators","__inheritedTruncate_decorators","_menuPosition_decorators","__esDecorate","_open_decorators","kind","name","static","private","access","obj","get","metadata","_metadata","_linkTitle_decorators","_truncate_decorators","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","HeaderLinkScss"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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oT,KAAAM,SAAAC,GAAA,KAAAK,kHACkBhU,EAAAiU,OAASC,EAAUC,GADxB9T,EAAAL,EAAAgU,OAAU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPrivateFieldGet as
|
|
1
|
+
import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPrivateFieldGet as n,__classPrivateFieldSet as o}from"tslib";import{unsafeSVG as a}from"lit-html/directives/unsafe-svg.js";import{css as r,LitElement as s,unsafeCSS as l,html as d}from"lit";import{customElement as c,state as u,property as h}from"lit/decorators.js";import{classMap as m}from"lit/directives/class-map.js";import{querySelectorAllDeep as p,querySelectorDeep as g}from"query-selector-shadow-dom";import{b as v,m as k}from"../../../vendor/@kyndryl-design-system/shidoka-icons-CfQBgr8V.js";var b=r`*,
|
|
2
2
|
*::before,
|
|
3
3
|
*::after {
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -249,6 +249,27 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPr
|
|
|
249
249
|
:host {
|
|
250
250
|
display: flex;
|
|
251
251
|
align-items: center;
|
|
252
|
+
--kyn-header-nav-menu-width: 230px;
|
|
253
|
+
--kyn-header-nav-menu-padding: 12px;
|
|
254
|
+
--kyn-header-nav-menu-background: var(
|
|
255
|
+
--kd-color-background-container-default
|
|
256
|
+
);
|
|
257
|
+
--kyn-header-nav-menu-border-radius: 8px;
|
|
258
|
+
--kyn-header-nav-menu-open-border-radius: 8px;
|
|
259
|
+
--kyn-header-nav-menu-overflow: hidden auto;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:host(.global-switcher-nav) {
|
|
263
|
+
--kyn-header-nav-menu-width: 246px;
|
|
264
|
+
--kyn-header-nav-menu-background: var(
|
|
265
|
+
--kd-color-background-menu-state-default
|
|
266
|
+
);
|
|
267
|
+
--kyn-header-nav-menu-open-border-radius: 8px 0 0 8px;
|
|
268
|
+
--kyn-header-nav-menu-overflow: visible;
|
|
269
|
+
--kyn-header-nav-sync-flyout-height: 1;
|
|
270
|
+
--kyn-icon-selector-animate-selection: 1;
|
|
271
|
+
--kyn-icon-selector-only-visible-on-hover: 1;
|
|
272
|
+
--kyn-icon-selector-persist-when-checked: 1;
|
|
252
273
|
}
|
|
253
274
|
|
|
254
275
|
.btn {
|
|
@@ -274,29 +295,29 @@ import{__setFunctionName as e,__esDecorate as t,__runInitializers as i,__classPr
|
|
|
274
295
|
|
|
275
296
|
@media (min-width: 42rem) {
|
|
276
297
|
.menu__content {
|
|
277
|
-
width: var(--kyn-header-nav-menu-width
|
|
278
|
-
padding: var(--kyn-header-nav-menu-padding
|
|
279
|
-
background: var(--kyn-header-nav-menu-background
|
|
280
|
-
border-radius: var(--kyn-header-nav-menu-border-radius
|
|
281
|
-
overflow: var(--kyn-header-nav-menu-overflow
|
|
298
|
+
width: var(--kyn-header-nav-menu-width);
|
|
299
|
+
padding: var(--kyn-header-nav-menu-padding);
|
|
300
|
+
background: var(--kyn-header-nav-menu-background);
|
|
301
|
+
border-radius: var(--kyn-header-nav-menu-border-radius);
|
|
302
|
+
overflow: var(--kyn-header-nav-menu-overflow);
|
|
282
303
|
}
|
|
283
304
|
:host(.global-switcher-frame-open) .menu__content {
|
|
284
|
-
border-radius: var(--kyn-header-nav-menu-open-border-radius
|
|
305
|
+
border-radius: var(--kyn-header-nav-menu-open-border-radius);
|
|
285
306
|
}
|
|
286
|
-
}`;let y=(()=>{var
|
|
287
|
-
<div class=${
|
|
307
|
+
}`;let y=(()=>{var r,y,f,_,x;let w,O,C,S,z,F,L,T=[c("kyn-header-nav")],R=[],q=s,M=[],$=[],j=[],A=[],H=[],W=[],D=[],G=[],V=[],E=[];return O=class extends q{constructor(){super(...arguments),r.set(this,i(this,M,!1)),y.set(this,(i(this,$),i(this,j,"left"))),f.set(this,(i(this,A),i(this,H,""))),_.set(this,(i(this,W),i(this,D,!1))),x.set(this,(i(this,G),i(this,V,!1))),this._attrObserver=i(this,E),this._autoOpenTriggered=!1,this._boundHandleClickOut=e=>this._handleClickOut(e)}get menuOpen(){return n(this,r,"f")}set menuOpen(e){o(this,r,e,"f")}get slot(){return n(this,y,"f")}set slot(e){o(this,y,e,"f")}get autoOpenFlyout(){return n(this,f,"f")}set autoOpenFlyout(e){o(this,f,e,"f")}get truncateLinks(){return n(this,_,"f")}set truncateLinks(e){o(this,_,e,"f")}get hasCategories(){return n(this,x,"f")}set hasCategories(e){o(this,x,e,"f")}get _isDesktop(){return"undefined"==typeof window||window.innerWidth>=672}render(){const e={"header-nav":!0,menu:!0,open:this.menuOpen},t={menu__content:!0,left:!0,"categories-open":this.hasCategories};return d`
|
|
308
|
+
<div class=${m(e)}>
|
|
288
309
|
<button
|
|
289
310
|
class="btn interactive"
|
|
290
311
|
aria-label="Toggle Menu"
|
|
291
312
|
title="Toggle Menu"
|
|
292
313
|
@click=${()=>this._toggleMenuOpen()}
|
|
293
314
|
>
|
|
294
|
-
${this.menuOpen?d`<span>${
|
|
315
|
+
${this.menuOpen?d`<span>${a(v)}</span>`:d`<span>${a(k)}</span>`}
|
|
295
316
|
</button>
|
|
296
317
|
|
|
297
|
-
<div class=${
|
|
318
|
+
<div class=${m(t)}>
|
|
298
319
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
299
320
|
</div>
|
|
300
321
|
</div>
|
|
301
|
-
`}_toggleMenuOpen(){this.menuOpen=!this.menuOpen}_updateCategoriesVisibility(){const e=
|
|
322
|
+
`}_toggleMenuOpen(){this.menuOpen=!this.menuOpen}_updateCategoriesVisibility(){const e=p("kyn-header-link",this),t=Array.from(e).some((e=>e.hasAttribute("open")||e.hasAttribute("isactive"))),i=Boolean(g("kyn-header-categories",this)),n=t||i;this.hasCategories!==n&&(this.hasCategories=n)}_handleSlotChange(){this._updateCategoriesVisibility(),this._syncGlobalSwitcherFrame(),this.autoOpenFlyout&&this._isDesktop&&!this._autoOpenTriggered&&this._autoOpenFirstCategoricalLink()}_handleClickOut(e){e.composedPath().includes(this)||(this.menuOpen=!1)}firstUpdated(e){this._updateCategoriesVisibility(),this.autoOpenFlyout&&this._isDesktop&&this._autoOpenFirstCategoricalLink()}willUpdate(e){if(e.has("menuOpen")){const e={open:this.menuOpen};this.dispatchEvent(new CustomEvent("on-nav-toggle",{composed:!0,bubbles:!0,detail:e})),this.menuOpen&&this.autoOpenFlyout&&this._isDesktop&&this._autoOpenFirstCategoricalLink(),this.menuOpen||(this._autoOpenTriggered=!1)}}_autoOpenFirstCategoricalLink(){requestAnimationFrame((()=>{const e=this.querySelectorAll(":scope > kyn-header-link");for(const t of e){const e=t;e._enterTimer&&(clearTimeout(e._enterTimer),e._enterTimer=void 0),e._leaveTimer&&(clearTimeout(e._leaveTimer),e._leaveTimer=void 0)}let t=null;if(this.autoOpenFlyout&&"default"!==this.autoOpenFlyout&&(t=this.querySelector(`:scope > kyn-header-link#${CSS.escape(this.autoOpenFlyout)}`)),!t)for(const i of e){const e=null!==i.querySelector("kyn-header-categories")||null!==g("kyn-header-categories",i),n=null!==i.querySelector("kyn-header-category")||null!==g("kyn-header-category",i),o=i.hasAttribute("full-width-flyout");if(e||n||o){t=i;break}}t&&(t.open=!0,this._autoOpenTriggered=!0,this._syncGlobalSwitcherFrame())}))}updated(e){e.has("hasCategories")&&this.classList.toggle("categories-open",this.hasCategories),e.has("hasCategories")&&this._syncGlobalSwitcherFrame()}_syncGlobalSwitcherFrame(){var e,t,i;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".menu__content");if(!n)return;const o=()=>{var e;n.style.height="",n.style.minHeight="",this.classList.remove("global-switcher-frame-open"),null===(e=this._globalSwitcherResizeObserver)||void 0===e||e.disconnect(),this._globalSwitcherResizeObserver=void 0};if(!("1"===getComputedStyle(this).getPropertyValue("--kyn-header-nav-sync-flyout-height").trim())||!this._isDesktop)return void o();const a=this.querySelector(":scope > kyn-header-link[open], :scope > kyn-header-link[isactive]"),r=null===(t=null==a?void 0:a.shadowRoot)||void 0===t?void 0:t.querySelector(".menu__content.slotted");if(!r)return void o();this.classList.add("global-switcher-frame-open");const s=()=>{const e=r.getBoundingClientRect().height;n.style.height=e?`${e}px`:"",n.style.minHeight=e?`${e}px`:""};requestAnimationFrame(s),null===(i=this._globalSwitcherResizeObserver)||void 0===i||i.disconnect(),this._globalSwitcherResizeObserver=new ResizeObserver(s),this._globalSwitcherResizeObserver.observe(r)}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._boundHandleClickOut),this._attrObserver=new MutationObserver((()=>{this._updateCategoriesVisibility(),this._syncGlobalSwitcherFrame()})),this._attrObserver.observe(this,{attributes:!0,subtree:!0,attributeFilter:["open"],childList:!0})}disconnectedCallback(){document.removeEventListener("click",this._boundHandleClickOut),this._attrObserver&&(this._attrObserver.disconnect(),this._attrObserver=void 0),this._globalSwitcherResizeObserver&&(this._globalSwitcherResizeObserver.disconnect(),this._globalSwitcherResizeObserver=void 0),super.disconnectedCallback()}},r=new WeakMap,y=new WeakMap,f=new WeakMap,_=new WeakMap,x=new WeakMap,e(O,"HeaderNav"),(()=>{var e;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=q[Symbol.metadata])&&void 0!==e?e:null):void 0;C=[u()],S=[h({type:String,reflect:!0})],z=[h({type:String,attribute:"auto-open-flyout"})],F=[h({type:Boolean,reflect:!0,attribute:"truncate-links"})],L=[u()],t(O,null,C,{kind:"accessor",name:"menuOpen",static:!1,private:!1,access:{has:e=>"menuOpen"in e,get:e=>e.menuOpen,set:(e,t)=>{e.menuOpen=t}},metadata:i},M,$),t(O,null,S,{kind:"accessor",name:"slot",static:!1,private:!1,access:{has:e=>"slot"in e,get:e=>e.slot,set:(e,t)=>{e.slot=t}},metadata:i},j,A),t(O,null,z,{kind:"accessor",name:"autoOpenFlyout",static:!1,private:!1,access:{has:e=>"autoOpenFlyout"in e,get:e=>e.autoOpenFlyout,set:(e,t)=>{e.autoOpenFlyout=t}},metadata:i},H,W),t(O,null,F,{kind:"accessor",name:"truncateLinks",static:!1,private:!1,access:{has:e=>"truncateLinks"in e,get:e=>e.truncateLinks,set:(e,t)=>{e.truncateLinks=t}},metadata:i},D,G),t(O,null,L,{kind:"accessor",name:"hasCategories",static:!1,private:!1,access:{has:e=>"hasCategories"in e,get:e=>e.hasCategories,set:(e,t)=>{e.hasCategories=t}},metadata:i},V,E),t(null,w={value:O},T,{kind:"class",name:O.name,metadata:i},null,R),O=w.value,i&&Object.defineProperty(O,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),O.styles=l(b),i(O,R),O})();export{y as HeaderNav};
|
|
302
323
|
//# sourceMappingURL=headerNav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headerNav.js","sources":["../../../../src/components/global/header/headerNav.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS, type PropertyValueMap } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport {\n querySelectorAllDeep,\n querySelectorDeep,\n} from 'query-selector-shadow-dom';\nimport HeaderNavScss from './headerNav.scss?inline';\n\nimport menuIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/hamburger-menu.svg';\nimport closeIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/close-simple.svg';\n\n/**\n * Container for header navigation links.\n * @slot unnamed - This element has a slot.\n * @fires on-nav-toggle - Fires when the nav menu opens or closes. `detail: { open }`.\n * @cssprop [--kyn-global-switcher-max-height=calc(100vh - var(--kd-header-reserved-space) - 16px)] - Max height for global-switcher flyout panels, including categorical nav wrappers.\n */\n@customElement('kyn-header-nav')\nexport class HeaderNav extends LitElement {\n static override styles = unsafeCSS(HeaderNavScss);\n\n /** Small screen header nav visibility.\n * @ignore\n */\n @state()\n accessor menuOpen = false;\n\n /** Force correct slot\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor slot = 'left';\n\n /** Controls which flyout (if any) auto-opens when the nav renders.\n * - `` (empty, default): original behavior — flyouts auto-collapse on mouse leave, nothing auto-opens.\n * - `default`: auto-open the first categorical flyout; flyouts stay open on mouse leave.\n * - `<id>`: auto-open the flyout whose kyn-header-link id matches; flyouts stay open on mouse leave.\n */\n @property({ type: String, attribute: 'auto-open-flyout' })\n accessor autoOpenFlyout = '';\n\n /** When true, all links in flyouts will truncate long text with ellipsis.\n * This cascades to all nested kyn-header-link components via CSS custom property.\n */\n @property({ type: Boolean, reflect: true, attribute: 'truncate-links' })\n accessor truncateLinks = false;\n\n /** Boolean value reflecting whether the navigation has categories.\n * @internal\n */\n @state()\n accessor hasCategories = false;\n\n /** Mutation observer for attribute changes.\n * @internal\n */\n private _attrObserver?: MutationObserver;\n\n /** Tracks whether auto-open has already been triggered to prevent multiple triggers.\n * @internal\n */\n private _autoOpenTriggered = false;\n\n /** Bound document click handler to allow proper add/remove of listener\n * @internal\n */\n private _boundHandleClickOut = (e: Event) => this._handleClickOut(e);\n\n /** Resize observer for keeping the Global Switcher parent rail aligned with the open flyout.\n * @internal\n */\n private _globalSwitcherResizeObserver?: ResizeObserver;\n\n /** @internal */\n private get _isDesktop(): boolean {\n if (typeof window === 'undefined') return true;\n return window.innerWidth >= 672;\n }\n\n override render() {\n const classes = {\n 'header-nav': true,\n menu: true,\n open: this.menuOpen,\n };\n\n const menuContentClasses = {\n menu__content: true,\n left: true,\n 'categories-open': this.hasCategories,\n };\n\n return html`\n <div class=${classMap(classes)}>\n <button\n class=\"btn interactive\"\n aria-label=\"Toggle Menu\"\n title=\"Toggle Menu\"\n @click=${() => this._toggleMenuOpen()}\n >\n ${this.menuOpen\n ? html`<span>${unsafeSVG(closeIcon)}</span>`\n : html`<span>${unsafeSVG(menuIcon)}</span>`}\n </button>\n\n <div class=${classMap(menuContentClasses)}>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n `;\n }\n\n private _toggleMenuOpen() {\n this.menuOpen = !this.menuOpen;\n }\n\n private _updateCategoriesVisibility(): void {\n const links = querySelectorAllDeep('kyn-header-link', this);\n\n const hasOpenCategory = Array.from(links).some((link) => {\n return link.hasAttribute('open') || link.hasAttribute('isactive');\n });\n\n const hasCategoriesElement = Boolean(\n querySelectorDeep('kyn-header-categories', this)\n );\n\n const nextHasCategories = hasOpenCategory || hasCategoriesElement;\n\n if (this.hasCategories !== nextHasCategories) {\n this.hasCategories = nextHasCategories;\n }\n }\n\n private _handleSlotChange() {\n this._updateCategoriesVisibility();\n this._syncGlobalSwitcherFrame();\n\n // Trigger auto-open when slot content changes (handles late-loading content)\n if (this.autoOpenFlyout && this._isDesktop && !this._autoOpenTriggered) {\n this._autoOpenFirstCategoricalLink();\n }\n }\n\n private _handleClickOut(e: Event) {\n if (!e.composedPath().includes(this)) {\n this.menuOpen = false;\n }\n }\n\n protected override firstUpdated(_changed: PropertyValueMap<this>): void {\n this._updateCategoriesVisibility();\n\n // Auto-open first categorical link on initial render when autoOpenFlyout is set.\n // This handles the case where the nav is already visible (desktop) without a menuOpen toggle.\n if (this.autoOpenFlyout && this._isDesktop) {\n this._autoOpenFirstCategoricalLink();\n }\n }\n\n override willUpdate(changedProps: PropertyValueMap<this>): void {\n if (changedProps.has('menuOpen')) {\n const detail = { open: this.menuOpen };\n\n this.dispatchEvent(\n new CustomEvent('on-nav-toggle', {\n composed: true,\n bubbles: true,\n detail,\n })\n );\n\n // Auto-open first link's flyout when nav opens and autoOpenFlyout is set\n // Only applies to categorical nav (when kyn-header-categories is present)\n if (this.menuOpen && this.autoOpenFlyout && this._isDesktop) {\n this._autoOpenFirstCategoricalLink();\n }\n\n // Reset auto-open flag when nav closes so it can re-trigger on next open\n if (!this.menuOpen) {\n this._autoOpenTriggered = false;\n }\n }\n }\n\n /** Auto-open the first header link that contains categorical/full-width nav\n * @internal\n */\n private _autoOpenFirstCategoricalLink(): void {\n // Use rAF to ensure child elements have completed their first Lit render\n // cycle before we try to open them. This is ~16ms (one frame) vs the\n // previous setTimeout(100) which caused a visible two-step open.\n requestAnimationFrame(() => {\n const links = this.querySelectorAll<HTMLElement & { open?: boolean }>(\n ':scope > kyn-header-link'\n );\n\n // Clear any pending pointer-event timers on all sibling links.\n // When the nav first paints, links can appear under the cursor,\n // firing pointerenter which queues a 150ms timer to open that link\n // and close others. Without clearing, that timer fires after our\n // auto-open and immediately closes the flyout.\n for (const link of links) {\n const l = link as any;\n if (l._enterTimer) {\n clearTimeout(l._enterTimer);\n l._enterTimer = undefined;\n }\n if (l._leaveTimer) {\n clearTimeout(l._leaveTimer);\n l._leaveTimer = undefined;\n }\n }\n\n // Find the target link to open\n let target: (HTMLElement & { open?: boolean }) | null = null;\n\n if (this.autoOpenFlyout && this.autoOpenFlyout !== 'default') {\n // Match by id\n target = this.querySelector(\n `:scope > kyn-header-link#${CSS.escape(this.autoOpenFlyout)}`\n );\n }\n\n if (!target) {\n // Fall back to first expandable/full-width link.\n for (const link of links) {\n const hasCategoricalNav =\n link.querySelector('kyn-header-categories') !== null ||\n querySelectorDeep('kyn-header-categories', link) !== null;\n const hasSlottedCategory =\n link.querySelector('kyn-header-category') !== null ||\n querySelectorDeep('kyn-header-category', link) !== null;\n const hasFullWidthFlyout = link.hasAttribute('full-width-flyout');\n\n if (hasCategoricalNav || hasSlottedCategory || hasFullWidthFlyout) {\n target = link;\n break;\n }\n }\n }\n\n if (target) {\n target.open = true;\n this._autoOpenTriggered = true;\n this._syncGlobalSwitcherFrame();\n }\n });\n }\n\n override updated(changedProps: PropertyValueMap<this>): void {\n if (changedProps.has('hasCategories')) {\n this.classList.toggle('categories-open', this.hasCategories);\n }\n\n if (changedProps.has('hasCategories')) {\n this._syncGlobalSwitcherFrame();\n }\n }\n\n /** Keep the Global Switcher rail height in step with the open flyout.\n * @internal\n */\n private _syncGlobalSwitcherFrame(): void {\n const frame = this.shadowRoot?.querySelector<HTMLElement>('.menu__content');\n\n if (!frame) return;\n\n const resetFrame = () => {\n frame.style.height = '';\n frame.style.minHeight = '';\n this.classList.remove('global-switcher-frame-open');\n this._globalSwitcherResizeObserver?.disconnect();\n this._globalSwitcherResizeObserver = undefined;\n };\n\n const shouldSyncFrame =\n getComputedStyle(this)\n .getPropertyValue('--kyn-header-nav-sync-flyout-height')\n .trim() === '1';\n\n if (!shouldSyncFrame || !this._isDesktop) {\n resetFrame();\n return;\n }\n\n const openLink = this.querySelector<HTMLElement>(\n ':scope > kyn-header-link[open], :scope > kyn-header-link[isactive]'\n );\n const flyout = openLink?.shadowRoot?.querySelector<HTMLElement>(\n '.menu__content.slotted'\n );\n\n if (!flyout) {\n resetFrame();\n return;\n }\n\n this.classList.add('global-switcher-frame-open');\n\n const setHeight = () => {\n const flyoutHeight = flyout.getBoundingClientRect().height;\n frame.style.height = flyoutHeight ? `${flyoutHeight}px` : '';\n frame.style.minHeight = flyoutHeight ? `${flyoutHeight}px` : '';\n };\n\n requestAnimationFrame(setHeight);\n\n this._globalSwitcherResizeObserver?.disconnect();\n this._globalSwitcherResizeObserver = new ResizeObserver(setHeight);\n this._globalSwitcherResizeObserver.observe(flyout);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n document.addEventListener('click', this._boundHandleClickOut);\n\n this._attrObserver = new MutationObserver(() => {\n this._updateCategoriesVisibility();\n this._syncGlobalSwitcherFrame();\n });\n\n this._attrObserver.observe(this, {\n attributes: true,\n subtree: true,\n attributeFilter: ['open'],\n childList: true,\n });\n }\n\n override disconnectedCallback(): void {\n document.removeEventListener('click', this._boundHandleClickOut);\n\n if (this._attrObserver) {\n this._attrObserver.disconnect();\n this._attrObserver = undefined;\n }\n\n if (this._globalSwitcherResizeObserver) {\n this._globalSwitcherResizeObserver.disconnect();\n this._globalSwitcherResizeObserver = undefined;\n }\n\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-header-nav': HeaderNav;\n }\n}\n"],"names":["HeaderNav","customElement","LitElement","_classThis","_classSuper","_HeaderNav_menuOpen_accessor_storage","set","this","__runInitializers","_menuOpen_initializers","_HeaderNav_slot_accessor_storage","_menuOpen_extraInitializers","_slot_initializers","_HeaderNav_autoOpenFlyout_accessor_storage","_slot_extraInitializers","_autoOpenFlyout_initializers","_HeaderNav_truncateLinks_accessor_storage","_autoOpenFlyout_extraInitializers","_truncateLinks_initializers","_HeaderNav_hasCategories_accessor_storage","_truncateLinks_extraInitializers","_hasCategories_initializers","_attrObserver","_hasCategories_extraInitializers","_autoOpenTriggered","_boundHandleClickOut","e","_handleClickOut","menuOpen","__classPrivateFieldGet","value","__classPrivateFieldSet","slot","autoOpenFlyout","truncateLinks","hasCategories","_isDesktop","window","innerWidth","render","classes","menu","open","menuContentClasses","menu__content","left","html","classMap","_toggleMenuOpen","unsafeSVG","closeIcon","menuIcon","_handleSlotChange","_updateCategoriesVisibility","links","querySelectorAllDeep","hasOpenCategory","Array","from","some","link","hasAttribute","hasCategoriesElement","Boolean","querySelectorDeep","nextHasCategories","_syncGlobalSwitcherFrame","_autoOpenFirstCategoricalLink","composedPath","includes","firstUpdated","_changed","willUpdate","changedProps","has","detail","dispatchEvent","CustomEvent","composed","bubbles","requestAnimationFrame","querySelectorAll","l","_enterTimer","clearTimeout","undefined","_leaveTimer","target","querySelector","CSS","escape","hasCategoricalNav","hasSlottedCategory","hasFullWidthFlyout","updated","classList","toggle","frame","_a","shadowRoot","resetFrame","style","height","minHeight","remove","_globalSwitcherResizeObserver","disconnect","getComputedStyle","getPropertyValue","trim","openLink","flyout","_b","add","setHeight","flyoutHeight","getBoundingClientRect","_c","ResizeObserver","observe","connectedCallback","super","document","addEventListener","MutationObserver","attributes","subtree","attributeFilter","childList","disconnectedCallback","removeEventListener","_menuOpen_decorators","state","property","type","String","reflect","attribute","_truncateLinks_decorators","_hasCategories_decorators","__esDecorate","kind","name","static","private","access","obj","get","metadata","_metadata","_slot_decorators","_autoOpenFlyout_decorators","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","HeaderNavScss"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AwE,GAAA,kBAAAA,EAAAC,IAAAD,GAAAA,EAAShH,cAAa5B,IAAA,CAAA4I,EAAApH,KAAAoH,EAAbhH,cAAaJ,CAAA,GAAAsH,SAAAC,GAAAnI,EAAAE,GAMtBwH,EAAAzI,EAAA,KAAAwI,EAAA,CAAAE,KAAA,WAAAC,KAAA,gBAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAvE,IAAAwE,GAAA,kBAAAA,EAAAC,IAAAD,GAAAA,EAAS/G,cAAa7B,IAAA,CAAA4I,EAAApH,KAAAoH,EAAb/G,cAAaL,CAAA,GAAAsH,SAAAC,GAAAhI,EAAAE,GAjCxBqH,EAAA,KAAAY,EAAA,CAAA1H,MAAA3B,GAAAsJ,EAAA,CAAAZ,KAAA,QAAAC,KAAA3I,EAAA2I,KAAAM,SAAAC,GAAA,KAAAK,iHACkBvJ,EAAAwJ,OAASC,EAAUC,GADxBrJ,EAAAL,EAAAuJ,MAAS"}
|
|
1
|
+
{"version":3,"file":"headerNav.js","sources":["../../../../src/components/global/header/headerNav.ts"],"sourcesContent":["import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';\nimport { LitElement, html, unsafeCSS, type PropertyValueMap } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport {\n querySelectorAllDeep,\n querySelectorDeep,\n} from 'query-selector-shadow-dom';\nimport HeaderNavScss from './headerNav.scss?inline';\n\nimport menuIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/hamburger-menu.svg';\nimport closeIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/close-simple.svg';\n\n/**\n * Container for header navigation links.\n * @slot unnamed - This element has a slot.\n * @fires on-nav-toggle - Fires when the nav menu opens or closes. `detail: { open }`.\n * @cssprop [--kyn-global-switcher-max-height=calc(100vh - var(--kd-header-reserved-space) - 16px)] - Max height for global-switcher flyout panels, including categorical nav wrappers.\n */\n@customElement('kyn-header-nav')\nexport class HeaderNav extends LitElement {\n static override styles = unsafeCSS(HeaderNavScss);\n\n /** Small screen header nav visibility.\n * @ignore\n */\n @state()\n accessor menuOpen = false;\n\n /** Force correct slot\n * @internal\n */\n @property({ type: String, reflect: true })\n override accessor slot = 'left';\n\n /** Controls which flyout (if any) auto-opens when the nav renders.\n * - `` (empty, default): original behavior — flyouts auto-collapse on mouse leave, nothing auto-opens.\n * - `default`: auto-open the first categorical flyout; flyouts stay open on mouse leave.\n * - `<id>`: auto-open the flyout whose kyn-header-link id matches; flyouts stay open on mouse leave.\n */\n @property({ type: String, attribute: 'auto-open-flyout' })\n accessor autoOpenFlyout = '';\n\n /** When true, all links in flyouts will truncate long text with ellipsis.\n * This cascades to all nested kyn-header-link components via CSS custom property.\n */\n @property({ type: Boolean, reflect: true, attribute: 'truncate-links' })\n accessor truncateLinks = false;\n\n /** Boolean value reflecting whether the navigation has categories.\n * @internal\n */\n @state()\n accessor hasCategories = false;\n\n /** Mutation observer for attribute changes.\n * @internal\n */\n private _attrObserver?: MutationObserver;\n\n /** Tracks whether auto-open has already been triggered to prevent multiple triggers.\n * @internal\n */\n private _autoOpenTriggered = false;\n\n /** Bound document click handler to allow proper add/remove of listener\n * @internal\n */\n private _boundHandleClickOut = (e: Event) => this._handleClickOut(e);\n\n /** Resize observer for keeping the Global Switcher parent rail aligned with the open flyout.\n * @internal\n */\n private _globalSwitcherResizeObserver?: ResizeObserver;\n\n /** @internal */\n private get _isDesktop(): boolean {\n if (typeof window === 'undefined') return true;\n return window.innerWidth >= 672;\n }\n\n override render() {\n const classes = {\n 'header-nav': true,\n menu: true,\n open: this.menuOpen,\n };\n\n const menuContentClasses = {\n menu__content: true,\n left: true,\n 'categories-open': this.hasCategories,\n };\n\n return html`\n <div class=${classMap(classes)}>\n <button\n class=\"btn interactive\"\n aria-label=\"Toggle Menu\"\n title=\"Toggle Menu\"\n @click=${() => this._toggleMenuOpen()}\n >\n ${this.menuOpen\n ? html`<span>${unsafeSVG(closeIcon)}</span>`\n : html`<span>${unsafeSVG(menuIcon)}</span>`}\n </button>\n\n <div class=${classMap(menuContentClasses)}>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n `;\n }\n\n private _toggleMenuOpen() {\n this.menuOpen = !this.menuOpen;\n }\n\n private _updateCategoriesVisibility(): void {\n const links = querySelectorAllDeep('kyn-header-link', this);\n\n const hasOpenCategory = Array.from(links).some((link) => {\n return link.hasAttribute('open') || link.hasAttribute('isactive');\n });\n\n const hasCategoriesElement = Boolean(\n querySelectorDeep('kyn-header-categories', this)\n );\n\n const nextHasCategories = hasOpenCategory || hasCategoriesElement;\n\n if (this.hasCategories !== nextHasCategories) {\n this.hasCategories = nextHasCategories;\n }\n }\n\n private _handleSlotChange() {\n this._updateCategoriesVisibility();\n this._syncGlobalSwitcherFrame();\n\n // Trigger auto-open when slot content changes (handles late-loading content)\n if (this.autoOpenFlyout && this._isDesktop && !this._autoOpenTriggered) {\n this._autoOpenFirstCategoricalLink();\n }\n }\n\n private _handleClickOut(e: Event) {\n if (!e.composedPath().includes(this)) {\n this.menuOpen = false;\n }\n }\n\n protected override firstUpdated(_changed: PropertyValueMap<this>): void {\n this._updateCategoriesVisibility();\n\n // Auto-open first categorical link on initial render when autoOpenFlyout is set.\n // This handles the case where the nav is already visible (desktop) without a menuOpen toggle.\n if (this.autoOpenFlyout && this._isDesktop) {\n this._autoOpenFirstCategoricalLink();\n }\n }\n\n override willUpdate(changedProps: PropertyValueMap<this>): void {\n if (changedProps.has('menuOpen')) {\n const detail = { open: this.menuOpen };\n\n this.dispatchEvent(\n new CustomEvent('on-nav-toggle', {\n composed: true,\n bubbles: true,\n detail,\n })\n );\n\n // Auto-open first link's flyout when nav opens and autoOpenFlyout is set\n // Only applies to categorical nav (when kyn-header-categories is present)\n if (this.menuOpen && this.autoOpenFlyout && this._isDesktop) {\n this._autoOpenFirstCategoricalLink();\n }\n\n // Reset auto-open flag when nav closes so it can re-trigger on next open\n if (!this.menuOpen) {\n this._autoOpenTriggered = false;\n }\n }\n }\n\n /** Auto-open the first header link that contains categorical/full-width nav\n * @internal\n */\n private _autoOpenFirstCategoricalLink(): void {\n // Use rAF to ensure child elements have completed their first Lit render\n // cycle before we try to open them. This is ~16ms (one frame) vs the\n // previous setTimeout(100) which caused a visible two-step open.\n requestAnimationFrame(() => {\n const links = this.querySelectorAll<HTMLElement & { open?: boolean }>(\n ':scope > kyn-header-link'\n );\n\n // Clear any pending pointer-event timers on all sibling links.\n // When the nav first paints, links can appear under the cursor,\n // firing pointerenter which queues a 150ms timer to open that link\n // and close others. Without clearing, that timer fires after our\n // auto-open and immediately closes the flyout.\n for (const link of links) {\n const l = link as any;\n if (l._enterTimer) {\n clearTimeout(l._enterTimer);\n l._enterTimer = undefined;\n }\n if (l._leaveTimer) {\n clearTimeout(l._leaveTimer);\n l._leaveTimer = undefined;\n }\n }\n\n // Find the target link to open\n let target: (HTMLElement & { open?: boolean }) | null = null;\n\n if (this.autoOpenFlyout && this.autoOpenFlyout !== 'default') {\n // Match by id\n target = this.querySelector(\n `:scope > kyn-header-link#${CSS.escape(this.autoOpenFlyout)}`\n );\n }\n\n if (!target) {\n // Fall back to first expandable/full-width link.\n for (const link of links) {\n const hasCategoricalNav =\n link.querySelector('kyn-header-categories') !== null ||\n querySelectorDeep('kyn-header-categories', link) !== null;\n const hasSlottedCategory =\n link.querySelector('kyn-header-category') !== null ||\n querySelectorDeep('kyn-header-category', link) !== null;\n const hasFullWidthFlyout = link.hasAttribute('full-width-flyout');\n\n if (hasCategoricalNav || hasSlottedCategory || hasFullWidthFlyout) {\n target = link;\n break;\n }\n }\n }\n\n if (target) {\n target.open = true;\n this._autoOpenTriggered = true;\n this._syncGlobalSwitcherFrame();\n }\n });\n }\n\n override updated(changedProps: PropertyValueMap<this>): void {\n if (changedProps.has('hasCategories')) {\n this.classList.toggle('categories-open', this.hasCategories);\n }\n\n if (changedProps.has('hasCategories')) {\n this._syncGlobalSwitcherFrame();\n }\n }\n\n /** Keep the Global Switcher rail height in step with the open flyout.\n * @internal\n */\n private _syncGlobalSwitcherFrame(): void {\n const frame = this.shadowRoot?.querySelector<HTMLElement>('.menu__content');\n\n if (!frame) return;\n\n const resetFrame = () => {\n frame.style.height = '';\n frame.style.minHeight = '';\n this.classList.remove('global-switcher-frame-open');\n this._globalSwitcherResizeObserver?.disconnect();\n this._globalSwitcherResizeObserver = undefined;\n };\n\n const shouldSyncFrame =\n getComputedStyle(this)\n .getPropertyValue('--kyn-header-nav-sync-flyout-height')\n .trim() === '1';\n\n if (!shouldSyncFrame || !this._isDesktop) {\n resetFrame();\n return;\n }\n\n const openLink = this.querySelector<HTMLElement>(\n ':scope > kyn-header-link[open], :scope > kyn-header-link[isactive]'\n );\n const flyout = openLink?.shadowRoot?.querySelector<HTMLElement>(\n '.menu__content.slotted'\n );\n\n if (!flyout) {\n resetFrame();\n return;\n }\n\n this.classList.add('global-switcher-frame-open');\n\n const setHeight = () => {\n const flyoutHeight = flyout.getBoundingClientRect().height;\n frame.style.height = flyoutHeight ? `${flyoutHeight}px` : '';\n frame.style.minHeight = flyoutHeight ? `${flyoutHeight}px` : '';\n };\n\n requestAnimationFrame(setHeight);\n\n this._globalSwitcherResizeObserver?.disconnect();\n this._globalSwitcherResizeObserver = new ResizeObserver(setHeight);\n this._globalSwitcherResizeObserver.observe(flyout);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n document.addEventListener('click', this._boundHandleClickOut);\n\n this._attrObserver = new MutationObserver(() => {\n this._updateCategoriesVisibility();\n this._syncGlobalSwitcherFrame();\n });\n\n this._attrObserver.observe(this, {\n attributes: true,\n subtree: true,\n attributeFilter: ['open'],\n childList: true,\n });\n }\n\n override disconnectedCallback(): void {\n document.removeEventListener('click', this._boundHandleClickOut);\n\n if (this._attrObserver) {\n this._attrObserver.disconnect();\n this._attrObserver = undefined;\n }\n\n if (this._globalSwitcherResizeObserver) {\n this._globalSwitcherResizeObserver.disconnect();\n this._globalSwitcherResizeObserver = undefined;\n }\n\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-header-nav': HeaderNav;\n }\n}\n"],"names":["HeaderNav","customElement","LitElement","_classThis","_classSuper","_HeaderNav_menuOpen_accessor_storage","set","this","__runInitializers","_menuOpen_initializers","_HeaderNav_slot_accessor_storage","_menuOpen_extraInitializers","_slot_initializers","_HeaderNav_autoOpenFlyout_accessor_storage","_slot_extraInitializers","_autoOpenFlyout_initializers","_HeaderNav_truncateLinks_accessor_storage","_autoOpenFlyout_extraInitializers","_truncateLinks_initializers","_HeaderNav_hasCategories_accessor_storage","_truncateLinks_extraInitializers","_hasCategories_initializers","_attrObserver","_hasCategories_extraInitializers","_autoOpenTriggered","_boundHandleClickOut","e","_handleClickOut","menuOpen","__classPrivateFieldGet","value","__classPrivateFieldSet","slot","autoOpenFlyout","truncateLinks","hasCategories","_isDesktop","window","innerWidth","render","classes","menu","open","menuContentClasses","menu__content","left","html","classMap","_toggleMenuOpen","unsafeSVG","closeIcon","menuIcon","_handleSlotChange","_updateCategoriesVisibility","links","querySelectorAllDeep","hasOpenCategory","Array","from","some","link","hasAttribute","hasCategoriesElement","Boolean","querySelectorDeep","nextHasCategories","_syncGlobalSwitcherFrame","_autoOpenFirstCategoricalLink","composedPath","includes","firstUpdated","_changed","willUpdate","changedProps","has","detail","dispatchEvent","CustomEvent","composed","bubbles","requestAnimationFrame","querySelectorAll","l","_enterTimer","clearTimeout","undefined","_leaveTimer","target","querySelector","CSS","escape","hasCategoricalNav","hasSlottedCategory","hasFullWidthFlyout","updated","classList","toggle","frame","_a","shadowRoot","resetFrame","style","height","minHeight","remove","_globalSwitcherResizeObserver","disconnect","getComputedStyle","getPropertyValue","trim","openLink","flyout","_b","add","setHeight","flyoutHeight","getBoundingClientRect","_c","ResizeObserver","observe","connectedCallback","super","document","addEventListener","MutationObserver","attributes","subtree","attributeFilter","childList","disconnectedCallback","removeEventListener","_menuOpen_decorators","state","property","type","String","reflect","attribute","_truncateLinks_decorators","_hasCategories_decorators","__esDecorate","kind","name","static","private","access","obj","get","metadata","_metadata","_slot_decorators","_autoOpenFlyout_decorators","_classDescriptor","_classDecorators","_classExtraInitializers","styles","unsafeCSS","HeaderNavScss"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoBaA,EAAS,yCADrBC,EAAc,0BACgBC,2DAARC,EAAA,cAAQC,oCAOpBC,EAAAC,IAAAC,KAAAC,EAAAD,KAAAE,GAAW,IAMFC,EAAAJ,IAAAC,MAAAC,EAAAD,KAAAI,GAAAH,EAAAD,KAAAK,EAAO,UAQhBC,EAAAP,IAAAC,MAAAC,EAAAD,KAAAO,GAAAN,EAAAD,KAAAQ,EAAiB,MAMjBC,EAAAV,IAAAC,MAAAC,EAAAD,KAAAU,GAAAT,EAAAD,KAAAW,GAAgB,KAMhBC,EAAAb,IAAAC,MAAAC,EAAAD,KAAAa,GAAAZ,EAAAD,KAAAc,GAAgB,KAKjBd,KAAAe,cAAad,EAAAD,KAAAgB,GAKbhB,KAAAiB,oBAAqB,EAKrBjB,KAAAkB,qBAAwBC,GAAanB,KAAKoB,gBAAgBD,EAwRpE,CAjUE,YAASE,GAAQ,OAAAC,EAAAtB,KAAAF,EAAA,IAAA,CAAjB,YAASuB,CAAQE,GAAAC,EAAAxB,KAAAF,EAAAyB,EAAA,IAAA,CAMjB,QAAkBE,GAAI,OAAAH,EAAAtB,KAAAG,EAAA,IAAA,CAAtB,QAAkB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eAAc3B,IAAA,CAAA4I,EAAApH,KAAAoH,EAAdjH,eAAcH,CAAA,GAAAsH,SAAAC,GAAAtI,EAAAE,GAMvB2H,EAAAzI,EAAA,KAAAuI,EAAA,CAAAG,KAAA,WAAAC,KAAA,gBAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAvE,IAAAwE,GAAA,kBAAAA,EAAAC,IAAAD,GAAAA,EAAShH,cAAa5B,IAAA,CAAA4I,EAAApH,KAAAoH,EAAbhH,cAAaJ,CAAA,GAAAsH,SAAAC,GAAAnI,EAAAE,GAMtBwH,EAAAzI,EAAA,KAAAwI,EAAA,CAAAE,KAAA,WAAAC,KAAA,gBAAAC,QAAA,EAAAC,SAAA,EAAAC,OAAA,CAAAvE,IAAAwE,GAAA,kBAAAA,EAAAC,IAAAD,GAAAA,EAAS/G,cAAa7B,IAAA,CAAA4I,EAAApH,KAAAoH,EAAb/G,cAAaL,CAAA,GAAAsH,SAAAC,GAAAhI,EAAAE,GAjCxBqH,EAAA,KAAAY,EAAA,CAAA1H,MAAA3B,GAAAsJ,EAAA,CAAAZ,KAAA,QAAAC,KAAA3I,EAAA2I,KAAAM,SAAAC,GAAA,KAAAK,iHACkBvJ,EAAAwJ,OAASC,EAAUC,GADxBrJ,EAAAL,EAAAuJ,MAAS"}
|
|
@@ -85,7 +85,7 @@ import{__setFunctionName as t,__esDecorate as e,__runInitializers as i,__classPr
|
|
|
85
85
|
width: var(--kyn-popover-mini-width);
|
|
86
86
|
min-width: 0;
|
|
87
87
|
max-width: var(--kyn-popover-mini-max-width);
|
|
88
|
-
padding:
|
|
88
|
+
padding: 12px;
|
|
89
89
|
display: flex;
|
|
90
90
|
align-items: center;
|
|
91
91
|
gap: 8px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyndryl-design-system/shidoka-applications",
|
|
3
|
-
"version": "2.106.
|
|
3
|
+
"version": "2.106.4",
|
|
4
4
|
"description": "Shidoka Web Components for Applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"lottie-web": "^5.12.2",
|
|
45
45
|
"prismjs": "^1.30.0",
|
|
46
46
|
"query-selector-shadow-dom": "^1.0.1",
|
|
47
|
-
"shadow-dom-testing-library": "^1.12.0",
|
|
48
47
|
"swiper": "^12.1.2",
|
|
49
48
|
"tslib": "^2.8.1"
|
|
50
49
|
},
|
|
@@ -68,12 +67,14 @@
|
|
|
68
67
|
"@storybook/addon-themes": "^10.2.13",
|
|
69
68
|
"@storybook/addon-vitest": "^10.2.13",
|
|
70
69
|
"@storybook/web-components-vite": "^10.2.13",
|
|
70
|
+
"@testing-library/dom": "^10.4.1",
|
|
71
71
|
"@types/prismjs": "^1.26.4",
|
|
72
72
|
"@types/query-selector-shadow-dom": "^1.0.4",
|
|
73
73
|
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
|
74
74
|
"@typescript-eslint/parser": "^5.48.1",
|
|
75
|
-
"@vitest/browser": "^
|
|
76
|
-
"@vitest/
|
|
75
|
+
"@vitest/browser": "^4.1.8",
|
|
76
|
+
"@vitest/browser-playwright": "^4.1.8",
|
|
77
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
77
78
|
"axe-playwright": "^2.2.2",
|
|
78
79
|
"chromatic": "^11.2.0",
|
|
79
80
|
"eslint": "^8.57.0",
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
"lint-staged": "^15.4.3",
|
|
85
86
|
"lit-analyzer": "^2.0.3",
|
|
86
87
|
"npm-run-all": "^4.1.5",
|
|
87
|
-
"playwright": "^1.
|
|
88
|
+
"playwright": "^1.60.0",
|
|
88
89
|
"postcss": "^8.4.21",
|
|
89
90
|
"prettier": "^2.8.2",
|
|
90
91
|
"remark-gfm": "^4.0.0",
|
|
@@ -99,10 +100,11 @@
|
|
|
99
100
|
"rollup-plugin-postcss-lit": "^2.2.0",
|
|
100
101
|
"sass": "^1.89.2",
|
|
101
102
|
"sass-embedded": "^1.89.2",
|
|
103
|
+
"shadow-dom-testing-library": "^1.12.0",
|
|
102
104
|
"storybook": "^10.2.13",
|
|
103
105
|
"storybook-addon-tag-badges": "^3.1.0",
|
|
104
106
|
"typescript": "^5.8.3",
|
|
105
|
-
"vitest": "^
|
|
107
|
+
"vitest": "^4.1.8"
|
|
106
108
|
},
|
|
107
109
|
"customElements": "custom-elements.json",
|
|
108
110
|
"lint-staged": {
|