ywana-core8 0.0.297 → 0.0.298

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.
@@ -5154,7 +5154,15 @@ var TablePage = function TablePage(props) {
5154
5154
  try {
5155
5155
  var context = TableContext(url, field, host);
5156
5156
  return Promise.resolve(context.load()).then(function () {
5157
- setPageContext(context);
5157
+ function _temp2() {
5158
+ setPageContext(context);
5159
+ }
5160
+
5161
+ var _temp = function () {
5162
+ if (canQuery) return Promise.resolve(context.loadQueries()).then(function () {});
5163
+ }();
5164
+
5165
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
5158
5166
  });
5159
5167
  } catch (e) {
5160
5168
  return Promise.reject(e);
@@ -5369,13 +5377,20 @@ var TableSelector = function TableSelector(props) {
5369
5377
 
5370
5378
 
5371
5379
  var TableQueries = function TableQueries(props) {
5372
- var _useContext3 = useContext(PageContext),
5373
- pageContext = _useContext3[0];
5374
-
5375
- useEffect(function () {
5376
- pageContext.loadQueries();
5377
- }, []);
5378
- var queries = [1, 2, 3];
5380
+ function remove(id) {
5381
+ alert("TODO: remove query");
5382
+ }
5383
+
5384
+ var queries = [{
5385
+ name: "Query 1",
5386
+ filters: {}
5387
+ }, {
5388
+ name: "Query 2",
5389
+ filters: {}
5390
+ }, {
5391
+ name: "Query 3",
5392
+ filters: {}
5393
+ }];
5379
5394
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
5380
5395
  className: "table-queries",
5381
5396
  title: /*#__PURE__*/React.createElement(Text, null, "Queries")
@@ -5384,7 +5399,16 @@ var TableQueries = function TableQueries(props) {
5384
5399
  }, queries.map(function (query) {
5385
5400
  return /*#__PURE__*/React.createElement("div", {
5386
5401
  className: "table-queries-item"
5387
- });
5402
+ }, /*#__PURE__*/React.createElement(Icon, {
5403
+ icon: "star"
5404
+ }), /*#__PURE__*/React.createElement("label", null, query.name), /*#__PURE__*/React.createElement(Icon, {
5405
+ icon: "close",
5406
+ clickable: true,
5407
+ size: "small",
5408
+ action: function action() {
5409
+ return remove();
5410
+ }
5411
+ }));
5388
5412
  })));
5389
5413
  };
