ywana-core8 0.0.668 → 0.0.669

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.umd.js CHANGED
@@ -5670,6 +5670,8 @@
5670
5670
  delay = _props$delay === void 0 ? 1000 : _props$delay,
5671
5671
  _props$patch = props.patch,
5672
5672
  patch = _props$patch === void 0 ? false : _props$patch,
5673
+ _props$versioning = props.versioning,
5674
+ versioning = _props$versioning === void 0 ? false : _props$versioning,
5673
5675
  groupBy = props.groupBy,
5674
5676
  levels = props.levels,
5675
5677
  sorter = props.sorter,
@@ -5677,12 +5679,12 @@
5677
5679
  editor = props.editor,
5678
5680
  footer = props.footer,
5679
5681
  children = props.children;
5682
+ var context = CollectionContext(url, field, host, page, fetching, versioning);
5680
5683
 
5681
5684
  var _useContext = React.useContext(PageContext),
5682
5685
  pageContext = _useContext[0],
5683
5686
  setPageContext = _useContext[1];
5684
5687
 
5685
- var context = CollectionContext(url, field, host, page, fetching);
5686
5688
  var all = pageContext.all;
5687
5689
  React.useEffect(function () {
5688
5690
  try {
@@ -6206,7 +6208,11 @@
6206
6208
  */
6207
6209
 
6208
6210
 
6209
- var CollectionContext = function CollectionContext(url, field, host, page, fetching) {
6211
+ var CollectionContext = function CollectionContext(url, field, host, page, fetching, versioning) {
6212
+ if (versioning === void 0) {
6213
+ versioning = false;
6214
+ }
6215
+
6210
6216
  var API = CollectionAPI(url, host);
6211
6217
  return {
6212
6218
  all: [],
@@ -6285,6 +6291,7 @@
6285
6291
  var _this8 = this;
6286
6292
 
6287
6293
  var _temp10 = _catch$3(function () {
6294
+ if (versioning) form.version = 1;
6288
6295
  return Promise.resolve(API.create(form)).then(function () {
6289
6296
  return Promise.resolve(_this8.load()).then(function () {});
6290
6297
  });
@@ -6302,6 +6309,7 @@
6302
6309
  var _this10 = this;
6303
6310
 
6304
6311
  var _temp12 = _catch$3(function () {
6312
+ if (versioning) form.version = form.version ? form.version + 1 : 1;
6305
6313
  return Promise.resolve(API.update(form)).then(function () {
6306
6314
  return Promise.resolve(_this10.load()).then(function () {});
6307
6315
  });
@@ -6319,6 +6327,7 @@
6319
6327
  var _this12 = this;
6320
6328
 
6321
6329
  var _temp14 = _catch$3(function () {
6330
+ if (versioning) form.version = form.version ? form.version + 1 : 1;
6322
6331
  return Promise.resolve(API.patch(id, form)).then(function () {
6323
6332
  return Promise.resolve(_this12.load()).then(function () {});
6324
6333
  });