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/cjs/index.js
CHANGED
|
@@ -2237,27 +2237,27 @@ const PopPendingMark = (props) => {
|
|
|
2237
2237
|
*/
|
|
2238
2238
|
/* ------------- Actions ------------ */
|
|
2239
2239
|
// Types of actions
|
|
2240
|
-
var ActionType$
|
|
2240
|
+
var ActionType$9;
|
|
2241
2241
|
(function (ActionType) {
|
|
2242
2242
|
// Indicate that the text was recently copied
|
|
2243
2243
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
2244
2244
|
// Clear the status
|
|
2245
2245
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
2246
|
-
})(ActionType$
|
|
2246
|
+
})(ActionType$9 || (ActionType$9 = {}));
|
|
2247
2247
|
/**
|
|
2248
2248
|
* Reducer that executes actions
|
|
2249
2249
|
* @author Gabe Abrams
|
|
2250
2250
|
* @param state current state
|
|
2251
2251
|
* @param action action to execute
|
|
2252
2252
|
*/
|
|
2253
|
-
const reducer$
|
|
2253
|
+
const reducer$a = (state, action) => {
|
|
2254
2254
|
switch (action.type) {
|
|
2255
|
-
case ActionType$
|
|
2255
|
+
case ActionType$9.IndicateRecentlyCopied: {
|
|
2256
2256
|
return {
|
|
2257
2257
|
recentlyCopied: true,
|
|
2258
2258
|
};
|
|
2259
2259
|
}
|
|
2260
|
-
case ActionType$
|
|
2260
|
+
case ActionType$9.ClearRecentlyCopiedStatus: {
|
|
2261
2261
|
return {
|
|
2262
2262
|
recentlyCopied: false,
|
|
2263
2263
|
};
|
|
@@ -2283,7 +2283,7 @@ const CopiableBox = (props) => {
|
|
|
2283
2283
|
recentlyCopied: false,
|
|
2284
2284
|
};
|
|
2285
2285
|
// Initialize state
|
|
2286
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2286
|
+
const [state, dispatch] = React.useReducer(reducer$a, initialState);
|
|
2287
2287
|
// Destructure common state
|
|
2288
2288
|
const { recentlyCopied, } = state;
|
|
2289
2289
|
/*------------------------------------------------------------------------*/
|
|
@@ -2303,13 +2303,13 @@ const CopiableBox = (props) => {
|
|
|
2303
2303
|
}
|
|
2304
2304
|
// Show copied notice
|
|
2305
2305
|
dispatch({
|
|
2306
|
-
type: ActionType$
|
|
2306
|
+
type: ActionType$9.IndicateRecentlyCopied,
|
|
2307
2307
|
});
|
|
2308
2308
|
// Wait a moment
|
|
2309
2309
|
yield waitMs(4000);
|
|
2310
2310
|
// Hide copied notice
|
|
2311
2311
|
dispatch({
|
|
2312
|
-
type: ActionType$
|
|
2312
|
+
type: ActionType$9.ClearRecentlyCopiedStatus,
|
|
2313
2313
|
});
|
|
2314
2314
|
});
|
|
2315
2315
|
/*------------------------------------------------------------------------*/
|
|
@@ -2365,20 +2365,20 @@ const CopiableBox = (props) => {
|
|
|
2365
2365
|
*/
|
|
2366
2366
|
/* ------------- Actions ------------ */
|
|
2367
2367
|
// Types of actions
|
|
2368
|
-
var ActionType$
|
|
2368
|
+
var ActionType$8;
|
|
2369
2369
|
(function (ActionType) {
|
|
2370
2370
|
// Toggle whether a child are being shown
|
|
2371
2371
|
ActionType["ToggleChild"] = "toggle-child";
|
|
2372
|
-
})(ActionType$
|
|
2372
|
+
})(ActionType$8 || (ActionType$8 = {}));
|
|
2373
2373
|
/**
|
|
2374
2374
|
* Reducer that executes actions
|
|
2375
2375
|
* @author Gabe Abrams
|
|
2376
2376
|
* @param state current state
|
|
2377
2377
|
* @param action action to execute
|
|
2378
2378
|
*/
|
|
2379
|
-
const reducer$
|
|
2379
|
+
const reducer$9 = (state, action) => {
|
|
2380
2380
|
switch (action.type) {
|
|
2381
|
-
case ActionType$
|
|
2381
|
+
case ActionType$8.ToggleChild: {
|
|
2382
2382
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
2383
2383
|
}
|
|
2384
2384
|
default: {
|
|
@@ -2407,7 +2407,7 @@ const NestableItemList = (props) => {
|
|
|
2407
2407
|
childExpanded: initChildExpanded,
|
|
2408
2408
|
};
|
|
2409
2409
|
// Initialize state
|
|
2410
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2410
|
+
const [state, dispatch] = React.useReducer(reducer$9, initialState);
|
|
2411
2411
|
// Destructure common state
|
|
2412
2412
|
const { childExpanded, } = state;
|
|
2413
2413
|
/*------------------------------------------------------------------------*/
|
|
@@ -2497,7 +2497,7 @@ const NestableItemList = (props) => {
|
|
|
2497
2497
|
backgroundColor: 'transparent',
|
|
2498
2498
|
}, type: "button", onClick: () => {
|
|
2499
2499
|
dispatch({
|
|
2500
|
-
type: ActionType$
|
|
2500
|
+
type: ActionType$8.ToggleChild,
|
|
2501
2501
|
id: item.id,
|
|
2502
2502
|
});
|
|
2503
2503
|
}, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
@@ -2781,7 +2781,7 @@ var SortType;
|
|
|
2781
2781
|
})(SortType || (SortType = {}));
|
|
2782
2782
|
/* ------------- Actions ------------ */
|
|
2783
2783
|
// Types of actions
|
|
2784
|
-
var ActionType$
|
|
2784
|
+
var ActionType$7;
|
|
2785
2785
|
(function (ActionType) {
|
|
2786
2786
|
// Toggle sort column param
|
|
2787
2787
|
ActionType["ToggleSortColumn"] = "toggle-sort-column";
|
|
@@ -2793,16 +2793,16 @@ var ActionType$6;
|
|
|
2793
2793
|
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2794
2794
|
// Hide all columns
|
|
2795
2795
|
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2796
|
-
})(ActionType$
|
|
2796
|
+
})(ActionType$7 || (ActionType$7 = {}));
|
|
2797
2797
|
/**
|
|
2798
2798
|
* Reducer that executes actions
|
|
2799
2799
|
* @author Gabe Abrams
|
|
2800
2800
|
* @param state current state
|
|
2801
2801
|
* @param action action to execute
|
|
2802
2802
|
*/
|
|
2803
|
-
const reducer$
|
|
2803
|
+
const reducer$8 = (state, action) => {
|
|
2804
2804
|
switch (action.type) {
|
|
2805
|
-
case ActionType$
|
|
2805
|
+
case ActionType$7.ToggleSortColumn: {
|
|
2806
2806
|
if (action.param !== state.sortColumnParam) {
|
|
2807
2807
|
// Different column param
|
|
2808
2808
|
return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
|
|
@@ -2814,22 +2814,22 @@ const reducer$7 = (state, action) => {
|
|
|
2814
2814
|
// Stop sorting by column
|
|
2815
2815
|
return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
|
|
2816
2816
|
}
|
|
2817
|
-
case ActionType$
|
|
2817
|
+
case ActionType$7.UpdateColumnVisibility: {
|
|
2818
2818
|
const { columnVisibilityMap } = state;
|
|
2819
2819
|
columnVisibilityMap[action.param] = action.visible;
|
|
2820
2820
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2821
2821
|
}
|
|
2822
|
-
case ActionType$
|
|
2822
|
+
case ActionType$7.ToggleColVisCusModalVisibility: {
|
|
2823
2823
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2824
2824
|
}
|
|
2825
|
-
case ActionType$
|
|
2825
|
+
case ActionType$7.ShowAllColumns: {
|
|
2826
2826
|
const { columnVisibilityMap } = state;
|
|
2827
2827
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2828
2828
|
columnVisibilityMap[param] = true;
|
|
2829
2829
|
});
|
|
2830
2830
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2831
2831
|
}
|
|
2832
|
-
case ActionType$
|
|
2832
|
+
case ActionType$7.HideAllColumns: {
|
|
2833
2833
|
const { columnVisibilityMap } = state;
|
|
2834
2834
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2835
2835
|
columnVisibilityMap[param] = false;
|
|
@@ -2876,7 +2876,7 @@ const IntelliTable = (props) => {
|
|
|
2876
2876
|
columnVisibilityCustomizationModalVisible: false,
|
|
2877
2877
|
};
|
|
2878
2878
|
// Initialize state
|
|
2879
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2879
|
+
const [state, dispatch] = React.useReducer(reducer$8, initialState);
|
|
2880
2880
|
// Destructure common state
|
|
2881
2881
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
2882
2882
|
/*------------------------------------------------------------------------*/
|
|
@@ -2899,13 +2899,13 @@ const IntelliTable = (props) => {
|
|
|
2899
2899
|
return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
2900
2900
|
}
|
|
2901
2901
|
dispatch({
|
|
2902
|
-
type: ActionType$
|
|
2902
|
+
type: ActionType$7.ToggleColVisCusModalVisibility,
|
|
2903
2903
|
});
|
|
2904
2904
|
}, okayVariant: Variant$1.Light },
|
|
2905
2905
|
columns.map((column) => {
|
|
2906
2906
|
return (React__default["default"].createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
2907
2907
|
dispatch({
|
|
2908
|
-
type: ActionType$
|
|
2908
|
+
type: ActionType$7.UpdateColumnVisibility,
|
|
2909
2909
|
param: column.param,
|
|
2910
2910
|
visible: checked,
|
|
2911
2911
|
});
|
|
@@ -2914,12 +2914,12 @@ const IntelliTable = (props) => {
|
|
|
2914
2914
|
React__default["default"].createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
2915
2915
|
React__default["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: () => {
|
|
2916
2916
|
dispatch({
|
|
2917
|
-
type: ActionType$
|
|
2917
|
+
type: ActionType$7.ShowAllColumns,
|
|
2918
2918
|
});
|
|
2919
2919
|
} }, "Select All"),
|
|
2920
2920
|
React__default["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: () => {
|
|
2921
2921
|
dispatch({
|
|
2922
|
-
type: ActionType$
|
|
2922
|
+
type: ActionType$7.HideAllColumns,
|
|
2923
2923
|
});
|
|
2924
2924
|
} }, "Deselect All")));
|
|
2925
2925
|
}
|
|
@@ -2970,7 +2970,7 @@ const IntelliTable = (props) => {
|
|
|
2970
2970
|
React__default["default"].createElement("div", null,
|
|
2971
2971
|
React__default["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: () => {
|
|
2972
2972
|
dispatch({
|
|
2973
|
-
type: ActionType$
|
|
2973
|
+
type: ActionType$7.ToggleSortColumn,
|
|
2974
2974
|
param: column.param,
|
|
2975
2975
|
});
|
|
2976
2976
|
} },
|
|
@@ -3159,7 +3159,7 @@ const IntelliTable = (props) => {
|
|
|
3159
3159
|
React__default["default"].createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
|
|
3160
3160
|
React__default["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: () => {
|
|
3161
3161
|
dispatch({
|
|
3162
|
-
type: ActionType$
|
|
3162
|
+
type: ActionType$7.ToggleColVisCusModalVisibility,
|
|
3163
3163
|
});
|
|
3164
3164
|
} },
|
|
3165
3165
|
"Show/Hide Cols",
|
|
@@ -3525,7 +3525,7 @@ const genHumanReadableName = (machineReadableName) => {
|
|
|
3525
3525
|
};
|
|
3526
3526
|
/* ------------- Actions ------------ */
|
|
3527
3527
|
// Types of actions
|
|
3528
|
-
var ActionType$
|
|
3528
|
+
var ActionType$6;
|
|
3529
3529
|
(function (ActionType) {
|
|
3530
3530
|
// Show the loading bar
|
|
3531
3531
|
ActionType["StartLoading"] = "start-loading";
|
|
@@ -3547,45 +3547,45 @@ var ActionType$5;
|
|
|
3547
3547
|
ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
|
|
3548
3548
|
// Update the advanced filter state
|
|
3549
3549
|
ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
|
|
3550
|
-
})(ActionType$
|
|
3550
|
+
})(ActionType$6 || (ActionType$6 = {}));
|
|
3551
3551
|
/**
|
|
3552
3552
|
* Reducer that executes actions
|
|
3553
3553
|
* @author Gabe Abrams
|
|
3554
3554
|
* @param state current state
|
|
3555
3555
|
* @param action action to execute
|
|
3556
3556
|
*/
|
|
3557
|
-
const reducer$
|
|
3557
|
+
const reducer$7 = (state, action) => {
|
|
3558
3558
|
switch (action.type) {
|
|
3559
|
-
case ActionType$
|
|
3559
|
+
case ActionType$6.StartLoading: {
|
|
3560
3560
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
3561
3561
|
}
|
|
3562
|
-
case ActionType$
|
|
3562
|
+
case ActionType$6.FinishLoading: {
|
|
3563
3563
|
return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
|
|
3564
3564
|
}
|
|
3565
|
-
case ActionType$
|
|
3565
|
+
case ActionType$6.ToggleFilterDrawer: {
|
|
3566
3566
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
|
|
3567
3567
|
? undefined // hide
|
|
3568
3568
|
: action.filterDrawer) });
|
|
3569
3569
|
}
|
|
3570
|
-
case ActionType$
|
|
3570
|
+
case ActionType$6.HideFilterDrawer: {
|
|
3571
3571
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3572
3572
|
}
|
|
3573
|
-
case ActionType$
|
|
3573
|
+
case ActionType$6.ResetFilters: {
|
|
3574
3574
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
|
|
3575
3575
|
}
|
|
3576
|
-
case ActionType$
|
|
3576
|
+
case ActionType$6.UpdateDateFilterState: {
|
|
3577
3577
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
|
|
3578
3578
|
}
|
|
3579
|
-
case ActionType$
|
|
3579
|
+
case ActionType$6.UpdateContextFilterState: {
|
|
3580
3580
|
return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
|
|
3581
3581
|
}
|
|
3582
|
-
case ActionType$
|
|
3582
|
+
case ActionType$6.UpdateTagFilterState: {
|
|
3583
3583
|
return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
|
|
3584
3584
|
}
|
|
3585
|
-
case ActionType$
|
|
3585
|
+
case ActionType$6.UpdateActionErrorFilterState: {
|
|
3586
3586
|
return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
|
|
3587
3587
|
}
|
|
3588
|
-
case ActionType$
|
|
3588
|
+
case ActionType$6.UpdateAdvancedFilterState: {
|
|
3589
3589
|
return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
|
|
3590
3590
|
}
|
|
3591
3591
|
default: {
|
|
@@ -3714,7 +3714,7 @@ const LogReviewer = (props) => {
|
|
|
3714
3714
|
advancedFilterState: initAdvancedFilterState,
|
|
3715
3715
|
};
|
|
3716
3716
|
// Initialize state
|
|
3717
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
3717
|
+
const [state, dispatch] = React.useReducer(reducer$7, initialState);
|
|
3718
3718
|
// Destructure common state
|
|
3719
3719
|
const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
|
|
3720
3720
|
/*------------------------------------------------------------------------*/
|
|
@@ -3764,7 +3764,7 @@ const LogReviewer = (props) => {
|
|
|
3764
3764
|
const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3765
3765
|
// Update state
|
|
3766
3766
|
dispatch({
|
|
3767
|
-
type: ActionType$
|
|
3767
|
+
type: ActionType$6.UpdateDateFilterState,
|
|
3768
3768
|
dateFilterState: newDateFilterState,
|
|
3769
3769
|
});
|
|
3770
3770
|
// Check which year/month combos we need to load
|
|
@@ -3775,7 +3775,7 @@ const LogReviewer = (props) => {
|
|
|
3775
3775
|
}
|
|
3776
3776
|
// Start loading
|
|
3777
3777
|
dispatch({
|
|
3778
|
-
type: ActionType$
|
|
3778
|
+
type: ActionType$6.StartLoading,
|
|
3779
3779
|
});
|
|
3780
3780
|
// Load required months
|
|
3781
3781
|
try {
|
|
@@ -3799,7 +3799,7 @@ const LogReviewer = (props) => {
|
|
|
3799
3799
|
}
|
|
3800
3800
|
// Finish loading
|
|
3801
3801
|
dispatch({
|
|
3802
|
-
type: ActionType$
|
|
3802
|
+
type: ActionType$6.FinishLoading,
|
|
3803
3803
|
logMap,
|
|
3804
3804
|
});
|
|
3805
3805
|
});
|
|
@@ -3838,7 +3838,7 @@ const LogReviewer = (props) => {
|
|
|
3838
3838
|
React__default["default"].createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
3839
3839
|
React__default["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: () => {
|
|
3840
3840
|
dispatch({
|
|
3841
|
-
type: ActionType$
|
|
3841
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3842
3842
|
filterDrawer: FilterDrawer.Date,
|
|
3843
3843
|
});
|
|
3844
3844
|
} },
|
|
@@ -3846,7 +3846,7 @@ const LogReviewer = (props) => {
|
|
|
3846
3846
|
"Date"),
|
|
3847
3847
|
React__default["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: () => {
|
|
3848
3848
|
dispatch({
|
|
3849
|
-
type: ActionType$
|
|
3849
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3850
3850
|
filterDrawer: FilterDrawer.Context,
|
|
3851
3851
|
});
|
|
3852
3852
|
} },
|
|
@@ -3854,7 +3854,7 @@ const LogReviewer = (props) => {
|
|
|
3854
3854
|
"Context"),
|
|
3855
3855
|
(LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React__default["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: () => {
|
|
3856
3856
|
dispatch({
|
|
3857
|
-
type: ActionType$
|
|
3857
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3858
3858
|
filterDrawer: FilterDrawer.Tag,
|
|
3859
3859
|
});
|
|
3860
3860
|
} },
|
|
@@ -3862,7 +3862,7 @@ const LogReviewer = (props) => {
|
|
|
3862
3862
|
"Tag")),
|
|
3863
3863
|
React__default["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: () => {
|
|
3864
3864
|
dispatch({
|
|
3865
|
-
type: ActionType$
|
|
3865
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3866
3866
|
filterDrawer: FilterDrawer.Action,
|
|
3867
3867
|
});
|
|
3868
3868
|
} },
|
|
@@ -3870,7 +3870,7 @@ const LogReviewer = (props) => {
|
|
|
3870
3870
|
"Action"),
|
|
3871
3871
|
React__default["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: () => {
|
|
3872
3872
|
dispatch({
|
|
3873
|
-
type: ActionType$
|
|
3873
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3874
3874
|
filterDrawer: FilterDrawer.Advanced,
|
|
3875
3875
|
});
|
|
3876
3876
|
} },
|
|
@@ -3878,7 +3878,7 @@ const LogReviewer = (props) => {
|
|
|
3878
3878
|
"Advanced"),
|
|
3879
3879
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
|
|
3880
3880
|
dispatch({
|
|
3881
|
-
type: ActionType$
|
|
3881
|
+
type: ActionType$6.ResetFilters,
|
|
3882
3882
|
initActionErrorFilterState,
|
|
3883
3883
|
initAdvancedFilterState,
|
|
3884
3884
|
initContextFilterState,
|
|
@@ -4000,7 +4000,7 @@ const LogReviewer = (props) => {
|
|
|
4000
4000
|
}
|
|
4001
4001
|
});
|
|
4002
4002
|
dispatch({
|
|
4003
|
-
type: ActionType$
|
|
4003
|
+
type: ActionType$6.UpdateContextFilterState,
|
|
4004
4004
|
contextFilterState,
|
|
4005
4005
|
});
|
|
4006
4006
|
} }));
|
|
@@ -4015,7 +4015,7 @@ const LogReviewer = (props) => {
|
|
|
4015
4015
|
return (React__default["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) => {
|
|
4016
4016
|
tagFilterState[tag] = checked;
|
|
4017
4017
|
dispatch({
|
|
4018
|
-
type: ActionType$
|
|
4018
|
+
type: ActionType$6.UpdateTagFilterState,
|
|
4019
4019
|
tagFilterState,
|
|
4020
4020
|
});
|
|
4021
4021
|
} }));
|
|
@@ -4028,21 +4028,21 @@ const LogReviewer = (props) => {
|
|
|
4028
4028
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
4029
4029
|
actionErrorFilterState.type = undefined;
|
|
4030
4030
|
dispatch({
|
|
4031
|
-
type: ActionType$
|
|
4031
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4032
4032
|
actionErrorFilterState,
|
|
4033
4033
|
});
|
|
4034
4034
|
}, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
|
|
4035
4035
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
4036
4036
|
actionErrorFilterState.type = LogType$1.Action;
|
|
4037
4037
|
dispatch({
|
|
4038
|
-
type: ActionType$
|
|
4038
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4039
4039
|
actionErrorFilterState,
|
|
4040
4040
|
});
|
|
4041
4041
|
}, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
|
|
4042
4042
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
4043
4043
|
actionErrorFilterState.type = LogType$1.Error;
|
|
4044
4044
|
dispatch({
|
|
4045
|
-
type: ActionType$
|
|
4045
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4046
4046
|
actionErrorFilterState,
|
|
4047
4047
|
});
|
|
4048
4048
|
}, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
|
|
@@ -4054,7 +4054,7 @@ const LogReviewer = (props) => {
|
|
|
4054
4054
|
return (React__default["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) => {
|
|
4055
4055
|
actionErrorFilterState.action[action] = checked;
|
|
4056
4056
|
dispatch({
|
|
4057
|
-
type: ActionType$
|
|
4057
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4058
4058
|
actionErrorFilterState,
|
|
4059
4059
|
});
|
|
4060
4060
|
} }));
|
|
@@ -4065,7 +4065,7 @@ const LogReviewer = (props) => {
|
|
|
4065
4065
|
return (React__default["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) => {
|
|
4066
4066
|
actionErrorFilterState.target[target] = checked;
|
|
4067
4067
|
dispatch({
|
|
4068
|
-
type: ActionType$
|
|
4068
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4069
4069
|
actionErrorFilterState,
|
|
4070
4070
|
});
|
|
4071
4071
|
} }));
|
|
@@ -4077,7 +4077,7 @@ const LogReviewer = (props) => {
|
|
|
4077
4077
|
React__default["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) => {
|
|
4078
4078
|
actionErrorFilterState.errorMessage = e.target.value;
|
|
4079
4079
|
dispatch({
|
|
4080
|
-
type: ActionType$
|
|
4080
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4081
4081
|
actionErrorFilterState,
|
|
4082
4082
|
});
|
|
4083
4083
|
} })),
|
|
@@ -4088,7 +4088,7 @@ const LogReviewer = (props) => {
|
|
|
4088
4088
|
.trim()
|
|
4089
4089
|
.toUpperCase());
|
|
4090
4090
|
dispatch({
|
|
4091
|
-
type: ActionType$
|
|
4091
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
4092
4092
|
actionErrorFilterState,
|
|
4093
4093
|
});
|
|
4094
4094
|
} }))))));
|
|
@@ -4102,7 +4102,7 @@ const LogReviewer = (props) => {
|
|
|
4102
4102
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: advancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
|
|
4103
4103
|
advancedFilterState.userFirstName = e.target.value;
|
|
4104
4104
|
dispatch({
|
|
4105
|
-
type: ActionType$
|
|
4105
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4106
4106
|
advancedFilterState,
|
|
4107
4107
|
});
|
|
4108
4108
|
} })),
|
|
@@ -4111,7 +4111,7 @@ const LogReviewer = (props) => {
|
|
|
4111
4111
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: advancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
|
|
4112
4112
|
advancedFilterState.userLastName = e.target.value;
|
|
4113
4113
|
dispatch({
|
|
4114
|
-
type: ActionType$
|
|
4114
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4115
4115
|
advancedFilterState,
|
|
4116
4116
|
});
|
|
4117
4117
|
} })),
|
|
@@ -4121,7 +4121,7 @@ const LogReviewer = (props) => {
|
|
|
4121
4121
|
advancedFilterState.userEmail = ((e.target.value)
|
|
4122
4122
|
.trim());
|
|
4123
4123
|
dispatch({
|
|
4124
|
-
type: ActionType$
|
|
4124
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4125
4125
|
advancedFilterState,
|
|
4126
4126
|
});
|
|
4127
4127
|
} })),
|
|
@@ -4135,7 +4135,7 @@ const LogReviewer = (props) => {
|
|
|
4135
4135
|
.trim());
|
|
4136
4136
|
}
|
|
4137
4137
|
dispatch({
|
|
4138
|
-
type: ActionType$
|
|
4138
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4139
4139
|
advancedFilterState,
|
|
4140
4140
|
});
|
|
4141
4141
|
} })),
|
|
@@ -4143,21 +4143,21 @@ const LogReviewer = (props) => {
|
|
|
4143
4143
|
React__default["default"].createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
4144
4144
|
advancedFilterState.includeLearners = checked;
|
|
4145
4145
|
dispatch({
|
|
4146
|
-
type: ActionType$
|
|
4146
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4147
4147
|
advancedFilterState,
|
|
4148
4148
|
});
|
|
4149
4149
|
}, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
|
|
4150
4150
|
React__default["default"].createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
4151
4151
|
advancedFilterState.includeTTMs = checked;
|
|
4152
4152
|
dispatch({
|
|
4153
|
-
type: ActionType$
|
|
4153
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4154
4154
|
advancedFilterState,
|
|
4155
4155
|
});
|
|
4156
4156
|
}, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
|
|
4157
4157
|
React__default["default"].createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
4158
4158
|
advancedFilterState.includeAdmins = checked;
|
|
4159
4159
|
dispatch({
|
|
4160
|
-
type: ActionType$
|
|
4160
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4161
4161
|
advancedFilterState,
|
|
4162
4162
|
});
|
|
4163
4163
|
}, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
|
|
@@ -4167,7 +4167,7 @@ const LogReviewer = (props) => {
|
|
|
4167
4167
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: advancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
|
|
4168
4168
|
advancedFilterState.courseName = e.target.value;
|
|
4169
4169
|
dispatch({
|
|
4170
|
-
type: ActionType$
|
|
4170
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4171
4171
|
advancedFilterState,
|
|
4172
4172
|
});
|
|
4173
4173
|
} })),
|
|
@@ -4181,7 +4181,7 @@ const LogReviewer = (props) => {
|
|
|
4181
4181
|
.trim());
|
|
4182
4182
|
}
|
|
4183
4183
|
dispatch({
|
|
4184
|
-
type: ActionType$
|
|
4184
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4185
4185
|
advancedFilterState,
|
|
4186
4186
|
});
|
|
4187
4187
|
} }))),
|
|
@@ -4190,21 +4190,21 @@ const LogReviewer = (props) => {
|
|
|
4190
4190
|
React__default["default"].createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
|
|
4191
4191
|
advancedFilterState.isMobile = undefined;
|
|
4192
4192
|
dispatch({
|
|
4193
|
-
type: ActionType$
|
|
4193
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4194
4194
|
advancedFilterState,
|
|
4195
4195
|
});
|
|
4196
4196
|
} }),
|
|
4197
4197
|
React__default["default"].createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
|
|
4198
4198
|
advancedFilterState.isMobile = true;
|
|
4199
4199
|
dispatch({
|
|
4200
|
-
type: ActionType$
|
|
4200
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4201
4201
|
advancedFilterState,
|
|
4202
4202
|
});
|
|
4203
4203
|
} }),
|
|
4204
4204
|
React__default["default"].createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
|
|
4205
4205
|
advancedFilterState.isMobile = false;
|
|
4206
4206
|
dispatch({
|
|
4207
|
-
type: ActionType$
|
|
4207
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4208
4208
|
advancedFilterState,
|
|
4209
4209
|
});
|
|
4210
4210
|
}, noMarginOnRight: true }))),
|
|
@@ -4213,21 +4213,21 @@ const LogReviewer = (props) => {
|
|
|
4213
4213
|
React__default["default"].createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
|
|
4214
4214
|
advancedFilterState.source = undefined;
|
|
4215
4215
|
dispatch({
|
|
4216
|
-
type: ActionType$
|
|
4216
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4217
4217
|
advancedFilterState,
|
|
4218
4218
|
});
|
|
4219
4219
|
} }),
|
|
4220
4220
|
React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
|
|
4221
4221
|
advancedFilterState.source = LogSource$1.Client;
|
|
4222
4222
|
dispatch({
|
|
4223
|
-
type: ActionType$
|
|
4223
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4224
4224
|
advancedFilterState,
|
|
4225
4225
|
});
|
|
4226
4226
|
} }),
|
|
4227
4227
|
React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
|
|
4228
4228
|
advancedFilterState.source = LogSource$1.Server;
|
|
4229
4229
|
dispatch({
|
|
4230
|
-
type: ActionType$
|
|
4230
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4231
4231
|
advancedFilterState,
|
|
4232
4232
|
});
|
|
4233
4233
|
}, noMarginOnRight: true })),
|
|
@@ -4238,7 +4238,7 @@ const LogReviewer = (props) => {
|
|
|
4238
4238
|
advancedFilterState.courseName = ((e.target.value)
|
|
4239
4239
|
.trim());
|
|
4240
4240
|
dispatch({
|
|
4241
|
-
type: ActionType$
|
|
4241
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4242
4242
|
advancedFilterState,
|
|
4243
4243
|
});
|
|
4244
4244
|
} })),
|
|
@@ -4248,7 +4248,7 @@ const LogReviewer = (props) => {
|
|
|
4248
4248
|
advancedFilterState.courseName = ((e.target.value)
|
|
4249
4249
|
.trim());
|
|
4250
4250
|
dispatch({
|
|
4251
|
-
type: ActionType$
|
|
4251
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4252
4252
|
advancedFilterState,
|
|
4253
4253
|
});
|
|
4254
4254
|
} })))))));
|
|
@@ -12068,11 +12068,11 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
12068
12068
|
*/
|
|
12069
12069
|
/* ------------- Actions ------------ */
|
|
12070
12070
|
// Types of actions
|
|
12071
|
-
var ActionType$
|
|
12071
|
+
var ActionType$5;
|
|
12072
12072
|
(function (ActionType) {
|
|
12073
12073
|
// Update the input value
|
|
12074
12074
|
ActionType["SetInputValue"] = "SetInputValue";
|
|
12075
|
-
})(ActionType$
|
|
12075
|
+
})(ActionType$5 || (ActionType$5 = {}));
|
|
12076
12076
|
/**
|
|
12077
12077
|
* Reducer that executes actions
|
|
12078
12078
|
* @author Yuen Ler Chow
|
|
@@ -12080,9 +12080,9 @@ var ActionType$4;
|
|
|
12080
12080
|
* @param action action to execute
|
|
12081
12081
|
* @returns updated state
|
|
12082
12082
|
*/
|
|
12083
|
-
const reducer$
|
|
12083
|
+
const reducer$6 = (state, action) => {
|
|
12084
12084
|
switch (action.type) {
|
|
12085
|
-
case ActionType$
|
|
12085
|
+
case ActionType$5.SetInputValue: {
|
|
12086
12086
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
12087
12087
|
}
|
|
12088
12088
|
default: {
|
|
@@ -12102,7 +12102,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12102
12102
|
inputValue: '',
|
|
12103
12103
|
};
|
|
12104
12104
|
// Initialize state
|
|
12105
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12105
|
+
const [state, dispatch] = React.useReducer(reducer$6, initialState);
|
|
12106
12106
|
// Destructure common state
|
|
12107
12107
|
const { inputValue } = state;
|
|
12108
12108
|
/*------------------------------------------------------------------------*/
|
|
@@ -12179,7 +12179,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12179
12179
|
}
|
|
12180
12180
|
// Reset text field to empty because the values have been added
|
|
12181
12181
|
dispatch({
|
|
12182
|
-
type: ActionType$
|
|
12182
|
+
type: ActionType$5.SetInputValue,
|
|
12183
12183
|
value: '',
|
|
12184
12184
|
});
|
|
12185
12185
|
};
|
|
@@ -12218,7 +12218,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12218
12218
|
else {
|
|
12219
12219
|
// simply update the input value to the new input value
|
|
12220
12220
|
dispatch({
|
|
12221
|
-
type: ActionType$
|
|
12221
|
+
type: ActionType$5.SetInputValue,
|
|
12222
12222
|
value: newValue,
|
|
12223
12223
|
});
|
|
12224
12224
|
}
|
|
@@ -12270,13 +12270,13 @@ const style$1 = `
|
|
|
12270
12270
|
`;
|
|
12271
12271
|
/* ------------- Actions ------------ */
|
|
12272
12272
|
// Types of actions
|
|
12273
|
-
var ActionType$
|
|
12273
|
+
var ActionType$4;
|
|
12274
12274
|
(function (ActionType) {
|
|
12275
12275
|
// Update the DBEntry
|
|
12276
12276
|
ActionType["UpdateDBEntry"] = "UpdateDBEntry";
|
|
12277
12277
|
// Start the save spinner
|
|
12278
12278
|
ActionType["StartSave"] = "StartSave";
|
|
12279
|
-
})(ActionType$
|
|
12279
|
+
})(ActionType$4 || (ActionType$4 = {}));
|
|
12280
12280
|
/**
|
|
12281
12281
|
* Reducer that executes actions
|
|
12282
12282
|
* @author Yuen Ler Chow
|
|
@@ -12284,12 +12284,12 @@ var ActionType$3;
|
|
|
12284
12284
|
* @param action action to execute
|
|
12285
12285
|
* @returns updated state
|
|
12286
12286
|
*/
|
|
12287
|
-
const reducer$
|
|
12287
|
+
const reducer$5 = (state, action) => {
|
|
12288
12288
|
switch (action.type) {
|
|
12289
|
-
case ActionType$
|
|
12289
|
+
case ActionType$4.UpdateDBEntry: {
|
|
12290
12290
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
12291
12291
|
}
|
|
12292
|
-
case ActionType$
|
|
12292
|
+
case ActionType$4.StartSave: {
|
|
12293
12293
|
return Object.assign(Object.assign({}, state), { saving: true });
|
|
12294
12294
|
}
|
|
12295
12295
|
default: {
|
|
@@ -12314,7 +12314,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12314
12314
|
saving: false,
|
|
12315
12315
|
};
|
|
12316
12316
|
// Initialize state
|
|
12317
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12317
|
+
const [state, dispatch] = React.useReducer(reducer$5, initialState);
|
|
12318
12318
|
// Destructure common state
|
|
12319
12319
|
const { entry, saving, } = state;
|
|
12320
12320
|
/*------------------------------------------------------------------------*/
|
|
@@ -12326,7 +12326,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12326
12326
|
*/
|
|
12327
12327
|
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
12328
12328
|
// Start the save loading indicator
|
|
12329
|
-
dispatch({ type: ActionType$
|
|
12329
|
+
dispatch({ type: ActionType$4.StartSave });
|
|
12330
12330
|
// add all default values to the entry
|
|
12331
12331
|
entryFields.forEach((field) => {
|
|
12332
12332
|
if (field.defaultValue && !entry[field.objectKey]) {
|
|
@@ -12509,7 +12509,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12509
12509
|
return (React__default["default"].createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
|
|
12510
12510
|
entry[field.objectKey] = choice.value;
|
|
12511
12511
|
dispatch({
|
|
12512
|
-
type: ActionType$
|
|
12512
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12513
12513
|
dbEntry: entry,
|
|
12514
12514
|
});
|
|
12515
12515
|
}, ariaLabel: choice.title }));
|
|
@@ -12521,7 +12521,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12521
12521
|
React__default["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) => {
|
|
12522
12522
|
entry[field.objectKey] = (e.target.value);
|
|
12523
12523
|
dispatch({
|
|
12524
|
-
type: ActionType$
|
|
12524
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12525
12525
|
dbEntry: entry,
|
|
12526
12526
|
});
|
|
12527
12527
|
} }))));
|
|
@@ -12534,7 +12534,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12534
12534
|
entry[field.objectKey] = (e.target.value
|
|
12535
12535
|
.replace(/[^0-9]/g, ''));
|
|
12536
12536
|
dispatch({
|
|
12537
|
-
type: ActionType$
|
|
12537
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12538
12538
|
dbEntry: entry,
|
|
12539
12539
|
});
|
|
12540
12540
|
} }))));
|
|
@@ -12564,7 +12564,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12564
12564
|
}
|
|
12565
12565
|
// Save
|
|
12566
12566
|
dispatch({
|
|
12567
|
-
type: ActionType$
|
|
12567
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12568
12568
|
dbEntry: entry,
|
|
12569
12569
|
});
|
|
12570
12570
|
}, ariaLabel: choice.title }));
|
|
@@ -12579,7 +12579,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12579
12579
|
// Update entry and save
|
|
12580
12580
|
entry[field.objectKey] = values;
|
|
12581
12581
|
dispatch({
|
|
12582
|
-
type: ActionType$
|
|
12582
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12583
12583
|
dbEntry: entry,
|
|
12584
12584
|
});
|
|
12585
12585
|
} })))));
|
|
@@ -12592,7 +12592,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12592
12592
|
React__default["default"].createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
|
|
12593
12593
|
entry[field.objectKey] = values;
|
|
12594
12594
|
dispatch({
|
|
12595
|
-
type: ActionType$
|
|
12595
|
+
type: ActionType$4.UpdateDBEntry,
|
|
12596
12596
|
dbEntry: entry,
|
|
12597
12597
|
});
|
|
12598
12598
|
} })))));
|
|
@@ -12666,7 +12666,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
|
|
|
12666
12666
|
*/
|
|
12667
12667
|
/* ------------- Actions ------------ */
|
|
12668
12668
|
// Types of actions
|
|
12669
|
-
var ActionType$
|
|
12669
|
+
var ActionType$3;
|
|
12670
12670
|
(function (ActionType) {
|
|
12671
12671
|
// Show adder
|
|
12672
12672
|
ActionType["ShowAdder"] = "ShowAdder";
|
|
@@ -12680,7 +12680,7 @@ var ActionType$2;
|
|
|
12680
12680
|
ActionType["StartDelete"] = "StartDelete";
|
|
12681
12681
|
// Finish deletion process
|
|
12682
12682
|
ActionType["FinishDelete"] = "FinishDelete";
|
|
12683
|
-
})(ActionType$
|
|
12683
|
+
})(ActionType$3 || (ActionType$3 = {}));
|
|
12684
12684
|
/**
|
|
12685
12685
|
* Reducer that executes actions
|
|
12686
12686
|
* @author Yuen Ler Chow
|
|
@@ -12688,18 +12688,18 @@ var ActionType$2;
|
|
|
12688
12688
|
* @param action action to execute
|
|
12689
12689
|
* @returns updated state
|
|
12690
12690
|
*/
|
|
12691
|
-
const reducer$
|
|
12691
|
+
const reducer$4 = (state, action) => {
|
|
12692
12692
|
switch (action.type) {
|
|
12693
|
-
case ActionType$
|
|
12693
|
+
case ActionType$3.FinishLoading: {
|
|
12694
12694
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
12695
12695
|
}
|
|
12696
|
-
case ActionType$
|
|
12696
|
+
case ActionType$3.ShowAdder: {
|
|
12697
12697
|
return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
|
|
12698
12698
|
}
|
|
12699
|
-
case ActionType$
|
|
12699
|
+
case ActionType$3.ShowEditor: {
|
|
12700
12700
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
|
|
12701
12701
|
}
|
|
12702
|
-
case ActionType$
|
|
12702
|
+
case ActionType$3.FinishAdd: {
|
|
12703
12703
|
// Handle cancel
|
|
12704
12704
|
const finishedEntry = action.dbEntry;
|
|
12705
12705
|
if (!finishedEntry) {
|
|
@@ -12723,10 +12723,10 @@ const reducer$3 = (state, action) => {
|
|
|
12723
12723
|
// Update the state
|
|
12724
12724
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
|
|
12725
12725
|
}
|
|
12726
|
-
case ActionType$
|
|
12726
|
+
case ActionType$3.StartDelete: {
|
|
12727
12727
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
12728
12728
|
}
|
|
12729
|
-
case ActionType$
|
|
12729
|
+
case ActionType$3.FinishDelete: {
|
|
12730
12730
|
return Object.assign(Object.assign({}, state), { loading: false,
|
|
12731
12731
|
// Remove the deleted entry from the list
|
|
12732
12732
|
dbEntries: state.dbEntries.filter((entry) => {
|
|
@@ -12752,7 +12752,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12752
12752
|
loading: true,
|
|
12753
12753
|
};
|
|
12754
12754
|
// Initialize state
|
|
12755
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12755
|
+
const [state, dispatch] = React.useReducer(reducer$4, initialState);
|
|
12756
12756
|
// Destructure common state
|
|
12757
12757
|
const { adding, dbEntryToEdit, dbEntries, loading, } = state;
|
|
12758
12758
|
/*------------------------------------------------------------------------*/
|
|
@@ -12778,7 +12778,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12778
12778
|
try {
|
|
12779
12779
|
// Start loader
|
|
12780
12780
|
dispatch({
|
|
12781
|
-
type: ActionType$
|
|
12781
|
+
type: ActionType$3.StartDelete,
|
|
12782
12782
|
});
|
|
12783
12783
|
// Perform deletion
|
|
12784
12784
|
yield visitServerEndpoint({
|
|
@@ -12787,7 +12787,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12787
12787
|
});
|
|
12788
12788
|
// Finish loader
|
|
12789
12789
|
dispatch({
|
|
12790
|
-
type: ActionType$
|
|
12790
|
+
type: ActionType$3.FinishDelete,
|
|
12791
12791
|
dbEntry: entry,
|
|
12792
12792
|
idPropName,
|
|
12793
12793
|
});
|
|
@@ -12816,7 +12816,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12816
12816
|
});
|
|
12817
12817
|
// Save loaded data
|
|
12818
12818
|
dispatch({
|
|
12819
|
-
type: ActionType$
|
|
12819
|
+
type: ActionType$3.FinishLoading,
|
|
12820
12820
|
dbEntries: data,
|
|
12821
12821
|
});
|
|
12822
12822
|
}
|
|
@@ -12859,7 +12859,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12859
12859
|
React__default["default"].createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
|
|
12860
12860
|
!disableEdit && (React__default["default"].createElement("button", { type: "button", id: `DBEntryManagerPanel-edit-with-id-${entry[idPropName]}`, className: "btn btn-primary", "aria-label": `edit db entry: ${entry[titlePropName]}`, onClick: () => {
|
|
12861
12861
|
dispatch({
|
|
12862
|
-
type: ActionType$
|
|
12862
|
+
type: ActionType$3.ShowEditor,
|
|
12863
12863
|
dbEntry: entry,
|
|
12864
12864
|
});
|
|
12865
12865
|
} },
|
|
@@ -12869,7 +12869,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12869
12869
|
React__default["default"].createElement("div", { className: "d-grid" },
|
|
12870
12870
|
React__default["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: () => {
|
|
12871
12871
|
dispatch({
|
|
12872
|
-
type: ActionType$
|
|
12872
|
+
type: ActionType$3.ShowAdder,
|
|
12873
12873
|
});
|
|
12874
12874
|
} },
|
|
12875
12875
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faPlus, className: "me-2" }),
|
|
@@ -12881,7 +12881,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12881
12881
|
if (!loading && (adding || dbEntryToEdit)) {
|
|
12882
12882
|
body = (React__default["default"].createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
|
|
12883
12883
|
dispatch({
|
|
12884
|
-
type: ActionType$
|
|
12884
|
+
type: ActionType$3.FinishAdd,
|
|
12885
12885
|
dbEntry: entry,
|
|
12886
12886
|
idPropName,
|
|
12887
12887
|
});
|
|
@@ -13078,25 +13078,25 @@ const getItemIds = (items) => {
|
|
|
13078
13078
|
};
|
|
13079
13079
|
/* ------------- Actions ------------ */
|
|
13080
13080
|
// Types of actions
|
|
13081
|
-
var ActionType$
|
|
13081
|
+
var ActionType$2;
|
|
13082
13082
|
(function (ActionType) {
|
|
13083
13083
|
// Hide the "jump to bottom" button
|
|
13084
13084
|
ActionType["HideJumpToBottomButton"] = "HideJumpToBottomButton";
|
|
13085
13085
|
// Show the "jump to bottom" button
|
|
13086
13086
|
ActionType["ShowJumpToBottomButton"] = "ShowJumpToBottomButton";
|
|
13087
|
-
})(ActionType$
|
|
13087
|
+
})(ActionType$2 || (ActionType$2 = {}));
|
|
13088
13088
|
/**
|
|
13089
13089
|
* Reducer that executes actions
|
|
13090
13090
|
* @author Gabe Abrams
|
|
13091
13091
|
* @param state current state
|
|
13092
13092
|
* @param action action to execute
|
|
13093
13093
|
*/
|
|
13094
|
-
const reducer$
|
|
13094
|
+
const reducer$3 = (state, action) => {
|
|
13095
13095
|
switch (action.type) {
|
|
13096
|
-
case ActionType$
|
|
13096
|
+
case ActionType$2.HideJumpToBottomButton: {
|
|
13097
13097
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
|
|
13098
13098
|
}
|
|
13099
|
-
case ActionType$
|
|
13099
|
+
case ActionType$2.ShowJumpToBottomButton: {
|
|
13100
13100
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: true });
|
|
13101
13101
|
}
|
|
13102
13102
|
default: {
|
|
@@ -13120,7 +13120,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13120
13120
|
jumpToBottomButtonVisible: false,
|
|
13121
13121
|
};
|
|
13122
13122
|
// Initialize state
|
|
13123
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
13123
|
+
const [state, dispatch] = React.useReducer(reducer$3, initialState);
|
|
13124
13124
|
// Destructure common state
|
|
13125
13125
|
const { jumpToBottomButtonVisible, } = state;
|
|
13126
13126
|
/* -------------- Refs -------------- */
|
|
@@ -13166,7 +13166,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13166
13166
|
}
|
|
13167
13167
|
// Update state
|
|
13168
13168
|
dispatch({
|
|
13169
|
-
type: ActionType$
|
|
13169
|
+
type: ActionType$2.HideJumpToBottomButton,
|
|
13170
13170
|
});
|
|
13171
13171
|
// Scroll to bottom
|
|
13172
13172
|
container.current.scrollTop = (container.current.scrollHeight
|
|
@@ -13190,7 +13190,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13190
13190
|
if (isScrolledToBottom()) {
|
|
13191
13191
|
// Hide button
|
|
13192
13192
|
dispatch({
|
|
13193
|
-
type: ActionType$
|
|
13193
|
+
type: ActionType$2.HideJumpToBottomButton,
|
|
13194
13194
|
});
|
|
13195
13195
|
}
|
|
13196
13196
|
};
|
|
@@ -13232,7 +13232,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13232
13232
|
else {
|
|
13233
13233
|
// Not scrolled to bottom. Show "jump to bottom" button.
|
|
13234
13234
|
dispatch({
|
|
13235
|
-
type: ActionType$
|
|
13235
|
+
type: ActionType$2.ShowJumpToBottomButton,
|
|
13236
13236
|
});
|
|
13237
13237
|
}
|
|
13238
13238
|
}, [items]);
|
|
@@ -13302,25 +13302,25 @@ const combineClassNames = (classNames) => {
|
|
|
13302
13302
|
*/
|
|
13303
13303
|
/* ------------- Actions ------------ */
|
|
13304
13304
|
// Types of actions
|
|
13305
|
-
var ActionType;
|
|
13305
|
+
var ActionType$1;
|
|
13306
13306
|
(function (ActionType) {
|
|
13307
13307
|
// Start hovering on an option
|
|
13308
13308
|
ActionType["StartHover"] = "StartHover";
|
|
13309
13309
|
// Stop hovering on an option
|
|
13310
13310
|
ActionType["StopHover"] = "StopHover";
|
|
13311
|
-
})(ActionType || (ActionType = {}));
|
|
13311
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
13312
13312
|
/**
|
|
13313
13313
|
* Reducer that executes actions
|
|
13314
13314
|
* @author Gabe Abrams
|
|
13315
13315
|
* @param state current state
|
|
13316
13316
|
* @param action action to execute
|
|
13317
13317
|
*/
|
|
13318
|
-
const reducer$
|
|
13318
|
+
const reducer$2 = (state, action) => {
|
|
13319
13319
|
switch (action.type) {
|
|
13320
|
-
case ActionType.StartHover: {
|
|
13320
|
+
case ActionType$1.StartHover: {
|
|
13321
13321
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
|
|
13322
13322
|
}
|
|
13323
|
-
case ActionType.StopHover: {
|
|
13323
|
+
case ActionType$1.StopHover: {
|
|
13324
13324
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: undefined });
|
|
13325
13325
|
}
|
|
13326
13326
|
default: {
|
|
@@ -13344,7 +13344,7 @@ const MultiSwitch = (props) => {
|
|
|
13344
13344
|
hoveredOptionId: undefined,
|
|
13345
13345
|
};
|
|
13346
13346
|
// Initialize state
|
|
13347
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
13347
|
+
const [state, dispatch] = React.useReducer(reducer$2, initialState);
|
|
13348
13348
|
// Destructure common state
|
|
13349
13349
|
const { hoveredOptionId, } = state;
|
|
13350
13350
|
/*------------------------------------------------------------------------*/
|
|
@@ -13476,27 +13476,27 @@ const MultiSwitch = (props) => {
|
|
|
13476
13476
|
: `click to select option "${option.label}"`), onClick: () => {
|
|
13477
13477
|
// Remove hover
|
|
13478
13478
|
dispatch({
|
|
13479
|
-
type: ActionType.StopHover,
|
|
13479
|
+
type: ActionType$1.StopHover,
|
|
13480
13480
|
});
|
|
13481
13481
|
// Notify parent
|
|
13482
13482
|
onChange(option.id);
|
|
13483
13483
|
}, onMouseEnter: () => {
|
|
13484
13484
|
dispatch({
|
|
13485
|
-
type: ActionType.StartHover,
|
|
13485
|
+
type: ActionType$1.StartHover,
|
|
13486
13486
|
hoveredOptionId: option.id,
|
|
13487
13487
|
});
|
|
13488
13488
|
}, onMouseLeave: () => {
|
|
13489
13489
|
dispatch({
|
|
13490
|
-
type: ActionType.StopHover,
|
|
13490
|
+
type: ActionType$1.StopHover,
|
|
13491
13491
|
});
|
|
13492
13492
|
}, onFocus: () => {
|
|
13493
13493
|
dispatch({
|
|
13494
|
-
type: ActionType.StartHover,
|
|
13494
|
+
type: ActionType$1.StartHover,
|
|
13495
13495
|
hoveredOptionId: option.id,
|
|
13496
13496
|
});
|
|
13497
13497
|
}, onBlur: () => {
|
|
13498
13498
|
dispatch({
|
|
13499
|
-
type: ActionType.StopHover,
|
|
13499
|
+
type: ActionType$1.StopHover,
|
|
13500
13500
|
});
|
|
13501
13501
|
}, style: {
|
|
13502
13502
|
pointerEvents: ((option.id === selectedOptionId)
|
|
@@ -13515,6 +13515,147 @@ const MultiSwitch = (props) => {
|
|
|
13515
13515
|
React__default["default"].createElement("div", { className: "MultiSwitch-highlight-container" }, highlight)));
|
|
13516
13516
|
};
|
|
13517
13517
|
|
|
13518
|
+
// Types of dropdown items
|
|
13519
|
+
var DropdownItemType;
|
|
13520
|
+
(function (DropdownItemType) {
|
|
13521
|
+
// Dropdown header
|
|
13522
|
+
DropdownItemType["Header"] = "Header";
|
|
13523
|
+
// Dropdown divider
|
|
13524
|
+
DropdownItemType["Divider"] = "Divider";
|
|
13525
|
+
// Dropdown item
|
|
13526
|
+
DropdownItemType["Item"] = "Item";
|
|
13527
|
+
})(DropdownItemType || (DropdownItemType = {}));
|
|
13528
|
+
var DropdownItemType$1 = DropdownItemType;
|
|
13529
|
+
|
|
13530
|
+
/**
|
|
13531
|
+
* A simple dropdown menu
|
|
13532
|
+
* @author Alessandra De Lucas
|
|
13533
|
+
* @author Yuen Ler Chow
|
|
13534
|
+
* @author Gabe Abrams
|
|
13535
|
+
*/
|
|
13536
|
+
/* ------------- Actions ------------ */
|
|
13537
|
+
// Types of actions
|
|
13538
|
+
var ActionType;
|
|
13539
|
+
(function (ActionType) {
|
|
13540
|
+
// Toggle opening the dropdown menu
|
|
13541
|
+
ActionType["ToggleDropdown"] = "ToggleDropdown";
|
|
13542
|
+
// Close the dropdown menu
|
|
13543
|
+
ActionType["CloseDropdown"] = "CloseDropdown";
|
|
13544
|
+
})(ActionType || (ActionType = {}));
|
|
13545
|
+
/**
|
|
13546
|
+
* Reducer that executes actions
|
|
13547
|
+
* @author Alessandra De Lucas
|
|
13548
|
+
* @author Yuen Ler Chow
|
|
13549
|
+
* @param state current state
|
|
13550
|
+
* @param action action to execute
|
|
13551
|
+
*/
|
|
13552
|
+
const reducer$1 = (state, action) => {
|
|
13553
|
+
switch (action.type) {
|
|
13554
|
+
case ActionType.ToggleDropdown: {
|
|
13555
|
+
return Object.assign(Object.assign({}, state), { isDropdownOpen: !state.isDropdownOpen });
|
|
13556
|
+
}
|
|
13557
|
+
case ActionType.CloseDropdown: {
|
|
13558
|
+
return Object.assign(Object.assign({}, state), { isDropdownOpen: false });
|
|
13559
|
+
}
|
|
13560
|
+
default: {
|
|
13561
|
+
return state;
|
|
13562
|
+
}
|
|
13563
|
+
}
|
|
13564
|
+
};
|
|
13565
|
+
/*------------------------------------------------------------------------*/
|
|
13566
|
+
/* ------------------------------ Component ----------------------------- */
|
|
13567
|
+
/*------------------------------------------------------------------------*/
|
|
13568
|
+
const Dropdown = (props) => {
|
|
13569
|
+
/*------------------------------------------------------------------------*/
|
|
13570
|
+
/* -------------------------------- Setup ------------------------------- */
|
|
13571
|
+
/*------------------------------------------------------------------------*/
|
|
13572
|
+
/* -------------- Props ------------- */
|
|
13573
|
+
// Destructure all props
|
|
13574
|
+
const { dropdownButton, items, } = props;
|
|
13575
|
+
/* -------------- State ------------- */
|
|
13576
|
+
// Initial state
|
|
13577
|
+
const initialState = {
|
|
13578
|
+
isDropdownOpen: false,
|
|
13579
|
+
};
|
|
13580
|
+
// Initialize state
|
|
13581
|
+
const [state, dispatch] = React.useReducer(reducer$1, initialState);
|
|
13582
|
+
// Destructure common state
|
|
13583
|
+
const { isDropdownOpen, } = state;
|
|
13584
|
+
/* -------------- Refs -------------- */
|
|
13585
|
+
// Initialize refs
|
|
13586
|
+
const dropdownRef = React.useRef(null);
|
|
13587
|
+
/*------------------------------------------------------------------------*/
|
|
13588
|
+
/* ------------------------- Component Functions ------------------------ */
|
|
13589
|
+
/*------------------------------------------------------------------------*/
|
|
13590
|
+
/**
|
|
13591
|
+
* Handle clicking outside of the dropdown menu to close it
|
|
13592
|
+
* @author Yuen Ler Chow
|
|
13593
|
+
* @param event the mouse event
|
|
13594
|
+
*/
|
|
13595
|
+
const handleClickOutside = (event) => {
|
|
13596
|
+
if (
|
|
13597
|
+
// Dropdown has been rendered
|
|
13598
|
+
dropdownRef.current
|
|
13599
|
+
// Click occurred outside the dropdown
|
|
13600
|
+
&& !dropdownRef.current.contains(event.target)) {
|
|
13601
|
+
dispatch({ type: ActionType.CloseDropdown });
|
|
13602
|
+
}
|
|
13603
|
+
};
|
|
13604
|
+
/*------------------------------------------------------------------------*/
|
|
13605
|
+
/* ------------------------- Lifecycle Functions ------------------------ */
|
|
13606
|
+
/*------------------------------------------------------------------------*/
|
|
13607
|
+
/**
|
|
13608
|
+
* Mount
|
|
13609
|
+
* @author Yuen Ler Chow
|
|
13610
|
+
*/
|
|
13611
|
+
React.useEffect(() => {
|
|
13612
|
+
// Add event listener to close dropdown when clicking outside
|
|
13613
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
13614
|
+
// Cleanup
|
|
13615
|
+
return () => {
|
|
13616
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
13617
|
+
};
|
|
13618
|
+
}, []);
|
|
13619
|
+
/*----------------------------------------*/
|
|
13620
|
+
/* --------------- Main UI -------------- */
|
|
13621
|
+
/*----------------------------------------*/
|
|
13622
|
+
return (React__default["default"].createElement("div", { className: "dropdown", ref: dropdownRef, "data-bs-theme": isDarkModeOn() ? 'dark' : undefined },
|
|
13623
|
+
React__default["default"].createElement("button", { className: combineClassNames([
|
|
13624
|
+
'btn dropdown-toggle border',
|
|
13625
|
+
isDropdownOpen && 'show',
|
|
13626
|
+
`btn-${dropdownButton.variant}`,
|
|
13627
|
+
dropdownButton.variant === Variant$1.Light && 'text-dark',
|
|
13628
|
+
]), type: "button", id: dropdownButton.id, "aria-expanded": isDropdownOpen, "aria-label": dropdownButton.ariaLabel, onClick: () => {
|
|
13629
|
+
dispatch({
|
|
13630
|
+
type: ActionType.ToggleDropdown,
|
|
13631
|
+
});
|
|
13632
|
+
} }, dropdownButton.content),
|
|
13633
|
+
React__default["default"].createElement("ul", { className: combineClassNames([
|
|
13634
|
+
'dropdown-menu',
|
|
13635
|
+
isDarkModeOn() && 'dropdown-menu-dark',
|
|
13636
|
+
isDropdownOpen && 'show',
|
|
13637
|
+
]) }, Object.values(items).map((item) => {
|
|
13638
|
+
if (item.type === DropdownItemType$1.Header) {
|
|
13639
|
+
return (
|
|
13640
|
+
// TODO: Implement header
|
|
13641
|
+
React__default["default"].createElement("span", null));
|
|
13642
|
+
}
|
|
13643
|
+
if (item.type === DropdownItemType$1.Divider) {
|
|
13644
|
+
return (
|
|
13645
|
+
// TODO: Implement divider
|
|
13646
|
+
React__default["default"].createElement("span", null));
|
|
13647
|
+
}
|
|
13648
|
+
return (React__default["default"].createElement("li", { key: item.id },
|
|
13649
|
+
React__default["default"].createElement("button", { type: "button", "aria-label": item.ariaLabel, className: "dropdown-item", onClick: (e) => {
|
|
13650
|
+
e.preventDefault();
|
|
13651
|
+
dispatch({
|
|
13652
|
+
type: ActionType.CloseDropdown,
|
|
13653
|
+
});
|
|
13654
|
+
item.onClick();
|
|
13655
|
+
} }, item.content)));
|
|
13656
|
+
}))));
|
|
13657
|
+
};
|
|
13658
|
+
|
|
13518
13659
|
/**
|
|
13519
13660
|
* One minute in ms
|
|
13520
13661
|
* @author Gabe Abrams
|
|
@@ -15851,6 +15992,8 @@ exports.DBEntryFieldType = DBEntryFieldType$1;
|
|
|
15851
15992
|
exports.DBEntryManagerPanel = DBEntryManagerPanel;
|
|
15852
15993
|
exports.DayOfWeek = DayOfWeek$1;
|
|
15853
15994
|
exports.Drawer = Drawer;
|
|
15995
|
+
exports.Dropdown = Dropdown;
|
|
15996
|
+
exports.DropdownItemType = DropdownItemType$1;
|
|
15854
15997
|
exports.DynamicWord = DynamicWord;
|
|
15855
15998
|
exports.ErrorBox = ErrorBox;
|
|
15856
15999
|
exports.ErrorWithCode = ErrorWithCode;
|