@six-group/ui-library-angular 4.0.3 → 4.0.4

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.
@@ -1,11 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Injectable, inject, Directive, HostListener, Input, EventEmitter, Output, APP_INITIALIZER, NgModule } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Injectable, inject, Directive, HostListener, Input, EventEmitter, Output, Optional, APP_INITIALIZER, NgModule } from '@angular/core';
3
3
  import { __decorate } from 'tslib';
4
4
  import { fromEvent } from 'rxjs';
5
5
  import { defineCustomElements } from '@six-group/ui-library/loader';
6
6
  import * as i1 from '@angular/forms';
7
7
  import { NgControl, NG_VALUE_ACCESSOR, FormControl, FormGroup, FormArray, NG_VALIDATORS, Validators } from '@angular/forms';
8
- import { getErrorMessage } from '@six-group/ui-library';
8
+ import { getErrorMessage, languages } from '@six-group/ui-library';
9
+ import * as i1$1 from '@angular/common';
10
+ import * as i2 from '@angular/router';
9
11
 
10
12
  /* eslint-disable */
11
13
  /* tslint:disable */
@@ -19,6 +21,14 @@ const proxyInputs = (Cmp, inputs) => {
19
21
  set(val) {
20
22
  this.z.runOutsideAngular(() => (this.el[item] = val));
21
23
  },
24
+ /**
25
+ * In the event that proxyInputs is called
26
+ * multiple times re-defining these inputs
27
+ * will cause an error to be thrown. As a result
28
+ * we set configurable: true to indicate these
29
+ * properties can be changed.
30
+ */
31
+ configurable: true,
22
32
  });
23
33
  });
24
34
  };
@@ -1050,10 +1060,10 @@ let SixSidebarItem = class SixSidebarItem {
1050
1060
  }
1051
1061
  };
1052
1062
  SixSidebarItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SixSidebarItem, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1053
- SixSidebarItem.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SixSidebarItem, selector: "six-sidebar-item", inputs: { disabled: "disabled", selected: "selected", value: "value" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1063
+ SixSidebarItem.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SixSidebarItem, selector: "six-sidebar-item", inputs: { disabled: "disabled", href: "href", selected: "selected", value: "value" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1054
1064
  SixSidebarItem = __decorate([
1055
1065
  ProxyCmp({
1056
- inputs: ['disabled', 'selected', 'value']
1066
+ inputs: ['disabled', 'href', 'selected', 'value']
1057
1067
  })
1058
1068
  ], SixSidebarItem);
1059
1069
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SixSidebarItem, decorators: [{
@@ -1063,7 +1073,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1063
1073
  changeDetection: ChangeDetectionStrategy.OnPush,
1064
1074
  template: '<ng-content></ng-content>',
1065
1075
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1066
- inputs: ['disabled', 'selected', 'value'],
1076
+ inputs: ['disabled', 'href', 'selected', 'value'],
1067
1077
  }]
1068
1078
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1069
1079
  let SixSidebarItemGroup = class SixSidebarItemGroup {
@@ -1074,10 +1084,10 @@ let SixSidebarItemGroup = class SixSidebarItemGroup {
1074
1084
  }
1075
1085
  };
1076
1086
  SixSidebarItemGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SixSidebarItemGroup, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1077
- SixSidebarItemGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SixSidebarItemGroup, selector: "six-sidebar-item-group", inputs: { icon: "icon", name: "name", open: "open", summaryIcon: "summaryIcon", value: "value" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1087
+ SixSidebarItemGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SixSidebarItemGroup, selector: "six-sidebar-item-group", inputs: { href: "href", icon: "icon", name: "name", open: "open", summaryIcon: "summaryIcon", value: "value" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1078
1088
  SixSidebarItemGroup = __decorate([
1079
1089
  ProxyCmp({
1080
- inputs: ['icon', 'name', 'open', 'summaryIcon', 'value']
1090
+ inputs: ['href', 'icon', 'name', 'open', 'summaryIcon', 'value']
1081
1091
  })
1082
1092
  ], SixSidebarItemGroup);
1083
1093
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SixSidebarItemGroup, decorators: [{
@@ -1087,7 +1097,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1087
1097
  changeDetection: ChangeDetectionStrategy.OnPush,
1088
1098
  template: '<ng-content></ng-content>',
1089
1099
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1090
- inputs: ['icon', 'name', 'open', 'summaryIcon', 'value'],
1100
+ inputs: ['href', 'icon', 'name', 'open', 'summaryIcon', 'value'],
1091
1101
  }]
1092
1102
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1093
1103
  let SixSpinner = class SixSpinner {
@@ -1562,7 +1572,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1562
1572
  args: ['blur', ['$event.target']]
1563
1573
  }] } });
