@vsn-ux/ngx-gaia 0.10.0 → 0.10.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/DOCS.md CHANGED
@@ -1114,6 +1114,7 @@ Segmented control container component.
1114
1114
  #### Inputs:
1115
1115
 
1116
1116
  - `selected: any` - Selected value
1117
+ - `compareFn: (o1: any, o2: any) => boolean` - Comparison function for object values (default: `(a, b) => a === b`)
1117
1118
 
1118
1119
  #### Outputs:
1119
1120
 
@@ -1164,6 +1165,29 @@ Icon buttons
1164
1165
  </ga-segmented-control>
1165
1166
  ```
1166
1167
 
1168
+ Object values with compareFn
1169
+
1170
+ ```html
1171
+ <ga-segmented-control [(selected)]="selectedOption" [compareFn]="compareById">
1172
+ <ga-segmented-control-text-button [value]="options[0]"
1173
+ >{{ options[0].label }}</ga-segmented-control-text-button
1174
+ >
1175
+ <ga-segmented-control-text-button [value]="options[1]"
1176
+ >{{ options[1].label }}</ga-segmented-control-text-button
1177
+ >
1178
+ </ga-segmented-control>
1179
+ ```
1180
+
1181
+ ```typescript
1182
+ options = [
1183
+ { id: 1, label: 'Table' },
1184
+ { id: 2, label: 'List' },
1185
+ ];
1186
+ selectedOption = { id: 1, label: 'Table' };
1187
+ compareById = (a: typeOfOption | null, b: typeOfOption | null) =>
1188
+ a?.id === b?.id;
1189
+ ```
1190
+
1167
1191
  ## Select
1168
1192
 
1169
1193
  Select components for dropdown selections with multi-select capabilities. Use for static selects where all options are loaded upfront.
@@ -1315,6 +1339,116 @@ Switch with label
1315
1339
  <ga-switch [(ngModel)]="value" label="Dark mode" />
1316
1340
  ```
1317
1341
 
1342
+ ## Tabs
1343
+
1344
+ Tab components for organizing content into switchable panels.
1345
+
1346
+ **Angular module: GaTabsModule**
1347
+
1348
+ ### `<ga-tabs>`
1349
+
1350
+ Container component for managing tab selection and content display.
1351
+
1352
+ #### Inputs:
1353
+
1354
+ - `selectedIndex: number` - Index of the selected tab (default: 0)
1355
+ - `withKeyline: boolean` - Display keyline below tabs (default: false)
1356
+ - `orientation: 'horizontal' | 'vertical'` - Tab orientation (default: 'horizontal')
1357
+ - `aria-label: string` - Accessible label for tab list
1358
+ - `aria-labelledby: string` - ID of element labeling tab list
1359
+
1360
+ #### Outputs:
1361
+
1362
+ - `beforeTabChange(event: GaBeforeTabChangeEvent)` - Emitted before tab changes, can prevent change via event.preventChange()
1363
+ - `selectedIndexChange(index: number)` - Emitted when selected index changes
1364
+ - `selectedTabChange(event: GaTabChangeEvent)` - Emitted when selected tab changes
1365
+
1366
+ ### `<ga-tab>`
1367
+
1368
+ Individual tab component for tab content.
1369
+
1370
+ #### Inputs:
1371
+
1372
+ - `title: string` - Tab label text (default: '')
1373
+ - `disabled: boolean` - Disabled state (default: false)
1374
+ - `rightIcon: GaIconData` - Icon displayed next to title
1375
+ - `rightIconColor: string` - Icon color
1376
+
1377
+ ### `[gaTabContent]`
1378
+
1379
+ Directive for explicit tab content template definition.
1380
+
1381
+ ### Examples:
1382
+
1383
+ Basic tabs
1384
+
1385
+ ```html
1386
+ <ga-tabs [(selectedIndex)]="selectedIndex">
1387
+ <ga-tab title="First"><p>First tab content</p></ga-tab>
1388
+ <ga-tab title="Second"><p>Second tab content</p></ga-tab>
1389
+ <ga-tab title="Third" disabled><p>Disabled tab</p></ga-tab>
1390
+ </ga-tabs>
1391
+ ```
1392
+
1393
+ Vertical orientation with keyline
1394
+
1395
+ ```html
1396
+ <ga-tabs orientation="vertical" withKeyline>
1397
+ <ga-tab title="Overview"><p>Overview content</p></ga-tab>
1398
+ <ga-tab title="Settings"><p>Settings content</p></ga-tab>
1399
+ <ga-tab title="Profile"><p>Profile content</p></ga-tab>
1400
+ </ga-tabs>
1401
+ ```
1402
+
1403
+ Tabs with icons
1404
+
1405
+ ```html
1406
+ <ga-tabs>
1407
+ <ga-tab title="Home" [rightIcon]="HomeIcon">
1408
+ <p>Home tab content</p>
1409
+ </ga-tab>
1410
+ <ga-tab title="Settings" [rightIcon]="SettingsIcon">
1411
+ <p>Settings tab content</p>
1412
+ </ga-tab>
1413
+ <ga-tab
1414
+ title="Alerts"
1415
+ [rightIcon]="AlertIcon"
1416
+ rightIconColor="var(--ga-color-warning)"
1417
+ >
1418
+ <p>Alerts tab content</p>
1419
+ </ga-tab>
1420
+ </ga-tabs>
1421
+ ```
1422
+
1423
+ Preventing tab change
1424
+
1425
+ ```html
1426
+ <ga-tabs (beforeTabChange)="onBeforeChange($event)">
1427
+ <ga-tab title="Tab 1"><p>Content 1</p></ga-tab>
1428
+ <ga-tab title="Tab 2"><p>Content 2</p></ga-tab>
1429
+ </ga-tabs>
1430
+ ```
1431
+
1432
+ ```typescript
1433
+ onBeforeChange(event: GaBeforeTabChangeEvent) {
1434
+ if (!confirm('Change tab?')) {
1435
+ event.preventChange();
1436
+ }
1437
+ }
1438
+ ```
1439
+
1440
+ Explicit content template
1441
+
1442
+ ```html
1443
+ <ga-tabs>
1444
+ <ga-tab title="Template Tab">
1445
+ <ng-template gaTabContent>
1446
+ <p>Content defined in explicit template</p>
1447
+ </ng-template>
1448
+ </ga-tab>
1449
+ </ga-tabs>
1450
+ ```
1451
+
1318
1452
  ## Text Area
