dce-reactkit 4.0.0-beta-date-and-time.1 → 4.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.
Files changed (43) hide show
  1. package/.vscode/settings.json +1 -3
  2. package/README.md +20 -0
  3. package/dist/cjs/index.js +1408 -2867
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/types/components/ItemPicker/index.d.ts +0 -1
  6. package/dist/cjs/types/components/ItemPicker/index.test.d.ts +1 -0
  7. package/dist/cjs/types/components/LoadingSpinner.d.ts +2 -2
  8. package/dist/cjs/types/components/Modal/ModalProps.d.ts +0 -2
  9. package/dist/cjs/types/components/SimpleDateChooser.d.ts +1 -3
  10. package/dist/cjs/types/components/TabBox.d.ts +0 -1
  11. package/dist/cjs/types/components/Tooltip.d.ts +1 -1
  12. package/dist/cjs/types/index.d.ts +1 -6
  13. package/dist/cjs/types/types/ReactKitErrorCode.d.ts +1 -3
  14. package/dist/esm/index.js +1423 -2878
  15. package/dist/esm/index.js.map +1 -1
  16. package/dist/esm/types/components/ItemPicker/index.d.ts +0 -1
  17. package/dist/esm/types/components/ItemPicker/index.test.d.ts +1 -0
  18. package/dist/esm/types/components/LoadingSpinner.d.ts +2 -2
  19. package/dist/esm/types/components/Modal/ModalProps.d.ts +0 -2
  20. package/dist/esm/types/components/SimpleDateChooser.d.ts +1 -3
  21. package/dist/esm/types/components/TabBox.d.ts +0 -1
  22. package/dist/esm/types/components/Tooltip.d.ts +1 -1
  23. package/dist/esm/types/index.d.ts +1 -6
  24. package/dist/esm/types/types/ReactKitErrorCode.d.ts +1 -3
  25. package/dist/index.d.ts +19 -77
  26. package/package.json +10 -6
  27. package/src/components/IntelliTable.tsx +1 -1
  28. package/src/components/ItemPicker/NestableItemList.tsx +0 -1
  29. package/src/components/ItemPicker/index.tsx +0 -96
  30. package/src/components/LogReviewer.tsx +2 -2
  31. package/src/components/Modal/ModalProps.ts +0 -4
  32. package/src/components/Modal/index.tsx +20 -59
  33. package/src/components/SimpleDateChooser.tsx +26 -62
  34. package/src/components/TabBox.tsx +9 -27
  35. package/src/components/Tooltip.tsx +1 -1
  36. package/src/index.ts +0 -10
  37. package/src/types/ReactKitErrorCode.tsx +1 -3
  38. package/dist/cjs/types/components/SimpleTimeChooser.d.ts +0 -20
  39. package/dist/cjs/types/helpers/getWordCount.d.ts +0 -10
  40. package/dist/esm/types/components/SimpleTimeChooser.d.ts +0 -20
  41. package/dist/esm/types/helpers/getWordCount.d.ts +0 -10
  42. package/src/components/SimpleTimeChooser.tsx +0 -195
  43. package/src/helpers/getWordCount.ts +0 -26
@@ -14,7 +14,6 @@ type Props = {
14
14
  */
15
15
  onChanged: (updatedItems: PickableItem[]) => void;
16
16
  noBottomMargin?: boolean;
17
- hideSelectAllOrNoneButtons?: boolean;
18
17
  };
19
18
  declare const ItemPicker: React.FC<Props>;
20
19
  export default ItemPicker;
@@ -2,6 +2,6 @@
2
2
  * Loading spinner/indicator
3
3
  * @author Gabe Abrams
4
4
  */
5
- import React from 'react';
6
- declare const LoadingSpinner: () => React.JSX.Element;
5
+ /// <reference types="react" />
6
+ declare const LoadingSpinner: () => JSX.Element;
7
7
  export default LoadingSpinner;
