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.
package/dist/index.cjs CHANGED
@@ -3634,6 +3634,7 @@ var SiteMenu = function SiteMenu(_ref6) {
3634
3634
  };
3635
3635
  var sections = React.useMemo(function () {
3636
3636
  return children.reduce(function (acc, child) {
3637
+ if (!child || !child.props) return acc;
3637
3638
  var section = child.props.section || "";
3638
3639
  if (!acc[section]) acc[section] = [];
3639
3640
  var title = child.props.title;
@@ -9939,15 +9940,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9939
9940
  return Promise.reject(e);
9940
9941
  }
9941
9942
  },
9942
- changeFilters: function changeFilters(filters) {
9943
- this.filters = filters;
9944
- },
9945
- loadQueries: function loadQueries(user) {
9943
+ removeChecked: function removeChecked() {
9946
9944
  try {
9947
9945
  var _this6 = this;
9948
9946
  var _temp8 = _catch$3(function () {
9949
- return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
9950
- _this6.queries = _API$queries;
9947
+ var promises = _this6.checked.map(function (id) {
9948
+ return API.remove(id);
9949
+ });
9950
+ return Promise.resolve(Promise.all(promises)).then(function () {
9951
+ return Promise.resolve(_this6.load()).then(function () {});
9951
9952
  });
9952
9953
  }, function (error) {
9953
9954
  console.log(error);
@@ -9957,12 +9958,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9957
9958
  return Promise.reject(e);
9958
9959
  }
9959
9960
  },
9960
- createQuery: function createQuery(query, user) {
9961
+ removeAll: function removeAll() {
9961
9962
  try {
9962
9963
  var _this7 = this;
9963
9964
  var _temp9 = _catch$3(function () {
9964
- return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
9965
- return Promise.resolve(_this7.loadQueries(user)).then(function () {});
9965
+ var promises = _this7.all.map(function (item) {
9966
+ return API.remove(item.id);
9967
+ });
9968
+ return Promise.resolve(Promise.all(promises)).then(function () {
9969
+ return Promise.resolve(_this7.load()).then(function () {});
9966
9970
  });
9967
9971
  }, function (error) {
9968
9972
  console.log(error);
@@ -9972,12 +9976,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9972
9976
  return Promise.reject(e);
9973
9977
  }
9974
9978
  },
9975
- removeQuery: function removeQuery(id, user) {
9979
+ changeFilters: function changeFilters(filters) {
9980
+ this.filters = filters;
9981
+ },
9982
+ loadQueries: function loadQueries(user) {
9976
9983
  try {
9977
9984
  var _this8 = this;
9978
9985
  var _temp10 = _catch$3(function () {
9979
- return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
9980
- return Promise.resolve(_this8.loadQueries(user)).then(function () {});
9986
+ return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
9987
+ _this8.queries = _API$queries;
9981
9988
  });
9982
9989
  }, function (error) {
9983
9990
  console.log(error);
@@ -9986,6 +9993,36 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9986
9993
  } catch (e) {
9987
9994
  return Promise.reject(e);
9988
9995
  }
9996
+ },
9997
+ createQuery: function createQuery(query, user) {
9998
+ try {
9999
+ var _this9 = this;
10000
+ var _temp11 = _catch$3(function () {
10001
+ return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
10002
+ return Promise.resolve(_this9.loadQueries(user)).then(function () {});
10003
+ });
10004
+ }, function (error) {
10005
+ console.log(error);
10006
+ });
10007
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
10008
+ } catch (e) {
10009
+ return Promise.reject(e);
10010
+ }
10011
+ },
10012
+ removeQuery: function removeQuery(id, user) {
10013
+ try {
10014
+ var _this10 = this;
10015
+ var _temp12 = _catch$3(function () {
10016
+ return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
10017
+ return Promise.resolve(_this10.loadQueries(user)).then(function () {});
10018
+ });
10019
+ }, function (error) {
10020
+ console.log(error);
10021
+ });
10022
+ return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(function () {}) : void 0);
10023
+ } catch (e) {
10024
+ return Promise.reject(e);
10025
+ }
9989
10026
  }
9990
10027
  };
9991
10028
  };