1319
1453
 
1320
1454
  Text area directive for multi-line text input.
@@ -368,7 +368,7 @@ function provideGaAlertI18n(value) {
368
368
  ]);
369
369
  }
370
370
 
371
- let nextUniqueId$a = 0;
371
+ let nextUniqueId$b = 0;
372
372
  class GaAlertComponent {
373
373
  i18n = inject(GaAlertI18n);
374
374
  dismissIcon = X;
@@ -396,7 +396,7 @@ class GaAlertComponent {
396
396
  return null;
397
397
  });
398
398
  title = contentChild(GaAlertTitleComponent);
399
- progressId = `ga-alert-progress-${++nextUniqueId$a}`;
399
+ progressId = `ga-alert-progress-${++nextUniqueId$b}`;
400
400
  variantClass = computed(() => {
401
401
  return `ga-notification ga-notification--${this.variant()}`;
402
402
  });
@@ -657,10 +657,10 @@ const CHECKBOX_CONTROL_VALUE_ACCESSOR = {
657
657
  };
658
658
  // Increasing integer for generating unique ids for checkbox components.
659
659
  // Inspired by @angular/components
660
- let nextUniqueId$9 = 0;
660
+ let nextUniqueId$a = 0;
661
661
  class GaCheckboxComponent {
662
662
  /** @ignore */
663
- _uniqueId = `ga-checkbox-${++nextUniqueId$9}`;
663
+ _uniqueId = `ga-checkbox-${++nextUniqueId$a}`;
664
664
  /** @ignore */
665
665
  implicitNgControlState = injectNgControlState();
666
666
  /** @ignore */
@@ -1262,9 +1262,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
1262
1262
  type: Injectable
1263
1263
  }] });
1264
1264
 
