@snabcentr/client-ui 0.0.22 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,16 +1,16 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, ContentChildren, Input, Output, HostBinding, HostListener, NgModule, Inject, ChangeDetectorRef, Optional, Self, ViewChild } from '@angular/core';
3
+ import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, ContentChildren, Input, Output, HostBinding, HostListener, NgModule, Inject, ChangeDetectorRef, Optional, Self, ViewChild, Directive, forwardRef } from '@angular/core';
4
4
  import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
5
5
  import { interval, filter, map, switchMap, skip } from 'rxjs';
6
6
  import * as i1 from '@snabcentr/client-core';
7
- import { SC_URLS, SC_PATH_IMAGE_NOT_FOUND } from '@snabcentr/client-core';
7
+ import { SC_URLS, SC_PATH_IMAGE_NOT_FOUND, ScIconTypesEnum } from '@snabcentr/client-core';
8
8
  import * as i2 from '@angular/common';
9
9
  import { CommonModule, formatDate } from '@angular/common';
10
10
  import * as i3 from '@taiga-ui/core';
11
11
  import { TuiButtonModule, TuiModeModule, tuiFormatNumber, TuiSvgModule, TuiLabelModule, TuiTextfieldControllerModule, TuiHintModule, TuiLoaderModule, TuiLinkModule } from '@taiga-ui/core';
12
12
  import * as i5 from '@taiga-ui/kit';
13
- import { TuiCarouselModule, TuiPaginationModule, TUI_NUMBER_VALUE_TRANSFORMER, TuiInputNumberComponent, TuiInputNumberModule, TuiFieldErrorPipeModule, TuiElasticContainerModule } from '@taiga-ui/kit';
13
+ import { TuiCarouselModule, TuiPaginationModule, TUI_NUMBER_VALUE_TRANSFORMER, TuiInputNumberComponent, TuiInputNumberModule, TuiFieldErrorPipeModule, TuiElasticContainerModule, TuiTreeService, TuiTreeItemContentComponent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TUI_TREE_LOADER, TuiTreeModule } from '@taiga-ui/kit';
14
14
  import * as i6 from '@taiga-ui/cdk';
15
15
  import { tuiCreateToken, AbstractTuiNullableControl } from '@taiga-ui/cdk';
16
16
  import { RouterModule } from '@angular/router';
@@ -20,7 +20,7 @@ import { NgControl, FormControl, FormsModule, ReactiveFormsModule } from '@angul
20
20
  import * as i7 from '@taiga-ui/addon-preview';
21
21
  import { TuiPreviewDialogService, TuiPreviewModule } from '@taiga-ui/addon-preview';
22
22
  import * as i8 from '@tinkoff/ng-polymorpheus';
23
- import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
23
+ import { PolymorpheusModule, PolymorpheusComponent } from '@tinkoff/ng-polymorpheus';
24
24
  import * as i2$1 from 'ngx-echarts';
25
25
  import { NgxEchartsModule } from 'ngx-echarts';
26
26
  import * as echarts from 'echarts/core';
@@ -1249,6 +1249,286 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
1249
1249
  }]
1250
1250
  }] });
1251
1251
 