5390
5414
  /**
@@ -5404,9 +5428,9 @@ var TableFilters = function TableFilters(props) {
5404
5428
  }
5405
5429
  };
5406
5430
 
5407
- var _useContext4 = useContext(PageContext),
5408
- pageContext = _useContext4[0],
5409
- setPageContext = _useContext4[1];
5431
+ var _useContext3 = useContext(PageContext),
5432
+ pageContext = _useContext3[0],
5433
+ setPageContext = _useContext3[1];
5410
5434
 
5411
5435
  var schema = props.schema,
5412
5436
  onSave = props.onSave;
@@ -5493,7 +5517,7 @@ var TableEditor = function TableEditor(props) {
5493
5517
  var remove = function remove(id) {
5494
5518
  try {
5495
5519
  return Promise.resolve(site.confirm("Are you sure ?")).then(function (confirm) {
5496
- var _temp = function () {
5520
+ var _temp3 = function () {
5497
5521
  if (confirm) {
5498
5522
  return Promise.resolve(pageContext.remove(id)).then(function () {
5499
5523
  pageContext.clear();
@@ -5502,7 +5526,7 @@ var TableEditor = function TableEditor(props) {
5502
5526
  }
5503
5527
  }();
5504
5528
 
5505
- if (_temp && _temp.then) return _temp.then(function () {});
5529
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
5506
5530
  });
5507
5531
  } catch (e) {
5508
5532
  return Promise.reject(e);
@@ -5511,9 +5535,9 @@ var TableEditor = function TableEditor(props) {
5511
5535
 
5512
5536
  var site = useContext(SiteContext);
5513
5537
 
5514
- var _useContext5 = useContext(PageContext),
5515
- pageContext = _useContext5[0],
5516
- setPageContext = _useContext5[1];
5538
+ var _useContext4 = useContext(PageContext),
5539
+ pageContext = _useContext4[0],
5540
+ setPageContext = _useContext4[1];
5517
5541
 
5518
5542
  var _pageContext$all = pageContext.all,
5519
5543
  all = _pageContext$all === void 0 ? [] : _pageContext$all;
@@ -5697,7 +5721,7 @@ var TableContext = function TableContext(url, field, host) {
5697
5721
  try {
5698
5722
  var _this2 = this;
5699
5723
 
5700
- var _temp3 = _catch(function () {
5724
+ var _temp5 = _catch(function () {
5701
5725
  var filters = filter ? Object.keys(filter).reduce(function (filters, key) {
5702
5726
  var field = filter[key];
5703
5727
  if (field) filters[key] = field;
@@ -5710,7 +5734,7 @@ var TableContext = function TableContext(url, field, host) {
5710
5734
  console.log(error);
5711
5735
  });
5712
5736
 
5713
- return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
5737
+ return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(function () {}) : void 0);
5714
5738
  } catch (e) {
5715
5739
  return Promise.reject(e);
5716
5740
  }
@@ -5745,7 +5769,7 @@ var TableContext = function TableContext(url, field, host) {
5745
5769
  try {
5746
5770
  var _this5 = this;
5747
5771
 
5748
- var _temp5 = _catch(function () {
5772
+ var _temp7 = _catch(function () {
5749
5773
  return Promise.resolve(API.create(form)).then(function () {
5750
5774
  return Promise.resolve(_this5.load()).then(function () {});
5751
5775
  });
@@ -5753,7 +5777,7 @@ var TableContext = function TableContext(url, field, host) {
5753
5777
  console.log(error);
5754
5778
  });
5755
5779
 
5756
- return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(function () {}) : void 0);
5780
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
5757
5781
  } catch (e) {
5758
5782
  return Promise.reject(e);
5759
5783
  }
@@ -5762,7 +5786,7 @@ var TableContext = function TableContext(url, field, host) {
5762
5786
  try {
5763
5787
  var _this7 = this;
5764
5788
 
5765
- var _temp7 = _catch(function () {
5789
+ var _temp9 = _catch(function () {
5766
5790
  return Promise.resolve(API.update(form)).then(function () {
5767
5791
  return Promise.resolve(_this7.load()).then(function () {});
5768
5792
  });
@@ -5770,7 +5794,7 @@ var TableContext = function TableContext(url, field, host) {
5770
5794
  console.log(error);
5771
5795
  });
5772
5796
 
5773
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
5797
+ return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
5774
5798
  } catch (e) {
5775
5799
  return Promise.reject(e);
5776
5800
  }
@@ -5779,7 +5803,7 @@ var TableContext = function TableContext(url, field, host) {
5779
5803
  try {
5780
5804
  var _this9 = this;
5781
5805
 
5782
- var _temp9 = _catch(function () {
5806
+ var _temp11 = _catch(function () {
5783
5807
  return Promise.resolve(API.remove(id)).then(function () {
5784
5808
  return Promise.resolve(_this9.load()).then(function () {});
5785
5809
  });
@@ -5787,7 +5811,7 @@ var TableContext = function TableContext(url, field, host) {
5787
5811
  console.log(error);
5788
5812
  });
5789
5813
 
5790
- return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
5814
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
5791
5815
  } catch (e) {
5792
5816
  return Promise.reject(e);
5793
5817
  }
@@ -5799,7 +5823,7 @@ var TableContext = function TableContext(url, field, host) {
5799
5823
  try {
5800
5824
  var _this11 = this;
5801
5825
 
5802
- var _temp11 = _catch(function () {
5826
+ var _temp13 = _catch(function () {
5803
5827
  return Promise.resolve(API.queries()).then(function (_API$queries) {
5804
5828
  _this11.queries = _API$queries;
5805
5829
  });
@@ -5807,7 +5831,7 @@ var TableContext = function TableContext(url, field, host) {
5807
5831
  console.log(error);
5808
5832
  });
5809
5833
 
5810
- return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
5834
+ return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
5811
5835
  } catch (e) {
5812
5836
  return Promise.reject(e);
5813
5837
  }
@@ -5816,7 +5840,7 @@ var TableContext = function TableContext(url, field, host) {
5816
5840
  try {
5817
5841
  var _this13 = this;
5818
5842
 
5819
- var _temp13 = _catch(function () {
5843
+ var _temp15 = _catch(function () {
5820
5844
  return Promise.resolve(API.createQuery(query)).then(function () {
5821
5845
  _this13.loadQueries();
5822
5846
  });
@@ -5824,7 +5848,7 @@ var TableContext = function TableContext(url, field, host) {
5824
5848
  console.log(error);
5825
5849
  });
5826
5850
 
5827
- return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
5851
+ return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
5828
5852
  } catch (e) {
5829
5853
  return Promise.reject(e);
5830
5854
  }
@@ -5833,7 +5857,7 @@ var TableContext = function TableContext(url, field, host) {
5833
5857
  try {
5834
5858
  var _this15 = this;
5835
5859
 
5836
- var _temp15 = _catch(function () {
5860
+ var _temp17 = _catch(function () {
5837
5861
  return Promise.resolve(API.removeQuery(id)).then(function () {
5838
5862
  return Promise.resolve(_this15.loadQueries()).then(function () {});
5839
5863
  });
@@ -5841,7 +5865,7 @@ var TableContext = function TableContext(url, field, host) {
5841
5865
  console.log(error);
5842
5866
  });
5843
5867
 
5844
- return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
5868
+ return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
5845
5869
  } catch (e) {
5846
5870
  return Promise.reject(e);
5847
5871
  }