@kyndryl-design-system/shidoka-applications 2.97.7 → 2.97.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/components/global/header/headerCategories.d.ts +11 -11
  2. package/components/global/header/headerCategories.d.ts.map +1 -1
  3. package/components/global/header/headerCategories.js +53 -78
  4. package/components/global/header/headerCategories.js.map +1 -1
  5. package/components/global/header/headerCategory.d.ts +36 -1
  6. package/components/global/header/headerCategory.d.ts.map +1 -1
  7. package/components/global/header/headerCategory.js +52 -9
  8. package/components/global/header/headerCategory.js.map +1 -1
  9. package/components/global/header/headerLink.d.ts.map +1 -1
  10. package/components/global/header/headerLink.js +6 -2
  11. package/components/global/header/headerLink.js.map +1 -1
  12. package/components/reusable/datePicker/datepicker.d.ts +4 -0
  13. package/components/reusable/datePicker/datepicker.d.ts.map +1 -1
  14. package/components/reusable/datePicker/datepicker.js +7 -5
  15. package/components/reusable/datePicker/datepicker.js.map +1 -1
  16. package/components/reusable/daterangepicker/daterangepicker.d.ts +5 -0
  17. package/components/reusable/daterangepicker/daterangepicker.d.ts.map +1 -1
  18. package/components/reusable/daterangepicker/daterangepicker.js +7 -5
  19. package/components/reusable/daterangepicker/daterangepicker.js.map +1 -1
  20. package/components/reusable/timepicker/timepicker.d.ts +2 -0
  21. package/components/reusable/timepicker/timepicker.d.ts.map +1 -1
  22. package/components/reusable/timepicker/timepicker.js +5 -3
  23. package/components/reusable/timepicker/timepicker.js.map +1 -1
  24. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { LitElement, type PropertyValueMap } from 'lit';
2
2
  import './headerCategory';
3
3
  import '../../reusable/button/button';
4
4
  import './headerLink';
