dce-reactkit 2.0.10 → 3.0.0-beta.1
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/dist/cjs/index.js +36424 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types/components/AppWrapper.d.ts +40 -0
- package/{lib → dist/cjs/types}/components/ErrorBox.d.ts +0 -0
- package/{lib → dist/cjs/types}/components/LoadingSpinner.d.ts +1 -0
- package/dist/cjs/types/components/Modal.d.ts +40 -0
- package/dist/cjs/types/components/TabBox.d.ts +11 -0
- package/{lib → dist/cjs/types}/errors/ErrorWithCode.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/abbreviate.d.ts +1 -0
- package/{lib → dist/cjs/types}/helpers/avg.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/ceilToNumDecimals.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/floorToNumDecimals.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/forceNumIntoBounds.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/padDecimalZeros.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/padZerosLeft.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/roundToNumDecimals.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/sum.d.ts +0 -0
- package/{lib → dist/cjs/types}/helpers/waitMs.d.ts +0 -0
- package/dist/cjs/types/index.d.ts +22 -0
- package/dist/cjs/types/types/ModalButtonType.d.ts +17 -0
- package/dist/cjs/types/types/ModalSize.d.ts +11 -0
- package/dist/cjs/types/types/ModalType.d.ts +16 -0
- package/{lib → dist/cjs/types}/types/ReactKitErrorCode.d.ts +0 -0
- package/{lib → dist/cjs/types}/types/Variant.d.ts +0 -0
- package/dist/esm/index.js +36375 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types/components/AppWrapper.d.ts +40 -0
- package/dist/esm/types/components/ErrorBox.d.ts +12 -0
- package/dist/esm/types/components/LoadingSpinner.d.ts +7 -0
- package/dist/esm/types/components/Modal.d.ts +40 -0
- package/dist/esm/types/components/TabBox.d.ts +11 -0
- package/dist/esm/types/errors/ErrorWithCode.d.ts +9 -0
- package/dist/esm/types/helpers/abbreviate.d.ts +10 -0
- package/dist/esm/types/helpers/avg.d.ts +8 -0
- package/{src/helpers/ceilToNumDecimals.tsx → dist/esm/types/helpers/ceilToNumDecimals.d.ts} +1 -5
- package/{src/helpers/floorToNumDecimals.tsx → dist/esm/types/helpers/floorToNumDecimals.d.ts} +1 -5
- package/{src/helpers/forceNumIntoBounds.tsx → dist/esm/types/helpers/forceNumIntoBounds.d.ts} +1 -10
- package/dist/esm/types/helpers/padDecimalZeros.d.ts +10 -0
- package/{src/helpers/padZerosLeft.tsx → dist/esm/types/helpers/padZerosLeft.d.ts} +1 -13
- package/{src/helpers/roundToNumDecimals.tsx → dist/esm/types/helpers/roundToNumDecimals.d.ts} +1 -5
- package/{src/helpers/sum.tsx → dist/esm/types/helpers/sum.d.ts} +1 -9
- package/{src/helpers/waitMs.tsx → dist/esm/types/helpers/waitMs.d.ts} +1 -6
- package/dist/esm/types/index.d.ts +22 -0
- package/dist/esm/types/types/ModalButtonType.d.ts +17 -0
- package/dist/esm/types/types/ModalSize.d.ts +11 -0
- package/dist/esm/types/types/ModalType.d.ts +16 -0
- package/dist/esm/types/types/ReactKitErrorCode.d.ts +13 -0
- package/dist/esm/types/types/Variant.d.ts +15 -0
- package/dist/index.d.ts +274 -0
- package/package.json +23 -22
- package/.eslintrc.js +0 -95
- 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.d.ts +0 -14
- package/lib/helpers/handleError.js +0 -54
- package/lib/helpers/handleError.js.map +0 -1
- package/lib/helpers/handleSuccess.d.ts +0 -8
- 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.d.ts +0 -21
- 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.d.ts +0 -23
- 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.d.ts +0 -17
- 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/components/AppWrapper.tsx +0 -189
- package/src/components/ErrorBox.tsx +0 -124
- package/src/components/LoadingSpinner.tsx +0 -105
- package/src/components/Modal.tsx +0 -447
- package/src/errors/ErrorWithCode.tsx +0 -15
- package/src/helpers/abbreviate.tsx +0 -23
- package/src/helpers/avg.tsx +0 -22
- package/src/helpers/handleError.ts +0 -65
- package/src/helpers/handleSuccess.ts +0 -18
- package/src/helpers/padDecimalZeros.tsx +0 -32
- 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
- package/src/types/ReactKitErrorCode.tsx +0 -16
- package/src/types/Variant.tsx +0 -16
- package/tsconfig.json +0 -24
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A wrapper for the entire React app that adds global functionality like
|
|
3
|
+
* handling for fatal error messages
|
|
4
|
+
* @author Gabe Abrams
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
declare type Props = {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
dark?: boolean;
|
|
10
|
+
sessionExpiredMessage?: string;
|
|
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<undefined>;
|
|
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>;
|
|
27
|
+
/**
|
|
28
|
+
* Show a fatal error message
|
|
29
|
+
* @author Gabe Abrams
|
|
30
|
+
* @param error the error to show
|
|
31
|
+
* @param [errorTitle] title of the error box
|
|
32
|
+
*/
|
|
33
|
+
export declare const showFatalError: (error: any, errorTitle?: string) => undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Show the "session expired" message
|
|
36
|
+
* @author Gabe Abrams
|
|
37
|
+
*/
|
|
38
|
+
export declare const showSessionExpiredMessage: () => undefined;
|
|
39
|
+
declare const AppWrapper: React.FC<Props>;
|
|
40
|
+
export default AppWrapper;
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A generic popup modal
|
|
3
|
+
* @author Gabe Abrams
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import Variant from '../types/Variant';
|
|
7
|
+
import ModalButtonType from '../types/ModalButtonType';
|
|
8
|
+
import ModalSize from '../types/ModalSize';
|
|
9
|
+
import ModalType from '../types/ModalType';
|
|
10
|
+
declare type Props = {
|
|
11
|
+
type?: ModalType;
|
|
12
|
+
size?: ModalSize;
|
|
13
|
+
title?: React.ReactNode;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
onClose?: (type: ModalButtonType) => void;
|
|
16
|
+
dontAllowBackdropExit?: boolean;
|
|
17
|
+
okayLabel?: string;
|
|
18
|
+
okayVariant?: Variant;
|
|
19
|
+
cancelLabel?: string;
|
|
20
|
+
cancelVariant?: Variant;
|
|
21
|
+
yesLabel?: string;
|
|
22
|
+
yesVariant?: Variant;
|
|
23
|
+
noLabel?: string;
|
|
24
|
+
noVariant?: Variant;
|
|
25
|
+
abandonLabel?: string;
|
|
26
|
+
abandonVariant?: Variant;
|
|
27
|
+
goBackLabel?: string;
|
|
28
|
+
goBackVariant?: Variant;
|
|
29
|
+
continueLabel?: string;
|
|
30
|
+
continueVariant?: Variant;
|
|
31
|
+
imSureLabel?: string;
|
|
32
|
+
imSureVariant?: Variant;
|
|
33
|
+
deleteLabel?: string;
|
|
34
|
+
deleteVariant?: Variant;
|
|
35
|
+
confirmLabel?: string;
|
|
36
|
+
confirmVariant?: Variant;
|
|
37
|
+
onTopOfOtherModals?: boolean;
|
|
38
|
+
};
|
|
39
|
+
declare const Modal: React.FC<Props>;
|
|
40
|
+
export default Modal;
|
|
@@ -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;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import AppWrapper, { alert, confirm, showFatalError } from './components/AppWrapper';
|
|
2
|
+
import LoadingSpinner from './components/LoadingSpinner';
|
|
3
|
+
import ErrorBox from './components/ErrorBox';
|
|
4
|
+
import Modal from './components/Modal';
|
|
5
|
+
import TabBox from './components/TabBox';
|
|
6
|
+
import ErrorWithCode from './errors/ErrorWithCode';
|
|
7
|
+
import abbreviate from './helpers/abbreviate';
|
|
8
|
+
import avg from './helpers/avg';
|
|
9
|
+
import ceilToNumDecimals from './helpers/ceilToNumDecimals';
|
|
10
|
+
import floorToNumDecimals from './helpers/floorToNumDecimals';
|
|
11
|
+
import forceNumIntoBounds from './helpers/forceNumIntoBounds';
|
|
12
|
+
import padDecimalZeros from './helpers/padDecimalZeros';
|
|
13
|
+
import padZerosLeft from './helpers/padZerosLeft';
|
|
14
|
+
import roundToNumDecimals from './helpers/roundToNumDecimals';
|
|
15
|
+
import sum from './helpers/sum';
|
|
16
|
+
import waitMs from './helpers/waitMs';
|
|
17
|
+
import ModalButtonType from './types/ModalButtonType';
|
|
18
|
+
import ModalSize from './types/ModalSize';
|
|
19
|
+
import ModalType from './types/ModalType';
|
|
20
|
+
import ReactKitErrorCode from './types/ReactKitErrorCode';
|
|
21
|
+
import Variant from './types/Variant';
|
|
22
|
+
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, alert, confirm, showFatalError, ErrorWithCode, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of buttons in the modal
|
|
3
|
+
* @author Gabe Abrams
|
|
4
|
+
*/
|
|
5
|
+
declare enum ModalButtonType {
|
|
6
|
+
Okay = "okay",
|
|
7
|
+
Cancel = "cancel",
|
|
8
|
+
Yes = "yes",
|
|
9
|
+
No = "no",
|
|
10
|
+
Abandon = "abandon",
|
|
11
|
+
GoBack = "goBack",
|
|
12
|
+
Continue = "continue",
|
|
13
|
+
ImSure = "imSure",
|
|
14
|
+
Delete = "delete",
|
|
15
|
+
Confirm = "confirm"
|
|
16
|
+
}
|
|
17
|
+
export default ModalButtonType;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of modals
|
|
3
|
+
* @author Gabe Abrams
|
|
4
|
+
*/
|
|
5
|
+
declare enum ModalType {
|
|
6
|
+
Okay = "okay",
|
|
7
|
+
OkayCancel = "okay-cancel",
|
|
8
|
+
YesNo = "yes-no",
|
|
9
|
+
YesNoCancel = "yes-no-cancel",
|
|
10
|
+
AbandonGoBack = "abandon-goBack",
|
|
11
|
+
ImSureCancel = "imSure-cancel",
|
|
12
|
+
DeleteCancel = "delete-cancel",
|
|
13
|
+
ConfirmCancel = "confirm-cancel",
|
|
14
|
+
NoButtons = "-"
|
|
15
|
+
}
|
|
16
|
+
export default ModalType;
|
|
File without changes
|
|
File without changes
|