1564
1574
  function getLanguage() {
1565
- const languages = ['de', 'fr', 'it', 'en'];
1566
1575
  const documentLang = document.documentElement.lang;
1567
1576
  if (languages.includes(documentLang)) {
1568
1577
  return documentLang;
@@ -1899,34 +1908,40 @@ class SixUiLibraryValidators {
1899
1908
  }
1900
1909
  class MinDateValidator {
1901
1910
  validate(control) {
1902
- return SixUiLibraryValidators.minDate(this.mindate);
1911
+ if (this.min != null) {
1912
+ return SixUiLibraryValidators.minDate(this.min)(control);
1913
+ }
1914
+ return null;
1903
1915
  }
1904
1916
  }
1905
1917
  MinDateValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MinDateValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1906
- MinDateValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: MinDateValidator, selector: "six-datepicker[min]", inputs: { mindate: "mindate" }, providers: [{ provide: NG_VALIDATORS, useExisting: MinDateValidator, multi: true }], ngImport: i0 });
1918
+ MinDateValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: MinDateValidator, selector: "six-datepicker[min]", inputs: { min: "min" }, providers: [{ provide: NG_VALIDATORS, useExisting: MinDateValidator, multi: true }], ngImport: i0 });
1907
1919
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MinDateValidator, decorators: [{
1908
1920
  type: Directive,
1909
1921
  args: [{
1910
1922
  selector: 'six-datepicker[min]',
1911
1923
  providers: [{ provide: NG_VALIDATORS, useExisting: MinDateValidator, multi: true }],
1912
1924
  }]
1913
- }], propDecorators: { mindate: [{
1925
+ }], propDecorators: { min: [{
1914
1926
  type: Input
1915
1927
  }] } });
1916
1928
  class MaxDateValidator {
1917
1929
  validate(control) {
1918
- return SixUiLibraryValidators.maxDate(this.maxdate);
1930
+ if (this.max != null) {
1931
+ return SixUiLibraryValidators.maxDate(this.max)(control);
1932
+ }
1933
+ return null;
1919
1934
  }
1920
1935
  }
1921
1936
  MaxDateValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MaxDateValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1922
- MaxDateValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: MaxDateValidator, selector: "six-datepicker[max]", inputs: { maxdate: "maxdate" }, providers: [{ provide: NG_VALIDATORS, useExisting: MaxDateValidator, multi: true }], ngImport: i0 });
1937
+ MaxDateValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: MaxDateValidator, selector: "six-datepicker[max]", inputs: { max: "max" }, providers: [{ provide: NG_VALIDATORS, useExisting: MaxDateValidator, multi: true }], ngImport: i0 });
1923
1938
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MaxDateValidator, decorators: [{
1924
1939
  type: Directive,
1925
1940
  args: [{
1926
1941
  selector: 'six-datepicker[max]',
1927
1942
  providers: [{ provide: NG_VALIDATORS, useExisting: MaxDateValidator, multi: true }],
1928
1943
  }]
1929
- }], propDecorators: { maxdate: [{
1944
+ }], propDecorators: { max: [{
1930
1945
  type: Input
1931
1946
  }] } });
1932
1947
  class AllowedDatesValidator {
@@ -2162,6 +2177,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2162
2177
  args: ['change', ['$event.target']]
2163
2178
  }] } });
2164
2179
 
