dce-reactkit 2.0.9 → 2.0.12
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/components/AppWrapper.d.ts +16 -1
- package/lib/components/AppWrapper.js +157 -13
- package/lib/components/AppWrapper.js.map +1 -1
- package/lib/components/Modal.d.ts +2 -0
- package/lib/components/Modal.js +9 -3
- package/lib/components/Modal.js.map +1 -1
- package/lib/components/TabBox.d.ts +11 -0
- package/lib/components/TabBox.js +42 -0
- package/lib/components/TabBox.js.map +1 -0
- package/lib/helpers/alert.d.ts +2 -0
- package/lib/helpers/alert.js +6 -0
- package/lib/helpers/alert.js.map +1 -0
- package/lib/helpers/confirm.d.ts +2 -0
- package/lib/helpers/confirm.js +6 -0
- package/lib/helpers/confirm.js.map +1 -0
- package/lib/helpers/showFatalError.d.ts +1 -1
- package/lib/helpers/showFatalError.js +2 -1
- package/lib/helpers/showFatalError.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AppWrapper.tsx +191 -11
- package/src/components/Modal.tsx +16 -2
- package/src/components/TabBox.tsx +136 -0
- package/src/helpers/alert.tsx +5 -0
- package/src/helpers/confirm.tsx +5 -0
- package/src/helpers/showFatalError.tsx +3 -1
- package/lib/components/AppWrapper.tsx +0 -181
- package/lib/components/ErrorBox.tsx +0 -124
- package/lib/components/LoadingSpinner.tsx +0 -105
- package/lib/components/Modal.tsx +0 -447
- package/lib/errors/ErrorWithCode.tsx +0 -15
- package/lib/helpers/abbreviate.tsx +0 -23
- package/lib/helpers/avg.tsx +0 -22
- package/lib/helpers/ceilToNumDecimals.tsx +0 -13
- package/lib/helpers/floorToNumDecimals.tsx +0 -13
- package/lib/helpers/forceNumIntoBounds.tsx +0 -19
- package/lib/helpers/handleError.ts +0 -65
- package/lib/helpers/handleSuccess.ts +0 -18
- package/lib/helpers/padDecimalZeros.tsx +0 -32
- package/lib/helpers/padZerosLeft.tsx +0 -21
- package/lib/helpers/parseRequest.ts +0 -299
- package/lib/helpers/roundToNumDecimals.tsx +0 -13
- package/lib/helpers/showFatalError.tsx +0 -3
- package/lib/helpers/sum.tsx +0 -16
- package/lib/helpers/visitServerEndpoint.tsx +0 -110
- package/lib/helpers/waitMs.tsx +0 -12
- package/lib/types/ParamType.ts +0 -18
- package/lib/types/ReactKitErrorCode.tsx +0 -16
- package/lib/types/Variant.tsx +0 -16
|
@@ -9,12 +9,27 @@ declare type Props = {
|
|
|
9
9
|
dark?: boolean;
|
|
10
10
|
sessionExpiredMessage?: string;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Show an alert modal with an "Okay" button
|
|
14
|
+
* @author Gabe Abrams
|
|
15
|
+
* @param title the title text to display at the top of the alert
|
|
16
|
+
* @param text the text to display in the alert
|
|
17
|
+
*/
|
|
18
|
+
export declare const _alert: (title: string, text: string) => Promise<unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* Show a confirmation modal with an "Okay" and a "Cancel" button
|
|
21
|
+
* @author Gabe Abrams
|
|
22
|
+
* @param title the title text to display at the top of the alert
|
|
23
|
+
* @param text the text to display in the alert
|
|
24
|
+
* @returns true if the user confirmed
|
|
25
|
+
*/
|
|
26
|
+
export declare const _confirm: (title: string, text: string) => Promise<boolean>;
|
|
12
27
|
/**
|
|
13
28
|
* Show a fatal error message
|
|
14
29
|
* @author Gabe Abrams
|
|
15
30
|
* @param error the error to show
|
|
16
31
|
* @param [errorTitle] title of the error box
|
|
17
32
|
*/
|
|
18
|
-
export declare const
|
|
33
|
+
export declare const _showFatalError: (error: any, errorTitle?: string) => Promise<unknown>;
|
|
19
34
|
declare const AppWrapper: (props: Props) => React.ReactElement;
|
|
20
35
|
export default AppWrapper;
|
|
@@ -10,11 +10,47 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
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
|
+
};
|
|
13
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
51
|
};
|
|
16
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
53
|
+
exports._showFatalError = exports._confirm = exports._alert = void 0;
|
|
18
54
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
55
|
/**
|
|
20
56
|
* A wrapper for the entire React app that adds global functionality like
|
|
@@ -29,11 +65,83 @@ var ErrorBox_1 = __importDefault(require("./ErrorBox"));
|
|
|
29
65
|
var visitServerEndpoint_1 = require("../helpers/visitServerEndpoint");
|
|
30
66
|
// Import shared types
|
|
31
67
|
var ReactKitErrorCode_1 = __importDefault(require("../types/ReactKitErrorCode"));
|
|
68
|
+
// Import shared components
|
|
69
|
+
var Modal_1 = __importDefault(require("./Modal"));
|
|
32
70
|
// Import custom errors
|
|
33
71
|
var ErrorWithCode_1 = __importDefault(require("../errors/ErrorWithCode"));
|
|
34
72
|
/*------------------------------------------------------------------------*/
|
|
35
73
|
/* Static Helpers */
|
|
36
74
|
/*------------------------------------------------------------------------*/
|
|
75
|
+
/*----------------------------------------*/
|
|
76
|
+
/* Alert */
|
|
77
|
+
/*----------------------------------------*/
|
|
78
|
+
// Stored copies of setters
|
|
79
|
+
var setAlertInfo;
|
|
80
|
+
var onAlertClosed;
|
|
81
|
+
/**
|
|
82
|
+
* Show an alert modal with an "Okay" button
|
|
83
|
+
* @author Gabe Abrams
|
|
84
|
+
* @param title the title text to display at the top of the alert
|
|
85
|
+
* @param text the text to display in the alert
|
|
86
|
+
*/
|
|
87
|
+
var _alert = function (title, text) { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
// Fallback if alert not available
|
|
90
|
+
if (!setAlertInfo) {
|
|
91
|
+
return [2 /*return*/, window.alert("".concat(title, "\n\n").concat(text))];
|
|
92
|
+
}
|
|
93
|
+
// Return promise that resolves when alert is closed
|
|
94
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
95
|
+
// Setup handler
|
|
96
|
+
onAlertClosed = function () {
|
|
97
|
+
resolve(null);
|
|
98
|
+
};
|
|
99
|
+
// Show the alert
|
|
100
|
+
setAlertInfo({
|
|
101
|
+
title: title,
|
|
102
|
+
text: text,
|
|
103
|
+
});
|
|
104
|
+
})];
|
|
105
|
+
});
|
|
106
|
+
}); };
|
|
107
|
+
exports._alert = _alert;
|
|
108
|
+
/*----------------------------------------*/
|
|
109
|
+
/* Confirm */
|
|
110
|
+
/*----------------------------------------*/
|
|
111
|
+
// Stored copies of setters
|
|
112
|
+
var setConfirmInfo;
|
|
113
|
+
var onConfirmClosed;
|
|
114
|
+
/**
|
|
115
|
+
* Show a confirmation modal with an "Okay" and a "Cancel" button
|
|
116
|
+
* @author Gabe Abrams
|
|
117
|
+
* @param title the title text to display at the top of the alert
|
|
118
|
+
* @param text the text to display in the alert
|
|
119
|
+
* @returns true if the user confirmed
|
|
120
|
+
*/
|
|
121
|
+
var _confirm = function (title, text) { return __awaiter(void 0, void 0, void 0, function () {
|
|
122
|
+
return __generator(this, function (_a) {
|
|
123
|
+
// Fallback if confirm is not available
|
|
124
|
+
if (!setConfirmInfo) {
|
|
125
|
+
return [2 /*return*/, window.confirm("".concat(title, "\n\n").concat(text))];
|
|
126
|
+
}
|
|
127
|
+
// Return promise that resolves with result of confirmation
|
|
128
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
129
|
+
// Setup handler
|
|
130
|
+
onConfirmClosed = function (confirmed) {
|
|
131
|
+
resolve(confirmed);
|
|
132
|
+
};
|
|
133
|
+
// Show the confirm
|
|
134
|
+
setConfirmInfo({
|
|
135
|
+
title: title,
|
|
136
|
+
text: text,
|
|
137
|
+
});
|
|
138
|
+
})];
|
|
139
|
+
});
|
|
140
|
+
}); };
|
|
141
|
+
exports._confirm = _confirm;
|
|
142
|
+
/*----------------------------------------*/
|
|
143
|
+
/* Fatal Error */
|
|
144
|
+
/*----------------------------------------*/
|
|
37
145
|
// Stored copies of setters
|
|
38
146
|
var setFatalErrorMessage;
|
|
39
147
|
var setFatalErrorCode;
|
|
@@ -44,7 +152,7 @@ var setFatalErrorTitle;
|
|
|
44
152
|
* @param error the error to show
|
|
45
153
|
* @param [errorTitle] title of the error box
|
|
46
154
|
*/
|
|
47
|
-
var
|
|
155
|
+
var _showFatalError = function (error, errorTitle) {
|
|
48
156
|
var _a, _b;
|
|
49
157
|
if (errorTitle === void 0) { errorTitle = 'An Error Occurred'; }
|
|
50
158
|
// Determine message and code
|
|
@@ -56,14 +164,14 @@ var showFatalError = function (error, errorTitle) {
|
|
|
56
164
|
: String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode_1.default.NoCode));
|
|
57
165
|
// Handle case where app hasn't loaded
|
|
58
166
|
if (!setFatalErrorMessage || !setFatalErrorCode) {
|
|
59
|
-
return
|
|
167
|
+
return (0, exports._alert)(errorTitle, "".concat(message, " (code: ").concat(code, "). Please contact support."));
|
|
60
168
|
}
|
|
61
169
|
// Use setters
|
|
62
170
|
setFatalErrorMessage(message);
|
|
63
171
|
setFatalErrorCode(code);
|
|
64
172
|
setFatalErrorTitle(errorTitle);
|
|
65
173
|
};
|
|
66
|
-
exports.
|
|
174
|
+
exports._showFatalError = _showFatalError;
|
|
67
175
|
/*------------------------------------------------------------------------*/
|
|
68
176
|
/* Component */
|
|
69
177
|
/*------------------------------------------------------------------------*/
|
|
@@ -75,14 +183,20 @@ var AppWrapper = function (props) {
|
|
|
75
183
|
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
184
|
/* -------------- State ------------- */
|
|
77
185
|
// Fatal error
|
|
78
|
-
var _b = (0, react_1.useState)(
|
|
186
|
+
var _b = (0, react_1.useState)(), fatalErrorMessage = _b[0], setFatalErrorMessageInner = _b[1];
|
|
79
187
|
setFatalErrorMessage = setFatalErrorMessageInner;
|
|
80
|
-
var _c = (0, react_1.useState)(
|
|
188
|
+
var _c = (0, react_1.useState)(), fatalErrorCode = _c[0], setFatalErrorCodeInner = _c[1];
|
|
81
189
|
setFatalErrorCode = setFatalErrorCodeInner;
|
|
82
|
-
var _d = (0, react_1.useState)(
|
|
190
|
+
var _d = (0, react_1.useState)(), fatalErrorTitle = _d[0], setFatalErrorTitleInner = _d[1];
|
|
83
191
|
setFatalErrorTitle = setFatalErrorTitleInner;
|
|
192
|
+
// Alert
|
|
193
|
+
var _e = (0, react_1.useState)(), alertInfo = _e[0], setAlertInfoInner = _e[1];
|
|
194
|
+
setAlertInfo = setAlertInfoInner;
|
|
195
|
+
// Confirm
|
|
196
|
+
var _f = (0, react_1.useState)(), confirmInfo = _f[0], setConfirmInfoInner = _f[1];
|
|
197
|
+
setConfirmInfo = setConfirmInfoInner;
|
|
84
198
|
// Session expired
|
|
85
|
-
var
|
|
199
|
+
var _g = (0, react_1.useState)(false), sessionHasExpired = _g[0], setSessionHasExpired = _g[1];
|
|
86
200
|
/*------------------------------------------------------------------------*/
|
|
87
201
|
/* Lifecycle Functions */
|
|
88
202
|
/*------------------------------------------------------------------------*/
|
|
@@ -101,16 +215,40 @@ var AppWrapper = function (props) {
|
|
|
101
215
|
/* Render */
|
|
102
216
|
/*------------------------------------------------------------------------*/
|
|
103
217
|
/*----------------------------------------*/
|
|
104
|
-
/*
|
|
218
|
+
/* Modal */
|
|
219
|
+
/*----------------------------------------*/
|
|
220
|
+
// Modal that may be defined
|
|
221
|
+
var modal;
|
|
222
|
+
/* -------------- Alert ------------- */
|
|
223
|
+
if (alertInfo) {
|
|
224
|
+
modal = ((0, jsx_runtime_1.jsx)(Modal_1.default, __assign({ title: alertInfo.title, type: Modal_1.default.ModalType.Okay, onClose: function () {
|
|
225
|
+
// Alert closed
|
|
226
|
+
if (onAlertClosed) {
|
|
227
|
+
onAlertClosed();
|
|
228
|
+
}
|
|
229
|
+
}, onTopOfOtherModals: true }, { children: alertInfo.text })));
|
|
230
|
+
}
|
|
231
|
+
/* ------------- Confirm ------------ */
|
|
232
|
+
if (confirmInfo) {
|
|
233
|
+
modal = ((0, jsx_runtime_1.jsx)(Modal_1.default, { title: confirmInfo.title, type: Modal_1.default.ModalType.OkayCancel, onClose: function (buttonType) {
|
|
234
|
+
if (onConfirmClosed) {
|
|
235
|
+
onConfirmClosed(buttonType === Modal_1.default.ButtonType.Okay);
|
|
236
|
+
}
|
|
237
|
+
}, dontAllowBackdropExit: true }));
|
|
238
|
+
}
|
|
105
239
|
/*----------------------------------------*/
|
|
106
|
-
|
|
240
|
+
/* Views */
|
|
241
|
+
/*----------------------------------------*/
|
|
242
|
+
// Body that will be filled with the current view
|
|
243
|
+
var body;
|
|
244
|
+
/* ----------- Fatal Error ---------- */
|
|
107
245
|
if (fatalErrorMessage || fatalErrorCode || sessionHasExpired) {
|
|
108
246
|
// Re-encapsulate in an error
|
|
109
247
|
var error = (sessionHasExpired
|
|
110
248
|
? new ErrorWithCode_1.default(fatalErrorMessage, fatalErrorCode)
|
|
111
249
|
: new ErrorWithCode_1.default(sessionExpiredMessage, ReactKitErrorCode_1.default.SessionExpired));
|
|
112
250
|
// Build error screen
|
|
113
|
-
|
|
251
|
+
body = ((0, jsx_runtime_1.jsx)("div", __assign({ style: {
|
|
114
252
|
display: 'block',
|
|
115
253
|
width: '100vw',
|
|
116
254
|
minHeight: '100vh',
|
|
@@ -122,8 +260,14 @@ var AppWrapper = function (props) {
|
|
|
122
260
|
? 'Session Expired'
|
|
123
261
|
: fatalErrorTitle), error: error }) })));
|
|
124
262
|
}
|
|
125
|
-
|
|
126
|
-
|
|
263
|
+
/* --------------- App -------------- */
|
|
264
|
+
if (!body) {
|
|
265
|
+
body = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
|
|
266
|
+
}
|
|
267
|
+
/*----------------------------------------*/
|
|
268
|
+
/* Main UI */
|
|
269
|
+
/*----------------------------------------*/
|
|
270
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modal, body] }));
|
|
127
271
|
};
|
|
128
272
|
/*------------------------------------------------------------------------*/
|
|
129
273
|
/* Wrap Up */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppWrapper.js","sourceRoot":"","sources":["../../src/components/AppWrapper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppWrapper.js","sourceRoot":"","sources":["../../src/components/AppWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AAEH,eAAe;AACf,+BAAmD;AAEnD,2BAA2B;AAC3B,wDAAkC;AAElC,iBAAiB;AACjB,sEAAyE;AAEzE,sBAAsB;AACtB,iFAA2D;AAE3D,2BAA2B;AAC3B,kDAA4B;AAE5B,uBAAuB;AACvB,0EAAoD;AAepD,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,2BAA2B;AAC3B,IAAI,YAA6D,CAAC;AAClE,IAAI,aAAyB,CAAC;AAE9B;;;;;GAKG;AACI,IAAM,MAAM,GAAG,UAAO,KAAa,EAAE,IAAY;;QACtD,kCAAkC;QAClC,IAAI,CAAC,YAAY,EAAE;YACjB,sBAAO,MAAM,CAAC,KAAK,CAAC,UAAG,KAAK,iBAAO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IACJ,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,mBAAmB;AACnB,kBAAe,UAAU,CAAC"}
|
|
@@ -39,6 +39,7 @@ declare type Props = {
|
|
|
39
39
|
title?: React.ReactNode;
|
|
40
40
|
children?: React.ReactNode;
|
|
41
41
|
onClose?: (type: ButtonType) => void;
|
|
42
|
+
dontAllowBackdropExit?: boolean;
|
|
42
43
|
okayLabel?: string;
|
|
43
44
|
okayVariant?: Variant;
|
|
44
45
|
cancelLabel?: string;
|
|
@@ -59,6 +60,7 @@ declare type Props = {
|
|
|
59
60
|
deleteVariant?: Variant;
|
|
60
61
|
confirmLabel?: string;
|
|
61
62
|
confirmVariant?: Variant;
|
|
63
|
+
onTopOfOtherModals?: boolean;
|
|
62
64
|
};
|
|
63
65
|
declare const Modal: (React.FC<Props> & {
|
|
64
66
|
ModalType: typeof ModalType;
|
package/lib/components/Modal.js
CHANGED
|
@@ -196,7 +196,7 @@ var Modal = function (props) {
|
|
|
196
196
|
/*------------------------------------------------------------------------*/
|
|
197
197
|
var _a;
|
|
198
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;
|
|
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, dontAllowBackdropExit = props.dontAllowBackdropExit, onTopOfOtherModals = props.onTopOfOtherModals;
|
|
200
200
|
/* -------------- State ------------- */
|
|
201
201
|
// If true, the modal is shown
|
|
202
202
|
var _d = (0, react_1.useState)(false), visible = _d[0], setVisible = _d[1];
|
|
@@ -300,8 +300,14 @@ var Modal = function (props) {
|
|
|
300
300
|
: undefined);
|
|
301
301
|
// Render the modal
|
|
302
302
|
return ((0, jsx_runtime_1.jsxs)(Modal_1.default, __assign({ show: visible, size: size !== ModalSize.Medium ? size : undefined, onHide: function () {
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
if (!dontAllowBackdropExit) {
|
|
304
|
+
handleClose(ButtonType.Cancel);
|
|
305
|
+
}
|
|
306
|
+
}, style: {
|
|
307
|
+
zIndex: (onTopOfOtherModals
|
|
308
|
+
? 6000000000
|
|
309
|
+
: 5000000000),
|
|
310
|
+
}, 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
311
|
};
|
|
306
312
|
/*------------------------------------------------------------------------*/
|
|
307
313
|
/* Wrap Up */
|
|
@@ -1 +1 @@
|
|
|
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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AC;aAChC;QACH,CAAC,EACD,KAAK,EAAE;YACL,MAAM,EAAE,CACN,kBAAkB;gBAChB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU,CACf;SACF,EACD,iBAAiB,EAAC,gBAAgB,EAClC,QAAQ,uBAER,4CAAQ,KAAK,GAAS,EACrB,KAAK,IAAI,CACR,uBAAC,eAAc,CAAC,MAAM,aACpB,WAAW,EAAE,CAAC,CAAC,OAAO,gBAEtB,uBAAC,eAAc,CAAC,KAAK,cAClB,KAAK,GACe,IACD,CACzB,EACA,QAAQ,IAAI,CACX,uBAAC,eAAc,CAAC,IAAI,cACjB,QAAQ,GACW,CACvB,EACA,MAAM,IAAI,CACT,uBAAC,eAAc,CAAC,MAAM,cACnB,MAAM,GACe,CACzB,KACc,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,YAAY;AACZ,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;AAC5B,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;AAC5B,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAC9B,KAAK,CAAC,OAAO,GAAG,iBAAO,CAAC;AAExB,kBAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A box with a tab on the top that holds buttons and other content
|
|
3
|
+
* @author Gabe Abrams
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
declare type Props = {
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare const TabBox: React.FC<Props>;
|
|
11
|
+
export default TabBox;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
/* Style */
|
|
17
|
+
/*------------------------------------------------------------------------*/
|
|
18
|
+
var style = "\n/* Tab Box */\n.TabBox-box {\n /* Light Border */\n border: 2px solid #dedede;\n \n /* Rounded Corners (except top-left) */\n border-bottom-right-radius: 5px;\n border-bottom-left-radius: 5px;\n border-top-right-radius: 5px;\n\n /* Very Light Gray Border */\n background: #fdfdfd;\n\n /* Align Contents on Left */\n text-align: left;\n}\n\n/* Container for Title */\n.TabBox-title-container {\n /* Place on Left */\n position: relative;\n left: 0;\n text-align: left;\n}\n\n/* Tab-style Title */\n.TabBox-title {\n /* Place so it Barely Overlaps the Box Border */\n display: inline-block;\n position: relative;\n top: 2px; /* Gives Illusion that Border Doesn't Exist Below Tab */\n\n /* Title-sized Font */\n font-size: 25px;\n\n /* Add Border on Top and Sides */\n border-top: 2px solid #dedede;\n border-left: 2px solid #dedede;\n border-right: 2px solid #dedede;\n\n /* Round the Top Corners */\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n\n /* Add Text Padding */\n padding-left: 12px;\n padding-right: 12px;\n\n /* Match Background Color of Box */\n background: #fdfdfd;\n}\n\n/* Make the TabBox's Children Appear Above Title if Overlap Occurs */\n.TabBox-children {\n position: relative;\n z-index: 1;\n}\n";
|
|
19
|
+
/*------------------------------------------------------------------------*/
|
|
20
|
+
/* Component */
|
|
21
|
+
/*------------------------------------------------------------------------*/
|
|
22
|
+
var TabBox = function (props) {
|
|
23
|
+
/*------------------------------------------------------------------------*/
|
|
24
|
+
/* Setup */
|
|
25
|
+
/*------------------------------------------------------------------------*/
|
|
26
|
+
/* -------------- Props ------------- */
|
|
27
|
+
var title = props.title, children = props.children;
|
|
28
|
+
/*------------------------------------------------------------------------*/
|
|
29
|
+
/* Render */
|
|
30
|
+
/*------------------------------------------------------------------------*/
|
|
31
|
+
/*----------------------------------------*/
|
|
32
|
+
/* Main UI */
|
|
33
|
+
/*----------------------------------------*/
|
|
34
|
+
// Full UI
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("style", { children: style }), (0, jsx_runtime_1.jsx)("div", __assign({ className: "TabBox-title-container" }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "TabBox-title" }, { children: title })) })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "TabBox-box p-2" }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "TabBox-children" }, { children: children })) }))] }));
|
|
36
|
+
};
|
|
37
|
+
/*------------------------------------------------------------------------*/
|
|
38
|
+
/* Wrap Up */
|
|
39
|
+
/*------------------------------------------------------------------------*/
|
|
40
|
+
// Export component
|
|
41
|
+
exports.default = TabBox;
|
|
42
|
+
//# sourceMappingURL=TabBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabBox.js","sourceRoot":"","sources":["../../src/components/TabBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAmBA,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,IAAM,KAAK,GAAG,uvCA0Db,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,IAAM,MAAM,GAAoB,UAAC,KAAK;IACpC,4EAA4E;IAC5E,4EAA4E;IAC5E,4EAA4E;IAE5E,wCAAwC;IAGtC,IAAA,KAAK,GAEH,KAAK,MAFF,EACL,QAAQ,GACN,KAAK,SADC,CACA;IAEV,4EAA4E;IAC5E,4EAA4E;IAC5E,4EAA4E;IAE5E,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;IAE5C,UAAU;IACV,OAAO,CACL,4CAEE,4CAAQ,KAAK,GAAS,EAGtB,yCAAK,SAAS,EAAC,wBAAwB,gBACrC,yCAAK,SAAS,EAAC,cAAc,gBAC1B,KAAK,IACF,IACF,EAGN,yCAAK,SAAS,EAAC,gBAAgB,gBAC7B,yCAAK,SAAS,EAAC,iBAAiB,gBAC7B,QAAQ,IACL,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E,mBAAmB;AACnB,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../src/helpers/alert.tsx"],"names":[],"mappings":";;AAAA,uDAAkD;AAElD,IAAM,KAAK,GAAG,mBAAM,CAAC;AAErB,kBAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../../src/helpers/confirm.tsx"],"names":[],"mappings":";;AAAA,uDAAoD;AAEpD,IAAM,OAAO,GAAG,qBAAQ,CAAC;AAEzB,kBAAe,OAAO,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const showFatalError: (error: any, errorTitle?: string) => Promise<unknown>;
|
|
2
2
|
export default showFatalError;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var AppWrapper_1 = require("../components/AppWrapper");
|
|
4
|
-
|
|
4
|
+
var showFatalError = AppWrapper_1._showFatalError;
|
|
5
|
+
exports.default = showFatalError;
|
|
5
6
|
//# sourceMappingURL=showFatalError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"showFatalError.js","sourceRoot":"","sources":["../../src/helpers/showFatalError.tsx"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"showFatalError.js","sourceRoot":"","sources":["../../src/helpers/showFatalError.tsx"],"names":[],"mappings":";;AAAA,uDAA2D;AAE3D,IAAM,cAAc,GAAG,4BAAe,CAAC;AAEvC,kBAAe,cAAc,CAAC"}
|