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 +22 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +22 -12
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +22 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +7 -3
package/dist/index.modern.js
CHANGED
@@ -4428,15 +4428,25 @@ var TableEditor = function TableEditor(props) {
|
|
4428
4428
|
|
4429
4429
|
var remove = function remove(id) {
|
4430
4430
|
try {
|
4431
|
-
|
4432
|
-
|
4433
|
-
|
4434
|
-
|
4431
|
+
var confirm = site.confirm("Are you sure ?");
|
4432
|
+
|
4433
|
+
var _temp2 = function () {
|
4434
|
+
if (confirm) {
|
4435
|
+
return Promise.resolve(pageContext.remove(id)).then(function () {
|
4436
|
+
pageContext.clear();
|
4437
|
+
setPageContext(Object.assign({}, pageContext));
|
4438
|
+
});
|
4439
|
+
}
|
4440
|
+
}();
|
4441
|
+
|
4442
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
4435
4443
|
} catch (e) {
|
4436
4444
|
return Promise.reject(e);
|
4437
4445
|
}
|
4438
4446
|
};
|
4439
4447
|
|
4448
|
+
var site = useContext(SiteContext);
|
4449
|
+
|
4440
4450
|
var _useContext4 = useContext(PageContext),
|
4441
4451
|
pageContext = _useContext4[0],
|
4442
4452
|
setPageContext = _useContext4[1];
|
@@ -4606,7 +4616,7 @@ var TableContext = function TableContext(url, field) {
|
|
4606
4616
|
try {
|
4607
4617
|
var _this2 = this;
|
4608
4618
|
|
4609
|
-
var
|
4619
|
+
var _temp4 = _catch(function () {
|
4610
4620
|
var filters = filter ? Object.keys(filter).reduce(function (filters, key) {
|
4611
4621
|
var field = filter[key];
|
4612
4622
|
if (field) filters[key] = field;
|
@@ -4619,7 +4629,7 @@ var TableContext = function TableContext(url, field) {
|
|
4619
4629
|
console.log(error);
|
4620
4630
|
});
|
4621
4631
|
|
4622
|
-
return Promise.resolve(
|
4632
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
4623
4633
|
} catch (e) {
|
4624
4634
|
return Promise.reject(e);
|
4625
4635
|
}
|
@@ -4654,7 +4664,7 @@ var TableContext = function TableContext(url, field) {
|
|
4654
4664
|
try {
|
4655
4665
|
var _this5 = this;
|
4656
4666
|
|
4657
|
-
var
|
4667
|
+
var _temp6 = _catch(function () {
|
4658
4668
|
return Promise.resolve(API.create(form)).then(function () {
|
4659
4669
|
return Promise.resolve(_this5.load()).then(function () {});
|
4660
4670
|
});
|
@@ -4662,7 +4672,7 @@ var TableContext = function TableContext(url, field) {
|
|
4662
4672
|
console.log(error);
|
4663
4673
|
});
|
4664
4674
|
|
4665
|
-
return Promise.resolve(
|
4675
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
4666
4676
|
} catch (e) {
|
4667
4677
|
return Promise.reject(e);
|
4668
4678
|
}
|
@@ -4671,7 +4681,7 @@ var TableContext = function TableContext(url, field) {
|
|
4671
4681
|
try {
|
4672
4682
|
var _this7 = this;
|
4673
4683
|
|
4674
|
-
var
|
4684
|
+
var _temp8 = _catch(function () {
|
4675
4685
|
return Promise.resolve(API.update(form)).then(function () {
|
4676
4686
|
return Promise.resolve(_this7.load()).then(function () {});
|
4677
4687
|
});
|
@@ -4679,7 +4689,7 @@ var TableContext = function TableContext(url, field) {
|
|
4679
4689
|
console.log(error);
|
4680
4690
|
});
|
4681
4691
|
|
4682
|
-
return Promise.resolve(
|
4692
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function () {}) : void 0);
|
4683
4693
|
} catch (e) {
|
4684
4694
|
return Promise.reject(e);
|
4685
4695
|
}
|
@@ -4688,7 +4698,7 @@ var TableContext = function TableContext(url, field) {
|
|
4688
4698
|
try {
|
4689
4699
|
var _this9 = this;
|
4690
4700
|
|
4691
|
-
var
|
4701
|
+
var _temp10 = _catch(function () {
|
4692
4702
|
return Promise.resolve(API.remove(id)).then(function () {
|
4693
4703
|
return Promise.resolve(_this9.load()).then(function () {});
|
4694
4704
|
});
|
@@ -4696,7 +4706,7 @@ var TableContext = function TableContext(url, field) {
|
|
4696
4706
|
console.log(error);
|
4697
4707
|
});
|
4698
4708
|
|
4699
|
-
return Promise.resolve(
|
4709
|
+
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
|
4700
4710
|
} catch (e) {
|
4701
4711
|
return Promise.reject(e);
|
4702
4712
|
}
|