@kuzntsv/uikit 0.0.20 → 0.0.22

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.
@@ -48,7 +48,7 @@ export declare class BaseToolbarComponent implements OnDestroy {
48
48
  clickedClearBtn: EventEmitter<any>;
49
49
  protected authService: AuthService;
50
50
  userRoles: string[];
51
- subscription: Subscription | undefined;
51
+ subscription: Subscription;
52
52
  constructor();
53
53
  ngOnDestroy(): void;
54
54
  isShow(roles: string[]): boolean;
@@ -833,12 +833,13 @@ class BaseToolbarComponent {
833
833
  // DI
834
834
  authService = inject(AuthService);
835
835
  userRoles = [];
836
- subscription;
836
+ subscription = new Subscription();
837
837
  constructor() {
838
838
  // получить права пользователя
839
- this.subscription = this.authService.roles$.subscribe((userRoles) => {
839
+ const subs = this.authService.roles$.subscribe((userRoles) => {
840
840
  this.userRoles = userRoles;
841
841
  });
842
+ this.subscription.add(subs);
842
843
  }
843
844
  ngOnDestroy() {
844
845
  if (this.subscription)
@@ -983,9 +984,8 @@ class BaseEditClass {
983
984
  form;
984
985
  dialogRef;
985
986
  /** Объект для отписки (вызывается метод unsubscribe при уничтожннии компонента). */
986
- subscription;
987
+ subscription = new Subscription();
987
988
  constructor() {
988
- this.subscription = new Subscription();
989
989
  }
990
990
  ngOnDestroy() {
991
991
  this.subscription.unsubscribe();
@@ -1031,9 +1031,8 @@ class BaseFilterClass {
1031
1031
  // eslint-disable-next-line no-magic-numbers
1032
1032
  defaultDebounceTime = 500;
1033
1033
  /** Объект для отписки (вызывается метод unsubscribe при уничтожннии компонента). */
1034
- subscription;
1034
+ subscription = new Subscription();
1035
1035
  constructor() {
1036
- this.subscription = new Subscription();
1037
1036
  }
1038
1037
  ngOnDestroy() {
1039
1038
  this.subscription.unsubscribe();
@@ -1275,7 +1274,7 @@ class BasePageClass {
1275
1274
  router = inject(Router);
1276
1275
  localStorage = inject(LocalStorageService);
1277
1276
  /** Объект для отписки (вызывается метод unsubscribe при уничтожннии компонента). */
1278
- subscription;
1277
+ subscription = new Subscription();
1279
1278
  constructor() {
1280
1279
  this.tableState = {
1281
1280
  sortActive: this.localStorage.getData(this.constructor.name + 'SortActive') || '',
@@ -1283,7 +1282,6 @@ class BasePageClass {
1283
1282
  pageIndex: Number(this.localStorage.getData(this.constructor.name + 'PageIndex')) || this.defaultPageIndex,
1284
1283
  pageSize: Number(this.localStorage.getData(this.constructor.name + 'PageSize')) || this.defaultPageSize
1285
1284
  };
1286
- this.subscription = new Subscription();
1287
1285
  }
1288
1286
  ngOnDestroy() {
1289
1287
  this.subscription.unsubscribe();
@@ -1359,17 +1357,17 @@ class BasePageClass {
1359
1357
  this.alertService?.error('Произошла ошибка при добавлении записи: ' + error, 0);
1360
1358
  }
1361
1359
  });
1362
- this.subscription?.add(subs);
1360
+ this.subscription.add(subs);
1363
1361
  }
1364
1362
  });
1365
- this.subscription?.add(subs);
1363
+ this.subscription.add(subs);
1366
1364
  // Закрытие окна по нажатию Escape
1367
1365
  const subs2 = dialogRef.keydownEvents().subscribe((event) => {
1368
1366
  if (event.key === 'Escape') {
1369
1367
  dialogRef.close(null);
1370
1368
  }
1371
1369
  });
1372
- this.subscription?.add(subs2);
1370
+ this.subscription.add(subs2);
1373
1371
  }
1374
1372
  else {
1375
1373
  this.alertService?.warning('Действие не доступно.');
@@ -1414,17 +1412,17 @@ class BasePageClass {
1414
1412
  this.alertService?.error('Произошла ошибка при изменении записи: ' + error, 0);
1415
1413
  }
1416
1414
  });
1417
- this.subscription?.add(subs);
1415
+ this.subscription.add(subs);
1418
1416
  }
1419
1417
  });
1420
- this.subscription?.add(subs);
1418
+ this.subscription.add(subs);
1421
1419
  // Закрытие окна по нажатию Escape
1422
1420
  const subs2 = dialogRef.keydownEvents().subscribe((event) => {
1423
1421
  if (event.key === 'Escape') {
1424
1422
  dialogRef.close(null);
1425
1423
  }
1426
1424
  });
1427
- this.subscription?.add(subs2);
1425
+ this.subscription.add(subs2);
1428
1426
  }
1429
1427
  else {
1430
1428
  this.alertService?.warning('Действие не доступно.');
@@ -1454,17 +1452,17 @@ class BasePageClass {
1454
1452
  this.alertService?.error('Произошла ошибка при удалении записи: ' + error, 0);
1455
1453
  }
1456
1454
  });
