inviton-powerduck 0.0.80 → 0.0.82
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.
|
@@ -337,7 +337,7 @@ export class DataTableFilterItemCollection extends Array<DataTableFilterItem> {
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
export class DataTableConfig {
|
|
340
|
-
static filterMarking =
|
|
340
|
+
static filterMarking = true;
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
@Component
|
|
@@ -854,6 +854,24 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
854
854
|
return selectedRows;
|
|
855
855
|
}
|
|
856
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
|
+
|
|
857
875
|
markSelection(): void {
|
|
858
876
|
var mySelf = this;
|
|
859
877
|
var escapeRegExp = function (string) {
|
|
@@ -872,6 +890,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
872
890
|
};
|
|
873
891
|
|
|
874
892
|
var regexBuilder = "";
|
|
893
|
+
var markArr: string[] = [];
|
|
875
894
|
if (this.filterArr != null) {
|
|
876
895
|
this.filterArr.forEach((filterItem) => {
|
|
877
896
|
if (regexBuilder.length > 0) {
|
|
@@ -879,7 +898,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
879
898
|
}
|
|
880
899
|
|
|
881
900
|
(getValueArr(filterItem) || []).forEach((filterValue) => {
|
|
882
|
-
|
|
901
|
+
markArr.push(escapeRegExp(filterValue));
|
|
883
902
|
});
|
|
884
903
|
});
|
|
885
904
|
}
|
|
@@ -889,10 +908,8 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
889
908
|
}
|
|
890
909
|
|
|
891
910
|
if (DataTableConfig.filterMarking) {
|
|
892
|
-
this.
|
|
893
|
-
|
|
894
|
-
mySelf.markInstance.markRegExp(new RegExp("(" + regexBuilder + ")", "i"));
|
|
895
|
-
},
|
|
911
|
+
this.unmarkSelection(() => {
|
|
912
|
+
mySelf.markInstance.mark(markArr);
|
|
896
913
|
});
|
|
897
914
|
}
|
|
898
915
|
}
|
|
@@ -926,11 +943,13 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
926
943
|
|
|
927
944
|
handleClientsideFilter(markResults?: boolean): boolean {
|
|
928
945
|
if (this.filterMode == DataTableFilterMode.Clientside) {
|
|
929
|
-
this.
|
|
946
|
+
this.unmarkSelection(() => {
|
|
947
|
+
this.performClientsideFilter();
|
|
930
948
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
949
|
+
if (markResults) {
|
|
950
|
+
this.markSelection();
|
|
951
|
+
}
|
|
952
|
+
});
|
|
934
953
|
|
|
935
954
|
return true;
|
|
936
955
|
}
|
|
@@ -1325,44 +1344,33 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1325
1344
|
loadPromise = mySelf.customAjaxCall(mySelf.getAjaxArgs(paginationPosition, paginationLength));
|
|
1326
1345
|
}
|
|
1327
1346
|
|
|
1328
|
-
const unmark = (cb: () => void) => {
|
|
1329
|
-
if (DataTableConfig.filterMarking) {
|
|
1330
|
-
mySelf.markInstance.unmark({
|
|
1331
|
-
done: function () {
|
|
1332
|
-
cb();
|
|
1333
|
-
},
|
|
1334
|
-
});
|
|
1335
|
-
} else {
|
|
1336
|
-
cb();
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
1347
|
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
});
|
|
1348
|
+
|
|
1349
|
+
loadPromise.then((data: any) => {
|
|
1350
|
+
mySelf.unmarkSelection(() => {
|
|
1351
|
+
mySelf.enforceBodyRedraw = true;
|
|
1352
|
+
mySelf.$nextTick(() => {
|
|
1353
|
+
mySelf.enforceBodyRedraw = false;
|
|
1354
|
+
mySelf.isLoading = false;
|
|
1355
|
+
|
|
1356
|
+
if (mySelf.parseLoadedRowset != null) {
|
|
1357
|
+
let rowset = mySelf.parseLoadedRowset(data);
|
|
1358
|
+
mySelf.totalCount = rowset.TotalCount;
|
|
1359
|
+
mySelf.totalFilteredCount = rowset.TotalFilteredCount;
|
|
1360
|
+
mySelf.rows = rowset.Rows;
|
|
1361
|
+
} else {
|
|
1362
|
+
mySelf.totalCount = data.TotalCount;
|
|
1363
|
+
mySelf.totalFilteredCount = data.TotalFilteredCount;
|
|
1364
|
+
mySelf.rows = data.Rows;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
mySelf.loadedRows = mySelf.rows;
|
|
1368
|
+
mySelf.$forceUpdate();
|
|
1369
|
+
mySelf.$nextTick(() => mySelf.markSelection());
|
|
1370
|
+
resolve(data);
|
|
1364
1371
|
});
|
|
1365
|
-
})
|
|
1372
|
+
});
|
|
1373
|
+
})
|
|
1366
1374
|
.catch((err) => {
|
|
1367
1375
|
mySelf.isLoading = false;
|
|
1368
1376
|
NotificationProvider.showErrorMessage(PowerduckState.getResourceValue('errorFetchingData'));
|