@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.
Files changed (91) hide show
  1. package/auth/sign-up-form/sc-sign-up-form.component.d.ts +6 -0
  2. package/contragents/new-contragent-form/sc-new-contragent-form.component.d.ts +4 -0
  3. package/contragents/sc-contragents.module.d.ts +4 -3
  4. package/delivery-address/add-delivery-address-dialog/sc-add-delivery-address-dialog.component.d.ts +13 -0
  5. package/directives/address-quality/sc-address-quality.directive.d.ts +23 -0
  6. package/directives/address-quality/sc-address-quality.service.d.ts +122 -0
  7. package/directives/address-quality/sc-i-address-quality-state.d.ts +14 -0
  8. package/directives/index.d.ts +2 -0
  9. package/esm2022/auth/sc-simple-sign-up-form/sc-simple-sign-up-form.component.mjs +1 -1
  10. package/esm2022/auth/sign-up-form/sc-sign-up-form.component.mjs +14 -4
  11. package/esm2022/catalog/notify-when-in-stock-dialog/sc-notify-when-in-stock-dialog.component.mjs +2 -2
  12. package/esm2022/contacts/new-contact-form/sc-new-contact-form.component.mjs +1 -1
  13. package/esm2022/contragents/new-contragent-bank-account-form/sc-new-contragent-bank-account-form.component.mjs +1 -1
  14. package/esm2022/contragents/new-contragent-form/sc-new-contragent-form.component.mjs +26 -20
  15. package/esm2022/contragents/sc-contragents.module.mjs +4 -1
  16. package/esm2022/delivery-address/add-delivery-address-dialog/sc-add-delivery-address-dialog.component.mjs +25 -4
  17. package/esm2022/directives/address-quality/sc-address-quality.directive.mjs +40 -0
  18. package/esm2022/directives/address-quality/sc-address-quality.service.mjs +214 -0
  19. package/esm2022/directives/address-quality/sc-i-address-quality-state.mjs +2 -0
  20. package/esm2022/directives/index.mjs +3 -1
  21. package/esm2022/feedback/feedback-form/sc-feedback-form.component.mjs +11 -21
  22. package/esm2022/form-fields/addresses-selection-field/sc-addresses-selection-field.component.mjs +4 -5
  23. package/esm2022/form-fields/suggestion-field/sc-suggestion-field.component.mjs +76 -16
  24. package/esm2022/order/draft/sc-draft.component.mjs +12 -15
  25. package/esm2022/order/index.mjs +3 -4
  26. package/esm2022/order/new-order-items/sc-new-order-items.component.mjs +39 -0
  27. package/esm2022/order/order-form/sc-order-form.component.mjs +6 -18
  28. package/esm2022/order/order-items-list/sc-order-items-list.component.mjs +3 -4
  29. package/esm2022/order/order-items-list-with-actions/sc-order-items-list-with-actions.component.mjs +53 -0
  30. package/esm2022/providers/index.mjs +2 -2
  31. package/esm2022/providers/sc-block-incomplete-address.mjs +8 -0
  32. package/esm2022/public-api.mjs +2 -1
  33. package/esm2022/samples/sc-sample.module.mjs +3 -10
  34. package/esm2022/services/index.mjs +2 -1
  35. package/esm2022/services/sc-scripts.service.mjs +106 -0
  36. package/esm2022/smart-captcha/index.mjs +5 -0
  37. package/esm2022/smart-captcha/interfaces/index.mjs +6 -0
  38. package/esm2022/smart-captcha/interfaces/sc-smart-captcha-api.mjs +2 -0
  39. package/esm2022/smart-captcha/interfaces/sc-smart-captcha-event.mjs +2 -0
  40. package/esm2022/smart-captcha/interfaces/sc-smart-captcha-language.mjs +2 -0
  41. package/esm2022/smart-captcha/interfaces/sc-smart-captcha-render-params.mjs +2 -0
  42. package/esm2022/smart-captcha/interfaces/sc-smart-captcha-settings.mjs +2 -0
  43. package/esm2022/smart-captcha/interfaces/sc-smart-captcha-window.mjs +2 -0
  44. package/esm2022/smart-captcha/sc-smart-captcha.component.mjs +167 -0
  45. package/esm2022/smart-captcha/services/index.mjs +2 -0
  46. package/esm2022/smart-captcha/services/sc-smart-captcha-loader.service.mjs +87 -0
  47. package/esm2022/smart-captcha/tokens/index.mjs +3 -0
  48. package/esm2022/smart-captcha/tokens/sc-smart-captcha-load-timeout.token.mjs +8 -0
  49. package/esm2022/smart-captcha/tokens/sc-smart-captcha-settings.token.mjs +6 -0
  50. package/esm2022/user/update-user-info-dialog/sc-update-user-info-dialog.component.mjs +3 -3
  51. package/feedback/feedback-form/sc-feedback-form.component.d.ts +1 -1
  52. package/fesm2022/snabcentr-client-ui.mjs +806 -215
  53. package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
  54. package/form-fields/addresses-selection-field/sc-addresses-selection-field.component.d.ts +2 -0
  55. package/form-fields/suggestion-field/sc-suggestion-field.component.d.ts +36 -2
  56. package/order/draft/sc-draft.component.d.ts +5 -8
  57. package/order/index.d.ts +2 -3
  58. package/order/{order-direction-items/sc-order-direction-items.component.d.ts → new-order-items/sc-new-order-items.component.d.ts} +5 -5
  59. package/order/order-form/sc-order-form.component.d.ts +2 -11
  60. package/order/order-items-list/sc-order-items-list.component.d.ts +0 -1
  61. package/order/order-items-list-with-actions/sc-order-items-list-with-actions.component.d.ts +37 -0
  62. package/package.json +2 -3
  63. package/providers/index.d.ts +1 -1
  64. package/providers/sc-block-incomplete-address.d.ts +5 -0
  65. package/public-api.d.ts +1 -0
  66. package/release_notes.tmp +1 -1
  67. package/samples/sc-sample.module.d.ts +1 -2
  68. package/services/index.d.ts +1 -0
  69. package/services/sc-scripts.service.d.ts +51 -0
  70. package/smart-captcha/index.d.ts +4 -0
  71. package/smart-captcha/interfaces/index.d.ts +5 -0
  72. package/smart-captcha/interfaces/sc-smart-captcha-api.d.ts +36 -0
  73. package/smart-captcha/interfaces/sc-smart-captcha-event.d.ts +4 -0
  74. package/smart-captcha/interfaces/sc-smart-captcha-language.d.ts +4 -0
  75. package/smart-captcha/interfaces/sc-smart-captcha-render-params.d.ts +16 -0
  76. package/smart-captcha/interfaces/sc-smart-captcha-settings.d.ts +16 -0
  77. package/smart-captcha/interfaces/sc-smart-captcha-window.d.ts +14 -0
  78. package/smart-captcha/sc-smart-captcha.component.d.ts +92 -0
  79. package/smart-captcha/services/index.d.ts +1 -0
  80. package/smart-captcha/services/sc-smart-captcha-loader.service.d.ts +50 -0
  81. package/smart-captcha/tokens/index.d.ts +2 -0
  82. package/smart-captcha/tokens/sc-smart-captcha-load-timeout.token.d.ts +5 -0
  83. package/smart-captcha/tokens/sc-smart-captcha-settings.token.d.ts +6 -0
  84. package/styles/tailwind/tailwind.scss +48 -2
  85. package/esm2022/order/models/sc-i-cart-items-by-direction.mjs +0 -22
  86. package/esm2022/order/order-direction-items/sc-order-direction-items.component.mjs +0 -39
  87. package/esm2022/order/order-items-list-by-directions/sc-order-items-list-by-directions.component.mjs +0 -75
  88. package/esm2022/providers/cleanup-recaptcha-artifacts.mjs +0 -30
  89. package/order/models/sc-i-cart-items-by-direction.d.ts +0 -25
  90. package/order/order-items-list-by-directions/sc-order-items-list-by-directions.component.d.ts +0 -58
  91. package/providers/cleanup-recaptcha-artifacts.d.ts +0 -7