@@ -38,7 +38,5 @@ type ModalProps = {
38
38
  confirmLabel?: string;
39
39
  confirmVariant?: Variant;
40
40
  onTopOfOtherModals?: boolean;
41
- isLoading?: boolean;
42
- isLoadingCancelable?: boolean;
43
41
  };
44
42
  export default ModalProps;
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * A very simple, lightweight date chooser
3
3
  * @author Gabe Abrams
4
- * @author Gardeniu Liu
5
4
  */
6
5
  import React from 'react';
7
6
  type Props = {
@@ -18,8 +17,7 @@ type Props = {
18
17
  */
19
18
  onChange: (month: number, day: number, year: number) => void;
20
19
  numMonthsToShow?: number;
21
- dontAllowPast?: boolean;
22
- dontAllowFuture?: boolean;
20
+ chooseFromPast?: boolean;
23
21
  };
24
22
  declare const SimpleDateChooser: React.FC<Props>;
25
23
  export default SimpleDateChooser;
@@ -6,7 +6,6 @@ import React from 'react';
6
6
  type Props = {
7
7
  title: React.ReactNode;
8
8
  children: React.ReactNode;
9
- topRightChildren?: React.ReactNode;
10
9
  noBottomMargin?: boolean;
11
10
  noBottomPadding?: boolean;
12
11
  };
@@ -5,7 +5,7 @@
5
5
  import React from 'react';
6
6
  type Props = {
7
7
  text: string;
8
- children: any;
8
+ children: JSX.Element;
9
9
  };
10
10
  declare const Tooltip: React.FC<Props>;
11
11
  export default Tooltip;
@@ -7,7 +7,6 @@ import RadioButton from './components/RadioButton';
7
7
  import CheckboxButton from './components/CheckboxButton';
8
8
  import ButtonInputGroup from './components/ButtonInputGroup';
9
9
  import SimpleDateChooser from './components/SimpleDateChooser';
10
- import SimpleTimeChooser from './components/SimpleTimeChooser';
11
10
  import Drawer from './components/Drawer';
12
11
  import PopSuccessMark from './components/PopSuccessMark';
13
12
  import PopFailureMark from './components/PopFailureMark';
@@ -27,9 +26,6 @@ import ErrorWithCode from './errors/ErrorWithCode';
27
26
  import MINUTE_IN_MS from './constants/MINUTE_IN_MS';
28
27
  import HOUR_IN_MS from './constants/HOUR_IN_MS';
29
28
  import DAY_IN_MS from './constants/DAY_IN_MS';
30
- import LOG_REVIEW_ROUTE_PATH_PREFIX from './constants/LOG_REVIEW_ROUTE_PATH_PREFIX';
31
- import LOG_ROUTE_PATH from './constants/LOG_ROUTE_PATH';
32
- import LOG_REVIEW_STATUS_ROUTE from './constants/LOG_REVIEW_STATUS_ROUTE';
33
29
  import DynamicWord from './dynamicConstants/DynamicWord';
34
30
  import initClient from './helpers/initClient';
35
31
  import abbreviate from './helpers/abbreviate';
@@ -76,7 +72,6 @@ import mapAsync from './helpers/asyncArrayFunctions/mapAsync';
76
72
  import someAsync from './helpers/asyncArrayFunctions/someAsync';
77
73
  import capitalize from './helpers/capitalize';
78
74
  import shuffleArray from './helpers/shuffleArray';
79
- import getWordCount from './helpers/getWordCount';
80
75
  import ParamType from './types/ParamType';
81
76
  import ModalButtonType from './types/ModalButtonType';
82
77
  import ModalSize from './types/ModalSize';
@@ -101,4 +96,4 @@ import PickableItem from './components/ItemPicker/types/PickableItem';
101
96
  import DBEntry from './components/DBEntryManagerPanel/types/DBEntry';
102
97
  import DBEntryField from './components/DBEntryManagerPanel/types/DBEntryField';
103
98
  import DBEntryFieldType from './components/DBEntryManagerPanel/types/DBEntryFieldType';
104
- export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, SimpleTimeChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, Dropdown, alert, prompt, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_ROUTE_PATH, LOG_REVIEW_STATUS_ROUTE, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, prefixWithAOrAn, everyAsync, filterAsync, forEachAsync, mapAsync, someAsync, capitalize, shuffleArray, getWordCount, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, useForceRender, setClientEventMetadataPopulator, ParamType, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, LogFunction, LogTypeSpecificInfo, LogMainInfo, LogSourceSpecificInfo, LogLevel, IntelliTableColumn, DropdownItemType, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, };
99
+ export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, Dropdown, alert, prompt, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, prefixWithAOrAn, everyAsync, filterAsync, forEachAsync, mapAsync, someAsync, capitalize, shuffleArray, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, useForceRender, setClientEventMetadataPopulator, ParamType, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, LogFunction, LogTypeSpecificInfo, LogMainInfo, LogSourceSpecificInfo, LogLevel, IntelliTableColumn, DropdownItemType, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, };
@@ -6,8 +6,6 @@ declare enum ReactKitErrorCode {
6
6
  NoResponse = "DRK1",
7
7
  NoCode = "DRK2",
8
8
  SessionExpired = "DRK3",
9
- NoCACCLSendRequestFunction = "DRK7",
10
- SimpleDateChooserInvalidDateRange = "DRK35",
11
- SimpleDateChooserInvalidNumMonths = "DRK36"
9
+ NoCACCLSendRequestFunction = "DRK7"
12
10
  }
