@snabcentr/client-ui 3.19.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 (40) hide show
  1. package/catalog/sc-catalog.module.d.ts +2 -1
  2. package/directives/index.d.ts +1 -0
  3. package/directives/sc-date-value-transformer.directive.d.ts +8 -0
  4. package/esm2022/cart/cart-item/sc-cart-item.component.mjs +5 -3
  5. package/esm2022/catalog/cost-with-discount/cost-with-discount.component.mjs +4 -3
  6. package/esm2022/catalog/price-card/sc-price-card.component.mjs +4 -3
  7. package/esm2022/catalog/price-card-inline/sc-price-card-inline.component.mjs +5 -3
  8. package/esm2022/catalog/price-warehouse-stock/sc-price-warehouse-stock.component.mjs +4 -3
  9. package/esm2022/catalog/sc-catalog.module.mjs +5 -2
  10. package/esm2022/directives/index.mjs +2 -1
  11. package/esm2022/directives/sc-date-value-transformer.directive.mjs +30 -0
  12. package/esm2022/files/files-and-documents/files-and-documents.component.mjs +4 -3
  13. package/esm2022/files/files-and-documents.module.mjs +4 -3
  14. package/esm2022/news/news-card/sc-news-card.component.mjs +4 -3
  15. package/esm2022/news/sc-news.module.mjs +4 -3
  16. package/esm2022/pipes/index.mjs +2 -1
  17. package/esm2022/pipes/sc-format-date.mjs +33 -0
  18. package/esm2022/providers/date-value-transformer/index.mjs +4 -0
  19. package/esm2022/providers/date-value-transformer/sc-date-value-transformer-types.mjs +2 -0
  20. package/esm2022/providers/date-value-transformer/sc-date-value-transformer-with-end-time.mjs +26 -0
  21. package/esm2022/providers/date-value-transformer/sc-date-value-transformer-with-start-time.mjs +37 -0
  22. package/esm2022/providers/index.mjs +3 -1
  23. package/esm2022/providers/sc-date-formatter.mjs +12 -0
  24. package/esm2022/providers/sc-date-value-transformer.mjs +12 -0
  25. package/fesm2022/snabcentr-client-ui.mjs +203 -65
  26. package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
  27. package/files/files-and-documents.module.d.ts +2 -1
  28. package/news/sc-news.module.d.ts +2 -1
  29. package/package.json +1 -1
  30. package/pipes/index.d.ts +1 -0
  31. package/pipes/sc-format-date.d.ts +20 -0
  32. package/providers/date-value-transformer/index.d.ts +3 -0
  33. package/providers/date-value-transformer/sc-date-value-transformer-types.d.ts +9 -0
  34. package/providers/date-value-transformer/sc-date-value-transformer-with-end-time.d.ts +16 -0
  35. package/providers/date-value-transformer/sc-date-value-transformer-with-start-time.d.ts +22 -0
  36. package/providers/index.d.ts +2 -0
  37. package/providers/sc-date-formatter.d.ts +6 -0
  38. package/providers/sc-date-value-transformer.d.ts +5 -0
  39. package/release_notes.tmp +3 -3
  40. package/styles/tailwind/tailwind.scss +0 -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.19.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",
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
+ }
@@ -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
+ }
@@ -6,3 +6,5 @@ export * from './sc-max-files-in-form-input';
6
6
  export * from './sc-page-size-options';
7
7
  export * from './sc-country-ids';
8
8
  export * from './sc-user-providers';
9
+ export * from './sc-date-formatter';
10
+ export * from './sc-date-value-transformer';
@@ -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[];
package/release_notes.tmp CHANGED
@@ -1,6 +1,6 @@
1
- ## 3.19.0 (2025-04-17)
1
+ ## 3.20.0 (2025-04-24)
2
2
 
3
- ### changed (1 change)
3
+ ### added (1 change)
4
4
 
5
- - [#11479: Отключена возможность добавить адрес доставки через форму в профиле....](web_soft/libs/angular/snabcentr-client-ui-lib@ffebe1944bc848bf2a8705bf6e39b92351091563) ([merge request](web_soft/libs/angular/snabcentr-client-ui-lib!265))
5
+ - [#11514: Добавлено форматирование даты в компонентах. Вынесен провайдер...](web_soft/libs/angular/snabcentr-client-ui-lib@96e5d6fc0ae66f56cf2188b0478c61a5efe1d4e0) ([merge request](web_soft/libs/angular/snabcentr-client-ui-lib!266))
6
6
 
@@ -886,10 +886,6 @@ video {
886
886
  height: 1rem;
887
887
  }
888
888
 
889
- .h-50 {
890
- height: 12.5rem;
891
- }
892
-
893
889
  .h-56 {
894
890
  height: 14rem;
895
891
  }