1265
- let nextUniqueId$8 = 0;
1265
+ let nextUniqueId$9 = 0;
1266
1266
  class GaInputDirective {
1267
- uniqueId = `ga-input-${++nextUniqueId$8}`;
1267
+ uniqueId = `ga-input-${++nextUniqueId$9}`;
1268
1268
  formFieldConnector = inject(GaFormFieldConnector, {
1269
1269
  optional: true,
1270
1270
  });
@@ -1911,9 +1911,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
1911
1911
 
1912
1912
  class GaSegmentedControlComponent {
1913
1913
  selected = model();
1914
+ compareFn = input((a, b) => a === b);
1914
1915
  change = output();
1916
+ safeCompareFn = computed(() => {
1917
+ const compareFn = this.compareFn();
1918
+ return (o1, o2) => {
1919
+ if (o1 === null || o1 === undefined || o2 === null || o2 === undefined) {
1920
+ return o1 === o2;
1921
+ }
1922
+ return compareFn(o1, o2);
1923
+ };
1924
+ });
1915
1925
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1916
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: GaSegmentedControlComponent, isStandalone: true, selector: "ga-segmented-control", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", change: "change" }, host: { attributes: { "role": "group" }, classAttribute: "ga-segmented-control" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1926
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: GaSegmentedControlComponent, isStandalone: true, selector: "ga-segmented-control", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, compareFn: { classPropertyName: "compareFn", publicName: "compareFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", change: "change" }, host: { attributes: { "role": "group" }, classAttribute: "ga-segmented-control" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1917
1927
  }
1918
1928
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSegmentedControlComponent, decorators: [{
1919
1929
  type: Component,
@@ -1935,9 +1945,12 @@ class GaSegmentedControlButtonDirective {
1935
1945
  });
1936
1946
  value = input();
1937
1947
  selected = computed(() => {
1938
- return (this.value() !== undefined &&
1939
- this.group.selected() !== undefined &&
1940
- this.group.selected() === this.value());
1948
+ const value = this.value();
1949
+ const selectedValue = this.group.selected();
1950
+ if (value === undefined || selectedValue === undefined) {
1951
+ return false;
1952
+ }
1953
+ return this.group.safeCompareFn()(selectedValue, value);
1941
1954
  });
1942
1955
  onClick() {
1943
1956
  this.group.selected.set(this.value());
@@ -2186,7 +2199,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2186
2199
 
2187
2200
  const GA_FORM_FIELD_ID = new InjectionToken('ga-form-field-id');
2188
2201
 
2189
- let nextUniqueId$7 = 0;
2202
+ let nextUniqueId$8 = 0;
2190
2203
  class GaFormFieldComponent {
2191
2204
  uniqueId = inject(GA_FORM_FIELD_ID);
2192
2205
  formFieldConnector = inject(GaFormFieldConnector);
@@ -2204,7 +2217,7 @@ class GaFormFieldComponent {
2204
2217
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.4", type: GaFormFieldComponent, isStandalone: true, selector: "ga-form-field", inputs: { disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ga-form-field" }, providers: [
2205
2218
  {
2206
2219
  provide: GA_FORM_FIELD_ID,
2207
- useFactory: () => `ga-form-field-${++nextUniqueId$7}`,
2220
+ useFactory: () => `ga-form-field-${++nextUniqueId$8}`,
2208
2221
  },
2209
2222
  GaFormFieldConnector,
2210
2223
  ], queries: [{ propertyName: "fieldInfo", first: true, predicate: GaFieldInfoComponent, descendants: true, isSignal: true }, { propertyName: "fieldErrors", predicate: GaFieldErrorDirective, isSignal: true }], exportAs: ["gaFormField"], ngImport: i0, template: "<ng-content select=\"ga-label\" />\n<ng-content />\n<ga-field-callout />\n", dependencies: [{ kind: "component", type: GaFieldCalloutComponent, selector: "ga-field-callout" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -2216,13 +2229,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2216
2229
  }, providers: [
2217
2230
  {
2218
2231
  provide: GA_FORM_FIELD_ID,
2219
- useFactory: () => `ga-form-field-${++nextUniqueId$7}`,
2232
+ useFactory: () => `ga-form-field-${++nextUniqueId$8}`,
2220
2233
  },
2221
2234
  GaFormFieldConnector,
2222
2235
  ], template: "<ng-content select=\"ga-label\" />\n<ng-content />\n<ga-field-callout />\n" }]
2223
2236
  }] });
2224
2237
 
2225
- let nextUniqueId$6 = 0;
2238
+ let nextUniqueId$7 = 0;
2226
2239
  /**
2227
2240
  * Internal tooltip component used by the gaTooltip directive.
2228
2241
  * This component is not intended for direct use in templates.
@@ -2230,7 +2243,7 @@ let nextUniqueId$6 = 0;
2230
2243
  * @internal
2231
2244
  */