@@ -56,6 +56,8 @@ export declare class ScAddressesSelectionFieldComponent implements OnInit {
56
56
  }) => string;
57
57
  /**
58
58
  * Инициализирует экземпляр класса {@link ScAddressesSelectionFieldComponent}.
59
+ * Включение выбора страны сохраняет выбранные страну, регион и город. При выключении выбора страна
60
+ * фиксируется на текущей стране системы, поэтому регион и город сбрасываются, только если была выбрана другая страна.
59
61
  *
60
62
  * @param formGroupDirective Директива c `FormGroup` из DOM.
61
63
  * @param locationsService Сервис для получения списков стран, регионов, городов.
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { NgControl } from '@angular/forms';
3
- import { ScISuggestionOrganization, ScISuggestionType, ScSuggestion, ScSuggestionService } from '@snabcentr/client-core';
3
+ import { ScISuggestionOrganization, ScISuggestionType, ScSuggestion, ScSuggestionAddressQuality, ScSuggestionService } from '@snabcentr/client-core';
4
4
  import { Observable } from 'rxjs';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
@@ -13,6 +13,11 @@ export declare class ScSuggestionFieldComponent implements OnInit {
13
13
  * Тип подсказок.
14
14
  */
15
15
  type: ScISuggestionType;
16
+ /**
17
+ * Признак, что элементы подсказок показывают пометку о полноте адреса.
18
+ * Отключается там, где адреса из подсказки по организации не применяются.
19
+ */
20
+ showAddressQuality: boolean;
16
21
  /**
17
22
  * Событие выбора результата подсказки.
18
23
  */
