dce-reactkit 3.6.28 → 3.7.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,8 +1,9 @@
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, faCaretDown } from '@fortawesome/free-solid-svg-icons';
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';
4
4
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
5
  import { faCircle as faCircle$1, faSquareMinus, faSquare } from '@fortawesome/free-regular-svg-icons';
6
+ import { Tooltip as Tooltip$1 } from 'bootstrap';
6
7
 
7
8
  /******************************************************************************
8
9
  Copyright (c) Microsoft Corporation.
@@ -386,7 +387,7 @@ const getModalButtonTypeToLabelAndVariant = () => {
386
387
  /*------------------------------------------------------------------------*/
387
388
  /* -------------------------------- Style ------------------------------- */
388
389
  /*------------------------------------------------------------------------*/
389
- const style$b = `
390
+ const style$a = `
390
391
  .Modal-backdrop {
391
392
  position: fixed;
392
393
  top: 0;
@@ -555,7 +556,7 @@ const Modal = (props) => {
555
556
  left: 0,
556
557
  right: 0,
557
558
  } },
558
- React__default.createElement("style", null, style$b),
559
+ React__default.createElement("style", null, style$a),
559
560
  React__default.createElement("div", { className: `Modal-backdrop ${backdropAnimationClass}`, style: {
560
561
  zIndex: 5000000003,
561
562
  }, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -1055,7 +1056,7 @@ const showSessionExpiredMessage = () => __awaiter(void 0, void 0, void 0, functi
1055
1056
  /*------------------------------------------------------------------------*/
1056
1057
  /* -------------------------------- Style ------------------------------- */
1057
1058
  /*------------------------------------------------------------------------*/
1058
- const style$a = `
1059
+ const style$9 = `
1059
1060
  .AppWrapper-leave-to-url-notice {
1060
1061
  opacity: 0;
1061
1062
 
@@ -1189,11 +1190,36 @@ const AppWrapper = (props) => {
1189
1190
  if (!body) {
1190
1191
  body = children;
1191
1192
  }
1193
+ /* ------------- Tooltip ------------ */
1194
+ const tooltipStyle = (isDarkModeOn()
1195
+ ? `
1196
+ .tooltip-inner {
1197
+ background-color: white;
1198
+ color: black;
1199
+ border: 0.1rem solid black;
1200
+ }
1201
+ div[data-popper-placement="top"] .tooltip-arrow::before {
1202
+ border-top-color: white !important;
1203
+ transform: translate(0, -0.05rem);
1204
+ }
1205
+ `
1206
+ : `
1207
+ .tooltip-inner {
1208
+ background-color: black;
1209
+ color: black;
1210
+ border: 0.1rem solid white;
1211
+ }
1212
+ div[data-popper-placement="top"] .tooltip-arrow::before {
1213
+ border-top-color: black !important;
1214
+ transform: translate(0, -0.05rem);
1215
+ }
1216
+ `);
1192
1217
  /*----------------------------------------*/
1193
1218
  /* --------------- Main UI -------------- */
1194
1219
  /*----------------------------------------*/
1195
1220
  return (React__default.createElement(React__default.Fragment, null,
1196
- React__default.createElement("style", null, style$a),
1221
+ React__default.createElement("style", null, style$9),
1222
+ React__default.createElement("style", null, tooltipStyle),
1197
1223
  modal,
1198
1224
  body));
1199
1225
  };
@@ -1205,7 +1231,7 @@ const AppWrapper = (props) => {
1205
1231
  /*------------------------------------------------------------------------*/
1206
1232
  /* -------------------------------- Style ------------------------------- */
1207
1233
  /*------------------------------------------------------------------------*/
1208
- const style$9 = `
1234
+ const style$8 = `
1209
1235
  /* Container fades in */
1210
1236
  .LoadingSpinner-container {
1211
1237
  animation-name: LoadingSpinner-container-fade-in;
@@ -1283,7 +1309,7 @@ const LoadingSpinner = () => {
1283
1309
  /*------------------------------------------------------------------------*/
1284
1310
  // Add all four blips to a container
1285
1311
  return (React__default.createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
1286
- React__default.createElement("style", null, style$9),
1312
+ React__default.createElement("style", null, style$8),
1287
1313
  React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-1 me-1" }),
1288
1314
  React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-2 me-1" }),
1289
1315
  React__default.createElement(FontAwesomeIcon, { icon: faCircle, className: "LoadingSpinner-blip-3 me-1" }),
@@ -1297,7 +1323,7 @@ const LoadingSpinner = () => {
1297
1323
  /*------------------------------------------------------------------------*/
1298
1324
  /* -------------------------------- Style ------------------------------- */
1299
1325
  /*------------------------------------------------------------------------*/
1300
- const style$8 = `
1326
+ const style$7 = `
1301
1327
  /* Tab Box */
1302
1328
  .TabBox-box {
1303
1329
  /* Light Border */
@@ -1377,7 +1403,7 @@ const TabBox = (props) => {
1377
1403
  /*----------------------------------------*/
1378
1404
  // Full UI
1379
1405
  return (React__default.createElement("div", { className: `TabBox-container ${noBottomMargin ? '' : 'mb-2'}` },
1380
- React__default.createElement("style", null, style$8),
1406
+ React__default.createElement("style", null, style$7),
1381
1407
  React__default.createElement("div", { className: "TabBox-title-container" },
1382
1408
  React__default.createElement("div", { className: "TabBox-title" }, title)),
1383
1409
  React__default.createElement("div", { className: `TabBox-box ps-2 pt-2 pe-2 ${noBottomPadding ? '' : 'pb-2'}` },
@@ -1706,7 +1732,7 @@ const SimpleDateChooser = (props) => {
1706
1732
  /*------------------------------------------------------------------------*/
1707
1733
  /* -------------------------------- Style ------------------------------- */
1708
1734
  /*------------------------------------------------------------------------*/
1709
- const style$7 = `
1735
+ const style$6 = `
1710
1736
  .Drawer-container {
1711
1737
  margin-left: 1rem;
1712
1738
  margin-right: 1rem;
@@ -1740,7 +1766,7 @@ const Drawer = (props) => {
1740
1766
  return (React__default.createElement("div", { className: "Drawer-container", style: {
1741
1767
  backgroundColor: (customBackgroundColor !== null && customBackgroundColor !== void 0 ? customBackgroundColor : undefined),
1742
1768
  } },
1743
- React__default.createElement("style", null, style$7),
1769
+ React__default.createElement("style", null, style$6),
1744
1770
  children));
1745
1771
  };
1746
1772
 
@@ -1751,7 +1777,7 @@ const Drawer = (props) => {
1751
1777
  /*------------------------------------------------------------------------*/
1752
1778
  /* -------------------------------- Style ------------------------------- */
1753
1779
  /*------------------------------------------------------------------------*/
1754
- const style$6 = `
1780
+ const style$5 = `
1755
1781
  .PopSuccessMark-outer-container {
1756
1782
  position: relative;
1757
1783
  display: inline-block;
@@ -1856,7 +1882,7 @@ const PopSuccessMark = (props) => {
1856
1882
  width: `${sizeRem}rem`,
1857
1883
  height: `${sizeRem}rem`,
1858
1884
  }, "aria-label": "checkmark indicating success" },
1859
- React__default.createElement("style", null, style$6),
1885
+ React__default.createElement("style", null, style$5),
1860
1886
  React__default.createElement("div", { className: `PopSuccessMark-check-stroke-1 bg-${checkVariant}`, style: {
1861
1887
  borderRadius: `${sizeRem / 5}rem`,
1862
1888
  } }),
@@ -1872,7 +1898,7 @@ const PopSuccessMark = (props) => {
1872
1898
  /*------------------------------------------------------------------------*/
1873
1899
  /* -------------------------------- Style ------------------------------- */
1874
1900
  /*------------------------------------------------------------------------*/
1875
- const style$5 = `
1901
+ const style$4 = `
1876
1902
  .PopFailureMark-outer-container {
1877
1903
  position: relative;
1878
1904
  display: inline-block;
@@ -1976,7 +2002,7 @@ const PopFailureMark = (props) => {
1976
2002
  width: `${sizeRem}rem`,
1977
2003
  height: `${sizeRem}rem`,
1978
2004
  }, "aria-label": "mark indicating failure" },
1979
- React__default.createElement("style", null, style$5),
2005
+ React__default.createElement("style", null, style$4),
1980
2006
  React__default.createElement("div", { className: `PopFailureMark-x-stroke-1 bg-${xVariant}`, style: {
1981
2007
  borderRadius: `${sizeRem / 5}rem`,
1982
2008
  } }),
@@ -1992,7 +2018,7 @@ const PopFailureMark = (props) => {
1992
2018
  /*------------------------------------------------------------------------*/
1993
2019
  /* -------------------------------- Style ------------------------------- */
1994
2020
  /*------------------------------------------------------------------------*/
1995
- const style$4 = `
2021
+ const style$3 = `
1996
2022
  .PopPendingMark-outer-container {
1997
2023
  position: relative;
1998
2024
  display: inline-block;
@@ -2065,7 +2091,7 @@ const PopPendingMark = (props) => {
2065
2091
  width: `${sizeRem}rem`,
2066
2092
  height: `${sizeRem}rem`,
2067
2093
  }, "aria-label": "mark indicating that the item is pending" },
2068
- React__default.createElement("style", null, style$4),
2094
+ React__default.createElement("style", null, style$3),
2069
2095
  React__default.createElement("div", null,
2070
2096
  React__default.createElement(FontAwesomeIcon, { icon: faHourglass, className: `PopPendingMark-hourglass text-${hourglassVariant}`, style: {
2071
2097
  fontSize: `${sizeRem * 0.6}rem`,
@@ -2078,27 +2104,27 @@ const PopPendingMark = (props) => {
2078
2104
  */
2079
2105
  /* ------------- Actions ------------ */
2080
2106
  // Types of actions
2081
- var ActionType$9;
2107
+ var ActionType$8;
2082
2108
  (function (ActionType) {
2083
2109
  // Indicate that the text was recently copied
2084
2110
  ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
2085
2111
  // Clear the status
2086
2112
  ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
2087
- })(ActionType$9 || (ActionType$9 = {}));
2113
+ })(ActionType$8 || (ActionType$8 = {}));
2088
2114
  /**
2089
2115
  * Reducer that executes actions
2090
2116
  * @author Gabe Abrams
2091
2117
  * @param state current state
2092
2118
  * @param action action to execute
2093
2119
  */
2094
- const reducer$a = (state, action) => {
2120
+ const reducer$9 = (state, action) => {
2095
2121
  switch (action.type) {
2096
- case ActionType$9.IndicateRecentlyCopied: {
2122
+ case ActionType$8.IndicateRecentlyCopied: {
2097
2123
  return {
2098
2124
  recentlyCopied: true,
2099
2125
  };
2100
2126
  }
2101
- case ActionType$9.ClearRecentlyCopiedStatus: {
2127
+ case ActionType$8.ClearRecentlyCopiedStatus: {
2102
2128
  return {
2103
2129
  recentlyCopied: false,
2104
2130
  };
@@ -2124,7 +2150,7 @@ const CopiableBox = (props) => {
2124
2150
  recentlyCopied: false,
2125
2151
  };
2126
2152
  // Initialize state
2127
- const [state, dispatch] = useReducer(reducer$a, initialState);
2153
+ const [state, dispatch] = useReducer(reducer$9, initialState);
2128
2154
  // Destructure common state
2129
2155
  const { recentlyCopied, } = state;
2130
2156
  /*------------------------------------------------------------------------*/
@@ -2144,13 +2170,13 @@ const CopiableBox = (props) => {
2144
2170
  }
2145
2171
  // Show copied notice
2146
2172
  dispatch({
2147
- type: ActionType$9.IndicateRecentlyCopied,
2173
+ type: ActionType$8.IndicateRecentlyCopied,
2148
2174
  });
2149
2175
  // Wait a moment
2150
2176
  yield waitMs(4000);
2151
2177
  // Hide copied notice
2152
2178
  dispatch({
2153
- type: ActionType$9.ClearRecentlyCopiedStatus,
2179
+ type: ActionType$8.ClearRecentlyCopiedStatus,
2154
2180
  });
2155
2181
  });
2156
2182
  /*------------------------------------------------------------------------*/
@@ -2206,20 +2232,20 @@ const CopiableBox = (props) => {
2206
2232
  */
2207
2233
  /* ------------- Actions ------------ */
2208
2234
  // Types of actions
2209
- var ActionType$8;
2235
+ var ActionType$7;
2210
2236
  (function (ActionType) {
2211
2237
  // Toggle whether a child are being shown
2212
2238
  ActionType["ToggleChild"] = "toggle-child";
2213
- })(ActionType$8 || (ActionType$8 = {}));
2239
+ })(ActionType$7 || (ActionType$7 = {}));
2214
2240
  /**
2215
2241
  * Reducer that executes actions
2216
2242
  * @author Gabe Abrams
2217
2243
  * @param state current state
2218
2244
  * @param action action to execute
2219
2245
  */
2220
- const reducer$9 = (state, action) => {
2246
+ const reducer$8 = (state, action) => {
2221
2247
  switch (action.type) {
2222
- case ActionType$8.ToggleChild: {
2248
+ case ActionType$7.ToggleChild: {
2223
2249
  return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
2224
2250
  }
2225
2251
  default: {
@@ -2248,7 +2274,7 @@ const NestableItemList = (props) => {
2248
2274
  childExpanded: initChildExpanded,
2249
2275
  };
2250
2276
  // Initialize state
2251
- const [state, dispatch] = useReducer(reducer$9, initialState);
2277
+ const [state, dispatch] = useReducer(reducer$8, initialState);
2252
2278
  // Destructure common state
2253
2279
  const { childExpanded, } = state;
2254
2280
  /*------------------------------------------------------------------------*/
@@ -2338,7 +2364,7 @@ const NestableItemList = (props) => {
2338
2364
  backgroundColor: 'transparent',
2339
2365
  }, type: "button", onClick: () => {
2340
2366
  dispatch({
2341
- type: ActionType$8.ToggleChild,
2367
+ type: ActionType$7.ToggleChild,
2342
2368
  id: item.id,
2343
2369
  });
2344
2370
  }, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
@@ -2622,7 +2648,7 @@ var SortType;
2622
2648
  })(SortType || (SortType = {}));
2623
2649
  /* ------------- Actions ------------ */
2624
2650
  // Types of actions
2625
- var ActionType$7;
2651
+ var ActionType$6;
2626
2652
  (function (ActionType) {
2627
2653
  // Toggle sort column param
2628
2654
  ActionType["ToggleSortColumn"] = "toggle-sort-column";
@@ -2634,16 +2660,16 @@ var ActionType$7;
2634
2660
  ActionType["ShowAllColumns"] = "show-all-columns";
2635
2661
  // Hide all columns
2636
2662
  ActionType["HideAllColumns"] = "hide-all-columns";
2637
- })(ActionType$7 || (ActionType$7 = {}));
2663
+ })(ActionType$6 || (ActionType$6 = {}));
2638
2664
  /**
2639
2665
  * Reducer that executes actions
2640
2666
  * @author Gabe Abrams
2641
2667
  * @param state current state
2642
2668
  * @param action action to execute
2643
2669
  */
2644
- const reducer$8 = (state, action) => {
2670
+ const reducer$7 = (state, action) => {
2645
2671
  switch (action.type) {
2646
- case ActionType$7.ToggleSortColumn: {
2672
+ case ActionType$6.ToggleSortColumn: {
2647
2673
  if (action.param !== state.sortColumnParam) {
2648
2674
  // Different column param
2649
2675
  return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
@@ -2655,22 +2681,22 @@ const reducer$8 = (state, action) => {
2655
2681
  // Stop sorting by column
2656
2682
  return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
2657
2683
  }
2658
- case ActionType$7.UpdateColumnVisibility: {
2684
+ case ActionType$6.UpdateColumnVisibility: {
2659
2685
  const { columnVisibilityMap } = state;
2660
2686
  columnVisibilityMap[action.param] = action.visible;
2661
2687
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2662
2688
  }
2663
- case ActionType$7.ToggleColVisCusModalVisibility: {
2689
+ case ActionType$6.ToggleColVisCusModalVisibility: {
2664
2690
  return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
2665
2691
  }
2666
- case ActionType$7.ShowAllColumns: {
2692
+ case ActionType$6.ShowAllColumns: {
2667
2693
  const { columnVisibilityMap } = state;
2668
2694
  Object.keys(columnVisibilityMap).forEach((param) => {
2669
2695
  columnVisibilityMap[param] = true;
2670
2696
  });
2671
2697
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2672
2698
  }
2673
- case ActionType$7.HideAllColumns: {
2699
+ case ActionType$6.HideAllColumns: {
2674
2700
  const { columnVisibilityMap } = state;
2675
2701
  Object.keys(columnVisibilityMap).forEach((param) => {
2676
2702
  columnVisibilityMap[param] = false;
@@ -2717,7 +2743,7 @@ const IntelliTable = (props) => {
2717
2743
  columnVisibilityCustomizationModalVisible: false,
2718
2744
  };
2719
2745
  // Initialize state
2720
- const [state, dispatch] = useReducer(reducer$8, initialState);
2746
+ const [state, dispatch] = useReducer(reducer$7, initialState);
2721
2747
  // Destructure common state
2722
2748
  const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
2723
2749
  /*------------------------------------------------------------------------*/
@@ -2740,13 +2766,13 @@ const IntelliTable = (props) => {
2740
2766
  return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
2741
2767
  }
2742
2768
  dispatch({
2743
- type: ActionType$7.ToggleColVisCusModalVisibility,
2769
+ type: ActionType$6.ToggleColVisCusModalVisibility,
2744
2770
  });
2745
2771
  }, okayVariant: Variant$1.Light },
2746
2772
  columns.map((column) => {
2747
2773
  return (React__default.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
2748
2774
  dispatch({
2749
- type: ActionType$7.UpdateColumnVisibility,
2775
+ type: ActionType$6.UpdateColumnVisibility,
2750
2776
  param: column.param,
2751
2777
  visible: checked,
2752
2778
  });
@@ -2755,12 +2781,12 @@ const IntelliTable = (props) => {
2755
2781
  React__default.createElement("div", { className: "mt-3" }, "Or you can:"),
2756
2782
  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: () => {
2757
2783
  dispatch({
2758
- type: ActionType$7.ShowAllColumns,
2784
+ type: ActionType$6.ShowAllColumns,
2759
2785
  });
2760
2786
  } }, "Select All"),
2761
2787
  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: () => {
2762
2788
  dispatch({
2763
- type: ActionType$7.HideAllColumns,
2789
+ type: ActionType$6.HideAllColumns,
2764
2790
  });
2765
2791
  } }, "Deselect All")));
2766
2792
  }
@@ -2811,7 +2837,7 @@ const IntelliTable = (props) => {
2811
2837
  React__default.createElement("div", null,
2812
2838
  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: () => {
2813
2839
  dispatch({
2814
- type: ActionType$7.ToggleSortColumn,
2840
+ type: ActionType$6.ToggleSortColumn,
2815
2841
  param: column.param,
2816
2842
  });
2817
2843
  } },
@@ -3000,7 +3026,7 @@ const IntelliTable = (props) => {
3000
3026
  React__default.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
3001
3027
  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: () => {
3002
3028
  dispatch({
3003
- type: ActionType$7.ToggleColVisCusModalVisibility,
3029
+ type: ActionType$6.ToggleColVisCusModalVisibility,
3004
3030
  });
3005
3031
  } },
3006
3032
  "Show/Hide Cols",
@@ -3032,7 +3058,7 @@ var FilterDrawer;
3032
3058
  /*------------------------------------------------------------------------*/
3033
3059
  /* -------------------------------- Style ------------------------------- */
3034
3060
  /*------------------------------------------------------------------------*/
3035
- const style$3 = `
3061
+ const style$2 = `
3036
3062
  .LogReviewer-outer-container {
3037
3063
  /* Full Screen */
3038
3064
  display: inline-block;
@@ -3366,7 +3392,7 @@ const genHumanReadableName = (machineReadableName) => {
3366
3392
  };
3367
3393
  /* ------------- Actions ------------ */
3368
3394
  // Types of actions
3369
- var ActionType$6;
3395
+ var ActionType$5;
3370
3396
  (function (ActionType) {
3371
3397
  // Show the loading bar
3372
3398
  ActionType["StartLoading"] = "start-loading";
@@ -3388,45 +3414,45 @@ var ActionType$6;
3388
3414
  ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
3389
3415
  // Update the advanced filter state
3390
3416
  ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
3391
- })(ActionType$6 || (ActionType$6 = {}));
3417
+ })(ActionType$5 || (ActionType$5 = {}));
3392
3418
  /**
3393
3419
  * Reducer that executes actions
3394
3420
  * @author Gabe Abrams
3395
3421
  * @param state current state
3396
3422
  * @param action action to execute
3397
3423
  */
3398
- const reducer$7 = (state, action) => {
3424
+ const reducer$6 = (state, action) => {
3399
3425
  switch (action.type) {
3400
- case ActionType$6.StartLoading: {
3426
+ case ActionType$5.StartLoading: {
3401
3427
  return Object.assign(Object.assign({}, state), { loading: true });
3402
3428
  }
3403
- case ActionType$6.FinishLoading: {
3429
+ case ActionType$5.FinishLoading: {
3404
3430
  return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
3405
3431
  }
3406
- case ActionType$6.ToggleFilterDrawer: {
3432
+ case ActionType$5.ToggleFilterDrawer: {
3407
3433
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
3408
3434
  ? undefined // hide
3409
3435
  : action.filterDrawer) });
3410
3436
  }
3411
- case ActionType$6.HideFilterDrawer: {
3437
+ case ActionType$5.HideFilterDrawer: {
3412
3438
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
3413
3439
  }
3414
- case ActionType$6.ResetFilters: {
3440
+ case ActionType$5.ResetFilters: {
3415
3441
  return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
3416
3442
  }
3417
- case ActionType$6.UpdateDateFilterState: {
3443
+ case ActionType$5.UpdateDateFilterState: {
3418
3444
  return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
3419
3445
  }
3420
- case ActionType$6.UpdateContextFilterState: {
3446
+ case ActionType$5.UpdateContextFilterState: {
3421
3447
  return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
3422
3448
  }
3423
- case ActionType$6.UpdateTagFilterState: {
3449
+ case ActionType$5.UpdateTagFilterState: {
3424
3450
  return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
3425
3451
  }
3426
- case ActionType$6.UpdateActionErrorFilterState: {
3452
+ case ActionType$5.UpdateActionErrorFilterState: {
3427
3453
  return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
3428
3454
  }
3429
- case ActionType$6.UpdateAdvancedFilterState: {
3455
+ case ActionType$5.UpdateAdvancedFilterState: {
3430
3456
  return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
3431
3457
  }
3432
3458
  default: {
@@ -3555,7 +3581,7 @@ const LogReviewer = (props) => {
3555
3581
  advancedFilterState: initAdvancedFilterState,
3556
3582
  };
3557
3583
  // Initialize state
3558
- const [state, dispatch] = useReducer(reducer$7, initialState);
3584
+ const [state, dispatch] = useReducer(reducer$6, initialState);
3559
3585
  // Destructure common state
3560
3586
  const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
3561
3587
  /*------------------------------------------------------------------------*/
@@ -3605,7 +3631,7 @@ const LogReviewer = (props) => {
3605
3631
  const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
3606
3632
  // Update state
3607
3633
  dispatch({
3608
- type: ActionType$6.UpdateDateFilterState,
3634
+ type: ActionType$5.UpdateDateFilterState,
3609
3635
  dateFilterState: newDateFilterState,
3610
3636
  });
3611
3637
  // Check which year/month combos we need to load
@@ -3616,7 +3642,7 @@ const LogReviewer = (props) => {
3616
3642
  }
3617
3643
  // Start loading
3618
3644
  dispatch({
3619
- type: ActionType$6.StartLoading,
3645
+ type: ActionType$5.StartLoading,
3620
3646
  });
3621
3647
  // Load required months
3622
3648
  try {
@@ -3640,7 +3666,7 @@ const LogReviewer = (props) => {
3640
3666
  }
3641
3667
  // Finish loading
3642
3668
  dispatch({
3643
- type: ActionType$6.FinishLoading,
3669
+ type: ActionType$5.FinishLoading,
3644
3670
  logMap,
3645
3671
  });
3646
3672
  });
@@ -3679,7 +3705,7 @@ const LogReviewer = (props) => {
3679
3705
  React__default.createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
3680
3706
  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: () => {
3681
3707
  dispatch({
3682
- type: ActionType$6.ToggleFilterDrawer,
3708
+ type: ActionType$5.ToggleFilterDrawer,
3683
3709
  filterDrawer: FilterDrawer.Date,
3684
3710
  });
3685
3711
  } },
@@ -3687,7 +3713,7 @@ const LogReviewer = (props) => {
3687
3713
  "Date"),
3688
3714
  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: () => {
3689
3715
  dispatch({
3690
- type: ActionType$6.ToggleFilterDrawer,
3716
+ type: ActionType$5.ToggleFilterDrawer,
3691
3717
  filterDrawer: FilterDrawer.Context,
3692
3718
  });
3693
3719
  } },
@@ -3695,7 +3721,7 @@ const LogReviewer = (props) => {
3695
3721
  "Context"),
3696
3722
  (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: () => {
3697
3723
  dispatch({
3698
- type: ActionType$6.ToggleFilterDrawer,
3724
+ type: ActionType$5.ToggleFilterDrawer,
3699
3725
  filterDrawer: FilterDrawer.Tag,
3700
3726
  });
3701
3727
  } },
@@ -3703,7 +3729,7 @@ const LogReviewer = (props) => {
3703
3729
  "Tag")),
3704
3730
  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: () => {
3705
3731
  dispatch({
3706
- type: ActionType$6.ToggleFilterDrawer,
3732
+ type: ActionType$5.ToggleFilterDrawer,
3707
3733
  filterDrawer: FilterDrawer.Action,
3708
3734
  });
3709
3735
  } },
@@ -3711,7 +3737,7 @@ const LogReviewer = (props) => {
3711
3737
  "Action"),
3712
3738
  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: () => {
3713
3739
  dispatch({
3714
- type: ActionType$6.ToggleFilterDrawer,
3740
+ type: ActionType$5.ToggleFilterDrawer,
3715
3741
  filterDrawer: FilterDrawer.Advanced,
3716
3742
  });
3717
3743
  } },
@@ -3719,7 +3745,7 @@ const LogReviewer = (props) => {
3719
3745
  "Advanced"),
3720
3746
  React__default.createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
3721
3747
  dispatch({
3722
- type: ActionType$6.ResetFilters,
3748
+ type: ActionType$5.ResetFilters,
3723
3749
  initActionErrorFilterState,
3724
3750
  initAdvancedFilterState,
3725
3751
  initContextFilterState,
@@ -3841,7 +3867,7 @@ const LogReviewer = (props) => {
3841
3867
  }
3842
3868
  });
3843
3869
  dispatch({
3844
- type: ActionType$6.UpdateContextFilterState,
3870
+ type: ActionType$5.UpdateContextFilterState,
3845
3871
  contextFilterState,
3846
3872
  });
3847
3873
  } }));
@@ -3856,7 +3882,7 @@ const LogReviewer = (props) => {
3856
3882
  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) => {
3857
3883
  tagFilterState[tag] = checked;
3858
3884
  dispatch({
3859
- type: ActionType$6.UpdateTagFilterState,
3885
+ type: ActionType$5.UpdateTagFilterState,
3860
3886
  tagFilterState,
3861
3887
  });
3862
3888
  } }));
@@ -3869,21 +3895,21 @@ const LogReviewer = (props) => {
3869
3895
  React__default.createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
3870
3896
  actionErrorFilterState.type = undefined;
3871
3897
  dispatch({
3872
- type: ActionType$6.UpdateActionErrorFilterState,
3898
+ type: ActionType$5.UpdateActionErrorFilterState,
3873
3899
  actionErrorFilterState,
3874
3900
  });
3875
3901
  }, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
3876
3902
  React__default.createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
3877
3903
  actionErrorFilterState.type = LogType$1.Action;
3878
3904
  dispatch({
3879
- type: ActionType$6.UpdateActionErrorFilterState,
3905
+ type: ActionType$5.UpdateActionErrorFilterState,
3880
3906
  actionErrorFilterState,
3881
3907
  });
3882
3908
  }, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
3883
3909
  React__default.createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
3884
3910
  actionErrorFilterState.type = LogType$1.Error;
3885
3911
  dispatch({
3886
- type: ActionType$6.UpdateActionErrorFilterState,
3912
+ type: ActionType$5.UpdateActionErrorFilterState,
3887
3913
  actionErrorFilterState,
3888
3914
  });
3889
3915
  }, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
@@ -3895,7 +3921,7 @@ const LogReviewer = (props) => {
3895
3921
  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) => {
3896
3922
  actionErrorFilterState.action[action] = checked;
3897
3923
  dispatch({
3898
- type: ActionType$6.UpdateActionErrorFilterState,
3924
+ type: ActionType$5.UpdateActionErrorFilterState,
3899
3925
  actionErrorFilterState,
3900
3926
  });
3901
3927
  } }));
@@ -3906,7 +3932,7 @@ const LogReviewer = (props) => {
3906
3932
  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) => {
3907
3933
  actionErrorFilterState.target[target] = checked;
3908
3934
  dispatch({
3909
- type: ActionType$6.UpdateActionErrorFilterState,
3935
+ type: ActionType$5.UpdateActionErrorFilterState,
3910
3936
  actionErrorFilterState,
3911
3937
  });
3912
3938
  } }));
@@ -3918,7 +3944,7 @@ const LogReviewer = (props) => {
3918
3944
  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) => {
3919
3945
  actionErrorFilterState.errorMessage = e.target.value;
3920
3946
  dispatch({
3921
- type: ActionType$6.UpdateActionErrorFilterState,
3947
+ type: ActionType$5.UpdateActionErrorFilterState,
3922
3948
  actionErrorFilterState,
3923
3949
  });
3924
3950
  } })),
@@ -3929,7 +3955,7 @@ const LogReviewer = (props) => {
3929
3955
  .trim()
3930
3956
  .toUpperCase());
3931
3957
  dispatch({
3932
- type: ActionType$6.UpdateActionErrorFilterState,
3958
+ type: ActionType$5.UpdateActionErrorFilterState,
3933
3959
  actionErrorFilterState,
3934
3960
  });
3935
3961
  } }))))));
@@ -3943,7 +3969,7 @@ const LogReviewer = (props) => {
3943
3969
  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) => {
3944
3970
  advancedFilterState.userFirstName = e.target.value;
3945
3971
  dispatch({
3946
- type: ActionType$6.UpdateAdvancedFilterState,
3972
+ type: ActionType$5.UpdateAdvancedFilterState,
3947
3973
  advancedFilterState,
3948
3974
  });
3949
3975
  } })),
@@ -3952,7 +3978,7 @@ const LogReviewer = (props) => {
3952
3978
  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) => {
3953
3979
  advancedFilterState.userLastName = e.target.value;
3954
3980
  dispatch({
3955
- type: ActionType$6.UpdateAdvancedFilterState,
3981
+ type: ActionType$5.UpdateAdvancedFilterState,
3956
3982
  advancedFilterState,
3957
3983
  });
3958
3984
  } })),
@@ -3962,7 +3988,7 @@ const LogReviewer = (props) => {
3962
3988
  advancedFilterState.userEmail = ((e.target.value)
3963
3989
  .trim());
3964
3990
  dispatch({
3965
- type: ActionType$6.UpdateAdvancedFilterState,
3991
+ type: ActionType$5.UpdateAdvancedFilterState,
3966
3992
  advancedFilterState,
3967
3993
  });
3968
3994
  } })),
@@ -3976,7 +4002,7 @@ const LogReviewer = (props) => {
3976
4002
  .trim());
3977
4003
  }
3978
4004
  dispatch({
3979
- type: ActionType$6.UpdateAdvancedFilterState,
4005
+ type: ActionType$5.UpdateAdvancedFilterState,
3980
4006
  advancedFilterState,
3981
4007
  });
3982
4008
  } })),
@@ -3984,21 +4010,21 @@ const LogReviewer = (props) => {
3984
4010
  React__default.createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
3985
4011
  advancedFilterState.includeLearners = checked;
3986
4012
  dispatch({
3987
- type: ActionType$6.UpdateAdvancedFilterState,
4013
+ type: ActionType$5.UpdateAdvancedFilterState,
3988
4014
  advancedFilterState,
3989
4015
  });
3990
4016
  }, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
3991
4017
  React__default.createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
3992
4018
  advancedFilterState.includeTTMs = checked;
3993
4019
  dispatch({
3994
- type: ActionType$6.UpdateAdvancedFilterState,
4020
+ type: ActionType$5.UpdateAdvancedFilterState,
3995
4021
  advancedFilterState,
3996
4022
  });
3997
4023
  }, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
