inviton-powerduck 0.0.79 → 0.0.80

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 = false;
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
  }
@@ -881,11 +888,13 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
881
888
  regexBuilder += escapeRegExp(this.fullTextQuery);
882
889
  }
883
890
 
884
- this.markInstance.unmark({
885
- done: function () {
886
- mySelf.markInstance.markRegExp(new RegExp("(" + regexBuilder + ")", "i"));
887
- },
888
- });
891
+ if (DataTableConfig.filterMarking) {
892
+ this.markInstance.unmark({
893
+ done: function () {
894
+ mySelf.markInstance.markRegExp(new RegExp("(" + regexBuilder + ")", "i"));
895
+ },
896
+ });
897
+ }
889
898
  }
890
899
 
891
900
  addFilterItem(dtColumn: TableColumn, newFilter: DataTablePostBackFilterItem): void {
@@ -1316,33 +1325,43 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
1316
1325
  loadPromise = mySelf.customAjaxCall(mySelf.getAjaxArgs(paginationPosition, paginationLength));
1317
1326
  }
1318
1327
 
1319
- loadPromise
1320
- .then((data: any) => {
1328
+ const unmark = (cb: () => void) => {
1329
+ if (DataTableConfig.filterMarking) {
1321
1330
  mySelf.markInstance.unmark({
1322
1331
  done: function () {
1323
- mySelf.enforceBodyRedraw = true;
1324
- mySelf.$nextTick(() => {
1325
- mySelf.enforceBodyRedraw = false;
1326
- mySelf.isLoading = false;
1327
-
1328
- if (mySelf.parseLoadedRowset != null) {
1329
- let rowset = mySelf.parseLoadedRowset(data);
1330
- mySelf.totalCount = rowset.TotalCount;
1331
- mySelf.totalFilteredCount = rowset.TotalFilteredCount;
1332
- mySelf.rows = rowset.Rows;
1333
- } else {
1334
- mySelf.totalCount = data.TotalCount;
1335
- mySelf.totalFilteredCount = data.TotalFilteredCount;
1336
- mySelf.rows = data.Rows;
1337
- }
1338
-
1339
- mySelf.loadedRows = mySelf.rows;
1340
- mySelf.$forceUpdate();
1341
- mySelf.$nextTick(() => mySelf.markSelection());
1342
- resolve(data);
1343
- });
1332
+ cb();
1344
1333
  },
1345
1334
  });
1335
+ } else {
1336
+ cb();
1337
+ }
1338
+ }
1339
+
1340
+ loadPromise
1341
+ .then((data: any) => {
1342
+ unmark(() => {
1343
+ mySelf.enforceBodyRedraw = true;
1344
+ mySelf.$nextTick(() => {
1345
+ mySelf.enforceBodyRedraw = false;
1346
+ mySelf.isLoading = false;
1347
+
1348
+ if (mySelf.parseLoadedRowset != null) {
1349
+ let rowset = mySelf.parseLoadedRowset(data);
1350
+ mySelf.totalCount = rowset.TotalCount;
1351
+ mySelf.totalFilteredCount = rowset.TotalFilteredCount;
1352
+ mySelf.rows = rowset.Rows;
1353
+ } else {
1354
+ mySelf.totalCount = data.TotalCount;
1355
+ mySelf.totalFilteredCount = data.TotalFilteredCount;
1356
+ mySelf.rows = data.Rows;
1357
+ }
1358
+
1359
+ mySelf.loadedRows = mySelf.rows;
1360
+ mySelf.$forceUpdate();
1361
+ mySelf.$nextTick(() => mySelf.markSelection());
1362
+ resolve(data);
1363
+ });
1364
+ });
1346
1365
  })
1347
1366
  .catch((err) => {
1348
1367
  mySelf.isLoading = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
- "version": "0.0.79",
3
+ "version": "0.0.80",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": " vite build && vue-tsc --declaration --emitDeclarationOnly",