dce-reactkit 2.0.11 → 3.0.0-beta.2

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.
Files changed (130) hide show
  1. package/dist/cjs/index.js +36424 -0
  2. package/dist/cjs/index.js.map +1 -0
  3. package/{lib → dist/cjs/types}/components/AppWrapper.d.ts +8 -3
  4. package/{lib → dist/cjs/types}/components/ErrorBox.d.ts +0 -0
  5. package/{lib → dist/cjs/types}/components/LoadingSpinner.d.ts +1 -0
  6. package/{lib → dist/cjs/types}/components/Modal.d.ts +5 -36
  7. package/{lib → dist/cjs/types}/components/TabBox.d.ts +0 -0
  8. package/{lib → dist/cjs/types}/errors/ErrorWithCode.d.ts +0 -0
  9. package/{lib → dist/cjs/types}/helpers/abbreviate.d.ts +1 -0
  10. package/{lib → dist/cjs/types}/helpers/avg.d.ts +0 -0
  11. package/{lib → dist/cjs/types}/helpers/ceilToNumDecimals.d.ts +0 -0
  12. package/{lib → dist/cjs/types}/helpers/floorToNumDecimals.d.ts +0 -0
  13. package/{lib → dist/cjs/types}/helpers/forceNumIntoBounds.d.ts +0 -0
  14. package/{lib → dist/cjs/types}/helpers/padDecimalZeros.d.ts +0 -0
  15. package/{lib → dist/cjs/types}/helpers/padZerosLeft.d.ts +0 -0
  16. package/{lib → dist/cjs/types}/helpers/roundToNumDecimals.d.ts +0 -0
  17. package/{lib → dist/cjs/types}/helpers/sum.d.ts +0 -0
  18. package/{lib → dist/cjs/types}/helpers/waitMs.d.ts +0 -0
  19. package/dist/cjs/types/index.d.ts +22 -0
  20. package/dist/cjs/types/types/ModalButtonType.d.ts +17 -0
  21. package/dist/cjs/types/types/ModalSize.d.ts +11 -0
  22. package/dist/cjs/types/types/ModalType.d.ts +16 -0
  23. package/{lib → dist/cjs/types}/types/ReactKitErrorCode.d.ts +0 -0
  24. package/{lib → dist/cjs/types}/types/Variant.d.ts +0 -0
  25. package/dist/esm/index.js +36375 -0
  26. package/dist/esm/index.js.map +1 -0
  27. package/dist/esm/types/components/AppWrapper.d.ts +40 -0
  28. package/dist/esm/types/components/ErrorBox.d.ts +12 -0
  29. package/dist/esm/types/components/LoadingSpinner.d.ts +7 -0
  30. package/dist/esm/types/components/Modal.d.ts +40 -0
  31. package/dist/esm/types/components/TabBox.d.ts +11 -0
  32. package/dist/esm/types/errors/ErrorWithCode.d.ts +9 -0
  33. package/dist/esm/types/helpers/abbreviate.d.ts +10 -0
  34. package/dist/esm/types/helpers/avg.d.ts +8 -0
  35. package/dist/esm/types/helpers/ceilToNumDecimals.d.ts +9 -0
  36. package/dist/esm/types/helpers/floorToNumDecimals.d.ts +9 -0
  37. package/dist/esm/types/helpers/forceNumIntoBounds.d.ts +10 -0
  38. package/dist/esm/types/helpers/padDecimalZeros.d.ts +10 -0
  39. package/dist/esm/types/helpers/padZerosLeft.d.ts +9 -0
  40. package/dist/esm/types/helpers/roundToNumDecimals.d.ts +9 -0
  41. package/dist/esm/types/helpers/sum.d.ts +8 -0
  42. package/dist/esm/types/helpers/waitMs.d.ts +7 -0
  43. package/dist/esm/types/index.d.ts +22 -0
  44. package/dist/esm/types/types/ModalButtonType.d.ts +17 -0
  45. package/dist/esm/types/types/ModalSize.d.ts +11 -0
  46. package/dist/esm/types/types/ModalType.d.ts +16 -0
  47. package/dist/esm/types/types/ReactKitErrorCode.d.ts +13 -0
  48. package/dist/esm/types/types/Variant.d.ts +15 -0
  49. package/dist/index.d.ts +274 -0
  50. package/package.json +20 -22
  51. package/rollup.config.js +42 -0
  52. package/src/components/AppWrapper.tsx +37 -36
  53. package/src/components/LoadingSpinner.tsx +3 -0
  54. package/src/components/Modal.tsx +50 -94
  55. package/src/helpers/abbreviate.tsx +2 -0
  56. package/src/helpers/padDecimalZeros.tsx +1 -1
  57. package/src/index.ts +61 -0
  58. package/src/types/ModalButtonType.tsx +18 -0
  59. package/src/types/ModalSize.tsx +12 -0
  60. package/src/types/ModalType.tsx +17 -0
  61. package/tsconfig.json +16 -17
  62. package/.eslintrc.js +0 -95
  63. package/lib/components/AppWrapper.js +0 -277
  64. package/lib/components/AppWrapper.js.map +0 -1
  65. package/lib/components/ErrorBox.js +0 -65
  66. package/lib/components/ErrorBox.js.map +0 -1
  67. package/lib/components/LoadingSpinner.js +0 -41
  68. package/lib/components/LoadingSpinner.js.map +0 -1
  69. package/lib/components/Modal.js +0 -321
  70. package/lib/components/Modal.js.map +0 -1
  71. package/lib/components/TabBox.js +0 -42
  72. package/lib/components/TabBox.js.map +0 -1
  73. package/lib/errors/ErrorWithCode.js +0 -33
  74. package/lib/errors/ErrorWithCode.js.map +0 -1
  75. package/lib/helpers/abbreviate.js +0 -21
  76. package/lib/helpers/abbreviate.js.map +0 -1
  77. package/lib/helpers/alert.d.ts +0 -2
  78. package/lib/helpers/alert.js +0 -5
  79. package/lib/helpers/alert.js.map +0 -1
  80. package/lib/helpers/avg.js +0 -24
  81. package/lib/helpers/avg.js.map +0 -1
  82. package/lib/helpers/ceilToNumDecimals.js +0 -15
  83. package/lib/helpers/ceilToNumDecimals.js.map +0 -1
  84. package/lib/helpers/confirm.d.ts +0 -2
  85. package/lib/helpers/confirm.js +0 -5
  86. package/lib/helpers/confirm.js.map +0 -1
  87. package/lib/helpers/floorToNumDecimals.js +0 -15
  88. package/lib/helpers/floorToNumDecimals.js.map +0 -1
  89. package/lib/helpers/forceNumIntoBounds.js +0 -15
  90. package/lib/helpers/forceNumIntoBounds.js.map +0 -1
  91. package/lib/helpers/handleError.d.ts +0 -14
  92. package/lib/helpers/handleError.js +0 -54
  93. package/lib/helpers/handleError.js.map +0 -1
  94. package/lib/helpers/handleSuccess.d.ts +0 -8
  95. package/lib/helpers/handleSuccess.js +0 -20
  96. package/lib/helpers/handleSuccess.js.map +0 -1
  97. package/lib/helpers/padDecimalZeros.js +0 -30
  98. package/lib/helpers/padDecimalZeros.js.map +0 -1
  99. package/lib/helpers/padZerosLeft.js +0 -21
  100. package/lib/helpers/padZerosLeft.js.map +0 -1
  101. package/lib/helpers/parseRequest.d.ts +0 -21
  102. package/lib/helpers/parseRequest.js +0 -240
  103. package/lib/helpers/parseRequest.js.map +0 -1
  104. package/lib/helpers/roundToNumDecimals.js +0 -15
  105. package/lib/helpers/roundToNumDecimals.js.map +0 -1
  106. package/lib/helpers/showFatalError.d.ts +0 -2
  107. package/lib/helpers/showFatalError.js +0 -5
  108. package/lib/helpers/showFatalError.js.map +0 -1
  109. package/lib/helpers/sum.js +0 -15
  110. package/lib/helpers/sum.js.map +0 -1
  111. package/lib/helpers/visitServerEndpoint.d.ts +0 -23
  112. package/lib/helpers/visitServerEndpoint.js +0 -135
  113. package/lib/helpers/visitServerEndpoint.js.map +0 -1
  114. package/lib/helpers/waitMs.js +0 -55
  115. package/lib/helpers/waitMs.js.map +0 -1
  116. package/lib/types/ParamType.d.ts +0 -17
  117. package/lib/types/ParamType.js +0 -21
  118. package/lib/types/ParamType.js.map +0 -1
  119. package/lib/types/ReactKitErrorCode.js +0 -18
  120. package/lib/types/ReactKitErrorCode.js.map +0 -1
  121. package/lib/types/Variant.js +0 -19
  122. package/lib/types/Variant.js.map +0 -1
  123. package/src/helpers/alert.tsx +0 -3
  124. package/src/helpers/confirm.tsx +0 -3
  125. package/src/helpers/handleError.ts +0 -65
  126. package/src/helpers/handleSuccess.ts +0 -18
  127. package/src/helpers/parseRequest.ts +0 -299
  128. package/src/helpers/showFatalError.tsx +0 -3
  129. package/src/helpers/visitServerEndpoint.tsx +0 -110
  130. package/src/types/ParamType.ts +0 -18
