dce-reactkit 3.8.7 → 3.9.0-beta-loading-modal.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 (39) hide show
  1. package/dist/cjs/index.js +254 -386
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/Modal/ModalProps.d.ts +2 -0
  4. package/dist/cjs/types/index.d.ts +1 -3
  5. package/dist/cjs/types/types/ReactKitErrorCode.d.ts +1 -4
  6. package/dist/esm/index.js +256 -386
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/esm/types/components/Modal/ModalProps.d.ts +2 -0
  9. package/dist/esm/types/index.d.ts +1 -3
  10. package/dist/esm/types/types/ReactKitErrorCode.d.ts +1 -4
  11. package/dist/index.d.ts +46 -83
  12. package/package.json +1 -2
  13. package/src/components/Modal/ModalProps.ts +4 -0
  14. package/src/components/Modal/index.tsx +49 -21
  15. package/src/components/MultiSwitch.tsx +1 -1
  16. package/src/index.ts +0 -4
  17. package/src/types/ReactKitErrorCode.tsx +1 -6
  18. package/dist/cjs/types/components/Dropdown.d.ts +0 -32
  19. package/dist/cjs/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
  20. package/dist/cjs/types/helpers/validators/validURL.d.ts +0 -8
  21. package/dist/cjs/types/helpers/visitEndpointOnAnotherServer/index.d.ts +0 -22
  22. package/dist/cjs/types/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.d.ts +0 -33
  23. package/dist/cjs/types/types/DropdownItemType.d.ts +0 -6
  24. package/dist/esm/types/components/Dropdown.d.ts +0 -32
  25. package/dist/esm/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
  26. package/dist/esm/types/helpers/validators/validURL.d.ts +0 -8
  27. package/dist/esm/types/helpers/visitEndpointOnAnotherServer/index.d.ts +0 -22
  28. package/dist/esm/types/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.d.ts +0 -33
  29. package/dist/esm/types/types/DropdownItemType.d.ts +0 -6
  30. package/src/components/Dropdown.tsx +0 -317
  31. package/src/helpers/validators/ChicagoTitleCase.test.ts +0 -85
  32. package/src/helpers/validators/ChicagoTitleCase.ts +0 -32
  33. package/src/helpers/validators/findURL.test.ts +0 -83
  34. package/src/helpers/validators/findURL.ts +0 -43
  35. package/src/helpers/validators/validURL.test.ts +0 -90
  36. package/src/helpers/validators/validURL.ts +0 -18
  37. package/src/helpers/visitEndpointOnAnotherServer/index.ts +0 -90
  38. package/src/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.ts +0 -164
  39. package/src/types/DropdownItemType.ts +0 -11
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useRef, useEffect, useReducer, forwardRef, useContext, useLayoutEffect, createContext, useMemo, useCallback, Component, Fragment } from 'react';
3
- import { faExclamationTriangle, faHourglassEnd, faCircle, faDotCircle, faCheckSquare, faHourglass, faClipboard, faChevronDown, faChevronRight, faCloudDownloadAlt, faMinus, faCheckCircle, faXmarkCircle, faSort, faSortDown, faSortUp, faCalendar, faTag, faHammer, faList, faTimes, faSave, faTrash, faCog, faPlus } from '@fortawesome/free-solid-svg-icons';
3
+ import { faExclamationTriangle, faCircle, faHourglassEnd, faDotCircle, faCheckSquare, faHourglass, faClipboard, faChevronDown, faChevronRight, faCloudDownloadAlt, faMinus, faCheckCircle, faXmarkCircle, faSort, faSortDown, faSortUp, faCalendar, faTag, faHammer, faList, faTimes, faSave, faTrash, faCog, faPlus } from '@fortawesome/free-solid-svg-icons';
4
4
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
5
  import ReactDOM, { createPortal } from 'react-dom';
6
6
  import { faCircle as faCircle$1, faSquareMinus, faSquare } from '@fortawesome/free-regular-svg-icons';
@@ -30,7 +30,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
30
30
  });
31
31
  }
32
32
 
33
- // Highest error code = DRK16
33
+ // Highest error code = DRK13
34
34
  /**
35
35
  * List of error codes built into the react kit
36
36
  * @author Gabe Abrams
@@ -50,10 +50,6 @@ var ReactKitErrorCode;
50
50
  ReactKitErrorCode["NotAllowedToReviewLogs"] = "DRK11";
51
51
  ReactKitErrorCode["ThemeCheckedBeforeReactKitReady"] = "DRK12";
52
52
  ReactKitErrorCode["SessionExpiredMessageGottenBeforeReactKitReady"] = "DRK13";
53
- // Server-to-server requests
54
- ReactKitErrorCode["NotConnected"] = "DRK14";
55
- ReactKitErrorCode["SelfSigned"] = "DRK15";
56
- ReactKitErrorCode["ResponseParseError"] = "DRK16";
57
53
  })(ReactKitErrorCode || (ReactKitErrorCode = {}));
58
54
  var ReactKitErrorCode$1 = ReactKitErrorCode;
59
55
 
@@ -184,6 +180,98 @@ const LogBuiltInMetadata = {
184
180
  },
185
181
  };
186
182
 
183
+ /**
184
+ * Loading spinner/indicator
185
+ * @author Gabe Abrams
186
+ */
187
+ /*------------------------------------------------------------------------*/
188
+ /* -------------------------------- Style ------------------------------- */
189
+ /*------------------------------------------------------------------------*/
190
+ const style$a = `
191
+ /* Container fades in */
192
+ .LoadingSpinner-container {
193
+ animation-name: LoadingSpinner-container-fade-in;
194
+ animation-duration: 0.3s;
195
+ animation-delay: 0.4s;
196
+ animation-fill-mode: both;
197
+ animation-timing-function: ease-out;
198
+ }
199
+ @keyframes LoadingSpinner-container-fade-in {
200
+ 0% {
201
+ opacity: 0;
202
+ }
203
+ 100% {
204
+ opacity: 1;
205
+ }
206
+ }
207
+
208
+ /* Blips */
209
+ .LoadingSpinner-blip-1,
210
+ .LoadingSpinner-blip-2,
211
+ .LoadingSpinner-blip-3,
212
+ .LoadingSpinner-blip-4 {
213
+ font-size: 1.8rem;
214
+ opacity: 0.6;
215
+ margin-top: 1rem;
216
+ margin-bottom: 1rem;
217
+ }
218
+
219
+ /* First Blip */
220
+ .LoadingSpinner-blip-1 {
221
+ animation: LoadingSpinner-pop-animation 2s infinite;
222
+ }
223
+
224
+ /* Second Blip */
225
+ .LoadingSpinner-blip-2 {
226
+ animation: LoadingSpinner-pop-animation 2s infinite;
227
+ -webkit-animation-delay: 0.1s;
228
+ animation-delay: 0.1s;
229
+ }
230
+
231
+ /* Third Blip */
232
+ .LoadingSpinner-blip-3 {
233
+ animation: LoadingSpinner-pop-animation 2s infinite;
234
+ animation-delay: 0.2s;
235
+ }
236
+
237
+ /* Fourth Blip */
238
+ .LoadingSpinner-blip-4 {
239
+ animation: LoadingSpinner-pop-animation 2s infinite;
240
+ animation-delay: 0.3s;
241
+ }
242
+
243
+ /* Pop Animation for Each Blip */
244
+ @keyframes LoadingSpinner-pop-animation {
245
+ 0% {
246
+ transform: scale(1.0);
247
+ }
248
+ 10% {
249
+ transform: scale(1.5);
250
+ }
251
+ 30% {
252
+ transform: scale(1.0);
253
+ }
254
+ 100% {
255
+ transform: scale(1.0);
256
+ }
257
+ }
258
+ `;
259
+ /*------------------------------------------------------------------------*/
260
+ /* ------------------------------ Component ----------------------------- */
261
+ /*------------------------------------------------------------------------*/
262
+ const LoadingSpinner = () => {
263
+ /*------------------------------------------------------------------------*/
264
+ /* ------------------------------- Render ------------------------------- */
265
+ /*------------------------------------------------------------------------*/
266
+ // Add all four blips to a container
267
+ return (React__default.createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
268
+ React__default.createElement("style", null, style$a),
269
+ React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-1 me-1" }),
270
+ React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-2 me-1" }),
271
+ React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-3 me-1" }),
272
+ React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-4" })));
273
+ };
274
+
187
275
  /**
188
276
  * Wait for a certain number of ms
189
277
  * @author Gabe Abrams
@@ -304,6 +392,7 @@ const BASE_Z_INDEX = 1000000000;
304
392
  const BASE_Z_INDEX_ON_TOP = 2000000000;
305
393
  // Constants
306
394
  const MS_TO_ANIMATE = 200; // Animation duration
395
+ const MS_TO_WAIT_BEFORE_SHOWING_LOADING_INDICATOR = 1000;
307
396
  // Modal type to list of buttons
308
397
  const modalTypeToModalButtonTypes = {
309
398
  [ModalType$1.Okay]: [
@@ -414,7 +503,7 @@ const getNextUniqueId = () => {
414
503
  /*------------------------------------------------------------------------*/
415
504
  /* -------------------------------- Style ------------------------------- */
416
505
  /*------------------------------------------------------------------------*/
417
- const style$a = `
506
+ const style$9 = `
418
507
  .Modal-backdrop {
419
508
  position: fixed;
420
509
  top: 0;
@@ -486,13 +575,14 @@ const Modal = (props) => {
486
575
  /*------------------------------------------------------------------------*/
487
576
  var _a;
488
577
  /* -------------- Props ------------- */
489
- const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, largeTitle, children, onClose, dontAllowBackdropExit, dontShowXButton, onTopOfOtherModals, } = props;
578
+ const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, largeTitle, children, onClose, dontAllowBackdropExit, dontShowXButton, onTopOfOtherModals, isLoading, isLoadingCancelable, } = props;
490
579
  // Determine if no header either
491
580
  const noHeader = (!title && type === ModalType$1.NoButtons);
492
581
  /* -------------- State ------------- */
493
582
  // True if animation is in use
494
583
  const [animatingIn, setAnimatingIn] = useState(true);
495
584
  const [animatingPop, setAnimatingPop] = useState(false);
585
+ const [showModal, setShowModal] = useState(false);
496
586
  /* -------------- Refs -------------- */
497
587
  // Keep track of whether modal is still mounted
498
588
  const mounted = useRef(false);
@@ -519,6 +609,14 @@ const Modal = (props) => {
519
609
  if (mounted.current) {
520
610
  setAnimatingIn(false);
521
611
  }
612
+ if (isLoading) {
613
+ // wait before showing modal
614
+ yield waitMs(MS_TO_WAIT_BEFORE_SHOWING_LOADING_INDICATOR);
615
+ setShowModal(true);
616
+ }
617
+ else {
618
+ setShowModal(true);
619
+ }
522
620
  }))();