2180
+ /**
2181
+ * Forked from https://github.com/ionic-team/ionic-framework/blob/main/packages/angular/common/src/directives/navigation/router-link-delegate.ts.
2182
+ */
2183
+ class SixRouterLinkDirective {
2184
+ constructor(locationStrategy, elementRef, router, routerLinkDirective) {
2185
+ this.locationStrategy = locationStrategy;
2186
+ this.elementRef = elementRef;
2187
+ this.router = router;
2188
+ this.routerLinkDirective = routerLinkDirective;
2189
+ }
2190
+ ngOnInit() {
2191
+ this.updateTargetUrlAndHref();
2192
+ }
2193
+ ngOnChanges() {
2194
+ this.updateTargetUrlAndHref();
2195
+ }
2196
+ updateTargetUrlAndHref() {
2197
+ if (this.routerLinkDirective?.urlTree) {
2198
+ this.elementRef.nativeElement.href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLinkDirective.urlTree));
2199
+ }
2200
+ }
2201
+ }
2202
+ SixRouterLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SixRouterLinkDirective, deps: [{ token: i1$1.LocationStrategy }, { token: i0.ElementRef }, { token: i2.Router }, { token: i2.RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
2203
+ SixRouterLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SixRouterLinkDirective, selector: "six-sidebar-item[routerLink],six-sidebar-item-group[routerLink],six-button[routerLink]", inputs: { routerLink: "routerLink", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", relativeTo: "relativeTo" }, usesOnChanges: true, ngImport: i0 });
2204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SixRouterLinkDirective, decorators: [{
2205
+ type: Directive,
2206
+ args: [{
2207
+ selector: 'six-sidebar-item[routerLink],six-sidebar-item-group[routerLink],six-button[routerLink]',
2208
+ }]
2209
+ }], ctorParameters: function () { return [{ type: i1$1.LocationStrategy }, { type: i0.ElementRef }, { type: i2.Router }, { type: i2.RouterLink, decorators: [{
2210
+ type: Optional
2211
+ }] }]; }, propDecorators: { routerLink: [{
2212
+ type: Input
2213
+ }], queryParams: [{
2214
+ type: Input
2215
+ }], fragment: [{
2216
+ type: Input
2217
+ }], queryParamsHandling: [{
2218
+ type: Input
2219
+ }], relativeTo: [{
2220
+ type: Input
2221
+ }] } });
2222
+
2165
2223
  class UiLibraryAngularModule {
2166
2224
  static forRoot(customValidationMessagesService) {
2167
2225
  return {
@@ -2197,7 +2255,9 @@ UiLibraryAngularModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
2197
2255
  AllowedDatesValidator,
2198
2256
  // form helpers
2199
2257
  SixFormDirective,
2200
- SixFormUtilDirective], exports: [SetAttributes, SixAlert, SixAvatar, SixBadge, SixButton, SixCard, SixCheckbox, SixDatepicker, SixDetails, SixDialog, SixDrawer, SixDropdown, SixError, SixErrorPage, SixFileList, SixFileListItem, SixFileUpload, SixFooter, SixGroupLabel, SixHeader, SixIcon, SixIconButton, SixInput, SixItemPicker, SixLanguageSwitcher, SixLayoutGrid, SixMainContainer, SixMenu, SixMenuDivider, SixMenuItem, SixMenuLabel, SixPicto, SixProgressBar, SixProgressRing, SixRadio, SixRange, SixRoot, SixSearchField, SixSelect, SixSidebar, SixSidebarItem, SixSidebarItemGroup, SixSpinner, SixStageIndicator, SixSwitch, SixTab, SixTabGroup, SixTabPanel, SixTag, SixTextarea, SixTile, SixTimepicker, SixTooltip,
2258
+ SixFormUtilDirective,
2259
+ // router link directive
2260
+ SixRouterLinkDirective], exports: [SetAttributes, SixAlert, SixAvatar, SixBadge, SixButton, SixCard, SixCheckbox, SixDatepicker, SixDetails, SixDialog, SixDrawer, SixDropdown, SixError, SixErrorPage, SixFileList, SixFileListItem, SixFileUpload, SixFooter, SixGroupLabel, SixHeader, SixIcon, SixIconButton, SixInput, SixItemPicker, SixLanguageSwitcher, SixLayoutGrid, SixMainContainer, SixMenu, SixMenuDivider, SixMenuItem, SixMenuLabel, SixPicto, SixProgressBar, SixProgressRing, SixRadio, SixRange, SixRoot, SixSearchField, SixSelect, SixSidebar, SixSidebarItem, SixSidebarItemGroup, SixSpinner, SixStageIndicator, SixSwitch, SixTab, SixTabGroup, SixTabPanel, SixTag, SixTextarea, SixTile, SixTimepicker, SixTooltip,
2201
2261
  // value accessors
2202
2262
  TextValueAccessor,
2203
2263
  NumericValueAccessor,
@@ -2216,7 +2276,9 @@ UiLibraryAngularModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
2216
2276
  AllowedDatesValidator,
2217
2277
  // form helpers
2218
2278
  SixFormDirective,
2219
- SixFormUtilDirective] });
2279
+ SixFormUtilDirective,
2280
+ // router link directive
2281
+ SixRouterLinkDirective] });
2220
2282
  UiLibraryAngularModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UiLibraryAngularModule });
