@six-group/ui-library-angular 0.0.0-insider.d1e67f0 → 0.0.0-insider.d4f3849

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.
@@ -2380,7 +2380,7 @@ class CheckboxValueAccessor extends ValueAccessor {
2380
2380
  this.updateValidation();
2381
2381
  }
2382
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 }); }
2383
- 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: [
2384
2384
  {
2385
2385
  provide: NG_VALUE_ACCESSOR,
2386
2386
  useExisting: CheckboxValueAccessor,
@@ -2391,7 +2391,7 @@ class CheckboxValueAccessor extends ValueAccessor {
2391
2391
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CheckboxValueAccessor, decorators: [{
2392
2392
  type: Directive,
2393
2393
  args: [{
2394
- selector: 'six-checkbox',
2394
+ selector: 'six-checkbox:not([six-checkbox-group])',
2395
2395
  providers: [
2396
2396
  {
2397
2397
  provide: NG_VALUE_ACCESSOR,
@@ -2406,6 +2406,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2406
2406
  args: ['change', ['$event.target']]
2407
2407
  }] } });
2408
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
+
2409
2473
  class RangeValueAccessor extends ValueAccessor {
2410
2474
  constructor(injector, el) {
2411
2475
  super(injector, el);
@@ -2751,6 +2815,8 @@ class UiLibraryAngularModule {
2751
2815
  TimepickerValueAccessor,
2752
2816
  SelectValueAccessor,
2753
2817
  CheckboxValueAccessor,
2818
+ CheckboxMultiSelectValueAccessor,
2819
+ SixCheckboxGroupDirective,
2754
2820
  SwitchValueAccessor,
2755
2821
  RangeValueAccessor,
2756
2822
  // validators
@@ -2780,6 +2846,8 @@ class UiLibraryAngularModule {
2780
2846
  TimepickerValueAccessor,
2781
2847
  SelectValueAccessor,
2782
2848
  CheckboxValueAccessor,
2849
+ CheckboxMultiSelectValueAccessor,
2850
+ SixCheckboxGroupDirective,
2783
2851
  SwitchValueAccessor,
2784
2852
  RangeValueAccessor,
2785
2853
  // validators
@@ -2817,6 +2885,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2817
2885
  TimepickerValueAccessor,
2818
2886
  SelectValueAccessor,
2819
2887
  CheckboxValueAccessor,
2888
+ CheckboxMultiSelectValueAccessor,
2889
+ SixCheckboxGroupDirective,
2820
2890
  SwitchValueAccessor,
2821
2891
  RangeValueAccessor,
2822
2892
  // validators
@@ -2851,6 +2921,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2851
2921
  TimepickerValueAccessor,
2852
2922
  SelectValueAccessor,
2853
2923
  CheckboxValueAccessor,
2924
+ CheckboxMultiSelectValueAccessor,
2925
+ SixCheckboxGroupDirective,
2854
2926
  SwitchValueAccessor,
2855
2927
  RangeValueAccessor,
2856
2928
  // validators
@@ -2901,5 +2973,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
2901
2973
  * Generated bundle index. Do not edit.
2902
2974
  */
2903
2975
 
2904
- 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 };
2905
2977
  //# sourceMappingURL=six-group-ui-library-angular.mjs.map