523
621
  return () => {
524
622
  mounted.current = false;
@@ -585,6 +683,9 @@ const Modal = (props) => {
585
683
  else if (animatingPop) {
586
684
  animationClass = 'Modal-animating-pop';
587
685
  }
686
+ // default to show close button when not loading and not show close button when loading
687
+ // unless downShowXButton or isLoadingCancelable
688
+ const showCloseButton = onClose && !dontShowXButton && !(isLoading && !isLoadingCancelable);
588
689
  // Render the modal
589
690
  const contentToRender = (React__default.createElement("div", { className: "modal show", tabIndex: -1, style: {
590
691
  zIndex: baseZIndex,
@@ -593,7 +694,7 @@ const Modal = (props) => {
593
694
  left: 0,
594
695
  right: 0,
595
696
  } },
596
- React__default.createElement("style", null, style$a),
697
+ React__default.createElement("style", null, style$9),
597
698
  React__default.createElement("div", { className: `Modal-backdrop ${backdropAnimationClass}`, style: {
598
699
  zIndex: baseZIndex + 1,
599
700
  }, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -611,11 +712,11 @@ const Modal = (props) => {
611
712
  // Handle close
612
713
  handleClose(ModalButtonType$1.Cancel);
613
714
  }) }),
614
- React__default.createElement("div", { className: `modal-dialog modal-${size} ${animationClass} modal-dialog-scrollable modal-dialog-centered`, style: {
715
+ showModal && (React__default.createElement("div", { className: `modal-dialog modal-${size} ${animationClass} modal-dialog-scrollable modal-dialog-centered`, style: {
615
716
  zIndex: baseZIndex + 2,
616
717
  // Override sizes for even larger for XL
617
718
  width: (size === ModalSize$1.ExtraLarge
618
- ? 'calc(100vw - 1rem)'
719
+ ? 'calc(100vw - 3rem)'
619
720
  : undefined),
620
721
  maxWidth: (size === ModalSize$1.ExtraLarge
621
722
  ? '80rem'
@@ -643,7 +744,7 @@ const Modal = (props) => {
643
744
  ? '1.6rem'
644
745
  : undefined),
645
746
  } }, title),
646
- (onClose && !dontShowXButton) && (React__default.createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
747
+ showCloseButton && (React__default.createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
647
748
  backgroundColor: (isDarkModeOn()
648
749
  ? 'white'
649
750
  : undefined),
@@ -651,14 +752,16 @@ const Modal = (props) => {
651
752
  // Handle close
652
753
  handleClose(ModalButtonType$1.Cancel);
653
754
  } })))),
654
- children && (React__default.createElement("div", { className: "modal-body", style: {
755
+ React__default.createElement("div", { className: "modal-body", style: {
655
756
  color: (isDarkModeOn()
656
757
  ? 'white'
657
758
  : undefined),
658
759
  backgroundColor: (isDarkModeOn()
659
760
  ? '#444'
660
761
  : undefined),
661
- } }, children)),
762
+ } }, isLoading ? (React__default.createElement(React__default.Fragment, null,
763
+ React__default.createElement(LoadingSpinner, null),
764
+ React__default.createElement("span", { className: "sr-only" }, "Content loading"))) : (children)),
662
765
  footer && (React__default.createElement("div", { className: "modal-footer pt-1 pb-1", style: {
663
766
  color: (isDarkModeOn()
664
767
  ? 'white'
@@ -669,7 +772,7 @@ const Modal = (props) => {
669
772
  borderTop: (isDarkModeOn()
670
773
  ? '0.1rem solid gray'
671
774
  : undefined),
672
- } }, footer))))));
775
+ } }, footer)))))));
673
776
  // Determine which portal to use
674
777
  const portalNumber = id.current % NUM_MODAL_PORTALS;
675
778
  // Render in a portal
