dce-reactkit 3.8.7 → 3.9.0-beta-loading-modal.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +254 -386
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Modal/ModalProps.d.ts +2 -0
- package/dist/cjs/types/index.d.ts +1 -3
- package/dist/cjs/types/types/ReactKitErrorCode.d.ts +1 -4
- package/dist/esm/index.js +256 -386
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Modal/ModalProps.d.ts +2 -0
- package/dist/esm/types/index.d.ts +1 -3
- package/dist/esm/types/types/ReactKitErrorCode.d.ts +1 -4
- package/dist/index.d.ts +46 -83
- package/package.json +1 -2
- package/src/components/Modal/ModalProps.ts +4 -0
- package/src/components/Modal/index.tsx +49 -21
- package/src/components/MultiSwitch.tsx +1 -1
- package/src/index.ts +0 -4
- package/src/types/ReactKitErrorCode.tsx +1 -6
- package/dist/cjs/types/components/Dropdown.d.ts +0 -32
- package/dist/cjs/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/cjs/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/cjs/types/helpers/visitEndpointOnAnotherServer/index.d.ts +0 -22
- package/dist/cjs/types/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.d.ts +0 -33
- package/dist/cjs/types/types/DropdownItemType.d.ts +0 -6
- package/dist/esm/types/components/Dropdown.d.ts +0 -32
- package/dist/esm/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/esm/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/esm/types/helpers/visitEndpointOnAnotherServer/index.d.ts +0 -22
- package/dist/esm/types/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.d.ts +0 -33
- package/dist/esm/types/types/DropdownItemType.d.ts +0 -6
- package/src/components/Dropdown.tsx +0 -317
- package/src/helpers/validators/ChicagoTitleCase.test.ts +0 -85
- package/src/helpers/validators/ChicagoTitleCase.ts +0 -32
- package/src/helpers/validators/findURL.test.ts +0 -83
- package/src/helpers/validators/findURL.ts +0 -43
- package/src/helpers/validators/validURL.test.ts +0 -90
- package/src/helpers/validators/validURL.ts +0 -18
- package/src/helpers/visitEndpointOnAnotherServer/index.ts +0 -90
- package/src/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.ts +0 -164
- package/src/types/DropdownItemType.ts +0 -11
package/dist/cjs/index.js
CHANGED
|
@@ -57,7 +57,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// Highest error code =
|
|
60
|
+
// Highest error code = DRK13
|
|
61
61
|
/**
|
|
62
62
|
* List of error codes built into the react kit
|
|
63
63
|
* @author Gabe Abrams
|
|
@@ -77,10 +77,6 @@ var ReactKitErrorCode;
|
|
|
77
77
|
ReactKitErrorCode["NotAllowedToReviewLogs"] = "DRK11";
|
|
78
78
|
ReactKitErrorCode["ThemeCheckedBeforeReactKitReady"] = "DRK12";
|
|
79
79
|
ReactKitErrorCode["SessionExpiredMessageGottenBeforeReactKitReady"] = "DRK13";
|
|
80
|
-
// Server-to-server requests
|
|
81
|
-
ReactKitErrorCode["NotConnected"] = "DRK14";
|
|
82
|
-
ReactKitErrorCode["SelfSigned"] = "DRK15";
|
|
83
|
-
ReactKitErrorCode["ResponseParseError"] = "DRK16";
|
|
84
80
|
})(ReactKitErrorCode || (ReactKitErrorCode = {}));
|
|
85
81
|
var ReactKitErrorCode$1 = ReactKitErrorCode;
|
|
86
82
|
|
|
@@ -211,6 +207,98 @@ const LogBuiltInMetadata = {
|
|
|
211
207
|
},
|
|
212
208
|
};
|
|
213
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Loading spinner/indicator
|
|
212
|
+
* @author Gabe Abrams
|
|
213
|
+
*/
|
|
214
|
+
/*------------------------------------------------------------------------*/
|
|
215
|
+
/* -------------------------------- Style ------------------------------- */
|
|
216
|
+
/*------------------------------------------------------------------------*/
|
|
217
|
+
const style$a = `
|
|
218
|
+
/* Container fades in */
|
|
219
|
+
.LoadingSpinner-container {
|
|
220
|
+
animation-name: LoadingSpinner-container-fade-in;
|
|
221
|
+
animation-duration: 0.3s;
|
|
222
|
+
animation-delay: 0.4s;
|
|
223
|
+
animation-fill-mode: both;
|
|
224
|
+
animation-timing-function: ease-out;
|
|
225
|
+
}
|
|
226
|
+
@keyframes LoadingSpinner-container-fade-in {
|
|
227
|
+
0% {
|
|
228
|
+
opacity: 0;
|
|
229
|
+
}
|
|
230
|
+
100% {
|
|
231
|
+
opacity: 1;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* Blips */
|
|
236
|
+
.LoadingSpinner-blip-1,
|
|
237
|
+
.LoadingSpinner-blip-2,
|
|
238
|
+
.LoadingSpinner-blip-3,
|
|
239
|
+
.LoadingSpinner-blip-4 {
|
|
240
|
+
font-size: 1.8rem;
|
|
241
|
+
opacity: 0.6;
|
|
242
|
+
margin-top: 1rem;
|
|
243
|
+
margin-bottom: 1rem;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* First Blip */
|
|
247
|
+
.LoadingSpinner-blip-1 {
|
|
248
|
+
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Second Blip */
|
|
252
|
+
.LoadingSpinner-blip-2 {
|
|
253
|
+
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
254
|
+
-webkit-animation-delay: 0.1s;
|
|
255
|
+
animation-delay: 0.1s;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* Third Blip */
|
|
259
|
+
.LoadingSpinner-blip-3 {
|
|
260
|
+
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
261
|
+
animation-delay: 0.2s;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* Fourth Blip */
|
|
265
|
+
.LoadingSpinner-blip-4 {
|
|
266
|
+
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
267
|
+
animation-delay: 0.3s;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Pop Animation for Each Blip */
|
|
271
|
+
@keyframes LoadingSpinner-pop-animation {
|
|
272
|
+
0% {
|
|
273
|
+
transform: scale(1.0);
|
|
274
|
+
}
|
|
275
|
+
10% {
|
|
276
|
+
transform: scale(1.5);
|
|
277
|
+
}
|
|
278
|
+
30% {
|
|
279
|
+
transform: scale(1.0);
|
|
280
|
+
}
|
|
281
|
+
100% {
|
|
282
|
+
transform: scale(1.0);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
`;
|
|
286
|
+
/*------------------------------------------------------------------------*/
|
|
287
|
+
/* ------------------------------ Component ----------------------------- */
|
|
288
|
+
/*------------------------------------------------------------------------*/
|
|
289
|
+
const LoadingSpinner = () => {
|
|
290
|
+
/*------------------------------------------------------------------------*/
|
|
291
|
+
/* ------------------------------- Render ------------------------------- */
|
|
292
|
+
/*------------------------------------------------------------------------*/
|
|
293
|
+
// Add all four blips to a container
|
|
294
|
+
return (React__default["default"].createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
|
|
295
|
+
React__default["default"].createElement("style", null, style$a),
|
|
296
|
+
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-1 me-1" }),
|
|
297
|
+
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-2 me-1" }),
|
|
298
|
+
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-3 me-1" }),
|
|
299
|
+
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-4" })));
|
|
300
|
+
};
|
|
301
|
+
|
|
214
302
|
/**
|
|
215
303
|
* Wait for a certain number of ms
|
|
216
304
|
* @author Gabe Abrams
|
|
@@ -331,6 +419,7 @@ const BASE_Z_INDEX = 1000000000;
|
|
|
331
419
|
const BASE_Z_INDEX_ON_TOP = 2000000000;
|
|
332
420
|
// Constants
|
|
333
421
|
const MS_TO_ANIMATE = 200; // Animation duration
|
|
422
|
+
const MS_TO_WAIT_BEFORE_SHOWING_LOADING_INDICATOR = 1000;
|
|
334
423
|
// Modal type to list of buttons
|
|
335
424
|
const modalTypeToModalButtonTypes = {
|
|
336
425
|
[ModalType$1.Okay]: [
|
|
@@ -441,7 +530,7 @@ const getNextUniqueId = () => {
|
|
|
441
530
|
/*------------------------------------------------------------------------*/
|
|
442
531
|
/* -------------------------------- Style ------------------------------- */
|
|
443
532
|
/*------------------------------------------------------------------------*/
|
|
444
|
-
const style$
|
|
533
|
+
const style$9 = `
|
|
445
534
|
.Modal-backdrop {
|
|
446
535
|
position: fixed;
|
|
447
536
|
top: 0;
|
|
@@ -513,13 +602,14 @@ const Modal = (props) => {
|
|
|
513
602
|
/*------------------------------------------------------------------------*/
|
|
514
603
|
var _a;
|
|
515
604
|
/* -------------- Props ------------- */
|
|
516
|
-
const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, largeTitle, children, onClose, dontAllowBackdropExit, dontShowXButton, onTopOfOtherModals, } = props;
|
|
605
|
+
const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, largeTitle, children, onClose, dontAllowBackdropExit, dontShowXButton, onTopOfOtherModals, isLoading, isLoadingCancelable, } = props;
|
|
517
606
|
// Determine if no header either
|
|
518
607
|
const noHeader = (!title && type === ModalType$1.NoButtons);
|
|
519
608
|
/* -------------- State ------------- */
|
|
520
609
|
// True if animation is in use
|
|
521
610
|
const [animatingIn, setAnimatingIn] = React.useState(true);
|
|
522
611
|
const [animatingPop, setAnimatingPop] = React.useState(false);
|
|
612
|
+
const [showModal, setShowModal] = React.useState(false);
|
|
523
613
|
/* -------------- Refs -------------- */
|
|
524
614
|
// Keep track of whether modal is still mounted
|
|
525
615
|
const mounted = React.useRef(false);
|
|
@@ -546,6 +636,14 @@ const Modal = (props) => {
|
|
|
546
636
|
if (mounted.current) {
|
|
547
637
|
setAnimatingIn(false);
|
|
548
638
|
}
|
|
639
|
+
if (isLoading) {
|
|
640
|
+
// wait before showing modal
|
|
641
|
+
yield waitMs(MS_TO_WAIT_BEFORE_SHOWING_LOADING_INDICATOR);
|
|
642
|
+
setShowModal(true);
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
setShowModal(true);
|
|
646
|
+
}
|
|
549
647
|
}))();
|
|
550
648
|
return () => {
|
|
551
649
|
mounted.current = false;
|
|
@@ -612,6 +710,9 @@ const Modal = (props) => {
|
|
|
612
710
|
else if (animatingPop) {
|
|
613
711
|
animationClass = 'Modal-animating-pop';
|
|
614
712
|
}
|
|
713
|
+
// default to show close button when not loading and not show close button when loading
|
|
714
|
+
// unless downShowXButton or isLoadingCancelable
|
|
715
|
+
const showCloseButton = onClose && !dontShowXButton && !(isLoading && !isLoadingCancelable);
|
|
615
716
|
// Render the modal
|
|
616
717
|
const contentToRender = (React__default["default"].createElement("div", { className: "modal show", tabIndex: -1, style: {
|
|
617
718
|
zIndex: baseZIndex,
|
|
@@ -620,7 +721,7 @@ const Modal = (props) => {
|
|
|
620
721
|
left: 0,
|
|
621
722
|
right: 0,
|
|
622
723
|
} },
|
|
623
|
-
React__default["default"].createElement("style", null, style$
|
|
724
|
+
React__default["default"].createElement("style", null, style$9),
|
|
624
725
|
React__default["default"].createElement("div", { className: `Modal-backdrop ${backdropAnimationClass}`, style: {
|
|
625
726
|
zIndex: baseZIndex + 1,
|
|
626
727
|
}, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -638,11 +739,11 @@ const Modal = (props) => {
|
|
|
638
739
|
// Handle close
|
|
639
740
|
handleClose(ModalButtonType$1.Cancel);
|
|
640
741
|
}) }),
|
|
641
|
-
React__default["default"].createElement("div", { className: `modal-dialog modal-${size} ${animationClass} modal-dialog-scrollable modal-dialog-centered`, style: {
|
|
742
|
+
showModal && (React__default["default"].createElement("div", { className: `modal-dialog modal-${size} ${animationClass} modal-dialog-scrollable modal-dialog-centered`, style: {
|
|
642
743
|
zIndex: baseZIndex + 2,
|
|
643
744
|
// Override sizes for even larger for XL
|
|
644
745
|
width: (size === ModalSize$1.ExtraLarge
|
|
645
|
-
? 'calc(100vw -
|
|
746
|
+
? 'calc(100vw - 3rem)'
|
|
646
747
|
: undefined),
|
|
647
748
|
maxWidth: (size === ModalSize$1.ExtraLarge
|
|
648
749
|
? '80rem'
|
|
@@ -670,7 +771,7 @@ const Modal = (props) => {
|
|
|
670
771
|
? '1.6rem'
|
|
671
772
|
: undefined),
|
|
672
773
|
} }, title),
|
|
673
|
-
|
|
774
|
+
showCloseButton && (React__default["default"].createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
|
|
674
775
|
backgroundColor: (isDarkModeOn()
|
|
675
776
|
? 'white'
|
|
676
777
|
: undefined),
|
|
@@ -678,14 +779,16 @@ const Modal = (props) => {
|
|
|
678
779
|
// Handle close
|
|
679
780
|
handleClose(ModalButtonType$1.Cancel);
|
|
680
781
|
} })))),
|
|
681
|
-
|
|
782
|
+
React__default["default"].createElement("div", { className: "modal-body", style: {
|
|
682
783
|
color: (isDarkModeOn()
|
|
683
784
|
? 'white'
|
|
684
785
|
: undefined),
|
|
685
786
|
backgroundColor: (isDarkModeOn()
|
|
686
787
|
? '#444'
|
|
687
788
|
: undefined),
|
|
688
|
-
} },
|
|
789
|
+
} }, isLoading ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
790
|
+
React__default["default"].createElement(LoadingSpinner, null),
|
|
791
|
+
React__default["default"].createElement("span", { className: "sr-only" }, "Content loading"))) : (children)),
|
|
689
792
|
footer && (React__default["default"].createElement("div", { className: "modal-footer pt-1 pb-1", style: {
|
|
690
793
|
color: (isDarkModeOn()
|
|
691
794
|
? 'white'
|
|
@@ -696,7 +799,7 @@ const Modal = (props) => {
|
|
|
696
799
|
borderTop: (isDarkModeOn()
|
|
697
800
|
? '0.1rem solid gray'
|
|
698
801
|
: undefined),
|
|
699
|
-
} }, footer))))));
|
|
802
|
+
} }, footer)))))));
|
|
700
803
|
// Determine which portal to use
|
|
701
804
|
const portalNumber = id.current % NUM_MODAL_PORTALS;
|
|
702
805
|
// Render in a portal
|
|
@@ -1176,7 +1279,7 @@ const showSessionExpiredMessage = () => __awaiter(void 0, void 0, void 0, functi
|
|
|
1176
1279
|
/*------------------------------------------------------------------------*/
|
|
1177
1280
|
/* -------------------------------- Style ------------------------------- */
|
|
1178
1281
|
/*------------------------------------------------------------------------*/
|
|
1179
|
-
const style$
|
|
1282
|
+
const style$8 = `
|
|
1180
1283
|
.AppWrapper-leave-to-url-notice {
|
|
1181
1284
|
opacity: 0;
|
|
1182
1285
|
|
|
@@ -1351,105 +1454,13 @@ const AppWrapper = (props) => {
|
|
|
1351
1454
|
/* --------------- Main UI -------------- */
|
|
1352
1455
|
/*----------------------------------------*/
|
|
1353
1456
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1354
|
-
React__default["default"].createElement("style", null, style$
|
|
1457
|
+
React__default["default"].createElement("style", null, style$8),
|
|
1355
1458
|
React__default["default"].createElement("style", null, tooltipStyle),
|
|
1356
1459
|
modal,
|
|
1357
1460
|
customModalPortals,
|
|
1358
1461
|
body));
|
|
1359
1462
|
};
|
|
1360
1463
|
|
|
1361
|
-
/**
|
|
1362
|
-
* Loading spinner/indicator
|
|
1363
|
-
* @author Gabe Abrams
|
|
1364
|
-
*/
|
|
1365
|
-
/*------------------------------------------------------------------------*/
|
|
1366
|
-
/* -------------------------------- Style ------------------------------- */
|
|
1367
|
-
/*------------------------------------------------------------------------*/
|
|
1368
|
-
const style$8 = `
|
|
1369
|
-
/* Container fades in */
|
|
1370
|
-
.LoadingSpinner-container {
|
|
1371
|
-
animation-name: LoadingSpinner-container-fade-in;
|
|
1372
|
-
animation-duration: 0.3s;
|
|
1373
|
-
animation-delay: 0.4s;
|
|
1374
|
-
animation-fill-mode: both;
|
|
1375
|
-
animation-timing-function: ease-out;
|
|
1376
|
-
}
|
|
1377
|
-
@keyframes LoadingSpinner-container-fade-in {
|
|
1378
|
-
0% {
|
|
1379
|
-
opacity: 0;
|
|
1380
|
-
}
|
|
1381
|
-
100% {
|
|
1382
|
-
opacity: 1;
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
/* Blips */
|
|
1387
|
-
.LoadingSpinner-blip-1,
|
|
1388
|
-
.LoadingSpinner-blip-2,
|
|
1389
|
-
.LoadingSpinner-blip-3,
|
|
1390
|
-
.LoadingSpinner-blip-4 {
|
|
1391
|
-
font-size: 1.8rem;
|
|
1392
|
-
opacity: 0.6;
|
|
1393
|
-
margin-top: 1rem;
|
|
1394
|
-
margin-bottom: 1rem;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
/* First Blip */
|
|
1398
|
-
.LoadingSpinner-blip-1 {
|
|
1399
|
-
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
/* Second Blip */
|
|
1403
|
-
.LoadingSpinner-blip-2 {
|
|
1404
|
-
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
1405
|
-
-webkit-animation-delay: 0.1s;
|
|
1406
|
-
animation-delay: 0.1s;
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
/* Third Blip */
|
|
1410
|
-
.LoadingSpinner-blip-3 {
|
|
1411
|
-
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
1412
|
-
animation-delay: 0.2s;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
/* Fourth Blip */
|
|
1416
|
-
.LoadingSpinner-blip-4 {
|
|
1417
|
-
animation: LoadingSpinner-pop-animation 2s infinite;
|
|
1418
|
-
animation-delay: 0.3s;
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
/* Pop Animation for Each Blip */
|
|
1422
|
-
@keyframes LoadingSpinner-pop-animation {
|
|
1423
|
-
0% {
|
|
1424
|
-
transform: scale(1.0);
|
|
1425
|
-
}
|
|
1426
|
-
10% {
|
|
1427
|
-
transform: scale(1.5);
|
|
1428
|
-
}
|
|
1429
|
-
30% {
|
|
1430
|
-
transform: scale(1.0);
|
|
1431
|
-
}
|
|
1432
|
-
100% {
|
|
1433
|
-
transform: scale(1.0);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
`;
|
|
1437
|
-
/*------------------------------------------------------------------------*/
|
|
1438
|
-
/* ------------------------------ Component ----------------------------- */
|
|
1439
|
-
/*------------------------------------------------------------------------*/
|
|
1440
|
-
const LoadingSpinner = () => {
|
|
1441
|
-
/*------------------------------------------------------------------------*/
|
|
1442
|
-
/* ------------------------------- Render ------------------------------- */
|
|
1443
|
-
/*------------------------------------------------------------------------*/
|
|
1444
|
-
// Add all four blips to a container
|
|
1445
|
-
return (React__default["default"].createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
|
|
1446
|
-
React__default["default"].createElement("style", null, style$8),
|
|
1447
|
-
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-1 me-1" }),
|
|
1448
|
-
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-2 me-1" }),
|
|
1449
|
-
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-3 me-1" }),
|
|
1450
|
-
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-4" })));
|
|
1451
|
-
};
|
|
1452
|
-
|
|
1453
1464
|
/**
|
|
1454
1465
|
* A box with a tab on the top that holds buttons and other content
|
|
1455
1466
|
* @author Gabe Abrams
|
|
@@ -2241,27 +2252,27 @@ const PopPendingMark = (props) => {
|
|
|
2241
2252
|
*/
|
|
2242
2253
|
/* ------------- Actions ------------ */
|
|
2243
2254
|
// Types of actions
|
|
2244
|
-
var ActionType$
|
|
2255
|
+
var ActionType$8;
|
|
2245
2256
|
(function (ActionType) {
|
|
2246
2257
|
// Indicate that the text was recently copied
|
|
2247
2258
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
2248
2259
|
// Clear the status
|
|
2249
2260
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
2250
|
-
})(ActionType$
|
|
2261
|
+
})(ActionType$8 || (ActionType$8 = {}));
|
|
2251
2262
|
/**
|
|
2252
2263
|
* Reducer that executes actions
|
|
2253
2264
|
* @author Gabe Abrams
|
|
2254
2265
|
* @param state current state
|
|
2255
2266
|
* @param action action to execute
|
|
2256
2267
|
*/
|
|
2257
|
-
const reducer$
|
|
2268
|
+
const reducer$9 = (state, action) => {
|
|
2258
2269
|
switch (action.type) {
|
|
2259
|
-
case ActionType$
|
|
2270
|
+
case ActionType$8.IndicateRecentlyCopied: {
|
|
2260
2271
|
return {
|
|
2261
2272
|
recentlyCopied: true,
|
|
2262
2273
|
};
|
|
2263
2274
|
}
|
|
2264
|
-
case ActionType$
|
|
2275
|
+
case ActionType$8.ClearRecentlyCopiedStatus: {
|
|
2265
2276
|
return {
|
|
2266
2277
|
recentlyCopied: false,
|
|
2267
2278
|
};
|
|
@@ -2287,7 +2298,7 @@ const CopiableBox = (props) => {
|
|
|
2287
2298
|
recentlyCopied: false,
|
|
2288
2299
|
};
|
|
2289
2300
|
// Initialize state
|
|
2290
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2301
|
+
const [state, dispatch] = React.useReducer(reducer$9, initialState);
|
|
2291
2302
|
// Destructure common state
|
|
2292
2303
|
const { recentlyCopied, } = state;
|
|
2293
2304
|
/*------------------------------------------------------------------------*/
|
|
@@ -2307,13 +2318,13 @@ const CopiableBox = (props) => {
|
|
|
2307
2318
|
}
|
|
2308
2319
|
// Show copied notice
|
|
2309
2320
|
dispatch({
|
|
2310
|
-
type: ActionType$
|
|
2321
|
+
type: ActionType$8.IndicateRecentlyCopied,
|
|
2311
2322
|
});
|
|
2312
2323
|
// Wait a moment
|
|
2313
2324
|
yield waitMs(4000);
|
|
2314
2325
|
// Hide copied notice
|
|
2315
2326
|
dispatch({
|
|
2316
|
-
type: ActionType$
|
|
2327
|
+
type: ActionType$8.ClearRecentlyCopiedStatus,
|
|
2317
2328
|
});
|
|
2318
2329
|
});
|
|
2319
2330
|
/*------------------------------------------------------------------------*/
|
|
@@ -2369,20 +2380,20 @@ const CopiableBox = (props) => {
|
|
|
2369
2380
|
*/
|
|
2370
2381
|
/* ------------- Actions ------------ */
|
|
2371
2382
|
// Types of actions
|
|
2372
|
-
var ActionType$
|
|
2383
|
+
var ActionType$7;
|
|
2373
2384
|
(function (ActionType) {
|
|
2374
2385
|
// Toggle whether a child are being shown
|
|
2375
2386
|
ActionType["ToggleChild"] = "toggle-child";
|
|
2376
|
-
})(ActionType$
|
|
2387
|
+
})(ActionType$7 || (ActionType$7 = {}));
|
|
2377
2388
|
/**
|
|
2378
2389
|
* Reducer that executes actions
|
|
2379
2390
|
* @author Gabe Abrams
|
|
2380
2391
|
* @param state current state
|
|
2381
2392
|
* @param action action to execute
|
|
2382
2393
|
*/
|
|
2383
|
-
const reducer$
|
|
2394
|
+
const reducer$8 = (state, action) => {
|
|
2384
2395
|
switch (action.type) {
|
|
2385
|
-
case ActionType$
|
|
2396
|
+
case ActionType$7.ToggleChild: {
|
|
2386
2397
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
2387
2398
|
}
|
|
2388
2399
|
default: {
|
|
@@ -2411,7 +2422,7 @@ const NestableItemList = (props) => {
|
|
|
2411
2422
|
childExpanded: initChildExpanded,
|
|
2412
2423
|
};
|
|
2413
2424
|
// Initialize state
|
|
2414
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2425
|
+
const [state, dispatch] = React.useReducer(reducer$8, initialState);
|
|
2415
2426
|
// Destructure common state
|
|
2416
2427
|
const { childExpanded, } = state;
|
|
2417
2428
|
/*------------------------------------------------------------------------*/
|
|
@@ -2501,7 +2512,7 @@ const NestableItemList = (props) => {
|
|
|
2501
2512
|
backgroundColor: 'transparent',
|
|
2502
2513
|
}, type: "button", onClick: () => {
|
|
2503
2514
|
dispatch({
|
|
2504
|
-
type: ActionType$
|
|
2515
|
+
type: ActionType$7.ToggleChild,
|
|
2505
2516
|
id: item.id,
|
|
2506
2517
|
});
|
|
2507
2518
|
}, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
@@ -2785,7 +2796,7 @@ var SortType;
|
|
|
2785
2796
|
})(SortType || (SortType = {}));
|
|
2786
2797
|
/* ------------- Actions ------------ */
|
|
2787
2798
|
// Types of actions
|
|
2788
|
-
var ActionType$
|
|
2799
|
+
var ActionType$6;
|
|
2789
2800
|
(function (ActionType) {
|
|
2790
2801
|
// Toggle sort column param
|
|
2791
2802
|
ActionType["ToggleSortColumn"] = "toggle-sort-column";
|
|
@@ -2797,16 +2808,16 @@ var ActionType$7;
|
|
|
2797
2808
|
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2798
2809
|
// Hide all columns
|
|
2799
2810
|
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2800
|
-
})(ActionType$
|
|
2811
|
+
})(ActionType$6 || (ActionType$6 = {}));
|
|
2801
2812
|
/**
|
|
2802
2813
|
* Reducer that executes actions
|
|
2803
2814
|
* @author Gabe Abrams
|
|
2804
2815
|
* @param state current state
|
|
2805
2816
|
* @param action action to execute
|
|
2806
2817
|
*/
|
|
2807
|
-
const reducer$
|
|
2818
|
+
const reducer$7 = (state, action) => {
|
|
2808
2819
|
switch (action.type) {
|
|
2809
|
-
case ActionType$
|
|
2820
|
+
case ActionType$6.ToggleSortColumn: {
|
|
2810
2821
|
if (action.param !== state.sortColumnParam) {
|
|
2811
2822
|
// Different column param
|
|
2812
2823
|
return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
|
|
@@ -2818,22 +2829,22 @@ const reducer$8 = (state, action) => {
|
|
|
2818
2829
|
// Stop sorting by column
|
|
2819
2830
|
return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
|
|
2820
2831
|
}
|
|
2821
|
-
case ActionType$
|
|
2832
|
+
case ActionType$6.UpdateColumnVisibility: {
|
|
2822
2833
|
const { columnVisibilityMap } = state;
|
|
2823
2834
|
columnVisibilityMap[action.param] = action.visible;
|
|
2824
2835
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2825
2836
|
}
|
|
2826
|
-
case ActionType$
|
|
2837
|
+
case ActionType$6.ToggleColVisCusModalVisibility: {
|
|
2827
2838
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2828
2839
|
}
|
|
2829
|
-
case ActionType$
|
|
2840
|
+
case ActionType$6.ShowAllColumns: {
|
|
2830
2841
|
const { columnVisibilityMap } = state;
|
|
2831
2842
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2832
2843
|
columnVisibilityMap[param] = true;
|
|
2833
2844
|
});
|
|
2834
2845
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2835
2846
|
}
|
|
2836
|
-
case ActionType$
|
|
2847
|
+
case ActionType$6.HideAllColumns: {
|
|
2837
2848
|
const { columnVisibilityMap } = state;
|
|
2838
2849
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2839
2850
|
columnVisibilityMap[param] = false;
|
|
@@ -2880,7 +2891,7 @@ const IntelliTable = (props) => {
|
|
|
2880
2891
|
columnVisibilityCustomizationModalVisible: false,
|
|
2881
2892
|
};
|
|
2882
2893
|
// Initialize state
|
|
2883
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2894
|
+
const [state, dispatch] = React.useReducer(reducer$7, initialState);
|
|
2884
2895
|
// Destructure common state
|
|
2885
2896
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
2886
2897
|
/*------------------------------------------------------------------------*/
|
|
@@ -2903,13 +2914,13 @@ const IntelliTable = (props) => {
|
|
|
2903
2914
|
return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
2904
2915
|
}
|
|
2905
2916
|
dispatch({
|
|
2906
|
-
type: ActionType$
|
|
2917
|
+
type: ActionType$6.ToggleColVisCusModalVisibility,
|
|
2907
2918
|
});
|
|
2908
2919
|
}, okayVariant: Variant$1.Light },
|
|
2909
2920
|
columns.map((column) => {
|
|
2910
2921
|
return (React__default["default"].createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
2911
2922
|
dispatch({
|
|
2912
|
-
type: ActionType$
|
|
2923
|
+
type: ActionType$6.UpdateColumnVisibility,
|
|
2913
2924
|
param: column.param,
|
|
2914
2925
|
visible: checked,
|
|
2915
2926
|
});
|
|
@@ -2918,12 +2929,12 @@ const IntelliTable = (props) => {
|
|
|
2918
2929
|
React__default["default"].createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
2919
2930
|
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: () => {
|
|
2920
2931
|
dispatch({
|
|
2921
|
-
type: ActionType$
|
|
2932
|
+
type: ActionType$6.ShowAllColumns,
|
|
2922
2933
|
});
|
|
2923
2934
|
} }, "Select All"),
|
|
2924
2935
|
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: () => {
|
|
2925
2936
|
dispatch({
|
|
2926
|
-
type: ActionType$
|
|
2937
|
+
type: ActionType$6.HideAllColumns,
|
|
2927
2938
|
});
|
|
2928
2939
|
} }, "Deselect All")));
|
|
2929
2940
|
}
|
|
@@ -2974,7 +2985,7 @@ const IntelliTable = (props) => {
|
|
|
2974
2985
|
React__default["default"].createElement("div", null,
|
|
2975
2986
|
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: () => {
|
|
2976
2987
|
dispatch({
|
|
2977
|
-
type: ActionType$
|
|
2988
|
+
type: ActionType$6.ToggleSortColumn,
|
|
2978
2989
|
param: column.param,
|
|
2979
2990
|
});
|
|
2980
2991
|
} },
|
|
@@ -3163,7 +3174,7 @@ const IntelliTable = (props) => {
|
|
|
3163
3174
|
React__default["default"].createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
|
|
3164
3175
|
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: () => {
|
|
3165
3176
|
dispatch({
|
|
3166
|
-
type: ActionType$
|
|
3177
|
+
type: ActionType$6.ToggleColVisCusModalVisibility,
|
|
3167
3178
|
});
|
|
3168
3179
|
} },
|
|
3169
3180
|
"Show/Hide Cols",
|
|
@@ -3529,7 +3540,7 @@ const genHumanReadableName = (machineReadableName) => {
|
|
|
3529
3540
|
};
|
|
3530
3541
|
/* ------------- Actions ------------ */
|
|
3531
3542
|
// Types of actions
|
|
3532
|
-
var ActionType$
|
|
3543
|
+
var ActionType$5;
|
|
3533
3544
|
(function (ActionType) {
|
|
3534
3545
|
// Show the loading bar
|
|
3535
3546
|
ActionType["StartLoading"] = "start-loading";
|
|
@@ -3551,45 +3562,45 @@ var ActionType$6;
|
|
|
3551
3562
|
ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
|
|
3552
3563
|
// Update the advanced filter state
|
|
3553
3564
|
ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
|
|
3554
|
-
})(ActionType$
|
|
3565
|
+
})(ActionType$5 || (ActionType$5 = {}));
|
|
3555
3566
|
/**
|
|
3556
3567
|
* Reducer that executes actions
|
|
3557
3568
|
* @author Gabe Abrams
|
|
3558
3569
|
* @param state current state
|
|
3559
3570
|
* @param action action to execute
|
|
3560
3571
|
*/
|
|
3561
|
-
const reducer$
|
|
3572
|
+
const reducer$6 = (state, action) => {
|
|
3562
3573
|
switch (action.type) {
|
|
3563
|
-
case ActionType$
|
|
3574
|
+
case ActionType$5.StartLoading: {
|
|
3564
3575
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
3565
3576
|
}
|
|
3566
|
-
case ActionType$
|
|
3577
|
+
case ActionType$5.FinishLoading: {
|
|
3567
3578
|
return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
|
|
3568
3579
|
}
|
|
3569
|
-
case ActionType$
|
|
3580
|
+
case ActionType$5.ToggleFilterDrawer: {
|
|
3570
3581
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
|
|
3571
3582
|
? undefined // hide
|
|
3572
3583
|
: action.filterDrawer) });
|
|
3573
3584
|
}
|
|
3574
|
-
case ActionType$
|
|
3585
|
+
case ActionType$5.HideFilterDrawer: {
|
|
3575
3586
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3576
3587
|
}
|
|
3577
|
-
case ActionType$
|
|
3588
|
+
case ActionType$5.ResetFilters: {
|
|
3578
3589
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
|
|
3579
3590
|
}
|
|
3580
|
-
case ActionType$
|
|
3591
|
+
case ActionType$5.UpdateDateFilterState: {
|
|
3581
3592
|
return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
|
|
3582
3593
|
}
|
|
3583
|
-
case ActionType$
|
|
3594
|
+
case ActionType$5.UpdateContextFilterState: {
|
|
3584
3595
|
return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
|
|
3585
3596
|
}
|
|
3586
|
-
case ActionType$
|
|
3597
|
+
case ActionType$5.UpdateTagFilterState: {
|
|
3587
3598
|
return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
|
|
3588
3599
|
}
|
|
3589
|
-
case ActionType$
|
|
3600
|
+
case ActionType$5.UpdateActionErrorFilterState: {
|
|
3590
3601
|
return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
|
|
3591
3602
|
}
|
|
3592
|
-
case ActionType$
|
|
3603
|
+
case ActionType$5.UpdateAdvancedFilterState: {
|
|
3593
3604
|
return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
|
|
3594
3605
|
}
|
|
3595
3606
|
default: {
|
|
@@ -3718,7 +3729,7 @@ const LogReviewer = (props) => {
|
|
|
3718
3729
|
advancedFilterState: initAdvancedFilterState,
|
|
3719
3730
|
};
|
|
3720
3731
|
// Initialize state
|
|
3721
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
3732
|
+
const [state, dispatch] = React.useReducer(reducer$6, initialState);
|
|
3722
3733
|
// Destructure common state
|
|
3723
3734
|
const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
|
|
3724
3735
|
/*------------------------------------------------------------------------*/
|
|
@@ -3768,7 +3779,7 @@ const LogReviewer = (props) => {
|
|
|
3768
3779
|
const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3769
3780
|
// Update state
|
|
3770
3781
|
dispatch({
|
|
3771
|
-
type: ActionType$
|
|
3782
|
+
type: ActionType$5.UpdateDateFilterState,
|
|
3772
3783
|
dateFilterState: newDateFilterState,
|
|
3773
3784
|
});
|
|
3774
3785
|
// Check which year/month combos we need to load
|
|
@@ -3779,7 +3790,7 @@ const LogReviewer = (props) => {
|
|
|
3779
3790
|
}
|
|
3780
3791
|
// Start loading
|
|
3781
3792
|
dispatch({
|
|
3782
|
-
type: ActionType$
|
|
3793
|
+
type: ActionType$5.StartLoading,
|
|
3783
3794
|
});
|
|
3784
3795
|
// Load required months
|
|
3785
3796
|
try {
|
|
@@ -3803,7 +3814,7 @@ const LogReviewer = (props) => {
|
|
|
3803
3814
|
}
|
|
3804
3815
|
// Finish loading
|
|
3805
3816
|
dispatch({
|
|
3806
|
-
type: ActionType$
|
|
3817
|
+
type: ActionType$5.FinishLoading,
|
|
3807
3818
|
logMap,
|
|
3808
3819
|
});
|
|
3809
3820
|
});
|
|
@@ -3842,7 +3853,7 @@ const LogReviewer = (props) => {
|
|
|
3842
3853
|
React__default["default"].createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
3843
3854
|
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: () => {
|
|
3844
3855
|
dispatch({
|
|
3845
|
-
type: ActionType$
|
|
3856
|
+
type: ActionType$5.ToggleFilterDrawer,
|
|
3846
3857
|
filterDrawer: FilterDrawer.Date,
|
|
3847
3858
|
});
|
|
3848
3859
|
} },
|
|
@@ -3850,7 +3861,7 @@ const LogReviewer = (props) => {
|
|
|
3850
3861
|
"Date"),
|
|
3851
3862
|
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: () => {
|
|
3852
3863
|
dispatch({
|
|
3853
|
-
type: ActionType$
|
|
3864
|
+
type: ActionType$5.ToggleFilterDrawer,
|
|
3854
3865
|
filterDrawer: FilterDrawer.Context,
|
|
3855
3866
|
});
|
|
3856
3867
|
} },
|
|
@@ -3858,7 +3869,7 @@ const LogReviewer = (props) => {
|
|
|
3858
3869
|
"Context"),
|
|
3859
3870
|
(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: () => {
|
|
3860
3871
|
dispatch({
|
|
3861
|
-
type: ActionType$
|
|
3872
|
+
type: ActionType$5.ToggleFilterDrawer,
|
|
3862
3873
|
filterDrawer: FilterDrawer.Tag,
|
|
3863
3874
|
});
|
|
3864
3875
|
} },
|
|
@@ -3866,7 +3877,7 @@ const LogReviewer = (props) => {
|
|
|
3866
3877
|
"Tag")),
|
|
3867
3878
|
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: () => {
|
|
3868
3879
|
dispatch({
|
|
3869
|
-
type: ActionType$
|
|
3880
|
+
type: ActionType$5.ToggleFilterDrawer,
|
|
3870
3881
|
filterDrawer: FilterDrawer.Action,
|
|
3871
3882
|
});
|
|
3872
3883
|
} },
|
|
@@ -3874,7 +3885,7 @@ const LogReviewer = (props) => {
|
|
|
3874
3885
|
"Action"),
|
|
3875
3886
|
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: () => {
|
|
3876
3887
|
dispatch({
|
|
3877
|
-
type: ActionType$
|
|
3888
|
+
type: ActionType$5.ToggleFilterDrawer,
|
|
3878
3889
|
filterDrawer: FilterDrawer.Advanced,
|
|
3879
3890
|
});
|
|
3880
3891
|
} },
|
|
@@ -3882,7 +3893,7 @@ const LogReviewer = (props) => {
|
|
|
3882
3893
|
"Advanced"),
|
|
3883
3894
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
|
|
3884
3895
|
dispatch({
|
|
3885
|
-
type: ActionType$
|
|
3896
|
+
type: ActionType$5.ResetFilters,
|
|
3886
3897
|
initActionErrorFilterState,
|
|
3887
3898
|
initAdvancedFilterState,
|
|
3888
3899
|
initContextFilterState,
|
|
@@ -4004,7 +4015,7 @@ const LogReviewer = (props) => {
|
|
|
4004
4015
|
}
|
|
4005
4016
|
});
|
|
4006
4017
|
dispatch({
|
|
4007
|
-
type: ActionType$
|
|
4018
|
+
type: ActionType$5.UpdateContextFilterState,
|
|
4008
4019
|
contextFilterState,
|
|
4009
4020
|
});
|
|
4010
4021
|
} }));
|
|
@@ -4019,7 +4030,7 @@ const LogReviewer = (props) => {
|
|
|
4019
4030
|
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) => {
|
|
4020
4031
|
tagFilterState[tag] = checked;
|
|
4021
4032
|
dispatch({
|
|
4022
|
-
type: ActionType$
|
|
4033
|
+
type: ActionType$5.UpdateTagFilterState,
|
|
4023
4034
|
tagFilterState,
|
|
4024
4035
|
});
|
|
4025
4036
|
} }));
|
|
@@ -4032,21 +4043,21 @@ const LogReviewer = (props) => {
|
|
|
4032
4043
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
4033
4044
|
actionErrorFilterState.type = undefined;
|
|
4034
4045
|
dispatch({
|
|
4035
|
-
type: ActionType$
|
|
4046
|
+
type: ActionType$5.UpdateActionErrorFilterState,
|
|
4036
4047
|
actionErrorFilterState,
|
|
4037
4048
|
});
|
|
4038
4049
|
}, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
|
|
4039
4050
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
4040
4051
|
actionErrorFilterState.type = LogType$1.Action;
|
|
4041
4052
|
dispatch({
|
|
4042
|
-
type: ActionType$
|
|
4053
|
+
type: ActionType$5.UpdateActionErrorFilterState,
|
|
4043
4054
|
actionErrorFilterState,
|
|
4044
4055
|
});
|
|
4045
4056
|
}, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
|
|
4046
4057
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
4047
4058
|
actionErrorFilterState.type = LogType$1.Error;
|
|
4048
4059
|
dispatch({
|
|
4049
|
-
type: ActionType$
|
|
4060
|
+
type: ActionType$5.UpdateActionErrorFilterState,
|
|
4050
4061
|
actionErrorFilterState,
|
|
4051
4062
|
});
|
|
4052
4063
|
}, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
|
|
@@ -4058,7 +4069,7 @@ const LogReviewer = (props) => {
|
|
|
4058
4069
|
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) => {
|
|
4059
4070
|
actionErrorFilterState.action[action] = checked;
|
|
4060
4071
|
dispatch({
|
|
4061
|
-
type: ActionType$
|
|
4072
|
+
type: ActionType$5.UpdateActionErrorFilterState,
|
|
4062
4073
|
actionErrorFilterState,
|
|
4063
4074
|
});
|
|
4064
4075
|
} }));
|
|
@@ -4069,7 +4080,7 @@ const LogReviewer = (props) => {
|
|
|
4069
4080
|
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) => {
|
|
4070
4081
|
actionErrorFilterState.target[target] = checked;
|
|
4071
4082
|
dispatch({
|
|
4072
|
-
type: ActionType$
|
|
4083
|
+
type: ActionType$5.UpdateActionErrorFilterState,
|
|
4073
4084
|
actionErrorFilterState,
|
|
4074
4085
|
});
|
|
4075
4086
|
} }));
|
|
@@ -4081,7 +4092,7 @@ const LogReviewer = (props) => {
|
|
|
4081
4092
|
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) => {
|
|
4082
4093
|
actionErrorFilterState.errorMessage = e.target.value;
|
|
4083
4094
|
dispatch({
|
|
4084
|
-
type: ActionType$
|
|
4095
|
+
type: ActionType$5.UpdateActionErrorFilterState,
|
|
4085
4096
|
actionErrorFilterState,
|
|
4086
4097
|
});
|
|
4087
4098
|
} })),
|
|
@@ -4092,7 +4103,7 @@ const LogReviewer = (props) => {
|
|
|
4092
4103
|
.trim()
|
|
4093
4104
|
.toUpperCase());
|
|
4094
4105
|
dispatch({
|
|
4095
|
-
type: ActionType$
|
|
4106
|
+
type: ActionType$5.UpdateActionErrorFilterState,
|
|
4096
4107
|
actionErrorFilterState,
|
|
4097
4108
|
});
|
|
4098
4109
|
} }))))));
|
|
@@ -4106,7 +4117,7 @@ const LogReviewer = (props) => {
|
|
|
4106
4117
|
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) => {
|
|
4107
4118
|
advancedFilterState.userFirstName = e.target.value;
|
|
4108
4119
|
dispatch({
|
|
4109
|
-
type: ActionType$
|
|
4120
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4110
4121
|
advancedFilterState,
|
|
4111
4122
|
});
|
|
4112
4123
|
} })),
|
|
@@ -4115,7 +4126,7 @@ const LogReviewer = (props) => {
|
|
|
4115
4126
|
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) => {
|
|
4116
4127
|
advancedFilterState.userLastName = e.target.value;
|
|
4117
4128
|
dispatch({
|
|
4118
|
-
type: ActionType$
|
|
4129
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4119
4130
|
advancedFilterState,
|
|
4120
4131
|
});
|
|
4121
4132
|
} })),
|
|
@@ -4125,7 +4136,7 @@ const LogReviewer = (props) => {
|
|
|
4125
4136
|
advancedFilterState.userEmail = ((e.target.value)
|
|
4126
4137
|
.trim());
|
|
4127
4138
|
dispatch({
|
|
4128
|
-
type: ActionType$
|
|
4139
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4129
4140
|
advancedFilterState,
|
|
4130
4141
|
});
|
|
4131
4142
|
} })),
|
|
@@ -4139,7 +4150,7 @@ const LogReviewer = (props) => {
|
|
|
4139
4150
|
.trim());
|
|
4140
4151
|
}
|
|
4141
4152
|
dispatch({
|
|
4142
|
-
type: ActionType$
|
|
4153
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4143
4154
|
advancedFilterState,
|
|
4144
4155
|
});
|
|
4145
4156
|
} })),
|
|
@@ -4147,21 +4158,21 @@ const LogReviewer = (props) => {
|
|
|
4147
4158
|
React__default["default"].createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
4148
4159
|
advancedFilterState.includeLearners = checked;
|
|
4149
4160
|
dispatch({
|
|
4150
|
-
type: ActionType$
|
|
4161
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4151
4162
|
advancedFilterState,
|
|
4152
4163
|
});
|
|
4153
4164
|
}, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
|
|
4154
4165
|
React__default["default"].createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
4155
4166
|
advancedFilterState.includeTTMs = checked;
|
|
4156
4167
|
dispatch({
|
|
4157
|
-
type: ActionType$
|
|
4168
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4158
4169
|
advancedFilterState,
|
|
4159
4170
|
});
|
|
4160
4171
|
}, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
|
|
4161
4172
|
React__default["default"].createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
4162
4173
|
advancedFilterState.includeAdmins = checked;
|
|
4163
4174
|
dispatch({
|
|
4164
|
-
type: ActionType$
|
|
4175
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4165
4176
|
advancedFilterState,
|
|
4166
4177
|
});
|
|
4167
4178
|
}, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
|
|
@@ -4171,7 +4182,7 @@ const LogReviewer = (props) => {
|
|
|
4171
4182
|
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) => {
|
|
4172
4183
|
advancedFilterState.courseName = e.target.value;
|
|
4173
4184
|
dispatch({
|
|
4174
|
-
type: ActionType$
|
|
4185
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4175
4186
|
advancedFilterState,
|
|
4176
4187
|
});
|
|
4177
4188
|
} })),
|
|
@@ -4185,7 +4196,7 @@ const LogReviewer = (props) => {
|
|
|
4185
4196
|
.trim());
|
|
4186
4197
|
}
|
|
4187
4198
|
dispatch({
|
|
4188
|
-
type: ActionType$
|
|
4199
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4189
4200
|
advancedFilterState,
|
|
4190
4201
|
});
|
|
4191
4202
|
} }))),
|
|
@@ -4194,21 +4205,21 @@ const LogReviewer = (props) => {
|
|
|
4194
4205
|
React__default["default"].createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
|
|
4195
4206
|
advancedFilterState.isMobile = undefined;
|
|
4196
4207
|
dispatch({
|
|
4197
|
-
type: ActionType$
|
|
4208
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4198
4209
|
advancedFilterState,
|
|
4199
4210
|
});
|
|
4200
4211
|
} }),
|
|
4201
4212
|
React__default["default"].createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
|
|
4202
4213
|
advancedFilterState.isMobile = true;
|
|
4203
4214
|
dispatch({
|
|
4204
|
-
type: ActionType$
|
|
4215
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4205
4216
|
advancedFilterState,
|
|
4206
4217
|
});
|
|
4207
4218
|
} }),
|
|
4208
4219
|
React__default["default"].createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
|
|
4209
4220
|
advancedFilterState.isMobile = false;
|
|
4210
4221
|
dispatch({
|
|
4211
|
-
type: ActionType$
|
|
4222
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4212
4223
|
advancedFilterState,
|
|
4213
4224
|
});
|
|
4214
4225
|
}, noMarginOnRight: true }))),
|
|
@@ -4217,21 +4228,21 @@ const LogReviewer = (props) => {
|
|
|
4217
4228
|
React__default["default"].createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
|
|
4218
4229
|
advancedFilterState.source = undefined;
|
|
4219
4230
|
dispatch({
|
|
4220
|
-
type: ActionType$
|
|
4231
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4221
4232
|
advancedFilterState,
|
|
4222
4233
|
});
|
|
4223
4234
|
} }),
|
|
4224
4235
|
React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
|
|
4225
4236
|
advancedFilterState.source = LogSource$1.Client;
|
|
4226
4237
|
dispatch({
|
|
4227
|
-
type: ActionType$
|
|
4238
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4228
4239
|
advancedFilterState,
|
|
4229
4240
|
});
|
|
4230
4241
|
} }),
|
|
4231
4242
|
React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
|
|
4232
4243
|
advancedFilterState.source = LogSource$1.Server;
|
|
4233
4244
|
dispatch({
|
|
4234
|
-
type: ActionType$
|
|
4245
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4235
4246
|
advancedFilterState,
|
|
4236
4247
|
});
|
|
4237
4248
|
}, noMarginOnRight: true })),
|
|
@@ -4242,7 +4253,7 @@ const LogReviewer = (props) => {
|
|
|
4242
4253
|
advancedFilterState.courseName = ((e.target.value)
|
|
4243
4254
|
.trim());
|
|
4244
4255
|
dispatch({
|
|
4245
|
-
type: ActionType$
|
|
4256
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4246
4257
|
advancedFilterState,
|
|
4247
4258
|
});
|
|
4248
4259
|
} })),
|
|
@@ -4252,7 +4263,7 @@ const LogReviewer = (props) => {
|
|
|
4252
4263
|
advancedFilterState.courseName = ((e.target.value)
|
|
4253
4264
|
.trim());
|
|
4254
4265
|
dispatch({
|
|
4255
|
-
type: ActionType$
|
|
4266
|
+
type: ActionType$5.UpdateAdvancedFilterState,
|
|
4256
4267
|
advancedFilterState,
|
|
4257
4268
|
});
|
|
4258
4269
|
} })))))));
|
|
@@ -12072,11 +12083,11 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
12072
12083
|
*/
|
|
12073
12084
|
/* ------------- Actions ------------ */
|
|
12074
12085
|
// Types of actions
|
|
12075
|
-
var ActionType$
|
|
12086
|
+
var ActionType$4;
|
|
12076
12087
|
(function (ActionType) {
|
|
12077
12088
|
// Update the input value
|
|
12078
12089
|
ActionType["SetInputValue"] = "SetInputValue";
|
|
12079
|
-
})(ActionType$
|
|
12090
|
+
})(ActionType$4 || (ActionType$4 = {}));
|
|
12080
12091
|
/**
|
|
12081
12092
|
* Reducer that executes actions
|
|
12082
12093
|
* @author Yuen Ler Chow
|
|
@@ -12084,9 +12095,9 @@ var ActionType$5;
|
|
|
12084
12095
|
* @param action action to execute
|
|
12085
12096
|
* @returns updated state
|
|
12086
12097
|
*/
|
|
12087
|
-
const reducer$
|
|
12098
|
+
const reducer$5 = (state, action) => {
|
|
12088
12099
|
switch (action.type) {
|
|
12089
|
-
case ActionType$
|
|
12100
|
+
case ActionType$4.SetInputValue: {
|
|
12090
12101
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
12091
12102
|
}
|
|
12092
12103
|
default: {
|
|
@@ -12106,7 +12117,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12106
12117
|
inputValue: '',
|
|
12107
12118
|
};
|
|
12108
12119
|
// Initialize state
|
|
12109
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12120
|
+
const [state, dispatch] = React.useReducer(reducer$5, initialState);
|
|
12110
12121
|
// Destructure common state
|
|
12111
12122
|
const { inputValue } = state;
|
|
12112
12123
|
/*------------------------------------------------------------------------*/
|
|
@@ -12183,7 +12194,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12183
12194
|
}
|
|
12184
12195
|
// Reset text field to empty because the values have been added
|
|
12185
12196
|
dispatch({
|
|
12186
|
-
type: ActionType$
|
|
12197
|
+
type: ActionType$4.SetInputValue,
|
|
12187
12198
|
value: '',
|
|
12188
12199
|
});
|
|
12189
12200
|
};
|
|
@@ -12222,7 +12233,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12222
12233
|
else {
|
|
12223
12234
|
// simply update the input value to the new input value
|
|
12224
12235
|
dispatch({
|
|
12225
|
-
type: ActionType$
|
|
12236
|
+
type: ActionType$4.SetInputValue,
|
|
12226
12237
|
value: newValue,
|
|
12227
12238
|
});
|
|
12228
12239
|
}
|
|
@@ -12274,13 +12285,13 @@ const style$1 = `
|
|
|
12274
12285
|
`;
|
|
12275
12286
|
/* ------------- Actions ------------ */
|
|
12276
12287
|
// Types of actions
|
|
12277
|
-
var ActionType$
|
|
12288
|
+
var ActionType$3;
|
|
12278
12289
|
(function (ActionType) {
|
|
12279
12290
|
// Update the DBEntry
|
|
12280
12291
|
ActionType["UpdateDBEntry"] = "UpdateDBEntry";
|
|
12281
12292
|
// Start the save spinner
|
|
12282
12293
|
ActionType["StartSave"] = "StartSave";
|
|
12283
|
-
})(ActionType$
|
|
12294
|
+
})(ActionType$3 || (ActionType$3 = {}));
|
|
12284
12295
|
/**
|
|
12285
12296
|
* Reducer that executes actions
|
|
12286
12297
|
* @author Yuen Ler Chow
|
|
@@ -12288,12 +12299,12 @@ var ActionType$4;
|
|
|
12288
12299
|
* @param action action to execute
|
|
12289
12300
|
* @returns updated state
|
|
12290
12301
|
*/
|
|
12291
|
-
const reducer$
|
|
12302
|
+
const reducer$4 = (state, action) => {
|
|
12292
12303
|
switch (action.type) {
|
|
12293
|
-
case ActionType$
|
|
12304
|
+
case ActionType$3.UpdateDBEntry: {
|
|
12294
12305
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
12295
12306
|
}
|
|
12296
|
-
case ActionType$
|
|
12307
|
+
case ActionType$3.StartSave: {
|
|
12297
12308
|
return Object.assign(Object.assign({}, state), { saving: true });
|
|
12298
12309
|
}
|
|
12299
12310
|
default: {
|
|
@@ -12318,7 +12329,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12318
12329
|
saving: false,
|
|
12319
12330
|
};
|
|
12320
12331
|
// Initialize state
|
|
12321
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12332
|
+
const [state, dispatch] = React.useReducer(reducer$4, initialState);
|
|
12322
12333
|
// Destructure common state
|
|
12323
12334
|
const { entry, saving, } = state;
|
|
12324
12335
|
/*------------------------------------------------------------------------*/
|
|
@@ -12330,7 +12341,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12330
12341
|
*/
|
|
12331
12342
|
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
12332
12343
|
// Start the save loading indicator
|
|
12333
|
-
dispatch({ type: ActionType$
|
|
12344
|
+
dispatch({ type: ActionType$3.StartSave });
|
|
12334
12345
|
// add all default values to the entry
|
|
12335
12346
|
entryFields.forEach((field) => {
|
|
12336
12347
|
if (field.defaultValue && !entry[field.objectKey]) {
|
|
@@ -12513,7 +12524,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12513
12524
|
return (React__default["default"].createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
|
|
12514
12525
|
entry[field.objectKey] = choice.value;
|
|
12515
12526
|
dispatch({
|
|
12516
|
-
type: ActionType$
|
|
12527
|
+
type: ActionType$3.UpdateDBEntry,
|
|
12517
12528
|
dbEntry: entry,
|
|
12518
12529
|
});
|
|
12519
12530
|
}, ariaLabel: choice.title }));
|
|
@@ -12525,7 +12536,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12525
12536
|
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) => {
|
|
12526
12537
|
entry[field.objectKey] = (e.target.value);
|
|
12527
12538
|
dispatch({
|
|
12528
|
-
type: ActionType$
|
|
12539
|
+
type: ActionType$3.UpdateDBEntry,
|
|
12529
12540
|
dbEntry: entry,
|
|
12530
12541
|
});
|
|
12531
12542
|
} }))));
|
|
@@ -12538,7 +12549,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12538
12549
|
entry[field.objectKey] = (e.target.value
|
|
12539
12550
|
.replace(/[^0-9]/g, ''));
|
|
12540
12551
|
dispatch({
|
|
12541
|
-
type: ActionType$
|
|
12552
|
+
type: ActionType$3.UpdateDBEntry,
|
|
12542
12553
|
dbEntry: entry,
|
|
12543
12554
|
});
|
|
12544
12555
|
} }))));
|
|
@@ -12568,7 +12579,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12568
12579
|
}
|
|
12569
12580
|
// Save
|
|
12570
12581
|
dispatch({
|
|
12571
|
-
type: ActionType$
|
|
12582
|
+
type: ActionType$3.UpdateDBEntry,
|
|
12572
12583
|
dbEntry: entry,
|
|
12573
12584
|
});
|
|
12574
12585
|
}, ariaLabel: choice.title }));
|
|
@@ -12583,7 +12594,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12583
12594
|
// Update entry and save
|
|
12584
12595
|
entry[field.objectKey] = values;
|
|
12585
12596
|
dispatch({
|
|
12586
|
-
type: ActionType$
|
|
12597
|
+
type: ActionType$3.UpdateDBEntry,
|
|
12587
12598
|
dbEntry: entry,
|
|
12588
12599
|
});
|
|
12589
12600
|
} })))));
|
|
@@ -12596,7 +12607,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12596
12607
|
React__default["default"].createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
|
|
12597
12608
|
entry[field.objectKey] = values;
|
|
12598
12609
|
dispatch({
|
|
12599
|
-
type: ActionType$
|
|
12610
|
+
type: ActionType$3.UpdateDBEntry,
|
|
12600
12611
|
dbEntry: entry,
|
|
12601
12612
|
});
|
|
12602
12613
|
} })))));
|
|
@@ -12670,7 +12681,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
|
|
|
12670
12681
|
*/
|
|
12671
12682
|
/* ------------- Actions ------------ */
|
|
12672
12683
|
// Types of actions
|
|
12673
|
-
var ActionType$
|
|
12684
|
+
var ActionType$2;
|
|
12674
12685
|
(function (ActionType) {
|
|
12675
12686
|
// Show adder
|
|
12676
12687
|
ActionType["ShowAdder"] = "ShowAdder";
|
|
@@ -12684,7 +12695,7 @@ var ActionType$3;
|
|
|
12684
12695
|
ActionType["StartDelete"] = "StartDelete";
|
|
12685
12696
|
// Finish deletion process
|
|
12686
12697
|
ActionType["FinishDelete"] = "FinishDelete";
|
|
12687
|
-
})(ActionType$
|
|
12698
|
+
})(ActionType$2 || (ActionType$2 = {}));
|
|
12688
12699
|
/**
|
|
12689
12700
|
* Reducer that executes actions
|
|
12690
12701
|
* @author Yuen Ler Chow
|
|
@@ -12692,18 +12703,18 @@ var ActionType$3;
|
|
|
12692
12703
|
* @param action action to execute
|
|
12693
12704
|
* @returns updated state
|
|
12694
12705
|
*/
|
|
12695
|
-
const reducer$
|
|
12706
|
+
const reducer$3 = (state, action) => {
|
|
12696
12707
|
switch (action.type) {
|
|
12697
|
-
case ActionType$
|
|
12708
|
+
case ActionType$2.FinishLoading: {
|
|
12698
12709
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
12699
12710
|
}
|
|
12700
|
-
case ActionType$
|
|
12711
|
+
case ActionType$2.ShowAdder: {
|
|
12701
12712
|
return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
|
|
12702
12713
|
}
|
|
12703
|
-
case ActionType$
|
|
12714
|
+
case ActionType$2.ShowEditor: {
|
|
12704
12715
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
|
|
12705
12716
|
}
|
|
12706
|
-
case ActionType$
|
|
12717
|
+
case ActionType$2.FinishAdd: {
|
|
12707
12718
|
// Handle cancel
|
|
12708
12719
|
const finishedEntry = action.dbEntry;
|
|
12709
12720
|
if (!finishedEntry) {
|
|
@@ -12727,10 +12738,10 @@ const reducer$4 = (state, action) => {
|
|
|
12727
12738
|
// Update the state
|
|
12728
12739
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
|
|
12729
12740
|
}
|
|
12730
|
-
case ActionType$
|
|
12741
|
+
case ActionType$2.StartDelete: {
|
|
12731
12742
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
12732
12743
|
}
|
|
12733
|
-
case ActionType$
|
|
12744
|
+
case ActionType$2.FinishDelete: {
|
|
12734
12745
|
return Object.assign(Object.assign({}, state), { loading: false,
|
|
12735
12746
|
// Remove the deleted entry from the list
|
|
12736
12747
|
dbEntries: state.dbEntries.filter((entry) => {
|
|
@@ -12756,7 +12767,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12756
12767
|
loading: true,
|
|
12757
12768
|
};
|
|
12758
12769
|
// Initialize state
|
|
12759
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12770
|
+
const [state, dispatch] = React.useReducer(reducer$3, initialState);
|
|
12760
12771
|
// Destructure common state
|
|
12761
12772
|
const { adding, dbEntryToEdit, dbEntries, loading, } = state;
|
|
12762
12773
|
/*------------------------------------------------------------------------*/
|
|
@@ -12782,7 +12793,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12782
12793
|
try {
|
|
12783
12794
|
// Start loader
|
|
12784
12795
|
dispatch({
|
|
12785
|
-
type: ActionType$
|
|
12796
|
+
type: ActionType$2.StartDelete,
|
|
12786
12797
|
});
|
|
12787
12798
|
// Perform deletion
|
|
12788
12799
|
yield visitServerEndpoint({
|
|
@@ -12791,7 +12802,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12791
12802
|
});
|
|
12792
12803
|
// Finish loader
|
|
12793
12804
|
dispatch({
|
|
12794
|
-
type: ActionType$
|
|
12805
|
+
type: ActionType$2.FinishDelete,
|
|
12795
12806
|
dbEntry: entry,
|
|
12796
12807
|
idPropName,
|
|
12797
12808
|
});
|
|
@@ -12820,7 +12831,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12820
12831
|
});
|
|
12821
12832
|
// Save loaded data
|
|
12822
12833
|
dispatch({
|
|
12823
|
-
type: ActionType$
|
|
12834
|
+
type: ActionType$2.FinishLoading,
|
|
12824
12835
|
dbEntries: data,
|
|
12825
12836
|
});
|
|
12826
12837
|
}
|
|
@@ -12863,7 +12874,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12863
12874
|
React__default["default"].createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
|
|
12864
12875
|
!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: () => {
|
|
12865
12876
|
dispatch({
|
|
12866
|
-
type: ActionType$
|
|
12877
|
+
type: ActionType$2.ShowEditor,
|
|
12867
12878
|
dbEntry: entry,
|
|
12868
12879
|
});
|
|
12869
12880
|
} },
|
|
@@ -12873,7 +12884,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12873
12884
|
React__default["default"].createElement("div", { className: "d-grid" },
|
|
12874
12885
|
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: () => {
|
|
12875
12886
|
dispatch({
|
|
12876
|
-
type: ActionType$
|
|
12887
|
+
type: ActionType$2.ShowAdder,
|
|
12877
12888
|
});
|
|
12878
12889
|
} },
|
|
12879
12890
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faPlus, className: "me-2" }),
|
|
@@ -12885,7 +12896,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
12885
12896
|
if (!loading && (adding || dbEntryToEdit)) {
|
|
12886
12897
|
body = (React__default["default"].createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
|
|
12887
12898
|
dispatch({
|
|
12888
|
-
type: ActionType$
|
|
12899
|
+
type: ActionType$2.FinishAdd,
|
|
12889
12900
|
dbEntry: entry,
|
|
12890
12901
|
idPropName,
|
|
12891
12902
|
});
|
|
@@ -13082,25 +13093,25 @@ const getItemIds = (items) => {
|
|
|
13082
13093
|
};
|
|
13083
13094
|
/* ------------- Actions ------------ */
|
|
13084
13095
|
// Types of actions
|
|
13085
|
-
var ActionType$
|
|
13096
|
+
var ActionType$1;
|
|
13086
13097
|
(function (ActionType) {
|
|
13087
13098
|
// Hide the "jump to bottom" button
|
|
13088
13099
|
ActionType["HideJumpToBottomButton"] = "HideJumpToBottomButton";
|
|
13089
13100
|
// Show the "jump to bottom" button
|
|
13090
13101
|
ActionType["ShowJumpToBottomButton"] = "ShowJumpToBottomButton";
|
|
13091
|
-
})(ActionType$
|
|
13102
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
13092
13103
|
/**
|
|
13093
13104
|
* Reducer that executes actions
|
|
13094
13105
|
* @author Gabe Abrams
|
|
13095
13106
|
* @param state current state
|
|
13096
13107
|
* @param action action to execute
|
|
13097
13108
|
*/
|
|
13098
|
-
const reducer$
|
|
13109
|
+
const reducer$2 = (state, action) => {
|
|
13099
13110
|
switch (action.type) {
|
|
13100
|
-
case ActionType$
|
|
13111
|
+
case ActionType$1.HideJumpToBottomButton: {
|
|
13101
13112
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
|
|
13102
13113
|
}
|
|
13103
|
-
case ActionType$
|
|
13114
|
+
case ActionType$1.ShowJumpToBottomButton: {
|
|
13104
13115
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: true });
|
|
13105
13116
|
}
|
|
13106
13117
|
default: {
|
|
@@ -13124,7 +13135,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13124
13135
|
jumpToBottomButtonVisible: false,
|
|
13125
13136
|
};
|
|
13126
13137
|
// Initialize state
|
|
13127
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
13138
|
+
const [state, dispatch] = React.useReducer(reducer$2, initialState);
|
|
13128
13139
|
// Destructure common state
|
|
13129
13140
|
const { jumpToBottomButtonVisible, } = state;
|
|
13130
13141
|
/* -------------- Refs -------------- */
|
|
@@ -13170,7 +13181,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13170
13181
|
}
|
|
13171
13182
|
// Update state
|
|
13172
13183
|
dispatch({
|
|
13173
|
-
type: ActionType$
|
|
13184
|
+
type: ActionType$1.HideJumpToBottomButton,
|
|
13174
13185
|
});
|
|
13175
13186
|
// Scroll to bottom
|
|
13176
13187
|
container.current.scrollTop = (container.current.scrollHeight
|
|
@@ -13194,7 +13205,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13194
13205
|
if (isScrolledToBottom()) {
|
|
13195
13206
|
// Hide button
|
|
13196
13207
|
dispatch({
|
|
13197
|
-
type: ActionType$
|
|
13208
|
+
type: ActionType$1.HideJumpToBottomButton,
|
|
13198
13209
|
});
|
|
13199
13210
|
}
|
|
13200
13211
|
};
|
|
@@ -13236,7 +13247,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13236
13247
|
else {
|
|
13237
13248
|
// Not scrolled to bottom. Show "jump to bottom" button.
|
|
13238
13249
|
dispatch({
|
|
13239
|
-
type: ActionType$
|
|
13250
|
+
type: ActionType$1.ShowJumpToBottomButton,
|
|
13240
13251
|
});
|
|
13241
13252
|
}
|
|
13242
13253
|
}, [items]);
|
|
@@ -13306,25 +13317,25 @@ const combineClassNames = (classNames) => {
|
|
|
13306
13317
|
*/
|
|
13307
13318
|
/* ------------- Actions ------------ */
|
|
13308
13319
|
// Types of actions
|
|
13309
|
-
var ActionType
|
|
13320
|
+
var ActionType;
|
|
13310
13321
|
(function (ActionType) {
|
|
13311
13322
|
// Start hovering on an option
|
|
13312
13323
|
ActionType["StartHover"] = "StartHover";
|
|
13313
13324
|
// Stop hovering on an option
|
|
13314
13325
|
ActionType["StopHover"] = "StopHover";
|
|
13315
|
-
})(ActionType
|
|
13326
|
+
})(ActionType || (ActionType = {}));
|
|
13316
13327
|
/**
|
|
13317
13328
|
* Reducer that executes actions
|
|
13318
13329
|
* @author Gabe Abrams
|
|
13319
13330
|
* @param state current state
|
|
13320
13331
|
* @param action action to execute
|
|
13321
13332
|
*/
|
|
13322
|
-
const reducer$
|
|
13333
|
+
const reducer$1 = (state, action) => {
|
|
13323
13334
|
switch (action.type) {
|
|
13324
|
-
case ActionType
|
|
13335
|
+
case ActionType.StartHover: {
|
|
13325
13336
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
|
|
13326
13337
|
}
|
|
13327
|
-
case ActionType
|
|
13338
|
+
case ActionType.StopHover: {
|
|
13328
13339
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: undefined });
|
|
13329
13340
|
}
|
|
13330
13341
|
default: {
|
|
@@ -13348,7 +13359,7 @@ const MultiSwitch = (props) => {
|
|
|
13348
13359
|
hoveredOptionId: undefined,
|
|
13349
13360
|
};
|
|
13350
13361
|
// Initialize state
|
|
13351
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
13362
|
+
const [state, dispatch] = React.useReducer(reducer$1, initialState);
|
|
13352
13363
|
// Destructure common state
|
|
13353
13364
|
const { hoveredOptionId, } = state;
|
|
13354
13365
|
/*------------------------------------------------------------------------*/
|
|
@@ -13360,7 +13371,7 @@ const MultiSwitch = (props) => {
|
|
|
13360
13371
|
});
|
|
13361
13372
|
// Constants
|
|
13362
13373
|
const gutterRems = heightRem * 0.1;
|
|
13363
|
-
const itemWidthRems = heightRem *
|
|
13374
|
+
const itemWidthRems = heightRem * 1.3;
|
|
13364
13375
|
const textFontSize = heightRem / 3.5;
|
|
13365
13376
|
const iconFontSize = heightRem / 2;
|
|
13366
13377
|
const borderWidthRems = 0.05;
|
|
@@ -13480,27 +13491,27 @@ const MultiSwitch = (props) => {
|
|
|
13480
13491
|
: `click to select option "${option.label}"`), onClick: () => {
|
|
13481
13492
|
// Remove hover
|
|
13482
13493
|
dispatch({
|
|
13483
|
-
type: ActionType
|
|
13494
|
+
type: ActionType.StopHover,
|
|
13484
13495
|
});
|
|
13485
13496
|
// Notify parent
|
|
13486
13497
|
onChange(option.id);
|
|
13487
13498
|
}, onMouseEnter: () => {
|
|
13488
13499
|
dispatch({
|
|
13489
|
-
type: ActionType
|
|
13500
|
+
type: ActionType.StartHover,
|
|
13490
13501
|
hoveredOptionId: option.id,
|
|
13491
13502
|
});
|
|
13492
13503
|
}, onMouseLeave: () => {
|
|
13493
13504
|
dispatch({
|
|
13494
|
-
type: ActionType
|
|
13505
|
+
type: ActionType.StopHover,
|
|
13495
13506
|
});
|
|
13496
13507
|
}, onFocus: () => {
|
|
13497
13508
|
dispatch({
|
|
13498
|
-
type: ActionType
|
|
13509
|
+
type: ActionType.StartHover,
|
|
13499
13510
|
hoveredOptionId: option.id,
|
|
13500
13511
|
});
|
|
13501
13512
|
}, onBlur: () => {
|
|
13502
13513
|
dispatch({
|
|
13503
|
-
type: ActionType
|
|
13514
|
+
type: ActionType.StopHover,
|
|
13504
13515
|
});
|
|
13505
13516
|
}, style: {
|
|
13506
13517
|
pointerEvents: ((option.id === selectedOptionId)
|
|
@@ -13519,147 +13530,6 @@ const MultiSwitch = (props) => {
|
|
|
13519
13530
|
React__default["default"].createElement("div", { className: "MultiSwitch-highlight-container" }, highlight)));
|
|
13520
13531
|
};
|
|
13521
13532
|
|
|
13522
|
-
// Types of dropdown items
|
|
13523
|
-
var DropdownItemType;
|
|
13524
|
-
(function (DropdownItemType) {
|
|
13525
|
-
// Dropdown header
|
|
13526
|
-
DropdownItemType["Header"] = "Header";
|
|
13527
|
-
// Dropdown divider
|
|
13528
|
-
DropdownItemType["Divider"] = "Divider";
|
|
13529
|
-
// Dropdown item
|
|
13530
|
-
DropdownItemType["Item"] = "Item";
|
|
13531
|
-
})(DropdownItemType || (DropdownItemType = {}));
|
|
13532
|
-
var DropdownItemType$1 = DropdownItemType;
|
|
13533
|
-
|
|
13534
|
-
/**
|
|
13535
|
-
* A simple dropdown menu
|
|
13536
|
-
* @author Alessandra De Lucas
|
|
13537
|
-
* @author Yuen Ler Chow
|
|
13538
|
-
* @author Gabe Abrams
|
|
13539
|
-
*/
|
|
13540
|
-
/* ------------- Actions ------------ */
|
|
13541
|
-
// Types of actions
|
|
13542
|
-
var ActionType;
|
|
13543
|
-
(function (ActionType) {
|
|
13544
|
-
// Toggle opening the dropdown menu
|
|
13545
|
-
ActionType["ToggleDropdown"] = "ToggleDropdown";
|
|
13546
|
-
// Close the dropdown menu
|
|
13547
|
-
ActionType["CloseDropdown"] = "CloseDropdown";
|
|
13548
|
-
})(ActionType || (ActionType = {}));
|
|
13549
|
-
/**
|
|
13550
|
-
* Reducer that executes actions
|
|
13551
|
-
* @author Alessandra De Lucas
|
|
13552
|
-
* @author Yuen Ler Chow
|
|
13553
|
-
* @param state current state
|
|
13554
|
-
* @param action action to execute
|
|
13555
|
-
*/
|
|
13556
|
-
const reducer$1 = (state, action) => {
|
|
13557
|
-
switch (action.type) {
|
|
13558
|
-
case ActionType.ToggleDropdown: {
|
|
13559
|
-
return Object.assign(Object.assign({}, state), { isDropdownOpen: !state.isDropdownOpen });
|
|
13560
|
-
}
|
|
13561
|
-
case ActionType.CloseDropdown: {
|
|
13562
|
-
return Object.assign(Object.assign({}, state), { isDropdownOpen: false });
|
|
13563
|
-
}
|
|
13564
|
-
default: {
|
|
13565
|
-
return state;
|
|
13566
|
-
}
|
|
13567
|
-
}
|
|
13568
|
-
};
|
|
13569
|
-
/*------------------------------------------------------------------------*/
|
|
13570
|
-
/* ------------------------------ Component ----------------------------- */
|
|
13571
|
-
/*------------------------------------------------------------------------*/
|
|
13572
|
-
const Dropdown = (props) => {
|
|
13573
|
-
/*------------------------------------------------------------------------*/
|
|
13574
|
-
/* -------------------------------- Setup ------------------------------- */
|
|
13575
|
-
/*------------------------------------------------------------------------*/
|
|
13576
|
-
/* -------------- Props ------------- */
|
|
13577
|
-
// Destructure all props
|
|
13578
|
-
const { dropdownButton, items, } = props;
|
|
13579
|
-
/* -------------- State ------------- */
|
|
13580
|
-
// Initial state
|
|
13581
|
-
const initialState = {
|
|
13582
|
-
isDropdownOpen: false,
|
|
13583
|
-
};
|
|
13584
|
-
// Initialize state
|
|
13585
|
-
const [state, dispatch] = React.useReducer(reducer$1, initialState);
|
|
13586
|
-
// Destructure common state
|
|
13587
|
-
const { isDropdownOpen, } = state;
|
|
13588
|
-
/* -------------- Refs -------------- */
|
|
13589
|
-
// Initialize refs
|
|
13590
|
-
const dropdownRef = React.useRef(null);
|
|
13591
|
-
/*------------------------------------------------------------------------*/
|
|
13592
|
-
/* ------------------------- Component Functions ------------------------ */
|
|
13593
|
-
/*------------------------------------------------------------------------*/
|
|
13594
|
-
/**
|
|
13595
|
-
* Handle clicking outside of the dropdown menu to close it
|
|
13596
|
-
* @author Yuen Ler Chow
|
|
13597
|
-
* @param event the mouse event
|
|
13598
|
-
*/
|
|
13599
|
-
const handleClickOutside = (event) => {
|
|
13600
|
-
if (
|
|
13601
|
-
// Dropdown has been rendered
|
|
13602
|
-
dropdownRef.current
|
|
13603
|
-
// Click occurred outside the dropdown
|
|
13604
|
-
&& !dropdownRef.current.contains(event.target)) {
|
|
13605
|
-
dispatch({ type: ActionType.CloseDropdown });
|
|
13606
|
-
}
|
|
13607
|
-
};
|
|
13608
|
-
/*------------------------------------------------------------------------*/
|
|
13609
|
-
/* ------------------------- Lifecycle Functions ------------------------ */
|
|
13610
|
-
/*------------------------------------------------------------------------*/
|
|
13611
|
-
/**
|
|
13612
|
-
* Mount
|
|
13613
|
-
* @author Yuen Ler Chow
|
|
13614
|
-
*/
|
|
13615
|
-
React.useEffect(() => {
|
|
13616
|
-
// Add event listener to close dropdown when clicking outside
|
|
13617
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
13618
|
-
// Cleanup
|
|
13619
|
-
return () => {
|
|
13620
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
13621
|
-
};
|
|
13622
|
-
}, []);
|
|
13623
|
-
/*----------------------------------------*/
|
|
13624
|
-
/* --------------- Main UI -------------- */
|
|
13625
|
-
/*----------------------------------------*/
|
|
13626
|
-
return (React__default["default"].createElement("div", { className: "dropdown", ref: dropdownRef, "data-bs-theme": isDarkModeOn() ? 'dark' : undefined },
|
|
13627
|
-
React__default["default"].createElement("button", { className: combineClassNames([
|
|
13628
|
-
'btn dropdown-toggle border',
|
|
13629
|
-
isDropdownOpen && 'show',
|
|
13630
|
-
`btn-${dropdownButton.variant}`,
|
|
13631
|
-
dropdownButton.variant === Variant$1.Light && 'text-dark',
|
|
13632
|
-
]), type: "button", id: dropdownButton.id, "aria-expanded": isDropdownOpen, "aria-label": dropdownButton.ariaLabel, onClick: () => {
|
|
13633
|
-
dispatch({
|
|
13634
|
-
type: ActionType.ToggleDropdown,
|
|
13635
|
-
});
|
|
13636
|
-
} }, dropdownButton.content),
|
|
13637
|
-
React__default["default"].createElement("ul", { className: combineClassNames([
|
|
13638
|
-
'dropdown-menu',
|
|
13639
|
-
isDarkModeOn() && 'dropdown-menu-dark',
|
|
13640
|
-
isDropdownOpen && 'show',
|
|
13641
|
-
]) }, Object.values(items).map((item) => {
|
|
13642
|
-
if (item.type === DropdownItemType$1.Header) {
|
|
13643
|
-
return (
|
|
13644
|
-
// TODO: Implement header
|
|
13645
|
-
React__default["default"].createElement("span", null));
|
|
13646
|
-
}
|
|
13647
|
-
if (item.type === DropdownItemType$1.Divider) {
|
|
13648
|
-
return (
|
|
13649
|
-
// TODO: Implement divider
|
|
13650
|
-
React__default["default"].createElement("span", null));
|
|
13651
|
-
}
|
|
13652
|
-
return (React__default["default"].createElement("li", { key: item.id },
|
|
13653
|
-
React__default["default"].createElement("button", { type: "button", "aria-label": item.ariaLabel, className: "dropdown-item", onClick: (e) => {
|
|
13654
|
-
e.preventDefault();
|
|
13655
|
-
dispatch({
|
|
13656
|
-
type: ActionType.CloseDropdown,
|
|
13657
|
-
});
|
|
13658
|
-
item.onClick();
|
|
13659
|
-
} }, item.content)));
|
|
13660
|
-
}))));
|
|
13661
|
-
};
|
|
13662
|
-
|
|
13663
13533
|
/**
|
|
13664
13534
|
* One minute in ms
|
|
13665
13535
|
* @author Gabe Abrams
|
|
@@ -15996,8 +15866,6 @@ exports.DBEntryFieldType = DBEntryFieldType$1;
|
|
|
15996
15866
|
exports.DBEntryManagerPanel = DBEntryManagerPanel;
|
|
15997
15867
|
exports.DayOfWeek = DayOfWeek$1;
|
|
15998
15868
|
exports.Drawer = Drawer;
|
|
15999
|
-
exports.Dropdown = Dropdown;
|
|
16000
|
-
exports.DropdownItemType = DropdownItemType$1;
|
|
16001
15869
|
exports.DynamicWord = DynamicWord;
|
|
16002
15870
|
exports.ErrorBox = ErrorBox;
|
|
16003
15871
|
exports.ErrorWithCode = ErrorWithCode;
|