2232
2245
  class GaTooltipComponent {
2233
- uniqueId = `ga-tooltip-${++nextUniqueId$6}`;
2246
+ uniqueId = `ga-tooltip-${++nextUniqueId$7}`;
2234
2247
  mouseLeaveSubject = new Subject();
2235
2248
  afterMouseLeave = () => this.mouseLeaveSubject.asObservable();
2236
2249
  mouseOver = signal(false);
@@ -3548,10 +3561,10 @@ const RADIO_CONTROL_VALUE_ACCESSOR = {
3548
3561
  multi: true,
3549
3562
  };
3550
3563
  // Increasing integer for generating unique ids for radio components.
3551
- let nextUniqueId$5 = 0;
3564
+ let nextUniqueId$6 = 0;
3552
3565
  class GaRadioGroupComponent {
3553
3566
  /** Name of the radio button group. All radio buttons inside this group will use this name. */
3554
- name = input(`ga-radio-group-${nextUniqueId$5++}`);
3567
+ name = input(`ga-radio-group-${nextUniqueId$6++}`);
3555
3568
  /**
3556
3569
  * Value for the radio-group. Should equal the value of the selected radio button if there is
3557
3570
  * a corresponding radio button with a matching value. If there is not such a corresponding
@@ -3610,7 +3623,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3610
3623
  }] });
3611
3624
 
3612
3625
  // Increasing integer for generating unique ids for radio button components.
3613
- let nextUniqueId$4 = 0;
3626
+ let nextUniqueId$5 = 0;
3614
3627
  class GaRadioButtonComponent {
3615
3628
  radioGroup = inject(GaRadioGroupComponent, {
3616
3629
  optional: true,
@@ -3619,7 +3632,7 @@ class GaRadioButtonComponent {
3619
3632
  optional: true,
3620
3633
  });
3621
3634
  implicitNgControlState = injectNgControlState();
3622
- _uniqueId = `ga-radio-button-${++nextUniqueId$4}`;
3635
+ _uniqueId = `ga-radio-button-${++nextUniqueId$5}`;
3623
3636
  /** The value attribute of the native input element */
3624
3637
  value = input(null);
3625
3638
  inputId = input(null, { alias: 'id' });
@@ -3885,9 +3898,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3885
3898
  }, template: "@if (loading()) {\n <ga-select-dropdown-spinner />\n} @else {\n <ng-content />\n}\n" }]
3886
3899
  }] });
3887
3900
 
3888
- let nextUniqueId$3 = 0;
3901
+ let nextUniqueId$4 = 0;
3889
3902
  class GaSelectComponent {
3890
- _uniqueId = `ga-select-${++nextUniqueId$3}`;
3903
+ _uniqueId = `ga-select-${++nextUniqueId$4}`;
3891
3904
  icons = { CircleX };
3892
3905
  _onTouched;
3893
3906
  _onModelChanged;
@@ -4734,9 +4747,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
4734
4747
  args: [{ selector: 'ga-intersection-trigger', template: ``, styles: [":host{height:0px;display:block;flex-shrink:0}\n"] }]
4735
4748
  }], ctorParameters: () => [] });
4736
4749
 
4737
- let nextUniqueId$2 = 0;
4750
+ let nextUniqueId$3 = 0;
4738
4751
  class GaDataSelectComponent {
4739
- _uniqueId = `ga-data-select-${++nextUniqueId$2}`;
4752
+ _uniqueId = `ga-data-select-${++nextUniqueId$3}`;
4740
4753
  icons = { CircleX };
4741
4754
  _onTouched;
4742
4755
  _onModelChanged;
@@ -5353,13 +5366,13 @@ const SWITCH_CONTROL_VALUE_ACCESSOR = {
5353
5366
  multi: true,
5354
5367
  };
5355
5368
  // Increasing integer for generating unique ids for switch components.
5356
- let nextUniqueId$1 = 0;
5369
+ let nextUniqueId$2 = 0;
5357
5370
  class GaSwitchComponent {
5358
5371
  icons = { Check };
5359
5372
  /** @ignore */
5360
5373
  implicitNgControlState = injectNgControlState();
5361
5374
  /** @ignore */
5362
- _uniqueId = `ga-switch-${++nextUniqueId$1}`;
5375
+ _uniqueId = `ga-switch-${++nextUniqueId$2}`;
5363
5376
  /** @ignore */
5364
5377
  tabindex = input(0, {
5365
5378
  alias: 'tabindex',
@@ -5551,6 +5564,141 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
5551
5564
  }]
5552
5565
  }] });
5553
5566
 
