@easydata/crud 1.4.3-beta01 → 1.4.5-rc01

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);
@@ -2817,6 +2818,12 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
2817
2818
  this.onUpdate(this);
2818
2819
  }
2819
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
+ };
2820
2827
  return EasyDataTable;
2821
2828
  }());
2822
2829
 
@@ -8021,6 +8028,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8021
8028
  this.context = context;
8022
8029
  this.basePath = basePath;
8023
8030
  this.options = {
8031
+ showFilterBox: true,
8024
8032
  showBackToEntities: true
8025
8033
  };
8026
8034
  this.defaultValidators = [new required_validator_RequiredValidator(), new type_validator_TypeValidator()];
@@ -8074,16 +8082,18 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8074
8082
  onRowDbClick: _this.rowDbClickHandler.bind(_this),
8075
8083
  onSyncGridColumn: _this.syncGridColumnHandler.bind(_this)
8076
8084
  }, _this.options.grid || {}));
8077
- var widgetSlot;
8078
- var filterBar = domel('div')
8079
- .addClass("kfrm-form")
8080
- .setStyle('margin', '10px 0px')
8081
- .addChild('div', function (b) {
8082
- return widgetSlot = b.toDOM();
8083
- }).toDOM();
8084
- _this.slot.insertBefore(filterBar, gridSlot);
8085
- var dataFilter = _this.context.createFilter();
8086
- new text_filter_widget_TextFilterWidget(widgetSlot, _this.grid, dataFilter);
8085
+ if (_this.options.showFilterBox) {
8086
+ var filterWidgetSlot_1;
8087
+ var filterBarDiv = domel('div')
8088
+ .addClass("kfrm-form")
8089
+ .setStyle('margin', '10px 0px')
8090
+ .addChild('div', function (b) {
8091
+ return filterWidgetSlot_1 = b.toDOM();
8092
+ }).toDOM();
8093
+ _this.slot.insertBefore(filterBarDiv, gridSlot);
8094
+ var dataFilter = _this.context.createFilter();
8095
+ new text_filter_widget_TextFilterWidget(filterWidgetSlot_1, _this.grid, dataFilter);
8096
+ }
8087
8097
  });
8088
8098
  };
8089
8099
  EntityDataView.prototype.manageCellRenderer = function (column, defaultRenderer) {
@@ -8136,7 +8146,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8136
8146
  };
8137
8147
  EntityDataView.prototype.editClickHandler = function (ev, rowIndex) {
8138
8148
  var _this = this;
8139
- this.context.getData().getRow(rowIndex)
8149
+ this.grid.getData().getRow(rowIndex)
8140
8150
  .then(function (row) {
8141
8151
  if (row) {
8142
8152
  _this.showEditForm(row);
@@ -8175,7 +8185,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8175
8185
  };
8176
8186
  EntityDataView.prototype.deleteClickHandler = function (ev, rowIndex) {
8177
8187
  var _this = this;
8178
- this.context.getData().getRow(rowIndex)
8188
+ this.grid.getData().getRow(rowIndex)
8179
8189
  .then(function (row) {
8180
8190
  if (row) {
8181
8191
  var activeEntity = _this.context.getActiveEntity();
@@ -8192,6 +8202,8 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
8192
8202
  .map(function (key) { return key + ":" + keys_1[key]; }).join(';')))
8193
8203
  .then(function (result) {
8194
8204
  if (result) {
8205
+ _this.grid.getData().deleteCachedRow(rowIndex);
8206
+ _this.grid.refresh();
8195
8207
  _this.context.deleteRecord(keys_1)
8196
8208
  .then(function () {
8197
8209
  return _this.refreshData();