@kuzntsv/uikit 0.0.20 → 0.0.21

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, HostListener, Output, ViewChild, Component, Input, Injectable, ChangeDetectionStrategy, Directive, inject, Inject, Pipe, input, output, effect } from '@angular/core';
2
+ import { EventEmitter, HostListener, Output, ViewChild, Component, Input, Injectable, ChangeDetectionStrategy, Directive, inject, Inject, Pipe, input, output, effect, signal } from '@angular/core';
3
3
  import { MatCard, MatCardHeader, MatCardTitle, MatCardContent } from '@angular/material/card';
4
4
  import * as i1 from '@angular/forms';
5
5
  import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -1359,17 +1359,17 @@ class BasePageClass {
1359
1359
  this.alertService?.error('Произошла ошибка при добавлении записи: ' + error, 0);
1360
1360
  }
1361
1361
  });
1362
- this.subscription?.add(subs);
1362
+ this.subscription.add(subs);
1363
1363
  }
1364
1364
  });
1365
- this.subscription?.add(subs);
1365
+ this.subscription.add(subs);
1366
1366
  // Закрытие окна по нажатию Escape
1367
1367
  const subs2 = dialogRef.keydownEvents().subscribe((event) => {
1368
1368
  if (event.key === 'Escape') {
1369
1369
  dialogRef.close(null);
1370
1370
  }
1371
1371
  });
1372
- this.subscription?.add(subs2);
1372
+ this.subscription.add(subs2);
1373
1373
  }
1374
1374
  else {
1375
1375
  this.alertService?.warning('Действие не доступно.');
@@ -1414,17 +1414,17 @@ class BasePageClass {
1414
1414
  this.alertService?.error('Произошла ошибка при изменении записи: ' + error, 0);
1415
1415
  }
1416
1416
  });
1417
- this.subscription?.add(subs);
1417
+ this.subscription.add(subs);
1418
1418
  }
1419
1419
  });
1420
- this.subscription?.add(subs);
1420
+ this.subscription.add(subs);
1421
1421
  // Закрытие окна по нажатию Escape
1422
1422
  const subs2 = dialogRef.keydownEvents().subscribe((event) => {
1423
1423
  if (event.key === 'Escape') {
1424
1424
  dialogRef.close(null);
1425
1425
  }
1426
1426
  });
1427
- this.subscription?.add(subs2);
1427
+ this.subscription.add(subs2);
1428
1428
  }
1429
1429
  else {
1430
1430
  this.alertService?.warning('Действие не доступно.');
@@ -1454,17 +1454,17 @@ class BasePageClass {
1454
1454
  this.alertService?.error('Произошла ошибка при удалении записи: ' + error, 0);
1455
1455
  }
1456
1456
  });
1457
- this.subscription?.add(subs);
1457
+ this.subscription.add(subs);
1458
1458
  }
1459
1459
  });
1460
- this.subscription?.add(subs);
1460
+ this.subscription.add(subs);
1461
1461
  // Закрытие окна по нажатию Escape
1462
1462
  const subs2 = dialogRef.keydownEvents().subscribe((event) => {
1463
1463
  if (event.key === 'Escape') {
1464
1464
  dialogRef.close(null);
1465
1465
  }
1466
1466
  });
1467
- this.subscription?.add(subs2);
1467
+ this.subscription.add(subs2);
1468
1468
  }
1469
1469
  }
1470
1470
  }
@@ -1795,21 +1795,23 @@ class BaseMatChipComponent {
1795
1795
  items = [];
1796
1796
  subscription;
1797
1797
  constructor() {
1798
+ this.subscription = new Subscription();
1798
1799
  }
1799
1800
  ngOnInit() {
1800
- this.subscription = this.items$.subscribe(data => {
1801
+ const subs = this.items$.subscribe(data => {
1801
1802
  // console.log('ITEMS$ data', data);
1802
1803
  this.items = data;
1803
1804
  if (this.items.length > 0) {
1804
1805
  this.filteredItems$ = this.inputCtrl.valueChanges.pipe(startWith(null), map(item => (item ? this._filter(item) : this.items.slice())));
1805
- const subs = this.selectedItems$.subscribe(items => {
1806
+ const subs2 = this.selectedItems$.subscribe(items => {
1806
1807
  // console.log('ITEMS', items);
1807
1808
  if (items)
1808
1809
  this.selectedItems = this.items.filter(s => items.includes(s.value));
1809
1810
  });
1810
- this.subscription?.add(subs);
1811
+ this.subscription.add(subs2);
1811
1812
  }
1812
1813
  });
1814
+ this.subscription.add(subs);
1813
1815
  }
1814
1816
  ngOnDestroy() {
1815
1817
  if (this.subscription)
@@ -1993,14 +1995,14 @@ class NavBarComponent {
1993
1995
  }
1994
1996
  if (userService.userData.idHuman) {
1995
1997
  // Аватар сотрудника.
1996
- const subs = this.avatarService.getAvatarById(Number(userService.userData.idHuman))
1998
+ const subs2 = this.avatarService.getAvatarById(Number(userService.userData.idHuman))
1997
1999
  .subscribe((image) => {
1998
2000
  if (image) {
1999
2001
  const blob = new Blob([image], { "type": "image/jpeg" });
2000
2002
  this.photoURL = URL.createObjectURL(blob);
2001
2003
  }
2002
2004
  });
2003
- this.subscription?.add(subs);
2005
+ this.subscription.add(subs2);
2004
2006
  }
2005
2007
  }
2006
2008
  }
@@ -2030,7 +2032,7 @@ class NavBarComponent {
2030
2032
  this.logout();
2031
2033
  }
2032
2034
  });
2033
- this.subscription?.add(subs);
2035
+ this.subscription.add(subs);
2034
2036
  }
2035
2037
  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
2038
  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 +2054,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
2052
2054
  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
2055
  }], ctorParameters: () => [] });