3998
4024
  React__default.createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
3999
4025
  advancedFilterState.includeAdmins = checked;
4000
4026
  dispatch({
4001
- type: ActionType$6.UpdateAdvancedFilterState,
4027
+ type: ActionType$5.UpdateAdvancedFilterState,
4002
4028
  advancedFilterState,
4003
4029
  });
4004
4030
  }, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
@@ -4008,7 +4034,7 @@ const LogReviewer = (props) => {
4008
4034
  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) => {
4009
4035
  advancedFilterState.courseName = e.target.value;
4010
4036
  dispatch({
4011
- type: ActionType$6.UpdateAdvancedFilterState,
4037
+ type: ActionType$5.UpdateAdvancedFilterState,
4012
4038
  advancedFilterState,
4013
4039
  });
4014
4040
  } })),
@@ -4022,7 +4048,7 @@ const LogReviewer = (props) => {
4022
4048
  .trim());
4023
4049
  }
4024
4050
  dispatch({
4025
- type: ActionType$6.UpdateAdvancedFilterState,
4051
+ type: ActionType$5.UpdateAdvancedFilterState,
4026
4052
  advancedFilterState,
4027
4053
  });
4028
4054
  } }))),
@@ -4031,21 +4057,21 @@ const LogReviewer = (props) => {
4031
4057
  React__default.createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
4032
4058
  advancedFilterState.isMobile = undefined;
4033
4059
  dispatch({
4034
- type: ActionType$6.UpdateAdvancedFilterState,
4060
+ type: ActionType$5.UpdateAdvancedFilterState,
4035
4061
  advancedFilterState,
4036
4062
  });
4037
4063
  } }),
