@easydata/crud 1.4.3 → 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.
@@ -1653,7 +1653,8 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
1653
1653
  this.lookupEntity = dto.lent;
1654
1654
  this.dataAttr = dto.dattr;
1655
1655
  this.lookupDataAttr = dto.ldattr;
1656
- this.defaultValue = dto.defVal;
1656
+ var isDataType = utils_utils.getDateDataTypes().indexOf(this.dataType);
1657
+ this.defaultValue = dto.defVal && isDataType ? new Date(dto.defVal) : dto.defVal;
1657
1658
  this.isNullable = utils_utils.getIfDefined(dto.nul, this.isNullable);
1658
1659
  this.isEditable = utils_utils.getIfDefined(dto.ied, this.isEditable);
1659
1660
  this.showOnView = utils_utils.getIfDefined(dto.ivis || dto.sov, this.showOnView);
@@ -7120,7 +7121,7 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7120
7121
  };
7121
7122
  TextFilterWidget.prototype.inputKeydownHandler = function (ev) {
7122
7123
  if (ev.keyCode == 13) {
7123
- this.applyFilter();
7124
+ this.applyFilter(true);
7124
7125
  }
7125
7126
  };
7126
7127
  TextFilterWidget.prototype.inputKeyupHandler = function () {
@@ -7129,29 +7130,31 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7129
7130
  clearTimeout(this.applyFilterTimeout);
7130
7131
  }
7131
7132
  this.applyFilterTimeout = setTimeout(function () {
7132
- _this.applyFilter();
7133
+ _this.applyFilter(true);
7133
7134
  }, this.options.instantTimeout);
7134
7135
  };
7135
7136
  TextFilterWidget.prototype.clearButtonClickHander = function () {
7136
7137
  this.filterInput.value = '';
7137
7138
  this.filterInput.focus();
7138
- this.applyFilter();
7139
+ this.applyFilter(true);
7139
7140
  };
7140
7141
  TextFilterWidget.prototype.searchButtonClickHandler = function () {
7141
- this.applyFilter();
7142
+ this.applyFilter(true);
7142
7143
  };
7143
- TextFilterWidget.prototype.applyFilter = function () {
7144
+ TextFilterWidget.prototype.applyFilter = function (checkChange) {
7144
7145
  var _this = this;
7145
7146
  if (this.applyFilterTimeout) {
7146
7147
  clearTimeout(this.applyFilterTimeout);
7147
7148
  }
7148
7149
  var filterValue = this.filter.getValue();
7149
- if (filterValue != this.filterInput.value) {
7150
+ if (!checkChange || filterValue != this.filterInput.value) {
7150
7151
  this.filter.apply(this.filterInput.value)
7151
7152
  .then(function (data) {
7152
7153
  _this.grid.setData(data);
7153
7154
  });
7155
+ return true;
7154
7156
  }
7157
+ return false;
7155
7158
  };
7156
7159
  TextFilterWidget.prototype.highlightCellRenderer = function (defaultRenderer, value, column, cellElement, rowElement) {
7157
7160
  if (utils_utils.isNumericType(column.type)
@@ -8085,7 +8088,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8085
8088
  }).toDOM();
8086
8089
  _this.slot.insertBefore(filterBarDiv, gridSlot);
8087
8090
  var dataFilter = _this.context.createFilter();
8088
- new text_filter_widget_TextFilterWidget(filterWidgetSlot_1, _this.grid, dataFilter);
8091
+ _this.filterWidget = new text_filter_widget_TextFilterWidget(filterWidgetSlot_1, _this.grid, dataFilter);
8089
8092
  }
8090
8093
  });
8091
8094
  };
@@ -8139,7 +8142,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8139
8142
  };
8140
8143
  EntityDataView.prototype.editClickHandler = function (ev, rowIndex) {
8141
8144
  var _this = this;
8142
- this.context.getData().getRow(rowIndex)
8145
+ this.grid.getData().getRow(rowIndex)
8143
8146
  .then(function (row) {
8144
8147
  if (row) {
8145
8148
  _this.showEditForm(row);
@@ -8178,7 +8181,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8178
8181
  };
8179
8182
  EntityDataView.prototype.deleteClickHandler = function (ev, rowIndex) {
8180
8183
  var _this = this;
8181
- this.context.getData().getRow(rowIndex)
8184
+ this.grid.getData().getRow(rowIndex)
8182
8185
  .then(function (row) {
8183
8186
  if (row) {
8184
8187
  var activeEntity = _this.context.getActiveEntity();
@@ -8219,7 +8222,13 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8219
8222
  var _this = this;
8220
8223
  return this.context.fetchDataset()
8221
8224
  .then(function () {
8222
- _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
+ }
8223
8232
  });
8224
8233
  };
8225
8234
  return EntityDataView;