@@ -15,7 +15,7 @@ declare type Props = {
15
15
  * @param title the title text to display at the top of the alert
16
16
  * @param text the text to display in the alert
17
17
  */
18
- export declare const alert: (title: string, text: string) => Promise<unknown>;
18
+ export declare const alert: (title: string, text: string) => Promise<undefined>;
19
19
  /**
20
20
  * Show a confirmation modal with an "Okay" and a "Cancel" button
21
21
  * @author Gabe Abrams
@@ -30,6 +30,11 @@ export declare const confirm: (title: string, text: string) => Promise<boolean>;
30
30
  * @param error the error to show
31
31
  * @param [errorTitle] title of the error box
32
32
  */
33
- export declare const showFatalError: (error: any, errorTitle?: string) => Promise<unknown>;
34
- declare const AppWrapper: (props: Props) => React.ReactElement;
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>;
35
40
  export default AppWrapper;
File without changes
@@ -2,5 +2,6 @@
2
2
  * Loading spinner/indicator
3
3
  * @author Gabe Abrams
4
4
  */
5
+ /// <reference types="react" />
5
6
  declare const LoadingSpinner: () => JSX.Element;
6
7
  export default LoadingSpinner;
@@ -4,41 +4,15 @@
4
4
  */
5
5
  import React from 'react';
6
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
- }
7
+ import ModalButtonType from '../types/ModalButtonType';
8
+ import ModalSize from '../types/ModalSize';
9
+ import ModalType from '../types/ModalType';
36
10
  declare type Props = {
37
11
  type?: ModalType;
38
12
  size?: ModalSize;
39
13
  title?: React.ReactNode;
40
14
  children?: React.ReactNode;
41
- onClose?: (type: ButtonType) => void;
15
+ onClose?: (type: ModalButtonType) => void;
42
16
  dontAllowBackdropExit?: boolean;
43
17
  okayLabel?: string;
44
18
  okayVariant?: Variant;
@@ -62,10 +36,5 @@ declare type Props = {
62
36
  confirmVariant?: Variant;
63
37
  onTopOfOtherModals?: boolean;
64
38
  };
65
- declare const Modal: (React.FC<Props> & {
66
- ModalType: typeof ModalType;
67
- ModalSize: typeof ModalSize;
68
- ButtonType: typeof ButtonType;
69
- Variant: typeof Variant;
70
- });
39
+ declare const Modal: React.FC<Props>;
71
40
  export default Modal;
File without changes
@@ -7,3 +7,4 @@
7
7
  * (including ellipses if applicable)
8
8
  */
9
9
  declare const abbreviate: (text: string, maxChars: number) => string;
10
+ export default abbreviate;
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,11 @@
1
+ /**
2
+ * Modal sizes
3
+ * @author Gabe Abrams
4
+ */
5
+ declare enum ModalSize {
6
+ Small = "sm",
7
+ Medium = "md",
8
+ Large = "lg",
9
+ ExtraLarge = "xl"
10
+ }
11
+ export default ModalSize;
@@ -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