dce-reactkit 3.8.5 → 3.8.6
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/cjs/index.js +277 -134
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/index.d.ts +3 -1
- package/dist/esm/index.js +276 -135
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +3 -1
- package/dist/index.d.ts +79 -43
- package/package.json +1 -1
- package/src/index.ts +4 -0
package/dist/esm/index.js
CHANGED
|
@@ -2210,27 +2210,27 @@ const PopPendingMark = (props) => {
|
|
|
2210
2210
|
*/
|
|
2211
2211
|
/* ------------- Actions ------------ */
|
|
2212
2212
|
// Types of actions
|
|
2213
|
-
var ActionType$
|
|
2213
|
+
var ActionType$9;
|
|
2214
2214
|
(function (ActionType) {
|
|
2215
2215
|
// Indicate that the text was recently copied
|
|
2216
2216
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
2217
2217
|
// Clear the status
|
|
2218
2218
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
2219
|
-
})(ActionType$
|
|
2219
|
+
})(ActionType$9 || (ActionType$9 = {}));
|
|
2220
2220
|
/**
|
|
2221
2221
|
* Reducer that executes actions
|
|
2222
2222
|
* @author Gabe Abrams
|
|
2223
2223
|
* @param state current state
|
|
2224
2224
|
* @param action action to execute
|
|
2225
2225
|
*/
|
|
2226
|
-
const reducer$
|
|
2226
|
+
const reducer$a = (state, action) => {
|
|
2227
2227
|
switch (action.type) {
|
|
2228
|
-
case ActionType$
|
|
2228
|
+
case ActionType$9.IndicateRecentlyCopied: {
|
|
2229
2229
|
return {
|
|
2230
2230
|
recentlyCopied: true,
|
|
2231
2231
|
};
|
|
2232
2232
|
}
|
|
2233
|
-
case ActionType$
|
|
2233
|
+
case ActionType$9.ClearRecentlyCopiedStatus: {
|
|
2234
2234
|
return {
|
|
2235
2235
|
recentlyCopied: false,
|
|
2236
2236
|
};
|
|
@@ -2256,7 +2256,7 @@ const CopiableBox = (props) => {
|
|
|
2256
2256
|
recentlyCopied: false,
|
|
2257
2257
|
};
|
|
2258
2258
|
// Initialize state
|
|
2259
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2259
|
+
const [state, dispatch] = useReducer(reducer$a, initialState);
|
|
2260
2260
|
// Destructure common state
|
|
2261
2261
|
const { recentlyCopied, } = state;
|
|
2262
2262
|
/*------------------------------------------------------------------------*/
|
|
@@ -2276,13 +2276,13 @@ const CopiableBox = (props) => {
|
|
|
2276
2276
|
}
|
|
2277
2277
|
// Show copied notice
|
|
2278
2278
|
dispatch({
|
|
2279
|
-
type: ActionType$
|
|
2279
|
+
type: ActionType$9.IndicateRecentlyCopied,
|
|
2280
2280
|
});
|
|
2281
2281
|
// Wait a moment
|
|
2282
2282
|
yield waitMs(4000);
|
|
2283
2283
|
// Hide copied notice
|
|
2284
2284
|
dispatch({
|
|
2285
|
-
type: ActionType$
|
|
2285
|
+
type: ActionType$9.ClearRecentlyCopiedStatus,
|
|
2286
2286
|
});
|
|
2287
2287
|
});
|
|
2288
2288
|
/*------------------------------------------------------------------------*/
|
|
@@ -2338,20 +2338,20 @@ const CopiableBox = (props) => {
|
|
|
2338
2338
|
*/
|
|
2339
2339
|
/* ------------- Actions ------------ */
|
|
2340
2340
|
// Types of actions
|
|
2341
|
-
var ActionType$
|
|
2341
|
+
var ActionType$8;
|
|
2342
2342
|
(function (ActionType) {
|
|
2343
2343
|
// Toggle whether a child are being shown
|
|
2344
2344
|
ActionType["ToggleChild"] = "toggle-child";
|
|
2345
|
-
})(ActionType$
|
|
2345
|
+
})(ActionType$8 || (ActionType$8 = {}));
|
|
2346
2346
|
/**
|
|
2347
2347
|
* Reducer that executes actions
|
|
2348
2348
|
* @author Gabe Abrams
|
|
2349
2349
|
* @param state current state
|
|
2350
2350
|
* @param action action to execute
|
|
2351
2351
|
*/
|
|
2352
|
-
const reducer$
|
|
2352
|
+
const reducer$9 = (state, action) => {
|
|
2353
2353
|
switch (action.type) {
|
|
2354
|
-
case ActionType$
|
|
2354
|
+
case ActionType$8.ToggleChild: {
|
|
2355
2355
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
2356
2356
|
}
|
|
2357
2357
|
default: {
|
|
@@ -2380,7 +2380,7 @@ const NestableItemList = (props) => {
|
|
|
2380
2380
|
childExpanded: initChildExpanded,
|
|
2381
2381
|
};
|
|
2382
2382
|
// Initialize state
|
|
2383
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2383
|
+
const [state, dispatch] = useReducer(reducer$9, initialState);
|
|
2384
2384
|
// Destructure common state
|
|
2385
2385
|
const { childExpanded, } = state;
|
|
2386
2386
|
/*------------------------------------------------------------------------*/
|
|
@@ -2470,7 +2470,7 @@ const NestableItemList = (props) => {
|
|
|
2470
2470
|
backgroundColor: 'transparent',
|
|
2471
2471
|
}, type: "button", onClick: () => {
|
|
2472
2472
|
dispatch({
|
|
2473
|
-
type: ActionType$
|
|
2473
|
+
type: ActionType$8.ToggleChild,
|
|
2474
2474
|
id: item.id,
|
|
2475
2475
|
});
|
|
2476
2476
|
}, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
@@ -2754,7 +2754,7 @@ var SortType;
|
|
|
2754
2754
|
})(SortType || (SortType = {}));
|
|
2755
2755
|
/* ------------- Actions ------------ */
|
|
2756
2756
|
// Types of actions
|
|
2757
|
-
var ActionType$
|
|
2757
|
+
var ActionType$7;
|
|
2758
2758
|
(function (ActionType) {
|
|
2759
2759
|
// Toggle sort column param
|
|
2760
2760
|
ActionType["ToggleSortColumn"] = "toggle-sort-column";
|
|
@@ -2766,16 +2766,16 @@ var ActionType$6;
|
|
|
2766
2766
|
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2767
2767
|
// Hide all columns
|
|
2768
2768
|
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2769
|
-
})(ActionType$
|
|
2769
|
+
})(ActionType$7 || (ActionType$7 = {}));
|
|
2770
2770
|
/**
|
|
2771
2771
|
* Reducer that executes actions
|
|
2772
2772
|
* @author Gabe Abrams
|
|
2773
2773
|
* @param state current state
|
|
2774
2774
|
* @param action action to execute
|
|
2775
2775
|
*/
|
|
2776
|
-
const reducer$
|
|
2776
|
+
const reducer$8 = (state, action) => {
|
|
2777
2777
|
switch (action.type) {
|
|
2778
|
-
case ActionType$
|
|
2778
|
+
case ActionType$7.ToggleSortColumn: {
|
|
2779
2779
|
if (action.param !== state.sortColumnParam) {
|
|
2780
2780
|
// Different column param
|
|
2781
2781
|
return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
|
|
@@ -2787,22 +2787,22 @@ const reducer$7 = (state, action) => {
|
|
|
2787
2787
|
// Stop sorting by column
|
|
2788
2788
|
return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
|
|
2789
2789
|
}
|
|
2790
|
-
case ActionType$
|
|
2790
|
+
case ActionType$7.UpdateColumnVisibility: {
|
|
2791
2791
|
const { columnVisibilityMap } = state;
|
|
2792
2792
|
columnVisibilityMap[action.param] = action.visible;
|
|
2793
2793
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2794
2794
|
}
|
|
2795
|
-
case ActionType$
|
|
2795
|
+
case ActionType$7.ToggleColVisCusModalVisibility: {
|
|
2796
2796
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2797
2797
|
}
|
|
2798
|
-
case ActionType$
|
|
2798
|
+
case ActionType$7.ShowAllColumns: {
|
|
2799
2799
|
const { columnVisibilityMap } = state;
|
|
2800
2800
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2801
2801
|
columnVisibilityMap[param] = true;
|
|
2802
2802
|
});
|
|
2803
2803
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2804
2804
|
}
|
|
2805
|
-
case ActionType$
|
|
2805
|
+
case ActionType$7.HideAllColumns: {
|
|
2806
2806
|
const { columnVisibilityMap } = state;
|
|
2807
2807
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2808
2808
|
columnVisibilityMap[param] = false;
|
|
@@ -2849,7 +2849,7 @@ const IntelliTable = (props) => {
|
|
|
2849
2849
|
columnVisibilityCustomizationModalVisible: false,
|
|
2850
2850
|
};
|
|
2851
2851
|
// Initialize state
|
|
2852
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2852
|
+
const [state, dispatch] = useReducer(reducer$8, initialState);
|
|
2853
2853
|
// Destructure common state
|
|
2854
2854
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
2855
2855
|
/*------------------------------------------------------------------------*/
|
|
@@ -2872,13 +2872,13 @@ const IntelliTable = (props) => {
|
|
|
2872
2872
|
return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
2873
2873
|
}
|
|
2874
2874
|
dispatch({
|
|
2875
|
-
type: ActionType$
|
|
2875
|
+
type: ActionType$7.ToggleColVisCusModalVisibility,
|
|
2876
2876
|
});
|
|
2877
2877
|
}, okayVariant: Variant$1.Light },
|
|
2878
2878
|
columns.map((column) => {
|
|
2879
2879
|
return (React__default.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
2880
2880
|
dispatch({
|
|
2881
|
-
type: ActionType$
|
|
2881
|
+
type: ActionType$7.UpdateColumnVisibility,
|
|
2882
2882
|
param: column.param,
|
|
2883
2883
|
visible: checked,
|
|
2884
2884
|
});
|
|
@@ -2887,12 +2887,12 @@ const IntelliTable = (props) => {
|
|
|
2887
2887
|
React__default.createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
2888
2888
|
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: () => {
|
|
2889
2889
|
dispatch({
|
|
2890
|
-
type: ActionType$
|
|
2890
|
+
type: ActionType$7.ShowAllColumns,
|
|
2891
2891
|
});
|
|
2892
2892
|
} }, "Select All"),
|
|
2893
2893
|
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: () => {
|
|
2894
2894
|
dispatch({
|
|
2895
|
-
type: ActionType$
|
|
2895
|
+
type: ActionType$7.HideAllColumns,
|
|
2896
2896
|
});
|
|
2897
2897
|
} }, "Deselect All")));
|
|
2898
2898
|
}
|
|
@@ -2943,7 +2943,7 @@ const IntelliTable = (props) => {
|
|
|
2943
2943
|
React__default.createElement("div", null,
|
|
2944
2944
|
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: () => {
|
|
2945
2945
|
dispatch({
|
|
2946
|
-
type: ActionType$
|
|
2946
|
+
type: ActionType$7.ToggleSortColumn,
|
|
2947
2947
|
param: column.param,
|
|
2948
2948
|
});
|
|
2949
2949
|
} },
|
|
@@ -3132,7 +3132,7 @@ const IntelliTable = (props) => {
|
|
|
3132
3132
|
React__default.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
|
|
3133
3133
|
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: () => {
|
|
3134
3134
|
dispatch({
|
|
3135
|
-
type: ActionType$
|
|
3135
|
+
type: ActionType$7.ToggleColVisCusModalVisibility,
|
|
3136
3136
|
});
|
|
3137
3137
|
} },
|
|
3138
3138
|
"Show/Hide Cols",
|
|
@@ -3498,7 +3498,7 @@ const genHumanReadableName = (machineReadableName) => {
|
|
|
3498
3498
|
};
|
|
3499
3499
|
/* ------------- Actions ------------ */
|
|
3500
3500
|
// Types of actions
|
|
3501
|
-
var ActionType$
|
|
3501
|
+
var ActionType$6;
|
|
3502
3502
|
(function (ActionType) {
|
|
3503
3503
|
// Show the loading bar
|
|
3504
3504
|
ActionType["StartLoading"] = "start-loading";
|
|
@@ -3520,45 +3520,45 @@ var ActionType$5;
|
|
|
3520
3520
|
ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
|
|
3521
3521
|
// Update the advanced filter state
|
|
3522
3522
|
ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
|
|
3523
|
-
})(ActionType$
|
|
3523
|
+
})(ActionType$6 || (ActionType$6 = {}));
|
|
3524
3524
|
/**
|
|
3525
3525
|
* Reducer that executes actions
|
|
3526
3526
|
* @author Gabe Abrams
|
|
3527
3527
|
* @param state current state
|
|
3528
3528
|
* @param action action to execute
|
|
3529
3529
|
*/
|
|
3530
|
-
const reducer$
|
|
3530
|
+
const reducer$7 = (state, action) => {
|
|
3531
3531
|
switch (action.type) {
|
|
3532
|
-
case ActionType$
|
|
3532
|
+
case ActionType$6.StartLoading: {
|
|
3533
3533
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
3534
3534
|
}
|
|
3535
|
-
case ActionType$
|
|
3535
|
+
case ActionType$6.FinishLoading: {
|
|
3536
3536
|
return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
|
|
3537
3537
|
}
|
|
3538
|
-
case ActionType$
|
|
3538
|
+
case ActionType$6.ToggleFilterDrawer: {
|
|
3539
3539
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
|
|
3540
3540
|
? undefined // hide
|
|
3541
3541
|
: action.filterDrawer) });
|
|
3542
3542
|
}
|
|
3543
|
-
case ActionType$
|
|
3543
|
+
case ActionType$6.HideFilterDrawer: {
|
|
3544
3544
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3545
3545
|
}
|
|
3546
|
-
case ActionType$
|
|
3546
|
+
case ActionType$6.ResetFilters: {
|
|
3547
3547
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
|
|
3548
3548
|
}
|
|
3549
|
-
case ActionType$
|
|
3549
|
+
case ActionType$6.UpdateDateFilterState: {
|
|
3550
3550
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
|
|
3551
3551
|
}
|
|
3552
|
-
case ActionType$
|
|
3552
|
+
case ActionType$6.UpdateContextFilterState: {
|
|
3553
3553
|
return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
|
|
3554
3554
|
}
|
|
3555
|
-
case ActionType$
|
|
3555
|
+
case ActionType$6.UpdateTagFilterState: {
|
|
3556
3556
|
return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
|
|
3557
3557
|
}
|
|
3558
|
-
case ActionType$
|
|
3558
|
+
case ActionType$6.UpdateActionErrorFilterState: {
|
|
3559
3559
|
return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
|
|
3560
3560
|
}
|
|
3561
|
-
case ActionType$
|
|
3561
|
+
case ActionType$6.UpdateAdvancedFilterState: {
|
|
3562
3562
|
return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
|
|
3563
3563
|
}
|
|
3564
3564
|
default: {
|
|
@@ -3687,7 +3687,7 @@ const LogReviewer = (props) => {
|
|
|
3687
3687
|
advancedFilterState: initAdvancedFilterState,
|
|
3688
3688
|
};
|
|
3689
3689
|
// Initialize state
|
|
3690
|
-
const [state, dispatch] = useReducer(reducer$
|
|
3690
|
+
const [state, dispatch] = useReducer(reducer$7, initialState);
|
|
3691
3691
|
// Destructure common state
|
|
3692
3692
|
const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
|
|
3693
3693
|
/*------------------------------------------------------------------------*/
|
|
@@ -3737,7 +3737,7 @@ const LogReviewer = (props) => {
|
|
|
3737
3737
|
const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3738
3738
|
// Update state
|
|
3739
3739
|
dispatch({
|
|
3740
|
-
type: ActionType$
|
|
3740
|
+
type: ActionType$6.UpdateDateFilterState,
|
|
3741
3741
|
dateFilterState: newDateFilterState,
|
|
3742
3742
|
});
|
|
3743
3743
|
// Check which year/month combos we need to load
|
|
@@ -3748,7 +3748,7 @@ const LogReviewer = (props) => {
|
|
|
3748
3748
|
}
|
|
3749
3749
|
// Start loading
|
|
3750
3750
|
dispatch({
|
|
3751
|
-
type: ActionType$
|
|
3751
|
+
type: ActionType$6.StartLoading,
|
|
3752
3752
|
});
|
|
3753
3753
|
// Load required months
|
|
3754
3754
|
try {
|
|
@@ -3772,7 +3772,7 @@ const LogReviewer = (props) => {
|
|
|
3772
3772
|
}
|
|
3773
3773
|
// Finish loading
|
|
3774
3774
|
dispatch({
|
|
3775
|
-
type: ActionType$
|
|
3775
|
+
type: ActionType$6.FinishLoading,
|
|
3776
3776
|
logMap,
|
|
3777
3777
|
});
|
|
3778
3778
|
});
|
|
@@ -3811,7 +3811,7 @@ const LogReviewer = (props) => {
|
|
|
3811
3811
|
React__default.createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
3812
3812
|
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: () => {
|
|
3813
3813
|
dispatch({
|
|
3814
|
-
type: ActionType$
|
|
3814
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3815
3815
|
filterDrawer: FilterDrawer.Date,
|
|
3816
3816
|
});
|
|
3817
3817
|
} },
|
|
@@ -3819,7 +3819,7 @@ const LogReviewer = (props) => {
|
|
|
3819
3819
|
"Date"),
|
|
3820
3820
|
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: () => {
|
|
3821
3821
|
dispatch({
|
|
3822
|
-
type: ActionType$
|
|
3822
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3823
3823
|
filterDrawer: FilterDrawer.Context,
|
|
3824
3824
|
});
|
|
3825
3825
|
} },
|
|
@@ -3827,7 +3827,7 @@ const LogReviewer = (props) => {
|
|
|
3827
3827
|
"Context"),
|
|
3828
3828
|
(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: () => {
|
|
3829
3829
|
dispatch({
|
|
3830
|
-
type: ActionType$
|
|
3830
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3831
3831
|
filterDrawer: FilterDrawer.Tag,
|
|
3832
3832
|
});
|
|
3833
3833
|
} },
|
|
@@ -3835,7 +3835,7 @@ const LogReviewer = (props) => {
|
|
|
3835
3835
|
"Tag")),
|
|
3836
3836
|
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: () => {
|
|
3837
3837
|
dispatch({
|
|
3838
|
-
type: ActionType$
|
|
3838
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3839
3839
|
filterDrawer: FilterDrawer.Action,
|
|
3840
3840
|
});
|
|
3841
3841
|
} },
|
|
@@ -3843,7 +3843,7 @@ const LogReviewer = (props) => {
|
|
|
3843
3843
|
"Action"),
|
|
3844
3844
|
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: () => {
|
|
3845
3845
|
dispatch({
|
|
3846
|
-
type: ActionType$
|
|
3846
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3847
3847
|
filterDrawer: FilterDrawer.Advanced,
|
|
3848
3848
|
});
|
|
3849
3849
|
} },
|
|
@@ -3851,7 +3851,7 @@ const LogReviewer = (props) => {
|
|
|
3851
3851
|
"Advanced"),
|
|
3852
3852
|
React__default.createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
|
|
3853
3853
|
dispatch({
|
|
3854
|
-
type: ActionType$
|
|
3854
|
+
type: ActionType$6.ResetFilters,
|
|
3855
3855
|
initActionErrorFilterState,
|
|
3856
3856
|
initAdvancedFilterState,
|
|
3857
3857
|
initContextFilterState,
|
|
@@ -3973,7 +3973,7 @@ const LogReviewer = (props) => {
|
|
|
3973
3973
|
}
|
|
3974
3974
|
});
|
|
3975
3975
|
dispatch({
|
|
3976
|
-
type: ActionType$
|
|
3976
|
+
type: ActionType$6.UpdateContextFilterState,
|
|
3977
3977
|
contextFilterState,
|
|
3978
3978
|
});
|
|
3979
3979
|
} }));
|
|
@@ -3988,7 +3988,7 @@ const LogReviewer = (props) => {
|
|
|
3988
3988
|
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) => {
|
|
3989
3989
|
tagFilterState[tag] = checked;
|
|
3990
3990
|
dispatch({
|
|
3991
|
-
type: ActionType$
|
|
3991
|
+
type: ActionType$6.UpdateTagFilterState,
|
|
3992
3992
|
tagFilterState,
|
|
3993
3993
|
});
|
|
3994
3994
|
} }));
|
|
@@ -4001,21 +4001,21 @@ const LogReviewer = (props) => {
|
|
|
4001
4001
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
4002
4002
|
actionErrorFilterState.type = undefined;
|
|
4003
4003
|
dispatch({
|
|
4004
|
-
type: ActionType$
|
|
4004
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4005
4005
|
actionErrorFilterState,
|
|
4006
4006
|
});
|
|
4007
4007
|
}, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
|
|
4008
4008
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
4009
4009
|
actionErrorFilterState.type = LogType$1.Action;
|
|
4010
4010
|
dispatch({
|
|
4011
|
-
type: ActionType$
|
|
4011
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4012
4012
|
actionErrorFilterState,
|
|
4013
4013
|
});
|
|
4014
4014
|
}, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
|
|
4015
4015
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
4016
4016
|
actionErrorFilterState.type = LogType$1.Error;
|
|
4017
4017
|
dispatch({
|
|
4018
|
-
type: ActionType$
|
|
4018
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4019
4019
|
actionErrorFilterState,
|
|
4020
4020
|
});
|
|
4021
4021
|
}, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
|
|
@@ -4027,7 +4027,7 @@ const LogReviewer = (props) => {
|
|
|
4027
4027
|
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) => {
|
|
4028
4028
|
actionErrorFilterState.action[action] = checked;
|
|
4029
4029
|
dispatch({
|
|
4030
|
-
type: ActionType$
|
|
4030
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4031
4031
|
actionErrorFilterState,
|
|
4032
4032
|
});
|
|
4033
4033
|
} }));
|
|
@@ -4038,7 +4038,7 @@ const LogReviewer = (props) => {
|
|
|
4038
4038
|
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) => {
|
|
4039
4039
|
actionErrorFilterState.target[target] = checked;
|
|
4040
4040
|
dispatch({
|
|
4041
|
-
type: ActionType$
|
|
4041
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4042
4042
|
actionErrorFilterState,
|
|
4043
4043
|
});
|
|
4044
4044
|
} }));
|
|
@@ -4050,7 +4050,7 @@ const LogReviewer = (props) => {
|
|
|
4050
4050
|
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) => {
|
|
4051
4051
|
actionErrorFilterState.errorMessage = e.target.value;
|
|
4052
4052
|
dispatch({
|
|
4053
|
-
type: ActionType$
|
|
4053
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4054
4054
|
actionErrorFilterState,
|
|
4055
4055
|
});
|
|
4056
4056
|
} })),
|
|
@@ -4061,7 +4061,7 @@ const LogReviewer = (props) => {
|
|
|
4061
4061
|
.trim()
|
|
4062
4062
|
.toUpperCase());
|
|
4063
4063
|
dispatch({
|
|
4064
|
-
type: ActionType$
|
|
4064
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4065
4065
|
actionErrorFilterState,
|
|
4066
4066
|
});
|
|
4067
4067
|
} }))))));
|
|
@@ -4075,7 +4075,7 @@ const LogReviewer = (props) => {
|
|
|
4075
4075
|
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) => {
|
|
4076
4076
|
advancedFilterState.userFirstName = e.target.value;
|
|
4077
4077
|
dispatch({
|
|
4078
|
-
type: ActionType$
|
|
4078
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4079
4079
|
advancedFilterState,
|
|
4080
4080
|
});
|
|
4081
4081
|
} })),
|
|
@@ -4084,7 +4084,7 @@ const LogReviewer = (props) => {
|
|
|
4084
4084
|
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) => {
|
|
4085
4085
|
advancedFilterState.userLastName = e.target.value;
|
|
4086
4086
|
dispatch({
|
|
4087
|
-
type: ActionType$
|
|
4087
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4088
4088
|
advancedFilterState,
|
|
4089
4089
|
});
|
|
4090
4090
|
} })),
|
|
@@ -4094,7 +4094,7 @@ const LogReviewer = (props) => {
|
|
|
4094
4094
|
advancedFilterState.userEmail = ((e.target.value)
|
|
4095
4095
|
.trim());
|
|
4096
4096
|
dispatch({
|
|
4097
|
-
type: ActionType$
|
|
4097
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4098
4098
|
advancedFilterState,
|
|
4099
4099
|
});
|
|
4100
4100
|
} })),
|
|
@@ -4108,7 +4108,7 @@ const LogReviewer = (props) => {
|
|
|
4108
4108
|
.trim());
|
|
4109
4109
|
}
|
|
4110
4110
|
dispatch({
|
|
4111
|
-
type: ActionType$
|
|
4111
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4112
4112
|
advancedFilterState,
|
|
4113
4113
|
});
|
|
4114
4114
|
} })),
|
|
@@ -4116,21 +4116,21 @@ const LogReviewer = (props) => {
|
|
|
4116
4116
|
React__default.createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
4117
4117
|
advancedFilterState.includeLearners = checked;
|
|
4118
4118
|
dispatch({
|
|
4119
|
-
type: ActionType$
|
|
4119
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4120
4120
|
advancedFilterState,
|
|
4121
4121
|
});
|
|
4122
4122
|
}, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
|
|
4123
4123
|
React__default.createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
4124
4124
|
advancedFilterState.includeTTMs = checked;
|
|
4125
4125
|
dispatch({
|
|
4126
|
-
type: ActionType$
|
|
4126
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4127
4127
|
advancedFilterState,
|
|
4128
4128
|
});
|
|
4129
4129
|
}, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
|
|
4130
4130
|
React__default.createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
4131
4131
|
advancedFilterState.includeAdmins = checked;
|
|
4132
4132
|
dispatch({
|
|
4133
|
-
type: ActionType$
|
|
4133
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4134
4134
|
advancedFilterState,
|
|
4135
4135
|
});
|
|
4136
4136
|
}, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
|
|
@@ -4140,7 +4140,7 @@ const LogReviewer = (props) => {
|
|
|
4140
4140
|
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) => {
|
|
4141
4141
|
advancedFilterState.courseName = e.target.value;
|
|
4142
4142
|
dispatch({
|
|
4143
|
-
type: ActionType$
|
|
4143
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4144
4144
|
advancedFilterState,
|
|
4145
4145
|
});
|
|
4146
4146
|
} })),
|
|
@@ -4154,7 +4154,7 @@ const LogReviewer = (props) => {
|
|
|
4154
4154
|
.trim());
|
|
4155
4155
|
}
|
|
4156
4156
|
dispatch({
|
|
4157
|
-
type: ActionType$
|
|
4157
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4158
4158
|
advancedFilterState,
|
|
4159
4159
|
});
|
|
4160
4160
|
} }))),
|
|
@@ -4163,21 +4163,21 @@ const LogReviewer = (props) => {
|
|
|
4163
4163
|
React__default.createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
|
|
4164
4164
|
advancedFilterState.isMobile = undefined;
|
|
4165
4165
|
dispatch({
|
|
4166
|
-
type: ActionType$
|
|
4166
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4167
4167
|
advancedFilterState,
|
|
4168
4168
|
});
|
|
4169
4169
|
} }),
|
|
4170
4170
|
React__default.createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
|
|
4171
4171
|
advancedFilterState.isMobile = true;
|
|
4172
4172
|
dispatch({
|
|
4173
|
-
type: ActionType$
|
|
4173
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4174
4174
|
advancedFilterState,
|
|
4175
4175
|
});
|
|
4176
4176
|
} }),
|
|
4177
4177
|
React__default.createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
|
|
4178
4178
|
advancedFilterState.isMobile = false;
|
|
4179
4179
|
dispatch({
|
|
4180
|
-
type: ActionType$
|
|
4180
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4181
4181
|
advancedFilterState,
|
|
4182
4182
|
});
|
|
4183
4183
|
}, noMarginOnRight: true }))),
|
|
@@ -4186,21 +4186,21 @@ const LogReviewer = (props) => {
|
|
|
4186
4186
|
React__default.createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
|
|
4187
4187
|
advancedFilterState.source = undefined;
|
|
4188
4188
|
dispatch({
|
|
4189
|
-
type: ActionType$
|
|
4189
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4190
4190
|
advancedFilterState,
|
|
4191
4191
|
});
|
|
4192
4192
|
} }),
|
|
4193
4193
|
React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
|
|
4194
4194
|
advancedFilterState.source = LogSource$1.Client;
|
|
4195
4195
|
dispatch({
|
|
4196
|
-
type: ActionType$
|
|
4196
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4197
4197
|
advancedFilterState,
|
|
4198
4198
|
});
|
|
4199
4199
|
} }),
|
|
4200
4200
|
React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
|
|
4201
4201
|
advancedFilterState.source = LogSource$1.Server;
|
|
4202
4202
|
dispatch({
|
|
4203
|
-
type: ActionType$
|
|
4203
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4204
4204
|
advancedFilterState,
|
|
4205
4205
|
});
|
|
4206
4206
|
}, noMarginOnRight: true })),
|
|
@@ -4211,7 +4211,7 @@ const LogReviewer = (props) => {
|
|
|
4211
4211
|
advancedFilterState.courseName = ((e.target.value)
|
|
4212
4212
|
.trim());
|
|
4213
4213
|
dispatch({
|
|
4214
|
-
type: ActionType$
|
|
4214
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4215
4215
|
advancedFilterState,
|
|
4216
4216
|
});
|
|
4217
4217
|
} })),
|
|
@@ -4221,7 +4221,7 @@ const LogReviewer = (props) => {
|
|
|
4221
4221
|
advancedFilterState.courseName = ((e.target.value)
|
|
4222
4222
|
.trim());
|
|
4223
4223
|
dispatch({
|
|
4224
|
-
type: ActionType$
|
|
4224
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4225
4225
|
advancedFilterState,
|
|
4226
4226
|
});
|
|
4227
4227
|
} })))))));
|
|
@@ -12041,11 +12041,11 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
12041
12041
|
*/
|
|
12042
12042
|
/* ------------- Actions ------------ */
|
|
12043
12043
|
// Types of actions
|
|
12044
|
-
var ActionType$
|
|
12044
|
+
var ActionType$5;
|
|
12045
12045
|
(function (ActionType) {
|
|
12046
12046
|
// Update the input value
|
|
12047
12047
|
ActionType["SetInputValue"] = "SetInputValue";
|
|
12048
|
-
})(ActionType$
|
|
12048
|
+
})(ActionType$5 || (ActionType$5 = {}));
|
|
12049
12049
|
/**
|
|
12050
12050
|
* Reducer that executes actions
|
|
12051
12051
|
* @author Yuen Ler Chow
|
|
@@ -12053,9 +12053,9 @@ var ActionType$4;
|
|
|
12053
12053
|
* @param action action to execute
|
|
12054
12054
|
* @returns updated state
|
|
12055
12055
|
*/
|
|
12056
|
-
const reducer$
|
|
12056
|
+
const reducer$6 = (state, action) => {
|
|
12057
12057
|
switch (action.type) {
|
|
12058
|
-
case ActionType$
|
|
12058
|
+
case ActionType$5.SetInputValue: {
|
|
12059
12059
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
12060
12060
|
}
|
|
12061
12061
|
default: {
|
|
@@ -12075,7 +12075,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12075
12075
|
inputValue: '',
|
|
12076
12076
|
};
|
|
12077
12077
|
// Initialize state
|
|
12078
|
-
const [state, dispatch] = useReducer(reducer$
|
|
12078
|
+
const [state, dispatch] = useReducer(reducer$6, initialState);
|
|
12079
12079
|
// Destructure common state
|
|
12080
12080
|
const { inputValue } = state;
|
|
12081
12081
|
/*------------------------------------------------------------------------*/
|
|
@@ -12152,7 +12152,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12152
12152
|
}
|
|
12153
12153
|
// Reset text field to empty because the values have been added
|
|
12154
12154
|
dispatch({
|
|
12155
|
-
type: ActionType$
|
|
12155
|
+
type: ActionType$5.SetInputValue,
|
|
12156
12156
|
value: '',
|
|
12157
12157
|
});
|
|
12158
12158
|
};
|
|
@@ -12191,7 +12191,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12191
12191
|
else {
|
|
12192
12192
|
// simply update the input value to the new input value
|
|
12193
12193
|
dispatch({
|
|
12194
|
-
type: ActionType$
|
|
12194
|
+
type: ActionType$5.SetInputValue,
|
|
12195
12195
|
value: newValue,
|
|
12196
12196
|
});
|
|
12197
12197
|
}
|
|
@@ -12243,13 +12243,13 @@ const style$1 = `
|
|
|
12243
12243
|
`;
|
|
12244
12244
|
/* ------------- Actions ------------ */
|
|
12245
12245
|
// Types of actions
|
|
12246
|
-
var ActionType$
|
|
12246
|
+
var ActionType$4;
|
|
12247
12247
|
(function (ActionType) {
|
|
12248
12248
|
// Update the DBEntry
|
|
12249
12249
|
ActionType["UpdateDBEntry"] = "UpdateDBEntry";
|
|
12250
12250
|
// Start the save spinner
|
|
12251
12251
|
ActionType["StartSave"] = "StartSave";
|
|
12252
|
-
})(ActionType$
|
|
12252
|
+
})(ActionType$4 || (ActionType$4 = {}));
|
|
12253
12253
|
/**
|
|
12254
12254
|
* Reducer that executes actions
|
|
12255
12255
|
* @author Yuen Ler Chow
|
|
@@ -12257,12 +12257,12 @@ var ActionType$3;
|
|
|
12257
12257
|
* @param action action to execute
|
|
12258
12258
|
* @returns updated state
|
|
12259
12259
|
*/
|
|
12260
|
-
const reducer$
|
|
12260
|
+
const reducer$5 = (state, action) => {
|
|
12261
12261
|
switch (action.type) {
|
|
12262
|
-
case ActionType$
|
|
12262
|
+
case ActionType$4.UpdateDBEntry: {
|
|
12263
12263
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
12264
12264
|
}
|
|
12265
|
-
case ActionType$
|
|
12265
|
+
case ActionType$4.StartSave: {
|
|
12266
12266
|
return Object.assign(Object.assign({}, state), { saving: true });
|
|
12267
12267
|
}
|
|
12268
12268
|
default: {
|
|
@@ -12287,7 +12287,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12287
12287
|
saving: false,
|
|
12288
12288
|
};
|
|
12289
12289
|
// Initialize state
|
|
12290
|
-
const [state, dispatch] = useReducer(reducer$
|
|
12290
|
+
const [state, dispatch] = useReducer(reducer$5, initialState);
|
|
12291
12291
|
// Destructure common state
|
|
12292
12292
|
const { entry, saving, } = state;
|
|
12293
12293
|
/*------------------------------------------------------------------------*/
|
|
@@ -12299,7 +12299,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12299
12299
|
*/
|
|
12300
12300
|
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
12301
12301
|
// Start the save loading indicator
|
|
12302
|
-
dispatch({ type: ActionType$
|
|
12302
|
+
dispatch({ type: ActionType$4.StartSave });
|
|
12303
12303
|
// add all default values to the entry
|
|
12304
12304
|
entryFields.forEach((field) => {
|
|
12305
12305
|
if (field.defaultValue && !entry[field.objectKey]) {
|
|
@@ -12482,7 +12482,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12482
12482
|
return (React__default.createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
|
|
12483
12483
|
entry[field.objectKey] = choice.value;
|
|
12484
12484
|
dispatch({
|
|
12485
|
-
type: ActionType$
|
|
12485
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12486
12486
|
dbEntry: entry,
|
|
12487
12487
|
});
|
|
12488
12488
|
}, ariaLabel: choice.title }));
|
|
@@ -12494,7 +12494,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12494
12494
|
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) => {
|
|
12495
12495
|
entry[field.objectKey] = (e.target.value);
|
|
12496
12496
|
dispatch({
|
|
12497
|
-
type: ActionType$
|
|
12497
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12498
12498
|
dbEntry: entry,
|
|
12499
12499
|
});
|
|
12500
12500
|
} }))));
|
|
@@ -12507,7 +12507,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12507
12507
|
entry[field.objectKey] = (e.target.value
|
|
12508
12508
|
.replace(/[^0-9]/g, ''));
|
|
12509
12509
|
dispatch({
|
|
12510
|
-
type: ActionType$
|
|
12510
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12511
12511
|
dbEntry: entry,
|
|
12512
12512
|
});
|
|
12513
12513
|
} }))));
|
|
@@ -12537,7 +12537,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12537
12537
|
}
|
|
12538
12538
|
// Save
|
|
12539
12539
|
dispatch({
|
|
12540
|
-
type: ActionType$
|
|
12540
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12541
12541
|
dbEntry: entry,
|
|
12542
12542
|
});
|
|
12543
12543
|
}, ariaLabel: choice.title }));
|
|
@@ -12552,7 +12552,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12552
12552
|
// Update entry and save
|
|
12553
12553
|
entry[field.objectKey] = values;
|
|
12554
12554
|
dispatch({
|
|
12555
|
-
type: ActionType$
|
|
12555
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12556
12556
|
dbEntry: entry,
|
|
12557
12557
|
});
|
|
12558
12558
|
} })))));
|
|
@@ -12565,7 +12565,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12565
12565
|
React__default.createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
|
|
12566
12566
|
entry[field.objectKey] = values;
|
|
12567
12567
|
dispatch({
|
|
12568
|
-
type: ActionType$
|
|
12568
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12569
12569
|
dbEntry: entry,
|
|
12570
12570
|
});
|
|
12571
12571
|
} })))));
|
|
@@ -12639,7 +12639,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
|
|
|
12639
12639
|
*/
|
|
12640
12640
|
/* ------------- Actions ------------ */
|
|
12641
12641
|
// Types of actions
|
|
12642
|
-
var ActionType$
|
|
12642
|
+
var ActionType$3;
|
|
12643
12643
|
(function (ActionType) {
|
|
12644
12644
|
// Show adder
|
|
12645
12645
|
ActionType["ShowAdder"] = "ShowAdder";
|
|
@@ -12653,7 +12653,7 @@ var ActionType$2;
|
|
|
12653
12653
|
ActionType["StartDelete"] = "StartDelete";
|
|
12654
12654
|
// Finish deletion process
|
|
12655
12655
|
ActionType["FinishDelete"] = "FinishDelete";
|
|
12656
|
-
})(ActionType$
|
|
12656
|
+
})(ActionType$3 || (ActionType$3 = {}));
|
|
12657
12657
|
/**
|
|
12658
12658
|
* Reducer that executes actions
|
|
12659
12659
|
* @author Yuen Ler Chow
|
|
@@ -12661,18 +12661,18 @@ var ActionType$2;
|
|
|
12661
12661
|
* @param action action to execute
|
|
12662
12662
|
* @returns updated state
|
|
12663
12663
|
*/
|
|
12664
|
-
const reducer$
|
|
12664
|
+
const reducer$4 = (state, action) => {
|
|
12665
12665
|
switch (action.type) {
|
|
12666
|
-
case ActionType$
|
|
12666
|
+
case ActionType$3.FinishLoading: {
|
|
12667
12667
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
12668
12668
|
}
|
|
12669
|
-
case ActionType$
|
|
12669
|
+
case ActionType$3.ShowAdder: {
|
|
12670
12670
|
return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
|
|
12671
12671
|
}
|
|
12672
|
-
case ActionType$
|
|
12672
|
+
case ActionType$3.ShowEditor: {
|
|
12673
12673
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
|
|
12674
12674
|
}
|
|
12675
|
-
case ActionType$
|
|
12675
|
+
case ActionType$3.FinishAdd: {
|
|
12676
12676
|
// Handle cancel
|
|
12677
12677
|
const finishedEntry = action.dbEntry;
|
|
12678
12678
|
if (!finishedEntry) {
|
|
@@ -12696,10 +12696,10 @@ const reducer$3 = (state, action) => {
|
|
|
12696
12696
|
// Update the state
|
|
12697
12697
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
|
|
12698
12698
|
}
|
|
12699
|
-
case ActionType$
|
|
12699
|
+
case ActionType$3.StartDelete: {
|
|
12700
12700
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
12701
12701
|
}
|
|
12702
|
-
case ActionType$
|
|
12702
|
+
case ActionType$3.FinishDelete: {
|
|
12703
12703
|
return Object.assign(Object.assign({}, state), { loading: false,
|
|
12704
12704
|
// Remove the deleted entry from the list
|
|
12705
12705
|
dbEntries: state.dbEntries.filter((entry) => {
|
|
@@ -12725,7 +12725,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12725
12725
|
loading: true,
|
|
12726
12726
|
};
|
|
12727
12727
|
// Initialize state
|
|
12728
|
-
const [state, dispatch] = useReducer(reducer$
|
|
12728
|
+
const [state, dispatch] = useReducer(reducer$4, initialState);
|
|
12729
12729
|
// Destructure common state
|
|
12730
12730
|
const { adding, dbEntryToEdit, dbEntries, loading, } = state;
|
|
12731
12731
|
/*------------------------------------------------------------------------*/
|
|
@@ -12751,7 +12751,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12751
12751
|
try {
|
|
12752
12752
|
// Start loader
|
|
12753
12753
|
dispatch({
|
|
12754
|
-
type: ActionType$
|
|
12754
|
+
type: ActionType$3.StartDelete,
|
|
12755
12755
|
});
|
|
12756
12756
|
// Perform deletion
|
|
12757
12757
|
yield visitServerEndpoint({
|
|
@@ -12760,7 +12760,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12760
12760
|
});
|
|
12761
12761
|
// Finish loader
|
|
12762
12762
|
dispatch({
|
|
12763
|
-
type: ActionType$
|
|
12763
|
+
type: ActionType$3.FinishDelete,
|
|
12764
12764
|
dbEntry: entry,
|
|
12765
12765
|
idPropName,
|
|
12766
12766
|
});
|
|
@@ -12789,7 +12789,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12789
12789
|
});
|
|
12790
12790
|
// Save loaded data
|
|
12791
12791
|
dispatch({
|
|
12792
|
-
type: ActionType$
|
|
12792
|
+
type: ActionType$3.FinishLoading,
|
|
12793
12793
|
dbEntries: data,
|
|
12794
12794
|
});
|
|
12795
12795
|
}
|
|
@@ -12832,7 +12832,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12832
12832
|
React__default.createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
|
|
12833
12833
|
!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: () => {
|
|
12834
12834
|
dispatch({
|
|
12835
|
-
type: ActionType$
|
|
12835
|
+
type: ActionType$3.ShowEditor,
|
|
12836
12836
|
dbEntry: entry,
|
|
12837
12837
|
});
|
|
12838
12838
|
} },
|
|
@@ -12842,7 +12842,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12842
12842
|
React__default.createElement("div", { className: "d-grid" },
|
|
12843
12843
|
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: () => {
|
|
12844
12844
|
dispatch({
|
|
12845
|
-
type: ActionType$
|
|
12845
|
+
type: ActionType$3.ShowAdder,
|
|
12846
12846
|
});
|
|
12847
12847
|
} },
|
|
12848
12848
|
React__default.createElement(FontAwesomeIcon, { icon: faPlus, className: "me-2" }),
|
|
@@ -12854,7 +12854,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12854
12854
|
if (!loading && (adding || dbEntryToEdit)) {
|
|
12855
12855
|
body = (React__default.createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
|
|
12856
12856
|
dispatch({
|
|
12857
|
-
type: ActionType$
|
|
12857
|
+
type: ActionType$3.FinishAdd,
|
|
12858
12858
|
dbEntry: entry,
|
|
12859
12859
|
idPropName,
|
|
12860
12860
|
});
|
|
@@ -13051,25 +13051,25 @@ const getItemIds = (items) => {
|
|
|
13051
13051
|
};
|
|
13052
13052
|
/* ------------- Actions ------------ */
|
|
13053
13053
|
// Types of actions
|
|
13054
|
-
var ActionType$
|
|
13054
|
+
var ActionType$2;
|
|
13055
13055
|
(function (ActionType) {
|
|
13056
13056
|
// Hide the "jump to bottom" button
|
|
13057
13057
|
ActionType["HideJumpToBottomButton"] = "HideJumpToBottomButton";
|
|
13058
13058
|
// Show the "jump to bottom" button
|
|
13059
13059
|
ActionType["ShowJumpToBottomButton"] = "ShowJumpToBottomButton";
|
|
13060
|
-
})(ActionType$
|
|
13060
|
+
})(ActionType$2 || (ActionType$2 = {}));
|
|
13061
13061
|
/**
|
|
13062
13062
|
* Reducer that executes actions
|
|
13063
13063
|
* @author Gabe Abrams
|
|
13064
13064
|
* @param state current state
|
|
13065
13065
|
* @param action action to execute
|
|
13066
13066
|
*/
|
|
13067
|
-
const reducer$
|
|
13067
|
+
const reducer$3 = (state, action) => {
|
|
13068
13068
|
switch (action.type) {
|
|
13069
|
-
case ActionType$
|
|
13069
|
+
case ActionType$2.HideJumpToBottomButton: {
|
|
13070
13070
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
|
|
13071
13071
|
}
|
|
13072
|
-
case ActionType$
|
|
13072
|
+
case ActionType$2.ShowJumpToBottomButton: {
|
|
13073
13073
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: true });
|
|
13074
13074
|
}
|
|
13075
13075
|
default: {
|
|
@@ -13093,7 +13093,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13093
13093
|
jumpToBottomButtonVisible: false,
|
|
13094
13094
|
};
|
|
13095
13095
|
// Initialize state
|
|
13096
|
-
const [state, dispatch] = useReducer(reducer$
|
|
13096
|
+
const [state, dispatch] = useReducer(reducer$3, initialState);
|
|
13097
13097
|
// Destructure common state
|
|
13098
13098
|
const { jumpToBottomButtonVisible, } = state;
|
|
13099
13099
|
/* -------------- Refs -------------- */
|
|
@@ -13139,7 +13139,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13139
13139
|
}
|
|
13140
13140
|
// Update state
|
|
13141
13141
|
dispatch({
|
|
13142
|
-
type: ActionType$
|
|
13142
|
+
type: ActionType$2.HideJumpToBottomButton,
|
|
13143
13143
|
});
|
|
13144
13144
|
// Scroll to bottom
|
|
13145
13145
|
container.current.scrollTop = (container.current.scrollHeight
|
|
@@ -13163,7 +13163,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13163
13163
|
if (isScrolledToBottom()) {
|
|
13164
13164
|
// Hide button
|
|
13165
13165
|
dispatch({
|
|
13166
|
-
type: ActionType$
|
|
13166
|
+
type: ActionType$2.HideJumpToBottomButton,
|
|
13167
13167
|
});
|
|
13168
13168
|
}
|
|
13169
13169
|
};
|
|
@@ -13205,7 +13205,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13205
13205
|
else {
|
|
13206
13206
|
// Not scrolled to bottom. Show "jump to bottom" button.
|
|
13207
13207
|
dispatch({
|
|
13208
|
-
type: ActionType$
|
|
13208
|
+
type: ActionType$2.ShowJumpToBottomButton,
|
|
13209
13209
|
});
|
|
13210
13210
|
}
|
|
13211
13211
|
}, [items]);
|
|
@@ -13275,25 +13275,25 @@ const combineClassNames = (classNames) => {
|
|
|
13275
13275
|
*/
|
|
13276
13276
|
/* ------------- Actions ------------ */
|
|
13277
13277
|
// Types of actions
|
|
13278
|
-
var ActionType;
|
|
13278
|
+
var ActionType$1;
|
|
13279
13279
|
(function (ActionType) {
|
|
13280
13280
|
// Start hovering on an option
|
|
13281
13281
|
ActionType["StartHover"] = "StartHover";
|
|
13282
13282
|
// Stop hovering on an option
|
|
13283
13283
|
ActionType["StopHover"] = "StopHover";
|
|
13284
|
-
})(ActionType || (ActionType = {}));
|
|
13284
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
13285
13285
|
/**
|
|
13286
13286
|
* Reducer that executes actions
|
|
13287
13287
|
* @author Gabe Abrams
|
|
13288
13288
|
* @param state current state
|
|
13289
13289
|
* @param action action to execute
|
|
13290
13290
|
*/
|
|
13291
|
-
const reducer$
|
|
13291
|
+
const reducer$2 = (state, action) => {
|
|
13292
13292
|
switch (action.type) {
|
|
13293
|
-
case ActionType.StartHover: {
|
|
13293
|
+
case ActionType$1.StartHover: {
|
|
13294
13294
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
|
|
13295
13295
|
}
|
|
13296
|
-
case ActionType.StopHover: {
|
|
13296
|
+
case ActionType$1.StopHover: {
|
|
13297
13297
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: undefined });
|
|
13298
13298
|
}
|
|
13299
13299
|
default: {
|
|
@@ -13317,7 +13317,7 @@ const MultiSwitch = (props) => {
|
|
|
13317
13317
|
hoveredOptionId: undefined,
|
|
13318
13318
|
};
|
|
13319
13319
|
// Initialize state
|
|
13320
|
-
const [state, dispatch] = useReducer(reducer$
|
|
13320
|
+
const [state, dispatch] = useReducer(reducer$2, initialState);
|
|
13321
13321
|
// Destructure common state
|
|
13322
13322
|
const { hoveredOptionId, } = state;
|
|
13323
13323
|
/*------------------------------------------------------------------------*/
|
|
@@ -13449,27 +13449,27 @@ const MultiSwitch = (props) => {
|
|
|
13449
13449
|
: `click to select option "${option.label}"`), onClick: () => {
|
|
13450
13450
|
// Remove hover
|
|
13451
13451
|
dispatch({
|
|
13452
|
-
type: ActionType.StopHover,
|
|
13452
|
+
type: ActionType$1.StopHover,
|
|
13453
13453
|
});
|
|
13454
13454
|
// Notify parent
|
|
13455
13455
|
onChange(option.id);
|
|
13456
13456
|
}, onMouseEnter: () => {
|
|
13457
13457
|
dispatch({
|
|
13458
|
-
type: ActionType.StartHover,
|
|
13458
|
+
type: ActionType$1.StartHover,
|
|
13459
13459
|
hoveredOptionId: option.id,
|
|
13460
13460
|
});
|
|
13461
13461
|
}, onMouseLeave: () => {
|
|
13462
13462
|
dispatch({
|
|
13463
|
-
type: ActionType.StopHover,
|
|
13463
|
+
type: ActionType$1.StopHover,
|
|
13464
13464
|
});
|
|
13465
13465
|
}, onFocus: () => {
|
|
13466
13466
|
dispatch({
|
|
13467
|
-
type: ActionType.StartHover,
|
|
13467
|
+
type: ActionType$1.StartHover,
|
|
13468
13468
|
hoveredOptionId: option.id,
|
|
13469
13469
|
});
|
|
13470
13470
|
}, onBlur: () => {
|
|
13471
13471
|
dispatch({
|
|
13472
|
-
type: ActionType.StopHover,
|
|
13472
|
+
type: ActionType$1.StopHover,
|
|
13473
13473
|
});
|
|
13474
13474
|
}, style: {
|
|
13475
13475
|
pointerEvents: ((option.id === selectedOptionId)
|
|
@@ -13488,6 +13488,147 @@ const MultiSwitch = (props) => {
|
|
|
13488
13488
|
React__default.createElement("div", { className: "MultiSwitch-highlight-container" }, highlight)));
|
|
13489
13489
|
};
|
|
13490
13490
|
|
|
13491
|
+
// Types of dropdown items
|
|
13492
|
+
var DropdownItemType;
|
|
13493
|
+
(function (DropdownItemType) {
|
|
13494
|
+
// Dropdown header
|
|
13495
|
+
DropdownItemType["Header"] = "Header";
|
|
13496
|
+
// Dropdown divider
|
|
13497
|
+
DropdownItemType["Divider"] = "Divider";
|
|
13498
|
+
// Dropdown item
|
|
13499
|
+
DropdownItemType["Item"] = "Item";
|
|
13500
|
+
})(DropdownItemType || (DropdownItemType = {}));
|
|
13501
|
+
var DropdownItemType$1 = DropdownItemType;
|
|
13502
|
+
|
|
13503
|
+
/**
|
|
13504
|
+
* A simple dropdown menu
|
|
13505
|
+
* @author Alessandra De Lucas
|
|
13506
|
+
* @author Yuen Ler Chow
|
|
13507
|
+
* @author Gabe Abrams
|
|
13508
|
+
*/
|
|
13509
|
+
/* ------------- Actions ------------ */
|
|
13510
|
+
// Types of actions
|
|
13511
|
+
var ActionType;
|
|
13512
|
+
(function (ActionType) {
|
|
13513
|
+
// Toggle opening the dropdown menu
|
|
13514
|
+
ActionType["ToggleDropdown"] = "ToggleDropdown";
|
|
13515
|
+
// Close the dropdown menu
|
|
13516
|
+
ActionType["CloseDropdown"] = "CloseDropdown";
|
|
13517
|
+
})(ActionType || (ActionType = {}));
|
|
13518
|
+
/**
|
|
13519
|
+
* Reducer that executes actions
|
|
13520
|
+
* @author Alessandra De Lucas
|
|
13521
|
+
* @author Yuen Ler Chow
|
|
13522
|
+
* @param state current state
|
|
13523
|
+
* @param action action to execute
|
|
13524
|
+
*/
|
|
13525
|
+
const reducer$1 = (state, action) => {
|
|
13526
|
+
switch (action.type) {
|
|
13527
|
+
case ActionType.ToggleDropdown: {
|
|
13528
|
+
return Object.assign(Object.assign({}, state), { isDropdownOpen: !state.isDropdownOpen });
|
|
13529
|
+
}
|
|
13530
|
+
case ActionType.CloseDropdown: {
|
|
13531
|
+
return Object.assign(Object.assign({}, state), { isDropdownOpen: false });
|
|
13532
|
+
}
|
|
13533
|
+
default: {
|
|
13534
|
+
return state;
|
|
13535
|
+
}
|
|
13536
|
+
}
|
|
13537
|
+
};
|
|
13538
|
+
/*------------------------------------------------------------------------*/
|
|
13539
|
+
/* ------------------------------ Component ----------------------------- */
|
|
13540
|
+
/*------------------------------------------------------------------------*/
|
|
13541
|
+
const Dropdown = (props) => {
|
|
13542
|
+
/*------------------------------------------------------------------------*/
|
|
13543
|
+
/* -------------------------------- Setup ------------------------------- */
|
|
13544
|
+
/*------------------------------------------------------------------------*/
|
|
13545
|
+
/* -------------- Props ------------- */
|
|
13546
|
+
// Destructure all props
|
|
13547
|
+
const { dropdownButton, items, } = props;
|
|
13548
|
+
/* -------------- State ------------- */
|
|
13549
|
+
// Initial state
|
|
13550
|
+
const initialState = {
|
|
13551
|
+
isDropdownOpen: false,
|
|
13552
|
+
};
|
|
13553
|
+
// Initialize state
|
|
13554
|
+
const [state, dispatch] = useReducer(reducer$1, initialState);
|
|
13555
|
+
// Destructure common state
|
|
13556
|
+
const { isDropdownOpen, } = state;
|
|
13557
|
+
/* -------------- Refs -------------- */
|
|
13558
|
+
// Initialize refs
|
|
13559
|
+
const dropdownRef = useRef(null);
|
|
13560
|
+
/*------------------------------------------------------------------------*/
|
|
13561
|
+
/* ------------------------- Component Functions ------------------------ */
|
|
13562
|
+
/*------------------------------------------------------------------------*/
|
|
13563
|
+
/**
|
|
13564
|
+
* Handle clicking outside of the dropdown menu to close it
|
|
13565
|
+
* @author Yuen Ler Chow
|
|
13566
|
+
* @param event the mouse event
|
|
13567
|
+
*/
|
|
13568
|
+
const handleClickOutside = (event) => {
|
|
13569
|
+
if (
|
|
13570
|
+
// Dropdown has been rendered
|
|
13571
|
+
dropdownRef.current
|
|
13572
|
+
// Click occurred outside the dropdown
|
|
13573
|
+
&& !dropdownRef.current.contains(event.target)) {
|
|
13574
|
+
dispatch({ type: ActionType.CloseDropdown });
|
|
13575
|
+
}
|
|
13576
|
+
};
|
|
13577
|
+
/*------------------------------------------------------------------------*/
|
|
13578
|
+
/* ------------------------- Lifecycle Functions ------------------------ */
|
|
13579
|
+
/*------------------------------------------------------------------------*/
|
|
13580
|
+
/**
|
|
13581
|
+
* Mount
|
|
13582
|
+
* @author Yuen Ler Chow
|
|
13583
|
+
*/
|
|
13584
|
+
useEffect(() => {
|
|
13585
|
+
// Add event listener to close dropdown when clicking outside
|
|
13586
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
13587
|
+
// Cleanup
|
|
13588
|
+
return () => {
|
|
13589
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
13590
|
+
};
|
|
13591
|
+
}, []);
|
|
13592
|
+
/*----------------------------------------*/
|
|
13593
|
+
/* --------------- Main UI -------------- */
|
|
13594
|
+
/*----------------------------------------*/
|
|
13595
|
+
return (React__default.createElement("div", { className: "dropdown", ref: dropdownRef, "data-bs-theme": isDarkModeOn() ? 'dark' : undefined },
|
|
13596
|
+
React__default.createElement("button", { className: combineClassNames([
|
|
13597
|
+
'btn dropdown-toggle border',
|
|
13598
|
+
isDropdownOpen && 'show',
|
|
13599
|
+
`btn-${dropdownButton.variant}`,
|
|
13600
|
+
dropdownButton.variant === Variant$1.Light && 'text-dark',
|
|
13601
|
+
]), type: "button", id: dropdownButton.id, "aria-expanded": isDropdownOpen, "aria-label": dropdownButton.ariaLabel, onClick: () => {
|
|
13602
|
+
dispatch({
|
|
13603
|
+
type: ActionType.ToggleDropdown,
|
|
13604
|
+
});
|
|
13605
|
+
} }, dropdownButton.content),
|
|
13606
|
+
React__default.createElement("ul", { className: combineClassNames([
|
|
13607
|
+
'dropdown-menu',
|
|
13608
|
+
isDarkModeOn() && 'dropdown-menu-dark',
|
|
13609
|
+
isDropdownOpen && 'show',
|
|
13610
|
+
]) }, Object.values(items).map((item) => {
|
|
13611
|
+
if (item.type === DropdownItemType$1.Header) {
|
|
13612
|
+
return (
|
|
13613
|
+
// TODO: Implement header
|
|
13614
|
+
React__default.createElement("span", null));
|
|
13615
|
+
}
|
|
13616
|
+
if (item.type === DropdownItemType$1.Divider) {
|
|
13617
|
+
return (
|
|
13618
|
+
// TODO: Implement divider
|
|
13619
|
+
React__default.createElement("span", null));
|
|
13620
|
+
}
|
|
13621
|
+
return (React__default.createElement("li", { key: item.id },
|
|
13622
|
+
React__default.createElement("button", { type: "button", "aria-label": item.ariaLabel, className: "dropdown-item", onClick: (e) => {
|
|
13623
|
+
e.preventDefault();
|
|
13624
|
+
dispatch({
|
|
13625
|
+
type: ActionType.CloseDropdown,
|
|
13626
|
+
});
|
|
13627
|
+
item.onClick();
|
|
13628
|
+
} }, item.content)));
|
|
13629
|
+
}))));
|
|
13630
|
+
};
|
|
13631
|
+
|
|
13491
13632
|
/**
|
|
13492
13633
|
* One minute in ms
|
|
13493
13634
|
* @author Gabe Abrams
|
|
@@ -15813,5 +15954,5 @@ var DayOfWeek;
|
|
|
15813
15954
|
})(DayOfWeek || (DayOfWeek = {}));
|
|
15814
15955
|
var DayOfWeek$1 = DayOfWeek;
|
|
15815
15956
|
|
|
15816
|
-
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
|
15957
|
+
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, Dropdown, DropdownItemType$1 as DropdownItemType, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, capitalize, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, everyAsync, extractProp, filterAsync, floorToNumDecimals, forEachAsync, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, mapAsync, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, setClientEventMetadataPopulator, showFatalError, shuffleArray, someAsync, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
|
15817
15958
|
//# sourceMappingURL=index.js.map
|