@snabcentr/client-ui 0.0.22 → 0.0.24

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.

Files changed (33) hide show
  1. package/esm2020/files/directives/index.mjs +3 -0
  2. package/esm2020/files/directives/tree-top.directive.mjs +63 -0
  3. package/esm2020/files/directives/tree.directive.mjs +47 -0
  4. package/esm2020/files/file-tree-item/file-tree-item.component.mjs +18 -0
  5. package/esm2020/files/files-and-documents.component.mjs +60 -0
  6. package/esm2020/files/files-and-documents.module.mjs +26 -0
  7. package/esm2020/files/index.mjs +6 -0
  8. package/esm2020/files/interfaces/tree-node.mjs +2 -0
  9. package/esm2020/files/services/index.mjs +3 -0
  10. package/esm2020/files/services/tree-icon.service.mjs +48 -0
  11. package/esm2020/files/services/tree-loader.service.mjs +60 -0
  12. package/esm2020/news/news-card/sc-news-card.component.mjs +3 -3
  13. package/esm2020/public-api.mjs +2 -1
  14. package/esm2020/share-button/sc-share-button.component.mjs +3 -3
  15. package/fesm2015/snabcentr-client-ui.mjs +291 -9
  16. package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
  17. package/fesm2020/snabcentr-client-ui.mjs +289 -9
  18. package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
  19. package/files/directives/index.d.ts +2 -0
  20. package/files/directives/tree-top.directive.d.ts +33 -0
  21. package/files/directives/tree.directive.d.ts +35 -0
  22. package/files/file-tree-item/file-tree-item.component.d.ts +9 -0
  23. package/files/files-and-documents.component.d.ts +27 -0
  24. package/files/files-and-documents.module.d.ts +16 -0
  25. package/files/index.d.ts +5 -0
  26. package/files/interfaces/tree-node.d.ts +29 -0
  27. package/files/services/index.d.ts +2 -0
  28. package/files/services/tree-icon.service.d.ts +23 -0
  29. package/files/services/tree-loader.service.d.ts +43 -0
  30. package/package.json +1 -1
  31. package/public-api.d.ts +1 -0
  32. package/release_notes.tmp +6 -0
  33. package/styles/tailwind/tailwind.scss +23 -36