@@ -41,6 +46,10 @@ export declare class ScSuggestionFieldComponent implements OnInit {
41
46
  * Признак, что разрешено выбирать записи ликвидированных организаций.
42
47
  */
43
48
  private readonly allowSelectTerminated;
49
+ /**
50
+ * Сервис-реестр качества адресов, выбранных из подсказок.
51
+ */
52
+ private readonly addressQualityService;
44
53
  /**
45
54
  * Инициализирует экземпляр класса {@link ScSuggestionFieldComponent}.
46
55
  *
@@ -62,12 +71,37 @@ export declare class ScSuggestionFieldComponent implements OnInit {
62
71
  * @param suggestion Объект подсказки.
63
72
  */
64
73
  isDisabledSuggestion(suggestion: ScSuggestion): boolean;
74
+ /**
75
+ * Возвращает текст пометки о качестве адреса для элемента выпадающего списка подсказок либо null, когда пометка не требуется.
76
+ *
77
+ * @param quality Качество (полнота) адреса.
78
+ */
79
+ getAddressQualityWarning(quality: ScSuggestionAddressQuality | null | undefined): string | null;
80
+ /**
81
+ * Возвращает текст пометки о качестве юридического адреса для подсказки по организации либо null,
82
+ * когда пометка не требуется, в том числе когда у организации нет юридического адреса.
83
+ *
84
+ * @param suggestion Объект подсказки по организации.
85
+ */
86
+ getOrganizationAddressQualityWarning(suggestion: ScISuggestionOrganization): string | null;
65
87
  /**
66
88
  * Проверяет прекращена ли деятельность указанной организации.
67
89
  *
68
90
  * @param suggestion Объект подсказки по организации.
69
91
  */
70
92
  isOrgTerminated(suggestion: ScISuggestionOrganization): boolean;
93
+ /**
94
+ * Заполняет контрол строкой выбранного адреса и регистрирует качество адреса.
95
+ *
96
+ * @param suggestion Объект подсказки по адресу.
97
+ */
98
+ private applyAddressSuggestion;
99
+ /**
100
+ * Заполняет поля родительской группы данными выбранной организации и регистрирует качество её адресов.
101
+ *
102
+ * @param suggestion Объект подсказки по организации.
103
+ */
104
+ private applyOrganizationSuggestion;
71
105
  static ɵfac: i0.ɵɵFactoryDeclaration<ScSuggestionFieldComponent, [{ skipSelf: true; }, null]>;
72
- static ɵcmp: i0.ɵɵComponentDeclaration<ScSuggestionFieldComponent, "sc-suggestion-field", never, { "type": { "alias": "type"; "required": false; }; }, { "selectedClick": "selectedClick"; }, never, never, false, never>;
106
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScSuggestionFieldComponent, "sc-suggestion-field", never, { "type": { "alias": "type"; "required": false; }; "showAddressQuality": { "alias": "showAddressQuality"; "required": false; }; }, { "selectedClick": "selectedClick"; }, never, never, false, never>;
73
107
  }
@@ -1,6 +1,5 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { ScOrderDraft } from '@snabcentr/client-core';
3
- import { ScOrderItemsByDirection } from '../models/sc-i-cart-items-by-direction';
4
3
  import * as i0 from "@angular/core";
5
4
  /**
6
5
  * Компонент страницы черновика заказа (аналог корзины для одного черновика).
@@ -23,9 +22,9 @@ export declare class ScDraftComponent implements OnInit {
23
22
  */
24
23
  readonly draft: import("@angular/core").ModelSignal<ScOrderDraft | null>;
25
24
  /**
26
- * Идентификаторы выбранных позиций.
25
+ * Идентификаторы позиций черновика, выбранных для оформления заказа.
27
26
  */
28
- readonly selectedItemsIds: import("@angular/core").ModelSignal<string[]>;
27
+ protected readonly selectedItemsIds: import("@angular/core").WritableSignal<string[]>;
29
28
  /**
30
29
  * Источник события удаления или отмены заказа.
31
30
  */