5567
+ class GaTabContentDirective {
5568
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5569
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: GaTabContentDirective, isStandalone: true, selector: "ng-template[gaTabContent]", ngImport: i0 });
5570
+ }
5571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabContentDirective, decorators: [{
5572
+ type: Directive,
5573
+ args: [{
5574
+ selector: 'ng-template[gaTabContent]',
5575
+ }]
5576
+ }] });
5577
+ class GaTabComponent {
5578
+ title = input('');
5579
+ disabled = input(false, { transform: booleanAttribute });
5580
+ rightIcon = input();
5581
+ rightIconColor = input();
5582
+ /** @ignore */
5583
+ explicitContent = contentChild(GaTabContentDirective, {
5584
+ read: TemplateRef,
5585
+ });
5586
+ /** @ignore */
5587
+ implicitContent = viewChild.required(TemplateRef);
5588
+ /** @ignore */
5589
+ contentTpl = computed(() => {
5590
+ return this.explicitContent() ?? this.implicitContent();
5591
+ });
5592
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5593
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.4", type: GaTabComponent, isStandalone: true, selector: "ga-tab", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, rightIcon: { classPropertyName: "rightIcon", publicName: "rightIcon", isSignal: true, isRequired: false, transformFunction: null }, rightIconColor: { classPropertyName: "rightIconColor", publicName: "rightIconColor", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "explicitContent", first: true, predicate: GaTabContentDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "implicitContent", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template><ng-content></ng-content></ng-template>\n" });
5594
+ }
5595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabComponent, decorators: [{
5596
+ type: Component,
5597
+ args: [{ selector: 'ga-tab', template: "<ng-template><ng-content></ng-content></ng-template>\n" }]
5598
+ }] });
5599
+
5600
+ // Increasing integer for generating unique id for tabpanels.
5601
+ let nextUniqueId$1 = 0;
5602
+ class GaTabsComponent {
5603
+ /** @ignore */
5604
+ uniqueId = `ga-tabs-${nextUniqueId$1++}`;
5605
+ /** @ignore */
5606
+ selectedTab = signal(null);
5607
+ /** @ignore */
5608
+ tabs = contentChildren(GaTabComponent);
5609
+ withKeyline = input(false, { transform: booleanAttribute });
5610
+ orientation = input('horizontal');
5611
+ ariaLabel = input(undefined, { alias: 'aria-label' });
5612
+ ariaLabelledby = input(undefined, {
5613
+ alias: 'aria-labelledby',
5614
+ });
5615
+ selectedIndexInput = input(0, {
5616
+ transform: numberAttribute,
5617
+ alias: 'selectedIndex',
5618
+ });
5619
+ selectedIndex = linkedSignal(() => this.selectedIndexInput());
5620
+ beforeTabChange = output();
5621
+ selectedIndexChange = output();
5622
+ selectedTabChange = output();
5623
+ constructor() {
5624
+ effect(() => {
5625
+ const selectedIndex = this.selectedIndex();
5626
+ untracked(() => this.selectTab(selectedIndex, false));
5627
+ });
5628
+ effect(() => {
5629
+ const selectedTab = this.selectedTab();
5630
+ const tabs = this.tabs();
5631
+ if (selectedTab && !tabs.includes(selectedTab)) {
5632
+ untracked(() => this.selectTab(this.selectedIndex(), true));
5633
+ }
5634
+ });
5635
+ }
5636
+ /** @ignore */
5637
+ onTabClick(index) {
5638
+ let canChange = true;
5639
+ this.beforeTabChange.emit({
5640
+ newIndex: index,
5641
+ oldIndex: this.selectedIndex(),
5642
+ preventChange: () => {
5643
+ canChange = false;
5644
+ },
5645
+ });
5646
+ if (canChange) {
5647
+ this.selectTab(index, true);
5648
+ }
5649
+ }
5650
+ selectTab(index, broadcastEvent) {
5651
+ const tabs = this.tabs();
5652
+ if (!tabs?.length) {
5653
+ return;
5654
+ }
5655
+ const clampedTabIndex = Math.min(tabs.length - 1, Math.max(index || 0, 0));
5656
+ const tabAtIndex = tabs.find((_, i) => i === clampedTabIndex);
5657
+ if (tabAtIndex.disabled()) {
5658
+ return;
5659
+ }
5660
+ if (clampedTabIndex !== this.selectedIndex()) {
5661
+ this.selectedIndex.set(clampedTabIndex);
5662
+ if (broadcastEvent) {
5663
+ this.selectedIndexChange.emit(clampedTabIndex);
5664
+ }
5665
+ }
5666
+ if (tabAtIndex !== this.selectedTab()) {
5667
+ this.selectedTab.set(tabAtIndex);
5668
+ if (broadcastEvent) {
5669
+ this.selectedTabChange.emit({
5670
+ index: clampedTabIndex,
5671
+ tab: tabAtIndex,
5672
+ });
5673
+ }
5674
+ }
5675
+ }
5676
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5677
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaTabsComponent, isStandalone: true, selector: "ga-tabs", inputs: { withKeyline: { classPropertyName: "withKeyline", publicName: "withKeyline", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, selectedIndexInput: { classPropertyName: "selectedIndexInput", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { beforeTabChange: "beforeTabChange", selectedIndexChange: "selectedIndexChange", selectedTabChange: "selectedTabChange" }, host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null", "class.ga-tabs-container--horizontal": "orientation() === 'horizontal'", "class.ga-tabs-container--vertical": "orientation() === 'vertical'" } }, queries: [{ propertyName: "tabs", predicate: GaTabComponent, isSignal: true }], ngImport: i0, template: "<ul\n role=\"tablist\"\n [attr.id]=\"uniqueId\"\n class=\"ga-tabs\"\n [class.ga-tabs--horizontal]=\"orientation() === 'horizontal'\"\n [class.ga-tabs--vertical]=\"orientation() === 'vertical'\"\n [class.ga-tabs--keyline]=\"withKeyline()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-orientation]=\"orientation()\"\n>\n @for (tab of tabs(); track tab; let i = $index) {\n <li\n [attr.id]=\"uniqueId + '-tablabel-' + i\"\n class=\"ga-tabs__tab\"\n [class.ga-tabs__tab--selected]=\"i === selectedIndex()\"\n [class.ga-tabs__tab--disabled]=\"tab.disabled()\"\n role=\"tab\"\n [tabindex]=\"tab.disabled() ? -1 : undefined\"\n (click)=\"onTabClick(i); $event.preventDefault()\"\n (keydown.enter)=\"onTabClick(i); $event.preventDefault()\"\n (keydown.space)=\"onTabClick(i); $event.preventDefault()\"\n [attr.aria-selected]=\"i === selectedIndex()\"\n [attr.aria-disabled]=\"tab.disabled()\"\n [attr.aria-controls]=\"uniqueId + '-tabpanel-' + i\"\n >\n {{ tab.title() }}\n @let tabTitleIcon = tab.rightIcon();\n @if (tabTitleIcon) {\n <ga-icon\n [icon]=\"tabTitleIcon\"\n size=\"16\"\n class=\"ga-tabs__tab-icon\"\n [color]=\"tab.rightIconColor()\"\n />\n }\n </li>\n }\n</ul>\n\n@for (tab of tabs(); track tab; let i = $index) {\n @if (tab === selectedTab()) {\n <div\n role=\"tabpanel\"\n [attr.id]=\"uniqueId + '-tabpanel-' + i\"\n [attr.aria-labelledby]=\"uniqueId + '-tablabel-' + i\"\n >\n <ng-template [ngTemplateOutlet]=\"tab.contentTpl()\"></ng-template>\n </div>\n }\n}\n", styles: [":host{display:flex}:host.ga-tabs-container--horizontal{flex-direction:column}:host.ga-tabs-container--vertical{flex-direction:row}:host .ga-tabs{overflow:auto;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }] });
5678
+ }
5679
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsComponent, decorators: [{
5680
+ type: Component,
5681
+ args: [{ selector: 'ga-tabs', imports: [NgTemplateOutlet, GaIconComponent], host: {
5682
+ '[attr.aria-label]': 'null',
5683
+ '[attr.aria-labelledby]': 'null',
5684
+ '[class.ga-tabs-container--horizontal]': "orientation() === 'horizontal'",
5685
+ '[class.ga-tabs-container--vertical]': "orientation() === 'vertical'",
5686
+ }, template: "<ul\n role=\"tablist\"\n [attr.id]=\"uniqueId\"\n class=\"ga-tabs\"\n [class.ga-tabs--horizontal]=\"orientation() === 'horizontal'\"\n [class.ga-tabs--vertical]=\"orientation() === 'vertical'\"\n [class.ga-tabs--keyline]=\"withKeyline()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-orientation]=\"orientation()\"\n>\n @for (tab of tabs(); track tab; let i = $index) {\n <li\n [attr.id]=\"uniqueId + '-tablabel-' + i\"\n class=\"ga-tabs__tab\"\n [class.ga-tabs__tab--selected]=\"i === selectedIndex()\"\n [class.ga-tabs__tab--disabled]=\"tab.disabled()\"\n role=\"tab\"\n [tabindex]=\"tab.disabled() ? -1 : undefined\"\n (click)=\"onTabClick(i); $event.preventDefault()\"\n (keydown.enter)=\"onTabClick(i); $event.preventDefault()\"\n (keydown.space)=\"onTabClick(i); $event.preventDefault()\"\n [attr.aria-selected]=\"i === selectedIndex()\"\n [attr.aria-disabled]=\"tab.disabled()\"\n [attr.aria-controls]=\"uniqueId + '-tabpanel-' + i\"\n >\n {{ tab.title() }}\n @let tabTitleIcon = tab.rightIcon();\n @if (tabTitleIcon) {\n <ga-icon\n [icon]=\"tabTitleIcon\"\n size=\"16\"\n class=\"ga-tabs__tab-icon\"\n [color]=\"tab.rightIconColor()\"\n />\n }\n </li>\n }\n</ul>\n\n@for (tab of tabs(); track tab; let i = $index) {\n @if (tab === selectedTab()) {\n <div\n role=\"tabpanel\"\n [attr.id]=\"uniqueId + '-tabpanel-' + i\"\n [attr.aria-labelledby]=\"uniqueId + '-tablabel-' + i\"\n >\n <ng-template [ngTemplateOutlet]=\"tab.contentTpl()\"></ng-template>\n </div>\n }\n}\n", styles: [":host{display:flex}:host.ga-tabs-container--horizontal{flex-direction:column}:host.ga-tabs-container--vertical{flex-direction:row}:host .ga-tabs{overflow:auto;white-space:nowrap}\n"] }]
5687
+ }], ctorParameters: () => [] });
5688
+
5689
+ class GaTabsModule {
5690
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5691
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, imports: [GaTabsComponent, GaTabComponent, GaTabContentDirective], exports: [GaTabsComponent, GaTabComponent, GaTabContentDirective] });
5692
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, imports: [GaTabsComponent] });
5693
+ }
5694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, decorators: [{
5695
+ type: NgModule,
5696
+ args: [{
5697
+ imports: [GaTabsComponent, GaTabComponent, GaTabContentDirective],
5698
+ exports: [GaTabsComponent, GaTabComponent, GaTabContentDirective],
5699
+ }]
5700
+ }] });
5701
+
5554
5702
  let nextUniqueId = 0;
