@vsn-ux/ngx-gaia 0.9.17 → 0.10.1

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
@@ -1315,6 +1315,116 @@ Switch with label
1315
1315
  <ga-switch [(ngModel)]="value" label="Dark mode" />
1316
1316
  ```
1317
1317
 
1318
+ ## Tabs
1319
+
1320
+ Tab components for organizing content into switchable panels.
1321
+
1322
+ **Angular module: GaTabsModule**
1323
+
1324
+ ### `<ga-tabs>`
1325
+
1326
+ Container component for managing tab selection and content display.
1327
+
1328
+ #### Inputs:
1329
+
1330
+ - `selectedIndex: number` - Index of the selected tab (default: 0)
1331
+ - `withKeyline: boolean` - Display keyline below tabs (default: false)
1332
+ - `orientation: 'horizontal' | 'vertical'` - Tab orientation (default: 'horizontal')
1333
+ - `aria-label: string` - Accessible label for tab list
1334
+ - `aria-labelledby: string` - ID of element labeling tab list
1335
+
1336
+ #### Outputs:
1337
+
1338
+ - `beforeTabChange(event: GaBeforeTabChangeEvent)` - Emitted before tab changes, can prevent change via event.preventChange()
1339
+ - `selectedIndexChange(index: number)` - Emitted when selected index changes
1340
+ - `selectedTabChange(event: GaTabChangeEvent)` - Emitted when selected tab changes
1341
+
1342
+ ### `<ga-tab>`
1343
+
1344
+ Individual tab component for tab content.
1345
+
1346
+ #### Inputs:
1347
+
1348
+ - `title: string` - Tab label text (default: '')
1349
+ - `disabled: boolean` - Disabled state (default: false)
1350
+ - `rightIcon: GaIconData` - Icon displayed next to title
1351
+ - `rightIconColor: string` - Icon color
1352
+
1353
+ ### `[gaTabContent]`
1354
+
1355
+ Directive for explicit tab content template definition.
1356
+
1357
+ ### Examples:
1358
+
1359
+ Basic tabs
1360
+
1361
+ ```html
1362
+ <ga-tabs [(selectedIndex)]="selectedIndex">
1363
+ <ga-tab title="First"><p>First tab content</p></ga-tab>
1364
+ <ga-tab title="Second"><p>Second tab content</p></ga-tab>
1365
+ <ga-tab title="Third" disabled><p>Disabled tab</p></ga-tab>
1366
+ </ga-tabs>
1367
+ ```
1368
+
1369
+ Vertical orientation with keyline
1370
+
1371
+ ```html
1372
+ <ga-tabs orientation="vertical" withKeyline>
1373
+ <ga-tab title="Overview"><p>Overview content</p></ga-tab>
1374
+ <ga-tab title="Settings"><p>Settings content</p></ga-tab>
1375
+ <ga-tab title="Profile"><p>Profile content</p></ga-tab>
1376
+ </ga-tabs>
1377
+ ```
1378
+
1379
+ Tabs with icons
1380
+
1381
+ ```html
1382
+ <ga-tabs>
1383
+ <ga-tab title="Home" [rightIcon]="HomeIcon">
1384
+ <p>Home tab content</p>
1385
+ </ga-tab>
1386
+ <ga-tab title="Settings" [rightIcon]="SettingsIcon">
1387
+ <p>Settings tab content</p>
1388
+ </ga-tab>
1389
+ <ga-tab
1390
+ title="Alerts"
1391
+ [rightIcon]="AlertIcon"
1392
+ rightIconColor="var(--ga-color-warning)"
1393
+ >
1394
+ <p>Alerts tab content</p>
1395
+ </ga-tab>
1396
+ </ga-tabs>
1397
+ ```
1398
+
1399
+ Preventing tab change
1400
+
1401
+ ```html
1402
+ <ga-tabs (beforeTabChange)="onBeforeChange($event)">
1403
+ <ga-tab title="Tab 1"><p>Content 1</p></ga-tab>
1404
+ <ga-tab title="Tab 2"><p>Content 2</p></ga-tab>
1405
+ </ga-tabs>
1406
+ ```
1407
+
1408
+ ```typescript
1409
+ onBeforeChange(event: GaBeforeTabChangeEvent) {
1410
+ if (!confirm('Change tab?')) {
1411
+ event.preventChange();
1412
+ }
1413
+ }
1414
+ ```
1415
+
1416
+ Explicit content template
1417
+
1418
+ ```html
1419
+ <ga-tabs>
1420
+ <ga-tab title="Template Tab">
1421
+ <ng-template gaTabContent>
1422
+ <p>Content defined in explicit template</p>
1423
+ </ng-template>
1424
+ </ga-tab>
1425
+ </ga-tabs>
1426
+ ```
1427
+
1318
1428
  ## Text Area
1319
1429
 
1320
1430
  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
  });
@@ -2186,7 +2186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2186
2186
 
2187
2187
  const GA_FORM_FIELD_ID = new InjectionToken('ga-form-field-id');
2188
2188
 
2189
- let nextUniqueId$7 = 0;
2189
+ let nextUniqueId$8 = 0;
2190
2190
  class GaFormFieldComponent {
2191
2191
  uniqueId = inject(GA_FORM_FIELD_ID);
2192
2192
  formFieldConnector = inject(GaFormFieldConnector);
@@ -2204,7 +2204,7 @@ class GaFormFieldComponent {
2204
2204
  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
2205
  {
2206
2206
  provide: GA_FORM_FIELD_ID,
2207
- useFactory: () => `ga-form-field-${++nextUniqueId$7}`,
2207
+ useFactory: () => `ga-form-field-${++nextUniqueId$8}`,
2208
2208
  },
2209
2209
  GaFormFieldConnector,
2210
2210
  ], 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 +2216,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2216
2216
  }, providers: [
2217
2217
  {
2218
2218
  provide: GA_FORM_FIELD_ID,
2219
- useFactory: () => `ga-form-field-${++nextUniqueId$7}`,
2219
+ useFactory: () => `ga-form-field-${++nextUniqueId$8}`,
2220
2220
  },
2221
2221
  GaFormFieldConnector,
2222
2222
  ], template: "<ng-content select=\"ga-label\" />\n<ng-content />\n<ga-field-callout />\n" }]
2223
2223
  }] });
2224
2224
 
2225
- let nextUniqueId$6 = 0;
2225
+ let nextUniqueId$7 = 0;
2226
2226
  /**
2227
2227
  * Internal tooltip component used by the gaTooltip directive.
2228
2228
  * This component is not intended for direct use in templates.
@@ -2230,7 +2230,7 @@ let nextUniqueId$6 = 0;
2230
2230
  * @internal
2231
2231
  */
2232
2232
  class GaTooltipComponent {
2233
- uniqueId = `ga-tooltip-${++nextUniqueId$6}`;
2233
+ uniqueId = `ga-tooltip-${++nextUniqueId$7}`;
2234
2234
  mouseLeaveSubject = new Subject();
2235
2235
  afterMouseLeave = () => this.mouseLeaveSubject.asObservable();
2236
2236
  mouseOver = signal(false);
@@ -2940,6 +2940,68 @@ class GaModalRef {
2940
2940
 
2941
2941
  const GA_MODAL_DATA = new InjectionToken('GaModalData');
2942
2942
 
2943
+ class GaModalOptions {
2944
+ /**
2945
+ * Defines the predefined size of the modal.
2946
+ *
2947
+ * @default `md`
2948
+ */
2949
+ size;
2950
+ /**
2951
+ * Defines the type of the modal:
2952
+ * - `none` for no icon.
2953
+ * - `information` for info dialog.
2954
+ * - `danger` for danger dialog.
2955
+ * - `warning` for warning dialog.
2956
+ * - `success` for success dialog.
2957
+ */
2958
+ type;
2959
+ /**
2960
+ * The ARIA role of the dialog element.
2961
+ *
2962
+ * @default `dialog`
2963
+ */
2964
+ role;
2965
+ /**
2966
+ * Defines the vertical position of the modal.
2967
+ * - `center` centers the modal vertically in the viewport (default).
2968
+ * - `top` positions the modal at the top with a calculated offset.
2969
+ *
2970
+ * @default `center`
2971
+ */
2972
+ verticalPosition;
2973
+ /**
2974
+ * Defines if the modal should be closed when the escape key is pressed.
2975
+ *
2976
+ * @default `true`
2977
+ */
2978
+ closeOnEscape;
2979
+ /**
2980
+ * Defines if the modal should be closed when the backdrop is clicked.
2981
+ *
2982
+ * @default `true`
2983
+ */
2984
+ closeOnOutsideClick;
2985
+ /**
2986
+ * Defines if the modal should be closed when the route changes.
2987
+ *
2988
+ * @default `true`
2989
+ */
2990
+ closeOnNavigation;
2991
+ }
2992
+ const DEFAULT_MODAL_OPTIONS = {
2993
+ role: 'dialog',
2994
+ type: 'none',
2995
+ size: 'md',
2996
+ verticalPosition: 'center',
2997
+ closeOnEscape: true,
2998
+ closeOnOutsideClick: true,
2999
+ closeOnNavigation: true,
3000
+ };
3001
+ function provideGaModalOptions(options) {
3002
+ return { provide: GaModalOptions, useValue: options };
3003
+ }
3004
+
2943
3005
  class GaModalService {
2944
3006
  /** @ignore */
2945
3007
  overlay = inject(Overlay);
@@ -2952,6 +3014,8 @@ class GaModalService {
2952
3014
  });
2953
3015
  /** @ignore */
2954
3016
  openModalsAtThisLevel = signal([]);
3017
+ /** @ignore */
3018
+ positionStrategy;
2955
3019
  get activeModals() {
2956
3020
  if (this.parentModalService) {
2957
3021
  return this.parentModalService.activeModals;
@@ -2976,15 +3040,23 @@ class GaModalService {
2976
3040
  const modalRef = new GaModalRef();
2977
3041
  const injector = this.createInjector(this.injector, overlayRef, modalRef, data);
2978
3042
  const modalPortal = new ComponentPortal(component, null, injector);
2979
- const result = overlayRef.attach(modalPortal);
2980
- modalRef.instance = result.instance;
3043
+ const { instance: modalComponent } = overlayRef.attach(modalPortal);
3044
+ modalRef.instance = modalComponent;
3045
+ // Update position and size if verticalPosition is 'top'
3046
+ const verticalPosition = modalComponent.options.verticalPosition ??
3047
+ DEFAULT_MODAL_OPTIONS.verticalPosition;
3048
+ if (verticalPosition === 'top') {
3049
+ const modalStackIndex = this.activeModals().length + 1;
3050
+ this.positionStrategy?.top(`calc(4rem * var(--ga-base-scaling-factor, 1) * ${modalStackIndex})`);
3051
+ overlayRef.updateSize({
3052
+ maxHeight: `calc(100vh - 4rem * var(--ga-base-scaling-factor, 1) * (2 + ${modalStackIndex}))`,
3053
+ });
3054
+ }
2981
3055
  this.activeModals.update((modals) => {
2982
- modals.push(modalRef.instance);
3056
+ modals.push(modalComponent);
2983
3057
  return modals;
2984
3058
  });
2985
- modalRef.instance
2986
- .afterClosed({ closeOnUnsubscribe: false })
2987
- .subscribe(() => {
3059
+ modalComponent.afterClosed({ closeOnUnsubscribe: false }).subscribe(() => {
2988
3060
  const index = this.activeModals().indexOf(modalRef.instance);
2989
3061
  if (index > -1) {
2990
3062
  this.activeModals.update((modals) => {
@@ -2993,26 +3065,25 @@ class GaModalService {
2993
3065
  });
2994
3066
  }
2995
3067
  });
2996
- return result.instance;
3068
+ return modalComponent;
2997
3069
  }
2998
3070
  /** @ignore */
2999
3071
  createOverlay() {
3000
- const modalStackIndex = this.activeModals().length;
3001
- const positionStrategy = this.overlay
3072
+ this.positionStrategy = this.overlay
3002
3073
  .position()
3003
3074
  .global()
3004
3075
  .centerHorizontally()
3005
- .top(`calc(4rem * var(--ga-base-scaling-factor, 1) * ${modalStackIndex + 1})`);
3076
+ .centerVertically();
3006
3077
  const scrollStrategy = this.overlay.scrollStrategies.block();
3007
3078
  return this.overlay.create({
3008
- positionStrategy,
3079
+ positionStrategy: this.positionStrategy,
3009
3080
  scrollStrategy,
3010
3081
  hasBackdrop: true,
3011
3082
  backdropClass: 'ga-modal__backdrop',
3012
3083
  // NOTE: handled manually inside the modal component
3013
3084
  disposeOnNavigation: false,
3014
3085
  height: 'auto',
3015
- maxHeight: `calc(100vh - 4rem * var(--ga-base-scaling-factor, 1) * (2 + ${modalStackIndex}))`,
3086
+ maxHeight: `calc(100vh - 4rem * var(--ga-base-scaling-factor, 1) * 2)`,
3016
3087
  });
3017
3088
  }
3018
3089
  /** @ignore */
@@ -3034,59 +3105,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3034
3105
  args: [{ providedIn: 'root' }]
3035
3106
  }] });
3036
3107
 
3037
- class GaModalOptions {
3038
- /**
3039
- * Defines the predefined size of the modal.
3040
- *
3041
- * @default `md`
3042
- */
3043
- size;
3044
- /**
3045
- * Defines the type of the modal:
3046
- * - `none` for no icon.
3047
- * - `information` for info dialog.
3048
- * - `danger` for danger dialog.
3049
- * - `warning` for warning dialog.
3050
- * - `success` for success dialog.
3051
- */
3052
- type;
3053
- /**
3054
- * The ARIA role of the dialog element.
3055
- *
3056
- * @default `dialog`
3057
- */
3058
- role;
3059
- /**
3060
- * Defines if the modal should be closed when the escape key is pressed.
3061
- *
3062
- * @default `true`
3063
- */
3064
- closeOnEscape;
3065
- /**
3066
- * Defines if the modal should be closed when the backdrop is clicked.
3067
- *
3068
- * @default `true`
3069
- */
3070
- closeOnOutsideClick;
3071
- /**
3072
- * Defines if the modal should be closed when the route changes.
3073
- *
3074
- * @default `true`
3075
- */
3076
- closeOnNavigation;
3077
- }
3078
- const DEFAULT_MODAL_OPTIONS = {
3079
- role: 'dialog',
3080
- type: 'none',
3081
- size: 'md',
3082
- closeOnEscape: true,
3083
- closeOnOutsideClick: true,
3084
- closeOnNavigation: true,
3085
- };
3086
- function provideGaModalOptions(options) {
3087
- return { provide: GaModalOptions, useValue: options };
3088
- }
3089
-
3090
3108
  class GaModalComponent {
3091
3109
  closeSubject = new Subject();
3092
3110
  overlayRef = inject(OverlayRef);
@@ -3530,10 +3548,10 @@ const RADIO_CONTROL_VALUE_ACCESSOR = {
3530
3548
  multi: true,
3531
3549
  };
3532
3550
  // Increasing integer for generating unique ids for radio components.
3533
- let nextUniqueId$5 = 0;
3551
+ let nextUniqueId$6 = 0;
3534
3552
  class GaRadioGroupComponent {
3535
3553
  /** Name of the radio button group. All radio buttons inside this group will use this name. */
3536
- name = input(`ga-radio-group-${nextUniqueId$5++}`);
3554
+ name = input(`ga-radio-group-${nextUniqueId$6++}`);
3537
3555
  /**
3538
3556
  * Value for the radio-group. Should equal the value of the selected radio button if there is
3539
3557
  * a corresponding radio button with a matching value. If there is not such a corresponding
@@ -3592,7 +3610,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3592
3610
  }] });
3593
3611
 
3594
3612
  // Increasing integer for generating unique ids for radio button components.
3595
- let nextUniqueId$4 = 0;
3613
+ let nextUniqueId$5 = 0;
3596
3614
  class GaRadioButtonComponent {
3597
3615
  radioGroup = inject(GaRadioGroupComponent, {
3598
3616
  optional: true,
@@ -3601,7 +3619,7 @@ class GaRadioButtonComponent {
3601
3619
  optional: true,
3602
3620
  });
3603
3621
  implicitNgControlState = injectNgControlState();
3604
- _uniqueId = `ga-radio-button-${++nextUniqueId$4}`;
3622
+ _uniqueId = `ga-radio-button-${++nextUniqueId$5}`;
3605
3623
  /** The value attribute of the native input element */
3606
3624
  value = input(null);
3607
3625
  inputId = input(null, { alias: 'id' });
@@ -3867,9 +3885,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3867
3885
  }, template: "@if (loading()) {\n <ga-select-dropdown-spinner />\n} @else {\n <ng-content />\n}\n" }]
3868
3886
  }] });
3869
3887
 
3870
- let nextUniqueId$3 = 0;
3888
+ let nextUniqueId$4 = 0;
3871
3889
  class GaSelectComponent {
3872
- _uniqueId = `ga-select-${++nextUniqueId$3}`;
3890
+ _uniqueId = `ga-select-${++nextUniqueId$4}`;
3873
3891
  icons = { CircleX };
3874
3892
  _onTouched;
3875
3893
  _onModelChanged;
@@ -4716,9 +4734,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
4716
4734
  args: [{ selector: 'ga-intersection-trigger', template: ``, styles: [":host{height:0px;display:block;flex-shrink:0}\n"] }]
4717
4735
  }], ctorParameters: () => [] });
4718
4736
 
4719
- let nextUniqueId$2 = 0;
4737
+ let nextUniqueId$3 = 0;
4720
4738
  class GaDataSelectComponent {
4721
- _uniqueId = `ga-data-select-${++nextUniqueId$2}`;
4739
+ _uniqueId = `ga-data-select-${++nextUniqueId$3}`;
4722
4740
  icons = { CircleX };
4723
4741
  _onTouched;
4724
4742
  _onModelChanged;
@@ -5335,13 +5353,13 @@ const SWITCH_CONTROL_VALUE_ACCESSOR = {
5335
5353
  multi: true,
5336
5354
  };
5337
5355
  // Increasing integer for generating unique ids for switch components.
5338
- let nextUniqueId$1 = 0;
5356
+ let nextUniqueId$2 = 0;
5339
5357
  class GaSwitchComponent {
5340
5358
  icons = { Check };
5341
5359
  /** @ignore */
5342
5360
  implicitNgControlState = injectNgControlState();
5343
5361
  /** @ignore */
5344
- _uniqueId = `ga-switch-${++nextUniqueId$1}`;
5362
+ _uniqueId = `ga-switch-${++nextUniqueId$2}`;
5345
5363
  /** @ignore */
5346
5364
  tabindex = input(0, {
5347
5365
  alias: 'tabindex',
@@ -5533,6 +5551,141 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
5533
5551
  }]
5534
5552
  }] });
5535
5553
 
5554
+ class GaTabContentDirective {
5555
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5556
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: GaTabContentDirective, isStandalone: true, selector: "ng-template[gaTabContent]", ngImport: i0 });
5557
+ }
5558
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabContentDirective, decorators: [{
5559
+ type: Directive,
5560
+ args: [{
5561
+ selector: 'ng-template[gaTabContent]',
5562
+ }]
5563
+ }] });
5564
+ class GaTabComponent {
5565
+ title = input('');
5566
+ disabled = input(false, { transform: booleanAttribute });
5567
+ rightIcon = input();
5568
+ rightIconColor = input();
5569
+ /** @ignore */
5570
+ explicitContent = contentChild(GaTabContentDirective, {
5571
+ read: TemplateRef,
5572
+ });
5573
+ /** @ignore */
5574
+ implicitContent = viewChild.required(TemplateRef);
5575
+ /** @ignore */
5576
+ contentTpl = computed(() => {
5577
+ return this.explicitContent() ?? this.implicitContent();
5578
+ });
5579
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5580
+ 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" });
5581
+ }
5582
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabComponent, decorators: [{
5583
+ type: Component,
5584
+ args: [{ selector: 'ga-tab', template: "<ng-template><ng-content></ng-content></ng-template>\n" }]
5585
+ }] });
5586
+
5587
+ // Increasing integer for generating unique id for tabpanels.
5588
+ let nextUniqueId$1 = 0;
5589
+ class GaTabsComponent {
5590
+ /** @ignore */
5591
+ uniqueId = `ga-tabs-${nextUniqueId$1++}`;
5592
+ /** @ignore */
5593
+ selectedTab = signal(null);
5594
+ /** @ignore */
5595
+ tabs = contentChildren(GaTabComponent);
5596
+ withKeyline = input(false, { transform: booleanAttribute });
5597
+ orientation = input('horizontal');
5598
+ ariaLabel = input(undefined, { alias: 'aria-label' });
5599
+ ariaLabelledby = input(undefined, {
5600
+ alias: 'aria-labelledby',
5601
+ });
5602
+ selectedIndexInput = input(0, {
5603
+ transform: numberAttribute,
5604
+ alias: 'selectedIndex',
5605
+ });
5606
+ selectedIndex = linkedSignal(() => this.selectedIndexInput());
5607
+ beforeTabChange = output();
5608
+ selectedIndexChange = output();
5609
+ selectedTabChange = output();
5610
+ constructor() {
5611
+ effect(() => {
5612
+ const selectedIndex = this.selectedIndex();
5613
+ untracked(() => this.selectTab(selectedIndex, false));
5614
+ });
5615
+ effect(() => {
5616
+ const selectedTab = this.selectedTab();
5617
+ const tabs = this.tabs();
5618
+ if (selectedTab && !tabs.includes(selectedTab)) {
5619
+ untracked(() => this.selectTab(this.selectedIndex(), true));
5620
+ }
5621
+ });
5622
+ }
5623
+ /** @ignore */
5624
+ onTabClick(index) {
5625
+ let canChange = true;
5626
+ this.beforeTabChange.emit({
5627
+ newIndex: index,
5628
+ oldIndex: this.selectedIndex(),
5629
+ preventChange: () => {
5630
+ canChange = false;
5631
+ },
5632
+ });
5633
+ if (canChange) {
5634
+ this.selectTab(index, true);
5635
+ }
5636
+ }
5637
+ selectTab(index, broadcastEvent) {
5638
+ const tabs = this.tabs();
5639
+ if (!tabs?.length) {
5640
+ return;
5641
+ }
5642
+ const clampedTabIndex = Math.min(tabs.length - 1, Math.max(index || 0, 0));
5643
+ const tabAtIndex = tabs.find((_, i) => i === clampedTabIndex);
5644
+ if (tabAtIndex.disabled()) {
5645
+ return;
5646
+ }
5647
+ if (clampedTabIndex !== this.selectedIndex()) {
5648
+ this.selectedIndex.set(clampedTabIndex);
5649
+ if (broadcastEvent) {
5650
+ this.selectedIndexChange.emit(clampedTabIndex);
5651
+ }
5652
+ }
5653
+ if (tabAtIndex !== this.selectedTab()) {
5654
+ this.selectedTab.set(tabAtIndex);
5655
+ if (broadcastEvent) {
5656
+ this.selectedTabChange.emit({
5657
+ index: clampedTabIndex,
5658
+ tab: tabAtIndex,
5659
+ });
5660
+ }
5661
+ }
5662
+ }
5663
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5664
+ 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"] }] });
5665
+ }
5666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsComponent, decorators: [{
5667
+ type: Component,
5668
+ args: [{ selector: 'ga-tabs', imports: [NgTemplateOutlet, GaIconComponent], host: {
5669
+ '[attr.aria-label]': 'null',
5670
+ '[attr.aria-labelledby]': 'null',
5671
+ '[class.ga-tabs-container--horizontal]': "orientation() === 'horizontal'",
5672
+ '[class.ga-tabs-container--vertical]': "orientation() === 'vertical'",
5673
+ }, 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"] }]
5674
+ }], ctorParameters: () => [] });
5675
+
5676
+ class GaTabsModule {
5677
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5678
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, imports: [GaTabsComponent, GaTabComponent, GaTabContentDirective], exports: [GaTabsComponent, GaTabComponent, GaTabContentDirective] });
5679
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, imports: [GaTabsComponent] });
5680
+ }
5681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaTabsModule, decorators: [{
5682
+ type: NgModule,
5683
+ args: [{
5684
+ imports: [GaTabsComponent, GaTabComponent, GaTabContentDirective],
5685
+ exports: [GaTabsComponent, GaTabComponent, GaTabContentDirective],
5686
+ }]
5687
+ }] });
5688
+
5536
5689
  let nextUniqueId = 0;
5537
5690
  class GaTextAreaDirective {
5538
5691
  implicitNgControlState = injectNgControlState();
@@ -5692,5 +5845,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
5692
5845
  * Generated bundle index. Do not edit.
5693
5846
  */
5694
5847
 
5695
- 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 };
5848
+ 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 };
5696
5849
  //# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map