@@ -49,15 +48,13 @@ export declare class ScDraftComponent implements OnInit {
49
48
  /** @inheritDoc */
50
49
  ngOnInit(): void;
51
50
  /**
52
- * Переход к оформлению заказа по выбранному направлению продаж.
53
- *
54
- * @param direction Группа позиций по направлению продаж.
51
+ * Переход к оформлению заказа из выбранных позиций.
55
52
  */
56
- protected goToNewOrder(direction: ScOrderItemsByDirection): void;
53
+ protected goToNewOrder(): void;
57
54
  /**
58
55
  * Удаляет черновик и перенаправляет к списку черновиков.
59
56
  */
60
57
  protected clearDraft(): void;
61
58
  static ɵfac: i0.ɵɵFactoryDeclaration<ScDraftComponent, never>;
62
- static ɵcmp: i0.ɵɵComponentDeclaration<ScDraftComponent, "sc-draft", never, { "draft": { "alias": "draft"; "required": false; "isSignal": true; }; "selectedItemsIds": { "alias": "selectedItemsIds"; "required": false; "isSignal": true; }; }, { "draft": "draftChange"; "selectedItemsIds": "selectedItemsIdsChange"; "deleteEvent": "deleteEvent"; }, never, never, true, never>;
59
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScDraftComponent, "sc-draft", never, { "draft": { "alias": "draft"; "required": false; "isSignal": true; }; }, { "draft": "draftChange"; "deleteEvent": "deleteEvent"; }, never, never, true, never>;
63
60
  }
package/order/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  export * from './directives';
2
2
  export * from './models/i-new-order-form';
3
- export * from './models/sc-i-cart-items-by-direction';
4
- export * from './order-direction-items/sc-order-direction-items.component';
3
+ export * from './new-order-items/sc-new-order-items.component';
5
4
  export * from './order-form/sc-order-form.config';
6
5
  export * from './order-form/sc-order-form.component';
7
6
  export * from './order-item/sc-order-item.component';
8
7
  export * from './order-items-list/sc-order-items-list.component';
9
- export * from './order-items-list-by-directions/sc-order-items-list-by-directions.component';
8
+ export * from './order-items-list-with-actions/sc-order-items-list-with-actions.component';
10
9
  export * from './order-items-list-by-stock/sc-order-items-list-by-stock.component';
11
10
  export * from './draft/sc-draft.component';
12
11
  export * from './sc-payment-status/sc-payment-status.component';
@@ -1,11 +1,11 @@
1
1
  import { ScOrderItem } from '@snabcentr/client-core';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
- * Список товаров заказа по направлению продаж с выбором позиций для оформления.
4
+ * Список товаров оформляемого заказа с выбором позиций.
5
5
  */
6
- export declare class ScOrderDirectionItemsComponent {
6
+ export declare class ScNewOrderItemsComponent {
7
7
  /**
8
- * Товары направления.
8
+ * Товары заказа.
9
9
  */
10
10
  readonly items: import("@angular/core").InputSignal<ScOrderItem[]>;
11
11
  /**
@@ -24,6 +24,6 @@ export declare class ScOrderDirectionItemsComponent {
24
24
  * Изменение выбора позиций для оформления.
25
25
  */
26
26
  readonly selectedItemsIdsChange: import("@angular/core").OutputEmitterRef<string[]>;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<ScOrderDirectionItemsComponent, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<ScOrderDirectionItemsComponent, "sc-order-direction-items", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "orderProcessingAcceptanceTime": { "alias": "orderProcessingAcceptanceTime"; "required": false; "isSignal": true; }; }, { "selectedItemsIdsChange": "selectedItemsIdsChange"; }, never, ["[footerActions]"], true, never>;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScNewOrderItemsComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScNewOrderItemsComponent, "sc-new-order-items", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "orderProcessingAcceptanceTime": { "alias": "orderProcessingAcceptanceTime"; "required": false; "isSignal": true; }; }, { "selectedItemsIdsChange": "selectedItemsIdsChange"; }, never, ["[footerActions]"], true, never>;
29
29
  }
@@ -15,19 +15,10 @@ type SelectType = ScIReferencesTypes<ScPaymentType, typeof ScPaymentType> | ScCo
15
15
  * Форма оформления заказа.
16
16
  */
