@snabcentr/client-ui 3.18.0 → 3.20.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.
Files changed (61) hide show
  1. package/accordion/sc-accordion.component.d.ts +5 -1
  2. package/catalog/sc-catalog.module.d.ts +2 -1
  3. package/delivery-address/add-delivery-address-dialog/sc-add-delivery-address-dialog.component.d.ts +9 -1
  4. package/delivery-address/delivery-address-accordion/sc-delivery-address-accordion.component.d.ts +9 -1
  5. package/delivery-address/sc-delivery-address.module.d.ts +2 -1
  6. package/directives/index.d.ts +1 -0
  7. package/directives/sc-date-value-transformer.directive.d.ts +8 -0
  8. package/esm2022/accordion/sc-accordion.component.mjs +8 -4
  9. package/esm2022/cart/cart-item/sc-cart-item.component.mjs +5 -3
  10. package/esm2022/catalog/cost-with-discount/cost-with-discount.component.mjs +4 -3
  11. package/esm2022/catalog/price-card/sc-price-card.component.mjs +4 -3
  12. package/esm2022/catalog/price-card-inline/sc-price-card-inline.component.mjs +5 -3
  13. package/esm2022/catalog/price-warehouse-stock/sc-price-warehouse-stock.component.mjs +4 -3
  14. package/esm2022/catalog/sc-catalog.module.mjs +5 -2
  15. package/esm2022/contacts/contacts-accordion/sc-contacts-accordion.component.mjs +1 -1
  16. package/esm2022/contragents/contragents-accordion/contragents-accordion-item/sc-contragents-accordion-item.component.mjs +1 -1
  17. package/esm2022/contragents/contragents-accordion/sc-contragents-accordion.component.mjs +1 -1
  18. package/esm2022/delivery-address/add-delivery-address-dialog/sc-add-delivery-address-dialog.component.mjs +14 -3
  19. package/esm2022/delivery-address/delivery-address-accordion/delivery-address-accordion-item/sc-delivery-address-accordion-item.component.mjs +1 -1
  20. package/esm2022/delivery-address/delivery-address-accordion/sc-delivery-address-accordion.component.mjs +17 -5
  21. package/esm2022/delivery-address/sc-delivery-address.module.mjs +12 -5
  22. package/esm2022/directives/index.mjs +2 -1
  23. package/esm2022/directives/sc-date-value-transformer.directive.mjs +30 -0
  24. package/esm2022/files/files-and-documents/files-and-documents.component.mjs +4 -3
  25. package/esm2022/files/files-and-documents.module.mjs +4 -3
  26. package/esm2022/form-fields/addresses-selection-field/sc-addresses-selection-field.component.mjs +4 -4
  27. package/esm2022/news/news-card/sc-news-card.component.mjs +4 -3
  28. package/esm2022/news/sc-news.module.mjs +4 -3
  29. package/esm2022/pipes/index.mjs +2 -1
  30. package/esm2022/pipes/sc-format-date.mjs +33 -0
  31. package/esm2022/profile/sc-profile-accordions-content/sc-profile-accordions-content.component.mjs +42 -54
  32. package/esm2022/providers/date-value-transformer/index.mjs +4 -0
  33. package/esm2022/providers/date-value-transformer/sc-date-value-transformer-types.mjs +2 -0
  34. package/esm2022/providers/date-value-transformer/sc-date-value-transformer-with-end-time.mjs +26 -0
  35. package/esm2022/providers/date-value-transformer/sc-date-value-transformer-with-start-time.mjs +37 -0
  36. package/esm2022/providers/index.mjs +4 -1
  37. package/esm2022/providers/sc-country-ids.mjs +6 -0
  38. package/esm2022/providers/sc-date-formatter.mjs +12 -0
  39. package/esm2022/providers/sc-date-value-transformer.mjs +12 -0
  40. package/esm2022/providers/sc-user-providers.mjs +24 -18
  41. package/esm2022/services/sc-help-notification.service.mjs +11 -3
  42. package/fesm2022/snabcentr-client-ui.mjs +277 -108
  43. package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
  44. package/files/files-and-documents.module.d.ts +2 -1
  45. package/news/sc-news.module.d.ts +2 -1
  46. package/package.json +2 -2
  47. package/pipes/index.d.ts +1 -0
  48. package/pipes/sc-format-date.d.ts +20 -0
  49. package/profile/sc-profile-accordions-content/sc-profile-accordions-content.component.d.ts +21 -24
  50. package/providers/date-value-transformer/index.d.ts +3 -0
  51. package/providers/date-value-transformer/sc-date-value-transformer-types.d.ts +9 -0
  52. package/providers/date-value-transformer/sc-date-value-transformer-with-end-time.d.ts +16 -0
  53. package/providers/date-value-transformer/sc-date-value-transformer-with-start-time.d.ts +22 -0
  54. package/providers/index.d.ts +3 -0
  55. package/providers/sc-country-ids.d.ts +5 -0
  56. package/providers/sc-date-formatter.d.ts +6 -0
  57. package/providers/sc-date-value-transformer.d.ts +5 -0
  58. package/providers/sc-user-providers.d.ts +10 -6
  59. package/release_notes.tmp +3 -3
  60. package/services/sc-help-notification.service.d.ts +8 -0
  61. package/styles/tailwind/tailwind.scss +4 -4
