ywana-core8 0.0.151 → 0.0.152

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
@@ -4432,15 +4432,25 @@
4432
4432
 
4433
4433
  var remove = function remove(id) {
4434
4434
  try {
4435
- return Promise.resolve(pageContext.remove(id)).then(function () {
4436
- pageContext.clear();
4437
- setPageContext(Object.assign({}, pageContext));
4438
- });
4435
+ var confirm = site.confirm("Are you sure ?");
4436
+
4437
+ var _temp2 = function () {
4438
+ if (confirm) {
4439
+ return Promise.resolve(pageContext.remove(id)).then(function () {
4440
+ pageContext.clear();
4441
+ setPageContext(Object.assign({}, pageContext));
4442
+ });
4443
+ }
4444
+ }();
4445
+
4446
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
4439
4447
  } catch (e) {
4440
4448
  return Promise.reject(e);
4441
4449
  }
4442
4450
  };
4443
4451
 
4452
+ var site = React.useContext(SiteContext);
4453
+
4444
4454
  var _useContext4 = React.useContext(PageContext),
4445
4455
  pageContext = _useContext4[0],
4446
4456
  setPageContext = _useContext4[1];
@@ -4610,7 +4620,7 @@
4610
4620
  try {
4611
4621
  var _this2 = this;
4612
4622
 
4613
- var _temp2 = _catch(function () {
4623
+ var _temp4 = _catch(function () {
4614
4624
  var filters = filter ? Object.keys(filter).reduce(function (filters, key) {
4615
4625
  var field = filter[key];
4616
4626
  if (field) filters[key] = field;
@@ -4623,7 +4633,7 @@
4623
4633
  console.log(error);
4624
4634
  });
4625
4635
 
4626
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
4636
+ return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
4627
4637
  } catch (e) {
4628
4638
  return Promise.reject(e);
4629
4639
  }
@@ -4658,7 +4668,7 @@
4658
4668
  try {
4659
4669
  var _this5 = this;
4660
4670
 
4661
- var _temp4 = _catch(function () {
4671
+ var _temp6 = _catch(function () {
4662
4672
  return Promise.resolve(API.create(form)).then(function () {
4663
4673
  return Promise.resolve(_this5.load()).then(function () {});
4664
4674
  });
@@ -4666,7 +4676,7 @@
4666
4676
  console.log(error);
4667
4677
  });
4668
4678
 
4669
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
4679
+ return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
4670
4680
  } catch (e) {
4671
4681
  return Promise.reject(e);
4672
4682
  }
@@ -4675,7 +4685,7 @@
4675
4685
  try {
4676
4686
  var _this7 = this;
4677
4687
 
4678
- var _temp6 = _catch(function () {
4688
+ var _temp8 = _catch(function () {
4679
4689
  return Promise.resolve(API.update(form)).then(function () {
4680
4690
  return Promise.resolve(_this7.load()).then(function () {});
4681
4691
  });
@@ -4683,7 +4693,7 @@
4683
4693
  console.log(error);
4684
4694
  });
4685
4695
 
4686
- return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
4696
+ return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function () {}) : void 0);
4687
4697
  } catch (e) {
4688
4698
  return Promise.reject(e);
4689
4699
  }
@@ -4692,7 +4702,7 @@
4692
4702
  try {
4693
4703
  var _this9 = this;
4694
4704
 
4695
- var _temp8 = _catch(function () {
4705
+ var _temp10 = _catch(function () {
4696
4706
  return Promise.resolve(API.remove(id)).then(function () {
4697
4707
  return Promise.resolve(_this9.load()).then(function () {});
4698
4708
  });
@@ -4700,7 +4710,7 @@
4700
4710
  console.log(error);
4701
4711
  });
4702
4712
 
4703
- return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function () {}) : void 0);
4713
+ return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
4704
4714
  } catch (e) {
4705
4715
  return Promise.reject(e);
4706
4716
  }