@thalassic/ui 22.14.0 → 22.14.2
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/fesm2022/thalassic-ui.mjs +46 -21
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thalassic-ui.d.ts +46 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, contentChild, Component, Injectable, makeEnvironmentProviders, forwardRef, PLATFORM_ID, output, effect, ElementRef, afterNextRender, linkedSignal, numberAttribute, Renderer2, viewChildren, contentChildren, isDevMode, untracked,
|
|
2
|
+
import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, contentChild, Component, Injectable, makeEnvironmentProviders, TemplateRef, forwardRef, PLATFORM_ID, output, effect, ElementRef, afterNextRender, linkedSignal, numberAttribute, Renderer2, viewChildren, contentChildren, isDevMode, untracked, provideEnvironmentInitializer, DOCUMENT } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { TemplatePortal, ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
5
5
|
import { takeUntilDestroyed, rxResource, toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
@@ -1139,8 +1139,15 @@ class Breadcrumbs {
|
|
|
1139
1139
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1140
1140
|
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
1141
1141
|
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1142
|
+
// Content
|
|
1143
|
+
// Optional projected template for an item's inner content (label/icon),
|
|
1144
|
+
// rendered in place of the built-in label. The list structure, links,
|
|
1145
|
+
// separators, and `aria-current` stay owned by the component. Bind the item
|
|
1146
|
+
// with `<ng-template let-item>`; see BreadcrumbItemContext for the full context.
|
|
1147
|
+
itemTemplate = contentChild(TemplateRef, /* @ts-ignore */
|
|
1148
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
1142
1149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Breadcrumbs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1143
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Breadcrumbs, isStandalone: true, selector: "tls-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separatorIcon: { classPropertyName: "separatorIcon", publicName: "separatorIcon", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "ariaLabelledby() ? null : ariaLabel()", "attr.aria-labelledby": "ariaLabelledby() ?? null" }, classAttribute: "tls-breadcrumbs" }, ngImport: i0, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item>\n @if (item.icon) {\n
|
|
1150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Breadcrumbs, isStandalone: true, selector: "tls-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separatorIcon: { classPropertyName: "separatorIcon", publicName: "separatorIcon", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "ariaLabelledby() ? null : ariaLabel()", "attr.aria-labelledby": "ariaLabelledby() ?? null" }, classAttribute: "tls-breadcrumbs" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let index = $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item let-index=\"index\" let-last=\"last\">\n @if (itemTemplate(); as customTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"customTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: last }\"\n />\n } @else {\n @if (item.icon) {\n <tls-icon class=\"tls-breadcrumbs__item-icon\" [iconSrc]=\"item.icon\" />\n }\n <span class=\"tls-breadcrumbs__label\">{{ item.label }}</span>\n }\n</ng-template>\n", dependencies: [{ kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }] });
|
|
1144
1151
|
}
|
|
1145
1152
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Breadcrumbs, decorators: [{
|
|
1146
1153
|
type: Component,
|
|
@@ -1149,8 +1156,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1149
1156
|
class: 'tls-breadcrumbs',
|
|
1150
1157
|
'[attr.aria-label]': 'ariaLabelledby() ? null : ariaLabel()',
|
|
1151
1158
|
'[attr.aria-labelledby]': 'ariaLabelledby() ?? null',
|
|
1152
|
-
}, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item>\n @if (item.icon) {\n
|
|
1153
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separatorIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "separatorIcon", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }] } });
|
|
1159
|
+
}, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let index = $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item let-index=\"index\" let-last=\"last\">\n @if (itemTemplate(); as customTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"customTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: last }\"\n />\n } @else {\n @if (item.icon) {\n <tls-icon class=\"tls-breadcrumbs__item-icon\" [iconSrc]=\"item.icon\" />\n }\n <span class=\"tls-breadcrumbs__label\">{{ item.label }}</span>\n }\n</ng-template>\n" }]
|
|
1160
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separatorIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "separatorIcon", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
1154
1161
|
|
|
1155
1162
|
const DEFAULT_BUTTON_CONFIG = {
|
|
1156
1163
|
color: 'primary',
|
|
@@ -6856,6 +6863,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
6856
6863
|
const DEFAULT_TAB_NAV_CONFIG = {
|
|
6857
6864
|
variant: 'flat',
|
|
6858
6865
|
orientation: 'horizontal',
|
|
6866
|
+
itemsAlign: 'start',
|
|
6859
6867
|
divider: false,
|
|
6860
6868
|
};
|
|
6861
6869
|
|
|
@@ -6892,6 +6900,8 @@ class TabNavDirective {
|
|
|
6892
6900
|
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
6893
6901
|
orientation = input(this._config.orientation, /* @ts-ignore */
|
|
6894
6902
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
6903
|
+
itemsAlign = input(this._config.itemsAlign, /* @ts-ignore */
|
|
6904
|
+
...(ngDevMode ? [{ debugName: "itemsAlign" }] : /* istanbul ignore next */ []));
|
|
6895
6905
|
divider = input(this._config.divider, { ...(ngDevMode ? { debugName: "divider" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
6896
6906
|
// Computed
|
|
6897
6907
|
hostClasses = computed(() => {
|
|
@@ -6899,13 +6909,14 @@ class TabNavDirective {
|
|
|
6899
6909
|
const array = ['tls-tab-nav', className];
|
|
6900
6910
|
array.push(`${className}--${this.variant()}`);
|
|
6901
6911
|
array.push(`${className}--${this.orientation()}`);
|
|
6912
|
+
array.push(`${className}--items-${this.itemsAlign()}`);
|
|
6902
6913
|
if (this.divider())
|
|
6903
6914
|
array.push(`${className}--divided`);
|
|
6904
6915
|
return array;
|
|
6905
6916
|
}, /* @ts-ignore */
|
|
6906
6917
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
6907
6918
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabNavDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6908
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TabNavDirective, isStandalone: true, selector: "nav[tlsTabNav]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0 });
|
|
6919
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TabNavDirective, isStandalone: true, selector: "nav[tlsTabNav]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, itemsAlign: { classPropertyName: "itemsAlign", publicName: "itemsAlign", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0 });
|
|
6909
6920
|
}
|
|
6910
6921
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabNavDirective, decorators: [{
|
|
6911
6922
|
type: Directive,
|
|
@@ -6915,7 +6926,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
6915
6926
|
'[class]': 'hostClasses()',
|
|
6916
6927
|
},
|
|
6917
6928
|
}]
|
|
6918
|
-
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }] } });
|
|
6929
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], itemsAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsAlign", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }] } });
|
|
6919
6930
|
|
|
6920
6931
|
/**
|
|
6921
6932
|
* One link inside a `nav[tlsTabNav]` strip. The anchor plays both tab-header
|
|
@@ -7139,6 +7150,8 @@ const DEFAULT_TABS_CONFIG = {
|
|
|
7139
7150
|
variant: 'flat',
|
|
7140
7151
|
orientation: 'horizontal',
|
|
7141
7152
|
headerPosition: 'start',
|
|
7153
|
+
headerAlign: 'stretch',
|
|
7154
|
+
itemsAlign: 'start',
|
|
7142
7155
|
};
|
|
7143
7156
|
|
|
7144
7157
|
const TABS_CONFIG = new InjectionToken('TABS_CONFIG', {
|
|
@@ -7146,15 +7159,19 @@ const TABS_CONFIG = new InjectionToken('TABS_CONFIG', {
|
|
|
7146
7159
|
});
|
|
7147
7160
|
|
|
7148
7161
|
class Tabs {
|
|
7162
|
+
// Injections
|
|
7149
7163
|
_config = inject(TABS_CONFIG);
|
|
7150
|
-
|
|
7151
|
-
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
7164
|
+
// Inputs
|
|
7152
7165
|
variant = input(this._config.variant, /* @ts-ignore */
|
|
7153
7166
|
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
7154
7167
|
orientation = input(this._config.orientation, /* @ts-ignore */
|
|
7155
7168
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
7156
7169
|
headerPosition = input(this._config.headerPosition, /* @ts-ignore */
|
|
7157
7170
|
...(ngDevMode ? [{ debugName: "headerPosition" }] : /* istanbul ignore next */ []));
|
|
7171
|
+
headerAlign = input(this._config.headerAlign, /* @ts-ignore */
|
|
7172
|
+
...(ngDevMode ? [{ debugName: "headerAlign" }] : /* istanbul ignore next */ []));
|
|
7173
|
+
itemsAlign = input(this._config.itemsAlign, /* @ts-ignore */
|
|
7174
|
+
...(ngDevMode ? [{ debugName: "itemsAlign" }] : /* istanbul ignore next */ []));
|
|
7158
7175
|
selected = model(undefined, /* @ts-ignore */
|
|
7159
7176
|
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
7160
7177
|
/** Accessible name for the tablist. */
|
|
@@ -7162,6 +7179,10 @@ class Tabs {
|
|
|
7162
7179
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
7163
7180
|
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
7164
7181
|
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
7182
|
+
// State
|
|
7183
|
+
tabs = contentChildren(Tab, /* @ts-ignore */
|
|
7184
|
+
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
7185
|
+
// Computed
|
|
7165
7186
|
hostClasses = computed(() => {
|
|
7166
7187
|
const className = 'tls-tabs';
|
|
7167
7188
|
const array = [className];
|
|
@@ -7172,16 +7193,19 @@ class Tabs {
|
|
|
7172
7193
|
}, /* @ts-ignore */
|
|
7173
7194
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
7174
7195
|
// The header strip uses the shared tab-header block (also rendered by
|
|
7175
|
-
// `tls-tab-nav`), so its variant/orientation modifiers live on the
|
|
7176
|
-
// element itself rather than on the tabs container.
|
|
7196
|
+
// `tls-tab-nav`), so its variant/orientation/alignment modifiers live on the
|
|
7197
|
+
// strip element itself rather than on the tabs container.
|
|
7177
7198
|
headerClasses = computed(() => {
|
|
7178
7199
|
const className = 'tls-tab-header';
|
|
7179
7200
|
const array = [className];
|
|
7180
7201
|
array.push(`${className}--${this.variant()}`);
|
|
7181
7202
|
array.push(`${className}--${this.orientation()}`);
|
|
7203
|
+
array.push(`${className}--align-${this.headerAlign()}`);
|
|
7204
|
+
array.push(`${className}--items-${this.itemsAlign()}`);
|
|
7182
7205
|
return array;
|
|
7183
7206
|
}, /* @ts-ignore */
|
|
7184
7207
|
...(ngDevMode ? [{ debugName: "headerClasses" }] : /* istanbul ignore next */ []));
|
|
7208
|
+
// Constructor
|
|
7185
7209
|
constructor() {
|
|
7186
7210
|
effect(() => {
|
|
7187
7211
|
if (this.selected() !== undefined)
|
|
@@ -7193,27 +7217,27 @@ class Tabs {
|
|
|
7193
7217
|
}
|
|
7194
7218
|
// Public methods
|
|
7195
7219
|
/**
|
|
7196
|
-
* Resolves
|
|
7197
|
-
*
|
|
7198
|
-
*
|
|
7199
|
-
*
|
|
7200
|
-
*
|
|
7220
|
+
* Resolves arbitrary text (e.g. a URL query param) to the value of the tab it
|
|
7221
|
+
* names, so a caller can tell an actual tab from a stale or hand-edited
|
|
7222
|
+
* value. Returns `undefined` when no tab matches — including while the
|
|
7223
|
+
* projected tabs have not resolved yet, so a reactive caller can retry once
|
|
7224
|
+
* they have.
|
|
7201
7225
|
*/
|
|
7202
7226
|
findTabValue(text) {
|
|
7203
|
-
const match = this.tabs().find(tab =>
|
|
7227
|
+
const match = this.tabs().find(tab => tab.value() === text);
|
|
7204
7228
|
if (!match)
|
|
7205
7229
|
return undefined;
|
|
7206
7230
|
return match.value();
|
|
7207
7231
|
}
|
|
7208
7232
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7209
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tabs, isStandalone: true, selector: "tls-tabs", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, headerPosition: { classPropertyName: "headerPosition", publicName: "headerPosition", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "tabs", predicate: Tab, isSignal: true }], hostDirectives: [{ directive: i1.Tabs }], ngImport: i0, template: "<ul\n ngTabList\n [class]=\"headerClasses()\"\n [orientation]=\"orientation()\"\n [softDisabled]=\"false\"\n [(selectedTab)]=\"selected\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n>\n @for (tab of tabs(); track tab) {\n <li\n role=\"presentation\"\n class=\"tls-tab-header__item\"\n [class.tls-tab-header__item--active]=\"ariaTab.selected()\"\n [class.tls-tab-header__item--disabled]=\"tab.disabled()\"\n >\n <button\n #ariaTab=\"ngTab\"\n ngTab\n class=\"tls-tab-header__item-control\"\n type=\"button\"\n [value]=\"tab.value()\"\n [disabled]=\"tab.disabled()\"\n [attr.aria-label]=\"tab.headerTemplateRef() ? tab.label() : null\"\n >\n @if (tab.headerTemplateRef(); as headerTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"headerTemplateRef\"></ng-container>\n } @else {\n {{ tab.label() }}\n }\n </button>\n </li>\n }\n</ul>\n<div class=\"tls-tabs-content\">\n @for (tab of tabs(); track tab) {\n <div ngTabPanel class=\"tls-tab\" [value]=\"tab.value()\" [preserveContent]=\"true\">\n <ng-template ngTabContent>\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplateRef()\"></ng-container>\n </ng-template>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: TabList, selector: "[ngTabList]", inputs: ["orientation", "wrap", "softDisabled", "focusMode", "selectionMode", "selectedTab", "disabled"], outputs: ["selectedTabChange"], exportAs: ["ngTabList"] }, { kind: "directive", type: Tab$1, selector: "[ngTab]", inputs: ["id", "disabled", "value"], exportAs: ["ngTab"] }, { kind: "directive", type: TabPanel, selector: "[ngTabPanel]", inputs: ["id", "value"], exportAs: ["ngTabPanel"] }, { kind: "directive", type: TabContent, selector: "ng-template[ngTabContent]", exportAs: ["ngTabContent"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
7233
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tabs, isStandalone: true, selector: "tls-tabs", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, headerPosition: { classPropertyName: "headerPosition", publicName: "headerPosition", isSignal: true, isRequired: false, transformFunction: null }, headerAlign: { classPropertyName: "headerAlign", publicName: "headerAlign", isSignal: true, isRequired: false, transformFunction: null }, itemsAlign: { classPropertyName: "itemsAlign", publicName: "itemsAlign", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "tabs", predicate: Tab, isSignal: true }], hostDirectives: [{ directive: i1.Tabs }], ngImport: i0, template: "<ul\n ngTabList\n [class]=\"headerClasses()\"\n [orientation]=\"orientation()\"\n [softDisabled]=\"false\"\n [(selectedTab)]=\"selected\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n>\n @for (tab of tabs(); track tab) {\n <li\n role=\"presentation\"\n class=\"tls-tab-header__item\"\n [class.tls-tab-header__item--active]=\"ariaTab.selected()\"\n [class.tls-tab-header__item--disabled]=\"tab.disabled()\"\n >\n <button\n #ariaTab=\"ngTab\"\n ngTab\n class=\"tls-tab-header__item-control\"\n type=\"button\"\n [value]=\"tab.value()\"\n [disabled]=\"tab.disabled()\"\n [attr.aria-label]=\"tab.headerTemplateRef() ? tab.label() : null\"\n >\n @if (tab.headerTemplateRef(); as headerTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"headerTemplateRef\"></ng-container>\n } @else {\n {{ tab.label() }}\n }\n </button>\n </li>\n }\n</ul>\n<div class=\"tls-tabs-content\">\n @for (tab of tabs(); track tab) {\n <div ngTabPanel class=\"tls-tab\" [value]=\"tab.value()\" [preserveContent]=\"true\">\n <ng-template ngTabContent>\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplateRef()\"></ng-container>\n </ng-template>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: TabList, selector: "[ngTabList]", inputs: ["orientation", "wrap", "softDisabled", "focusMode", "selectionMode", "selectedTab", "disabled"], outputs: ["selectedTabChange"], exportAs: ["ngTabList"] }, { kind: "directive", type: Tab$1, selector: "[ngTab]", inputs: ["id", "disabled", "value"], exportAs: ["ngTab"] }, { kind: "directive", type: TabPanel, selector: "[ngTabPanel]", inputs: ["id", "value"], exportAs: ["ngTabPanel"] }, { kind: "directive", type: TabContent, selector: "ng-template[ngTabContent]", exportAs: ["ngTabContent"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
7210
7234
|
}
|
|
7211
7235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, decorators: [{
|
|
7212
7236
|
type: Component,
|
|
7213
7237
|
args: [{ selector: 'tls-tabs', imports: [TabList, Tab$1, TabPanel, TabContent, NgTemplateOutlet], hostDirectives: [Tabs$1], host: {
|
|
7214
7238
|
'[class]': 'hostClasses()',
|
|
7215
7239
|
}, template: "<ul\n ngTabList\n [class]=\"headerClasses()\"\n [orientation]=\"orientation()\"\n [softDisabled]=\"false\"\n [(selectedTab)]=\"selected\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n>\n @for (tab of tabs(); track tab) {\n <li\n role=\"presentation\"\n class=\"tls-tab-header__item\"\n [class.tls-tab-header__item--active]=\"ariaTab.selected()\"\n [class.tls-tab-header__item--disabled]=\"tab.disabled()\"\n >\n <button\n #ariaTab=\"ngTab\"\n ngTab\n class=\"tls-tab-header__item-control\"\n type=\"button\"\n [value]=\"tab.value()\"\n [disabled]=\"tab.disabled()\"\n [attr.aria-label]=\"tab.headerTemplateRef() ? tab.label() : null\"\n >\n @if (tab.headerTemplateRef(); as headerTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"headerTemplateRef\"></ng-container>\n } @else {\n {{ tab.label() }}\n }\n </button>\n </li>\n }\n</ul>\n<div class=\"tls-tabs-content\">\n @for (tab of tabs(); track tab) {\n <div ngTabPanel class=\"tls-tab\" [value]=\"tab.value()\" [preserveContent]=\"true\">\n <ng-template ngTabContent>\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplateRef()\"></ng-container>\n </ng-template>\n </div>\n }\n</div>\n" }]
|
|
7216
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
7240
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], headerPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerPosition", required: false }] }], headerAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerAlign", required: false }] }], itemsAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsAlign", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => Tab), { isSignal: true }] }] } });
|
|
7217
7241
|
|
|
7218
7242
|
const DEFAULT_TABS_QUERY_SYNC_CONFIG = {
|
|
7219
7243
|
paramKey: 'tab',
|
|
@@ -7244,9 +7268,10 @@ class TabsQuerySyncDirective extends QuerySyncDirective {
|
|
|
7244
7268
|
_lastSynced;
|
|
7245
7269
|
constructor() {
|
|
7246
7270
|
super();
|
|
7247
|
-
// Restore the selection from the URL.
|
|
7248
|
-
//
|
|
7249
|
-
// resolve after init, so this retries
|
|
7271
|
+
// Restore the selection from the URL. The param is matched against the
|
|
7272
|
+
// declared tabs so a stale or hand-edited value is ignored rather than
|
|
7273
|
+
// selecting nothing; projected tabs resolve after init, so this retries
|
|
7274
|
+
// until a match appears.
|
|
7250
7275
|
effect(() => {
|
|
7251
7276
|
if (!this._restoreRead) {
|
|
7252
7277
|
this._restoreRead = true;
|