@@ -1149,7 +1252,7 @@ const showSessionExpiredMessage = () => __awaiter(void 0, void 0, void 0, functi
1149
1252
  /*------------------------------------------------------------------------*/
1150
1253
  /* -------------------------------- Style ------------------------------- */
1151
1254
  /*------------------------------------------------------------------------*/
1152
- const style$9 = `
1255
+ const style$8 = `
1153
1256
  .AppWrapper-leave-to-url-notice {
1154
1257
  opacity: 0;
1155
1258
 
@@ -1324,105 +1427,13 @@ const AppWrapper = (props) => {
1324
1427
  /* --------------- Main UI -------------- */
1325
1428
  /*----------------------------------------*/
1326
1429
  return (React__default.createElement(React__default.Fragment, null,
1327
- React__default.createElement("style", null, style$9),
1430
+ React__default.createElement("style", null, style$8),
1328
1431
  React__default.createElement("style", null, tooltipStyle),
1329
1432
  modal,
1330
1433
  customModalPortals,
1331
1434
  body));
1332
1435
  };
1333
1436
 
1334
- /**
1335
- * Loading spinner/indicator
1336
- * @author Gabe Abrams
1337
- */
1338
- /*------------------------------------------------------------------------*/
1339
- /* -------------------------------- Style ------------------------------- */
1340
- /*------------------------------------------------------------------------*/
1341
- const style$8 = `
1342
- /* Container fades in */
1343
- .LoadingSpinner-container {
1344
- animation-name: LoadingSpinner-container-fade-in;
1345
- animation-duration: 0.3s;
1346
- animation-delay: 0.4s;
1347
- animation-fill-mode: both;
1348
- animation-timing-function: ease-out;
1349
- }
1350
- @keyframes LoadingSpinner-container-fade-in {
1351
- 0% {
1352
- opacity: 0;
1353
- }
1354
- 100% {
1355
- opacity: 1;
1356
- }
1357
- }
1358
-
1359
- /* Blips */
1360
- .LoadingSpinner-blip-1,
1361
- .LoadingSpinner-blip-2,
1362
- .LoadingSpinner-blip-3,
1363
- .LoadingSpinner-blip-4 {
1364
- font-size: 1.8rem;
1365
- opacity: 0.6;
1366
- margin-top: 1rem;
1367
- margin-bottom: 1rem;
1368
- }
1369
-
1370
- /* First Blip */
1371
- .LoadingSpinner-blip-1 {
1372
- animation: LoadingSpinner-pop-animation 2s infinite;
1373
- }
1374
-
1375
- /* Second Blip */
1376
- .LoadingSpinner-blip-2 {
1377
- animation: LoadingSpinner-pop-animation 2s infinite;
1378
- -webkit-animation-delay: 0.1s;
1379
- animation-delay: 0.1s;
1380
- }
1381
-
1382
- /* Third Blip */
1383
- .LoadingSpinner-blip-3 {
1384
- animation: LoadingSpinner-pop-animation 2s infinite;
1385
- animation-delay: 0.2s;
1386
- }
1387
-
1388
- /* Fourth Blip */
1389
- .LoadingSpinner-blip-4 {
1390
- animation: LoadingSpinner-pop-animation 2s infinite;
1391
- animation-delay: 0.3s;
1392
- }
1393
-
1394
- /* Pop Animation for Each Blip */
1395
- @keyframes LoadingSpinner-pop-animation {
1396
- 0% {
1397
- transform: scale(1.0);
1398
- }
1399
- 10% {
1400
- transform: scale(1.5);
1401
- }
1402
- 30% {
1403
- transform: scale(1.0);
1404
- }
1405
- 100% {
1406
- transform: scale(1.0);
1407
- }
1408
- }
1409
- `;
1410
- /*------------------------------------------------------------------------*/
1411
- /* ------------------------------ Component ----------------------------- */
1412
- /*------------------------------------------------------------------------*/
1413
- const LoadingSpinner = () => {
1414
- /*------------------------------------------------------------------------*/
1415
- /* ------------------------------- Render ------------------------------- */
1416
- /*------------------------------------------------------------------------*/
1417
- // Add all four blips to a container
1418
- return (React__default.createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
1419
- React__default.createElement("style", null, style$8),
1420
- React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-1 me-1" }),
1421
- React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-2 me-1" }),
1422
- React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-3 me-1" }),
1423
- React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-4" })));
1424
- };
1425
-
1426
1437
  /**
1427
1438
  * A box with a tab on the top that holds buttons and other content
1428
1439
  * @author Gabe Abrams
@@ -2214,27 +2225,27 @@ const PopPendingMark = (props) => {
2214
2225
  */
2215
2226
  /* ------------- Actions ------------ */
2216
2227
  // Types of actions
2217
- var ActionType$9;
2228
+ var ActionType$8;
2218
2229
  (function (ActionType) {
2219
2230
  // Indicate that the text was recently copied
2220
2231
  ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
2221
2232
  // Clear the status
2222
2233
  ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
2223
- })(ActionType$9 || (ActionType$9 = {}));
2234
+ })(ActionType$8 || (ActionType$8 = {}));
2224
2235
  /**
2225
2236
  * Reducer that executes actions
2226
2237
  * @author Gabe Abrams
2227
2238
  * @param state current state
2228
2239
  * @param action action to execute
2229
2240
  */
2230
- const reducer$a = (state, action) => {
2241
+ const reducer$9 = (state, action) => {
2231
2242
  switch (action.type) {
2232
- case ActionType$9.IndicateRecentlyCopied: {
2243
+ case ActionType$8.IndicateRecentlyCopied: {
2233
2244
  return {
2234
2245
  recentlyCopied: true,
2235
2246
  };
2236
2247
  }
2237
- case ActionType$9.ClearRecentlyCopiedStatus: {
2248
+ case ActionType$8.ClearRecentlyCopiedStatus: {
2238
2249
  return {
2239
2250
  recentlyCopied: false,
2240
2251
  };
@@ -2260,7 +2271,7 @@ const CopiableBox = (props) => {
2260
2271
  recentlyCopied: false,
2261
2272
  };
2262
2273
  // Initialize state
2263
- const [state, dispatch] = useReducer(reducer$a, initialState);
2274
+ const [state, dispatch] = useReducer(reducer$9, initialState);
2264
2275
  // Destructure common state
2265
2276
  const { recentlyCopied, } = state;
2266
2277
  /*------------------------------------------------------------------------*/
@@ -2280,13 +2291,13 @@ const CopiableBox = (props) => {
2280
2291
  }
2281
2292
  // Show copied notice
2282
2293
  dispatch({
2283
- type: ActionType$9.IndicateRecentlyCopied,
2294
+ type: ActionType$8.IndicateRecentlyCopied,
2284
2295
  });
2285
2296
  // Wait a moment
2286
2297
  yield waitMs(4000);
2287
2298
  // Hide copied notice
2288
2299
  dispatch({
2289
- type: ActionType$9.ClearRecentlyCopiedStatus,
2300
+ type: ActionType$8.ClearRecentlyCopiedStatus,
2290
2301
  });
2291
2302
  });
2292
2303
  /*------------------------------------------------------------------------*/
@@ -2342,20 +2353,20 @@ const CopiableBox = (props) => {
2342
2353
  */
2343
2354
  /* ------------- Actions ------------ */
2344
2355
  // Types of actions
2345
- var ActionType$8;
2356
+ var ActionType$7;
2346
2357
  (function (ActionType) {
2347
2358
  // Toggle whether a child are being shown
2348
2359
  ActionType["ToggleChild"] = "toggle-child";
2349
- })(ActionType$8 || (ActionType$8 = {}));
2360
+ })(ActionType$7 || (ActionType$7 = {}));
2350
2361
  /**
2351
2362
  * Reducer that executes actions
2352
2363
  * @author Gabe Abrams
2353
2364
  * @param state current state
2354
2365
  * @param action action to execute
2355
2366
  */
2356
- const reducer$9 = (state, action) => {
2367
+ const reducer$8 = (state, action) => {
2357
2368
  switch (action.type) {
2358
- case ActionType$8.ToggleChild: {
2369
+ case ActionType$7.ToggleChild: {
2359
2370
  return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
2360
2371
  }
2361
2372
  default: {
@@ -2384,7 +2395,7 @@ const NestableItemList = (props) => {
2384
2395
  childExpanded: initChildExpanded,
2385
2396
  };
2386
2397
  // Initialize state
2387
- const [state, dispatch] = useReducer(reducer$9, initialState);
2398
+ const [state, dispatch] = useReducer(reducer$8, initialState);
2388
2399
  // Destructure common state
2389
2400
  const { childExpanded, } = state;
2390
2401
  /*------------------------------------------------------------------------*/
@@ -2474,7 +2485,7 @@ const NestableItemList = (props) => {
2474
2485
  backgroundColor: 'transparent',
2475
2486
  }, type: "button", onClick: () => {
2476
2487
  dispatch({
2477
- type: ActionType$8.ToggleChild,
2488
+ type: ActionType$7.ToggleChild,
2478
2489
  id: item.id,
2479
2490
  });
2480
2491
  }, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
@@ -2758,7 +2769,7 @@ var SortType;
2758
2769
  })(SortType || (SortType = {}));
2759
2770
  /* ------------- Actions ------------ */
2760
2771
  // Types of actions
2761
- var ActionType$7;
2772
+ var ActionType$6;
2762
2773
  (function (ActionType) {
2763
2774
  // Toggle sort column param
2764
2775
  ActionType["ToggleSortColumn"] = "toggle-sort-column";
@@ -2770,16 +2781,16 @@ var ActionType$7;
2770
2781
  ActionType["ShowAllColumns"] = "show-all-columns";
2771
2782
  // Hide all columns
2772
2783
  ActionType["HideAllColumns"] = "hide-all-columns";
2773
- })(ActionType$7 || (ActionType$7 = {}));
2784
+ })(ActionType$6 || (ActionType$6 = {}));
2774
2785
  /**
2775
2786
  * Reducer that executes actions
2776
2787
  * @author Gabe Abrams
2777
2788
  * @param state current state
2778
2789
  * @param action action to execute
2779
2790
  */
2780
- const reducer$8 = (state, action) => {
2791
+ const reducer$7 = (state, action) => {
2781
2792
  switch (action.type) {
2782
- case ActionType$7.ToggleSortColumn: {
2793
+ case ActionType$6.ToggleSortColumn: {
2783
2794
  if (action.param !== state.sortColumnParam) {
2784
2795
  // Different column param
2785
2796
  return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
@@ -2791,22 +2802,22 @@ const reducer$8 = (state, action) => {
2791
2802
  // Stop sorting by column
2792
2803
  return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
2793
2804
  }
2794
- case ActionType$7.UpdateColumnVisibility: {
2805
+ case ActionType$6.UpdateColumnVisibility: {
2795
2806
  const { columnVisibilityMap } = state;
2796
2807
  columnVisibilityMap[action.param] = action.visible;
2797
2808
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2798
2809
  }
2799
- case ActionType$7.ToggleColVisCusModalVisibility: {
2810
+ case ActionType$6.ToggleColVisCusModalVisibility: {
2800
2811
  return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
2801
2812
  }
2802
- case ActionType$7.ShowAllColumns: {
2813
+ case ActionType$6.ShowAllColumns: {
2803
2814
  const { columnVisibilityMap } = state;
2804
2815
  Object.keys(columnVisibilityMap).forEach((param) => {
2805
2816
  columnVisibilityMap[param] = true;
2806
2817
  });
2807
2818
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2808
2819
  }
2809
- case ActionType$7.HideAllColumns: {
2820
+ case ActionType$6.HideAllColumns: {
2810
2821
  const { columnVisibilityMap } = state;
2811
2822
  Object.keys(columnVisibilityMap).forEach((param) => {
2812
2823
  columnVisibilityMap[param] = false;
@@ -2853,7 +2864,7 @@ const IntelliTable = (props) => {
2853
2864
  columnVisibilityCustomizationModalVisible: false,
2854
2865
  };
2855
2866
  // Initialize state
2856
- const [state, dispatch] = useReducer(reducer$8, initialState);
2867
+ const [state, dispatch] = useReducer(reducer$7, initialState);
2857
2868
  // Destructure common state
2858
2869
  const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
2859
2870
  /*------------------------------------------------------------------------*/
@@ -2876,13 +2887,13 @@ const IntelliTable = (props) => {
2876
2887
  return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
2877
2888
  }
2878
2889
  dispatch({
2879
- type: ActionType$7.ToggleColVisCusModalVisibility,
2890
+ type: ActionType$6.ToggleColVisCusModalVisibility,
2880
2891
  });
2881
2892
  }, okayVariant: Variant$1.Light },
2882
2893
  columns.map((column) => {
2883
2894
  return (React__default.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
2884
2895
  dispatch({
2885
- type: ActionType$7.UpdateColumnVisibility,
2896
+ type: ActionType$6.UpdateColumnVisibility,
2886
2897
  param: column.param,
2887
2898
  visible: checked,
2888
2899
  });
@@ -2891,12 +2902,12 @@ const IntelliTable = (props) => {
2891
2902
  React__default.createElement("div", { className: "mt-3" }, "Or you can:"),
2892
2903
  React__default.createElement("button", { type: "button", id: `IntelliTable-${id}-select-all-columns`, className: "btn btn-secondary me-2", "aria-label": `show all columns in the ${title} table`, onClick: () => {
2893
2904
  dispatch({
2894
- type: ActionType$7.ShowAllColumns,
2905
+ type: ActionType$6.ShowAllColumns,
2895
2906
  });
2896
2907
  } }, "Select All"),
2897
2908
  React__default.createElement("button", { type: "button", id: `IntelliTable-${id}-select-none-columns`, className: "btn btn-secondary", "aria-label": `hide all columns in the ${title} table`, onClick: () => {
2898
2909
  dispatch({
2899
- type: ActionType$7.HideAllColumns,
2910
+ type: ActionType$6.HideAllColumns,
2900
2911
  });
2901
2912
  } }, "Deselect All")));
2902
2913
  }
@@ -2947,7 +2958,7 @@ const IntelliTable = (props) => {
2947
2958
  React__default.createElement("div", null,
2948
2959
  React__default.createElement("button", { type: "button", id: `IntelliTable-${id}-sort-by-${column.param}-button`, className: `btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`, "aria-label": sortButtonAriaLabel, onClick: () => {
2949
2960
  dispatch({
2950
- type: ActionType$7.ToggleSortColumn,
2961
+ type: ActionType$6.ToggleSortColumn,
2951
2962
  param: column.param,
2952
2963
  });
2953
2964
  } },
@@ -3136,7 +3147,7 @@ const IntelliTable = (props) => {
3136
3147
  React__default.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
3137
3148
  React__default.createElement("button", { type: "button", className: "btn btn-secondary ms-2", "aria-label": `show panel for customizing which columns show in table ${title}`, id: `IntelliTable-${id}-show-column-customization-modal`, onClick: () => {
3138
3149
  dispatch({
3139
- type: ActionType$7.ToggleColVisCusModalVisibility,
3150
+ type: ActionType$6.ToggleColVisCusModalVisibility,
3140
3151
  });
3141
3152
  } },
3142
3153
  "Show/Hide Cols",
@@ -3502,7 +3513,7 @@ const genHumanReadableName = (machineReadableName) => {
3502
3513
  };
3503
3514
  /* ------------- Actions ------------ */
3504
3515
  // Types of actions
3505
- var ActionType$6;
3516
+ var ActionType$5;
3506
3517
  (function (ActionType) {
3507
3518
  // Show the loading bar
3508
3519
  ActionType["StartLoading"] = "start-loading";
@@ -3524,45 +3535,45 @@ var ActionType$6;
3524
3535
  ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
3525
3536
  // Update the advanced filter state
3526
3537
  ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
3527
- })(ActionType$6 || (ActionType$6 = {}));
3538
+ })(ActionType$5 || (ActionType$5 = {}));
3528
3539
  /**
3529
3540
  * Reducer that executes actions
3530
3541
  * @author Gabe Abrams
3531
3542
  * @param state current state
3532
3543
  * @param action action to execute
3533
3544
  */
3534
- const reducer$7 = (state, action) => {
3545
+ const reducer$6 = (state, action) => {
3535
3546
  switch (action.type) {
3536
- case ActionType$6.StartLoading: {
3547
+ case ActionType$5.StartLoading: {
3537
3548
  return Object.assign(Object.assign({}, state), { loading: true });
3538
3549
  }
3539
- case ActionType$6.FinishLoading: {
3550
+ case ActionType$5.FinishLoading: {
3540
3551
  return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
3541
3552
  }
3542
- case ActionType$6.ToggleFilterDrawer: {
3553
+ case ActionType$5.ToggleFilterDrawer: {
3543
3554
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
3544
3555
  ? undefined // hide
3545
3556
  : action.filterDrawer) });
3546
3557
  }
3547
- case ActionType$6.HideFilterDrawer: {
3558
+ case ActionType$5.HideFilterDrawer: {
3548
3559
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
3549
3560
  }
3550
- case ActionType$6.ResetFilters: {
3561
+ case ActionType$5.ResetFilters: {
3551
3562
  return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
3552
3563
  }
3553
- case ActionType$6.UpdateDateFilterState: {
3564
+ case ActionType$5.UpdateDateFilterState: {
3554
3565
  return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
3555
3566
  }
3556
- case ActionType$6.UpdateContextFilterState: {
3567
+ case ActionType$5.UpdateContextFilterState: {
3557
3568
  return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
3558
3569
  }
3559
- case ActionType$6.UpdateTagFilterState: {
3570
+ case ActionType$5.UpdateTagFilterState: {
3560
3571
  return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
3561
3572
  }
3562
- case ActionType$6.UpdateActionErrorFilterState: {
3573
+ case ActionType$5.UpdateActionErrorFilterState: {
3563
3574
  return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
3564
3575
  }
3565
- case ActionType$6.UpdateAdvancedFilterState: {
3576
+ case ActionType$5.UpdateAdvancedFilterState: {
3566
3577
  return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
3567
3578
  }
3568
3579
  default: {
@@ -3691,7 +3702,7 @@ const LogReviewer = (props) => {
3691
3702
  advancedFilterState: initAdvancedFilterState,
3692
3703
  };
3693
3704
  // Initialize state
3694
- const [state, dispatch] = useReducer(reducer$7, initialState);
3705
+ const [state, dispatch] = useReducer(reducer$6, initialState);
3695
3706
  // Destructure common state
3696
3707
  const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
3697
3708
  /*------------------------------------------------------------------------*/
@@ -3741,7 +3752,7 @@ const LogReviewer = (props) => {
3741
3752
  const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
3742
3753
  // Update state
3743
3754
  dispatch({
3744
- type: ActionType$6.UpdateDateFilterState,
3755
+ type: ActionType$5.UpdateDateFilterState,
3745
3756
  dateFilterState: newDateFilterState,
3746
3757
  });
3747
3758
  // Check which year/month combos we need to load
@@ -3752,7 +3763,7 @@ const LogReviewer = (props) => {
3752
3763
  }
3753
3764
  // Start loading
3754
3765
  dispatch({
3755
- type: ActionType$6.StartLoading,
3766
+ type: ActionType$5.StartLoading,
3756
3767
  });
3757
3768
  // Load required months
3758
3769
  try {
@@ -3776,7 +3787,7 @@ const LogReviewer = (props) => {
3776
3787
  }
3777
3788
  // Finish loading
3778
3789
  dispatch({
3779
- type: ActionType$6.FinishLoading,
3790
+ type: ActionType$5.FinishLoading,
3780
3791
  logMap,
3781
3792
  });
3782
3793
  });
@@ -3815,7 +3826,7 @@ const LogReviewer = (props) => {
3815
3826
  React__default.createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
3816
3827
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-date-filter-drawer", className: `btn btn-${FilterDrawer.Date === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle date filter drawer", onClick: () => {
3817
3828
  dispatch({
3818
- type: ActionType$6.ToggleFilterDrawer,
3829
+ type: ActionType$5.ToggleFilterDrawer,
3819
3830
  filterDrawer: FilterDrawer.Date,
3820
3831
  });
3821
3832
  } },
@@ -3823,7 +3834,7 @@ const LogReviewer = (props) => {
3823
3834
  "Date"),
3824
3835
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-context-filter-drawer", className: `btn btn-${FilterDrawer.Context === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle context filter drawer", onClick: () => {
3825
3836
  dispatch({
3826
- type: ActionType$6.ToggleFilterDrawer,
3837
+ type: ActionType$5.ToggleFilterDrawer,
3827
3838
  filterDrawer: FilterDrawer.Context,
3828
3839
  });
3829
3840
  } },
@@ -3831,7 +3842,7 @@ const LogReviewer = (props) => {
3831
3842
  "Context"),
3832
3843
  (LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-tag-filter-drawer", className: `btn btn-${FilterDrawer.Tag === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle tag filter drawer", onClick: () => {
3833
3844
  dispatch({
3834
- type: ActionType$6.ToggleFilterDrawer,
3845
+ type: ActionType$5.ToggleFilterDrawer,
3835
3846
  filterDrawer: FilterDrawer.Tag,
3836
3847
  });
3837
3848
  } },
@@ -3839,7 +3850,7 @@ const LogReviewer = (props) => {
3839
3850
  "Tag")),
3840
3851
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-action-filter-drawer", className: `btn btn-${FilterDrawer.Action === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle action and error filter drawer", onClick: () => {
3841
3852
  dispatch({
3842
- type: ActionType$6.ToggleFilterDrawer,
3853
+ type: ActionType$5.ToggleFilterDrawer,
3843
3854
  filterDrawer: FilterDrawer.Action,
3844
3855
  });
3845
3856
  } },
@@ -3847,7 +3858,7 @@ const LogReviewer = (props) => {
3847
3858
  "Action"),
3848
3859
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle advanced filter drawer", onClick: () => {
3849
3860
  dispatch({
3850
- type: ActionType$6.ToggleFilterDrawer,
3861
+ type: ActionType$5.ToggleFilterDrawer,
3851
3862
  filterDrawer: FilterDrawer.Advanced,
3852
3863
  });
3853
3864
  } },
@@ -3855,7 +3866,7 @@ const LogReviewer = (props) => {
3855
3866
  "Advanced"),
3856
3867
  React__default.createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
3857
3868
  dispatch({
3858
- type: ActionType$6.ResetFilters,
3869
+ type: ActionType$5.ResetFilters,
3859
3870
  initActionErrorFilterState,
3860
3871
  initAdvancedFilterState,
3861
3872
  initContextFilterState,
@@ -3977,7 +3988,7 @@ const LogReviewer = (props) => {
3977
3988
  }
3978
3989
  });
3979
3990
  dispatch({
3980
- type: ActionType$6.UpdateContextFilterState,
3991
+ type: ActionType$5.UpdateContextFilterState,
3981
3992
  contextFilterState,
3982
3993
  });
3983
3994
  } }));
@@ -3992,7 +4003,7 @@ const LogReviewer = (props) => {
3992
4003
  return (React__default.createElement(CheckboxButton, { key: tag, id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, checked: tagFilterState[tag], onChanged: (checked) => {
3993
4004
  tagFilterState[tag] = checked;
3994
4005
  dispatch({
3995
- type: ActionType$6.UpdateTagFilterState,
4006
+ type: ActionType$5.UpdateTagFilterState,
3996
4007
  tagFilterState,
3997
4008
  });
3998
4009
  } }));
@@ -4005,21 +4016,21 @@ const LogReviewer = (props) => {
4005
4016
  React__default.createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
4006
4017
  actionErrorFilterState.type = undefined;
4007
4018
  dispatch({
4008
- type: ActionType$6.UpdateActionErrorFilterState,
4019
+ type: ActionType$5.UpdateActionErrorFilterState,
4009
4020
  actionErrorFilterState,
4010
4021
  });
4011
4022
  }, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
4012
4023
  React__default.createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
4013
4024
  actionErrorFilterState.type = LogType$1.Action;
4014
4025
  dispatch({
4015
- type: ActionType$6.UpdateActionErrorFilterState,
4026
+ type: ActionType$5.UpdateActionErrorFilterState,
4016
4027
  actionErrorFilterState,
4017
4028
  });
4018
4029
  }, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
4019
4030
  React__default.createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
4020
4031
  actionErrorFilterState.type = LogType$1.Error;
4021
4032
  dispatch({
4022
- type: ActionType$6.UpdateActionErrorFilterState,
4033
+ type: ActionType$5.UpdateActionErrorFilterState,
4023
4034
  actionErrorFilterState,
4024
4035
  });
4025
4036
  }, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
@@ -4031,7 +4042,7 @@ const LogReviewer = (props) => {
4031
4042
  return (React__default.createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: actionErrorFilterState.action[action], onChanged: (checked) => {
4032
4043
  actionErrorFilterState.action[action] = checked;
4033
4044
  dispatch({
4034
- type: ActionType$6.UpdateActionErrorFilterState,
4045
+ type: ActionType$5.UpdateActionErrorFilterState,
4035
4046
  actionErrorFilterState,
4036
4047
  });
4037
4048
  } }));
@@ -4042,7 +4053,7 @@ const LogReviewer = (props) => {
4042
4053
  return (React__default.createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
4043
4054
  actionErrorFilterState.target[target] = checked;
4044
4055
  dispatch({
4045
- type: ActionType$6.UpdateActionErrorFilterState,
4056
+ type: ActionType$5.UpdateActionErrorFilterState,
4046
4057
  actionErrorFilterState,
4047
4058
  });
4048
4059
  } }));
@@ -4054,7 +4065,7 @@ const LogReviewer = (props) => {
4054
4065
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: actionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => {
4055
4066
  actionErrorFilterState.errorMessage = e.target.value;
4056
4067
  dispatch({
4057
- type: ActionType$6.UpdateActionErrorFilterState,
4068
+ type: ActionType$5.UpdateActionErrorFilterState,
4058
4069
  actionErrorFilterState,
4059
4070
  });
4060
4071
  } })),
@@ -4065,7 +4076,7 @@ const LogReviewer = (props) => {
4065
4076
  .trim()
4066
4077
  .toUpperCase());
4067
4078
  dispatch({
4068
- type: ActionType$6.UpdateActionErrorFilterState,
4079
+ type: ActionType$5.UpdateActionErrorFilterState,
4069
4080
  actionErrorFilterState,
4070
4081
  });
4071
4082
  } }))))));
@@ -4079,7 +4090,7 @@ const LogReviewer = (props) => {
4079
4090
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: advancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
4080
4091
  advancedFilterState.userFirstName = e.target.value;
4081
4092
  dispatch({
4082
- type: ActionType$6.UpdateAdvancedFilterState,
4093
+ type: ActionType$5.UpdateAdvancedFilterState,
4083
4094
  advancedFilterState,
4084
4095
  });
4085
4096
  } })),
@@ -4088,7 +4099,7 @@ const LogReviewer = (props) => {
4088
4099
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: advancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
4089
4100
  advancedFilterState.userLastName = e.target.value;
4090
4101
  dispatch({
4091
- type: ActionType$6.UpdateAdvancedFilterState,
4102
+ type: ActionType$5.UpdateAdvancedFilterState,
4092
4103
  advancedFilterState,
4093
4104
  });
4094
4105
  } })),
@@ -4098,7 +4109,7 @@ const LogReviewer = (props) => {
4098
4109
  advancedFilterState.userEmail = ((e.target.value)
4099
4110
  .trim());
4100
4111
  dispatch({
4101
- type: ActionType$6.UpdateAdvancedFilterState,
4112
+ type: ActionType$5.UpdateAdvancedFilterState,
4102
4113
  advancedFilterState,
4103
4114
  });
4104
4115
  } })),
