x25 17.0.18 → 17.0.22
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/Account/Load.d.ts +13 -0
- package/Account/Load.js +46 -0
- package/Account/Load.js.map +1 -0
- package/Account/actions.d.ts +2 -0
- package/Account/actions.js +10 -0
- package/Account/actions.js.map +1 -0
- package/Account/index.d.ts +3 -0
- package/Account/index.js +31 -0
- package/Account/index.js.map +1 -0
- package/Account/reducer.d.ts +26 -0
- package/Account/reducer.js +76 -0
- package/Account/reducer.js.map +1 -0
- package/Account/request.d.ts +1 -0
- package/Account/request.js +51 -0
- package/Account/request.js.map +1 -0
- package/Async/InitModule.d.ts +4 -0
- package/Async/InitModule.js +133 -0
- package/Async/InitModule.js.map +1 -0
- package/Async/RouteLoading.d.ts +9 -0
- package/Async/RouteLoading.js +40 -0
- package/Async/RouteLoading.js.map +1 -0
- package/Async/SimulatedException.d.ts +8 -0
- package/Async/SimulatedException.js +38 -0
- package/Async/SimulatedException.js.map +1 -0
- package/Async/index.d.ts +4 -0
- package/Async/index.js +86 -0
- package/Async/index.js.map +1 -0
- package/Async/types.d.ts +24 -0
- package/Async/types.js +3 -0
- package/Async/types.js.map +1 -0
- package/Inputs/Business/BankAccount.d.ts +11 -0
- package/Inputs/Business/BankAccount.js +32 -0
- package/Inputs/Business/BankAccount.js.map +1 -0
- package/Inputs/Business/BankName.d.ts +11 -0
- package/Inputs/Business/BankName.js +32 -0
- package/Inputs/Business/BankName.js.map +1 -0
- package/Inputs/Business/Email.d.ts +4 -0
- package/Inputs/Business/Email.js +26 -0
- package/Inputs/Business/Email.js.map +1 -0
- package/Inputs/Business/Phone.d.ts +4 -0
- package/Inputs/Business/Phone.js +26 -0
- package/Inputs/Business/Phone.js.map +1 -0
- package/Inputs/Business/index.d.ts +5 -0
- package/Inputs/Business/index.js +15 -0
- package/Inputs/Business/index.js.map +1 -0
- package/Inputs/CaptchaBox.d.ts +18 -0
- package/Inputs/CaptchaBox.js +77 -0
- package/Inputs/CaptchaBox.js.map +1 -0
- package/Inputs/DateInput.d.ts +36 -0
- package/Inputs/DateInput.js +115 -0
- package/Inputs/DateInput.js.map +1 -0
- package/Inputs/DateTemplate.d.ts +39 -0
- package/Inputs/DateTemplate.js +121 -0
- package/Inputs/DateTemplate.js.map +1 -0
- package/Inputs/DelayInputChange.d.ts +24 -0
- package/Inputs/DelayInputChange.js +101 -0
- package/Inputs/DelayInputChange.js.map +1 -0
- package/Inputs/FocusTemplate.d.ts +19 -0
- package/Inputs/FocusTemplate.js +53 -0
- package/Inputs/FocusTemplate.js.map +1 -0
- package/Inputs/InputTemplate.d.ts +21 -0
- package/Inputs/InputTemplate.js +32 -0
- package/Inputs/InputTemplate.js.map +1 -0
- package/Inputs/LabelTemplate.d.ts +14 -0
- package/Inputs/LabelTemplate.js +29 -0
- package/Inputs/LabelTemplate.js.map +1 -0
- package/Inputs/NumericInput.d.ts +39 -0
- package/Inputs/NumericInput.js +76 -0
- package/Inputs/NumericInput.js.map +1 -0
- package/Inputs/NumericTemplate.d.ts +44 -0
- package/Inputs/NumericTemplate.js +74 -0
- package/Inputs/NumericTemplate.js.map +1 -0
- package/Inputs/Selects/Custom.d.ts +23 -0
- package/Inputs/Selects/Custom.js +28 -0
- package/Inputs/Selects/Custom.js.map +1 -0
- package/Inputs/Selects/Simple.d.ts +21 -0
- package/Inputs/Selects/Simple.js +36 -0
- package/Inputs/Selects/Simple.js.map +1 -0
- package/Inputs/Selects/index.d.ts +5 -0
- package/Inputs/Selects/index.js +28 -0
- package/Inputs/Selects/index.js.map +1 -0
- package/Inputs/SimpleInput.d.ts +14 -0
- package/Inputs/SimpleInput.js +27 -0
- package/Inputs/SimpleInput.js.map +1 -0
- package/Inputs/SimpleTextarea.d.ts +19 -0
- package/Inputs/SimpleTextarea.js +25 -0
- package/Inputs/SimpleTextarea.js.map +1 -0
- package/Inputs/TextareaTemplate.d.ts +20 -0
- package/Inputs/TextareaTemplate.js +32 -0
- package/Inputs/TextareaTemplate.js.map +1 -0
- package/Inputs/Tooltip.d.ts +18 -0
- package/Inputs/Tooltip.js +52 -0
- package/Inputs/Tooltip.js.map +1 -0
- package/Inputs/index.d.ts +15 -0
- package/Inputs/index.js +28 -0
- package/Inputs/index.js.map +1 -0
- package/Messages/Error.d.ts +10 -0
- package/Messages/Error.js +35 -0
- package/Messages/Error.js.map +1 -0
- package/Messages/Loading.d.ts +8 -0
- package/Messages/Loading.js +32 -0
- package/Messages/Loading.js.map +1 -0
- package/Messages/index.d.ts +2 -0
- package/Messages/index.js +15 -0
- package/Messages/index.js.map +1 -0
- package/Modal/Delete.d.ts +42 -0
- package/Modal/Delete.js +156 -0
- package/Modal/Delete.js.map +1 -0
- package/Modal/Root.d.ts +10 -0
- package/Modal/Root.js +63 -0
- package/Modal/Root.js.map +1 -0
- package/Modal/SimpleModal.d.ts +11 -0
- package/Modal/SimpleModal.js +32 -0
- package/Modal/SimpleModal.js.map +1 -0
- package/Modal/actions.d.ts +2 -0
- package/Modal/actions.js +8 -0
- package/Modal/actions.js.map +1 -0
- package/Modal/getComponent.d.ts +2 -0
- package/Modal/getComponent.js +21 -0
- package/Modal/getComponent.js.map +1 -0
- package/Modal/index.d.ts +4 -0
- package/Modal/index.js +13 -0
- package/Modal/index.js.map +1 -0
- package/Modal/reducer.d.ts +6 -0
- package/Modal/reducer.js +45 -0
- package/Modal/reducer.js.map +1 -0
- package/Modal/types.d.ts +2 -0
- package/Modal/types.js +3 -0
- package/Modal/types.js.map +1 -0
- package/Modal/util.d.ts +3 -0
- package/Modal/util.js +22 -0
- package/Modal/util.js.map +1 -0
- package/Things.d.ts +3 -0
- package/Things.js +22 -0
- package/Things.js.map +1 -0
- package/actions.d.ts +11 -0
- package/actions.js +50 -0
- package/actions.js.map +1 -0
- package/config.d.ts +2 -0
- package/config.js +9 -0
- package/config.js.map +1 -0
- package/dev/ErrorBoundary.d.ts +22 -0
- package/dev/ErrorBoundary.js +77 -0
- package/dev/ErrorBoundary.js.map +1 -0
- package/dev/TheError.d.ts +11 -0
- package/dev/TheError.js +34 -0
- package/dev/TheError.js.map +1 -0
- package/dev/index.d.ts +2 -0
- package/dev/index.js +102 -0
- package/dev/index.js.map +1 -0
- package/dev/types.d.ts +8 -0
- package/dev/types.js +3 -0
- package/dev/types.js.map +1 -0
- package/index.d.ts +0 -0
- package/index.js +2 -0
- package/index.js.map +1 -0
- package/package.json +14 -19
- package/prod/SentryErrorBoundary.d.ts +17 -0
- package/prod/SentryErrorBoundary.js +95 -0
- package/prod/SentryErrorBoundary.js.map +1 -0
- package/reducer/captchas.d.ts +6 -0
- package/reducer/captchas.js +45 -0
- package/reducer/captchas.js.map +1 -0
- package/reducer/index.d.ts +31 -0
- package/reducer/index.js +49 -0
- package/reducer/index.js.map +1 -0
- package/reducer/module.d.ts +6 -0
- package/reducer/module.js +42 -0
- package/reducer/module.js.map +1 -0
- package/types/index.d.ts +21 -0
- package/types/index.js +3 -0
- package/types/index.js.map +1 -0
- package/utility/calendar.d.ts +15 -0
- package/utility/calendar.js +33 -0
- package/utility/calendar.js.map +1 -0
- package/utility/date.d.ts +13 -0
- package/utility/date.js +68 -0
- package/utility/date.js.map +1 -0
- package/utility/index.d.ts +10 -0
- package/utility/index.js +23 -0
- package/utility/index.js.map +1 -0
- package/utility/mql.d.ts +1 -0
- package/utility/mql.js +5 -0
- package/utility/mql.js.map +1 -0
- package/utility/normalize-test.d.ts +1 -0
- package/utility/normalize-test.js +64 -0
- package/utility/normalize-test.js.map +1 -0
- package/utility/normalize.d.ts +21 -0
- package/utility/normalize.js +66 -0
- package/utility/normalize.js.map +1 -0
- package/utility/numbers.d.ts +4 -0
- package/utility/numbers.js +37 -0
- package/utility/numbers.js.map +1 -0
- package/utility/numeric.d.ts +5 -0
- package/utility/numeric.js +59 -0
- package/utility/numeric.js.map +1 -0
- package/utility/others.d.ts +16 -0
- package/utility/others.js +36 -0
- package/utility/others.js.map +1 -0
- package/utility/strings-test.d.ts +1 -0
- package/utility/strings-test.js +121 -0
- package/utility/strings-test.js.map +1 -0
- package/utility/strings.d.ts +5 -0
- package/utility/strings.js +40 -0
- package/utility/strings.js.map +1 -0
- package/utility/validation/common.d.ts +61 -0
- package/utility/validation/common.js +169 -0
- package/utility/validation/common.js.map +1 -0
- package/utility/validation/index.d.ts +15 -0
- package/utility/validation/index.js +72 -0
- package/utility/validation/index.js.map +1 -0
- package/utility/validation/specific.d.ts +4 -0
- package/utility/validation/specific.js +10 -0
- package/utility/validation/specific.js.map +1 -0
- package/utility/validation/validate/date.d.ts +2 -0
- package/utility/validation/validate/date.js +44 -0
- package/utility/validation/validate/date.js.map +1 -0
- package/utility/validation/validate/email-test.d.ts +1 -0
- package/utility/validation/validate/email-test.js +25 -0
- package/utility/validation/validate/email-test.js.map +1 -0
- package/utility/validation/validate/email.d.ts +1 -0
- package/utility/validation/validate/email.js +9 -0
- package/utility/validation/validate/email.js.map +1 -0
- package/utility/validation/validate/index.d.ts +2 -0
- package/utility/validation/validate/index.js +15 -0
- package/utility/validation/validate/index.js.map +1 -0
- package/utility/words.d.ts +108 -0
- package/utility/words.js +161 -0
- package/utility/words.js.map +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare type PropTypes = {
|
|
2
|
+
readonly appName: string;
|
|
3
|
+
readonly isFetching: boolean;
|
|
4
|
+
readonly hasError: boolean;
|
|
5
|
+
readonly data: any;
|
|
6
|
+
readonly children: any;
|
|
7
|
+
readonly shouldFetch: any;
|
|
8
|
+
readonly fetchInitialInformation: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("react-redux").ConnectedComponent<(props: PropTypes) => any, import("react-redux").Omit<PropTypes, "data" | "hasError" | "isFetching" | "shouldFetch" | "fetchInitialInformation"> & {
|
|
11
|
+
appName: string;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
package/Account/Load.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var react_redux_1 = require("react-redux");
|
|
8
|
+
var utility_1 = require("../utility");
|
|
9
|
+
var Messages_1 = require("../Messages");
|
|
10
|
+
var reducer_1 = require("./reducer");
|
|
11
|
+
var actions_1 = require("./actions");
|
|
12
|
+
var mapStateToProps = function (state) { return ({
|
|
13
|
+
data: reducer_1.selectors.getCurrentAccount(state),
|
|
14
|
+
hasError: reducer_1.selectors.getCurrentAccountHasError(state),
|
|
15
|
+
fetched: reducer_1.selectors.getCurrentAccountIsFetched(state),
|
|
16
|
+
isFetching: reducer_1.selectors.getCurrentAccountIsFetching(state),
|
|
17
|
+
shouldFetch: reducer_1.selectors.getCurrentAccountShouldFetch(state),
|
|
18
|
+
}); }, mapDispatchToProps = function (dispatch, _a) {
|
|
19
|
+
var appName = _a.appName;
|
|
20
|
+
return ({
|
|
21
|
+
fetchInitialInformation: function () {
|
|
22
|
+
setTimeout(function () {
|
|
23
|
+
dispatch((0, actions_1.fetchInitialInformation)(appName));
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}, LoadAccount = function (props) {
|
|
28
|
+
var children = props.children, data = props.data, isFetching = props.isFetching, shouldFetch = props.shouldFetch, hasError = props.hasError, fetchInitialInformation = props.fetchInitialInformation;
|
|
29
|
+
react_1.default.useEffect(function () {
|
|
30
|
+
if (shouldFetch) {
|
|
31
|
+
fetchInitialInformation();
|
|
32
|
+
}
|
|
33
|
+
}, [shouldFetch, isFetching, hasError]);
|
|
34
|
+
if (isFetching) {
|
|
35
|
+
return react_1.default.createElement(Messages_1.LoadingMessage, { message: utility_1.words.PleaseWait });
|
|
36
|
+
}
|
|
37
|
+
if (hasError) {
|
|
38
|
+
return react_1.default.createElement(Messages_1.LargeErrorMessage, { message: utility_1.words.ThereWasAProblem, onRetry: fetchInitialInformation });
|
|
39
|
+
}
|
|
40
|
+
if (data.size === 0) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return children;
|
|
44
|
+
};
|
|
45
|
+
exports.default = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(LoadAccount);
|
|
46
|
+
//# sourceMappingURL=Load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Load.js","sourceRoot":"","sources":["../../src/Account/Load.tsx"],"names":[],"mappings":";;;;;AAWA,gDAA0B;AAC1B,2CAAsC;AACtC,sCAAmC;AACnC,wCAAgE;AAChE,qCAAsC;AACtC,qCAAqF;AAErF,IAAM,eAAe,GAAG,UAAC,KAAY,IAAK,OAAA,CAAC;IACvC,IAAI,EAAU,mBAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC;IAChD,QAAQ,EAAM,mBAAS,CAAC,yBAAyB,CAAC,KAAK,CAAC;IACxD,OAAO,EAAO,mBAAS,CAAC,0BAA0B,CAAC,KAAK,CAAC;IACzD,UAAU,EAAI,mBAAS,CAAC,2BAA2B,CAAC,KAAK,CAAC;IAC1D,WAAW,EAAG,mBAAS,CAAC,4BAA4B,CAAC,KAAK,CAAC;CAC5D,CAAC,EANsC,CAMtC,EACF,kBAAkB,GAAG,UAAC,QAAkB,EAAE,EAElB;QADtB,OAAO,aAAA;IACoB,OAAA,CAAC;QAC5B,uBAAuB;YACrB,UAAU,CAAC;gBACT,QAAQ,CAAC,IAAA,iCAA6B,EAAC,OAAO,CAAC,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACL,CAAC;KAEF,CAAC;AAP2B,CAO3B,EAEF,WAAW,GAAG,UAAC,KAAgB;IAE3B,IAAA,QAAQ,GAMN,KAAK,SANC,EACR,IAAI,GAKF,KAAK,KALH,EACJ,UAAU,GAIR,KAAK,WAJG,EACV,WAAW,GAGT,KAAK,YAHI,EACX,QAAQ,GAEN,KAAK,SAFC,EACR,uBAAuB,GACrB,KAAK,wBADgB,CACf;IAEV,eAAK,CAAC,SAAS,CAAC;QACd,IAAI,WAAW,EAAE;YACf,uBAAuB,EAAE,CAAC;SAC3B;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExC,IAAI,UAAU,EAAE;QACd,OAAO,8BAAC,yBAAc,IAAC,OAAO,EAAE,eAAK,CAAC,UAAU,GAAI,CAAC;KACtD;IAED,IAAI,QAAQ,EAAE;QACZ,OAAO,8BAAC,4BAAiB,IAAC,OAAO,EAAE,eAAK,CAAC,gBAAgB,EAAE,OAAO,EAAE,uBAAuB,GAAI,CAAC;KACjG;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,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchInitialInformation = void 0;
|
|
4
|
+
var request_1 = require("./request");
|
|
5
|
+
var fetchInitialInformation = function (appName) { return ({
|
|
6
|
+
type: "FETCH_INITIAL_INFORMATION",
|
|
7
|
+
payload: (0, request_1.fetchInitialInformation)(appName),
|
|
8
|
+
}); };
|
|
9
|
+
exports.fetchInitialInformation = fetchInitialInformation;
|
|
10
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/Account/actions.ts"],"names":[],"mappings":";;;AACA,qCAAsF;AAE/E,IAAM,uBAAuB,GAAG,UAAC,OAAe,IAAa,OAAA,CAAC;IACnE,IAAI,EAAM,2BAA2B;IACrC,OAAO,EAAG,IAAA,iCAA8B,EAAC,OAAO,CAAC;CAClD,CAAC,EAHkE,CAGlE,CAAC;AAHU,QAAA,uBAAuB,2BAGjC"}
|
package/Account/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.LoadAccount = exports.accountReducer = exports.accountSelectors = void 0;
|
|
26
|
+
var reducer_1 = __importStar(require("./reducer"));
|
|
27
|
+
exports.accountReducer = reducer_1.default;
|
|
28
|
+
Object.defineProperty(exports, "accountSelectors", { enumerable: true, get: function () { return reducer_1.selectors; } });
|
|
29
|
+
var Load_1 = __importDefault(require("./Load"));
|
|
30
|
+
exports.LoadAccount = Load_1.default;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA0E;AAG/C,yBAHpB,iBAAc,CAGoB;AAAhC,iGAH6B,mBAAgB,OAG7B;AAFzB,gDAAiC;AAEU,sBAFpC,cAAW,CAEoC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Action, State } from "src/types";
|
|
2
|
+
declare const reducer: (state: any, action: Action) => any;
|
|
3
|
+
export declare const selectors: {
|
|
4
|
+
getCurrentAccountCompanies: (state: State) => any;
|
|
5
|
+
getCurrentAccount: (state: State) => any;
|
|
6
|
+
getCurrentAccountIsFetching: (state: State) => any;
|
|
7
|
+
getCurrentAccountShouldFetch: ((state: {}) => boolean) & import("reselect").OutputSelectorFields<(args_0: any, args_1: any, args_2: any) => boolean & {
|
|
8
|
+
clearCache: () => void;
|
|
9
|
+
}> & {
|
|
10
|
+
clearCache: () => void;
|
|
11
|
+
};
|
|
12
|
+
getCurrentAccountIsFetched: ((state: {}) => any) & import("reselect").OutputSelectorFields<(args_0: any, args_1: any, args_2: any) => any> & {
|
|
13
|
+
clearCache: () => void;
|
|
14
|
+
};
|
|
15
|
+
getCurrentAccountHasError: ((state: {}) => boolean) & import("reselect").OutputSelectorFields<(args_0: any) => boolean & {
|
|
16
|
+
clearCache: () => void;
|
|
17
|
+
}> & {
|
|
18
|
+
clearCache: () => void;
|
|
19
|
+
};
|
|
20
|
+
getIsCurrentAccountAdministrator: ((state: {}) => boolean) & import("reselect").OutputSelectorFields<(args_0: any) => boolean & {
|
|
21
|
+
clearCache: () => void;
|
|
22
|
+
}> & {
|
|
23
|
+
clearCache: () => void;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default reducer;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.selectors = void 0;
|
|
23
|
+
var reselect_1 = require("reselect");
|
|
24
|
+
var Immutable = __importStar(require("immutable"));
|
|
25
|
+
var utility_1 = require("../utility");
|
|
26
|
+
var initialState = Immutable.Map({
|
|
27
|
+
error: utility_1.noError,
|
|
28
|
+
fetched: false,
|
|
29
|
+
fetching: false,
|
|
30
|
+
info: Immutable.Map(),
|
|
31
|
+
companies: Immutable.Map(),
|
|
32
|
+
}), fetchCurrentAccountPending = function (state) { return state.merge({
|
|
33
|
+
error: utility_1.noError,
|
|
34
|
+
fetching: true,
|
|
35
|
+
}); }, fetchCurrentAccountRejected = function (state, _a) {
|
|
36
|
+
var error = _a.payload.error;
|
|
37
|
+
return state.merge({
|
|
38
|
+
error: error,
|
|
39
|
+
fetching: false,
|
|
40
|
+
});
|
|
41
|
+
}, fetchCurrentAccountFulfilled = function (state, _a) {
|
|
42
|
+
var payload = _a.payload;
|
|
43
|
+
return state.mergeDeep({
|
|
44
|
+
fetched: true,
|
|
45
|
+
fetching: false,
|
|
46
|
+
info: payload.Account,
|
|
47
|
+
companies: payload.Companies,
|
|
48
|
+
});
|
|
49
|
+
}, accountChangePassword = function (state) { return state.setIn(["info", "RequireChange"], false); }, accountGaveConsent = function (state) { return state.setIn(["info", "HasToGiveConsent"], false); }, reducer = function (state, action) {
|
|
50
|
+
if (state === void 0) { state = initialState; }
|
|
51
|
+
switch (action.type) {
|
|
52
|
+
case "FETCH_INITIAL_INFORMATION_PENDING":
|
|
53
|
+
return fetchCurrentAccountPending(state);
|
|
54
|
+
case "FETCH_INITIAL_INFORMATION_REJECTED":
|
|
55
|
+
return fetchCurrentAccountRejected(state, action);
|
|
56
|
+
case "FETCH_INITIAL_INFORMATION_FULFILLED":
|
|
57
|
+
return fetchCurrentAccountFulfilled(state, action);
|
|
58
|
+
case "ACCOUNT_CHANGE_PASSWORD":
|
|
59
|
+
return accountChangePassword(state);
|
|
60
|
+
case "ACCOUNT_GAVE_CONSENT":
|
|
61
|
+
return accountGaveConsent(state);
|
|
62
|
+
default:
|
|
63
|
+
return state;
|
|
64
|
+
}
|
|
65
|
+
}, getFetched = function (state) { return state.getIn(["account", "fetched"]); }, getError = function (state) { return state.getIn(["account", "error"]); }, getCurrentAccount = function (state) { return state.getIn(["account", "info"]); }, getCurrentAccountCompanies = function (state) { return state.getIn(["account", "companies"]); }, getCurrentAccountIsFetching = function (state) { return state.getIn(["account", "fetching"]); }, getCurrentAccountShouldFetch = (0, reselect_1.createSelector)(getCurrentAccountIsFetching, getFetched, getError, function (isFetching, isFetched, error) { return !isFetching && !isFetched && error === utility_1.noError; }), getCurrentAccountIsFetched = (0, reselect_1.createSelector)(getCurrentAccountIsFetching, getFetched, getError, function (isFetching, isFetched, error) { return !isFetching && isFetched && error === utility_1.noError; }), getCurrentAccountHasError = (0, reselect_1.createSelector)(getError, function (error) { return error !== utility_1.noError; }), getIsCurrentAccountAdministrator = (0, reselect_1.createSelector)(getCurrentAccount, function (account) { return (0, utility_1.isAdministratorAccount)(account.get("Type")); });
|
|
66
|
+
exports.selectors = {
|
|
67
|
+
getCurrentAccountCompanies: getCurrentAccountCompanies,
|
|
68
|
+
getCurrentAccount: getCurrentAccount,
|
|
69
|
+
getCurrentAccountIsFetching: getCurrentAccountIsFetching,
|
|
70
|
+
getCurrentAccountShouldFetch: getCurrentAccountShouldFetch,
|
|
71
|
+
getCurrentAccountIsFetched: getCurrentAccountIsFetched,
|
|
72
|
+
getCurrentAccountHasError: getCurrentAccountHasError,
|
|
73
|
+
getIsCurrentAccountAdministrator: getIsCurrentAccountAdministrator,
|
|
74
|
+
};
|
|
75
|
+
exports.default = reducer;
|
|
76
|
+
//# sourceMappingURL=reducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../src/Account/reducer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,qCAA0C;AAC1C,mDAAuC;AACvC,sCAA6D;AAE7D,IAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC;IAC/B,KAAK,EAAO,iBAAO;IACnB,OAAO,EAAK,KAAK;IACjB,QAAQ,EAAI,KAAK;IACjB,IAAI,EAAQ,SAAS,CAAC,GAAG,EAAE;IAC3B,SAAS,EAAG,SAAS,CAAC,GAAG,EAAE;CAC5B,CAAC,EAEF,0BAA0B,GAAG,UAAC,KAAU,IAAK,OAAA,KAAK,CAAC,KAAK,CAAC;IACvD,KAAK,EAAM,iBAAO;IAClB,QAAQ,EAAG,IAAI;CAChB,CAAC,EAH2C,CAG3C,EACF,2BAA2B,GAAG,UAAC,KAAU,EAAE,EAIpC;QAFH,KAAK,mBAAA;IAEG,OAAA,KAAK,CAAC,KAAK,CAAC;QACtB,KAAK,OAAA;QACL,QAAQ,EAAE,KAAK;KAChB,CAAC;AAHU,CAGV,EACF,4BAA4B,GAAG,UAAC,K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BAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchInitialInformation: (app: string) => Promise<any>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.fetchInitialInformation = void 0;
|
|
26
|
+
var superagent_1 = __importDefault(require("superagent"));
|
|
27
|
+
var Immutable = __importStar(require("immutable"));
|
|
28
|
+
var utility_1 = require("../utility");
|
|
29
|
+
var normalizeInitialInformation = function (info) {
|
|
30
|
+
var Account = info.Account, IsConnected = info.IsConnected, Counties = info.Counties, Companies = info.Companies;
|
|
31
|
+
return {
|
|
32
|
+
Account: Immutable.Map(Account || {}),
|
|
33
|
+
IsConnected: IsConnected,
|
|
34
|
+
Error: IsConnected ? utility_1.noError : "Not connected",
|
|
35
|
+
Counties: (typeof Counties === "undefined"
|
|
36
|
+
? Immutable.List()
|
|
37
|
+
: (0, utility_1.normalizeArrayByField)(Counties, "Short").entities),
|
|
38
|
+
Companies: (typeof Companies === "undefined"
|
|
39
|
+
? Immutable.List()
|
|
40
|
+
: (0, utility_1.normalizeArray)(Companies).entities),
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
var fetchInitialInformation = function (app) { return new Promise(function (resolve, reject) { return superagent_1.default.
|
|
44
|
+
get("/api/extern/get-initial-information").
|
|
45
|
+
type("form").
|
|
46
|
+
query({
|
|
47
|
+
app: app,
|
|
48
|
+
}).
|
|
49
|
+
end((0, utility_1.withPromiseCallback)(function (response) { return resolve(normalizeInitialInformation(response)); }, reject)); }); };
|
|
50
|
+
exports.fetchInitialInformation = fetchInitialInformation;
|
|
51
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/Account/request.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA+B;AAC/B,mDAAuC;AACvC,sCAAiG;AAEjG,IAAM,2BAA2B,GAAG,UAAC,IAAS;IAE1C,IAAA,OAAO,GAIL,IAAI,QAJC,EACP,WAAW,GAGT,IAAI,YAHK,EACX,QAAQ,GAEN,IAAI,SAFE,EACR,SAAS,GACP,IAAI,UADG,CACF;IAET,OAAO;QACL,OAAO,EAAI,SAAS,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QACvC,WAAW,aAAA;QACX,KAAK,EAAM,WAAW,CAAC,CAAC,CAAC,iBAAO,CAAC,CAAC,CAAC,eAAe;QAClD,QAAQ,EAAG,CACT,OAAO,QAAQ,KAAK,WAAW;YAC7B,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE;YAClB,CAAC,CAAC,IAAA,+BAAqB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CACtD;QACD,SAAS,EAAE,CACT,OAAO,SAAS,KAAK,WAAW;YAC9B,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE;YAClB,CAAC,CAAC,IAAA,wBAAc,EAAC,SAAS,CAAC,CAAC,QAAQ,CACvC;KACF,CAAC;AACJ,CAAC,CAAC;AAEK,IACL,uBAAuB,GAAG,UAAC,GAAW,IAAK,OAC1C,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM,IAAK,OAAA,oBAAK;IACpC,GAAG,CAAC,qCAAqC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC;IACZ,KAAK,CAAC;IACJ,GAAG,KAAA;CACJ,CAAC;IACF,GAAG,CACD,IAAA,6BAAmB,EAAC,UAAC,QAAQ,IAAK,OAAA,OAAO,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC,EAA9C,CAA8C,EAAE,MAAM,CAAC,CAAC,EAP7D,CAO6D,CAC5E,EATwB,CASxB,CAAC;AATpB,QAAA,uBAAuB,2BASH"}
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
31
|
+
}) : (function(o, m, k, k2) {
|
|
32
|
+
if (k2 === undefined) k2 = k;
|
|
33
|
+
o[k2] = m[k];
|
|
34
|
+
}));
|
|
35
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
36
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
37
|
+
}) : function(o, v) {
|
|
38
|
+
o["default"] = v;
|
|
39
|
+
});
|
|
40
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
var redux_injector_1 = require("redux-injector");
|
|
49
|
+
var react_redux_1 = require("react-redux");
|
|
50
|
+
var React = __importStar(require("react"));
|
|
51
|
+
var util_1 = require("../Modal/util");
|
|
52
|
+
var utility_1 = require("../utility");
|
|
53
|
+
var injectPaginator = function (_a) {
|
|
54
|
+
var key = _a.key, itemsReducer = _a.itemsReducer, pagesReducer = _a.pagesReducer;
|
|
55
|
+
(0, redux_injector_1.injectReducer)("entities.".concat(key), itemsReducer);
|
|
56
|
+
(0, redux_injector_1.injectReducer)("paginations.".concat(key), pagesReducer);
|
|
57
|
+
};
|
|
58
|
+
var Loading_1 = require("../Messages/Loading");
|
|
59
|
+
var module_1 = require("../reducer/module");
|
|
60
|
+
var mapStateToProps = function (state, _a) {
|
|
61
|
+
var module = _a.route.default.module;
|
|
62
|
+
return ({
|
|
63
|
+
ready: (0, module_1.getIsModuleReady)(state, module),
|
|
64
|
+
});
|
|
65
|
+
}, mapDispatchToProps = function (dispatch, _a) {
|
|
66
|
+
var route = _a.route;
|
|
67
|
+
return ({
|
|
68
|
+
initModule: function () {
|
|
69
|
+
var _a = route.default, reducers = _a.reducers, modals = _a.modals, paginators = _a.paginators, module = _a.module;
|
|
70
|
+
(0, utility_1.delay)().then(function () {
|
|
71
|
+
if (reducers) {
|
|
72
|
+
if (Array.isArray(reducers)) {
|
|
73
|
+
for (var _i = 0, reducers_1 = reducers; _i < reducers_1.length; _i++) {
|
|
74
|
+
var _a = reducers_1[_i], key = _a.key, func = _a.func;
|
|
75
|
+
(0, redux_injector_1.injectReducer)(key, func);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
var key = reducers.key, func = reducers.func;
|
|
80
|
+
(0, redux_injector_1.injectReducer)(key, func);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}).
|
|
84
|
+
then(function () {
|
|
85
|
+
if (modals) {
|
|
86
|
+
(0, util_1.injectModals)(modals);
|
|
87
|
+
}
|
|
88
|
+
}).
|
|
89
|
+
then(function () {
|
|
90
|
+
if (paginators) {
|
|
91
|
+
if (Array.isArray(paginators)) {
|
|
92
|
+
for (var _i = 0, paginators_1 = paginators; _i < paginators_1.length; _i++) {
|
|
93
|
+
var paginator = paginators_1[_i];
|
|
94
|
+
injectPaginator(paginator);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
injectPaginator(paginators);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}).
|
|
102
|
+
then(function () {
|
|
103
|
+
dispatch((0, module_1.moduleIsReadyAction)(module));
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
var InitModule = /** @class */ (function (_super) {
|
|
109
|
+
__extends(InitModule, _super);
|
|
110
|
+
function InitModule() {
|
|
111
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
112
|
+
}
|
|
113
|
+
InitModule.prototype.componentDidMount = function () {
|
|
114
|
+
if (!this.props.ready) {
|
|
115
|
+
this.props.initModule();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
InitModule.prototype.shouldComponentUpdate = function () {
|
|
119
|
+
return true;
|
|
120
|
+
};
|
|
121
|
+
InitModule.prototype.render = function () {
|
|
122
|
+
var _a = this.props, route = _a.route, ready = _a.ready, props = _a.props, Component = route.default.Component;
|
|
123
|
+
if (ready) {
|
|
124
|
+
return React.createElement(Component, __assign({}, props));
|
|
125
|
+
}
|
|
126
|
+
return (React.createElement("div", { className: "mt-3" },
|
|
127
|
+
React.createElement(Loading_1.LoadingMessage, { message: utility_1.words.PleaseWait })));
|
|
128
|
+
};
|
|
129
|
+
return InitModule;
|
|
130
|
+
}(React.Component));
|
|
131
|
+
var WrapInitModule = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(InitModule), createWrap = function (route, props) { return React.createElement(WrapInitModule, { props: props, route: route }); };
|
|
132
|
+
exports.default = createWrap;
|
|
133
|
+
//# sourceMappingURL=InitModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitModule.js","sourceRoot":"","sources":["../../src/Async/InitModule.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,iDAA+C;AAC/C,2CAAsC;AACtC,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AAe,EAAE,kBAAkB,CAAC,CAAC,UAAU,CAAC,EAE7E,UAAU,GAAG,UAAC,KAAgB,EAAE,KAAU,IAAK,OAAA,oBAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAI,EAA9C,CAA8C,CAAC;AAEhG,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type LoadingPropTypes = {
|
|
3
|
+
readonly error?: any;
|
|
4
|
+
readonly timedOut: boolean;
|
|
5
|
+
readonly pastDelay: boolean;
|
|
6
|
+
readonly retry: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const RouteLoading: ({ error, retry, timedOut, }: LoadingPropTypes) => JSX.Element;
|
|
9
|
+
export default RouteLoading;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var Loading_1 = require("../Messages/Loading");
|
|
8
|
+
var utility_1 = require("../utility");
|
|
9
|
+
var index_1 = require("./index");
|
|
10
|
+
var
|
|
11
|
+
// type FireErrorPropTypes = {
|
|
12
|
+
// error: any;
|
|
13
|
+
// };
|
|
14
|
+
// import SimulatedException from "./SimulatedException";
|
|
15
|
+
// IgnoreThisNode = ({
|
|
16
|
+
// error: {
|
|
17
|
+
// message,
|
|
18
|
+
// stack,
|
|
19
|
+
// },
|
|
20
|
+
// }: FireErrorPropTypes) => {
|
|
21
|
+
// throw new SimulatedException(message, stack);
|
|
22
|
+
// },
|
|
23
|
+
// <ErrorBoundary>
|
|
24
|
+
// <IgnoreThisNode error={error} />
|
|
25
|
+
// </ErrorBoundary>
|
|
26
|
+
RouteLoading = function (_a) {
|
|
27
|
+
var error = _a.error, retry = _a.retry, timedOut = _a.timedOut;
|
|
28
|
+
if (error) {
|
|
29
|
+
return (react_1.default.createElement(index_1.ErrorBoundary, null));
|
|
30
|
+
}
|
|
31
|
+
if (timedOut) {
|
|
32
|
+
return (react_1.default.createElement("div", null,
|
|
33
|
+
utility_1.words.ItLoadsSlower,
|
|
34
|
+
react_1.default.createElement("button", { className: "btn btn-primary btn-block", onClick: retry, type: "button" }, utility_1.words.TryAgain)));
|
|
35
|
+
}
|
|
36
|
+
return (react_1.default.createElement("div", { className: "mt-3" },
|
|
37
|
+
react_1.default.createElement(Loading_1.LoadingMessage, { message: utility_1.words.PleaseWait })));
|
|
38
|
+
};
|
|
39
|
+
exports.default = RouteLoading;
|
|
40
|
+
//# sourceMappingURL=RouteLoading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteLoading.js","sourceRoot":"","sources":["../../src/Async/RouteLoading.tsx"],"names":[],"mappings":";;;;;AAMA,gDAA0B;AAC1B,+CAAqD;AACrD,sCAAmC;AACnC,iCAAwC;AAExC;AAEE,8BAA8B;AAC9B,gBAAgB;AAChB,KAAK;AACL,yDAAyD;AACzD,sBAAsB;AACtB,eAAe;AACf,iBAAiB;AACjB,eAAe;AACf,SAAS;AACT,gCAAgC;AAChC,oDAAoD;AACpD,OAAO;AAGP,kBAAkB;AAClB,mCAAmC;AACnC,mBAAmB;AAGnB,YAAY,GAAG,UAAC,EAIG;QAHjB,KAAK,WAAA,EACL,KAAK,WAAA,EACL,QAAQ,cAAA;IAER,IAAI,KAAK,EAAE;QACT,OAAO,CACL,8BAAC,qBAAa,OAAG,CAClB,CAAC;KACH;IAED,IAAI,QAAQ,EAAE;QACZ,OAAO,CACL;YAAM,eAAK,CAAC,aAAa;YACvB,0CAAQ,SAAS,EAAC,2BAA2B,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,IACxE,eAAK,CAAC,QAAQ,CACR,CACL,CACP,CAAC;KACH;IAED,OAAO,CACL,uCAAK,SAAS,EAAC,MAAM;QACnB,8BAAC,wBAAc,IAAC,OAAO,EAAE,eAAK,CAAC,UAAU,GAAI,CAE9C,CAAC,CAAC;AACP,CAAC,CAAC;AAEJ,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare class CustomError<Message extends string, Stack extends string> extends Error {
|
|
2
|
+
constructor(message: Message, stack: Stack);
|
|
3
|
+
}
|
|
4
|
+
declare type Message = string;
|
|
5
|
+
declare type Stack = string;
|
|
6
|
+
declare class SimulatedException extends CustomError<Message, Stack> {
|
|
7
|
+
}
|
|
8
|
+
export default SimulatedException;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
/* eslint-disable max-classes-per-file */
|
|
19
|
+
var CustomError = /** @class */ (function (_super) {
|
|
20
|
+
__extends(CustomError, _super);
|
|
21
|
+
function CustomError(message, stack) {
|
|
22
|
+
var _this = _super.call(this, message) || this;
|
|
23
|
+
_this.message = message;
|
|
24
|
+
_this.name = message;
|
|
25
|
+
_this.stack = stack;
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
return CustomError;
|
|
29
|
+
}(Error));
|
|
30
|
+
var SimulatedException = /** @class */ (function (_super) {
|
|
31
|
+
__extends(SimulatedException, _super);
|
|
32
|
+
function SimulatedException() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
}
|
|
35
|
+
return SimulatedException;
|
|
36
|
+
}(CustomError));
|
|
37
|
+
exports.default = SimulatedException;
|
|
38
|
+
//# sourceMappingURL=SimulatedException.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulatedException.js","sourceRoot":"","sources":["../../src/Async/SimulatedException.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAyC;AACzC;IAAwE,+BAAK;IAC3E,qBAAa,OAAgB,EAAE,KAAY;QAA3C,YACE,kBAAM,OAAO,CAAC,SAIf;QAHC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;IACrB,CAAC;IAEH,kBAAC;AAAD,CAAC,AARD,CAAwE,KAAK,GAQ5E;AAKD;IAAiC,sCAA2B;IAA5D;;IAA8D,CAAC;IAAD,yBAAC;AAAD,CAAC,AAA/D,CAAiC,WAAW,GAAmB;AAE/D,kBAAe,kBAAkB,CAAC"}
|
package/Async/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Loadable from "react-loadable";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare let ErrorBoundary: () => JSX.Element;
|
|
4
|
+
export declare const setErrorBoundary: (theError: any) => void, createAsyncRoute: (loader: any) => React.ComponentType<any> & Loadable.LoadableComponent;
|
package/Async/index.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createAsyncRoute = exports.setErrorBoundary = exports.ErrorBoundary = void 0;
|
|
26
|
+
/* eslint-disable new-cap, react/prefer-stateless-function, react/require-optimization */
|
|
27
|
+
var react_loadable_1 = __importDefault(require("react-loadable"));
|
|
28
|
+
var React = __importStar(require("react"));
|
|
29
|
+
var utility_1 = require("../utility");
|
|
30
|
+
var RouteLoading_1 = __importDefault(require("./RouteLoading"));
|
|
31
|
+
var InitModule_1 = __importDefault(require("./InitModule"));
|
|
32
|
+
// type injectPaginatorTypes = {
|
|
33
|
+
// key: string,
|
|
34
|
+
// itemsReducer: any;
|
|
35
|
+
// pagesReducer: any;
|
|
36
|
+
// };
|
|
37
|
+
// import { injectReducer } from "redux-injector";
|
|
38
|
+
// import { injectModals } from "../Modal/util";
|
|
39
|
+
var timeout = 15000;
|
|
40
|
+
var ErrorBoundary = function () { return React.createElement("div", null, utility_1.words.NoErrorPassed); };
|
|
41
|
+
exports.ErrorBoundary = ErrorBoundary;
|
|
42
|
+
// const injectPaginator = ({ key, itemsReducer, pagesReducer } : injectPaginatorTypes) => {
|
|
43
|
+
// injectReducer(`entities.${key}`, itemsReducer);
|
|
44
|
+
// injectReducer(`paginations.${key}`, pagesReducer);
|
|
45
|
+
// };
|
|
46
|
+
// const renderWithReducer = (route, props) => {
|
|
47
|
+
// const { Component, reducers, modals, paginators } = route.default;
|
|
48
|
+
//
|
|
49
|
+
// if (reducers) {
|
|
50
|
+
// if (Array.isArray(reducers)) {
|
|
51
|
+
// for (const { key, func } of reducers) {
|
|
52
|
+
// injectReducer(key, func);
|
|
53
|
+
// }
|
|
54
|
+
// } else {
|
|
55
|
+
// const { key, func } = reducers;
|
|
56
|
+
//
|
|
57
|
+
// injectReducer(key, func);
|
|
58
|
+
// }
|
|
59
|
+
// }
|
|
60
|
+
//
|
|
61
|
+
// if (modals) {
|
|
62
|
+
// injectModals(modals);
|
|
63
|
+
// }
|
|
64
|
+
//
|
|
65
|
+
// if (paginators) {
|
|
66
|
+
// if (Array.isArray(paginators)) {
|
|
67
|
+
// for (const paginator of paginators) {
|
|
68
|
+
// injectPaginator(paginator);
|
|
69
|
+
// }
|
|
70
|
+
// } else {
|
|
71
|
+
// injectPaginator(paginators);
|
|
72
|
+
// }
|
|
73
|
+
// }
|
|
74
|
+
//
|
|
75
|
+
// return <Component {...props} />;
|
|
76
|
+
// };
|
|
77
|
+
var setErrorBoundary = function (theError) {
|
|
78
|
+
exports.ErrorBoundary = theError;
|
|
79
|
+
}, createAsyncRoute = function (loader) { return (0, react_loadable_1.default)({
|
|
80
|
+
loader: loader,
|
|
81
|
+
loading: RouteLoading_1.default,
|
|
82
|
+
render: InitModule_1.default,
|
|
83
|
+
timeout: timeout,
|
|
84
|
+
}); };
|
|
85
|
+
exports.setErrorBoundary = setErrorBoundary, exports.createAsyncRoute = createAsyncRoute;
|
|
86
|
+
//# sourceMappingURL=index.js.map
|