redux-paginator-immutable 17.0.37 → 17.0.39
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/lib/Info.js +2 -3
- package/lib/Info.js.map +1 -1
- package/lib/LoadDataItem.d.ts +5 -3
- package/lib/LoadDataItem.js +3 -6
- package/lib/LoadDataItem.js.map +1 -1
- package/lib/LoadPaginator.js +3 -3
- package/lib/LoadPaginator.js.map +1 -1
- package/lib/LoadingButton.js +3 -3
- package/lib/LoadingButton.js.map +1 -1
- package/lib/reducerOperations.js +3 -1
- package/lib/reducerOperations.js.map +1 -1
- package/package.json +14 -14
- package/src/Info.tsx +2 -3
- package/src/LoadDataItem.tsx +1 -1
- package/src/LoadPaginator.tsx +1 -1
- package/src/LoadingButton.tsx +1 -1
- package/src/reducerOperations.ts +4 -7
- package/lib/words.d.ts +0 -9
- package/lib/words.js +0 -12
- package/lib/words.js.map +0 -1
- package/src/words.ts +0 -10
package/lib/Info.js
CHANGED
|
@@ -5,15 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const utility_1 = require("x25/utility");
|
|
8
|
-
const words_1 = __importDefault(require("./words"));
|
|
9
8
|
const getNumberForm = (value, one, all) => {
|
|
10
9
|
if (value === 1) {
|
|
11
10
|
return `1 ${one}`;
|
|
12
11
|
}
|
|
13
12
|
return `${utility_1.words.getNumberTense(value)} ${all}`;
|
|
14
13
|
}, Info = ({ shown, total, one, all }) => (react_1.default.createElement("div", { className: "text-muted" },
|
|
15
|
-
`${
|
|
16
|
-
shown === total ? `${
|
|
14
|
+
`${utility_1.words.Showing} `,
|
|
15
|
+
shown === total ? `${utility_1.words.All} - ` : `${shown} ${utility_1.words.Of}`,
|
|
17
16
|
` ${getNumberForm(total, one, all)}`));
|
|
18
17
|
exports.default = Info;
|
|
19
18
|
//# sourceMappingURL=Info.js.map
|
package/lib/Info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Info.js","sourceRoot":"","sources":["../src/Info.tsx"],"names":[],"mappings":";;;;;AAOA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"Info.js","sourceRoot":"","sources":["../src/Info.tsx"],"names":[],"mappings":";;;;;AAOA,kDAA0B;AAC1B,yCAAoC;AAEpC,MACE,aAAa,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE;IAClE,IAAI,KAAK,KAAK,CAAC,EAAE;QACf,OAAO,KAAK,GAAG,EAAE,CAAC;KACnB;IAED,OAAO,GAAG,eAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;AACjD,CAAC,EAED,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAiB,EAAE,EAAE,CAAC,CACpD,uCAAK,SAAS,EAAC,YAAY;IACxB,GAAG,eAAK,CAAC,OAAO,GAAG;IACnB,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,eAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,eAAK,CAAC,EAAE,EAAE;IAC5D,IAAI,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CACjC,CACP,CAAC;AAEJ,kBAAe,IAAI,CAAC"}
|
package/lib/LoadDataItem.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ declare type LoadDataItemPropTypes = {
|
|
|
9
9
|
shouldFetch: any;
|
|
10
10
|
fetchItem: () => void;
|
|
11
11
|
};
|
|
12
|
-
declare
|
|
12
|
+
declare const _default: import("react-redux").ConnectedComponent<(props: LoadDataItemPropTypes) => any, {
|
|
13
|
+
children: React.ReactNode;
|
|
13
14
|
id: string;
|
|
14
15
|
settings: {
|
|
15
16
|
selectors: any;
|
|
@@ -18,6 +19,7 @@ declare type OwnProps = {
|
|
|
18
19
|
manageEntity: any;
|
|
19
20
|
normalizeDataItem: any;
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
|
|
23
|
+
store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
|
|
24
|
+
}>;
|
|
23
25
|
export default _default;
|
package/lib/LoadDataItem.js
CHANGED
|
@@ -22,15 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const React = __importStar(require("react"));
|
|
30
27
|
const react_redux_1 = require("react-redux");
|
|
31
28
|
const Messages_1 = require("x25/Messages");
|
|
29
|
+
const utility_1 = require("x25/utility");
|
|
32
30
|
const actions_1 = require("./actions");
|
|
33
|
-
const words_1 = __importDefault(require("./words"));
|
|
34
31
|
const mapStateToProps = (state, { settings: { selectors, }, id, }) => ({
|
|
35
32
|
data: selectors.getItem(state, id),
|
|
36
33
|
hasError: selectors.getItemHasError(state, id),
|
|
@@ -49,10 +46,10 @@ const mapStateToProps = (state, { settings: { selectors, }, id, }) => ({
|
|
|
49
46
|
}
|
|
50
47
|
}, [shouldFetch, isFetching, hasError]);
|
|
51
48
|
if (isFetching) {
|
|
52
|
-
return React.createElement(Messages_1.LoadingMessage, { message:
|
|
49
|
+
return React.createElement(Messages_1.LoadingMessage, { message: utility_1.words.LoadingData });
|
|
53
50
|
}
|
|
54
51
|
if (hasError) {
|
|
55
|
-
return React.createElement(Messages_1.LargeErrorMessage, { message:
|
|
52
|
+
return React.createElement(Messages_1.LargeErrorMessage, { message: utility_1.words.ThereWasAProblem, onRetry: fetchItem });
|
|
56
53
|
}
|
|
57
54
|
if (data.size === 0) {
|
|
58
55
|
return null;
|
package/lib/LoadDataItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadDataItem.js","sourceRoot":"","sources":["../src/LoadDataItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoadDataItem.js","sourceRoot":"","sources":["../src/LoadDataItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAsB/B,6CAAsC;AACtC,2CAAiE;AACjE,yCAAoC;AACpC,uCAAyD;AAEzD,MACE,eAAe,GAAG,CAAC,KAAU,EAAE,EAC7B,QAAQ,EAAE,EACR,SAAS,GACV,EACD,EAAE,GACO,EAAE,EAAE,CAAC,CAAC;IACf,IAAI,EAAU,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IAC1C,QAAQ,EAAM,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC;IAClD,OAAO,EAAO,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,CAAC;IACnD,UAAU,EAAI,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,EAAE,CAAC;IACxD,WAAW,EAAG,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,EAAE,CAAC;CAC1D,CAAC,EACF,kBAAkB,GAAG,CAAC,QAAa,EAAE,EACnC,EAAE,EACF,QAAQ,GACC,EAAE,EAAE,CAAC,CAAC;IACf,SAAS;QACP,QAAQ,CAAC,IAAA,mBAAe,kCACnB,QAAQ,KACX,EAAE,IACF,CAAC,CAAC;IACN,CAAC;CACF,CAAC,EAEF,YAAY,GAAG,CAAC,KAA4B,EAAQ,EAAE;IACpD,MAAM,EACJ,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,GACV,GAAG,KAAK,CAAC;IAEV,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,WAAW,EAAE;YACf,SAAS,EAAE,CAAC;SACb;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExC,IAAI,UAAU,EAAE;QACd,OAAO,oBAAC,yBAAc,IAAC,OAAO,EAAE,eAAK,CAAC,WAAW,GAAI,CAAC;KACvD;IAED,IAAI,QAAQ,EAAE;QACZ,OAAO,oBAAC,4BAAiB,IAAC,OAAO,EAAE,eAAK,CAAC,gBAAgB,EAAE,OAAO,EAAE,SAAS,GAAI,CAAC;KACnF;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEJ,kBAAe,IAAA,qBAAO,EAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,YAAY,CAAC,CAAC"}
|
package/lib/LoadPaginator.js
CHANGED
|
@@ -30,9 +30,9 @@ const react_1 = __importStar(require("react"));
|
|
|
30
30
|
const Immutable = __importStar(require("immutable"));
|
|
31
31
|
const react_redux_1 = require("react-redux");
|
|
32
32
|
const Messages_1 = require("x25/Messages");
|
|
33
|
+
const utility_1 = require("x25/utility");
|
|
33
34
|
const selectors_1 = __importDefault(require("./selectors"));
|
|
34
35
|
const LoadingButton_1 = __importDefault(require("./LoadingButton"));
|
|
35
|
-
const words_1 = __importDefault(require("./words"));
|
|
36
36
|
const LoadPaginator = (props) => {
|
|
37
37
|
const { token, settings } = props, { list, entities } = (0, react_redux_1.useSelector)((state) => (selectors_1.default.getPaginators(state, settings.key))), currentPage = selectors_1.default.getCurrentView(list, token), isFetching = selectors_1.default.isPageFetching(list, token, currentPage), isFetched = selectors_1.default.isPageFetched(list, token, currentPage), resultsUpTo = (selectors_1.default.getResultsUpToPage(list, token, entities, currentPage, settings.rowsPerLoad)), items = settings.manipulateItems(resultsUpTo), total = selectors_1.default.getCurrentTotalResultsCount(list, token), hasProblems = selectors_1.default.hasPageProblems(list, token), paginator = Immutable.Map({
|
|
38
38
|
currentPage,
|
|
@@ -59,10 +59,10 @@ const LoadPaginator = (props) => {
|
|
|
59
59
|
}, [shouldFetch]);
|
|
60
60
|
(0, react_1.useEffect)(() => () => resetView(token), []);
|
|
61
61
|
if (items.size === 0 && isFetching) {
|
|
62
|
-
return react_1.default.createElement(Messages_1.LoadingMessage, { message:
|
|
62
|
+
return react_1.default.createElement(Messages_1.LoadingMessage, { message: utility_1.words.LoadingData });
|
|
63
63
|
}
|
|
64
64
|
if (hasProblems && currentPage === 1) {
|
|
65
|
-
return (react_1.default.createElement(Messages_1.LargeErrorMessage, { message:
|
|
65
|
+
return (react_1.default.createElement(Messages_1.LargeErrorMessage, { message: utility_1.words.ThereWasAProblem, onRetry: handleLoadMoreClick }));
|
|
66
66
|
}
|
|
67
67
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
68
68
|
react_1.default.cloneElement(props.children, {
|
package/lib/LoadPaginator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadPaginator.js","sourceRoot":"","sources":["../src/LoadPaginator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,qDAAuC;AACvC,6CAAuD;AACvD,2CAAiE;AACjE,4DAAoC;AACpC,oEAA4C;
|
|
1
|
+
{"version":3,"file":"LoadPaginator.js","sourceRoot":"","sources":["../src/LoadPaginator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,qDAAuC;AACvC,6CAAuD;AACvD,2CAAiE;AACjE,yCAAoC;AACpC,4DAAoC;AACpC,oEAA4C;AAI5C,MACE,aAAa,GAAG,CAAC,KAA8B,EAAE,EAAE;IACjD,MACE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAE3B,EAAE,IAAI,EAAE,QAAQ,EAAE,G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AC;AACJ,CAAC,CAAC;AAEJ,kBAAe,aAAa,CAAC"}
|
package/lib/LoadingButton.js
CHANGED
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const Messages_1 = require("x25/Messages");
|
|
8
|
-
const
|
|
8
|
+
const utility_1 = require("x25/utility");
|
|
9
9
|
const LoadingButton = (props) => {
|
|
10
10
|
const { isFetching, hasProblems, onLoadMoreClick } = props;
|
|
11
11
|
return (react_1.default.createElement("div", { className: "text-center my-2" },
|
|
12
|
-
hasProblems ? react_1.default.createElement(Messages_1.ErrorMessage, { message:
|
|
13
|
-
isFetching ? react_1.default.createElement(Messages_1.LoadingMessage, { message:
|
|
12
|
+
hasProblems ? react_1.default.createElement(Messages_1.ErrorMessage, { message: utility_1.words.ThereWasAProblem }) : null,
|
|
13
|
+
isFetching ? react_1.default.createElement(Messages_1.LoadingMessage, { message: utility_1.words.LoadingData, sm: true }) : (react_1.default.createElement("button", { className: "btn btn-outline-info d-print-none", disabled: isFetching, onClick: onLoadMoreClick, type: "button" }, isFetching ? utility_1.words.LoadingData : utility_1.words.LoadMore))));
|
|
14
14
|
};
|
|
15
15
|
exports.default = LoadingButton;
|
|
16
16
|
//# sourceMappingURL=LoadingButton.js.map
|
package/lib/LoadingButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingButton.js","sourceRoot":"","sources":["../src/LoadingButton.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,2CAA4D;AAO5D,
|
|
1
|
+
{"version":3,"file":"LoadingButton.js","sourceRoot":"","sources":["../src/LoadingButton.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,2CAA4D;AAO5D,yCAAoC;AAEpC,MAAM,aAAa,GAAG,CAAC,KAA8B,EAAE,EAAE;IACvD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE3D,OAAO,CACL,uCAAK,SAAS,EAAC,kBAAkB;QAC9B,WAAW,CAAC,CAAC,CAAC,8BAAC,uBAAY,IAAC,OAAO,EAAE,eAAK,CAAC,gBAAgB,GAAI,CAAC,CAAC,CAAC,IAAI;QACtE,UAAU,CAAC,CAAC,CAAC,8BAAC,yBAAc,IAAC,OAAO,EAAE,eAAK,CAAC,WAAW,EAAE,EAAE,SAAG,CAAC,CAAC,CAAC,CAChE,0CACE,SAAS,EAAC,mCAAmC,EAC7C,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,QAAQ,IACZ,UAAU,CAAC,CAAC,CAAC,eAAK,CAAC,WAAW,CAAC,CAAC,CAAC,eAAK,CAAC,QAAQ,CACzC,CACV,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|
package/lib/reducerOperations.js
CHANGED
|
@@ -26,7 +26,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.receivePageItems = exports.resetView = exports.changeView = exports.performChangeView = exports.receivePage = exports.requestPage = void 0;
|
|
27
27
|
const Immutable = __importStar(require("immutable"));
|
|
28
28
|
const requestPage = (state, action) => {
|
|
29
|
-
const { payload: { token, page
|
|
29
|
+
const { payload: { token, page } } = action,
|
|
30
|
+
// it is the type any because ts apparently has a problem
|
|
31
|
+
elements = Immutable.Map({
|
|
30
32
|
page,
|
|
31
33
|
error: false,
|
|
32
34
|
fetching: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducerOperations.js","sourceRoot":"","sources":["../src/reducerOperations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAUvC,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAE,MAAyB,EAAE,EAAE;IACjE,
|
|
1
|
+
{"version":3,"file":"re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KAAiB,EAAE,MAAyB,EAAE,EAAE;IAClE,MACE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,EAC1B,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,EACjC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI,EAC9B,MAAM,GAAG,OAAO,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAC3D,CAAC,IAAU,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CACpC,EACD,QAAQ,GAAG,YAAY,CAAC,MAAM,CAC5B,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAClB,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAC9D,EAAE,SAAS,CAAC,GAAG,EAAE,CACnB,CAAC;IAEJ,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEK,kCAAW;AAAE,kCAAW;AAAE,8CAAiB;AAAE,gCAAU;AAAE,8BAAS;AAAE,4CAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redux-paginator-immutable",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.39",
|
|
4
4
|
"types": "./lib/index.d.ts",
|
|
5
5
|
"description": "redux-paginator-immutable helps you deal with paginated API by composing your existing reducers",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
},
|
|
77
77
|
"homepage": "https://github.com/cristian-sima/redux-paginator-immutable#readme",
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@babel/preset-env": "^7.
|
|
80
|
-
"@babel/preset-typescript": "^7.
|
|
79
|
+
"@babel/preset-env": "^7.19.4",
|
|
80
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
81
81
|
"@types/superagent": "^4.1.15",
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
83
|
-
"@typescript-eslint/parser": "^5.
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
|
83
|
+
"@typescript-eslint/parser": "^5.41.0",
|
|
84
84
|
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
|
85
85
|
"babel-polyfill": "^6.26.0",
|
|
86
86
|
"chai": "^4.3.4",
|
|
@@ -88,28 +88,28 @@
|
|
|
88
88
|
"codecov": "^3.8.1",
|
|
89
89
|
"depcheck": "^1.4.3",
|
|
90
90
|
"es3ify": "^0.2.2",
|
|
91
|
-
"eslint": "^8.
|
|
91
|
+
"eslint": "^8.26.0",
|
|
92
92
|
"eslint-plugin-import": "^2.26.0",
|
|
93
|
-
"eslint-plugin-react": "^7.
|
|
93
|
+
"eslint-plugin-react": "^7.31.10",
|
|
94
94
|
"expect": "^28.1.0",
|
|
95
95
|
"flux-standard-action": "^2.1.1",
|
|
96
96
|
"glob": "^8.0.3",
|
|
97
97
|
"isparta": "^4.1.1",
|
|
98
|
-
"mocha": "^10.
|
|
98
|
+
"mocha": "^10.1.0",
|
|
99
99
|
"npm-check": "^5.9.2",
|
|
100
100
|
"rimraf": "^3.0.2",
|
|
101
101
|
"ts-mocha": "^10.0.0",
|
|
102
102
|
"typescript": "^4.6.4",
|
|
103
|
-
"webpack": "^5.
|
|
103
|
+
"webpack": "^5.74.0"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"immutable": "
|
|
106
|
+
"immutable": "^3.8.2",
|
|
107
107
|
"query-string": "^7.1.1",
|
|
108
108
|
"react": "^17.0.2",
|
|
109
|
-
"react-redux": "^8.0.
|
|
109
|
+
"react-redux": "^8.0.4",
|
|
110
110
|
"redux": "^4.2.0",
|
|
111
|
-
"reselect": "^4.1.
|
|
111
|
+
"reselect": "^4.1.6",
|
|
112
112
|
"superagent": "^7.1.3",
|
|
113
|
-
"x25": "^17.
|
|
113
|
+
"x25": "^17.3.2"
|
|
114
114
|
}
|
|
115
|
-
}
|
|
115
|
+
}
|
package/src/Info.tsx
CHANGED
|
@@ -6,8 +6,7 @@ type InfoPropTypes = {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
|
-
import { words
|
|
10
|
-
import words from "./words";
|
|
9
|
+
import { words } from "x25/utility";
|
|
11
10
|
|
|
12
11
|
const
|
|
13
12
|
getNumberForm = (value: number, one: string, all: string): string => {
|
|
@@ -15,7 +14,7 @@ const
|
|
|
15
14
|
return `1 ${one}`;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
return `${
|
|
17
|
+
return `${words.getNumberTense(value)} ${all}`;
|
|
19
18
|
},
|
|
20
19
|
|
|
21
20
|
Info = ({ shown, total, one, all }: InfoPropTypes) => (
|
package/src/LoadDataItem.tsx
CHANGED
|
@@ -22,8 +22,8 @@ type OwnProps = {
|
|
|
22
22
|
};
|
|
23
23
|
import { connect } from "react-redux";
|
|
24
24
|
import { LargeErrorMessage, LoadingMessage } from "x25/Messages";
|
|
25
|
+
import { words } from "x25/utility";
|
|
25
26
|
import { fetchItem as fetchItemAction } from "./actions";
|
|
26
|
-
import words from "./words";
|
|
27
27
|
|
|
28
28
|
const
|
|
29
29
|
mapStateToProps = (state: any, {
|
package/src/LoadPaginator.tsx
CHANGED
|
@@ -2,9 +2,9 @@ import React, { useEffect } from "react";
|
|
|
2
2
|
import * as Immutable from "immutable";
|
|
3
3
|
import { useDispatch, useSelector } from "react-redux";
|
|
4
4
|
import { LargeErrorMessage, LoadingMessage } from "x25/Messages";
|
|
5
|
+
import { words } from "x25/utility";
|
|
5
6
|
import selectors from "./selectors";
|
|
6
7
|
import LoadingButton from "./LoadingButton";
|
|
7
|
-
import words from "./words";
|
|
8
8
|
|
|
9
9
|
import { ChangeView, List, LoadData, LoadPaginatorPropTypes, ResetView } from "./LoadPaginatorTypes";
|
|
10
10
|
|
package/src/LoadingButton.tsx
CHANGED
|
@@ -6,7 +6,7 @@ type LoadingButtonPropTypes = {
|
|
|
6
6
|
hasProblems: boolean;
|
|
7
7
|
onLoadMoreClick: () => void;
|
|
8
8
|
};
|
|
9
|
-
import words from "
|
|
9
|
+
import { words } from "x25/utility";
|
|
10
10
|
|
|
11
11
|
const LoadingButton = (props : LoadingButtonPropTypes) => {
|
|
12
12
|
const { isFetching, hasProblems, onLoadMoreClick } = props;
|
package/src/reducerOperations.ts
CHANGED
|
@@ -9,13 +9,10 @@ import type {
|
|
|
9
9
|
} from "./types";
|
|
10
10
|
|
|
11
11
|
const requestPage = (state: PagesState, action: RequestPageAction) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
} = action,
|
|
18
|
-
elements = Immutable.Map({
|
|
12
|
+
const
|
|
13
|
+
{ payload: { token, page } } = action,
|
|
14
|
+
// it is the type any because ts apparently has a problem
|
|
15
|
+
elements : any = Immutable.Map({
|
|
19
16
|
page,
|
|
20
17
|
error : false,
|
|
21
18
|
fetching : true,
|
package/lib/words.d.ts
DELETED
package/lib/words.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const words = {
|
|
4
|
-
ThereWasAProblem: "There was a problem. Try again",
|
|
5
|
-
Showing: "Showing",
|
|
6
|
-
All: "all",
|
|
7
|
-
Of: "of",
|
|
8
|
-
LoadingData: "Loading data...",
|
|
9
|
-
LoadMore: "Load more",
|
|
10
|
-
};
|
|
11
|
-
exports.default = words;
|
|
12
|
-
//# sourceMappingURL=words.js.map
|
package/lib/words.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"words.js","sourceRoot":"","sources":["../src/words.ts"],"names":[],"mappings":";;AAAA,MAAM,KAAK,GAAG;IACZ,gBAAgB,EAAG,gCAAgC;IACnD,OAAO,EAAY,SAAS;IAC5B,GAAG,EAAgB,KAAK;IACxB,EAAE,EAAiB,IAAI;IACvB,WAAW,EAAQ,iBAAiB;IACpC,QAAQ,EAAW,WAAW;CAC/B,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|