dce-reactkit 3.5.13 → 3.6.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 (34) hide show
  1. package/dist/cjs/index.js +355 -298
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/client/initClient.d.ts +7 -0
  4. package/dist/cjs/types/components/AppWrapper.d.ts +0 -1
  5. package/dist/cjs/types/helpers/makeLinksClickable.d.ts +4 -2
  6. package/dist/esm/index.js +355 -298
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/esm/types/client/initClient.d.ts +7 -0
  9. package/dist/esm/types/components/AppWrapper.d.ts +0 -1
  10. package/dist/esm/types/helpers/makeLinksClickable.d.ts +4 -2
  11. package/dist/index.d.ts +5 -3
  12. package/package.json +1 -1
  13. package/src/client/initClient.tsx +20 -4
  14. package/src/components/AppWrapper.tsx +8 -6
  15. package/src/components/ButtonInputGroup.tsx +6 -6
  16. package/src/components/CSVDownloadButton.tsx +6 -6
  17. package/src/components/CheckboxButton.tsx +19 -8
  18. package/src/components/CopiableBox.tsx +8 -8
  19. package/src/components/Drawer.tsx +7 -7
  20. package/src/components/ErrorBox.tsx +5 -5
  21. package/src/components/IntelliTable.tsx +135 -135
  22. package/src/components/ItemPicker/NestableItemList.tsx +7 -7
  23. package/src/components/ItemPicker/index.tsx +7 -7
  24. package/src/components/LoadingSpinner.tsx +4 -4
  25. package/src/components/LogReviewer.tsx +21 -22
  26. package/src/components/Modal.tsx +163 -75
  27. package/src/components/PopFailureMark.tsx +7 -7
  28. package/src/components/PopPendingMark.tsx +7 -7
  29. package/src/components/PopSuccessMark.tsx +7 -7
  30. package/src/components/RadioButton.tsx +17 -8
  31. package/src/components/SimpleDateChooser.tsx +14 -13
  32. package/src/components/TabBox.tsx +7 -7
  33. package/src/helpers/genRouteHandler.ts +45 -41
  34. package/src/helpers/makeLinksClickable.tsx +6 -4
package/dist/cjs/index.js CHANGED
@@ -83,17 +83,17 @@ var ReactKitErrorCode$1 = ReactKitErrorCode;
83
83
  * @author Gabe Abrams
84
84
  */
85
85
  /*------------------------------------------------------------------------*/
86
- /* Component */
86
+ /* ------------------------------ Component ----------------------------- */
87
87
  /*------------------------------------------------------------------------*/
88
88
  const ErrorBox = (props) => {
89
89
  /*------------------------------------------------------------------------*/
90
- /* Setup */
90
+ /* -------------------------------- Setup ------------------------------- */
91
91
  /*------------------------------------------------------------------------*/
92
92
  var _a;
93
93
  /* -------------- Props ------------- */
94
94
  const { error, title = 'An Error Occurred', onClose, } = props;
95
95
  /*------------------------------------------------------------------------*/
96
- /* Render */
96
+ /* ------------------------------- Render ------------------------------- */
97
97
  /*------------------------------------------------------------------------*/
98
98
  // Determine error text
99
99
  const errorText = (typeof error === 'string'
@@ -230,11 +230,89 @@ var ModalSize;
230
230
  var ModalSize$1 = ModalSize;
231
231
 
232
232
  /**
233
- * A generic popup modal
233
+ * An error with a code
234
234
  * @author Gabe Abrams
235
235
  */
236
+ class ErrorWithCode extends Error {
237
+ constructor(message, code) {
238
+ super(message);
239
+ this.name = 'ErrorWithCode';
240
+ this.code = code;
241
+ }
242
+ }
243
+
244
+ /*----------------------------------------*/
245
+ /* ---- Static Variables and Getters ---- */
246
+ /*----------------------------------------*/
247
+ /* ----------- Initialized ---------- */
248
+ let onInitialized;
249
+ const initialized = new Promise((resolve) => {
250
+ onInitialized = resolve;
251
+ });
252
+ /* ---------- Send Request ---------- */
253
+ let storedSendRequest;
254
+ /**
255
+ * Get the send request function
256
+ * @author Gabe Abrams
257
+ * @returns sendRequest function
258
+ */
259
+ const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
260
+ // Show timeout error if too much time passes
261
+ let successful = false;
262
+ (() => __awaiter(void 0, void 0, void 0, function* () {
263
+ yield waitMs(5000);
264
+ if (!successful) {
265
+ showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
266
+ }
267
+ }))();
268
+ // Wait for initialization
269
+ yield initialized;
270
+ successful = true;
271
+ // Return
272
+ return storedSendRequest;
273
+ });
274
+ /* ----- Session Expired Message ---- */
275
+ let sessionExpiredMessage;
276
+ /**
277
+ * Get the custom session expired message
278
+ * @author Gabe Abrams
279
+ * @returns session expired message
280
+ */
281
+ const getSessionExpiredMessage = () => {
282
+ // Return
283
+ return (sessionExpiredMessage !== null && sessionExpiredMessage !== void 0 ? sessionExpiredMessage : 'Your session has expired. Please go back to Canvas and start over.');
284
+ };
285
+ /* ------------ Dark Mode ----------- */
286
+ let darkModeOn = false;
287
+ /**
288
+ * Get whether dark mode is enabled or not
289
+ * @returns true if dark mode is enabled
290
+ */
291
+ const isDarkModeOn = () => {
292
+ return darkModeOn;
293
+ };
294
+ /*----------------------------------------*/
295
+ /* ---------------- Init ---------------- */
296
+ /*----------------------------------------*/
297
+ /**
298
+ * Initialize the client-side version of reactkit
299
+ * @author Gabe Abrams
300
+ * @param opts object containing all arguments
301
+ * @param opts.sendRequest caccl send request functions
302
+ * @param [opts.sessionExpiredMessage] a custom session expired message
303
+ */
304
+ const initClient = (opts) => {
305
+ // Store values
306
+ storedSendRequest = opts.sendRequest;
307
+ sessionExpiredMessage = opts.sessionExpiredMessage;
308
+ darkModeOn = !!opts.darkModeOn;
309
+ // Mark as initialized
310
+ onInitialized(null);
311
+ };
312
+
313
+ /* eslint-disable react/no-unused-prop-types */
236
314
  /*------------------------------------------------------------------------*/
237
- /* Constants */
315
+ /* ------------------------------ Constants ----------------------------- */
238
316
  /*------------------------------------------------------------------------*/
239
317
  // Constants
240
318
  const MS_TO_ANIMATE = 200; // Animation duration
@@ -273,51 +351,66 @@ const modalTypeToModalButtonTypes = {
273
351
  ModalButtonType$1.Cancel,
274
352
  ],
275
353
  };