2054
2056
 
2055
- class BaseSelectAutocompleteWithVirtualScrollComponent {
2057
+ class BaseSelectAutocompleteWithVsComponent {
2056
2058
  // https://stackblitz.com/edit/autocomplete-with-virtual-scroll-dc9u2g
2057
2059
  // Все элементы
2058
- items$ = new BehaviorSubject([]);
2060
+ items = input([]);
2059
2061
  // Выбранный элемент
2060
- selectedItem$ = new BehaviorSubject(undefined);
2062
+ selectedItem = input(undefined);
2061
2063
  // Заголовок
2062
- title = '';
2064
+ title = input('');
2063
2065
  // Видимость
2064
- isVisible = true;
2066
+ isVisible = input(true);
2065
2067
  // Обязательность
2066
- isRequired = false;
2068
+ isRequired = input(false);
2067
2069
  // Доступность
2068
- isDisabled = false;
2070
+ isDisabled = input(false);
2069
2071
  // Доступность
2070
- width = '200';
2072
+ width = input('200');
2071
2073
  // Событие изменения выбранного элемента
2072
- selectedItemChange = new EventEmitter();
2074
+ selectedItemChange = output();
2073
2075
  height = '200px';
2074
2076
  // input элемент
2075
2077
  inputCtrl = new FormControl();
2076
2078
  // отфильтрованные (отображаемые) элементы
2077
- filteredItems$ = new BehaviorSubject([]);
2079
+ filteredItems = signal([]);
2078
2080
  subscription;
2079
2081
  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);
2082
+ this.subscription = new Subscription();
2083
+ effect(() => {
2084
+ this.inputCtrl.setValue(this.selectedItem());
2085
+ });
2086
+ effect(() => {
2087
+ console.log('ITEMS$ data', this.items());
2088
+ console.log('onLoad: this.selectedItem$.value =', this.selectedItem());
2089
+ this.filteredItems.set(this.items());
2090
+ if (this.selectedItem())
2091
+ this.inputCtrl.setValue(this.selectedItem());
2090
2092
  // if (this.items.length > 0) {
2091
2093
  // this.filteredItems$ = this.inputCtrl.valueChanges.pipe(
2092
2094
  // startWith(null),
2093
2095
  // map(item => (item ? this._filter(item) : this.items.slice())),
2094
2096
  // );
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
2097
  });
2098
+ }
2099
+ ngOnInit() {
2103
2100
  // Listen for changes to the input
2104
- const subs = this.inputCtrl.valueChanges
2101
+ const subs3 = this.inputCtrl.valueChanges
2105
2102
  .pipe(startWith$1(''),
2106
2103
  // eslint-disable-next-line no-magic-numbers
2107
2104
  debounceTime(500), distinctUntilChanged(),
@@ -2113,12 +2110,12 @@ class BaseSelectAutocompleteWithVirtualScrollComponent {
2113
2110
  map((value) => {
2114
2111
  // Filter the options
2115
2112
  if (typeof value === 'undefined') {
2116
- this.filteredItems$.next(this.items$.value);
2113
+ this.filteredItems.set(this.items());
2117
2114
  }
2118
2115
  else {
2119
2116
  if (typeof value !== 'object') {
2120
2117
  console.log('v1=', value);
2121
- this.filteredItems$.next(this.items$.value.filter(option => option.viewValue
2118
+ this.filteredItems.set(this.items().filter(option => option.viewValue
2122
2119
  .toLowerCase()
2123
2120
  .includes(value.toLowerCase())));
2124
2121
  }
@@ -2127,29 +2124,29 @@ class BaseSelectAutocompleteWithVirtualScrollComponent {
2127
2124
  console.log('v2=', value);
2128
2125
  if (value) {
2129
2126
  // this.predmet = value;
2130
- this.filteredItems$.next(this.items$.value.filter((option) => (option.viewValue)
2127
+ this.filteredItems.set(this.items().filter((option) => (option.viewValue)
2131
2128
  .toLowerCase()
2132
2129
  .includes(value.viewValue.toLowerCase())));
2133
2130
  }
2134
2131
  else {
2135
- this.filteredItems$.next(this.items$.value);
2132
+ this.filteredItems.set(this.items());
2136
2133
  }
2137
2134
  }
2138
2135
  }
2139
2136
  // Recompute how big the viewport should be.
2140
2137
  // eslint-disable-next-line no-magic-numbers
2141
- if (this.filteredItems$.value.length < 4) {
2138
+ if (this.filteredItems().length < 4) {
2142
2139
  // eslint-disable-next-line no-magic-numbers
2143
- this.height = this.filteredItems$.value.length * 50 + 'px';
2140
+ this.height = this.filteredItems().length * 50 + 'px';
2144
2141
  }
2145
2142
  else {
2146
2143
  this.height = '200px';
2147
2144
  }
2148
- console.log('update filteredItems$.value=', this.filteredItems$.value);
2145
+ console.log('update filteredItems$.value=', this.filteredItems());
2149
2146
  }))
2150
2147
  .subscribe();
2151
- this.subscription?.add(subs);
2152
- if (this.isDisabled) {
2148
+ this.subscription.add(subs3);
2149
+ if (this.isDisabled()) {
2153
2150
  this.inputCtrl.disable();
2154
2151
  }
2155
2152
  else {
@@ -2174,30 +2171,14 @@ class BaseSelectAutocompleteWithVirtualScrollComponent {
2174
2171
  ? lookup.viewValue
2175
2172
  : null;
2176
2173
  }
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" }] });
2174
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2175
+ 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
2176
  }
2180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVirtualScrollComponent, decorators: [{
2177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVsComponent, decorators: [{
2181
2178
  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
- }] } });
2179
+ args: [{ selector: 'ngx-uik-select-autocomplete-with-vs', imports: [FormsModule, ReactiveFormsModule, MatAutocompleteModule, MatHint, MatError, MatOption, MatIcon,
2180
+ 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"] }]
2181
+ }], ctorParameters: () => [] });
2201
2182
 
2202
2183
  class BaseSelectWithGroupComponent {
2203
2184
  // Все группы
@@ -2212,13 +2193,15 @@ class BaseSelectWithGroupComponent {
2212
2193
  control = new FormControl([]);
2213
2194
  subscription;
2214
2195
  constructor() {
2196
+ this.subscription = new Subscription();
2215
2197
  }
2216
2198
  ngOnInit() {
2217
2199
  this.groups$.subscribe(data => {
2218
2200
  if (data.length > 0) {
2219
- this.subscription = this.selectedItems$.subscribe(items => {
2201
+ const subs = this.selectedItems$.subscribe(items => {
2220
2202
  this.control.setValue(items.map(i => Number(i)));
2221
2203
  });
2204
+ this.subscription.add(subs);
2222
2205
  }
2223
2206
  });
2224
2207
  }
@@ -2317,7 +2300,7 @@ class TableComponent {
2317
2300
  this.selection.select(d);
2318
2301
  });
2319
2302
  });
2320
- this.subscription?.add(subs);
2303
+ this.subscription.add(subs);
2321
2304
  // пересоздаем, т.к. параметр allowMultiSelect появляется только сейчас
2322
2305
  this.selection = new SelectionModel(this.allowMultiSelect);
2323
2306
  }
@@ -2342,7 +2325,7 @@ class TableComponent {
2342
2325
  pageSize: page.pageSize
2343
2326
  });
2344
2327
  });
2345
- this.subscription?.add(subs);
2328
+ this.subscription.add(subs);
2346
2329
  }
2347
2330
  // изменение сортировки
2348
2331
  if (this.sort) {
@@ -2355,14 +2338,14 @@ class TableComponent {
2355
2338
  sortDirection: sort.direction
2356
2339
  });
2357
2340
  });
2358
- this.subscription?.add(subs);
2341
+ this.subscription.add(subs);
2359
2342
  }
2360
2343
  // изменение выбранных записей
2361
2344
  if (this.selection) {
2362
2345
  const subs = this.selection.changed.subscribe(change => {
2363
2346
  this.selectionChange.emit(change.source.selected);
2364
2347
  });
2365
- this.subscription?.add(subs);
2348
+ this.subscription.add(subs);
2366
2349
  }
2367
2350
  }
2368
2351
  /** Whether the number of selected elements matches the total number of rows. */
@@ -2480,5 +2463,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
2480
2463
  * Generated bundle index. Do not edit.
2481
2464
  */
2482
2465
 
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 };
2466
+ 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
2467
  //# sourceMappingURL=kuzntsv-uikit.mjs.map