@@ -4112,7 +4123,7 @@ const LogReviewer = (props) => {
4112
4123
  .trim());
4113
4124
  }
4114
4125
  dispatch({
4115
- type: ActionType$6.UpdateAdvancedFilterState,
4126
+ type: ActionType$5.UpdateAdvancedFilterState,
4116
4127
  advancedFilterState,
4117
4128
  });
4118
4129
  } })),
@@ -4120,21 +4131,21 @@ const LogReviewer = (props) => {
4120
4131
  React__default.createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
4121
4132
  advancedFilterState.includeLearners = checked;
4122
4133
  dispatch({
4123
- type: ActionType$6.UpdateAdvancedFilterState,
4134
+ type: ActionType$5.UpdateAdvancedFilterState,
4124
4135
  advancedFilterState,
4125
4136
  });
4126
4137
  }, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
4127
4138
  React__default.createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
4128
4139
  advancedFilterState.includeTTMs = checked;
4129
4140
  dispatch({
4130
- type: ActionType$6.UpdateAdvancedFilterState,
4141
+ type: ActionType$5.UpdateAdvancedFilterState,
4131
4142
  advancedFilterState,
4132
4143
  });
4133
4144
  }, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
4134
4145
  React__default.createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
4135
4146
  advancedFilterState.includeAdmins = checked;