1457
- this.subscription?.add(subs);
1455
+ this.subscription.add(subs);
1458
1456
  }
1459
1457
  });
1460
- this.subscription?.add(subs);
1458
+ this.subscription.add(subs);
1461
1459
  // Закрытие окна по нажатию Escape
1462
1460
  const subs2 = dialogRef.keydownEvents().subscribe((event) => {
1463
1461
  if (event.key === 'Escape') {
1464
1462
  dialogRef.close(null);
1465
1463
  }
1466
1464
  });
1467
- this.subscription?.add(subs2);
1465
+ this.subscription.add(subs2);
1468
1466
  }
1469
1467
  }
1470
1468
  }
@@ -1793,23 +1791,24 @@ class BaseMatChipComponent {
1793
1791
  selectedItems = [];
1794
1792
  // Все элементы
1795
1793
  items = [];
1796
- subscription;
1794
+ subscription = new Subscription();
1797
1795
  constructor() {
1798
1796
  }
1799
1797
  ngOnInit() {
1800
- this.subscription = this.items$.subscribe(data => {
1798
+ const subs = this.items$.subscribe(data => {
1801
1799
  // console.log('ITEMS$ data', data);
1802
1800
  this.items = data;
1803
1801
  if (this.items.length > 0) {
1804
1802
  this.filteredItems$ = this.inputCtrl.valueChanges.pipe(startWith(null), map(item => (item ? this._filter(item) : this.items.slice())));
1805
- const subs = this.selectedItems$.subscribe(items => {
1803
+ const subs2 = this.selectedItems$.subscribe(items => {
1806
1804
  // console.log('ITEMS', items);
1807
1805
  if (items)
1808
1806
  this.selectedItems = this.items.filter(s => items.includes(s.value));
1809
1807
  });
1810
- this.subscription?.add(subs);
1808
+ this.subscription.add(subs2);
1811
1809
  }
1812
1810
  });
1811
+ this.subscription.add(subs);
1813
1812
  }
1814
1813
  ngOnDestroy() {
1815
1814
  if (this.subscription)
@@ -1891,7 +1890,7 @@ class DateRangeInputComponent {
1891
1890
  required = input(false);
1892
1891
  dateRangeChange = output();
1893
1892
  form;
1894
- subscription;
1893
+ subscription = new Subscription();
1895
1894
  constructor() {
1896
1895
  this.form = new FormGroup({
1897
1896
  begin: new FormControl(),
@@ -1975,7 +1974,7 @@ class NavBarComponent {
1975
1974
  roles$;
1976
1975
  fioUser = '';
1977
1976
  photoURL = '';
1978
- subscription;
1977
+ subscription = new Subscription();
1979
1978
  constructor(authService, userService, avatarService, dialog, router) {
1980
1979
  this.authService = authService;
1981
1980
  this.avatarService = avatarService;
@@ -1984,7 +1983,7 @@ class NavBarComponent {
1984
1983
  this.loggedIn$ = this.authService.loggedIn$;
1985
1984
  this.roles$ = this.authService.roles$;
1986
1985
  this.fioUser = '';
1987
- this.subscription = this.loggedIn$.subscribe({
1986
+ const subs = this.loggedIn$.subscribe({
1988
1987
  next: (value) => {
1989
1988
  if (value) {
1990
1989
  if (userService.userData) {
@@ -1993,19 +1992,20 @@ class NavBarComponent {
1993
1992
  }
1994
1993
  if (userService.userData.idHuman) {
1995
1994
  // Аватар сотрудника.
1996
- const subs = this.avatarService.getAvatarById(Number(userService.userData.idHuman))
1995
+ const subs2 = this.avatarService.getAvatarById(Number(userService.userData.idHuman))
1997
1996
  .subscribe((image) => {
1998
1997
  if (image) {
1999
1998
  const blob = new Blob([image], { "type": "image/jpeg" });
2000
1999
  this.photoURL = URL.createObjectURL(blob);
2001
2000
  }
2002
2001
  });
2003
- this.subscription?.add(subs);
2002
+ this.subscription.add(subs2);
2004
2003
  }
2005
2004
  }
2006
2005
  }
2007
2006
  }
2008
2007
  });
2008
+ this.subscription.add(subs);
2009
2009
  }
2010
2010
  ngOnDestroy() {
2011
2011
  if (this.subscription)
@@ -2030,7 +2030,7 @@ class NavBarComponent {
2030
2030
  this.logout();
2031
2031
  }
2032
2032
  });
2033
- this.subscription?.add(subs);
2033
+ this.subscription.add(subs);
2034
2034
  }
2035
2035
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NavBarComponent, deps: [{ token: AuthService }, { token: UserService }, { token: AvatarService }, { token: i1$4.MatDialog }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
2036
2036
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NavBarComponent, isStandalone: true, selector: "ngx-uik-navbar", ngImport: i0, template: "@if (loggedIn$ | async) {\r\n <nav class=\"ngx-uik-navbar-header\">\r\n \r\n <ng-content></ng-content>\r\n\r\n <div class=\"flex-spacer\"></div>\r\n \r\n @if ((loggedIn$ | async) === false || !photoURL) {\r\n <mat-icon [matTooltip]=\"(roles$ | async)?.join(',')||''\">account_circle</mat-icon>\r\n }\r\n @if ((loggedIn$ | async) && photoURL) {\r\n <img\r\n class=\"user-photo\"\r\n [src]=\"photoURL | safe\"\r\n loading=\"lazy\"\r\n [alt]=\"fioUser\"\r\n [matTooltip]=\"(roles$ | async)?.join(',')||''\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"(roles$ | async)?.join(',') || ''\">\r\n {{ fioUser }}\r\n </span>\r\n\r\n <a mat-button class=\"pm-button\" (click)=\"openDialog()\">\u0412\u044B\u0439\u0442\u0438 <mat-icon>logout</mat-icon></a>\r\n </nav>\r\n}", styles: [".ngx-uik-navbar-header{display:flex;flex-wrap:wrap;align-items:center;padding:8px 16px}.flex-spacer{flex-grow:1}.user-name{margin-left:8px;line-height:1rem;white-space:normal}.user-photo{border-radius:50%;width:32px;height:32px;margin-right:10px}.mat-mdc-button{color:#fff!important;padding-left:16px!important;padding-right:16px!important}.mdc-button{letter-spacing:normal}\n"], dependencies: [{ kind: "component", type: MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: SafePipe, name: "safe" }] });
@@ -2052,56 +2052,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
2052
2052
  args: [{ selector: 'ngx-uik-not-found', standalone: true, template: "<div class=\"center\">\r\n <h3 class=\"mat-display-1\">\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430</h3>\r\n</div>\r\n", styles: [".center{display:flex;justify-content:center;margin:3rem}\n"] }]
2053
2053
  }], ctorParameters: () => [] });
2054
2054
 
2055
- class BaseSelectAutocompleteWithVirtualScrollComponent {
2055
+ class BaseSelectAutocompleteWithVsComponent {
2056
2056
  // https://stackblitz.com/edit/autocomplete-with-virtual-scroll-dc9u2g
2057
2057
  // Все элементы
2058
- items$ = new BehaviorSubject([]);
2058
+ items = input([]);
2059
2059
  // Выбранный элемент
2060
- selectedItem$ = new BehaviorSubject(undefined);
2060
+ selectedItem = input(undefined);
2061
2061
  // Заголовок
2062
- title = '';
2062
+ title = input('');
2063
2063
  // Видимость
2064
- isVisible = true;
2064
+ isVisible = input(true);
2065
2065
  // Обязательность
2066
- isRequired = false;
2066
+ isRequired = input(false);
2067
2067
  // Доступность
2068
- isDisabled = false;
2068
+ isDisabled = input(false);
2069
2069
  // Доступность
2070
- width = '200';
2070
+ width = input('200');
2071
2071
  // Событие изменения выбранного элемента
2072
- selectedItemChange = new EventEmitter();
2072
+ selectedItemChange = output();
2073
2073
  height = '200px';
2074
2074
  // input элемент
2075
2075
  inputCtrl = new FormControl();
2076
2076
  // отфильтрованные (отображаемые) элементы
2077
- filteredItems$ = new BehaviorSubject([]);
2078
- subscription;
2077
+ filteredItems = [];
2078
+ subscription = new Subscription();
2079
2079
  constructor() {
2080
- }
2081
- ngOnInit() {
2082
- //console.log('isVisible = ', this.isVisible);
2083
- //console.log('isDisabled = ', this.isDisabled);
2084
- this.subscription = this.items$.subscribe(data => {
2085
- console.log('ITEMS$ data', data);
2086
- console.log('onLoad: this.selectedItem$.value =', this.selectedItem$.value);
2087
- this.filteredItems$.next(data);
2088
- if (this.selectedItem$.value)
2089
- this.inputCtrl.setValue(this.selectedItem$.value);
2080
+ effect(() => {
2081
+ this.inputCtrl.setValue(this.selectedItem());
2082
+ });
2083
+ effect(() => {
2084
+ console.log('ITEMS$ data', this.items());
2085
+ console.log('onLoad: this.selectedItem$.value =', this.selectedItem());
2086
+ this.filteredItems = this.items();
2087
+ if (this.selectedItem())
2088
+ this.inputCtrl.setValue(this.selectedItem());
2090
2089
  // if (this.items.length > 0) {
2091
2090
  // this.filteredItems$ = this.inputCtrl.valueChanges.pipe(
2092
2091
  // startWith(null),
2093
2092
  // map(item => (item ? this._filter(item) : this.items.slice())),
2094
2093
  // );
2095
- const subs = this.selectedItem$.subscribe(item => {
2096
- console.log('ITEM =', item);
2097
- this.inputCtrl.setValue(item);
2098
- // if (item)
2099
- // this.selectedItems = this.items.filter(s => items.includes(s.value));
2100
- });
2101
- this.subscription?.add(subs);
2102
2094
  });
2095
+ }
2096
+ ngOnInit() {
2103
2097
  // Listen for changes to the input
2104
- const subs = this.inputCtrl.valueChanges
2098
+ const subs3 = this.inputCtrl.valueChanges
2105
2099
  .pipe(startWith$1(''),
2106
2100
  // eslint-disable-next-line no-magic-numbers
2107
2101
  debounceTime(500), distinctUntilChanged(),
@@ -2113,43 +2107,41 @@ class BaseSelectAutocompleteWithVirtualScrollComponent {
2113
2107
  map((value) => {
2114
2108
  // Filter the options
2115
2109
  if (typeof value === 'undefined') {
2116
- this.filteredItems$.next(this.items$.value);
2110
+ this.filteredItems = this.items();
2117
2111
  }
2118
2112
  else {
2119
2113
  if (typeof value !== 'object') {
2120
2114
  console.log('v1=', value);
2121
- this.filteredItems$.next(this.items$.value.filter(option => option.viewValue
2122
- .toLowerCase()
2123
- .includes(value.toLowerCase())));
2115
+ this.filteredItems = this.items()
2116
+ .filter(option => option.viewValue.toLowerCase().includes(value.toLowerCase()));
2124
2117
  }
2125
2118
  else {
2126
2119
  // typeof value === 'object'
2127
2120
  console.log('v2=', value);
2128
2121
  if (value) {
2129
2122
  // this.predmet = value;
2130
- this.filteredItems$.next(this.items$.value.filter((option) => (option.viewValue)
2131
- .toLowerCase()
2132
- .includes(value.viewValue.toLowerCase())));
2123
+ this.filteredItems = this.items()
2124
+ .filter((option) => option.viewValue.toLowerCase().includes(value.viewValue.toLowerCase()));
2133
2125
  }
2134
2126
  else {
2135
- this.filteredItems$.next(this.items$.value);
2127
+ this.filteredItems = this.items();
2136
2128
  }
2137
2129
  }
2138
2130
  }
2139
2131
  // Recompute how big the viewport should be.
2140
2132
  // eslint-disable-next-line no-magic-numbers
2141
- if (this.filteredItems$.value.length < 4) {
2133
+ if (this.filteredItems.length < 4) {
2142
2134
  // eslint-disable-next-line no-magic-numbers
2143
- this.height = this.filteredItems$.value.length * 50 + 'px';
2135
+ this.height = this.filteredItems.length * 50 + 'px';
2144
2136
  }
2145
2137
  else {
2146
2138
  this.height = '200px';
2147
2139
  }
2148
- console.log('update filteredItems$.value=', this.filteredItems$.value);
2140
+ console.log('update filteredItems$.value=', this.filteredItems);
2149
2141
  }))
2150
2142
  .subscribe();
2151
- this.subscription?.add(subs);
2152
- if (this.isDisabled) {
2143
+ this.subscription.add(subs3);
2144
+ if (this.isDisabled()) {
2153
2145
  this.inputCtrl.disable();
2154
2146
  }
2155
2147
  else {
@@ -2174,30 +2166,14 @@ class BaseSelectAutocompleteWithVirtualScrollComponent {
2174
2166
  ? lookup.viewValue
2175
2167
  : null;
2176
2168
  }
2177
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVirtualScrollComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2178
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: BaseSelectAutocompleteWithVirtualScrollComponent, isStandalone: true, selector: "ngx-uik-select-autocomplete-with-virtual-scroll", inputs: { items$: "items$", selectedItem$: "selectedItem$", title: "title", isVisible: "isVisible", isRequired: "isRequired", isDisabled: "isDisabled", width: "width" }, outputs: { selectedItemChange: "selectedItemChange" }, ngImport: i0, template: "@if (isVisible) {\r\n <mat-form-field [style.width.px]=\"width\">\r\n <mat-label>{{title}}</mat-label>\r\n <input type=\"text\"\r\n [placeholder]=title\r\n aria-label=\"Number\"\r\n matInput\r\n (ngModelChange)=\"onSelectedItemChange($event)\"\r\n [formControl]=\"inputCtrl\"\r\n [matAutocomplete]=\"auto\"\r\n [required]=\"isRequired ? 'required' : ''\"\r\n >\r\n @if (!isDisabled && selectedItem$.value) {\r\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"onClearClick($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayWithFn\" showPanel=\"true\">\r\n <cdk-virtual-scroll-viewport class=\"autocomplete-test-viewport\" [style.height]=\"height\" itemSize=\"25\">\r\n <mat-option *cdkVirtualFor=\"let option of filteredItems$\" [value]=\"option\" class=\"autocomplete-item\">\r\n {{option.viewValue}}\r\n </mat-option>\r\n </cdk-virtual-scroll-viewport>\r\n </mat-autocomplete>\r\n @if (inputCtrl.invalid) {\r\n <mat-error>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 {{title}}</mat-error>\r\n }\r\n @if (!inputCtrl.value) {\r\n <mat-hint>\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u0432\u0432\u043E\u0434\u0438\u0442\u044C ...</mat-hint>\r\n }\r\n </mat-form-field>\r\n}", styles: ["mat-form-field{margin-right:12px}.autocomplete-item{height:50px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i4$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i4$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i4$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }] });
2169
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2170
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: BaseSelectAutocompleteWithVsComponent, isStandalone: true, selector: "ngx-uik-select-autocomplete-with-vs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, selectedItem: { classPropertyName: "selectedItem", publicName: "selectedItem", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemChange: "selectedItemChange" }, ngImport: i0, template: "@if (isVisible()) {\r\n <mat-form-field [style.width.px]=\"width()\">\r\n <mat-label>{{ title() }}</mat-label>\r\n <input type=\"text\"\r\n [placeholder]=title()\r\n aria-label=\"Number\"\r\n matInput\r\n (ngModelChange)=\"onSelectedItemChange($event)\"\r\n [formControl]=\"inputCtrl\"\r\n [matAutocomplete]=\"auto\"\r\n [required]=\"isRequired() ? 'required' : ''\"\r\n >\r\n @if (!isDisabled && selectedItem()) {\r\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"onClearClick($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayWithFn\" showPanel=\"true\">\r\n <cdk-virtual-scroll-viewport class=\"autocomplete-test-viewport\" [style.height]=\"height\" itemSize=\"25\">\r\n <mat-option *cdkVirtualFor=\"let option of filteredItems\" [value]=\"option\" class=\"autocomplete-item\">\r\n {{option.viewValue}}\r\n </mat-option>\r\n </cdk-virtual-scroll-viewport>\r\n </mat-autocomplete>\r\n @if (inputCtrl.invalid) {\r\n <mat-error>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 {{title()}}</mat-error>\r\n }\r\n @if (!inputCtrl.value) {\r\n <mat-hint>\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u0432\u0432\u043E\u0434\u0438\u0442\u044C ...</mat-hint>\r\n }\r\n </mat-form-field>\r\n}", styles: ["mat-form-field{margin-right:12px}.autocomplete-item{height:50px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i4$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i4$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i4$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }] });
2179
2171
  }
2180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVirtualScrollComponent, decorators: [{
2172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVsComponent, decorators: [{
2181
2173
  type: Component,
2182
- args: [{ selector: 'ngx-uik-select-autocomplete-with-virtual-scroll', imports: [FormsModule, ReactiveFormsModule, MatAutocompleteModule, MatHint, MatError, MatOption, MatIcon,
2183
- MatFormField, ScrollingModule, MatInput, MatLabel], template: "@if (isVisible) {\r\n <mat-form-field [style.width.px]=\"width\">\r\n <mat-label>{{title}}</mat-label>\r\n <input type=\"text\"\r\n [placeholder]=title\r\n aria-label=\"Number\"\r\n matInput\r\n (ngModelChange)=\"onSelectedItemChange($event)\"\r\n [formControl]=\"inputCtrl\"\r\n [matAutocomplete]=\"auto\"\r\n [required]=\"isRequired ? 'required' : ''\"\r\n >\r\n @if (!isDisabled && selectedItem$.value) {\r\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"onClearClick($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayWithFn\" showPanel=\"true\">\r\n <cdk-virtual-scroll-viewport class=\"autocomplete-test-viewport\" [style.height]=\"height\" itemSize=\"25\">\r\n <mat-option *cdkVirtualFor=\"let option of filteredItems$\" [value]=\"option\" class=\"autocomplete-item\">\r\n {{option.viewValue}}\r\n </mat-option>\r\n </cdk-virtual-scroll-viewport>\r\n </mat-autocomplete>\r\n @if (inputCtrl.invalid) {\r\n <mat-error>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 {{title}}</mat-error>\r\n }\r\n @if (!inputCtrl.value) {\r\n <mat-hint>\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u0432\u0432\u043E\u0434\u0438\u0442\u044C ...</mat-hint>\r\n }\r\n </mat-form-field>\r\n}", styles: ["mat-form-field{margin-right:12px}.autocomplete-item{height:50px}\n"] }]
2184
- }], ctorParameters: () => [], propDecorators: { items$: [{
2185
- type: Input
2186
- }], selectedItem$: [{
2187
- type: Input
2188
- }], title: [{
2189
- type: Input
2190
- }], isVisible: [{
2191
- type: Input
2192
- }], isRequired: [{
2193
- type: Input
2194
- }], isDisabled: [{
2195
- type: Input
2196
- }], width: [{
2197
- type: Input
2198
- }], selectedItemChange: [{
2199
- type: Output
2200
- }] } });
2174
+ args: [{ selector: 'ngx-uik-select-autocomplete-with-vs', imports: [FormsModule, ReactiveFormsModule, MatAutocompleteModule, MatHint, MatError, MatOption, MatIcon,
2175
+ MatFormField, ScrollingModule, MatInput, MatLabel], template: "@if (isVisible()) {\r\n <mat-form-field [style.width.px]=\"width()\">\r\n <mat-label>{{ title() }}</mat-label>\r\n <input type=\"text\"\r\n [placeholder]=title()\r\n aria-label=\"Number\"\r\n matInput\r\n (ngModelChange)=\"onSelectedItemChange($event)\"\r\n [formControl]=\"inputCtrl\"\r\n [matAutocomplete]=\"auto\"\r\n [required]=\"isRequired() ? 'required' : ''\"\r\n >\r\n @if (!isDisabled && selectedItem()) {\r\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"onClearClick($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayWithFn\" showPanel=\"true\">\r\n <cdk-virtual-scroll-viewport class=\"autocomplete-test-viewport\" [style.height]=\"height\" itemSize=\"25\">\r\n <mat-option *cdkVirtualFor=\"let option of filteredItems\" [value]=\"option\" class=\"autocomplete-item\">\r\n {{option.viewValue}}\r\n </mat-option>\r\n </cdk-virtual-scroll-viewport>\r\n </mat-autocomplete>\r\n @if (inputCtrl.invalid) {\r\n <mat-error>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 {{title()}}</mat-error>\r\n }\r\n @if (!inputCtrl.value) {\r\n <mat-hint>\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u0432\u0432\u043E\u0434\u0438\u0442\u044C ...</mat-hint>\r\n }\r\n </mat-form-field>\r\n}", styles: ["mat-form-field{margin-right:12px}.autocomplete-item{height:50px}\n"] }]
2176
+ }], ctorParameters: () => [] });
2201
2177
 
2202
2178
  class BaseSelectWithGroupComponent {
2203
2179
  // Все группы
@@ -2210,15 +2186,16 @@ class BaseSelectWithGroupComponent {
2210
2186
  selectedItemsChange = new EventEmitter();
2211
2187
  separatorKeysCodes = [ENTER, COMMA];
2212
2188
  control = new FormControl([]);
2213
- subscription;
2189
+ subscription = new Subscription();
2214
2190
  constructor() {
2215
2191
  }
2216
2192
  ngOnInit() {
2217
2193
  this.groups$.subscribe(data => {
2218
2194
  if (data.length > 0) {
2219
- this.subscription = this.selectedItems$.subscribe(items => {
2195
+ const subs = this.selectedItems$.subscribe(items => {
2220
2196
  this.control.setValue(items.map(i => Number(i)));
2221
2197
  });
2198
+ this.subscription.add(subs);
2222
2199
  }
2223
2200
  });
2224
2201
  }
@@ -2299,12 +2276,13 @@ class TableComponent {
2299
2276
  authService = inject(AuthService);
2300
2277
  // Разрешено ли отправлять событие rowDoubleClicked при двойном щелчке мышью.
2301
2278
  dblClickedEventEnable = true;
2302
- subscription;
2279
+ subscription = new Subscription();
2303
2280
  constructor() {
2304
2281
  // получить права пользователя
2305
- this.subscription = this.authService.roles$.subscribe((userRoles) => {
2282
+ const subs = this.authService.roles$.subscribe((userRoles) => {
2306
2283
  this.dblClickedEventEnable = !this.authService.isHideElement(this.rolesDblClickedEvent, userRoles);
2307
2284
  });
2285
+ this.subscription.add(subs);
2308
2286
  }
2309
2287
  ngOnInit() {
2310
2288
  this.displayedColumns = ['select'].concat(this.columnOptions?.filter(c => !c.hide).map((item) => item.name) || []);
@@ -2317,7 +2295,7 @@ class TableComponent {
2317
2295
  this.selection.select(d);
2318
2296
  });
2319
2297
  });
2320
- this.subscription?.add(subs);
2298
+ this.subscription.add(subs);
2321
2299
  // пересоздаем, т.к. параметр allowMultiSelect появляется только сейчас
2322
2300
  this.selection = new SelectionModel(this.allowMultiSelect);
2323
2301
  }
@@ -2342,7 +2320,7 @@ class TableComponent {
2342
2320
  pageSize: page.pageSize
2343
2321
  });
2344
2322
  });
2345
- this.subscription?.add(subs);
2323
+ this.subscription.add(subs);
2346
2324
  }
2347
2325
  // изменение сортировки
2348
2326
  if (this.sort) {
@@ -2355,14 +2333,14 @@ class TableComponent {
2355
2333
  sortDirection: sort.direction
2356
2334
  });
2357
2335
  });
2358
- this.subscription?.add(subs);
2336
+ this.subscription.add(subs);
2359
2337
  }
2360
2338
  // изменение выбранных записей
2361
2339
  if (this.selection) {
2362
2340
  const subs = this.selection.changed.subscribe(change => {
2363
2341
  this.selectionChange.emit(change.source.selected);
2364
2342
  });
2365
- this.subscription?.add(subs);
2343
+ this.subscription.add(subs);
2366
2344
  }
2367
2345
  }
2368
2346
  /** Whether the number of selected elements matches the total number of rows. */
@@ -2480,5 +2458,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
2480
2458
  * Generated bundle index. Do not edit.
2481
2459
  */
2482
2460
 
2483
- export { Action, AlertService, AnimationsService, AuthService, AvatarService, BaseEditClass, BaseFilterClass, BaseMatChipComponent, BaseNavBarMenuClass, BasePageClass, BaseSelectAutocompleteWithVirtualScrollComponent, BaseSelectWithGroupComponent, BaseServiceClass, BaseToolbarComponent, DateRangeInputComponent, DialogAction, DialogComponent, DisableIfRoleDirective, DisableIfUnauthorizedDirective, EntityAction, Environment, ExportService, HideIfRoleNotDirective, HideIfUnauthorizedDirective, LoaderService, LocalStorageService, LoginPageComponent, MY_FORMATS, NavBarComponent, NotFoundComponent, ProgressSpinnerComponent, ROUTE_ANIMATIONS_ELEMENTS, RedirectGuard, RoleService, SafePipe, SecUser, TableComponent, TimePipe, TruncatePipe, User, UserService, authGuard, dateFormat, isRouteAnimationsAll, isRouteAnimationsElements, isRouteAnimationsNone, isRouteAnimationsPage, roleGuard, routeAnimations };
2461
+ export { Action, AlertService, AnimationsService, AuthService, AvatarService, BaseEditClass, BaseFilterClass, BaseMatChipComponent, BaseNavBarMenuClass, BasePageClass, BaseSelectAutocompleteWithVsComponent, BaseSelectWithGroupComponent, BaseServiceClass, BaseToolbarComponent, DateRangeInputComponent, DialogAction, DialogComponent, DisableIfRoleDirective, DisableIfUnauthorizedDirective, EntityAction, Environment, ExportService, HideIfRoleNotDirective, HideIfUnauthorizedDirective, LoaderService, LocalStorageService, LoginPageComponent, MY_FORMATS, NavBarComponent, NotFoundComponent, ProgressSpinnerComponent, ROUTE_ANIMATIONS_ELEMENTS, RedirectGuard, RoleService, SafePipe, SecUser, TableComponent, TimePipe, TruncatePipe, User, UserService, authGuard, dateFormat, isRouteAnimationsAll, isRouteAnimationsElements, isRouteAnimationsNone, isRouteAnimationsPage, roleGuard, routeAnimations };
2484
2462
  //# sourceMappingURL=kuzntsv-uikit.mjs.map