UNPKG

@carbon/ibm-products-web-components

Version:
76 lines (74 loc) 2.37 kB
/** * Copyright IBM Corp. 2020, 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import "../../globals/settings.js"; import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.js"; import page_header_default from "./page-header.scss.js"; import { LitElement, html } from "lit"; import { property } from "lit/decorators.js"; import { carbonElement } from "@carbon/web-components/es/globals/decorators/carbon-element.js"; //#region src/components/page-header/page-header-tabs.ts /** * @license * * Copyright IBM Corp. 2025, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ /** * Page header Tabs Bar. * @element c4p-page-header-tabs */ let CDSPageHeaderTabs = class CDSPageHeaderTabs extends LitElement { constructor(..._args) { super(..._args); this.disableStickyTabBar = false; } connectedCallback() { super.connectedCallback(); this.updateContext(); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has("disableStickyTabBar")) this.updateContext(); } updateContext() { const pageHeader = this.closest(`c4p-page-header`); if (pageHeader) { pageHeader.context = { ...pageHeader.context, disableStickyTabBar: this.disableStickyTabBar }; pageHeader.requestUpdate("context"); } } render() { return html` <div class="${"cds-custom"}--css-grid" condensed=""> <div class="${"cds-custom"}--sm:col-span-4 ${"cds-custom"}--md:col-span-8 ${"cds-custom"}--lg:col-span-16 ${"cds-custom"}--css-grid-column" > <div class="${"c4p"}--page-header__tab-bar--tablist"> <slot></slot> <slot name="tags"></slot> </div> </div> <slot name="scroller"></slot> </div>`; } static { this.styles = page_header_default; } }; __decorate([property({ type: Boolean, attribute: "disable-sticky-tab-bar" })], CDSPageHeaderTabs.prototype, "disableStickyTabBar", void 0); CDSPageHeaderTabs = __decorate([carbonElement(`c4p-page-header-tabs`)], CDSPageHeaderTabs); var page_header_tabs_default = CDSPageHeaderTabs; //#endregion export { page_header_tabs_default as default }; //# sourceMappingURL=page-header-tabs.js.map