ywana-core8 0.0.562 → 0.0.565

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/dist/index.cjs CHANGED
@@ -4808,7 +4808,8 @@ var CollectionEditor$1 = function CollectionEditor(_ref10) {
4808
4808
  field: field,
4809
4809
  value: value,
4810
4810
  onRemove: remove,
4811
- onChange: onChange
4811
+ onChange: onChange,
4812
+ onReload: reload
4812
4813
  }) // : <DataTable {...table} editable={editable} />
4813
4814
  : /*#__PURE__*/React__default["default"].createElement(TableEditor$2, {
4814
4815
  icon: "info",
@@ -5264,6 +5265,16 @@ function _catch$2(body, recover) {
5264
5265
 
5265
5266
 
5266
5267
  var CollectionPage = function CollectionPage(props) {
5268
+ var reloadSelection = function reloadSelection() {
5269
+ try {
5270
+ return Promise.resolve(pageContext.reloadSelection()).then(function () {
5271
+ setPageContext(Object.assign({}, pageContext));
5272
+ });
5273
+ } catch (e) {
5274
+ return Promise.reject(e);
5275
+ }
5276
+ };
5277
+
5267
5278
  var reload = function reload() {
5268
5279
  try {
5269
5280
  return Promise.resolve(pageContext.load()).then(function () {
@@ -5395,7 +5406,7 @@ var CollectionPage = function CollectionPage(props) {
5395
5406
  delay: delay,
5396
5407
  canDelete: canDelete,
5397
5408
  canEdit: canEdit,
5398
- onReload: reload
5409
+ onReload: reloadSelection
5399
5410
  }), children ? /*#__PURE__*/React__default["default"].createElement("article", null, children) : null));
5400
5411
  };
5401
5412
  var CollectionFilters = function CollectionFilters(props) {
@@ -5826,6 +5837,17 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5826
5837
  return Promise.reject(e);
5827
5838
  }
5828
5839
  },
5840
+ reloadSelection: function reloadSelection() {
5841
+ try {
5842
+ var _this6 = this;
5843
+
5844
+ return Promise.resolve(_this6.fetch(_this6.selected.id)).then(function (result) {
5845
+ _this6.selected = result;
5846
+ });
5847
+ } catch (e) {
5848
+ return Promise.reject(e);
5849
+ }
5850
+ },
5829
5851
  fetch: function fetch(id) {
5830
5852
  try {
5831
5853
  return Promise.resolve(_catch$2(function () {
@@ -5842,11 +5864,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5842
5864
  },
5843
5865
  create: function create(form) {
5844
5866
  try {
5845
- var _this6 = this;
5867
+ var _this8 = this;
5846
5868
 
5847
5869
  var _temp6 = _catch$2(function () {
5848
5870
  return Promise.resolve(API.create(form)).then(function () {
5849
- return Promise.resolve(_this6.load()).then(function () {});
5871
+ return Promise.resolve(_this8.load()).then(function () {});
5850
5872
  });
5851
5873
  }, function (error) {
5852
5874
  console.log(error);
@@ -5859,11 +5881,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5859
5881
  },
5860
5882
  update: function update(form) {
5861
5883
  try {
5862
- var _this8 = this;
5884
+ var _this10 = this;
5863
5885
 
5864
5886
  var _temp8 = _catch$2(function () {
5865
5887
  return Promise.resolve(API.update(form)).then(function () {
5866
- return Promise.resolve(_this8.load()).then(function () {});
5888
+ return Promise.resolve(_this10.load()).then(function () {});
5867
5889
  });
5868
5890
  }, function (error) {
5869
5891
  console.log(error);
@@ -5876,11 +5898,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5876
5898
  },
5877
5899
  patch: function patch(id, form) {
5878
5900
  try {
5879
- var _this10 = this;
5901
+ var _this12 = this;
5880
5902
 
5881
5903
  var _temp10 = _catch$2(function () {
5882
5904
  return Promise.resolve(API.patch(id, form)).then(function () {
5883
- return Promise.resolve(_this10.load()).then(function () {});
5905
+ return Promise.resolve(_this12.load()).then(function () {});
5884
5906
  });
5885
5907
  }, function (error) {
5886
5908
  console.log(error);
@@ -5893,11 +5915,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5893
5915
  },
5894
5916
  updateProperty: function updateProperty(id, propertyName, form) {
5895
5917
  try {
5896
- var _this12 = this;
5918
+ var _this14 = this;
5897
5919
 
5898
5920
  var _temp12 = _catch$2(function () {
5899
5921
  return Promise.resolve(API.updateProperty(id, propertyName, form)).then(function () {
5900
- return Promise.resolve(_this12.load()).then(function () {});
5922
+ return Promise.resolve(_this14.load()).then(function () {});
5901
5923
  });
5902
5924
  }, function (error) {
5903
5925
  console.log(error);
@@ -5910,11 +5932,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5910
5932
  },
5911
5933
  remove: function remove(id) {
5912
5934
  try {
5913
- var _this14 = this;
5935
+ var _this16 = this;
5914
5936
 
5915
5937
  var _temp14 = _catch$2(function () {
5916
5938
  return Promise.resolve(API.remove(id)).then(function () {
5917
- return Promise.resolve(_this14.load()).then(function () {});
5939
+ return Promise.resolve(_this16.load()).then(function () {});
5918
5940
  });
5919
5941
  }, function (error) {
5920
5942
  console.log(error);