17
17
  export declare class ScOrderFormComponent implements OnInit {
18
- /**
19
- * Идентификатор направления продаж заказа.
20
- */
21
- readonly directionId: import("@angular/core").InputSignal<number>;
22
18
  /**
23
19
  * Требовать подтверждённые контактные данные для оформления. Для черновика — `false`.
24
20
  */
25
21
  readonly enforceApprovedContacts: import("@angular/core").InputSignal<boolean>;
26
- /**
27
- * Сохранять и восстанавливать черновые данные формы по направлению (метаданные). Для черновика — `false`.
28
- * Работает только если предоставлен токен {@link SC_ORDER_FORM_CONFIG}.
29
- */
30
- readonly persistMetadata: import("@angular/core").InputSignal<boolean>;
31
22
  /**
32
23
  * Событие отправки валидной формы оформления. Полезная нагрузка — сырые значения формы.
33
24
  */
@@ -235,7 +226,7 @@ export declare class ScOrderFormComponent implements OnInit {
235
226
  */
236
227
  private triggerUnconfirmedWarning;
237
228
  /**
238
- * Восстанавливает черновые данные формы из метаданных и инициализирует их сохранение.
229
+ * Восстанавливает черновые данные формы из метаданных и инициализирует их сохранение, если предоставлен токен {@link SC_ORDER_FORM_CONFIG}.
239
230
  */
240
231
  private initMetadata;
241
232
  /**
@@ -278,6 +269,6 @@ export declare class ScOrderFormComponent implements OnInit {
278
269
  */
279
270
  private onUploadFile;
280
271
  static ɵfac: i0.ɵɵFactoryDeclaration<ScOrderFormComponent, never>;
281
- static ɵcmp: i0.ɵɵComponentDeclaration<ScOrderFormComponent, "sc-order-form", never, { "directionId": { "alias": "directionId"; "required": true; "isSignal": true; }; "enforceApprovedContacts": { "alias": "enforceApprovedContacts"; "required": false; "isSignal": true; }; "persistMetadata": { "alias": "persistMetadata"; "required": false; "isSignal": true; }; }, { "orderSubmit": "orderSubmit"; }, never, never, true, never>;
272
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScOrderFormComponent, "sc-order-form", never, { "enforceApprovedContacts": { "alias": "enforceApprovedContacts"; "required": false; "isSignal": true; }; }, { "orderSubmit": "orderSubmit"; }, never, never, true, never>;
282
273
  }
283
274
  export {};
@@ -5,7 +5,6 @@ import { ScOrderOptions } from '../directives/sc-order-options';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
7
  * Компонент списка товаров корзины, заказа или черновика.
8
- * Позиции разбиты.
9
8
  */
10
9
  export declare class ScOrderItemsListComponent {
11
10
  /**
@@ -0,0 +1,37 @@
1
+ import { ScOrderItem } from '@snabcentr/client-core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Список позиций заказа с действиями и блоком позиций, которые больше не предоставляются.
5
+ */
6
+ export declare class ScOrderItemsListWithActionsComponent {
7
+ /**
8
+ * Товары заказа.
9
+ */
10
+ readonly items: import("@angular/core").InputSignal<ScOrderItem[]>;
11
+ /**
12
+ * Включить выбор позиций чекбоксами.
13
+ */
14
+ readonly selectable: import("@angular/core").InputSignal<boolean>;
15
+ /**
16
+ * Включить редактирование позиций.
17
+ */
18
+ readonly editable: import("@angular/core").InputSignal<boolean>;
19
+ /**
20
+ * Позиции, доступные для заказа.
21
+ */
22
+ protected readonly availableItems: import("@angular/core").Signal<ScOrderItem[]>;
23
+ /**
24
+ * Позиции корзины, которые больше не предоставляются.
25
+ */
26
+ protected readonly nullItems: import("@angular/core").Signal<ScOrderItem[]>;
27
+ /**
28
+ * Идентификаторы выбранных позиций.
29
+ */
30
+ readonly selectedItemsIds: import("@angular/core").ModelSignal<string[]>;
31
+ /**
32
+ * Инициализирует экземпляр класса {@link ScOrderItemsListWithActionsComponent}.
33
+ */
34
+ constructor();
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScOrderItemsListWithActionsComponent, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScOrderItemsListWithActionsComponent, "sc-order-items-list-with-actions", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "selectedItemsIds": { "alias": "selectedItemsIds"; "required": false; "isSignal": true; }; }, { "selectedItemsIds": "selectedItemsIdsChange"; }, never, ["[footerActions]"], true, never>;
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snabcentr/client-ui",
3
- "version": "4.14.7",
3
+ "version": "4.14.8",
4
4
  "author": "Snabcentr Ltd.",
5
5
  "repository": "https://gitlab.snabcentr.met/web/angular/snabcentr-client-ui-lib",
6
6
  "license": "Commercial",
@@ -16,7 +16,7 @@
16
16
  "@maskito/core": "^3.11.1",
17
17
  "@ng-web-apis/intersection-observer": "^4.14.0",
18
18
  "@ng-web-apis/common": "^4.14.0",
19
- "@snabcentr/client-core": "^3.21.3",
19
+ "@snabcentr/client-core": "^3.23.4",
20
20
  "@taiga-ui/addon-charts": "^4.66.0",
21
21
  "@taiga-ui/addon-commerce": "^4.66.0",
22
22
  "@taiga-ui/cdk": "^4.66.0",
@@ -31,7 +31,6 @@
31
31
  "@taiga-ui/experimental": "^4.66.0",
32
32
  "@taiga-ui/styles": "^4.66.0",
33
33
  "@tailwindcss/container-queries": "^0.1.1",
34
- "ng-recaptcha-2": "^14.0.0",
35
34
  "angular8-yandex-maps": "^18.2.0",
36
35
  "date-fns": "^4.1.0",
37
36
  "libphonenumber-js": "^1.12.7",
@@ -1,6 +1,7 @@
1
1
  export * from './sc-verification-code-timeout';
2
2
  export * from './sc-dialog-service.providers';
3
3
  export * from './sc-allow-select-terminated';
4
+ export * from './sc-block-incomplete-address';
4
5
  export * from './sc-help-notification-limit';
5
6
  export * from './sc-help-notification-close';
6
7
  export * from './sc-max-files-in-form-input';
@@ -13,4 +14,3 @@ export * from './sc-notify-when-in-stock-required-fields';
13
14
  export * from './sc-banner-duration';
14
15
  export * from './sc-debounce-time-default';
15
16
  export * from './sc-hidden-print-elements.token';
16
- export * from './cleanup-recaptcha-artifacts';
@@ -0,0 +1,5 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * Токен признака, что отправка форм с неполным (по данным подсказок) адресом заблокирована.
4
+ */
5
+ export declare const SC_BLOCK_INCOMPLETE_ADDRESS: InjectionToken<boolean>;
package/public-api.d.ts CHANGED
@@ -29,6 +29,7 @@ export * from './providers';
29
29
  export * from './feedback';
30
30
  export * from './qrcode';
31
31
  export * from './share';
32
+ export * from './smart-captcha';
32
33
  export * from './user';
33
34
  export * from './validators';
34
35
  export * from './verification';
package/release_notes.tmp CHANGED
@@ -1,4 +1,4 @@
1
- ## 4.14.7 (2026-10-05)
1
+ ## 4.14.8 (2026-10-09)
2
2
 
3
3
  No changes.
4
4
 
@@ -8,12 +8,11 @@ import * as i6 from "../form-fields/form-fields.module";
8
8
  import * as i7 from "@taiga-ui/legacy";
9
9
  import * as i8 from "@taiga-ui/cdk/directives/item";
10
10
  import * as i9 from "@taiga-ui/cdk";
11
- import * as i10 from "ng-recaptcha-2";
12
11
  /**
13
12
  * Модуль представления образцов товара.
14
13
  */
15
14
  export declare class ScPreviewSampleModule {
16
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ScPreviewSampleModule, never>;
17
- static ɵmod: i0.ɵɵNgModuleDeclaration<ScPreviewSampleModule, [typeof i1.ScPreviewSampleComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i4.TuiError, typeof i5.TuiFieldErrorPipe, typeof i6.ScFormFieldsModule, typeof i7.TuiInputModule, typeof i7.TuiInputPhoneModule, typeof i8.TuiItem, typeof i5.TuiCarouselComponent, typeof i5.TuiCarouselDirective, typeof i5.TuiCarouselAutoscroll, typeof i5.TuiCarouselButtons, typeof i5.TuiCarouselScroll, typeof i5.TuiAvatar, typeof i9.TuiHovered, typeof i4.TuiButton, typeof i5.TuiButtonLoading, typeof i4.TuiLabel, typeof i10.RecaptchaFormsModule, typeof i10.RecaptchaModule], [typeof i1.ScPreviewSampleComponent]>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ScPreviewSampleModule, [typeof i1.ScPreviewSampleComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i4.TuiError, typeof i5.TuiFieldErrorPipe, typeof i6.ScFormFieldsModule, typeof i7.TuiInputModule, typeof i7.TuiInputPhoneModule, typeof i8.TuiItem, typeof i5.TuiCarouselComponent, typeof i5.TuiCarouselDirective, typeof i5.TuiCarouselAutoscroll, typeof i5.TuiCarouselButtons, typeof i5.TuiCarouselScroll, typeof i5.TuiAvatar, typeof i9.TuiHovered, typeof i4.TuiButton, typeof i5.TuiButtonLoading, typeof i4.TuiLabel], [typeof i1.ScPreviewSampleComponent]>;
18
17
  static ɵinj: i0.ɵɵInjectorDeclaration<ScPreviewSampleModule>;
19
18
  }
@@ -1,2 +1,3 @@
1
1
  export * from './sc-help-notification.service';
2
2
  export * from './print.service';
3
+ export * from './sc-scripts.service';
@@ -0,0 +1,51 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Сервис для вставки в {@link Document} внешних и дополнительных скриптов.
5
+ */
6
+ export declare class ScScriptsService {
7
+ /**
8
+ * Объект {@link Document}, предоставляющий доступ к DOM страницы.
9
+ */
10
+ private readonly document;
11
+ /**
12
+ * Объект {@link Renderer2}, предоставляющий доступ к DOM страницы.
13
+ */
14
+ private readonly renderer;
15
+ /**
16
+ * Признак того, что скрипт выполняется в браузере.
17
+ */
18
+ private readonly isBrowser;
19
+ /**
20
+ * {@link NgZone} для вставки скриптов вне зоны Angular.
21
+ */
22
+ private readonly ngZone;
23
+ /**
24
+ * Вставляет в конец {@link Document.body} скрипты, заданные строками HTML, вне зоны Angular. Из каждой строки берётся первый `<script>`. На сервере ничего не делает.
25
+ * Принимает только доверенные строки из конфигурации приложения: строка разбирается как HTML и может выполнить код.
26
+ *
27
+ * @param scriptStrings Строки HTML скриптов.
28
+ */
29
+ appendScripts(scriptStrings: readonly string[]): void;
30
+ /**
31
+ * Загружает внешний скрипт: при подписке добавляет его в {@link Document.head}, после загрузки выдаёт элемент скрипта и завершается.
32
+ * Если скрипт не загрузился или подписка отменена раньше, удаляет его со страницы; удаление не отменяет загрузку и выполнение уже вставленного скрипта. На сервере завершается без загрузки.
33
+ *
34
+ * @param url Адрес скрипта.
35
+ */
36
+ loadScript$(url: string): Observable<HTMLScriptElement>;
37
+ /**
38
+ * Удаляет скрипт со страницы. При подключённых анимациях Angular узел удаляется при ближайшей проверке изменений.
39
+ *
40
+ * @param script Элемент скрипта.
41
+ */
42
+ removeScript(script: HTMLScriptElement): void;
43
+ /**
44
+ * Создаёт {@link HTMLScriptElement} из строки HTML скрипта.
45
+ *
46
+ * @param scriptString Строка HTML скрипта.
47
+ */
48
+ private createScript;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScScriptsService, never>;
50
+ static ɵprov: i0.ɵɵInjectableDeclaration<ScScriptsService>;
51
+ }
@@ -0,0 +1,4 @@
1
+ export * from './interfaces';
2
+ export * from './sc-smart-captcha.component';
3
+ export * from './services';
4
+ export * from './tokens';
@@ -0,0 +1,5 @@
1
+ export * from './sc-smart-captcha-api';
2
+ export * from './sc-smart-captcha-event';
3
+ export * from './sc-smart-captcha-language';
4
+ export * from './sc-smart-captcha-render-params';
5
+ export * from './sc-smart-captcha-settings';
@@ -0,0 +1,36 @@
1
+ import { ScSmartCaptchaEvent } from './sc-smart-captcha-event';
2
+ import { ScSmartCaptchaRenderParams } from './sc-smart-captcha-render-params';
3
+ /**
4
+ * API Yandex SmartCaptcha, доступное в `window.smartCaptcha` после загрузки скрипта.
5
+ *
6
+ * @see [Методы window.smartCaptcha](https://yandex.cloud/ru/docs/smartcaptcha/concepts/widget-methods#methods)
7
+ */
8
+ export interface ScSmartCaptchaApi {
9
+ /**
10
+ * Отрисовывает виджет в контейнере и возвращает идентификатор виджета (может быть равен `0`).
11
+ *
12
+ * @param container Контейнер для виджета.
13
+ * @param params Параметры отрисовки.
14
+ */
15
+ render: (container: HTMLElement, params: ScSmartCaptchaRenderParams) => number;
16
+ /**
17
+ * Сбрасывает виджет в начальное состояние.
18
+ *
19
+ * @param widgetId Идентификатор виджета.
20
+ */
21
+ reset: (widgetId: number) => void;
22
+ /**
23
+ * Удаляет виджет и созданные им элементы и обработчики.
24
+ *
25
+ * @param widgetId Идентификатор виджета.
26
+ */
27
+ destroy: (widgetId: number) => void;
28
+ /**
29
+ * Подписывает обработчик на событие виджета и возвращает функцию отписки.
30
+ *
31
+ * @param widgetId Идентификатор виджета.
32
+ * @param event Событие виджета.
33
+ * @param callback Обработчик события, для события `success` получает токен.
34
+ */
35
+ subscribe: (widgetId: number, event: ScSmartCaptchaEvent, callback: (payload?: unknown) => void) => () => void;
36
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Событие виджета Yandex SmartCaptcha, на которое можно подписаться.
3
+ */
4
+ export type ScSmartCaptchaEvent = 'challenge-visible' | 'challenge-hidden' | 'network-error' | 'javascript-error' | 'success' | 'token-expired';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Язык виджета Yandex SmartCaptcha.
3
+ */
4
+ export type ScSmartCaptchaLanguage = 'ru' | 'en' | 'be' | 'kk' | 'tt' | 'uk' | 'uz' | 'tr';
@@ -0,0 +1,16 @@
1
+ import { ScSmartCaptchaLanguage } from './sc-smart-captcha-language';
2
+ /**
3
+ * Параметры отрисовки виджета Yandex SmartCaptcha.
4
+ *
5
+ * @see [Метод render](https://yandex.cloud/ru/docs/smartcaptcha/concepts/widget-methods#render)
6
+ */
7
+ export interface ScSmartCaptchaRenderParams {
8
+ /**
9
+ * Ключ клиентской части.
10
+ */
11
+ sitekey: string;
12
+ /**
13
+ * Язык виджета.
14
+ */
15
+ hl?: ScSmartCaptchaLanguage;
16
+ }
@@ -0,0 +1,16 @@
1
+ import { ScSmartCaptchaLanguage } from './sc-smart-captcha-language';
2
+ /**
3
+ * Настройки Yandex SmartCaptcha.
4
+ */
5
+ export interface ScSmartCaptchaSettings {
6
+ /**
7
+ * Ключ клиентской части.
8
+ *
9
+ * @see [Ключи капчи](https://yandex.cloud/ru/docs/smartcaptcha/concepts/keys)
10
+ */
11
+ sitekey: string;
12
+ /**
13
+ * Язык виджета.
14
+ */
15
+ language: ScSmartCaptchaLanguage;
16
+ }
@@ -0,0 +1,14 @@
1
+ import { ScSmartCaptchaApi } from './sc-smart-captcha-api';
2
+ /**
3
+ * Окно браузера с API Yandex SmartCaptcha.
4
+ */
5
+ export interface ScSmartCaptchaWindow extends Window {
6
+ /**
7
+ * API Yandex SmartCaptcha, появляется после загрузки скрипта.
8
+ */
9
+ smartCaptcha?: ScSmartCaptchaApi;
10
+ /**
11
+ * Обработчик загрузки скрипта, имя которого передаётся в параметре `onload` адреса скрипта.
12
+ */
13
+ scSmartCaptchaOnload?: () => void;
14
+ }
@@ -0,0 +1,92 @@
1
+ import { WritableSignal } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Виджет Yandex SmartCaptcha. Значение поля ввода - токен прохождения проверки, `null` пока проверка не пройдена или токен истёк.
6
+ */
7
+ export declare class ScSmartCaptchaComponent implements ControlValueAccessor {
8
+ /**
9
+ * Контейнер, в котором отрисовывается виджет.
10
+ */
11
+ private readonly container;
12
+ /**
13
+ * Настройки Yandex SmartCaptcha.
14
+ */
15
+ private readonly settings;
16
+ /**
17
+ * Сервис загрузки скрипта Yandex SmartCaptcha.
18
+ */
19
+ private readonly loader;
20
+ /**
21
+ * {@link NgZone} для отрисовки виджета вне зоны Angular и возврата его событий в зону.
22
+ */
23
+ private readonly ngZone;
24
+ /**
25
+ * Ссылка для автоматического управления уничтожением зависимостей.
26
+ */
27
+ private readonly destroyRef;
28
+ /**
29
+ * Признак того, что капчу не удалось загрузить.
30
+ */
31
+ protected readonly hasError: WritableSignal<boolean>;
32
+ /**
33
+ * API Yandex SmartCaptcha, в котором отрисован виджет.
34
+ */
35
+ private api?;
36
+ /**
37
+ * Идентификатор отрисованного виджета.
38
+ */
39
+ private widgetId?;
40
+ /**
41
+ * Функции отписки от событий виджета.
42
+ */
43
+ private unsubscribers;
44
+ /**
45
+ * Обработчик изменения значения поля ввода.
46
+ */
47
+ private onChange;
48
+ /**
49
+ * Обработчик касания поля ввода.
50
+ */
51
+ private onTouched;
52
+ /**
53
+ * Инициализирует экземпляр класса {@link ScSmartCaptchaComponent}.
54
+ */
55
+ constructor();
56
+ /** @inheritDoc */
57
+ writeValue(token: string | null): void;
58
+ /** @inheritDoc */
59
+ registerOnChange(onChange: (token: string | null) => void): void;
60
+ /** @inheritDoc */
61
+ registerOnTouched(onTouched: () => void): void;
62
+ /**
63
+ * Повторяет загрузку капчи после ошибки.
64
+ */
65
+ protected retry(): void;
66
+ /**
67
+ * Загружает API Yandex SmartCaptcha и отрисовывает виджет (API приходит вне зоны Angular). При ошибке загрузки или отрисовки показывает сообщение.
68
+ */
69
+ private load;
70
+ /**
71
+ * Отрисовывает виджет и подписывается на его события.
72
+ *
73
+ * @param api API Yandex SmartCaptcha.
74
+ */
75
+ private render;
76
+ /**
77
+ * Передаёт форме новое значение токена.
78
+ *
79
+ * @param token Токен прохождения проверки.
80
+ */
81
+ private updateValue;
82
+ /**
83
+ * Удаляет виджет, очищает токен и показывает сообщение об ошибке.
84
+ */
85
+ private showError;
86
+ /**
87
+ * Удаляет виджет вместе с созданными им элементами и обработчиками.
88
+ */
89
+ private destroyWidget;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScSmartCaptchaComponent, never>;
91
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScSmartCaptchaComponent, "sc-smart-captcha", never, {}, {}, never, never, true, never>;
92
+ }
@@ -0,0 +1 @@
1
+ export * from './sc-smart-captcha-loader.service';