5555
5703
  class GaTextAreaDirective {
5556
5704
  implicitNgControlState = injectNgControlState();
@@ -5710,5 +5858,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
5710
5858
  * Generated bundle index. Do not edit.
5711
5859
  */
5712
5860
 
5713
- export { CHECKBOX_CONTROL_VALUE_ACCESSOR, DEFAULT_MODAL_OPTIONS, GA_ALERT_I18N_FACTORY, GA_BASE_FONT_SIZE, GA_BUTTON_I18N_FACTORY, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_DATA_SELECT_I18N_FACTORY, GA_DATA_SELECT_REQUIRED_VALIDATOR, GA_DATEPICKER_I18N_FACTORY, GA_DATEPICKER_PARSER_FORMATTER_FACTORY, GA_DATEPICKER_VALUE_ADAPTER_FACTORY, GA_DATE_PARSER_FORMATTER_CONFIG, GA_DEFAULT_DATEPICKER_FORMATS, GA_FORM_CONTROL_ADAPTER, GA_FORM_ERRORS, GA_ICON_DEFAULT_SIZE, GA_MODAL_DATA, GA_MODAL_I18N_FACTORY, GA_SELECT_I18N_FACTORY, GA_SELECT_REQUIRED_VALIDATOR, GA_TOOLTIP_DEFAULT_OFFSET, GaAlertComponent, GaAlertI18n, GaAlertI18nDefault, GaAlertModule, GaAlertTitleActionsComponent, GaAlertTitleComponent, GaBadgeComponent, GaBadgeModule, GaButtonDirective, GaButtonI18n, GaButtonI18nDefault, GaButtonModule, GaCardComponent, GaCardModule, GaCheckboxComponent, GaCheckboxModule, GaCheckboxRequiredValidator, GaChipComponent, GaChipListboxComponent, GaChipModule, GaDataSelectComponent, GaDataSelectI18n, GaDataSelectI18nDefault, GaDataSelectModule, GaDataSelectOptgroupLabelDirective, GaDataSelectOptionLabelDirective, GaDataSelectRequiredValidator, GaDataSelectValueDirective, GaDatepickerComponent, GaDatepickerI18n, GaDatepickerI18nDefault, GaDatepickerInputDirective, GaDatepickerModule, GaDatepickerNativeUtcIsoValueAdapter, GaDatepickerNativeUtcValueAdapter, GaDatepickerParserFormatter, GaDatepickerParserFormatterDefault, GaDatepickerStructValueAdapter, GaDatepickerToggleComponent, GaDatepickerValueAdapter, GaFieldErrorDirective, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormControlErrorsDirective, GaFormFieldComponent, GaFormFieldConnector, GaFormFieldModule, GaIconButtonDirective, GaIconComponent, GaIconModule, GaInputComponent, GaInputDirective, GaInputModule, GaLabelledByFormFieldDirective, GaLinkDirective, GaLinkModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaMenuTriggerIconComponent, GaModalActionsComponent, GaModalCloseDirective, GaModalComponent, GaModalContentComponent, GaModalDescriptionComponent, GaModalDescriptionDirective, GaModalHeaderComponent, GaModalI18n, GaModalI18nDefault, GaModalLabelDirective, GaModalModule, GaModalOptions, GaModalRef, GaModalService, GaModalTitleDirective, GaOptgroupComponent, GaOptionComponent, GaRadioButtonComponent, GaRadioGroupComponent, GaRadioModule, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlIconButtonComponent, GaSegmentedControlModule, GaSegmentedControlTextButtonComponent, GaSelectComponent, GaSelectDropdownComponent, GaSelectDropdownSpinnerComponent, GaSelectI18n, GaSelectI18nDefault, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaSwitchComponent, GaSwitchModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, SWITCH_CONTROL_VALUE_ACCESSOR, compareStructs, extendGaDateParserFormatter, injectNgControlState, provideGaAlertI18n, provideGaBaseFontSize, provideGaButtonI18n, provideGaDataSelectI18n, provideGaDatepickerI18n, provideGaDatepickerParserFormatter, provideGaDatepickerValueAdapter, provideGaFormErrors, provideGaModalI18n, provideGaModalOptions, provideGaSelectI18n };
5861
+ export { CHECKBOX_CONTROL_VALUE_ACCESSOR, DEFAULT_MODAL_OPTIONS, GA_ALERT_I18N_FACTORY, GA_BASE_FONT_SIZE, GA_BUTTON_I18N_FACTORY, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_DATA_SELECT_I18N_FACTORY, GA_DATA_SELECT_REQUIRED_VALIDATOR, GA_DATEPICKER_I18N_FACTORY, GA_DATEPICKER_PARSER_FORMATTER_FACTORY, GA_DATEPICKER_VALUE_ADAPTER_FACTORY, GA_DATE_PARSER_FORMATTER_CONFIG, GA_DEFAULT_DATEPICKER_FORMATS, GA_FORM_CONTROL_ADAPTER, GA_FORM_ERRORS, GA_ICON_DEFAULT_SIZE, GA_MODAL_DATA, GA_MODAL_I18N_FACTORY, GA_SELECT_I18N_FACTORY, GA_SELECT_REQUIRED_VALIDATOR, GA_TOOLTIP_DEFAULT_OFFSET, GaAlertComponent, GaAlertI18n, GaAlertI18nDefault, GaAlertModule, GaAlertTitleActionsComponent, GaAlertTitleComponent, GaBadgeComponent, GaBadgeModule, GaButtonDirective, GaButtonI18n, GaButtonI18nDefault, GaButtonModule, GaCardComponent, GaCardModule, GaCheckboxComponent, GaCheckboxModule, GaCheckboxRequiredValidator, GaChipComponent, GaChipListboxComponent, GaChipModule, GaDataSelectComponent, GaDataSelectI18n, GaDataSelectI18nDefault, GaDataSelectModule, GaDataSelectOptgroupLabelDirective, GaDataSelectOptionLabelDirective, GaDataSelectRequiredValidator, GaDataSelectValueDirective, GaDatepickerComponent, GaDatepickerI18n, GaDatepickerI18nDefault, GaDatepickerInputDirective, GaDatepickerModule, GaDatepickerNativeUtcIsoValueAdapter, GaDatepickerNativeUtcValueAdapter, GaDatepickerParserFormatter, GaDatepickerParserFormatterDefault, GaDatepickerStructValueAdapter, GaDatepickerToggleComponent, GaDatepickerValueAdapter, GaFieldErrorDirective, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormControlErrorsDirective, GaFormFieldComponent, GaFormFieldConnector, GaFormFieldModule, GaIconButtonDirective, GaIconComponent, GaIconModule, GaInputComponent, GaInputDirective, GaInputModule, GaLabelledByFormFieldDirective, GaLinkDirective, GaLinkModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaMenuTriggerIconComponent, GaModalActionsComponent, GaModalCloseDirective, GaModalComponent, GaModalContentComponent, GaModalDescriptionComponent, GaModalDescriptionDirective, GaModalHeaderComponent, GaModalI18n, GaModalI18nDefault, GaModalLabelDirective, GaModalModule, GaModalOptions, GaModalRef, GaModalService, GaModalTitleDirective, GaOptgroupComponent, GaOptionComponent, GaRadioButtonComponent, GaRadioGroupComponent, GaRadioModule, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlIconButtonComponent, GaSegmentedControlModule, GaSegmentedControlTextButtonComponent, GaSelectComponent, GaSelectDropdownComponent, GaSelectDropdownSpinnerComponent, GaSelectI18n, GaSelectI18nDefault, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaSwitchComponent, GaSwitchModule, GaTabComponent, GaTabContentDirective, GaTabsComponent, GaTabsModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, SWITCH_CONTROL_VALUE_ACCESSOR, compareStructs, extendGaDateParserFormatter, injectNgControlState, provideGaAlertI18n, provideGaBaseFontSize, provideGaButtonI18n, provideGaDataSelectI18n, provideGaDatepickerI18n, provideGaDatepickerParserFormatter, provideGaDatepickerValueAdapter, provideGaFormErrors, provideGaModalI18n, provideGaModalOptions, provideGaSelectI18n };
5714
5862
  //# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map