@epam/uui-db 4.5.3 → 4.6.0

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.
package/index.js CHANGED
@@ -407,7 +407,8 @@ var Db = /** @class */ (function () {
407
407
  }
408
408
  }
409
409
  Db.prototype.update = function (mutate) {
410
- var clone = new this.constructor((0, tslib_1.__assign)({}, this.tables), this.viewCache);
410
+ var clone = new this.constructor(this.tables, this.viewCache);
411
+ clone.tables = (0, tslib_1.__assign)({}, this.tables);
411
412
  mutate(clone);
412
413
  return clone;
413
414
  };
@@ -530,6 +531,12 @@ var DbRef = /** @class */ (function () {
530
531
  this.update();
531
532
  }
532
533
  };
534
+ DbRef.prototype.revert = function () {
535
+ this.db = this.base;
536
+ this.errors = [];
537
+ this.log = this.log.slice(0, this.savedPoint);
538
+ this.update();
539
+ };
533
540
  /** Concrete DbRef instances should override and implement their save logic in this method */
534
541
  DbRef.prototype.savePatch = function (patch) {
535
542
  return Promise.resolve({ submit: {} });
@@ -714,7 +721,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
714
721
  exports.DbTable = void 0;
715
722
  var tslib_1 = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.js");
716
723
  var I = (0, tslib_1.__importStar)(__webpack_require__(/*! immutable */ "immutable"));
717
- var uui_1 = __webpack_require__(/*! @epam/uui */ "@epam/uui");
724
+ var uui_core_1 = __webpack_require__(/*! @epam/uui-core */ "@epam/uui-core");
718
725
  var immutable_1 = __webpack_require__(/*! immutable */ "immutable");
719
726
  var DbTable = /** @class */ (function () {
720
727
  function DbTable(schema, state, q) {
@@ -893,15 +900,15 @@ var DbTable = /** @class */ (function () {
893
900
  result = this.state.pk.toArray();
894
901
  }
895
902
  if (filter) {
896
- var predicate = (0, uui_1.getPatternPredicate)(q.filter);
903
+ var predicate = (0, uui_core_1.getPatternPredicate)(q.filter);
897
904
  result = result.filter(predicate);
898
905
  }
899
906
  if (q.search) {
900
- var searchFilter_1 = (0, uui_1.getSearchFilter)(q.search);
907
+ var searchFilter_1 = (0, uui_core_1.getSearchFilter)(q.search);
901
908
  result = result.filter(function (item) { return searchFilter_1(_this.schema.searchBy.map(function (field) { return item[field]; })); });
902
909
  }
903
910
  if (q.sorting) {
904
- var comparer = (0, uui_1.getOrderComparer)(q.sorting);
911
+ var comparer = (0, uui_core_1.getOrderComparer)(q.sorting);
905
912
  result = result.sort(comparer);
906
913
  }
907
914
  if (q.range) {
@@ -978,7 +985,7 @@ var ListLoadingTracker = /** @class */ (function () {
978
985
  }
979
986
  };
980
987
  ListLoadingTracker.prototype.count = function (request) {
981
- var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;
988
+ var entry = this.prepare(request).entry;
982
989
  return { knownCount: Math.max(entry.count, entry.maxCount), exactCount: entry.maxCount };
983
990
  };
984
991
  ListLoadingTracker.prototype.append = function (request, response) {
@@ -1684,14 +1691,14 @@ module.exports = __webpack_require__(/*! /Users/Aliaksei_Manetau/WebstormProject
1684
1691
 
1685
1692
  /***/ }),
1686
1693
 
1687
- /***/ "@epam/uui":
1688
- /*!****************************!*\
1689
- !*** external "@epam/uui" ***!
1690
- \****************************/
1694
+ /***/ "@epam/uui-core":
1695
+ /*!*********************************!*\
1696
+ !*** external "@epam/uui-core" ***!
1697
+ \*********************************/
1691
1698
  /*! no static exports found */
1692
1699
  /***/ (function(module, exports) {
1693
1700
 
1694
- module.exports = require("@epam/uui");
1701
+ module.exports = require("@epam/uui-core");
1695
1702
 
1696
1703
  /***/ }),
1697
1704