@thalassic/ui 22.14.1 → 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.
@@ -6863,6 +6863,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
6863
6863
  const DEFAULT_TAB_NAV_CONFIG = {
6864
6864
  variant: 'flat',
6865
6865
  orientation: 'horizontal',
6866
+ itemsAlign: 'start',
6866
6867
  divider: false,
6867
6868
  };
6868
6869
 
@@ -6899,6 +6900,8 @@ class TabNavDirective {
6899
6900
  ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
6900
6901
  orientation = input(this._config.orientation, /* @ts-ignore */
6901
6902
  ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
6903
+ itemsAlign = input(this._config.itemsAlign, /* @ts-ignore */
6904
+ ...(ngDevMode ? [{ debugName: "itemsAlign" }] : /* istanbul ignore next */ []));
6902
6905
  divider = input(this._config.divider, { ...(ngDevMode ? { debugName: "divider" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
6903
6906
  // Computed
6904
6907
  hostClasses = computed(() => {
@@ -6906,13 +6909,14 @@ class TabNavDirective {
6906
6909
  const array = ['tls-tab-nav', className];
6907
6910
  array.push(`${className}--${this.variant()}`);
6908
6911
  array.push(`${className}--${this.orientation()}`);
6912
+ array.push(`${className}--items-${this.itemsAlign()}`);
6909
6913
  if (this.divider())
6910
6914
  array.push(`${className}--divided`);
6911
6915
  return array;
6912
6916
  }, /* @ts-ignore */
6913
6917
  ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
6914
6918
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabNavDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
6915
- 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 });
6916
6920
  }
6917
6921
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabNavDirective, decorators: [{
6918
6922
  type: Directive,
@@ -6922,7 +6926,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
6922
6926
  '[class]': 'hostClasses()',
6923
6927
  },
6924
6928
  }]
6925
- }], 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 }] }] } });
6926
6930
 
6927
6931
  /**
6928
6932
  * One link inside a `nav[tlsTabNav]` strip. The anchor plays both tab-header
@@ -7146,6 +7150,8 @@ const DEFAULT_TABS_CONFIG = {
7146
7150
  variant: 'flat',
7147
7151
  orientation: 'horizontal',
7148
7152
  headerPosition: 'start',
7153
+ headerAlign: 'stretch',
7154
+ itemsAlign: 'start',
7149
7155
  };
7150
7156
 
7151
7157
  const TABS_CONFIG = new InjectionToken('TABS_CONFIG', {
@@ -7153,15 +7159,19 @@ const TABS_CONFIG = new InjectionToken('TABS_CONFIG', {
7153
7159
  });
7154
7160
 
7155
7161
  class Tabs {
7162
+ // Injections
7156
7163
  _config = inject(TABS_CONFIG);
7157
- tabs = contentChildren(Tab, /* @ts-ignore */
7158
- ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
7164
+ // Inputs
7159
7165
  variant = input(this._config.variant, /* @ts-ignore */
7160
7166
  ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
7161
7167
  orientation = input(this._config.orientation, /* @ts-ignore */
7162
7168
  ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
7163
7169
  headerPosition = input(this._config.headerPosition, /* @ts-ignore */
7164
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 */ []));
7165
7175
  selected = model(undefined, /* @ts-ignore */
7166
7176
  ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
7167
7177
  /** Accessible name for the tablist. */
@@ -7169,6 +7179,10 @@ class Tabs {
7169
7179
  ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
7170
7180
  ariaLabelledby = input(undefined, /* @ts-ignore */
7171
7181
  ...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
7182
+ // State
7183
+ tabs = contentChildren(Tab, /* @ts-ignore */
7184
+ ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
7185
+ // Computed
7172
7186
  hostClasses = computed(() => {
7173
7187
  const className = 'tls-tabs';
7174
7188
  const array = [className];
@@ -7179,16 +7193,19 @@ class Tabs {
7179
7193
  }, /* @ts-ignore */
7180
7194
  ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
7181
7195
  // The header strip uses the shared tab-header block (also rendered by
7182
- // `tls-tab-nav`), so its variant/orientation modifiers live on the strip
7183
- // 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.
7184
7198
  headerClasses = computed(() => {
7185
7199
  const className = 'tls-tab-header';
7186
7200
  const array = [className];
7187
7201
  array.push(`${className}--${this.variant()}`);
7188
7202
  array.push(`${className}--${this.orientation()}`);
7203
+ array.push(`${className}--align-${this.headerAlign()}`);
7204
+ array.push(`${className}--items-${this.itemsAlign()}`);
7189
7205
  return array;
7190
7206
  }, /* @ts-ignore */
7191
7207
  ...(ngDevMode ? [{ debugName: "headerClasses" }] : /* istanbul ignore next */ []));
7208
+ // Constructor
7192
7209
  constructor() {
7193
7210
  effect(() => {
7194
7211
  if (this.selected() !== undefined)
@@ -7200,27 +7217,27 @@ class Tabs {
7200
7217
  }
7201
7218
  // Public methods
7202
7219
  /**
7203
- * Resolves serialized text (e.g. a URL query param) back to the matching
7204
- * tab's actual value, so a numeric tab value round-trips with its own type
7205
- * instead of a string that would never match. Returns `undefined` when no tab
7206
- * matches — including while the projected tabs have not resolved yet, so a
7207
- * reactive caller can retry once they have.
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.
7208
7225
  */
7209
7226
  findTabValue(text) {
7210
- const match = this.tabs().find(tab => String(tab.value()) === text);
7227
+ const match = this.tabs().find(tab => tab.value() === text);
7211
7228
  if (!match)
7212
7229
  return undefined;
7213
7230
  return match.value();
7214
7231
  }
7215
7232
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
7216
- 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"] }] });
7217
7234
  }
7218
7235
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, decorators: [{
7219
7236
  type: Component,
7220
7237
  args: [{ selector: 'tls-tabs', imports: [TabList, Tab$1, TabPanel, TabContent, NgTemplateOutlet], hostDirectives: [Tabs$1], host: {
7221
7238
  '[class]': 'hostClasses()',
7222
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" }]
7223
- }], ctorParameters: () => [], propDecorators: { tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => Tab), { isSignal: true }] }], 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 }] }], 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 }] }] } });
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 }] }] } });
7224
7241
 
7225
7242
  const DEFAULT_TABS_QUERY_SYNC_CONFIG = {
7226
7243
  paramKey: 'tab',
@@ -7251,9 +7268,10 @@ class TabsQuerySyncDirective extends QuerySyncDirective {
7251
7268
  _lastSynced;
7252
7269
  constructor() {
7253
7270
  super();
7254
- // Restore the selection from the URL. Tab values may be numbers, so the
7255
- // param is matched against each tab's serialized value; projected tabs
7256
- // resolve after init, so this retries until a match appears.
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.
7257
7275
  effect(() => {
7258
7276
  if (!this._restoreRead) {
7259
7277
  this._restoreRead = true;