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