ywana-core8 0.1.54 → 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
@@ -9940,15 +9940,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9940
9940
  return Promise.reject(e);
9941
9941
  }
9942
9942
  },
9943
- changeFilters: function changeFilters(filters) {
9944
- this.filters = filters;
9945
- },
9946
- loadQueries: function loadQueries(user) {
9943
+ removeChecked: function removeChecked() {
9947
9944
  try {
9948
9945
  var _this6 = this;
9949
9946
  var _temp8 = _catch$3(function () {
9950
- return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
9951
- _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 () {});
9952
9952
  });
9953
9953
  }, function (error) {
9954
9954
  console.log(error);
@@ -9958,12 +9958,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9958
9958
  return Promise.reject(e);
9959
9959
  }
9960
9960
  },
9961
- createQuery: function createQuery(query, user) {
9961
+ removeAll: function removeAll() {
9962
9962
  try {
9963
9963
  var _this7 = this;
9964
9964
  var _temp9 = _catch$3(function () {
9965
- return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
9966
- 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 () {});
9967
9970
  });
9968
9971
  }, function (error) {
9969
9972
  console.log(error);
@@ -9973,12 +9976,15 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9973
9976
  return Promise.reject(e);
9974
9977
  }
9975
9978
  },
9976
- removeQuery: function removeQuery(id, user) {
9979
+ changeFilters: function changeFilters(filters) {
9980
+ this.filters = filters;
9981
+ },
9982
+ loadQueries: function loadQueries(user) {
9977
9983
  try {
9978
9984
  var _this8 = this;
9979
9985
  var _temp10 = _catch$3(function () {
9980
- return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
9981
- 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;
9982
9988
  });
9983
9989
  }, function (error) {
9984
9990
  console.log(error);
@@ -9987,6 +9993,36 @@ var TableContext$2 = function TableContext(url, field, host, urlQuery, params) {
9987
9993
  } catch (e) {
9988
9994
  return Promise.reject(e);
9989
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
+ }
9990
10026
  }
9991
10027
  };
9992
10028
  };