@snabcentr/client-ui 0.0.23 → 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.
- package/esm2020/files/directives/index.mjs +3 -0
- package/esm2020/files/directives/tree-top.directive.mjs +63 -0
- package/esm2020/files/directives/tree.directive.mjs +47 -0
- package/esm2020/files/file-tree-item/file-tree-item.component.mjs +18 -0
- package/esm2020/files/files-and-documents.component.mjs +60 -0
- package/esm2020/files/files-and-documents.module.mjs +26 -0
- package/esm2020/files/index.mjs +6 -0
- package/esm2020/files/interfaces/tree-node.mjs +2 -0
- package/esm2020/files/services/index.mjs +3 -0
- package/esm2020/files/services/tree-icon.service.mjs +48 -0
- package/esm2020/files/services/tree-loader.service.mjs +60 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/snabcentr-client-ui.mjs +287 -5
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +285 -5
- package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
- package/files/directives/index.d.ts +2 -0
- package/files/directives/tree-top.directive.d.ts +33 -0
- package/files/directives/tree.directive.d.ts +35 -0
- package/files/file-tree-item/file-tree-item.component.d.ts +9 -0
- package/files/files-and-documents.component.d.ts +27 -0
- package/files/files-and-documents.module.d.ts +16 -0
- package/files/index.d.ts +5 -0
- package/files/interfaces/tree-node.d.ts +29 -0
- package/files/services/index.d.ts +2 -0
- package/files/services/tree-icon.service.d.ts +23 -0
- package/files/services/tree-loader.service.d.ts +43 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/release_notes.tmp +6 -1
- package/styles/tailwind/tailwind.scss +13 -4
@@ -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';
|
@@ -1267,6 +1267,288 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
1267
1267
|
}]
|
1268
1268
|
}] });
|
1269
1269
|
|
1270
|
+
/**
|
1271
|
+
* Сервис работающий с значками элементов дерева.
|
1272
|
+
*/
|
1273
|
+
class TreeIconService {
|
1274
|
+
/**
|
1275
|
+
* Назначает значок элементу дерева в зависимости от типа файла.
|
1276
|
+
*
|
1277
|
+
* @param info Объект пришедших данных о файле.
|
1278
|
+
* @returns Возвращает название значка в виде строки.
|
1279
|
+
*/
|
1280
|
+
getIconName(info) {
|
1281
|
+
switch (info.getIcon()) {
|
1282
|
+
case ScIconTypesEnum.iconImage:
|
1283
|
+
return 'scIconImage';
|
1284
|
+
case ScIconTypesEnum.iconPdfFile:
|
1285
|
+
return 'scIconPdfFile';
|
1286
|
+
case ScIconTypesEnum.iconWordFile:
|
1287
|
+
return 'scIconWordFile';
|
1288
|
+
case ScIconTypesEnum.iconExcelFile:
|
1289
|
+
return 'scIconExcelFile';
|
1290
|
+
case ScIconTypesEnum.iconFolder:
|
1291
|
+
return 'scIconFolder';
|
1292
|
+
default:
|
1293
|
+
return 'scIconFile';
|
1294
|
+
}
|
1295
|
+
}
|
1296
|
+
/**
|
1297
|
+
* Проверяет на признак наличия дочерних элементов.
|
1298
|
+
*
|
1299
|
+
* @param info Объект пришедших данных о файле.
|
1300
|
+
* @returns Возвращает true при наличии дочерних элементов и false при их отсутсвии.
|
1301
|
+
*/
|
1302
|
+
hasChildren(info) {
|
1303
|
+
return info.type === 'dir';
|
1304
|
+
}
|
1305
|
+
}
|
1306
|
+
TreeIconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeIconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1307
|
+
TreeIconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeIconService, providedIn: 'root' });
|
1308
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeIconService, decorators: [{
|
1309
|
+
type: Injectable,
|
1310
|
+
args: [{
|
1311
|
+
providedIn: 'root',
|
1312
|
+
}]
|
1313
|
+
}] });
|
1314
|
+
|
1315
|
+
/**
|
1316
|
+
* Сервис для асинхронного раскрытия вложенности.
|
1317
|
+
*/
|
1318
|
+
class TreeLoaderService {
|
1319
|
+
/**
|
1320
|
+
* Инициализирует экземпляр класса {@link TreeLoaderService}
|
1321
|
+
*
|
1322
|
+
* @param filesService Сервис для получения файлов директории.
|
1323
|
+
* @param iconService Сервис для определения и назначения значка элементу дерева.
|
1324
|
+
*/
|
1325
|
+
constructor(filesService, iconService) {
|
1326
|
+
this.filesService = filesService;
|
1327
|
+
this.iconService = iconService;
|
1328
|
+
}
|
1329
|
+
/**
|
1330
|
+
* Загружает дочерние элементы дерева.
|
1331
|
+
*
|
1332
|
+
* @param item Элемент дерева.
|
1333
|
+
* @returns Массив дочерних элементов.
|
1334
|
+
*/
|
1335
|
+
loadChildren(item) {
|
1336
|
+
return item.id ? this.initData(item.id) : this.initData(undefined);
|
1337
|
+
}
|
1338
|
+
/**
|
1339
|
+
* Проверяет указанный элемент дерева на наличие дочерних элементов и возвращает массив дочерних элементов, если они есть, либо пустой массив.
|
1340
|
+
*
|
1341
|
+
* @param node Элемент дерева.
|
1342
|
+
* @returns Возвращает массив типа TreeNode[].
|
1343
|
+
*/
|
1344
|
+
hasChildren(node) {
|
1345
|
+
return node.hasChildren && !!node.id;
|
1346
|
+
}
|
1347
|
+
/**
|
1348
|
+
* Загружает и заполняет массив дочерних элементов.
|
1349
|
+
*
|
1350
|
+
* @param id Идентификатор директории, чьи дочернии элементы загружаются.
|
1351
|
+
* @returns Возвращает массив дочерних элементов.
|
1352
|
+
*/
|
1353
|
+
initData(id) {
|
1354
|
+
return this.filesService.getFiles(id).pipe(map((data) => data.map((item) => ({
|
1355
|
+
text: item.name,
|
1356
|
+
icon: this.iconService.getIconName(item),
|
1357
|
+
hasChildren: this.iconService.hasChildren(item),
|
1358
|
+
createdAt: item.createdAt,
|
1359
|
+
id: item.id,
|
1360
|
+
link: item.link,
|
1361
|
+
}))));
|
1362
|
+
}
|
1363
|
+
}
|
1364
|
+
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 });
|
1365
|
+
TreeLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeLoaderService });
|
1366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeLoaderService, decorators: [{
|
1367
|
+
type: Injectable
|
1368
|
+
}], ctorParameters: function () { return [{ type: i1.ScFilesService }, { type: TreeIconService }]; } });
|
1369
|
+
|
1370
|
+
/**
|
1371
|
+
* Директива отвечающая за обработку действий над элементами дерева.
|
1372
|
+
*/
|
1373
|
+
class TreeDirective {
|
1374
|
+
/**
|
1375
|
+
* Инициализирует экземпляр класса {@link TreeDirective}.
|
1376
|
+
*
|
1377
|
+
* @param service Сервис для работы с деревом.
|
1378
|
+
*/
|
1379
|
+
constructor(service) {
|
1380
|
+
this.service = service;
|
1381
|
+
/**
|
1382
|
+
* Карта данных дерева.
|
1383
|
+
*/
|
1384
|
+
this.map = new Map();
|
1385
|
+
/**
|
1386
|
+
* Проверяет указанный элемент дерева на наличие дочерних элементов и возвращает массив дочерних элементов, если они есть, либо пустой массив.
|
1387
|
+
*
|
1388
|
+
* @param node Элемент дерева.
|
1389
|
+
* @returns Возвращает массив типа TreeNode[].
|
1390
|
+
*/
|
1391
|
+
this.childrenHandler = (node) => (node.hasChildren ? this.service.getChildren(node) : []);
|
1392
|
+
}
|
1393
|
+
/**
|
1394
|
+
* Обрабатывает нажатие на указанный элемент дерева.
|
1395
|
+
*
|
1396
|
+
* @param node Элемент дерева.
|
1397
|
+
*/
|
1398
|
+
onToggled(node) {
|
1399
|
+
this.service.loadChildren(node);
|
1400
|
+
}
|
1401
|
+
}
|
1402
|
+
TreeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeDirective, deps: [{ token: i5.TuiTreeService }], target: i0.ɵɵFactoryTarget.Directive });
|
1403
|
+
TreeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: TreeDirective, selector: "[scTree]", providers: [TuiTreeService], exportAs: ["scTree"], ngImport: i0 });
|
1404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeDirective, decorators: [{
|
1405
|
+
type: Directive,
|
1406
|
+
args: [{
|
1407
|
+
selector: '[scTree]',
|
1408
|
+
exportAs: 'scTree',
|
1409
|
+
providers: [TuiTreeService],
|
1410
|
+
}]
|
1411
|
+
}], ctorParameters: function () { return [{ type: i5.TuiTreeService }]; } });
|
1412
|
+
|
1413
|
+
/**
|
1414
|
+
* Компонент для удаления стандартного значка элемента дерева.
|
1415
|
+
*/
|
1416
|
+
class FileTreeItemComponent extends TuiTreeItemContentComponent {
|
1417
|
+
}
|
1418
|
+
FileTreeItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FileTreeItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
1419
|
+
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 });
|
1420
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FileTreeItemComponent, decorators: [{
|
1421
|
+
type: Component,
|
1422
|
+
args: [{ selector: 'sc-file-tree-item', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
1423
|
+
'(click)': `onClick()`,
|
1424
|
+
}, 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"] }]
|
1425
|
+
}] });
|
1426
|
+
|
1427
|
+
/* eslint-disable @angular-eslint/no-input-rename */
|
1428
|
+
/**
|
1429
|
+
* Директива отвечающая за корневые элементы дерева.
|
1430
|
+
*/
|
1431
|
+
class TreeTopDirective {
|
1432
|
+
constructor() {
|
1433
|
+
/**
|
1434
|
+
* Отображаемое имя корневого элемента дерева.
|
1435
|
+
*/
|
1436
|
+
this.text = '';
|
1437
|
+
}
|
1438
|
+
}
|
1439
|
+
TreeTopDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeTopDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
1440
|
+
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: [
|
1441
|
+
{
|
1442
|
+
provide: TUI_TREE_START,
|
1443
|
+
useExisting: forwardRef(() => TreeTopDirective),
|
1444
|
+
},
|
1445
|
+
{
|
1446
|
+
provide: TUI_TREE_CONTENT,
|
1447
|
+
useValue: new PolymorpheusComponent(FileTreeItemComponent),
|
1448
|
+
},
|
1449
|
+
], ngImport: i0 });
|
1450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TreeTopDirective, decorators: [{
|
1451
|
+
type: Directive,
|
1452
|
+
args: [{
|
1453
|
+
selector: '[scTopNodeText]',
|
1454
|
+
providers: [
|
1455
|
+
{
|
1456
|
+
provide: TUI_TREE_START,
|
1457
|
+
useExisting: forwardRef(() => TreeTopDirective),
|
1458
|
+
},
|
1459
|
+
{
|
1460
|
+
provide: TUI_TREE_CONTENT,
|
1461
|
+
useValue: new PolymorpheusComponent(FileTreeItemComponent),
|
1462
|
+
},
|
1463
|
+
],
|
1464
|
+
}]
|
1465
|
+
}], propDecorators: { text: [{
|
1466
|
+
type: Input,
|
1467
|
+
args: ['scTopNodeText']
|
1468
|
+
}], icon: [{
|
1469
|
+
type: Input,
|
1470
|
+
args: ['scTopNodeIcon']
|
1471
|
+
}], link: [{
|
1472
|
+
type: Input,
|
1473
|
+
args: ['scTopNodeLink']
|
1474
|
+
}], hasChildren: [{
|
1475
|
+
type: Input,
|
1476
|
+
args: ['scTopNodeChilds']
|
1477
|
+
}], id: [{
|
1478
|
+
type: Input,
|
1479
|
+
args: ['scTopNodeParent']
|
1480
|
+
}], createdAt: [{
|
1481
|
+
type: Input,
|
1482
|
+
args: ['scTopNodeDate']
|
1483
|
+
}] } });
|
1484
|
+
|
1485
|
+
/**
|
1486
|
+
* Компонент файлов и документов.
|
1487
|
+
*/
|
1488
|
+
class FilesAndDocumentsComponent {
|
1489
|
+
/**
|
1490
|
+
* Инициализирует экземпляр класса {@link FilesAndDocumentsComponent}.
|
1491
|
+
*
|
1492
|
+
* @param loading Объект отвечающий за значок загрузки, в момент раскрытия элемента дерева.
|
1493
|
+
* @param iconService Сервис для определения и назначения значка элементу дерева.
|
1494
|
+
* @param filesService Сервис для загрузки файлов.
|
1495
|
+
*/
|
1496
|
+
constructor(loading, iconService, filesService) {
|
1497
|
+
this.loading = loading;
|
1498
|
+
this.iconService = iconService;
|
1499
|
+
this.filesService = filesService;
|
1500
|
+
/**
|
1501
|
+
* Данные визуализации и их начальное получение.
|
1502
|
+
*/
|
1503
|
+
this.data$ = this.filesService.getFiles().pipe(map((data) => data.map((item) => ({
|
1504
|
+
text: item.name,
|
1505
|
+
icon: this.iconService.getIconName(item),
|
1506
|
+
hasChildren: this.iconService.hasChildren(item),
|
1507
|
+
createdAt: item.createdAt,
|
1508
|
+
id: item.id,
|
1509
|
+
link: item.link,
|
1510
|
+
}))));
|
1511
|
+
}
|
1512
|
+
}
|
1513
|
+
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 });
|
1514
|
+
FilesAndDocumentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FilesAndDocumentsComponent, selector: "sc-files-and-documents", providers: [
|
1515
|
+
{
|
1516
|
+
provide: TUI_TREE_LOADER,
|
1517
|
+
useClass: TreeLoaderService,
|
1518
|
+
},
|
1519
|
+
], 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 });
|
1520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsComponent, decorators: [{
|
1521
|
+
type: Component,
|
1522
|
+
args: [{ selector: 'sc-files-and-documents', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
1523
|
+
{
|
1524
|
+
provide: TUI_TREE_LOADER,
|
1525
|
+
useClass: TreeLoaderService,
|
1526
|
+
},
|
1527
|
+
], 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" }]
|
1528
|
+
}], ctorParameters: function () {
|
1529
|
+
return [{ type: undefined, decorators: [{
|
1530
|
+
type: Inject,
|
1531
|
+
args: [TUI_TREE_LOADING]
|
1532
|
+
}] }, { type: TreeIconService }, { type: i1.ScFilesService }];
|
1533
|
+
} });
|
1534
|
+
|
1535
|
+
/**
|
1536
|
+
* Модуль файлов и документов.
|
1537
|
+
*/
|
1538
|
+
class FilesAndDocumentsModule {
|
1539
|
+
}
|
1540
|
+
FilesAndDocumentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1541
|
+
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] });
|
1542
|
+
FilesAndDocumentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsModule, imports: [CommonModule, TuiTreeModule, TuiSvgModule, TuiLoaderModule, TuiLinkModule] });
|
1543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilesAndDocumentsModule, decorators: [{
|
1544
|
+
type: NgModule,
|
1545
|
+
args: [{
|
1546
|
+
imports: [CommonModule, TuiTreeModule, TuiSvgModule, TuiLoaderModule, TuiLinkModule],
|
1547
|
+
declarations: [FilesAndDocumentsComponent, TreeDirective, TreeTopDirective, FileTreeItemComponent],
|
1548
|
+
exports: [FilesAndDocumentsComponent],
|
1549
|
+
}]
|
1550
|
+
}] });
|
1551
|
+
|
1270
1552
|
/**
|
1271
1553
|
* Список иконок.
|
1272
1554
|
* TODO: TASK[#7779] Добавить иконки отдельных значков для соц. сетей после добавления их в кит дизайна.
|
@@ -1587,5 +1869,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
1587
1869
|
* Generated bundle index. Do not edit.
|
1588
1870
|
*/
|
1589
1871
|
|
1590
|
-
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 };
|
1872
|
+
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 };
|
1591
1873
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|