4038
4064
  React__default.createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
4039
4065
  advancedFilterState.isMobile = true;
4040
4066
  dispatch({
4041
- type: ActionType$6.UpdateAdvancedFilterState,
4067
+ type: ActionType$5.UpdateAdvancedFilterState,
4042
4068
  advancedFilterState,
4043
4069
  });
4044
4070
  } }),
4045
4071
  React__default.createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
4046
4072
  advancedFilterState.isMobile = false;
4047
4073
  dispatch({
4048
- type: ActionType$6.UpdateAdvancedFilterState,
4074
+ type: ActionType$5.UpdateAdvancedFilterState,
4049
4075
  advancedFilterState,
4050
4076
  });
4051
4077
  }, noMarginOnRight: true }))),
@@ -4054,21 +4080,21 @@ const LogReviewer = (props) => {
4054
4080
  React__default.createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
4055
4081
  advancedFilterState.source = undefined;
4056
4082
  dispatch({
4057
- type: ActionType$6.UpdateAdvancedFilterState,
4083
+ type: ActionType$5.UpdateAdvancedFilterState,
4058
4084
  advancedFilterState,
4059
4085
  });
4060
4086
  } }),
4061
4087
  React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
4062
4088
  advancedFilterState.source = LogSource$1.Client;
4063
4089
  dispatch({
4064
- type: ActionType$6.UpdateAdvancedFilterState,
4090
+ type: ActionType$5.UpdateAdvancedFilterState,
4065
4091
  advancedFilterState,
4066
4092
  });