4136
4147
  dispatch({
4137
- type: ActionType$6.UpdateAdvancedFilterState,
4148
+ type: ActionType$5.UpdateAdvancedFilterState,
4138
4149
  advancedFilterState,
4139
4150
  });
4140
4151
  }, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
@@ -4144,7 +4155,7 @@ const LogReviewer = (props) => {
4144
4155
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: advancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
4145
4156
  advancedFilterState.courseName = e.target.value;
4146
4157
  dispatch({
4147
- type: ActionType$6.UpdateAdvancedFilterState,
4158
+ type: ActionType$5.UpdateAdvancedFilterState,
4148
4159
  advancedFilterState,
4149
4160
  });
4150
4161
  } })),
@@ -4158,7 +4169,7 @@ const LogReviewer = (props) => {
4158
4169
  .trim());
4159
4170
  }
4160
4171
  dispatch({
4161
- type: ActionType$6.UpdateAdvancedFilterState,
4172
+ type: ActionType$5.UpdateAdvancedFilterState,
4162
4173
  advancedFilterState,
4163
4174
  });
4164
4175
  } }))),
@@ -4167,21 +4178,21 @@ const LogReviewer = (props) => {
4167
4178
  React__default.createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
4168
4179
  advancedFilterState.isMobile = undefined;
4169
4180
  dispatch({
4170
- type: ActionType$6.UpdateAdvancedFilterState,
4181
+ type: ActionType$5.UpdateAdvancedFilterState,
4171
4182
  advancedFilterState,
4172
4183
  });
4173
4184
  } }),
4174
4185
  React__default.createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
4175
4186
  advancedFilterState.isMobile = true;
4176
4187
  dispatch({
4177
- type: ActionType$6.UpdateAdvancedFilterState,
4188
+ type: ActionType$5.UpdateAdvancedFilterState,
4178
4189
  advancedFilterState,
4179
4190
  });
4180
4191
  } }),
4181
4192
  React__default.createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
4182
4193
  advancedFilterState.isMobile = false;
4183
4194
  dispatch({
4184
- type: ActionType$6.UpdateAdvancedFilterState,
4195
+ type: ActionType$5.UpdateAdvancedFilterState,
4185
4196
  advancedFilterState,
4186
4197
  });
4187
4198
  }, noMarginOnRight: true }))),
@@ -4190,21 +4201,21 @@ const LogReviewer = (props) => {
4190
4201
  React__default.createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
4191
4202
  advancedFilterState.source = undefined;
4192
4203
  dispatch({
4193
- type: ActionType$6.UpdateAdvancedFilterState,
4204
+ type: ActionType$5.UpdateAdvancedFilterState,
4194
4205
  advancedFilterState,
4195
4206
  });
4196
4207
  } }),
4197
4208
  React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
4198
4209
  advancedFilterState.source = LogSource$1.Client;
4199
4210
  dispatch({
4200
- type: ActionType$6.UpdateAdvancedFilterState,
4211
+ type: ActionType$5.UpdateAdvancedFilterState,
4201
4212
  advancedFilterState,
4202
4213
  });
4203
4214
  } }),
4204
4215
  React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
4205
4216
  advancedFilterState.source = LogSource$1.Server;
4206
4217
  dispatch({
4207
- type: ActionType$6.UpdateAdvancedFilterState,
4218
+ type: ActionType$5.UpdateAdvancedFilterState,
4208
4219
  advancedFilterState,
4209
4220
  });
4210
4221
  }, noMarginOnRight: true })),
