@kuzntsv/uikit 0.0.21 → 0.0.23
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.
- package/base/base-toolbar/components/base-toolbar.component.d.ts +1 -1
- package/fesm2022/kuzntsv-uikit.mjs +38 -51
- package/fesm2022/kuzntsv-uikit.mjs.map +1 -1
- package/package.json +1 -1
- package/shared/date-range-input/date-range-input.component.d.ts +1 -1
- package/shared/select-autocomplete-with-vs/select-autocomplete-with-vs.component.d.ts +1 -1
|
@@ -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
|
|
51
|
+
subscription: Subscription;
|
|
52
52
|
constructor();
|
|
53
53
|
ngOnDestroy(): void;
|
|
54
54
|
isShow(roles: string[]): boolean;
|
|
@@ -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
|
|
2
|
+
import { EventEmitter, HostListener, Output, ViewChild, Component, Input, Injectable, ChangeDetectionStrategy, Directive, inject, Inject, Pipe, input, output, effect } 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';
|
|
@@ -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
|
-
|
|
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();
|
|
@@ -1793,9 +1791,8 @@ class BaseMatChipComponent {
|
|
|
1793
1791
|
selectedItems = [];
|
|
1794
1792
|
// Все элементы
|
|
1795
1793
|
items = [];
|
|
1796
|
-
subscription;
|
|
1794
|
+
subscription = new Subscription();
|
|
1797
1795
|
constructor() {
|
|
1798
|
-
this.subscription = new Subscription();
|
|
1799
1796
|
}
|
|
1800
1797
|
ngOnInit() {
|
|
1801
1798
|
const subs = this.items$.subscribe(data => {
|
|
@@ -1893,7 +1890,7 @@ class DateRangeInputComponent {
|
|
|
1893
1890
|
required = input(false);
|
|
1894
1891
|
dateRangeChange = output();
|
|
1895
1892
|
form;
|
|
1896
|
-
subscription;
|
|
1893
|
+
subscription = new Subscription();
|
|
1897
1894
|
constructor() {
|
|
1898
1895
|
this.form = new FormGroup({
|
|
1899
1896
|
begin: new FormControl(),
|
|
@@ -1977,7 +1974,7 @@ class NavBarComponent {
|
|
|
1977
1974
|
roles$;
|
|
1978
1975
|
fioUser = '';
|
|
1979
1976
|
photoURL = '';
|
|
1980
|
-
subscription;
|
|
1977
|
+
subscription = new Subscription();
|
|
1981
1978
|
constructor(authService, userService, avatarService, dialog, router) {
|
|
1982
1979
|
this.authService = authService;
|
|
1983
1980
|
this.avatarService = avatarService;
|
|
@@ -1986,7 +1983,7 @@ class NavBarComponent {
|
|
|
1986
1983
|
this.loggedIn$ = this.authService.loggedIn$;
|
|
1987
1984
|
this.roles$ = this.authService.roles$;
|
|
1988
1985
|
this.fioUser = '';
|
|
1989
|
-
|
|
1986
|
+
const subs = this.loggedIn$.subscribe({
|
|
1990
1987
|
next: (value) => {
|
|
1991
1988
|
if (value) {
|
|
1992
1989
|
if (userService.userData) {
|
|
@@ -2008,6 +2005,7 @@ class NavBarComponent {
|
|
|
2008
2005
|
}
|
|
2009
2006
|
}
|
|
2010
2007
|
});
|
|
2008
|
+
this.subscription.add(subs);
|
|
2011
2009
|
}
|
|
2012
2010
|
ngOnDestroy() {
|
|
2013
2011
|
if (this.subscription)
|
|
@@ -2076,29 +2074,22 @@ class BaseSelectAutocompleteWithVsComponent {
|
|
|
2076
2074
|
// input элемент
|
|
2077
2075
|
inputCtrl = new FormControl();
|
|
2078
2076
|
// отфильтрованные (отображаемые) элементы
|
|
2079
|
-
filteredItems =
|
|
2080
|
-
subscription;
|
|
2077
|
+
filteredItems = [];
|
|
2078
|
+
subscription = new Subscription();
|
|
2081
2079
|
constructor() {
|
|
2082
|
-
this.subscription = new Subscription();
|
|
2083
|
-
effect(() => {
|
|
2084
|
-
this.inputCtrl.setValue(this.selectedItem());
|
|
2085
|
-
});
|
|
2086
2080
|
effect(() => {
|
|
2087
|
-
console.log('
|
|
2088
|
-
console.log('onLoad: this.selectedItem$.value =', this.selectedItem());
|
|
2089
|
-
this.filteredItems.set(this.items());
|
|
2081
|
+
console.log('selectedItem =', this.selectedItem());
|
|
2090
2082
|
if (this.selectedItem())
|
|
2091
2083
|
this.inputCtrl.setValue(this.selectedItem());
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
// );
|
|
2084
|
+
});
|
|
2085
|
+
effect(() => {
|
|
2086
|
+
console.log('ITEMS =', this.items());
|
|
2087
|
+
this.filteredItems = this.items();
|
|
2097
2088
|
});
|
|
2098
2089
|
}
|
|
2099
2090
|
ngOnInit() {
|
|
2100
2091
|
// Listen for changes to the input
|
|
2101
|
-
const
|
|
2092
|
+
const subs = this.inputCtrl.valueChanges
|
|
2102
2093
|
.pipe(startWith$1(''),
|
|
2103
2094
|
// eslint-disable-next-line no-magic-numbers
|
|
2104
2095
|
debounceTime(500), distinctUntilChanged(),
|
|
@@ -2110,42 +2101,40 @@ class BaseSelectAutocompleteWithVsComponent {
|
|
|
2110
2101
|
map((value) => {
|
|
2111
2102
|
// Filter the options
|
|
2112
2103
|
if (typeof value === 'undefined') {
|
|
2113
|
-
this.filteredItems
|
|
2104
|
+
this.filteredItems = this.items();
|
|
2114
2105
|
}
|
|
2115
2106
|
else {
|
|
2116
2107
|
if (typeof value !== 'object') {
|
|
2117
2108
|
console.log('v1=', value);
|
|
2118
|
-
this.filteredItems
|
|
2119
|
-
.toLowerCase()
|
|
2120
|
-
.includes(value.toLowerCase())));
|
|
2109
|
+
this.filteredItems = this.items()
|
|
2110
|
+
.filter(option => option.viewValue.toLowerCase().includes(value.toLowerCase()));
|
|
2121
2111
|
}
|
|
2122
2112
|
else {
|
|
2123
2113
|
// typeof value === 'object'
|
|
2124
2114
|
console.log('v2=', value);
|
|
2125
2115
|
if (value) {
|
|
2126
2116
|
// this.predmet = value;
|
|
2127
|
-
this.filteredItems
|
|
2128
|
-
.toLowerCase()
|
|
2129
|
-
.includes(value.viewValue.toLowerCase())));
|
|
2117
|
+
this.filteredItems = this.items()
|
|
2118
|
+
.filter((option) => option.viewValue.toLowerCase().includes(value.viewValue.toLowerCase()));
|
|
2130
2119
|
}
|
|
2131
2120
|
else {
|
|
2132
|
-
this.filteredItems
|
|
2121
|
+
this.filteredItems = this.items();
|
|
2133
2122
|
}
|
|
2134
2123
|
}
|
|
2135
2124
|
}
|
|
2136
2125
|
// Recompute how big the viewport should be.
|
|
2137
2126
|
// eslint-disable-next-line no-magic-numbers
|
|
2138
|
-
if (this.filteredItems
|
|
2127
|
+
if (this.filteredItems.length < 4) {
|
|
2139
2128
|
// eslint-disable-next-line no-magic-numbers
|
|
2140
|
-
this.height = this.filteredItems
|
|
2129
|
+
this.height = this.filteredItems.length * 50 + 'px';
|
|
2141
2130
|
}
|
|
2142
2131
|
else {
|
|
2143
2132
|
this.height = '200px';
|
|
2144
2133
|
}
|
|
2145
|
-
console.log('update filteredItems$.value=', this.filteredItems
|
|
2134
|
+
console.log('update filteredItems$.value=', this.filteredItems);
|
|
2146
2135
|
}))
|
|
2147
2136
|
.subscribe();
|
|
2148
|
-
this.subscription.add(
|
|
2137
|
+
this.subscription.add(subs);
|
|
2149
2138
|
if (this.isDisabled()) {
|
|
2150
2139
|
this.inputCtrl.disable();
|
|
2151
2140
|
}
|
|
@@ -2164,20 +2153,18 @@ class BaseSelectAutocompleteWithVsComponent {
|
|
|
2164
2153
|
}
|
|
2165
2154
|
onClearClick($event) {
|
|
2166
2155
|
$event.stopPropagation();
|
|
2167
|
-
this.inputCtrl.setValue(
|
|
2156
|
+
this.inputCtrl.setValue('');
|
|
2168
2157
|
}
|
|
2169
2158
|
displayWithFn(lookup) {
|
|
2170
|
-
return lookup
|
|
2171
|
-
? lookup.viewValue
|
|
2172
|
-
: null;
|
|
2159
|
+
return lookup ? lookup.viewValue : null;
|
|
2173
2160
|
}
|
|
2174
2161
|
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
|
|
2162
|
+
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" }] });
|
|
2176
2163
|
}
|
|
2177
2164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseSelectAutocompleteWithVsComponent, decorators: [{
|
|
2178
2165
|
type: Component,
|
|
2179
2166
|
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
|
|
2167
|
+
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
2168
|
}], ctorParameters: () => [] });
|
|
2182
2169
|
|
|
2183
2170
|
class BaseSelectWithGroupComponent {
|
|
@@ -2191,9 +2178,8 @@ class BaseSelectWithGroupComponent {
|
|
|
2191
2178
|
selectedItemsChange = new EventEmitter();
|
|
2192
2179
|
separatorKeysCodes = [ENTER, COMMA];
|
|
2193
2180
|
control = new FormControl([]);
|
|
2194
|
-
subscription;
|
|
2181
|
+
subscription = new Subscription();
|
|
2195
2182
|
constructor() {
|
|
2196
|
-
this.subscription = new Subscription();
|
|
2197
2183
|
}
|
|
2198
2184
|
ngOnInit() {
|
|
2199
2185
|
this.groups$.subscribe(data => {
|
|
@@ -2282,12 +2268,13 @@ class TableComponent {
|
|
|
2282
2268
|
authService = inject(AuthService);
|
|
2283
2269
|
// Разрешено ли отправлять событие rowDoubleClicked при двойном щелчке мышью.
|
|
2284
2270
|
dblClickedEventEnable = true;
|
|
2285
|
-
subscription;
|
|
2271
|
+
subscription = new Subscription();
|
|
2286
2272
|
constructor() {
|
|
2287
2273
|
// получить права пользователя
|
|
2288
|
-
|
|
2274
|
+
const subs = this.authService.roles$.subscribe((userRoles) => {
|
|
2289
2275
|
this.dblClickedEventEnable = !this.authService.isHideElement(this.rolesDblClickedEvent, userRoles);
|
|
2290
2276
|
});
|
|
2277
|
+
this.subscription.add(subs);
|
|
2291
2278
|
}
|
|
2292
2279
|
ngOnInit() {
|
|
2293
2280
|
this.displayedColumns = ['select'].concat(this.columnOptions?.filter(c => !c.hide).map((item) => item.name) || []);
|