13
11
  export default ReactKitErrorCode;
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ declare enum Variant {
23
23
  * @author Gabe Abrams
24
24
  */
25
25
 
26
- type Props$m = {
26
+ type Props$l = {
27
27
  children: React$1.ReactNode;
28
28
  };
29
29
  /**
@@ -106,28 +106,27 @@ declare const showFatalError: (error: any, errorTitle?: string) => Promise<void>
106
106
  * @author Gabe Abrams
107
107
  */
108
108
  declare const addFatalErrorHandler: (handler: () => void) => void;
109
- declare const AppWrapper: React$1.FC<Props$m>;
109
+ declare const AppWrapper: React$1.FC<Props$l>;
110
110
 
111
111
  /**
112
112
  * Loading spinner/indicator
113
113
  * @author Gabe Abrams
114
114
  */
115
-
116
- declare const LoadingSpinner: () => React$1.JSX.Element;
115
+ declare const LoadingSpinner: () => JSX.Element;
117
116
 
118
117
  /**
119
118
  * Displays an error
120
119
  * @author Gabe Abrams
121
120
  */
122
121
 
123
- type Props$l = {
122
+ type Props$k = {
124
123
  error: any;
125
124
  title?: string;
126
125
  onClose?: () => void;
127
126
  variant?: Variant;
128
127
  icon?: IconProp;
129
128
  };
130
- declare const ErrorBox: React$1.FC<Props$l>;
129
+ declare const ErrorBox: React$1.FC<Props$k>;
131
130
 
132
131
  /**
133
132
  * Types of buttons in the modal
@@ -209,8 +208,6 @@ type ModalProps = {
209
208
  confirmLabel?: string;
210
209
  confirmVariant?: Variant;
211
210
  onTopOfOtherModals?: boolean;
212
- isLoading?: boolean;
213
- isLoadingCancelable?: boolean;
214
211
  };
215
212
 
216
213
  /**
@@ -226,21 +223,20 @@ declare const Modal: React$1.FC<ModalProps>;
226
223
  * @author Gabe Abrams
227
224
  */
228
225
 
229
- type Props$k = {
226
+ type Props$j = {
230
227
  title: React$1.ReactNode;
231
228
  children: React$1.ReactNode;
232
- topRightChildren?: React$1.ReactNode;
233
229
  noBottomMargin?: boolean;
234
230
  noBottomPadding?: boolean;
235
231
  };
236
- declare const TabBox: React$1.FC<Props$k>;
232
+ declare const TabBox: React$1.FC<Props$j>;
237
233
 
238
234
  /**
239
235
  * A radio selection button
240
236
  * @author Gabe Abrams
241
237
  */
242
238
 
243
- type Props$j = {
239
+ type Props$i = {
244
240
  text: React$1.ReactNode;
245
241
  onSelected: () => void;
246
242
  ariaLabel: string;
@@ -254,14 +250,14 @@ type Props$j = {
254
250
  small?: boolean;
255
251
  useComplexFormatting?: boolean;
256
252
  };
257
- declare const RadioButton: React$1.FC<Props$j>;
253
+ declare const RadioButton: React$1.FC<Props$i>;
258
254
 
259
255
  /**
260
256
  * A checkbox button
261
257
  * @author Gabe Abrams
262
258
  */
263
259
 
264
- type Props$i = {
260
+ type Props$h = {
265
261
  text: React$1.ReactNode;
266
262
  onChanged: (checked: boolean) => void;
267
263
  ariaLabel: string;
@@ -276,14 +272,14 @@ type Props$i = {
276
272
  dashed?: boolean;
277
273
  useComplexFormatting?: boolean;
278
274
  };
279
- declare const CheckboxButton: React$1.FC<Props$i>;
275
+ declare const CheckboxButton: React$1.FC<Props$h>;
280
276
 
281
277
  /**
282
278
  * Input group with a title and space for buttons
283
279
  * @author Gabe Abrams
284
280
  */
285
281
 
286
- type Props$h = {
282
+ type Props$g = {
287
283
  label: React$1.ReactNode;
288
284
  minLabelWidth?: string;
289
285
  children: React$1.ReactNode;
@@ -292,15 +288,14 @@ type Props$h = {
292
288
  isAdminFeature?: boolean;
293
289
  noMarginOnBottom?: boolean;
294
290
  };
295
- declare const ButtonInputGroup: React$1.FC<Props$h>;
291
+ declare const ButtonInputGroup: React$1.FC<Props$g>;
296
292
 
297
293
  /**
298
294
  * A very simple, lightweight date chooser
299
295
  * @author Gabe Abrams
300
- * @author Gardeniu Liu
301
296
  */
302
297
 
303
- type Props$g = {
298
+ type Props$f = {
304
299
  ariaLabel: string;
305
300
  name: string;
306
301
  month: number;
@@ -314,30 +309,9 @@ type Props$g = {
314
309
  */
315
310
  onChange: (month: number, day: number, year: number) => void;
316
311
  numMonthsToShow?: number;
317
- dontAllowPast?: boolean;
318
- dontAllowFuture?: boolean;
319
- };
320
- declare const SimpleDateChooser: React$1.FC<Props$g>;
321
-
322
- /**
323
- * A very simple, lightweight time chooser
324
- * @author Gardenia Liu
325
- */
326
-
327
- type Props$f = {
328
- ariaLabel: string;
329
- name: string;
330
- hour: number;
331
- minute: number;
332
- /**
333
- * Handler for when time changes
334
- * @param hour new 24hr hour number
335
- * @param minute new minute number
336
- */
337
- onChange: (hour: number, minute: number) => void;
338
- intervalMin?: number;
312
+ chooseFromPast?: boolean;
339
313
  };
340
- declare const SimpleTimeChooser: React$1.FC<Props$f>;
314
+ declare const SimpleDateChooser: React$1.FC<Props$f>;
341
315
 
342
316
  /**
343
317
  * Drawer container
@@ -437,7 +411,6 @@ type Props$9 = {
437
411
  */
438
412
  onChanged: (updatedItems: PickableItem[]) => void;
439
413
  noBottomMargin?: boolean;
440
- hideSelectAllOrNoneButtons?: boolean;
441
414
  };
442
415
  declare const ItemPicker: React$1.FC<Props$9>;
443
416
 
@@ -663,7 +636,7 @@ declare const DBEntryManagerPanel: React$1.FC<Props$5>;
663
636
 
664
637
  type Props$4 = {
665
638
  text: string;
666
- children: any;
639
+ children: JSX.Element;
667
640
  };
668
641
  declare const Tooltip: React$1.FC<Props$4>;
669
642
 
@@ -796,25 +769,6 @@ declare const HOUR_IN_MS = 3600000;
796
769
  */
797
770
  declare const DAY_IN_MS = 86400000;
798
771
 
799
- /**
800
- * Path of the route for storing client-side logs
801
- * @author Gabe Abrams
802
- */
803
- declare const LOG_REVIEW_ROUTE_PATH_PREFIX: string;
804
-
805
- /**
806
- * Path of the route for storing client-side logs
807
- * @author Gabe Abrams
808
- */
809
- declare const LOG_ROUTE_PATH: string;
810
-
811
- /**
812
- * Route for checking the status of the current user's
813
- * access to log review
814
- * @author Gabe Abrams
815
- */
816
- declare const LOG_REVIEW_STATUS_ROUTE: string;
817
-
818
772
  /**
819
773
  * Dynamic words determined by the user's platform
820
774
  * @author Gabe Abrams
@@ -1524,16 +1478,6 @@ declare const capitalize: (str: string) => string;
1524
1478
  */
1525
1479
  declare const shuffleArray: <T>(arr: T[]) => T[];
1526
1480
 
1527
- /**
1528
- * Get number of words in string
1529
- * @author Gardenia Liu
1530
- * @author Allison Zhang
1531
- * @author Gabe Abrams
1532
- * @param text the string to check
1533
- * @returns number of words in the string
1534
- */
1535
- declare const getWordCount: (text: string) => number;
1536
-
1537
1481
  /**
1538
1482
  * Days of the week
1539
1483
  * @author Gabe Abrams
@@ -1572,9 +1516,7 @@ declare enum ReactKitErrorCode {
1572
1516
  NoResponse = "DRK1",
1573
1517
  NoCode = "DRK2",
1574
1518
  SessionExpired = "DRK3",
1575
- NoCACCLSendRequestFunction = "DRK7",
1576
- SimpleDateChooserInvalidDateRange = "DRK35",
1577
- SimpleDateChooserInvalidNumMonths = "DRK36"
1519
+ NoCACCLSendRequestFunction = "DRK7"
1578
1520
  }
1579
1521
 
1580
- export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntry, DBEntryField, DBEntryFieldType, DBEntryManagerPanel, DayOfWeek, Drawer, Dropdown, DropdownItemType, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_REVIEW_STATUS_ROUTE, LOG_ROUTE_PATH, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogFunction, LogLevel, LogMainInfo, LogMetadataType, LogReviewer, LogSource, LogSourceSpecificInfo, LogType, LogTypeSpecificInfo, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, MultiSwitch, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, SimpleTimeChooser, TabBox, ToggleSwitch, Tooltip, Variant, abbreviate, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, getWordCount, idify, initClient, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, prompt, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
1522
+ export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntry, DBEntryField, DBEntryFieldType, DBEntryManagerPanel, DayOfWeek, Drawer, Dropdown, DropdownItemType, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogFunction, LogLevel, LogMainInfo, LogMetadataType, LogReviewer, LogSource, LogSourceSpecificInfo, LogType, LogTypeSpecificInfo, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, MultiSwitch, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant, abbreviate, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, idify, initClient, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, prompt, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "4.0.0-beta-date-and-time.1",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -33,22 +33,25 @@
33
33
  "@fortawesome/free-solid-svg-icons": "^x.x.x",
34
34
  "@fortawesome/react-fontawesome": "^x.x.x",
35
35
  "bootstrap": "^5.x.x",
36
- "react": "^x.x.x"
36
+ "express": "^x.x.x",
37
+ "react": "^x.x.x",
38
+ "react-dom": "^x.x.x"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@rollup/plugin-commonjs": "^22.0.0",
40
42
  "@rollup/plugin-json": "^4.1.0",
41
43
  "@rollup/plugin-node-resolve": "^13.2.1",
42
- "@rollup/plugin-typescript": "^10.0.1",
44
+ "@rollup/plugin-typescript": "^8.3.2",
43
45
  "@types/bootstrap": "^5.2.8",
44
46
  "@types/express": "^4.17.17",
45
47
  "@types/jest": "^28.1.7",
48
+ "@types/jwt-simple": "^0.5.36",
46
49
  "@types/node": "^20.2.5",
47
- "@types/react": "^19.0.10",
48
- "@types/react-dom": "^19.0.4",
50
+ "@types/oauth-signature": "^1.5.2",
51
+ "@types/react": "^17.0.7",
49
52
  "@typescript-eslint/eslint-plugin": "^5.59.9",
50
53
  "@typescript-eslint/parser": "^5.59.9",
51
- "eslint": "^8.42.0",
54
+ "eslint": "^8.57.1",
52
55
  "eslint-config-airbnb": "^19.0.4",
53
56
  "eslint-config-airbnb-typescript": "^17.0.0",
54
57
  "eslint-plugin-import": "^2.27.5",
@@ -57,6 +60,7 @@
57
60
  "eslint-plugin-react-hooks": "^4.6.0",
58
61
  "jest": "^28.1.3",
59
62
  "jest-environment-jsdom": "^28.1.3",
63
+ "oauth-signature": "^1.5.0",
60
64
  "rollup": "^2.70.2",
61
65
  "rollup-plugin-dts": "^4.2.1",
62
66
  "rollup-plugin-sourcemaps": "^0.6.3",
@@ -315,7 +315,7 @@ const IntelliTable: React.FC<Props> = (props) => {
315
315
  checked={columnVisibilityMap[column.param]}
316
316
  ariaLabel={`show "${column.title}" column in the ${title} table`}
317
317
  checkedVariant={Variant.Light}
318
- uncheckedVariant={Variant.Light}
318
+ uncheckedVariant={Variant.Secondary}
319
319
  />
320
320
  );
321
321
  })
@@ -272,7 +272,6 @@ const NestableItemList: React.FC<Props> = (props) => {
272
272
  }}
273
273
  ariaLabel={`Select ${item.name}`}
274
274
  checkedVariant={Variant.Light}
275
- uncheckedVariant={Variant.Light}
276
275
  />
277
276
 
278
277
  {/* Children */}
@@ -33,8 +33,6 @@ type Props = {
33
33
  onChanged: (updatedItems: PickableItem[]) => void,
34
34
  // If true, don't add margin to bottom of item picker
35
35
  noBottomMargin?: boolean,
36
- // If true, hide select all or none buttons
37
- hideSelectAllOrNoneButtons?: boolean,
38
36
  };
39
37
 
40
38
  /*------------------------------------------------------------------------*/
@@ -54,61 +52,12 @@ const ItemPicker: React.FC<Props> = (props) => {
54
52
  items,
55
53
  onChanged,
56
54
  noBottomMargin,
57
- hideSelectAllOrNoneButtons,
58
55
  } = props;
59
56
 
60
57
  /*------------------------------------------------------------------------*/
61
58
  /* ------------------------- Component Functions ------------------------ */
62
59
  /*------------------------------------------------------------------------*/
63
60
 
64
- /**
65
- * Updates the checked state of an item (including all children)
66
- * @author Yuen Ler Chow
67
- * @param item the item to update
68
- * @param checked the new checked state
69
- * @returns the updated item
70
- */
71
- const updateItemChecked = (
72
- item: PickableItem,
73
- checked: boolean,
74
- ): PickableItem => {
75
- if (item.isGroup) {
76
- return {
77
- ...item,
78
- children: item.children.map((child) => {
79
- return updateItemChecked(child, checked);
80
- }),
81
- };
82
- }
83
- return { ...item, checked };
84
- };
85
-
86
- /**
87
- * Selects all items in the list
88
- * @author Yuen Ler Chow
89
- */
90
- const handleSelectAll = () => {
91
- const updatedItems = items.map(
92
- (item) => {
93
- return updateItemChecked(item, true);
94
- },
95
- );
96
- onChanged(updatedItems);
97
- };
98
-
99
- /**
100
- * Deselects all items in the list
101
- * @author Yuen Ler Chow
102
- */
103
- const handleDeselectAll = () => {
104
- const updatedItems = items.map(
105
- (item) => {
106
- return updateItemChecked(item, false);
107
- },
108
- );
109
- onChanged(updatedItems);
110
- };
111
-
112
61
  /*------------------------------------------------------------------------*/
113
62
  /* ------------------------------- Render ------------------------------- */
114
63
  /*------------------------------------------------------------------------*/
@@ -117,55 +66,10 @@ const ItemPicker: React.FC<Props> = (props) => {
117
66
  /* --------------- Main UI -------------- */
118
67
  /*----------------------------------------*/
119
68
 
120
- // Select all/none
121
- const selectAllOrNone = (
122
- !hideSelectAllOrNoneButtons
123
- ? (
124
- <div
125
- className="d-flex h-100 align-items-end flex-row"
126
- >
127
- <div className="d-flex justify-content-end">
128
- {/* Label */}
129
- <div
130
- className="me-2"
131
- style={{ fontSize: '1.2rem' }}
132
- >
133
- Select
134
- </div>
135
- {/* Buttons */}
136
- <div className="btn-group" role="group">
137
- {/* All */}
138
- <button
139
- type="button"
140
- style={{ borderRight: '0.1rem solid white' }}
141
- aria-label="Select all contexts"
142
- className="btn btn-secondary py-0"
143
- onClick={handleSelectAll}
144
- >
145
- All
146
- </button>
147
- {/* None */}
148
- <button
149
- type="button"
150
- aria-label="Deselect all contexts"
151
- className="btn btn-secondary py-0"
152
- onClick={handleDeselectAll}
153
- >
154
- None
155
- </button>
156
- </div>
157
- </div>
158
- </div>
159
- )
160
- : undefined
161
- );
162
-
163
- // Main UI
164
69
  return (
165
70
  <TabBox
166
71
  title={title}
167
72
  noBottomMargin={noBottomMargin}
168
- topRightChildren={selectAllOrNone}
169
73
  >
170
74
  <div style={{ overflowX: 'auto' }}>
171
75
  <NestableItemList
@@ -1182,7 +1182,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1182
1182
  year={dateFilterState.startDate.year}
1183
1183
  month={dateFilterState.startDate.month}
1184
1184
  day={dateFilterState.startDate.day}
1185
- dontAllowFuture
1185
+ chooseFromPast
1186
1186
  numMonthsToShow={36}
1187
1187
  onChange={(month, day, year) => {
1188
1188
  dateFilterState.startDate = { month, day, year };
@@ -1198,7 +1198,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1198
1198
  year={dateFilterState.endDate.year}
1199
1199
  month={dateFilterState.endDate.month}
1200
1200
  day={dateFilterState.endDate.day}
1201
- dontAllowFuture
1201
+ chooseFromPast
1202
1202
  numMonthsToShow={12}
1203
1203
  onChange={(month, day, year) => {
1204
1204
  if (
@@ -69,10 +69,6 @@ type ModalProps = {
69
69
  confirmVariant?: Variant,
70
70
  // True if modal should be on top of other modals
71
71
  onTopOfOtherModals?: boolean,
72
- // If true, the modal is loading
73
- isLoading?: boolean,
74
- // If true, the loading is cancelable
75
- isLoadingCancelable?: boolean,
76
72
  };
77
73
 
78
74
  export default ModalProps;