@wavemaker/app-ng-runtime 11.15.4-rc.250 → 11.15.5-1.256
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 +4 -13
- package/components/base/esm2022/utils/widget-utils.mjs +5 -4
- package/components/base/esm2022/widgets/common/base/base.component.mjs +1 -11
- package/components/base/fesm2022/index.mjs +4 -13
- package/components/base/fesm2022/index.mjs.map +1 -1
- package/components/containers/tabs/bundles/index.umd.js +1 -1
- package/components/containers/tabs/esm2022/tabs.animator.mjs +2 -2
- package/components/containers/tabs/fesm2022/index.mjs +1 -1
- package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
- package/components/data/form/bundles/index.umd.js +6 -3
- package/components/data/form/esm2022/form.component.mjs +5 -2
- package/components/data/form/esm2022/live-form/live-form.directive.mjs +3 -3
- package/components/data/form/fesm2022/index.mjs +6 -3
- package/components/data/form/fesm2022/index.mjs.map +1 -1
- package/components/data/form/live-form/live-form.directive.d.ts +1 -1
- package/components/data/list/bundles/index.umd.js +6 -0
- package/components/data/list/esm2022/list.component.mjs +7 -1
- package/components/data/list/fesm2022/index.mjs +6 -0
- package/components/data/list/fesm2022/index.mjs.map +1 -1
- package/components/data/pagination/bundles/index.umd.js +45 -7
- package/components/data/pagination/esm2022/pagination.component.mjs +46 -8
- package/components/data/pagination/fesm2022/index.mjs +45 -7
- package/components/data/pagination/fesm2022/index.mjs.map +1 -1
- package/components/data/pagination/pagination.component.d.ts +1 -0
- package/components/data/table/bundles/index.umd.js +228 -20
- package/components/data/table/esm2022/table-column/table-column.directive.mjs +6 -1
- package/components/data/table/esm2022/table-cud.directive.mjs +14 -3
- package/components/data/table/esm2022/table-filter.directive.mjs +6 -1
- package/components/data/table/esm2022/table.component.mjs +206 -19
- package/components/data/table/fesm2022/index.mjs +229 -21
- package/components/data/table/fesm2022/index.mjs.map +1 -1
- package/components/data/table/table.component.d.ts +16 -1
- package/core/bundles/index.umd.js +7 -1
- package/core/esm2022/utils/dom.mjs +4 -2
- package/core/esm2022/utils/utils.mjs +5 -1
- package/core/fesm2022/index.mjs +7 -1
- package/core/fesm2022/index.mjs.map +1 -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 +45 -12
- package/runtime/base/components/app-component/app.component.d.ts +1 -1
- package/runtime/base/esm2022/components/app-component/app.component.mjs +23 -12
- package/runtime/base/esm2022/guards/role.guard.mjs +2 -2
- package/runtime/base/esm2022/services/app.manager.service.mjs +23 -1
- package/runtime/base/fesm2022/index.mjs +45 -12
- package/runtime/base/fesm2022/index.mjs.map +1 -1
- package/runtime/base/services/app.manager.service.d.ts +5 -0
- package/scripts/datatable/datatable.js +282 -44
- package/transpiler/bundles/index.umd.js +3 -0
- package/transpiler/esm2022/build.mjs +4 -1
- package/transpiler/fesm2022/index.mjs +3 -0
- package/transpiler/fesm2022/index.mjs.map +1 -1
|
@@ -106,6 +106,8 @@
|
|
|
106
106
|
CSV: 'fa fa-file-text-o'
|
|
107
107
|
};
|
|
108
108
|
const ROW_OPS_FIELD = 'rowOperations';
|
|
109
|
+
/** Same default as `table.props.ts` — used when `pagesizeoptions` cannot be parsed to integers. */
|
|
110
|
+
const DEFAULT_PAGE_SIZE_OPTIONS = '5,10,20,50,100';
|
|
109
111
|
const noop = () => { };
|
|
110
112
|
const isInputBodyWrapper = target => {
|
|
111
113
|
const classes = ['.dropdown-menu', '.uib-typeahead-match', '.modal-dialog', '.toast'];
|
|
@@ -129,6 +131,19 @@
|
|
|
129
131
|
};
|
|
130
132
|
class TableComponent extends i4.StylableComponent {
|
|
131
133
|
static { this.initializeProps = registerProps$5(); }
|
|
134
|
+
/** wm.Variable + inline or quickedit (editmode is string from markup; normalize case). */
|
|
135
|
+
isModelVariableInlineOrQuickEdit() {
|
|
136
|
+
if (lodashEs.get(this.datasource, 'category') !== 'wm.Variable') {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const em = String(this.editmode || '').toLowerCase();
|
|
140
|
+
return em === 'quickedit' || em === 'inline';
|
|
141
|
+
}
|
|
142
|
+
/** True while an inline/quickedit row save is updating the grid (incl. delayed navigator emit). */
|
|
143
|
+
shouldSoftRefreshAfterModelVarRowSave() {
|
|
144
|
+
return this.isModelVariableInlineOrQuickEdit()
|
|
145
|
+
&& (this._isInlineEditSave || this._modelVarEditSoftRefreshActiveUntil > Date.now());
|
|
146
|
+
}
|
|
132
147
|
set gridData(newValue) {
|
|
133
148
|
this.isDataLoading = false;
|
|
134
149
|
// Fix for [WMS-24012]: hide no datafound msg when variableInflight is true and dataset is empty
|
|
@@ -196,7 +211,14 @@
|
|
|
196
211
|
console.warn('Error in beforedatarender event callback, continuing with table rendering:', error);
|
|
197
212
|
}
|
|
198
213
|
}
|
|
199
|
-
|
|
214
|
+
if (this.shouldSoftRefreshAfterModelVarRowSave()) {
|
|
215
|
+
const clonedData = i2.getClonedObject(this._gridData);
|
|
216
|
+
this.gridOptions.data = clonedData;
|
|
217
|
+
this.callDataGridMethod('softRefreshData', clonedData);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
this.setDataGridOption('data', i2.getClonedObject(this._gridData));
|
|
221
|
+
}
|
|
200
222
|
}
|
|
201
223
|
}
|
|
202
224
|
get gridData() {
|
|
@@ -249,6 +271,8 @@
|
|
|
249
271
|
this.formfields = {};
|
|
250
272
|
this.enablesort = true;
|
|
251
273
|
this.showviewlessbutton = false;
|
|
274
|
+
/** Covers async navigator/dataset updates after inline/quickedit save (wm.Variable). */
|
|
275
|
+
this._modelVarEditSoftRefreshActiveUntil = 0;
|
|
252
276
|
this.primaryKey = [];
|
|
253
277
|
this.selectedItems = [];
|
|
254
278
|
this.selectedItemChange = new rxjs.Subject();
|
|
@@ -324,10 +348,14 @@
|
|
|
324
348
|
showviewlessbutton: false,
|
|
325
349
|
ondemandmessage: '',
|
|
326
350
|
allowpagesizechange: false,
|
|
327
|
-
pagesizeoptions:
|
|
351
|
+
pagesizeoptions: DEFAULT_PAGE_SIZE_OPTIONS,
|
|
328
352
|
viewlessmessage: '',
|
|
329
353
|
loadingdatamsg: '',
|
|
330
354
|
isNextPageData: undefined,
|
|
355
|
+
enableSort: true,
|
|
356
|
+
multiselect: false,
|
|
357
|
+
showRadioColumn: false,
|
|
358
|
+
enableColumnSelection: false,
|
|
331
359
|
multiselecttitle: '',
|
|
332
360
|
multiselectarialabel: '',
|
|
333
361
|
radioselecttitle: '',
|
|
@@ -587,10 +615,24 @@
|
|
|
587
615
|
this.prevData = i2.getClonedObject(row);
|
|
588
616
|
},
|
|
589
617
|
afterRowUpdate: (row, e, callBack, options) => {
|
|
618
|
+
const isModelVarInlineOrQuick = this.isModelVariableInlineOrQuickEdit();
|
|
619
|
+
if (isModelVarInlineOrQuick) {
|
|
620
|
+
this._isInlineEditSave = true;
|
|
621
|
+
// Inline save triggers navigatePage / dataset emit asynchronously; a
|
|
622
|
+
// microtask timeout cleared the flag before gridData ran → full rerender.
|
|
623
|
+
this._modelVarEditSoftRefreshActiveUntil = Date.now() + 550;
|
|
624
|
+
}
|
|
590
625
|
i2.muteWatchers();
|
|
591
|
-
|
|
626
|
+
const v = lodashEs.get(this.datasource, 'category') === 'wm.Variable' && options && options.rowindex != null;
|
|
627
|
+
this.updateRecord(lodashEs.extend({}, options, { row, prevData: v ? options.rowindex : this.prevData, event: e, callBack }));
|
|
592
628
|
setTimeout(() => {
|
|
593
629
|
i2.unMuteWatchers();
|
|
630
|
+
if (isModelVarInlineOrQuick) {
|
|
631
|
+
setTimeout(() => {
|
|
632
|
+
this._isInlineEditSave = false;
|
|
633
|
+
this._modelVarEditSoftRefreshActiveUntil = 0;
|
|
634
|
+
}, 520);
|
|
635
|
+
}
|
|
594
636
|
}, 10);
|
|
595
637
|
},
|
|
596
638
|
onBeforeRowUpdate: (row, e, options) => {
|
|
@@ -663,11 +705,67 @@
|
|
|
663
705
|
this.customExprCompiledTl = {};
|
|
664
706
|
this.customExprCompiledSummaryTl = {};
|
|
665
707
|
},
|
|
708
|
+
updateCustomExpressionContexts: (preparedData) => {
|
|
709
|
+
const viewCount = this.customExprViewRef.length;
|
|
710
|
+
for (let i = 0; i < viewCount; i++) {
|
|
711
|
+
const viewRef = this.customExprViewRef.get(i);
|
|
712
|
+
if (!viewRef || !viewRef.context || !viewRef.context.row || viewRef.context.row.$index === undefined) {
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
const existingRow = viewRef.context.row;
|
|
716
|
+
const rowIndex = existingRow.$index - 1;
|
|
717
|
+
const dataRow = preparedData[rowIndex];
|
|
718
|
+
if (!dataRow) {
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
Object.keys(dataRow).forEach(key => {
|
|
722
|
+
if (key !== '$$index' && key !== '$$pk') {
|
|
723
|
+
existingRow[key] = dataRow[key];
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
existingRow.$isFirst = existingRow.$index === 1;
|
|
727
|
+
existingRow.$isLast = this.gridData.length === existingRow.$index;
|
|
728
|
+
viewRef.markForCheck();
|
|
729
|
+
}
|
|
730
|
+
},
|
|
666
731
|
clearRowDetailExpression: () => {
|
|
667
732
|
this.rowDetailViewRef.clear();
|
|
668
733
|
this.rowDefMap = {};
|
|
669
734
|
this.rowDefInstances = {};
|
|
670
735
|
},
|
|
736
|
+
invalidateRowDetailCache: (preparedData) => {
|
|
737
|
+
this.rowDefMap = {};
|
|
738
|
+
this.rowDefInstances = {};
|
|
739
|
+
// Update existing row detail view contexts in-place so currently
|
|
740
|
+
// expanded partials pick up the new row data via change detection.
|
|
741
|
+
const viewCount = this.rowDetailViewRef.length;
|
|
742
|
+
for (let i = 0; i < viewCount; i++) {
|
|
743
|
+
const viewRef = this.rowDetailViewRef.get(i);
|
|
744
|
+
if (!viewRef || !viewRef.context || !viewRef.context.row) {
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
const existingRow = viewRef.context.row;
|
|
748
|
+
const rowIndex = existingRow.$index - 1;
|
|
749
|
+
const dataRow = preparedData[rowIndex];
|
|
750
|
+
if (!dataRow) {
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
Object.keys(dataRow).forEach(key => {
|
|
754
|
+
if (key !== '$$index' && key !== '$$pk') {
|
|
755
|
+
existingRow[key] = dataRow[key];
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
viewRef.markForCheck();
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
refreshSelectedItems: () => {
|
|
762
|
+
const selectedRows = this.callDataGridMethod('getSelectedRows');
|
|
763
|
+
if (selectedRows.length) {
|
|
764
|
+
this.items.length = 0;
|
|
765
|
+
selectedRows.forEach(row => this.items.push(row));
|
|
766
|
+
this.selectedItemChange.next(selectedRows);
|
|
767
|
+
}
|
|
768
|
+
},
|
|
671
769
|
generateCustomExpressions: (rowData, index, summaryRow) => {
|
|
672
770
|
const row = this.getClonedRowObject(rowData);
|
|
673
771
|
const compileTemplate = (tmpl) => {
|
|
@@ -1092,7 +1190,8 @@
|
|
|
1092
1190
|
this.gridOptions.ondemandmessage = this.ondemandmessage;
|
|
1093
1191
|
this.gridOptions.viewlessmessage = this.viewlessmessage;
|
|
1094
1192
|
this.gridOptions.loadingdatamsg = this.loadingdatamsg;
|
|
1095
|
-
this.gridOptions.pagesizeoptions = this.pagesizeoptions;
|
|
1193
|
+
this.gridOptions.pagesizeoptions = this.sanitizeCommaSeparatedIntegers(this.pagesizeoptions);
|
|
1194
|
+
this.pagesizeoptions = this.gridOptions.pagesizeoptions;
|
|
1096
1195
|
this.gridOptions.multiselecttitle = this.multiselecttitle;
|
|
1097
1196
|
this.gridOptions.multiselectarialabel = this.multiselectarialabel;
|
|
1098
1197
|
this.gridOptions.radioselecttitle = this.radioselecttitle;
|
|
@@ -1369,6 +1468,8 @@
|
|
|
1369
1468
|
}
|
|
1370
1469
|
}
|
|
1371
1470
|
ngOnDestroy() {
|
|
1471
|
+
this._modelVarEditSoftRefreshActiveUntil = 0;
|
|
1472
|
+
this._isInlineEditSave = false;
|
|
1372
1473
|
// MEMORY LEAK FIX: Remove document click listener
|
|
1373
1474
|
document.removeEventListener('click', this.documentClickBind);
|
|
1374
1475
|
// MEMORY LEAK FIX: Unsubscribe from navigator watches
|
|
@@ -1522,6 +1623,7 @@
|
|
|
1522
1623
|
row.$isLast = this.gridData.length === row.$index;
|
|
1523
1624
|
delete row.$$index;
|
|
1524
1625
|
delete row.$$pk;
|
|
1626
|
+
delete row.$$wmSourceListIndex;
|
|
1525
1627
|
return row;
|
|
1526
1628
|
}
|
|
1527
1629
|
handleLoading(data) {
|
|
@@ -1621,10 +1723,13 @@
|
|
|
1621
1723
|
}
|
|
1622
1724
|
setDataGridOption(optionName, newVal, forceSet = false) {
|
|
1623
1725
|
if (!this.datagridElement || !this.datagridElement.datatable || !this.datagridElement.datatable('instance')) {
|
|
1726
|
+
// Bound properties can update before the jQuery widget is initialized.
|
|
1727
|
+
// Keep gridOptions in sync so the initial datatable() call sees the latest value.
|
|
1728
|
+
this.gridOptions[optionName] = newVal;
|
|
1624
1729
|
return;
|
|
1625
1730
|
}
|
|
1626
1731
|
const option = {};
|
|
1627
|
-
if (i2.isDefined && (!lodashEs.isEqual(newVal, this.gridOptions[optionName]) || forceSet)) {
|
|
1732
|
+
if (i2.isDefined(newVal) && (!lodashEs.isEqual(newVal, this.gridOptions[optionName]) || forceSet)) {
|
|
1628
1733
|
option[optionName] = newVal;
|
|
1629
1734
|
this.datagridElement.datatable('option', option);
|
|
1630
1735
|
this.gridOptions[optionName] = newVal;
|
|
@@ -1763,6 +1868,14 @@
|
|
|
1763
1868
|
// Apply filter and sort, if data is refreshed through Refresh data method
|
|
1764
1869
|
if (!this.isNavigationEnabled() && this._isClientSearch) {
|
|
1765
1870
|
data = i2.getClonedObject(serviceData);
|
|
1871
|
+
if (lodashEs.isObject(data) && !lodashEs.isArray(data)) {
|
|
1872
|
+
data = [data];
|
|
1873
|
+
}
|
|
1874
|
+
if (lodashEs.get(this.datasource, 'category') === 'wm.Variable' && lodashEs.isArray(data)) {
|
|
1875
|
+
for (let i = 0; i < data.length; i++) {
|
|
1876
|
+
data[i].$$wmSourceListIndex = i;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1766
1879
|
data = this.getSearchResult(data, this.filterInfo);
|
|
1767
1880
|
data = this.getSortResult(data, this.sortInfo);
|
|
1768
1881
|
this.serverData = data;
|
|
@@ -2059,13 +2172,48 @@
|
|
|
2059
2172
|
case 'allowpagesizechange':
|
|
2060
2173
|
this.gridOptions.allowpagesizechange = nv;
|
|
2061
2174
|
this.allowpagesizechange = nv;
|
|
2175
|
+
this.dataNavigator.allowpagesizechange = nv;
|
|
2176
|
+
if (nv) {
|
|
2177
|
+
const pagesizeoptions = this.sanitizeCommaSeparatedIntegers(this.pagesizeoptions);
|
|
2178
|
+
this.gridOptions.pagesizeoptions = pagesizeoptions;
|
|
2179
|
+
this.pagesizeoptions = pagesizeoptions;
|
|
2180
|
+
this.prevPagesizeoptions = '';
|
|
2181
|
+
this.setDefaultPageSize(this.pagesize || this.actualPageSize || this.gridOptions.getPageSize());
|
|
2182
|
+
}
|
|
2062
2183
|
break;
|
|
2063
2184
|
case 'pagesizeoptions':
|
|
2064
2185
|
this.prevPagesizeoptions = this.sanitizeCommaSeparatedIntegers(ov);
|
|
2065
2186
|
this.gridOptions.pagesizeoptions = this.sanitizeCommaSeparatedIntegers(nv);
|
|
2066
|
-
this.pagesizeoptions = this.
|
|
2067
|
-
if (this.allowpagesizechange)
|
|
2068
|
-
this.setDefaultPageSize(
|
|
2187
|
+
this.pagesizeoptions = this.gridOptions.pagesizeoptions;
|
|
2188
|
+
if (this.allowpagesizechange) {
|
|
2189
|
+
this.setDefaultPageSize(this.pagesize || this.actualPageSize || this.gridOptions.getPageSize());
|
|
2190
|
+
if (lodashEs.get(this.datasource, 'category') !== 'wm.Variable') {
|
|
2191
|
+
this.dataNavigator.onPageSizeChange(undefined, this.dataNavigator.pageSizeOptions[0] || this.pagesize);
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
break;
|
|
2195
|
+
case 'showheader':
|
|
2196
|
+
this.setDataGridOption('showHeader', nv);
|
|
2197
|
+
break;
|
|
2198
|
+
case 'showheader':
|
|
2199
|
+
this.setDataGridOption('showHeader', nv);
|
|
2200
|
+
break;
|
|
2201
|
+
case 'enablesort':
|
|
2202
|
+
this.setDataGridOption('enableSort', nv);
|
|
2203
|
+
break;
|
|
2204
|
+
case 'enablecolumnselection':
|
|
2205
|
+
// this.enablecolumnselection = nv;
|
|
2206
|
+
//this.gridOptions.enableColumnSelection = nv;
|
|
2207
|
+
this.setDataGridOption('enableColumnSelection', nv);
|
|
2208
|
+
break;
|
|
2209
|
+
case 'isrowselectable':
|
|
2210
|
+
this.setDataGridOption('isrowselectable', nv);
|
|
2211
|
+
break;
|
|
2212
|
+
case 'multiselect':
|
|
2213
|
+
this.setDataGridOption('multiselect', nv);
|
|
2214
|
+
break;
|
|
2215
|
+
case 'radioselect':
|
|
2216
|
+
this.setDataGridOption('showRadioColumn', nv);
|
|
2069
2217
|
break;
|
|
2070
2218
|
case 'multiselecttitle':
|
|
2071
2219
|
this.setDataGridOption('multiselecttitle', nv);
|
|
@@ -2100,17 +2248,22 @@
|
|
|
2100
2248
|
setDefaultPageSize(nv) {
|
|
2101
2249
|
let widgetState = this.statePersistence.getWidgetState(this);
|
|
2102
2250
|
if (this.gridOptions.allowpagesizechange) {
|
|
2103
|
-
|
|
2251
|
+
const normalizedPageSizeOptions = this.getNormalizedPageSizeOptionsArray(this.pagesizeoptions);
|
|
2252
|
+
if (this.isPageSizeOptionsChanged() && normalizedPageSizeOptions.length) { // if pagesize options are changed, then update the pagesize without checking for statepersistence
|
|
2253
|
+
nv = normalizedPageSizeOptions[0];
|
|
2254
|
+
this.pagesize = nv;
|
|
2255
|
+
}
|
|
2256
|
+
else if (lodashEs.get(widgetState, 'pagesize')) {
|
|
2104
2257
|
nv = lodashEs.get(widgetState, 'pagesize');
|
|
2105
2258
|
this.pagesize = nv; // updating the default pagesize to user selected pagesize
|
|
2106
2259
|
}
|
|
2107
|
-
else if (this.pagesizeoptions) {
|
|
2108
|
-
nv =
|
|
2260
|
+
else if (this.pagesizeoptions && normalizedPageSizeOptions.length) {
|
|
2261
|
+
nv = normalizedPageSizeOptions[0];
|
|
2109
2262
|
this.pagesize = nv;
|
|
2110
2263
|
}
|
|
2111
2264
|
this.updatedPageSize = nv;
|
|
2112
2265
|
if (this.isPageSizeOptionsChanged()) {
|
|
2113
|
-
this.dataNavigator.defaultPageSizeOptions =
|
|
2266
|
+
this.dataNavigator.defaultPageSizeOptions = normalizedPageSizeOptions;
|
|
2114
2267
|
this.dataNavigator.pageSizeOptions = [...this.dataNavigator.defaultPageSizeOptions];
|
|
2115
2268
|
}
|
|
2116
2269
|
}
|
|
@@ -2136,14 +2289,43 @@
|
|
|
2136
2289
|
this.dataNavigator.onPageSizeChange(undefined, pagesize);
|
|
2137
2290
|
}
|
|
2138
2291
|
sanitizeCommaSeparatedIntegers(input) {
|
|
2139
|
-
if (
|
|
2140
|
-
return
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2292
|
+
if (input === null || input === undefined || input === '') {
|
|
2293
|
+
return DEFAULT_PAGE_SIZE_OPTIONS;
|
|
2294
|
+
}
|
|
2295
|
+
let arr;
|
|
2296
|
+
if (Array.isArray(input)) {
|
|
2297
|
+
arr = input;
|
|
2298
|
+
}
|
|
2299
|
+
else if (typeof input === "string") {
|
|
2300
|
+
const trimmed = input.trim();
|
|
2301
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
2302
|
+
try {
|
|
2303
|
+
arr = JSON.parse(trimmed);
|
|
2304
|
+
}
|
|
2305
|
+
catch {
|
|
2306
|
+
arr = [];
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
else {
|
|
2310
|
+
arr = trimmed.split(",");
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
else {
|
|
2314
|
+
return DEFAULT_PAGE_SIZE_OPTIONS;
|
|
2315
|
+
}
|
|
2316
|
+
const uniqueNumbers = Array.from(new Set(arr
|
|
2317
|
+
.map(v => String(v).trim())
|
|
2144
2318
|
.filter(v => /^-?\d+$/.test(v))
|
|
2145
2319
|
.map(v => Math.abs(parseInt(v, 10)))));
|
|
2146
|
-
|
|
2320
|
+
const joined = uniqueNumbers.join(",");
|
|
2321
|
+
return joined || DEFAULT_PAGE_SIZE_OPTIONS;
|
|
2322
|
+
}
|
|
2323
|
+
getNormalizedPageSizeOptionsArray(input) {
|
|
2324
|
+
return this.sanitizeCommaSeparatedIntegers(input)
|
|
2325
|
+
.split(',')
|
|
2326
|
+
.map(Number)
|
|
2327
|
+
.filter(v => !lodashEs.isNaN(v))
|
|
2328
|
+
.sort((a, b) => a - b);
|
|
2147
2329
|
}
|
|
2148
2330
|
onDataSourceChange() {
|
|
2149
2331
|
this.fieldDefs.forEach(col => {
|
|
@@ -2271,6 +2453,11 @@
|
|
|
2271
2453
|
if (lodashEs.isObject(data) && !lodashEs.isArray(data)) {
|
|
2272
2454
|
data = [data];
|
|
2273
2455
|
}
|
|
2456
|
+
if (lodashEs.get(this.datasource, 'category') === 'wm.Variable' && lodashEs.isArray(data)) {
|
|
2457
|
+
for (let i = 0; i < data.length; i++) {
|
|
2458
|
+
data[i].$$wmSourceListIndex = i;
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2274
2461
|
data = this.getSearchResult(data, this.filterInfo);
|
|
2275
2462
|
data = this.getSortResult(data, this.sortInfo);
|
|
2276
2463
|
return data;
|
|
@@ -2698,7 +2885,11 @@
|
|
|
2698
2885
|
if (dataSource.execute(i2.DataSource.Operation.SUPPORTS_CRUD) || !dataSource.execute(i2.DataSource.Operation.IS_API_AWARE) || dataSource.category === 'wm.CrudVariable') {
|
|
2699
2886
|
if (!dataSource.execute(i2.DataSource.Operation.IS_API_AWARE)) {
|
|
2700
2887
|
const extraOptions = this.generatePath(this.table.binddataset);
|
|
2701
|
-
|
|
2888
|
+
const item = options.row;
|
|
2889
|
+
if (dataSource.category === 'wm.Variable' && item) {
|
|
2890
|
+
delete item['$$wmSourceListIndex'];
|
|
2891
|
+
}
|
|
2892
|
+
dataSource.execute(i2.DataSource.Operation.SET_ITEM, { prevItem: options.prevData, item, path: extraOptions.path, parentIndex: extraOptions.index });
|
|
2702
2893
|
this.updateSuccessHandler(options.row, options);
|
|
2703
2894
|
return;
|
|
2704
2895
|
}
|
|
@@ -2781,7 +2972,14 @@
|
|
|
2781
2972
|
if (dataSource.execute(i2.DataSource.Operation.SUPPORTS_CRUD) || !dataSource.execute(i2.DataSource.Operation.IS_API_AWARE) || this.table._isDependent || dataSource.category === 'wm.CrudVariable') {
|
|
2782
2973
|
if (!dataSource.execute(i2.DataSource.Operation.IS_API_AWARE)) {
|
|
2783
2974
|
const extraOptions = this.generatePath(this.table.binddataset);
|
|
2784
|
-
|
|
2975
|
+
let item = options.row;
|
|
2976
|
+
if (dataSource.category === 'wm.Variable' && options.rowindex != null) {
|
|
2977
|
+
item = options.rowindex;
|
|
2978
|
+
}
|
|
2979
|
+
else if (dataSource.category === 'wm.Variable' && item) {
|
|
2980
|
+
delete item['$$wmSourceListIndex'];
|
|
2981
|
+
}
|
|
2982
|
+
dataSource.execute(i2.DataSource.Operation.REMOVE_ITEM, { item, path: extraOptions.path, parentIndex: extraOptions.index });
|
|
2785
2983
|
this.deleteSuccessHandler(options.row, undefined, options.evt, options.callBack);
|
|
2786
2984
|
return;
|
|
2787
2985
|
}
|
|
@@ -3321,6 +3519,11 @@
|
|
|
3321
3519
|
if (lodashEs.isObject(data) && !lodashEs.isArray(data)) {
|
|
3322
3520
|
data = [data];
|
|
3323
3521
|
}
|
|
3522
|
+
if (lodashEs.get(this.table.datasource, 'category') === 'wm.Variable' && lodashEs.isArray(data)) {
|
|
3523
|
+
for (let i = 0; i < data.length; i++) {
|
|
3524
|
+
data[i].$$wmSourceListIndex = i;
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3324
3527
|
/*Both the functions return same 'data' if arguments are undefined*/
|
|
3325
3528
|
data = this.getSearchResult(data, this.table.filterInfo);
|
|
3326
3529
|
data = this.getSortResult(data, this.table.sortInfo);
|
|
@@ -4534,6 +4737,11 @@
|
|
|
4534
4737
|
case 'showinfilter':
|
|
4535
4738
|
this.showinfilter = nv;
|
|
4536
4739
|
break;
|
|
4740
|
+
case 'sortable':
|
|
4741
|
+
if (this.table) {
|
|
4742
|
+
this.table.callDataGridMethod('refreshSortHeader');
|
|
4743
|
+
}
|
|
4744
|
+
break;
|
|
4537
4745
|
default:
|
|
4538
4746
|
if (inlineWidgetProps.includes(key)) {
|
|
4539
4747
|
this.setInlineWidgetProp('inlineInstance', key, nv);
|