@snabcentr/client-ui 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- 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';
|
@@ -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] Добавить иконки отдельных значков для соц. сетей после добавления их в кит дизайна.
|
@@ -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
|