redux-paginator-immutable 17.1.1 → 17.1.2
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/LoadingButton.d.ts +2 -2
- package/LoadingButton.js +51 -7
- package/LoadingButton.js.map +1 -1
- package/package.json +1 -1
package/LoadingButton.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ type LoadingButtonPropTypes = {
|
|
|
4
4
|
hasProblems: boolean;
|
|
5
5
|
fetchMore: () => void;
|
|
6
6
|
};
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
7
|
+
declare const Loading: (props: LoadingButtonPropTypes) => JSX.Element;
|
|
8
|
+
export default Loading;
|
package/LoadingButton.js
CHANGED
|
@@ -1,24 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
2
28
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
30
|
};
|
|
5
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
33
|
+
/* eslint-disable no-useless-constructor */
|
|
34
|
+
/* eslint-disable class-methods-use-this */
|
|
35
|
+
/* eslint-disable react/sort-comp */
|
|
6
36
|
var react_1 = __importDefault(require("react"));
|
|
7
37
|
var Messages_1 = require("x25/Messages");
|
|
8
38
|
var react_intersection_observer_1 = require("react-intersection-observer");
|
|
9
39
|
var utility_1 = require("x25/utility");
|
|
40
|
+
var ErrorBoundary = /** @class */ (function (_super) {
|
|
41
|
+
__extends(ErrorBoundary, _super);
|
|
42
|
+
function ErrorBoundary(props) {
|
|
43
|
+
return _super.call(this, props) || this;
|
|
44
|
+
}
|
|
45
|
+
ErrorBoundary.prototype.componentDidCatch = function () {
|
|
46
|
+
};
|
|
47
|
+
ErrorBoundary.getDerivedStateFromError = function () {
|
|
48
|
+
return { hasError: true };
|
|
49
|
+
};
|
|
50
|
+
ErrorBoundary.prototype.render = function () {
|
|
51
|
+
return this.props.children;
|
|
52
|
+
};
|
|
53
|
+
return ErrorBoundary;
|
|
54
|
+
}(react_1.default.Component));
|
|
10
55
|
var LoadingButton = function (props) {
|
|
11
|
-
var isFetching = props.isFetching, hasProblems = props.hasProblems, fetchMore = props.fetchMore, _a = (0, react_intersection_observer_1.useInView)({
|
|
12
|
-
triggerOnce: true,
|
|
13
|
-
}), ref = _a[0], inView = _a[1];
|
|
56
|
+
var isFetching = props.isFetching, hasProblems = props.hasProblems, fetchMore = props.fetchMore, _a = (0, react_intersection_observer_1.useInView)({}), ref = _a[0], inView = _a[1];
|
|
14
57
|
react_1.default.useEffect(function () {
|
|
15
58
|
if (!isFetching && !hasProblems && inView) {
|
|
16
59
|
fetchMore();
|
|
17
60
|
}
|
|
18
61
|
}, [isFetching, hasProblems, inView]);
|
|
19
|
-
return (react_1.default.createElement("div", { className: "text-center my-2"
|
|
62
|
+
return (react_1.default.createElement("div", { className: "text-center my-2" },
|
|
20
63
|
hasProblems ? react_1.default.createElement(Messages_1.ErrorMessage, { message: utility_1.words.ThereWasAProblem }) : null,
|
|
21
|
-
isFetching ? react_1.default.createElement(Messages_1.LoadingMessage, { message: utility_1.words.LoadingData, sm: true }) : (react_1.default.createElement("button", { className: "btn btn-link d-print-none", disabled: isFetching, onClick: fetchMore, type: "button" }, isFetching ? utility_1.words.LoadingData : utility_1.words.LoadMore))));
|
|
22
|
-
}
|
|
23
|
-
|
|
64
|
+
isFetching ? react_1.default.createElement(Messages_1.LoadingMessage, { message: utility_1.words.LoadingData, sm: true }) : (react_1.default.createElement("button", { className: "btn btn-link d-print-none", disabled: isFetching, onClick: fetchMore, ref: ref, type: "button" }, isFetching ? utility_1.words.LoadingData : utility_1.words.LoadMore))));
|
|
65
|
+
}, Loading = function (props) { return (react_1.default.createElement(ErrorBoundary, null,
|
|
66
|
+
react_1.default.createElement(LoadingButton, __assign({}, props)))); };
|
|
67
|
+
exports.default = Loading;
|
|
24
68
|
//# sourceMappingURL=LoadingButton.js.map
|
package/LoadingButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingButton.js","sourceRoot":"","sources":["../src/LoadingButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoadingButton.js","sourceRoot":"","sources":["../src/LoadingButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAyD;AACzD,2CAA2C;AAC3C,2CAA2C;AAC3C,oCAAoC;AACpC,gDAA0B;AAC1B,yCAA4D;AAC5D,2EAAwD;AAOxD,uCAAoC;AAEpC;IAA4B,iCAAe;IACzC,uBA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