@vsn-ux/ngx-gaia 0.8.2 → 0.8.3

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.
@@ -366,7 +366,7 @@ function provideGaAlertI18n(value) {
366
366
  ]);
367
367
  }
368
368
 
369
- let nextUniqueId$8 = 0;
369
+ let nextUniqueId$9 = 0;
370
370
  class GaAlertComponent {
371
371
  i18n = inject(GaAlertI18n);
372
372
  dismissIcon = X;
@@ -394,7 +394,7 @@ class GaAlertComponent {
394
394
  return null;
395
395
  });
396
396
  title = contentChild(GaAlertTitleComponent);
397
- progressId = `ga-alert-progress-${++nextUniqueId$8}`;
397
+ progressId = `ga-alert-progress-${++nextUniqueId$9}`;
398
398
  variantClass = computed(() => {
399
399
  return `ga-notification ga-notification--${this.variant()}`;
400
400
  });
@@ -540,11 +540,11 @@ const CHECKBOX_CONTROL_VALUE_ACCESSOR = {
540
540
  };
541
541
  // Increasing integer for generating unique ids for checkbox components.
542
542
  // Inspired by @angular/components
543
- let nextUniqueId$7 = 0;
543
+ let nextUniqueId$8 = 0;
544
544
  class GaCheckboxComponent {
545
545
  tabindex;
546
546
  /** @ignore */
547
- _uniqueId = `ga-checkbox-${++nextUniqueId$7}`;
547
+ _uniqueId = `ga-checkbox-${++nextUniqueId$8}`;
548
548
  /** @ignore */
549
549
  injector = inject(Injector);
550
550
  icons = { Minus, Check };
@@ -879,9 +879,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
879
879
  }]
880
880
  }] });
881
881
 
882
- let nextUniqueId$6 = 0;
882
+ let nextUniqueId$7 = 0;
883
883
  class GaInputDirective {
884
- uniqueId = `ga-input-${++nextUniqueId$6}`;
884
+ uniqueId = `ga-input-${++nextUniqueId$7}`;
885
885
  implicitNgControl = inject(NgControl, {
886
886
  optional: true,
887
887
  self: true,
@@ -950,9 +950,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
950
950
  }]
951
951
  }] });
952
952
 
953
- let nextUniqueId$5 = 0;
953
+ let nextUniqueId$6 = 0;
954
954
  class GaFormFieldComponent {
955
- uniqueId = `ga-form-field-${++nextUniqueId$5}`;
955
+ uniqueId = `ga-form-field-${++nextUniqueId$6}`;
956
956
  disabled = input(undefined, { transform: booleanAttribute });
957
957
  formControl = contentChild(GA_FORM_CONTROL, { descendants: true });
958
958
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -965,9 +965,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
965
965
  }, template: "<ng-content />\n" }]
966
966
  }] });
967
967
 
968
- let nextUniqueId$4 = 0;
968
+ let nextUniqueId$5 = 0;
969
969
  class GaTooltipComponent {
970
- uniqueId = `ga-tooltip-${++nextUniqueId$4}`;
970
+ uniqueId = `ga-tooltip-${++nextUniqueId$5}`;
971
971
  mouseLeaveSubject = new Subject();
972
972
  afterMouseLeave = () => this.mouseLeaveSubject.asObservable();
973
973
  mouseOver = signal(false);
@@ -2198,10 +2198,10 @@ const RADIO_CONTROL_VALUE_ACCESSOR = {
2198
2198
  multi: true,
2199
2199
  };
2200
2200
  // Increasing integer for generating unique ids for radio components.
2201
- let nextUniqueId$3 = 0;
2201
+ let nextUniqueId$4 = 0;
2202
2202
  class GaRadioGroupComponent {
2203
2203
  /** Name of the radio button group. All radio buttons inside this group will use this name. */
2204
- name = input(`ga-radio-group-${nextUniqueId$3++}`);
2204
+ name = input(`ga-radio-group-${nextUniqueId$4++}`);
2205
2205
  /**
2206
2206
  * Value for the radio-group. Should equal the value of the selected radio button if there is
2207
2207
  * a corresponding radio button with a matching value. If there is not such a corresponding
@@ -2260,13 +2260,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2260
2260
  }] });
2261
2261
 
2262
2262
  // Increasing integer for generating unique ids for radio button components.
2263
- let nextUniqueId$2 = 0;
2263
+ let nextUniqueId$3 = 0;
2264
2264
  class GaRadioButtonComponent {
2265
2265
  tabindex;
2266
2266
  radioGroup = inject(GaRadioGroupComponent, {
2267
2267
  optional: true,
2268
2268
  });
2269
- _uniqueId = `ga-radio-button-${++nextUniqueId$2}`;
2269
+ _uniqueId = `ga-radio-button-${++nextUniqueId$3}`;
2270
2270
  /** The value attribute of the native input element */
2271
2271
  value = input(null);
2272
2272
  inputId = input(null, { alias: 'id' });
@@ -2448,9 +2448,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2448
2448
  }, template: "@if (selectComponent.multiple()) {\n @for (option of selectComponent.selectedOptions(); track option) {\n <div\n class=\"ga-tag\"\n [class.ga-tag--interactive-selected]=\"!selectComponent.disabled()\"\n [class.ga-tag--interactive-selected-disabled]=\"selectComponent.disabled()\"\n >\n <span class=\"ga-tag__label\">{{ option.cdkOption.getLabel() }}</span>\n @if (!selectComponent.disabled()) {\n <div class=\"ga-tag__separator\"></div>\n <ga-icon\n [icon]=\"icons.X\"\n size=\"16\"\n class=\"ga-tag__icon\"\n (click)=\"deselectOption(option); $event.stopPropagation()\"\n />\n }\n </div>\n }\n} @else {\n {{ singleViewValue() }}\n}\n" }]
