dce-reactkit 2.0.10 → 3.0.0
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/cjs/index.js +2 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/lib/components/AppWrapper.d.ts +35 -0
- package/lib/{components → cjs/lib/components}/ErrorBox.d.ts +0 -0
- package/lib/{components → cjs/lib/components}/LoadingSpinner.d.ts +1 -0
- package/lib/cjs/lib/components/Modal.d.ts +40 -0
- package/lib/cjs/lib/components/TabBox.d.ts +11 -0
- package/lib/{errors → cjs/lib/errors}/ErrorWithCode.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/abbreviate.d.ts +1 -0
- package/lib/{helpers → cjs/lib/helpers}/avg.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/ceilToNumDecimals.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/floorToNumDecimals.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/forceNumIntoBounds.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/handleError.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/handleSuccess.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/padDecimalZeros.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/padZerosLeft.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/parseRequest.d.ts +1 -1
- package/lib/{helpers → cjs/lib/helpers}/roundToNumDecimals.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/sum.d.ts +0 -0
- package/lib/{helpers → cjs/lib/helpers}/visitServerEndpoint.d.ts +2 -2
- package/lib/{helpers → cjs/lib/helpers}/waitMs.d.ts +0 -0
- package/lib/cjs/lib/index.d.ts +27 -0
- package/lib/cjs/lib/types/ModalButtonType.d.ts +17 -0
- package/lib/cjs/lib/types/ModalSize.d.ts +11 -0
- package/lib/cjs/lib/types/ModalType.d.ts +16 -0
- package/lib/{types → cjs/lib/types}/ParamType.d.ts +0 -0
- package/lib/{types → cjs/lib/types}/ReactKitErrorCode.d.ts +0 -0
- package/lib/{types → cjs/lib/types}/Variant.d.ts +0 -0
- package/lib/cjs/types/components/AppWrapper.d.ts +40 -0
- package/lib/cjs/types/components/ErrorBox.d.ts +12 -0
- package/lib/cjs/types/components/LoadingSpinner.d.ts +7 -0
- package/lib/cjs/types/components/Modal.d.ts +40 -0
- package/lib/cjs/types/components/TabBox.d.ts +11 -0
- package/lib/cjs/types/errors/ErrorWithCode.d.ts +9 -0
- package/lib/cjs/types/helpers/abbreviate.d.ts +10 -0
- package/lib/cjs/types/helpers/alert.d.ts +2 -0
- package/lib/cjs/types/helpers/avg.d.ts +8 -0
- package/lib/cjs/types/helpers/ceilToNumDecimals.d.ts +9 -0
- package/lib/cjs/types/helpers/confirm.d.ts +2 -0
- package/lib/cjs/types/helpers/floorToNumDecimals.d.ts +9 -0
- package/lib/cjs/types/helpers/forceNumIntoBounds.d.ts +10 -0
- package/lib/cjs/types/helpers/handleError.d.ts +14 -0
- package/lib/cjs/types/helpers/handleSuccess.d.ts +8 -0
- package/lib/cjs/types/helpers/padDecimalZeros.d.ts +10 -0
- package/lib/cjs/types/helpers/padZerosLeft.d.ts +9 -0
- package/lib/cjs/types/helpers/parseRequest.d.ts +21 -0
- package/lib/cjs/types/helpers/roundToNumDecimals.d.ts +9 -0
- package/lib/cjs/types/helpers/showFatalError.d.ts +2 -0
- package/lib/cjs/types/helpers/sum.d.ts +8 -0
- package/lib/cjs/types/helpers/visitServerEndpoint.d.ts +23 -0
- package/lib/cjs/types/helpers/waitMs.d.ts +7 -0
- package/lib/cjs/types/index.d.ts +22 -0
- package/lib/cjs/types/types/ModalButtonType.d.ts +17 -0
- package/lib/cjs/types/types/ModalSize.d.ts +11 -0
- package/lib/cjs/types/types/ModalType.d.ts +16 -0
- package/lib/cjs/types/types/ParamType.d.ts +17 -0
- package/lib/cjs/types/types/ReactKitErrorCode.d.ts +13 -0
- package/lib/cjs/types/types/Variant.d.ts +15 -0
- package/lib/esm/index.js +16 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/lib/components/AppWrapper.d.ts +35 -0
- package/lib/esm/lib/components/ErrorBox.d.ts +12 -0
- package/lib/esm/lib/components/LoadingSpinner.d.ts +7 -0
- package/lib/esm/lib/components/Modal.d.ts +40 -0
- package/lib/esm/lib/components/TabBox.d.ts +11 -0
- package/lib/esm/lib/errors/ErrorWithCode.d.ts +9 -0
- package/lib/esm/lib/helpers/abbreviate.d.ts +10 -0
- package/lib/esm/lib/helpers/avg.d.ts +8 -0
- package/lib/esm/lib/helpers/ceilToNumDecimals.d.ts +9 -0
- package/lib/esm/lib/helpers/floorToNumDecimals.d.ts +9 -0
- package/lib/esm/lib/helpers/forceNumIntoBounds.d.ts +10 -0
- package/lib/esm/lib/helpers/handleError.d.ts +14 -0
- package/lib/esm/lib/helpers/handleSuccess.d.ts +8 -0
- package/lib/esm/lib/helpers/padDecimalZeros.d.ts +10 -0
- package/lib/esm/lib/helpers/padZerosLeft.d.ts +9 -0
- package/lib/esm/lib/helpers/parseRequest.d.ts +21 -0
- package/lib/esm/lib/helpers/roundToNumDecimals.d.ts +9 -0
- package/lib/esm/lib/helpers/sum.d.ts +8 -0
- package/lib/esm/lib/helpers/visitServerEndpoint.d.ts +23 -0
- package/lib/esm/lib/helpers/waitMs.d.ts +7 -0
- package/lib/esm/lib/index.d.ts +27 -0
- package/lib/esm/lib/types/ModalButtonType.d.ts +17 -0
- package/lib/esm/lib/types/ModalSize.d.ts +11 -0
- package/lib/esm/lib/types/ModalType.d.ts +16 -0
- package/lib/esm/lib/types/ParamType.d.ts +17 -0
- package/lib/esm/lib/types/ReactKitErrorCode.d.ts +13 -0
- package/lib/esm/lib/types/Variant.d.ts +15 -0
- package/lib/esm/types/components/AppWrapper.d.ts +40 -0
- package/lib/esm/types/components/ErrorBox.d.ts +12 -0
- package/lib/esm/types/components/LoadingSpinner.d.ts +7 -0
- package/lib/esm/types/components/Modal.d.ts +40 -0
- package/lib/esm/types/components/TabBox.d.ts +11 -0
- package/lib/esm/types/errors/ErrorWithCode.d.ts +9 -0
- package/lib/esm/types/helpers/abbreviate.d.ts +10 -0
- package/lib/esm/types/helpers/alert.d.ts +2 -0
- package/lib/esm/types/helpers/avg.d.ts +8 -0
- package/lib/esm/types/helpers/ceilToNumDecimals.d.ts +9 -0
- package/lib/esm/types/helpers/confirm.d.ts +2 -0
- package/lib/esm/types/helpers/floorToNumDecimals.d.ts +9 -0
- package/lib/esm/types/helpers/forceNumIntoBounds.d.ts +10 -0
- package/lib/esm/types/helpers/handleError.d.ts +14 -0
- package/lib/esm/types/helpers/handleSuccess.d.ts +8 -0
- package/lib/esm/types/helpers/padDecimalZeros.d.ts +10 -0
- package/lib/esm/types/helpers/padZerosLeft.d.ts +9 -0
- package/lib/esm/types/helpers/parseRequest.d.ts +21 -0
- package/lib/esm/types/helpers/roundToNumDecimals.d.ts +9 -0
- package/lib/esm/types/helpers/showFatalError.d.ts +2 -0
- package/lib/esm/types/helpers/sum.d.ts +8 -0
- package/lib/esm/types/helpers/visitServerEndpoint.d.ts +23 -0
- package/lib/esm/types/helpers/waitMs.d.ts +7 -0
- package/lib/esm/types/index.d.ts +22 -0
- package/lib/esm/types/types/ModalButtonType.d.ts +17 -0
- package/lib/esm/types/types/ModalSize.d.ts +11 -0
- package/lib/esm/types/types/ModalType.d.ts +16 -0
- package/lib/esm/types/types/ParamType.d.ts +17 -0
- package/lib/esm/types/types/ReactKitErrorCode.d.ts +13 -0
- package/lib/esm/types/types/Variant.d.ts +15 -0
- package/lib/index.d.ts +274 -0
- package/package.json +26 -5
- package/rollup.config.js +43 -0
- package/src/components/AppWrapper.tsx +212 -36
- package/src/components/LoadingSpinner.tsx +3 -0
- package/src/components/Modal.tsx +65 -95
- package/src/components/TabBox.tsx +136 -0
- package/src/helpers/abbreviate.tsx +2 -0
- package/src/helpers/padDecimalZeros.tsx +1 -1
- package/src/index.ts +61 -0
- package/src/types/ModalButtonType.tsx +18 -0
- package/src/types/ModalSize.tsx +12 -0
- package/src/types/ModalType.tsx +17 -0
- package/tsconfig.json +14 -17
- package/lib/components/AppWrapper.d.ts +0 -20
- package/lib/components/AppWrapper.js +0 -133
- package/lib/components/AppWrapper.js.map +0 -1
- package/lib/components/ErrorBox.js +0 -65
- package/lib/components/ErrorBox.js.map +0 -1
- package/lib/components/LoadingSpinner.js +0 -41
- package/lib/components/LoadingSpinner.js.map +0 -1
- package/lib/components/Modal.d.ts +0 -69
- package/lib/components/Modal.js +0 -315
- package/lib/components/Modal.js.map +0 -1
- package/lib/errors/ErrorWithCode.js +0 -33
- package/lib/errors/ErrorWithCode.js.map +0 -1
- package/lib/helpers/abbreviate.js +0 -21
- package/lib/helpers/abbreviate.js.map +0 -1
- package/lib/helpers/avg.js +0 -24
- package/lib/helpers/avg.js.map +0 -1
- package/lib/helpers/ceilToNumDecimals.js +0 -15
- package/lib/helpers/ceilToNumDecimals.js.map +0 -1
- package/lib/helpers/floorToNumDecimals.js +0 -15
- package/lib/helpers/floorToNumDecimals.js.map +0 -1
- package/lib/helpers/forceNumIntoBounds.js +0 -15
- package/lib/helpers/forceNumIntoBounds.js.map +0 -1
- package/lib/helpers/handleError.js +0 -54
- package/lib/helpers/handleError.js.map +0 -1
- package/lib/helpers/handleSuccess.js +0 -20
- package/lib/helpers/handleSuccess.js.map +0 -1
- package/lib/helpers/padDecimalZeros.js +0 -30
- package/lib/helpers/padDecimalZeros.js.map +0 -1
- package/lib/helpers/padZerosLeft.js +0 -21
- package/lib/helpers/padZerosLeft.js.map +0 -1
- package/lib/helpers/parseRequest.js +0 -240
- package/lib/helpers/parseRequest.js.map +0 -1
- package/lib/helpers/roundToNumDecimals.js +0 -15
- package/lib/helpers/roundToNumDecimals.js.map +0 -1
- package/lib/helpers/showFatalError.d.ts +0 -2
- package/lib/helpers/showFatalError.js +0 -5
- package/lib/helpers/showFatalError.js.map +0 -1
- package/lib/helpers/sum.js +0 -15
- package/lib/helpers/sum.js.map +0 -1
- package/lib/helpers/visitServerEndpoint.js +0 -135
- package/lib/helpers/visitServerEndpoint.js.map +0 -1
- package/lib/helpers/waitMs.js +0 -55
- package/lib/helpers/waitMs.js.map +0 -1
- package/lib/types/ParamType.js +0 -21
- package/lib/types/ParamType.js.map +0 -1
- package/lib/types/ReactKitErrorCode.js +0 -18
- package/lib/types/ReactKitErrorCode.js.map +0 -1
- package/lib/types/Variant.js +0 -19
- package/lib/types/Variant.js.map +0 -1
- package/src/helpers/handleError.ts +0 -65
- package/src/helpers/handleSuccess.ts +0 -18
- package/src/helpers/parseRequest.ts +0 -299
- package/src/helpers/showFatalError.tsx +0 -3
- package/src/helpers/visitServerEndpoint.tsx +0 -110
- package/src/types/ParamType.ts +0 -18
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.showFatalError = void 0;
|
|
18
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
/**
|
|
20
|
-
* A wrapper for the entire React app that adds global functionality like
|
|
21
|
-
* handling for fatal error messages
|
|
22
|
-
* @author Gabe Abrams
|
|
23
|
-
*/
|
|
24
|
-
// Import React
|
|
25
|
-
var react_1 = require("react");
|
|
26
|
-
// Import shared components
|
|
27
|
-
var ErrorBox_1 = __importDefault(require("./ErrorBox"));
|
|
28
|
-
// Import helpers
|
|
29
|
-
var visitServerEndpoint_1 = require("../helpers/visitServerEndpoint");
|
|
30
|
-
// Import shared types
|
|
31
|
-
var ReactKitErrorCode_1 = __importDefault(require("../types/ReactKitErrorCode"));
|
|
32
|
-
// Import custom errors
|
|
33
|
-
var ErrorWithCode_1 = __importDefault(require("../errors/ErrorWithCode"));
|
|
34
|
-
/*------------------------------------------------------------------------*/
|
|
35
|
-
/* Static Helpers */
|
|
36
|
-
/*------------------------------------------------------------------------*/
|
|
37
|
-
// Stored copies of setters
|
|
38
|
-
var setFatalErrorMessage;
|
|
39
|
-
var setFatalErrorCode;
|
|
40
|
-
var setFatalErrorTitle;
|
|
41
|
-
/**
|
|
42
|
-
* Show a fatal error message
|
|
43
|
-
* @author Gabe Abrams
|
|
44
|
-
* @param error the error to show
|
|
45
|
-
* @param [errorTitle] title of the error box
|
|
46
|
-
*/
|
|
47
|
-
var showFatalError = function (error, errorTitle) {
|
|
48
|
-
var _a, _b;
|
|
49
|
-
if (errorTitle === void 0) { errorTitle = 'An Error Occurred'; }
|
|
50
|
-
// Determine message and code
|
|
51
|
-
var message = (typeof error === 'string'
|
|
52
|
-
? error.trim()
|
|
53
|
-
: String((_a = error.message) !== null && _a !== void 0 ? _a : 'An unknown error occurred.'));
|
|
54
|
-
var code = (typeof error === 'string'
|
|
55
|
-
? ReactKitErrorCode_1.default.NoCode
|
|
56
|
-
: String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode_1.default.NoCode));
|
|
57
|
-
// Handle case where app hasn't loaded
|
|
58
|
-
if (!setFatalErrorMessage || !setFatalErrorCode) {
|
|
59
|
-
return alert("An error has occurred: ".concat(message, " (code: ").concat(code, "). Please contact support."));
|
|
60
|
-
}
|
|
61
|
-
// Use setters
|
|
62
|
-
setFatalErrorMessage(message);
|
|
63
|
-
setFatalErrorCode(code);
|
|
64
|
-
setFatalErrorTitle(errorTitle);
|
|
65
|
-
};
|
|
66
|
-
exports.showFatalError = showFatalError;
|
|
67
|
-
/*------------------------------------------------------------------------*/
|
|
68
|
-
/* Component */
|
|
69
|
-
/*------------------------------------------------------------------------*/
|
|
70
|
-
var AppWrapper = function (props) {
|
|
71
|
-
/*------------------------------------------------------------------------*/
|
|
72
|
-
/* Setup */
|
|
73
|
-
/*------------------------------------------------------------------------*/
|
|
74
|
-
/* -------------- Props ------------- */
|
|
75
|
-
var children = props.children, dark = props.dark, _a = props.sessionExpiredMessage, sessionExpiredMessage = _a === void 0 ? 'Your session has expired. Please go back to Canvas and start over.' : _a;
|
|
76
|
-
/* -------------- State ------------- */
|
|
77
|
-
// Fatal error
|
|
78
|
-
var _b = (0, react_1.useState)(null), fatalErrorMessage = _b[0], setFatalErrorMessageInner = _b[1];
|
|
79
|
-
setFatalErrorMessage = setFatalErrorMessageInner;
|
|
80
|
-
var _c = (0, react_1.useState)(null), fatalErrorCode = _c[0], setFatalErrorCodeInner = _c[1];
|
|
81
|
-
setFatalErrorCode = setFatalErrorCodeInner;
|
|
82
|
-
var _d = (0, react_1.useState)(null), fatalErrorTitle = _d[0], setFatalErrorTitleInner = _d[1];
|
|
83
|
-
setFatalErrorTitle = setFatalErrorTitleInner;
|
|
84
|
-
// Session expired
|
|
85
|
-
var _e = (0, react_1.useState)(false), sessionHasExpired = _e[0], setSessionHasExpired = _e[1];
|
|
86
|
-
/*------------------------------------------------------------------------*/
|
|
87
|
-
/* Lifecycle Functions */
|
|
88
|
-
/*------------------------------------------------------------------------*/
|
|
89
|
-
/**
|
|
90
|
-
* Mount
|
|
91
|
-
* @author Gabe Abrams
|
|
92
|
-
*/
|
|
93
|
-
(0, react_1.useEffect)(function () {
|
|
94
|
-
// Add session expired handler
|
|
95
|
-
(0, visitServerEndpoint_1.setSessionExpiryHandler)(function () {
|
|
96
|
-
// Session expired!
|
|
97
|
-
setSessionHasExpired(true);
|
|
98
|
-
});
|
|
99
|
-
}, []);
|
|
100
|
-
/*------------------------------------------------------------------------*/
|
|
101
|
-
/* Render */
|
|
102
|
-
/*------------------------------------------------------------------------*/
|
|
103
|
-
/*----------------------------------------*/
|
|
104
|
-
/* Main UI */
|
|
105
|
-
/*----------------------------------------*/
|
|
106
|
-
// Show error
|
|
107
|
-
if (fatalErrorMessage || fatalErrorCode || sessionHasExpired) {
|
|
108
|
-
// Re-encapsulate in an error
|
|
109
|
-
var error = (sessionHasExpired
|
|
110
|
-
? new ErrorWithCode_1.default(fatalErrorMessage, fatalErrorCode)
|
|
111
|
-
: new ErrorWithCode_1.default(sessionExpiredMessage, ReactKitErrorCode_1.default.SessionExpired));
|
|
112
|
-
// Build error screen
|
|
113
|
-
return ((0, jsx_runtime_1.jsx)("div", __assign({ style: {
|
|
114
|
-
display: 'block',
|
|
115
|
-
width: '100vw',
|
|
116
|
-
minHeight: '100vh',
|
|
117
|
-
paddingTop: '10rem',
|
|
118
|
-
backgroundColor: (dark
|
|
119
|
-
? '#222'
|
|
120
|
-
: '#fff'),
|
|
121
|
-
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBox_1.default, { title: (sessionHasExpired
|
|
122
|
-
? 'Session Expired'
|
|
123
|
-
: fatalErrorTitle), error: error }) })));
|
|
124
|
-
}
|
|
125
|
-
// Show the app itself
|
|
126
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
|
|
127
|
-
};
|
|
128
|
-
/*------------------------------------------------------------------------*/
|
|
129
|
-
/* Wrap Up */
|
|
130
|
-
/*------------------------------------------------------------------------*/
|
|
131
|
-
// Export component
|
|
132
|
-
exports.default = AppWrapper;
|
|
133
|
-
//# sourceMappingURL=AppWrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppWrapper.js","sourceRoot":"","sources":["../../src/components/AppWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AAEH,eAAe;AACf,+BAAmD;AAEnD,2BAA2B;AAC3B,wDAAk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,CAAC;QAEF,qBAAqB;QACrB,OAAO,CACL,yCACE,KAAK,EAAE;gBACL,OAAO,EAAE,OAAO;gBAChB,KAAK,EAAE,OAAO;gBACd,SAAS,EAAE,OAAO;gBAClB,UAAU,EAAE,OAAO;gBACnB,eAAe,EAAE,CACf,IAAI;oBACF,CAAC,CAAC,MAAM;oBACR,CAAC,CAAC,MAAM,CACX;aACF,gBAED,uBAAC,kBAAQ,IACP,KAAK,EAAE,CACL,iBAAiB;oBACf,CAAC,CAAC,iBAAiB;oBACnB,CAAC,CAAC,eAAe,CACpB,EACD,KAAK,EAAE,KAAK,GACZ,IACE,CACP,CAAC;KACH;IAED,sBAAsB;IACtB,OAAO,CACL,2DACG,QAAQ,GACR,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,mBAAmB;AACnB,kBAAe,UAAU,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
// Import FontAwesome Icons
|
|
19
|
-
var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
|
|
20
|
-
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
|
|
21
|
-
// Import shared types
|
|
22
|
-
var ReactKitErrorCode_1 = __importDefault(require("../types/ReactKitErrorCode"));
|
|
23
|
-
/*------------------------------------------------------------------------*/
|
|
24
|
-
/* Component */
|
|
25
|
-
/*------------------------------------------------------------------------*/
|
|
26
|
-
var ErrorBox = function (props) {
|
|
27
|
-
/*------------------------------------------------------------------------*/
|
|
28
|
-
/* Setup */
|
|
29
|
-
/*------------------------------------------------------------------------*/
|
|
30
|
-
var _a;
|
|
31
|
-
/* -------------- Props ------------- */
|
|
32
|
-
var error = props.error, _b = props.title, title = _b === void 0 ? 'An Error Occurred' : _b, onClose = props.onClose;
|
|
33
|
-
/*------------------------------------------------------------------------*/
|
|
34
|
-
/* Render */
|
|
35
|
-
/*------------------------------------------------------------------------*/
|
|
36
|
-
// Determine error text
|
|
37
|
-
var errorText = (typeof error === 'string'
|
|
38
|
-
? error.trim()
|
|
39
|
-
: String(error.message || 'An unknown error occurred. Please contact support.'));
|
|
40
|
-
// Error code box
|
|
41
|
-
var errorCodeBox;
|
|
42
|
-
if (error && error.code) {
|
|
43
|
-
errorCodeBox = ((0, jsx_runtime_1.jsxs)("span", { children: [' ', (0, jsx_runtime_1.jsxs)("span", __assign({ style: {
|
|
44
|
-
backgroundColor: 'white',
|
|
45
|
-
borderRadius: '5px',
|
|
46
|
-
paddingLeft: '3px',
|
|
47
|
-
paddingRight: '3px',
|
|
48
|
-
color: '#DC4150',
|
|
49
|
-
fontVariant: 'small-caps',
|
|
50
|
-
fontSize: '80%',
|
|
51
|
-
whiteSpace: 'nowrap',
|
|
52
|
-
} }, { children: ["code:", ' ', String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode_1.default.NoCode).toUpperCase()] }))] }));
|
|
53
|
-
}
|
|
54
|
-
// Main UI
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "alert alert-danger text-center", style: {
|
|
56
|
-
maxWidth: '650px',
|
|
57
|
-
margin: 'auto',
|
|
58
|
-
} }, { children: [(0, jsx_runtime_1.jsxs)("h4", __assign({ className: "mb-1" }, { children: [(0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faExclamationTriangle, className: "me-2" }), title] })), (0, jsx_runtime_1.jsxs)("div", { children: [errorText, errorCodeBox] }), onClose && ((0, jsx_runtime_1.jsx)("div", __assign({ className: "mt-2" }, { children: (0, jsx_runtime_1.jsx)("button", __assign({ type: "button", className: "btn btn-light", "aria-label": "dismiss error and close this activity or view", onClick: onClose }, { children: "Close" })) })))] })));
|
|
59
|
-
};
|
|
60
|
-
/*------------------------------------------------------------------------*/
|
|
61
|
-
/* Wrap Up */
|
|
62
|
-
/*------------------------------------------------------------------------*/
|
|
63
|
-
// Export component
|
|
64
|
-
exports.default = ErrorBox;
|
|
65
|
-
//# sourceMappingURL=ErrorBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBox.js","sourceRoot":"","sources":["../../src/components/ErrorBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAQA,2BAA2B;AAC3B,oEAAiE;AACjE,0EAA0E;AAE1E,sBAAsB;AACtB,iFAA2D;AAe3D,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,IAAM,QAAQ,GAAoB,UAAC,KAAK;IACtC,4EAA4E;IAC5E,4EAA4E;IAC5E,4EAA4E;;IAE5E,wCAAwC;IAGtC,IAAA,KAAK,GAGH,KAAK,MAHF,EACL,KAEE,KAAK,MAFoB,EAA3B,KAAK,mBAAG,mBAAmB,KAAA,EAC3B,OAAO,GACL,KAAK,QADA,CACC;IAEV,4EAA4E;IAC5E,4EAA4E;IAC5E,4EAA4E;IAE5E,uBAAuB;IACvB,IAAM,SAAS,GAAW,CACxB,OAAO,KAAK,KAAK,QAAQ;QACvB,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE;QACd,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,oDAAoD,CAAC,CAClF,CAAC;IAEF,iBAAiB;IACjB,IAAI,YAAY,CAAC;IACjB,IAAI,KAAK,IAAK,KAAa,CAAC,IAAI,EAAE;QAChC,YAAY,GAAG,CACb,6CACG,GAAG,EACJ,2CACE,KAAK,EAAE;wBACL,eAAe,EAAE,OAAO;wBACxB,YAAY,EAAE,KAAK;wBACnB,WAAW,EAAE,KAAK;wBAClB,YAAY,EAAE,KAAK;wBACnB,KAAK,EAAE,SAAS;wBAChB,WAAW,EAAE,YAAY;wBACzB,QAAQ,EAAE,KAAK;wBACf,UAAU,EAAE,QAAQ;qBACrB,0BAGA,GAAG,EACH,MAAM,CAAC,MAAC,KAAa,CAAC,IAAI,mCAAI,2BAAiB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KACjE,IACF,CACR,CAAC;KACH;IAED,UAAU;IACV,OAAO,CACL,0CACE,SAAS,EAAC,gCAAgC,EAC1C,KAAK,EAAE;YACL,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,MAAM;SACf,iBAED,yCAAI,SAAS,EAAC,MAAM,iBAClB,uBAAC,mCAAe,IACd,IAAI,EAAE,4CAAqB,EAC3B,SAAS,EAAC,MAAM,GAChB,EACD,KAAK,KACH,EACL,4CACG,SAAS,EACT,YAAY,IACT,EACL,OAAO,IAAI,CACV,yCAAK,SAAS,EAAC,MAAM,gBACnB,4CACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,eAAe,gBACd,+CAA+C,EAC1D,OAAO,EAAE,OAAO,2BAGT,IACL,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,mBAAmB;AACnB,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
/**
|
|
16
|
-
* Loading spinner/indicator
|
|
17
|
-
* @author Gabe Abrams
|
|
18
|
-
*/
|
|
19
|
-
// Import FontAwesome Icons
|
|
20
|
-
var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
|
|
21
|
-
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
|
|
22
|
-
/*------------------------------------------------------------------------*/
|
|
23
|
-
/* Style */
|
|
24
|
-
/*------------------------------------------------------------------------*/
|
|
25
|
-
var style = "\n/* Blips */\n.LoadingSpinner-blip-1,\n.LoadingSpinner-blip-2,\n.LoadingSpinner-blip-3,\n.LoadingSpinner-blip-4 {\n font-size: 25px;\n opacity: 0.6;\n margin-top: 20px;\n margin-bottom: 20px;\n}\n\n/* First Blip */\n.LoadingSpinner-blip-1 {\n animation: LoadingSpinner-pop-animation 2s infinite;\n}\n\n/* Second Blip */\n.LoadingSpinner-blip-2 {\n animation: LoadingSpinner-pop-animation 2s infinite;\n -webkit-animation-delay: 0.1s;\n animation-delay: 0.1s;\n}\n\n/* Third Blip */\n.LoadingSpinner-blip-3 {\n animation: LoadingSpinner-pop-animation 2s infinite;\n animation-delay: 0.2s;\n}\n\n/* Fourth Blip */\n.LoadingSpinner-blip-4 {\n animation: LoadingSpinner-pop-animation 2s infinite;\n animation-delay: 0.3s;\n}\n\n/* Pop Animation for Each Blip */\n@keyframes LoadingSpinner-pop-animation {\n 0% {\n transform: scale(1.0);\n }\n 10% {\n transform: scale(1.5);\n }\n 30% {\n transform: scale(1.0);\n }\n 100% {\n transform: scale(1.0);\n }\n}\n";
|
|
26
|
-
/*------------------------------------------------------------------------*/
|
|
27
|
-
/* Component */
|
|
28
|
-
/*------------------------------------------------------------------------*/
|
|
29
|
-
var LoadingSpinner = function () {
|
|
30
|
-
/*------------------------------------------------------------------------*/
|
|
31
|
-
/* Render */
|
|
32
|
-
/*------------------------------------------------------------------------*/
|
|
33
|
-
// Add all four blips to a container
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "text-center LoadingSpinner LoadingSpinner-container" }, { children: [(0, jsx_runtime_1.jsx)("style", { children: style }), (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faCircle, className: "LoadingSpinner-blip-1 me-1" }), (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faCircle, className: "LoadingSpinner-blip-2 me-1" }), (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faCircle, className: "LoadingSpinner-blip-3 me-1" }), (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faCircle, className: "LoadingSpinner-blip-4" })] })));
|
|
35
|
-
};
|
|
36
|
-
/*------------------------------------------------------------------------*/
|
|
37
|
-
/* Wrap Up */
|
|
38
|
-
/*------------------------------------------------------------------------*/
|
|
39
|
-
// Export component
|
|
40
|
-
exports.default = LoadingSpinner;
|
|
41
|
-
//# sourceMappingURL=LoadingSpinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../src/components/LoadingSpinner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;GAGG;AAEH,2BAA2B;AAC3B,oEAAiE;AACjE,0EAA6D;AAE7D,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,IAAM,KAAK,GAAG,69BAmDb,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,IAAM,cAAc,GAAG;IACrB,4EAA4E;IAC5E,4EAA4E;IAC5E,4EAA4E;IAE5E,oCAAoC;IACpC,OAAO,CACL,0CAAK,SAAS,EAAC,qDAAqD,iBAClE,4CAAQ,KAAK,GAAS,EACtB,uBAAC,mCAAe,IACd,IAAI,EAAE,+BAAQ,EACd,SAAS,EAAC,4BAA4B,GACtC,EACF,uBAAC,mCAAe,IACd,IAAI,EAAE,+BAAQ,EACd,SAAS,EAAC,4BAA4B,GACtC,EACF,uBAAC,mCAAe,IACd,IAAI,EAAE,+BAAQ,EACd,SAAS,EAAC,4BAA4B,GACtC,EACF,uBAAC,mCAAe,IACd,IAAI,EAAE,+BAAQ,EACd,SAAS,EAAC,uBAAuB,GACjC,KACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,mBAAmB;AACnB,kBAAe,cAAc,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A generic popup modal
|
|
3
|
-
* @author Gabe Abrams
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import Variant from '../types/Variant';
|
|
7
|
-
declare enum ModalType {
|
|
8
|
-
Okay = "okay",
|
|
9
|
-
OkayCancel = "okay-cancel",
|
|
10
|
-
YesNo = "yes-no",
|
|
11
|
-
YesNoCancel = "yes-no-cancel",
|
|
12
|
-
AbandonGoBack = "abandon-goBack",
|
|
13
|
-
ImSureCancel = "imSure-cancel",
|
|
14
|
-
DeleteCancel = "delete-cancel",
|
|
15
|
-
ConfirmCancel = "confirm-cancel",
|
|
16
|
-
NoButtons = "-"
|
|
17
|
-
}
|
|
18
|
-
declare enum ModalSize {
|
|
19
|
-
Small = "sm",
|
|
20
|
-
Medium = "md",
|
|
21
|
-
Large = "lg",
|
|
22
|
-
ExtraLarge = "xl"
|
|
23
|
-
}
|
|
24
|
-
declare enum ButtonType {
|
|
25
|
-
Okay = "okay",
|
|
26
|
-
Cancel = "cancel",
|
|
27
|
-
Yes = "yes",
|
|
28
|
-
No = "no",
|
|
29
|
-
Abandon = "abandon",
|
|
30
|
-
GoBack = "goBack",
|
|
31
|
-
Continue = "continue",
|
|
32
|
-
ImSure = "imSure",
|
|
33
|
-
Delete = "delete",
|
|
34
|
-
Confirm = "confirm"
|
|
35
|
-
}
|
|
36
|
-
declare type Props = {
|
|
37
|
-
type?: ModalType;
|
|
38
|
-
size?: ModalSize;
|
|
39
|
-
title?: React.ReactNode;
|
|
40
|
-
children?: React.ReactNode;
|
|
41
|
-
onClose?: (type: ButtonType) => void;
|
|
42
|
-
okayLabel?: string;
|
|
43
|
-
okayVariant?: Variant;
|
|
44
|
-
cancelLabel?: string;
|
|
45
|
-
cancelVariant?: Variant;
|
|
46
|
-
yesLabel?: string;
|
|
47
|
-
yesVariant?: Variant;
|
|
48
|
-
noLabel?: string;
|
|
49
|
-
noVariant?: Variant;
|
|
50
|
-
abandonLabel?: string;
|
|
51
|
-
abandonVariant?: Variant;
|
|
52
|
-
goBackLabel?: string;
|
|
53
|
-
goBackVariant?: Variant;
|
|
54
|
-
continueLabel?: string;
|
|
55
|
-
continueVariant?: Variant;
|
|
56
|
-
imSureLabel?: string;
|
|
57
|
-
imSureVariant?: Variant;
|
|
58
|
-
deleteLabel?: string;
|
|
59
|
-
deleteVariant?: Variant;
|
|
60
|
-
confirmLabel?: string;
|
|
61
|
-
confirmVariant?: Variant;
|
|
62
|
-
};
|
|
63
|
-
declare const Modal: (React.FC<Props> & {
|
|
64
|
-
ModalType: typeof ModalType;
|
|
65
|
-
ModalSize: typeof ModalSize;
|
|
66
|
-
ButtonType: typeof ButtonType;
|
|
67
|
-
Variant: typeof Variant;
|
|
68
|
-
});
|
|
69
|
-
export default Modal;
|
package/lib/components/Modal.js
DELETED
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
var _a, _b;
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
55
|
-
/**
|
|
56
|
-
* A generic popup modal
|
|
57
|
-
* @author Gabe Abrams
|
|
58
|
-
*/
|
|
59
|
-
// Import React
|
|
60
|
-
var react_1 = require("react");
|
|
61
|
-
// Import other components
|
|
62
|
-
var Modal_1 = __importDefault(require("react-bootstrap/Modal"));
|
|
63
|
-
var waitMs_1 = __importDefault(require("../helpers/waitMs"));
|
|
64
|
-
// Import types
|
|
65
|
-
var Variant_1 = __importDefault(require("../types/Variant"));
|
|
66
|
-
/*------------------------------------------------------------------------*/
|
|
67
|
-
/* Style */
|
|
68
|
-
/*------------------------------------------------------------------------*/
|
|
69
|
-
var style = "\n/* More opaque backdrop */\n.Modal-backdrop {\n background-color: black !important;\n opacity: 0.8 !important;\n z-index: 10000000 !important;\n}\n\n/* Customize the modal header and body */\n.modal-header {\n /* Dark theme */\n background-color: #222 !important;\n color: white !important;\n\n /* Border */\n border: 1px solid #545454 !important;\n}\n.modal-body {\n /* Dark theme */\n background-color: #222 !important;\n color: white !important;\n\n /* Border */\n border-top: 0 !important;\n border-left: 1px solid #545454 !important;\n border-bottom: 1px solid #545454 !important;\n border-right: 1px solid #545454 !important;\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n}\n\n/* Create our own animation */\n.modal-content {\n animation-name: Modal-drop-in;\n animation-duration: 0.4s;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n animation-timing-function: ease-out;\n}\n@keyframes Modal-drop-in {\n 0% {\n transform: scale(0.8);\n opacity: 0.5;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n";
|
|
70
|
-
/*------------------------------------------------------------------------*/
|
|
71
|
-
/* Constants */
|
|
72
|
-
/*------------------------------------------------------------------------*/
|
|
73
|
-
// Constants
|
|
74
|
-
var MS_TO_ANIMATE = 400; // Time to animate in/out (defined by bootstrap)
|
|
75
|
-
var MS_ANIMATE_IN_DELAY = 10;
|
|
76
|
-
// Time to wait before animating in (must be >0 or animation won't trigger)
|
|
77
|
-
// Modal types
|
|
78
|
-
var ModalType;
|
|
79
|
-
(function (ModalType) {
|
|
80
|
-
ModalType["Okay"] = "okay";
|
|
81
|
-
ModalType["OkayCancel"] = "okay-cancel";
|
|
82
|
-
ModalType["YesNo"] = "yes-no";
|
|
83
|
-
ModalType["YesNoCancel"] = "yes-no-cancel";
|
|
84
|
-
ModalType["AbandonGoBack"] = "abandon-goBack";
|
|
85
|
-
ModalType["ImSureCancel"] = "imSure-cancel";
|
|
86
|
-
ModalType["DeleteCancel"] = "delete-cancel";
|
|
87
|
-
ModalType["ConfirmCancel"] = "confirm-cancel";
|
|
88
|
-
ModalType["NoButtons"] = "-";
|
|
89
|
-
})(ModalType || (ModalType = {}));
|
|
90
|
-
// Modal sizes
|
|
91
|
-
var ModalSize;
|
|
92
|
-
(function (ModalSize) {
|
|
93
|
-
ModalSize["Small"] = "sm";
|
|
94
|
-
ModalSize["Medium"] = "md";
|
|
95
|
-
ModalSize["Large"] = "lg";
|
|
96
|
-
ModalSize["ExtraLarge"] = "xl";
|
|
97
|
-
})(ModalSize || (ModalSize = {}));
|
|
98
|
-
// Button types
|
|
99
|
-
var ButtonType;
|
|
100
|
-
(function (ButtonType) {
|
|
101
|
-
ButtonType["Okay"] = "okay";
|
|
102
|
-
ButtonType["Cancel"] = "cancel";
|
|
103
|
-
ButtonType["Yes"] = "yes";
|
|
104
|
-
ButtonType["No"] = "no";
|
|
105
|
-
ButtonType["Abandon"] = "abandon";
|
|
106
|
-
ButtonType["GoBack"] = "goBack";
|
|
107
|
-
ButtonType["Continue"] = "continue";
|
|
108
|
-
ButtonType["ImSure"] = "imSure";
|
|
109
|
-
ButtonType["Delete"] = "delete";
|
|
110
|
-
ButtonType["Confirm"] = "confirm";
|
|
111
|
-
})(ButtonType || (ButtonType = {}));
|
|
112
|
-
// Modal type to list of buttons
|
|
113
|
-
var modalTypeToButtonTypes = (_a = {},
|
|
114
|
-
_a[ModalType.Okay] = [
|
|
115
|
-
ButtonType.Okay,
|
|
116
|
-
],
|
|
117
|
-
_a[ModalType.OkayCancel] = [
|
|
118
|
-
ButtonType.Okay,
|
|
119
|
-
ButtonType.Cancel,
|
|
120
|
-
],
|
|
121
|
-
_a[ModalType.YesNo] = [
|
|
122
|
-
ButtonType.Yes,
|
|
123
|
-
ButtonType.No,
|
|
124
|
-
],
|
|
125
|
-
_a[ModalType.YesNoCancel] = [
|
|
126
|
-
ButtonType.Yes,
|
|
127
|
-
ButtonType.No,
|
|
128
|
-
ButtonType.Cancel,
|
|
129
|
-
],
|
|
130
|
-
_a[ModalType.AbandonGoBack] = [
|
|
131
|
-
ButtonType.Abandon,
|
|
132
|
-
ButtonType.GoBack,
|
|
133
|
-
],
|
|
134
|
-
_a[ModalType.ImSureCancel] = [
|
|
135
|
-
ButtonType.ImSure,
|
|
136
|
-
ButtonType.Cancel,
|
|
137
|
-
],
|
|
138
|
-
_a[ModalType.DeleteCancel] = [
|
|
139
|
-
ButtonType.Delete,
|
|
140
|
-
ButtonType.Cancel,
|
|
141
|
-
],
|
|
142
|
-
_a[ModalType.ConfirmCancel] = [
|
|
143
|
-
ButtonType.Confirm,
|
|
144
|
-
ButtonType.Cancel,
|
|
145
|
-
],
|
|
146
|
-
_a);
|
|
147
|
-
// Button type styling and labels
|
|
148
|
-
var buttonTypeToLabelAndVariant = (_b = {},
|
|
149
|
-
_b[ButtonType.Okay] = {
|
|
150
|
-
label: 'Okay',
|
|
151
|
-
variant: Variant_1.default.Dark,
|
|
152
|
-
},
|
|
153
|
-
_b[ButtonType.Cancel] = {
|
|
154
|
-
label: 'Cancel',
|
|
155
|
-
variant: Variant_1.default.Secondary,
|
|
156
|
-
},
|
|
157
|
-
_b[ButtonType.Yes] = {
|
|
158
|
-
label: 'Yes',
|
|
159
|
-
variant: Variant_1.default.Dark,
|
|
160
|
-
},
|
|
161
|
-
_b[ButtonType.No] = {
|
|
162
|
-
label: 'No',
|
|
163
|
-
variant: Variant_1.default.Secondary,
|
|
164
|
-
},
|
|
165
|
-
_b[ButtonType.Abandon] = {
|
|
166
|
-
label: 'Abandon Changes',
|
|
167
|
-
variant: Variant_1.default.Warning,
|
|
168
|
-
},
|
|
169
|
-
_b[ButtonType.GoBack] = {
|
|
170
|
-
label: 'Go Back',
|
|
171
|
-
variant: Variant_1.default.Secondary,
|
|
172
|
-
},
|
|
173
|
-
_b[ButtonType.Continue] = {
|
|
174
|
-
label: 'Continue',
|
|
175
|
-
variant: Variant_1.default.Dark,
|
|
176
|
-
},
|
|
177
|
-
_b[ButtonType.ImSure] = {
|
|
178
|
-
label: 'I am sure',
|
|
179
|
-
variant: Variant_1.default.Warning,
|
|
180
|
-
},
|
|
181
|
-
_b[ButtonType.Delete] = {
|
|
182
|
-
label: 'Yes, Delete',
|
|
183
|
-
variant: Variant_1.default.Danger,
|
|
184
|
-
},
|
|
185
|
-
_b[ButtonType.Confirm] = {
|
|
186
|
-
label: 'Confirm',
|
|
187
|
-
variant: Variant_1.default.Dark,
|
|
188
|
-
},
|
|
189
|
-
_b);
|
|
190
|
-
/*------------------------------------------------------------------------*/
|
|
191
|
-
/* Component */
|
|
192
|
-
/*------------------------------------------------------------------------*/
|
|
193
|
-
var Modal = function (props) {
|
|
194
|
-
/*------------------------------------------------------------------------*/
|
|
195
|
-
/* Setup */
|
|
196
|
-
/*------------------------------------------------------------------------*/
|
|
197
|
-
var _a;
|
|
198
|
-
/* -------------- Props ------------- */
|
|
199
|
-
var _b = props.type, type = _b === void 0 ? ModalType.NoButtons : _b, _c = props.size, size = _c === void 0 ? ModalSize.Large : _c, title = props.title, children = props.children, onClose = props.onClose;
|
|
200
|
-
/* -------------- State ------------- */
|
|
201
|
-
// If true, the modal is shown
|
|
202
|
-
var _d = (0, react_1.useState)(false), visible = _d[0], setVisible = _d[1];
|
|
203
|
-
// True if currently animating in
|
|
204
|
-
var _e = (0, react_1.useState)(false), animatingIn = _e[0], setAnimatingIn = _e[1];
|
|
205
|
-
/*------------------------------------------------------------------------*/
|
|
206
|
-
/* Lifecycle Functions */
|
|
207
|
-
/*------------------------------------------------------------------------*/
|
|
208
|
-
/**
|
|
209
|
-
* Mount
|
|
210
|
-
* @author Gabe Abrams
|
|
211
|
-
*/
|
|
212
|
-
(0, react_1.useEffect)(function () {
|
|
213
|
-
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
214
|
-
return __generator(this, function (_a) {
|
|
215
|
-
switch (_a.label) {
|
|
216
|
-
case 0:
|
|
217
|
-
// Start the component animating in
|
|
218
|
-
return [4 /*yield*/, (0, waitMs_1.default)(MS_ANIMATE_IN_DELAY)];
|
|
219
|
-
case 1:
|
|
220
|
-
// Start the component animating in
|
|
221
|
-
_a.sent();
|
|
222
|
-
setAnimatingIn(true);
|
|
223
|
-
// Wait and then set visible to true
|
|
224
|
-
return [4 /*yield*/, (0, waitMs_1.default)(MS_TO_ANIMATE)];
|
|
225
|
-
case 2:
|
|
226
|
-
// Wait and then set visible to true
|
|
227
|
-
_a.sent();
|
|
228
|
-
setVisible(true);
|
|
229
|
-
return [2 /*return*/];
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
}); })();
|
|
233
|
-
}, []);
|
|
234
|
-
/*------------------------------------------------------------------------*/
|
|
235
|
-
/* Component Functions */
|
|
236
|
-
/*------------------------------------------------------------------------*/
|
|
237
|
-
/**
|
|
238
|
-
* Handles the closing of the modal
|
|
239
|
-
* @author Gabe Abrams
|
|
240
|
-
* @param buttonType the button that was clicked when closing the
|
|
241
|
-
* modal
|
|
242
|
-
*/
|
|
243
|
-
var handleClose = function (buttonType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
244
|
-
return __generator(this, function (_a) {
|
|
245
|
-
switch (_a.label) {
|
|
246
|
-
case 0:
|
|
247
|
-
// Don't close if no handler
|
|
248
|
-
if (!onClose) {
|
|
249
|
-
return [2 /*return*/];
|
|
250
|
-
}
|
|
251
|
-
// Don't close if animating in
|
|
252
|
-
if (animatingIn) {
|
|
253
|
-
return [2 /*return*/];
|
|
254
|
-
}
|
|
255
|
-
// Don't close if already closed
|
|
256
|
-
if (!visible) {
|
|
257
|
-
return [2 /*return*/];
|
|
258
|
-
}
|
|
259
|
-
// Update the state
|
|
260
|
-
setVisible(false);
|
|
261
|
-
// Call the handler after the modal has animated out
|
|
262
|
-
return [4 /*yield*/, (0, waitMs_1.default)(MS_TO_ANIMATE)];
|
|
263
|
-
case 1:
|
|
264
|
-
// Call the handler after the modal has animated out
|
|
265
|
-
_a.sent();
|
|
266
|
-
onClose(buttonType);
|
|
267
|
-
return [2 /*return*/];
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
}); };
|
|
271
|
-
/*------------------------------------------------------------------------*/
|
|
272
|
-
/* Render */
|
|
273
|
-
/*------------------------------------------------------------------------*/
|
|
274
|
-
/*----------------------------------------*/
|
|
275
|
-
/* Footer */
|
|
276
|
-
/*----------------------------------------*/
|
|
277
|
-
// Get list of buttons for this modal type
|
|
278
|
-
var buttonTypes = (_a = modalTypeToButtonTypes[type]) !== null && _a !== void 0 ? _a : [];
|
|
279
|
-
// Create buttons
|
|
280
|
-
var buttons = buttonTypes.map(function (buttonType, i) {
|
|
281
|
-
// Get default style
|
|
282
|
-
var _a = buttonTypeToLabelAndVariant[buttonType], label = _a.label, variant = _a.variant;
|
|
283
|
-
// Override with customizations
|
|
284
|
-
if (props["".concat(buttonType, "Label")]) {
|
|
285
|
-
label = props["".concat(buttonType, "Label")];
|
|
286
|
-
}
|
|
287
|
-
if (props["".concat(buttonType, "Variant")]) {
|
|
288
|
-
variant = props["".concat(buttonType, "Variant")];
|
|
289
|
-
}
|
|
290
|
-
// Check if this button is last
|
|
291
|
-
var last = (i === buttonTypes.length - 1);
|
|
292
|
-
// Create the button
|
|
293
|
-
return ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", className: "Modal-".concat(buttonType, "-button btn btn-").concat(variant, " ").concat(last ? '' : 'mr-1'), onClick: function () {
|
|
294
|
-
handleClose(buttonType);
|
|
295
|
-
} }, { children: label })));
|
|
296
|
-
});
|
|
297
|
-
// Put all buttons in a footer
|
|
298
|
-
var footer = ((buttons && buttons.length)
|
|
299
|
-
? ((0, jsx_runtime_1.jsx)("div", { children: buttons }))
|
|
300
|
-
: undefined);
|
|
301
|
-
// Render the modal
|
|
302
|
-
return ((0, jsx_runtime_1.jsxs)(Modal_1.default, __assign({ show: visible, size: size !== ModalSize.Medium ? size : undefined, onHide: function () {
|
|
303
|
-
handleClose(ButtonType.Cancel);
|
|
304
|
-
}, style: { zIndex: 5000000000 }, backdropClassName: "Modal-backdrop", centered: true }, { children: [(0, jsx_runtime_1.jsx)("style", { children: style }), title && ((0, jsx_runtime_1.jsx)(Modal_1.default.Header, __assign({ closeButton: !!onClose }, { children: (0, jsx_runtime_1.jsx)(Modal_1.default.Title, { children: title }) }))), children && ((0, jsx_runtime_1.jsx)(Modal_1.default.Body, { children: children })), footer && ((0, jsx_runtime_1.jsx)(Modal_1.default.Footer, { children: footer }))] })));
|
|
305
|
-
};
|
|
306
|
-
/*------------------------------------------------------------------------*/
|
|
307
|
-
/* Wrap Up */
|
|
308
|
-
/*------------------------------------------------------------------------*/
|
|
309
|
-
// Add enums
|
|
310
|
-
Modal.ModalType = ModalType;
|
|
311
|
-
Modal.ModalSize = ModalSize;
|
|
312
|
-
Modal.ButtonType = ButtonType;
|
|
313
|
-
Modal.Variant = Variant_1.default;
|
|
314
|
-
exports.default = Modal;
|
|
315
|
-
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AAEH,eAAe;AACf,+BAAmD;AAEnD,0BAA0B;AAC1B,gEAAmD;AACnD,6DAAuC;AAEvC,eAAe;AACf,6DAAuC;AAEvC,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,IAAM,KAAK,GAAG,6kCAiDb,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,YAAY;AACZ,IAAM,aAAa,GAAG,GAAG,CAAC,CAAC,gDAAgD;AAC3E,IAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,2EAA2E;AAE3E,cAAc;AACd,IAAK,SAUJ;AAVD,WAAK,SAAS;IACZ,0BAAa,CAAA;IACb,uCAA0B,CAAA;IAC1B,6BAAgB,CAAA;IAChB,0CAA6B,CAAA;IAC7B,6CAAgC,CAAA;IAChC,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