inviton-powerduck 0.0.79 → 0.0.81
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.
|
@@ -336,6 +336,10 @@ export class DataTableFilterItemCollection extends Array<DataTableFilterItem> {
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
+
export class DataTableConfig {
|
|
340
|
+
static filterMarking = true;
|
|
341
|
+
}
|
|
342
|
+
|
|
339
343
|
@Component
|
|
340
344
|
class TableButtonComponent extends TsxComponent<TableButton> implements TableButton {
|
|
341
345
|
@Prop() title!: string;
|
|
@@ -453,9 +457,12 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
453
457
|
this.currentMobileBehavior = this.mobileBehavior;
|
|
454
458
|
this.performColumnRefresh();
|
|
455
459
|
this.handleWindowResized();
|
|
456
|
-
this.markInstance = new Mark(this.$el);
|
|
457
460
|
window.addEventListener("resize", this.handleWindowResized, true);
|
|
458
461
|
|
|
462
|
+
if (DataTableConfig.filterMarking) {
|
|
463
|
+
this.markInstance = new Mark(this.$el);
|
|
464
|
+
}
|
|
465
|
+
|
|
459
466
|
if (this.handleInitialFilter) {
|
|
460
467
|
this.parseInitialFilter();
|
|
461
468
|
}
|
|
@@ -847,6 +854,24 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
847
854
|
return selectedRows;
|
|
848
855
|
}
|
|
849
856
|
|
|
857
|
+
unmarkSelection(cb: () => void): void {
|
|
858
|
+
if (DataTableConfig.filterMarking) {
|
|
859
|
+
this.markInstance.unmark({
|
|
860
|
+
done: () => {
|
|
861
|
+
this.enforceBodyRedraw = true;
|
|
862
|
+
this.$nextTick(() => {
|
|
863
|
+
this.enforceBodyRedraw = false;
|
|
864
|
+
this.$nextTick(() => {
|
|
865
|
+
cb();
|
|
866
|
+
});
|
|
867
|
+
});
|
|
868
|
+
},
|
|
869
|
+
});
|
|
870
|
+
} else {
|
|
871
|
+
cb();
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
850
875
|
markSelection(): void {
|
|
851
876
|
var mySelf = this;
|
|
852
877
|
var escapeRegExp = function (string) {
|
|
@@ -881,11 +906,11 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
881
906
|
regexBuilder += escapeRegExp(this.fullTextQuery);
|
|
882
907
|
}
|
|
883
908
|
|
|
884
|
-
|
|
885
|
-
|
|
909
|
+
if (DataTableConfig.filterMarking) {
|
|
910
|
+
this.unmarkSelection(() => {
|
|
886
911
|
mySelf.markInstance.markRegExp(new RegExp("(" + regexBuilder + ")", "i"));
|
|
887
|
-
}
|
|
888
|
-
}
|
|
912
|
+
});
|
|
913
|
+
}
|
|
889
914
|
}
|
|
890
915
|
|
|
891
916
|
addFilterItem(dtColumn: TableColumn, newFilter: DataTablePostBackFilterItem): void {
|
|
@@ -917,11 +942,13 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
917
942
|
|
|
918
943
|
handleClientsideFilter(markResults?: boolean): boolean {
|
|
919
944
|
if (this.filterMode == DataTableFilterMode.Clientside) {
|
|
920
|
-
this.
|
|
945
|
+
this.unmarkSelection(() => {
|
|
946
|
+
this.performClientsideFilter();
|
|
921
947
|
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
948
|
+
if (markResults) {
|
|
949
|
+
this.markSelection();
|
|
950
|
+
}
|
|
951
|
+
});
|
|
925
952
|
|
|
926
953
|
return true;
|
|
927
954
|
}
|
|
@@ -1316,34 +1343,33 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1316
1343
|
loadPromise = mySelf.customAjaxCall(mySelf.getAjaxArgs(paginationPosition, paginationLength));
|
|
1317
1344
|
}
|
|
1318
1345
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
});
|
|
1344
|
-
},
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
loadPromise.then((data: any) => {
|
|
1349
|
+
mySelf.unmarkSelection(() => {
|
|
1350
|
+
mySelf.enforceBodyRedraw = true;
|
|
1351
|
+
mySelf.$nextTick(() => {
|
|
1352
|
+
mySelf.enforceBodyRedraw = false;
|
|
1353
|
+
mySelf.isLoading = false;
|
|
1354
|
+
|
|
1355
|
+
if (mySelf.parseLoadedRowset != null) {
|
|
1356
|
+
let rowset = mySelf.parseLoadedRowset(data);
|
|
1357
|
+
mySelf.totalCount = rowset.TotalCount;
|
|
1358
|
+
mySelf.totalFilteredCount = rowset.TotalFilteredCount;
|
|
1359
|
+
mySelf.rows = rowset.Rows;
|
|
1360
|
+
} else {
|
|
1361
|
+
mySelf.totalCount = data.TotalCount;
|
|
1362
|
+
mySelf.totalFilteredCount = data.TotalFilteredCount;
|
|
1363
|
+
mySelf.rows = data.Rows;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
mySelf.loadedRows = mySelf.rows;
|
|
1367
|
+
mySelf.$forceUpdate();
|
|
1368
|
+
mySelf.$nextTick(() => mySelf.markSelection());
|
|
1369
|
+
resolve(data);
|
|
1345
1370
|
});
|
|
1346
|
-
})
|
|
1371
|
+
});
|
|
1372
|
+
})
|
|
1347
1373
|
.catch((err) => {
|
|
1348
1374
|
mySelf.isLoading = false;
|
|
1349
1375
|
NotificationProvider.showErrorMessage(PowerduckState.getResourceValue('errorFetchingData'));
|