276
- // Button type styling and labels
277
- const ModalButtonTypeToLabelAndVariant = {
278
- [ModalButtonType$1.Okay]: {
279
- label: 'Okay',
280
- variant: Variant$1.Dark,
281
- },
282
- [ModalButtonType$1.Cancel]: {
283
- label: 'Cancel',
284
- variant: Variant$1.Secondary,
285
- },
286
- [ModalButtonType$1.Yes]: {
287
- label: 'Yes',
288
- variant: Variant$1.Dark,
289
- },
290
- [ModalButtonType$1.No]: {
291
- label: 'No',
292
- variant: Variant$1.Secondary,
293
- },
294
- [ModalButtonType$1.Abandon]: {
295
- label: 'Abandon Changes',
296
- variant: Variant$1.Warning,
297
- },
298
- [ModalButtonType$1.GoBack]: {
299
- label: 'Go Back',
300
- variant: Variant$1.Secondary,
301
- },
302
- [ModalButtonType$1.Continue]: {
303
- label: 'Continue',
304
- variant: Variant$1.Dark,
305
- },
306
- [ModalButtonType$1.ImSure]: {
307
- label: 'I am sure',
308
- variant: Variant$1.Warning,
309
- },
310
- [ModalButtonType$1.Delete]: {
311
- label: 'Yes, Delete',
312
- variant: Variant$1.Danger,
313
- },
314
- [ModalButtonType$1.Confirm]: {
315
- label: 'Confirm',
316
- variant: Variant$1.Dark,
317
- },
354
+ /**
355
+ * Get button type styling and labels
356
+ * @author Gabe Abrams
357
+ * @returns map of button type to label and variant
358
+ */
359
+ const getModalButtonTypeToLabelAndVariant = () => {
360
+ const dark = isDarkModeOn();
361
+ return {
362
+ [ModalButtonType$1.Okay]: {
363
+ label: 'Okay',
364
+ variant: (dark
365
+ ? Variant$1.Light
366
+ : Variant$1.Dark),
367
+ },
368
+ [ModalButtonType$1.Cancel]: {
369
+ label: 'Cancel',
370
+ variant: Variant$1.Secondary,
371
+ },
372
+ [ModalButtonType$1.Yes]: {
373
+ label: 'Yes',
374
+ variant: (dark
375
+ ? Variant$1.Light
376
+ : Variant$1.Dark),
377
+ },
378
+ [ModalButtonType$1.No]: {
379
+ label: 'No',
380
+ variant: Variant$1.Secondary,
381
+ },
382
+ [ModalButtonType$1.Abandon]: {
383
+ label: 'Abandon Changes',
384
+ variant: Variant$1.Warning,
385
+ },
386
+ [ModalButtonType$1.GoBack]: {
387
+ label: 'Go Back',
388
+ variant: Variant$1.Secondary,
389
+ },
390
+ [ModalButtonType$1.Continue]: {
391
+ label: 'Continue',
392
+ variant: (dark
393
+ ? Variant$1.Light
394
+ : Variant$1.Dark),
395
+ },
396
+ [ModalButtonType$1.ImSure]: {
397
+ label: 'I am sure',
398
+ variant: Variant$1.Warning,
399
+ },
400
+ [ModalButtonType$1.Delete]: {
401
+ label: 'Yes, Delete',
402
+ variant: Variant$1.Danger,
403
+ },
404
+ [ModalButtonType$1.Confirm]: {
405
+ label: 'Confirm',
406
+ variant: (dark
407
+ ? Variant$1.Light
408
+ : Variant$1.Dark),
409
+ },
410
+ };
318
411
  };
319
412
  /*------------------------------------------------------------------------*/
320
- /* Style */
413
+ /* -------------------------------- Style ------------------------------- */
321
414
  /*------------------------------------------------------------------------*/
322
415
  const style$b = `
323
416
  .Modal-backdrop {
@@ -383,25 +476,23 @@ const style$b = `
383
476
  }
384
477
  `;
385
478
  /*------------------------------------------------------------------------*/
386
- /* Component */
479
+ /* ------------------------------ Component ----------------------------- */
387
480
  /*------------------------------------------------------------------------*/
388
481
  const Modal = (props) => {
389
482
  /*------------------------------------------------------------------------*/
390
- /* Setup */
483
+ /* -------------------------------- Setup ------------------------------- */
391
484
  /*------------------------------------------------------------------------*/
392
485
  var _a;
393
486
  /* -------------- Props ------------- */
394
487
  const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, children, onClose, dontAllowBackdropExit, onTopOfOtherModals, } = props;
395
488
  /* -------------- State ------------- */
396
- // If true, the modal is shown
397
- const [visible, setVisible] = React.useState(false);
398
489
  // True if animation is in use
399
490
  const [animatingIn, setAnimatingIn] = React.useState(true);
400
491
  const [animatingPop, setAnimatingPop] = React.useState(false);
401
492
  // Keep track of whether modal is still mounted
402
493
  const mounted = React.useRef(false);
403
494
  /*------------------------------------------------------------------------*/
404
- /* Lifecycle Functions */
495
+ /* ------------------------- Lifecycle Functions ------------------------ */
405
496
  /*------------------------------------------------------------------------*/
406
497
  /**
407
498
  * Mount
@@ -410,14 +501,12 @@ const Modal = (props) => {
410
501
  React.useEffect(() => {
411
502
  (() => __awaiter(void 0, void 0, void 0, function* () {
412
503
  // Set defaults
413
- setVisible(false);
414
504
  setAnimatingIn(true);
415
505
  setAnimatingPop(false);
416
506
  // Wait for animation
417
507
  yield waitMs(MS_TO_ANIMATE);
418
508
  // Update to state after animated in
419
509
  if (mounted.current) {
420
- setVisible(true);
421
510
  setAnimatingIn(false);
422
511
  }
423
512
  }))();
@@ -426,47 +515,46 @@ const Modal = (props) => {
426
515
  };
427
516
  }, []);
428
517
  /*------------------------------------------------------------------------*/
429
- /* Component Functions */
518
+ /* ------------------------- Component Functions ------------------------ */
430
519
  /*------------------------------------------------------------------------*/
431
520
  /**
432
521
  * Handles the closing of the modal
433
522
  * @author Gabe Abrams
434
- * @param ModalButtonType the button that was clicked when closing the
523
+ * @param modalButtonType the button that was clicked when closing the
435
524
  * modal
436
525
  */
437
- const handleClose = (ModalButtonType) => __awaiter(void 0, void 0, void 0, function* () {
526
+ const handleClose = (modalButtonType) => __awaiter(void 0, void 0, void 0, function* () {
438
527
  // Don't close if no handler
439
528
  if (!onClose) {
440
529
  return;
441
530
  }
442
- onClose(ModalButtonType);
531
+ onClose(modalButtonType);
443
532
  });
444
533
  /*------------------------------------------------------------------------*/
445
- /* Render */
534
+ /* ------------------------------- Render ------------------------------- */
446
535
  /*------------------------------------------------------------------------*/
447
- /*----------------------------------------*/
448
- /* Footer */
449
- /*----------------------------------------*/
450
536
  // Get list of buttons for this modal type
451
537
  const ModalButtonTypes = (_a = modalTypeToModalButtonTypes[type]) !== null && _a !== void 0 ? _a : [];
538
+ // Get map of button type to label and variant
539
+ const ModalButtonTypeToLabelAndVariant = getModalButtonTypeToLabelAndVariant();
452
540
  // Create buttons
453
- const buttons = ModalButtonTypes.map((ModalButtonType, i) => {
541
+ const buttons = ModalButtonTypes.map((modalButtonType, i) => {
454
542
  // Get default style
455
- let { label, variant, } = ModalButtonTypeToLabelAndVariant[ModalButtonType];
543
+ let { label, variant, } = ModalButtonTypeToLabelAndVariant[modalButtonType];
456
544
  // Override with customizations
457
- const newLabel = props[`${ModalButtonType}Label`];
545
+ const newLabel = props[`${modalButtonType}Label`];
458
546
  if (newLabel) {
459
547
  label = newLabel;
460
548
  }
461
- const newVariant = props[`${ModalButtonType}Variant`];
549
+ const newVariant = props[`${modalButtonType}Variant`];
462
550
  if (newVariant) {
463
551
  variant = newVariant;
464
552
  }
465
553
  // Check if this button is last
466
554
  const last = (i === ModalButtonTypes.length - 1);
467
555
  // Create the button
468
- return (React__default["default"].createElement("button", { key: ModalButtonType, type: "button", className: `Modal-${ModalButtonType}-button btn btn-${variant} ${last ? '' : 'me-1'}`, onClick: () => {
469
- handleClose(ModalButtonType);
556
+ return (React__default["default"].createElement("button", { key: modalButtonType, type: "button", className: `Modal-${modalButtonType}-button btn btn-${variant} ${last ? '' : 'me-1'}`, onClick: () => {
557
+ handleClose(modalButtonType);
470
558
  } }, label));
471
559
  });
472
560
  // Put all buttons in a footer
@@ -484,7 +572,7 @@ const Modal = (props) => {
484
572
  animationClass = 'Modal-animating-pop';
485
573
  }
486
574
  // Render the modal
487
- return (React__default["default"].createElement("div", { className: `modal show modal-dialog-scrollable modal-dialog-centered`, tabIndex: -1, style: {
575
+ return (React__default["default"].createElement("div", { className: "modal show modal-dialog-scrollable modal-dialog-centered", tabIndex: -1, style: {
488
576
  zIndex: (onTopOfOtherModals
489
577
  ? 5000000001
490
578
  : 5000000000),
@@ -514,8 +602,22 @@ const Modal = (props) => {
514
602
  React__default["default"].createElement("div", { className: `modal-dialog modal-${size} ${animationClass}`, style: {
515
603
  zIndex: 5000000002,
516
604
  } },
517
- React__default["default"].createElement("div", { className: "modal-content" },
518
- React__default["default"].createElement("div", { className: "modal-header" },
605
+ React__default["default"].createElement("div", { className: "modal-content", style: {
606
+ borderColor: (isDarkModeOn()
607
+ ? 'gray'
608
+ : undefined),
609
+ } },
610
+ React__default["default"].createElement("div", { className: "modal-header", style: {
611
+ color: (isDarkModeOn()
612
+ ? 'white'
613
+ : undefined),
614
+ backgroundColor: (isDarkModeOn()
615
+ ? '#444'
616
+ : undefined),
617
+ borderBottom: (isDarkModeOn()
618
+ ? '0.1rem solid gray'
619
+ : undefined),
620
+ } },
519
621
  React__default["default"].createElement("h5", { className: "modal-title", style: {
520
622
  fontWeight: 'bold',
521
623
  } }, title),
@@ -523,22 +625,27 @@ const Modal = (props) => {
523
625
  // Handle close
524
626
  handleClose(ModalButtonType$1.Cancel);
525
627
  } }))),
526
- children && (React__default["default"].createElement("div", { className: "modal-body" }, children)),
527
- footer && (React__default["default"].createElement("div", { className: "modal-footer pt-1 pb-1" }, footer))))));
628
+ children && (React__default["default"].createElement("div", { className: "modal-body", style: {
629
+ color: (isDarkModeOn()
630
+ ? 'white'
631
+ : undefined),
632
+ backgroundColor: (isDarkModeOn()
633
+ ? '#444'
634
+ : undefined),
635
+ } }, children)),
636
+ footer && (React__default["default"].createElement("div", { className: "modal-footer pt-1 pb-1", style: {
637
+ color: (isDarkModeOn()
638
+ ? 'white'
639
+ : undefined),
640
+ backgroundColor: (isDarkModeOn()
641
+ ? '#444'
642
+ : undefined),
643
+ borderTop: (isDarkModeOn()
644
+ ? '0.1rem solid gray'
645
+ : undefined),
646
+ } }, footer))))));
528
647
  };
529
648
 
530
- /**
531
- * An error with a code
532
- * @author Gabe Abrams
533
- */
534
- class ErrorWithCode extends Error {
535
- constructor(message, code) {
536
- super(message);
537
- this.name = 'ErrorWithCode';
538
- this.code = code;
539
- }
540
- }
541
-
542
649
  /**
543
650
  * Path that all routes start with
544
651
  * @author Gabe Abrams
@@ -563,65 +670,6 @@ var LogLevel;
563
670
  })(LogLevel || (LogLevel = {}));
564
671
  var LogLevel$1 = LogLevel;
565
672
 
566
- /*----------------------------------------*/
567
- /* ---- Static Variables and Getters ---- */
568
- /*----------------------------------------*/
569
- /* ----------- Initialized ---------- */
570
- let onInitialized;
571
- let initialized = new Promise((resolve) => {
572
- onInitialized = resolve;
573
- });
574
- /* ---------- Send Request ---------- */
575
- let storedSendRequest;
576
- /**
577
- * Get the send request function
578
- * @author Gabe Abrams
579
- * @returns sendRequest function
580
- */
581
- const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
582
- // Show timeout error if too much time passes
583
- let successful = false;
584
- (() => __awaiter(void 0, void 0, void 0, function* () {
585
- yield waitMs(5000);
586
- if (!successful) {
587
- showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
588
- }
589
- }))(),
590
- // Wait for initialization
591
- yield initialized;
592
- successful = true;
593
- // Return
594
- return storedSendRequest;
595
- });
596
- /* ----- Session Expired Message ---- */
597
- let sessionExpiredMessage;
598
- /**
599
- * Get the custom session expired message
600
- * @author Gabe Abrams
601
- * @returns session expired message
602
- */
603
- const getSessionExpiredMessage = () => {
604
- // Return
605
- return (sessionExpiredMessage !== null && sessionExpiredMessage !== void 0 ? sessionExpiredMessage : 'Your session has expired. Please go back to Canvas and start over.');
606
- };
607
- /*----------------------------------------*/
608
- /* ---------------- Init ---------------- */
609
- /*----------------------------------------*/
610
- /**
611
- * Initialize the client-side version of reactkit
612
- * @author Gabe Abrams
613
- * @param opts object containing all arguments
614
- * @param opts.sendRequest caccl send request functions
615
- * @param [opts.sessionExpiredMessage] a custom session expired message
616
- */
617
- const initClient = (opts) => {
618
- // Store values
619
- storedSendRequest = opts.sendRequest;
620
- sessionExpiredMessage = opts.sessionExpiredMessage;
621
- // Mark as initialized
622
- onInitialized(null);
623
- };
624
-
625
673
  // Keep track of whether or not session expiry has already been handled
626
674
  let sessionAlreadyExpired = false;
627
675
  /*------------------------------------------------------------------------*/
@@ -981,7 +1029,7 @@ const AppWrapper = (props) => {
981
1029
  /* -------------------------------- Setup ------------------------------- */
982
1030
  /*------------------------------------------------------------------------*/
983
1031
  /* -------------- Props ------------- */
984
- const { children, dark, } = props;
1032
+ const { children, } = props;
985
1033
  /* -------------- State ------------- */
986
1034
  // Leave to URL
987
1035
  const [urlToLeaveTo, setURLToLeaveToInner,] = React.useState();
@@ -1064,7 +1112,7 @@ const AppWrapper = (props) => {
1064
1112
  width: '100vw',
1065
1113
  minHeight: '100vh',
1066
1114
  paddingTop: '2rem',
1067
- backgroundColor: (dark
1115
+ backgroundColor: (isDarkModeOn()
1068
1116
  ? '#222'
1069
1117
  : '#fff'),
1070
1118
  } },
@@ -1077,7 +1125,7 @@ const AppWrapper = (props) => {
1077
1125
  body = children;
1078
1126
  }
1079
1127
  /*----------------------------------------*/
1080
- /* Main UI */
1128
+ /* --------------- Main UI -------------- */
1081
1129
  /*----------------------------------------*/
1082
1130
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1083
1131
  React__default["default"].createElement("style", null, style$a),
@@ -1090,7 +1138,7 @@ const AppWrapper = (props) => {
1090
1138
  * @author Gabe Abrams
1091
1139
  */
1092
1140
  /*------------------------------------------------------------------------*/
1093
- /* Style */
1141
+ /* -------------------------------- Style ------------------------------- */
1094
1142
  /*------------------------------------------------------------------------*/
1095
1143
  const style$9 = `
