@easydata/crud 1.4.5-rc01 → 1.4.5-rc02

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.
@@ -2818,12 +2818,6 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
2818
2818
  this.onUpdate(this);
2819
2819
  }
2820
2820
  };
2821
- EasyDataTable.prototype.deleteCachedRow = function (rowIndex, count) {
2822
- if (count === void 0) { count = 1; }
2823
- if (rowIndex < 0 || rowIndex >= this.cachedRows.length)
2824
- return;
2825
- this.cachedRows.splice(rowIndex, count);
2826
- };
2827
2821
  return EasyDataTable;
2828
2822
  }());
2829
2823
 
@@ -7127,7 +7121,7 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7127
7121
  };
7128
7122
  TextFilterWidget.prototype.inputKeydownHandler = function (ev) {
7129
7123
  if (ev.keyCode == 13) {
7130
- this.applyFilter();
7124
+ this.applyFilter(true);
7131
7125
  }
7132
7126
  };
7133
7127
  TextFilterWidget.prototype.inputKeyupHandler = function () {
@@ -7136,29 +7130,31 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7136
7130
  clearTimeout(this.applyFilterTimeout);
7137
7131
  }
7138
7132
  this.applyFilterTimeout = setTimeout(function () {
7139
- _this.applyFilter();
7133
+ _this.applyFilter(true);
7140
7134
  }, this.options.instantTimeout);
7141
7135
  };
7142
7136
  TextFilterWidget.prototype.clearButtonClickHander = function () {
7143
7137
  this.filterInput.value = '';
7144
7138
  this.filterInput.focus();
7145
- this.applyFilter();
7139
+ this.applyFilter(true);
7146
7140
  };
7147
7141
  TextFilterWidget.prototype.searchButtonClickHandler = function () {
7148
- this.applyFilter();
7142
+ this.applyFilter(true);
7149
7143
  };
7150
- TextFilterWidget.prototype.applyFilter = function () {
7144
+ TextFilterWidget.prototype.applyFilter = function (checkChange) {
7151
7145
  var _this = this;
7152
7146
  if (this.applyFilterTimeout) {
7153
7147
  clearTimeout(this.applyFilterTimeout);
7154
7148
  }
7155
7149
  var filterValue = this.filter.getValue();
7156
- if (filterValue != this.filterInput.value) {
7150
+ if (!checkChange || filterValue != this.filterInput.value) {
7157
7151
  this.filter.apply(this.filterInput.value)
7158
7152
  .then(function (data) {
7159
7153
  _this.grid.setData(data);
7160
7154
  });
7155
+ return true;
7161
7156
  }
7157
+ return false;
7162
7158
  };
7163
7159
  TextFilterWidget.prototype.highlightCellRenderer = function (defaultRenderer, value, column, cellElement, rowElement) {
7164
7160
  if (utils_utils.isNumericType(column.type)
@@ -8092,7 +8088,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8092
8088
  }).toDOM();
8093
8089
  _this.slot.insertBefore(filterBarDiv, gridSlot);
8094
8090
  var dataFilter = _this.context.createFilter();
8095
- new text_filter_widget_TextFilterWidget(filterWidgetSlot_1, _this.grid, dataFilter);
8091
+ _this.filterWidget = new text_filter_widget_TextFilterWidget(filterWidgetSlot_1, _this.grid, dataFilter);
8096
8092
  }
8097
8093
  });
8098
8094
  };
@@ -8202,8 +8198,6 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8202
8198
  .map(function (key) { return key + ":" + keys_1[key]; }).join(';')))
8203
8199
  .then(function (result) {
8204
8200
  if (result) {
8205
- _this.grid.getData().deleteCachedRow(rowIndex);
8206
- _this.grid.refresh();
8207
8201
  _this.context.deleteRecord(keys_1)
8208
8202
  .then(function () {
8209
8203
  return _this.refreshData();
@@ -8228,7 +8222,13 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8228
8222
  var _this = this;
8229
8223
  return this.context.fetchDataset()
8230
8224
  .then(function () {
8231
- _this.grid.refresh();
8225
+ var processed = false;
8226
+ if (_this.filterWidget) {
8227
+ processed = _this.filterWidget.applyFilter(false);
8228
+ }
8229
+ if (!processed) {
8230
+ _this.grid.refresh();
8231
+ }
8232
8232
  });
8233
8233
  };
8234
8234
  return EntityDataView;