@six-group/ui-library-angular 5.1.1 → 5.2.0-rc.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.
@@ -415,11 +415,11 @@ let SixDropdown = class SixDropdown {
415
415
  proxyOutputs(this, this.el, ['six-dropdown-show', 'six-dropdown-after-show', 'six-dropdown-hide', 'six-dropdown-after-hide', 'six-dropdown-auto-filter-fired', 'six-async-filter-fired', 'six-dropdown-scroll']);
416
416
  }
417
417
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: SixDropdown, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
418
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: SixDropdown, isStandalone: false, selector: "six-dropdown", inputs: { asyncFilter: "asyncFilter", autofocusFilter: "autofocusFilter", closeOnSelect: "closeOnSelect", containingElement: "containingElement", disableHideOnEnterAndSpace: "disableHideOnEnterAndSpace", distance: "distance", filter: "filter", filterDebounce: "filterDebounce", filterPlaceholder: "filterPlaceholder", hoist: "hoist", matchTriggerWidth: "matchTriggerWidth", open: "open", options: "options", placement: "placement", skidding: "skidding", virtualScroll: "virtualScroll" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
418
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: SixDropdown, isStandalone: false, selector: "six-dropdown", inputs: { asyncFilter: "asyncFilter", autofocusFilter: "autofocusFilter", closeOnSelect: "closeOnSelect", containingElement: "containingElement", disableHideOnEnterAndSpace: "disableHideOnEnterAndSpace", distance: "distance", filter: "filter", filterDebounce: "filterDebounce", filterPlaceholder: "filterPlaceholder", hoist: "hoist", matchTriggerWidth: "matchTriggerWidth", noScroll: "noScroll", open: "open", options: "options", placement: "placement", skidding: "skidding", virtualScroll: "virtualScroll" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
419
419
  };
420
420
  SixDropdown = __decorate([
421
421
  ProxyCmp({
422
- inputs: ['asyncFilter', 'autofocusFilter', 'closeOnSelect', 'containingElement', 'disableHideOnEnterAndSpace', 'distance', 'filter', 'filterDebounce', 'filterPlaceholder', 'hoist', 'matchTriggerWidth', 'open', 'options', 'placement', 'skidding', 'virtualScroll'],
422
+ inputs: ['asyncFilter', 'autofocusFilter', 'closeOnSelect', 'containingElement', 'disableHideOnEnterAndSpace', 'distance', 'filter', 'filterDebounce', 'filterPlaceholder', 'hoist', 'matchTriggerWidth', 'noScroll', 'open', 'options', 'placement', 'skidding', 'virtualScroll'],
423
423
  methods: ['show', 'hide']
424
424
  })
425
425
  ], SixDropdown);
@@ -430,7 +430,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
430
430
  changeDetection: ChangeDetectionStrategy.OnPush,
431
431
  template: '<ng-content></ng-content>',
432
432
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
433
- inputs: ['asyncFilter', 'autofocusFilter', 'closeOnSelect', 'containingElement', 'disableHideOnEnterAndSpace', 'distance', 'filter', 'filterDebounce', 'filterPlaceholder', 'hoist', 'matchTriggerWidth', 'open', 'options', 'placement', 'skidding', 'virtualScroll'],
433
+ inputs: ['asyncFilter', 'autofocusFilter', 'closeOnSelect', 'containingElement', 'disableHideOnEnterAndSpace', 'distance', 'filter', 'filterDebounce', 'filterPlaceholder', 'hoist', 'matchTriggerWidth', 'noScroll', 'open', 'options', 'placement', 'skidding', 'virtualScroll'],
434
434
  standalone: false
435
435
  }]
436
436
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
@@ -1686,6 +1686,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
1686
1686
 
1687
1687
  const DEFAULT_UI_LIBRARY_CONFIG = {
1688
1688
  showAsteriskOnRequiredValidator: false,
1689
+ disableValidationService: false,
1689
1690
  };
1690
1691
  const UI_LIBRARY_CONFIG = new InjectionToken('UiLibraryConfig');
1691
1692
 
