@snabcentr/client-ui 3.9.4 → 3.10.0

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.

@@ -0,0 +1,123 @@
1
+ import { InputSignal, OutputEmitterRef } from '@angular/core';
2
+ import { FormControl, FormGroup } from '@angular/forms';
3
+ import { ScFeedbackForm, ScISuggestionType, ScUploadedFile } from '@snabcentr/client-core';
4
+ import { TuiDialogContext } from '@taiga-ui/core';
5
+ import { TuiFileLike } from '@taiga-ui/kit';
6
+ import { Observable, Subject } from 'rxjs';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * Компонент формы обратной связи.
10
+ */
11
+ export declare class ScFeedbackFormComponent {
12
+ /**
13
+ * Условное название блока где расположена ссылка.
14
+ */
15
+ readonly formSlag: InputSignal<keyof typeof ScFeedbackForm>;
16
+ /**
17
+ * Событие нажатия на кнопку договора оферты.
18
+ */
19
+ readonly onClickOffer: OutputEmitterRef<void>;
20
+ /**
21
+ * Событие успешной отправки формы.
22
+ */
23
+ readonly onSendSuccess: OutputEmitterRef<void>;
24
+ /**
25
+ * Сервис обратной связи.
26
+ */
27
+ private readonly feedbackService;
28
+ /**
29
+ * Сервис конвертации данных.
30
+ */
31
+ private readonly convertersService;
32
+ /**
33
+ * Максимальное количество файлов, отправляемых в форме.
34
+ */
35
+ private readonly maxFilesInForm;
36
+ /**
37
+ * Сервис данных о пользователе.
38
+ */
39
+ private readonly user$;
40
+ /**
41
+ * Контекст диалогового окна, в котором открыт компонент.
42
+ */
43
+ protected readonly context: TuiDialogContext<void, {
44
+ onClickOfferHandler: () => void;
45
+ formSlag: keyof typeof ScFeedbackForm;
46
+ }> | null;
47
+ /**
48
+ * Поле ввода для recaptcha.
49
+ */
50
+ protected readonly recaptchaControl: FormControl<string | null>;
51
+ /**
52
+ * Группа полей ввода для формы «Пожелания и предложения по улучшению сайта».
53
+ */
54
+ protected readonly form: FormGroup<{
55
+ name: FormControl<string | null>;
56
+ phone: FormControl<string | null>;
57
+ email: FormControl<string | null>;
58
+ message: FormControl<string | null>;
59
+ files: FormControl<ScUploadedFile[] | null>;
60
+ }>;
61
+ /**
62
+ * Перечисление типов подсказок.
63
+ */
64
+ protected readonly suggestionType: typeof ScISuggestionType;
65
+ /**
66
+ * {@link Subject} события отправки формы.
67
+ */
68
+ protected readonly onSubmit: Subject<void>;
69
+ /**
70
+ * {@link Observable} запроса на отправку данных.
71
+ */
72
+ protected readonly request$: Observable<undefined | null>;
73
+ /**
74
+ * {@link Observable} изменения состояния загрузки данных.
75
+ */
76
+ protected readonly loading$: Observable<boolean>;
77
+ /**
78
+ * Управляет состоянием загруженных файлов.
79
+ */
80
+ protected readonly loadedFile: FormControl<TuiFileLike[] | null>;
81
+ /**
82
+ * Observable, который отслеживает, приняты ли файлы в соответствии с требованиями по типу размеру и т.д.
83
+ */
84
+ protected readonly accepted$: Observable<File[]>;
85
+ /**
86
+ * Список файлов, которые были отклонены при загрузке.
87
+ */
88
+ protected rejected: readonly File[];
89
+ /**
90
+ * Инициализирует экземпляр класса {@link ScFeedbackFormComponent}.
91
+ */
92
+ constructor();
93
+ /**
94
+ * Обрабатывает отклоненные файлы.
95
+ *
96
+ * @param files Список файлов, которые были отклонены.
97
+ */
98
+ protected onReject(files: readonly File[]): void;
99
+ /**
100
+ * Удаляет файл из списка загруженных и отклоненных файлов.
101
+ *
102
+ * @param file Файл, который нужно удалить.
103
+ */
104
+ protected onRemove(file: File): void;
105
+ /**
106
+ * Загружает файл в форму обратной связи.
107
+ *
108
+ * @param files Набор файлов.
109
+ */
110
+ private onUploadFile;
111
+ /**
112
+ * Проверяет количество файлов загруженных пользователем.
113
+ *
114
+ * @param maxLength максимальное допустимое количество файлов для отправки.
115
+ */
116
+ private maxFilesLength;
117
+ /**
118
+ * Выполняет очистку полей формы.
119
+ */
120
+ private resetForm;
121
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScFeedbackFormComponent, never>;
122
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScFeedbackFormComponent, "sc-feedback-form", never, { "formSlag": { "alias": "formSlag"; "required": true; "isSignal": true; }; }, { "onClickOffer": "onClickOffer"; "onSendSuccess": "onSendSuccess"; }, never, never, true, never>;
123
+ }
@@ -0,0 +1,20 @@
1
+ import { TuiDialogContext } from '@taiga-ui/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Компонент «Спасибо!».
5
+ */
6
+ export declare class ScGratitudeComponent {
7
+ /**
8
+ * Контекст диалогового окна, в котором открыт компонент.
9
+ */
10
+ protected readonly context: TuiDialogContext<void, {
11
+ autoClose: number;
12
+ subTitle: string;
13
+ }> | null;
14
+ /**
15
+ * Инициализирует экземпляр класса {@link ScGratitudeComponent}.
16
+ */
17
+ constructor();
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScGratitudeComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScGratitudeComponent, "sc-gratitude", never, {}, {}, never, never, true, never>;
20
+ }
@@ -0,0 +1,2 @@
1
+ export * from './feedback-form/sc-feedback-form.component';
2
+ export * from './gratitude/sc-gratitude.component';