@@ -4215,7 +4226,7 @@ const LogReviewer = (props) => {
4215
4226
  advancedFilterState.courseName = ((e.target.value)
4216
4227
  .trim());
4217
4228
  dispatch({
4218
- type: ActionType$6.UpdateAdvancedFilterState,
4229
+ type: ActionType$5.UpdateAdvancedFilterState,
4219
4230
  advancedFilterState,
4220
4231
  });
4221
4232
  } })),
@@ -4225,7 +4236,7 @@ const LogReviewer = (props) => {
4225
4236
  advancedFilterState.courseName = ((e.target.value)
4226
4237
  .trim());
4227
4238
  dispatch({
4228
- type: ActionType$6.UpdateAdvancedFilterState,
4239
+ type: ActionType$5.UpdateAdvancedFilterState,
4229
4240
  advancedFilterState,
4230
4241
  });
4231
4242
  } })))))));
@@ -12045,11 +12056,11 @@ var CreatableSelect$1 = CreatableSelect;
12045
12056
  */
12046
12057
  /* ------------- Actions ------------ */
12047
12058
  // Types of actions
12048
- var ActionType$5;
12059
+ var ActionType$4;
12049
12060
  (function (ActionType) {
12050
12061
  // Update the input value
12051
12062
  ActionType["SetInputValue"] = "SetInputValue";
12052
- })(ActionType$5 || (ActionType$5 = {}));
12063
+ })(ActionType$4 || (ActionType$4 = {}));
12053
12064
  /**
12054
12065
  * Reducer that executes actions
12055
12066
  * @author Yuen Ler Chow
@@ -12057,9 +12068,9 @@ var ActionType$5;
12057
12068
  * @param action action to execute
12058
12069
  * @returns updated state
12059
12070
  */
12060
- const reducer$6 = (state, action) => {
12071
+ const reducer$5 = (state, action) => {
12061
12072
  switch (action.type) {
12062
- case ActionType$5.SetInputValue: {
12073
+ case ActionType$4.SetInputValue: {
12063
12074
  return Object.assign(Object.assign({}, state), { inputValue: action.value });
12064
12075
  }
12065
12076
  default: {
@@ -12079,7 +12090,7 @@ const CreatableMultiselect = (props) => {
12079
12090
  inputValue: '',
12080
12091
  };
12081
12092
  // Initialize state
12082
- const [state, dispatch] = useReducer(reducer$6, initialState);
12093
+ const [state, dispatch] = useReducer(reducer$5, initialState);
12083
12094
  // Destructure common state
12084
12095
  const { inputValue } = state;
12085
12096
  /*------------------------------------------------------------------------*/
@@ -12156,7 +12167,7 @@ const CreatableMultiselect = (props) => {
12156
12167
  }
12157
12168
  // Reset text field to empty because the values have been added
12158
12169
  dispatch({
12159
- type: ActionType$5.SetInputValue,
12170
+ type: ActionType$4.SetInputValue,
12160
12171
  value: '',
12161
12172
  });
12162
12173
  };
@@ -12195,7 +12206,7 @@ const CreatableMultiselect = (props) => {
12195
12206
  else {
12196
12207
  // simply update the input value to the new input value
12197
12208
  dispatch({
12198
- type: ActionType$5.SetInputValue,
12209
+ type: ActionType$4.SetInputValue,
12199
12210
  value: newValue,
12200
12211
  });
12201
12212
  }
@@ -12247,13 +12258,13 @@ const style$1 = `
12247
12258
  `;
12248
12259
  /* ------------- Actions ------------ */
12249
12260
  // Types of actions
12250
- var ActionType$4;
12261
+ var ActionType$3;
12251
12262
  (function (ActionType) {
12252
12263
  // Update the DBEntry
12253
12264
  ActionType["UpdateDBEntry"] = "UpdateDBEntry";
12254
12265
  // Start the save spinner
12255
12266
  ActionType["StartSave"] = "StartSave";
12256
- })(ActionType$4 || (ActionType$4 = {}));
12267
+ })(ActionType$3 || (ActionType$3 = {}));
12257
12268
  /**
12258
12269
  * Reducer that executes actions
12259
12270
  * @author Yuen Ler Chow
@@ -12261,12 +12272,12 @@ var ActionType$4;
12261
12272
  * @param action action to execute
12262
12273
  * @returns updated state
12263
12274
  */
12264
- const reducer$5 = (state, action) => {
12275
+ const reducer$4 = (state, action) => {
12265
12276
  switch (action.type) {
12266
- case ActionType$4.UpdateDBEntry: {
12277
+ case ActionType$3.UpdateDBEntry: {
12267
12278
  return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
12268
12279
  }
12269
- case ActionType$4.StartSave: {
12280
+ case ActionType$3.StartSave: {
12270
12281
  return Object.assign(Object.assign({}, state), { saving: true });
12271
12282
  }
12272
12283
  default: {
@@ -12291,7 +12302,7 @@ const AddOrEditDBEntry = (props) => {
12291
12302
  saving: false,
12292
12303
  };
12293
12304
  // Initialize state
12294
- const [state, dispatch] = useReducer(reducer$5, initialState);
12305
+ const [state, dispatch] = useReducer(reducer$4, initialState);
12295
12306
  // Destructure common state
12296
12307
  const { entry, saving, } = state;
12297
12308
  /*------------------------------------------------------------------------*/
@@ -12303,7 +12314,7 @@ const AddOrEditDBEntry = (props) => {
12303
12314
  */
12304
12315
  const save = () => __awaiter(void 0, void 0, void 0, function* () {
12305
12316
  // Start the save loading indicator
12306
- dispatch({ type: ActionType$4.StartSave });
12317
+ dispatch({ type: ActionType$3.StartSave });
12307
12318
  // add all default values to the entry
12308
12319
  entryFields.forEach((field) => {
12309
12320
  if (field.defaultValue && !entry[field.objectKey]) {
@@ -12486,7 +12497,7 @@ const AddOrEditDBEntry = (props) => {
12486
12497
  return (React__default.createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
12487
12498
  entry[field.objectKey] = choice.value;
12488
12499
  dispatch({
12489
- type: ActionType$4.UpdateDBEntry,
12500
+ type: ActionType$3.UpdateDBEntry,
12490
12501
  dbEntry: entry,
12491
12502
  });
12492
12503
  }, ariaLabel: choice.title }));
@@ -12498,7 +12509,7 @@ const AddOrEditDBEntry = (props) => {
12498
12509
  React__default.createElement("input", { disabled: disabled, type: "text", className: "form-control", placeholder: field.placeholder, "aria-describedby": "AddOrEditDBEntry-form-name-label", value: entry[field.objectKey] || '', onChange: (e) => {
12499
12510
  entry[field.objectKey] = (e.target.value);
12500
12511
  dispatch({
12501
- type: ActionType$4.UpdateDBEntry,
12512
+ type: ActionType$3.UpdateDBEntry,
12502
12513
  dbEntry: entry,
12503
12514
  });
12504
12515
  } }))));
@@ -12511,7 +12522,7 @@ const AddOrEditDBEntry = (props) => {
12511
12522
  entry[field.objectKey] = (e.target.value
12512
12523
  .replace(/[^0-9]/g, ''));
12513
12524
  dispatch({
12514
- type: ActionType$4.UpdateDBEntry,
12525
+ type: ActionType$3.UpdateDBEntry,
12515
12526
  dbEntry: entry,
12516
12527
  });
12517
12528
  } }))));
@@ -12541,7 +12552,7 @@ const AddOrEditDBEntry = (props) => {
12541
12552
  }
12542
12553
  // Save
12543
12554
  dispatch({
12544
- type: ActionType$4.UpdateDBEntry,
12555
+ type: ActionType$3.UpdateDBEntry,
12545
12556
  dbEntry: entry,
12546
12557
  });
12547
12558
  }, ariaLabel: choice.title }));
@@ -12556,7 +12567,7 @@ const AddOrEditDBEntry = (props) => {
12556
12567
  // Update entry and save
12557
12568
  entry[field.objectKey] = values;
12558
12569
  dispatch({
12559
- type: ActionType$4.UpdateDBEntry,
12570
+ type: ActionType$3.UpdateDBEntry,
12560
12571
  dbEntry: entry,
12561
12572
  });
12562
12573
  } })))));
@@ -12569,7 +12580,7 @@ const AddOrEditDBEntry = (props) => {
12569
12580
  React__default.createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
12570
12581
  entry[field.objectKey] = values;
12571
12582
  dispatch({
12572
- type: ActionType$4.UpdateDBEntry,
12583
+ type: ActionType$3.UpdateDBEntry,
12573
12584
  dbEntry: entry,
12574
12585
  });
12575
12586
  } })))));
@@ -12643,7 +12654,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
12643
12654
  */
12644
12655
  /* ------------- Actions ------------ */
12645
12656
  // Types of actions
12646
- var ActionType$3;
12657
+ var ActionType$2;
12647
12658
  (function (ActionType) {
12648
12659
  // Show adder
12649
12660
  ActionType["ShowAdder"] = "ShowAdder";
@@ -12657,7 +12668,7 @@ var ActionType$3;
12657
12668
  ActionType["StartDelete"] = "StartDelete";
12658
12669
  // Finish deletion process
12659
12670
  ActionType["FinishDelete"] = "FinishDelete";
12660
- })(ActionType$3 || (ActionType$3 = {}));
12671
+ })(ActionType$2 || (ActionType$2 = {}));
12661
12672
  /**
12662
12673
  * Reducer that executes actions
12663
12674
  * @author Yuen Ler Chow
@@ -12665,18 +12676,18 @@ var ActionType$3;
12665
12676
  * @param action action to execute
12666
12677
  * @returns updated state
12667
12678
  */