@@ -1740,12 +1741,12 @@ class ValueAccessor {
1740
1741
  const element = this.el.nativeElement;
1741
1742
  const control = this.ngControl?.control;
1742
1743
  const invalid = control.status === 'INVALID' && control.dirty && control.touched;
1743
- let errorTexts;
1744
- if (invalid) {
1745
- errorTexts = this.initialErrorText || this.getErrorTexts(control);
1746
- }
1747
1744
  element.invalid = invalid;
1748
- element.errorText = errorTexts ?? '';
1745
+ // If the module is configured to do so, display error messages for invalid controls
1746
+ if (!this.config.disableValidationService) {
1747
+ const errorTexts = invalid ? this.initialErrorText || this.getErrorTexts(control) : undefined;
1748
+ element.errorText = errorTexts ?? '';
1749
+ }
1749
1750
  // When the module is configured to do so, display an asterisk next to any form control that has a required validator
1750
1751
  if (this.config.showAsteriskOnRequiredValidator && this.ngControl.control.hasValidator(Validators.required)) {
1751
1752
  element.required = true;
@@ -2379,7 +2380,7 @@ class CheckboxValueAccessor extends ValueAccessor {
2379
2380
  this.updateValidation();
2380
2381
  }
2381
2382
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CheckboxValueAccessor, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2382
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.3", type: CheckboxValueAccessor, isStandalone: false, selector: "six-checkbox", host: { listeners: { "change": "handleChangeEvent($event.target)" } }, providers: [
2383
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.3", type: CheckboxValueAccessor, isStandalone: false, selector: "six-checkbox:not([six-checkbox-group])", host: { listeners: { "change": "handleChangeEvent($event.target)" } }, providers: [
2383
2384
  {
2384
2385
  provide: NG_VALUE_ACCESSOR,
2385
2386
  useExisting: CheckboxValueAccessor,
@@ -2390,7 +2391,7 @@ class CheckboxValueAccessor extends ValueAccessor {
2390
2391
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CheckboxValueAccessor, decorators: [{
2391
2392
  type: Directive,
2392
2393
  args: [{
2393
- selector: 'six-checkbox',
2394
+ selector: 'six-checkbox:not([six-checkbox-group])',
2394
2395
  providers: [
2395
2396
  {
2396
2397
  provide: NG_VALUE_ACCESSOR,
@@ -2405,6 +2406,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2405
2406
  args: ['change', ['$event.target']]
2406
2407
  }] } });
2407
2408
 
2409
+ class SixCheckboxGroupDirective {
2410
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: SixCheckboxGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2411
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.3", type: SixCheckboxGroupDirective, isStandalone: false, selector: "[six-checkbox-group]", ngImport: i0 }); }
2412
+ }
2413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: SixCheckboxGroupDirective, decorators: [{
2414
+ type: Directive,
2415
+ args: [{
2416
+ selector: '[six-checkbox-group]',
2417
+ standalone: false,
2418
+ }]
2419
+ }] });
2420
+ // Accessor applies only when the SixCheckboxGroupDirective attribute is present
2421
+ class CheckboxMultiSelectValueAccessor extends ValueAccessor {
2422
+ constructor(injector, el) {
2423
+ super(injector, el);
2424
+ }
2425
+ onHostChange(el) {
2426
+ const checked = el.checked;
2427
+ const current = this.ngControl?.value;
2428
+ if (!current)
2429
+ return;
2430
+ const set = new Set(current);
2431
+ checked ? set.add(this.value) : set.delete(this.value);
2432
+ this.handleValueChange(el, Array.from(set));
2433
+ }
2434
+ writeValue(values) {
2435
+ const arr = Array.isArray(values) ? values : [];
2436
+ const checkbox = this.el.nativeElement;
2437
+ checkbox.checked = arr.includes(this.value);
2438
+ this.updateValidation();
2439
+ }
2440
+ setDisabledState(isDisabled) {
2441
+ this.el.nativeElement.disabled = isDisabled;
2442
+ }
2443
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CheckboxMultiSelectValueAccessor, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2444
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.3", type: CheckboxMultiSelectValueAccessor, isStandalone: false, selector: "six-checkbox[six-checkbox-group]", inputs: { value: "value" }, host: { listeners: { "change": "onHostChange($event.target)" } }, providers: [
2445
+ {
2446
+ provide: NG_VALUE_ACCESSOR,
2447
+ useExisting: CheckboxMultiSelectValueAccessor,
2448
+ multi: true,
2449
+ },
2450
+ ], usesInheritance: true, ngImport: i0 }); }
2451
+ }
2452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CheckboxMultiSelectValueAccessor, decorators: [{
2453
+ type: Directive,
2454
+ args: [{
2455
+ selector: 'six-checkbox[six-checkbox-group]',
2456
+ providers: [
2457
+ {
2458
+ provide: NG_VALUE_ACCESSOR,
2459
+ useExisting: CheckboxMultiSelectValueAccessor,
2460
+ multi: true,
2461
+ },
2462
+ ],
2463
+ standalone: false,
2464
+ }]
2465
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { value: [{
2466
+ type: Input,
2467
+ args: [{ required: true }]
2468
+ }], onHostChange: [{
2469
+ type: HostListener,
2470
+ args: ['change', ['$event.target']]
2471
+ }] } });
2472
+
2408
2473
  class RangeValueAccessor extends ValueAccessor {
2409
2474
  constructor(injector, el) {
2410
2475
  super(injector, el);
@@ -2750,6 +2815,8 @@ class UiLibraryAngularModule {
2750
2815
  TimepickerValueAccessor,
2751
2816
  SelectValueAccessor,
2752
2817
  CheckboxValueAccessor,
2818
+ CheckboxMultiSelectValueAccessor,
2819
+ SixCheckboxGroupDirective,
2753
2820
  SwitchValueAccessor,
2754
2821
  RangeValueAccessor,
2755
2822
  // validators
@@ -2779,6 +2846,8 @@ class UiLibraryAngularModule {
2779
2846
  TimepickerValueAccessor,
2780
2847
  SelectValueAccessor,
2781
2848
  CheckboxValueAccessor,
2849
+ CheckboxMultiSelectValueAccessor,
2850
+ SixCheckboxGroupDirective,
2782
2851
  SwitchValueAccessor,
2783
2852
  RangeValueAccessor,
2784
2853
  // validators
@@ -2816,6 +2885,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2816
2885
  TimepickerValueAccessor,
2817
2886
  SelectValueAccessor,
2818
2887
  CheckboxValueAccessor,
2888
+ CheckboxMultiSelectValueAccessor,
2889
+ SixCheckboxGroupDirective,
2819
2890
  SwitchValueAccessor,
2820
2891
  RangeValueAccessor,
2821
2892
  // validators
@@ -2850,6 +2921,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2850
2921
  TimepickerValueAccessor,
2851
2922
  SelectValueAccessor,
2852
2923
  CheckboxValueAccessor,
2924
+ CheckboxMultiSelectValueAccessor,
2925
+ SixCheckboxGroupDirective,
2853
2926
  SwitchValueAccessor,
2854
2927
  RangeValueAccessor,
2855
2928
  // validators
@@ -2900,5 +2973,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2900
2973
  * Generated bundle index. Do not edit.
2901
2974
  */
2902
2975
 
2903
- export { ActiveSidebarDirective, ActiveSidebarItemDirective, ActiveSidebarItemGroupDirective, AlertService, AllowedDatesValidator, AllowedDatesValidatorIso, CheckboxValueAccessor, DIRECTIVES, DateValueAccessor, DatepickerValueAccessor, MaxDateValidator, MaxDateValidatorIso, MaxValidator, MinDateValidator, MinDateValidatorIso, MinValidator, NumericValueAccessor, RadioValueAccessor, RangeValueAccessor, SelectValueAccessor, SixAlert, SixAvatar, SixBadge, SixBreadcrumbs, SixBreadcrumbsItem, SixButton, SixCard, SixCheckbox, SixDate, SixDatepicker, SixDetails, SixDialog, SixDrawer, SixDropdown, SixError, SixErrorPage, SixFileList, SixFileListItem, SixFileUpload, SixFooter, SixFormDirective, SixFormUtilDirective, SixGroupLabel, SixHeader, SixHeaderDropdownItem, SixHeaderItem, SixHeaderMenuButton, SixIcon, SixIconButton, SixInput, SixItemPicker, SixLanguageSwitcher, SixLayoutGrid, SixLogo, SixMainContainer, SixMenu, SixMenuDivider, SixMenuItem, SixMenuLabel, SixPicto, SixProgressBar, SixProgressRing, SixRadio, SixRange, SixRating, SixRoot, SixRouterLinkDirective, SixSearchField, SixSelect, SixSidebar, SixSidebarItem, SixSidebarItemGroup, SixSpinner, SixStageIndicator, SixSwitch, SixTab, SixTabGroup, SixTabPanel, SixTag, SixTextarea, SixTile, SixTimepicker, SixTooltip, SixUiLibraryValidators, SwitchValueAccessor, TextValueAccessor, TimepickerValueAccessor, UiLibraryAngularModule, ValidationMessagesService, ValueAccessor };
2976
+ export { ActiveSidebarDirective, ActiveSidebarItemDirective, ActiveSidebarItemGroupDirective, AlertService, AllowedDatesValidator, AllowedDatesValidatorIso, CheckboxMultiSelectValueAccessor, CheckboxValueAccessor, DIRECTIVES, DateValueAccessor, DatepickerValueAccessor, MaxDateValidator, MaxDateValidatorIso, MaxValidator, MinDateValidator, MinDateValidatorIso, MinValidator, NumericValueAccessor, RadioValueAccessor, RangeValueAccessor, SelectValueAccessor, SixAlert, SixAvatar, SixBadge, SixBreadcrumbs, SixBreadcrumbsItem, SixButton, SixCard, SixCheckbox, SixCheckboxGroupDirective, SixDate, SixDatepicker, SixDetails, SixDialog, SixDrawer, SixDropdown, SixError, SixErrorPage, SixFileList, SixFileListItem, SixFileUpload, SixFooter, SixFormDirective, SixFormUtilDirective, SixGroupLabel, SixHeader, SixHeaderDropdownItem, SixHeaderItem, SixHeaderMenuButton, SixIcon, SixIconButton, SixInput, SixItemPicker, SixLanguageSwitcher, SixLayoutGrid, SixLogo, SixMainContainer, SixMenu, SixMenuDivider, SixMenuItem, SixMenuLabel, SixPicto, SixProgressBar, SixProgressRing, SixRadio, SixRange, SixRating, SixRoot, SixRouterLinkDirective, SixSearchField, SixSelect, SixSidebar, SixSidebarItem, SixSidebarItemGroup, SixSpinner, SixStageIndicator, SixSwitch, SixTab, SixTabGroup, SixTabPanel, SixTag, SixTextarea, SixTile, SixTimepicker, SixTooltip, SixUiLibraryValidators, SwitchValueAccessor, TextValueAccessor, TimepickerValueAccessor, UiLibraryAngularModule, ValidationMessagesService, ValueAccessor };
2904
2977
  //# sourceMappingURL=six-group-ui-library-angular.mjs.map