@myrtex-org/form 1.1.40 → 1.1.42
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.
- package/esm2022/lib/modules/object-form/components/elements/input/table/helpers/get-row-model.helper.mjs +3 -2
- package/esm2022/lib/modules/object-form/components/elements/input/table/input-table.component.mjs +143 -77
- package/esm2022/lib/modules/object-form/models/value.model.mjs +6 -2
- package/fesm2022/myrtex-org-form.mjs +151 -79
- package/fesm2022/myrtex-org-form.mjs.map +1 -1
- package/lib/modules/object-form/components/elements/input/table/input-table.component.d.ts +10 -4
- package/lib/modules/object-form/models/value.model.d.ts +13 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject,
|
|
2
|
+
import { Injectable, inject, ChangeDetectionStrategy, Component, EventEmitter, Output, Input, Directive, ChangeDetectorRef, Inject, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1$3 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@angular/router';
|
|
@@ -22,7 +22,6 @@ import * as i2$2 from '@angular/forms';
|
|
|
22
22
|
import { FormsModule } from '@angular/forms';
|
|
23
23
|
import { provideNgxMask } from 'ngx-mask';
|
|
24
24
|
import { v4 } from 'uuid';
|
|
25
|
-
import CustomStore from 'devextreme/data/custom_store';
|
|
26
25
|
import * as i2$3 from 'devextreme-angular';
|
|
27
26
|
import { DxDataGridModule } from 'devextreme-angular';
|
|
28
27
|
import * as i3 from 'devextreme-angular/ui/nested';
|
|
@@ -2113,6 +2112,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
2113
2112
|
args: [{ selector: 'app-input-radio-group', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (settings) {\r\n <div class=\"input-radio-group-content\">\r\n @if (settings.options.label) {\r\n <mrx-label\r\n [required]=\"settings.options.required\"\r\n [tooltip]=\"settings.options.tooltip || ''\"\r\n >\r\n {{ settings.options.label }}\r\n </mrx-label>\r\n }\r\n\r\n <mrx-radio-group\r\n [(ngModel)]=\"value\"\r\n [fields]=\"autosaveFields\"\r\n [items]=\"list\"\r\n [invalid]=\"getInvalid\"\r\n [disabled]=\"disabled\"\r\n [invalidMessage]=\"getInvalidMessage\"\r\n (modelChange)=\"updateValue($event)\"\r\n ></mrx-radio-group>\r\n </div>\r\n}\r\n" }]
|
|
2114
2113
|
}] });
|
|
2115
2114
|
|
|
2115
|
+
var TableItemType;
|
|
2116
|
+
(function (TableItemType) {
|
|
2117
|
+
TableItemType[TableItemType["Row"] = 1] = "Row";
|
|
2118
|
+
TableItemType[TableItemType["Group"] = 2] = "Group";
|
|
2119
|
+
})(TableItemType || (TableItemType = {}));
|
|
2120
|
+
|
|
2116
2121
|
class FormDispenserModal {
|
|
2117
2122
|
constructor() {
|
|
2118
2123
|
this._store = inject(Store);
|
|
@@ -2333,14 +2338,12 @@ const getRowModel = (model) => {
|
|
|
2333
2338
|
});
|
|
2334
2339
|
return values;
|
|
2335
2340
|
};
|
|
2336
|
-
return { id: v4(), data: getValuesFromModel(model) };
|
|
2341
|
+
return { id: v4(), data: getValuesFromModel(model), itemType: TableItemType.Row };
|
|
2337
2342
|
};
|
|
2338
2343
|
|
|
2339
2344
|
class InputTableComponent {
|
|
2340
2345
|
constructor() {
|
|
2341
2346
|
this.type = ComponentType.InputTable;
|
|
2342
|
-
this._referenceService = inject(ReferenceService);
|
|
2343
|
-
this._lookupsCache = new Map();
|
|
2344
2347
|
this._store = inject(Store);
|
|
2345
2348
|
this._detector = inject(ChangeDetectorRef);
|
|
2346
2349
|
this._modalService = inject(ModalService);
|
|
@@ -2348,6 +2351,7 @@ class InputTableComponent {
|
|
|
2348
2351
|
this._subscriptions$ = [];
|
|
2349
2352
|
this._isCheckRequired = false;
|
|
2350
2353
|
this._canEditObject = false;
|
|
2354
|
+
this._rows = [];
|
|
2351
2355
|
this.dataSource = [];
|
|
2352
2356
|
this.columns = [];
|
|
2353
2357
|
this.values = [];
|
|
@@ -2356,14 +2360,14 @@ class InputTableComponent {
|
|
|
2356
2360
|
set data(settings) {
|
|
2357
2361
|
this.settings = settings;
|
|
2358
2362
|
this.model = { sysName: settings.sysName, type: settings.type, data: [], totals: [] };
|
|
2363
|
+
this._rows = [];
|
|
2359
2364
|
this._detector.detectChanges();
|
|
2360
2365
|
this._initColumns(this.settings.components);
|
|
2361
2366
|
}
|
|
2362
2367
|
get rowsCount() {
|
|
2363
|
-
return this.
|
|
2368
|
+
return this._rows.length || 0;
|
|
2364
2369
|
}
|
|
2365
2370
|
get hasAnyTotal() {
|
|
2366
|
-
// Проверяем все компоненты и их вложенные компоненты на наличие showTotal
|
|
2367
2371
|
return this.settings.components.some(c => this.showTotal(c) || c.components?.some(inner => this.showTotal(inner)));
|
|
2368
2372
|
}
|
|
2369
2373
|
get isRedNoData() {
|
|
@@ -2372,12 +2376,6 @@ class InputTableComponent {
|
|
|
2372
2376
|
ngOnInit() {
|
|
2373
2377
|
this._initModel();
|
|
2374
2378
|
this._changeSubject$.pipe(debounceTime(700)).subscribe(model => {
|
|
2375
|
-
console.log('Данные таблицы обновлены и готовы к отправке:', model);
|
|
2376
|
-
console.log('Чистые строки (data):', model.data);
|
|
2377
|
-
console.log('Данные для отображения в Grid:', this.dataSource);
|
|
2378
|
-
console.log('Grid Instance:', this.dataGrid.instance);
|
|
2379
|
-
window.grid = this.dataGrid.instance;
|
|
2380
|
-
console.log('Экземпляр привязан к window.grid');
|
|
2381
2379
|
this._store.dispatch(updateValues({ value: model }));
|
|
2382
2380
|
});
|
|
2383
2381
|
this._subscriptions$.push(this._store.select(selectIsCheckRequired).subscribe(result => {
|
|
@@ -2394,7 +2392,8 @@ class InputTableComponent {
|
|
|
2394
2392
|
const cloneResult = structuredClone(result);
|
|
2395
2393
|
if (cloneResult && !Array.isArray(cloneResult) && this.model.data !== cloneResult.data) {
|
|
2396
2394
|
this.model = structuredClone(cloneResult);
|
|
2397
|
-
this.
|
|
2395
|
+
this._rows = this._extractRows(this.model.data);
|
|
2396
|
+
this._initDataSource(this._rows);
|
|
2398
2397
|
}
|
|
2399
2398
|
}));
|
|
2400
2399
|
}
|
|
@@ -2411,25 +2410,25 @@ class InputTableComponent {
|
|
|
2411
2410
|
isCheckRequired: this._isCheckRequired
|
|
2412
2411
|
}).afterClosed().subscribe(resolve => {
|
|
2413
2412
|
if (resolve.result) {
|
|
2414
|
-
this.
|
|
2415
|
-
this._initDataSource(this.
|
|
2416
|
-
this._changeSubject$.next(
|
|
2413
|
+
this._rows = [...structuredClone(this._rows), resolve.rowModel];
|
|
2414
|
+
this._initDataSource(this._rows);
|
|
2415
|
+
this._changeSubject$.next(this._buildTableValueModel());
|
|
2417
2416
|
}
|
|
2418
2417
|
});
|
|
2419
2418
|
}
|
|
2420
2419
|
deleteRow(event) {
|
|
2421
|
-
const findRow = this.
|
|
2420
|
+
const findRow = this._rows.find(item => item.id === event.row.data.id);
|
|
2422
2421
|
if (findRow) {
|
|
2423
|
-
this.
|
|
2424
|
-
this._initDataSource(this.
|
|
2425
|
-
this._changeSubject$.next(this.
|
|
2422
|
+
this._rows = this._rows.filter(item => item.id !== event.row.data.id);
|
|
2423
|
+
this._initDataSource(this._rows);
|
|
2424
|
+
this._changeSubject$.next(this._buildTableValueModel());
|
|
2426
2425
|
}
|
|
2427
2426
|
}
|
|
2428
2427
|
get disabled() {
|
|
2429
2428
|
return !this._canEditObject;
|
|
2430
2429
|
}
|
|
2431
2430
|
editRow(event) {
|
|
2432
|
-
const findRow = this.
|
|
2431
|
+
const findRow = this._rows.find(item => item.id === event.row.data.id);
|
|
2433
2432
|
if (findRow) {
|
|
2434
2433
|
this._modalService.open(InputTableModalComponent, {
|
|
2435
2434
|
title: 'Редактирование строки',
|
|
@@ -2438,12 +2437,13 @@ class InputTableComponent {
|
|
|
2438
2437
|
rowModel: findRow
|
|
2439
2438
|
}).afterClosed().subscribe(resolve => {
|
|
2440
2439
|
if (resolve.result) {
|
|
2441
|
-
const
|
|
2442
|
-
const
|
|
2443
|
-
if (
|
|
2444
|
-
|
|
2445
|
-
this.
|
|
2446
|
-
this.
|
|
2440
|
+
const cloneRows = structuredClone(this._rows);
|
|
2441
|
+
const editableRow = cloneRows.find(row => row.id === resolve.rowModel.id);
|
|
2442
|
+
if (editableRow) {
|
|
2443
|
+
editableRow.data = resolve.rowModel.data;
|
|
2444
|
+
this._rows = cloneRows;
|
|
2445
|
+
this._initDataSource(this._rows);
|
|
2446
|
+
this._changeSubject$.next(this._buildTableValueModel());
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
});
|
|
@@ -2466,8 +2466,6 @@ class InputTableComponent {
|
|
|
2466
2466
|
switch (component.type) {
|
|
2467
2467
|
case ComponentType.InputDate:
|
|
2468
2468
|
return 'date';
|
|
2469
|
-
case ComponentType.InputSwitch:
|
|
2470
|
-
return 'boolean';
|
|
2471
2469
|
default:
|
|
2472
2470
|
return 'string';
|
|
2473
2471
|
}
|
|
@@ -2480,7 +2478,7 @@ class InputTableComponent {
|
|
|
2480
2478
|
return false;
|
|
2481
2479
|
}
|
|
2482
2480
|
isTotalColumn(component) {
|
|
2483
|
-
return component.options
|
|
2481
|
+
return component.options.inTotals;
|
|
2484
2482
|
}
|
|
2485
2483
|
_initModel() {
|
|
2486
2484
|
this.model = {
|
|
@@ -2489,6 +2487,7 @@ class InputTableComponent {
|
|
|
2489
2487
|
data: [],
|
|
2490
2488
|
totals: []
|
|
2491
2489
|
};
|
|
2490
|
+
this._rows = [];
|
|
2492
2491
|
}
|
|
2493
2492
|
_initDataSource(data) {
|
|
2494
2493
|
this.dataSource = data.map((item) => {
|
|
@@ -2500,7 +2499,9 @@ class InputTableComponent {
|
|
|
2500
2499
|
return newDataItem;
|
|
2501
2500
|
});
|
|
2502
2501
|
this._detector.detectChanges();
|
|
2503
|
-
this.dataGrid
|
|
2502
|
+
if (this.dataGrid?.instance) {
|
|
2503
|
+
this.dataGrid.instance.refresh();
|
|
2504
|
+
}
|
|
2504
2505
|
}
|
|
2505
2506
|
_initColumns(components) {
|
|
2506
2507
|
this.columns = components.map(c => this._transformColumn(structuredClone(c)));
|
|
@@ -2520,11 +2521,12 @@ class InputTableComponent {
|
|
|
2520
2521
|
},
|
|
2521
2522
|
],
|
|
2522
2523
|
});
|
|
2523
|
-
this.dataGrid
|
|
2524
|
+
if (this.dataGrid?.instance) {
|
|
2525
|
+
this.dataGrid.instance.repaint();
|
|
2526
|
+
}
|
|
2524
2527
|
this._detector.detectChanges();
|
|
2525
2528
|
}
|
|
2526
2529
|
_transformColumn(component) {
|
|
2527
|
-
const dataType = this.getDataType(component);
|
|
2528
2530
|
const column = {
|
|
2529
2531
|
caption: component.options.label || '',
|
|
2530
2532
|
columns: component.components.map(c => this._transformColumn(structuredClone(c))),
|
|
@@ -2533,10 +2535,9 @@ class InputTableComponent {
|
|
|
2533
2535
|
format: this.getFormat(component),
|
|
2534
2536
|
minWidth: 160
|
|
2535
2537
|
};
|
|
2536
|
-
if (dataType === 'boolean') {
|
|
2538
|
+
if (column.dataType === 'boolean') {
|
|
2537
2539
|
column.calculateCellValue = (rowData) => {
|
|
2538
2540
|
const value = rowData[component.sysName];
|
|
2539
|
-
// Если true — Да, если false, "" или null — Нет
|
|
2540
2541
|
return !!value;
|
|
2541
2542
|
};
|
|
2542
2543
|
column.lookup = {
|
|
@@ -2548,29 +2549,6 @@ class InputTableComponent {
|
|
|
2548
2549
|
displayExpr: 'displayValue'
|
|
2549
2550
|
};
|
|
2550
2551
|
}
|
|
2551
|
-
if (component.type === ComponentType.InputSelect) {
|
|
2552
|
-
const selectModel = component;
|
|
2553
|
-
if (selectModel.options.manual) {
|
|
2554
|
-
column.lookup = {
|
|
2555
|
-
dataSource: selectModel.options.items,
|
|
2556
|
-
valueExpr: 'value',
|
|
2557
|
-
displayExpr: 'text'
|
|
2558
|
-
};
|
|
2559
|
-
}
|
|
2560
|
-
else if (selectModel.options.directory?.[0]) {
|
|
2561
|
-
const directoryName = selectModel.options.directory[0];
|
|
2562
|
-
column.lookup = {
|
|
2563
|
-
// Оборачиваем в CustomStore для соответствия типам DevExtreme
|
|
2564
|
-
dataSource: new CustomStore({
|
|
2565
|
-
key: 'value',
|
|
2566
|
-
load: () => this.getLookupData(directoryName),
|
|
2567
|
-
byKey: (key) => this.getLookupData(directoryName).then(items => items.find(i => i.value === key))
|
|
2568
|
-
}),
|
|
2569
|
-
valueExpr: 'value',
|
|
2570
|
-
displayExpr: 'text'
|
|
2571
|
-
};
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
2552
|
if (this.settings.options.groups.length) {
|
|
2575
2553
|
const findIdx = this.settings.options.groups.findIndex(x => x === component.sysName);
|
|
2576
2554
|
if (findIdx !== -1) {
|
|
@@ -2579,27 +2557,121 @@ class InputTableComponent {
|
|
|
2579
2557
|
}
|
|
2580
2558
|
return column;
|
|
2581
2559
|
}
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2560
|
+
_buildTableValueModel() {
|
|
2561
|
+
const groupedData = this._buildGroupedItems(this._rows, this.settings.options.groups || [], 0);
|
|
2562
|
+
const totals = this._calculateTotals(this._rows);
|
|
2563
|
+
this.model = {
|
|
2564
|
+
sysName: this.settings.sysName,
|
|
2565
|
+
type: this.settings.type,
|
|
2566
|
+
data: groupedData,
|
|
2567
|
+
totals
|
|
2568
|
+
};
|
|
2569
|
+
return structuredClone(this.model);
|
|
2570
|
+
}
|
|
2571
|
+
_buildGroupedItems(rows, groupFields, level) {
|
|
2572
|
+
if (!groupFields.length || level >= groupFields.length) {
|
|
2573
|
+
return rows.map(row => ({ ...row, itemType: row.itemType ?? TableItemType.Row }));
|
|
2574
|
+
}
|
|
2575
|
+
const groupField = groupFields[level];
|
|
2576
|
+
const groups = new Map();
|
|
2577
|
+
for (const row of rows) {
|
|
2578
|
+
const fieldValue = row.data.find(x => x.sysName === groupField)?.value ?? null;
|
|
2579
|
+
const key = JSON.stringify(fieldValue);
|
|
2580
|
+
const existing = groups.get(key) ?? {
|
|
2581
|
+
rows: [],
|
|
2582
|
+
groupValueSysName: this._getGroupValueSysName(fieldValue, groupField)
|
|
2583
|
+
};
|
|
2584
|
+
existing.rows.push(row);
|
|
2585
|
+
groups.set(key, existing);
|
|
2586
|
+
}
|
|
2587
|
+
const result = [];
|
|
2588
|
+
for (const groupItem of groups.values()) {
|
|
2589
|
+
const nestedData = this._buildGroupedItems(groupItem.rows, groupFields, level + 1);
|
|
2590
|
+
const groupModel = {
|
|
2591
|
+
itemType: TableItemType.Group,
|
|
2592
|
+
data: nestedData,
|
|
2593
|
+
totals: this._calculateTotals(groupItem.rows, groupItem.groupValueSysName)
|
|
2594
|
+
};
|
|
2595
|
+
result.push(groupModel);
|
|
2596
|
+
}
|
|
2597
|
+
return result;
|
|
2598
|
+
}
|
|
2599
|
+
_calculateTotals(rows, groupFieldSysName) {
|
|
2600
|
+
const totalColumns = this._getTotalColumns(this.settings.components);
|
|
2601
|
+
return totalColumns.map(component => {
|
|
2602
|
+
const sum = rows.reduce((acc, row) => {
|
|
2603
|
+
const value = row.data.find(x => x.sysName === component.sysName)?.value;
|
|
2604
|
+
const numericValue = typeof value === 'number' ? value : Number(value);
|
|
2605
|
+
return Number.isFinite(numericValue) ? acc + numericValue : acc;
|
|
2606
|
+
}, 0);
|
|
2607
|
+
return {
|
|
2608
|
+
sysName: this._getTotalSysName(component.sysName, groupFieldSysName),
|
|
2609
|
+
type: component.type,
|
|
2610
|
+
valueType: component.valueType,
|
|
2611
|
+
value: sum
|
|
2612
|
+
};
|
|
2601
2613
|
});
|
|
2602
2614
|
}
|
|
2615
|
+
_getTotalSysName(columnSysName, groupFieldSysName) {
|
|
2616
|
+
if (groupFieldSysName) {
|
|
2617
|
+
return `${columnSysName}_${groupFieldSysName}_total`;
|
|
2618
|
+
}
|
|
2619
|
+
return `${columnSysName}_total`;
|
|
2620
|
+
}
|
|
2621
|
+
_getGroupValueSysName(fieldValue, fallbackSysName) {
|
|
2622
|
+
if (Array.isArray(fieldValue) && fieldValue.length) {
|
|
2623
|
+
const firstValue = fieldValue[0];
|
|
2624
|
+
if (typeof firstValue === 'string' || typeof firstValue === 'number' || typeof firstValue === 'boolean') {
|
|
2625
|
+
return String(firstValue);
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
if (fieldValue && typeof fieldValue === 'object') {
|
|
2629
|
+
if (typeof fieldValue.value === 'string' || typeof fieldValue.value === 'number' || typeof fieldValue.value === 'boolean') {
|
|
2630
|
+
return String(fieldValue.value);
|
|
2631
|
+
}
|
|
2632
|
+
if (typeof fieldValue.sysName === 'string' && fieldValue.sysName) {
|
|
2633
|
+
return fieldValue.sysName;
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
if (typeof fieldValue === 'string' || typeof fieldValue === 'number' || typeof fieldValue === 'boolean') {
|
|
2637
|
+
return String(fieldValue);
|
|
2638
|
+
}
|
|
2639
|
+
return fallbackSysName;
|
|
2640
|
+
}
|
|
2641
|
+
_getTotalColumns(components) {
|
|
2642
|
+
const result = [];
|
|
2643
|
+
for (const component of components) {
|
|
2644
|
+
if (component.type === ComponentType.InputNumber && this.showTotal(component)) {
|
|
2645
|
+
result.push(component);
|
|
2646
|
+
}
|
|
2647
|
+
if (component.components?.length) {
|
|
2648
|
+
result.push(...this._getTotalColumns(component.components));
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
return result;
|
|
2652
|
+
}
|
|
2653
|
+
_extractRows(items = []) {
|
|
2654
|
+
const rows = [];
|
|
2655
|
+
for (const item of items) {
|
|
2656
|
+
if (this._isRow(item)) {
|
|
2657
|
+
rows.push({
|
|
2658
|
+
...item,
|
|
2659
|
+
itemType: TableItemType.Row
|
|
2660
|
+
});
|
|
2661
|
+
}
|
|
2662
|
+
else {
|
|
2663
|
+
const group = item;
|
|
2664
|
+
if (group.data?.length) {
|
|
2665
|
+
rows.push(...this._extractRows(group.data));
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
return rows;
|
|
2670
|
+
}
|
|
2671
|
+
_isRow(item) {
|
|
2672
|
+
const maybeRow = item;
|
|
2673
|
+
return typeof maybeRow.id === 'string' && Array.isArray(maybeRow.data);
|
|
2674
|
+
}
|
|
2603
2675
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2604
2676
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: InputTableComponent, selector: "app-input-table", inputs: { values: "values", data: "data" }, outputs: { changed: "changed" }, viewQueries: [{ propertyName: "dataGrid", first: true, predicate: ["dataGrid"], descendants: true }, { propertyName: "editTemplate", first: true, predicate: ["editTemplate"], descendants: true }], ngImport: i0, template: "@if (settings) {\r\n <div class=\"input-table-content w-100\">\r\n @if (settings.options.label) {\r\n <mrx-label\r\n [required]=\"settings.options.required\"\r\n [tooltip]=\"settings.options.tooltip || ''\"\r\n >\r\n {{ settings.options.label }}\r\n </mrx-label>\r\n }\r\n\r\n <dx-data-grid\r\n #dataGrid\r\n [dataSource]=\"dataSource\"\r\n [columns]=\"columns\"\r\n [disabled]=\"disabled\"\r\n noDataText=\"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445\"\r\n style=\"width: 100%\"\r\n [wordWrapEnabled]=\"true\"\r\n [columnAutoWidth]=\"true\"\r\n [class.noData]=\"isRedNoData\"\r\n >\r\n <dxo-toolbar>\r\n <dxi-item location=\"after\">\r\n <div *dxTemplate class=\"add-row\">\r\n <mrx-button\r\n [size]=\"'medium'\"\r\n [type]=\"'secondary'\"\r\n [customClasses]=\"'mb-3'\"\r\n (mrxClick)=\"createRow()\"\r\n >{{settings.options.addBtnTitle}}\r\n </mrx-button>\r\n </div>\r\n </dxi-item>\r\n </dxo-toolbar>\r\n\r\n <div *dxTemplate=\"let buttonData of 'editButtonTemplate'\">\r\n <span class=\"mrx-icon icon-edit icon-font-16 cursor-pointer\" (click)=\"editRow(buttonData)\"></span>\r\n </div>\r\n\r\n <div *dxTemplate=\"let buttonData of 'deleteButtonTemplate'\">\r\n <span class=\"mrx-icon icon-delete icon-font-16 cursor-pointer\" (click)=\"deleteRow(buttonData)\"></span>\r\n </div>\r\n\r\n @if (dataSource.length) {\r\n <dxo-summary>\r\n @for (component of settings.components; track component.id; let first = $first) {\r\n @if (!first) {\r\n @if (showTotal(component)) {\r\n <dxi-group-item\r\n [column]=\"component.sysName\"\r\n summaryType=\"sum\"\r\n displayFormat=\"\u0418\u0442\u043E\u0433\u043E: {0}\"\r\n [showInGroupFooter]=\"true\"\r\n [alignByColumn]=\"true\">\r\n </dxi-group-item>\r\n\r\n <dxi-total-item \r\n [column]=\"component.sysName\" \r\n displayFormat=\"{0}\"\r\n summaryType=\"sum\"\r\n ></dxi-total-item>\r\n }\r\n\r\n @for (component of component.components; track component.id) {\r\n @if (showTotal(component)) {\r\n <dxi-group-item\r\n [column]=\"component.sysName\"\r\n summaryType=\"sum\"\r\n displayFormat=\"\u0418\u0442\u043E\u0433\u043E: {0}\"\r\n [showInGroupFooter]=\"true\"\r\n [alignByColumn]=\"true\">\r\n </dxi-group-item>\r\n }\r\n\r\n @for (component of component.components; track component.id) {\r\n @if (showTotal(component)) {\r\n <dxi-group-item\r\n [column]=\"component.sysName\"\r\n summaryType=\"sum\"\r\n displayFormat=\"\u0418\u0442\u043E\u0433\u043E: {0}\"\r\n [showInGroupFooter]=\"true\"\r\n [alignByColumn]=\"true\">\r\n </dxi-group-item>\r\n }\r\n }\r\n }\r\n } @else {\r\n @if (hasAnyTotal) { \r\n <dxi-total-item\r\n [column]=\"component.sysName\"\r\n [cssClass]=\"'text-bold'\"\r\n [displayFormat]=\"showTotal(component) ? '{0}' : '\u0418\u0422\u041E\u0413\u041E'\"\r\n [summaryType]=\"showTotal(component) ? 'sum' : undefined\"\r\n ></dxi-total-item>\r\n }\r\n }\r\n }\r\n </dxo-summary>\r\n }\r\n </dx-data-grid>\r\n\r\n @if(!!settings.options.maxRows) {\r\n <mrx-hint-error-message\r\n message=\"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0441\u0442\u0440\u043E\u043A: {{ settings.options.maxRows }}\"\r\n [maxValue]=\"settings.options.maxRows\"\r\n [value]=\"rowsCount\"\r\n ></mrx-hint-error-message>\r\n }\r\n\r\n <ng-template #editTemplate let-cellInfo=\"cellInfo\">\r\n <div class=\"d-flex align-items-center justify-content-center\" style=\"gap: 4px\">\r\n <span class=\"mrx-icon icon-edit icon-font-16 cursor-pointer\" (click)=\"editRow(cellInfo)\"></span>\r\n <span class=\"mrx-icon icon-delete icon-font-16 cursor-pointer\" (click)=\"deleteRow(cellInfo)\"></span>\r\n </div>\r\n </ng-template>\r\n </div>\r\n}\r\n\r\n\r\n", styles: [":host::ng-deep .input-table-content .noData .dx-datagrid-nodata{color:var(--system-text-negative, #8E2100)}:host::ng-deep .input-table-content .dx-datagrid{padding:0}:host::ng-deep .input-table-content .dx-datagrid-header-panel{display:flex;align-items:center;min-height:40px;padding:0}:host::ng-deep .input-table-content .dx-datagrid-rowsview{border-bottom:none}:host::ng-deep .input-table-content .dx-datagrid-rowsview.dx-empty{border-bottom:1px solid #ddd;height:48px}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer{border-top:none;border-left:none;border-right:none}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content{padding:0}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content table,:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content th,:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content td{border:1px solid #ddd;border-top:none;border-collapse:collapse}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content table{border-top:none}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content .dx-datagrid-summary-item{font-weight:400}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-headers{position:relative;top:0;border-top:1px solid var(--neutral-bg-divider)}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-headers td.dx-command-expand.dx-datagrid-group-space{border-right:none!important;border-right-color:transparent}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer td.dx-command-expand.dx-datagrid-group-space{border-right-color:transparent}:host::ng-deep .input-table-content .dx-datagrid .dx-row>td,:host::ng-deep .input-table-content .dx-datagrid .page-wrapper .dx-treelist-container .dx-row>td{color:var(--neutral-text-secondary, #4D5157);font-family:var(--body-md-bold-font-family, \"PT Sans\");font-size:var(--body-md-bold-font-size, 14px);font-weight:var(--body-md-bold-font-weight, 700);line-height:var(--body-md-bold-line-height, 16px)}:host::ng-deep .input-table-content .dx-datagrid .dx-row.dx-data-row.dx-column-lines>td{color:var(--neutral-text-tertiary, #71767E);font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:var(--body-md-line-height, 20px)}:host::ng-deep .custom-cell-controls .dx-template-wrapper{display:inline-flex}\n"], dependencies: [{ kind: "component", type: i1$2.LabelComponent, selector: "mrx-label", inputs: ["requiredHidden", "required", "boldLabel", "disabled", "placeholder", "label", "customClasses", "triggerTextPosition", "isPublicInfo", "publicInfoTooltip", "isSwitch", "switchLabel", "switchValue", "switchSize", "isCheckbox", "checkboxLabel", "checkboxValue", "counter", "linkText", "linkPrevent", "linkType", "linkMonochrome", "href", "triggerType", "tooltip", "tooltipInitialVisible", "isSaveToStorage"], outputs: ["changeSwitchValue", "changeCheckboxValue", "clickedLink"] }, { kind: "component", type: i1$2.ButtonComponent, selector: "mrx-button", inputs: ["size", "type", "color", "iconPosition", "active", "disabled", "isLoading", "iconOnly", "customClasses", "label", "icon", "iconClass", "buttonType", "href", "target", "routerLink", "queryParams"], outputs: ["mrxClick"] }, { kind: "component", type: i2$3.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExporting", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i3.DxiItemComponent, selector: "dxi-item", inputs: ["disabled", "html", "icon", "template", "text", "title", "titleTemplate", "visible", "onClick", "stylingMode", "type", "baseSize", "box", "ratio", "shrink", "elementAttr", "hint", "beginGroup", "closeMenuOnClick", "items", "selectable", "selected", "colSpan", "cssClass", "dataField", "editorOptions", "editorType", "helpText", "isRequired", "itemType", "label", "name", "validationRules", "visibleIndex", "alignItemLabels", "caption", "colCount", "colCountByScreen", "tabPanelOptions", "tabs", "badge", "tabTemplate", "buttonOptions", "horizontalAlignment", "verticalAlignment", "locateInMenu", "location", "menuItemTemplate", "options", "showText", "widget", "height", "width", "imageAlt", "imageSrc", "acceptedValues", "formatName", "formatValues", "key", "showChevron", "linkAttr", "url", "heightRatio", "widthRatio", "expanded", "hasItems", "id", "parentId"] }, { kind: "component", type: i3.DxoSummaryComponent, selector: "dxo-summary", inputs: ["calculateCustomSummary", "groupItems", "recalculateWhileEditing", "skipEmptyValues", "texts", "totalItems"] }, { kind: "component", type: i3.DxiGroupItemComponent, selector: "dxi-group-item", inputs: ["alignByColumn", "column", "customizeText", "displayFormat", "name", "showInColumn", "showInGroupFooter", "skipEmptyValues", "summaryType", "valueFormat"] }, { kind: "component", type: i3.DxiTotalItemComponent, selector: "dxi-total-item", inputs: ["alignment", "column", "cssClass", "customizeText", "displayFormat", "name", "showInColumn", "skipEmptyValues", "summaryType", "valueFormat"] }, { kind: "component", type: i3.DxoToolbarComponent, selector: "dxo-toolbar", inputs: ["disabled", "items", "visible", "fileSelectionItems", "container", "multiline"] }, { kind: "directive", type: i4.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i1$2.HintErrorMessageComponent, selector: "mrx-hint-error-message", inputs: ["message", "value", "maxValue", "minValue", "minLength", "maxLength", "checkInvalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2605
2677
|
}
|
|
@@ -3070,5 +3142,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
3070
3142
|
* Generated bundle index. Do not edit.
|
|
3071
3143
|
*/
|
|
3072
3144
|
|
|
3073
|
-
export { ComponentShortType, ComponentSizeEnum, ComponentType, ConcurrencyInterceptor, ConcurrencyStoreService, ConditionOperatorType, CustomInputStateEnum, CustomInputStateEnumLabel, DateFormatEnum, DateFormatLabelEnum, DateTypeEnum, DateTypeLabelEnum, DependenceActionType, EApplicationActions, EFFECTS, InnTypeEnum, InnTypeLabelEnum, InputState, InputTableComponent, InputTableModalComponent, LogicalOperatorType, OBJECT_ID_NAME, OBJECT_VERSION_ID_NAME, ObjectFormEffects, ObjectFormModule, SECTION_SYS_NAME_NAME, STATE_NAME, SharedFormModule, TEMPLATE_SYS_NAME_NAME, TemplateComponentsGroupTypeEnum, TemplateComponentsGroupTypeLabels, TemplateStatus, ValueType, appendVersionId, conditionOperatorTypeLabel, getConditionOperatorsList, getDependenceActionsList, getTemplateStatusText, initialObjectFormState, initialSharedFormState, isNullOrUndefined, isNumeric, objectForm_actions as objectFormActions, objectForm_selector as objectFormSelectors, objectReducer, sharedFormReducer, sharedForm_selector as sharedSelectors };
|
|
3145
|
+
export { ComponentShortType, ComponentSizeEnum, ComponentType, ConcurrencyInterceptor, ConcurrencyStoreService, ConditionOperatorType, CustomInputStateEnum, CustomInputStateEnumLabel, DateFormatEnum, DateFormatLabelEnum, DateTypeEnum, DateTypeLabelEnum, DependenceActionType, EApplicationActions, EFFECTS, InnTypeEnum, InnTypeLabelEnum, InputState, InputTableComponent, InputTableModalComponent, LogicalOperatorType, OBJECT_ID_NAME, OBJECT_VERSION_ID_NAME, ObjectFormEffects, ObjectFormModule, SECTION_SYS_NAME_NAME, STATE_NAME, SharedFormModule, TEMPLATE_SYS_NAME_NAME, TableItemType, TemplateComponentsGroupTypeEnum, TemplateComponentsGroupTypeLabels, TemplateStatus, ValueType, appendVersionId, conditionOperatorTypeLabel, getConditionOperatorsList, getDependenceActionsList, getTemplateStatusText, initialObjectFormState, initialSharedFormState, isNullOrUndefined, isNumeric, objectForm_actions as objectFormActions, objectForm_selector as objectFormSelectors, objectReducer, sharedFormReducer, sharedForm_selector as sharedSelectors };
|
|
3074
3146
|
//# sourceMappingURL=myrtex-org-form.mjs.map
|