12668
- const reducer$4 = (state, action) => {
12679
+ const reducer$3 = (state, action) => {
12669
12680
  switch (action.type) {
12670
- case ActionType$3.FinishLoading: {
12681
+ case ActionType$2.FinishLoading: {
12671
12682
  return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
12672
12683
  }
12673
- case ActionType$3.ShowAdder: {
12684
+ case ActionType$2.ShowAdder: {
12674
12685
  return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
12675
12686
  }
12676
- case ActionType$3.ShowEditor: {
12687
+ case ActionType$2.ShowEditor: {
12677
12688
  return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
12678
12689
  }
12679
- case ActionType$3.FinishAdd: {
12690
+ case ActionType$2.FinishAdd: {
12680
12691
  // Handle cancel
12681
12692
  const finishedEntry = action.dbEntry;
12682
12693
  if (!finishedEntry) {
@@ -12700,10 +12711,10 @@ const reducer$4 = (state, action) => {
12700
12711
  // Update the state
12701
12712
  return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
12702
12713
  }
12703
- case ActionType$3.StartDelete: {
12714
+ case ActionType$2.StartDelete: {
12704
12715
  return Object.assign(Object.assign({}, state), { loading: true });
12705
12716
  }
12706
- case ActionType$3.FinishDelete: {
12717
+ case ActionType$2.FinishDelete: {
12707
12718
  return Object.assign(Object.assign({}, state), { loading: false,
12708
12719
  // Remove the deleted entry from the list
12709
12720
  dbEntries: state.dbEntries.filter((entry) => {
@@ -12729,7 +12740,7 @@ const DBEntryManagerPanel = (props) => {
12729
12740
  loading: true,
12730
12741
  };
12731
12742
  // Initialize state
12732
- const [state, dispatch] = useReducer(reducer$4, initialState);
12743
+ const [state, dispatch] = useReducer(reducer$3, initialState);
12733
12744
  // Destructure common state
12734
12745
  const { adding, dbEntryToEdit, dbEntries, loading, } = state;
12735
12746
  /*------------------------------------------------------------------------*/
@@ -12755,7 +12766,7 @@ const DBEntryManagerPanel = (props) => {
12755
12766
  try {
12756
12767
  // Start loader
12757
12768
  dispatch({
12758
- type: ActionType$3.StartDelete,
12769
+ type: ActionType$2.StartDelete,
12759
12770
  });
12760
12771
  // Perform deletion
12761
12772
  yield visitServerEndpoint({
@@ -12764,7 +12775,7 @@ const DBEntryManagerPanel = (props) => {
12764
12775
  });
12765
12776
  // Finish loader
12766
12777
  dispatch({
12767
- type: ActionType$3.FinishDelete,
12778
+ type: ActionType$2.FinishDelete,
12768
12779
  dbEntry: entry,
12769
12780
  idPropName,
12770
12781
  });
@@ -12793,7 +12804,7 @@ const DBEntryManagerPanel = (props) => {
12793
12804
  });
12794
12805
  // Save loaded data
12795
12806
  dispatch({
12796
- type: ActionType$3.FinishLoading,
12807
+ type: ActionType$2.FinishLoading,
12797
12808
  dbEntries: data,
12798
12809
  });
12799
12810
  }
@@ -12836,7 +12847,7 @@ const DBEntryManagerPanel = (props) => {
12836
12847
  React__default.createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
12837
12848
  !disableEdit && (React__default.createElement("button", { type: "button", id: `DBEntryManagerPanel-edit-with-id-${entry[idPropName]}`, className: "btn btn-primary", "aria-label": `edit db entry: ${entry[titlePropName]}`, onClick: () => {
12838
12849
  dispatch({
12839
- type: ActionType$3.ShowEditor,
12850
+ type: ActionType$2.ShowEditor,
12840
12851
  dbEntry: entry,
12841
12852
  });
12842
12853
  } },
@@ -12846,7 +12857,7 @@ const DBEntryManagerPanel = (props) => {
12846
12857
  React__default.createElement("div", { className: "d-grid" },
12847
12858
  React__default.createElement("button", { type: "button", id: "DBEntryManagerPanel-add-entry", className: "btn btn-lg btn-primary", "aria-label": `add a new ${itemName} entry to the list of entries`, onClick: () => {
12848
12859
  dispatch({
12849
- type: ActionType$3.ShowAdder,
12860
+ type: ActionType$2.ShowAdder,
12850
12861
  });
12851
12862
  } },
12852
12863
  React__default.createElement(FontAwesomeIcon, { icon: faPlus, className: "me-2" }),
@@ -12858,7 +12869,7 @@ const DBEntryManagerPanel = (props) => {
12858
12869
  if (!loading && (adding || dbEntryToEdit)) {
12859
12870
  body = (React__default.createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
12860
12871
  dispatch({
12861
- type: ActionType$3.FinishAdd,
12872
+ type: ActionType$2.FinishAdd,
12862
12873
  dbEntry: entry,
12863
12874
  idPropName,
12864
12875
  });
@@ -13055,25 +13066,25 @@ const getItemIds = (items) => {
13055
13066
  };
13056
13067
  /* ------------- Actions ------------ */
13057
13068
  // Types of actions
13058
- var ActionType$2;
13069
+ var ActionType$1;
13059
13070
  (function (ActionType) {
13060
13071
  // Hide the "jump to bottom" button
13061
13072
  ActionType["HideJumpToBottomButton"] = "HideJumpToBottomButton";
13062
13073
  // Show the "jump to bottom" button
13063
13074
  ActionType["ShowJumpToBottomButton"] = "ShowJumpToBottomButton";
13064
- })(ActionType$2 || (ActionType$2 = {}));
13075
+ })(ActionType$1 || (ActionType$1 = {}));
13065
13076
  /**
13066
13077
  * Reducer that executes actions
13067
13078
  * @author Gabe Abrams
13068
13079
  * @param state current state
13069
13080
  * @param action action to execute
13070
13081
  */
13071
- const reducer$3 = (state, action) => {
13082
+ const reducer$2 = (state, action) => {
13072
13083
  switch (action.type) {
13073
- case ActionType$2.HideJumpToBottomButton: {
13084
+ case ActionType$1.HideJumpToBottomButton: {
13074
13085
  return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
13075
13086
  }
13076
- case ActionType$2.ShowJumpToBottomButton: {
13087
+ case ActionType$1.ShowJumpToBottomButton: {
13077
13088
  return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: true });
13078
13089
  }
13079
13090
  default: {
@@ -13097,7 +13108,7 @@ const AutoscrollToBottomContainer = (props) => {
13097
13108
  jumpToBottomButtonVisible: false,
13098
13109
  };
13099
13110
  // Initialize state
13100
- const [state, dispatch] = useReducer(reducer$3, initialState);
13111
+ const [state, dispatch] = useReducer(reducer$2, initialState);
13101
13112
  // Destructure common state
13102
13113
  const { jumpToBottomButtonVisible, } = state;
13103
13114
  /* -------------- Refs -------------- */
@@ -13143,7 +13154,7 @@ const AutoscrollToBottomContainer = (props) => {
13143
13154
  }
13144
13155
  // Update state
13145
13156
  dispatch({
13146
- type: ActionType$2.HideJumpToBottomButton,
13157
+ type: ActionType$1.HideJumpToBottomButton,
13147
13158
  });
13148
13159
  // Scroll to bottom
13149
13160
  container.current.scrollTop = (container.current.scrollHeight
@@ -13167,7 +13178,7 @@ const AutoscrollToBottomContainer = (props) => {
13167
13178
  if (isScrolledToBottom()) {
13168
13179
  // Hide button
13169
13180
  dispatch({
13170
- type: ActionType$2.HideJumpToBottomButton,
13181
+ type: ActionType$1.HideJumpToBottomButton,
13171
13182
  });
13172
13183
  }
13173
13184
  };
@@ -13209,7 +13220,7 @@ const AutoscrollToBottomContainer = (props) => {
13209
13220
  else {
13210
13221
  // Not scrolled to bottom. Show "jump to bottom" button.
13211
13222
  dispatch({
13212
- type: ActionType$2.ShowJumpToBottomButton,
13223
+ type: ActionType$1.ShowJumpToBottomButton,
13213
13224
  });
13214
13225
  }
13215
13226
  }, [items]);
@@ -13279,25 +13290,25 @@ const combineClassNames = (classNames) => {
13279
13290
  */
13280
13291
  /* ------------- Actions ------------ */
13281
13292
  // Types of actions
13282
- var ActionType$1;
13293
+ var ActionType;
13283
13294
  (function (ActionType) {
13284
13295
  // Start hovering on an option
13285
13296
  ActionType["StartHover"] = "StartHover";
13286
13297
  // Stop hovering on an option
13287
13298
  ActionType["StopHover"] = "StopHover";
13288
- })(ActionType$1 || (ActionType$1 = {}));
13299
+ })(ActionType || (ActionType = {}));
13289
13300
  /**
13290
13301
  * Reducer that executes actions
13291
13302
  * @author Gabe Abrams
13292
13303
  * @param state current state
13293
13304
  * @param action action to execute
13294
13305
  */
13295
- const reducer$2 = (state, action) => {
13306
+ const reducer$1 = (state, action) => {
13296
13307
  switch (action.type) {
13297
- case ActionType$1.StartHover: {
13308
+ case ActionType.StartHover: {
13298
13309
  return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
13299
13310
  }
13300
- case ActionType$1.StopHover: {
13311
+ case ActionType.StopHover: {
13301
13312
  return Object.assign(Object.assign({}, state), { hoveredOptionId: undefined });
13302
13313
  }
13303
13314
  default: {
@@ -13321,7 +13332,7 @@ const MultiSwitch = (props) => {
13321
13332
  hoveredOptionId: undefined,
13322
13333
  };
13323
13334
  // Initialize state
13324
- const [state, dispatch] = useReducer(reducer$2, initialState);
13335
+ const [state, dispatch] = useReducer(reducer$1, initialState);
13325
13336
  // Destructure common state
13326
13337
  const { hoveredOptionId, } = state;
13327
13338
  /*------------------------------------------------------------------------*/
@@ -13333,7 +13344,7 @@ const MultiSwitch = (props) => {
13333
13344
  });
13334
13345
  // Constants
13335
13346
  const gutterRems = heightRem * 0.1;
13336
- const itemWidthRems = heightRem * 2.2;
13347
+ const itemWidthRems = heightRem * 1.3;
13337
13348
  const textFontSize = heightRem / 3.5;
13338
13349
  const iconFontSize = heightRem / 2;
13339
13350
  const borderWidthRems = 0.05;
@@ -13453,27 +13464,27 @@ const MultiSwitch = (props) => {
13453
13464
  : `click to select option "${option.label}"`), onClick: () => {
13454
13465
  // Remove hover
13455
13466
  dispatch({
13456
- type: ActionType$1.StopHover,
13467
+ type: ActionType.StopHover,
13457
13468
  });
13458
13469
  // Notify parent
13459
13470
  onChange(option.id);
13460
13471
  }, onMouseEnter: () => {
13461
13472
  dispatch({
13462
- type: ActionType$1.StartHover,
13473
+ type: ActionType.StartHover,
13463
13474
  hoveredOptionId: option.id,
13464
13475
  });
13465
13476
  }, onMouseLeave: () => {
13466
13477
  dispatch({
13467
- type: ActionType$1.StopHover,
13478
+ type: ActionType.StopHover,
13468
13479
  });
13469
13480
  }, onFocus: () => {
13470
13481
  dispatch({
13471
- type: ActionType$1.StartHover,
13482
+ type: ActionType.StartHover,
13472
13483
  hoveredOptionId: option.id,
13473
13484
  });
13474
13485
  }, onBlur: () => {
13475
13486
  dispatch({
13476
- type: ActionType$1.StopHover,
13487
+ type: ActionType.StopHover,
13477
13488
  });
13478
13489
  }, style: {
13479
13490
  pointerEvents: ((option.id === selectedOptionId)
@@ -13492,147 +13503,6 @@ const MultiSwitch = (props) => {
13492
13503
  React__default.createElement("div", { className: "MultiSwitch-highlight-container" }, highlight)));
13493
13504
  };
13494
13505
 
13495
- // Types of dropdown items
13496
- var DropdownItemType;
13497
- (function (DropdownItemType) {
13498
- // Dropdown header
13499
- DropdownItemType["Header"] = "Header";
13500
- // Dropdown divider
13501
- DropdownItemType["Divider"] = "Divider";
13502
- // Dropdown item
13503
- DropdownItemType["Item"] = "Item";
13504
- })(DropdownItemType || (DropdownItemType = {}));
13505
- var DropdownItemType$1 = DropdownItemType;
13506
-
13507
- /**
13508
- * A simple dropdown menu
13509
- * @author Alessandra De Lucas
13510
- * @author Yuen Ler Chow
13511
- * @author Gabe Abrams
13512
- */
13513
- /* ------------- Actions ------------ */
13514
- // Types of actions
13515
- var ActionType;
13516
- (function (ActionType) {
13517
- // Toggle opening the dropdown menu
13518
- ActionType["ToggleDropdown"] = "ToggleDropdown";
13519
- // Close the dropdown menu
13520
- ActionType["CloseDropdown"] = "CloseDropdown";
13521
- })(ActionType || (ActionType = {}));
13522
- /**
13523
- * Reducer that executes actions
13524
- * @author Alessandra De Lucas
13525
- * @author Yuen Ler Chow
13526
- * @param state current state
13527
- * @param action action to execute
13528
- */
13529
- const reducer$1 = (state, action) => {
13530
- switch (action.type) {
13531
- case ActionType.ToggleDropdown: {
13532
- return Object.assign(Object.assign({}, state), { isDropdownOpen: !state.isDropdownOpen });
13533
- }
13534
- case ActionType.CloseDropdown: {
13535
- return Object.assign(Object.assign({}, state), { isDropdownOpen: false });
13536
- }
13537
- default: {
13538
- return state;
13539
- }
13540
- }
13541
- };
13542
- /*------------------------------------------------------------------------*/
13543
- /* ------------------------------ Component ----------------------------- */
13544
- /*------------------------------------------------------------------------*/
13545
- const Dropdown = (props) => {
13546
- /*------------------------------------------------------------------------*/
13547
- /* -------------------------------- Setup ------------------------------- */
13548
- /*------------------------------------------------------------------------*/
13549
- /* -------------- Props ------------- */
13550
- // Destructure all props
13551
- const { dropdownButton, items, } = props;
13552
- /* -------------- State ------------- */
13553
- // Initial state
13554
- const initialState = {
13555
- isDropdownOpen: false,
13556
- };
13557
- // Initialize state
13558
- const [state, dispatch] = useReducer(reducer$1, initialState);
13559
- // Destructure common state
13560
- const { isDropdownOpen, } = state;
13561
- /* -------------- Refs -------------- */
13562
- // Initialize refs
13563
- const dropdownRef = useRef(null);
13564
- /*------------------------------------------------------------------------*/
13565
- /* ------------------------- Component Functions ------------------------ */
13566
- /*------------------------------------------------------------------------*/
13567
- /**
13568
- * Handle clicking outside of the dropdown menu to close it
13569
- * @author Yuen Ler Chow
13570
- * @param event the mouse event
13571
- */
13572
- const handleClickOutside = (event) => {
13573
- if (
13574
- // Dropdown has been rendered
13575
- dropdownRef.current
13576
- // Click occurred outside the dropdown
13577
- && !dropdownRef.current.contains(event.target)) {
13578
- dispatch({ type: ActionType.CloseDropdown });
13579
- }
13580
- };
13581
- /*------------------------------------------------------------------------*/
13582
- /* ------------------------- Lifecycle Functions ------------------------ */
13583
- /*------------------------------------------------------------------------*/
13584
- /**
13585
- * Mount
13586
- * @author Yuen Ler Chow
13587
- */
13588
- useEffect(() => {
13589
- // Add event listener to close dropdown when clicking outside
13590
- document.addEventListener('mousedown', handleClickOutside);
13591
- // Cleanup
13592
- return () => {
13593
- document.removeEventListener('mousedown', handleClickOutside);
13594
- };
13595
- }, []);
13596
- /*----------------------------------------*/
13597
- /* --------------- Main UI -------------- */
13598
- /*----------------------------------------*/
13599
- return (React__default.createElement("div", { className: "dropdown", ref: dropdownRef, "data-bs-theme": isDarkModeOn() ? 'dark' : undefined },
13600
- React__default.createElement("button", { className: combineClassNames([
13601
- 'btn dropdown-toggle border',
13602
- isDropdownOpen && 'show',
13603
- `btn-${dropdownButton.variant}`,
13604
- dropdownButton.variant === Variant$1.Light && 'text-dark',
13605
- ]), type: "button", id: dropdownButton.id, "aria-expanded": isDropdownOpen, "aria-label": dropdownButton.ariaLabel, onClick: () => {
13606
- dispatch({
13607
- type: ActionType.ToggleDropdown,
13608
- });
13609
- } }, dropdownButton.content),
13610
- React__default.createElement("ul", { className: combineClassNames([
13611
- 'dropdown-menu',
13612
- isDarkModeOn() && 'dropdown-menu-dark',
13613
- isDropdownOpen && 'show',
13614
- ]) }, Object.values(items).map((item) => {
13615
- if (item.type === DropdownItemType$1.Header) {
13616
- return (
13617
- // TODO: Implement header
13618
- React__default.createElement("span", null));
13619
- }
13620
- if (item.type === DropdownItemType$1.Divider) {
13621
- return (
13622
- // TODO: Implement divider
13623
- React__default.createElement("span", null));
13624
- }
13625
- return (React__default.createElement("li", { key: item.id },
13626
- React__default.createElement("button", { type: "button", "aria-label": item.ariaLabel, className: "dropdown-item", onClick: (e) => {
13627
- e.preventDefault();
13628
- dispatch({
13629
- type: ActionType.CloseDropdown,
13630
- });
13631
- item.onClick();
13632
- } }, item.content)));
13633
- }))));
13634
- };
13635
-
13636
13506
  /**
13637
13507
  * One minute in ms
13638
13508
  * @author Gabe Abrams
@@ -15958,5 +15828,5 @@ var DayOfWeek;
15958
15828
  })(DayOfWeek || (DayOfWeek = {}));
15959
15829
  var DayOfWeek$1 = DayOfWeek;
15960
15830
 
15961
- export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, Dropdown, DropdownItemType$1 as DropdownItemType, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
15831
+ export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
15962
15832
  //# sourceMappingURL=index.js.map