@cas-smartdesign/header-layout 3.0.2 → 3.1.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../element-base/element-base.ts", "../header-layout.html?raw", "../header-layout.ts"],
3
+ "sources": ["../../../element-base/element-base.ts", "../header-layout.html", "../header-layout.ts"],
4
4
  "sourcesContent": ["export type IReadyEvent = void;\n\nexport interface CustomEventMap extends HTMLElementEventMap {\n ready: CustomEvent<IReadyEvent>;\n}\n\nexport interface ElementBase {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nexport abstract class ElementBase extends HTMLElement {\n public abstract is(): string;\n\n protected abstract template(): HTMLTemplateElement;\n private static readonly TEMPLATE_CACHE: {\n [name: string]: HTMLTemplateElement;\n } = {};\n private memoizedTemplate(): HTMLTemplateElement {\n const is = this.is();\n if (ElementBase.TEMPLATE_CACHE[is]) {\n return ElementBase.TEMPLATE_CACHE[is];\n }\n const template = this.template();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).ShadyCSS) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).ShadyCSS.prepareTemplate(template, this.is());\n }\n ElementBase.TEMPLATE_CACHE[is] = template;\n return template;\n }\n\n public connectedCallback() {\n const template = this.memoizedTemplate();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).ShadyCSS) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).ShadyCSS.styleElement(this);\n }\n if (!this.shadowRoot) {\n this.attachShadow({ mode: \"open\" });\n this.shadowRoot.appendChild(document.importNode(template.content, true));\n requestAnimationFrame(() => this.dispatchEvent(new CustomEvent<IReadyEvent>(\"ready\")));\n }\n }\n\n public whenReady(actor: () => void) {\n if (this.shadowRoot) {\n actor();\n } else {\n this.addEventListener(\"ready\", () => actor());\n }\n }\n}\n", "export default \"<style>\\n\\t:host {\\n\\t\\tdisplay: block;\\n\\t\\tposition: relative;\\n\\t\\toverflow: auto;\\n\\t\\tcontain: content;\\n\\t\\theight: 100%;\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t.content-container {\\n\\t\\tposition: absolute;\\n\\t\\tpadding: inherit;\\n\\t\\ttop: 0;\\n\\t\\tbottom: 0;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tz-index: 1;\\n\\t\\tscroll-behavior: smooth;\\n\\t}\\n\\n\\t/* No 'bottom:0' because this can have dynamic height */\\n\\t.header-container {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tz-index: 2;\\n\\t\\tpointer-events: none;\\n\\t}\\n\\n\\t.header-container > ::slotted(*) {\\n\\t\\tpointer-events: auto;\\n\\t}\\n\\n\\t:host([sticky]) .header-container {\\n\\t\\tposition: sticky;\\n\\t}\\n\\n\\t:host(:not([sticky])) .header-container {\\n\\t\\ttransform: translate3d(0, 0, 0);\\n\\t}\\n\\n\\t:host(:not([sticky])) {\\n\\t\\toverflow: hidden;\\n\\t}\\n\\n\\t:host(:not([sticky])) .content-container {\\n\\t\\theight: 100%;\\n\\t\\toverflow: auto;\\n\\t\\tbox-sizing: border-box;\\n\\t}\\n</style>\\n<div class=\\\"header-container\\\">\\n\\t<slot name=\\\"header\\\"></slot>\\n</div>\\n<div class=\\\"content-container\\\">\\n\\t<slot name=\\\"content\\\"></slot>\\n</div>\\n\"", "import { ElementBase, CustomEventMap as ElementBaseEventMap } from \"@cas-smartdesign/element-base\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [HeaderLayout.ID]: HeaderLayout;\n }\n}\n\nimport { default as htmlTemplate } from \"./header-layout.html?raw\";\n\nexport interface IHeaderSwitchEvent {\n shouldShowNormalHeader: boolean;\n}\nexport interface IHeaderLayoutScrollEvent {\n scrollTop: number;\n}\nexport interface CustomEventMap extends ElementBaseEventMap {\n \"header-switch\": CustomEvent<IHeaderSwitchEvent>;\n \"header-layout-scroll\": CustomEvent<IHeaderLayoutScrollEvent>;\n}\n\nexport default interface HeaderLayout {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nexport default class HeaderLayout extends ElementBase {\n public static readonly ID = \"sd-header-layout\";\n\n public minimumHeaderHeight: number;\n public headerResizeObserverActive = true;\n\n private headerContainer: HTMLElement;\n private contentContainer: HTMLElement;\n private headerSlot: HTMLSlotElement;\n private headerElement: HTMLElement;\n private smallHeaderElement: HTMLElement;\n\n private resizeObserver: ResizeObserver;\n private headerResizeObserver: ResizeObserver;\n\n private lastKnownWidth: number;\n private lastKnownHeaderHeight: number;\n private supportsSticky: boolean;\n private headersHeightDiff: number;\n private normalHeaderHeight: number;\n private showNormalHeader = true;\n private scrollElement: HTMLElement = this;\n\n constructor() {\n super();\n const cssSupport = window.CSS;\n this.supportsSticky = cssSupport && cssSupport.supports(\"position\", \"sticky\");\n if (!this.supportsSticky) {\n this.resizeObserver = new ResizeObserver(() =>\n this.debounce(\"non-sticky-resize\", () => {\n if (this.lastKnownWidth !== this.offsetWidth) {\n this.lastKnownWidth = this.offsetWidth;\n // Ensure scrollbar is visible next to the header element.\n this.headerContainer.style.width = `calc(100% - ${\n this.contentContainer.offsetWidth - this.contentContainer.clientWidth\n }px)`;\n }\n }),\n );\n }\n this.headerResizeObserver = new ResizeObserver(\n () =>\n this.headerResizeObserverActive &&\n this.debounce(\"header-resize\", () => {\n if (this.headerContainer && this.headerContainer.offsetParent) {\n this.updateHeaderHeight();\n this.updateHeader();\n }\n }),\n );\n }\n\n public is(): string {\n return HeaderLayout.ID;\n }\n\n protected template(): HTMLTemplateElement {\n const template = document.createElement(\"template\");\n template.innerHTML = htmlTemplate;\n return template;\n }\n\n public connectedCallback() {\n super.connectedCallback();\n\n if (!this.headerContainer) {\n this.initialize();\n }\n\n if (!this.supportsSticky) {\n this.resizeObserver.observe(this);\n this.scrollElement = this.contentContainer;\n }\n\n this.headerResizeObserver.observe(this.headerContainer);\n this.updateContentContainerPadding(this.headerContainer.offsetHeight);\n }\n\n public disconnectedCallback() {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n if (this.headerResizeObserver) {\n this.headerResizeObserver.disconnect();\n }\n }\n\n private initialize() {\n this.headerContainer = this.shadowRoot.querySelector(\".header-container\");\n this.contentContainer = this.shadowRoot.querySelector(\".content-container\");\n this.headerSlot = this.shadowRoot.querySelector(\".header-container > slot\") as HTMLSlotElement;\n\n this.headerSlot.addEventListener(\"slotchange\", () => {\n this.updateHeaderElementRefs();\n });\n\n if (this.supportsSticky) {\n this.setAttribute(\"sticky\", \"\");\n this.addEventListener(\"scroll\", () => {\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n }\n if (!this.supportsSticky) {\n this.headerContainer.addEventListener(\"wheel\", (event: WheelEvent) => {\n event.preventDefault();\n this.debounce(\"handle-scroll\", () => {\n this.contentContainer.scrollTop += event.deltaY;\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n });\n this.contentContainer.addEventListener(\"scroll\", () => {\n this.debounce(\"handle-scroll\", () => {\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n });\n }\n }\n\n private updateHeaderElementRefs() {\n this.headerElement = this.headerSlot.assignedNodes()[0] as HTMLElement;\n this.smallHeaderElement = this.headerSlot.assignedNodes()[1] as HTMLElement;\n this.normalHeaderHeight = this.headerElement.offsetHeight;\n if (this.smallHeaderElement) {\n this.headersHeightDiff = Math.abs(this.normalHeaderHeight - this.smallHeaderElement.offsetHeight);\n this.smallHeaderElement.style.display = \"none\";\n }\n }\n\n private updateContentContainerPadding(headerHeight: number): void {\n if (this.lastKnownHeaderHeight !== headerHeight) {\n this.lastKnownHeaderHeight = headerHeight;\n this.contentContainer.style.paddingTop = headerHeight + \"px\";\n }\n }\n\n private debounced = {};\n private debounce(id: string, actor: () => void) {\n if (this.debounced[id]) {\n return;\n }\n this.debounced[id] = true;\n requestAnimationFrame(() => {\n delete this.debounced[id];\n actor();\n });\n }\n\n public measure() {\n this.updateHeaderHeight(true);\n this.updateHeader(true);\n }\n\n private updateHeaderHeight(forceMeasure = false) {\n if (forceMeasure || this.showNormalHeader) {\n this.normalHeaderHeight = this.headerContainer.offsetHeight;\n this.updateContentContainerPadding(this.normalHeaderHeight);\n }\n\n if (this.minimumHeaderHeight && this.smallHeaderElement) {\n this.headersHeightDiff = Math.abs(this.normalHeaderHeight - this.smallHeaderElement.offsetHeight);\n }\n }\n\n private updateHeader(forceDispatchEvent = false): void {\n const scrollTop = this.scrollElement.scrollTop;\n if (this.smallHeaderElement) {\n this.headerElement.style.transform = `translateY(-${scrollTop}px)`;\n this.showNormalHeader = scrollTop < this.headersHeightDiff;\n if (this.showNormalHeader) {\n this.headerElement.style.display = \"\";\n this.smallHeaderElement.style.display = \"none\";\n } else {\n this.headerElement.style.display = \"none\";\n this.smallHeaderElement.style.display = \"\";\n }\n } else if (this.minimumHeaderHeight) {\n const shouldShowNormalHeader = scrollTop < this.normalHeaderHeight - this.minimumHeaderHeight;\n if (forceDispatchEvent || this.showNormalHeader !== shouldShowNormalHeader) {\n this.showNormalHeader = shouldShowNormalHeader;\n this.dispatchEvent(\n new CustomEvent<IHeaderSwitchEvent>(\"header-switch\", {\n detail: { shouldShowNormalHeader: this.showNormalHeader },\n }),\n );\n }\n this.headerElement.style.transform = this.showNormalHeader ? `translateY(-${scrollTop}px)` : \"\";\n }\n }\n\n private dispatchCustomScrollEvent(): void {\n this.dispatchEvent(\n new CustomEvent<IHeaderLayoutScrollEvent>(\"header-layout-scroll\", {\n detail: { scrollTop: this.scrollElement.scrollTop },\n }),\n );\n }\n}\n\nif (!customElements.get(HeaderLayout.ID)) {\n customElements.define(HeaderLayout.ID, HeaderLayout);\n}\n"],