2449
2449
  }] });
2450
2450
 
2451
- let nextUniqueId$1 = 0;
2451
+ let nextUniqueId$2 = 0;
2452
2452
  class GaSelectComponent {
2453
- _uniqueId = `ga-select-${++nextUniqueId$1}`;
2453
+ _uniqueId = `ga-select-${++nextUniqueId$2}`;
2454
2454
  focusedTriggerElement = null;
2455
2455
  _onTouched;
2456
2456
  _onModelChanged;
@@ -2895,6 +2895,135 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2895
2895
  }]
2896
2896
  }] });
2897
2897
 
2898
+ const SWITCH_CONTROL_VALUE_ACCESSOR = {
2899
+ provide: NG_VALUE_ACCESSOR,
2900
+ useExisting: forwardRef(() => GaSwitchComponent),
2901
+ multi: true,
2902
+ };
2903
+ // Increasing integer for generating unique ids for switch components.
2904
+ let nextUniqueId$1 = 0;
2905
+ class GaSwitchComponent {
2906
+ icons = { Check };
2907
+ /** @ignore */
2908
+ _uniqueId = `ga-switch-${++nextUniqueId$1}`;
2909
+ injector = inject(Injector);
2910
+ /** @ignore */
2911
+ tabindex = input(0, {
2912
+ alias: 'tabindex',
2913
+ });
2914
+ /** @ignore */
2915
+ _onTouched;
2916
+ /** @ignore */
2917
+ _onModelChanged;
2918
+ /** @ignore */
2919
+ _invalidNgModel = signal(false);
2920
+ _ngModelName = signal(null);
2921
+ checked = input(false, {
2922
+ transform: booleanAttribute,
2923
+ });
2924
+ disabled = input(false, {
2925
+ transform: booleanAttribute,
2926
+ });
2927
+ ariaInvalid = input(false, {
2928
+ transform: booleanAttribute,
2929
+ alias: 'aria-invalid',
2930
+ });
2931
+ label = input('');
2932
+ ariaLabel = input(null, { alias: 'aria-label' });
2933
+ ariaLabelledby = input(null, {
2934
+ alias: 'aria-labelledby',
2935
+ });
2936
+ ariaDescribedby = input(null, {
2937
+ alias: 'aria-describedby',
2938
+ });
2939
+ ariaErrormessage = input(null, {
2940
+ alias: 'aria-errormessage',
2941
+ });
2942
+ nameInput = input(null, { alias: 'name' });
2943
+ id = input(null);
2944
+ disabledModel = linkedSignal(() => this.disabled());
2945
+ checkedModel = linkedSignal(() => this.checked());
2946
+ checkedChange = output();
2947
+ /** @ignore */
2948
+ inputId = computed(() => this.id() ?? this._uniqueId);
2949
+ /** @ignore */
2950
+ name = computed(() => {
2951
+ return this.nameInput() ?? this._ngModelName() ?? this._uniqueId;
2952
+ });
2953
+ /** @ignore */
2954
+ invalidComputed = computed(() => {
2955
+ return this.ariaInvalid() || this._invalidNgModel();
2956
+ });
2957
+ ngDoCheck() {
2958
+ const implicitNgControl = this.injector.get(NgControl, null, {
2959
+ self: true,
2960
+ });
2961
+ if (implicitNgControl) {
2962
+ this._invalidNgModel.set(!!implicitNgControl.invalid && !!implicitNgControl.dirty);
2963
+ if (implicitNgControl.name) {
2964
+ this._ngModelName.set(implicitNgControl.name);
2965
+ }
2966
+ }
2967
+ }
2968
+ /** @ignore */
2969
+ onInputChange(event) {
2970
+ const target = event.target;
2971
+ const newValue = target.checked;
2972
+ this.checkedModel.set(newValue);
2973
+ this._onModelChanged?.(newValue);
2974
+ this.checkedChange.emit(newValue);
2975
+ }
2976
+ /** @ignore */
2977
+ onBlur() {
2978
+ this._onTouched?.();
2979
+ }
2980
+ // ControlValueAccessor implementation
2981
+ writeValue(value) {
2982
+ const newValue = !!value;
2983
+ this.checkedModel.set(newValue);
2984
+ }
2985
+ registerOnChange(fn) {
2986
+ this._onModelChanged = fn;
2987
+ }
2988
+ registerOnTouched(fn) {
2989
+ this._onTouched = fn;
2990
+ }
2991
+ setDisabledState(disabled) {
2992
+ this.disabledModel.set(disabled);
2993
+ }
2994
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2995
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaSwitchComponent, isStandalone: true, selector: "ga-switch", inputs: { tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", 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 }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaErrormessage: { classPropertyName: "ariaErrormessage", publicName: "aria-errormessage", isSignal: true, isRequired: false, transformFunction: null }, nameInput: { classPropertyName: "nameInput", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "class.ga-switch--checked": "checkedModel()", "class.ga-switch--disabled": "disabledModel()", "class.ga-switch--invalid": "invalidComputed()", "attr.id": "null", "attr.tabindex": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null", "attr.aria-errormessage": "null", "attr.aria-invalid": "null" }, classAttribute: "ga-switch" }, providers: [SWITCH_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<input\n #input\n type=\"checkbox\"\n class=\"ga-switch__input\"\n [attr.id]=\"inputId()\"\n [name]=\"name()\"\n [checked]=\"checkedModel()\"\n [disabled]=\"disabledModel()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.aria-errormessage]=\"ariaErrormessage()\"\n [attr.aria-invalid]=\"invalidComputed() ? 'true' : null\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n/>\n<div class=\"ga-switch__marker\">\n <ga-icon\n [icon]=\"icons.Check\"\n class=\"ga-switch__check-icon\"\n [size]=\"16\"\n aria-hidden=\"true\"\n />\n <span class=\"ga-switch__slider\"></span>\n</div>\n@if (label()) {\n <label [attr.for]=\"inputId()\" class=\"ga-switch__label\">{{ label() }}</label>\n}\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2996
+ }
2997
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSwitchComponent, decorators: [{
2998
+ type: Component,
2999
+ args: [{ selector: 'ga-switch', imports: [GaIconModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [SWITCH_CONTROL_VALUE_ACCESSOR], host: {
3000
+ class: 'ga-switch',
3001
+ '[class.ga-switch--checked]': 'checkedModel()',
3002
+ '[class.ga-switch--disabled]': 'disabledModel()',
3003
+ '[class.ga-switch--invalid]': 'invalidComputed()',
3004
+ '[attr.id]': 'null',
3005
+ '[attr.tabindex]': 'null',
3006
+ '[attr.aria-label]': 'null',
3007
+ '[attr.aria-labelledby]': 'null',
3008
+ '[attr.aria-describedby]': 'null',
3009
+ '[attr.aria-errormessage]': 'null',
3010
+ '[attr.aria-invalid]': 'null',
3011
+ }, template: "<input\n #input\n type=\"checkbox\"\n class=\"ga-switch__input\"\n [attr.id]=\"inputId()\"\n [name]=\"name()\"\n [checked]=\"checkedModel()\"\n [disabled]=\"disabledModel()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.aria-errormessage]=\"ariaErrormessage()\"\n [attr.aria-invalid]=\"invalidComputed() ? 'true' : null\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n/>\n<div class=\"ga-switch__marker\">\n <ga-icon\n [icon]=\"icons.Check\"\n class=\"ga-switch__check-icon\"\n [size]=\"16\"\n aria-hidden=\"true\"\n />\n <span class=\"ga-switch__slider\"></span>\n</div>\n@if (label()) {\n <label [attr.for]=\"inputId()\" class=\"ga-switch__label\">{{ label() }}</label>\n}\n" }]
3012
+ }] });
3013
+
3014
+ class GaSwitchModule {
3015
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3016
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: GaSwitchModule, imports: [GaSwitchComponent], exports: [GaSwitchComponent] });
3017
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSwitchModule, imports: [GaSwitchComponent] });
3018
+ }
3019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSwitchModule, decorators: [{
3020
+ type: NgModule,
3021
+ args: [{
3022
+ imports: [GaSwitchComponent],
3023
+ exports: [GaSwitchComponent],
3024
+ }]
3025
+ }] });
3026
+
2898
3027
  class GaLinkDirective {
2899
3028
  variant = input('', { alias: 'gaLink' });
2900
3029
  size = input('medium', { alias: 'gaLinkSize' });
@@ -3039,5 +3168,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3039
3168
  * Generated bundle index. Do not edit.
3040
3169
  */
3041
3170
 
3042
- 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_FORM_CONTROL, GA_ICON_DEFAULT_SIZE, GA_MODAL_DATA, GA_MODAL_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, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormFieldComponent, 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, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, provideGaAlertI18n, provideGaBaseFontSize, provideGaButtonI18n, provideGaModalI18n, provideGaModalOptions };
3171
+ 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_FORM_CONTROL, GA_ICON_DEFAULT_SIZE, GA_MODAL_DATA, GA_MODAL_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, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormFieldComponent, 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, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaSwitchComponent, GaSwitchModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, SWITCH_CONTROL_VALUE_ACCESSOR, provideGaAlertI18n, provideGaBaseFontSize, provideGaButtonI18n, provideGaModalI18n, provideGaModalOptions };
3043
3172
  //# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map