@myrtex-org/form 1.1.65 → 1.1.66
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/date/input-date.component.mjs +13 -64
- package/esm2022/lib/modules/object-form/components/elements/input/table/components/input-table-modal/input-table-modal.component.mjs +17 -46
- package/esm2022/lib/modules/object-form/components/elements/input/table/input-table.component.mjs +29 -53
- package/fesm2022/myrtex-org-form.mjs +55 -159
- package/fesm2022/myrtex-org-form.mjs.map +1 -1
- package/lib/modules/object-form/components/elements/input/date/input-date.component.d.ts +1 -2
- package/lib/modules/object-form/components/elements/input/table/components/input-table-modal/input-table-modal.component.d.ts +0 -1
- package/lib/modules/object-form/components/elements/input/table/input-table.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1732,11 +1732,8 @@ class InputDateComponent extends BaseFieldComponent {
|
|
|
1732
1732
|
}
|
|
1733
1733
|
updateValue(event) {
|
|
1734
1734
|
if (this._isInit) {
|
|
1735
|
-
this._isUpdatingInternal = true;
|
|
1735
|
+
this._isUpdatingInternal = true; // Блокируем внешние обновления на время ввода
|
|
1736
1736
|
if (this.settings.options.range) {
|
|
1737
|
-
// Явно форсируем правильные sysName для обеих под-моделей перед записью значений
|
|
1738
|
-
this.modelStart.sysName = `${this.settings.sysName}-id0`;
|
|
1739
|
-
this.modelEnd.sysName = `${this.settings.sysName}-id1`;
|
|
1740
1737
|
if (!event.value || event.value.length === 0) {
|
|
1741
1738
|
this.dateModel = [];
|
|
1742
1739
|
this.modelStart.value = null;
|
|
@@ -1749,17 +1746,14 @@ class InputDateComponent extends BaseFieldComponent {
|
|
|
1749
1746
|
this.modelEnd.value = event.value[1];
|
|
1750
1747
|
this.modelCounter = this._getDaysDifference(this.modelStart.value, this.modelEnd.value);
|
|
1751
1748
|
}
|
|
1752
|
-
|
|
1753
|
-
this.dispatchModify({
|
|
1754
|
-
id: event.id,
|
|
1755
|
-
value: [structuredClone(this.modelStart), structuredClone(this.modelEnd)]
|
|
1756
|
-
});
|
|
1749
|
+
this.model.value = this.dateModel;
|
|
1757
1750
|
}
|
|
1758
1751
|
else {
|
|
1759
1752
|
this.dateModel = event.value;
|
|
1760
1753
|
this.model.value = event.value;
|
|
1761
|
-
this.dispatchModify(event);
|
|
1762
1754
|
}
|
|
1755
|
+
this.dispatchModify(event);
|
|
1756
|
+
// Снимаем блокировку чуть позже, когда Store переварит изменения
|
|
1763
1757
|
setTimeout(() => this._isUpdatingInternal = false, 600);
|
|
1764
1758
|
}
|
|
1765
1759
|
}
|
|
@@ -1786,25 +1780,19 @@ class InputDateComponent extends BaseFieldComponent {
|
|
|
1786
1780
|
}
|
|
1787
1781
|
_transformOutputValue() {
|
|
1788
1782
|
if (this.settings.options.range) {
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
};
|
|
1783
|
+
return [structuredClone(this.modelStart), structuredClone(this.modelEnd)];
|
|
1784
|
+
}
|
|
1785
|
+
else {
|
|
1786
|
+
return structuredClone(this.model);
|
|
1794
1787
|
}
|
|
1795
|
-
return structuredClone(this.model);
|
|
1796
1788
|
}
|
|
1797
1789
|
_initSubscriptionForValue() {
|
|
1798
1790
|
this._subscriptions$.push(this._store.select(selectValueModel(this.settings))
|
|
1799
1791
|
.subscribe((result) => {
|
|
1800
|
-
// КРИТИЧНО ДЛЯ МОДАЛКИ: Если мы находимся в модальном режиме (valueMode === 'manual'),
|
|
1801
|
-
// мы игнорируем глобальный Store формы, так как данные должны браться из `@Input() values`
|
|
1802
|
-
if (this.valueMode === 'manual') {
|
|
1803
|
-
this._loadFromInputs();
|
|
1804
|
-
return;
|
|
1805
|
-
}
|
|
1806
1792
|
if (!result || this._isUpdatingInternal)
|
|
1807
1793
|
return;
|
|
1794
|
+
// Если компонент уже инициализирован, проверяем, нужно ли обновляться.
|
|
1795
|
+
// Мы НЕ обновляемся, если данные в Store идентичны тем, что мы уже держим в памяти.
|
|
1808
1796
|
if (this._isInit) {
|
|
1809
1797
|
const newValue = Array.isArray(result)
|
|
1810
1798
|
? JSON.stringify([result[0]?.value, result[1]?.value])
|
|
@@ -1813,59 +1801,20 @@ class InputDateComponent extends BaseFieldComponent {
|
|
|
1813
1801
|
? JSON.stringify([this.modelStart?.value, this.modelEnd?.value])
|
|
1814
1802
|
: JSON.stringify(this.model?.value);
|
|
1815
1803
|
if (newValue === currentValue) {
|
|
1816
|
-
return;
|
|
1804
|
+
return; // Данные те же самые, выходим, чтобы не запускать таймер заново
|
|
1817
1805
|
}
|
|
1818
1806
|
}
|
|
1807
|
+
// Если данные реально новые (пришли извне), обновляем локальные модели
|
|
1819
1808
|
if (Array.isArray(result)) {
|
|
1820
1809
|
this.modelStart = structuredClone(result[0]) || defaultValueModel(this.settings);
|
|
1821
1810
|
this.modelEnd = structuredClone(result[1]) || defaultValueModel(this.settings);
|
|
1822
1811
|
}
|
|
1823
1812
|
else {
|
|
1824
1813
|
this.model = structuredClone(result || defaultValueModel(this.settings));
|
|
1825
|
-
// Если range=true, но ngrx выдал одиночную модель, у которой в value лежит массив [start, end]
|
|
1826
|
-
if (this.settings.options.range && Array.isArray(this.model.value)) {
|
|
1827
|
-
this.modelStart = { ...defaultValueModel(this.settings), value: this.model.value[0], sysName: `${this.settings.sysName}_start` };
|
|
1828
|
-
this.modelEnd = { ...defaultValueModel(this.settings), value: this.model.value[1], sysName: `${this.settings.sysName}_end` };
|
|
1829
|
-
}
|
|
1830
1814
|
}
|
|
1831
1815
|
this._customInit();
|
|
1832
1816
|
}));
|
|
1833
1817
|
}
|
|
1834
|
-
// Добавим метод ручной загрузки данных из переданного Input-а (для изоляции в модалке)
|
|
1835
|
-
_loadFromInputs() {
|
|
1836
|
-
if (!this.values)
|
|
1837
|
-
return;
|
|
1838
|
-
const valuesArray = this.values;
|
|
1839
|
-
if (this.settings.options.range) {
|
|
1840
|
-
// Ищем значения по суффиксам внутри переданного массива строки
|
|
1841
|
-
const startNode = valuesArray.find(x => x.sysName === `${this.settings.sysName}-id0`);
|
|
1842
|
-
const endNode = valuesArray.find(x => x.sysName === `${this.settings.sysName}-id1`);
|
|
1843
|
-
this.modelStart = startNode ? structuredClone(startNode) : { ...defaultValueModel(this.settings), sysName: `${this.settings.sysName}-id0` };
|
|
1844
|
-
this.modelEnd = endNode ? structuredClone(endNode) : { ...defaultValueModel(this.settings), sysName: `${this.settings.sysName}-id1` };
|
|
1845
|
-
if (this.modelStart.value && this.modelEnd.value) {
|
|
1846
|
-
this.dateModel = [this.modelStart.value, this.modelEnd.value];
|
|
1847
|
-
this.modelCounter = this._getDaysDifference(this.modelStart.value, this.modelEnd.value);
|
|
1848
|
-
}
|
|
1849
|
-
else if (this.modelStart.value) {
|
|
1850
|
-
this.dateModel = [this.modelStart.value, ''];
|
|
1851
|
-
this.modelCounter = 0;
|
|
1852
|
-
}
|
|
1853
|
-
else {
|
|
1854
|
-
this.dateModel = [];
|
|
1855
|
-
this.modelCounter = 0;
|
|
1856
|
-
}
|
|
1857
|
-
}
|
|
1858
|
-
else {
|
|
1859
|
-
// Логика для обычной даты без ренджа
|
|
1860
|
-
const found = valuesArray.find(x => x.sysName === this.settings.sysName);
|
|
1861
|
-
if (found) {
|
|
1862
|
-
this.model = structuredClone(found);
|
|
1863
|
-
this.dateModel = this.model.value;
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
|
-
this._isInit = true;
|
|
1867
|
-
this._detector.markForCheck();
|
|
1868
|
-
}
|
|
1869
1818
|
_customInit() {
|
|
1870
1819
|
if (this.settings.options.range) {
|
|
1871
1820
|
if (!this.modelStart) {
|
|
@@ -2240,7 +2189,6 @@ class InputTableModalComponent extends ModalServiceComponent {
|
|
|
2240
2189
|
this.store = store;
|
|
2241
2190
|
this.formulaCalculateService = formulaCalculateService;
|
|
2242
2191
|
this.emptyRow = true;
|
|
2243
|
-
this._detector = inject(ChangeDetectorRef);
|
|
2244
2192
|
this.title = data.title;
|
|
2245
2193
|
this.okText = data.okText;
|
|
2246
2194
|
this.settings = data.settings;
|
|
@@ -2249,8 +2197,6 @@ class InputTableModalComponent extends ModalServiceComponent {
|
|
|
2249
2197
|
this.result = { result: false, rowModel: this.rowModel };
|
|
2250
2198
|
}
|
|
2251
2199
|
componentValueChanged(valueModel) {
|
|
2252
|
-
// ЛОГ 2: Что пришло в модалку из диспенсера
|
|
2253
|
-
console.log('2. [Modal] componentValueChanged получил:', valueModel);
|
|
2254
2200
|
if (isArray(valueModel)) {
|
|
2255
2201
|
valueModel.forEach(model => {
|
|
2256
2202
|
this._transformValues(model);
|
|
@@ -2261,21 +2207,17 @@ class InputTableModalComponent extends ModalServiceComponent {
|
|
|
2261
2207
|
}
|
|
2262
2208
|
this._recalculateFormulaFields();
|
|
2263
2209
|
this.emptyRow = this.rowModel.data.every(x => this.isEmpty(x.value, x.valueType));
|
|
2264
|
-
// ЛОГ 3: Как изменилась строка после обработки
|
|
2265
|
-
console.log('3. [Modal] Текущее состояние rowModel.data:', this.rowModel.data);
|
|
2266
2210
|
}
|
|
2267
2211
|
ok() {
|
|
2268
2212
|
if (!this._isValid()) {
|
|
2213
|
+
// включаем подсветку полей
|
|
2269
2214
|
this.store.dispatch(updateCheckRequired({ isCheckRequired: true }));
|
|
2270
2215
|
return;
|
|
2271
2216
|
}
|
|
2217
|
+
// возвращаем признак как был до открытия модалки
|
|
2272
2218
|
this.store.dispatch(updateCheckRequired({ isCheckRequired: this.isCheckRequired }));
|
|
2273
|
-
|
|
2274
|
-
this.result
|
|
2275
|
-
result: true,
|
|
2276
|
-
rowModel: structuredClone(this.rowModel)
|
|
2277
|
-
};
|
|
2278
|
-
this.dialogRef.close(this.result);
|
|
2219
|
+
this.result = { result: true, rowModel: this.rowModel };
|
|
2220
|
+
this.dialogRef.close(structuredClone(this.result));
|
|
2279
2221
|
}
|
|
2280
2222
|
close() {
|
|
2281
2223
|
// возвращаем признак как был до открытия модалки
|
|
@@ -2284,34 +2226,12 @@ class InputTableModalComponent extends ModalServiceComponent {
|
|
|
2284
2226
|
this.dialogRef.close(this.result);
|
|
2285
2227
|
}
|
|
2286
2228
|
_transformValues(value) {
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
if (value && value.value && Array.isArray(value.value) && value.value[0]?.sysName) {
|
|
2292
|
-
value.value.forEach((subModel) => {
|
|
2293
|
-
const findSubValue = this.rowModel.data.find((c) => c.sysName === subModel.sysName);
|
|
2294
|
-
if (findSubValue) {
|
|
2295
|
-
findSubValue.value = subModel.value; // Меняем только примитивное значение (value) внутри объекта
|
|
2296
|
-
}
|
|
2297
|
-
});
|
|
2298
|
-
}
|
|
2299
|
-
// 2. Одиночный компонент даты (передающий id)
|
|
2300
|
-
else if (value && value.id && !value.sysName) {
|
|
2301
|
-
const findValue = this.rowModel.data.find((c) => c.sysName === value.id);
|
|
2302
|
-
if (findValue) {
|
|
2303
|
-
findValue.value = value.value;
|
|
2304
|
-
}
|
|
2305
|
-
}
|
|
2306
|
-
// 3. Все остальные стандартные компоненты
|
|
2307
|
-
else if (value && value.sysName) {
|
|
2308
|
-
const findValue = this.rowModel.data.find((c) => c.sysName === value.sysName);
|
|
2309
|
-
if (findValue) {
|
|
2310
|
-
findValue.value = value.value;
|
|
2311
|
-
}
|
|
2229
|
+
const cloneRowModel = structuredClone(this.rowModel);
|
|
2230
|
+
const findValue = cloneRowModel.data.find((c) => c.sysName === value.sysName);
|
|
2231
|
+
if (findValue) {
|
|
2232
|
+
findValue.value = value.value;
|
|
2312
2233
|
}
|
|
2313
|
-
|
|
2314
|
-
this._detector.detectChanges();
|
|
2234
|
+
this.rowModel = cloneRowModel;
|
|
2315
2235
|
}
|
|
2316
2236
|
_recalculateFormulaFields() {
|
|
2317
2237
|
const formulaComponents = this._getFormulaNumberComponents(this.settings.components);
|
|
@@ -2354,13 +2274,13 @@ class InputTableModalComponent extends ModalServiceComponent {
|
|
|
2354
2274
|
return result;
|
|
2355
2275
|
}
|
|
2356
2276
|
_isValid() {
|
|
2357
|
-
|
|
2358
|
-
|
|
2277
|
+
var hasError = false;
|
|
2278
|
+
var requiredComponents = this._getRequiredComponents(this.settings.components);
|
|
2359
2279
|
for (const component of requiredComponents) {
|
|
2360
|
-
const value = this.rowModel.data
|
|
2361
|
-
|
|
2362
|
-
|| x.sysName == `${component.sysName}
|
|
2363
|
-
|
|
2280
|
+
const value = this.rowModel.data
|
|
2281
|
+
.find(x => x.sysName == component.sysName
|
|
2282
|
+
|| x.sysName == `${component.sysName}_start`
|
|
2283
|
+
|| x.sysName == `${component.sysName}_end`);
|
|
2364
2284
|
if (!value?.value) {
|
|
2365
2285
|
hasError = true;
|
|
2366
2286
|
break;
|
|
@@ -2486,9 +2406,6 @@ class InputTableComponent {
|
|
|
2486
2406
|
this._subscriptions$.forEach((subscription) => subscription.unsubscribe());
|
|
2487
2407
|
}
|
|
2488
2408
|
createRow() {
|
|
2489
|
-
if (this.disabled) {
|
|
2490
|
-
return;
|
|
2491
|
-
}
|
|
2492
2409
|
this._modalService.open(InputTableModalComponent, {
|
|
2493
2410
|
title: 'Создание строки',
|
|
2494
2411
|
okText: 'Создать',
|
|
@@ -2504,9 +2421,6 @@ class InputTableComponent {
|
|
|
2504
2421
|
});
|
|
2505
2422
|
}
|
|
2506
2423
|
deleteRow(event) {
|
|
2507
|
-
if (this.disabled) {
|
|
2508
|
-
return;
|
|
2509
|
-
}
|
|
2510
2424
|
const findRow = this._rows.find(item => item.id === event.row.data.id);
|
|
2511
2425
|
if (findRow) {
|
|
2512
2426
|
this._rows = this._rows.filter(item => item.id !== event.row.data.id);
|
|
@@ -2582,77 +2496,58 @@ class InputTableComponent {
|
|
|
2582
2496
|
this._rows = [];
|
|
2583
2497
|
}
|
|
2584
2498
|
_initDataSource(data) {
|
|
2585
|
-
// Маппим массив строк из Store/локального состояния в массив плоских объектов для DevExtreme
|
|
2586
2499
|
this.dataSource = data.map((item) => {
|
|
2587
2500
|
const newDataItem = {};
|
|
2588
|
-
// Разворачиваем все дочерние элементы строки (включая itb6-id0, itb6-id1, itb6-itt0 и т.д.)
|
|
2589
2501
|
for (let i in item.data) {
|
|
2590
2502
|
newDataItem[item.data[i].sysName] = item.data[i].value;
|
|
2591
2503
|
}
|
|
2592
|
-
// Обязательно сохраняем id строки, чтобы работали методы editRow и deleteRow
|
|
2593
2504
|
newDataItem.id = item.id;
|
|
2594
|
-
console.log('Сырая строка в dataSource:', newDataItem);
|
|
2595
2505
|
return newDataItem;
|
|
2596
2506
|
});
|
|
2597
|
-
// Запускаем ручную проверку изменений, так как у компонента стоит ChangeDetectionStrategy.OnPush
|
|
2598
2507
|
this._detector.detectChanges();
|
|
2599
|
-
// Если грид уже отрендерен в DOM, принудительно обновляем его данные
|
|
2600
2508
|
if (this.dataGrid?.instance) {
|
|
2601
|
-
this.dataGrid.instance.
|
|
2509
|
+
this.dataGrid.instance.refresh();
|
|
2602
2510
|
}
|
|
2603
2511
|
}
|
|
2604
2512
|
_initColumns(components) {
|
|
2605
|
-
// Формируем только бизнес-колонки. Колонка кнопок теперь создается автоматически в HTML
|
|
2606
2513
|
this.columns = components.map(c => this._transformColumn(structuredClone(c)));
|
|
2607
|
-
this.
|
|
2514
|
+
this.columns.push({
|
|
2515
|
+
caption: '',
|
|
2516
|
+
type: 'buttons',
|
|
2517
|
+
width: 80,
|
|
2518
|
+
cssClass: 'custom-cell-controls',
|
|
2519
|
+
buttons: [
|
|
2520
|
+
{
|
|
2521
|
+
template: 'editButtonTemplate',
|
|
2522
|
+
hint: 'Редактировать',
|
|
2523
|
+
},
|
|
2524
|
+
{
|
|
2525
|
+
template: 'deleteButtonTemplate',
|
|
2526
|
+
hint: 'Удалить',
|
|
2527
|
+
},
|
|
2528
|
+
],
|
|
2529
|
+
});
|
|
2608
2530
|
if (this.dataGrid?.instance) {
|
|
2609
2531
|
this.dataGrid.instance.repaint();
|
|
2610
2532
|
}
|
|
2533
|
+
this._detector.detectChanges();
|
|
2611
2534
|
}
|
|
2612
2535
|
_transformColumn(component) {
|
|
2613
2536
|
const dataType = this.getDataType(component);
|
|
2614
|
-
const isRangeDate = component.type === ComponentType.InputDate && component.options?.range;
|
|
2615
2537
|
const column = {
|
|
2616
2538
|
caption: component.options.label || '',
|
|
2617
2539
|
columns: component.components.map(c => this._transformColumn(structuredClone(c))),
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
dataType: isRangeDate ? 'string' : this.getDataType(component),
|
|
2540
|
+
dataField: component.sysName,
|
|
2541
|
+
dataType: this.getDataType(component),
|
|
2621
2542
|
format: this.getFormat(component),
|
|
2622
2543
|
minWidth: 160
|
|
2623
2544
|
};
|
|
2624
|
-
if (isRangeDate) {
|
|
2625
|
-
column.cellTemplate = (container, options) => {
|
|
2626
|
-
const rowData = options.data;
|
|
2627
|
-
let displayStr = '';
|
|
2628
|
-
if (rowData) {
|
|
2629
|
-
const baseSysName = component.sysName.toLowerCase();
|
|
2630
|
-
const rowKeys = Object.keys(rowData);
|
|
2631
|
-
// Регистронезависимый поиск ключей начала и конца диапазона
|
|
2632
|
-
const startKey = rowKeys.find(k => k.toLowerCase() === `${baseSysName}-id0` || k.toLowerCase() === `${baseSysName}_id0`);
|
|
2633
|
-
const endKey = rowKeys.find(k => k.toLowerCase() === `${baseSysName}-id1` || k.toLowerCase() === `${baseSysName}_id1`);
|
|
2634
|
-
const rawStart = startKey ? rowData[startKey] : null;
|
|
2635
|
-
const rawEnd = endKey ? rowData[endKey] : null;
|
|
2636
|
-
if (rawStart || rawEnd) {
|
|
2637
|
-
const formatOptions = component.options.viewType === DateTypeEnum.DateTime
|
|
2638
|
-
? { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }
|
|
2639
|
-
: { day: '2-digit', month: '2-digit', year: 'numeric' };
|
|
2640
|
-
const startDate = rawStart ? new Date(rawStart) : null;
|
|
2641
|
-
const endDate = rawEnd ? new Date(rawEnd) : null;
|
|
2642
|
-
const startStr = startDate && !isNaN(startDate.getTime()) ? startDate.toLocaleDateString('ru-RU', formatOptions) : '...';
|
|
2643
|
-
const endStr = endDate && !isNaN(endDate.getTime()) ? endDate.toLocaleDateString('ru-RU', formatOptions) : '...';
|
|
2644
|
-
displayStr = `${startStr} — ${endStr}`;
|
|
2645
|
-
}
|
|
2646
|
-
else {
|
|
2647
|
-
displayStr = '—';
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
container.textContent = displayStr;
|
|
2651
|
-
};
|
|
2652
|
-
}
|
|
2653
|
-
// Логика для boolean и select остается без изменений...
|
|
2654
2545
|
if (dataType === 'boolean') {
|
|
2655
|
-
column.calculateCellValue = (rowData) =>
|
|
2546
|
+
column.calculateCellValue = (rowData) => {
|
|
2547
|
+
const value = rowData[component.sysName];
|
|
2548
|
+
// Если true — Да, если false, "" или null — Нет
|
|
2549
|
+
return !!value;
|
|
2550
|
+
};
|
|
2656
2551
|
column.lookup = {
|
|
2657
2552
|
dataSource: [
|
|
2658
2553
|
{ value: true, displayValue: 'Да' },
|
|
@@ -2674,6 +2569,7 @@ class InputTableComponent {
|
|
|
2674
2569
|
else if (selectModel.options.directory?.[0]) {
|
|
2675
2570
|
const directoryName = selectModel.options.directory[0];
|
|
2676
2571
|
column.lookup = {
|
|
2572
|
+
// Оборачиваем в CustomStore для соответствия типам DevExtreme
|
|
2677
2573
|
dataSource: new CustomStore({
|
|
2678
2574
|
key: 'value',
|
|
2679
2575
|
load: () => this.getLookupData(directoryName),
|
|
@@ -2829,11 +2725,11 @@ class InputTableComponent {
|
|
|
2829
2725
|
return typeof maybeRow.id === 'string' && Array.isArray(maybeRow.data);
|
|
2830
2726
|
}
|
|
2831
2727
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2832
|
-
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 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 @if(!disabled) {\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\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\r\n @if(!disabled) {\r\n <dxi-column\r\n [width]=\"80\"\r\n cssClass=\"custom-cell-controls\"\r\n [allowFiltering]=\"false\"\r\n [allowSorting]=\"false\"\r\n cellTemplate=\"actionsTemplate\"\r\n ></dxi-column>\r\n\r\n <div *dxTemplate=\"let cellInfo of 'actionsTemplate'\">\r\n <div class=\"d-flex align-items-center justify-content-center\" style=\"gap: 8px\">\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 </div>\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 @if(!disabled) {\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 }\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.DxiColumnComponent, selector: "dxi-column", inputs: ["alignment", "allowEditing", "allowExporting", "allowFiltering", "allowFixing", "allowGrouping", "allowHeaderFiltering", "allowHiding", "allowReordering", "allowResizing", "allowSearch", "allowSorting", "autoExpandGroup", "buttons", "calculateCellValue", "calculateDisplayValue", "calculateFilterExpression", "calculateGroupValue", "calculateSortValue", "caption", "cellTemplate", "columns", "cssClass", "customizeText", "dataField", "dataType", "editCellTemplate", "editorOptions", "encodeHtml", "falseText", "filterOperations", "filterType", "filterValue", "filterValues", "fixed", "fixedPosition", "format", "formItem", "groupCellTemplate", "groupIndex", "headerCellTemplate", "headerFilter", "hidingPriority", "isBand", "lookup", "minWidth", "name", "ownerBand", "renderAsync", "selectedFilterOperation", "setCellValue", "showEditorAlways", "showInColumnChooser", "showWhenGrouped", "sortIndex", "sortingMethod", "sortOrder", "trueText", "type", "validationRules", "visible", "visibleIndex", "width"], outputs: ["filterValueChange", "filterValuesChange", "groupIndexChange", "selectedFilterOperationChange", "sortIndexChange", "sortOrderChange", "visibleChange", "visibleIndexChange"] }, { 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 }); }
|
|
2728
|
+
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 }); }
|
|
2833
2729
|
}
|
|
2834
2730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputTableComponent, decorators: [{
|
|
2835
2731
|
type: Component,
|
|
2836
|
-
args: [{ selector: 'app-input-table', changeDetection: ChangeDetectionStrategy.OnPush, 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 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
|
|
2732
|
+
args: [{ selector: 'app-input-table', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
2837
2733
|
}], propDecorators: { values: [{
|
|
2838
2734
|
type: Input
|
|
2839
2735
|
}], data: [{
|