5
- "mappings": "2fA8BO,IAAeA,EAAf,MAAeA,UAAoB,WAAY,CAO1C,kBAAwC,CACtC,IAAAC,EAAK,KAAK,GAAA,EACZ,GAAAD,EAAY,eAAeC,CAAE,EACtB,OAAAD,EAAY,eAAeC,CAAE,EAElC,IAAAC,EAAW,KAAK,SAAA,EAEtB,OAAK,OAAe,UAEf,OAAe,SAAS,gBAAgBA,EAAU,KAAK,GAAA,CAAI,EAEpDF,EAAA,eAAeC,CAAE,EAAIC,EAC1BA,CACX,CAEO,mBAAoB,CACjB,IAAAA,EAAW,KAAK,iBAAA,EAEjB,OAAe,UAEf,OAAe,SAAS,aAAa,IAAI,EAEzC,KAAK,aACN,KAAK,aAAa,CAAE,KAAM,MAAQ,CAAA,EAClC,KAAK,WAAW,YAAY,SAAS,WAAWA,EAAS,QAAS,EAAI,CAAC,EACvE,sBAAsB,IAAM,KAAK,cAAc,IAAI,YAAyB,OAAO,CAAC,CAAC,EAE7F,CAEO,UAAUC,EAAm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C,KAAK,cAAc,MAAM,QAAU,OACnC,KAAK,mBAAmB,MAAM,QAAU,YAErC,KAAK,oBAAqB,CACjC,IAAMC,EAAyBD,EAAY,KAAK,mBAAqB,KAAK,qBACtED,GAAsB,KAAK,mBAAqBE,KAChD,KAAK,iBAAmBA,EACxB,KAAK,cACD,IAAI,YAAgC,gBAAiB,CACjD,OAAQ,CAAE,uBAAwB,KAAK,gBAAA,CAAiB,CAC3D,CAAA,GAGT,KAAK,cAAc,MAAM,UAAY,KAAK,iBAAmB,eAAeD,CAAS,MAAQ,EACjG,CACJ,CAEQ,2BAAkC,CACtC,KAAK,cACD,IAAI,YAAsC,uBAAwB,CAC9D,OAAQ,CAAE,UAAW,KAAK,cAAc,SAAA,CAAU,CACrD,CAAA,CAET,CACJ,EAtMIV,EAAuB,GAAK,mBADhC,IAAqBY,EAArBZ,EAyMK,eAAe,IAAIY,EAAa,EAAE,GACnC,eAAe,OAAOA,EAAa,GAAIA,CAAY",
6
6
  "names": ["_ElementBase", "is", "template", "actor", "ElementBase", "htmlTemplate", "_HeaderLayout", "ElementBase", "cssSupport", "template", "event", "headerHeight", "id", "actor", "forceMeasure", "forceDispatchEvent", "scrollTop", "shouldShowNormalHeader", "HeaderLayout"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"header-layout.mjs","sources":["../header-layout.html?raw","../header-layout.ts"],"sourcesContent":["export default \"<style>\\n\\t:host {\\n\\t\\tdisplay: block;\\n\\t\\tposition: relative;\\n\\t\\toverflow: auto;\\n\\t\\tcontain: content;\\n\\t\\theight: 100%;\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t.content-container {\\n\\t\\tposition: absolute;\\n\\t\\tpadding: inherit;\\n\\t\\ttop: 0;\\n\\t\\tbottom: 0;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tz-index: 1;\\n\\t\\tscroll-behavior: smooth;\\n\\t}\\n\\n\\t/* No 'bottom:0' because this can have dynamic height */\\n\\t.header-container {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tz-index: 2;\\n\\t\\tpointer-events: none;\\n\\t}\\n\\n\\t.header-container > ::slotted(*) {\\n\\t\\tpointer-events: auto;\\n\\t}\\n\\n\\t:host([sticky]) .header-container {\\n\\t\\tposition: sticky;\\n\\t}\\n\\n\\t:host(:not([sticky])) .header-container {\\n\\t\\ttransform: translate3d(0, 0, 0);\\n\\t}\\n\\n\\t:host(:not([sticky])) {\\n\\t\\toverflow: hidden;\\n\\t}\\n\\n\\t:host(:not([sticky])) .content-container {\\n\\t\\theight: 100%;\\n\\t\\toverflow: auto;\\n\\t\\tbox-sizing: border-box;\\n\\t}\\n</style>\\n<div class=\\\"header-container\\\">\\n\\t<slot name=\\\"header\\\"></slot>\\n</div>\\n<div class=\\\"content-container\\\">\\n\\t<slot name=\\\"content\\\"></slot>\\n</div>\\n\"","import { ElementBase, CustomEventMap as ElementBaseEventMap } from \"@cas-smartdesign/element-base\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [HeaderLayout.ID]: HeaderLayout;\n }\n}\n\nimport { default as htmlTemplate } from \"./header-layout.html?raw\";\n\nexport interface IHeaderSwitchEvent {\n shouldShowNormalHeader: boolean;\n}\nexport interface IHeaderLayoutScrollEvent {\n scrollTop: number;\n}\nexport interface CustomEventMap extends ElementBaseEventMap {\n \"header-switch\": CustomEvent<IHeaderSwitchEvent>;\n \"header-layout-scroll\": CustomEvent<IHeaderLayoutScrollEvent>;\n}\n\nexport default interface HeaderLayout {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nexport default class HeaderLayout extends ElementBase {\n public static readonly ID = \"sd-header-layout\";\n\n public minimumHeaderHeight: number;\n public headerResizeObserverActive = true;\n\n private headerContainer: HTMLElement;\n private contentContainer: HTMLElement;\n private headerSlot: HTMLSlotElement;\n private headerElement: HTMLElement;\n private smallHeaderElement: HTMLElement;\n\n private resizeObserver: ResizeObserver;\n private headerResizeObserver: ResizeObserver;\n\n private lastKnownWidth: number;\n private lastKnownHeaderHeight: number;\n private supportsSticky: boolean;\n private headersHeightDiff: number;\n private normalHeaderHeight: number;\n private showNormalHeader = true;\n private scrollElement: HTMLElement = this;\n\n constructor() {\n super();\n const cssSupport = window.CSS;\n this.supportsSticky = cssSupport && cssSupport.supports(\"position\", \"sticky\");\n if (!this.supportsSticky) {\n this.resizeObserver = new ResizeObserver(() =>\n this.debounce(\"non-sticky-resize\", () => {\n if (this.lastKnownWidth !== this.offsetWidth) {\n this.lastKnownWidth = this.offsetWidth;\n // Ensure scrollbar is visible next to the header element.\n this.headerContainer.style.width = `calc(100% - ${\n this.contentContainer.offsetWidth - this.contentContainer.clientWidth\n }px)`;\n }\n }),\n );\n }\n this.headerResizeObserver = new ResizeObserver(\n () =>\n this.headerResizeObserverActive &&\n this.debounce(\"header-resize\", () => {\n if (this.headerContainer && this.headerContainer.offsetParent) {\n this.updateHeaderHeight();\n this.updateHeader();\n }\n }),\n );\n }\n\n public is(): string {\n return HeaderLayout.ID;\n }\n\n protected template(): HTMLTemplateElement {\n const template = document.createElement(\"template\");\n template.innerHTML = htmlTemplate;\n return template;\n }\n\n public connectedCallback() {\n super.connectedCallback();\n\n if (!this.headerContainer) {\n this.initialize();\n }\n\n if (!this.supportsSticky) {\n this.resizeObserver.observe(this);\n this.scrollElement = this.contentContainer;\n }\n\n this.headerResizeObserver.observe(this.headerContainer);\n this.updateContentContainerPadding(this.headerContainer.offsetHeight);\n }\n\n public disconnectedCallback() {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n if (this.headerResizeObserver) {\n this.headerResizeObserver.disconnect();\n }\n }\n\n private initialize() {\n this.headerContainer = this.shadowRoot.querySelector(\".header-container\");\n this.contentContainer = this.shadowRoot.querySelector(\".content-container\");\n this.headerSlot = this.shadowRoot.querySelector(\".header-container > slot\") as HTMLSlotElement;\n\n this.headerSlot.addEventListener(\"slotchange\", () => {\n this.updateHeaderElementRefs();\n });\n\n if (this.supportsSticky) {\n this.setAttribute(\"sticky\", \"\");\n this.addEventListener(\"scroll\", () => {\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n }\n if (!this.supportsSticky) {\n this.headerContainer.addEventListener(\"wheel\", (event: WheelEvent) => {\n event.preventDefault();\n this.debounce(\"handle-scroll\", () => {\n this.contentContainer.scrollTop += event.deltaY;\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n });\n this.contentContainer.addEventListener(\"scroll\", () => {\n this.debounce(\"handle-scroll\", () => {\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n });\n }\n }\n\n private updateHeaderElementRefs() {\n this.headerElement = this.headerSlot.assignedNodes()[0] as HTMLElement;\n this.smallHeaderElement = this.headerSlot.assignedNodes()[1] as HTMLElement;\n this.normalHeaderHeight = this.headerElement.offsetHeight;\n if (this.smallHeaderElement) {\n this.headersHeightDiff = Math.abs(this.normalHeaderHeight - this.smallHeaderElement.offsetHeight);\n this.smallHeaderElement.style.display = \"none\";\n }\n }\n\n private updateContentContainerPadding(headerHeight: number): void {\n if (this.lastKnownHeaderHeight !== headerHeight) {\n this.lastKnownHeaderHeight = headerHeight;\n this.contentContainer.style.paddingTop = headerHeight + \"px\";\n }\n }\n\n private debounced = {};\n private debounce(id: string, actor: () => void) {\n if (this.debounced[id]) {\n return;\n }\n this.debounced[id] = true;\n requestAnimationFrame(() => {\n delete this.debounced[id];\n actor();\n });\n }\n\n public measure() {\n this.updateHeaderHeight(true);\n this.updateHeader(true);\n }\n\n private updateHeaderHeight(forceMeasure = false) {\n if (forceMeasure || this.showNormalHeader) {\n this.normalHeaderHeight = this.headerContainer.offsetHeight;\n this.updateContentContainerPadding(this.normalHeaderHeight);\n }\n\n if (this.minimumHeaderHeight && this.smallHeaderElement) {\n this.headersHeightDiff = Math.abs(this.normalHeaderHeight - this.smallHeaderElement.offsetHeight);\n }\n }\n\n private updateHeader(forceDispatchEvent = false): void {\n const scrollTop = this.scrollElement.scrollTop;\n if (this.smallHeaderElement) {\n this.headerElement.style.transform = `translateY(-${scrollTop}px)`;\n this.showNormalHeader = scrollTop < this.headersHeightDiff;\n if (this.showNormalHeader) {\n this.headerElement.style.display = \"\";\n this.smallHeaderElement.style.display = \"none\";\n } else {\n this.headerElement.style.display = \"none\";\n this.smallHeaderElement.style.display = \"\";\n }\n } else if (this.minimumHeaderHeight) {\n const shouldShowNormalHeader = scrollTop < this.normalHeaderHeight - this.minimumHeaderHeight;\n if (forceDispatchEvent || this.showNormalHeader !== shouldShowNormalHeader) {\n this.showNormalHeader = shouldShowNormalHeader;\n this.dispatchEvent(\n new CustomEvent<IHeaderSwitchEvent>(\"header-switch\", {\n detail: { shouldShowNormalHeader: this.showNormalHeader },\n }),\n );\n }\n this.headerElement.style.transform = this.showNormalHeader ? `translateY(-${scrollTop}px)` : \"\";\n }\n }\n\n private dispatchCustomScrollEvent(): void {\n this.dispatchEvent(\n new CustomEvent<IHeaderLayoutScrollEvent>(\"header-layout-scroll\", {\n detail: { scrollTop: this.scrollElement.scrollTop },\n }),\n );\n }\n}\n\nif (!customElements.get(HeaderLayout.ID)) {\n customElements.define(HeaderLayout.ID, HeaderLayout);\n}\n"],"names":["htmlTemplate","_HeaderLayout","ElementBase","cssSupport","template","event","headerHeight","id","actor","forceMeasure","forceDispatchEvent","scrollTop","shouldShowNormalHeader","HeaderLayout"],"mappings":";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YAAgC,iBAAiB;AAAA,UACjD,QAAQ,EAAE,wBAAwB,KAAK,iBAAiB;AAAA,QAAA,CAC3D;AAAA,MAAA,IAGT,KAAK,cAAc,MAAM,YAAY,KAAK,mBAAmB,eAAeD,CAAS,QAAQ;AAAA,IACjG;AAAA,EACJ;AAAA,EAEQ,4BAAkC;AACjC,SAAA;AAAA,MACD,IAAI,YAAsC,wBAAwB;AAAA,QAC9D,QAAQ,EAAE,WAAW,KAAK,cAAc,UAAU;AAAA,MAAA,CACrD;AAAA,IAAA;AAAA,EAET;AACJ;AAtMIV,EAAuB,KAAK;AADhC,IAAqBY,IAArBZ;AAyMK,eAAe,IAAIY,EAAa,EAAE,KACpB,eAAA,OAAOA,EAAa,IAAIA,CAAY;"}