1252
+ /**
1253
+ * Сервис работающий с значками элементов дерева.
1254
+ */
1255
+ class TreeIconService {
1256
+ /**
1257
+ * Назначает значок элементу дерева в зависимости от типа файла.
1258
+ *
1259
+ * @param info Объект пришедших данных о файле.
1260
+ * @returns Возвращает название значка в виде строки.
1261
+ */
1262
+ getIconName(info) {
1263
+ switch (info.getIcon()) {
1264
+ case ScIconTypesEnum.iconImage:
1265
+ return 'scIconImage';
1266
+ case ScIconTypesEnum.iconPdfFile:
1267
+ return 'scIconPdfFile';
1268
+ case ScIconTypesEnum.iconWordFile:
1269
+ return 'scIconWordFile';
1270
+ case ScIconTypesEnum.iconExcelFile:
1271
+ return 'scIconExcelFile';
1272
+ case ScIconTypesEnum.iconFolder:
1273
+ return 'scIconFolder';
1274
+ default:
1275
+ return 'scIconFile';
1276
+ }
1277
+ }
1278
+ /**
1279
+ * Проверяет на признак наличия дочерних элементов.
1280
+ *
1281
+ * @param info Объект пришедших данных о файле.
1282
+ * @returns Возвращает true при наличии дочерних элементов и false при их отсутсвии.
1283
+ */
1284
+ hasChildren(info) {
1285
+ return info.type === 'dir';
1286
+ }
1287
+ }
1288
+ TreeIconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeIconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1289
+ TreeIconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeIconService, providedIn: 'root' });
1290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeIconService, decorators: [{
1291
+ type: Injectable,
1292
+ args: [{
1293
+ providedIn: 'root',
1294
+ }]
1295
+ }] });
1296
+
1297
+ /**
1298
+ * Сервис для асинхронного раскрытия вложенности.
1299
+ */
1300
+ class TreeLoaderService {
1301
+ /**
1302
+ * Инициализирует экземпляр класса {@link TreeLoaderService}
1303
+ *
1304
+ * @param filesService Сервис для получения файлов директории.
1305
+ * @param iconService Сервис для определения и назначения значка элементу дерева.
1306
+ */
1307
+ constructor(filesService, iconService) {
1308
+ this.filesService = filesService;
1309
+ this.iconService = iconService;
1310
+ }
1311
+ /**
1312
+ * Загружает дочерние элементы дерева.
1313
+ *
1314
+ * @param item Элемент дерева.
1315
+ * @returns Массив дочерних элементов.
1316
+ */
1317
+ loadChildren(item) {
1318
+ return item.id ? this.initData(item.id) : this.initData(undefined);
1319
+ }
1320
+ /**
1321
+ * Проверяет указанный элемент дерева на наличие дочерних элементов и возвращает массив дочерних элементов, если они есть, либо пустой массив.
1322
+ *
1323
+ * @param node Элемент дерева.
1324
+ * @returns Возвращает массив типа TreeNode[].
1325
+ */
1326
+ hasChildren(node) {
1327
+ return node.hasChildren && !!node.id;
1328
+ }
1329
+ /**
1330
+ * Загружает и заполняет массив дочерних элементов.
1331
+ *
1332
+ * @param id Идентификатор директории, чьи дочернии элементы загружаются.
1333
+ * @returns Возвращает массив дочерних элементов.
1334
+ */
1335
+ initData(id) {
1336
+ return this.filesService.getFiles(id).pipe(map((data) => data.map((item) => ({
1337
+ text: item.name,
1338
+ icon: this.iconService.getIconName(item),
1339
+ hasChildren: this.iconService.hasChildren(item),
1340
+ createdAt: item.createdAt,
1341
+ id: item.id,
1342
+ link: item.link,
1343
+ }))));
1344
+ }
1345
+ }
1346
+ TreeLoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeLoaderService, deps: [{ token: i1.ScFilesService }, { token: TreeIconService }], target: i0.ɵɵFactoryTarget.Injectable });
1347
+ TreeLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeLoaderService });
1348
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeLoaderService, decorators: [{
1349
+ type: Injectable
1350
+ }], ctorParameters: function () { return [{ type: i1.ScFilesService }, { type: TreeIconService }]; } });
1351
+
1352
+ /**
1353
+ * Директива отвечающая за обработку действий над элементами дерева.
1354
+ */
1355
+ class TreeDirective {
1356
+ /**
1357
+ * Инициализирует экземпляр класса {@link TreeDirective}.
1358
+ *
1359
+ * @param service Сервис для работы с деревом.
1360
+ */
1361
+ constructor(service) {
1362
+ this.service = service;
1363
+ /**
1364
+ * Карта данных дерева.
1365
+ */
1366
+ this.map = new Map();
1367
+ /**
1368
+ * Проверяет указанный элемент дерева на наличие дочерних элементов и возвращает массив дочерних элементов, если они есть, либо пустой массив.
1369
+ *
1370
+ * @param node Элемент дерева.
1371
+ * @returns Возвращает массив типа TreeNode[].
1372
+ */
1373
+ this.childrenHandler = (node) => (node.hasChildren ? this.service.getChildren(node) : []);
1374
+ }
1375
+ /**
1376
+ * Обрабатывает нажатие на указанный элемент дерева.
1377
+ *
1378
+ * @param node Элемент дерева.
1379
+ */
1380
+ onToggled(node) {
1381
+ this.service.loadChildren(node);
1382
+ }
1383
+ }
1384
+ TreeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeDirective, deps: [{ token: i5.TuiTreeService }], target: i0.ɵɵFactoryTarget.Directive });
1385
+ TreeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: TreeDirective, selector: "[scTree]", providers: [TuiTreeService], exportAs: ["scTree"], ngImport: i0 });
1386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeDirective, decorators: [{
1387
+ type: Directive,
1388
+ args: [{
1389
+ selector: '[scTree]',
1390
+ exportAs: 'scTree',
1391
+ providers: [TuiTreeService],
1392
+ }]
1393
+ }], ctorParameters: function () { return [{ type: i5.TuiTreeService }]; } });
1394
+
1395
+ /**
1396
+ * Компонент для удаления стандартного значка элемента дерева.
1397
+ */
1398
+ class FileTreeItemComponent extends TuiTreeItemContentComponent {
1399
+ }
1400
+ FileTreeItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FileTreeItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1401
+ FileTreeItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FileTreeItemComponent, selector: "sc-file-tree-item", host: { listeners: { "click": "onClick()" } }, usesInheritance: true, ngImport: i0, template: "<ng-container [ngTemplateOutlet]=\"context.template\"></ng-container>\n", styles: [":host{position:relative;height:var(--tui-height-s);display:flex;align-items:center;padding:0 .5rem;border-radius:var(--tui-radius-xs);background:var(--tui-base-01)}:host:before,:host:after{content:\"\";position:absolute;left:-.75rem;z-index:-1}:host:before{width:1rem;border-bottom:1px solid var(--tui-base-04)}:host:after{top:-1rem;bottom:1rem;border-left:1px solid var(--tui-base-04)}:host._expandable:hover{cursor:pointer;background:var(--tui-base-02)}tui-svg{position:relative;background:inherit;z-index:1}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FileTreeItemComponent, decorators: [{
1403
+ type: Component,
1404
+ args: [{ selector: 'sc-file-tree-item', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1405
+ '(click)': `onClick()`,
1406
+ }, template: "<ng-container [ngTemplateOutlet]=\"context.template\"></ng-container>\n", styles: [":host{position:relative;height:var(--tui-height-s);display:flex;align-items:center;padding:0 .5rem;border-radius:var(--tui-radius-xs);background:var(--tui-base-01)}:host:before,:host:after{content:\"\";position:absolute;left:-.75rem;z-index:-1}:host:before{width:1rem;border-bottom:1px solid var(--tui-base-04)}:host:after{top:-1rem;bottom:1rem;border-left:1px solid var(--tui-base-04)}:host._expandable:hover{cursor:pointer;background:var(--tui-base-02)}tui-svg{position:relative;background:inherit;z-index:1}\n"] }]
1407
+ }] });
1408
+
1409
+ /* eslint-disable @angular-eslint/no-input-rename */
1410
+ /**
1411
+ * Директива отвечающая за корневые элементы дерева.
1412
+ */
1413
+ class TreeTopDirective {
1414
+ constructor() {
1415
+ /**
1416
+ * Отображаемое имя корневого элемента дерева.
1417
+ */
1418
+ this.text = '';
1419
+ }
1420
+ }
1421
+ TreeTopDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeTopDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1422
+ TreeTopDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: TreeTopDirective, selector: "[scTopNodeText]", inputs: { text: ["scTopNodeText", "text"], icon: ["scTopNodeIcon", "icon"], link: ["scTopNodeLink", "link"], hasChildren: ["scTopNodeChilds", "hasChildren"], id: ["scTopNodeParent", "id"], createdAt: ["scTopNodeDate", "createdAt"] }, providers: [
1423
+ {
1424
+ provide: TUI_TREE_START,
1425
+ useExisting: forwardRef(() => TreeTopDirective),
1426
+ },
1427
+ {
1428
+ provide: TUI_TREE_CONTENT,
1429
+ useValue: new PolymorpheusComponent(FileTreeItemComponent),
1430
+ },
1431
+ ], ngImport: i0 });
1432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeTopDirective, decorators: [{
1433
+ type: Directive,
1434
+ args: [{
1435
+ selector: '[scTopNodeText]',
1436
+ providers: [
1437
+ {
1438
+ provide: TUI_TREE_START,
1439
+ useExisting: forwardRef(() => TreeTopDirective),
1440
+ },
1441
+ {
1442
+ provide: TUI_TREE_CONTENT,
1443
+ useValue: new PolymorpheusComponent(FileTreeItemComponent),
1444
+ },
1445
+ ],
1446
+ }]
1447
+ }], propDecorators: { text: [{
1448
+ type: Input,
1449
+ args: ['scTopNodeText']
1450
+ }], icon: [{
1451
+ type: Input,
1452
+ args: ['scTopNodeIcon']
1453
+ }], link: [{
1454
+ type: Input,
1455
+ args: ['scTopNodeLink']
1456
+ }], hasChildren: [{
1457
+ type: Input,
1458
+ args: ['scTopNodeChilds']
1459
+ }], id: [{
1460
+ type: Input,
1461
+ args: ['scTopNodeParent']
1462
+ }], createdAt: [{
1463
+ type: Input,
1464
+ args: ['scTopNodeDate']
1465
+ }] } });
1466
+
1467
+ /**
1468
+ * Компонент файлов и документов.
1469
+ */
1470
+ class FilesAndDocumentsComponent {
1471
+ /**
1472
+ * Инициализирует экземпляр класса {@link FilesAndDocumentsComponent}.
1473
+ *
1474
+ * @param loading Объект отвечающий за значок загрузки, в момент раскрытия элемента дерева.
1475
+ * @param iconService Сервис для определения и назначения значка элементу дерева.
1476
+ * @param filesService Сервис для загрузки файлов.
1477
+ */
1478
+ constructor(loading, iconService, filesService) {
1479
+ this.loading = loading;
1480
+ this.iconService = iconService;
1481
+ this.filesService = filesService;
1482
+ /**
1483
+ * Данные визуализации и их начальное получение.
1484
+ */
1485
+ this.data$ = this.filesService.getFiles().pipe(map((data) => data.map((item) => ({
1486
+ text: item.name,
1487
+ icon: this.iconService.getIconName(item),
1488
+ hasChildren: this.iconService.hasChildren(item),
1489
+ createdAt: item.createdAt,
1490
+ id: item.id,
1491
+ link: item.link,
1492
+ }))));
1493
+ }
1494
+ }
1495
+ FilesAndDocumentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsComponent, deps: [{ token: TUI_TREE_LOADING }, { token: TreeIconService }, { token: i1.ScFilesService }], target: i0.ɵɵFactoryTarget.Component });
1496
+ FilesAndDocumentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FilesAndDocumentsComponent, selector: "sc-files-and-documents", providers: [
1497
+ {
1498
+ provide: TUI_TREE_LOADER,
1499
+ useClass: TreeLoaderService,
1500
+ },
1501
+ ], ngImport: i0, template: "<ng-container *ngIf=\"data$ | async as data; else skeleton\">\n <tui-tree\n *ngFor=\"let node of data\"\n #tree=\"scTree\"\n scTree\n [scTopNodeText]=\"node.text\"\n [scTopNodeIcon]=\"node.icon\"\n [scTopNodeLink]=\"node.link\"\n [scTopNodeChilds]=\"node.hasChildren\"\n [scTopNodeParent]=\"node.id\"\n [scTopNodeDate]=\"node.createdAt\"\n [childrenHandler]=\"tree.childrenHandler\"\n [content]=\"content\"\n [map]=\"tree.map\"\n [tuiTreeController]=\"false\"\n [value]=\"tree.service.data$ | async\"\n (toggled)=\"tree.onToggled($event)\"\n class=\"overflow-hidden\"\n ></tui-tree>\n</ng-container>\n\n<ng-template #content let-item>\n <tui-loader *ngIf=\"item === loading; else text\" class=\"w-8 my-4\"></tui-loader>\n <ng-template #text>\n <tui-svg [src]=\"item.icon\" class=\"tui-space_right-2\"></tui-svg>\n <a tuiLink [pseudo]=\"true\" *ngIf=\"item.link\" href=\"{{ item.link }}\" class=\"grow\">{{ item.text }}</a>\n <p *ngIf=\"!item.link\" class=\"grow\">{{ item.text }}</p>\n <p>{{ item.createdAt }}</p>\n </ng-template>\n</ng-template>\n\n<ng-template #skeleton>\n <div class=\"flex flex-col gap-2\">\n <div *ngFor=\"let _ of [].constructor(7)\" class=\"flex items-center gap-2\">\n <div class=\"tui-skeleton h-6 w-6\"></div>\n <div class=\"tui-skeleton h-4 w-40\"></div>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.TuiTreeComponent, selector: "tui-tree[value]", inputs: ["value", "trackBy", "content"] }, { kind: "directive", type: i5.TuiTreeChildrenDirective, selector: "tui-tree[childrenHandler]", inputs: ["childrenHandler"] }, { kind: "directive", type: i5.TuiTreeControllerDirective, selector: "[tuiTreeController][map]", inputs: ["tuiTreeController", "map"], outputs: ["toggled"], exportAs: ["tuiTreeController"] }, { kind: "component", type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "component", type: i3.TuiLoaderComponent, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { kind: "component", type: i3.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { kind: "directive", type: TreeDirective, selector: "[scTree]", exportAs: ["scTree"] }, { kind: "directive", type: TreeTopDirective, selector: "[scTopNodeText]", inputs: ["scTopNodeText", "scTopNodeIcon", "scTopNodeLink", "scTopNodeChilds", "scTopNodeParent", "scTopNodeDate"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsComponent, decorators: [{
1503
+ type: Component,
1504
+ args: [{ selector: 'sc-files-and-documents', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1505
+ {
1506
+ provide: TUI_TREE_LOADER,
1507
+ useClass: TreeLoaderService,
1508
+ },
1509
+ ], template: "<ng-container *ngIf=\"data$ | async as data; else skeleton\">\n <tui-tree\n *ngFor=\"let node of data\"\n #tree=\"scTree\"\n scTree\n [scTopNodeText]=\"node.text\"\n [scTopNodeIcon]=\"node.icon\"\n [scTopNodeLink]=\"node.link\"\n [scTopNodeChilds]=\"node.hasChildren\"\n [scTopNodeParent]=\"node.id\"\n [scTopNodeDate]=\"node.createdAt\"\n [childrenHandler]=\"tree.childrenHandler\"\n [content]=\"content\"\n [map]=\"tree.map\"\n [tuiTreeController]=\"false\"\n [value]=\"tree.service.data$ | async\"\n (toggled)=\"tree.onToggled($event)\"\n class=\"overflow-hidden\"\n ></tui-tree>\n</ng-container>\n\n<ng-template #content let-item>\n <tui-loader *ngIf=\"item === loading; else text\" class=\"w-8 my-4\"></tui-loader>\n <ng-template #text>\n <tui-svg [src]=\"item.icon\" class=\"tui-space_right-2\"></tui-svg>\n <a tuiLink [pseudo]=\"true\" *ngIf=\"item.link\" href=\"{{ item.link }}\" class=\"grow\">{{ item.text }}</a>\n <p *ngIf=\"!item.link\" class=\"grow\">{{ item.text }}</p>\n <p>{{ item.createdAt }}</p>\n </ng-template>\n</ng-template>\n\n<ng-template #skeleton>\n <div class=\"flex flex-col gap-2\">\n <div *ngFor=\"let _ of [].constructor(7)\" class=\"flex items-center gap-2\">\n <div class=\"tui-skeleton h-6 w-6\"></div>\n <div class=\"tui-skeleton h-4 w-40\"></div>\n </div>\n </div>\n</ng-template>\n" }]
1510
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1511
+ type: Inject,
1512
+ args: [TUI_TREE_LOADING]
1513
+ }] }, { type: TreeIconService }, { type: i1.ScFilesService }]; } });
1514
+
1515
+ /**
1516
+ * Модуль файлов и документов.
1517
+ */
1518
+ class FilesAndDocumentsModule {
1519
+ }
1520
+ FilesAndDocumentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1521
+ FilesAndDocumentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsModule, declarations: [FilesAndDocumentsComponent, TreeDirective, TreeTopDirective, FileTreeItemComponent], imports: [CommonModule, TuiTreeModule, TuiSvgModule, TuiLoaderModule, TuiLinkModule], exports: [FilesAndDocumentsComponent] });
1522
+ FilesAndDocumentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsModule, imports: [CommonModule, TuiTreeModule, TuiSvgModule, TuiLoaderModule, TuiLinkModule] });
1523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsModule, decorators: [{
1524
+ type: NgModule,
1525
+ args: [{
1526
+ imports: [CommonModule, TuiTreeModule, TuiSvgModule, TuiLoaderModule, TuiLinkModule],
1527
+ declarations: [FilesAndDocumentsComponent, TreeDirective, TreeTopDirective, FileTreeItemComponent],
1528
+ exports: [FilesAndDocumentsComponent],
1529
+ }]
1530
+ }] });
1531
+
1252
1532
  /**
1253
1533
  * Список иконок.
1254
1534
  * TODO: TASK[#7779] Добавить иконки отдельных значков для соц. сетей после добавления их в кит дизайна.
@@ -1376,10 +1656,10 @@ class ScShareButtonComponent {
1376
1656
  }
1377
1657
  }
1378
1658
  ScShareButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1379
- ScShareButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScShareButtonComponent, selector: "sc-share-button", inputs: { appearance: "appearance", size: "size" }, outputs: { clickShareEvent: "clickShareEvent" }, ngImport: i0, template: "<button tuiIconButton icon=\"scIconShare\" [appearance]=\"appearance\" [size]=\"size\" (click)=\"clickShareEvent.emit()\"></button>\n", dependencies: [{ kind: "component", type: i3.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1659
+ ScShareButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScShareButtonComponent, selector: "sc-share-button", inputs: { appearance: "appearance", size: "size" }, outputs: { clickShareEvent: "clickShareEvent" }, ngImport: i0, template: "<button tuiIconButton icon=\"scIconShare\" [appearance]=\"appearance\" [size]=\"size\" (click)=\"$event.stopPropagation(); clickShareEvent.emit()\"></button>\n", dependencies: [{ kind: "component", type: i3.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1380
1660
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonComponent, decorators: [{
1381
1661
  type: Component,
1382
- args: [{ selector: 'sc-share-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button tuiIconButton icon=\"scIconShare\" [appearance]=\"appearance\" [size]=\"size\" (click)=\"clickShareEvent.emit()\"></button>\n" }]
1662
+ args: [{ selector: 'sc-share-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button tuiIconButton icon=\"scIconShare\" [appearance]=\"appearance\" [size]=\"size\" (click)=\"$event.stopPropagation(); clickShareEvent.emit()\"></button>\n" }]
1383
1663
  }], propDecorators: { appearance: [{
1384
1664
  type: Input
1385
1665
  }], size: [{
@@ -1404,10 +1684,10 @@ class ScNewsCardComponent {
1404
1684
  }
1405
1685
  }
1406
1686
  ScNewsCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScNewsCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1407
- ScNewsCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScNewsCardComponent, selector: "sc-news-card", inputs: { news: "news" }, outputs: { clickCardEvent: "clickCardEvent", clickShareEvent: "clickShareEvent" }, ngImport: i0, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full bg-white overflow-hidden\">\n <div class=\"w-full flex justify-between align-baseline mb-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <sc-share-button (clickShareEvent)=\"clickShareEvent.emit()\"></sc-share-button>\n </div>\n <p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </p>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ScShareButtonComponent, selector: "sc-share-button", inputs: ["appearance", "size"], outputs: ["clickShareEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1687
+ ScNewsCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScNewsCardComponent, selector: "sc-news-card", inputs: { news: "news" }, outputs: { clickCardEvent: "clickCardEvent", clickShareEvent: "clickShareEvent" }, ngImport: i0, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full w-full flex justify-between align-baseline bg-white overflow-hidden\">\n <div class=\"flex flex-col gap-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </div>\n <sc-share-button (clickShareEvent)=\"clickShareEvent.emit()\"></sc-share-button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ScShareButtonComponent, selector: "sc-share-button", inputs: ["appearance", "size"], outputs: ["clickShareEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1408
1688
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScNewsCardComponent, decorators: [{
1409
1689
  type: Component,
1410
- args: [{ selector: 'sc-news-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full bg-white overflow-hidden\">\n <div class=\"w-full flex justify-between align-baseline mb-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <sc-share-button (clickShareEvent)=\"clickShareEvent.emit()\"></sc-share-button>\n </div>\n <p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </p>\n </div>\n</div>\n" }]
1690
+ args: [{ selector: 'sc-news-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full w-full flex justify-between align-baseline bg-white overflow-hidden\">\n <div class=\"flex flex-col gap-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </div>\n <sc-share-button (clickShareEvent)=\"clickShareEvent.emit()\"></sc-share-button>\n </div>\n</div>\n" }]
1411
1691
  }], propDecorators: { news: [{
1412
1692
  type: Input
1413
1693
  }], clickCardEvent: [{
@@ -1565,5 +1845,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
1565
1845
  * Generated bundle index. Do not edit.
1566
1846
  */