@@ -6,11 +6,12 @@ import * as i4 from "./file-tree-item/file-tree-item.component";
6
6
  import * as i5 from "@angular/common";
7
7
  import * as i6 from "@taiga-ui/kit";
8
8
  import * as i7 from "@taiga-ui/core";
9
+ import * as i8 from "../pipes/sc-format-date";
9
10
  /**
10
11
  * Модуль файлов и документов.
11
12
  */
12
13
  export declare class FilesAndDocumentsModule {
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<FilesAndDocumentsModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<FilesAndDocumentsModule, [typeof i1.FilesAndDocumentsComponent, typeof i2.TreeDirective, typeof i3.TreeTopDirective, typeof i4.FileTreeItemComponent], [typeof i5.CommonModule, typeof i6.TuiTreeComponent, typeof i6.TuiTreeItem, typeof i6.TuiTreeItemContent, typeof i6.TuiTreeChildren, typeof i6.TuiTreeItemController, typeof i6.TuiTreeControllerDirective, typeof i6.TuiTreeNode, typeof i7.TuiIcon, typeof i7.TuiLoader, typeof i7.TuiLink], [typeof i1.FilesAndDocumentsComponent]>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FilesAndDocumentsModule, [typeof i1.FilesAndDocumentsComponent, typeof i2.TreeDirective, typeof i3.TreeTopDirective, typeof i4.FileTreeItemComponent], [typeof i5.CommonModule, typeof i6.TuiTreeComponent, typeof i6.TuiTreeItem, typeof i6.TuiTreeItemContent, typeof i6.TuiTreeChildren, typeof i6.TuiTreeItemController, typeof i6.TuiTreeControllerDirective, typeof i6.TuiTreeNode, typeof i7.TuiIcon, typeof i7.TuiLoader, typeof i7.TuiLink, typeof i8.ScFormatDatePipe], [typeof i1.FilesAndDocumentsComponent]>;
15
16
  static ɵinj: i0.ɵɵInjectorDeclaration<FilesAndDocumentsModule>;
16
17
  }
@@ -4,11 +4,12 @@ import * as i2 from "./news-card-skeleton/sc-news-card-skeleton.component";
4
4
  import * as i3 from "@angular/common";
5
5
  import * as i4 from "@angular/router";
6
6
  import * as i5 from "../share-button/sc-share-button.module";
7
+ import * as i6 from "../pipes/sc-format-date";
7
8
  /**
8
9
  * Модуль работы с новостями.
9
10
  */