1
+ {"version":3,"file":"header-layout.mjs","sources":["../header-layout.html?raw","../header-layout.ts"],"sourcesContent":["export default \"<style>\\n\\t:host {\\n\\t\\tdisplay: block;\\n\\t\\tposition: relative;\\n\\t\\toverflow: auto;\\n\\t\\tcontain: content;\\n\\t\\theight: 100%;\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t.content-container {\\n\\t\\tposition: absolute;\\n\\t\\tpadding: inherit;\\n\\t\\ttop: 0;\\n\\t\\tbottom: 0;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tz-index: 1;\\n\\t\\tscroll-behavior: smooth;\\n\\t}\\n\\n\\t/* No 'bottom:0' because this can have dynamic height */\\n\\t.header-container {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tz-index: 2;\\n\\t\\tpointer-events: none;\\n\\t}\\n\\n\\t.header-container > ::slotted(*) {\\n\\t\\tpointer-events: auto;\\n\\t}\\n\\n\\t:host([sticky]) .header-container {\\n\\t\\tposition: sticky;\\n\\t}\\n\\n\\t:host(:not([sticky])) .header-container {\\n\\t\\ttransform: translate3d(0, 0, 0);\\n\\t}\\n\\n\\t:host(:not([sticky])) {\\n\\t\\toverflow: hidden;\\n\\t}\\n\\n\\t:host(:not([sticky])) .content-container {\\n\\t\\theight: 100%;\\n\\t\\toverflow: auto;\\n\\t\\tbox-sizing: border-box;\\n\\t}\\n</style>\\n<div class=\\\"header-container\\\">\\n\\t<slot name=\\\"header\\\"></slot>\\n</div>\\n<div class=\\\"content-container\\\">\\n\\t<slot name=\\\"content\\\"></slot>\\n</div>\\n\"","import { ElementBase, CustomEventMap as ElementBaseEventMap } from \"@cas-smartdesign/element-base\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [HeaderLayout.ID]: HeaderLayout;\n }\n}\n\nimport { default as htmlTemplate } from \"./header-layout.html?raw\";\n\nexport interface IHeaderSwitchEvent {\n shouldShowNormalHeader: boolean;\n}\nexport interface IHeaderLayoutScrollEvent {\n scrollTop: number;\n}\nexport interface CustomEventMap extends ElementBaseEventMap {\n \"header-switch\": CustomEvent<IHeaderSwitchEvent>;\n \"header-layout-scroll\": CustomEvent<IHeaderLayoutScrollEvent>;\n}\n\nexport default interface HeaderLayout {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nexport default class HeaderLayout extends ElementBase {\n public static readonly ID = \"sd-header-layout\";\n\n public minimumHeaderHeight: number;\n public headerResizeObserverActive = true;\n\n private headerContainer: HTMLElement;\n private contentContainer: HTMLElement;\n private headerSlot: HTMLSlotElement;\n private headerElement: HTMLElement;\n private smallHeaderElement: HTMLElement;\n\n private resizeObserver: ResizeObserver;\n private headerResizeObserver: ResizeObserver;\n\n private lastKnownWidth: number;\n private lastKnownHeaderHeight: number;\n private supportsSticky: boolean;\n private headersHeightDiff: number;\n private normalHeaderHeight: number;\n private showNormalHeader = true;\n private scrollElement: HTMLElement = this;\n\n constructor() {\n super();\n const cssSupport = window.CSS;\n this.supportsSticky = cssSupport && cssSupport.supports(\"position\", \"sticky\");\n if (!this.supportsSticky) {\n this.resizeObserver = new ResizeObserver(() =>\n this.debounce(\"non-sticky-resize\", () => {\n if (this.lastKnownWidth !== this.offsetWidth) {\n this.lastKnownWidth = this.offsetWidth;\n // Ensure scrollbar is visible next to the header element.\n this.headerContainer.style.width = `calc(100% - ${\n this.contentContainer.offsetWidth - this.contentContainer.clientWidth\n }px)`;\n }\n }),\n );\n }\n this.headerResizeObserver = new ResizeObserver(\n () =>\n this.headerResizeObserverActive &&\n this.debounce(\"header-resize\", () => {\n if (this.headerContainer && this.headerContainer.offsetParent) {\n this.updateHeaderHeight();\n this.updateHeader();\n }\n }),\n );\n }\n\n public is(): string {\n return HeaderLayout.ID;\n }\n\n protected template(): HTMLTemplateElement {\n const template = document.createElement(\"template\");\n template.innerHTML = htmlTemplate;\n return template;\n }\n\n public connectedCallback() {\n super.connectedCallback();\n\n if (!this.headerContainer) {\n this.initialize();\n }\n\n if (!this.supportsSticky) {\n this.resizeObserver.observe(this);\n this.scrollElement = this.contentContainer;\n }\n\n this.headerResizeObserver.observe(this.headerContainer);\n this.updateContentContainerPadding(this.headerContainer.offsetHeight);\n }\n\n public disconnectedCallback() {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n if (this.headerResizeObserver) {\n this.headerResizeObserver.disconnect();\n }\n }\n\n private initialize() {\n this.headerContainer = this.shadowRoot.querySelector(\".header-container\");\n this.contentContainer = this.shadowRoot.querySelector(\".content-container\");\n this.headerSlot = this.shadowRoot.querySelector(\".header-container > slot\") as HTMLSlotElement;\n\n this.headerSlot.addEventListener(\"slotchange\", () => {\n this.updateHeaderElementRefs();\n });\n\n if (this.supportsSticky) {\n this.setAttribute(\"sticky\", \"\");\n this.addEventListener(\"scroll\", () => {\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n }\n if (!this.supportsSticky) {\n this.headerContainer.addEventListener(\"wheel\", (event: WheelEvent) => {\n event.preventDefault();\n this.debounce(\"handle-scroll\", () => {\n this.contentContainer.scrollTop += event.deltaY;\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n });\n this.contentContainer.addEventListener(\"scroll\", () => {\n this.debounce(\"handle-scroll\", () => {\n this.updateHeader();\n this.dispatchCustomScrollEvent();\n });\n });\n }\n }\n\n private updateHeaderElementRefs() {\n this.headerElement = this.headerSlot.assignedNodes()[0] as HTMLElement;\n this.smallHeaderElement = this.headerSlot.assignedNodes()[1] as HTMLElement;\n this.normalHeaderHeight = this.headerElement.offsetHeight;\n if (this.smallHeaderElement) {\n this.headersHeightDiff = Math.abs(this.normalHeaderHeight - this.smallHeaderElement.offsetHeight);\n this.smallHeaderElement.style.display = \"none\";\n }\n }\n\n private updateContentContainerPadding(headerHeight: number): void {\n if (this.lastKnownHeaderHeight !== headerHeight) {\n this.lastKnownHeaderHeight = headerHeight;\n this.contentContainer.style.paddingTop = headerHeight + \"px\";\n }\n }\n\n private debounced = {};\n private debounce(id: string, actor: () => void) {\n if (this.debounced[id]) {\n return;\n }\n this.debounced[id] = true;\n requestAnimationFrame(() => {\n delete this.debounced[id];\n actor();\n });\n }\n\n public measure() {\n this.updateHeaderHeight(true);\n this.updateHeader(true);\n }\n\n private updateHeaderHeight(forceMeasure = false) {\n if (forceMeasure || this.showNormalHeader) {\n this.normalHeaderHeight = this.headerContainer.offsetHeight;\n this.updateContentContainerPadding(this.normalHeaderHeight);\n }\n\n if (this.minimumHeaderHeight && this.smallHeaderElement) {\n this.headersHeightDiff = Math.abs(this.normalHeaderHeight - this.smallHeaderElement.offsetHeight);\n }\n }\n\n private updateHeader(forceDispatchEvent = false): void {\n const scrollTop = this.scrollElement.scrollTop;\n if (this.smallHeaderElement) {\n this.headerElement.style.transform = `translateY(-${scrollTop}px)`;\n this.showNormalHeader = scrollTop < this.headersHeightDiff;\n if (this.showNormalHeader) {\n this.headerElement.style.display = \"\";\n this.smallHeaderElement.style.display = \"none\";\n } else {\n this.headerElement.style.display = \"none\";\n this.smallHeaderElement.style.display = \"\";\n }\n } else if (this.minimumHeaderHeight) {\n const shouldShowNormalHeader = scrollTop < this.normalHeaderHeight - this.minimumHeaderHeight;\n if (forceDispatchEvent || this.showNormalHeader !== shouldShowNormalHeader) {\n this.showNormalHeader = shouldShowNormalHeader;\n this.dispatchEvent(\n new CustomEvent<IHeaderSwitchEvent>(\"header-switch\", {\n detail: { shouldShowNormalHeader: this.showNormalHeader },\n }),\n );\n }\n this.headerElement.style.transform = this.showNormalHeader ? `translateY(-${scrollTop}px)` : \"\";\n }\n }\n\n private dispatchCustomScrollEvent(): void {\n this.dispatchEvent(\n new CustomEvent<IHeaderLayoutScrollEvent>(\"header-layout-scroll\", {\n detail: { scrollTop: this.scrollElement.scrollTop },\n }),\n );\n }\n}\n\nif (!customElements.get(HeaderLayout.ID)) {\n customElements.define(HeaderLayout.ID, HeaderLayout);\n}\n"],"names":["htmlTemplate","_HeaderLayout","ElementBase","cssSupport","template","event","headerHeight","id","actor","forceMeasure","forceDispatchEvent","scrollTop","shouldShowNormalHeader","HeaderLayout"],"mappings":";AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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A;AAAA,MAAU,CACrD;AAAA,IAAA;AAAA,EAET;AACJ;AAtMIV,EAAuB,KAAK;AADhC,IAAqBY,IAArBZ;AAyMK,eAAe,IAAIY,EAAa,EAAE,KACnC,eAAe,OAAOA,EAAa,IAAIA,CAAY;"}
@@ -1,187 +1,192 @@
1
1
  {
2
- "@cypress/vite-dev-server@5.0.7": {
2
+ "@cypress/vite-dev-server@7.0.0": {
3
3
  "licenses": "MIT",
4
4
  "repository": "https://github.com/cypress-io/cypress",
5
5
  "licenseUrl": "https://github.com/cypress-io/cypress/tree/develop/npm/vite-dev-server#readme"
6
6
  },
7
- "@rollup/plugin-node-resolve@15.2.3": {
7
+ "@eslint/js@9.34.0": {
8
+ "licenses": "MIT",
9
+ "repository": "https://github.com/eslint/eslint",
10
+ "licenseUrl": "https://unpkg.com/@eslint/js@9.34.0/LICENSE"
11
+ },
12
+ "@rollup/plugin-node-resolve@16.0.1": {
8
13
  "licenses": "MIT",
9
14
  "repository": "https://github.com/rollup/plugins",
10
- "licenseUrl": "https://github.com/rollup/plugins/raw/HEAD/LICENSE"
15
+ "licenseUrl": "https://unpkg.com/@rollup/plugin-node-resolve@16.0.1/LICENSE"
11
16
  },
12
- "@types/node@20.10.6": {
17
+ "@types/node@24.3.0": {
13
18
  "licenses": "MIT",
14
19
  "repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
15
- "licenseUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/raw/HEAD/LICENSE"
20
+ "licenseUrl": "https://unpkg.com/@types/node@24.3.0/LICENSE"
16
21
  },
17
22
  "@types/postcss-prefix-selector@1.16.3": {
18
23
  "licenses": "MIT",
19
24
  "repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
20
- "licenseUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/raw/HEAD/LICENSE"
25
+ "licenseUrl": "https://unpkg.com/@types/postcss-prefix-selector@1.16.3/LICENSE"
21
26
  },
22
- "@typescript-eslint/eslint-plugin@6.17.0": {
27
+ "@typescript-eslint/eslint-plugin@8.41.0": {
23
28
  "licenses": "MIT",
24
29
  "repository": "https://github.com/typescript-eslint/typescript-eslint",
25
- "licenseUrl": "https://github.com/typescript-eslint/typescript-eslint/raw/HEAD/LICENSE"
30
+ "licenseUrl": "https://unpkg.com/@typescript-eslint/eslint-plugin@8.41.0/LICENSE"
26
31
  },
27
- "@typescript-eslint/parser@6.17.0": {
28
- "licenses": "BSD-2-Clause",
32
+ "@typescript-eslint/parser@8.41.0": {
33
+ "licenses": "MIT",
29
34
  "repository": "https://github.com/typescript-eslint/typescript-eslint",
30
- "licenseUrl": "https://github.com/typescript-eslint/typescript-eslint/raw/HEAD/LICENSE"
35
+ "licenseUrl": "https://unpkg.com/@typescript-eslint/parser@8.41.0/LICENSE"
31
36
  },
32
- "@vitest/coverage-v8@1.1.1": {
37
+ "@vitest/coverage-v8@3.2.4": {
33
38
  "licenses": "MIT",
34
39
  "repository": "https://github.com/vitest-dev/vitest",
35
- "licenseUrl": "https://github.com/vitest-dev/vitest/raw/HEAD/LICENSE"
40
+ "licenseUrl": "https://unpkg.com/@vitest/coverage-v8@3.2.4/LICENSE"
36
41
  },
37
- "@vitest/ui@1.1.1": {
42
+ "@vitest/ui@3.2.4": {
38
43
  "licenses": "MIT",
39
44
  "repository": "https://github.com/vitest-dev/vitest",
40
- "licenseUrl": "https://github.com/vitest-dev/vitest/raw/HEAD/LICENSE"
45
+ "licenseUrl": "https://unpkg.com/@vitest/ui@3.2.4/LICENSE"
41
46
  },
42
- "axe-core@4.8.3": {
47
+ "axe-core@4.10.3": {
43
48
  "licenses": "MPL-2.0",
44
49
  "repository": "https://github.com/dequelabs/axe-core",
45
- "licenseUrl": "https://github.com/dequelabs/axe-core/raw/HEAD/LICENSE"
50
+ "licenseUrl": "https://unpkg.com/axe-core@4.10.3/LICENSE"
46
51
  },
47
- "cypress-axe@1.5.0": {
52
+ "cypress-axe@1.7.0": {
48
53
  "licenses": "MIT",
49
54
  "repository": "https://github.com/component-driven/cypress-axe",
50
- "licenseUrl": "https://github.com/component-driven/cypress-axe/raw/HEAD/License.md"
51
- },
52
- "cypress-real-events@1.13.0": {
53
- "licenses": "MIT",
54
- "repository": "https://github.com/dmtrKovalenko/cypress-real-events",
55
- "licenseUrl": "https://github.com/dmtrKovalenko/cypress-real-events"
55
+ "licenseUrl": "https://unpkg.com/cypress-axe@1.7.0/License.md"
56
56
  },
57
- "cypress@13.6.2": {
57
+ "cypress@15.0.0": {
58
58
  "licenses": "MIT",
59
59
  "repository": "https://github.com/cypress-io/cypress",
60
60
  "licenseUrl": "https://cypress.io"
61
61
  },
62
- "esbuild@0.19.11": {
62
+ "esbuild@0.25.9": {
63
63
  "licenses": "MIT",
64
64
  "repository": "https://github.com/evanw/esbuild",
65
- "licenseUrl": "https://github.com/evanw/esbuild/raw/HEAD/LICENSE.md"
65
+ "licenseUrl": "https://unpkg.com/esbuild@0.25.9/LICENSE.md"
66
66
  },
67
67
  "eslint-config-google@0.14.0": {
68
68
  "licenses": "Apache-2.0",
69
69
  "repository": "https://github.com/google/eslint-config-google",
70
- "licenseUrl": "https://github.com/google/eslint-config-google/raw/HEAD/LICENSE"
70
+ "licenseUrl": "https://unpkg.com/eslint-config-google@0.14.0/LICENSE"
71
71
  },
72
- "eslint-config-prettier@9.1.0": {
72
+ "eslint-config-prettier@10.1.8": {
73
73
  "licenses": "MIT",
74
74
  "repository": "https://github.com/prettier/eslint-config-prettier",
75
- "licenseUrl": "https://github.com/prettier/eslint-config-prettier/raw/HEAD/LICENSE"
75
+ "licenseUrl": "https://unpkg.com/eslint-config-prettier@10.1.8/LICENSE"
76
76
  },
77
- "eslint@8.56.0": {
77
+ "eslint@9.34.0": {
78
78
  "licenses": "MIT",
79
79
  "repository": "https://github.com/eslint/eslint",
80
- "licenseUrl": "https://github.com/eslint/eslint/raw/HEAD/LICENSE"
80
+ "licenseUrl": "https://unpkg.com/eslint@9.34.0/LICENSE"
81
81
  },
82
- "github-markdown-css@5.5.0": {
82
+ "github-markdown-css@5.8.1": {
83
83
  "licenses": "MIT",
84
84
  "repository": "https://github.com/sindresorhus/github-markdown-css",
85
- "licenseUrl": "https://github.com/sindresorhus/github-markdown-css/raw/HEAD/license"
85
+ "licenseUrl": "https://unpkg.com/github-markdown-css@5.8.1/license"
86
86
  },
87
- "highlight.js@11.9.0": {
87
+ "highlight.js@11.11.1": {
88
88
  "licenses": "BSD-3-Clause",
89
89
  "repository": "https://github.com/highlightjs/highlight.js",
90
- "licenseUrl": "https://github.com/highlightjs/highlight.js/raw/HEAD/LICENSE"
90
+ "licenseUrl": "https://unpkg.com/highlight.js@11.11.1/LICENSE"
91
91
  },
92
- "junit-report-builder@3.1.0": {
92
+ "junit-report-builder@5.1.1": {
93
93
  "licenses": "MIT",
94
94
  "repository": "https://github.com/davidparsson/junit-report-builder",
95
- "licenseUrl": "https://github.com/davidparsson/junit-report-builder/raw/HEAD/LICENSE"
95
+ "licenseUrl": "https://unpkg.com/junit-report-builder@5.1.1/LICENSE"
96
96
  },
97
- "lint-staged@15.2.0": {
97
+ "lint-staged@16.1.5": {
98
98
  "licenses": "MIT",
99
- "repository": "https://github.com/okonet/lint-staged",
100
- "licenseUrl": "https://github.com/okonet/lint-staged/raw/HEAD/LICENSE"
99
+ "repository": "https://github.com/lint-staged/lint-staged",
100
+ "licenseUrl": "https://unpkg.com/lint-staged@16.1.5/LICENSE"
101
101
  },
102
- "marked@11.1.1": {
102
+ "marked@16.2.1": {
103
103
  "licenses": "MIT",
104
104
  "repository": "https://github.com/markedjs/marked",
105
- "licenseUrl": "https://github.com/markedjs/marked/raw/HEAD/LICENSE.md"
105
+ "licenseUrl": "https://unpkg.com/marked@16.2.1/LICENSE.md"
106
106
  },
107
- "postcss-prefix-selector@1.16.0": {
107
+ "postcss-prefix-selector@2.1.1": {
108
108
  "licenses": "MIT",
109
109
  "repository": "https://github.com/RadValentin/postcss-prefix-selector",
110
- "licenseUrl": "https://github.com/RadValentin/postcss-prefix-selector/raw/HEAD/LICENSE"
110
+ "licenseUrl": "https://unpkg.com/postcss-prefix-selector@2.1.1/LICENSE"
111
111
  },
112
- "postcss@8.4.32": {
112
+ "postcss@8.5.6": {
113
113
  "licenses": "MIT",
114
114
  "repository": "https://github.com/postcss/postcss",
115
- "licenseUrl": "https://github.com/postcss/postcss/raw/HEAD/LICENSE"
115
+ "licenseUrl": "https://unpkg.com/postcss@8.5.6/LICENSE"
116
116
  },
117
- "prettier@3.1.1": {
117
+ "prettier@3.6.2": {
118
118
  "licenses": "MIT",
119
119
  "repository": "https://github.com/prettier/prettier",
120
- "licenseUrl": "https://github.com/prettier/prettier/raw/HEAD/LICENSE"
120
+ "licenseUrl": "https://unpkg.com/prettier@3.6.2/LICENSE"
121
121
  },
122
122
  "resolve-pkg@2.0.0": {
123
123
  "licenses": "MIT",
124
124
  "repository": "https://github.com/sindresorhus/resolve-pkg",
125
- "licenseUrl": "https://github.com/sindresorhus/resolve-pkg/raw/HEAD/license"
125
+ "licenseUrl": "https://unpkg.com/resolve-pkg@2.0.0/license"
126
126
  },
127
- "sass@1.69.6": {
127
+ "sass@1.91.0": {
128
128
  "licenses": "MIT",
129
129
  "repository": "https://github.com/sass/dart-sass",
130
- "licenseUrl": "https://github.com/sass/dart-sass/raw/HEAD/LICENSE"
130
+ "licenseUrl": "https://unpkg.com/sass@1.91.0/LICENSE"
131
131
  },
132
- "stylelint-config-recommended-scss@14.0.0": {
132
+ "stylelint-config-recommended-scss@16.0.0": {
133
133
  "licenses": "MIT",
134
134
  "repository": "https://github.com/stylelint-scss/stylelint-config-recommended-scss",
135
- "licenseUrl": "https://github.com/stylelint-scss/stylelint-config-recommended-scss/raw/HEAD/LICENSE"
135
+ "licenseUrl": "https://unpkg.com/stylelint-config-recommended-scss@16.0.0/LICENSE"
136
136
  },
137
- "stylelint-config-standard@36.0.0": {
137
+ "stylelint-config-standard@39.0.0": {
138
138
  "licenses": "MIT",
139
139
  "repository": "https://github.com/stylelint/stylelint-config-standard",
140
- "licenseUrl": "https://github.com/stylelint/stylelint-config-standard/raw/HEAD/LICENSE"
140
+ "licenseUrl": "https://unpkg.com/stylelint-config-standard@39.0.0/LICENSE"
141
141
  },
142
- "stylelint-scss@6.0.0": {
142
+ "stylelint-scss@6.12.1": {
143
143
  "licenses": "MIT",
144
144
  "repository": "https://github.com/stylelint-scss/stylelint-scss",
145
- "licenseUrl": "https://github.com/stylelint-scss/stylelint-scss/raw/HEAD/LICENSE"
145
+ "licenseUrl": "https://unpkg.com/stylelint-scss@6.12.1/LICENSE"
146
146
  },
147
- "stylelint@16.1.0": {
147
+ "stylelint@16.23.1": {
148
148
  "licenses": "MIT",
149
149
  "repository": "https://github.com/stylelint/stylelint",
150
- "licenseUrl": "https://github.com/stylelint/stylelint/raw/HEAD/LICENSE"
150
+ "licenseUrl": "https://unpkg.com/stylelint@16.23.1/LICENSE"
151
151
  },
152
- "tsup@8.0.1": {
152
+ "tsup@8.5.0": {
153
153
  "licenses": "MIT",
154
154
  "repository": "https://github.com/egoist/tsup",
155
- "licenseUrl": "https://github.com/egoist/tsup/raw/HEAD/LICENSE"
155
+ "licenseUrl": "https://unpkg.com/tsup@8.5.0/LICENSE"
156
156
  },
157
- "turbo@1.11.2": {
158
- "licenses": "MPL-2.0",
159
- "repository": "https://github.com/vercel/turbo",
160
- "licenseUrl": "https://github.com/vercel/turbo/raw/HEAD/LICENSE"
157
+ "turbo@2.5.6": {
158
+ "licenses": "MIT",
159
+ "repository": "https://github.com/vercel/turborepo",
160
+ "licenseUrl": "https://unpkg.com/turbo@2.5.6/LICENSE"
161
+ },
162
+ "typescript-eslint@8.41.0": {
163
+ "licenses": "MIT",
164
+ "repository": "https://github.com/typescript-eslint/typescript-eslint",
165
+ "licenseUrl": "https://unpkg.com/typescript-eslint@8.41.0/LICENSE"
161
166
  },
162
- "typescript@5.3.3": {
167
+ "typescript@5.9.2": {
163
168
  "licenses": "Apache-2.0",
164
- "repository": "https://github.com/Microsoft/TypeScript",
165
- "licenseUrl": "https://github.com/Microsoft/TypeScript/raw/HEAD/LICENSE.txt"
169
+ "repository": "https://github.com/microsoft/TypeScript",
170
+ "licenseUrl": "https://unpkg.com/typescript@5.9.2/LICENSE.txt"
166
171
  },
167
- "vite-tsconfig-paths@4.2.3": {
172
+ "vite-tsconfig-paths@5.1.4": {
168
173
  "licenses": "MIT",
169
174
  "repository": "https://github.com/aleclarson/vite-tsconfig-paths",
170
- "licenseUrl": "https://github.com/aleclarson/vite-tsconfig-paths/raw/HEAD/LICENSE"
175
+ "licenseUrl": "https://unpkg.com/vite-tsconfig-paths@5.1.4/LICENSE"
171
176
  },
172
- "vite@5.0.10": {
177
+ "vite@7.1.3": {
173
178
  "licenses": "MIT",
174
179
  "repository": "https://github.com/vitejs/vite",
175
- "licenseUrl": "https://github.com/vitejs/vite/raw/HEAD/LICENSE.md"
180
+ "licenseUrl": "https://unpkg.com/vite@7.1.3/LICENSE.md"
176
181
  },
177
- "vitest@1.1.1": {
182
+ "vitest@3.2.4": {
178
183
  "licenses": "MIT",
179
184
  "repository": "https://github.com/vitest-dev/vitest",
180
- "licenseUrl": "https://github.com/vitest-dev/vitest/raw/HEAD/LICENSE.md"
185
+ "licenseUrl": "https://unpkg.com/vitest@3.2.4/LICENSE.md"
181
186
  },
182
- "yargs@17.7.2": {
187
+ "yargs@18.0.0": {
183
188
  "licenses": "MIT",
184
189
  "repository": "https://github.com/yargs/yargs",
185
- "licenseUrl": "https://github.com/yargs/yargs/raw/HEAD/LICENSE"
190
+ "licenseUrl": "https://unpkg.com/yargs@18.0.0/LICENSE"
186
191
  }
187
192
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@cas-smartdesign/header-layout",
3
- "version": "3.0.2",
3
+ "version": "3.1.1",
4
4
  "description": "A scrollable layout element with sticky header.",
5
5
  "main": "dist/header-layout-with-externals.js",
6
6
  "module": "dist/header-layout.mjs",
7
7
  "types": "dist/header-layout.d.ts",
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "dependencies": {
10
- "@cas-smartdesign/element-base": "^5.0.2"
10
+ "@cas-smartdesign/element-base": "^5.1.1"
11
11
  },
12
12
  "files": [
13
13
  "dist",
@@ -18,8 +18,8 @@
18
18
  "access": "public"
19
19
  },
20
20
  "devDependencies": {
21
- "@cas-smartdesign/element-preview": "^0.2.2",
22
- "@cas-smartdesign/license-generator": "^1.6.3"
21
+ "@cas-smartdesign/element-preview": "^0.3.1",
22
+ "@cas-smartdesign/license-generator": "^1.8.1"
23
23
  },
24
24
  "scripts": {
25
25
  "version": "pnpm version",