5
+ import type { HeaderCategory } from './headerCategory';
5
6
  declare const _defaultTextStrings: {
6
7
  back: string;
7
8
  more: string;
@@ -37,19 +38,11 @@ export interface HeaderMegaChangeDetail {
37
38
  view: HeaderView;
38
39
  }
39
40
  type HeaderView = 'root' | 'detail';
40
- interface SlottedLinkData {
41
- href: string;
42
- inner: string;
43
- textContent: string;
44
- target?: string;
45
- rel?: string;
46
- }
47
41
  interface SlottedCategoryData {
48
42
  id: string;
43
+ slotKey: string;
49
44
  heading: string;
50
- links: SlottedLinkData[];
51
- iconHtml?: string;
52
- showDivider: boolean;
45
+ categoryEl: HeaderCategory;
53
46
  noAutoDivider: boolean;
54
47
  }
55
48
  /**
@@ -189,13 +182,20 @@ export declare class HeaderCategories extends LitElement {
189
182
  private normalizeHeaderLinkTarget;
190
183
  /** Resolve max root links. Disabling limiting, or using non-positive values, means "no limit". */
191
184
  private get _rootLinksLimit();
185
+ private _sanitizeSlotKey;
186
+ private _getRootSlotName;
187
+ private _getDetailSlotName;
188
+ private _getActiveSlottedCategory;
189
+ private _syncSlottedCategoryPresentation;
190
+ private _resetSlottedCategoryPresentation;
191
+ private _handleSlottedMoreClick;
192
192
  private _emitChange;
193
193
  setRootView(tabId?: string): void;
194
194
  openCategoryDetail(tabId: string, categoryId: string, e?: Event): void;
195
195
  handleBackClick(e?: Event): void;
196
196
  private _handleNavToggle;
197
197
  willUpdate(changed: PropertyValueMap<this>): void;
198
- updated(changed: PropertyValueMap<this>): void;
198
+ updated(_changed: PropertyValueMap<this>): void;
199
199
  private renderLinkContent;
200
200
  private renderCategoryColumn;
201
201
  private renderRootView;
@@ -1 +1 @@
1
- {"version":3,"file":"headerCategories.d.ts","sourceRoot":"","sources":["../../../../src/components/global/header/headerCategories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAmB,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAIzE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,8BAA8B,CAAC;AACtC,OAAO,cAAc,CAAC;AAStB,QAAA,MAAM,mBAAmB;;;CAGxB,CAAC;AAEF,KAAK,iBAAiB,GAAG,OAAO,mBAAmB,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,E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AAe;IAsGvB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAgBd,MAAM;IAsDN,iBAAiB,IAAI,IAAI;IAmBzB,oBAAoB,IAAI,IAAI;CAmBtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,gBAAgB,CAAC;KAC3C;CACF"}
1
+ {"version":3,"file":"headerCategories.d.ts","sourceRoot":"","sources":["../../../../src/components/global/header/headerCategories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAmB,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAIzE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,8BAA8B,CAAC;AACtC,OAAO,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,mBAAmB;;;CAGxB,CAAC;AAEF,KAAK,iBAAiB,GAAG,OAAO,mBAAmB,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,sBAAsB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;CACzB;AAED,MAAM,MAAM,sBAAsB,GAAG,CACnC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,yBAAyB,KAChC,MAAM,GAAG,IAAI,CAAC;AAEnB,M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C,EAAE,MAAM,GAAG,IAAI;IAYjC,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAetE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAkBhC,OAAO,CAAC,gBAAgB;IAyBf,UAAU,CAAC,OAAO,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAuBjD,OAAO,CAAC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAoBxD,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,oBAAoB;IA6D5B,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAsDxB,OAAO,CAAC,uBAAuB;IA6B/B,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,+BAA+B;IAiBvC;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA2GvB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAgBd,MAAM;IAkEN,iBAAiB,IAAI,IAAI;IAoBzB,oBAAoB,IAAI,IAAI;CAqBtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,gBAAgB,CAAC;KAC3C;CACF"}
@@ -1,4 +1,4 @@
1
- import{__setFunctionName as t,__esDecorate as e,__runInitializers as i,__classPrivateFieldGet as a,__classPrivateFieldSet as o}from"tslib";import{unsafeSVG as n}from"lit-html/directives/unsafe-svg.js";import{unsafeHTML as r}from"lit-html/directives/unsafe-html.js";import{css as s,LitElement as d,unsafeCSS as l,html as h}from"lit";import{customElement as c,property as u,state as m}from"lit/decorators.js";import"./headerCategory.js";import"../../reusable/button/button.js";import"./headerLink.js";import{h as g,d as y,f as v}from"../../../vendor/@kyndryl-design-system/shidoka-icons-BF-nc1nV.js";import{ifDefined as p}from"lit/directives/if-defined.js";import{debounce as w}from"../../../common/helpers/helpers.js";import"lit-html/directives/class-map.js";import"../../reusable/button/defs.js";import"lit/directives/class-map.js";import"lit/directives/style-map.js";import"../../reusable/textInput/textInput.js";import"deepmerge-ts";import"../../../common/mixins/form-input.js";var k=s`@charset "UTF-8";
1
+ import{__setFunctionName as t,__esDecorate as e,__runInitializers as i,__classPrivateFieldGet as a,__classPrivateFieldSet as o}from"tslib";import{unsafeSVG as s}from"lit-html/directives/unsafe-svg.js";import{unsafeHTML as n}from"lit-html/directives/unsafe-html.js";import{css as r,LitElement as d,unsafeCSS as l,html as h}from"lit";import{customElement as c,property as u,state as g}from"lit/decorators.js";import"./headerCategory.js";import"../../reusable/button/button.js";import"./headerLink.js";import{h as m,d as y,f as v}from"../../../vendor/@kyndryl-design-system/shidoka-icons-BF-nc1nV.js";import{ifDefined as p}from"lit/directives/if-defined.js";import{debounce as w}from"../../../common/helpers/helpers.js";import"lit/directives/style-map.js";import"lit-html/directives/class-map.js";import"../../reusable/button/defs.js";import"lit/directives/class-map.js";import"../../reusable/textInput/textInput.js";import"deepmerge-ts";import"../../../common/mixins/form-input.js";var _=r`@charset "UTF-8";
2
2
  *,
3
3
  *::before,
4
4
  *::after {
@@ -40,12 +40,17 @@ import{__setFunctionName as t,__esDecorate as e,__runInitializers as i,__classPr
40
40
  margin: 0 0 16px;
41
41
  }
42
42
 
43
- slot.header-categories__slot::slotted(*) {
43
+ slot.header-categories__projected,
44
+ slot.header-categories__observer {
45
+ display: block;
46
+ }
47
+
48
+ slot.header-categories__projected::slotted(*) {
44
49
  display: block;
45
50
  break-inside: avoid;
46
51
  -webkit-column-break-inside: avoid;
47
52
  page-break-inside: avoid;
48
- margin: 0 0 16px;
53
+ margin: 0;
49
54
  }
50
55
 
51
56
  :host(:not([layout=grid]):not([view=detail])) .header-categories__inner {
@@ -394,6 +399,10 @@ slot.header-categories__slot::slotted(*) {
394
399
  flex: 0 0 200px;
395
400
  }
396
401
 
402
+ :host([view=detail]) .header-detail-category {
403
+ display: block;
404
+ }
405
+
397
406
  :host([view=detail]) .header-detail-columns--single {
398
407
  max-width: 360px;
399
408
  width: auto;
@@ -408,54 +417,54 @@ slot.header-categories__slot::slotted(*) {
408
417
  :host([view=detail]) .header-detail-columns > div {
409
418
  min-width: 160px;
410
419
  }
411
- }`;const f={back:"Back",more:"More"},_="root",b="detail",x="#";let C=(()=>{var s,C,$,M,S,I,R,L,A,D,T,W,z,E,N,j;let O,H,B,q,P,F,V,U,J,Y,G,K,Q,X,Z,tt,et,it,at=[c("kyn-header-categories")],ot=[],nt=d,rt=[],st=[],dt=[],lt=[],ht=[],ct=[],ut=[],mt=[],gt=[],yt=[],vt=[],pt=[],wt=[],kt=[],ft=[],_t=[],bt=[],xt=[],Ct=[],$t=[],Mt=[],St=[],It=[],Rt=[],Lt=[],At=[],Dt=[],Tt=[],Wt=[],zt=[],Et=[],Nt=[];return H=class extends nt{constructor(){super(...arguments),s.set(this,i(this,rt,null)),C.set(this,(i(this,st),i(this,dt,""))),$.set(this,(i(this,lt),i(this,ht,null))),M.set(this,(i(this,ct),i(this,ut,4))),S.set(this,(i(this,mt),i(this,gt,!0))),I.set(this,(i(this,yt),i(this,vt,""))),R.set(this,(i(this,pt),i(this,wt,3))),L.set(this,(i(this,kt),i(this,ft,!1))),A.set(this,(i(this,_t),i(this,bt,!1))),D.set(this,(i(this,xt),i(this,Ct,!1))),T.set(this,(i(this,$t),i(this,Mt,null))),W.set(this,(i(this,St),i(this,It,f))),z.set(this,(i(this,Rt),i(this,Lt,6))),E.set(this,(i(this,At),i(this,Dt,_))),N.set(this,(i(this,Tt),i(this,Wt,null))),j.set(this,(i(this,zt),i(this,Et,[]))),this._buildSlottedRaf=i(this,Nt),this._owningNav=null,this._debouncedUpdateDividers=w((t=>{this.view!==_||"grid"!==this.layout&&"masonry"!==this.layout||this._updateDividers()}),100),this._lastEmittedColumnCount=0,this._handleResize=()=>{this._debouncedUpdateDividers(new Event("resize"))},this._boundHandleNavToggle=t=>this._handleNavToggle(t)}get tabsConfig(){return a(this,s,"f")}set tabsConfig(t){o(this,s,t,"f")}get activeMegaTabId(){return a(this,C,"f")}set activeMegaTabId(t){o(this,C,t,"f")}get activeMegaCategoryId(){return a(this,$,"f")}set activeMegaCategoryId(t){o(this,$,t,"f")}get maxRootLinks(){return a(this,M,"f")}set maxRootLinks(t){o(this,M,t,"f")}get limitRootLinks(){return a(this,S,"f")}set limitRootLinks(t){o(this,S,t,"f")}get layout(){return a(this,I,"f")}set layout(t){o(this,I,t,"f")}get maxColumns(){return a(this,R,"f")}set maxColumns(t){o(this,R,t,"f")}get fixedColumnWidths(){return a(this,L,"f")}set fixedColumnWidths(t){o(this,L,t,"f")}get showCategoryIcons(){return a(this,A,"f")}set showCategoryIcons(t){o(this,A,t,"f")}get hideCategoryDividers(){return a(this,D,"f")}set hideCategoryDividers(t){o(this,D,t,"f")}get textStrings(){return a(this,T,"f")}set textStrings(t){o(this,T,t,"f")}get _textStrings(){return a(this,W,"f")}set _textStrings(t){o(this,W,t,"f")}get detailLinksPerColumn(){return a(this,z,"f")}set detailLinksPerColumn(t){o(this,z,t,"f")}get view(){return a(this,E,"f")}set view(t){o(this,E,t,"f")}get linkRenderer(){return a(this,N,"f")}set linkRenderer(t){o(this,N,t,"f")}get _slottedCategories(){return a(this,j,"f")}set _slottedCategories(t){o(this,j,t,"f")}_updateAndEmitColumnCount(){if("grid"!==this.layout&&"masonry"!==this.layout)return;const t=this.closest("kyn-tab-panel");if(t&&!t.hasAttribute("visible"))return;const e=this._getColumnCount();e!==this._lastEmittedColumnCount&&(this._lastEmittedColumnCount=e,this.dispatchEvent(new CustomEvent("on-column-count-change",{detail:{columnCount:e,fixedColumnWidths:this.fixedColumnWidths},composed:!0,bubbles:!0})))}_resolveOwningNav(){var t,e;const i=this.closest("kyn-header-nav");if(i)return i;let a=this.getRootNode();for(;a instanceof ShadowRoot;){const i=null===(e=(t=a.host).closest)||void 0===e?void 0:e.call(t,"kyn-header-nav");if(i)return i;a=a.host.getRootNode()}return null}get _isJsonMode(){return null!=this.tabsConfig}get _tabConfig(){var t;return this.tabsConfig&&null!==(t=this.tabsConfig[this.activeMegaTabId])&&void 0!==t?t:null}chunkBy(t,e){if(!t||e<=0)return[[]];const i=[];for(let a=0;a<t.length;a+=e)i.push(t.slice(a,a+e));return i}normalizeHeaderLinkTarget(t){return"_blank"===t||"_parent"===t||"_top"===t?t:"_self"}get _rootLinksLimit(){return!this.limitRootLinks||this.maxRootLinks<=0?Number.POSITIVE_INFINITY:this.maxRootLinks}_emitChange(){const t={activeMegaTabId:this.activeMegaTabId,activeMegaCategoryId:this.activeMegaCategoryId,view:this.view};this.dispatchEvent(new CustomEvent("on-nav-change",{detail:t,composed:!0,bubbles:!0}))}setRootView(t){this.activeMegaTabId=null!=t?t:this.activeMegaTabId,this.activeMegaCategoryId=null,this.view=_,this._emitChange(),this._isJsonMode||this._buildSlottedCategories()}openCategoryDetail(t,e,i){i&&(i.preventDefault(),i.stopPropagation()),this.activeMegaTabId=t,this.activeMegaCategoryId=e,this.view=b,this._emitChange(),this._isJsonMode||this._buildSlottedCategories()}handleBackClick(t){t&&(t.preventDefault(),t.stopPropagation()),this.setRootView(this.activeMegaTabId),this.updateComplete.then((()=>{const t=Array.from(this.querySelectorAll("kyn-header-link")).find((t=>t.hasAttribute("isactive")));t&&t.focus&&t.focus()}))}_handleNavToggle(t){var e;const i=Boolean(null===(e=t.detail)||void 0===e?void 0:e.open);i?this.view!==_||"grid"!==this.layout&&"masonry"!==this.layout||requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.setAttribute("data-columns",String(this._getColumnCount())),this._updateDividers(),this._updateAndEmitColumnCount()}))})):i||this.setRootView(this.activeMegaTabId)}willUpdate(t){var e;t.has("textStrings")&&(this._textStrings={...f,...null!==(e=this.textStrings)&&void 0!==e?e:{}}),"grid"!==this.layout&&"masonry"!==this.layout||this.setAttribute("data-columns",String(this._getColumnCount()))}updated(t){if(t.has("activeMegaCategoryId")||t.has("activeMegaTabId")){const t=null==this.activeMegaCategoryId?_:b;this.view!==t&&(this.view=t)}"grid"!==this.layout&&"masonry"!==this.layout||this.view===_&&requestAnimationFrame((()=>{requestAnimationFrame((()=>this._updateDividers()))})),this.view===_&&this._updateAndEmitColumnCount()}renderLinkContent(t,e){if(this.linkRenderer){const i=this.linkRenderer(t,e);if("string"==typeof i&&i.trim().length>0)return h`${r(i)}`;null!=i&&"string"!=typeof i&&console.warn("[kyn-header-categories] linkRenderer must return a string or null. Received: "+typeof i)}return h`${t.label}`}renderCategoryColumn(t,e){var i;if(!e)return null;const a=null!==(i=e.links)&&void 0!==i?i:[],o=this._rootLinksLimit;return h`
420
+ }`;const f={back:"Back",more:"More"},k="root",b="detail";let x=(()=>{var r,x,C,S,M,I,$,R,A,L,D,T,N,E,P,W;let j,z,O,V,B,F,H,Y,q,J,U,K,G,Z,Q,X,tt,et,it=[c("kyn-header-categories")],at=[],ot=d,st=[],nt=[],rt=[],dt=[],lt=[],ht=[],ct=[],ut=[],gt=[],mt=[],yt=[],vt=[],pt=[],wt=[],_t=[],ft=[],kt=[],bt=[],xt=[],Ct=[],St=[],Mt=[],It=[],$t=[],Rt=[],At=[],Lt=[],Dt=[],Tt=[],Nt=[],Et=[],Pt=[];return z=class extends ot{constructor(){super(...arguments),r.set(this,i(this,st,null)),x.set(this,(i(this,nt),i(this,rt,""))),C.set(this,(i(this,dt),i(this,lt,null))),S.set(this,(i(this,ht),i(this,ct,4))),M.set(this,(i(this,ut),i(this,gt,!0))),I.set(this,(i(this,mt),i(this,yt,""))),$.set(this,(i(this,vt),i(this,pt,3))),R.set(this,(i(this,wt),i(this,_t,!1))),A.set(this,(i(this,ft),i(this,kt,!1))),L.set(this,(i(this,bt),i(this,xt,!1))),D.set(this,(i(this,Ct),i(this,St,null))),T.set(this,(i(this,Mt),i(this,It,f))),N.set(this,(i(this,$t),i(this,Rt,6))),E.set(this,(i(this,At),i(this,Lt,k))),P.set(this,(i(this,Dt),i(this,Tt,null))),W.set(this,(i(this,Nt),i(this,Et,[]))),this._buildSlottedRaf=i(this,Pt),this._owningNav=null,this._debouncedUpdateDividers=w((t=>{this.view!==k||"grid"!==this.layout&&"masonry"!==this.layout||this._updateDividers()}),100),this._lastEmittedColumnCount=0,this._handleResize=()=>{this._debouncedUpdateDividers(new Event("resize"))},this._boundHandleNavToggle=t=>this._handleNavToggle(t)}get tabsConfig(){return a(this,r,"f")}set tabsConfig(t){o(this,r,t,"f")}get activeMegaTabId(){return a(this,x,"f")}set activeMegaTabId(t){o(this,x,t,"f")}get activeMegaCategoryId(){return a(this,C,"f")}set activeMegaCategoryId(t){o(this,C,t,"f")}get maxRootLinks(){return a(this,S,"f")}set maxRootLinks(t){o(this,S,t,"f")}get limitRootLinks(){return a(this,M,"f")}set limitRootLinks(t){o(this,M,t,"f")}get layout(){return a(this,I,"f")}set layout(t){o(this,I,t,"f")}get maxColumns(){return a(this,$,"f")}set maxColumns(t){o(this,$,t,"f")}get fixedColumnWidths(){return a(this,R,"f")}set fixedColumnWidths(t){o(this,R,t,"f")}get showCategoryIcons(){return a(this,A,"f")}set showCategoryIcons(t){o(this,A,t,"f")}get hideCategoryDividers(){return a(this,L,"f")}set hideCategoryDividers(t){o(this,L,t,"f")}get textStrings(){return a(this,D,"f")}set textStrings(t){o(this,D,t,"f")}get _textStrings(){return a(this,T,"f")}set _textStrings(t){o(this,T,t,"f")}get detailLinksPerColumn(){return a(this,N,"f")}set detailLinksPerColumn(t){o(this,N,t,"f")}get view(){return a(this,E,"f")}set view(t){o(this,E,t,"f")}get linkRenderer(){return a(this,P,"f")}set linkRenderer(t){o(this,P,t,"f")}get _slottedCategories(){return a(this,W,"f")}set _slottedCategories(t){o(this,W,t,"f")}_updateAndEmitColumnCount(){if("grid"!==this.layout&&"masonry"!==this.layout)return;const t=this.closest("kyn-tab-panel");if(t&&!t.hasAttribute("visible"))return;const e=this._getColumnCount();e!==this._lastEmittedColumnCount&&(this._lastEmittedColumnCount=e,this.dispatchEvent(new CustomEvent("on-column-count-change",{detail:{columnCount:e,fixedColumnWidths:this.fixedColumnWidths},composed:!0,bubbles:!0})))}_resolveOwningNav(){var t,e;const i=this.closest("kyn-header-nav");if(i)return i;let a=this.getRootNode();for(;a instanceof ShadowRoot;){const i=null===(e=(t=a.host).closest)||void 0===e?void 0:e.call(t,"kyn-header-nav");if(i)return i;a=a.host.getRootNode()}return null}get _isJsonMode(){return null!=this.tabsConfig}get _tabConfig(){var t;return this.tabsConfig&&null!==(t=this.tabsConfig[this.activeMegaTabId])&&void 0!==t?t:null}chunkBy(t,e){if(!t||e<=0)return[[]];const i=[];for(let a=0;a<t.length;a+=e)i.push(t.slice(a,a+e));return i}normalizeHeaderLinkTarget(t){return"_blank"===t||"_parent"===t||"_top"===t?t:"_self"}get _rootLinksLimit(){return!this.limitRootLinks||this.maxRootLinks<=0?Number.POSITIVE_INFINITY:this.maxRootLinks}_sanitizeSlotKey(t){return t.replace(/[^a-zA-Z0-9_-]/g,"-")}_getRootSlotName(t){return`manual-root-${t.slotKey}`}_getDetailSlotName(t){return`manual-detail-${t.slotKey}`}_getActiveSlottedCategory(){var t;return this._slottedCategories.length?null!==(t=this._slottedCategories.find((t=>t.id===this.activeMegaCategoryId)))&&void 0!==t?t:this._slottedCategories[0]:null}_syncSlottedCategoryPresentation(){if(this._isJsonMode)return;const t=this._getActiveSlottedCategory();this._slottedCategories.forEach((e=>{const{categoryEl:i,heading:a,noAutoDivider:o}=e,s=this.view===b&&(null==t?void 0:t.id)===e.id;i.maxVisibleLinks=this.view===k?this._rootLinksLimit:Number.POSITIVE_INFINITY,i.moreLabel=this._textStrings.more,i.detailView=s,i.detailHeading=s?`${a} – ${this._textStrings.more}`:"",i.detailLinksPerColumn=this.detailLinksPerColumn,i.slot=this.view===k?this._getRootSlotName(e):s?this._getDetailSlotName(e):"manual-hidden",this.view!==k||this.hideCategoryDividers?(i.removeAttribute("showdivider"),i.setAttribute("noautodivider","")):(i.setAttribute("showdivider",""),o?i.setAttribute("noautodivider",""):i.removeAttribute("noautodivider"))}))}_resetSlottedCategoryPresentation(){this._slottedCategories.forEach((({categoryEl:t})=>{t.maxVisibleLinks=Number.POSITIVE_INFINITY,t.detailView=!1,t.detailHeading="",t.removeAttribute("slot")}))}_handleSlottedMoreClick(t){var e;const i=t.detail.categoryId||(null===(e=this._getActiveSlottedCategory())||void 0===e?void 0:e.id)||"";i&&this.openCategoryDetail(this.activeMegaTabId,i,t)}_emitChange(){const t={activeMegaTabId:this.activeMegaTabId,activeMegaCategoryId:this.activeMegaCategoryId,view:this.view};this.dispatchEvent(new CustomEvent("on-nav-change",{detail:t,composed:!0,bubbles:!0}))}setRootView(t){this.activeMegaTabId=null!=t?t:this.activeMegaTabId,this.activeMegaCategoryId=null,this.view=k,this._emitChange(),this._isJsonMode||(this._buildSlottedCategories(),this._syncSlottedCategoryPresentation())}openCategoryDetail(t,e,i){i&&(i.preventDefault(),i.stopPropagation()),this.activeMegaTabId=t,this.activeMegaCategoryId=e,this.view=b,this._emitChange(),this._isJsonMode||(this._buildSlottedCategories(),this._syncSlottedCategoryPresentation())}handleBackClick(t){t&&(t.preventDefault(),t.stopPropagation()),this.setRootView(this.activeMegaTabId),this.updateComplete.then((()=>{const t=Array.from(this.querySelectorAll("kyn-header-link")).find((t=>t.hasAttribute("isactive")));t&&t.focus&&t.focus()}))}_handleNavToggle(t){var e;const i=Boolean(null===(e=t.detail)||void 0===e?void 0:e.open);i?this.view!==k||"grid"!==this.layout&&"masonry"!==this.layout||requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.setAttribute("data-columns",String(this._getColumnCount())),this._updateDividers(),this._updateAndEmitColumnCount()}))})):i||this.setRootView(this.activeMegaTabId)}willUpdate(t){var e;t.has("textStrings")&&(this._textStrings={...f,...null!==(e=this.textStrings)&&void 0!==e?e:{}}),(t.has("activeMegaCategoryId")||t.has("activeMegaTabId"))&&(this.view=null==this.activeMegaCategoryId?k:b),"grid"!==this.layout&&"masonry"!==this.layout||this.setAttribute("data-columns",String(this._getColumnCount())),this._isJsonMode||this._syncSlottedCategoryPresentation()}updated(t){"grid"!==this.layout&&"masonry"!==this.layout||this.view===k&&requestAnimationFrame((()=>{requestAnimationFrame((()=>this._updateDividers()))})),this.view===k&&this._updateAndEmitColumnCount()}renderLinkContent(t,e){if(this.linkRenderer){const i=this.linkRenderer(t,e);if("string"==typeof i&&i.trim().length>0)return h`${n(i)}`;null!=i&&"string"!=typeof i&&console.warn("[kyn-header-categories] linkRenderer must return a string or null. Received: "+typeof i)}return h`${t.label}`}renderCategoryColumn(t,e){var i;if(!e)return null;const a=null!==(i=e.links)&&void 0!==i?i:[],o=this._rootLinksLimit;return h`
412
421
  <kyn-header-category
413
422
  heading=${e.heading}
414
423
  ?showDivider=${!this.hideCategoryDividers}
415
424
  ?data-auto-divider=${!this.hideCategoryDividers}
416
425
  >
417
- ${this.showCategoryIcons?h`<span slot="icon">${n(g)}</span>`:null}
426
+ ${this.showCategoryIcons?h`<span slot="icon">${s(m)}</span>`:null}
418
427
  ${a.slice(0,o).map((i=>{var a;const o=this.normalizeHeaderLinkTarget(i.target);return h`
419
428
  <kyn-header-link
420
- href=${null!==(a=i.href)&&void 0!==a?a:x}
429
+ href=${null!==(a=i.href)&&void 0!==a?a:"#"}
421
430
  target=${o}
422
431
  rel=${p(i.rel)}
423
432
  .linkTitle=${i.label}
424
433
  >
425
- ${this.renderLinkContent(i,{tabId:t,categoryId:e.id,view:_})}
434
+ ${this.renderLinkContent(i,{tabId:t,categoryId:e.id,view:k})}
426
435
  </kyn-header-link>
427
436
  `}))}
428
437
  ${a.length>o?h`
429
438
  <kyn-header-link
430
439
  slot="more"
431
- href=${x}
440
+ href=${"#"}
432
441
  @click=${i=>this.openCategoryDetail(t,e.id,i)}
433
442
  @keydown=${i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.openCategoryDetail(t,e.id,i))}}
434
443
  >
435
444
  <span
436
445
  style="display: inline-flex; align-items: center; gap: 8px;"
437
446
  >
438
- ${this._textStrings.more} ${n(y)}
447
+ ${this._textStrings.more} ${s(y)}
439
448
  </span>
440
449
  </kyn-header-link>
441
450
  `:null}
442
451
  </kyn-header-category>
443
- `}renderRootView(){var t,e;const i=null!==(e=null===(t=this._tabConfig)||void 0===t?void 0:t.categories)&&void 0!==e?e:[];return h`${i.map((t=>this.renderCategoryColumn(this.activeMegaTabId,t)))}`}renderDetailView(){var t,e,i;const a=null!==(e=null===(t=this._tabConfig)||void 0===t?void 0:t.categories)&&void 0!==e?e:[],o=null!==(i=a.find((t=>t.id===this.activeMegaCategoryId)))&&void 0!==i?i:a[0];if(!o)return null;const r=this.computeDetailColumns(o.links),s=1===r.length;return h`
452
+ `}renderRootView(){var t,e;const i=null!==(e=null===(t=this._tabConfig)||void 0===t?void 0:t.categories)&&void 0!==e?e:[];return h`${i.map((t=>this.renderCategoryColumn(this.activeMegaTabId,t)))}`}renderDetailView(){var t,e,i;const a=null!==(e=null===(t=this._tabConfig)||void 0===t?void 0:t.categories)&&void 0!==e?e:[],o=null!==(i=a.find((t=>t.id===this.activeMegaCategoryId)))&&void 0!==i?i:a[0];if(!o)return null;const n=this.computeDetailColumns(o.links),r=1===n.length;return h`
444
453
  <kyn-header-category
445
454
  heading=${`${o.heading} – ${this._textStrings.more}`}
446
455
  >
447
- ${this.showCategoryIcons?h`<span slot="icon">${n(g)}</span>`:null}
456
+ ${this.showCategoryIcons?h`<span slot="icon">${s(m)}</span>`:null}
448
457
  <div
449
458
  id=${`detail-${o.id}`}
450
- class="header-detail-columns ${s?"header-detail-columns--single":""}"
459
+ class="header-detail-columns ${r?"header-detail-columns--single":""}"
451
460
  role="region"
452
461
  aria-label=${`${o.heading} – ${this._textStrings.more}`}
453
462
  >
454
- ${r.map((t=>h`
463
+ ${n.map((t=>h`
455
464
  <div>
456
465
  ${t.map((t=>{var e;const i=this.normalizeHeaderLinkTarget(t.target);return h`
457
466
  <kyn-header-link
458
- href=${null!==(e=t.href)&&void 0!==e?e:x}
467
+ href=${null!==(e=t.href)&&void 0!==e?e:"#"}
459
468
  target=${i}
460
469
  rel=${p(t.rel)}
461
470
  .linkTitle=${t.label}
@@ -467,68 +476,29 @@ slot.header-categories__slot::slotted(*) {
467
476
  `))}
468
477
  </div>
469
478
  </kyn-header-category>
470
- `}_buildSlottedCategories(){if(this._isJsonMode)return;const t=Array.from(this.querySelectorAll("kyn-header-category"));if(!t.length)return void(this._slottedCategories=[]);const e=t.map(((t,e)=>{var i,a;const o=null!==(i=t.getAttribute("id"))&&void 0!==i?i:`category-${e+1}`,n=null!==(a=t.getAttribute("heading"))&&void 0!==a?a:"",r=t.querySelector('[slot="icon"]'),s=r?r.innerHTML:void 0,d=Array.from(t.querySelectorAll("kyn-header-link")).filter((e=>e.parentElement===t)).filter((t=>"true"!==t.dataset.kynMoreLink)).map((t=>{var e,i,a,o,n;return{href:null!==(e=t.getAttribute("href"))&&void 0!==e?e:x,target:null!==(i=t.getAttribute("target"))&&void 0!==i?i:void 0,rel:null!==(a=t.getAttribute("rel"))&&void 0!==a?a:void 0,inner:t.innerHTML,textContent:null!==(n=null===(o=t.textContent)||void 0===o?void 0:o.trim())&&void 0!==n?n:""}}));return{id:o,heading:n,links:d,iconHtml:s,showDivider:t.hasAttribute("showdivider"),noAutoDivider:t.hasAttribute("noautodivider")}}));this._slottedCategories=e}renderSlottedRoot(){const t=this._slottedCategories;if(!t.length)return null;const e=this._rootLinksLimit;return h`${t.map((t=>h`
471
- <kyn-header-category
472
- heading=${t.heading}
473
- ?showDivider=${!this.hideCategoryDividers}
474
- .noAutoDivider=${!!this.hideCategoryDividers||t.noAutoDivider}
475
- ?data-auto-divider=${!this.hideCategoryDividers}
476
- >
477
- ${t.iconHtml?h`<span slot="icon">${r(t.iconHtml)}</span>`:this.showCategoryIcons?h`<span slot="icon">${n(g)}</span>`:null}
478
- ${t.links.slice(0,e).map((t=>{const e=this.normalizeHeaderLinkTarget(t.target);return h`
479
- <kyn-header-link
480
- href=${t.href}
481
- target=${e}
482
- rel=${p(t.rel)}
483
- .linkTitle=${t.textContent}
484
- >
485
- ${r(t.inner)}
486
- </kyn-header-link>
487
- `}))}
488
- ${t.links.length>e?h`
489
- <kyn-header-link
490
- slot="more"
491
- href=${x}
492
- @click=${e=>this.openCategoryDetail(this.activeMegaTabId,t.id,e)}
493
- @keydown=${e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.openCategoryDetail(this.activeMegaTabId,t.id,e))}}
494
- >
495
- <span
496
- style="display: inline-flex; align-items: center; gap: 8px;"
497
- >
498
- ${this._textStrings.more} ${n(y)}
499
- </span>
500
- </kyn-header-link>
501
- `:null}
502
- </kyn-header-category>
503
- `))}`}computeDetailColumns(t){const e=null!=t?t:[];if(!e.length)return[];const i=Math.max(this.detailLinksPerColumn,1),a=Math.ceil(e.length/i),o=Math.min(4,Math.max(1,a)),n=Math.ceil(e.length/o);return this.chunkBy(e,n)}renderSlottedDetail(){var t;const e=this._slottedCategories;if(!e.length)return null;const i=null!==(t=e.find((t=>t.id===this.activeMegaCategoryId)))&&void 0!==t?t:e[0];if(!i)return null;const a=this.computeDetailColumns(i.links),o=1===a.length;return h`
504
- <kyn-header-category
505
- heading=${`${i.heading} – ${this._textStrings.more}`}
479
+ `}_buildSlottedCategories(){if(this._isJsonMode)return;const t=Array.from(this.children).filter((t=>"KYN-HEADER-CATEGORY"===t.tagName));if(!t.length)return void(this._slottedCategories=[]);const e=t.map(((t,e)=>{var i,a;const o=null!==(i=t.getAttribute("id"))&&void 0!==i?i:`category-${e+1}`,s=null!==(a=t.getAttribute("heading"))&&void 0!==a?a:"";return{id:o,slotKey:`${e+1}-${this._sanitizeSlotKey(o)}`,heading:s,categoryEl:t,noAutoDivider:t.hasAttribute("noautodivider")}}));this._slottedCategories=e}renderSlottedRoot(){const t=this._slottedCategories;return t.length?h`${t.map((t=>h`
480
+ <slot
481
+ class="header-categories__projected"
482
+ name=${this._getRootSlotName(t)}
483
+ ></slot>
484
+ `))}`:null}computeDetailColumns(t){const e=null!=t?t:[];if(!e.length)return[];const i=Math.max(this.detailLinksPerColumn,1),a=Math.ceil(e.length/i),o=Math.min(4,Math.max(1,a)),s=Math.ceil(e.length/o);return this.chunkBy(e,s)}renderSlottedDetail(){const t=this._getActiveSlottedCategory();return t?h`
485
+ <div
486
+ id=${`detail-${t.id}`}
487
+ class="header-detail-category"
488
+ role="region"
489
+ aria-label=${`${t.heading} – ${this._textStrings.more}`}
490
+ >
491
+ <slot
492
+ class="header-categories__projected"
493
+ name=${this._getDetailSlotName(t)}
494
+ ></slot>
495
+ </div>
496
+ `:null}_scheduleBuildSlottedCategories(){if("undefined"==typeof window)return this._buildSlottedCategories(),void this._syncSlottedCategoryPresentation();null!=this._buildSlottedRaf&&window.cancelAnimationFrame(this._buildSlottedRaf),this._buildSlottedRaf=window.requestAnimationFrame((()=>{this._buildSlottedCategories(),this._syncSlottedCategoryPresentation(),this._buildSlottedRaf=void 0}))}_updateDividers(){var t;if(this.view!==k)return;if("grid"!==this.layout&&"masonry"!==this.layout)return;if(this.hideCategoryDividers)return;const e=this.getBoundingClientRect();if(0===e.width||0===e.height)return;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".header-categories__inner");if(!i)return;const a=this._isJsonMode?Array.from(i.querySelectorAll("kyn-header-category[data-auto-divider]")):this._slottedCategories.map((({categoryEl:t,noAutoDivider:e})=>(t.setAttribute("showdivider",""),e?t.setAttribute("noautodivider",""):t.removeAttribute("noautodivider"),t)));if(!a.length)return;const o=a.map((t=>({el:t,rect:t.getBoundingClientRect()})));if("grid"===this.layout){const t=new Map;for(const e of o){const i=e.rect.top;let a=!1;for(const[o]of t)if(Math.abs(i-o)<=10){t.get(o).push(e),a=!0;break}a||t.set(i,[e])}let e=-1/0;for(const[i]of t)i>e&&(e=i);const i=t.get(e);if(i)for(const t of i)t.el.removeAttribute("showdivider"),t.el.setAttribute("noautodivider","")}else{const t=new Map;for(const e of o){const i=e.rect.left;let a=!1;for(const[o]of t)if(Math.abs(i-o)<=10){t.get(o).push(e),a=!0;break}a||t.set(i,[e])}for(const[,e]of t){let t=e[0];for(const i of e)i.rect.bottom>t.rect.bottom&&(t=i);t.el.removeAttribute("showdivider"),t.el.setAttribute("noautodivider","")}}}_getColumnCount(){var t,e,i;if(this.view!==k||"grid"!==this.layout&&"masonry"!==this.layout)return 1;const a=this._isJsonMode?null!==(i=null===(e=null===(t=this._tabConfig)||void 0===t?void 0:t.categories)||void 0===e?void 0:e.length)&&void 0!==i?i:0:this._slottedCategories.length||this.querySelectorAll(":scope > kyn-header-category").length;return Math.min(Math.max(1,a),this.maxColumns)}render(){const t=this.view,e="grid"===this.layout||"masonry"===this.layout?this._getColumnCount():null,i=this._isJsonMode?t===k?this.renderRootView():this.renderDetailView():t===k?this.renderSlottedRoot():this.renderSlottedDetail();return h`
497
+ <div
498
+ class="header-categories"
499
+ data-view=${t}
500
+ @on-more-click=${t=>this._handleSlottedMoreClick(t)}
506
501
  >
507
- ${i.iconHtml?h`<span slot="icon">${r(i.iconHtml)}</span>`:this.showCategoryIcons?h`<span slot="icon">${n(g)}</span>`:null}
508
- <div
509
- id=${`detail-${i.id}`}
510
- class="header-detail-columns ${o?"header-detail-columns--single":""}"
511
- role="region"
512
- aria-label=${`${i.heading} – ${this._textStrings.more}`}
513
- >
514
- ${a.map((t=>h`
515
- <div>
516
- ${t.map((t=>{const e=this.normalizeHeaderLinkTarget(t.target);return h`
517
- <kyn-header-link
518
- href=${t.href}
519
- target=${e}
520
- rel=${p(t.rel)}
521
- .linkTitle=${t.textContent}
522
- >
523
- ${r(t.inner)}
524
- </kyn-header-link>
525
- `}))}
526
- </div>
527
- `))}
528
- </div>
529
- </kyn-header-category>
530
- `}_scheduleBuildSlottedCategories(){"undefined"!=typeof window?(null!=this._buildSlottedRaf&&window.cancelAnimationFrame(this._buildSlottedRaf),this._buildSlottedRaf=window.requestAnimationFrame((()=>{this._buildSlottedCategories(),this._buildSlottedRaf=void 0}))):this._buildSlottedCategories()}_updateDividers(){var t;if(this.view!==_)return;if("grid"!==this.layout&&"masonry"!==this.layout)return;if(this.hideCategoryDividers)return;const e=this.getBoundingClientRect();if(0===e.width||0===e.height)return;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".header-categories__inner");if(!i)return;const a=Array.from(i.querySelectorAll("kyn-header-category[data-auto-divider]"));if(!a.length)return;a.forEach((t=>{t.setAttribute("showdivider",""),t.removeAttribute("noautodivider")}));const o=a.map((t=>({el:t,rect:t.getBoundingClientRect()})));if("grid"===this.layout){const t=new Map;for(const e of o){const i=e.rect.top;let a=!1;for(const[o]of t)if(Math.abs(i-o)<=10){t.get(o).push(e),a=!0;break}a||t.set(i,[e])}let e=-1/0;for(const[i]of t)i>e&&(e=i);const i=t.get(e);if(i)for(const t of i)t.el.removeAttribute("showdivider"),t.el.setAttribute("noautodivider","")}else{const t=new Map;for(const e of o){const i=e.rect.left;let a=!1;for(const[o]of t)if(Math.abs(i-o)<=10){t.get(o).push(e),a=!0;break}a||t.set(i,[e])}for(const[,e]of t){let t=e[0];for(const i of e)i.rect.bottom>t.rect.bottom&&(t=i);t.el.removeAttribute("showdivider"),t.el.setAttribute("noautodivider","")}}}_getColumnCount(){var t,e,i;if(this.view!==_||"grid"!==this.layout&&"masonry"!==this.layout)return 1;const a=this._isJsonMode?null!==(i=null===(e=null===(t=this._tabConfig)||void 0===t?void 0:t.categories)||void 0===e?void 0:e.length)&&void 0!==i?i:0:this._slottedCategories.length||this.querySelectorAll(":scope > kyn-header-category").length;return Math.min(Math.max(1,a),this.maxColumns)}render(){const t=this.view,e="grid"===this.layout||"masonry"===this.layout?this._getColumnCount():null,i=this._isJsonMode?t===_?this.renderRootView():this.renderDetailView():t===_?this.renderSlottedRoot():this.renderSlottedDetail();return h`
531
- <div class="header-categories" data-view=${t}>
532
502
  <div
533
503
  class="header-categories__inner"
534
504
  data-columns=${p(null!=e?e:void 0)}
@@ -536,9 +506,14 @@ slot.header-categories__slot::slotted(*) {
536
506
  ${null!=i?i:h``}
537
507
  </div>
538
508
 
509
+ <slot
510
+ name="manual-hidden"
511
+ class="header-categories__observer"
512
+ style="display: none;"
513
+ ></slot>
539
514
  <!-- hidden slot used only to observe light DOM changes (edge case) -->
540
515
  <slot
541
- class="header-categories__slot"
516
+ class="header-categories__observer"
542
517
  style="display: none;"
543
518
  @slotchange=${()=>this._scheduleBuildSlottedCategories()}
544
519
  ></slot>
@@ -554,12 +529,12 @@ slot.header-categories__slot::slotted(*) {
554
529
  <span
555
530
  style="display: inline-flex; align-items: center; margin-right: 8px;"
556
531
  >
557
- ${n(v)}
532
+ ${s(v)}
558
533
  </span>
559
534
  ${this._textStrings.back}
560
535
  </kyn-button>
561
536
  </div>
562
537
  `:null}
563
538
  </div>
564
- `}connectedCallback(){var t;super.connectedCallback(),this._owningNav=this._resolveOwningNav(),null===(t=this._owningNav)||void 0===t||t.addEventListener("on-nav-toggle",this._boundHandleNavToggle),this._buildSlottedCategories(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this))}disconnectedCallback(){var t;null===(t=this._owningNav)||void 0===t||t.removeEventListener("on-nav-toggle",this._boundHandleNavToggle),this._owningNav=null,null!=this._buildSlottedRaf&&(window.cancelAnimationFrame(this._buildSlottedRaf),this._buildSlottedRaf=void 0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),super.disconnectedCallback()}},s=new WeakMap,C=new WeakMap,$=new WeakMap,M=new WeakMap,S=new WeakMap,I=new WeakMap,R=new WeakMap,L=new WeakMap,A=new WeakMap,D=new WeakMap,T=new WeakMap,W=new WeakMap,z=new WeakMap,E=new WeakMap,N=new WeakMap,j=new WeakMap,t(H,"HeaderCategories"),(()=>{var t;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=nt[Symbol.metadata])&&void 0!==t?t:null):void 0;B=[u({attribute:!1})],q=[u({type:String})],P=[u({type:String})],F=[u({type:Number})],V=[u({type:Boolean,attribute:"limit-root-links"})],U=[u({type:String,reflect:!0})],J=[u({type:Number})],Y=[u({type:Boolean,reflect:!0,attribute:"fixed-column-widths"})],G=[u({type:Boolean,attribute:"show-category-icons"})],K=[u({type:Boolean,attribute:"hide-category-dividers"})],Q=[u({type:Object})],X=[m()],Z=[u({type:Number})],tt=[u({type:String,reflect:!0})],et=[u({attribute:!1})],it=[m()],e(H,null,B,{kind:"accessor",name:"tabsConfig",static:!1,private:!1,access:{has:t=>"tabsConfig"in t,get:t=>t.tabsConfig,set:(t,e)=>{t.tabsConfig=e}},metadata:i},rt,st),e(H,null,q,{kind:"accessor",name:"activeMegaTabId",static:!1,private:!1,access:{has:t=>"activeMegaTabId"in t,get:t=>t.activeMegaTabId,set:(t,e)=>{t.activeMegaTabId=e}},metadata:i},dt,lt),e(H,null,P,{kind:"accessor",name:"activeMegaCategoryId",static:!1,private:!1,access:{has:t=>"activeMegaCategoryId"in t,get:t=>t.activeMegaCategoryId,set:(t,e)=>{t.activeMegaCategoryId=e}},metadata:i},ht,ct),e(H,null,F,{kind:"accessor",name:"maxRootLinks",static:!1,private:!1,access:{has:t=>"maxRootLinks"in t,get:t=>t.maxRootLinks,set:(t,e)=>{t.maxRootLinks=e}},metadata:i},ut,mt),e(H,null,V,{kind:"accessor",name:"limitRootLinks",static:!1,private:!1,access:{has:t=>"limitRootLinks"in t,get:t=>t.limitRootLinks,set:(t,e)=>{t.limitRootLinks=e}},metadata:i},gt,yt),e(H,null,U,{kind:"accessor",name:"layout",static:!1,private:!1,access:{has:t=>"layout"in t,get:t=>t.layout,set:(t,e)=>{t.layout=e}},metadata:i},vt,pt),e(H,null,J,{kind:"accessor",name:"maxColumns",static:!1,private:!1,access:{has:t=>"maxColumns"in t,get:t=>t.maxColumns,set:(t,e)=>{t.maxColumns=e}},metadata:i},wt,kt),e(H,null,Y,{kind:"accessor",name:"fixedColumnWidths",static:!1,private:!1,access:{has:t=>"fixedColumnWidths"in t,get:t=>t.fixedColumnWidths,set:(t,e)=>{t.fixedColumnWidths=e}},metadata:i},ft,_t),e(H,null,G,{kind:"accessor",name:"showCategoryIcons",static:!1,private:!1,access:{has:t=>"showCategoryIcons"in t,get:t=>t.showCategoryIcons,set:(t,e)=>{t.showCategoryIcons=e}},metadata:i},bt,xt),e(H,null,K,{kind:"accessor",name:"hideCategoryDividers",static:!1,private:!1,access:{has:t=>"hideCategoryDividers"in t,get:t=>t.hideCategoryDividers,set:(t,e)=>{t.hideCategoryDividers=e}},metadata:i},Ct,$t),e(H,null,Q,{kind:"accessor",name:"textStrings",static:!1,private:!1,access:{has:t=>"textStrings"in t,get:t=>t.textStrings,set:(t,e)=>{t.textStrings=e}},metadata:i},Mt,St),e(H,null,X,{kind:"accessor",name:"_textStrings",static:!1,private:!1,access:{has:t=>"_textStrings"in t,get:t=>t._textStrings,set:(t,e)=>{t._textStrings=e}},metadata:i},It,Rt),e(H,null,Z,{kind:"accessor",name:"detailLinksPerColumn",static:!1,private:!1,access:{has:t=>"detailLinksPerColumn"in t,get:t=>t.detailLinksPerColumn,set:(t,e)=>{t.detailLinksPerColumn=e}},metadata:i},Lt,At),e(H,null,tt,{kind:"accessor",name:"view",static:!1,private:!1,access:{has:t=>"view"in t,get:t=>t.view,set:(t,e)=>{t.view=e}},metadata:i},Dt,Tt),e(H,null,et,{kind:"accessor",name:"linkRenderer",static:!1,private:!1,access:{has:t=>"linkRenderer"in t,get:t=>t.linkRenderer,set:(t,e)=>{t.linkRenderer=e}},metadata:i},Wt,zt),e(H,null,it,{kind:"accessor",name:"_slottedCategories",static:!1,private:!1,access:{has:t=>"_slottedCategories"in t,get:t=>t._slottedCategories,set:(t,e)=>{t._slottedCategories=e}},metadata:i},Et,Nt),e(null,O={value:H},at,{kind:"class",name:H.name,metadata:i},null,ot),H=O.value,i&&Object.defineProperty(H,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),H.styles=l(k),i(H,ot),H})();export{C as HeaderCategories};
539
+ `}connectedCallback(){var t;super.connectedCallback(),this._owningNav=this._resolveOwningNav(),null===(t=this._owningNav)||void 0===t||t.addEventListener("on-nav-toggle",this._boundHandleNavToggle),this._buildSlottedCategories(),this._syncSlottedCategoryPresentation(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this))}disconnectedCallback(){var t;null===(t=this._owningNav)||void 0===t||t.removeEventListener("on-nav-toggle",this._boundHandleNavToggle),this._owningNav=null,null!=this._buildSlottedRaf&&(window.cancelAnimationFrame(this._buildSlottedRaf),this._buildSlottedRaf=void 0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),this._resetSlottedCategoryPresentation(),super.disconnectedCallback()}},r=new WeakMap,x=new WeakMap,C=new WeakMap,S=new WeakMap,M=new WeakMap,I=new WeakMap,$=new WeakMap,R=new WeakMap,A=new WeakMap,L=new WeakMap,D=new WeakMap,T=new WeakMap,N=new WeakMap,E=new WeakMap,P=new WeakMap,W=new WeakMap,t(z,"HeaderCategories"),(()=>{var t;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=ot[Symbol.metadata])&&void 0!==t?t:null):void 0;O=[u({attribute:!1})],V=[u({type:String})],B=[u({type:String})],F=[u({type:Number})],H=[u({type:Boolean,attribute:"limit-root-links"})],Y=[u({type:String,reflect:!0})],q=[u({type:Number})],J=[u({type:Boolean,reflect:!0,attribute:"fixed-column-widths"})],U=[u({type:Boolean,attribute:"show-category-icons"})],K=[u({type:Boolean,attribute:"hide-category-dividers"})],G=[u({type:Object})],Z=[g()],Q=[u({type:Number})],X=[u({type:String,reflect:!0})],tt=[u({attribute:!1})],et=[g()],e(z,null,O,{kind:"accessor",name:"tabsConfig",static:!1,private:!1,access:{has:t=>"tabsConfig"in t,get:t=>t.tabsConfig,set:(t,e)=>{t.tabsConfig=e}},metadata:i},st,nt),e(z,null,V,{kind:"accessor",name:"activeMegaTabId",static:!1,private:!1,access:{has:t=>"activeMegaTabId"in t,get:t=>t.activeMegaTabId,set:(t,e)=>{t.activeMegaTabId=e}},metadata:i},rt,dt),e(z,null,B,{kind:"accessor",name:"activeMegaCategoryId",static:!1,private:!1,access:{has:t=>"activeMegaCategoryId"in t,get:t=>t.activeMegaCategoryId,set:(t,e)=>{t.activeMegaCategoryId=e}},metadata:i},lt,ht),e(z,null,F,{kind:"accessor",name:"maxRootLinks",static:!1,private:!1,access:{has:t=>"maxRootLinks"in t,get:t=>t.maxRootLinks,set:(t,e)=>{t.maxRootLinks=e}},metadata:i},ct,ut),e(z,null,H,{kind:"accessor",name:"limitRootLinks",static:!1,private:!1,access:{has:t=>"limitRootLinks"in t,get:t=>t.limitRootLinks,set:(t,e)=>{t.limitRootLinks=e}},metadata:i},gt,mt),e(z,null,Y,{kind:"accessor",name:"layout",static:!1,private:!1,access:{has:t=>"layout"in t,get:t=>t.layout,set:(t,e)=>{t.layout=e}},metadata:i},yt,vt),e(z,null,q,{kind:"accessor",name:"maxColumns",static:!1,private:!1,access:{has:t=>"maxColumns"in t,get:t=>t.maxColumns,set:(t,e)=>{t.maxColumns=e}},metadata:i},pt,wt),e(z,null,J,{kind:"accessor",name:"fixedColumnWidths",static:!1,private:!1,access:{has:t=>"fixedColumnWidths"in t,get:t=>t.fixedColumnWidths,set:(t,e)=>{t.fixedColumnWidths=e}},metadata:i},_t,ft),e(z,null,U,{kind:"accessor",name:"showCategoryIcons",static:!1,private:!1,access:{has:t=>"showCategoryIcons"in t,get:t=>t.showCategoryIcons,set:(t,e)=>{t.showCategoryIcons=e}},metadata:i},kt,bt),e(z,null,K,{kind:"accessor",name:"hideCategoryDividers",static:!1,private:!1,access:{has:t=>"hideCategoryDividers"in t,get:t=>t.hideCategoryDividers,set:(t,e)=>{t.hideCategoryDividers=e}},metadata:i},xt,Ct),e(z,null,G,{kind:"accessor",name:"textStrings",static:!1,private:!1,access:{has:t=>"textStrings"in t,get:t=>t.textStrings,set:(t,e)=>{t.textStrings=e}},metadata:i},St,Mt),e(z,null,Z,{kind:"accessor",name:"_textStrings",static:!1,private:!1,access:{has:t=>"_textStrings"in t,get:t=>t._textStrings,set:(t,e)=>{t._textStrings=e}},metadata:i},It,$t),e(z,null,Q,{kind:"accessor",name:"detailLinksPerColumn",static:!1,private:!1,access:{has:t=>"detailLinksPerColumn"in t,get:t=>t.detailLinksPerColumn,set:(t,e)=>{t.detailLinksPerColumn=e}},metadata:i},Rt,At),e(z,null,X,{kind:"accessor",name:"view",static:!1,private:!1,access:{has:t=>"view"in t,get:t=>t.view,set:(t,e)=>{t.view=e}},metadata:i},Lt,Dt),e(z,null,tt,{kind:"accessor",name:"linkRenderer",static:!1,private:!1,access:{has:t=>"linkRenderer"in t,get:t=>t.linkRenderer,set:(t,e)=>{t.linkRenderer=e}},metadata:i},Tt,Nt),e(z,null,et,{kind:"accessor",name:"_slottedCategories",static:!1,private:!1,access:{has:t=>"_slottedCategories"in t,get:t=>t._slottedCategories,set:(t,e)=>{t._slottedCategories=e}},metadata:i},Et,Pt),e(null,j={value:z},it,{kind:"class",name:z.name,metadata:i},null,at),z=j.value,i&&Object.defineProperty(z,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),z.styles=l(_),i(z,at),z})();export{x as HeaderCategories};
565
540
  //# sourceMappingURL=headerCategories.js.map