10
11
  export declare class ScNewsModule {
11
12
  static ɵfac: i0.ɵɵFactoryDeclaration<ScNewsModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<ScNewsModule, [typeof i1.ScNewsCardComponent, typeof i2.ScNewsCardSkeletonComponent], [typeof i3.CommonModule, typeof i4.RouterModule, typeof i5.ScShareButtonModule], [typeof i1.ScNewsCardComponent, typeof i2.ScNewsCardSkeletonComponent]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ScNewsModule, [typeof i1.ScNewsCardComponent, typeof i2.ScNewsCardSkeletonComponent], [typeof i3.CommonModule, typeof i4.RouterModule, typeof i5.ScShareButtonModule, typeof i6.ScFormatDatePipe], [typeof i1.ScNewsCardComponent, typeof i2.ScNewsCardSkeletonComponent]>;
13
14
  static ɵinj: i0.ɵɵInjectorDeclaration<ScNewsModule>;
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snabcentr/client-ui",
3
- "version": "3.18.0",
3
+ "version": "3.20.0",
4
4
  "author": "Snabcentr Ltd.",
5
5
  "repository": "https://gitlab.snabcentr.met/web/angular/snabcentr-client-ui-lib",
6
6
  "license": "Commercial",
@@ -15,7 +15,7 @@
15
15
  "@maskito/core": "^3.2.0",
16
16
  "@ng-web-apis/intersection-observer": "^4.11.1",
17
17
  "@ng-web-apis/common": "^4.11.1",
18
- "@snabcentr/client-core": "^2.24.3",
18
+ "@snabcentr/client-core": "^2.43.0",
19
19
  "@taiga-ui/addon-charts": "^4.24.0",
20
20
  "@taiga-ui/addon-commerce": "^4.24.0",
21
21
  "@taiga-ui/cdk": "^4.24.0",
package/pipes/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export * from './sc-format-date';
1
2
  export * from './sc-phone-format';
@@ -0,0 +1,20 @@
1
+ import type { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Пайп для форматирования даты и времени.
5
+ */
6
+ export declare class ScFormatDatePipe implements PipeTransform {
7
+ /**
8
+ * Функция форматирования даты и времени.
9
+ */
10
+ private readonly formatter;
11
+ /**
12
+ * Форматирует строку даты через {@link SC_DATE_FORMATTER}.
13
+ *
14
+ * @param timeString - Строка времени.
15
+ * @returns Форматированная дата и время.
16
+ */
17
+ transform(timeString?: string): string | undefined;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScFormatDatePipe, never>;
19
+ static ɵpipe: i0.ɵɵPipeDeclaration<ScFormatDatePipe, "scFormatDate", true>;
20
+ }
@@ -1,20 +1,32 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
- import { ScContragent, ScIBankAccount, ScICity, ScIContact, ScIDeliveryAddress, ScLocationsService, ScUser, ScUserService, ScVerificationService } from '@snabcentr/client-core';
3
+ import { ScContragent, ScIBankAccount, ScICityWithRegionAndCountry, ScIContact, ScIDeliveryAddress, ScUser } from '@snabcentr/client-core';
4
4
  import { Observable, Subject } from 'rxjs';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
7
  * Компонент контента профиля пользователя в виде раскрывающихся смысловых блоков.
8
8
  */
9
9
  export declare class ScProfileAccordionsContentComponent {
10
- readonly user$: Observable<ScUser>;
11
- private readonly locationsService;
10
+ /**
11
+ * Сервис данных о пользователе.
12
+ */
12
13
  private readonly userService;
14
+ /**
15
+ * Сервис верификации.
16
+ */
13
17
  private readonly verificationService;
18
+ /**
19
+ * Поток данных о текущем пользователе.
20
+ */
21
+ protected readonly user$: Observable<ScUser>;
22
+ /**
23
+ * Поток данных о текущем городе пользователя.
24
+ */
25
+ protected readonly userCity$: Observable<ScICityWithRegionAndCountry>;
14
26
  /**
15
27
  * {@link FormControl} переключателя 'Я хочу получать рассылку'.
16
28
  */
17
- getNewsControl: FormControl<boolean>;
29
+ protected getNewsControl: FormControl<boolean>;
18
30
  /**
19
31
  * {@link Observable} запроса изменения признака пользователя 'Я хочу получать рассылку'.
20
32
  */
@@ -22,11 +34,11 @@ export declare class ScProfileAccordionsContentComponent {
22
34
  /**
23
35
  * {@link Observable} изменения состояния загрузки данных изменения признака пользователя 'Я хочу получать рассылку'.
24
36
  */
25
- readonly getNewsLoading$: Observable<boolean>;
37
+ protected readonly getNewsLoading$: Observable<boolean>;
26
38
  /**
27
39
  * {@link Subject} события отправки сообщения для подтверждения адреса электронной почты.
28
40
  */
29
- readonly onSendApproveEmail: Subject<string>;
41
+ protected readonly onSendApproveEmail: Subject<string>;
30
42
  /**
31
43
  * {@link Observable} запроса данных аутентификации.
32
44
  */
@@ -34,15 +46,15 @@ export declare class ScProfileAccordionsContentComponent {
34
46
  /**
35
47
  * {@link Observable} изменения состояния загрузки данных отправки сообщения для подтверждения адреса электронной почты.
36
48
  */
37
- readonly approveEmailLoading$: Observable<boolean>;
49
+ protected readonly approveEmailLoading$: Observable<boolean>;
38
50
  /**
39
51
  * {@link Observable} изменения состояния признака, отправлено ли сообщение для подтверждения адреса электронной почты.
40
52
  */
41
- readonly isSendApproveEmail$: Observable<boolean>;
53
+ protected readonly isSendApproveEmail$: Observable<boolean>;
42
54
  /**
43
55
  * {@link Observable} изменения списка контактных лиц пользователя.
44
56
  */
45
- readonly userContacts$: Observable<ScIContact[] | null>;
57
+ protected readonly userContacts$: Observable<ScIContact[] | null>;
46
58
  /**
47
59
  * Событие нажатия на кнопку редактирование профиля пользователя.
48
60
  */
@@ -105,21 +117,6 @@ export declare class ScProfileAccordionsContentComponent {
105
117
  * Событие нажатия на кнопку удаления контактного лица у клиента.
106
118
  */
107
119
  deleteUserContactClick: EventEmitter<ScIContact>;
108
- /**
109
- * Инициализирует экземпляр класса {@link ScProfileComponent}.
110
- *
111
- * @param user$ Поток данных о текущем пользователе.
112
- * @param locationsService Сервис для получения списков стран, регионов, городов.
113
- * @param userService Сервис данных о пользователе.
114
- * @param verificationService Сервис верификации.
115
- */
116
- constructor(user$: Observable<ScUser>, locationsService: ScLocationsService, userService: ScUserService, verificationService: ScVerificationService);
117
- /**
118
- * Создает запрос получения данных о городе текущего пользователя по идентификатору города.
119
- *
120
- * @param cityId Идентификатор записи города.
121
- */
122
- getUserCity$(cityId: number): Observable<ScICity>;
123
120
  static ɵfac: i0.ɵɵFactoryDeclaration<ScProfileAccordionsContentComponent, never>;
124
121
  static ɵcmp: i0.ɵɵComponentDeclaration<ScProfileAccordionsContentComponent, "sc-profile-accordions-content", never, {}, { "editProfileClick": "editProfileClick"; "approvePhoneClick": "approvePhoneClick"; "addContragentClick": "addContragentClick"; "deleteContragentClick": "deleteContragentClick"; "addContragentBankAccountClick": "addContragentBankAccountClick"; "deleteContragentBankAccountClick": "deleteContragentBankAccountClick"; "addContragentContactClick": "addContragentContactClick"; "deleteContragentContactClick": "deleteContragentContactClick"; "addDeliveryAddressClick": "addDeliveryAddressClick"; "deleteDeliveryAddressClick": "deleteDeliveryAddressClick"; "addDeliveryAddressContactClick": "addDeliveryAddressContactClick"; "deleteDeliveryAddressContactClick": "deleteDeliveryAddressContactClick"; "addUserContactClick": "addUserContactClick"; "deleteUserContactClick": "deleteUserContactClick"; }, never, never, false, never>;
125
122
  }
@@ -0,0 +1,3 @@
1
+ export * from './sc-date-value-transformer-types';
2
+ export * from './sc-date-value-transformer-with-start-time';
3
+ export * from './sc-date-value-transformer-with-end-time';
@@ -0,0 +1,9 @@
1
+ import { TuiDay } from '@taiga-ui/cdk';
2
+ /**
3
+ * Изначальный тип данных преобразования даты.
4
+ */
5
+ export type From = TuiDay | null;
6
+ /**
7
+ * Конечный тип данных преобразования даты.
8
+ */
9
+ export type To = string | null;
@@ -0,0 +1,16 @@
1
+ import { From, To } from './sc-date-value-transformer-types';
2
+ import { DateValueTransformerWithStartTime } from './sc-date-value-transformer-with-start-time';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Преобразователь даты формата "YYYY-MM-DD 23:59:59".
6
+ */
7
+ export declare class DateValueTransformerWithEndTime extends DateValueTransformerWithStartTime {
8
+ /**
9
+ * Преобразует значение из {@link From} формата в {@link To} в формат "YYYY-MM-DD 23:59:59".
10
+ *
11
+ * @param componentValue Значение из компонента поля ввода.
12
+ */
13
+ toControlValue(componentValue: From): To;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateValueTransformerWithEndTime, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<DateValueTransformerWithEndTime>;
16
+ }
@@ -0,0 +1,22 @@
1
+ import { TuiValueTransformer } from '@taiga-ui/cdk';
2
+ import { From, To } from './sc-date-value-transformer-types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Преобразователь даты формата "YYYY-MM-DD 00:00:00".
6
+ */
7
+ export declare class DateValueTransformerWithStartTime extends TuiValueTransformer<From, To> {
8
+ /**
9
+ * Преобразует значение из {@link To} формата в {@link From}.
10
+ *
11
+ * @param controlValue Значение из формы поля ввода.
12
+ */
13
+ fromControlValue(controlValue: To): From;
14
+ /**
15
+ * Преобразует значение из {@link From} формата в {@link To} в формат "YYYY-MM-DD 00:00:00".
16
+ *
17
+ * @param componentValue Значение из компонента поля ввода.
18
+ */
19
+ toControlValue(componentValue: From): To;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateValueTransformerWithStartTime, never>;
21
+ static ɵprov: i0.ɵɵInjectableDeclaration<DateValueTransformerWithStartTime>;
22
+ }
@@ -4,4 +4,7 @@ export * from './sc-help-notification-limit';
4
4
  export * from './sc-help-notification-close';
5
5
  export * from './sc-max-files-in-form-input';
6
6
  export * from './sc-page-size-options';
7
+ export * from './sc-country-ids';
7
8
  export * from './sc-user-providers';
9
+ export * from './sc-date-formatter';
10
+ export * from './sc-date-value-transformer';
@@ -0,0 +1,5 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * Токен ID России.
4
+ */
5
+ export declare const CURRENT_COUNTRY_ID: InjectionToken<number>;
@@ -0,0 +1,6 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * Токен для функции форматирования даты и времени.
4
+ * По умолчанию используется формат 'DD.MM.YYYY HH:MM'.
5
+ */
6
+ export declare const SC_DATE_FORMATTER: InjectionToken<(date: string) => string>;
@@ -0,0 +1,5 @@
1
+ import { Provider } from '@angular/core';
2
+ /**
3
+ * Провайдер преобразователя даты по умолчанию.
4
+ */
5
+ export declare const tuiDateValueTransformerDefaultProvider: Provider[];
@@ -1,17 +1,21 @@
1
1
  import { InjectionToken, Provider } from '@angular/core';
2
- import { ScUser, ScUserService } from '@snabcentr/client-core';
2
+ import { ScICityWithRegionAndCountry, ScUser } from '@snabcentr/client-core';
3
3
  import { Observable } from 'rxjs';
4
4
  /**
5
5
  * Токен потока данных о текущем пользователе.
6
6
  */
7
- export declare const SC_USER_INFO: InjectionToken<Observable<ScUser | undefined>>;
7
+ export declare const SC_USER_INFO: InjectionToken<Observable<ScUser>>;
8
8
  /**
9
- * Фабрика создания потока данных о текущем пользователе.
10
- *
11
- * @param userService Сервис данных о пользователе.
9
+ * Токен потока данных о текущем городе пользователя с информацией о регионе и стране.
10
+ */
11
+ export declare const SC_USER_CITY_INFO: InjectionToken<Observable<ScICityWithRegionAndCountry>>;
12
+ /**
13
+ * Токен проверки, является ли текущая страна пользователя верной.
12
14
  */
13
- export declare function scUserFactory(userService: ScUserService): Observable<ScUser | undefined>;
15
+ export declare const IS_DEFAULT_COUNTRY: InjectionToken<Observable<boolean>>;
14
16
  /**
15
17
  * Провайдер потока данных о текущем пользователе.
18
+ *
19
+ * @deprecated
16
20
  */
17
21
  export declare const SC_USER_PROVIDERS: Provider[];
package/release_notes.tmp CHANGED
@@ -1,6 +1,6 @@
1
- ## 3.18.0 (2025-04-15)
1
+ ## 3.20.0 (2025-04-24)
2
2
 
3
- ### changed (1 change)
3
+ ### added (1 change)
4
4
 
5
- - [#11469: Убрана автоматическая прокрутка карусели.](web_soft/libs/angular/snabcentr-client-ui-lib@c6d676457cf33e4096e642cc1070e57664081595) ([merge request](web_soft/libs/angular/snabcentr-client-ui-lib!264))
5
+ - [#11514: Добавлено форматирование даты в компонентах. Вынесен провайдер...](web_soft/libs/angular/snabcentr-client-ui-lib@96e5d6fc0ae66f56cf2188b0478c61a5efe1d4e0) ([merge request](web_soft/libs/angular/snabcentr-client-ui-lib!266))
6
6
 
@@ -21,6 +21,14 @@ export declare class ScHelpNotificationService {
21
21
  * Поток для закрытия уведомлений.
22
22
  */
23
23
  private readonly close$;
24
+ /**
25
+ * Сервис для работы с пользователем.
26
+ */
27
+ private readonly userService;
28
+ /**
29
+ * Список контактов для показа в уведомлении.
30
+ */
31
+ readonly userHelpContacts: Observable<ScIOrgContact[]>;
24
32
  /**
25
33
  * Инициализирует экземпляр класса {@link ScHelpNotificationService}.
26
34
  */
@@ -708,6 +708,10 @@ video {
708
708
  margin: -0.5rem !important;
709
709
  }
710
710
 
711
+ .m-2 {
712
+ margin: 0.5rem;
713
+ }
714
+
711
715
  .mx-2 {
712
716
  margin-left: 0.5rem;
713
717
  margin-right: 0.5rem;
@@ -882,10 +886,6 @@ video {
882
886
  height: 1rem;
883
887
  }
884
888
 
885
- .h-50 {
886
- height: 12.5rem;
887
- }
888
-
889
889
  .h-56 {
890
890
  height: 14rem;
891
891
  }