ywana-core8 0.0.800 → 0.0.801

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.umd.js CHANGED
@@ -11016,9 +11016,11 @@
11016
11016
  return data
11017
11017
  }
11018
11018
  */
11019
+ setLoading(true);
11019
11020
  return Promise.resolve(_catch(function () {
11020
11021
  return Promise.resolve(API.all(filters, likes, page)).then(function (response) {
11021
- var next = field ? response[field] : response; //const data = runCustomFilters(next)
11022
+ var next = field ? response[field] : response;
11023
+ setLoading(false); //const data = runCustomFilters(next)
11022
11024
  //return data
11023
11025
 
11024
11026
  _exit2 = 1;
@@ -11026,6 +11028,7 @@
11026
11028
  });
11027
11029
  }, function (error) {
11028
11030
  console.log(error);
11031
+ setLoading(false);
11029
11032
  }));
11030
11033
  } catch (e) {
11031
11034
  return Promise.reject(e);
@@ -11072,6 +11075,10 @@
11072
11075
  selected = _useState7[0],
11073
11076
  setSelected = _useState7[1];
11074
11077
 
11078
+ var _useState8 = React.useState(false),
11079
+ loading = _useState8[0],
11080
+ setLoading = _useState8[1];
11081
+
11075
11082
  React.useEffect(function () {
11076
11083
  var mounted = true;
11077
11084
 
@@ -11087,7 +11094,6 @@
11087
11094
  };
11088
11095
  }, [filters]);
11089
11096
  React.useEffect(function () {
11090
- console.log("Run custom filters", customFilters, all);
11091
11097
  if (all.length > 0) runCustomFilters();
11092
11098
  }, [all, customFilters]);
11093
11099
 
@@ -11105,6 +11111,7 @@
11105
11111
 
11106
11112
  var value = {
11107
11113
  all: all,
11114
+ loading: loading,
11108
11115
  load: load,
11109
11116
  reload: reload,
11110
11117
  selected: selected,
@@ -11401,7 +11408,8 @@
11401
11408
  var context = React.useContext(CollectionContext);
11402
11409
  var _context$filtered = context.filtered,
11403
11410
  filtered = _context$filtered === void 0 ? [] : _context$filtered,
11404
- selected = context.selected;
11411
+ selected = context.selected,
11412
+ loading = context.loading;
11405
11413
 
11406
11414
  var _useState = React.useState(''),
11407
11415
  search = _useState[0],
@@ -11453,7 +11461,9 @@
11453
11461
  }), /*#__PURE__*/React__default["default"].createElement(TextField, {
11454
11462
  onChange: changeSearch,
11455
11463
  outlined: true
11456
- })) : null);
11464
+ })) : null, loading ? /*#__PURE__*/React__default["default"].createElement("div", {
11465
+ className: "loading"
11466
+ }, /*#__PURE__*/React__default["default"].createElement(CircularProgress, null)) : null);
11457
11467
  };
11458
11468
 
11459
11469
  /**