dce-reactkit 3.6.8 → 3.6.9
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 +346 -139
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/MultiSwitch.d.ts +24 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/index.js +346 -140
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/MultiSwitch.d.ts +24 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +66 -43
- package/package.json +1 -1
- package/src/components/MultiSwitch.tsx +347 -0
- package/src/index.ts +2 -0
package/dist/esm/index.js
CHANGED
|
@@ -2038,27 +2038,27 @@ const PopPendingMark = (props) => {
|
|
|
2038
2038
|
*/
|
|
2039
2039
|
/* ------------- Actions ------------ */
|
|
2040
2040
|
// Types of actions
|
|
2041
|
-
var ActionType$
|
|
2041
|
+
var ActionType$9;
|
|
2042
2042
|
(function (ActionType) {
|
|
2043
2043
|
// Indicate that the text was recently copied
|
|
2044
2044
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
2045
2045
|
// Clear the status
|
|
2046
2046
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
2047
|
-
})(ActionType$
|
|
2047
|
+
})(ActionType$9 || (ActionType$9 = {}));
|
|
2048
2048
|
/**
|
|
2049
2049
|
* Reducer that executes actions
|
|
2050
2050
|
* @author Gabe Abrams
|
|
2051
2051
|
* @param state current state
|
|
2052
2052
|
* @param action action to execute
|
|
2053
2053
|
*/
|
|
2054
|
-
const reducer$
|
|
2054
|
+
const reducer$9 = (state, action) => {
|
|
2055
2055
|
switch (action.type) {
|
|
2056
|
-
case ActionType$
|
|
2056
|
+
case ActionType$9.IndicateRecentlyCopied: {
|
|
2057
2057
|
return {
|
|
2058
2058
|
recentlyCopied: true,
|
|
2059
2059
|
};
|
|
2060
2060
|
}
|
|
2061
|
-
case ActionType$
|
|
2061
|
+
case ActionType$9.ClearRecentlyCopiedStatus: {
|
|
2062
2062
|
return {
|
|
2063
2063
|
recentlyCopied: false,
|
|
2064
2064
|
};
|
|
@@ -2084,7 +2084,7 @@ const CopiableBox = (props) => {
|
|
|
2084
2084
|
recentlyCopied: false,
|
|
2085
2085
|
};
|
|
2086
2086
|
// Initialize state
|
|
2087
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2087
|
+
const [state, dispatch] = useReducer(reducer$9, initialState);
|
|
2088
2088
|
// Destructure common state
|
|
2089
2089
|
const { recentlyCopied, } = state;
|
|
2090
2090
|
/*------------------------------------------------------------------------*/
|
|
@@ -2104,13 +2104,13 @@ const CopiableBox = (props) => {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
// Show copied notice
|
|
2106
2106
|
dispatch({
|
|
2107
|
-
type: ActionType$
|
|
2107
|
+
type: ActionType$9.IndicateRecentlyCopied,
|
|
2108
2108
|
});
|
|
2109
2109
|
// Wait a moment
|
|
2110
2110
|
yield waitMs(4000);
|
|
2111
2111
|
// Hide copied notice
|
|
2112
2112
|
dispatch({
|
|
2113
|
-
type: ActionType$
|
|
2113
|
+
type: ActionType$9.ClearRecentlyCopiedStatus,
|
|
2114
2114
|
});
|
|
2115
2115
|
});
|
|
2116
2116
|
/*------------------------------------------------------------------------*/
|
|
@@ -2166,20 +2166,20 @@ const CopiableBox = (props) => {
|
|
|
2166
2166
|
*/
|
|
2167
2167
|
/* ------------- Actions ------------ */
|
|
2168
2168
|
// Types of actions
|
|
2169
|
-
var ActionType$
|
|
2169
|
+
var ActionType$8;
|
|
2170
2170
|
(function (ActionType) {
|
|
2171
2171
|
// Toggle whether a child are being shown
|
|
2172
2172
|
ActionType["ToggleChild"] = "toggle-child";
|
|
2173
|
-
})(ActionType$
|
|
2173
|
+
})(ActionType$8 || (ActionType$8 = {}));
|
|
2174
2174
|
/**
|
|
2175
2175
|
* Reducer that executes actions
|
|
2176
2176
|
* @author Gabe Abrams
|
|
2177
2177
|
* @param state current state
|
|
2178
2178
|
* @param action action to execute
|
|
2179
2179
|
*/
|
|
2180
|
-
const reducer$
|
|
2180
|
+
const reducer$8 = (state, action) => {
|
|
2181
2181
|
switch (action.type) {
|
|
2182
|
-
case ActionType$
|
|
2182
|
+
case ActionType$8.ToggleChild: {
|
|
2183
2183
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
2184
2184
|
}
|
|
2185
2185
|
default: {
|
|
@@ -2208,7 +2208,7 @@ const NestableItemList = (props) => {
|
|
|
2208
2208
|
childExpanded: initChildExpanded,
|
|
2209
2209
|
};
|
|
2210
2210
|
// Initialize state
|
|
2211
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2211
|
+
const [state, dispatch] = useReducer(reducer$8, initialState);
|
|
2212
2212
|
// Destructure common state
|
|
2213
2213
|
const { childExpanded, } = state;
|
|
2214
2214
|
/*------------------------------------------------------------------------*/
|
|
@@ -2298,7 +2298,7 @@ const NestableItemList = (props) => {
|
|
|
2298
2298
|
backgroundColor: 'transparent',
|
|
2299
2299
|
}, type: "button", onClick: () => {
|
|
2300
2300
|
dispatch({
|
|
2301
|
-
type: ActionType$
|
|
2301
|
+
type: ActionType$8.ToggleChild,
|
|
2302
2302
|
id: item.id,
|
|
2303
2303
|
});
|
|
2304
2304
|
}, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
@@ -2574,7 +2574,7 @@ var SortType;
|
|
|
2574
2574
|
})(SortType || (SortType = {}));
|
|
2575
2575
|
/* ------------- Actions ------------ */
|
|
2576
2576
|
// Types of actions
|
|
2577
|
-
var ActionType$
|
|
2577
|
+
var ActionType$7;
|
|
2578
2578
|
(function (ActionType) {
|
|
2579
2579
|
// Toggle sort column param
|
|
2580
2580
|
ActionType["ToggleSortColumn"] = "toggle-sort-column";
|
|
@@ -2586,16 +2586,16 @@ var ActionType$6;
|
|
|
2586
2586
|
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2587
2587
|
// Hide all columns
|
|
2588
2588
|
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2589
|
-
})(ActionType$
|
|
2589
|
+
})(ActionType$7 || (ActionType$7 = {}));
|
|
2590
2590
|
/**
|
|
2591
2591
|
* Reducer that executes actions
|
|
2592
2592
|
* @author Gabe Abrams
|
|
2593
2593
|
* @param state current state
|
|
2594
2594
|
* @param action action to execute
|
|
2595
2595
|
*/
|
|
2596
|
-
const reducer$
|
|
2596
|
+
const reducer$7 = (state, action) => {
|
|
2597
2597
|
switch (action.type) {
|
|
2598
|
-
case ActionType$
|
|
2598
|
+
case ActionType$7.ToggleSortColumn: {
|
|
2599
2599
|
if (action.param !== state.sortColumnParam) {
|
|
2600
2600
|
// Different column param
|
|
2601
2601
|
return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
|
|
@@ -2607,22 +2607,22 @@ const reducer$6 = (state, action) => {
|
|
|
2607
2607
|
// Stop sorting by column
|
|
2608
2608
|
return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
|
|
2609
2609
|
}
|
|
2610
|
-
case ActionType$
|
|
2610
|
+
case ActionType$7.UpdateColumnVisibility: {
|
|
2611
2611
|
const { columnVisibilityMap } = state;
|
|
2612
2612
|
columnVisibilityMap[action.param] = action.visible;
|
|
2613
2613
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2614
2614
|
}
|
|
2615
|
-
case ActionType$
|
|
2615
|
+
case ActionType$7.ToggleColVisCusModalVisibility: {
|
|
2616
2616
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2617
2617
|
}
|
|
2618
|
-
case ActionType$
|
|
2618
|
+
case ActionType$7.ShowAllColumns: {
|
|
2619
2619
|
const { columnVisibilityMap } = state;
|
|
2620
2620
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2621
2621
|
columnVisibilityMap[param] = true;
|
|
2622
2622
|
});
|
|
2623
2623
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2624
2624
|
}
|
|
2625
|
-
case ActionType$
|
|
2625
|
+
case ActionType$7.HideAllColumns: {
|
|
2626
2626
|
const { columnVisibilityMap } = state;
|
|
2627
2627
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2628
2628
|
columnVisibilityMap[param] = false;
|
|
@@ -2669,7 +2669,7 @@ const IntelliTable = (props) => {
|
|
|
2669
2669
|
columnVisibilityCustomizationModalVisible: false,
|
|
2670
2670
|
};
|
|
2671
2671
|
// Initialize state
|
|
2672
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2672
|
+
const [state, dispatch] = useReducer(reducer$7, initialState);
|
|
2673
2673
|
// Destructure common state
|
|
2674
2674
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
2675
2675
|
/*------------------------------------------------------------------------*/
|
|
@@ -2692,13 +2692,13 @@ const IntelliTable = (props) => {
|
|
|
2692
2692
|
return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
2693
2693
|
}
|
|
2694
2694
|
dispatch({
|
|
2695
|
-
type: ActionType$
|
|
2695
|
+
type: ActionType$7.ToggleColVisCusModalVisibility,
|
|
2696
2696
|
});
|
|
2697
2697
|
}, okayVariant: Variant$1.Light },
|
|
2698
2698
|
columns.map((column) => {
|
|
2699
2699
|
return (React__default.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
2700
2700
|
dispatch({
|
|
2701
|
-
type: ActionType$
|
|
2701
|
+
type: ActionType$7.UpdateColumnVisibility,
|
|
2702
2702
|
param: column.param,
|
|
2703
2703
|
visible: checked,
|
|
2704
2704
|
});
|
|
@@ -2707,12 +2707,12 @@ const IntelliTable = (props) => {
|
|
|
2707
2707
|
React__default.createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
2708
2708
|
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: () => {
|
|
2709
2709
|
dispatch({
|
|
2710
|
-
type: ActionType$
|
|
2710
|
+
type: ActionType$7.ShowAllColumns,
|
|
2711
2711
|
});
|
|
2712
2712
|
} }, "Select All"),
|
|
2713
2713
|
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: () => {
|
|
2714
2714
|
dispatch({
|
|
2715
|
-
type: ActionType$
|
|
2715
|
+
type: ActionType$7.HideAllColumns,
|
|
2716
2716
|
});
|
|
2717
2717
|
} }, "Deselect All")));
|
|
2718
2718
|
}
|
|
@@ -2763,7 +2763,7 @@ const IntelliTable = (props) => {
|
|
|
2763
2763
|
React__default.createElement("div", null,
|
|
2764
2764
|
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: () => {
|
|
2765
2765
|
dispatch({
|
|
2766
|
-
type: ActionType$
|
|
2766
|
+
type: ActionType$7.ToggleSortColumn,
|
|
2767
2767
|
param: column.param,
|
|
2768
2768
|
});
|
|
2769
2769
|
} },
|
|
@@ -2952,7 +2952,7 @@ const IntelliTable = (props) => {
|
|
|
2952
2952
|
React__default.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
|
|
2953
2953
|
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: () => {
|
|
2954
2954
|
dispatch({
|
|
2955
|
-
type: ActionType$
|
|
2955
|
+
type: ActionType$7.ToggleColVisCusModalVisibility,
|
|
2956
2956
|
});
|
|
2957
2957
|
} },
|
|
2958
2958
|
"Show/Hide Cols",
|
|
@@ -3318,7 +3318,7 @@ const genHumanReadableName = (machineReadableName) => {
|
|
|
3318
3318
|
};
|
|
3319
3319
|
/* ------------- Actions ------------ */
|
|
3320
3320
|
// Types of actions
|
|
3321
|
-
var ActionType$
|
|
3321
|
+
var ActionType$6;
|
|
3322
3322
|
(function (ActionType) {
|
|
3323
3323
|
// Show the loading bar
|
|
3324
3324
|
ActionType["StartLoading"] = "start-loading";
|
|
@@ -3340,45 +3340,45 @@ var ActionType$5;
|
|
|
3340
3340
|
ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
|
|
3341
3341
|
// Update the advanced filter state
|
|
3342
3342
|
ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
|
|
3343
|
-
})(ActionType$
|
|
3343
|
+
})(ActionType$6 || (ActionType$6 = {}));
|
|
3344
3344
|
/**
|
|
3345
3345
|
* Reducer that executes actions
|
|
3346
3346
|
* @author Gabe Abrams
|
|
3347
3347
|
* @param state current state
|
|
3348
3348
|
* @param action action to execute
|
|
3349
3349
|
*/
|
|
3350
|
-
const reducer$
|
|
3350
|
+
const reducer$6 = (state, action) => {
|
|
3351
3351
|
switch (action.type) {
|
|
3352
|
-
case ActionType$
|
|
3352
|
+
case ActionType$6.StartLoading: {
|
|
3353
3353
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
3354
3354
|
}
|
|
3355
|
-
case ActionType$
|
|
3355
|
+
case ActionType$6.FinishLoading: {
|
|
3356
3356
|
return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
|
|
3357
3357
|
}
|
|
3358
|
-
case ActionType$
|
|
3358
|
+
case ActionType$6.ToggleFilterDrawer: {
|
|
3359
3359
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
|
|
3360
3360
|
? undefined // hide
|
|
3361
3361
|
: action.filterDrawer) });
|
|
3362
3362
|
}
|
|
3363
|
-
case ActionType$
|
|
3363
|
+
case ActionType$6.HideFilterDrawer: {
|
|
3364
3364
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3365
3365
|
}
|
|
3366
|
-
case ActionType$
|
|
3366
|
+
case ActionType$6.ResetFilters: {
|
|
3367
3367
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
|
|
3368
3368
|
}
|
|
3369
|
-
case ActionType$
|
|
3369
|
+
case ActionType$6.UpdateDateFilterState: {
|
|
3370
3370
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
|
|
3371
3371
|
}
|
|
3372
|
-
case ActionType$
|
|
3372
|
+
case ActionType$6.UpdateContextFilterState: {
|
|
3373
3373
|
return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
|
|
3374
3374
|
}
|
|
3375
|
-
case ActionType$
|
|
3375
|
+
case ActionType$6.UpdateTagFilterState: {
|
|
3376
3376
|
return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
|
|
3377
3377
|
}
|
|
3378
|
-
case ActionType$
|
|
3378
|
+
case ActionType$6.UpdateActionErrorFilterState: {
|
|
3379
3379
|
return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
|
|
3380
3380
|
}
|
|
3381
|
-
case ActionType$
|
|
3381
|
+
case ActionType$6.UpdateAdvancedFilterState: {
|
|
3382
3382
|
return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
|
|
3383
3383
|
}
|
|
3384
3384
|
default: {
|
|
@@ -3507,7 +3507,7 @@ const LogReviewer = (props) => {
|
|
|
3507
3507
|
advancedFilterState: initAdvancedFilterState,
|
|
3508
3508
|
};
|
|
3509
3509
|
// Initialize state
|
|
3510
|
-
const [state, dispatch] = useReducer(reducer$
|
|
3510
|
+
const [state, dispatch] = useReducer(reducer$6, initialState);
|
|
3511
3511
|
// Destructure common state
|
|
3512
3512
|
const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
|
|
3513
3513
|
/*------------------------------------------------------------------------*/
|
|
@@ -3557,7 +3557,7 @@ const LogReviewer = (props) => {
|
|
|
3557
3557
|
const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3558
3558
|
// Update state
|
|
3559
3559
|
dispatch({
|
|
3560
|
-
type: ActionType$
|
|
3560
|
+
type: ActionType$6.UpdateDateFilterState,
|
|
3561
3561
|
dateFilterState: newDateFilterState,
|
|
3562
3562
|
});
|
|
3563
3563
|
// Check which year/month combos we need to load
|
|
@@ -3568,7 +3568,7 @@ const LogReviewer = (props) => {
|
|
|
3568
3568
|
}
|
|
3569
3569
|
// Start loading
|
|
3570
3570
|
dispatch({
|
|
3571
|
-
type: ActionType$
|
|
3571
|
+
type: ActionType$6.StartLoading,
|
|
3572
3572
|
});
|
|
3573
3573
|
// Load required months
|
|
3574
3574
|
try {
|
|
@@ -3592,7 +3592,7 @@ const LogReviewer = (props) => {
|
|
|
3592
3592
|
}
|
|
3593
3593
|
// Finish loading
|
|
3594
3594
|
dispatch({
|
|
3595
|
-
type: ActionType$
|
|
3595
|
+
type: ActionType$6.FinishLoading,
|
|
3596
3596
|
logMap,
|
|
3597
3597
|
});
|
|
3598
3598
|
});
|
|
@@ -3631,7 +3631,7 @@ const LogReviewer = (props) => {
|
|
|
3631
3631
|
React__default.createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
3632
3632
|
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: () => {
|
|
3633
3633
|
dispatch({
|
|
3634
|
-
type: ActionType$
|
|
3634
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3635
3635
|
filterDrawer: FilterDrawer.Date,
|
|
3636
3636
|
});
|
|
3637
3637
|
} },
|
|
@@ -3639,7 +3639,7 @@ const LogReviewer = (props) => {
|
|
|
3639
3639
|
"Date"),
|
|
3640
3640
|
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: () => {
|
|
3641
3641
|
dispatch({
|
|
3642
|
-
type: ActionType$
|
|
3642
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3643
3643
|
filterDrawer: FilterDrawer.Context,
|
|
3644
3644
|
});
|
|
3645
3645
|
} },
|
|
@@ -3647,7 +3647,7 @@ const LogReviewer = (props) => {
|
|
|
3647
3647
|
"Context"),
|
|
3648
3648
|
(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: () => {
|
|
3649
3649
|
dispatch({
|
|
3650
|
-
type: ActionType$
|
|
3650
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3651
3651
|
filterDrawer: FilterDrawer.Tag,
|
|
3652
3652
|
});
|
|
3653
3653
|
} },
|
|
@@ -3655,7 +3655,7 @@ const LogReviewer = (props) => {
|
|
|
3655
3655
|
"Tag")),
|
|
3656
3656
|
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: () => {
|
|
3657
3657
|
dispatch({
|
|
3658
|
-
type: ActionType$
|
|
3658
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3659
3659
|
filterDrawer: FilterDrawer.Action,
|
|
3660
3660
|
});
|
|
3661
3661
|
} },
|
|
@@ -3663,7 +3663,7 @@ const LogReviewer = (props) => {
|
|
|
3663
3663
|
"Action"),
|
|
3664
3664
|
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: () => {
|
|
3665
3665
|
dispatch({
|
|
3666
|
-
type: ActionType$
|
|
3666
|
+
type: ActionType$6.ToggleFilterDrawer,
|
|
3667
3667
|
filterDrawer: FilterDrawer.Advanced,
|
|
3668
3668
|
});
|
|
3669
3669
|
} },
|
|
@@ -3671,7 +3671,7 @@ const LogReviewer = (props) => {
|
|
|
3671
3671
|
"Advanced"),
|
|
3672
3672
|
React__default.createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
|
|
3673
3673
|
dispatch({
|
|
3674
|
-
type: ActionType$
|
|
3674
|
+
type: ActionType$6.ResetFilters,
|
|
3675
3675
|
initActionErrorFilterState,
|
|
3676
3676
|
initAdvancedFilterState,
|
|
3677
3677
|
initContextFilterState,
|
|
@@ -3793,7 +3793,7 @@ const LogReviewer = (props) => {
|
|
|
3793
3793
|
}
|
|
3794
3794
|
});
|
|
3795
3795
|
dispatch({
|
|
3796
|
-
type: ActionType$
|
|
3796
|
+
type: ActionType$6.UpdateContextFilterState,
|
|
3797
3797
|
contextFilterState,
|
|
3798
3798
|
});
|
|
3799
3799
|
} }));
|
|
@@ -3808,7 +3808,7 @@ const LogReviewer = (props) => {
|
|
|
3808
3808
|
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) => {
|
|
3809
3809
|
tagFilterState[tag] = checked;
|
|
3810
3810
|
dispatch({
|
|
3811
|
-
type: ActionType$
|
|
3811
|
+
type: ActionType$6.UpdateTagFilterState,
|
|
3812
3812
|
tagFilterState,
|
|
3813
3813
|
});
|
|
3814
3814
|
} }));
|
|
@@ -3821,21 +3821,21 @@ const LogReviewer = (props) => {
|
|
|
3821
3821
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
3822
3822
|
actionErrorFilterState.type = undefined;
|
|
3823
3823
|
dispatch({
|
|
3824
|
-
type: ActionType$
|
|
3824
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
3825
3825
|
actionErrorFilterState,
|
|
3826
3826
|
});
|
|
3827
3827
|
}, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
|
|
3828
3828
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
3829
3829
|
actionErrorFilterState.type = LogType$1.Action;
|
|
3830
3830
|
dispatch({
|
|
3831
|
-
type: ActionType$
|
|
3831
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
3832
3832
|
actionErrorFilterState,
|
|
3833
3833
|
});
|
|
3834
3834
|
}, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
|
|
3835
3835
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
3836
3836
|
actionErrorFilterState.type = LogType$1.Error;
|
|
3837
3837
|
dispatch({
|
|
3838
|
-
type: ActionType$
|
|
3838
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
3839
3839
|
actionErrorFilterState,
|
|
3840
3840
|
});
|
|
3841
3841
|
}, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
|
|
@@ -3847,7 +3847,7 @@ const LogReviewer = (props) => {
|
|
|
3847
3847
|
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) => {
|
|
3848
3848
|
actionErrorFilterState.action[action] = checked;
|
|
3849
3849
|
dispatch({
|
|
3850
|
-
type: ActionType$
|
|
3850
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
3851
3851
|
actionErrorFilterState,
|
|
3852
3852
|
});
|
|
3853
3853
|
} }));
|
|
@@ -3858,7 +3858,7 @@ const LogReviewer = (props) => {
|
|
|
3858
3858
|
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) => {
|
|
3859
3859
|
actionErrorFilterState.target[target] = checked;
|
|
3860
3860
|
dispatch({
|
|
3861
|
-
type: ActionType$
|
|
3861
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
3862
3862
|
actionErrorFilterState,
|
|
3863
3863
|
});
|
|
3864
3864
|
} }));
|
|
@@ -3870,7 +3870,7 @@ const LogReviewer = (props) => {
|
|
|
3870
3870
|
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) => {
|
|
3871
3871
|
actionErrorFilterState.errorMessage = e.target.value;
|
|
3872
3872
|
dispatch({
|
|
3873
|
-
type: ActionType$
|
|
3873
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
3874
3874
|
actionErrorFilterState,
|
|
3875
3875
|
});
|
|
3876
3876
|
} })),
|
|
@@ -3881,7 +3881,7 @@ const LogReviewer = (props) => {
|
|
|
3881
3881
|
.trim()
|
|
3882
3882
|
.toUpperCase());
|
|
3883
3883
|
dispatch({
|
|
3884
|
-
type: ActionType$
|
|
3884
|
+
type: ActionType$6.UpdateActionErrorFilterState,
|
|
3885
3885
|
actionErrorFilterState,
|
|
3886
3886
|
});
|
|
3887
3887
|
} }))))));
|
|
@@ -3895,7 +3895,7 @@ const LogReviewer = (props) => {
|
|
|
3895
3895
|
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) => {
|
|
3896
3896
|
advancedFilterState.userFirstName = e.target.value;
|
|
3897
3897
|
dispatch({
|
|
3898
|
-
type: ActionType$
|
|
3898
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3899
3899
|
advancedFilterState,
|
|
3900
3900
|
});
|
|
3901
3901
|
} })),
|
|
@@ -3904,7 +3904,7 @@ const LogReviewer = (props) => {
|
|
|
3904
3904
|
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) => {
|
|
3905
3905
|
advancedFilterState.userLastName = e.target.value;
|
|
3906
3906
|
dispatch({
|
|
3907
|
-
type: ActionType$
|
|
3907
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3908
3908
|
advancedFilterState,
|
|
3909
3909
|
});
|
|
3910
3910
|
} })),
|
|
@@ -3914,7 +3914,7 @@ const LogReviewer = (props) => {
|
|
|
3914
3914
|
advancedFilterState.userEmail = ((e.target.value)
|
|
3915
3915
|
.trim());
|
|
3916
3916
|
dispatch({
|
|
3917
|
-
type: ActionType$
|
|
3917
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3918
3918
|
advancedFilterState,
|
|
3919
3919
|
});
|
|
3920
3920
|
} })),
|
|
@@ -3928,7 +3928,7 @@ const LogReviewer = (props) => {
|
|
|
3928
3928
|
.trim());
|
|
3929
3929
|
}
|
|
3930
3930
|
dispatch({
|
|
3931
|
-
type: ActionType$
|
|
3931
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3932
3932
|
advancedFilterState,
|
|
3933
3933
|
});
|
|
3934
3934
|
} })),
|
|
@@ -3936,21 +3936,21 @@ const LogReviewer = (props) => {
|
|
|
3936
3936
|
React__default.createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
3937
3937
|
advancedFilterState.includeLearners = checked;
|
|
3938
3938
|
dispatch({
|
|
3939
|
-
type: ActionType$
|
|
3939
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3940
3940
|
advancedFilterState,
|
|
3941
3941
|
});
|
|
3942
3942
|
}, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
|
|
3943
3943
|
React__default.createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
3944
3944
|
advancedFilterState.includeTTMs = checked;
|
|
3945
3945
|
dispatch({
|
|
3946
|
-
type: ActionType$
|
|
3946
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3947
3947
|
advancedFilterState,
|
|
3948
3948
|
});
|
|
3949
3949
|
}, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
|
|
3950
3950
|
React__default.createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
3951
3951
|
advancedFilterState.includeAdmins = checked;
|
|
3952
3952
|
dispatch({
|
|
3953
|
-
type: ActionType$
|
|
3953
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3954
3954
|
advancedFilterState,
|
|
3955
3955
|
});
|
|
3956
3956
|
}, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
|
|
@@ -3960,7 +3960,7 @@ const LogReviewer = (props) => {
|
|
|
3960
3960
|
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) => {
|
|
3961
3961
|
advancedFilterState.courseName = e.target.value;
|
|
3962
3962
|
dispatch({
|
|
3963
|
-
type: ActionType$
|
|
3963
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3964
3964
|
advancedFilterState,
|
|
3965
3965
|
});
|
|
3966
3966
|
} })),
|
|
@@ -3974,7 +3974,7 @@ const LogReviewer = (props) => {
|
|
|
3974
3974
|
.trim());
|
|
3975
3975
|
}
|
|
3976
3976
|
dispatch({
|
|
3977
|
-
type: ActionType$
|
|
3977
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3978
3978
|
advancedFilterState,
|
|
3979
3979
|
});
|
|
3980
3980
|
} }))),
|
|
@@ -3983,21 +3983,21 @@ const LogReviewer = (props) => {
|
|
|
3983
3983
|
React__default.createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
|
|
3984
3984
|
advancedFilterState.isMobile = undefined;
|
|
3985
3985
|
dispatch({
|
|
3986
|
-
type: ActionType$
|
|
3986
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3987
3987
|
advancedFilterState,
|
|
3988
3988
|
});
|
|
3989
3989
|
} }),
|
|
3990
3990
|
React__default.createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
|
|
3991
3991
|
advancedFilterState.isMobile = true;
|
|
3992
3992
|
dispatch({
|
|
3993
|
-
type: ActionType$
|
|
3993
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
3994
3994
|
advancedFilterState,
|
|
3995
3995
|
});
|
|
3996
3996
|
} }),
|
|
3997
3997
|
React__default.createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
|
|
3998
3998
|
advancedFilterState.isMobile = false;
|
|
3999
3999
|
dispatch({
|
|
4000
|
-
type: ActionType$
|
|
4000
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4001
4001
|
advancedFilterState,
|
|
4002
4002
|
});
|
|
4003
4003
|
}, noMarginOnRight: true }))),
|
|
@@ -4006,21 +4006,21 @@ const LogReviewer = (props) => {
|
|
|
4006
4006
|
React__default.createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
|
|
4007
4007
|
advancedFilterState.source = undefined;
|
|
4008
4008
|
dispatch({
|
|
4009
|
-
type: ActionType$
|
|
4009
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4010
4010
|
advancedFilterState,
|
|
4011
4011
|
});
|
|
4012
4012
|
} }),
|
|
4013
4013
|
React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
|
|
4014
4014
|
advancedFilterState.source = LogSource$1.Client;
|
|
4015
4015
|
dispatch({
|
|
4016
|
-
type: ActionType$
|
|
4016
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4017
4017
|
advancedFilterState,
|
|
4018
4018
|
});
|
|
4019
4019
|
} }),
|
|
4020
4020
|
React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
|
|
4021
4021
|
advancedFilterState.source = LogSource$1.Server;
|
|
4022
4022
|
dispatch({
|
|
4023
|
-
type: ActionType$
|
|
4023
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4024
4024
|
advancedFilterState,
|
|
4025
4025
|
});
|
|
4026
4026
|
}, noMarginOnRight: true })),
|
|
@@ -4031,7 +4031,7 @@ const LogReviewer = (props) => {
|
|
|
4031
4031
|
advancedFilterState.courseName = ((e.target.value)
|
|
4032
4032
|
.trim());
|
|
4033
4033
|
dispatch({
|
|
4034
|
-
type: ActionType$
|
|
4034
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4035
4035
|
advancedFilterState,
|
|
4036
4036
|
});
|
|
4037
4037
|
} })),
|
|
@@ -4041,7 +4041,7 @@ const LogReviewer = (props) => {
|
|
|
4041
4041
|
advancedFilterState.courseName = ((e.target.value)
|
|
4042
4042
|
.trim());
|
|
4043
4043
|
dispatch({
|
|
4044
|
-
type: ActionType$
|
|
4044
|
+
type: ActionType$6.UpdateAdvancedFilterState,
|
|
4045
4045
|
advancedFilterState,
|
|
4046
4046
|
});
|
|
4047
4047
|
} })))))));
|
|
@@ -39646,11 +39646,11 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
39646
39646
|
*/
|
|
39647
39647
|
/* ------------- Actions ------------ */
|
|
39648
39648
|
// Types of actions
|
|
39649
|
-
var ActionType$
|
|
39649
|
+
var ActionType$5;
|
|
39650
39650
|
(function (ActionType) {
|
|
39651
39651
|
// Update the input value
|
|
39652
39652
|
ActionType["SetInputValue"] = "SetInputValue";
|
|
39653
|
-
})(ActionType$
|
|
39653
|
+
})(ActionType$5 || (ActionType$5 = {}));
|
|
39654
39654
|
/**
|
|
39655
39655
|
* Reducer that executes actions
|
|
39656
39656
|
* @author Yuen Ler Chow
|
|
@@ -39658,9 +39658,9 @@ var ActionType$4;
|
|
|
39658
39658
|
* @param action action to execute
|
|
39659
39659
|
* @returns updated state
|
|
39660
39660
|
*/
|
|
39661
|
-
const reducer$
|
|
39661
|
+
const reducer$5 = (state, action) => {
|
|
39662
39662
|
switch (action.type) {
|
|
39663
|
-
case ActionType$
|
|
39663
|
+
case ActionType$5.SetInputValue: {
|
|
39664
39664
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
39665
39665
|
}
|
|
39666
39666
|
default: {
|
|
@@ -39680,7 +39680,7 @@ const CreatableMultiselect = (props) => {
|
|
|
39680
39680
|
inputValue: '',
|
|
39681
39681
|
};
|
|
39682
39682
|
// Initialize state
|
|
39683
|
-
const [state, dispatch] = useReducer(reducer$
|
|
39683
|
+
const [state, dispatch] = useReducer(reducer$5, initialState);
|
|
39684
39684
|
// Destructure common state
|
|
39685
39685
|
const { inputValue } = state;
|
|
39686
39686
|
/*------------------------------------------------------------------------*/
|
|
@@ -39757,7 +39757,7 @@ const CreatableMultiselect = (props) => {
|
|
|
39757
39757
|
}
|
|
39758
39758
|
// Reset text field to empty because the values have been added
|
|
39759
39759
|
dispatch({
|
|
39760
|
-
type: ActionType$
|
|
39760
|
+
type: ActionType$5.SetInputValue,
|
|
39761
39761
|
value: '',
|
|
39762
39762
|
});
|
|
39763
39763
|
};
|
|
@@ -39796,7 +39796,7 @@ const CreatableMultiselect = (props) => {
|
|
|
39796
39796
|
else {
|
|
39797
39797
|
// simply update the input value to the new input value
|
|
39798
39798
|
dispatch({
|
|
39799
|
-
type: ActionType$
|
|
39799
|
+
type: ActionType$5.SetInputValue,
|
|
39800
39800
|
value: newValue,
|
|
39801
39801
|
});
|
|
39802
39802
|
}
|
|
@@ -39848,13 +39848,13 @@ const style$2 = `
|
|
|
39848
39848
|
`;
|
|
39849
39849
|
/* ------------- Actions ------------ */
|
|
39850
39850
|
// Types of actions
|
|
39851
|
-
var ActionType$
|
|
39851
|
+
var ActionType$4;
|
|
39852
39852
|
(function (ActionType) {
|
|
39853
39853
|
// Update the DBEntry
|
|
39854
39854
|
ActionType["UpdateDBEntry"] = "UpdateDBEntry";
|
|
39855
39855
|
// Start the save spinner
|
|
39856
39856
|
ActionType["StartSave"] = "StartSave";
|
|
39857
|
-
})(ActionType$
|
|
39857
|
+
})(ActionType$4 || (ActionType$4 = {}));
|
|
39858
39858
|
/**
|
|
39859
39859
|
* Reducer that executes actions
|
|
39860
39860
|
* @author Yuen Ler Chow
|
|
@@ -39862,12 +39862,12 @@ var ActionType$3;
|
|
|
39862
39862
|
* @param action action to execute
|
|
39863
39863
|
* @returns updated state
|
|
39864
39864
|
*/
|
|
39865
|
-
const reducer$
|
|
39865
|
+
const reducer$4 = (state, action) => {
|
|
39866
39866
|
switch (action.type) {
|
|
39867
|
-
case ActionType$
|
|
39867
|
+
case ActionType$4.UpdateDBEntry: {
|
|
39868
39868
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
39869
39869
|
}
|
|
39870
|
-
case ActionType$
|
|
39870
|
+
case ActionType$4.StartSave: {
|
|
39871
39871
|
return Object.assign(Object.assign({}, state), { saving: true });
|
|
39872
39872
|
}
|
|
39873
39873
|
default: {
|
|
@@ -39892,7 +39892,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39892
39892
|
saving: false,
|
|
39893
39893
|
};
|
|
39894
39894
|
// Initialize state
|
|
39895
|
-
const [state, dispatch] = useReducer(reducer$
|
|
39895
|
+
const [state, dispatch] = useReducer(reducer$4, initialState);
|
|
39896
39896
|
// Destructure common state
|
|
39897
39897
|
const { entry, saving, } = state;
|
|
39898
39898
|
/*------------------------------------------------------------------------*/
|
|
@@ -39904,7 +39904,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39904
39904
|
*/
|
|
39905
39905
|
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39906
39906
|
// Start the save loading indicator
|
|
39907
|
-
dispatch({ type: ActionType$
|
|
39907
|
+
dispatch({ type: ActionType$4.StartSave });
|
|
39908
39908
|
// add all default values to the entry
|
|
39909
39909
|
entryFields.forEach((field) => {
|
|
39910
39910
|
if (field.defaultValue && !entry[field.objectKey]) {
|
|
@@ -40087,7 +40087,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
40087
40087
|
return (React__default.createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
|
|
40088
40088
|
entry[field.objectKey] = choice.value;
|
|
40089
40089
|
dispatch({
|
|
40090
|
-
type: ActionType$
|
|
40090
|
+
type: ActionType$4.UpdateDBEntry,
|
|
40091
40091
|
dbEntry: entry,
|
|
40092
40092
|
});
|
|
40093
40093
|
}, ariaLabel: choice.title }));
|
|
@@ -40099,7 +40099,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
40099
40099
|
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) => {
|
|
40100
40100
|
entry[field.objectKey] = (e.target.value);
|
|
40101
40101
|
dispatch({
|
|
40102
|
-
type: ActionType$
|
|
40102
|
+
type: ActionType$4.UpdateDBEntry,
|
|
40103
40103
|
dbEntry: entry,
|
|
40104
40104
|
});
|
|
40105
40105
|
} }))));
|
|
@@ -40112,7 +40112,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
40112
40112
|
entry[field.objectKey] = (e.target.value
|
|
40113
40113
|
.replace(/[^0-9]/g, ''));
|
|
40114
40114
|
dispatch({
|
|
40115
|
-
type: ActionType$
|
|
40115
|
+
type: ActionType$4.UpdateDBEntry,
|
|
40116
40116
|
dbEntry: entry,
|
|
40117
40117
|
});
|
|
40118
40118
|
} }))));
|
|
@@ -40142,7 +40142,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
40142
40142
|
}
|
|
40143
40143
|
// Save
|
|
40144
40144
|
dispatch({
|
|
40145
|
-
type: ActionType$
|
|
40145
|
+
type: ActionType$4.UpdateDBEntry,
|
|
40146
40146
|
dbEntry: entry,
|
|
40147
40147
|
});
|
|
40148
40148
|
}, ariaLabel: choice.title }));
|
|
@@ -40157,7 +40157,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
40157
40157
|
// Update entry and save
|
|
40158
40158
|
entry[field.objectKey] = values;
|
|
40159
40159
|
dispatch({
|
|
40160
|
-
type: ActionType$
|
|
40160
|
+
type: ActionType$4.UpdateDBEntry,
|
|
40161
40161
|
dbEntry: entry,
|
|
40162
40162
|
});
|
|
40163
40163
|
} })))));
|
|
@@ -40170,7 +40170,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
40170
40170
|
React__default.createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
|
|
40171
40171
|
entry[field.objectKey] = values;
|
|
40172
40172
|
dispatch({
|
|
40173
|
-
type: ActionType$
|
|
40173
|
+
type: ActionType$4.UpdateDBEntry,
|
|
40174
40174
|
dbEntry: entry,
|
|
40175
40175
|
});
|
|
40176
40176
|
} })))));
|
|
@@ -40244,7 +40244,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
|
|
|
40244
40244
|
*/
|
|
40245
40245
|
/* ------------- Actions ------------ */
|
|
40246
40246
|
// Types of actions
|
|
40247
|
-
var ActionType$
|
|
40247
|
+
var ActionType$3;
|
|
40248
40248
|
(function (ActionType) {
|
|
40249
40249
|
// Show adder
|
|
40250
40250
|
ActionType["ShowAdder"] = "ShowAdder";
|
|
@@ -40258,7 +40258,7 @@ var ActionType$2;
|
|
|
40258
40258
|
ActionType["StartDelete"] = "StartDelete";
|
|
40259
40259
|
// Finish deletion process
|
|
40260
40260
|
ActionType["FinishDelete"] = "FinishDelete";
|
|
40261
|
-
})(ActionType$
|
|
40261
|
+
})(ActionType$3 || (ActionType$3 = {}));
|
|
40262
40262
|
/**
|
|
40263
40263
|
* Reducer that executes actions
|
|
40264
40264
|
* @author Yuen Ler Chow
|
|
@@ -40266,18 +40266,18 @@ var ActionType$2;
|
|
|
40266
40266
|
* @param action action to execute
|
|
40267
40267
|
* @returns updated state
|
|
40268
40268
|
*/
|
|
40269
|
-
const reducer$
|
|
40269
|
+
const reducer$3 = (state, action) => {
|
|
40270
40270
|
switch (action.type) {
|
|
40271
|
-
case ActionType$
|
|
40271
|
+
case ActionType$3.FinishLoading: {
|
|
40272
40272
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
40273
40273
|
}
|
|
40274
|
-
case ActionType$
|
|
40274
|
+
case ActionType$3.ShowAdder: {
|
|
40275
40275
|
return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
|
|
40276
40276
|
}
|
|
40277
|
-
case ActionType$
|
|
40277
|
+
case ActionType$3.ShowEditor: {
|
|
40278
40278
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
|
|
40279
40279
|
}
|
|
40280
|
-
case ActionType$
|
|
40280
|
+
case ActionType$3.FinishAdd: {
|
|
40281
40281
|
// Handle cancel
|
|
40282
40282
|
const finishedEntry = action.dbEntry;
|
|
40283
40283
|
if (!finishedEntry) {
|
|
@@ -40301,10 +40301,10 @@ const reducer$2 = (state, action) => {
|
|
|
40301
40301
|
// Update the state
|
|
40302
40302
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
|
|
40303
40303
|
}
|
|
40304
|
-
case ActionType$
|
|
40304
|
+
case ActionType$3.StartDelete: {
|
|
40305
40305
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
40306
40306
|
}
|
|
40307
|
-
case ActionType$
|
|
40307
|
+
case ActionType$3.FinishDelete: {
|
|
40308
40308
|
return Object.assign(Object.assign({}, state), { loading: false,
|
|
40309
40309
|
// Remove the deleted entry from the list
|
|
40310
40310
|
dbEntries: state.dbEntries.filter((entry) => {
|
|
@@ -40330,7 +40330,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40330
40330
|
loading: true,
|
|
40331
40331
|
};
|
|
40332
40332
|
// Initialize state
|
|
40333
|
-
const [state, dispatch] = useReducer(reducer$
|
|
40333
|
+
const [state, dispatch] = useReducer(reducer$3, initialState);
|
|
40334
40334
|
// Destructure common state
|
|
40335
40335
|
const { adding, dbEntryToEdit, dbEntries, loading, } = state;
|
|
40336
40336
|
/*------------------------------------------------------------------------*/
|
|
@@ -40356,7 +40356,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40356
40356
|
try {
|
|
40357
40357
|
// Start loader
|
|
40358
40358
|
dispatch({
|
|
40359
|
-
type: ActionType$
|
|
40359
|
+
type: ActionType$3.StartDelete,
|
|
40360
40360
|
});
|
|
40361
40361
|
// Perform deletion
|
|
40362
40362
|
yield visitServerEndpoint({
|
|
@@ -40365,7 +40365,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40365
40365
|
});
|
|
40366
40366
|
// Finish loader
|
|
40367
40367
|
dispatch({
|
|
40368
|
-
type: ActionType$
|
|
40368
|
+
type: ActionType$3.FinishDelete,
|
|
40369
40369
|
dbEntry: entry,
|
|
40370
40370
|
idPropName,
|
|
40371
40371
|
});
|
|
@@ -40394,7 +40394,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40394
40394
|
});
|
|
40395
40395
|
// Save loaded data
|
|
40396
40396
|
dispatch({
|
|
40397
|
-
type: ActionType$
|
|
40397
|
+
type: ActionType$3.FinishLoading,
|
|
40398
40398
|
dbEntries: data,
|
|
40399
40399
|
});
|
|
40400
40400
|
}
|
|
@@ -40437,7 +40437,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40437
40437
|
React__default.createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
|
|
40438
40438
|
!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: () => {
|
|
40439
40439
|
dispatch({
|
|
40440
|
-
type: ActionType$
|
|
40440
|
+
type: ActionType$3.ShowEditor,
|
|
40441
40441
|
dbEntry: entry,
|
|
40442
40442
|
});
|
|
40443
40443
|
} },
|
|
@@ -40447,7 +40447,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40447
40447
|
React__default.createElement("div", { className: "d-grid" },
|
|
40448
40448
|
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: () => {
|
|
40449
40449
|
dispatch({
|
|
40450
|
-
type: ActionType$
|
|
40450
|
+
type: ActionType$3.ShowAdder,
|
|
40451
40451
|
});
|
|
40452
40452
|
} },
|
|
40453
40453
|
React__default.createElement(FontAwesomeIcon, { icon: faPlus, className: "me-2" }),
|
|
@@ -40459,7 +40459,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40459
40459
|
if (!loading && (adding || dbEntryToEdit)) {
|
|
40460
40460
|
body = (React__default.createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
|
|
40461
40461
|
dispatch({
|
|
40462
|
-
type: ActionType$
|
|
40462
|
+
type: ActionType$3.FinishAdd,
|
|
40463
40463
|
dbEntry: entry,
|
|
40464
40464
|
idPropName,
|
|
40465
40465
|
});
|
|
@@ -40656,7 +40656,7 @@ const style$1 = `
|
|
|
40656
40656
|
`;
|
|
40657
40657
|
/* ------------- Actions ------------ */
|
|
40658
40658
|
// Types of actions
|
|
40659
|
-
var ActionType$
|
|
40659
|
+
var ActionType$2;
|
|
40660
40660
|
(function (ActionType) {
|
|
40661
40661
|
// Make the tooltip visible
|
|
40662
40662
|
ActionType["Show"] = "Show";
|
|
@@ -40668,28 +40668,28 @@ var ActionType$1;
|
|
|
40668
40668
|
ActionType["SetSquareBottomLeft"] = "SetSquareBottomLeft";
|
|
40669
40669
|
// Set whether bottom right corner should be square
|
|
40670
40670
|
ActionType["SetSquareBottomRight"] = "SetSquareBottomRight";
|
|
40671
|
-
})(ActionType$
|
|
40671
|
+
})(ActionType$2 || (ActionType$2 = {}));
|
|
40672
40672
|
/**
|
|
40673
40673
|
* Reducer that executes actions
|
|
40674
40674
|
* @author Gabe Abrams
|
|
40675
40675
|
* @param state current state
|
|
40676
40676
|
* @param action action to execute
|
|
40677
40677
|
*/
|
|
40678
|
-
const reducer$
|
|
40678
|
+
const reducer$2 = (state, action) => {
|
|
40679
40679
|
switch (action.type) {
|
|
40680
|
-
case ActionType$
|
|
40680
|
+
case ActionType$2.Show: {
|
|
40681
40681
|
return Object.assign(Object.assign({}, state), { isVisible: true });
|
|
40682
40682
|
}
|
|
40683
|
-
case ActionType$
|
|
40683
|
+
case ActionType$2.Hide: {
|
|
40684
40684
|
return Object.assign(Object.assign({}, state), { isVisible: false, nudgePx: 0 });
|
|
40685
40685
|
}
|
|
40686
|
-
case ActionType$
|
|
40686
|
+
case ActionType$2.SetNudgePx: {
|
|
40687
40687
|
return Object.assign(Object.assign({}, state), { nudgePx: action.nudgePx });
|
|
40688
40688
|
}
|
|
40689
|
-
case ActionType$
|
|
40689
|
+
case ActionType$2.SetSquareBottomLeft: {
|
|
40690
40690
|
return Object.assign(Object.assign({}, state), { squareBottomLeft: action.squareBottomLeft });
|
|
40691
40691
|
}
|
|
40692
|
-
case ActionType$
|
|
40692
|
+
case ActionType$2.SetSquareBottomRight: {
|
|
40693
40693
|
return Object.assign(Object.assign({}, state), { squareBottomRight: action.squareBottomRight });
|
|
40694
40694
|
}
|
|
40695
40695
|
default: {
|
|
@@ -40714,7 +40714,7 @@ const Tooltip = (props) => {
|
|
|
40714
40714
|
nudgePx: 0,
|
|
40715
40715
|
};
|
|
40716
40716
|
// Initialize state
|
|
40717
|
-
const [state, dispatch] = useReducer(reducer$
|
|
40717
|
+
const [state, dispatch] = useReducer(reducer$2, initialState);
|
|
40718
40718
|
// Destructure common state
|
|
40719
40719
|
const { isVisible, nudgePx, squareBottomLeft, squareBottomRight, } = state;
|
|
40720
40720
|
/* -------------- Refs -------------- */
|
|
@@ -40753,7 +40753,7 @@ const Tooltip = (props) => {
|
|
|
40753
40753
|
}
|
|
40754
40754
|
// Update state
|
|
40755
40755
|
dispatch({
|
|
40756
|
-
type: ActionType$
|
|
40756
|
+
type: ActionType$2.SetNudgePx,
|
|
40757
40757
|
nudgePx: newNudgePx,
|
|
40758
40758
|
});
|
|
40759
40759
|
}
|
|
@@ -40767,12 +40767,12 @@ const Tooltip = (props) => {
|
|
|
40767
40767
|
const remInPixels = Number.parseInt(getComputedStyle(document.documentElement).fontSize, 10);
|
|
40768
40768
|
// Set bottom left corner rounding
|
|
40769
40769
|
dispatch({
|
|
40770
|
-
type: ActionType$
|
|
40770
|
+
type: ActionType$2.SetSquareBottomLeft,
|
|
40771
40771
|
squareBottomLeft: (arrowRect.left < (TOOLTIP_BORDER_RADIUS_REM * remInPixels)),
|
|
40772
40772
|
});
|
|
40773
40773
|
// Set bottom right corner rounding
|
|
40774
40774
|
dispatch({
|
|
40775
|
-
type: ActionType$
|
|
40775
|
+
type: ActionType$2.SetSquareBottomRight,
|
|
40776
40776
|
squareBottomRight: (arrowRect.right
|
|
40777
40777
|
> window.innerWidth - (TOOLTIP_BORDER_RADIUS_REM * remInPixels)),
|
|
40778
40778
|
});
|
|
@@ -40795,19 +40795,19 @@ const Tooltip = (props) => {
|
|
|
40795
40795
|
// Render
|
|
40796
40796
|
return (React__default.createElement("div", { className: `Tooltip-outer-container ${containerIsDisplayBlock ? 'd-block' : 'd-inline-block'}}`, "aria-label": text, onMouseEnter: () => {
|
|
40797
40797
|
dispatch({
|
|
40798
|
-
type: ActionType$
|
|
40798
|
+
type: ActionType$2.Show,
|
|
40799
40799
|
});
|
|
40800
40800
|
}, onMouseLeave: () => {
|
|
40801
40801
|
dispatch({
|
|
40802
|
-
type: ActionType$
|
|
40802
|
+
type: ActionType$2.Hide,
|
|
40803
40803
|
});
|
|
40804
40804
|
}, onFocus: () => {
|
|
40805
40805
|
dispatch({
|
|
40806
|
-
type: ActionType$
|
|
40806
|
+
type: ActionType$2.Show,
|
|
40807
40807
|
});
|
|
40808
40808
|
}, onBlur: () => {
|
|
40809
40809
|
dispatch({
|
|
40810
|
-
type: ActionType$
|
|
40810
|
+
type: ActionType$2.Hide,
|
|
40811
40811
|
});
|
|
40812
40812
|
} },
|
|
40813
40813
|
React__default.createElement("style", null, style$1),
|
|
@@ -40960,25 +40960,25 @@ const getItemIds = (items) => {
|
|
|
40960
40960
|
};
|
|
40961
40961
|
/* ------------- Actions ------------ */
|
|
40962
40962
|
// Types of actions
|
|
40963
|
-
var ActionType;
|
|
40963
|
+
var ActionType$1;
|
|
40964
40964
|
(function (ActionType) {
|
|
40965
40965
|
// Hide the "jump to bottom" button
|
|
40966
40966
|
ActionType["HideJumpToBottomButton"] = "HideJumpToBottomButton";
|
|
40967
40967
|
// Show the "jump to bottom" button
|
|
40968
40968
|
ActionType["ShowJumpToBottomButton"] = "ShowJumpToBottomButton";
|
|
40969
|
-
})(ActionType || (ActionType = {}));
|
|
40969
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
40970
40970
|
/**
|
|
40971
40971
|
* Reducer that executes actions
|
|
40972
40972
|
* @author Gabe Abrams
|
|
40973
40973
|
* @param state current state
|
|
40974
40974
|
* @param action action to execute
|
|
40975
40975
|
*/
|
|
40976
|
-
const reducer = (state, action) => {
|
|
40976
|
+
const reducer$1 = (state, action) => {
|
|
40977
40977
|
switch (action.type) {
|
|
40978
|
-
case ActionType.HideJumpToBottomButton: {
|
|
40978
|
+
case ActionType$1.HideJumpToBottomButton: {
|
|
40979
40979
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
|
|
40980
40980
|
}
|
|
40981
|
-
case ActionType.ShowJumpToBottomButton: {
|
|
40981
|
+
case ActionType$1.ShowJumpToBottomButton: {
|
|
40982
40982
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: true });
|
|
40983
40983
|
}
|
|
40984
40984
|
default: {
|
|
@@ -41002,7 +41002,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
41002
41002
|
jumpToBottomButtonVisible: false,
|
|
41003
41003
|
};
|
|
41004
41004
|
// Initialize state
|
|
41005
|
-
const [state, dispatch] = useReducer(reducer, initialState);
|
|
41005
|
+
const [state, dispatch] = useReducer(reducer$1, initialState);
|
|
41006
41006
|
// Destructure common state
|
|
41007
41007
|
const { jumpToBottomButtonVisible, } = state;
|
|
41008
41008
|
/* -------------- Refs -------------- */
|
|
@@ -41048,7 +41048,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
41048
41048
|
}
|
|
41049
41049
|
// Update state
|
|
41050
41050
|
dispatch({
|
|
41051
|
-
type: ActionType.HideJumpToBottomButton,
|
|
41051
|
+
type: ActionType$1.HideJumpToBottomButton,
|
|
41052
41052
|
});
|
|
41053
41053
|
// Scroll to bottom
|
|
41054
41054
|
container.current.scrollTop = (container.current.scrollHeight
|
|
@@ -41072,7 +41072,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
41072
41072
|
if (isScrolledToBottom()) {
|
|
41073
41073
|
// Hide button
|
|
41074
41074
|
dispatch({
|
|
41075
|
-
type: ActionType.HideJumpToBottomButton,
|
|
41075
|
+
type: ActionType$1.HideJumpToBottomButton,
|
|
41076
41076
|
});
|
|
41077
41077
|
}
|
|
41078
41078
|
};
|
|
@@ -41114,7 +41114,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
41114
41114
|
else {
|
|
41115
41115
|
// Not scrolled to bottom. Show "jump to bottom" button.
|
|
41116
41116
|
dispatch({
|
|
41117
|
-
type: ActionType.ShowJumpToBottomButton,
|
|
41117
|
+
type: ActionType$1.ShowJumpToBottomButton,
|
|
41118
41118
|
});
|
|
41119
41119
|
}
|
|
41120
41120
|
}, [items]);
|
|
@@ -41147,6 +41147,212 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
41147
41147
|
messageAfterItems)));
|
|
41148
41148
|
};
|
|
41149
41149
|
|
|
41150
|
+
/**
|
|
41151
|
+
* A switch with multiple options for selection
|
|
41152
|
+
* @author Alessandra De Lucas
|
|
41153
|
+
* @author Gabe Abrams
|
|
41154
|
+
*/
|
|
41155
|
+
/* ------------- Actions ------------ */
|
|
41156
|
+
// Types of actions
|
|
41157
|
+
var ActionType;
|
|
41158
|
+
(function (ActionType) {
|
|
41159
|
+
// Start hovering on an option
|
|
41160
|
+
ActionType["StartHover"] = "StartHover";
|
|
41161
|
+
// Stop hovering on an option
|
|
41162
|
+
ActionType["StopHover"] = "StopHover";
|
|
41163
|
+
})(ActionType || (ActionType = {}));
|
|
41164
|
+
/**
|
|
41165
|
+
* Reducer that executes actions
|
|
41166
|
+
* @author Gabe Abrams
|
|
41167
|
+
* @param state current state
|
|
41168
|
+
* @param action action to execute
|
|
41169
|
+
*/
|
|
41170
|
+
const reducer = (state, action) => {
|
|
41171
|
+
switch (action.type) {
|
|
41172
|
+
case ActionType.StartHover: {
|
|
41173
|
+
return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
|
|
41174
|
+
}
|
|
41175
|
+
case ActionType.StopHover: {
|
|
41176
|
+
return Object.assign(Object.assign({}, state), { hoveredOptionId: undefined });
|
|
41177
|
+
}
|
|
41178
|
+
default: {
|
|
41179
|
+
return state;
|
|
41180
|
+
}
|
|
41181
|
+
}
|
|
41182
|
+
};
|
|
41183
|
+
/*------------------------------------------------------------------------*/
|
|
41184
|
+
/* ------------------------------ Component ----------------------------- */
|
|
41185
|
+
/*------------------------------------------------------------------------*/
|
|
41186
|
+
const MultiSwitch = (props) => {
|
|
41187
|
+
/*------------------------------------------------------------------------*/
|
|
41188
|
+
/* -------------------------------- Setup ------------------------------- */
|
|
41189
|
+
/*------------------------------------------------------------------------*/
|
|
41190
|
+
/* -------------- Props ------------- */
|
|
41191
|
+
// Destructure all props
|
|
41192
|
+
const { options, selectedOptionId, onChange, heightRem = 3, } = props;
|
|
41193
|
+
/* -------------- State ------------- */
|
|
41194
|
+
// Initial state
|
|
41195
|
+
const initialState = {
|
|
41196
|
+
hoveredOptionId: undefined,
|
|
41197
|
+
};
|
|
41198
|
+
// Initialize state
|
|
41199
|
+
const [state, dispatch] = useReducer(reducer, initialState);
|
|
41200
|
+
// Destructure common state
|
|
41201
|
+
const { hoveredOptionId, } = state;
|
|
41202
|
+
/*------------------------------------------------------------------------*/
|
|
41203
|
+
/* -------------------------------- Style ------------------------------- */
|
|
41204
|
+
/*------------------------------------------------------------------------*/
|
|
41205
|
+
// Calculate the index of the selected option
|
|
41206
|
+
const selectedOptionIndex = options.findIndex((option) => {
|
|
41207
|
+
return (option.id === selectedOptionId);
|
|
41208
|
+
});
|
|
41209
|
+
// Constants
|
|
41210
|
+
const gutterRems = heightRem * 0.1;
|
|
41211
|
+
const itemWidthRems = heightRem * 1.3;
|
|
41212
|
+
const textFontSize = heightRem / 3.5;
|
|
41213
|
+
const iconFontSize = heightRem / 2;
|
|
41214
|
+
const borderWidthRems = 0.05;
|
|
41215
|
+
// Style
|
|
41216
|
+
const style = `
|
|
41217
|
+
.MultiSwitch-outer-box {
|
|
41218
|
+
display: inline-block !important;
|
|
41219
|
+
position: relative;
|
|
41220
|
+
border-radius: 0.5rem !important;
|
|
41221
|
+
border: ${borderWidthRems}rem solid #666 !important;
|
|
41222
|
+
padding: 0 !important;
|
|
41223
|
+
height: ${heightRem}rem !important;
|
|
41224
|
+
width: ${gutterRems + (2 * borderWidthRems) + options.length * (itemWidthRems + gutterRems)}rem !important;
|
|
41225
|
+
overflow: visible !important;
|
|
41226
|
+
text-wrap: none !important;
|
|
41227
|
+
z-index: 0;
|
|
41228
|
+
}
|
|
41229
|
+
|
|
41230
|
+
.MultiSwitch-options-container {
|
|
41231
|
+
position: relative;
|
|
41232
|
+
display: flex;
|
|
41233
|
+
flex-direction: row;
|
|
41234
|
+
align-items: center;
|
|
41235
|
+
justify-content: flex-start;
|
|
41236
|
+
z-index: 1;
|
|
41237
|
+
margin-top: ${gutterRems}rem;
|
|
41238
|
+
width: ${gutterRems + options.length * (itemWidthRems + gutterRems)}rem;
|
|
41239
|
+
overflow: visible !important;
|
|
41240
|
+
text-wrap: none !important;
|
|
41241
|
+
}
|
|
41242
|
+
|
|
41243
|
+
.MultiSwitch-icon {
|
|
41244
|
+
font-size: ${iconFontSize}rems !important;
|
|
41245
|
+
}
|
|
41246
|
+
|
|
41247
|
+
.MultiSwitch-option-button {
|
|
41248
|
+
position: relative !important;
|
|
41249
|
+
font-size: ${textFontSize}rem !important;
|
|
41250
|
+
z-index: 1 !important;
|
|
41251
|
+
display: inline-block !important;
|
|
41252
|
+
flex-grow: 0 !important;
|
|
41253
|
+
border: 0 !important;
|
|
41254
|
+
border-radius: 0.5rem !important;
|
|
41255
|
+
width: ${itemWidthRems}rem !important;
|
|
41256
|
+
height: ${heightRem - (2 * gutterRems)}rem !important;
|
|
41257
|
+
overflow: hidden;
|
|
41258
|
+
text-overflow: ellipsis;
|
|
41259
|
+
font-size: ${heightRem / 3}rem !important;
|
|
41260
|
+
line-height: 1 !important;
|
|
41261
|
+
margin-right: 0 !important;
|
|
41262
|
+
margin-top: 0 !important;
|
|
41263
|
+
margin-bottom: 0 !important;
|
|
41264
|
+
margin-left: ${gutterRems}rem !important;
|
|
41265
|
+
color: black !important;
|
|
41266
|
+
background-color: transparent !important;
|
|
41267
|
+
transition: background-color 0.3s ease-out !important;
|
|
41268
|
+
}
|
|
41269
|
+
|
|
41270
|
+
.MultiSwitch-option-button-hovered {
|
|
41271
|
+
background-color: #eee !important;
|
|
41272
|
+
}
|
|
41273
|
+
|
|
41274
|
+
.MultiSwitch-option-text {
|
|
41275
|
+
display: inline-block;
|
|
41276
|
+
font-size: ${textFontSize}rem !important;
|
|
41277
|
+
text-overflow: ellipsis;
|
|
41278
|
+
white-space: nowrap;
|
|
41279
|
+
width: 100%;
|
|
41280
|
+
text-align: center !important;
|
|
41281
|
+
}
|
|
41282
|
+
|
|
41283
|
+
.MultiSwitch-highlight-container {
|
|
41284
|
+
position: absolute;
|
|
41285
|
+
z-index: -1;
|
|
41286
|
+
left: 0;
|
|
41287
|
+
top: 0;
|
|
41288
|
+
display: inline-block;
|
|
41289
|
+
height: 0;
|
|
41290
|
+
width: 0;
|
|
41291
|
+
overflow: visible;
|
|
41292
|
+
}
|
|
41293
|
+
|
|
41294
|
+
.MultiSwitch-highlight {
|
|
41295
|
+
position: absolute;
|
|
41296
|
+
border-radius: 0.5rem !important;
|
|
41297
|
+
width: ${itemWidthRems}rem;
|
|
41298
|
+
height: ${heightRem - (2 * gutterRems)}rem;
|
|
41299
|
+
top: ${gutterRems}rem;
|
|
41300
|
+
left: ${gutterRems}rem;
|
|
41301
|
+
transform: translate(${selectedOptionIndex * (itemWidthRems + gutterRems) + borderWidthRems}rem, -${borderWidthRems * 0.5}rem);
|
|
41302
|
+
transition: transform 0.3s ease-in-out;
|
|
41303
|
+
}
|
|
41304
|
+
`;
|
|
41305
|
+
/*------------------------------------------------------------------------*/
|
|
41306
|
+
/* ------------------------------- Render ------------------------------- */
|
|
41307
|
+
/*------------------------------------------------------------------------*/
|
|
41308
|
+
/*----------------------------------------*/
|
|
41309
|
+
/* --------------- Main UI -------------- */
|
|
41310
|
+
/*----------------------------------------*/
|
|
41311
|
+
const optionElements = options.map((option) => {
|
|
41312
|
+
return (React__default.createElement("button", { type: "button", className: `MultiSwitch-option-button${option.id === hoveredOptionId ? ' MultiSwitch-option-button-hovered' : ''}`, "aria-label": (option.id === selectedOptionId
|
|
41313
|
+
? `option "${option.label}", currently selected`
|
|
41314
|
+
: `click to select option "${option.label}"`), onClick: () => {
|
|
41315
|
+
// Remove hover
|
|
41316
|
+
dispatch({
|
|
41317
|
+
type: ActionType.StopHover,
|
|
41318
|
+
});
|
|
41319
|
+
// Notify parent
|
|
41320
|
+
onChange(option.id);
|
|
41321
|
+
}, onMouseEnter: () => {
|
|
41322
|
+
dispatch({
|
|
41323
|
+
type: ActionType.StartHover,
|
|
41324
|
+
hoveredOptionId: option.id,
|
|
41325
|
+
});
|
|
41326
|
+
}, onMouseLeave: () => {
|
|
41327
|
+
dispatch({
|
|
41328
|
+
type: ActionType.StopHover,
|
|
41329
|
+
});
|
|
41330
|
+
}, onFocus: () => {
|
|
41331
|
+
dispatch({
|
|
41332
|
+
type: ActionType.StartHover,
|
|
41333
|
+
hoveredOptionId: option.id,
|
|
41334
|
+
});
|
|
41335
|
+
}, onBlur: () => {
|
|
41336
|
+
dispatch({
|
|
41337
|
+
type: ActionType.StopHover,
|
|
41338
|
+
});
|
|
41339
|
+
}, style: {
|
|
41340
|
+
pointerEvents: ((option.id === selectedOptionId)
|
|
41341
|
+
? 'none'
|
|
41342
|
+
: undefined),
|
|
41343
|
+
}, disabled: option.id === selectedOptionId },
|
|
41344
|
+
React__default.createElement("div", { className: "MultiSelect-icon" },
|
|
41345
|
+
React__default.createElement(FontAwesomeIcon, { icon: option.icon })),
|
|
41346
|
+
React__default.createElement("div", { className: "MultiSwitch-option-text" }, option.label)));
|
|
41347
|
+
});
|
|
41348
|
+
// Highlight behind selected option
|
|
41349
|
+
const highlight = (React__default.createElement("div", { className: "MultiSwitch-highlight bg-warning d-inline-block" }));
|
|
41350
|
+
return (React__default.createElement("div", { className: "MultiSwitch-outer-box alert alert-dark" },
|
|
41351
|
+
React__default.createElement("style", null, style),
|
|
41352
|
+
React__default.createElement("div", { className: "MultiSwitch-options-container" }, optionElements),
|
|
41353
|
+
React__default.createElement("div", { className: "MultiSwitch-highlight-container" }, highlight)));
|
|
41354
|
+
};
|
|
41355
|
+
|
|
41150
41356
|
/**
|
|
41151
41357
|
* One minute in ms
|
|
41152
41358
|
* @author Gabe Abrams
|
|
@@ -43088,5 +43294,5 @@ var DayOfWeek;
|
|
|
43088
43294
|
})(DayOfWeek || (DayOfWeek = {}));
|
|
43089
43295
|
var DayOfWeek$1 = DayOfWeek;
|
|
43090
43296
|
|
|
43091
|
-
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, 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, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
|
43297
|
+
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, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
|
43092
43298
|
//# sourceMappingURL=index.js.map
|