@wavemaker/app-ng-runtime 11.14.1-18.6421 → 11.14.1-18.6428
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/components/base/bundles/index.umd.js +17 -81
- package/components/base/esm2022/pipes/custom-pipes.mjs +10 -10
- package/components/base/esm2022/utils/widget-utils.mjs +3 -3
- package/components/base/esm2022/widgets/common/base/base.component.mjs +6 -61
- package/components/base/esm2022/widgets/common/lazy-load/lazy-load.directive.mjs +3 -7
- package/components/base/esm2022/widgets/framework/property-change-handler.mjs +2 -7
- package/components/base/fesm2022/index.mjs +18 -82
- package/components/base/fesm2022/index.mjs.map +1 -1
- package/components/base/pipes/custom-pipes.d.ts +5 -5
- package/components/basic/label/bundles/index.umd.js +1 -9
- package/components/basic/label/esm2022/label.directive.mjs +2 -10
- package/components/basic/label/fesm2022/index.mjs +1 -9
- package/components/basic/label/fesm2022/index.mjs.map +1 -1
- package/components/chart/bundles/index.umd.js +2 -2
- package/components/chart/esm2022/chart.utils.mjs +3 -3
- package/components/chart/fesm2022/index.mjs +2 -2
- package/components/chart/fesm2022/index.mjs.map +1 -1
- package/components/containers/wizard/bundles/index.umd.js +2 -21
- package/components/containers/wizard/esm2022/wizard-step/wizard-step.component.mjs +1 -3
- package/components/containers/wizard/esm2022/wizard.component.mjs +3 -20
- package/components/containers/wizard/fesm2022/index.mjs +2 -21
- package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
- package/components/containers/wizard/wizard-step/wizard-step.component.d.ts +0 -2
- package/components/data/pagination/bundles/index.umd.js +0 -4
- package/components/data/pagination/esm2022/pagination.component.mjs +1 -5
- package/components/data/pagination/fesm2022/index.mjs +0 -4
- package/components/data/pagination/fesm2022/index.mjs.map +1 -1
- package/components/data/table/bundles/index.umd.js +14 -370
- package/components/data/table/esm2022/table-action/table-action.directive.mjs +1 -8
- package/components/data/table/esm2022/table-column/table-column.directive.mjs +3 -107
- package/components/data/table/esm2022/table-column-group/table-column-group.directive.mjs +1 -9
- package/components/data/table/esm2022/table-cud.directive.mjs +2 -8
- package/components/data/table/esm2022/table-filter.directive.mjs +2 -12
- package/components/data/table/esm2022/table-row/table-row.directive.mjs +1 -8
- package/components/data/table/esm2022/table-row-action/table-row-action.directive.mjs +1 -8
- package/components/data/table/esm2022/table.component.mjs +12 -219
- package/components/data/table/fesm2022/index.mjs +15 -371
- package/components/data/table/fesm2022/index.mjs.map +1 -1
- package/components/data/table/table-action/table-action.directive.d.ts +2 -3
- package/components/data/table/table-column/table-column.directive.d.ts +2 -3
- package/components/data/table/table-column-group/table-column-group.directive.d.ts +2 -3
- package/components/data/table/table-cud.directive.d.ts +1 -3
- package/components/data/table/table-filter.directive.d.ts +1 -3
- package/components/data/table/table-row/table-row.directive.d.ts +2 -3
- package/components/data/table/table-row-action/table-row-action.directive.d.ts +2 -3
- package/components/data/table/table.component.d.ts +2 -6
- package/components/navigation/menu/bundles/index.umd.js +0 -5
- package/components/navigation/menu/esm2022/menu.component.mjs +1 -6
- package/components/navigation/menu/fesm2022/index.mjs +0 -5
- package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
- package/components/navigation/popover/bundles/index.umd.js +6 -6
- package/components/navigation/popover/esm2022/popover.component.mjs +4 -4
- package/components/navigation/popover/fesm2022/index.mjs +3 -3
- package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
- package/components/navigation/popover/popover.component.d.ts +0 -6
- package/core/bundles/index.umd.js +15 -120
- package/core/esm2022/public_api.mjs +2 -2
- package/core/esm2022/utils/utils.mjs +2 -6
- package/core/esm2022/utils/watcher.mjs +15 -118
- package/core/fesm2022/index.mjs +15 -124
- package/core/fesm2022/index.mjs.map +1 -1
- package/core/public_api.d.ts +1 -1
- package/core/utils/utils.d.ts +0 -1
- package/npm-shrinkwrap.json +2 -2
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/runtime/base/bundles/index.umd.js +2 -3
- package/runtime/base/esm2022/components/base-page.component.mjs +1 -2
- package/runtime/base/esm2022/services/pipe-provider.service.mjs +4 -4
- package/runtime/base/fesm2022/index.mjs +2 -3
- package/runtime/base/fesm2022/index.mjs.map +1 -1
- package/runtime/dynamic/bundles/index.umd.js +0 -4
- package/runtime/dynamic/esm2022/app/app.config.mjs +2 -6
- package/runtime/dynamic/fesm2022/index.mjs +1 -5
- package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
- package/scripts/datatable/datatable.js +15 -103
|
@@ -8,7 +8,7 @@ import { ViewContainerRef, HostListener, ViewChild, ContentChild, ContentChildre
|
|
|
8
8
|
import * as i1 from '@angular/forms';
|
|
9
9
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
10
10
|
import * as i2 from '@wm/core';
|
|
11
|
-
import { isDefined, getClonedObject, closePopover, triggerFn, $appDigest, $unwatch, $watch,
|
|
11
|
+
import { isDefined, getClonedObject, closePopover, triggerFn, $appDigest, $unwatch, $watch, DataSource, isDataSourceEqual, isMobile, $invokeWatchers, getValidJSON, extendProto, getDatasourceFromExpr, $parseEvent, extractCurrentItemExpr, isNumberType, DataType, adjustContainerRightEdges, FormWidgetType, isDateTimeType, getDisplayDateTimeFormat } from '@wm/core';
|
|
12
12
|
import { Subject } from 'rxjs';
|
|
13
13
|
import * as i4 from '@wm/components/base';
|
|
14
14
|
import { register, PROP_BOOLEAN, PROP_STRING, PROP_NUMBER, PROP_ANY, StylableComponent, DEBOUNCE_TIMES, getConditionalClasses, unsupportedStatePersistenceTypes, styler, extractDataSourceName, EDIT_MODE, getRowOperationsColumn, transformData, prepareFieldDefs, getOrderByExpr, NAVIGATION_TYPE, provideAs, provideAsWidgetRef, refreshDataSource, getMatchModeTypesMap, getMatchModeMsgs, isDataSetWidget, BaseComponent, setHeaderConfigForTable, BaseFieldValidations, applyFilterOnField, getDistinctFieldProperties, getDistinctValues, getWatchIdentifier, fetchRelatedFieldData, getDistinctValuesForField, getEditModeWidget, getDataTableFilterWidget, getDefaultValue, Context } from '@wm/components/base';
|
|
@@ -176,15 +176,8 @@ class TableComponent extends StylableComponent {
|
|
|
176
176
|
this.setDataGridOption('colDefs', getClonedObject(this.fieldDefs));
|
|
177
177
|
}
|
|
178
178
|
// If data and colDefs are present, call on before data render event
|
|
179
|
-
// Note: Errors in beforedatarender should not prevent table rendering
|
|
180
179
|
if (!this.isdynamictable && !isEmpty(newValue) && gridOptions.colDefs.length) {
|
|
181
|
-
|
|
182
|
-
this.invokeEventCallback('beforedatarender', { $data: this._gridData, $columns: this.columns, data: this._gridData, columns: this.columns });
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
// Log error but continue with rendering - beforedatarender errors should not block table rendering
|
|
186
|
-
console.warn('Error in beforedatarender event callback, continuing with table rendering:', error);
|
|
187
|
-
}
|
|
180
|
+
this.invokeEventCallback('beforedatarender', { $data: this._gridData, $columns: this.columns, data: this._gridData, columns: this.columns });
|
|
188
181
|
}
|
|
189
182
|
this.setDataGridOption('data', getClonedObject(this._gridData));
|
|
190
183
|
}
|
|
@@ -577,11 +570,7 @@ class TableComponent extends StylableComponent {
|
|
|
577
570
|
this.prevData = getClonedObject(row);
|
|
578
571
|
},
|
|
579
572
|
afterRowUpdate: (row, e, callBack, options) => {
|
|
580
|
-
|
|
581
|
-
this.updateRecord(extend({}, options, { row, 'prevData': options.rowindex ? options.rowindex : this.prevData, 'event': e, 'callBack': callBack }));
|
|
582
|
-
setTimeout(() => {
|
|
583
|
-
unMuteWatchers();
|
|
584
|
-
}, 10);
|
|
573
|
+
this.updateRecord(extend({}, options, { row, 'prevData': this.prevData, 'event': e, 'callBack': callBack }));
|
|
585
574
|
},
|
|
586
575
|
onBeforeRowUpdate: (row, e, options) => {
|
|
587
576
|
return this.invokeEventCallback('beforerowupdate', { $event: e, $data: row, row, options: options });
|
|
@@ -1235,10 +1224,6 @@ class TableComponent extends StylableComponent {
|
|
|
1235
1224
|
return this.actualPageSize || 5;
|
|
1236
1225
|
}
|
|
1237
1226
|
watchVariableDataSet(newVal) {
|
|
1238
|
-
// Guard against component destruction
|
|
1239
|
-
if (this.isDestroyed) {
|
|
1240
|
-
return;
|
|
1241
|
-
}
|
|
1242
1227
|
let result;
|
|
1243
1228
|
// Check for Variable filters if applied
|
|
1244
1229
|
if (this.gridOptions.isNavTypeScrollOrOndemand()) {
|
|
@@ -1296,12 +1281,6 @@ class TableComponent extends StylableComponent {
|
|
|
1296
1281
|
}
|
|
1297
1282
|
/*Return if data is invalid.*/
|
|
1298
1283
|
if (!this.isDataValid()) {
|
|
1299
|
-
// If data is invalid and variableInflight is still true, clear loading state
|
|
1300
|
-
// This prevents tables from getting stuck in loading when data is invalid
|
|
1301
|
-
if (this.variableInflight) {
|
|
1302
|
-
this.variableInflight = false;
|
|
1303
|
-
this.setGridData([]);
|
|
1304
|
-
}
|
|
1305
1284
|
return;
|
|
1306
1285
|
}
|
|
1307
1286
|
// If value is empty or in studio mode, dont enable the navigation
|
|
@@ -1329,13 +1308,7 @@ class TableComponent extends StylableComponent {
|
|
|
1329
1308
|
// @ts-ignore
|
|
1330
1309
|
if (!isObject(newVal) || newVal === '' || (newVal && newVal.dataValue === '')) {
|
|
1331
1310
|
if (!this.variableInflight) {
|
|
1332
|
-
// If variable has finished loading and resultSet is empty,
|
|
1333
|
-
this.setGridData([]);
|
|
1334
|
-
}
|
|
1335
|
-
else {
|
|
1336
|
-
// If variableInflight is still true but we have invalid/empty data, clear loading state
|
|
1337
|
-
// This handles cases where data never arrives or is invalid
|
|
1338
|
-
this.variableInflight = false;
|
|
1311
|
+
// If variable has finished loading and resultSet is empty, ender empty data
|
|
1339
1312
|
this.setGridData([]);
|
|
1340
1313
|
}
|
|
1341
1314
|
return;
|
|
@@ -1345,142 +1318,13 @@ class TableComponent extends StylableComponent {
|
|
|
1345
1318
|
}
|
|
1346
1319
|
}
|
|
1347
1320
|
ngOnDestroy() {
|
|
1348
|
-
// MEMORY LEAK FIX: Remove document click listener
|
|
1349
1321
|
document.removeEventListener('click', this.documentClickBind);
|
|
1350
|
-
// MEMORY LEAK FIX: Unsubscribe from navigator watches
|
|
1351
1322
|
if (this.navigatorResultWatch) {
|
|
1352
1323
|
this.navigatorResultWatch.unsubscribe();
|
|
1353
|
-
this.navigatorResultWatch = null;
|
|
1354
1324
|
}
|
|
1355
1325
|
if (this.navigatorMaxResultWatch) {
|
|
1356
1326
|
this.navigatorMaxResultWatch.unsubscribe();
|
|
1357
|
-
this.navigatorMaxResultWatch = null;
|
|
1358
|
-
}
|
|
1359
|
-
// MEMORY LEAK FIX: Clear all ViewContainerRef embedded views
|
|
1360
|
-
// These hold references to row data, custom expressions, and inline widgets
|
|
1361
|
-
if (this.customExprViewRef) {
|
|
1362
|
-
this.customExprViewRef.clear();
|
|
1363
|
-
}
|
|
1364
|
-
if (this.rowActionsViewRef) {
|
|
1365
|
-
this.rowActionsViewRef.clear();
|
|
1366
|
-
}
|
|
1367
|
-
if (this.filterViewRef) {
|
|
1368
|
-
this.filterViewRef.clear();
|
|
1369
|
-
}
|
|
1370
|
-
if (this.inlineEditViewRef) {
|
|
1371
|
-
this.inlineEditViewRef.clear();
|
|
1372
|
-
}
|
|
1373
|
-
if (this.inlineEditNewViewRef) {
|
|
1374
|
-
this.inlineEditNewViewRef.clear();
|
|
1375
|
-
}
|
|
1376
|
-
if (this.rowDetailViewRef) {
|
|
1377
|
-
this.rowDetailViewRef.clear();
|
|
1378
|
-
}
|
|
1379
|
-
if (this.rowExpansionActionViewRef) {
|
|
1380
|
-
this.rowExpansionActionViewRef.clear();
|
|
1381
|
-
}
|
|
1382
|
-
if (this.dynamicTableRef) {
|
|
1383
|
-
this.dynamicTableRef.clear();
|
|
1384
|
-
}
|
|
1385
|
-
// MEMORY LEAK FIX: Clear compiled template caches
|
|
1386
|
-
this.rowActionsCompiledTl = {};
|
|
1387
|
-
this.rowFilterCompliedTl = {};
|
|
1388
|
-
this.inlineCompliedTl = {};
|
|
1389
|
-
this.inlineNewCompliedTl = {};
|
|
1390
|
-
this.customExprCompiledTl = {};
|
|
1391
|
-
this.customExprCompiledSummaryTl = {};
|
|
1392
|
-
this.rowDefInstances = {};
|
|
1393
|
-
this.rowDefMap = {};
|
|
1394
|
-
this.rowExpansionActionTl = {};
|
|
1395
|
-
// MEMORY LEAK FIX: Clear dynamic context
|
|
1396
|
-
if (this._dynamicContext) {
|
|
1397
|
-
Object.keys(this._dynamicContext).forEach(key => {
|
|
1398
|
-
delete this._dynamicContext[key];
|
|
1399
|
-
});
|
|
1400
|
-
this._dynamicContext = null;
|
|
1401
1327
|
}
|
|
1402
|
-
// MEMORY LEAK FIX: Clear data arrays
|
|
1403
|
-
this._gridData = [];
|
|
1404
|
-
this.items = [];
|
|
1405
|
-
this.selectedItems = [];
|
|
1406
|
-
this.fieldDefs = [];
|
|
1407
|
-
this.fullFieldDefs = [];
|
|
1408
|
-
this.__fullData = null;
|
|
1409
|
-
// MEMORY LEAK FIX: Destroy jQuery datatable widget before clearing gridOptions
|
|
1410
|
-
if (this.datagridElement && this.datagridElement.datatable) {
|
|
1411
|
-
try {
|
|
1412
|
-
this.datagridElement.datatable('destroy');
|
|
1413
|
-
}
|
|
1414
|
-
catch (e) {
|
|
1415
|
-
// Ignore errors during destroy
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
// MEMORY LEAK FIX: Clear gridOptions to release all function closures and data
|
|
1419
|
-
// gridOptions holds many closures that capture 'this' and prevent GC
|
|
1420
|
-
if (this.gridOptions) {
|
|
1421
|
-
// Clear data array
|
|
1422
|
-
if (this.gridOptions.data) {
|
|
1423
|
-
this.gridOptions.data = [];
|
|
1424
|
-
}
|
|
1425
|
-
// Clear column definitions
|
|
1426
|
-
if (this.gridOptions.colDefs) {
|
|
1427
|
-
this.gridOptions.colDefs = [];
|
|
1428
|
-
}
|
|
1429
|
-
// Clear row actions
|
|
1430
|
-
if (this.gridOptions.rowActions) {
|
|
1431
|
-
this.gridOptions.rowActions = [];
|
|
1432
|
-
}
|
|
1433
|
-
// Clear header config
|
|
1434
|
-
if (this.gridOptions.headerConfig) {
|
|
1435
|
-
this.gridOptions.headerConfig = [];
|
|
1436
|
-
}
|
|
1437
|
-
// Nullify all function references to break closures
|
|
1438
|
-
Object.keys(this.gridOptions).forEach(key => {
|
|
1439
|
-
if (typeof this.gridOptions[key] === 'function') {
|
|
1440
|
-
this.gridOptions[key] = null;
|
|
1441
|
-
}
|
|
1442
|
-
});
|
|
1443
|
-
}
|
|
1444
|
-
// MEMORY LEAK FIX: Clear other data structures
|
|
1445
|
-
this.columns = {};
|
|
1446
|
-
this.formfields = {};
|
|
1447
|
-
this.rowFilter = {};
|
|
1448
|
-
this.actions = [];
|
|
1449
|
-
this._actions = { header: [], footer: [] };
|
|
1450
|
-
this.exportOptions = [];
|
|
1451
|
-
this.headerConfig = [];
|
|
1452
|
-
this.rowActions = [];
|
|
1453
|
-
// MEMORY LEAK FIX: Clear all @ContentChildren QueryLists holding template references
|
|
1454
|
-
// These QueryLists hold TemplateRef instances that create circular references to the parent LView
|
|
1455
|
-
if (this.rowActionTmpl) {
|
|
1456
|
-
this.rowActionTmpl.reset([]);
|
|
1457
|
-
}
|
|
1458
|
-
if (this.filterTmpl) {
|
|
1459
|
-
this.filterTmpl.reset([]);
|
|
1460
|
-
}
|
|
1461
|
-
if (this.inlineWidgetTmpl) {
|
|
1462
|
-
this.inlineWidgetTmpl.reset([]);
|
|
1463
|
-
}
|
|
1464
|
-
if (this.inlineWidgetNewTmpl) {
|
|
1465
|
-
this.inlineWidgetNewTmpl.reset([]);
|
|
1466
|
-
}
|
|
1467
|
-
if (this.customExprTmpl) {
|
|
1468
|
-
this.customExprTmpl.reset([]);
|
|
1469
|
-
}
|
|
1470
|
-
if (this.rowExpansionActionTmpl) {
|
|
1471
|
-
this.rowExpansionActionTmpl.reset([]);
|
|
1472
|
-
}
|
|
1473
|
-
// MEMORY LEAK FIX: Clear @ContentChild template reference
|
|
1474
|
-
this.rowExpansionTmpl = null;
|
|
1475
|
-
// MEMORY LEAK FIX: Complete and clear subjects
|
|
1476
|
-
if (this.selectedItemChange) {
|
|
1477
|
-
this.selectedItemChange.complete();
|
|
1478
|
-
this.selectedItemChange = null;
|
|
1479
|
-
}
|
|
1480
|
-
// MEMORY LEAK FIX: Clear ViewChild references
|
|
1481
|
-
this.dataNavigator = null;
|
|
1482
|
-
this._tableElement = null;
|
|
1483
|
-
// console.log("table component destroyed");
|
|
1484
1328
|
super.ngOnDestroy();
|
|
1485
1329
|
}
|
|
1486
1330
|
addRowIndex(row) {
|
|
@@ -1551,9 +1395,6 @@ class TableComponent extends StylableComponent {
|
|
|
1551
1395
|
if (!key.endsWith('_filter') && ((key.endsWith('_new') && newRow) || (!key.endsWith('_new') && !newRow))) {
|
|
1552
1396
|
ctrls[key].setValue('');
|
|
1553
1397
|
this.resetFormControl(ctrls[key]);
|
|
1554
|
-
// MEMORY LEAK FIX: Clear validators to release references
|
|
1555
|
-
ctrls[key].clearValidators();
|
|
1556
|
-
ctrls[key].clearAsyncValidators();
|
|
1557
1398
|
}
|
|
1558
1399
|
});
|
|
1559
1400
|
}
|
|
@@ -1873,14 +1714,7 @@ class TableComponent extends StylableComponent {
|
|
|
1873
1714
|
defaultFieldDefs.forEach(col => {
|
|
1874
1715
|
this.columns[col.field] = col;
|
|
1875
1716
|
});
|
|
1876
|
-
|
|
1877
|
-
try {
|
|
1878
|
-
this.invokeEventCallback('beforedatarender', { $data: data, $columns: this.columns, data: data, columns: this.columns });
|
|
1879
|
-
}
|
|
1880
|
-
catch (error) {
|
|
1881
|
-
// Log error but continue with rendering - beforedatarender errors should not block table rendering
|
|
1882
|
-
console.warn('Error in beforedatarender event callback, continuing with table rendering:', error);
|
|
1883
|
-
}
|
|
1717
|
+
this.invokeEventCallback('beforedatarender', { $data: data, $columns: this.columns, data: data, columns: this.columns });
|
|
1884
1718
|
defaultFieldDefs = [];
|
|
1885
1719
|
// Apply the changes made by the user
|
|
1886
1720
|
forEach(this.columns, val => {
|
|
@@ -1919,23 +1753,19 @@ class TableComponent extends StylableComponent {
|
|
|
1919
1753
|
return sortExp || '';
|
|
1920
1754
|
}
|
|
1921
1755
|
onPropertyChange(key, nv, ov) {
|
|
1922
|
-
// Guard against property changes after component destruction
|
|
1923
|
-
if (this.isDestroyed) {
|
|
1924
|
-
return;
|
|
1925
|
-
}
|
|
1926
1756
|
let enableNewRow, widgetState;
|
|
1927
1757
|
switch (key) {
|
|
1928
1758
|
case 'datasource':
|
|
1929
1759
|
// Fix for [WMS-23653] when startUpdate is false (request on page load property is unchecked),
|
|
1930
1760
|
// then set status msg as "No data found"
|
|
1931
|
-
if (this.allowpagesizechange
|
|
1761
|
+
if (this.allowpagesizechange) {
|
|
1932
1762
|
this.datasource.maxResults = this.pagesize || this.datasource.maxResults;
|
|
1933
1763
|
}
|
|
1934
|
-
if (nv
|
|
1764
|
+
if (nv.startUpdate === false) {
|
|
1935
1765
|
this.variableInflight = false;
|
|
1936
1766
|
this.callDataGridMethod('setStatus', 'nodata', this.nodatamessage);
|
|
1937
1767
|
}
|
|
1938
|
-
if (
|
|
1768
|
+
if (get(this.datasource, 'category') !== 'wm.Variable') {
|
|
1939
1769
|
this.headerselectall = false;
|
|
1940
1770
|
this.setDataGridOption("headerselectall", false);
|
|
1941
1771
|
}
|
|
@@ -1947,12 +1777,6 @@ class TableComponent extends StylableComponent {
|
|
|
1947
1777
|
this.gridOptions.setIsNextPageData(false);
|
|
1948
1778
|
}
|
|
1949
1779
|
if (this.binddatasource && !this.datasource) {
|
|
1950
|
-
// If datasource is not set yet, clear loading state and show no data
|
|
1951
|
-
// This prevents tables from being stuck in loading state
|
|
1952
|
-
if (this.variableInflight) {
|
|
1953
|
-
this.variableInflight = false;
|
|
1954
|
-
this.callDataGridMethod('setStatus', 'nodata', this.nodatamessage);
|
|
1955
|
-
}
|
|
1956
1780
|
return;
|
|
1957
1781
|
}
|
|
1958
1782
|
// if table is inside list then table dataset will be set as "item.XXX" and there is no datasource.
|
|
@@ -2056,11 +1880,9 @@ class TableComponent extends StylableComponent {
|
|
|
2056
1880
|
this.allowpagesizechange = nv;
|
|
2057
1881
|
break;
|
|
2058
1882
|
case 'pagesizeoptions':
|
|
2059
|
-
this.
|
|
2060
|
-
this.
|
|
2061
|
-
this.
|
|
2062
|
-
if (this.allowpagesizechange)
|
|
2063
|
-
this.setDefaultPageSize(nv);
|
|
1883
|
+
this.gridOptions.pagesizeoptions = nv;
|
|
1884
|
+
this.pagesizeoptions = nv;
|
|
1885
|
+
this.setDefaultPageSize(nv);
|
|
2064
1886
|
break;
|
|
2065
1887
|
case 'multiselecttitle':
|
|
2066
1888
|
this.setDataGridOption('multiselecttitle', nv);
|
|
@@ -2104,41 +1926,12 @@ class TableComponent extends StylableComponent {
|
|
|
2104
1926
|
this.pagesize = nv;
|
|
2105
1927
|
}
|
|
2106
1928
|
this.updatedPageSize = nv;
|
|
2107
|
-
if (this.isPageSizeOptionsChanged()) {
|
|
2108
|
-
this.dataNavigator.defaultPageSizeOptions = this.pagesizeoptions?.split(',').map(Number).sort((a, b) => a - b) || [];
|
|
2109
|
-
this.dataNavigator.pageSizeOptions = [...this.dataNavigator.defaultPageSizeOptions];
|
|
2110
|
-
}
|
|
2111
1929
|
}
|
|
2112
1930
|
this.dataNavigator.options = {
|
|
2113
1931
|
maxResults: nv
|
|
2114
1932
|
};
|
|
2115
1933
|
this.dataNavigator.widget.maxResults = nv;
|
|
2116
1934
|
this.dataNavigator.maxResults = nv;
|
|
2117
|
-
if (this.datasource) {
|
|
2118
|
-
this.datasource.maxResults = this.pagesize || this.datasource.maxResults;
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
isPageSizeOptionsChanged() {
|
|
2122
|
-
return !isEqual(this.prevPagesizeoptions, this.pagesizeoptions);
|
|
2123
|
-
}
|
|
2124
|
-
selectPageSize(pagesize) {
|
|
2125
|
-
if (!this.allowpagesizechange && !pagesize)
|
|
2126
|
-
return;
|
|
2127
|
-
if (pagesize < this.dataNavigator.pageSizeOptions[0] || pagesize > this.dataNavigator.pageSizeOptions[this.dataNavigator.pageSizeOptions.length - 1]
|
|
2128
|
-
|| !this.dataNavigator.pageSizeOptions.includes(Number(pagesize))) {
|
|
2129
|
-
pagesize = this.dataNavigator.pageSizeOptions[0];
|
|
2130
|
-
}
|
|
2131
|
-
this.dataNavigator.onPageSizeChange(undefined, pagesize);
|
|
2132
|
-
}
|
|
2133
|
-
sanitizeCommaSeparatedIntegers(input) {
|
|
2134
|
-
if (!input)
|
|
2135
|
-
return "";
|
|
2136
|
-
const uniqueNumbers = Array.from(new Set(input
|
|
2137
|
-
.split(",")
|
|
2138
|
-
.map(v => v.trim())
|
|
2139
|
-
.filter(v => /^-?\d+$/.test(v))
|
|
2140
|
-
.map(v => Math.abs(parseInt(v, 10)))));
|
|
2141
|
-
return uniqueNumbers.join(",");
|
|
2142
1935
|
}
|
|
2143
1936
|
onDataSourceChange() {
|
|
2144
1937
|
this.fieldDefs.forEach(col => {
|
|
@@ -2664,7 +2457,7 @@ class TableCUDDirective {
|
|
|
2664
2457
|
this.updateVariable(response, options.callBack);
|
|
2665
2458
|
}
|
|
2666
2459
|
else if (!this.table.datasource.execute(DataSource.Operation.IS_API_AWARE)) {
|
|
2667
|
-
this.table.initiateSelectItem('current', response, undefined,
|
|
2460
|
+
this.table.initiateSelectItem('current', response, undefined, false, options.callBack);
|
|
2668
2461
|
}
|
|
2669
2462
|
triggerFn(options.success, response);
|
|
2670
2463
|
this.table.invokeEventCallback('rowupdate', { $event: options.event, $data: response, row: response });
|
|
@@ -2914,12 +2707,6 @@ class TableCUDDirective {
|
|
|
2914
2707
|
this.table.callDataGridMethod('cancelEdit', $row);
|
|
2915
2708
|
}
|
|
2916
2709
|
}
|
|
2917
|
-
ngOnDestroy() {
|
|
2918
|
-
// MEMORY LEAK FIX: Clear all references
|
|
2919
|
-
this.table = null;
|
|
2920
|
-
this.dialogService = null;
|
|
2921
|
-
this.app = null;
|
|
2922
|
-
}
|
|
2923
2710
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableCUDDirective, deps: [{ token: TableComponent, self: true }, { token: i2.AbstractDialogService }, { token: i2.App }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2924
2711
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableCUDDirective, isStandalone: true, selector: "[wmTableCUD]", ngImport: i0 }); }
|
|
2925
2712
|
}
|
|
@@ -3232,12 +3019,6 @@ class TableFilterSortDirective {
|
|
|
3232
3019
|
// Function that checks if a given string is a valid date and returns the timestamp if it is, or NaN if it's not.
|
|
3233
3020
|
parseDateString(dateString) {
|
|
3234
3021
|
const timestamp = Date.parse(dateString);
|
|
3235
|
-
// handling case when string starts with string and end with number
|
|
3236
|
-
const trimmed = dateString.trim();
|
|
3237
|
-
const monthRegex = /\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:t(?:ember)?)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b/i;
|
|
3238
|
-
if (/^[A-Za-z]+/.test(trimmed) && /\d+$/.test(trimmed) && !monthRegex.test(trimmed)) {
|
|
3239
|
-
return NaN;
|
|
3240
|
-
}
|
|
3241
3022
|
if (!isNaN(timestamp)) {
|
|
3242
3023
|
return timestamp;
|
|
3243
3024
|
}
|
|
@@ -3253,7 +3034,7 @@ class TableFilterSortDirective {
|
|
|
3253
3034
|
const fieldValue = get(find(data, sortObj.field), sortObj.field);
|
|
3254
3035
|
const isValidDateString = typeof fieldValue === 'string' ? this.parseDateString(fieldValue) : NaN;
|
|
3255
3036
|
if (!isNaN(isValidDateString)) { // if the field is a date string
|
|
3256
|
-
data = orderBy(data, [(item) => this.parseDateString(
|
|
3037
|
+
data = orderBy(data, [(item) => this.parseDateString(item[sortObj.field])], [sortObj.direction]);
|
|
3257
3038
|
}
|
|
3258
3039
|
else if (sortObj.sortBy ? this.table.columns[sortObj.sortBy]?.caseinsensitive : this.table.columns[sortObj.field]?.caseinsensitive) {
|
|
3259
3040
|
//Fix for [WMS-27505]: Added case-insensitive sorting so that uppercase and lowercase letters are treated the same when sorting.
|
|
@@ -3615,10 +3396,6 @@ class TableFilterSortDirective {
|
|
|
3615
3396
|
condition: logicalOp
|
|
3616
3397
|
});
|
|
3617
3398
|
}
|
|
3618
|
-
ngOnDestroy() {
|
|
3619
|
-
// MEMORY LEAK FIX: Clear table reference
|
|
3620
|
-
this.table = null;
|
|
3621
|
-
}
|
|
3622
3399
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableFilterSortDirective, deps: [{ token: TableComponent, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3623
3400
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableFilterSortDirective, isStandalone: true, selector: "[wmTableFilterSort]", ngImport: i0 }); }
|
|
3624
3401
|
}
|
|
@@ -3705,13 +3482,6 @@ class TableActionDirective extends BaseComponent {
|
|
|
3705
3482
|
this.buttonDef[key] = nv;
|
|
3706
3483
|
}
|
|
3707
3484
|
}
|
|
3708
|
-
ngOnDestroy() {
|
|
3709
|
-
// MEMORY LEAK FIX: Clear table and buttonDef references
|
|
3710
|
-
this.table = null;
|
|
3711
|
-
this.buttonDef = null;
|
|
3712
|
-
// Call parent ngOnDestroy (BaseComponent has cleanup)
|
|
3713
|
-
super.ngOnDestroy();
|
|
3714
|
-
}
|
|
3715
3485
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableActionDirective, deps: [{ token: i0.Injector }, { token: TableComponent, optional: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3716
3486
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableActionDirective, isStandalone: true, selector: "[wmTableAction]", providers: [
|
|
3717
3487
|
provideAsWidgetRef(TableActionDirective)
|
|
@@ -3876,14 +3646,6 @@ class TableColumnGroupDirective extends BaseComponent {
|
|
|
3876
3646
|
const fieldName = this.group && this.group.name;
|
|
3877
3647
|
setHeaderConfigForTable(this.table.headerConfig, this.config, fieldName, fieldName ? colIndex : headerIndex);
|
|
3878
3648
|
}
|
|
3879
|
-
ngOnDestroy() {
|
|
3880
|
-
// MEMORY LEAK FIX: Clear table, group, and config references
|
|
3881
|
-
this.table = null;
|
|
3882
|
-
this.group = null;
|
|
3883
|
-
this.config = null;
|
|
3884
|
-
// Call parent ngOnDestroy (BaseComponent has cleanup)
|
|
3885
|
-
super.ngOnDestroy();
|
|
3886
|
-
}
|
|
3887
3649
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableColumnGroupDirective, deps: [{ token: i0.Injector }, { token: TableColumnGroupDirective, optional: true, skipSelf: true }, { token: TableComponent, optional: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3888
3650
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableColumnGroupDirective, isStandalone: true, selector: "[wmTableColumnGroup]", providers: [
|
|
3889
3651
|
provideAsWidgetRef(TableColumnGroupDirective)
|
|
@@ -4078,10 +3840,6 @@ class TableColumnDirective extends BaseComponent {
|
|
|
4078
3840
|
}
|
|
4079
3841
|
// Remove validators for the inline widget and set form to untouched
|
|
4080
3842
|
removeValidations() {
|
|
4081
|
-
// Guard against component destruction or table/ngform being null
|
|
4082
|
-
if (this.isDestroyed || !this.table || !this.table.ngform) {
|
|
4083
|
-
return;
|
|
4084
|
-
}
|
|
4085
3843
|
this.table.ngform.markAsUntouched();
|
|
4086
3844
|
const control = this.getFormControl();
|
|
4087
3845
|
if (!control) {
|
|
@@ -4093,10 +3851,6 @@ class TableColumnDirective extends BaseComponent {
|
|
|
4093
3851
|
}
|
|
4094
3852
|
// Apply default|sync|async|prop validators for QuickEdit new row form control
|
|
4095
3853
|
applyNewRowValidations() {
|
|
4096
|
-
// Guard against component destruction or table/ngform being null
|
|
4097
|
-
if (this.isDestroyed || !this.table || !this.table.ngform) {
|
|
4098
|
-
return;
|
|
4099
|
-
}
|
|
4100
3854
|
if (!this._checkNewEditableRowControl()) {
|
|
4101
3855
|
return;
|
|
4102
3856
|
}
|
|
@@ -4113,37 +3867,22 @@ class TableColumnDirective extends BaseComponent {
|
|
|
4113
3867
|
}
|
|
4114
3868
|
// Remove validators for the QuickEdit new row widget and set form to untouched
|
|
4115
3869
|
removeNewRowValidations() {
|
|
4116
|
-
// Guard against component destruction or table/ngform being null
|
|
4117
|
-
if (this.isDestroyed || !this.table || !this.table.ngform) {
|
|
4118
|
-
return;
|
|
4119
|
-
}
|
|
4120
3870
|
this.table.ngform.markAsUntouched();
|
|
4121
3871
|
if (!this._checkNewEditableRowControl()) {
|
|
4122
3872
|
return;
|
|
4123
3873
|
}
|
|
4124
3874
|
const control = this.getFormControl('_new');
|
|
4125
|
-
if (!control) {
|
|
4126
|
-
return;
|
|
4127
|
-
}
|
|
4128
3875
|
control.clearValidators();
|
|
4129
3876
|
control.clearAsyncValidators();
|
|
4130
3877
|
control.updateValueAndValidity();
|
|
4131
3878
|
}
|
|
4132
3879
|
addFormControl(suffix) {
|
|
4133
|
-
// Guard against component destruction or table/ngform being null
|
|
4134
|
-
if (this.isDestroyed || !this.table || !this.table.ngform) {
|
|
4135
|
-
return;
|
|
4136
|
-
}
|
|
4137
3880
|
const ctrlName = suffix ? (this.binding + suffix) : this.binding;
|
|
4138
3881
|
this.table.ngform.addControl(ctrlName, this.table.fb.control(''));
|
|
4139
3882
|
}
|
|
4140
3883
|
getFormControl(suffix) {
|
|
4141
|
-
// Guard against component destruction or table/ngform being null
|
|
4142
|
-
if (this.isDestroyed || !this.table || !this.table.ngform) {
|
|
4143
|
-
return null;
|
|
4144
|
-
}
|
|
4145
3884
|
const ctrlName = suffix ? (this.binding + suffix) : this.binding;
|
|
4146
|
-
return this.table.ngform.controls[ctrlName]
|
|
3885
|
+
return this.table.ngform.controls[ctrlName];
|
|
4147
3886
|
}
|
|
4148
3887
|
_checkNewEditableRowControl() {
|
|
4149
3888
|
return this._isNewEditableRow && this.getFormControl('_new');
|
|
@@ -4217,16 +3956,12 @@ class TableColumnDirective extends BaseComponent {
|
|
|
4217
3956
|
}
|
|
4218
3957
|
// On field value change, apply cascading filter and set validation message
|
|
4219
3958
|
onValueChange(val, widget) {
|
|
4220
|
-
// Guard against component destruction or table being null
|
|
4221
|
-
if (this.isDestroyed || !this.table) {
|
|
4222
|
-
return;
|
|
4223
|
-
}
|
|
4224
3959
|
if (val !== null) {
|
|
4225
3960
|
applyFilterOnField(this.table.datasource, this.widget, this.table.fieldDefs, val, {
|
|
4226
3961
|
widget: 'edit-widget-type'
|
|
4227
3962
|
});
|
|
4228
3963
|
}
|
|
4229
|
-
if (this.table.ngform
|
|
3964
|
+
if (this.table.ngform.touched) {
|
|
4230
3965
|
this.activeControlType = widget;
|
|
4231
3966
|
if (widget === 'inlineInstance') {
|
|
4232
3967
|
this.notifyChanges();
|
|
@@ -4517,83 +4252,6 @@ class TableColumnDirective extends BaseComponent {
|
|
|
4517
4252
|
this.table.redraw(true);
|
|
4518
4253
|
}
|
|
4519
4254
|
}
|
|
4520
|
-
ngOnDestroy() {
|
|
4521
|
-
// MEMORY LEAK FIX: Clear ContentChildren QueryLists
|
|
4522
|
-
if (this._filterInstances) {
|
|
4523
|
-
try {
|
|
4524
|
-
this._filterInstances.reset([]);
|
|
4525
|
-
}
|
|
4526
|
-
catch (e) {
|
|
4527
|
-
// Silently handle cleanup errors - QueryList might already be destroyed
|
|
4528
|
-
}
|
|
4529
|
-
}
|
|
4530
|
-
if (this._inlineInstances) {
|
|
4531
|
-
try {
|
|
4532
|
-
this._inlineInstances.reset([]);
|
|
4533
|
-
}
|
|
4534
|
-
catch (e) {
|
|
4535
|
-
// Silently handle cleanup errors - QueryList might already be destroyed
|
|
4536
|
-
}
|
|
4537
|
-
}
|
|
4538
|
-
if (this._inlineInstancesNew) {
|
|
4539
|
-
try {
|
|
4540
|
-
this._inlineInstancesNew.reset([]);
|
|
4541
|
-
}
|
|
4542
|
-
catch (e) {
|
|
4543
|
-
// Silently handle cleanup errors - QueryList might already be destroyed
|
|
4544
|
-
}
|
|
4545
|
-
}
|
|
4546
|
-
// MEMORY LEAK FIX: Clear all widget instance references
|
|
4547
|
-
this.filterInstance = null;
|
|
4548
|
-
this.inlineInstance = null;
|
|
4549
|
-
this.inlineInstanceNew = null;
|
|
4550
|
-
// MEMORY LEAK FIX: Clear template references
|
|
4551
|
-
this.customExprTmpl = null;
|
|
4552
|
-
this.inlineWidthTempRef = null;
|
|
4553
|
-
this.filterTemplateRef = null;
|
|
4554
|
-
// MEMORY LEAK FIX: Clear dataset references
|
|
4555
|
-
this._filterDataSet = null;
|
|
4556
|
-
this.dataset = null;
|
|
4557
|
-
this._dataoptions = null;
|
|
4558
|
-
this._datasource = null;
|
|
4559
|
-
// MEMORY LEAK FIX: Clear validation objects
|
|
4560
|
-
if (this.fieldValidations) {
|
|
4561
|
-
try {
|
|
4562
|
-
this.fieldValidations.destroy();
|
|
4563
|
-
}
|
|
4564
|
-
catch (e) {
|
|
4565
|
-
// Silently handle cleanup errors
|
|
4566
|
-
}
|
|
4567
|
-
this.fieldValidations = null;
|
|
4568
|
-
}
|
|
4569
|
-
if (this.fieldValidations_new) {
|
|
4570
|
-
try {
|
|
4571
|
-
this.fieldValidations_new.destroy();
|
|
4572
|
-
}
|
|
4573
|
-
catch (e) {
|
|
4574
|
-
// Silently handle cleanup errors
|
|
4575
|
-
}
|
|
4576
|
-
this.fieldValidations_new = null;
|
|
4577
|
-
}
|
|
4578
|
-
this.syncValidators = [];
|
|
4579
|
-
this.asyncValidators = [];
|
|
4580
|
-
// MEMORY LEAK FIX: Clear filter control reference
|
|
4581
|
-
this.filterControl = null;
|
|
4582
|
-
// MEMORY LEAK FIX: Clear notify fields array
|
|
4583
|
-
if (this.notifyForFields) {
|
|
4584
|
-
this.notifyForFields = [];
|
|
4585
|
-
}
|
|
4586
|
-
// MEMORY LEAK FIX: Clear observe fields array
|
|
4587
|
-
if (this.observeOnFields) {
|
|
4588
|
-
this.observeOnFields = [];
|
|
4589
|
-
}
|
|
4590
|
-
// MEMORY LEAK FIX: Clear table and group references
|
|
4591
|
-
// Note: These are injected dependencies, but clearing helps GC
|
|
4592
|
-
this.table = null;
|
|
4593
|
-
this.group = null;
|
|
4594
|
-
// Call parent ngOnDestroy
|
|
4595
|
-
super.ngOnDestroy();
|
|
4596
|
-
}
|
|
4597
4255
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableColumnDirective, deps: [{ token: i0.Injector }, { token: i2.AppDefaults }, { token: TableComponent, optional: true }, { token: TableColumnGroupDirective, optional: true }, { token: 'filterdataset.bind', attribute: true }, { token: 'dataset.bind', attribute: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4598
4256
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableColumnDirective, isStandalone: true, selector: "[wmTableColumn]", providers: [
|
|
4599
4257
|
provideAsWidgetRef(TableColumnDirective)
|
|
@@ -4688,13 +4346,6 @@ class TableRowDirective extends BaseComponent {
|
|
|
4688
4346
|
this.config.content = this.content;
|
|
4689
4347
|
}
|
|
4690
4348
|
}
|
|
4691
|
-
ngOnDestroy() {
|
|
4692
|
-
// MEMORY LEAK FIX: Clear table and config references
|
|
4693
|
-
this.table = null;
|
|
4694
|
-
this.config = null;
|
|
4695
|
-
// Call parent ngOnDestroy (BaseComponent has cleanup)
|
|
4696
|
-
super.ngOnDestroy();
|
|
4697
|
-
}
|
|
4698
4349
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableRowDirective, deps: [{ token: i0.Injector }, { token: TableComponent, optional: true, skipSelf: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4699
4350
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableRowDirective, isStandalone: true, selector: "[wmTableRow]", providers: [
|
|
4700
4351
|
provideAsWidgetRef(TableRowDirective)
|
|
@@ -4776,13 +4427,6 @@ class TableRowActionDirective extends BaseComponent {
|
|
|
4776
4427
|
this.populateAction();
|
|
4777
4428
|
this.table.registerRowActions(this.buttonDef);
|
|
4778
4429
|
}
|
|
4779
|
-
ngOnDestroy() {
|
|
4780
|
-
// MEMORY LEAK FIX: Clear table reference and button definition
|
|
4781
|
-
this.table = null;
|
|
4782
|
-
this.buttonDef = null;
|
|
4783
|
-
// Call parent ngOnDestroy (BaseComponent has cleanup)
|
|
4784
|
-
super.ngOnDestroy();
|
|
4785
|
-
}
|
|
4786
4430
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableRowActionDirective, deps: [{ token: i0.Injector }, { token: TableComponent, optional: true }, { token: Context, self: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4787
4431
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableRowActionDirective, isStandalone: true, selector: "[wmTableRowAction]", providers: [
|
|
4788
4432
|
provideAsWidgetRef(TableRowActionDirective),
|