4067
4093
  } }),
4068
4094
  React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
4069
4095
  advancedFilterState.source = LogSource$1.Server;
4070
4096
  dispatch({
4071
- type: ActionType$6.UpdateAdvancedFilterState,
4097
+ type: ActionType$5.UpdateAdvancedFilterState,
4072
4098
  advancedFilterState,
4073
4099
  });
4074
4100
  }, noMarginOnRight: true })),
@@ -4079,7 +4105,7 @@ const LogReviewer = (props) => {
4079
4105
  advancedFilterState.courseName = ((e.target.value)
4080
4106
  .trim());
4081
4107
  dispatch({
4082
- type: ActionType$6.UpdateAdvancedFilterState,
4108
+ type: ActionType$5.UpdateAdvancedFilterState,
4083
4109
  advancedFilterState,
4084
4110
  });
4085
4111
  } })),
@@ -4089,7 +4115,7 @@ const LogReviewer = (props) => {
4089
4115
  advancedFilterState.courseName = ((e.target.value)
4090
4116
  .trim());
4091
4117
  dispatch({
4092
- type: ActionType$6.UpdateAdvancedFilterState,
4118
+ type: ActionType$5.UpdateAdvancedFilterState,
4093
4119
  advancedFilterState,
4094
4120
  });
4095
4121
  } })))))));
