ywana-core8 0.1.53 → 0.1.55

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.
@@ -3625,6 +3625,7 @@ var SiteMenu = function SiteMenu(_ref6) {
3625
3625
  };
3626
3626
  var sections = useMemo(function () {
3627
3627
  return children.reduce(function (acc, child) {
3628
+ if (!child || !child.props) return acc;
3628
3629
  var section = child.props.section || "";
3629
3630
  if (!acc[section]) acc[section] = [];
3630
3631
  var title = child.props.title;
@@ -9930,15 +9931,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9930
9931
  return Promise.reject(e);
9931
9932
  }
9932
9933
  },
9933
- changeFilters: function changeFilters(filters) {
9934
- this.filters = filters;
9935
- },
9936
- loadQueries: function loadQueries(user) {
9934
+ removeChecked: function removeChecked() {
9937
9935
  try {
9938
9936
  var _this6 = this;
9939
9937
  var _temp8 = _catch$3(function () {
9940
- return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
9941
- _this6.queries = _API$queries;
9938
+ var promises = _this6.checked.map(function (id) {
9939
+ return API.remove(id);
9940
+ });
9941
+ return Promise.resolve(Promise.all(promises)).then(function () {
9942
+ return Promise.resolve(_this6.load()).then(function () {});
9942
9943
  });
9943
9944
  }, function (error) {
9944
9945
  console.log(error);
@@ -9948,12 +9949,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9948
9949
  return Promise.reject(e);
9949
9950
  }
9950
9951
  },
9951
- createQuery: function createQuery(query, user) {
9952
+ removeAll: function removeAll() {
9952
9953
  try {
9953
9954
  var _this7 = this;
9954
9955
  var _temp9 = _catch$3(function () {
9955
- return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
9956
- return Promise.resolve(_this7.loadQueries(user)).then(function () {});
9956
+ var promises = _this7.all.map(function (item) {
9957
+ return API.remove(item.id);
9958
+ });
9959
+ return Promise.resolve(Promise.all(promises)).then(function () {
9960
+ return Promise.resolve(_this7.load()).then(function () {});
9957
9961
  });
9958
9962
  }, function (error) {
9959
9963
  console.log(error);
@@ -9963,12 +9967,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9963
9967
  return Promise.reject(e);
9964
9968
  }
9965
9969
  },
9966
- removeQuery: function removeQuery(id, user) {
9970
+ changeFilters: function changeFilters(filters) {
9971
+ this.filters = filters;
9972
+ },
9973
+ loadQueries: function loadQueries(user) {
9967
9974
  try {
9968
9975
  var _this8 = this;
9969
9976
  var _temp10 = _catch$3(function () {
9970
- return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
9971
- return Promise.resolve(_this8.loadQueries(user)).then(function () {});
9977
+ return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
9978
+ _this8.queries = _API$queries;
9972
9979
  });
9973
9980
  }, function (error) {
9974
9981
  console.log(error);
@@ -9977,6 +9984,36 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9977
9984
  } catch (e) {
9978
9985
  return Promise.reject(e);
9979
9986
  }
9987
+ },
9988
+ createQuery: function createQuery(query, user) {
9989
+ try {
9990
+ var _this9 = this;
9991
+ var _temp11 = _catch$3(function () {
9992
+ return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
9993
+ return Promise.resolve(_this9.loadQueries(user)).then(function () {});
9994
+ });
9995
+ }, function (error) {
9996
+ console.log(error);
9997
+ });
9998
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
9999
+ } catch (e) {
10000
+ return Promise.reject(e);
10001
+ }
10002
+ },
10003
+ removeQuery: function removeQuery(id, user) {
10004
+ try {
10005
+ var _this10 = this;
10006
+ var _temp12 = _catch$3(function () {
10007
+ return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
10008
+ return Promise.resolve(_this10.loadQueries(user)).then(function () {});
10009
+ });
10010
+ }, function (error) {
10011
+ console.log(error);
10012
+ });
10013
+ return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(function () {}) : void 0);
10014
+ } catch (e) {
10015
+ return Promise.reject(e);
10016
+ }
9980
10017
  }
9981
10018
  };
9982
10019
  };