@@ -0,0 +1,2 @@
1
+ export * from './tree-top.directive';
2
+ export * from './tree.directive';
@@ -0,0 +1,33 @@
1
+ import { TreeNode } from '../interfaces/tree-node';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Директива отвечающая за корневые элементы дерева.
5
+ */
6
+ export declare class TreeTopDirective implements TreeNode {
7
+ /**
8
+ * Отображаемое имя корневого элемента дерева.
9
+ */
10
+ text: string;
11
+ /**
12
+ * Значок корневого элемента дерева.
13
+ */
14
+ icon: string;
15
+ /**
16
+ * Ссылка корневого элемента дерева.
17
+ */
18
+ link?: string;
19
+ /**
20
+ * Признак наличия дочерних элементов.
21
+ */
22
+ hasChildren: boolean;
23
+ /**
24
+ * Идентификатор корневого элемента дерева.
25
+ */
26
+ id?: number;
27
+ /**
28
+ * Дата создания корневого элемента дерева.
29
+ */
30
+ createdAt?: string;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeTopDirective, never>;
32
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TreeTopDirective, "[scTopNodeText]", never, { "text": "scTopNodeText"; "icon": "scTopNodeIcon"; "link": "scTopNodeLink"; "hasChildren": "scTopNodeChilds"; "id": "scTopNodeParent"; "createdAt": "scTopNodeDate"; }, {}, never, never, false>;
33
+ }
@@ -0,0 +1,35 @@
1
+ import { TuiHandler } from '@taiga-ui/cdk';
2
+ import { TuiTreeService } from '@taiga-ui/kit';
3
+ import { TreeNode } from '../interfaces/tree-node';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Директива отвечающая за обработку действий над элементами дерева.
7
+ */
8
+ export declare class TreeDirective {
9
+ readonly service: TuiTreeService<TreeNode>;
10
+ /**
11
+ * Карта данных дерева.
12
+ */
13
+ map: Map<TreeNode, boolean>;
14
+ /**
15
+ * Инициализирует экземпляр класса {@link TreeDirective}.
16
+ *
17
+ * @param service Сервис для работы с деревом.
18
+ */
19
+ constructor(service: TuiTreeService<TreeNode>);
20
+ /**
21
+ * Проверяет указанный элемент дерева на наличие дочерних элементов и возвращает массив дочерних элементов, если они есть, либо пустой массив.
22
+ *
23
+ * @param node Элемент дерева.
24
+ * @returns Возвращает массив типа TreeNode[].
25
+ */
26
+ childrenHandler: TuiHandler<TreeNode, readonly TreeNode[]>;
27
+ /**
28
+ * Обрабатывает нажатие на указанный элемент дерева.
29
+ *
30
+ * @param node Элемент дерева.
31
+ */
32
+ onToggled(node: TreeNode): void;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeDirective, never>;
34
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TreeDirective, "[scTree]", ["scTree"], {}, {}, never, never, false>;
35
+ }
@@ -0,0 +1,9 @@
1
+ import { TuiTreeItemContentComponent } from '@taiga-ui/kit';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Компонент для удаления стандартного значка элемента дерева.
5
+ */
6
+ export declare class FileTreeItemComponent extends TuiTreeItemContentComponent {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileTreeItemComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileTreeItemComponent, "sc-file-tree-item", never, {}, {}, never, never, false>;
9
+ }
@@ -0,0 +1,27 @@
1
+ import { ScFilesService } from '@snabcentr/client-core';
2
+ import { Observable } from 'rxjs';
3
+ import { TreeIconService } from './services/tree-icon.service';
4
+ import { TreeNode } from './interfaces/tree-node';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Компонент файлов и документов.
8
+ */
9
+ export declare class FilesAndDocumentsComponent {
10
+ readonly loading: unknown;
11
+ readonly iconService: TreeIconService;
12
+ private readonly filesService;
13
+ /**
14
+ * Данные визуализации и их начальное получение.
15
+ */
16
+ data$: Observable<TreeNode[]>;
17
+ /**
18
+ * Инициализирует экземпляр класса {@link FilesAndDocumentsComponent}.
19
+ *
20
+ * @param loading Объект отвечающий за значок загрузки, в момент раскрытия элемента дерева.
21
+ * @param iconService Сервис для определения и назначения значка элементу дерева.
22
+ * @param filesService Сервис для загрузки файлов.
23
+ */
24
+ constructor(loading: unknown, iconService: TreeIconService, filesService: ScFilesService);
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilesAndDocumentsComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<FilesAndDocumentsComponent, "sc-files-and-documents", never, {}, {}, never, never, false>;
27
+ }
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./files-and-documents.component";
3
+ import * as i2 from "./directives/tree.directive";
4
+ import * as i3 from "./directives/tree-top.directive";
5
+ import * as i4 from "./file-tree-item/file-tree-item.component";
6
+ import * as i5 from "@angular/common";
7
+ import * as i6 from "@taiga-ui/kit";
8
+ import * as i7 from "@taiga-ui/core";
9
+ /**
10
+ * Модуль файлов и документов.
11
+ */
12
+ export declare class FilesAndDocumentsModule {
13
+ 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.TuiTreeModule, typeof i7.TuiSvgModule, typeof i7.TuiLoaderModule, typeof i7.TuiLinkModule], [typeof i1.FilesAndDocumentsComponent]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<FilesAndDocumentsModule>;
16
+ }
@@ -0,0 +1,5 @@
1
+ export * from './files-and-documents.component';
2
+ export * from './files-and-documents.module';
3
+ export * from './services';
4
+ export * from './directives';
5
+ export * from './interfaces/tree-node';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Интерфейс для реализации компонентами, отображающими элемент дерева.
3
+ */
4
+ export interface TreeNode {
5
+ /**
6
+ * Признак наличия дочерних элементов.
7
+ */
8
+ hasChildren: boolean;
9
+ /**
10
+ * Отображаемое имя элемента дерева.
11
+ */
12
+ text: string;
13
+ /**
14
+ * Отображаемый значок элемента дерева.
15
+ */
16
+ icon: string;
17
+ /**
18
+ * Идентификатор элемента дерева.
19
+ */
20
+ id?: number;
21
+ /**
22
+ * Ссылка элемента дерева.
23
+ */
24
+ link?: string;
25
+ /**
26
+ * Дата создания элемента дерева.
27
+ */
28
+ createdAt?: string;
29
+ }
@@ -0,0 +1,2 @@
1
+ export * from './tree-icon.service';
2
+ export * from './tree-loader.service';
@@ -0,0 +1,23 @@
1
+ import { ScDocumentInfo } from '@snabcentr/client-core/files/classes/sc-document-info';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Сервис работающий с значками элементов дерева.
5
+ */
6
+ export declare class TreeIconService {
7
+ /**
8
+ * Назначает значок элементу дерева в зависимости от типа файла.
9
+ *
10
+ * @param info Объект пришедших данных о файле.
11
+ * @returns Возвращает название значка в виде строки.
12
+ */
13
+ getIconName(info: ScDocumentInfo): string;
14
+ /**
15
+ * Проверяет на признак наличия дочерних элементов.
16
+ *
17
+ * @param info Объект пришедших данных о файле.
18
+ * @returns Возвращает true при наличии дочерних элементов и false при их отсутсвии.
19
+ */
20
+ hasChildren(info: ScDocumentInfo): boolean;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeIconService, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<TreeIconService>;
23
+ }
@@ -0,0 +1,43 @@
1
+ import { ScFilesService } from '@snabcentr/client-core';
2
+ import { TuiTreeLoader } from '@taiga-ui/kit';
3
+ import { Observable } from 'rxjs';
4
+ import { TreeIconService } from './tree-icon.service';
5
+ import { TreeNode } from '../interfaces/tree-node';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Сервис для асинхронного раскрытия вложенности.
9
+ */
10
+ export declare class TreeLoaderService implements TuiTreeLoader<TreeNode> {
11
+ private readonly filesService;
12
+ private readonly iconService;
13
+ /**
14
+ * Инициализирует экземпляр класса {@link TreeLoaderService}
15
+ *
16
+ * @param filesService Сервис для получения файлов директории.
17
+ * @param iconService Сервис для определения и назначения значка элементу дерева.
18
+ */
19
+ constructor(filesService: ScFilesService, iconService: TreeIconService);
20
+ /**
21
+ * Загружает дочерние элементы дерева.
22
+ *
23
+ * @param item Элемент дерева.
24
+ * @returns Массив дочерних элементов.
25
+ */
26
+ loadChildren(item: TreeNode): Observable<TreeNode[]>;
27
+ /**
28
+ * Проверяет указанный элемент дерева на наличие дочерних элементов и возвращает массив дочерних элементов, если они есть, либо пустой массив.
29
+ *
30
+ * @param node Элемент дерева.
31
+ * @returns Возвращает массив типа TreeNode[].
32
+ */
33
+ hasChildren(node: TreeNode): boolean;
34
+ /**
35
+ * Загружает и заполняет массив дочерних элементов.
36
+ *
37
+ * @param id Идентификатор директории, чьи дочернии элементы загружаются.
38
+ * @returns Возвращает массив дочерних элементов.
39
+ */
40
+ private initData;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeLoaderService, never>;
42
+ static ɵprov: i0.ɵɵInjectableDeclaration<TreeLoaderService>;
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snabcentr/client-ui",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "author": "Snabcentr Ltd.",
5
5
  "repository": "https://gitlab.snabcentr.met/web/angular/snabcentr-client-ui-lib",
6
6
  "license": "Commercial",
package/public-api.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './banner';
2
2
  export * from './cart';
3
3
  export * from './catalog';
4
+ export * from './files';
4
5
  export * from './icons';
5
6
  export * from './loader';
6
7
  export * from './news';
@@ -0,0 +1,6 @@
1
+ ## 0.0.24 (2023-12-11)
2
+
3
+ ### added (1 change)
4
+
5
+ - [#7823: Добавлен компонент файлов и документов](web_soft/libs/angular/snabcentr-client-ui-lib@d175cb6b17c77b3b264af4375fe4201a2a4ede49) ([merge request](web_soft/libs/angular/snabcentr-client-ui-lib!24))
6
+
@@ -1,5 +1,5 @@
1
1
  /*
2
- ! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com
2
+ ! tailwindcss v3.3.6 | MIT License | https://tailwindcss.com
3
3
  */
4
4
 
5
5
  /*
@@ -121,8 +121,10 @@ strong {
121
121
  }
122
122
 
123
123
  /*
124
- 1. Use the user's configured `mono` font family by default.
125
- 2. Correct the odd `em` font sizing in all browsers.
124
+ 1. Use the user's configured `mono` font-family by default.
125
+ 2. Use the user's configured `mono` font-feature-settings by default.
126
+ 3. Use the user's configured `mono` font-variation-settings by default.
127
+ 4. Correct the odd `em` font sizing in all browsers.
126
128
  */
127
129
 
128
130
  code,
@@ -131,8 +133,12 @@ samp,
131
133
  pre {
132
134
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
133
135
  /* 1 */
134
- font-size: 1em;
136
+ font-feature-settings: normal;
135
137
  /* 2 */
138
+ font-variation-settings: normal;
139
+ /* 3 */
140
+ font-size: 1em;
141
+ /* 4 */
136
142
  }
137
143
 
138
144
  /*
@@ -656,10 +662,6 @@ video {
656
662
  left: 4rem;
657
663
  }
658
664
 
659
- .left-3 {
660
- left: 0.75rem;
661
- }
662
-
663
665
  .right-0 {
664
666
  right: 0px;
665
667
  }
@@ -680,10 +682,6 @@ video {
680
682
  top: 0.5rem;
681
683
  }
682
684
 
683
- .top-3 {
684
- top: 0.75rem;
685
- }
686
-
687
685
  .isolate {
688
686
  isolation: isolate;
689
687
  }
@@ -700,16 +698,13 @@ video {
700
698
  margin: 2rem;
701
699
  }
702
700
 
703
- .mb-1 {
704
- margin-bottom: 0.25rem;
705
- }
706
-
707
- .mb-2 {
708
- margin-bottom: 0.5rem;
701
+ .my-4 {
702
+ margin-top: 1rem;
703
+ margin-bottom: 1rem;
709
704
  }
710
705
 
711
- .mb-2\.5 {
712
- margin-bottom: 0.625rem;
706
+ .mb-1 {
707
+ margin-bottom: 0.25rem;
713
708
  }
714
709
 
715
710
  .mb-3 {
@@ -819,6 +814,10 @@ video {
819
814
  height: 14rem;
820
815
  }
821
816
 
817
+ .h-6 {
818
+ height: 1.5rem;
819
+ }
820
+
822
821
  .h-64 {
823
822
  height: 16rem;
824
823
  }
@@ -847,10 +846,6 @@ video {
847
846
  width: 7rem;
848
847
  }
849
848
 
850
- .w-3 {
851
- width: 0.75rem;
852
- }
853
-
854
849
  .w-3\/4 {
855
850
  width: 75%;
856
851
  }
@@ -875,6 +870,10 @@ video {
875
870
  width: 11rem;
876
871
  }
877
872
 
873
+ .w-6 {
874
+ width: 1.5rem;
875
+ }
876
+
878
877
  .w-70 {
879
878
  width: 17.5rem;
880
879
  }
@@ -1093,14 +1092,6 @@ video {
1093
1092
  border-radius: 0.375rem;
1094
1093
  }
1095
1094
 
1096
- .rounded-sm {
1097
- border-radius: 0.125rem;
1098
- }
1099
-
1100
- .rounded-tui-radius-l {
1101
- border-radius: var(--tui-radius-l);
1102
- }
1103
-
1104
1095
  .rounded-tui-radius-m {
1105
1096
  border-radius: var(--tui-radius-m);
1106
1097
  }
@@ -1281,10 +1272,6 @@ video {
1281
1272
  color: rgb(22 163 74 / var(--tw-text-opacity));
1282
1273
  }
1283
1274
 
1284
- .text-tui-base-07 {
1285
- color: var(--tui-base-07);
1286
- }
1287
-
1288
1275
  .text-tui-base-09 {
1289
1276
  color: var(--tui-base-09);
1290
1277
  }