@snabcentr/client-ui 3.8.1 → 3.8.2
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.
Potentially problematic release.
This version of @snabcentr/client-ui might be problematic. Click here for more details.
package/error-handler/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
export * from './interfaces/i-block-error';
|
2
2
|
export * from './consts/error-change-handler.providers';
|
3
|
-
export * from './error-block-status/error-block-status.component';
|
4
3
|
export * from './sc-error-handler.component';
|
4
|
+
export * from './error-block-status/error-block-status.component';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export * from './interfaces/i-block-error';
|
2
2
|
export * from './consts/error-change-handler.providers';
|
3
|
-
export * from './error-block-status/error-block-status.component';
|
4
3
|
export * from './sc-error-handler.component';
|
5
|
-
|
4
|
+
export * from './error-block-status/error-block-status.component';
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9jbGllbnQtdWkvZXJyb3ItaGFuZGxlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMseUNBQXlDLENBQUM7QUFDeEQsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLG1EQUFtRCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9pbnRlcmZhY2VzL2ktYmxvY2stZXJyb3InO1xuZXhwb3J0ICogZnJvbSAnLi9jb25zdHMvZXJyb3ItY2hhbmdlLWhhbmRsZXIucHJvdmlkZXJzJztcbmV4cG9ydCAqIGZyb20gJy4vc2MtZXJyb3ItaGFuZGxlci5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9lcnJvci1ibG9jay1zdGF0dXMvZXJyb3ItYmxvY2stc3RhdHVzLmNvbXBvbmVudCc7XG4iXX0=
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { EventEmitter, Component, ChangeDetectionStrategy, Inject, Input, Output, inject, DestroyRef, SkipSelf, Directive, HostBinding, ContentChild, ViewChild, NgModule, Pipe, ElementRef, HostListener, Renderer2, Optional, Injectable, ContentChildren, ChangeDetectorRef, signal,
|
2
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, Inject, Input, Output, inject, DestroyRef, SkipSelf, Directive, HostBinding, ContentChild, ViewChild, NgModule, Pipe, ElementRef, HostListener, Renderer2, Optional, Injectable, ContentChildren, ChangeDetectorRef, signal, computed, output, effect, input, forwardRef, InjectionToken } from '@angular/core';
|
3
3
|
import * as i1 from '@snabcentr/client-core';
|
4
4
|
import { ScUserMetrikaGoalsEnum, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScOpfList, ScPhoneService, ScUserMetrikaService, ScAuthService, SC_URLS, SC_PATH_IMAGE_NOT_FOUND, SEARCH_TERM, ScUnitsHelper, ScImageHelper, IS_RUNNING_ON_TERMINAL, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScSamplesService, ScUserService } from '@snabcentr/client-core';
|
5
5
|
import * as i6$1 from 'rxjs';
|
@@ -28,7 +28,7 @@ import * as i1$2 from '@taiga-ui/cdk/directives/item';
|
|
28
28
|
import * as i3$2 from '@ng-web-apis/intersection-observer';
|
29
29
|
import { IntersectionObserverService, WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
|
30
30
|
import * as i2$3 from '@angular/router';
|
31
|
-
import { RouterModule, ActivatedRoute, Router, NavigationEnd
|
31
|
+
import { RouterModule, ActivatedRoute, RouterLink, Router, NavigationEnd } from '@angular/router';
|
32
32
|
import * as i9 from '@taiga-ui/addon-commerce';
|
33
33
|
import { TuiCurrencyPipe } from '@taiga-ui/addon-commerce';
|
34
34
|
import * as i2$4 from 'angularx-qrcode';
|
@@ -4416,58 +4416,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
4416
4416
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
4417
4417
|
const SC_ERROR_CHANGE_HANDLER = tuiCreateTokenFromFactory(() => () => noop);
|
4418
4418
|
|
4419
|
-
/**
|
4420
|
-
* Компонент для управления кодом ошибки отображаемой на странице.
|
4421
|
-
*/
|
4422
|
-
class ScErrorHandlerComponent {
|
4423
|
-
/**
|
4424
|
-
* Инициирует экземпляр класса {@link ErrorHandlerComponent}.
|
4425
|
-
*/
|
4426
|
-
constructor() {
|
4427
|
-
/**
|
4428
|
-
* Сигнал для хранения кода ошибки.
|
4429
|
-
*/
|
4430
|
-
this.code = signal(null);
|
4431
|
-
/**
|
4432
|
-
* Сигнал дефолтного передаваемого из вне значения ошибки.
|
4433
|
-
*/
|
4434
|
-
// eslint-disable-next-line @angular-eslint/no-input-rename
|
4435
|
-
this.defaultCode = input(null, { alias: 'code' });
|
4436
|
-
/**
|
4437
|
-
* Сервис маршрутизации.
|
4438
|
-
*/
|
4439
|
-
this.router = inject(Router);
|
4440
|
-
/**
|
4441
|
-
* Обработчик изменения ошибки.
|
4442
|
-
*/
|
4443
|
-
this.errorChangeHandler = inject(SC_ERROR_CHANGE_HANDLER);
|
4444
|
-
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
|
4445
|
-
// Сбрасываем ошибку при переходе на новый маршрут.
|
4446
|
-
this.code.set(this.defaultCode());
|
4447
|
-
});
|
4448
|
-
}
|
4449
|
-
/**
|
4450
|
-
* Возвращает текущий сигнал с кодом ошибки.
|
4451
|
-
*/
|
4452
|
-
getErrorCode() {
|
4453
|
-
return this.code;
|
4454
|
-
}
|
4455
|
-
/**
|
4456
|
-
* Устанавливает новый код ошибки.
|
4457
|
-
*
|
4458
|
-
* @param code Новый код ошибки.
|
4459
|
-
*/
|
4460
|
-
setErrorCode(code) {
|
4461
|
-
this.code.set(code);
|
4462
|
-
}
|
4463
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ScErrorHandlerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4464
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: ScErrorHandlerComponent, isStandalone: true, selector: "sc-error-handler", inputs: { defaultCode: { classPropertyName: "defaultCode", publicName: "code", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (code() === null) {\n <ng-content />\n} @else {\n <sc-error-block-status (pageErrorChange)=\"errorChangeHandler($event)\"></sc-error-block-status>\n}\n", dependencies: [{ kind: "component", type: ScErrorBlockStatusComponent, selector: "sc-error-block-status", outputs: ["pageErrorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
4465
|
-
}
|
4466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ScErrorHandlerComponent, decorators: [{
|
4467
|
-
type: Component,
|
4468
|
-
args: [{ standalone: true, selector: 'sc-error-handler', imports: [ScErrorBlockStatusComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (code() === null) {\n <ng-content />\n} @else {\n <sc-error-block-status (pageErrorChange)=\"errorChangeHandler($event)\"></sc-error-block-status>\n}\n" }]
|
4469
|
-
}], ctorParameters: () => [] });
|
4470
|
-
|
4471
4419
|
/**
|
4472
4420
|
* Компонент представления данных об ошибке.
|
4473
4421
|
*/
|
@@ -4539,6 +4487,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
4539
4487
|
args: [{ standalone: true, selector: 'sc-error-block-status', imports: [TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TuiButton, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col items-center gap-8\">\n <div class=\"border-20 border-solid border-tui-primary text-center sm:border-32\">\n <div class=\"text-8xl leading-1.15 text-black sm:text-44\">\n {{ error().code }}\n </div>\n <div class=\"text-6xl leading-1.15 text-tui-primary sm:text-8xl\">ERROR</div>\n </div>\n <div class=\"flex flex-col gap-2 text-center\">\n <div class=\"text-h5 sm:text-h4\">{{ error().message }}</div>\n <div class=\"text-body-m-bold sm:text-h6\">{{ error().description }}</div>\n </div>\n <button\n tuiButton\n appearance=\"primary\"\n routerLink=\"/\"\n >\n \u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E\n </button>\n</div>\n" }]
|
4540
4488
|
}], ctorParameters: () => [] });
|
4541
4489
|
|
4490
|
+
/**
|
4491
|
+
* Компонент для управления кодом ошибки отображаемой на странице.
|
4492
|
+
*/
|
4493
|
+
class ScErrorHandlerComponent {
|
4494
|
+
/**
|
4495
|
+
* Инициирует экземпляр класса {@link ErrorHandlerComponent}.
|
4496
|
+
*/
|
4497
|
+
constructor() {
|
4498
|
+
/**
|
4499
|
+
* Сигнал для хранения кода ошибки.
|
4500
|
+
*/
|
4501
|
+
this.code = signal(null);
|
4502
|
+
/**
|
4503
|
+
* Сигнал дефолтного передаваемого из вне значения ошибки.
|
4504
|
+
*/
|
4505
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
4506
|
+
this.defaultCode = input(null, { alias: 'code' });
|
4507
|
+
/**
|
4508
|
+
* Сервис маршрутизации.
|
4509
|
+
*/
|
4510
|
+
this.router = inject(Router);
|
4511
|
+
/**
|
4512
|
+
* Обработчик изменения ошибки.
|
4513
|
+
*/
|
4514
|
+
this.errorChangeHandler = inject(SC_ERROR_CHANGE_HANDLER);
|
4515
|
+
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
|
4516
|
+
// Сбрасываем ошибку при переходе на новый маршрут.
|
4517
|
+
this.code.set(this.defaultCode());
|
4518
|
+
});
|
4519
|
+
}
|
4520
|
+
/**
|
4521
|
+
* Возвращает текущий сигнал с кодом ошибки.
|
4522
|
+
*/
|
4523
|
+
getErrorCode() {
|
4524
|
+
return this.code;
|
4525
|
+
}
|
4526
|
+
/**
|
4527
|
+
* Устанавливает новый код ошибки.
|
4528
|
+
*
|
4529
|
+
* @param code Новый код ошибки.
|
4530
|
+
*/
|
4531
|
+
setErrorCode(code) {
|
4532
|
+
this.code.set(code);
|
4533
|
+
}
|
4534
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ScErrorHandlerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4535
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: ScErrorHandlerComponent, isStandalone: true, selector: "sc-error-handler", inputs: { defaultCode: { classPropertyName: "defaultCode", publicName: "code", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (code() === null) {\n <ng-content />\n} @else {\n <sc-error-block-status (pageErrorChange)=\"errorChangeHandler($event)\"></sc-error-block-status>\n}\n", dependencies: [{ kind: "component", type: ScErrorBlockStatusComponent, selector: "sc-error-block-status", outputs: ["pageErrorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
4536
|
+
}
|
4537
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ScErrorHandlerComponent, decorators: [{
|
4538
|
+
type: Component,
|
4539
|
+
args: [{ standalone: true, selector: 'sc-error-handler', imports: [ScErrorBlockStatusComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (code() === null) {\n <ng-content />\n} @else {\n <sc-error-block-status (pageErrorChange)=\"errorChangeHandler($event)\"></sc-error-block-status>\n}\n" }]
|
4540
|
+
}], ctorParameters: () => [] });
|
4541
|
+
|
4542
4542
|
/* eslint-disable class-methods-use-this */
|
4543
4543
|
/**
|
4544
4544
|
* Сервис работающий с значками элементов дерева.
|