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.
@@ -4800,7 +4800,8 @@ var CollectionEditor$1 = function CollectionEditor(_ref10) {
4800
4800
  field: field,
4801
4801
  value: value,
4802
4802
  onRemove: remove,
4803
- onChange: onChange
4803
+ onChange: onChange,
4804
+ onReload: reload
4804
4805
  }) // : <DataTable {...table} editable={editable} />
4805
4806
  : /*#__PURE__*/React.createElement(TableEditor$2, {
4806
4807
  icon: "info",
@@ -5256,6 +5257,16 @@ function _catch$2(body, recover) {
5256
5257
 
5257
5258
 
5258
5259
  var CollectionPage = function CollectionPage(props) {
5260
+ var reloadSelection = function reloadSelection() {
5261
+ try {
5262
+ return Promise.resolve(pageContext.reloadSelection()).then(function () {
5263
+ setPageContext(Object.assign({}, pageContext));
5264
+ });
5265
+ } catch (e) {
5266
+ return Promise.reject(e);
5267
+ }
5268
+ };
5269
+
5259
5270
  var reload = function reload() {
5260
5271
  try {
5261
5272
  return Promise.resolve(pageContext.load()).then(function () {
@@ -5387,7 +5398,7 @@ var CollectionPage = function CollectionPage(props) {
5387
5398
  delay: delay,
5388
5399
  canDelete: canDelete,
5389
5400
  canEdit: canEdit,
5390
- onReload: reload
5401
+ onReload: reloadSelection
5391
5402
  }), children ? /*#__PURE__*/React.createElement("article", null, children) : null));
5392
5403
  };
5393
5404
  var CollectionFilters = function CollectionFilters(props) {
@@ -5818,6 +5829,17 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5818
5829
  return Promise.reject(e);
5819
5830
  }
5820
5831
  },
5832
+ reloadSelection: function reloadSelection() {
5833
+ try {
5834
+ var _this6 = this;
5835
+
5836
+ return Promise.resolve(_this6.fetch(_this6.selected.id)).then(function (result) {
5837
+ _this6.selected = result;
5838
+ });
5839
+ } catch (e) {
5840
+ return Promise.reject(e);
5841
+ }
5842
+ },
5821
5843
  fetch: function fetch(id) {
5822
5844
  try {
5823
5845
  return Promise.resolve(_catch$2(function () {
@@ -5834,11 +5856,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5834
5856
  },
5835
5857
  create: function create(form) {
5836
5858
  try {
5837
- var _this6 = this;
5859
+ var _this8 = this;
5838
5860
 
5839
5861
  var _temp6 = _catch$2(function () {
5840
5862
  return Promise.resolve(API.create(form)).then(function () {
5841
- return Promise.resolve(_this6.load()).then(function () {});
5863
+ return Promise.resolve(_this8.load()).then(function () {});
5842
5864
  });
5843
5865
  }, function (error) {
5844
5866
  console.log(error);
@@ -5851,11 +5873,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5851
5873
  },
5852
5874
  update: function update(form) {
5853
5875
  try {
5854
- var _this8 = this;
5876
+ var _this10 = this;
5855
5877
 
5856
5878
  var _temp8 = _catch$2(function () {
5857
5879
  return Promise.resolve(API.update(form)).then(function () {
5858
- return Promise.resolve(_this8.load()).then(function () {});
5880
+ return Promise.resolve(_this10.load()).then(function () {});
5859
5881
  });
5860
5882
  }, function (error) {
5861
5883
  console.log(error);
@@ -5868,11 +5890,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5868
5890
  },
5869
5891
  patch: function patch(id, form) {
5870
5892
  try {
5871
- var _this10 = this;
5893
+ var _this12 = this;
5872
5894
 
5873
5895
  var _temp10 = _catch$2(function () {
5874
5896
  return Promise.resolve(API.patch(id, form)).then(function () {
5875
- return Promise.resolve(_this10.load()).then(function () {});
5897
+ return Promise.resolve(_this12.load()).then(function () {});
5876
5898
  });
5877
5899
  }, function (error) {
5878
5900
  console.log(error);
@@ -5885,11 +5907,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5885
5907
  },
5886
5908
  updateProperty: function updateProperty(id, propertyName, form) {
5887
5909
  try {
5888
- var _this12 = this;
5910
+ var _this14 = this;
5889
5911
 
5890
5912
  var _temp12 = _catch$2(function () {
5891
5913
  return Promise.resolve(API.updateProperty(id, propertyName, form)).then(function () {
5892
- return Promise.resolve(_this12.load()).then(function () {});
5914
+ return Promise.resolve(_this14.load()).then(function () {});
5893
5915
  });
5894
5916
  }, function (error) {
5895
5917
  console.log(error);
@@ -5902,11 +5924,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5902
5924
  },
5903
5925
  remove: function remove(id) {
5904
5926
  try {
5905
- var _this14 = this;
5927
+ var _this16 = this;
5906
5928
 
5907
5929
  var _temp14 = _catch$2(function () {
5908
5930
  return Promise.resolve(API.remove(id)).then(function () {
5909
- return Promise.resolve(_this14.load()).then(function () {});
5931
+ return Promise.resolve(_this16.load()).then(function () {});
5910
5932
  });
5911
5933
  }, function (error) {
5912
5934
  console.log(error);