@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.
@@ -286,7 +286,8 @@ var meta_entity_MetaEntityAttr = /** @class */ (function () {
286
286
  this.lookupEntity = dto.lent;
287
287
  this.dataAttr = dto.dattr;
288
288
  this.lookupDataAttr = dto.ldattr;
289
- this.defaultValue = dto.defVal;
289
+ var isDataType = utils["a" /* utils */].getDateDataTypes().indexOf(this.dataType);
290
+ this.defaultValue = dto.defVal && isDataType ? new Date(dto.defVal) : dto.defVal;
290
291
  this.isNullable = utils["a" /* utils */].getIfDefined(dto.nul, this.isNullable);
291
292
  this.isEditable = utils["a" /* utils */].getIfDefined(dto.ied, this.isEditable);
292
293
  this.showOnView = utils["a" /* utils */].getIfDefined(dto.ivis || dto.sov, this.showOnView);
@@ -7542,6 +7543,12 @@ var EasyDataTable = /** @class */ (function () {
7542
7543
  this.onUpdate(this);
7543
7544
  }
7544
7545
  };
7546
+ EasyDataTable.prototype.deleteCachedRow = function (rowIndex, count) {
7547
+ if (count === void 0) { count = 1; }
7548
+ if (rowIndex < 0 || rowIndex >= this.cachedRows.length)
7549
+ return;
7550
+ this.cachedRows.splice(rowIndex, count);
7551
+ };
7545
7552
  return EasyDataTable;
7546
7553
  }());
7547
7554
 
@@ -12452,6 +12459,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
12452
12459
  this.context = context;
12453
12460
  this.basePath = basePath;
12454
12461
  this.options = {
12462
+ showFilterBox: true,
12455
12463
  showBackToEntities: true
12456
12464
  };
12457
12465
  this.defaultValidators = [new required_validator_RequiredValidator(), new type_validator_TypeValidator()];
@@ -12505,16 +12513,18 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
12505
12513
  onRowDbClick: _this.rowDbClickHandler.bind(_this),
12506
12514
  onSyncGridColumn: _this.syncGridColumnHandler.bind(_this)
12507
12515
  }, _this.options.grid || {}));
12508
- var widgetSlot;
12509
- var filterBar = Object(lib_public_api["domel"])('div')
12510
- .addClass("kfrm-form")
12511
- .setStyle('margin', '10px 0px')
12512
- .addChild('div', function (b) {
12513
- return widgetSlot = b.toDOM();
12514
- }).toDOM();
12515
- _this.slot.insertBefore(filterBar, gridSlot);
12516
- var dataFilter = _this.context.createFilter();
12517
- new text_filter_widget_TextFilterWidget(widgetSlot, _this.grid, dataFilter);
12516
+ if (_this.options.showFilterBox) {
12517
+ var filterWidgetSlot_1;
12518
+ var filterBarDiv = Object(lib_public_api["domel"])('div')
12519
+ .addClass("kfrm-form")
12520
+ .setStyle('margin', '10px 0px')
12521
+ .addChild('div', function (b) {
12522
+ return filterWidgetSlot_1 = b.toDOM();
12523
+ }).toDOM();
12524
+ _this.slot.insertBefore(filterBarDiv, gridSlot);
12525
+ var dataFilter = _this.context.createFilter();
12526
+ new text_filter_widget_TextFilterWidget(filterWidgetSlot_1, _this.grid, dataFilter);
12527
+ }
12518
12528
  });
12519
12529
  };
12520
12530
  EntityDataView.prototype.manageCellRenderer = function (column, defaultRenderer) {
@@ -12567,7 +12577,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
12567
12577
  };
12568
12578
  EntityDataView.prototype.editClickHandler = function (ev, rowIndex) {
12569
12579
  var _this = this;
12570
- this.context.getData().getRow(rowIndex)
12580
+ this.grid.getData().getRow(rowIndex)
12571
12581
  .then(function (row) {
12572
12582
  if (row) {
12573
12583
  _this.showEditForm(row);
@@ -12606,7 +12616,7 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
12606
12616
  };
12607
12617
  EntityDataView.prototype.deleteClickHandler = function (ev, rowIndex) {
12608
12618
  var _this = this;
12609
- this.context.getData().getRow(rowIndex)
12619
+ this.grid.getData().getRow(rowIndex)
12610
12620
  .then(function (row) {
12611
12621
  if (row) {
12612
12622
  var activeEntity = _this.context.getActiveEntity();
@@ -12623,6 +12633,8 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
12623
12633
  .map(function (key) { return key + ":" + keys_1[key]; }).join(';')))
12624
12634
  .then(function (result) {
12625
12635
  if (result) {
12636
+ _this.grid.getData().deleteCachedRow(rowIndex);
12637
+ _this.grid.refresh();
12626
12638
  _this.context.deleteRecord(keys_1)
12627
12639
  .then(function () {
12628
12640
  return _this.refreshData();