2221
2283
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UiLibraryAngularModule, decorators: [{
2222
2284
  type: NgModule,
@@ -2243,6 +2305,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2243
2305
  // form helpers
2244
2306
  SixFormDirective,
2245
2307
  SixFormUtilDirective,
2308
+ // router link directive
2309
+ SixRouterLinkDirective,
2246
2310
  ],
2247
2311
  imports: [],
2248
2312
  exports: [
@@ -2267,6 +2331,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2267
2331
  // form helpers
2268
2332
  SixFormDirective,
2269
2333
  SixFormUtilDirective,
2334
+ // router link directive
2335
+ SixRouterLinkDirective,
2270
2336
  ],
2271
2337
  }]
2272
2338
  }] });
@@ -2279,5 +2345,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2279
2345
  * Generated bundle index. Do not edit.
2280
2346
  */
2281
2347
 
2282
- export { AllowedDatesValidator, CheckboxValueAccessor, DIRECTIVES, DatepickerValueAccessor, MaxDateValidator, MaxValidator, MinDateValidator, MinValidator, NumericValueAccessor, RadioValueAccessor, RangeValueAccessor, SelectValueAccessor, SetAttributes, SixAlert, SixAvatar, SixBadge, SixButton, SixCard, SixCheckbox, SixDatepicker, SixDetails, SixDialog, SixDrawer, SixDropdown, SixError, SixErrorPage, SixFileList, SixFileListItem, SixFileUpload, SixFooter, SixFormDirective, SixFormUtilDirective, SixGroupLabel, SixHeader, SixIcon, SixIconButton, SixInput, SixItemPicker, SixLanguageSwitcher, SixLayoutGrid, SixMainContainer, SixMenu, SixMenuDivider, SixMenuItem, SixMenuLabel, SixPicto, SixProgressBar, SixProgressRing, SixRadio, SixRange, SixRoot, SixSearchField, SixSelect, SixSidebar, SixSidebarItem, SixSidebarItemGroup, SixSpinner, SixStageIndicator, SixSwitch, SixTab, SixTabGroup, SixTabPanel, SixTag, SixTextarea, SixTile, SixTimepicker, SixTooltip, SixUiLibraryValidators, SwitchValueAccessor, TextValueAccessor, TimepickerValueAccessor, UiLibraryAngularModule, ValidationMessagesService, ValueAccessor };
2348
+ export { AllowedDatesValidator, CheckboxValueAccessor, DIRECTIVES, DatepickerValueAccessor, MaxDateValidator, MaxValidator, MinDateValidator, MinValidator, NumericValueAccessor, RadioValueAccessor, RangeValueAccessor, SelectValueAccessor, SetAttributes, SixAlert, SixAvatar, SixBadge, SixButton, SixCard, SixCheckbox, SixDatepicker, SixDetails, SixDialog, SixDrawer, SixDropdown, SixError, SixErrorPage, SixFileList, SixFileListItem, SixFileUpload, SixFooter, SixFormDirective, SixFormUtilDirective, SixGroupLabel, SixHeader, SixIcon, SixIconButton, SixInput, SixItemPicker, SixLanguageSwitcher, SixLayoutGrid, SixMainContainer, SixMenu, SixMenuDivider, SixMenuItem, SixMenuLabel, SixPicto, SixProgressBar, SixProgressRing, SixRadio, SixRange, 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 };
2283
2349
  //# sourceMappingURL=six-group-ui-library-angular.mjs.map