1096
1144
  /* Container fades in */
@@ -1162,11 +1210,11 @@ const style$9 = `
1162
1210
  }
1163
1211
  `;
1164
1212
  /*------------------------------------------------------------------------*/
1165
- /* Component */
1213
+ /* ------------------------------ Component ----------------------------- */
1166
1214
  /*------------------------------------------------------------------------*/
1167
1215
  const LoadingSpinner = () => {
1168
1216
  /*------------------------------------------------------------------------*/
1169
- /* Render */
1217
+ /* ------------------------------- Render ------------------------------- */
1170
1218
  /*------------------------------------------------------------------------*/
1171
1219
  // Add all four blips to a container
1172
1220
  return (React__default["default"].createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
@@ -1182,7 +1230,7 @@ const LoadingSpinner = () => {
1182
1230
  * @author Gabe Abrams
1183
1231
  */
1184
1232
  /*------------------------------------------------------------------------*/
1185
- /* Style */
1233
+ /* -------------------------------- Style ------------------------------- */
1186
1234
  /*------------------------------------------------------------------------*/
1187
1235
  const style$8 = `
1188
1236
  /* Tab Box */
@@ -1248,19 +1296,19 @@ const style$8 = `
1248
1296
  }
1249
1297
  `;
1250
1298
  /*------------------------------------------------------------------------*/
1251
- /* Component */
1299
+ /* ------------------------------ Component ----------------------------- */
1252
1300
  /*------------------------------------------------------------------------*/
1253
1301
  const TabBox = (props) => {
1254
1302
  /*------------------------------------------------------------------------*/
1255
- /* Setup */
1303
+ /* -------------------------------- Setup ------------------------------- */
1256
1304
  /*------------------------------------------------------------------------*/
1257
1305
  /* -------------- Props ------------- */
1258
1306
  const { title, children, noBottomPadding, noBottomMargin, } = props;
1259
1307
  /*------------------------------------------------------------------------*/
1260
- /* Render */
1308
+ /* ------------------------------- Render ------------------------------- */
1261
1309
  /*------------------------------------------------------------------------*/
1262
1310
  /*----------------------------------------*/
1263
- /* Main UI */
1311
+ /* --------------- Main UI -------------- */
1264
1312
  /*----------------------------------------*/
1265
1313
  // Full UI
1266
1314
  return (React__default["default"].createElement("div", { className: `TabBox-container ${noBottomMargin ? '' : 'mb-2'}` },
@@ -1276,19 +1324,23 @@ const TabBox = (props) => {
1276
1324
  * @author Gabe Abrams
1277
1325
  */
1278
1326
  /*------------------------------------------------------------------------*/
1279
- /* Component */
1327
+ /* ------------------------------ Component ----------------------------- */
1280
1328
  /*------------------------------------------------------------------------*/
1281
1329
  const RadioButton = (props) => {
1282
1330
  /*------------------------------------------------------------------------*/
1283
- /* Setup */
1331
+ /* -------------------------------- Setup ------------------------------- */
1284
1332
  /*------------------------------------------------------------------------*/
1285
1333
  /* -------------- Props ------------- */
1286
- const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$1.Secondary, unselectedVariant = Variant$1.Light, small, } = props;
1334
+ const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = (isDarkModeOn()
1335
+ ? Variant$1.Light
1336
+ : Variant$1.Secondary), unselectedVariant = (isDarkModeOn()
1337
+ ? Variant$1.Secondary
1338
+ : Variant$1.Light), small, } = props;
1287
1339
  /*------------------------------------------------------------------------*/
1288
- /* Render */
1340
+ /* ------------------------------- Render ------------------------------- */
1289
1341
  /*------------------------------------------------------------------------*/
1290
1342
  /*----------------------------------------*/
1291
- /* Main UI */
1343
+ /* --------------- Main UI -------------- */
1292
1344
  /*----------------------------------------*/
1293
1345
  return (React__default["default"].createElement("button", { type: "button", id: id, title: title, className: `btn btn-${selected ? selectedVariant : unselectedVariant}${selected ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'}`, "aria-label": `${ariaLabel}${selected ? ': currently selected' : ''}`, onClick: () => {
1294
1346
  if (!selected) {
@@ -1304,19 +1356,23 @@ const RadioButton = (props) => {
1304
1356
  * @author Gabe Abrams
1305
1357
  */
1306
1358
  /*------------------------------------------------------------------------*/
1307
- /* Component */
1359
+ /* ------------------------------ Component ----------------------------- */
1308
1360
  /*------------------------------------------------------------------------*/
1309
1361
  const CheckboxButton = (props) => {
1310
1362
  /*------------------------------------------------------------------------*/
1311
- /* Setup */
1363
+ /* -------------------------------- Setup ------------------------------- */
1312
1364
  /*------------------------------------------------------------------------*/
1313
1365
  /* -------------- Props ------------- */
1314
- const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$1.Secondary, uncheckedVariant = Variant$1.Light, small, dashed, } = props;
1366
+ const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = (isDarkModeOn()
1367
+ ? Variant$1.Light
1368
+ : Variant$1.Secondary), uncheckedVariant = (isDarkModeOn()
1369
+ ? Variant$1.Secondary
1370
+ : Variant$1.Light), small, dashed, } = props;
1315
1371
  /*------------------------------------------------------------------------*/
1316
- /* Render */
1372
+ /* ------------------------------- Render ------------------------------- */
1317
1373
  /*------------------------------------------------------------------------*/
1318
1374
  /*----------------------------------------*/
1319
- /* Main UI */
1375
+ /* --------------- Main UI -------------- */
1320
1376
  /*----------------------------------------*/
1321
1377
  // Determine the icon
1322
1378
  let icon;
@@ -1341,20 +1397,20 @@ const CheckboxButton = (props) => {
1341
1397
  * @author Gabe Abrams
1342
1398
  */
1343
1399
  /*------------------------------------------------------------------------*/
1344
- /* Component */
1400
+ /* ------------------------------ Component ----------------------------- */
1345
1401
  /*------------------------------------------------------------------------*/
1346
1402
  const ButtonInputGroup = (props) => {
1347
1403
  /*------------------------------------------------------------------------*/
1348
- /* Setup */
1404
+ /* -------------------------------- Setup ------------------------------- */
1349
1405
  /*------------------------------------------------------------------------*/
1350
1406
  /* -------------- Props ------------- */
1351
1407
  // Destructure all props
1352
1408
  const { label, minLabelWidth, children, className, wrapButtonsAndAddGaps, } = props;
1353
1409
  /*------------------------------------------------------------------------*/
1354
- /* Render */
1410
+ /* ------------------------------- Render ------------------------------- */
1355
1411
  /*------------------------------------------------------------------------*/
1356
1412
  /*----------------------------------------*/
1357
- /* Main UI */
1413
+ /* --------------- Main UI -------------- */
1358
1414
  /*----------------------------------------*/
1359
1415
  return (React__default["default"].createElement("div", { className: `input-group ${className !== null && className !== void 0 ? className : ''}` },
1360
1416
  React__default["default"].createElement("div", { className: "input-group-prepend d-flex w-100" },
@@ -1480,21 +1536,19 @@ const getTimeInfoInET = (dateOrTimestamp) => {
1480
1536
  * @author Gabe Abrams
1481
1537
  */
1482
1538
  /*------------------------------------------------------------------------*/
1483
- /* Component */
1539
+ /* ------------------------------ Component ----------------------------- */
1484
1540
  /*------------------------------------------------------------------------*/
1485
1541
  const SimpleDateChooser = (props) => {
1486
1542
  /*------------------------------------------------------------------------*/
1487
- /* Setup */
1543
+ /* -------------------------------- Setup ------------------------------- */
1488
1544
  /*------------------------------------------------------------------------*/
1489
- var _a;
1490
1545
  /* -------------- Props ------------- */
1491
- const { ariaLabel, name, month, day, year, onChange, chooseFromPast, } = props;
1492
- const numMonthsToShow = ((_a = props.numMonthsToShow) !== null && _a !== void 0 ? _a : 6);
1546
+ const { ariaLabel, name, onChange, chooseFromPast, numMonthsToShow = 6, } = props;
1493
1547
  /*------------------------------------------------------------------------*/
1494
- /* Render */
1548
+ /* ------------------------------- Render ------------------------------- */
1495
1549
  /*------------------------------------------------------------------------*/
1496
1550
  /*----------------------------------------*/
1497
- /* Main UI */
1551
+ /* --------------- Main UI -------------- */
1498
1552
  /*----------------------------------------*/
1499
1553
  // Determine the set of choices allowed
1500
1554
  const today = getTimeInfoInET();
@@ -1549,6 +1603,7 @@ const SimpleDateChooser = (props) => {
1549
1603
  });
1550
1604
  }
1551
1605
  // Create choice options
1606
+ const { month, day, year, } = props;
1552
1607
  const monthOptions = [];
1553
1608
  const dayOptions = [];
1554
1609
  choices.forEach((choice) => {
@@ -1584,7 +1639,7 @@ const SimpleDateChooser = (props) => {
1584
1639
  * @author Gabe Abrams
1585
1640
  */
1586
1641
  /*------------------------------------------------------------------------*/
1587
- /* Style */
1642
+ /* -------------------------------- Style ------------------------------- */
1588
1643
  /*------------------------------------------------------------------------*/
1589
1644
  const style$7 = `
1590
1645
  .Drawer-container {
@@ -1602,20 +1657,20 @@ const style$7 = `
1602
1657
  }
1603
1658
  `;
1604
1659
  /*------------------------------------------------------------------------*/
1605
- /* Component */
1660
+ /* ------------------------------ Component ----------------------------- */
1606
1661
  /*------------------------------------------------------------------------*/
1607
1662
  const Drawer = (props) => {
1608
1663
  /*------------------------------------------------------------------------*/
1609
- /* Setup */
1664
+ /* -------------------------------- Setup ------------------------------- */
1610
1665
  /*------------------------------------------------------------------------*/
1611
1666
  /* -------------- Props ------------- */
1612
1667
  // Destructure all props
1613
1668
  const { customBackgroundColor, children, } = props;
1614
1669
  /*------------------------------------------------------------------------*/
1615
- /* Render */
1670
+ /* ------------------------------- Render ------------------------------- */
1616
1671
  /*------------------------------------------------------------------------*/
1617
1672
  /*----------------------------------------*/
1618
- /* Main UI */
1673
+ /* --------------- Main UI -------------- */
1619
1674
  /*----------------------------------------*/
1620
1675
  return (React__default["default"].createElement("div", { className: "Drawer-container", style: {
1621
1676
  backgroundColor: (customBackgroundColor !== null && customBackgroundColor !== void 0 ? customBackgroundColor : undefined),
@@ -1629,7 +1684,7 @@ const Drawer = (props) => {
1629
1684
  * @author Gabe Abrams
1630
1685
  */
1631
1686
  /*------------------------------------------------------------------------*/
1632
- /* Style */
1687
+ /* -------------------------------- Style ------------------------------- */
1633
1688
  /*------------------------------------------------------------------------*/
1634
1689
  const style$6 = `
1635
1690
  .PopSuccessMark-outer-container {
@@ -1717,20 +1772,20 @@ const style$6 = `
1717
1772
  }
1718
1773
  `;
1719
1774
  /*------------------------------------------------------------------------*/
1720
- /* Component */
1775
+ /* ------------------------------ Component ----------------------------- */
1721
1776
  /*------------------------------------------------------------------------*/
1722
1777
  const PopSuccessMark = (props) => {
1723
1778
  /*------------------------------------------------------------------------*/
1724
- /* Setup */
1779
+ /* -------------------------------- Setup ------------------------------- */
1725
1780
  /*------------------------------------------------------------------------*/
1726
1781
  /* -------------- Props ------------- */
1727
1782
  // Destructure all props
1728
1783
  const { sizeRem = 3, circleVariant = 'success', checkVariant = 'white', } = props;
1729
1784
  /*------------------------------------------------------------------------*/
1730
- /* Render */
1785
+ /* ------------------------------- Render ------------------------------- */
1731
1786
  /*------------------------------------------------------------------------*/
1732
1787
  /*----------------------------------------*/
1733
- /* Main UI */
1788
+ /* --------------- Main UI -------------- */
1734
1789
  /*----------------------------------------*/
1735
1790
  return (React__default["default"].createElement("div", { className: `PopSuccessMark-outer-container bg-${circleVariant}`, style: {
1736
1791
  width: `${sizeRem}rem`,
@@ -1750,7 +1805,7 @@ const PopSuccessMark = (props) => {
1750
1805
  * @author Gabe Abrams
1751
1806
  */
1752
1807
  /*------------------------------------------------------------------------*/
1753
- /* Style */
1808
+ /* -------------------------------- Style ------------------------------- */
1754
1809
  /*------------------------------------------------------------------------*/
1755
1810
  const style$5 = `
1756
1811
  .PopFailureMark-outer-container {
@@ -1837,20 +1892,20 @@ const style$5 = `
1837
1892
  }
1838
1893
  `;
1839
1894
  /*------------------------------------------------------------------------*/
1840
- /* Component */
1895
+ /* ------------------------------ Component ----------------------------- */
1841
1896
  /*------------------------------------------------------------------------*/
1842
1897
  const PopFailureMark = (props) => {
1843
1898
  /*------------------------------------------------------------------------*/
1844
- /* Setup */
1899
+ /* -------------------------------- Setup ------------------------------- */
1845
1900
  /*------------------------------------------------------------------------*/
1846
1901
  /* -------------- Props ------------- */
1847
1902
  // Destructure all props
1848
1903
  const { sizeRem = 3, circleVariant = 'danger', xVariant = 'white', } = props;
1849
1904
  /*------------------------------------------------------------------------*/
1850
- /* Render */
1905
+ /* ------------------------------- Render ------------------------------- */
1851
1906
  /*------------------------------------------------------------------------*/
1852
1907
  /*----------------------------------------*/
1853
- /* Main UI */
1908
+ /* --------------- Main UI -------------- */
1854
1909
  /*----------------------------------------*/
1855
1910
  return (React__default["default"].createElement("div", { className: `PopFailureMark-outer-container bg-${circleVariant}`, style: {
1856
1911
  width: `${sizeRem}rem`,
@@ -1870,7 +1925,7 @@ const PopFailureMark = (props) => {
1870
1925
  * @author Gabe Abrams
1871
1926
  */
1872
1927
  /*------------------------------------------------------------------------*/
1873
- /* Style */
1928
+ /* -------------------------------- Style ------------------------------- */
1874
1929
  /*------------------------------------------------------------------------*/
1875
1930
  const style$4 = `
1876
1931
  .PopPendingMark-outer-container {
@@ -1926,20 +1981,20 @@ const style$4 = `
1926
1981
  }
1927
1982
  `;
1928
1983
  /*------------------------------------------------------------------------*/
1929
- /* Component */
1984
+ /* ------------------------------ Component ----------------------------- */
1930
1985
  /*------------------------------------------------------------------------*/
1931
1986
  const PopPendingMark = (props) => {
1932
1987
  /*------------------------------------------------------------------------*/
1933
- /* Setup */
1988
+ /* -------------------------------- Setup ------------------------------- */
1934
1989
  /*------------------------------------------------------------------------*/
1935
1990
  /* -------------- Props ------------- */
1936
1991
  // Destructure all props
1937
1992
  const { sizeRem = 3, circleVariant = 'warning', hourglassVariant = 'white', } = props;
1938
1993
  /*------------------------------------------------------------------------*/
1939
- /* Render */
1994
+ /* ------------------------------- Render ------------------------------- */
1940
1995
  /*------------------------------------------------------------------------*/
1941
1996
  /*----------------------------------------*/
1942
- /* Main UI */
1997
+ /* --------------- Main UI -------------- */
1943
1998
  /*----------------------------------------*/
1944
1999
  return (React__default["default"].createElement("div", { className: `PopPendingMark-outer-container bg-${circleVariant}`, style: {
1945
2000
  width: `${sizeRem}rem`,
@@ -1989,11 +2044,11 @@ const reducer$8 = (state, action) => {
1989
2044
  }
1990
2045
  };
1991
2046
  /*------------------------------------------------------------------------*/
1992
- /* Component */
2047
+ /* ------------------------------ Component ----------------------------- */
1993
2048
  /*------------------------------------------------------------------------*/
1994
2049
  const CopiableBox = (props) => {
1995
2050
  /*------------------------------------------------------------------------*/
1996
- /* Setup */
2051
+ /* -------------------------------- Setup ------------------------------- */
1997
2052
  /*------------------------------------------------------------------------*/
1998
2053
  /* -------------- Props ------------- */
1999
2054
  // Destructure all props
@@ -2008,7 +2063,7 @@ const CopiableBox = (props) => {
2008
2063
  // Destructure common state
2009
2064
  const { recentlyCopied, } = state;
2010
2065
  /*------------------------------------------------------------------------*/
2011
- /* Component Functions */
2066
+ /* ------------------------- Component Functions ------------------------ */
2012
2067
  /*------------------------------------------------------------------------*/
2013
2068
  /**
2014
2069
  * Perform a copy
@@ -2034,10 +2089,10 @@ const CopiableBox = (props) => {
2034
2089
  });
2035
2090
  });
2036
2091
  /*------------------------------------------------------------------------*/
2037
- /* Render */
2092
+ /* ------------------------------- Render ------------------------------- */
2038
2093
  /*------------------------------------------------------------------------*/
2039
2094
  /*----------------------------------------*/
2040
- /* Main UI */
2095
+ /* --------------- Main UI -------------- */
2041
2096
  /*----------------------------------------*/
2042
2097
  return (React__default["default"].createElement("div", { className: "input-group mb-2" },
2043
2098
  (label || labelIcon) && (React__default["default"].createElement("span", { className: "input-group-text", style: {
@@ -2108,11 +2163,11 @@ const reducer$7 = (state, action) => {
2108
2163
  }
2109
2164
  };
2110
2165
  /*------------------------------------------------------------------------*/
2111
- /* Component */
2166
+ /* ------------------------------ Component ----------------------------- */
2112
2167
  /*------------------------------------------------------------------------*/
2113
2168
  const NestableItemList = (props) => {
2114
2169
  /*------------------------------------------------------------------------*/
2115
- /* Setup */
2170
+ /* -------------------------------- Setup ------------------------------- */
2116
2171
  /*------------------------------------------------------------------------*/
2117
2172
  /* -------------- Props ------------- */
2118
2173
  // Destructure all props
@@ -2132,7 +2187,7 @@ const NestableItemList = (props) => {
2132
2187
  // Destructure common state
2133
2188
  const { childExpanded, } = state;
2134
2189
  /*------------------------------------------------------------------------*/
2135
- /* Component Functions */
2190
+ /* ------------------------- Component Functions ------------------------ */
2136
2191
  /*------------------------------------------------------------------------*/
2137
2192
  /**
2138
2193
  * Checks if all items in a list are checked
@@ -2207,7 +2262,7 @@ const NestableItemList = (props) => {
2207
2262
  });
2208
2263
  };
2209
2264
  /*------------------------------------------------------------------------*/
2210
- /* Render */
2265
+ /* ------------------------------- Render ------------------------------- */
2211
2266
  /*------------------------------------------------------------------------*/
2212
2267
  return (React__default["default"].createElement("div", null, items.map((item) => {
2213
2268
  return (React__default["default"].createElement("div", { key: item.id },
@@ -2240,23 +2295,23 @@ const NestableItemList = (props) => {
2240
2295
  * @author Yuen Ler Chow
2241
2296
  */
2242
2297
  /*------------------------------------------------------------------------*/
2243
- /* Component */
2298
+ /* ------------------------------ Component ----------------------------- */
2244
2299
  /*------------------------------------------------------------------------*/
2245
2300
  const ItemPicker = (props) => {
2246
2301
  /*------------------------------------------------------------------------*/
2247
- /* Setup */
2302
+ /* -------------------------------- Setup ------------------------------- */
2248
2303
  /*------------------------------------------------------------------------*/
2249
2304
  /* -------------- Props ------------- */
2250
2305
  // Destructure all props
2251
2306
  const { title, items, onChanged, noBottomMargin, } = props;
2252
2307
  /*------------------------------------------------------------------------*/
2253
- /* Component Functions */
2308
+ /* ------------------------- Component Functions ------------------------ */
2254
2309
  /*------------------------------------------------------------------------*/
2255
2310
  /*------------------------------------------------------------------------*/
2256
- /* Render */
2311
+ /* ------------------------------- Render ------------------------------- */
2257
2312
  /*------------------------------------------------------------------------*/
2258
2313
  /*----------------------------------------*/
2259
- /* Main UI */
2314
+ /* --------------- Main UI -------------- */
2260
2315
  /*----------------------------------------*/
2261
2316
  return (React__default["default"].createElement(TabBox, { title: title, noBottomMargin: noBottomMargin },
2262
2317
  React__default["default"].createElement("div", { style: { overflowX: 'auto' } },
@@ -2454,20 +2509,20 @@ const genCSV = (data, columns) => {
2454
2509
  * @author Gabe Abrams
2455
2510
  */
2456
2511
  /*------------------------------------------------------------------------*/
2457
- /* Component */
2512
+ /* ------------------------------ Component ----------------------------- */
2458
2513
  /*------------------------------------------------------------------------*/
2459
2514
  const CSVDownloadButton = (props) => {
2460
2515
  /*------------------------------------------------------------------------*/
2461
- /* Setup */
2516
+ /* -------------------------------- Setup ------------------------------- */
2462
2517
  /*------------------------------------------------------------------------*/
2463
2518
  /* -------------- Props ------------- */
2464
2519
  // Destructure all props
2465
2520
  const { filename, csv, id, className, ariaLabel, style, onClick, children, } = props;
2466
2521
  /*------------------------------------------------------------------------*/
2467
- /* Render */
2522
+ /* ------------------------------- Render ------------------------------- */
2468
2523
  /*------------------------------------------------------------------------*/
2469
2524
  /*----------------------------------------*/
2470
- /* Main UI */
2525
+ /* --------------- Main UI -------------- */
2471
2526
  /*----------------------------------------*/
2472
2527
  // Render the button
2473
2528
  return (React__default["default"].createElement("a", { id: id, download: filename, href: `data:application/octet-stream,${encodeURIComponent(csv)}`, className: `CSVDownloadButton-button ${className !== null && className !== void 0 ? className : 'btn btn-secondary'}`, "aria-label": (ariaLabel
@@ -2555,26 +2610,26 @@ const reducer$6 = (state, action) => {
2555
2610
  }
2556
2611
  };
2557
2612
  /*------------------------------------------------------------------------*/
2558
- /* Component */
2613
+ /* ------------------------------ Component ----------------------------- */
2559
2614
  /*------------------------------------------------------------------------*/
2560
2615
  const IntelliTable = (props) => {
2561
2616
  /*------------------------------------------------------------------------*/
2562
- /* Setup */
2617
+ /* -------------------------------- Setup ------------------------------- */
2563
2618
  /*------------------------------------------------------------------------*/
2564
2619
  var _a;
2565
2620
  /* -------------- Props ------------- */
2566
2621
  // Destructure all props
2567
- const { title, id, columns, } = props;
2622
+ const { title, id, columns, csvName, data = [], } = props;
2568
2623
  // Get data, show empty row if none
2569
- const data = ((props.data && props.data.length > 0)
2570
- ? props.data
2571
- : [{ id: 'empty-row' }]);
2624
+ if (data.length === 0) {
2625
+ data.push({ id: 'empty-row' });
2626
+ }
2572
2627
  // Get CSV filename
2573
2628
  let filename = `${title}.csv`;
2574
- if (props.csvName) {
2575
- filename = (props.csvName.endsWith('.csv')
2576
- ? props.csvName
2577
- : `${props.csvName}.csv`);
2629
+ if (csvName) {
2630
+ filename = (csvName.endsWith('.csv')
2631
+ ? csvName
2632
+ : `${csvName}.csv`);
2578
2633
  }
2579
2634
  /* -------------- State ------------- */
2580
2635
  // Initial state
@@ -2593,10 +2648,10 @@ const IntelliTable = (props) => {
2593
2648
  // Destructure common state
2594
2649
  const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
2595
2650
  /*------------------------------------------------------------------------*/
2596
- /* Render */
2651
+ /* ------------------------------- Render ------------------------------- */
2597
2652
  /*------------------------------------------------------------------------*/
2598
2653
  /*----------------------------------------*/
2599
- /* Modal */
2654
+ /* ---------------- Modal --------------- */
2600
2655
  /*----------------------------------------*/
2601
2656
  // Modal that may be defined
2602
2657
  let modal;
@@ -2637,7 +2692,7 @@ const IntelliTable = (props) => {
2637
2692
  } }, "Deselect All")));
2638
2693
  }
2639
2694
  /*----------------------------------------*/
2640
- /* Main UI */
2695
+ /* --------------- Main UI -------------- */
2641
2696
  /*----------------------------------------*/
2642
2697
  // Table header
2643
2698
  const headerCells = (columns
@@ -2692,7 +2747,7 @@ const IntelliTable = (props) => {
2692
2747
  const tableHeader = (React__default["default"].createElement("thead", null,
2693
2748
  React__default["default"].createElement("tr", null, headerCells)));
2694
2749
  // Sort data
2695
- let sortedData = [...data];
2750
+ const sortedData = [...data];
2696
2751
  const paramType = (_a = columns.find((column) => {
2697
2752
  return (column.param === sortColumnParam);
2698
2753
  })) === null || _a === void 0 ? void 0 : _a.type;
@@ -2781,7 +2836,7 @@ const IntelliTable = (props) => {
2781
2836
  });
2782
2837
  let fullValue;
2783
2838
  let visibleValue;
2784
- let title = '';
2839
+ let colTitle = '';
2785
2840
  if (column.type === ParamType$1.Boolean) {
2786
2841
  fullValue = !!(value);
2787
2842
  const noValue = (value === undefined
@@ -2789,9 +2844,9 @@ const IntelliTable = (props) => {
2789
2844
  visibleValue = (noValue
2790
2845
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2791
2846
  : (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: fullValue ? freeSolidSvgIcons.faCheckCircle : freeSolidSvgIcons.faXmarkCircle })));
2792
- title = (fullValue ? 'True' : 'False');
2847
+ colTitle = (fullValue ? 'True' : 'False');
2793
2848
  if (noValue) {
2794
- title = 'Empty Cell';
2849
+ colTitle = 'Empty Cell';
2795
2850
  }
2796
2851
  }
2797
2852
  else if (column.type === ParamType$1.Int) {
@@ -2800,9 +2855,9 @@ const IntelliTable = (props) => {
2800
2855
  visibleValue = (noValue
2801
2856
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2802
2857
  : fullValue);
2803
- title = String(fullValue);
2858
+ colTitle = String(fullValue);
2804
2859
  if (noValue) {
2805
- title = 'Empty Cell';
2860
+ colTitle = 'Empty Cell';
2806
2861
  }
2807
2862
  }
2808
2863
  else if (column.type === ParamType$1.Float) {
@@ -2811,9 +2866,9 @@ const IntelliTable = (props) => {
2811
2866
  visibleValue = (noValue
2812
2867
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2813
2868
  : roundToNumDecimals(fullValue, 2));
2814
- title = String(fullValue);
2869
+ colTitle = String(fullValue);
2815
2870
  if (noValue) {
2816
- title = 'Empty Cell';
2871
+ colTitle = 'Empty Cell';
2817
2872
  }
2818
2873
  }
2819
2874
  else if (column.type === ParamType$1.String) {
@@ -2824,9 +2879,9 @@ const IntelliTable = (props) => {
2824
2879
  visibleValue = (noValue
2825
2880
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2826
2881
  : fullValue);
2827
- title = `"${value}"`;
2882
+ colTitle = `"${value}"`;
2828
2883
  if (noValue) {
2829
- title = 'Empty Cell';
2884
+ colTitle = 'Empty Cell';
2830
2885
  }
2831
2886
  }
2832
2887
  else if (column.type === ParamType$1.JSON) {
@@ -2837,10 +2892,10 @@ const IntelliTable = (props) => {
2837
2892
  visibleValue = (noValue
2838
2893
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2839
2894
  : fullValue);
2840
- title = "JSON Object";
2895
+ colTitle = 'JSON Object';
2841
2896
  }
2842
2897
  // Create UI
2843
- return (React__default["default"].createElement("td", { key: `${datum.id}-${column.param}`, title: title, style: {
2898
+ return (React__default["default"].createElement("td", { key: `${datum.id}-${column.param}`, title: colTitle, style: {
2844
2899
  borderRight: '0.05rem solid #555',
2845
2900
  borderLeft: '0.05rem solid #555',
2846
2901
  } }, visibleValue));
@@ -2902,7 +2957,7 @@ var FilterDrawer;
2902
2957
  FilterDrawer["Advanced"] = "advanced";
2903
2958
  })(FilterDrawer || (FilterDrawer = {}));
2904
2959
  /*------------------------------------------------------------------------*/
2905
- /* Style */
2960
+ /* -------------------------------- Style ------------------------------- */
2906
2961
  /*------------------------------------------------------------------------*/
2907
2962
  const style$3 = `
2908
2963
  .LogReviewer-outer-container {
@@ -2988,7 +3043,7 @@ const style$3 = `
2988
3043
  }
2989
3044
  `;
2990
3045
  /*------------------------------------------------------------------------*/
2991
- /* Constants */
3046
+ /* ------------------------------ Constants ----------------------------- */
2992
3047
  /*------------------------------------------------------------------------*/
2993
3048
  const columns = [
2994
3049
  {
@@ -3177,7 +3232,7 @@ const columns = [
3177
3232
  },
3178
3233
  ];
3179
3234
  /*------------------------------------------------------------------------*/
3180
- /* Static Functions */
3235
+ /* -------------------------- Static Functions -------------------------- */
3181
3236
  /*------------------------------------------------------------------------*/
3182
3237
  /**
3183
3238
  * Turn a machine-readable name into a human-readable name
@@ -3307,11 +3362,11 @@ const reducer$5 = (state, action) => {
3307
3362
  }
3308
3363
  };
3309
3364
  /*------------------------------------------------------------------------*/
3310
- /* Component */
3365
+ /* ------------------------------ Component ----------------------------- */
3311
3366
  /*------------------------------------------------------------------------*/
3312
3367
  const LogReviewer = (props) => {
3313
3368
  /*------------------------------------------------------------------------*/
3314
- /* Setup */
3369
+ /* -------------------------------- Setup ------------------------------- */
3315
3370
  /*------------------------------------------------------------------------*/
3316
3371
  var _a, _b, _c, _d;
3317
3372
  /* -------------- Props ------------- */
@@ -3431,7 +3486,7 @@ const LogReviewer = (props) => {
3431
3486
  // Destructure common state
3432
3487
  const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
3433
3488
  /*------------------------------------------------------------------------*/
3434
- /* Component Functions */
3489
+ /* ------------------------- Component Functions ------------------------ */
3435
3490
  /*------------------------------------------------------------------------*/
3436
3491
  /**
3437
3492
  * Get the list of year/month combos that need to be loaded given a new
@@ -3444,8 +3499,7 @@ const LogReviewer = (props) => {
3444
3499
  // List of year/month combos that need to be loaded
3445
3500
  const toLoad = [];
3446
3501
  // Loop through dates
3447
- let year = newDateFilterState.startDate.year;
3448
- let month = newDateFilterState.startDate.month;
3502
+ let { year, month } = newDateFilterState.startDate;
3449
3503
  while (
3450
3504
  // Earlier year
3451
3505
  (year < newDateFilterState.endDate.year)
@@ -3518,7 +3572,7 @@ const LogReviewer = (props) => {
3518
3572
  });
3519
3573
  });
3520
3574
  /*------------------------------------------------------------------------*/
3521
- /* Lifecycle Functions */
3575
+ /* ------------------------- Lifecycle Functions ------------------------ */
3522
3576
  /*------------------------------------------------------------------------*/
3523
3577
  /**
3524
3578
  * Mount
@@ -3529,10 +3583,10 @@ const LogReviewer = (props) => {
3529
3583
  handleDateRangeUpdated(dateFilterState);
3530
3584
  }, []);
3531
3585
  /*------------------------------------------------------------------------*/
3532
- /* Render */
3586
+ /* ------------------------------- Render ------------------------------- */
3533
3587
  /*------------------------------------------------------------------------*/
3534
3588
  /*----------------------------------------*/
3535
- /* Main UI */
3589
+ /* --------------- Main UI -------------- */
3536
3590
  /*----------------------------------------*/
3537
3591
  // Body that will be filled with the contents of the panel
3538
3592
  let body;
@@ -3544,7 +3598,7 @@ const LogReviewer = (props) => {
3544
3598
  /* ------------ Review UI ----------- */
3545
3599
  if (!loading) {
3546
3600
  /*----------------------------------------*/
3547
- /* Filters */
3601
+ /* --------------- Filters -------------- */
3548
3602
  /*----------------------------------------*/
3549
3603
  // Filter toggle
3550
3604
  const filterToggles = (React__default["default"].createElement("div", { className: "LogReviewer-filter-toggles" },
@@ -3843,7 +3897,7 @@ const LogReviewer = (props) => {
3843
3897
  React__default["default"].createElement("span", { className: "input-group-text" }, "User Canvas Id"),
3844
3898
  React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user canvas id", value: advancedFilterState.userId, placeholder: "e.g. 104985", onChange: (e) => {
3845
3899
  const { value } = e.target;
3846
- // Only update if value contains only numbers
3900
+ // Only update if value contains only numbers
3847
3901
  if (/^\d+$/.test(value)) {
3848
3902
  advancedFilterState.userId = ((e.target.value)
3849
3903
  .trim());
@@ -3889,7 +3943,7 @@ const LogReviewer = (props) => {
3889
3943
  React__default["default"].createElement("span", { className: "input-group-text" }, "Course Canvas Id"),
3890
3944
  React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course canvas id", value: advancedFilterState.courseId, placeholder: "e.g. 15948", onChange: (e) => {
3891
3945
  const { value } = e.target;
3892
- // Only update if value contains only numbers
3946
+ // Only update if value contains only numbers
3893
3947
  if (/^\d+$/.test(value)) {
3894
3948
  advancedFilterState.courseId = ((e.target.value)
3895
3949
  .trim());
@@ -4222,7 +4276,7 @@ const LogReviewer = (props) => {
4222
4276
  });
4223
4277
  });
4224
4278
  /*----------------------------------------*/
4225
- /* Data */
4279
+ /* ---------------- Data ---------------- */
4226
4280
  /*----------------------------------------*/
4227
4281
  // Nothing to show notice
4228
4282
  const noLogsNotice = (logs.length === 0
@@ -41805,7 +41859,7 @@ const genRouteHandler = (opts) => {
41805
41859
  // Output params
41806
41860
  const output = {};
41807
41861
  /*----------------------------------------*/
41808
- /* Parse Params */
41862
+ /* ------------ Parse Params ------------ */
41809
41863
  /*----------------------------------------*/
41810
41864
  // Process items one by one
41811
41865
  const paramList = Object.entries((_a = opts.paramTypes) !== null && _a !== void 0 ? _a : {});
@@ -41964,7 +42018,7 @@ const genRouteHandler = (opts) => {
41964
42018
  }
41965
42019
  }
41966
42020
  /*----------------------------------------*/
41967
- /* Launch Info */
42021
+ /* ------------- Launch Info ------------ */
41968
42022
  /*----------------------------------------*/
41969
42023
  // Get launch info
41970
42024
  const { launched, launchInfo } = cacclGetLaunchInfo(req);
@@ -42099,7 +42153,7 @@ const genRouteHandler = (opts) => {
42099
42153
  * Log an event on the server
42100
42154
  * @author Gabe Abrams
42101
42155
  */
42102
- const logServerEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
42156
+ const logServerEvent = (logOpts) => __awaiter(void 0, void 0, void 0, function* () {
42103
42157
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
42104
42158
  // NOTE: internally, we slip through an opts.overrideAsClientEvent boolean
42105
42159
  // that indicates that this is actually a client event, but we don't
@@ -42130,29 +42184,29 @@ const genRouteHandler = (opts) => {
42130
42184
  hour,
42131
42185
  minute,
42132
42186
  timestamp,
42133
- context: (typeof opts.context === 'string'
42134
- ? opts.context
42135
- : ((_d = ((_c = opts.context) !== null && _c !== void 0 ? _c : {})._) !== null && _d !== void 0 ? _d : LogBuiltInMetadata.Context.Uncategorized)),
42136
- subcontext: ((_e = opts.subcontext) !== null && _e !== void 0 ? _e : LogBuiltInMetadata.Context.Uncategorized),
42137
- tags: ((_f = opts.tags) !== null && _f !== void 0 ? _f : []),
42138
- level: ((_g = opts.level) !== null && _g !== void 0 ? _g : LogLevel$1.Info),
42139
- metadata: ((_h = opts.metadata) !== null && _h !== void 0 ? _h : {}),
42187
+ context: (typeof logOpts.context === 'string'
42188
+ ? logOpts.context
42189
+ : ((_d = ((_c = logOpts.context) !== null && _c !== void 0 ? _c : {})._) !== null && _d !== void 0 ? _d : LogBuiltInMetadata.Context.Uncategorized)),
42190
+ subcontext: ((_e = logOpts.subcontext) !== null && _e !== void 0 ? _e : LogBuiltInMetadata.Context.Uncategorized),
42191
+ tags: ((_f = logOpts.tags) !== null && _f !== void 0 ? _f : []),
42192
+ level: ((_g = logOpts.level) !== null && _g !== void 0 ? _g : LogLevel$1.Info),
42193
+ metadata: ((_h = logOpts.metadata) !== null && _h !== void 0 ? _h : {}),
42140
42194
  };
42141
42195
  // Type-specific info
42142
42196
  const typeSpecificInfo = (('error' in opts && opts.error)
42143
42197
  ? {
42144
42198
  type: LogType$1.Error,
42145
- errorMessage: (_j = opts.error.message) !== null && _j !== void 0 ? _j : 'Unknown message',
42146
- errorCode: (_k = opts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$1.NoCode,
42147
- errorStack: (_l = opts.error.stack) !== null && _l !== void 0 ? _l : 'No stack',
42199
+ errorMessage: (_j = logOpts.error.message) !== null && _j !== void 0 ? _j : 'Unknown message',
42200
+ errorCode: (_k = logOpts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$1.NoCode,
42201
+ errorStack: (_l = logOpts.error.stack) !== null && _l !== void 0 ? _l : 'No stack',
42148
42202
  }
42149
42203
  : {
42150
42204
  type: LogType$1.Action,
42151
- target: ((_m = opts.target) !== null && _m !== void 0 ? _m : LogBuiltInMetadata.Target.NoTarget),
42152
- action: ((_o = opts.action) !== null && _o !== void 0 ? _o : LogAction$1.Unknown),
42205
+ target: ((_m = logOpts.target) !== null && _m !== void 0 ? _m : LogBuiltInMetadata.Target.NoTarget),
42206
+ action: ((_o = logOpts.action) !== null && _o !== void 0 ? _o : LogAction$1.Unknown),
42153
42207
  });
42154
42208
  // Source-specific info
42155
- const sourceSpecificInfo = (opts.overrideAsClientEvent
42209
+ const sourceSpecificInfo = (logOpts.overrideAsClientEvent
42156
42210
  ? {
42157
42211
  source: LogSource$1.Client,
42158
42212
  }
@@ -42169,20 +42223,21 @@ const genRouteHandler = (opts) => {
42169
42223
  // Store to the log collection
42170
42224
  yield logCollection.insert(log);
42171
42225
  }
42172
- else {
42226
+ else if (log.type === LogType$1.Error) {
42173
42227
  // Print to console
42174
- if (log.type === LogType$1.Error) {
42175
- console.error('dce-reactkit error log:', log);
42176
- }
42177
- else {
42178
- console.log('dce-reactkit action log:', log);
42179
- }
42228
+ // eslint-disable-next-line no-console
42229
+ console.error('dce-reactkit error log:', log);
42230
+ }
42231
+ else {
42232
+ // eslint-disable-next-line no-console
42233
+ console.log('dce-reactkit action log:', log);
42180
42234
  }
42181
42235
  // Return log entry
42182
42236
  return log;
42183
42237
  }
42184
42238
  catch (err) {
42185
42239
  // Print because we cannot store the error
42240
+ // eslint-disable-next-line no-console
42186
42241
  console.error('Could not log the following:', opts);
42187
42242
  // Create a dummy log to return
42188
42243
  const dummyMainInfo = {
@@ -42258,32 +42313,32 @@ const genRouteHandler = (opts) => {
42258
42313
  /**
42259
42314
  * Render an error page
42260
42315
  * @author Gabe Abrams
42261
- * @param opts object containing all arguments
42262
- * @param [opts.title=An Error Occurred] title of the error box
42263
- * @param [opts.description=An unknown server error occurred. Please contact support.]
42316
+ * @param renderOpts object containing all arguments
42317
+ * @param [renderOpts.title=An Error Occurred] title of the error box
42318
+ * @param [renderOpts.description=An unknown server error occurred. Please contact support.]
42264
42319
  * a human-readable description of the error
42265
- * @param [opts.code=ReactKitErrorCode.NoCode] error code to show
42266
- * @param [opts.pageTitle=opts.title] title of the page/tab if it differs from
42320
+ * @param [renderOpts.code=ReactKitErrorCode.NoCode] error code to show
42321
+ * @param [renderOpts.pageTitle=renderOpts.title] title of the page/tab if it differs from
42267
42322
  * the title of the error
42268
- * @param [opts.status=500] http status code
42323
+ * @param [renderOpts.status=500] http status code
42269
42324
  */
42270
- const renderErrorPage = (opts = {}) => {
42325
+ const renderErrorPage = (renderOpts = {}) => {
42271
42326
  var _a, _b;
42272
- const html = genErrorPage(opts);
42273
- send(html, (_a = opts.status) !== null && _a !== void 0 ? _a : 500);
42327
+ const html = genErrorPage(renderOpts);
42328
+ send(html, (_a = renderOpts.status) !== null && _a !== void 0 ? _a : 500);
42274
42329
  // Log
42275
42330
  logServerEvent({
42276
42331
  context: LogBuiltInMetadata.Context.ServerRenderedErrorPage,
42277
42332
  error: {
42278
- message: `${opts.title}: ${opts.description}`,
42279
- code: opts.code,
42333
+ message: `${renderOpts.title}: ${renderOpts.description}`,
42334
+ code: renderOpts.code,
42280
42335
  },
42281
42336
  metadata: {
42282
- title: opts.title,
42283
- description: opts.description,
42284
- code: opts.code,
42285
- pageTitle: opts.pageTitle,
42286
- status: (_b = opts.status) !== null && _b !== void 0 ? _b : 500,
42337
+ title: renderOpts.title,
42338
+ description: renderOpts.description,
42339
+ code: renderOpts.code,
42340
+ pageTitle: renderOpts.pageTitle,
42341
+ status: (_b = renderOpts.status) !== null && _b !== void 0 ? _b : 500,
42287
42342
  },
42288
42343
  });
42289
42344
  };
@@ -42318,6 +42373,7 @@ const genRouteHandler = (opts) => {
42318
42373
  return;
42319
42374
  }
42320
42375
  // Log error that was not responded with
42376
+ // eslint-disable-next-line no-console
42321
42377
  console.log('Error occurred but could not be sent to client because a response was already sent:', err);
42322
42378
  }
42323
42379
  });
@@ -42942,8 +42998,9 @@ const urlRegex = /(https?:\/\/)?([a-z0-9-]+\.)+[a-z0-9]{2,6}(:[0-9]{1,5})?(\/\S*
42942
42998
  * @param text the text to process
42943
42999
  * @param [opts] options to customize behavior
42944
43000
  * @param [opts.newTab] if true, links will open in a new tab
42945
- * @param [opts.preventPropagation] if true, clicks to link will prevent default
42946
- * and propagation
43001
+ * @param [opts.preventPropagation] if true, clicks to link will prevent
43002
+ * propagation
43003
+ * @param [opts.inheritColor] if true, inherit text color for links
42947
43004
  * @returns the processed text
42948
43005
  */
42949
43006
  const makeLinksClickable = (text, opts) => {
@@ -42970,10 +43027,10 @@ const makeLinksClickable = (text, opts) => {
42970
43027
  // Add the link
42971
43028
  elements.push(React__default["default"].createElement("a", { key: nextKey += 1, href: link, target: newTab ? '_blank' : undefined, rel: newTab ? 'noopener noreferrer' : undefined, style: {
42972
43029
  textDecoration: 'underline',
43030
+ color: (opts === null || opts === void 0 ? void 0 : opts.inheritColor) ? 'inherit' : undefined,
42973
43031
  }, onClick: (e) => {
42974
- // Prevent default and propagation if requested
43032
+ // Prevent propagation if requested
42975
43033
  if (opts === null || opts === void 0 ? void 0 : opts.preventPropagation) {
42976
- e.preventDefault();
42977
43034
  e.stopPropagation();
42978
43035
  }
42979
43036
  } }, link));