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.cjs +14 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +15 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +14 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +14 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain2/CollectionContext.js +9 -1
- package/src/domain2/CollectionList.css +15 -0
- package/src/domain2/CollectionList.js +3 -2
package/dist/index.cjs
CHANGED
@@ -11022,9 +11022,11 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
11022
11022
|
return data
|
11023
11023
|
}
|
11024
11024
|
*/
|
11025
|
+
setLoading(true);
|
11025
11026
|
return Promise.resolve(_catch(function () {
|
11026
11027
|
return Promise.resolve(API.all(filters, likes, page)).then(function (response) {
|
11027
|
-
var next = field ? response[field] : response;
|
11028
|
+
var next = field ? response[field] : response;
|
11029
|
+
setLoading(false); //const data = runCustomFilters(next)
|
11028
11030
|
//return data
|
11029
11031
|
|
11030
11032
|
_exit2 = 1;
|
@@ -11032,6 +11034,7 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
11032
11034
|
});
|
11033
11035
|
}, function (error) {
|
11034
11036
|
console.log(error);
|
11037
|
+
setLoading(false);
|
11035
11038
|
}));
|
11036
11039
|
} catch (e) {
|
11037
11040
|
return Promise.reject(e);
|
@@ -11078,6 +11081,10 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
11078
11081
|
selected = _useState7[0],
|
11079
11082
|
setSelected = _useState7[1];
|
11080
11083
|
|
11084
|
+
var _useState8 = React.useState(false),
|
11085
|
+
loading = _useState8[0],
|
11086
|
+
setLoading = _useState8[1];
|
11087
|
+
|
11081
11088
|
React.useEffect(function () {
|
11082
11089
|
var mounted = true;
|
11083
11090
|
|
@@ -11093,7 +11100,6 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
11093
11100
|
};
|
11094
11101
|
}, [filters]);
|
11095
11102
|
React.useEffect(function () {
|
11096
|
-
console.log("Run custom filters", customFilters, all);
|
11097
11103
|
if (all.length > 0) runCustomFilters();
|
11098
11104
|
}, [all, customFilters]);
|
11099
11105
|
|
@@ -11111,6 +11117,7 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
11111
11117
|
|
11112
11118
|
var value = {
|
11113
11119
|
all: all,
|
11120
|
+
loading: loading,
|
11114
11121
|
load: load,
|
11115
11122
|
reload: reload,
|
11116
11123
|
selected: selected,
|
@@ -11407,7 +11414,8 @@ var CollectionList = function CollectionList(props) {
|
|
11407
11414
|
var context = React.useContext(CollectionContext);
|
11408
11415
|
var _context$filtered = context.filtered,
|
11409
11416
|
filtered = _context$filtered === void 0 ? [] : _context$filtered,
|
11410
|
-
selected = context.selected
|
11417
|
+
selected = context.selected,
|
11418
|
+
loading = context.loading;
|
11411
11419
|
|
11412
11420
|
var _useState = React.useState(''),
|
11413
11421
|
search = _useState[0],
|
@@ -11459,7 +11467,9 @@ var CollectionList = function CollectionList(props) {
|
|
11459
11467
|
}), /*#__PURE__*/React__default["default"].createElement(TextField, {
|
11460
11468
|
onChange: changeSearch,
|
11461
11469
|
outlined: true
|
11462
|
-
})) : null
|
11470
|
+
})) : null, loading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
11471
|
+
className: "loading"
|
11472
|
+
}, /*#__PURE__*/React__default["default"].createElement(CircularProgress, null)) : null);
|
11463
11473
|
};
|
11464
11474
|
|
11465
11475
|
/**
|