@tedi-design-system/angular 8.1.0-rc.17 → 8.1.0-rc.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/community/index.d.ts.map +1 -1
- package/fesm2022/tedi-design-system-angular-community.mjs +11 -0
- package/fesm2022/tedi-design-system-angular-community.mjs.map +1 -1
- package/fesm2022/tedi-design-system-angular-tedi.mjs +445 -15
- package/fesm2022/tedi-design-system-angular-tedi.mjs.map +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/tedi/index.d.ts +248 -16
- package/tedi/index.d.ts.map +1 -1
|
@@ -2707,20 +2707,6 @@ const translationsMap = {
|
|
|
2707
2707
|
en: "Table of contents",
|
|
2708
2708
|
ru: "Содержание",
|
|
2709
2709
|
},
|
|
2710
|
-
"table-of-contents.valid": {
|
|
2711
|
-
description: "Number of valid steps",
|
|
2712
|
-
components: ["TableOfContents"],
|
|
2713
|
-
et: (count) => `${count} valiidsed`,
|
|
2714
|
-
en: (count) => `${count} valid`,
|
|
2715
|
-
ru: (count) => `${count} действительны`,
|
|
2716
|
-
},
|
|
2717
|
-
"table-of-contents.invalid": {
|
|
2718
|
-
description: "Number of invalid steps",
|
|
2719
|
-
components: ["TableOfContents"],
|
|
2720
|
-
et: (count) => `${count} mitte valiidne`,
|
|
2721
|
-
en: (count) => `${count} invalid`,
|
|
2722
|
-
ru: (count) => `${count} неверный`,
|
|
2723
|
-
},
|
|
2724
2710
|
"truncate.see-more": {
|
|
2725
2711
|
description: "See more button label",
|
|
2726
2712
|
components: ["Truncate"],
|
|
@@ -22557,6 +22543,450 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImpo
|
|
|
22557
22543
|
}, template: "<ng-content />\n", styles: [".tedi-horizontal-stepper{display:flex;background-color:var(--stepper-background)}.tedi-horizontal-stepper--transparent{background-color:transparent}.tedi-horizontal-stepper--compact .tedi-horizontal-stepper-item{flex:1 0 0}.tedi-horizontal-stepper--compact .tedi-horizontal-stepper-item--selected{flex:0 0 auto}.tedi-horizontal-stepper--compact .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__step{align-items:center;justify-content:center;width:100%}.tedi-horizontal-stepper--compact .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__content{display:none}.tedi-horizontal-stepper--compact .tedi-horizontal-stepper-item--selected .tedi-horizontal-stepper-item__content{display:flex}@media(max-width:35.98rem){.tedi-horizontal-stepper--compact-sm .tedi-horizontal-stepper-item{flex:1 0 0}.tedi-horizontal-stepper--compact-sm .tedi-horizontal-stepper-item--selected{flex:0 0 auto}.tedi-horizontal-stepper--compact-sm .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__step{align-items:center;justify-content:center;width:100%}.tedi-horizontal-stepper--compact-sm .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__content{display:none}.tedi-horizontal-stepper--compact-sm .tedi-horizontal-stepper-item--selected .tedi-horizontal-stepper-item__content{display:flex}}@media(max-width:47.98rem){.tedi-horizontal-stepper--compact-md .tedi-horizontal-stepper-item{flex:1 0 0}.tedi-horizontal-stepper--compact-md .tedi-horizontal-stepper-item--selected{flex:0 0 auto}.tedi-horizontal-stepper--compact-md .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__step{align-items:center;justify-content:center;width:100%}.tedi-horizontal-stepper--compact-md .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__content{display:none}.tedi-horizontal-stepper--compact-md .tedi-horizontal-stepper-item--selected .tedi-horizontal-stepper-item__content{display:flex}}@media(max-width:61.98rem){.tedi-horizontal-stepper--compact-lg .tedi-horizontal-stepper-item{flex:1 0 0}.tedi-horizontal-stepper--compact-lg .tedi-horizontal-stepper-item--selected{flex:0 0 auto}.tedi-horizontal-stepper--compact-lg .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__step{align-items:center;justify-content:center;width:100%}.tedi-horizontal-stepper--compact-lg .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__content{display:none}.tedi-horizontal-stepper--compact-lg .tedi-horizontal-stepper-item--selected .tedi-horizontal-stepper-item__content{display:flex}}@media(max-width:74.98rem){.tedi-horizontal-stepper--compact-xl .tedi-horizontal-stepper-item{flex:1 0 0}.tedi-horizontal-stepper--compact-xl .tedi-horizontal-stepper-item--selected{flex:0 0 auto}.tedi-horizontal-stepper--compact-xl .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__step{align-items:center;justify-content:center;width:100%}.tedi-horizontal-stepper--compact-xl .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__content{display:none}.tedi-horizontal-stepper--compact-xl .tedi-horizontal-stepper-item--selected .tedi-horizontal-stepper-item__content{display:flex}}@media(max-width:87.48rem){.tedi-horizontal-stepper--compact-xxl .tedi-horizontal-stepper-item{flex:1 0 0}.tedi-horizontal-stepper--compact-xxl .tedi-horizontal-stepper-item--selected{flex:0 0 auto}.tedi-horizontal-stepper--compact-xxl .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__step{align-items:center;justify-content:center;width:100%}.tedi-horizontal-stepper--compact-xxl .tedi-horizontal-stepper-item .tedi-horizontal-stepper-item__content{display:none}.tedi-horizontal-stepper--compact-xxl .tedi-horizontal-stepper-item--selected .tedi-horizontal-stepper-item__content{display:flex}}\n"] }]
|
|
22558
22544
|
}], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => HorizontalStepperItemComponent), { isSignal: true }] }] } });
|
|
22559
22545
|
|
|
22546
|
+
/**
|
|
22547
|
+
* A single entry in a `tedi-table-of-contents`. Its non-item content (a
|
|
22548
|
+
* `tedi-link`, anchor or button) is the clickable label; nested
|
|
22549
|
+
* `tedi-table-of-contents-item` children become this item's sub-items and are
|
|
22550
|
+
* only revealed when the item is on the active branch.
|
|
22551
|
+
*/
|
|
22552
|
+
class TableOfContentsItemComponent {
|
|
22553
|
+
/**
|
|
22554
|
+
* Unique id. Required to mark the item active (via the parent's `activeId`)
|
|
22555
|
+
* and to be the parent of nested items. Named `itemId` to avoid
|
|
22556
|
+
* shadowing the native `id` attribute.
|
|
22557
|
+
*/
|
|
22558
|
+
itemId = input(...(ngDevMode ? [undefined, { debugName: "itemId" }] : []));
|
|
22559
|
+
/** Render a separator below the item. */
|
|
22560
|
+
separator = input(false, ...(ngDevMode ? [{ debugName: "separator" }] : []));
|
|
22561
|
+
root = inject(TableOfContentsComponent);
|
|
22562
|
+
parent = inject(TableOfContentsItemComponent, {
|
|
22563
|
+
optional: true,
|
|
22564
|
+
skipSelf: true,
|
|
22565
|
+
});
|
|
22566
|
+
/** Direct nested items (a single level down). */
|
|
22567
|
+
childItems = contentChildren(TableOfContentsItemComponent, ...(ngDevMode ? [{ debugName: "childItems" }] : []));
|
|
22568
|
+
numbered = computed(() => this.root.numbered(), ...(ngDevMode ? [{ debugName: "numbered" }] : []));
|
|
22569
|
+
depth = computed(() => this.parent ? this.parent.depth() + 1 : 1, ...(ngDevMode ? [{ debugName: "depth" }] : []));
|
|
22570
|
+
/** CSS indent level — capped at 2, matching the design's two-level hierarchy. */
|
|
22571
|
+
level = computed(() => Math.min(this.depth(), 2), ...(ngDevMode ? [{ debugName: "level" }] : []));
|
|
22572
|
+
hasChildren = computed(() => this.childItems().length > 0, ...(ngDevMode ? [{ debugName: "hasChildren" }] : []));
|
|
22573
|
+
isSelected = computed(() => !!this.itemId() && this.itemId() === this.root.activeId(), ...(ngDevMode ? [{ debugName: "isSelected" }] : []));
|
|
22574
|
+
/** Whether the active item is this item or somewhere in its subtree. */
|
|
22575
|
+
containsActive = computed(() => this.isSelected() ||
|
|
22576
|
+
this.childItems().some((child) => child.containsActive()), ...(ngDevMode ? [{ debugName: "containsActive" }] : []));
|
|
22577
|
+
/**
|
|
22578
|
+
* Whether this item's nested group is expanded: always when the TOC is
|
|
22579
|
+
* `defaultOpen`, otherwise only along the branch leading to the active item.
|
|
22580
|
+
*/
|
|
22581
|
+
isOpen = computed(() => this.hasChildren() && (this.root.defaultOpen() || this.containsActive()), ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
22582
|
+
siblings = computed(() => this.parent ? this.parent.childItems() : this.root.items(), ...(ngDevMode ? [{ debugName: "siblings" }] : []));
|
|
22583
|
+
index = computed(() => this.siblings().indexOf(this), ...(ngDevMode ? [{ debugName: "index" }] : []));
|
|
22584
|
+
numberPrefix = computed(() => this.parent ? this.parent.numberBase() : undefined, ...(ngDevMode ? [{ debugName: "numberPrefix" }] : []));
|
|
22585
|
+
/** Hierarchical number base without trailing dot, e.g. `2` or `2.1`. */
|
|
22586
|
+
numberBase = computed(() => {
|
|
22587
|
+
const position = this.index() + 1;
|
|
22588
|
+
const prefix = this.numberPrefix();
|
|
22589
|
+
return prefix ? `${prefix}.${position}` : `${position}`;
|
|
22590
|
+
}, ...(ngDevMode ? [{ debugName: "numberBase" }] : []));
|
|
22591
|
+
/** Rendered number — `1.` at the top level, `1.1` when nested. */
|
|
22592
|
+
numberLabel = computed(() => this.numberPrefix() ? this.numberBase() : `${this.numberBase()}.`, ...(ngDevMode ? [{ debugName: "numberLabel" }] : []));
|
|
22593
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22594
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.24", type: TableOfContentsItemComponent, isStandalone: true, selector: "tedi-table-of-contents-item", inputs: { itemId: { classPropertyName: "itemId", publicName: "itemId", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "listitem" }, properties: { "class.tedi-table-of-contents__item--selected": "isSelected()", "attr.aria-current": "isSelected() ? 'location' : null", "attr.data-name": "'table-of-contents-item'" }, classAttribute: "tedi-table-of-contents__item" }, queries: [{ propertyName: "childItems", predicate: TableOfContentsItemComponent, isSignal: true }], ngImport: i0, template: "<span\n class=\"tedi-table-of-contents__row\"\n [class]=\"'tedi-table-of-contents__row--level-' + level()\"\n>\n @if (numbered()) {\n <span class=\"tedi-table-of-contents__number\" aria-hidden=\"true\">{{\n numberLabel()\n }}</span>\n }\n <span class=\"tedi-table-of-contents__content\">\n <ng-content />\n </span>\n <ng-content select=\"[tediTocItemSuffix]\" />\n</span>\n\n@if (separator()) {\n <div class=\"tedi-table-of-contents__separator\">\n <tedi-separator />\n </div>\n}\n\n@if (isOpen()) {\n <ul class=\"tedi-table-of-contents__group\" role=\"list\">\n <ng-content select=\"tedi-table-of-contents-item\" />\n </ul>\n}\n", dependencies: [{ kind: "component", type: SeparatorComponent, selector: "tedi-separator", inputs: ["axis", "color", "variant", "dotSize", "dotFilled", "thickness", "spacing", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
22595
|
+
}
|
|
22596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsItemComponent, decorators: [{
|
|
22597
|
+
type: Component,
|
|
22598
|
+
args: [{ selector: "tedi-table-of-contents-item", standalone: true, imports: [SeparatorComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
22599
|
+
class: "tedi-table-of-contents__item",
|
|
22600
|
+
role: "listitem",
|
|
22601
|
+
"[class.tedi-table-of-contents__item--selected]": "isSelected()",
|
|
22602
|
+
"[attr.aria-current]": "isSelected() ? 'location' : null",
|
|
22603
|
+
"[attr.data-name]": "'table-of-contents-item'",
|
|
22604
|
+
}, template: "<span\n class=\"tedi-table-of-contents__row\"\n [class]=\"'tedi-table-of-contents__row--level-' + level()\"\n>\n @if (numbered()) {\n <span class=\"tedi-table-of-contents__number\" aria-hidden=\"true\">{{\n numberLabel()\n }}</span>\n }\n <span class=\"tedi-table-of-contents__content\">\n <ng-content />\n </span>\n <ng-content select=\"[tediTocItemSuffix]\" />\n</span>\n\n@if (separator()) {\n <div class=\"tedi-table-of-contents__separator\">\n <tedi-separator />\n </div>\n}\n\n@if (isOpen()) {\n <ul class=\"tedi-table-of-contents__group\" role=\"list\">\n <ng-content select=\"tedi-table-of-contents-item\" />\n </ul>\n}\n" }]
|
|
22605
|
+
}], propDecorators: { itemId: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemId", required: false }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], childItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableOfContentsItemComponent), { isSignal: true }] }] } });
|
|
22606
|
+
|
|
22607
|
+
let nextUniqueId = 0;
|
|
22608
|
+
/**
|
|
22609
|
+
* A navigation aid that lists the sections of a page and highlights the one the
|
|
22610
|
+
* reader is on. Compose it from `tedi-table-of-contents-item` elements; nest
|
|
22611
|
+
* items to build a two-level hierarchy.
|
|
22612
|
+
*
|
|
22613
|
+
* The active item is controlled via `activeId`: it gets the accent bar and active link colour.
|
|
22614
|
+
*
|
|
22615
|
+
* When `sticky` is enabled the container pins while the page scrolls. Two knobs
|
|
22616
|
+
* adapt it to the surrounding layout: `stickyOffset` moves where it pins (raise
|
|
22617
|
+
* it to clear a fixed header), and `stickyMaxHeight` overrides the height cap
|
|
22618
|
+
* for when the TOC scrolls inside a fixed-height container rather than the window.
|
|
22619
|
+
*
|
|
22620
|
+
* The gap the sticky TOC leaves above the viewport bottom has no input — override
|
|
22621
|
+
* the `--tedi-table-of-contents-sticky-bottom` CSS custom property (default
|
|
22622
|
+
* `1.5rem`) from any ancestor when you need to clear a fixed footer.
|
|
22623
|
+
*/
|
|
22624
|
+
class TableOfContentsComponent {
|
|
22625
|
+
/**
|
|
22626
|
+
* Heading rendered above the list. Defaults to the localised "Table of
|
|
22627
|
+
* contents" label; pass `null` (or an empty string) to render it headless —
|
|
22628
|
+
* the navigation keeps an accessible name via `aria-label`.
|
|
22629
|
+
*/
|
|
22630
|
+
heading = input(undefined, ...(ngDevMode ? [{ debugName: "heading" }] : []));
|
|
22631
|
+
/**
|
|
22632
|
+
* Semantic level of the heading element (`h1`–`h6`). The visual style stays
|
|
22633
|
+
* h4 regardless; set this to match the surrounding page's heading outline
|
|
22634
|
+
* (e.g. `h2` when the TOC follows only a page `h1`).
|
|
22635
|
+
*/
|
|
22636
|
+
headingLevel = input("h3", ...(ngDevMode ? [{ debugName: "headingLevel" }] : []));
|
|
22637
|
+
/**
|
|
22638
|
+
* Visual variant:
|
|
22639
|
+
* - `default` — rendered inside a bordered card.
|
|
22640
|
+
* - `transparent` — no card chrome; the list sits on the page with a
|
|
22641
|
+
* continuous grey left rail.
|
|
22642
|
+
*/
|
|
22643
|
+
variant = input("default", ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
22644
|
+
/**
|
|
22645
|
+
* Draws a divider under each item except the last — sub-items included — so the
|
|
22646
|
+
* list reads as a set of separated rows.
|
|
22647
|
+
* @default false
|
|
22648
|
+
*/
|
|
22649
|
+
bordered = input(false, ...(ngDevMode ? [{ debugName: "bordered" }] : []));
|
|
22650
|
+
/** Id of the currently active item. */
|
|
22651
|
+
activeId = input(...(ngDevMode ? [undefined, { debugName: "activeId" }] : []));
|
|
22652
|
+
/**
|
|
22653
|
+
* Keep the active item visible inside the TOC's own scroll area. When the list
|
|
22654
|
+
* is taller than a bounded or sticky container and `activeId` changes, the TOC
|
|
22655
|
+
* scrolls its internal scroll region just enough to reveal the active item.
|
|
22656
|
+
* No-op when the list isn't scrollable (short lists, unbounded layouts).
|
|
22657
|
+
* @default false
|
|
22658
|
+
*/
|
|
22659
|
+
scrollActiveIntoView = input(false, ...(ngDevMode ? [{ debugName: "scrollActiveIntoView" }] : []));
|
|
22660
|
+
/**
|
|
22661
|
+
* Whether nested items are expanded by default. When `true` (default) the full
|
|
22662
|
+
* outline is always visible. When `false`, a branch reveals its sub-items only
|
|
22663
|
+
* while it is on the active trail (the active item or one of its ancestors).
|
|
22664
|
+
* @default true
|
|
22665
|
+
*/
|
|
22666
|
+
defaultOpen = input(true, ...(ngDevMode ? [{ debugName: "defaultOpen" }] : []));
|
|
22667
|
+
/** Show auto-generated hierarchical numbers (`1.`, `2.`, `2.1`, …). */
|
|
22668
|
+
numbered = input(false, ...(ngDevMode ? [{ debugName: "numbered" }] : []));
|
|
22669
|
+
/** Stick the container to the viewport while scrolling. */
|
|
22670
|
+
sticky = input(true, ...(ngDevMode ? [{ debugName: "sticky" }] : []));
|
|
22671
|
+
/**
|
|
22672
|
+
* Distance from the top of the scroll container at which the sticky TOC pins,
|
|
22673
|
+
* as any CSS length or expression. Raise it to clear a fixed header — e.g.
|
|
22674
|
+
* `"calc(var(--layout-header-height) + 1.5rem)"`. Drives both `top` and the
|
|
22675
|
+
* default `max-height`. Only applies while `sticky` is `true`.
|
|
22676
|
+
* @default "1.5rem"
|
|
22677
|
+
*/
|
|
22678
|
+
stickyOffset = input(...(ngDevMode ? [undefined, { debugName: "stickyOffset" }] : []));
|
|
22679
|
+
/**
|
|
22680
|
+
* Overrides the sticky height cap. The default keeps the TOC within the
|
|
22681
|
+
* viewport (`calc(100dvh - offset - 1.5rem)`); set this when the TOC scrolls
|
|
22682
|
+
* inside a fixed-height container rather than the window — e.g.
|
|
22683
|
+
* `"calc(30rem - 3rem)"` for a 30rem scroll region. Only applies while
|
|
22684
|
+
* `sticky` is `true`.
|
|
22685
|
+
*/
|
|
22686
|
+
stickyMaxHeight = input(...(ngDevMode ? [undefined, { debugName: "stickyMaxHeight" }] : []));
|
|
22687
|
+
/**
|
|
22688
|
+
* Accessible name for the navigation landmark. Overrides the default, which is
|
|
22689
|
+
* the heading (via `aria-labelledby`) or the localised title when headless.
|
|
22690
|
+
* Useful to disambiguate multiple tables of contents on one page.
|
|
22691
|
+
*/
|
|
22692
|
+
ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
|
|
22693
|
+
translations = inject(TediTranslationService);
|
|
22694
|
+
host = inject(ElementRef);
|
|
22695
|
+
platformId = inject(PLATFORM_ID);
|
|
22696
|
+
constructor() {
|
|
22697
|
+
// Reveal the active item within the TOC's own scroll region whenever it
|
|
22698
|
+
// changes. Runs after render so nested items have finished expanding.
|
|
22699
|
+
afterRenderEffect(() => {
|
|
22700
|
+
const activeId = this.activeId();
|
|
22701
|
+
if (!this.scrollActiveIntoView() || !activeId)
|
|
22702
|
+
return;
|
|
22703
|
+
if (!isPlatformBrowser(this.platformId))
|
|
22704
|
+
return;
|
|
22705
|
+
this.revealActiveItem();
|
|
22706
|
+
});
|
|
22707
|
+
}
|
|
22708
|
+
/** Top-level items, used by items to compute their hierarchical numbers. */
|
|
22709
|
+
items = contentChildren(forwardRef(() => TableOfContentsItemComponent), ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
22710
|
+
titleLabel = this.translations.track("table-of-contents.title");
|
|
22711
|
+
resolvedHeading = computed(() => {
|
|
22712
|
+
const heading = this.heading();
|
|
22713
|
+
return heading === undefined ? this.titleLabel() : heading;
|
|
22714
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedHeading" }] : []));
|
|
22715
|
+
navLabel = computed(() => this.ariaLabel() || this.titleLabel(), ...(ngDevMode ? [{ debugName: "navLabel" }] : []));
|
|
22716
|
+
headingId = `tedi-table-of-contents-heading-${(nextUniqueId += 1)}`;
|
|
22717
|
+
/** Scroll the TOC's own scroll region so the active item's row is visible. */
|
|
22718
|
+
revealActiveItem() {
|
|
22719
|
+
const hostEl = this.host.nativeElement;
|
|
22720
|
+
const activeItem = hostEl.querySelector('[aria-current="location"]');
|
|
22721
|
+
if (!activeItem)
|
|
22722
|
+
return;
|
|
22723
|
+
// Position by the item's own row, not the whole subtree (which may include
|
|
22724
|
+
// expanded children).
|
|
22725
|
+
const target = activeItem.querySelector(":scope > .tedi-table-of-contents__row") ?? activeItem;
|
|
22726
|
+
const scroller = this.findScrollParent(target);
|
|
22727
|
+
if (!scroller)
|
|
22728
|
+
return;
|
|
22729
|
+
const scrollerRect = scroller.getBoundingClientRect();
|
|
22730
|
+
const targetRect = target.getBoundingClientRect();
|
|
22731
|
+
const margin = 8;
|
|
22732
|
+
const behavior = window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
22733
|
+
? "auto"
|
|
22734
|
+
: "smooth";
|
|
22735
|
+
if (targetRect.top < scrollerRect.top + margin) {
|
|
22736
|
+
scroller.scrollBy({
|
|
22737
|
+
top: targetRect.top - scrollerRect.top - margin,
|
|
22738
|
+
behavior,
|
|
22739
|
+
});
|
|
22740
|
+
}
|
|
22741
|
+
else if (targetRect.bottom > scrollerRect.bottom - margin) {
|
|
22742
|
+
scroller.scrollBy({
|
|
22743
|
+
top: targetRect.bottom - scrollerRect.bottom + margin,
|
|
22744
|
+
behavior,
|
|
22745
|
+
});
|
|
22746
|
+
}
|
|
22747
|
+
}
|
|
22748
|
+
/** Nearest scrollable ancestor within this component (e.g. the sticky `nav`). */
|
|
22749
|
+
findScrollParent(el) {
|
|
22750
|
+
const hostEl = this.host.nativeElement;
|
|
22751
|
+
let node = el.parentElement;
|
|
22752
|
+
while (node && hostEl.contains(node)) {
|
|
22753
|
+
const overflowY = getComputedStyle(node).overflowY;
|
|
22754
|
+
if ((overflowY === "auto" || overflowY === "scroll") &&
|
|
22755
|
+
node.scrollHeight > node.clientHeight) {
|
|
22756
|
+
return node;
|
|
22757
|
+
}
|
|
22758
|
+
node = node.parentElement;
|
|
22759
|
+
}
|
|
22760
|
+
return null;
|
|
22761
|
+
}
|
|
22762
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22763
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.24", type: TableOfContentsComponent, isStandalone: true, selector: "tedi-table-of-contents", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, scrollActiveIntoView: { classPropertyName: "scrollActiveIntoView", publicName: "scrollActiveIntoView", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, numbered: { classPropertyName: "numbered", publicName: "numbered", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, stickyOffset: { classPropertyName: "stickyOffset", publicName: "stickyOffset", isSignal: true, isRequired: false, transformFunction: null }, stickyMaxHeight: { classPropertyName: "stickyMaxHeight", publicName: "stickyMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.tedi-table-of-contents--bordered": "bordered()", "attr.data-name": "'table-of-contents'", "style.--tedi-table-of-contents-sticky-top": "stickyOffset()", "style.--tedi-table-of-contents-sticky-max-height": "stickyMaxHeight()" }, classAttribute: "tedi-table-of-contents" }, queries: [{ propertyName: "items", predicate: i0.forwardRef(() => TableOfContentsItemComponent), isSignal: true }], ngImport: i0, template: "<ng-template #inner>\n @if (resolvedHeading()) {\n @switch (headingLevel()) {\n @case (\"h1\") {\n <h1\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h1>\n }\n @case (\"h2\") {\n <h2\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h2>\n }\n @case (\"h4\") {\n <h4\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h4>\n }\n @case (\"h5\") {\n <h5\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h5>\n }\n @case (\"h6\") {\n <h6\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h6>\n }\n @default {\n <h3\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h3>\n }\n }\n }\n <nav\n [attr.aria-labelledby]=\"\n !ariaLabel() && resolvedHeading() ? headingId : null\n \"\n [attr.aria-label]=\"ariaLabel() || (resolvedHeading() ? null : navLabel())\"\n >\n <ul\n class=\"tedi-table-of-contents__list\"\n role=\"list\"\n [class.tedi-table-of-contents__list--headless]=\"!resolvedHeading()\"\n >\n <ng-content select=\"tedi-table-of-contents-item\" />\n </ul>\n </nav>\n</ng-template>\n\n@if (variant() === \"transparent\") {\n <div\n class=\"tedi-table-of-contents__container tedi-table-of-contents--transparent\"\n [class.tedi-table-of-contents--sticky]=\"sticky()\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </div>\n} @else {\n <tedi-card\n class=\"tedi-table-of-contents__container\"\n [class.tedi-table-of-contents--sticky]=\"sticky()\"\n >\n <tedi-card-content [padding]=\"0\">\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </tedi-card-content>\n </tedi-card>\n}\n", styles: [".tedi-table-of-contents{--tedi-table-of-contents-padding: var(--card-padding-md-default);--tedi-table-of-contents-sticky-top: 1.5rem;--tedi-table-of-contents-sticky-bottom: 1.5rem;--tedi-table-of-contents-sticky-max-height: calc( 100dvh - var(--tedi-table-of-contents-sticky-top) - var(--tedi-table-of-contents-sticky-bottom) );display:block}.tedi-table-of-contents__container{display:block}.tedi-table-of-contents__container.tedi-table-of-contents--sticky{position:sticky;top:var(--tedi-table-of-contents-sticky-top);display:flex;flex-direction:column;max-height:var(--tedi-table-of-contents-sticky-max-height)}.tedi-table-of-contents--sticky>.tedi-card-content{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.tedi-table-of-contents--sticky .tedi-table-of-contents__heading{flex:none}.tedi-table-of-contents--sticky nav{flex:1 1 auto;min-height:0;margin-block:var(--card-padding-md-default);overflow-y:auto}.tedi-table-of-contents--sticky .tedi-table-of-contents__list{padding-block:0}.tedi-table-of-contents--transparent .tedi-table-of-contents__list{position:relative;padding-bottom:0;isolation:isolate}.tedi-table-of-contents--transparent .tedi-table-of-contents__list:before{position:absolute;inset-block:0;inset-inline-start:0;z-index:-1;width:var(--tedi-borders-01);content:\"\";background:var(--card-border-primary)}.tedi-table-of-contents__heading{padding:var(--card-padding-md-default) var(--card-padding-md-default) 0 var(--card-padding-md-default)}.tedi-table-of-contents__list,.tedi-table-of-contents__group{display:flex;flex-direction:column;padding:0;margin:0;list-style:none}.tedi-table-of-contents__list{padding:var(--card-padding-md-default) 0}.tedi-table-of-contents--bordered .tedi-table-of-contents__list{padding:var(--card-padding-xs) 0}.tedi-table-of-contents__list--headless{padding-top:var(--tedi-table-of-contents-padding)}.tedi-table-of-contents__item{display:flex;flex-direction:column}.tedi-table-of-contents__row{display:flex;gap:var(--layout-grid-gutters-04);align-items:center;padding-block:var(--table-of-contents-padding-y);padding-inline:var(--table-of-contents-padding-left-level-1);border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__row--level-2{padding-right:var(--list-padding-left-level-1);padding-left:var(--list-padding-left-level-2)}.tedi-table-of-contents__number{flex-shrink:0;min-width:1.5rem;color:var(--link-primary-default);text-align:right}.tedi-table-of-contents__separator{padding-block:var(--layout-grid-gutters-04);padding-right:var(--table-of-contents-padding-left-level-1);padding-left:calc(var(--table-of-contents-padding-left-level-1) - var(--table-of-contents-active-item-border-width));border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__content{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.tedi-table-of-contents__suffix{flex:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__number{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button){color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover :not(tedi-icon){text-decoration:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__separator{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents--bordered .tedi-table-of-contents__row{border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents--bordered .tedi-table-of-contents__list>.tedi-table-of-contents__item:last-child>.tedi-table-of-contents__row{border-bottom:0}.tedi-table-of-contents__bar{position:fixed;inset-inline:0;bottom:0;z-index:var(--z-index-header);display:flex;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);background:var(--card-background-primary);border-top:var(--tedi-borders-01) solid var(--card-border-primary);border-top-left-radius:var(--card-radius-rounded);border-top-right-radius:var(--card-radius-rounded);transition:transform .3s ease}.tedi-table-of-contents__bar--static{position:static}.tedi-table-of-contents__bar--hidden{display:none}.tedi-table-of-contents__bar--tucked{transform:translateY(100%)}@media(prefers-reduced-motion:reduce){.tedi-table-of-contents__bar{transition:none}}.tedi-table-of-contents__bar-title{margin:0}.tedi-table-of-contents__sheet{--tedi-table-of-contents-padding: var(--card-padding-md-default);display:flex;flex-direction:column;max-height:80dvh}.tedi-table-of-contents__sheet-header{display:flex;flex:none;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents__sheet-nav{flex:1 1 auto;min-height:0;overflow-y:auto}.tedi-table-of-contents__sheet-panel{width:100%;overflow-y:auto;background:var(--card-background-primary);border-top-left-radius:var(--modal-radius);border-top-right-radius:var(--modal-radius)}.tedi-table-of-contents__backdrop{background:var(--general-surface-overlay)}\n"], dependencies: [{ kind: "component", type: CardComponent, selector: "tedi-card", inputs: ["background", "padding", "borderRadius", "borderless", "border", "xs", "sm", "md", "lg", "xl", "xxl"] }, { kind: "component", type: CardContentComponent, selector: "tedi-card-content", inputs: ["background", "padding", "backgroundImage", "backgroundPosition", "backgroundSize", "backgroundRepeat", "autoWidth", "xs", "sm", "md", "lg", "xl", "xxl"] }, { kind: "component", type: TextComponent, selector: "[tedi-text]", inputs: ["modifiers", "color"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
22764
|
+
}
|
|
22765
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsComponent, decorators: [{
|
|
22766
|
+
type: Component,
|
|
22767
|
+
args: [{ selector: "tedi-table-of-contents", standalone: true, imports: [
|
|
22768
|
+
CardComponent,
|
|
22769
|
+
CardContentComponent,
|
|
22770
|
+
TextComponent,
|
|
22771
|
+
NgTemplateOutlet,
|
|
22772
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
22773
|
+
class: "tedi-table-of-contents",
|
|
22774
|
+
"[class.tedi-table-of-contents--bordered]": "bordered()",
|
|
22775
|
+
"[attr.data-name]": "'table-of-contents'",
|
|
22776
|
+
"[style.--tedi-table-of-contents-sticky-top]": "stickyOffset()",
|
|
22777
|
+
"[style.--tedi-table-of-contents-sticky-max-height]": "stickyMaxHeight()",
|
|
22778
|
+
}, template: "<ng-template #inner>\n @if (resolvedHeading()) {\n @switch (headingLevel()) {\n @case (\"h1\") {\n <h1\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h1>\n }\n @case (\"h2\") {\n <h2\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h2>\n }\n @case (\"h4\") {\n <h4\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h4>\n }\n @case (\"h5\") {\n <h5\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h5>\n }\n @case (\"h6\") {\n <h6\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h6>\n }\n @default {\n <h3\n tedi-text\n modifiers=\"h4\"\n class=\"tedi-table-of-contents__heading\"\n [id]=\"headingId\"\n >\n {{ resolvedHeading() }}\n </h3>\n }\n }\n }\n <nav\n [attr.aria-labelledby]=\"\n !ariaLabel() && resolvedHeading() ? headingId : null\n \"\n [attr.aria-label]=\"ariaLabel() || (resolvedHeading() ? null : navLabel())\"\n >\n <ul\n class=\"tedi-table-of-contents__list\"\n role=\"list\"\n [class.tedi-table-of-contents__list--headless]=\"!resolvedHeading()\"\n >\n <ng-content select=\"tedi-table-of-contents-item\" />\n </ul>\n </nav>\n</ng-template>\n\n@if (variant() === \"transparent\") {\n <div\n class=\"tedi-table-of-contents__container tedi-table-of-contents--transparent\"\n [class.tedi-table-of-contents--sticky]=\"sticky()\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </div>\n} @else {\n <tedi-card\n class=\"tedi-table-of-contents__container\"\n [class.tedi-table-of-contents--sticky]=\"sticky()\"\n >\n <tedi-card-content [padding]=\"0\">\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </tedi-card-content>\n </tedi-card>\n}\n", styles: [".tedi-table-of-contents{--tedi-table-of-contents-padding: var(--card-padding-md-default);--tedi-table-of-contents-sticky-top: 1.5rem;--tedi-table-of-contents-sticky-bottom: 1.5rem;--tedi-table-of-contents-sticky-max-height: calc( 100dvh - var(--tedi-table-of-contents-sticky-top) - var(--tedi-table-of-contents-sticky-bottom) );display:block}.tedi-table-of-contents__container{display:block}.tedi-table-of-contents__container.tedi-table-of-contents--sticky{position:sticky;top:var(--tedi-table-of-contents-sticky-top);display:flex;flex-direction:column;max-height:var(--tedi-table-of-contents-sticky-max-height)}.tedi-table-of-contents--sticky>.tedi-card-content{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.tedi-table-of-contents--sticky .tedi-table-of-contents__heading{flex:none}.tedi-table-of-contents--sticky nav{flex:1 1 auto;min-height:0;margin-block:var(--card-padding-md-default);overflow-y:auto}.tedi-table-of-contents--sticky .tedi-table-of-contents__list{padding-block:0}.tedi-table-of-contents--transparent .tedi-table-of-contents__list{position:relative;padding-bottom:0;isolation:isolate}.tedi-table-of-contents--transparent .tedi-table-of-contents__list:before{position:absolute;inset-block:0;inset-inline-start:0;z-index:-1;width:var(--tedi-borders-01);content:\"\";background:var(--card-border-primary)}.tedi-table-of-contents__heading{padding:var(--card-padding-md-default) var(--card-padding-md-default) 0 var(--card-padding-md-default)}.tedi-table-of-contents__list,.tedi-table-of-contents__group{display:flex;flex-direction:column;padding:0;margin:0;list-style:none}.tedi-table-of-contents__list{padding:var(--card-padding-md-default) 0}.tedi-table-of-contents--bordered .tedi-table-of-contents__list{padding:var(--card-padding-xs) 0}.tedi-table-of-contents__list--headless{padding-top:var(--tedi-table-of-contents-padding)}.tedi-table-of-contents__item{display:flex;flex-direction:column}.tedi-table-of-contents__row{display:flex;gap:var(--layout-grid-gutters-04);align-items:center;padding-block:var(--table-of-contents-padding-y);padding-inline:var(--table-of-contents-padding-left-level-1);border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__row--level-2{padding-right:var(--list-padding-left-level-1);padding-left:var(--list-padding-left-level-2)}.tedi-table-of-contents__number{flex-shrink:0;min-width:1.5rem;color:var(--link-primary-default);text-align:right}.tedi-table-of-contents__separator{padding-block:var(--layout-grid-gutters-04);padding-right:var(--table-of-contents-padding-left-level-1);padding-left:calc(var(--table-of-contents-padding-left-level-1) - var(--table-of-contents-active-item-border-width));border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__content{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.tedi-table-of-contents__suffix{flex:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__number{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button){color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover :not(tedi-icon){text-decoration:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__separator{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents--bordered .tedi-table-of-contents__row{border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents--bordered .tedi-table-of-contents__list>.tedi-table-of-contents__item:last-child>.tedi-table-of-contents__row{border-bottom:0}.tedi-table-of-contents__bar{position:fixed;inset-inline:0;bottom:0;z-index:var(--z-index-header);display:flex;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);background:var(--card-background-primary);border-top:var(--tedi-borders-01) solid var(--card-border-primary);border-top-left-radius:var(--card-radius-rounded);border-top-right-radius:var(--card-radius-rounded);transition:transform .3s ease}.tedi-table-of-contents__bar--static{position:static}.tedi-table-of-contents__bar--hidden{display:none}.tedi-table-of-contents__bar--tucked{transform:translateY(100%)}@media(prefers-reduced-motion:reduce){.tedi-table-of-contents__bar{transition:none}}.tedi-table-of-contents__bar-title{margin:0}.tedi-table-of-contents__sheet{--tedi-table-of-contents-padding: var(--card-padding-md-default);display:flex;flex-direction:column;max-height:80dvh}.tedi-table-of-contents__sheet-header{display:flex;flex:none;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents__sheet-nav{flex:1 1 auto;min-height:0;overflow-y:auto}.tedi-table-of-contents__sheet-panel{width:100%;overflow-y:auto;background:var(--card-background-primary);border-top-left-radius:var(--modal-radius);border-top-right-radius:var(--modal-radius)}.tedi-table-of-contents__backdrop{background:var(--general-surface-overlay)}\n"] }]
|
|
22779
|
+
}], ctorParameters: () => [], propDecorators: { heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }], scrollActiveIntoView: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollActiveIntoView", required: false }] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], numbered: [{ type: i0.Input, args: [{ isSignal: true, alias: "numbered", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }], stickyOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyOffset", required: false }] }], stickyMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyMaxHeight", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], items: [{ type: i0.ContentChildren, args: [forwardRef(() => TableOfContentsItemComponent), { isSignal: true }] }] } });
|
|
22780
|
+
|
|
22781
|
+
/**
|
|
22782
|
+
* Marks projected content as the trailing suffix of a
|
|
22783
|
+
* `tedi-table-of-contents-item`. The item renders it right-aligned at the end of
|
|
22784
|
+
* the row — e.g. a `tedi-tag`.
|
|
22785
|
+
*/
|
|
22786
|
+
class TableOfContentsItemSuffixDirective {
|
|
22787
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsItemSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
22788
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.24", type: TableOfContentsItemSuffixDirective, isStandalone: true, selector: "[tediTocItemSuffix]", host: { classAttribute: "tedi-table-of-contents__suffix" }, ngImport: i0 });
|
|
22789
|
+
}
|
|
22790
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsItemSuffixDirective, decorators: [{
|
|
22791
|
+
type: Directive,
|
|
22792
|
+
args: [{
|
|
22793
|
+
selector: "[tediTocItemSuffix]",
|
|
22794
|
+
standalone: true,
|
|
22795
|
+
host: {
|
|
22796
|
+
class: "tedi-table-of-contents__suffix",
|
|
22797
|
+
},
|
|
22798
|
+
}]
|
|
22799
|
+
}] });
|
|
22800
|
+
|
|
22801
|
+
/**
|
|
22802
|
+
* Mobile variant of `tedi-table-of-contents`: a bottom bar that opens the list
|
|
22803
|
+
* in a bottom-sheet overlay. Takes the same `tedi-table-of-contents-item`
|
|
22804
|
+
* children as the desktop card; render it on small viewports.
|
|
22805
|
+
*
|
|
22806
|
+
* It provides itself as `TableOfContentsComponent` so the projected items
|
|
22807
|
+
* resolve their context (`activeId`, `numbered`, `items`) exactly as they do
|
|
22808
|
+
* inside the desktop component.
|
|
22809
|
+
*/
|
|
22810
|
+
class TableOfContentsCollapsibleComponent {
|
|
22811
|
+
/**
|
|
22812
|
+
* Heading shown on the bar and sheet. Defaults to the localised "Table of
|
|
22813
|
+
* contents" label.
|
|
22814
|
+
*/
|
|
22815
|
+
heading = input(undefined, ...(ngDevMode ? [{ debugName: "heading" }] : []));
|
|
22816
|
+
/** Id of the currently active item. */
|
|
22817
|
+
activeId = input(...(ngDevMode ? [undefined, { debugName: "activeId" }] : []));
|
|
22818
|
+
/**
|
|
22819
|
+
* Whether nested items are expanded by default. When `false`, a branch reveals
|
|
22820
|
+
* its sub-items only while it is on the active trail. Mirrors
|
|
22821
|
+
* `tedi-table-of-contents` so projected items resolve it via the shared root.
|
|
22822
|
+
* @default true
|
|
22823
|
+
*/
|
|
22824
|
+
defaultOpen = input(true, ...(ngDevMode ? [{ debugName: "defaultOpen" }] : []));
|
|
22825
|
+
/** Show auto-generated hierarchical numbers (`1.`, `2.`, `2.1`, …). */
|
|
22826
|
+
numbered = input(false, ...(ngDevMode ? [{ debugName: "numbered" }] : []));
|
|
22827
|
+
/**
|
|
22828
|
+
* Draws a divider under each item except the last — sub-items included — so the
|
|
22829
|
+
* sheet's list reads as a set of separated rows. Mirrors `tedi-table-of-contents`.
|
|
22830
|
+
* @default false
|
|
22831
|
+
*/
|
|
22832
|
+
bordered = input(false, ...(ngDevMode ? [{ debugName: "bordered" }] : []));
|
|
22833
|
+
/**
|
|
22834
|
+
* Pin the bar to the bottom of the viewport. Set `false` to render it inline.
|
|
22835
|
+
*/
|
|
22836
|
+
sticky = input(true, ...(ngDevMode ? [{ debugName: "sticky" }] : []));
|
|
22837
|
+
/**
|
|
22838
|
+
* Hide the bar while the user scrolls down and reveal it when they scroll up,
|
|
22839
|
+
* keeping the reading area clear. Watches window scroll by default; set
|
|
22840
|
+
* `scrollContainer` to watch a scrollable element instead.
|
|
22841
|
+
* @default false
|
|
22842
|
+
*/
|
|
22843
|
+
hideOnScroll = input(false, ...(ngDevMode ? [{ debugName: "hideOnScroll" }] : []));
|
|
22844
|
+
/**
|
|
22845
|
+
* Element whose scroll drives `hideOnScroll`. Defaults to the window; set it to
|
|
22846
|
+
* the scrollable container when the content scrolls inside a region rather than
|
|
22847
|
+
* the whole page.
|
|
22848
|
+
*/
|
|
22849
|
+
scrollContainer = input(...(ngDevMode ? [undefined, { debugName: "scrollContainer" }] : []));
|
|
22850
|
+
/**
|
|
22851
|
+
* Accessible name for the sheet's navigation landmark and dialog. Defaults to
|
|
22852
|
+
* the visible title.
|
|
22853
|
+
*/
|
|
22854
|
+
ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
|
|
22855
|
+
/** Top-level items, read by items to compute their hierarchical numbers. */
|
|
22856
|
+
items = contentChildren(forwardRef(() => TableOfContentsItemComponent), ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
22857
|
+
dialog = inject(Dialog);
|
|
22858
|
+
overlay = inject(Overlay);
|
|
22859
|
+
translations = inject(TediTranslationService);
|
|
22860
|
+
platformId = inject(PLATFORM_ID);
|
|
22861
|
+
zone = inject(NgZone);
|
|
22862
|
+
sheet = viewChild.required("sheet");
|
|
22863
|
+
dialogRef;
|
|
22864
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
22865
|
+
/** True while the sticky bar is hidden by a scroll-down gesture. */
|
|
22866
|
+
barHidden = signal(false, ...(ngDevMode ? [{ debugName: "barHidden" }] : []));
|
|
22867
|
+
lastScrollY = 0;
|
|
22868
|
+
ticking = false;
|
|
22869
|
+
scrollTarget;
|
|
22870
|
+
onScroll = () => this.handleScroll();
|
|
22871
|
+
constructor() {
|
|
22872
|
+
// Runs client-side only; drives the scroll-away behaviour for `hideOnScroll`.
|
|
22873
|
+
afterNextRender(() => {
|
|
22874
|
+
const target = this.scrollContainer() ?? window;
|
|
22875
|
+
this.scrollTarget = target;
|
|
22876
|
+
this.lastScrollY = this.currentScrollY();
|
|
22877
|
+
// Outside Angular so scroll events don't trigger change detection; the
|
|
22878
|
+
// `barHidden` signal updates the view on its own when it actually changes.
|
|
22879
|
+
this.zone.runOutsideAngular(() => {
|
|
22880
|
+
target.addEventListener("scroll", this.onScroll, {
|
|
22881
|
+
passive: true,
|
|
22882
|
+
});
|
|
22883
|
+
});
|
|
22884
|
+
});
|
|
22885
|
+
}
|
|
22886
|
+
currentScrollY() {
|
|
22887
|
+
const el = this.scrollContainer();
|
|
22888
|
+
return el ? el.scrollTop : window.scrollY;
|
|
22889
|
+
}
|
|
22890
|
+
titleLabel = this.translations.track("table-of-contents.title");
|
|
22891
|
+
openLabel = this.translations.track("open");
|
|
22892
|
+
closeLabel = this.translations.track("close");
|
|
22893
|
+
title = computed(() => this.heading() || this.titleLabel(), ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
22894
|
+
/** Accessible name for the nav/dialog — the `ariaLabel` override or the title. */
|
|
22895
|
+
navLabel = computed(() => this.ariaLabel() || this.title(), ...(ngDevMode ? [{ debugName: "navLabel" }] : []));
|
|
22896
|
+
toggle(open) {
|
|
22897
|
+
if (open) {
|
|
22898
|
+
this.openSheet();
|
|
22899
|
+
}
|
|
22900
|
+
else {
|
|
22901
|
+
this.close();
|
|
22902
|
+
}
|
|
22903
|
+
}
|
|
22904
|
+
close() {
|
|
22905
|
+
this.dialogRef?.close();
|
|
22906
|
+
}
|
|
22907
|
+
ngOnDestroy() {
|
|
22908
|
+
this.close();
|
|
22909
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
22910
|
+
this.scrollTarget?.removeEventListener("scroll", this.onScroll);
|
|
22911
|
+
}
|
|
22912
|
+
}
|
|
22913
|
+
// Reveal on scroll up, hide on scroll down; always show near the top. Throttled
|
|
22914
|
+
// to one update per frame and ignores sub-pixel jitter.
|
|
22915
|
+
handleScroll() {
|
|
22916
|
+
if (this.ticking)
|
|
22917
|
+
return;
|
|
22918
|
+
this.ticking = true;
|
|
22919
|
+
requestAnimationFrame(() => {
|
|
22920
|
+
this.ticking = false;
|
|
22921
|
+
const currentY = this.currentScrollY();
|
|
22922
|
+
if (!this.hideOnScroll()) {
|
|
22923
|
+
this.barHidden.set(false);
|
|
22924
|
+
this.lastScrollY = currentY;
|
|
22925
|
+
return;
|
|
22926
|
+
}
|
|
22927
|
+
const delta = currentY - this.lastScrollY;
|
|
22928
|
+
if (Math.abs(delta) < 4)
|
|
22929
|
+
return;
|
|
22930
|
+
this.barHidden.set(currentY > 8 && delta > 0);
|
|
22931
|
+
this.lastScrollY = currentY;
|
|
22932
|
+
});
|
|
22933
|
+
}
|
|
22934
|
+
onListClick(event) {
|
|
22935
|
+
if (event.target.closest("a, button")) {
|
|
22936
|
+
this.close();
|
|
22937
|
+
}
|
|
22938
|
+
}
|
|
22939
|
+
openSheet() {
|
|
22940
|
+
if (this.dialogRef)
|
|
22941
|
+
return;
|
|
22942
|
+
this.open.set(true);
|
|
22943
|
+
this.dialogRef = this.dialog.open(this.sheet(), {
|
|
22944
|
+
panelClass: "tedi-table-of-contents__sheet-panel",
|
|
22945
|
+
backdropClass: "tedi-table-of-contents__backdrop",
|
|
22946
|
+
hasBackdrop: true,
|
|
22947
|
+
ariaModal: true,
|
|
22948
|
+
ariaLabel: this.navLabel(),
|
|
22949
|
+
autoFocus: "first-tabbable",
|
|
22950
|
+
restoreFocus: true,
|
|
22951
|
+
disableClose: true,
|
|
22952
|
+
positionStrategy: this.overlay
|
|
22953
|
+
.position()
|
|
22954
|
+
.global()
|
|
22955
|
+
.centerHorizontally()
|
|
22956
|
+
.bottom("0"),
|
|
22957
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
22958
|
+
});
|
|
22959
|
+
this.dialogRef.backdropClick?.subscribe(() => this.close());
|
|
22960
|
+
this.dialogRef.keydownEvents?.subscribe((event) => {
|
|
22961
|
+
if (event.key === "Escape")
|
|
22962
|
+
this.close();
|
|
22963
|
+
});
|
|
22964
|
+
this.dialogRef.closed.subscribe(() => {
|
|
22965
|
+
this.dialogRef = undefined;
|
|
22966
|
+
this.open.set(false);
|
|
22967
|
+
});
|
|
22968
|
+
}
|
|
22969
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsCollapsibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22970
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.24", type: TableOfContentsCollapsibleComponent, isStandalone: true, selector: "tedi-table-of-contents-collapsible", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, numbered: { classPropertyName: "numbered", publicName: "numbered", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, hideOnScroll: { classPropertyName: "hideOnScroll", publicName: "hideOnScroll", isSignal: true, isRequired: false, transformFunction: null }, scrollContainer: { classPropertyName: "scrollContainer", publicName: "scrollContainer", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-name": "'table-of-contents-collapsible'" }, classAttribute: "tedi-table-of-contents-collapsible" }, providers: [
|
|
22971
|
+
{
|
|
22972
|
+
provide: TableOfContentsComponent,
|
|
22973
|
+
useExisting: forwardRef(() => TableOfContentsCollapsibleComponent),
|
|
22974
|
+
},
|
|
22975
|
+
], queries: [{ propertyName: "items", predicate: i0.forwardRef(() => TableOfContentsItemComponent), isSignal: true }], viewQueries: [{ propertyName: "sheet", first: true, predicate: ["sheet"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"tedi-table-of-contents__bar\"\n [class.tedi-table-of-contents__bar--static]=\"!sticky()\"\n [class.tedi-table-of-contents__bar--hidden]=\"open()\"\n [class.tedi-table-of-contents__bar--tucked]=\"barHidden()\"\n>\n <span tedi-text modifiers=\"bold\" class=\"tedi-table-of-contents__bar-title\">\n {{ title() }}\n </span>\n <button\n tedi-collapse-button\n aria-haspopup=\"dialog\"\n [open]=\"open()\"\n [openText]=\"openLabel()\"\n [closeText]=\"closeLabel()\"\n [underline]=\"false\"\n (openChange)=\"toggle($event)\"\n ></button>\n</div>\n\n<ng-template #sheet>\n <div\n class=\"tedi-table-of-contents tedi-table-of-contents__sheet\"\n [class.tedi-table-of-contents--bordered]=\"bordered()\"\n >\n <div class=\"tedi-table-of-contents__sheet-header\">\n <span\n tedi-text\n modifiers=\"bold\"\n class=\"tedi-table-of-contents__bar-title\"\n >\n {{ title() }}\n </span>\n <button\n tedi-collapse-button\n [open]=\"true\"\n [openText]=\"openLabel()\"\n [closeText]=\"closeLabel()\"\n [underline]=\"false\"\n (openChange)=\"close()\"\n ></button>\n </div>\n <nav\n class=\"tedi-table-of-contents__sheet-nav\"\n [attr.aria-label]=\"navLabel()\"\n (click)=\"onListClick($event)\"\n >\n <ul\n class=\"tedi-table-of-contents__list tedi-table-of-contents__list--headless\"\n role=\"list\"\n >\n <ng-content select=\"tedi-table-of-contents-item\" />\n </ul>\n </nav>\n </div>\n</ng-template>\n", styles: [".tedi-table-of-contents{--tedi-table-of-contents-padding: var(--card-padding-md-default);--tedi-table-of-contents-sticky-top: 1.5rem;--tedi-table-of-contents-sticky-bottom: 1.5rem;--tedi-table-of-contents-sticky-max-height: calc( 100dvh - var(--tedi-table-of-contents-sticky-top) - var(--tedi-table-of-contents-sticky-bottom) );display:block}.tedi-table-of-contents__container{display:block}.tedi-table-of-contents__container.tedi-table-of-contents--sticky{position:sticky;top:var(--tedi-table-of-contents-sticky-top);display:flex;flex-direction:column;max-height:var(--tedi-table-of-contents-sticky-max-height)}.tedi-table-of-contents--sticky>.tedi-card-content{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.tedi-table-of-contents--sticky .tedi-table-of-contents__heading{flex:none}.tedi-table-of-contents--sticky nav{flex:1 1 auto;min-height:0;margin-block:var(--card-padding-md-default);overflow-y:auto}.tedi-table-of-contents--sticky .tedi-table-of-contents__list{padding-block:0}.tedi-table-of-contents--transparent .tedi-table-of-contents__list{position:relative;padding-bottom:0;isolation:isolate}.tedi-table-of-contents--transparent .tedi-table-of-contents__list:before{position:absolute;inset-block:0;inset-inline-start:0;z-index:-1;width:var(--tedi-borders-01);content:\"\";background:var(--card-border-primary)}.tedi-table-of-contents__heading{padding:var(--card-padding-md-default) var(--card-padding-md-default) 0 var(--card-padding-md-default)}.tedi-table-of-contents__list,.tedi-table-of-contents__group{display:flex;flex-direction:column;padding:0;margin:0;list-style:none}.tedi-table-of-contents__list{padding:var(--card-padding-md-default) 0}.tedi-table-of-contents--bordered .tedi-table-of-contents__list{padding:var(--card-padding-xs) 0}.tedi-table-of-contents__list--headless{padding-top:var(--tedi-table-of-contents-padding)}.tedi-table-of-contents__item{display:flex;flex-direction:column}.tedi-table-of-contents__row{display:flex;gap:var(--layout-grid-gutters-04);align-items:center;padding-block:var(--table-of-contents-padding-y);padding-inline:var(--table-of-contents-padding-left-level-1);border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__row--level-2{padding-right:var(--list-padding-left-level-1);padding-left:var(--list-padding-left-level-2)}.tedi-table-of-contents__number{flex-shrink:0;min-width:1.5rem;color:var(--link-primary-default);text-align:right}.tedi-table-of-contents__separator{padding-block:var(--layout-grid-gutters-04);padding-right:var(--table-of-contents-padding-left-level-1);padding-left:calc(var(--table-of-contents-padding-left-level-1) - var(--table-of-contents-active-item-border-width));border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__content{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.tedi-table-of-contents__suffix{flex:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__number{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button){color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover :not(tedi-icon){text-decoration:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__separator{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents--bordered .tedi-table-of-contents__row{border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents--bordered .tedi-table-of-contents__list>.tedi-table-of-contents__item:last-child>.tedi-table-of-contents__row{border-bottom:0}.tedi-table-of-contents__bar{position:fixed;inset-inline:0;bottom:0;z-index:var(--z-index-header);display:flex;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);background:var(--card-background-primary);border-top:var(--tedi-borders-01) solid var(--card-border-primary);border-top-left-radius:var(--card-radius-rounded);border-top-right-radius:var(--card-radius-rounded);transition:transform .3s ease}.tedi-table-of-contents__bar--static{position:static}.tedi-table-of-contents__bar--hidden{display:none}.tedi-table-of-contents__bar--tucked{transform:translateY(100%)}@media(prefers-reduced-motion:reduce){.tedi-table-of-contents__bar{transition:none}}.tedi-table-of-contents__bar-title{margin:0}.tedi-table-of-contents__sheet{--tedi-table-of-contents-padding: var(--card-padding-md-default);display:flex;flex-direction:column;max-height:80dvh}.tedi-table-of-contents__sheet-header{display:flex;flex:none;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents__sheet-nav{flex:1 1 auto;min-height:0;overflow-y:auto}.tedi-table-of-contents__sheet-panel{width:100%;overflow-y:auto;background:var(--card-background-primary);border-top-left-radius:var(--modal-radius);border-top-right-radius:var(--modal-radius)}.tedi-table-of-contents__backdrop{background:var(--general-surface-overlay)}\n"], dependencies: [{ kind: "component", type: TextComponent, selector: "[tedi-text]", inputs: ["modifiers", "color"] }, { kind: "component", type: CollapseButtonComponent, selector: "button[tedi-collapse-button]", inputs: ["open", "openText", "closeText", "hideText", "arrowType", "size", "inverted", "underline", "ariaControls", "ariaLabel", "id"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
22976
|
+
}
|
|
22977
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableOfContentsCollapsibleComponent, decorators: [{
|
|
22978
|
+
type: Component,
|
|
22979
|
+
args: [{ selector: "tedi-table-of-contents-collapsible", standalone: true, imports: [TextComponent, CollapseButtonComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
22980
|
+
class: "tedi-table-of-contents-collapsible",
|
|
22981
|
+
"[attr.data-name]": "'table-of-contents-collapsible'",
|
|
22982
|
+
}, providers: [
|
|
22983
|
+
{
|
|
22984
|
+
provide: TableOfContentsComponent,
|
|
22985
|
+
useExisting: forwardRef(() => TableOfContentsCollapsibleComponent),
|
|
22986
|
+
},
|
|
22987
|
+
], template: "<div\n class=\"tedi-table-of-contents__bar\"\n [class.tedi-table-of-contents__bar--static]=\"!sticky()\"\n [class.tedi-table-of-contents__bar--hidden]=\"open()\"\n [class.tedi-table-of-contents__bar--tucked]=\"barHidden()\"\n>\n <span tedi-text modifiers=\"bold\" class=\"tedi-table-of-contents__bar-title\">\n {{ title() }}\n </span>\n <button\n tedi-collapse-button\n aria-haspopup=\"dialog\"\n [open]=\"open()\"\n [openText]=\"openLabel()\"\n [closeText]=\"closeLabel()\"\n [underline]=\"false\"\n (openChange)=\"toggle($event)\"\n ></button>\n</div>\n\n<ng-template #sheet>\n <div\n class=\"tedi-table-of-contents tedi-table-of-contents__sheet\"\n [class.tedi-table-of-contents--bordered]=\"bordered()\"\n >\n <div class=\"tedi-table-of-contents__sheet-header\">\n <span\n tedi-text\n modifiers=\"bold\"\n class=\"tedi-table-of-contents__bar-title\"\n >\n {{ title() }}\n </span>\n <button\n tedi-collapse-button\n [open]=\"true\"\n [openText]=\"openLabel()\"\n [closeText]=\"closeLabel()\"\n [underline]=\"false\"\n (openChange)=\"close()\"\n ></button>\n </div>\n <nav\n class=\"tedi-table-of-contents__sheet-nav\"\n [attr.aria-label]=\"navLabel()\"\n (click)=\"onListClick($event)\"\n >\n <ul\n class=\"tedi-table-of-contents__list tedi-table-of-contents__list--headless\"\n role=\"list\"\n >\n <ng-content select=\"tedi-table-of-contents-item\" />\n </ul>\n </nav>\n </div>\n</ng-template>\n", styles: [".tedi-table-of-contents{--tedi-table-of-contents-padding: var(--card-padding-md-default);--tedi-table-of-contents-sticky-top: 1.5rem;--tedi-table-of-contents-sticky-bottom: 1.5rem;--tedi-table-of-contents-sticky-max-height: calc( 100dvh - var(--tedi-table-of-contents-sticky-top) - var(--tedi-table-of-contents-sticky-bottom) );display:block}.tedi-table-of-contents__container{display:block}.tedi-table-of-contents__container.tedi-table-of-contents--sticky{position:sticky;top:var(--tedi-table-of-contents-sticky-top);display:flex;flex-direction:column;max-height:var(--tedi-table-of-contents-sticky-max-height)}.tedi-table-of-contents--sticky>.tedi-card-content{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.tedi-table-of-contents--sticky .tedi-table-of-contents__heading{flex:none}.tedi-table-of-contents--sticky nav{flex:1 1 auto;min-height:0;margin-block:var(--card-padding-md-default);overflow-y:auto}.tedi-table-of-contents--sticky .tedi-table-of-contents__list{padding-block:0}.tedi-table-of-contents--transparent .tedi-table-of-contents__list{position:relative;padding-bottom:0;isolation:isolate}.tedi-table-of-contents--transparent .tedi-table-of-contents__list:before{position:absolute;inset-block:0;inset-inline-start:0;z-index:-1;width:var(--tedi-borders-01);content:\"\";background:var(--card-border-primary)}.tedi-table-of-contents__heading{padding:var(--card-padding-md-default) var(--card-padding-md-default) 0 var(--card-padding-md-default)}.tedi-table-of-contents__list,.tedi-table-of-contents__group{display:flex;flex-direction:column;padding:0;margin:0;list-style:none}.tedi-table-of-contents__list{padding:var(--card-padding-md-default) 0}.tedi-table-of-contents--bordered .tedi-table-of-contents__list{padding:var(--card-padding-xs) 0}.tedi-table-of-contents__list--headless{padding-top:var(--tedi-table-of-contents-padding)}.tedi-table-of-contents__item{display:flex;flex-direction:column}.tedi-table-of-contents__row{display:flex;gap:var(--layout-grid-gutters-04);align-items:center;padding-block:var(--table-of-contents-padding-y);padding-inline:var(--table-of-contents-padding-left-level-1);border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__row--level-2{padding-right:var(--list-padding-left-level-1);padding-left:var(--list-padding-left-level-2)}.tedi-table-of-contents__number{flex-shrink:0;min-width:1.5rem;color:var(--link-primary-default);text-align:right}.tedi-table-of-contents__separator{padding-block:var(--layout-grid-gutters-04);padding-right:var(--table-of-contents-padding-left-level-1);padding-left:calc(var(--table-of-contents-padding-left-level-1) - var(--table-of-contents-active-item-border-width));border-left:var(--table-of-contents-active-item-border-width) solid transparent}.tedi-table-of-contents__content{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.tedi-table-of-contents__suffix{flex:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__number{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button){color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover{color:var(--link-primary-active)}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__row .tedi-table-of-contents__content :is(a,button):hover :not(tedi-icon){text-decoration:none}.tedi-table-of-contents__item--selected>.tedi-table-of-contents__separator{border-left-color:var(--table-of-contents-border-active)}.tedi-table-of-contents--bordered .tedi-table-of-contents__row{border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents--bordered .tedi-table-of-contents__list>.tedi-table-of-contents__item:last-child>.tedi-table-of-contents__row{border-bottom:0}.tedi-table-of-contents__bar{position:fixed;inset-inline:0;bottom:0;z-index:var(--z-index-header);display:flex;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);background:var(--card-background-primary);border-top:var(--tedi-borders-01) solid var(--card-border-primary);border-top-left-radius:var(--card-radius-rounded);border-top-right-radius:var(--card-radius-rounded);transition:transform .3s ease}.tedi-table-of-contents__bar--static{position:static}.tedi-table-of-contents__bar--hidden{display:none}.tedi-table-of-contents__bar--tucked{transform:translateY(100%)}@media(prefers-reduced-motion:reduce){.tedi-table-of-contents__bar{transition:none}}.tedi-table-of-contents__bar-title{margin:0}.tedi-table-of-contents__sheet{--tedi-table-of-contents-padding: var(--card-padding-md-default);display:flex;flex-direction:column;max-height:80dvh}.tedi-table-of-contents__sheet-header{display:flex;flex:none;gap:var(--layout-grid-gutters-16);align-items:center;justify-content:space-between;padding:var(--card-padding-md-default);border-bottom:var(--tedi-borders-01) solid var(--card-border-primary)}.tedi-table-of-contents__sheet-nav{flex:1 1 auto;min-height:0;overflow-y:auto}.tedi-table-of-contents__sheet-panel{width:100%;overflow-y:auto;background:var(--card-background-primary);border-top-left-radius:var(--modal-radius);border-top-right-radius:var(--modal-radius)}.tedi-table-of-contents__backdrop{background:var(--general-surface-overlay)}\n"] }]
|
|
22988
|
+
}], ctorParameters: () => [], propDecorators: { heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], numbered: [{ type: i0.Input, args: [{ isSignal: true, alias: "numbered", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }], hideOnScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideOnScroll", required: false }] }], scrollContainer: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollContainer", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], items: [{ type: i0.ContentChildren, args: [forwardRef(() => TableOfContentsItemComponent), { isSignal: true }] }], sheet: [{ type: i0.ViewChild, args: ["sheet", { isSignal: true }] }] } });
|
|
22989
|
+
|
|
22560
22990
|
/**
|
|
22561
22991
|
* Root of the Tabs compound component. Wraps `tedi-tabs-list` and
|
|
22562
22992
|
* `tedi-tabs-content` elements and owns the active-tab state, which the list,
|
|
@@ -23028,5 +23458,5 @@ function provideTedi(config = {}) {
|
|
|
23028
23458
|
* Generated bundle index. Do not edit.
|
|
23029
23459
|
*/
|
|
23030
23460
|
|
|
23031
|
-
export { AVAILABLE_LANGUAGES, AccordionComponent, AccordionItemComponent, AccordionItemContentComponent, AccordionItemHeaderComponent, AlertComponent, AttachmentActionsComponent, AttachmentComponent, BREAKPOINTS, BaseButtonDirective, BreadcrumbItemDirective, BreadcrumbSeparatorDirective, BreadcrumbsComponent, BreakpointService, ButtonComponent, ButtonGroupButtonDirective, ButtonGroupComponent, COUNTER_TAG_WIDTH, CalendarComponent, CardButtonComponent, CardComponent, CardContentComponent, CardHeaderComponent, CardIconComponent, CardRowComponent, CarouselComponent, CarouselContentComponent, CarouselFooterComponent, CarouselHeaderComponent, CarouselIndicatorsComponent, CarouselNavigationComponent, CarouselSlideDirective, CheckboxCardComponent, CheckboxCardGroupComponent, CheckboxComponent, CheckboxGroupComponent, ClosingButtonComponent, ColComponent, CollapseButtonComponent, CollapseComponent, DROPDOWN_API, DROPDOWN_CONTENT_API, DateFieldComponent, DatePickerComponent, DropdownComponent, DropdownContentComponent, DropdownItemComponent, DropdownItemValueComponent, DropdownItemValueLabelComponent, DropdownItemValueMetaComponent, DropdownTriggerDirective, EllipsisComponent, EmptyStateComponent, FeedbackTextComponent, FilterComponent, FilterContentDirective, FilterGroupComponent, FilterPrependDirective, FloatingButtonComponent, FooterBodyComponent, FooterBottomComponent, FooterComponent, FooterSectionComponent, FooterSideComponent, FormFieldComponent, FormFieldExtraDirective, HeaderActionsComponent, HeaderBottomComponent, HeaderComponent, HeaderContentComponent, HeaderLanguageComponent, HeaderLoginComponent, HeaderLogoComponent, HeaderLogoDarkDirective, HeaderLogoutComponent, HeaderMobileButtonComponent, HeaderProfileComponent, HeaderRoleComponent, HeaderRoleContentDirective, HeaderRoleNoResultsDirective, HeaderRoleTitleDirective, HeaderSearchComponent, HeaderTopComponent, HeadingWithIconComponent, HideAtDirective, HorizontalPushHandler, HorizontalStepperComponent, HorizontalStepperItemComponent, IconComponent, InfoButtonComponent, InfoTooltipComponent, InputGroupComponent, InputGroupPrefixDirective, InputGroupSuffixDirective, LANGUAGE_COOKIE_NAME, LANGUAGE_FALLBACK_VALUE, LabelComponent, LabelRowComponent, LinkComponent, ListComponent, MODAL_DATA, MODAL_SIZE, ModalComponent, ModalContentComponent, ModalFooterComponent, ModalHeaderComponent, ModalRef, ModalService, NumberFieldComponent, PaginationComponent, PopoverComponent, PopoverContentComponent, PopoverTriggerDirective, ProgressBarComponent, RadioCardComponent, RadioCardGroupComponent, RadioComponent, RadioGroupComponent, RowComponent, ScrollFadeComponent, SearchComponent, SearchFooterActionsComponent, SearchFooterTemplateDirective, SearchSuggestionComponent, SearchSuggestionTemplateDirective, SelectComponent, SelectOptionTemplateDirective, SelectTooltipTemplateDirective, SelectValueTemplateDirective, SeparatorComponent, ShowAtDirective, SideNavComponent, SideNavDropdownComponent, SideNavDropdownGroupComponent, SideNavDropdownItemComponent, SideNavGroupTitleComponent, SideNavItemComponent, SideNavOverlayComponent, SideNavToggleComponent, SkeletonBlockComponent, SkeletonComponent, SliderComponent, SpecialOptionControls, SpinnerComponent, StatusBadgeComponent, StatusIndicatorComponent, TAG_GAP, TEDI_FIELD_CONTEXT, TEDI_FORM_FIELD_CONTROL, TEDI_INPUT_GROUP, TEDI_TABLE_CONTEXT, TEDI_THEME_DEFAULT_TOKEN, TEDI_TRANSLATION_DEFAULT_TOKEN, THEME_CLASS_PREFIX, THEME_COOKIE_NAME, THEME_FALLBACK_VALUE, TOAST_DEFAULT_DURATION, TabsComponent, TabsContentComponent, TabsListComponent, TabsTriggerComponent, TagComponent, TediPaginationResultsDirective, TediTableColumnsMenuComponent, TediTableComponent, TediTableHeaderButtonComponent, TediTableToolbarComponent, TediTranslationPipe, TediTranslationService, TextComponent, TextFieldComponent, TextGroupComponent, TextGroupLabelComponent, TextGroupValueComponent, TextareaComponent, ThemeService, TimeFieldComponent, TimePickerComponent, TimelineComponent, TimelineDescriptionComponent, TimelineItemComponent, TimelineTimingsBottomDirective, TimelineTitleComponent, ToastComponent, ToastService, ToggleComponent, TooltipComponent, TooltipContentComponent, TooltipTriggerComponent, TruncateComponent, VerticalSpacingDirective, VerticalSpacingItemDirective, addDays, addMonths, addYears, breakpointInput, buildMonthGrid, calculateArrowOffset, calculateVisibleTagCount, computeGroupSpans, controlDescribedBy, cookieSignal, createTablePersistence, deriveControlState, endOfMonth, formatDate, formatLocaleDate, formatLocaleDateHint, formatLocaleDateLong, formatMonthYear, generateUUID, getCardBorderPlacementColor, getDaysInMonth, getFirstDayOfWeek, getFocusableElements, getISOWeek, getMonthNames, getPaddingCssVariables, getPlacementFromPositionChange, getWeekdayNames, groupRowSpan, highlightParts, injectTediTableContext, isAfterDay, isBeforeDay, isDateInRange, isSameDay, isSameMonth, isSameYear, isValidTime, matchAny, matchDate, normalizeTime, parseDate, parseLocaleDate, provideTedi, resolveCardBorderRadius, startOfMonth, startOfWeek, toConnectedPositions, toggleDateInArray, usePagination };
|
|
23461
|
+
export { AVAILABLE_LANGUAGES, AccordionComponent, AccordionItemComponent, AccordionItemContentComponent, AccordionItemHeaderComponent, AlertComponent, AttachmentActionsComponent, AttachmentComponent, BREAKPOINTS, BaseButtonDirective, BreadcrumbItemDirective, BreadcrumbSeparatorDirective, BreadcrumbsComponent, BreakpointService, ButtonComponent, ButtonGroupButtonDirective, ButtonGroupComponent, COUNTER_TAG_WIDTH, CalendarComponent, CardButtonComponent, CardComponent, CardContentComponent, CardHeaderComponent, CardIconComponent, CardRowComponent, CarouselComponent, CarouselContentComponent, CarouselFooterComponent, CarouselHeaderComponent, CarouselIndicatorsComponent, CarouselNavigationComponent, CarouselSlideDirective, CheckboxCardComponent, CheckboxCardGroupComponent, CheckboxComponent, CheckboxGroupComponent, ClosingButtonComponent, ColComponent, CollapseButtonComponent, CollapseComponent, DROPDOWN_API, DROPDOWN_CONTENT_API, DateFieldComponent, DatePickerComponent, DropdownComponent, DropdownContentComponent, DropdownItemComponent, DropdownItemValueComponent, DropdownItemValueLabelComponent, DropdownItemValueMetaComponent, DropdownTriggerDirective, EllipsisComponent, EmptyStateComponent, FeedbackTextComponent, FilterComponent, FilterContentDirective, FilterGroupComponent, FilterPrependDirective, FloatingButtonComponent, FooterBodyComponent, FooterBottomComponent, FooterComponent, FooterSectionComponent, FooterSideComponent, FormFieldComponent, FormFieldExtraDirective, HeaderActionsComponent, HeaderBottomComponent, HeaderComponent, HeaderContentComponent, HeaderLanguageComponent, HeaderLoginComponent, HeaderLogoComponent, HeaderLogoDarkDirective, HeaderLogoutComponent, HeaderMobileButtonComponent, HeaderProfileComponent, HeaderRoleComponent, HeaderRoleContentDirective, HeaderRoleNoResultsDirective, HeaderRoleTitleDirective, HeaderSearchComponent, HeaderTopComponent, HeadingWithIconComponent, HideAtDirective, HorizontalPushHandler, HorizontalStepperComponent, HorizontalStepperItemComponent, IconComponent, InfoButtonComponent, InfoTooltipComponent, InputGroupComponent, InputGroupPrefixDirective, InputGroupSuffixDirective, LANGUAGE_COOKIE_NAME, LANGUAGE_FALLBACK_VALUE, LabelComponent, LabelRowComponent, LinkComponent, ListComponent, MODAL_DATA, MODAL_SIZE, ModalComponent, ModalContentComponent, ModalFooterComponent, ModalHeaderComponent, ModalRef, ModalService, NumberFieldComponent, PaginationComponent, PopoverComponent, PopoverContentComponent, PopoverTriggerDirective, ProgressBarComponent, RadioCardComponent, RadioCardGroupComponent, RadioComponent, RadioGroupComponent, RowComponent, ScrollFadeComponent, SearchComponent, SearchFooterActionsComponent, SearchFooterTemplateDirective, SearchSuggestionComponent, SearchSuggestionTemplateDirective, SelectComponent, SelectOptionTemplateDirective, SelectTooltipTemplateDirective, SelectValueTemplateDirective, SeparatorComponent, ShowAtDirective, SideNavComponent, SideNavDropdownComponent, SideNavDropdownGroupComponent, SideNavDropdownItemComponent, SideNavGroupTitleComponent, SideNavItemComponent, SideNavOverlayComponent, SideNavToggleComponent, SkeletonBlockComponent, SkeletonComponent, SliderComponent, SpecialOptionControls, SpinnerComponent, StatusBadgeComponent, StatusIndicatorComponent, TAG_GAP, TEDI_FIELD_CONTEXT, TEDI_FORM_FIELD_CONTROL, TEDI_INPUT_GROUP, TEDI_TABLE_CONTEXT, TEDI_THEME_DEFAULT_TOKEN, TEDI_TRANSLATION_DEFAULT_TOKEN, THEME_CLASS_PREFIX, THEME_COOKIE_NAME, THEME_FALLBACK_VALUE, TOAST_DEFAULT_DURATION, TableOfContentsCollapsibleComponent, TableOfContentsComponent, TableOfContentsItemComponent, TableOfContentsItemSuffixDirective, TabsComponent, TabsContentComponent, TabsListComponent, TabsTriggerComponent, TagComponent, TediPaginationResultsDirective, TediTableColumnsMenuComponent, TediTableComponent, TediTableHeaderButtonComponent, TediTableToolbarComponent, TediTranslationPipe, TediTranslationService, TextComponent, TextFieldComponent, TextGroupComponent, TextGroupLabelComponent, TextGroupValueComponent, TextareaComponent, ThemeService, TimeFieldComponent, TimePickerComponent, TimelineComponent, TimelineDescriptionComponent, TimelineItemComponent, TimelineTimingsBottomDirective, TimelineTitleComponent, ToastComponent, ToastService, ToggleComponent, TooltipComponent, TooltipContentComponent, TooltipTriggerComponent, TruncateComponent, VerticalSpacingDirective, VerticalSpacingItemDirective, addDays, addMonths, addYears, breakpointInput, buildMonthGrid, calculateArrowOffset, calculateVisibleTagCount, computeGroupSpans, controlDescribedBy, cookieSignal, createTablePersistence, deriveControlState, endOfMonth, formatDate, formatLocaleDate, formatLocaleDateHint, formatLocaleDateLong, formatMonthYear, generateUUID, getCardBorderPlacementColor, getDaysInMonth, getFirstDayOfWeek, getFocusableElements, getISOWeek, getMonthNames, getPaddingCssVariables, getPlacementFromPositionChange, getWeekdayNames, groupRowSpan, highlightParts, injectTediTableContext, isAfterDay, isBeforeDay, isDateInRange, isSameDay, isSameMonth, isSameYear, isValidTime, matchAny, matchDate, normalizeTime, parseDate, parseLocaleDate, provideTedi, resolveCardBorderRadius, startOfMonth, startOfWeek, toConnectedPositions, toggleDateInArray, usePagination };
|
|
23032
23462
|
//# sourceMappingURL=tedi-design-system-angular-tedi.mjs.map
|