1567
1847
 
1568
- export { SC_LINEAR_VALUES, SC_LINEAR_VALUES_TOKEN, ScBannerComponent, ScBannerModule, ScCartItemMobileComponent, ScCartModule, ScCatalogModule, ScCategoryCardComponent, ScFavoriteBtnComponent, ScInputQuantityComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScOrderItemMobileComponent, ScOrderModule, ScPriceCardComponent, ScPriceHistoryComponent, ScPriceWarehouseStockComponent, ScShareButtonComponent, ScShareButtonModule, scClientUiIconsName, stepValidator };
1848
+ export { FilesAndDocumentsComponent, FilesAndDocumentsModule, SC_LINEAR_VALUES, SC_LINEAR_VALUES_TOKEN, ScBannerComponent, ScBannerModule, ScCartItemMobileComponent, ScCartModule, ScCatalogModule, ScCategoryCardComponent, ScFavoriteBtnComponent, ScInputQuantityComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScOrderItemMobileComponent, ScOrderModule, ScPriceCardComponent, ScPriceHistoryComponent, ScPriceWarehouseStockComponent, ScShareButtonComponent, ScShareButtonModule, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, scClientUiIconsName, stepValidator };
1569
1849
  //# sourceMappingURL=snabcentr-client-ui.mjs.map