@@ -4368,7 +4394,7 @@ const LogReviewer = (props) => {
4368
4394
  }
4369
4395
  /* ---------- Wrap in Modal --------- */
4370
4396
  return (React__default.createElement("div", { className: "LogReviewer-outer-container" },
4371
- React__default.createElement("style", null, style$3),
4397
+ React__default.createElement("style", null, style$2),
4372
4398
  React__default.createElement("div", { className: "LogReviewer-inner-container" },
4373
4399
  React__default.createElement("div", { className: "LogReviewer-header" },
4374
4400
  React__default.createElement("div", { className: "LogReviewer-header-title" },
@@ -39694,11 +39720,11 @@ var CreatableSelect$1 = CreatableSelect;
39694
39720
  */
39695
39721
  /* ------------- Actions ------------ */
39696
39722
  // Types of actions
39697
- var ActionType$5;
39723
+ var ActionType$4;
39698
39724
  (function (ActionType) {
39699
39725
  // Update the input value
39700
39726
  ActionType["SetInputValue"] = "SetInputValue";
39701
- })(ActionType$5 || (ActionType$5 = {}));
39727
+ })(ActionType$4 || (ActionType$4 = {}));
39702
39728
  /**
39703
39729
  * Reducer that executes actions
39704
39730
  * @author Yuen Ler Chow
@@ -39706,9 +39732,9 @@ var ActionType$5;
39706
39732
  * @param action action to execute
39707
39733
  * @returns updated state
39708
39734
  */
39709
- const reducer$6 = (state, action) => {
39735
+ const reducer$5 = (state, action) => {
39710
39736
  switch (action.type) {
39711
- case ActionType$5.SetInputValue: {
39737
+ case ActionType$4.SetInputValue: {
39712
39738
  return Object.assign(Object.assign({}, state), { inputValue: action.value });
39713
39739
  }
39714
39740
  default: {
@@ -39728,7 +39754,7 @@ const CreatableMultiselect = (props) => {
39728
39754
  inputValue: '',
39729
39755
  };
39730
39756
  // Initialize state
39731
- const [state, dispatch] = useReducer(reducer$6, initialState);
39757
+ const [state, dispatch] = useReducer(reducer$5, initialState);
39732
39758
  // Destructure common state
39733
39759
  const { inputValue } = state;
39734
39760
  /*------------------------------------------------------------------------*/
@@ -39805,7 +39831,7 @@ const CreatableMultiselect = (props) => {
39805
39831
  }
39806
39832
  // Reset text field to empty because the values have been added
39807
39833
  dispatch({
39808
- type: ActionType$5.SetInputValue,
39834
+ type: ActionType$4.SetInputValue,
39809
39835
  value: '',
39810
39836
  });
39811
39837
  };
@@ -39844,7 +39870,7 @@ const CreatableMultiselect = (props) => {
39844
39870
  else {
39845
39871
  // simply update the input value to the new input value
39846
39872
  dispatch({
39847
- type: ActionType$5.SetInputValue,
39873
+ type: ActionType$4.SetInputValue,
39848
39874
  value: newValue,
39849
39875
  });
39850
39876
  }
@@ -39889,20 +39915,20 @@ const CreatableMultiselect = (props) => {
39889
39915
  /*------------------------------------------------------------------------*/
39890
39916
  /* -------------------------------- Style ------------------------------- */
39891
39917
  /*------------------------------------------------------------------------*/
39892
- const style$2 = `
39918
+ const style$1 = `
39893
39919
  .AddOrEditDBEntry-input-label {
39894
39920
  min-width: 7rem;
39895
39921
  }
39896
39922
  `;
39897
39923
  /* ------------- Actions ------------ */
39898
39924
  // Types of actions
39899
- var ActionType$4;
39925
+ var ActionType$3;
39900
39926
  (function (ActionType) {
39901
39927
  // Update the DBEntry
39902
39928
  ActionType["UpdateDBEntry"] = "UpdateDBEntry";
39903
39929
  // Start the save spinner
39904
39930
  ActionType["StartSave"] = "StartSave";
39905
- })(ActionType$4 || (ActionType$4 = {}));
39931
+ })(ActionType$3 || (ActionType$3 = {}));
39906
39932
  /**
39907
39933
  * Reducer that executes actions
39908
39934
  * @author Yuen Ler Chow
@@ -39910,12 +39936,12 @@ var ActionType$4;
39910
39936
  * @param action action to execute
39911
39937
  * @returns updated state
39912
39938
  */
39913
- const reducer$5 = (state, action) => {
39939
+ const reducer$4 = (state, action) => {
39914
39940
  switch (action.type) {
39915
- case ActionType$4.UpdateDBEntry: {
39941
+ case ActionType$3.UpdateDBEntry: {
39916
39942
  return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
39917
39943
  }
39918
- case ActionType$4.StartSave: {
39944
+ case ActionType$3.StartSave: {
39919
39945
  return Object.assign(Object.assign({}, state), { saving: true });
39920
39946
  }
39921
39947
  default: {
@@ -39940,7 +39966,7 @@ const AddOrEditDBEntry = (props) => {
39940
39966
  saving: false,
39941
39967
  };
39942
39968
  // Initialize state
39943
- const [state, dispatch] = useReducer(reducer$5, initialState);
39969
+ const [state, dispatch] = useReducer(reducer$4, initialState);
39944
39970
  // Destructure common state
39945
39971
  const { entry, saving, } = state;
39946
39972
  /*------------------------------------------------------------------------*/
@@ -39952,7 +39978,7 @@ const AddOrEditDBEntry = (props) => {
39952
39978
  */
39953
39979
  const save = () => __awaiter(void 0, void 0, void 0, function* () {
39954
39980
  // Start the save loading indicator
39955
- dispatch({ type: ActionType$4.StartSave });
39981
+ dispatch({ type: ActionType$3.StartSave });
39956
39982
  // add all default values to the entry
39957
39983
  entryFields.forEach((field) => {
39958
39984
  if (field.defaultValue && !entry[field.objectKey]) {
@@ -40135,7 +40161,7 @@ const AddOrEditDBEntry = (props) => {
40135
40161
  return (React__default.createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
40136
40162
  entry[field.objectKey] = choice.value;
40137
40163
  dispatch({
40138
- type: ActionType$4.UpdateDBEntry,
40164
+ type: ActionType$3.UpdateDBEntry,
40139
40165
  dbEntry: entry,
40140
40166
  });
40141
40167
  }, ariaLabel: choice.title }));
@@ -40147,7 +40173,7 @@ const AddOrEditDBEntry = (props) => {
40147
40173
  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) => {
40148
40174
  entry[field.objectKey] = (e.target.value);
40149
40175
  dispatch({
40150
- type: ActionType$4.UpdateDBEntry,
40176
+ type: ActionType$3.UpdateDBEntry,
40151
40177
  dbEntry: entry,
40152
40178
  });
40153
40179
  } }))));
@@ -40160,7 +40186,7 @@ const AddOrEditDBEntry = (props) => {
40160
40186
  entry[field.objectKey] = (e.target.value
40161
40187
  .replace(/[^0-9]/g, ''));
40162
40188
  dispatch({
40163
- type: ActionType$4.UpdateDBEntry,
40189
+ type: ActionType$3.UpdateDBEntry,
40164
40190
  dbEntry: entry,
40165
40191
  });
40166
40192
  } }))));
@@ -40190,7 +40216,7 @@ const AddOrEditDBEntry = (props) => {
40190
40216
  }
40191
40217
  // Save
40192
40218
  dispatch({
40193
- type: ActionType$4.UpdateDBEntry,
40219
+ type: ActionType$3.UpdateDBEntry,
40194
40220
  dbEntry: entry,
40195
40221
  });
40196
40222
  }, ariaLabel: choice.title }));
@@ -40205,7 +40231,7 @@ const AddOrEditDBEntry = (props) => {
40205
40231
  // Update entry and save
40206
40232
  entry[field.objectKey] = values;
40207
40233
  dispatch({
40208
- type: ActionType$4.UpdateDBEntry,
40234
+ type: ActionType$3.UpdateDBEntry,
40209
40235
  dbEntry: entry,
40210
40236
  });
40211
40237
  } })))));
@@ -40218,7 +40244,7 @@ const AddOrEditDBEntry = (props) => {
40218
40244
  React__default.createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
40219
40245
  entry[field.objectKey] = values;
40220
40246
  dispatch({
40221
- type: ActionType$4.UpdateDBEntry,
40247
+ type: ActionType$3.UpdateDBEntry,
40222
40248
  dbEntry: entry,
40223
40249
  });
40224
40250
  } })))));
@@ -40267,7 +40293,7 @@ const AddOrEditDBEntry = (props) => {
40267
40293
  /* --------------- Main UI -------------- */
40268
40294
  /*----------------------------------------*/
40269
40295
  return (React__default.createElement("div", { className: "alert alert-light text-black" },
40270
- React__default.createElement("style", null, style$2),
40296
+ React__default.createElement("style", null, style$1),
40271
40297
  body));
40272
40298
  };
40273
40299
 
@@ -40292,7 +40318,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
40292
40318
  */
40293
40319
  /* ------------- Actions ------------ */
40294
40320
  // Types of actions
40295
- var ActionType$3;
40321
+ var ActionType$2;
40296
40322
  (function (ActionType) {
40297
40323
  // Show adder
40298
40324
  ActionType["ShowAdder"] = "ShowAdder";
@@ -40306,7 +40332,7 @@ var ActionType$3;
40306
40332
  ActionType["StartDelete"] = "StartDelete";
40307
40333
  // Finish deletion process
40308
40334
  ActionType["FinishDelete"] = "FinishDelete";
40309
- })(ActionType$3 || (ActionType$3 = {}));
40335
+ })(ActionType$2 || (ActionType$2 = {}));
40310
40336
  /**
40311
40337
  * Reducer that executes actions
40312
40338
  * @author Yuen Ler Chow
@@ -40314,18 +40340,18 @@ var ActionType$3;
40314
40340
  * @param action action to execute
40315
40341
  * @returns updated state
40316
40342
  */
40317
- const reducer$4 = (state, action) => {
40343
+ const reducer$3 = (state, action) => {
40318
40344
  switch (action.type) {
40319
- case ActionType$3.FinishLoading: {
40345
+ case ActionType$2.FinishLoading: {
40320
40346
  return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
40321
40347
  }
40322
- case ActionType$3.ShowAdder: {
40348
+ case ActionType$2.ShowAdder: {
40323
40349
  return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
40324
40350
  }
40325
- case ActionType$3.ShowEditor: {
40351
+ case ActionType$2.ShowEditor: {
40326
40352
  return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
40327
40353
  }
40328
- case ActionType$3.FinishAdd: {
40354
+ case ActionType$2.FinishAdd: {
40329
40355
  // Handle cancel
40330
40356
  const finishedEntry = action.dbEntry;
40331
40357
  if (!finishedEntry) {
@@ -40349,10 +40375,10 @@ const reducer$4 = (state, action) => {
40349
40375
  // Update the state
40350
40376
  return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
40351
40377
  }
40352
- case ActionType$3.StartDelete: {
40378
+ case ActionType$2.StartDelete: {
40353
40379
  return Object.assign(Object.assign({}, state), { loading: true });
40354
40380
  }
40355
- case ActionType$3.FinishDelete: {
40381
+ case ActionType$2.FinishDelete: {
40356
40382
  return Object.assign(Object.assign({}, state), { loading: false,
40357
40383
  // Remove the deleted entry from the list
40358
40384
  dbEntries: state.dbEntries.filter((entry) => {
@@ -40378,7 +40404,7 @@ const DBEntryManagerPanel = (props) => {
40378
40404
  loading: true,
40379
40405
  };
40380
40406
  // Initialize state
40381
- const [state, dispatch] = useReducer(reducer$4, initialState);
40407
+ const [state, dispatch] = useReducer(reducer$3, initialState);
40382
40408
  // Destructure common state
40383
40409
  const { adding, dbEntryToEdit, dbEntries, loading, } = state;
40384
40410
  /*------------------------------------------------------------------------*/
@@ -40404,7 +40430,7 @@ const DBEntryManagerPanel = (props) => {
40404
40430
  try {
40405
40431
  // Start loader
40406
40432
  dispatch({
40407
- type: ActionType$3.StartDelete,
40433
+ type: ActionType$2.StartDelete,
40408
40434
  });
40409
40435
  // Perform deletion
40410
40436
  yield visitServerEndpoint({
@@ -40413,7 +40439,7 @@ const DBEntryManagerPanel = (props) => {
40413
40439
  });
40414
40440
  // Finish loader
40415
40441
  dispatch({
40416
- type: ActionType$3.FinishDelete,
40442
+ type: ActionType$2.FinishDelete,
40417
40443
  dbEntry: entry,
40418
40444
  idPropName,
40419
40445
  });
@@ -40442,7 +40468,7 @@ const DBEntryManagerPanel = (props) => {
40442
40468
  });
40443
40469
  // Save loaded data
40444
40470
  dispatch({
40445
- type: ActionType$3.FinishLoading,
40471
+ type: ActionType$2.FinishLoading,
40446
40472
  dbEntries: data,
40447
40473
  });
40448
40474
  }
@@ -40485,7 +40511,7 @@ const DBEntryManagerPanel = (props) => {
40485
40511
  React__default.createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
40486
40512
  !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: () => {
40487
40513
  dispatch({
40488
- type: ActionType$3.ShowEditor,
40514
+ type: ActionType$2.ShowEditor,
40489
40515
  dbEntry: entry,
40490
40516
  });
40491
40517
  } },
@@ -40495,7 +40521,7 @@ const DBEntryManagerPanel = (props) => {
40495
40521
  React__default.createElement("div", { className: "d-grid" },
40496
40522
  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: () => {
40497
40523
  dispatch({
40498
- type: ActionType$3.ShowAdder,
40524
+ type: ActionType$2.ShowAdder,
40499
40525
  });
40500
40526
  } },
40501
40527
  React__default.createElement(FontAwesomeIcon, { icon: faPlus, className: "me-2" }),
@@ -40507,7 +40533,7 @@ const DBEntryManagerPanel = (props) => {
40507
40533
  if (!loading && (adding || dbEntryToEdit)) {
40508
40534
  body = (React__default.createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
40509
40535
  dispatch({
40510
- type: ActionType$3.FinishAdd,
40536
+ type: ActionType$2.FinishAdd,
40511
40537
  dbEntry: entry,
40512
40538
  idPropName,
40513
40539
  });
@@ -40524,228 +40550,6 @@ const DBEntryManagerPanel = (props) => {
40524
40550
  * @author Gabe Abrams
40525
40551
  */
40526
40552
  /*------------------------------------------------------------------------*/
40527
- /* ------------------------------ Constants ----------------------------- */
40528
- /*------------------------------------------------------------------------*/
40529
- // Tooltip widths
40530
- const TOOLTIP_WIDTH_THIN_REM = 5;
40531
- const TOOLTIP_WIDTH_NORMAL_REM = 7;
40532
- const TOOLTIP_WIDTH_WIDE_REM = 10;
40533
- // Tooltip border radius
40534
- const TOOLTIP_BORDER_RADIUS_REM = 0.3;
40535
- /*------------------------------------------------------------------------*/
40536
- /* -------------------------------- Style ------------------------------- */
40537
- /*------------------------------------------------------------------------*/
40538
- const style$1 = `
40539
- /* Container for contents and tooltip */
40540
- .Tooltip-outer-container {
40541
- position: relative;
40542
- }
40543
-
40544
- /* Container for just tooltip */
40545
- .Tooltip-tooltip-container {
40546
- /* Position in middle but take no space */
40547
- /* (so layout of page is unaffected) */
40548
- position: absolute;
40549
- display: inline-block;
40550
- top: 0;
40551
- left: 50%;
40552
- height: 0;
40553
- width: 0;
40554
- overflow: visible;
40555
- }
40556
-
40557
- /* Tooltip */
40558
- .Tooltip-tooltip {
40559
- /* Position above item */
40560
- display: inline-block;
40561
- position: absolute;
40562
- top: -2.3rem;
40563
- height: 1.8rem;
40564
- z-index: 1;
40565
-
40566
- /* Use standard black font */
40567
- font-size: 1rem;
40568
- color: black;
40569
-
40570
- /* Non-interactive */
40571
- pointer-events: none;
40572
- }
40573
-
40574
- /* Tooltip box (the rectangle surrounding the text) */
40575
- .Tooltip-box,
40576
- .Tooltip-box-shadow,
40577
- .Tooltip-box-highlight {
40578
- /* Fill all space with rectangle */
40579
- position: absolute;
40580
- left: 0;
40581
- top: 0;
40582
- display: inline-block;
40583
- width: 100%;
40584
- height: 100%;
40585
-
40586
- /* Rounded border */
40587
- border: 0.15rem solid black;
40588
- border-radius: ${TOOLTIP_BORDER_RADIUS_REM}rem;
40589
- }
40590
-
40591
- /* Tooltip highlight (the bright background to the text) */
40592
- .Tooltip-box-highlight {
40593
- /* Bootstrap warning variant background */
40594
- background-color: rgb(255, 193, 7);
40595
- border-radius: ${TOOLTIP_BORDER_RADIUS_REM}rem;
40596
-
40597
- /* Place on top */
40598
- z-index: -1;
40599
- }
40600
-
40601
- /* Tooltip box (the black rectangle) */
40602
- .Tooltip-box {
40603
- /* Plain black background */
40604
- background-color: black;
40605
-
40606
- /* Place in middle */
40607
- z-index: -2;
40608
- }
40609
-
40610
- /* Tooltip box shadow (the white shadow beneath the box) */
40611
- .Tooltip-box-shadow {
40612
- /* White shadow */
40613
- box-shadow: 0 0 0.3rem white;
40614
-
40615
- /* Place beneath */
40616
- z-index: -3;
40617
- }
40618
-
40619
- /* Tooltip contents (the text and icon) */
40620
- .Tooltip-contents {
40621
- /* Center text, don't allow overflow */
40622
- white-space: nowrap;
40623
- overflow: hidden;
40624
- text-align: center;
40625
- text-overflow: ellipsis;
40626
- display: flex;
40627
- align-items: center;
40628
- justify-content: center;
40629
-
40630
- /* Space within parent */
40631
- z-index: 1;
40632
- padding-left: 0.2rem;
40633
- padding-right: 0.2rem;
40634
- height: 100%;
40635
- }
40636
-
40637
- /* Tooltip text */
40638
- .Tooltip-text {
40639
- /* Center text, add ellipsis */
40640
- overflow: hidden;
40641
- text-align: center;
40642
- text-overflow: ellipsis;
40643
- }
40644
-
40645
- /* Classes to switch between tooltip visible/hidden */
40646
- .Tooltip-tooltip-visible-true {
40647
- opacity: 1;
40648
- }
40649
- .Tooltip-tooltip-visible-false {
40650
- opacity: 0;
40651
- }
40652
-
40653
- /* Classes to switch between tooltip sizes */
40654
- .Tooltip-size-thin {
40655
- width: ${TOOLTIP_WIDTH_THIN_REM}rem;
40656
- left: calc(50% - ${TOOLTIP_WIDTH_THIN_REM / 2}rem);
40657
- }
40658
- .Tooltip-size-normal {
40659
- width: ${TOOLTIP_WIDTH_NORMAL_REM}rem;
40660
- left: calc(50% - ${TOOLTIP_WIDTH_NORMAL_REM / 2}rem);
40661
- }
40662
- .Tooltip-size-wide {
40663
- width: ${TOOLTIP_WIDTH_WIDE_REM}rem;
40664
- left: calc(50% - ${TOOLTIP_WIDTH_WIDE_REM / 2}rem);
40665
- }
40666
-
40667
- /* Arrow (beneath tooltip) */
40668
- .Tooltip-arrow,
40669
- .Tooltip-arrow-shadow {
40670
- /* Position beneath tooltip */
40671
- position: absolute;
40672
- top: -1.5rem;
40673
- font-size: 1.5rem;
40674
- left: calc(50% - 0.5rem);
40675
- width: 0;
40676
- display: inline-block;
40677
-
40678
- /* Non-interactive */
40679
- pointer-events: none;
40680
- }
40681
-
40682
- /* Arrow itself */
40683
- .Tooltip-arrow {
40684
- color: black;
40685
- z-index: 4;
40686
- }
40687
-
40688
- /* Arrow shadow */
40689
- .Tooltip-arrow-shadow {
40690
- z-index: -1;
40691
-
40692
- /* Blur a white version of the caret as a shadow */
40693
- color: white;
40694
- filter: blur(0.2rem);
40695
- }
40696
-
40697
- /* Classes to switch between arrow visible/hidden */
40698
- .Tooltip-arrow-visible-true {
40699
- opacity: 1;
40700
- }
40701
- .Tooltip-arrow-visible-false {
40702
- opacity: 0;
40703
- }
40704
- `;
40705
- /* ------------- Actions ------------ */
40706
- // Types of actions
40707
- var ActionType$2;
40708
- (function (ActionType) {
40709
- // Make the tooltip visible
40710
- ActionType["Show"] = "Show";
40711
- // Make the tooltip invisible
40712
- ActionType["Hide"] = "Hide";
40713
- // Set nudge pixels
40714
- ActionType["SetNudgePx"] = "SetNudgePx";
40715
- // Set whether bottom left corner should be square
40716
- ActionType["SetSquareBottomLeft"] = "SetSquareBottomLeft";
40717
- // Set whether bottom right corner should be square
40718
- ActionType["SetSquareBottomRight"] = "SetSquareBottomRight";
40719
- })(ActionType$2 || (ActionType$2 = {}));
40720
- /**
40721
- * Reducer that executes actions
40722
- * @author Gabe Abrams
40723
- * @param state current state
40724
- * @param action action to execute
40725
- */
40726
- const reducer$3 = (state, action) => {
40727
- switch (action.type) {
40728
- case ActionType$2.Show: {
40729
- return Object.assign(Object.assign({}, state), { isVisible: true });
40730
- }
40731
- case ActionType$2.Hide: {
40732
- return Object.assign(Object.assign({}, state), { isVisible: false, nudgePx: 0 });
40733
- }
40734
- case ActionType$2.SetNudgePx: {
40735
- return Object.assign(Object.assign({}, state), { nudgePx: action.nudgePx });
40736
- }
40737
- case ActionType$2.SetSquareBottomLeft: {
40738
- return Object.assign(Object.assign({}, state), { squareBottomLeft: action.squareBottomLeft });
40739
- }
40740
- case ActionType$2.SetSquareBottomRight: {
40741
- return Object.assign(Object.assign({}, state), { squareBottomRight: action.squareBottomRight });
40742
- }
40743
- default: {
40744
- return state;
40745
- }
40746
- }
40747
- };
40748
- /*------------------------------------------------------------------------*/
40749
40553
  /* ------------------------------ Component ----------------------------- */
40750
40554
  /*------------------------------------------------------------------------*/
40751
40555
  const Tooltip = (props) => {
@@ -40754,21 +40558,10 @@ const Tooltip = (props) => {
40754
40558
  /*------------------------------------------------------------------------*/
40755
40559
  /* -------------- Props ------------- */
40756
40560
  // Destructure all props
40757
- const { icon, text, children, wide, thin, containerIsDisplayBlock, } = props;
40758
- /* -------------- State ------------- */
40759
- // Initial state
40760
- const initialState = {
40761
- isVisible: false,
40762
- nudgePx: 0,
40763
- };
40764
- // Initialize state
40765
- const [state, dispatch] = useReducer(reducer$3, initialState);
40766
- // Destructure common state
40767
- const { isVisible, nudgePx, squareBottomLeft, squareBottomRight, } = state;
40561
+ const { text, children, } = props;
40768
40562
  /* -------------- Refs -------------- */
40769
- // Initialize refs
40770
- const tooltipContainer = useRef(null);
40771
- const arrowElement = useRef(null);
40563
+ // Child ref
40564
+ const childRef = useRef(undefined);
40772
40565
  /*------------------------------------------------------------------------*/
40773
40566
  /* ------------------------- Lifecycle Functions ------------------------ */
40774
40567
  /*------------------------------------------------------------------------*/
@@ -40777,109 +40570,29 @@ const Tooltip = (props) => {
40777
40570
  * @author Gabe Abrams
40778
40571
  */
40779
40572
  useEffect(() => {
40780
- // Update tooltip container position
40781
- if (tooltipContainer.current && isVisible) {
40782
- // Get the tooltip container location
40783
- const tooltipContainerRect = (tooltipContainer
40784
- .current
40785
- .getBoundingClientRect());
40786
- // Get the window width
40787
- const windowWidth = window.innerWidth;
40788
- // Calculate new nudge value
40789
- let newNudgePx;
40790
- if (tooltipContainerRect.left < 0) {
40791
- // Tooltip is off the left side of the screen
40792
- newNudgePx = -1 * tooltipContainerRect.left;
40793
- }
40794
- else if (tooltipContainerRect.right > windowWidth) {
40795
- // Tooltip is off the right side of the screen
40796
- newNudgePx = -1 * (tooltipContainerRect.right - windowWidth);
40797
- }
40798
- else {
40799
- // Tooltip is in the middle of the screen
40800
- newNudgePx = 0;
40801
- }
40802
- // Update state
40803
- dispatch({
40804
- type: ActionType$2.SetNudgePx,
40805
- nudgePx: newNudgePx,
40806
- });
40807
- }
40808
- // Update border rounding
40809
- if (arrowElement.current && isVisible) {
40810
- // Get the arrow location
40811
- const arrowRect = (arrowElement
40812
- .current
40813
- .getBoundingClientRect());
40814
- // REM in pixels given font size
40815
- const remInPixels = Number.parseInt(getComputedStyle(document.documentElement).fontSize, 10);
40816
- // Set bottom left corner rounding
40817
- dispatch({
40818
- type: ActionType$2.SetSquareBottomLeft,
40819
- squareBottomLeft: (arrowRect.left < (TOOLTIP_BORDER_RADIUS_REM * remInPixels)),
40820
- });
40821
- // Set bottom right corner rounding
40822
- dispatch({
40823
- type: ActionType$2.SetSquareBottomRight,
40824
- squareBottomRight: (arrowRect.right
40825
- > window.innerWidth - (TOOLTIP_BORDER_RADIUS_REM * remInPixels)),
40826
- });
40573
+ // Skip if no child
40574
+ if (!childRef.current) {
40575
+ return;
40827
40576
  }
40828
- }, [isVisible]);
40577
+ // Initialize tooltip
40578
+ const t = new Tooltip$1(childRef.current, {
40579
+ title: text,
40580
+ placement: 'top',
40581
+ trigger: 'hover',
40582
+ });
40583
+ // Clean up tooltip
40584
+ return () => {
40585
+ t.dispose();
40586
+ };
40587
+ }, [text]);
40829
40588
  /*------------------------------------------------------------------------*/
40830
40589
  /* ------------------------------- Render ------------------------------- */
40831
40590
  /*------------------------------------------------------------------------*/
40832
40591
  /*----------------------------------------*/
40833
40592
  /* --------------- Main UI -------------- */
40834
40593
  /*----------------------------------------*/
40835
- // Determine size
40836
- let size = 'normal';
40837
- if (wide) {
40838
- size = 'wide';
40839
- }
40840
- else if (thin) {
40841
- size = 'thin';
40842
- }
40843
- // Render
40844
- return (React__default.createElement("div", { className: `Tooltip-outer-container ${containerIsDisplayBlock ? 'd-block' : 'd-inline-block'}}`, "aria-label": text, onMouseEnter: () => {
40845
- dispatch({
40846
- type: ActionType$2.Show,
40847
- });
40848
- }, onMouseLeave: () => {
40849
- dispatch({
40850
- type: ActionType$2.Hide,
40851
- });
40852
- }, onFocus: () => {
40853
- dispatch({
40854
- type: ActionType$2.Show,
40855
- });
40856
- }, onBlur: () => {
40857
- dispatch({
40858
- type: ActionType$2.Hide,
40859
- });
40860
- } },
40861
- React__default.createElement("style", null, style$1),
40862
- children,
40863
- React__default.createElement("div", { className: `Tooltip-arrow Tooltip-arrow-visible-${isVisible ? 'true' : 'false'}`, ref: arrowElement },
40864
- React__default.createElement(FontAwesomeIcon, { icon: faCaretDown })),
40865
- React__default.createElement("div", { className: `Tooltip-arrow-shadow Tooltip-arrow-visible-${isVisible ? 'true' : 'false'}` },
40866
- React__default.createElement(FontAwesomeIcon, { icon: faCaretDown })),
40867
- React__default.createElement("div", { className: "Tooltip-tooltip-container" },
40868
- React__default.createElement("div", { className: `Tooltip-tooltip Tooltip-tooltip-visible-${isVisible ? 'true' : 'false'} Tooltip-size-${size}`, role: "tooltip", ref: tooltipContainer, style: {
40869
- transform: `translateX(${nudgePx}px)`,
40870
- } },
40871
- React__default.createElement("div", { className: "Tooltip-box-highlight" }),
40872
- React__default.createElement("div", { className: "Tooltip-box", style: {
40873
- borderBottomLeftRadius: squareBottomLeft ? 0 : undefined,
40874
- borderBottomRightRadius: squareBottomRight ? 0 : undefined,
40875
- } }),
40876
- React__default.createElement("div", { className: "Tooltip-box-shadow", style: {
40877
- borderBottomLeftRadius: squareBottomLeft ? 0 : undefined,
40878
- borderBottomRightRadius: squareBottomRight ? 0 : undefined,
40879
- } }),
40880
- React__default.createElement("div", { className: "Tooltip-contents" },
40881
- icon && (React__default.createElement(FontAwesomeIcon, { icon: icon, className: "me-1" })),
40882
- React__default.createElement("span", { className: "Tooltip-text" }, text))))));
40594
+ // Clone child and add ref
40595
+ return React__default.cloneElement(children, { ref: childRef });
40883
40596
  };
40884
40597
 
40885
40598
  /**