@snabcentr/client-ui 4.14.7 → 4.14.8
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/auth/sign-up-form/sc-sign-up-form.component.d.ts +6 -0
- package/contragents/new-contragent-form/sc-new-contragent-form.component.d.ts +4 -0
- package/contragents/sc-contragents.module.d.ts +4 -3
- package/delivery-address/add-delivery-address-dialog/sc-add-delivery-address-dialog.component.d.ts +13 -0
- package/directives/address-quality/sc-address-quality.directive.d.ts +23 -0
- package/directives/address-quality/sc-address-quality.service.d.ts +122 -0
- package/directives/address-quality/sc-i-address-quality-state.d.ts +14 -0
- package/directives/index.d.ts +2 -0
- package/esm2022/auth/sc-simple-sign-up-form/sc-simple-sign-up-form.component.mjs +1 -1
- package/esm2022/auth/sign-up-form/sc-sign-up-form.component.mjs +14 -4
- package/esm2022/catalog/notify-when-in-stock-dialog/sc-notify-when-in-stock-dialog.component.mjs +2 -2
- package/esm2022/contacts/new-contact-form/sc-new-contact-form.component.mjs +1 -1
- package/esm2022/contragents/new-contragent-bank-account-form/sc-new-contragent-bank-account-form.component.mjs +1 -1
- package/esm2022/contragents/new-contragent-form/sc-new-contragent-form.component.mjs +26 -20
- package/esm2022/contragents/sc-contragents.module.mjs +4 -1
- package/esm2022/delivery-address/add-delivery-address-dialog/sc-add-delivery-address-dialog.component.mjs +25 -4
- package/esm2022/directives/address-quality/sc-address-quality.directive.mjs +40 -0
- package/esm2022/directives/address-quality/sc-address-quality.service.mjs +214 -0
- package/esm2022/directives/address-quality/sc-i-address-quality-state.mjs +2 -0
- package/esm2022/directives/index.mjs +3 -1
- package/esm2022/feedback/feedback-form/sc-feedback-form.component.mjs +11 -21
- package/esm2022/form-fields/addresses-selection-field/sc-addresses-selection-field.component.mjs +4 -5
- package/esm2022/form-fields/suggestion-field/sc-suggestion-field.component.mjs +76 -16
- package/esm2022/order/draft/sc-draft.component.mjs +12 -15
- package/esm2022/order/index.mjs +3 -4
- package/esm2022/order/new-order-items/sc-new-order-items.component.mjs +39 -0
- package/esm2022/order/order-form/sc-order-form.component.mjs +6 -18
- package/esm2022/order/order-items-list/sc-order-items-list.component.mjs +3 -4
- package/esm2022/order/order-items-list-with-actions/sc-order-items-list-with-actions.component.mjs +53 -0
- package/esm2022/providers/index.mjs +2 -2
- package/esm2022/providers/sc-block-incomplete-address.mjs +8 -0
- package/esm2022/public-api.mjs +2 -1
- package/esm2022/samples/sc-sample.module.mjs +3 -10
- package/esm2022/services/index.mjs +2 -1
- package/esm2022/services/sc-scripts.service.mjs +106 -0
- package/esm2022/smart-captcha/index.mjs +5 -0
- package/esm2022/smart-captcha/interfaces/index.mjs +6 -0
- package/esm2022/smart-captcha/interfaces/sc-smart-captcha-api.mjs +2 -0
- package/esm2022/smart-captcha/interfaces/sc-smart-captcha-event.mjs +2 -0
- package/esm2022/smart-captcha/interfaces/sc-smart-captcha-language.mjs +2 -0
- package/esm2022/smart-captcha/interfaces/sc-smart-captcha-render-params.mjs +2 -0
- package/esm2022/smart-captcha/interfaces/sc-smart-captcha-settings.mjs +2 -0
- package/esm2022/smart-captcha/interfaces/sc-smart-captcha-window.mjs +2 -0
- package/esm2022/smart-captcha/sc-smart-captcha.component.mjs +167 -0
- package/esm2022/smart-captcha/services/index.mjs +2 -0
- package/esm2022/smart-captcha/services/sc-smart-captcha-loader.service.mjs +87 -0
- package/esm2022/smart-captcha/tokens/index.mjs +3 -0
- package/esm2022/smart-captcha/tokens/sc-smart-captcha-load-timeout.token.mjs +8 -0
- package/esm2022/smart-captcha/tokens/sc-smart-captcha-settings.token.mjs +6 -0
- package/esm2022/user/update-user-info-dialog/sc-update-user-info-dialog.component.mjs +3 -3
- package/feedback/feedback-form/sc-feedback-form.component.d.ts +1 -1
- package/fesm2022/snabcentr-client-ui.mjs +806 -215
- package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
- package/form-fields/addresses-selection-field/sc-addresses-selection-field.component.d.ts +2 -0
- package/form-fields/suggestion-field/sc-suggestion-field.component.d.ts +36 -2
- package/order/draft/sc-draft.component.d.ts +5 -8
- package/order/index.d.ts +2 -3
- package/order/{order-direction-items/sc-order-direction-items.component.d.ts → new-order-items/sc-new-order-items.component.d.ts} +5 -5
- package/order/order-form/sc-order-form.component.d.ts +2 -11
- package/order/order-items-list/sc-order-items-list.component.d.ts +0 -1
- package/order/order-items-list-with-actions/sc-order-items-list-with-actions.component.d.ts +37 -0
- package/package.json +2 -3
- package/providers/index.d.ts +1 -1
- package/providers/sc-block-incomplete-address.d.ts +5 -0
- package/public-api.d.ts +1 -0
- package/release_notes.tmp +1 -1
- package/samples/sc-sample.module.d.ts +1 -2
- package/services/index.d.ts +1 -0
- package/services/sc-scripts.service.d.ts +51 -0
- package/smart-captcha/index.d.ts +4 -0
- package/smart-captcha/interfaces/index.d.ts +5 -0
- package/smart-captcha/interfaces/sc-smart-captcha-api.d.ts +36 -0
- package/smart-captcha/interfaces/sc-smart-captcha-event.d.ts +4 -0
- package/smart-captcha/interfaces/sc-smart-captcha-language.d.ts +4 -0
- package/smart-captcha/interfaces/sc-smart-captcha-render-params.d.ts +16 -0
- package/smart-captcha/interfaces/sc-smart-captcha-settings.d.ts +16 -0
- package/smart-captcha/interfaces/sc-smart-captcha-window.d.ts +14 -0
- package/smart-captcha/sc-smart-captcha.component.d.ts +92 -0
- package/smart-captcha/services/index.d.ts +1 -0
- package/smart-captcha/services/sc-smart-captcha-loader.service.d.ts +50 -0
- package/smart-captcha/tokens/index.d.ts +2 -0
- package/smart-captcha/tokens/sc-smart-captcha-load-timeout.token.d.ts +5 -0
- package/smart-captcha/tokens/sc-smart-captcha-settings.token.d.ts +6 -0
- package/styles/tailwind/tailwind.scss +48 -2
- package/esm2022/order/models/sc-i-cart-items-by-direction.mjs +0 -22
- package/esm2022/order/order-direction-items/sc-order-direction-items.component.mjs +0 -39
- package/esm2022/order/order-items-list-by-directions/sc-order-items-list-by-directions.component.mjs +0 -75
- package/esm2022/providers/cleanup-recaptcha-artifacts.mjs +0 -30
- package/order/models/sc-i-cart-items-by-direction.d.ts +0 -25
- package/order/order-items-list-by-directions/sc-order-items-list-by-directions.component.d.ts +0 -58
- package/providers/cleanup-recaptcha-artifacts.d.ts +0 -7
|
@@ -24,6 +24,10 @@ export declare class ScSignUpFormComponent implements OnInit {
|
|
|
24
24
|
* Сервис для сбора метрик о действиях пользователей.
|
|
25
25
|
*/
|
|
26
26
|
private readonly userMetrikaService;
|
|
27
|
+
/**
|
|
28
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
29
|
+
*/
|
|
30
|
+
private readonly addressQualityService;
|
|
27
31
|
/**
|
|
28
32
|
* Поле ввода организационно-правовых форм.
|
|
29
33
|
*/
|
|
@@ -81,6 +85,8 @@ export declare class ScSignUpFormComponent implements OnInit {
|
|
|
81
85
|
readonly steps: string[];
|
|
82
86
|
/**
|
|
83
87
|
* Инициализирует экземпляр класса {@link ScSignUpFormComponent}.
|
|
88
|
+
* Название сбрасывается только при переходе между физическим лицом и организацией: у физического лица в поле Ф.И.О.,
|
|
89
|
+
* у остальных форм название организации, поэтому прежнее значение по смыслу не подходит.
|
|
84
90
|
*/
|
|
85
91
|
constructor();
|
|
86
92
|
/**
|
|
@@ -16,6 +16,10 @@ export declare class ScNewContragentFormComponent implements OnInit, OnDestroy {
|
|
|
16
16
|
* Сервис для получения списков стран, регионов, городов.
|
|
17
17
|
*/
|
|
18
18
|
private readonly locationsService;
|
|
19
|
+
/**
|
|
20
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
21
|
+
*/
|
|
22
|
+
private readonly addressQualityService;
|
|
19
23
|
/**
|
|
20
24
|
* Директива c `FormGroup` из DOM.
|
|
21
25
|
*/
|
|
@@ -14,13 +14,14 @@ import * as i12 from "@taiga-ui/kit";
|
|
|
14
14
|
import * as i13 from "@taiga-ui/legacy";
|
|
15
15
|
import * as i14 from "@taiga-ui/core/components/data-list";
|
|
16
16
|
import * as i15 from "@maskito/angular";
|
|
17
|
-
import * as i16 from "../
|
|
18
|
-
import * as i17 from "
|
|
17
|
+
import * as i16 from "../directives/address-quality/sc-address-quality.directive";
|
|
18
|
+
import * as i17 from "../form-fields/form-fields.module";
|
|
19
|
+
import * as i18 from "@taiga-ui/cdk/directives/item";
|
|
19
20
|
/**
|
|
20
21
|
* Модуль для отображение контента разделами, с возможностью скрывать и отображать содержимое.
|
|
21
22
|
*/
|
|
22
23
|
export declare class ScContragentsModule {
|
|
23
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<ScContragentsModule, never>;
|
|
24
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ScContragentsModule, [typeof i1.ScContragentsAccordionComponent, typeof i2.ScContragentsAccordionItemComponent, typeof i3.ScNewContragentBankAccountsFormComponent, typeof i4.ScAddContragentBankAccountsDialogComponent, typeof i5.ScAddContragentDialogComponent, typeof i6.ScNewContragentFormComponent], [typeof i7.FormsModule, typeof i7.ReactiveFormsModule, typeof i8.CommonModule, typeof i9.ScAccordionModule, typeof i10.TuiButton, typeof i10.TuiLoader, typeof i10.TuiNotification, typeof i11.ScContactsModule, typeof i12.TuiFieldErrorPipe, typeof i10.TuiError, typeof i13.TuiSelectModule, typeof i10.TuiDataListComponent, typeof i10.TuiDataListDirective, typeof i10.TuiOption, typeof i10.TuiOptionNew, typeof i10.TuiOptionWithValue, typeof i10.TuiOptGroup, typeof i12.TuiDataListWrapperComponent, typeof i12.TuiDataListGroupWrapperComponent, typeof i14.TuiDataListDirective, typeof i10.TuiLabel, typeof i13.TuiInputModule, typeof i13.TuiInputPhoneModule, typeof i15.MaskitoDirective, typeof i16.ScFormFieldsModule, typeof i12.TuiElasticContainer, typeof
|
|
25
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ScContragentsModule, [typeof i1.ScContragentsAccordionComponent, typeof i2.ScContragentsAccordionItemComponent, typeof i3.ScNewContragentBankAccountsFormComponent, typeof i4.ScAddContragentBankAccountsDialogComponent, typeof i5.ScAddContragentDialogComponent, typeof i6.ScNewContragentFormComponent], [typeof i7.FormsModule, typeof i7.ReactiveFormsModule, typeof i8.CommonModule, typeof i9.ScAccordionModule, typeof i10.TuiButton, typeof i10.TuiLoader, typeof i10.TuiNotification, typeof i11.ScContactsModule, typeof i12.TuiFieldErrorPipe, typeof i10.TuiError, typeof i13.TuiSelectModule, typeof i10.TuiDataListComponent, typeof i10.TuiDataListDirective, typeof i10.TuiOption, typeof i10.TuiOptionNew, typeof i10.TuiOptionWithValue, typeof i10.TuiOptGroup, typeof i12.TuiDataListWrapperComponent, typeof i12.TuiDataListGroupWrapperComponent, typeof i14.TuiDataListDirective, typeof i10.TuiLabel, typeof i13.TuiInputModule, typeof i13.TuiInputPhoneModule, typeof i15.MaskitoDirective, typeof i16.ScAddressQualityDirective, typeof i17.ScFormFieldsModule, typeof i12.TuiElasticContainer, typeof i18.TuiItem, typeof i12.TuiCarouselComponent, typeof i12.TuiCarouselDirective, typeof i12.TuiCarouselAutoscroll, typeof i12.TuiCarouselButtons, typeof i12.TuiCarouselScroll, typeof i12.TuiButtonLoading, typeof i13.TuiComboBoxModule, typeof i12.TuiStringifyContentPipe, typeof i12.TuiFilterByInputPipe, typeof i12.TuiStepperComponent, typeof i12.TuiStep], [typeof i1.ScContragentsAccordionComponent, typeof i3.ScNewContragentBankAccountsFormComponent, typeof i4.ScAddContragentBankAccountsDialogComponent, typeof i5.ScAddContragentDialogComponent, typeof i6.ScNewContragentFormComponent]>;
|
|
25
26
|
static ɵinj: i0.ɵɵInjectorDeclaration<ScContragentsModule>;
|
|
26
27
|
}
|
package/delivery-address/add-delivery-address-dialog/sc-add-delivery-address-dialog.component.d.ts
CHANGED
|
@@ -50,6 +50,10 @@ export declare class ScAddDeliveryAddressDialogComponent implements AfterViewIni
|
|
|
50
50
|
* Список стран.
|
|
51
51
|
*/
|
|
52
52
|
protected readonly countries: readonly TuiCountryIsoCode[];
|
|
53
|
+
/**
|
|
54
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
55
|
+
*/
|
|
56
|
+
private readonly addressQualityService;
|
|
53
57
|
/**
|
|
54
58
|
* {@link Observable} запроса данных добавления адрес доставки.
|
|
55
59
|
*/
|
|
@@ -114,6 +118,15 @@ export declare class ScAddDeliveryAddressDialogComponent implements AfterViewIni
|
|
|
114
118
|
* @param suggestion Объект подсказки ареса.
|
|
115
119
|
*/
|
|
116
120
|
onSelectedAddress(suggestion: ScSuggestion): void;
|
|
121
|
+
/**
|
|
122
|
+
* Возвращает признак, что адрес введён, но вариант с координатами не выбран: под полем показывается ошибка «Выберите вариант из списка».
|
|
123
|
+
*/
|
|
124
|
+
isAddressWithoutCoordinates(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Возвращает текст предупреждения о полноте выбранного адреса доставки либо null, когда предупреждение не требуется
|
|
127
|
+
* или вместо него показана ошибка «Выберите вариант из списка».
|
|
128
|
+
*/
|
|
129
|
+
getAddressQualityWarning(): string | null;
|
|
117
130
|
/**
|
|
118
131
|
* Устанавливает {@link addressPlacemark} точку на определённые координаты.
|
|
119
132
|
*
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Директива предупреждения о качестве (полноте) адреса, выбранного из подсказок, для поля с контролом формы.
|
|
4
|
+
*
|
|
5
|
+
* Блокировку отправки формы с неполным адресом обеспечивает валидатор {@link ScAddressQualityService.validator},
|
|
6
|
+
* подключённый к контролу адреса при его создании.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ScAddressQualityDirective {
|
|
9
|
+
/**
|
|
10
|
+
* Контрол поля адреса.
|
|
11
|
+
*/
|
|
12
|
+
private readonly ngControl;
|
|
13
|
+
/**
|
|
14
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
15
|
+
*/
|
|
16
|
+
private readonly addressQualityService;
|
|
17
|
+
/**
|
|
18
|
+
* Возвращает текст предупреждения о необходимости проверить выбранный адрес либо null, когда предупреждение не требуется.
|
|
19
|
+
*/
|
|
20
|
+
getWarningMessage(): string | null;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScAddressQualityDirective, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ScAddressQualityDirective, "[scAddressQuality]", ["scAddressQuality"], {}, {}, never, never, true, never>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
|
2
|
+
import { ScISuggestionOrganization, ScSuggestionAddressQuality } from '@snabcentr/client-core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
6
|
+
*
|
|
7
|
+
* Хранит качество последнего выбранного адреса для каждого контрола. Качество полного адреса
|
|
8
|
+
* действует, пока значение контрола не изменилось после выбора: ручная правка возвращает адрес
|
|
9
|
+
* в разряд непроверяемых. Качество неполного адреса и адреса с неопределённой полнотой сохраняется
|
|
10
|
+
* и при ручной правке текста: его заменяет только выбор другой подсказки по этому полю.
|
|
11
|
+
* Полная очистка поля сбрасывает качество: адрес, введённый после неё, считается ручным.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ScAddressQualityService {
|
|
14
|
+
/**
|
|
15
|
+
* Возвращает признак, что значение поля адреса пустое без учёта пробелов.
|
|
16
|
+
*
|
|
17
|
+
* @param value Значение поля адреса.
|
|
18
|
+
*/
|
|
19
|
+
private static isEmptyAddress;
|
|
20
|
+
/**
|
|
21
|
+
* Валидатор, запрещающий отправку формы с неполным адресом, пока блокировка включена токеном {@link SC_BLOCK_INCOMPLETE_ADDRESS}.
|
|
22
|
+
* Подключается к контролу адреса при его создании; директива качества адреса только показывает предупреждение.
|
|
23
|
+
*
|
|
24
|
+
* @param control Контрол адреса.
|
|
25
|
+
*/
|
|
26
|
+
readonly validator: ValidatorFn;
|
|
27
|
+
/**
|
|
28
|
+
* Признак, что отправка форм с неполным адресом заблокирована.
|
|
29
|
+
*/
|
|
30
|
+
private readonly blockIncompleteAddress;
|
|
31
|
+
/**
|
|
32
|
+
* Ошибка валидации неполного адреса.
|
|
33
|
+
*/
|
|
34
|
+
private readonly incompleteAddressError;
|
|
35
|
+
/**
|
|
36
|
+
* Реестр состояний качества по контролам адресов.
|
|
37
|
+
*/
|
|
38
|
+
private readonly states;
|
|
39
|
+
/**
|
|
40
|
+
* Реестр признаков включённого контроля качества по контролам адресов.
|
|
41
|
+
*/
|
|
42
|
+
private readonly checkEnabledStates;
|
|
43
|
+
/**
|
|
44
|
+
* Задаёт качество адреса, выбранного в контроле, и пересчитывает валидность контрола
|
|
45
|
+
* без рассылки событий, чтобы не нарушать подавление valueChanges при выборе подсказки.
|
|
46
|
+
* Контрол адреса, требующего внимания пользователя, помечается затронутым, чтобы сообщения показались сразу.
|
|
47
|
+
*
|
|
48
|
+
* @param control Контрол адреса.
|
|
49
|
+
* @param quality Качество (полнота) адреса или null, если качество неизвестно.
|
|
50
|
+
*/
|
|
51
|
+
setQuality(control: AbstractControl, quality: ScSuggestionAddressQuality | null): void;
|
|
52
|
+
/**
|
|
53
|
+
* Возвращает качество адреса, выбранного в контроле, либо null, если адрес из подсказок
|
|
54
|
+
* не выбирался или поле пустое. Качество полного адреса действует, только пока значение контрола не изменилось
|
|
55
|
+
* после выбора; качество неполного адреса и адреса с неопределённой полнотой действует
|
|
56
|
+
* до выбора другой подсказки или полной очистки поля, в том числе после ручной правки текста.
|
|
57
|
+
*
|
|
58
|
+
* @param control Контрол адреса.
|
|
59
|
+
*/
|
|
60
|
+
getQuality(control: AbstractControl): ScSuggestionAddressQuality | null;
|
|
61
|
+
/**
|
|
62
|
+
* Задаёт качество адресов организации контролам группы на основе выбранной подсказки.
|
|
63
|
+
* Качество применяется только к заполненным адресам подсказки: для пустого адреса
|
|
64
|
+
* оно сбрасывается, даже если сервис подсказок прислал для него значение.
|
|
65
|
+
*
|
|
66
|
+
* @param group Группа с контролами адресов организации.
|
|
67
|
+
* @param suggestion Объект подсказки по организации.
|
|
68
|
+
*/
|
|
69
|
+
setOrganizationAddressQualities(group: AbstractControl, suggestion: ScISuggestionOrganization): void;
|
|
70
|
+
/**
|
|
71
|
+
* Включает или отключает контроль качества адреса для контрола и пересчитывает его валидность без рассылки событий.
|
|
72
|
+
* Сохранённое качество при отключении не теряется и снова учитывается после включения.
|
|
73
|
+
* Вызывать при смене значения формы, а не из хуков проверки изменений (ngOnChanges и т.п.),
|
|
74
|
+
* чтобы родительские шаблоны сразу видели актуальную валидность.
|
|
75
|
+
*
|
|
76
|
+
* @param control Контрол адреса.
|
|
77
|
+
* @param enabled Признак, что контроль качества адреса включён.
|
|
78
|
+
*/
|
|
79
|
+
setQualityCheckEnabled(control: AbstractControl, enabled: boolean): void;
|
|
80
|
+
/**
|
|
81
|
+
* Возвращает признак, что контроль качества адреса для контрола включён.
|
|
82
|
+
*
|
|
83
|
+
* @param control Контрол адреса.
|
|
84
|
+
*/
|
|
85
|
+
isQualityCheckEnabled(control: AbstractControl): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Возвращает ошибку неполного адреса либо null, если контрол можно отправлять: контроль качества отключён,
|
|
88
|
+
* блокировка выключена токеном {@link SC_BLOCK_INCOMPLETE_ADDRESS} или адрес не неполный.
|
|
89
|
+
* Для очищенного поля сбрасывает сохранённое качество адреса.
|
|
90
|
+
*
|
|
91
|
+
* @param control Контрол адреса.
|
|
92
|
+
*/
|
|
93
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
94
|
+
/**
|
|
95
|
+
* Возвращает текст предупреждения о необходимости проверить выбранный адрес либо null, когда предупреждение не требуется,
|
|
96
|
+
* в том числе для пустого поля. Для неполного адреса при включённой блокировке отправки вместо предупреждения
|
|
97
|
+
* показывается ошибка валидатора {@link validator}, если он подключён к контролу.
|
|
98
|
+
*
|
|
99
|
+
* @param control Контрол адреса.
|
|
100
|
+
*/
|
|
101
|
+
getWarningMessage(control: AbstractControl): string | null;
|
|
102
|
+
/**
|
|
103
|
+
* Возвращает сигнал состояния качества для контрола, создавая его при первом обращении.
|
|
104
|
+
*
|
|
105
|
+
* @param control Контрол адреса.
|
|
106
|
+
*/
|
|
107
|
+
private stateOf;
|
|
108
|
+
/**
|
|
109
|
+
* Возвращает сигнал признака включённого контроля качества для контрола, создавая его при первом обращении.
|
|
110
|
+
*
|
|
111
|
+
* @param control Контрол адреса.
|
|
112
|
+
*/
|
|
113
|
+
private checkEnabledOf;
|
|
114
|
+
/**
|
|
115
|
+
* Сбрасывает сохранённое качество адреса, если поле очищено.
|
|
116
|
+
*
|
|
117
|
+
* @param control Контрол адреса.
|
|
118
|
+
*/
|
|
119
|
+
private resetQualityOfEmptyAddress;
|
|
120
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScAddressQualityService, never>;
|
|
121
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ScAddressQualityService>;
|
|
122
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ScSuggestionAddressQuality } from '@snabcentr/client-core';
|
|
2
|
+
/**
|
|
3
|
+
* Состояние качества адреса, выбранного из подсказок.
|
|
4
|
+
*/
|
|
5
|
+
export interface ScIAddressQualityState {
|
|
6
|
+
/**
|
|
7
|
+
* Качество (полнота) адреса.
|
|
8
|
+
*/
|
|
9
|
+
quality: ScSuggestionAddressQuality;
|
|
10
|
+
/**
|
|
11
|
+
* Значение контрола на момент выбора адреса.
|
|
12
|
+
*/
|
|
13
|
+
value: unknown;
|
|
14
|
+
}
|
package/directives/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './abstract-price-card/abstract-sc-price-card.directive';
|
|
2
|
+
export * from './address-quality/sc-address-quality.directive';
|
|
3
|
+
export * from './address-quality/sc-address-quality.service';
|
|
2
4
|
export * from './links';
|
|
3
5
|
export * from './next-input-focus/sc-next-input-focus.directive';
|
|
4
6
|
export * from './next-input-focus/sc-next-input-focus.module';
|
|
@@ -194,7 +194,7 @@ export class ScSimpleSignUpFormComponent {
|
|
|
194
194
|
this.helpNotificationService.closeAllHelpNotification();
|
|
195
195
|
}
|
|
196
196
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScSimpleSignUpFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
197
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScSimpleSignUpFormComponent, selector: "sc-simple-sign-up-form", outputs: { successAuth: "successAuth", clickOffer: "clickOffer" }, providers: [tuiDropdownOptionsProvider({ limitWidth: 'fixed' })], ngImport: i0, template: "<form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex flex-col gap-6\"\n>\n <div class=\"flex flex-col gap-3\">\n <sc-verification-phone-check-form\n (isBusyChange)=\"onIsBusyChange($event)\"\n (isConfirmedChange)=\"onIsConfirmedChange($event)\"\n [showCodeFields]=\"form.controls.phone.valid && form.controls.phone.valid\"\n [shouldBeConfirmed]=\"true\"\n />\n @if (isPhoneBusy() !== null && form.controls.phone.valid) {\n @if (!isPhoneBusy()) {\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-input formControlName=\"name\">\n \u0424.\u0418.\u041E.\n <input\n tuiTextfieldLegacy\n autocomplete=\"name\"\n />\n </tui-input>\n <tui-error\n formControlName=\"name\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-input formControlName=\"email\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <sc-suggestion-field\n *tuiDataList\n [type]=\"suggestionType.email\"\n />\n </tui-input>\n <tui-error\n formControlName=\"email\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <tui-error\n [error]=\"[] | tuiFieldError | async\"\n class=\"self-center\"\n />\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n required=\"true\"\n formControlName=\"acceptRules\"\n />\n <div>\n <span>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044F\u0441\u044C \u043D\u0430 \u0441\u0430\u0439\u0442\u0435, \u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u044E\u0441\u044C \u0441\n <a\n tuiLink\n [pseudo]=\"true\"\n (click)=\"$event.preventDefault(); clickOffer.emit()\"\n >\n \u0414\u043E\u0433\u043E\u0432\u043E\u0440\u043E\u043C \u043E\u0444\u0435\u0440\u0442\u044B\n </a>\n .\n </span>\n <span class=\"text-tui-negative\">*</span>\n <tui-error\n formControlName=\"acceptRules\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </div>\n </label>\n }\n }\n\n <tui-error\n [error]=\"[] | tuiFieldError | async\"\n class=\"self-center\"\n />\n </div>\n <button\n tuiButton\n [disabled]=\"isPhoneBusy() ? form.controls.verificationCode.invalid || form.controls.phone.invalid : form.invalid\"\n [loading]=\"loading()\"\n type=\"submit\"\n class=\"self-center\"\n >\n {{ isPhoneBusy() ? '\u0412\u043E\u0439\u0442\u0438' : '\u041A\u0443\u043F\u0438\u0442\u044C' }}\n </button>\n</form>\n", dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "input[tuiTextfieldLegacy], textarea[tuiTextfieldLegacy]" }, { kind: "component", type: i3.TuiInputComponent, selector: "tui-input" }, { kind: "directive", type: i3.TuiInputDirective, selector: "tui-input" }, { kind: "directive", type: i4.TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "directive", type: i4.TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: i4.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i4.TuiError, selector: "tui-error", inputs: ["error"] }, { kind: "component", type: i5.ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "component", type: i6.ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "directive", type: i7.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { kind: "component", type: i8.TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]", inputs: ["size"] }, { kind: "component", type: i8.TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TuiFieldErrorPipe, name: "tuiFieldError" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
197
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScSimpleSignUpFormComponent, selector: "sc-simple-sign-up-form", outputs: { successAuth: "successAuth", clickOffer: "clickOffer" }, providers: [tuiDropdownOptionsProvider({ limitWidth: 'fixed' })], ngImport: i0, template: "<form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex flex-col gap-6\"\n>\n <div class=\"flex flex-col gap-3\">\n <sc-verification-phone-check-form\n (isBusyChange)=\"onIsBusyChange($event)\"\n (isConfirmedChange)=\"onIsConfirmedChange($event)\"\n [showCodeFields]=\"form.controls.phone.valid && form.controls.phone.valid\"\n [shouldBeConfirmed]=\"true\"\n />\n @if (isPhoneBusy() !== null && form.controls.phone.valid) {\n @if (!isPhoneBusy()) {\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-input formControlName=\"name\">\n \u0424.\u0418.\u041E.\n <input\n tuiTextfieldLegacy\n autocomplete=\"name\"\n />\n </tui-input>\n <tui-error\n formControlName=\"name\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-input formControlName=\"email\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <sc-suggestion-field\n *tuiDataList\n [type]=\"suggestionType.email\"\n />\n </tui-input>\n <tui-error\n formControlName=\"email\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <tui-error\n [error]=\"[] | tuiFieldError | async\"\n class=\"self-center\"\n />\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n required=\"true\"\n formControlName=\"acceptRules\"\n />\n <div>\n <span>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044F\u0441\u044C \u043D\u0430 \u0441\u0430\u0439\u0442\u0435, \u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u044E\u0441\u044C \u0441\n <a\n tuiLink\n [pseudo]=\"true\"\n (click)=\"$event.preventDefault(); clickOffer.emit()\"\n >\n \u0414\u043E\u0433\u043E\u0432\u043E\u0440\u043E\u043C \u043E\u0444\u0435\u0440\u0442\u044B\n </a>\n .\n </span>\n <span class=\"text-tui-negative\">*</span>\n <tui-error\n formControlName=\"acceptRules\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </div>\n </label>\n }\n }\n\n <tui-error\n [error]=\"[] | tuiFieldError | async\"\n class=\"self-center\"\n />\n </div>\n <button\n tuiButton\n [disabled]=\"isPhoneBusy() ? form.controls.verificationCode.invalid || form.controls.phone.invalid : form.invalid\"\n [loading]=\"loading()\"\n type=\"submit\"\n class=\"self-center\"\n >\n {{ isPhoneBusy() ? '\u0412\u043E\u0439\u0442\u0438' : '\u041A\u0443\u043F\u0438\u0442\u044C' }}\n </button>\n</form>\n", dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "input[tuiTextfieldLegacy], textarea[tuiTextfieldLegacy]" }, { kind: "component", type: i3.TuiInputComponent, selector: "tui-input" }, { kind: "directive", type: i3.TuiInputDirective, selector: "tui-input" }, { kind: "directive", type: i4.TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "directive", type: i4.TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: i4.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i4.TuiError, selector: "tui-error", inputs: ["error"] }, { kind: "component", type: i5.ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "component", type: i6.ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "directive", type: i7.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { kind: "component", type: i8.TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]", inputs: ["size"] }, { kind: "component", type: i8.TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TuiFieldErrorPipe, name: "tuiFieldError" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
198
198
|
}
|
|
199
199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScSimpleSignUpFormComponent, decorators: [{
|
|
200
200
|
type: Component,
|