@popmenu/common-ui 0.18.2 → 0.18.3-alpha.0
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/build/esm/components/Accordion/index.d.ts +1 -0
- package/build/esm/components/AccordionActions/index.d.ts +1 -0
- package/build/esm/components/AccordionDetails/index.d.ts +1 -0
- package/build/esm/components/AccordionSummary/index.d.ts +1 -0
- package/build/esm/components/Alert/index.d.ts +1 -0
- package/build/esm/components/AppBar/index.d.ts +1 -0
- package/build/esm/components/AudioPlayer/AudioPlayer.d.ts +3 -0
- package/build/esm/components/AudioPlayer/AudioPlayerProps.d.ts +4 -0
- package/build/esm/components/AudioPlayer/index.d.ts +2 -0
- package/build/esm/components/AudioPlayer/util/audioPlayerReducer.d.ts +11 -0
- package/build/esm/components/AudioPlayer/util/formatTime.d.ts +1 -0
- package/build/esm/components/AudioPlayer/util/index.d.ts +5 -0
- package/build/esm/components/AudioPlayer/util/setupAudioRef.d.ts +8 -0
- package/build/esm/components/AudioPlayer/util/types.d.ts +77 -0
- package/build/esm/components/AudioPlayer/util/useVolumeIcon.d.ts +2 -0
- package/build/esm/components/Avatar/Avatar.d.ts +3 -0
- package/build/esm/components/Avatar/AvatarProps.d.ts +15 -0
- package/build/esm/components/Avatar/avatar.styles.d.ts +2 -0
- package/build/esm/components/Avatar/index.d.ts +2 -0
- package/build/esm/components/Avatar/util/useImageProps.d.ts +15 -0
- package/build/esm/components/Badge/index.d.ts +1 -0
- package/build/esm/components/Box/Box.d.ts +3 -0
- package/build/esm/components/Box/BoxProps.d.ts +5 -0
- package/build/esm/components/Box/BoxStyles.d.ts +1 -0
- package/build/esm/components/Box/index.d.ts +7 -0
- package/build/esm/components/Breadcrumbs/index.d.ts +1 -0
- package/build/esm/components/Button/Button.d.ts +3 -0
- package/build/esm/components/Button/ButtonProps.d.ts +6 -0
- package/build/esm/components/Button/ButtonStyles.d.ts +2 -0
- package/build/esm/components/Button/index.d.ts +2 -0
- package/build/esm/components/ButtonBase/index.d.ts +1 -0
- package/build/esm/components/ButtonGroup/index.d.ts +1 -0
- package/build/esm/components/Card/index.d.ts +1 -0
- package/build/esm/components/CardActionArea/index.d.ts +1 -0
- package/build/esm/components/CardActions/index.d.ts +1 -0
- package/build/esm/components/CardContent/index.d.ts +1 -0
- package/build/esm/components/CardHeader/index.d.ts +1 -0
- package/build/esm/components/CardMedia/index.d.ts +1 -0
- package/build/esm/components/Checkbox/Checkbox.d.ts +3 -0
- package/build/esm/components/Checkbox/CheckboxProps.d.ts +8 -0
- package/build/esm/components/Checkbox/index.d.ts +2 -0
- package/build/esm/components/Chip/index.d.ts +1 -0
- package/build/esm/components/CircularProgress/index.d.ts +1 -0
- package/build/esm/components/ClickAwayListener/index.d.ts +1 -0
- package/build/esm/components/CollapsibleText/CollapsibleText.d.ts +3 -0
- package/build/esm/components/CollapsibleText/CollapsibleTextProps.d.ts +12 -0
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.d.ts +4 -0
- package/build/esm/components/CollapsibleText/index.d.ts +2 -0
- package/build/esm/components/Dialog/index.d.ts +1 -0
- package/build/esm/components/DialogActions/index.d.ts +1 -0
- package/build/esm/components/DialogContent/index.d.ts +1 -0
- package/build/esm/components/DialogContentText/index.d.ts +1 -0
- package/build/esm/components/DialogTitle/index.d.ts +1 -0
- package/build/esm/components/Divider/Divider.d.ts +3 -0
- package/build/esm/components/Divider/DividerProps.d.ts +17 -0
- package/build/esm/components/Divider/index.d.ts +2 -0
- package/build/esm/components/Drawer/index.d.ts +1 -0
- package/build/esm/components/Fab/index.d.ts +1 -0
- package/build/esm/components/FormControl/index.d.ts +1 -0
- package/build/esm/components/FormControlLabel/index.d.ts +1 -0
- package/build/esm/components/FormLabel/index.d.ts +1 -0
- package/build/esm/components/Grid/index.d.ts +1 -0
- package/build/esm/components/GridList/index.d.ts +1 -0
- package/build/esm/components/Hidden/index.d.ts +1 -0
- package/build/esm/components/Icon/Icon.d.ts +4 -0
- package/build/esm/components/Icon/IconProps.d.ts +11 -0
- package/build/esm/components/Icon/IconStyles.d.ts +2 -0
- package/build/esm/components/Icon/index.d.ts +2 -0
- package/build/esm/components/IconButton/IconButton.d.ts +3 -0
- package/build/esm/components/IconButton/IconButtonProps.d.ts +2 -0
- package/build/esm/components/IconButton/index.d.ts +2 -0
- package/build/esm/components/InputAdornment/index.d.ts +1 -0
- package/build/esm/components/LinearProgress/index.d.ts +1 -0
- package/build/esm/components/Link/Link.d.ts +3 -0
- package/build/esm/components/Link/LinkProps.d.ts +4 -0
- package/build/esm/components/Link/index.d.ts +2 -0
- package/build/esm/components/Link/link.styles.d.ts +2 -0
- package/build/esm/components/List/index.d.ts +1 -0
- package/build/esm/components/ListItem/index.d.ts +1 -0
- package/build/esm/components/ListItemIcon/index.d.ts +1 -0
- package/build/esm/components/ListItemSecondaryAction/index.d.ts +1 -0
- package/build/esm/components/ListItemText/index.d.ts +1 -0
- package/build/esm/components/Menu/index.d.ts +1 -0
- package/build/esm/components/MenuItem/index.d.ts +1 -0
- package/build/esm/components/MenuList/index.d.ts +1 -0
- package/build/esm/components/Modal/index.d.ts +1 -0
- package/build/esm/components/Paper/Paper.d.ts +6 -0
- package/build/esm/components/Paper/index.d.ts +1 -0
- package/build/esm/components/PaperContent/PaperContent.d.ts +2 -0
- package/build/esm/components/PaperContent/index.d.ts +1 -0
- package/build/esm/components/Popover/index.d.ts +1 -0
- package/build/esm/components/Popper/index.d.ts +1 -0
- package/build/esm/components/Radio/Radio.d.ts +3 -0
- package/build/esm/components/Radio/RadioProps.d.ts +8 -0
- package/build/esm/components/Radio/index.d.ts +2 -0
- package/build/esm/components/SplitInput/SplitInput.d.ts +3 -0
- package/build/esm/components/SplitInput/SplitInputProps.d.ts +18 -0
- package/build/esm/components/SplitInput/SplitInputStyles.d.ts +2 -0
- package/build/esm/components/SplitInput/index.d.ts +2 -0
- package/build/esm/components/Step/index.d.ts +1 -0
- package/build/esm/components/StepButton/index.d.ts +1 -0
- package/build/esm/components/StepConnector/index.d.ts +1 -0
- package/build/esm/components/StepContent/index.d.ts +1 -0
- package/build/esm/components/StepIcon/index.d.ts +1 -0
- package/build/esm/components/StepLabel/index.d.ts +1 -0
- package/build/esm/components/Stepper/index.d.ts +1 -0
- package/build/esm/components/Switch/Switch.d.ts +3 -0
- package/build/esm/components/Switch/SwitchProps.d.ts +8 -0
- package/build/esm/components/Switch/index.d.ts +2 -0
- package/build/esm/components/Switch/switch.styles.d.ts +2 -0
- package/build/esm/components/Tab/index.d.ts +1 -0
- package/build/esm/components/Table/Table.d.ts +3 -0
- package/build/esm/components/Table/TableProps.d.ts +28 -0
- package/build/esm/components/Table/TableStyles.d.ts +2 -0
- package/build/esm/components/Table/index.d.ts +2 -0
- package/build/esm/components/Table/util/makeColumns.d.ts +7 -0
- package/build/esm/components/TableActionsCell/TableActionsCell.d.ts +3 -0
- package/build/esm/components/TableActionsCell/TableActionsCellProps.d.ts +10 -0
- package/build/esm/components/TableActionsCell/index.d.ts +2 -0
- package/build/esm/components/TableBody/TableBody.d.ts +2 -0
- package/build/esm/components/TableBody/index.d.ts +1 -0
- package/build/esm/components/TableCell/TableCell.d.ts +2 -0
- package/build/esm/components/TableCell/TableCellStyles.d.ts +1 -0
- package/build/esm/components/TableCell/index.d.ts +1 -0
- package/build/esm/components/TableFooter/TableFooter.d.ts +2 -0
- package/build/esm/components/TableFooter/index.d.ts +1 -0
- package/build/esm/components/TableHeader/TableHeader.d.ts +2 -0
- package/build/esm/components/TableHeader/index.d.ts +1 -0
- package/build/esm/components/TableHeaderCell/TableHeaderCell.d.ts +3 -0
- package/build/esm/components/TableHeaderCell/TableHeaderCellProps.d.ts +8 -0
- package/build/esm/components/TableHeaderCell/TableHeaderCellStyles.d.ts +2 -0
- package/build/esm/components/TableHeaderCell/index.d.ts +1 -0
- package/build/esm/components/TableHeaderRow/TableHeaderRow.d.ts +2 -0
- package/build/esm/components/TableHeaderRow/index.d.ts +1 -0
- package/build/esm/components/TableRow/TableRow.d.ts +2 -0
- package/build/esm/components/TableRow/TableRowStyles.d.ts +1 -0
- package/build/esm/components/TableRow/index.d.ts +1 -0
- package/build/esm/components/Tabs/index.d.ts +1 -0
- package/build/esm/components/TextField/index.d.ts +1 -0
- package/build/esm/components/ThemeProvider/index.d.ts +1 -0
- package/build/esm/components/ToggleButton/ToggleButton.d.ts +3 -0
- package/build/esm/components/ToggleButton/ToggleButtonProps.d.ts +4 -0
- package/build/esm/components/ToggleButton/ToggleButtonStyles.d.ts +2 -0
- package/build/esm/components/ToggleButton/index.d.ts +2 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +3 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupProps.d.ts +6 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.d.ts +1 -0
- package/build/esm/components/ToggleButtonGroup/index.d.ts +2 -0
- package/build/esm/components/Toolbar/index.d.ts +1 -0
- package/build/esm/components/Tooltip/Tooltip.d.ts +3 -0
- package/build/esm/components/Tooltip/TooltipProps.d.ts +1 -0
- package/build/esm/components/Tooltip/TooltipStyles.d.ts +2 -0
- package/build/esm/components/Tooltip/index.d.ts +2 -0
- package/build/esm/components/Typography/Typography.d.ts +3 -0
- package/build/esm/components/Typography/TypographyStyles.d.ts +2 -0
- package/build/esm/components/Typography/index.d.ts +2 -0
- package/build/esm/components/index.d.ts +75 -0
- package/build/esm/hooks/index.d.ts +1 -0
- package/build/esm/hooks/useCollapsibleText.d.ts +10 -0
- package/build/esm/index.d.ts +3 -0
- package/build/esm/index.js +1339 -0
- package/build/esm/index.js.map +1 -0
- package/build/{index.es.js → esm/react-table-de7bf68c.js} +3 -1337
- package/build/esm/react-table-de7bf68c.js.map +1 -0
- package/build/esm/types/index.d.ts +2 -0
- package/build/esm/util/ServerStyleSheets.d.ts +1 -0
- package/build/esm/util/colors/alpha.d.ts +1 -0
- package/build/esm/util/colors/darken.d.ts +1 -0
- package/build/esm/util/colors/decomposeColor.d.ts +1 -0
- package/build/esm/util/colors/getLuminance.d.ts +1 -0
- package/build/esm/util/colors/hexToRgb.d.ts +1 -0
- package/build/esm/util/colors/index.d.ts +8 -0
- package/build/esm/util/colors/lighten.d.ts +1 -0
- package/build/esm/util/colors/recomposeColor.d.ts +1 -0
- package/build/esm/util/colors/rgbToHex.d.ts +1 -0
- package/build/esm/util/createTheme.d.ts +1 -0
- package/build/esm/util/index.d.ts +4 -0
- package/build/esm/util/makeStyles.d.ts +1 -0
- package/package.json +3 -3
- package/build/index.es.js.map +0 -1
|
@@ -1,1064 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { makeStyles, Paper as Paper$1, useTheme, Box, Popper, Grow, Slider } from '@material-ui/core';
|
|
3
|
-
export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Box, Breadcrumbs, ButtonBase, ClickAwayListener, Fab, GridList, Hidden, Modal, Popover, Popper, Step, StepButton, StepConnector, StepContent, StepIcon, StepLabel, Stepper, ThemeProvider, Toolbar, alpha, createTheme, darken, decomposeColor, getLuminance, hexToRgb, lighten, makeStyles, recomposeColor, rgbToHex } from '@material-ui/core';
|
|
4
|
-
export { default as AppBar } from '@material-ui/core/AppBar';
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import React__default, { createElement, forwardRef, useRef, useState, useReducer, useEffect, useMemo, Fragment } from 'react';
|
|
7
|
-
import MuiIconButton from '@material-ui/core/IconButton';
|
|
8
|
-
import MuiTypography from '@material-ui/core/Typography';
|
|
9
|
-
import { makeStyles as makeStyles$1, useTheme as useTheme$1 } from '@material-ui/core/styles';
|
|
10
|
-
export { ServerStyleSheets } from '@material-ui/core/styles';
|
|
11
|
-
import MuiAvatar from '@material-ui/core/Avatar';
|
|
12
|
-
export { default as Badge } from '@material-ui/core/Badge';
|
|
13
|
-
import MuiButton from '@material-ui/core/Button';
|
|
14
|
-
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
15
|
-
export { default as CircularProgress } from '@material-ui/core/CircularProgress';
|
|
16
|
-
export { default as ButtonGroup } from '@material-ui/core/ButtonGroup';
|
|
17
|
-
export { default as Card } from '@material-ui/core/Card';
|
|
18
|
-
export { default as CardActionArea } from '@material-ui/core/CardActionArea';
|
|
19
|
-
export { default as CardActions } from '@material-ui/core/CardActions';
|
|
20
|
-
export { default as CardContent } from '@material-ui/core/CardContent';
|
|
21
|
-
export { default as CardHeader } from '@material-ui/core/CardHeader';
|
|
22
|
-
export { default as CardMedia } from '@material-ui/core/CardMedia';
|
|
23
|
-
import MuiCheckbox from '@material-ui/core/Checkbox';
|
|
24
|
-
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
25
|
-
export { default as FormControlLabel } from '@material-ui/core/FormControlLabel';
|
|
26
|
-
export { default as Chip } from '@material-ui/core/Chip';
|
|
27
|
-
import Collapse from '@material-ui/core/Collapse';
|
|
28
|
-
export { default as Dialog } from '@material-ui/core/Dialog';
|
|
29
|
-
export { default as DialogActions } from '@material-ui/core/DialogActions';
|
|
30
|
-
export { default as DialogContent } from '@material-ui/core/DialogContent';
|
|
31
|
-
export { default as DialogTitle } from '@material-ui/core/DialogTitle';
|
|
32
|
-
export { default as Drawer } from '@material-ui/core/Drawer';
|
|
33
|
-
export { default as FormControl } from '@material-ui/core/FormControl';
|
|
34
|
-
export { default as Grid } from '@material-ui/core/Grid';
|
|
35
|
-
export { default as InputAdornment } from '@material-ui/core/InputAdornment';
|
|
36
|
-
export { default as LinearProgress } from '@material-ui/core/LinearProgress';
|
|
37
|
-
import MuiLink from '@material-ui/core/Link';
|
|
38
|
-
export { default as List } from '@material-ui/core/List';
|
|
39
|
-
export { default as ListItem } from '@material-ui/core/ListItem';
|
|
40
|
-
export { default as ListItemIcon } from '@material-ui/core/ListItemIcon';
|
|
41
|
-
export { default as ListItemSecondaryAction } from '@material-ui/core/ListItemSecondaryAction';
|
|
42
|
-
export { default as ListItemText } from '@material-ui/core/ListItemText';
|
|
43
|
-
import Menu from '@material-ui/core/Menu';
|
|
44
|
-
export { default as Menu } from '@material-ui/core/Menu';
|
|
45
|
-
import MenuItem from '@material-ui/core/MenuItem';
|
|
46
|
-
export { default as MenuItem } from '@material-ui/core/MenuItem';
|
|
47
|
-
export { default as MenuList } from '@material-ui/core/MenuList';
|
|
48
|
-
import MuiRadio from '@material-ui/core/Radio';
|
|
49
|
-
import TextField from '@material-ui/core/TextField';
|
|
50
|
-
export { default as TextField } from '@material-ui/core/TextField';
|
|
51
|
-
import MuiSwitch from '@material-ui/core/Switch';
|
|
52
|
-
import { Pagination } from '@material-ui/lab';
|
|
53
|
-
export { default as Tab } from '@material-ui/core/Tab';
|
|
54
|
-
export { default as Tabs } from '@material-ui/core/Tabs';
|
|
55
|
-
import MuiToggleButton from '@material-ui/lab/ToggleButton';
|
|
56
|
-
import MuiToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
|
|
57
|
-
import MuiTooltip from '@material-ui/core/Tooltip';
|
|
58
|
-
|
|
59
|
-
/*! *****************************************************************************
|
|
60
|
-
Copyright (c) Microsoft Corporation.
|
|
61
|
-
|
|
62
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
63
|
-
purpose with or without fee is hereby granted.
|
|
64
|
-
|
|
65
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
66
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
67
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
68
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
69
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
70
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
71
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
72
|
-
***************************************************************************** */
|
|
73
|
-
|
|
74
|
-
var __assign = function() {
|
|
75
|
-
__assign = Object.assign || function __assign(t) {
|
|
76
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
77
|
-
s = arguments[i];
|
|
78
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
79
|
-
}
|
|
80
|
-
return t;
|
|
81
|
-
};
|
|
82
|
-
return __assign.apply(this, arguments);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
function __rest(s, e) {
|
|
86
|
-
var t = {};
|
|
87
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
88
|
-
t[p] = s[p];
|
|
89
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
90
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
91
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
92
|
-
t[p[i]] = s[p[i]];
|
|
93
|
-
}
|
|
94
|
-
return t;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function __spreadArray(to, from, pack) {
|
|
98
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
99
|
-
if (ar || !(i in from)) {
|
|
100
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
101
|
-
ar[i] = from[i];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return to.concat(ar || from);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
var _path$3K;
|
|
108
|
-
|
|
109
|
-
function _extends$3$() { _extends$3$ = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3$.apply(this, arguments); }
|
|
110
|
-
|
|
111
|
-
function SvgMore(props) {
|
|
112
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3$({
|
|
113
|
-
viewBox: "0 0 16 16",
|
|
114
|
-
strokeLinecap: "round",
|
|
115
|
-
strokeLinejoin: "round",
|
|
116
|
-
stroke: "currentColor",
|
|
117
|
-
width: "1em",
|
|
118
|
-
height: "1em",
|
|
119
|
-
fill: "none"
|
|
120
|
-
}, props), _path$3K || (_path$3K = /*#__PURE__*/React.createElement("path", {
|
|
121
|
-
d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.333A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z"
|
|
122
|
-
})));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
var _path$2X;
|
|
126
|
-
|
|
127
|
-
function _extends$3b() { _extends$3b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3b.apply(this, arguments); }
|
|
128
|
-
|
|
129
|
-
function SvgChevronDown(props) {
|
|
130
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3b({
|
|
131
|
-
viewBox: "0 0 16 16",
|
|
132
|
-
strokeLinecap: "round",
|
|
133
|
-
strokeLinejoin: "round",
|
|
134
|
-
stroke: "currentColor",
|
|
135
|
-
width: "1em",
|
|
136
|
-
height: "1em",
|
|
137
|
-
fill: "none"
|
|
138
|
-
}, props), _path$2X || (_path$2X = /*#__PURE__*/React.createElement("path", {
|
|
139
|
-
d: "M4 6l4 4 4-4"
|
|
140
|
-
})));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
var _path$2W;
|
|
144
|
-
|
|
145
|
-
function _extends$3a() { _extends$3a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3a.apply(this, arguments); }
|
|
146
|
-
|
|
147
|
-
function SvgChevronUp(props) {
|
|
148
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3a({
|
|
149
|
-
viewBox: "0 0 16 16",
|
|
150
|
-
strokeLinecap: "round",
|
|
151
|
-
strokeLinejoin: "round",
|
|
152
|
-
stroke: "currentColor",
|
|
153
|
-
width: "1em",
|
|
154
|
-
height: "1em",
|
|
155
|
-
fill: "none"
|
|
156
|
-
}, props), _path$2W || (_path$2W = /*#__PURE__*/React.createElement("path", {
|
|
157
|
-
d: "M12 10L8 6l-4 4"
|
|
158
|
-
})));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
var _path$1f;
|
|
162
|
-
|
|
163
|
-
function _extends$1p() { _extends$1p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1p.apply(this, arguments); }
|
|
164
|
-
|
|
165
|
-
function SvgPause(props) {
|
|
166
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1p({
|
|
167
|
-
viewBox: "0 0 16 16",
|
|
168
|
-
strokeLinecap: "round",
|
|
169
|
-
strokeLinejoin: "round",
|
|
170
|
-
stroke: "currentColor",
|
|
171
|
-
width: "1em",
|
|
172
|
-
height: "1em",
|
|
173
|
-
fill: "none"
|
|
174
|
-
}, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
|
|
175
|
-
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
176
|
-
})));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
var _path$1d;
|
|
180
|
-
|
|
181
|
-
function _extends$1n() { _extends$1n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1n.apply(this, arguments); }
|
|
182
|
-
|
|
183
|
-
function SvgPlay(props) {
|
|
184
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1n({
|
|
185
|
-
viewBox: "0 0 16 16",
|
|
186
|
-
strokeLinecap: "round",
|
|
187
|
-
strokeLinejoin: "round",
|
|
188
|
-
stroke: "currentColor",
|
|
189
|
-
width: "1em",
|
|
190
|
-
height: "1em",
|
|
191
|
-
fill: "none"
|
|
192
|
-
}, props), _path$1d || (_path$1d = /*#__PURE__*/React.createElement("path", {
|
|
193
|
-
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
194
|
-
})));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
var _path$10;
|
|
198
|
-
|
|
199
|
-
function _extends$1a() { _extends$1a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1a.apply(this, arguments); }
|
|
200
|
-
|
|
201
|
-
function SvgVolumeDown(props) {
|
|
202
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1a({
|
|
203
|
-
viewBox: "0 0 16 16",
|
|
204
|
-
strokeLinecap: "round",
|
|
205
|
-
strokeLinejoin: "round",
|
|
206
|
-
stroke: "currentColor",
|
|
207
|
-
width: "1em",
|
|
208
|
-
height: "1em",
|
|
209
|
-
fill: "none"
|
|
210
|
-
}, props), _path$10 || (_path$10 = /*#__PURE__*/React.createElement("path", {
|
|
211
|
-
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
212
|
-
})));
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
var _path$$;
|
|
216
|
-
|
|
217
|
-
function _extends$19() { _extends$19 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$19.apply(this, arguments); }
|
|
218
|
-
|
|
219
|
-
function SvgVolumeMute(props) {
|
|
220
|
-
return /*#__PURE__*/React.createElement("svg", _extends$19({
|
|
221
|
-
viewBox: "0 0 16 16",
|
|
222
|
-
strokeLinecap: "round",
|
|
223
|
-
strokeLinejoin: "round",
|
|
224
|
-
stroke: "currentColor",
|
|
225
|
-
width: "1em",
|
|
226
|
-
height: "1em",
|
|
227
|
-
fill: "none"
|
|
228
|
-
}, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
|
|
229
|
-
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
|
|
230
|
-
})));
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
var _path$_;
|
|
234
|
-
|
|
235
|
-
function _extends$18() { _extends$18 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$18.apply(this, arguments); }
|
|
236
|
-
|
|
237
|
-
function SvgVolumeOff(props) {
|
|
238
|
-
return /*#__PURE__*/React.createElement("svg", _extends$18({
|
|
239
|
-
viewBox: "0 0 16 16",
|
|
240
|
-
strokeLinecap: "round",
|
|
241
|
-
strokeLinejoin: "round",
|
|
242
|
-
stroke: "currentColor",
|
|
243
|
-
width: "1em",
|
|
244
|
-
height: "1em",
|
|
245
|
-
fill: "none"
|
|
246
|
-
}, props), _path$_ || (_path$_ = /*#__PURE__*/React.createElement("path", {
|
|
247
|
-
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
|
|
248
|
-
})));
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
var _path$Z;
|
|
252
|
-
|
|
253
|
-
function _extends$17() { _extends$17 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$17.apply(this, arguments); }
|
|
254
|
-
|
|
255
|
-
function SvgVolumeUp(props) {
|
|
256
|
-
return /*#__PURE__*/React.createElement("svg", _extends$17({
|
|
257
|
-
viewBox: "0 0 16 16",
|
|
258
|
-
strokeLinecap: "round",
|
|
259
|
-
strokeLinejoin: "round",
|
|
260
|
-
stroke: "currentColor",
|
|
261
|
-
width: "1em",
|
|
262
|
-
height: "1em",
|
|
263
|
-
fill: "none"
|
|
264
|
-
}, props), _path$Z || (_path$Z = /*#__PURE__*/React.createElement("path", {
|
|
265
|
-
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713"
|
|
266
|
-
})));
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
var useIconStyles = makeStyles(function (_a) {
|
|
270
|
-
var spacing = _a.spacing, palette = _a.palette;
|
|
271
|
-
var getFontSize = function (_a) {
|
|
272
|
-
var size = _a.size;
|
|
273
|
-
var sizes = {
|
|
274
|
-
inherit: 'inherit',
|
|
275
|
-
small: spacing(1.5),
|
|
276
|
-
medium: spacing(2),
|
|
277
|
-
large: spacing(2.5),
|
|
278
|
-
'extra-large': spacing(3),
|
|
279
|
-
};
|
|
280
|
-
return size ? sizes[size] : 'inherit';
|
|
281
|
-
};
|
|
282
|
-
var getColor = function (props) {
|
|
283
|
-
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
284
|
-
var value = 'inherit';
|
|
285
|
-
if (props.color) {
|
|
286
|
-
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
287
|
-
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
288
|
-
value = palette[color][variant];
|
|
289
|
-
}
|
|
290
|
-
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
291
|
-
value = props.color;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return value;
|
|
295
|
-
};
|
|
296
|
-
return {
|
|
297
|
-
root: {
|
|
298
|
-
color: getColor,
|
|
299
|
-
fontSize: getFontSize,
|
|
300
|
-
strokeWidth: '1.3px',
|
|
301
|
-
},
|
|
302
|
-
};
|
|
303
|
-
});
|
|
1
|
+
import React__default from 'react';
|
|
304
2
|
|
|
305
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
306
4
|
|
|
307
|
-
var classnames = {exports: {}};
|
|
308
|
-
|
|
309
|
-
/*!
|
|
310
|
-
Copyright (c) 2018 Jed Watson.
|
|
311
|
-
Licensed under the MIT License (MIT), see
|
|
312
|
-
http://jedwatson.github.io/classnames
|
|
313
|
-
*/
|
|
314
|
-
|
|
315
|
-
(function (module) {
|
|
316
|
-
/* global define */
|
|
317
|
-
|
|
318
|
-
(function () {
|
|
319
|
-
|
|
320
|
-
var hasOwn = {}.hasOwnProperty;
|
|
321
|
-
|
|
322
|
-
function classNames() {
|
|
323
|
-
var classes = [];
|
|
324
|
-
|
|
325
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
326
|
-
var arg = arguments[i];
|
|
327
|
-
if (!arg) continue;
|
|
328
|
-
|
|
329
|
-
var argType = typeof arg;
|
|
330
|
-
|
|
331
|
-
if (argType === 'string' || argType === 'number') {
|
|
332
|
-
classes.push(arg);
|
|
333
|
-
} else if (Array.isArray(arg)) {
|
|
334
|
-
if (arg.length) {
|
|
335
|
-
var inner = classNames.apply(null, arg);
|
|
336
|
-
if (inner) {
|
|
337
|
-
classes.push(inner);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
} else if (argType === 'object') {
|
|
341
|
-
if (arg.toString === Object.prototype.toString) {
|
|
342
|
-
for (var key in arg) {
|
|
343
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
344
|
-
classes.push(key);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
} else {
|
|
348
|
-
classes.push(arg.toString());
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return classes.join(' ');
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
if (module.exports) {
|
|
357
|
-
classNames.default = classNames;
|
|
358
|
-
module.exports = classNames;
|
|
359
|
-
} else {
|
|
360
|
-
window.classNames = classNames;
|
|
361
|
-
}
|
|
362
|
-
}());
|
|
363
|
-
}(classnames));
|
|
364
|
-
|
|
365
|
-
var classNames = classnames.exports;
|
|
366
|
-
|
|
367
|
-
var iconStaticClassName = 'pop-icon';
|
|
368
|
-
var Icon = function (props) {
|
|
369
|
-
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
370
|
-
var classes = useIconStyles(props);
|
|
371
|
-
var isValid = true;
|
|
372
|
-
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
373
|
-
isValid = false;
|
|
374
|
-
}
|
|
375
|
-
return isValid
|
|
376
|
-
? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
377
|
-
: null;
|
|
378
|
-
};
|
|
379
|
-
Icon.defaultProps = {
|
|
380
|
-
size: 'inherit',
|
|
381
|
-
color: 'inherit',
|
|
382
|
-
};
|
|
383
|
-
Icon.displayName = 'Icon';
|
|
384
|
-
|
|
385
|
-
var IconButton = forwardRef(function (props, ref) {
|
|
386
|
-
return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
|
|
387
|
-
});
|
|
388
|
-
IconButton.displayName = 'IconButton';
|
|
389
|
-
IconButton.defaultProps = {
|
|
390
|
-
color: 'secondary',
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
var useTypographyStyles = makeStyles$1(function () {
|
|
394
|
-
var _a;
|
|
395
|
-
return ({
|
|
396
|
-
root: (_a = {},
|
|
397
|
-
_a["& ." + iconStaticClassName] = {
|
|
398
|
-
position: 'relative',
|
|
399
|
-
top: '0.125em',
|
|
400
|
-
padding: '0 0.125em',
|
|
401
|
-
boxSizing: 'content-box',
|
|
402
|
-
},
|
|
403
|
-
_a),
|
|
404
|
-
caption: {
|
|
405
|
-
display: 'inline',
|
|
406
|
-
},
|
|
407
|
-
overline: {
|
|
408
|
-
display: 'inline',
|
|
409
|
-
},
|
|
410
|
-
});
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
var Typography = forwardRef(function (props, ref) {
|
|
414
|
-
var classes = useTypographyStyles(props);
|
|
415
|
-
return React__default.createElement(MuiTypography, __assign({ ref: ref, classes: classes }, props));
|
|
416
|
-
});
|
|
417
|
-
Typography.displayName = 'Typography';
|
|
418
|
-
|
|
419
|
-
var useStyles$1 = makeStyles(function (_a) {
|
|
420
|
-
var spacing = _a.spacing;
|
|
421
|
-
return ({
|
|
422
|
-
root: {
|
|
423
|
-
'&:last-child': {
|
|
424
|
-
marginBottom: 0,
|
|
425
|
-
},
|
|
426
|
-
marginBottom: spacing(4),
|
|
427
|
-
padding: spacing(4),
|
|
428
|
-
},
|
|
429
|
-
});
|
|
430
|
-
});
|
|
431
|
-
var Paper = forwardRef(function (props, ref) {
|
|
432
|
-
var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
|
|
433
|
-
var classes = useStyles$1(props);
|
|
434
|
-
return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
|
|
435
|
-
});
|
|
436
|
-
Paper.displayName = 'Paper';
|
|
437
|
-
Paper.defaultProps = {
|
|
438
|
-
legacyStyles: false,
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
var AUDIO_PLAYER_EVENT_TYPES;
|
|
442
|
-
(function (AUDIO_PLAYER_EVENT_TYPES) {
|
|
443
|
-
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_PLAYBACK"] = "TOGGLE_PLAYBACK";
|
|
444
|
-
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_VOLUME_CONTROL"] = "TOGGLE_VOLUME_CONTROL";
|
|
445
|
-
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_MUTE"] = "TOGGLE_MUTE";
|
|
446
|
-
AUDIO_PLAYER_EVENT_TYPES["VOLUME_CHANGE"] = "VOLUME_CHANGE";
|
|
447
|
-
AUDIO_PLAYER_EVENT_TYPES["TIME_CHANGE"] = "TIME_CHANGE";
|
|
448
|
-
AUDIO_PLAYER_EVENT_TYPES["DURATION_CHANGE"] = "DURATION_CHANGE";
|
|
449
|
-
AUDIO_PLAYER_EVENT_TYPES["SET_TIME"] = "SET_TIME";
|
|
450
|
-
AUDIO_PLAYER_EVENT_TYPES["CAN_PLAY"] = "CAN_PLAY";
|
|
451
|
-
AUDIO_PLAYER_EVENT_TYPES["RESET"] = "RESET";
|
|
452
|
-
})(AUDIO_PLAYER_EVENT_TYPES || (AUDIO_PLAYER_EVENT_TYPES = {}));
|
|
453
|
-
var PLAYBACK_STATES;
|
|
454
|
-
(function (PLAYBACK_STATES) {
|
|
455
|
-
PLAYBACK_STATES["NONE"] = "NONE";
|
|
456
|
-
PLAYBACK_STATES["PAUSED"] = "PAUSED";
|
|
457
|
-
PLAYBACK_STATES["PLAYING"] = "PLAYING";
|
|
458
|
-
})(PLAYBACK_STATES || (PLAYBACK_STATES = {}));
|
|
459
|
-
var CONTROL_LABELS;
|
|
460
|
-
(function (CONTROL_LABELS) {
|
|
461
|
-
CONTROL_LABELS["PAUSE"] = "PAUSE";
|
|
462
|
-
CONTROL_LABELS["PLAY"] = "PLAY";
|
|
463
|
-
CONTROL_LABELS["MUTE"] = "MUTE";
|
|
464
|
-
CONTROL_LABELS["UNMUTE"] = "UNMUTE";
|
|
465
|
-
})(CONTROL_LABELS || (CONTROL_LABELS = {}));
|
|
466
|
-
var VOLUME_CONTROL_STATES;
|
|
467
|
-
(function (VOLUME_CONTROL_STATES) {
|
|
468
|
-
VOLUME_CONTROL_STATES["SHOW"] = "SHOW";
|
|
469
|
-
VOLUME_CONTROL_STATES["HIDE"] = "HIDE";
|
|
470
|
-
})(VOLUME_CONTROL_STATES || (VOLUME_CONTROL_STATES = {}));
|
|
471
|
-
|
|
472
|
-
var initialAudioPlayerState = {
|
|
473
|
-
playback: PLAYBACK_STATES.NONE,
|
|
474
|
-
volumeControls: VOLUME_CONTROL_STATES.HIDE,
|
|
475
|
-
context: {
|
|
476
|
-
volume: 100,
|
|
477
|
-
playbackButtonLabel: CONTROL_LABELS.PLAY,
|
|
478
|
-
volumeButtonLabel: CONTROL_LABELS.MUTE,
|
|
479
|
-
},
|
|
480
|
-
};
|
|
481
|
-
var getPlayback = function (_a) {
|
|
482
|
-
var audio = _a.current;
|
|
483
|
-
var playback = PLAYBACK_STATES.NONE;
|
|
484
|
-
if (audio) {
|
|
485
|
-
var paused = audio.paused, readyState = audio.readyState;
|
|
486
|
-
if (readyState === 0) {
|
|
487
|
-
playback = PLAYBACK_STATES.NONE;
|
|
488
|
-
}
|
|
489
|
-
else if (paused) {
|
|
490
|
-
playback = PLAYBACK_STATES.PAUSED;
|
|
491
|
-
}
|
|
492
|
-
else {
|
|
493
|
-
playback = PLAYBACK_STATES.PLAYING;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return playback;
|
|
497
|
-
};
|
|
498
|
-
var audioPlayerReducer = function (state, event) {
|
|
499
|
-
var _a, _b;
|
|
500
|
-
var audioRef = state.context.audioRef;
|
|
501
|
-
var nextState = __assign({}, state);
|
|
502
|
-
switch (state.playback) {
|
|
503
|
-
case PLAYBACK_STATES.NONE:
|
|
504
|
-
if (event.type === AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY) {
|
|
505
|
-
nextState.playback = getPlayback(audioRef);
|
|
506
|
-
return nextState;
|
|
507
|
-
}
|
|
508
|
-
break;
|
|
509
|
-
case PLAYBACK_STATES.PAUSED:
|
|
510
|
-
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
511
|
-
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
512
|
-
nextState.playback = getPlayback(audioRef);
|
|
513
|
-
nextState.context.playbackButtonLabel = CONTROL_LABELS.PAUSE;
|
|
514
|
-
return nextState;
|
|
515
|
-
}
|
|
516
|
-
break;
|
|
517
|
-
case PLAYBACK_STATES.PLAYING:
|
|
518
|
-
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
519
|
-
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
|
520
|
-
nextState.playback = getPlayback(audioRef);
|
|
521
|
-
nextState.context.playbackButtonLabel = CONTROL_LABELS.PLAY;
|
|
522
|
-
return nextState;
|
|
523
|
-
}
|
|
524
|
-
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE) {
|
|
525
|
-
return nextState;
|
|
526
|
-
}
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
switch (state.volumeControls) {
|
|
530
|
-
case VOLUME_CONTROL_STATES.SHOW:
|
|
531
|
-
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
|
|
532
|
-
nextState.volumeControls = VOLUME_CONTROL_STATES.HIDE;
|
|
533
|
-
return nextState;
|
|
534
|
-
}
|
|
535
|
-
if (event.type === AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE) {
|
|
536
|
-
if (nextState.context.volume !== event.context.volume) {
|
|
537
|
-
nextState.context.volume = event.context.volume;
|
|
538
|
-
if (audioRef.current) {
|
|
539
|
-
audioRef.current.volume = event.context.volume;
|
|
540
|
-
}
|
|
541
|
-
return nextState;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
break;
|
|
545
|
-
case VOLUME_CONTROL_STATES.HIDE:
|
|
546
|
-
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
|
|
547
|
-
nextState.volumeControls = VOLUME_CONTROL_STATES.SHOW;
|
|
548
|
-
return nextState;
|
|
549
|
-
}
|
|
550
|
-
break;
|
|
551
|
-
}
|
|
552
|
-
switch (event.type) {
|
|
553
|
-
case AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE:
|
|
554
|
-
if (audioRef.current) {
|
|
555
|
-
audioRef.current.muted = !audioRef.current.muted;
|
|
556
|
-
return nextState;
|
|
557
|
-
}
|
|
558
|
-
break;
|
|
559
|
-
case AUDIO_PLAYER_EVENT_TYPES.SET_TIME:
|
|
560
|
-
if (audioRef.current) {
|
|
561
|
-
audioRef.current.currentTime = event.context.time;
|
|
562
|
-
return nextState;
|
|
563
|
-
}
|
|
564
|
-
break;
|
|
565
|
-
case AUDIO_PLAYER_EVENT_TYPES.RESET:
|
|
566
|
-
if (audioRef.current) {
|
|
567
|
-
audioRef.current.currentTime = 0;
|
|
568
|
-
nextState.playback = getPlayback(audioRef);
|
|
569
|
-
return nextState;
|
|
570
|
-
}
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
return state;
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
var useVolumeIcon = function (state) {
|
|
577
|
-
var volumeIcon = SvgVolumeUp;
|
|
578
|
-
if (state.context.volume >= 0.5) {
|
|
579
|
-
volumeIcon = SvgVolumeUp;
|
|
580
|
-
}
|
|
581
|
-
else if (state.context.volume < 0.5 && state.context.volume > 0) {
|
|
582
|
-
volumeIcon = SvgVolumeDown;
|
|
583
|
-
}
|
|
584
|
-
else if (state.context.volume === 0) {
|
|
585
|
-
volumeIcon = SvgVolumeMute;
|
|
586
|
-
}
|
|
587
|
-
if (state.context.audioRef.current) {
|
|
588
|
-
if (state.context.audioRef.current.muted) {
|
|
589
|
-
volumeIcon = SvgVolumeOff;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
return volumeIcon;
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
var appendZero = function (num) { return (num < 10 ? "0" + num : num); };
|
|
596
|
-
var formatTime = function (time, remaning) {
|
|
597
|
-
if (remaning === void 0) { remaning = false; }
|
|
598
|
-
var dateTime = new Date(0, 0, 0, 0, 0, time, 0);
|
|
599
|
-
var dateTimeH = appendZero(dateTime.getHours());
|
|
600
|
-
var dateTimeM = appendZero(dateTime.getMinutes());
|
|
601
|
-
var dateTimeS = appendZero(dateTime.getSeconds());
|
|
602
|
-
var minus = remaning ? '-' : '';
|
|
603
|
-
return dateTimeH > 0 ? "" + minus + dateTimeH + ":" + dateTimeM + ":" + dateTimeS : "" + minus + dateTimeM + ":" + dateTimeS;
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
var setupAudioRef = function (config) { return function () {
|
|
607
|
-
var _a, _b, _c, _d;
|
|
608
|
-
var audioRef = config.audioRef, send = config.send;
|
|
609
|
-
var handleDurationChange = function (event) {
|
|
610
|
-
var duration = event.target.duration;
|
|
611
|
-
send({ type: AUDIO_PLAYER_EVENT_TYPES.DURATION_CHANGE, context: { duration: duration } });
|
|
612
|
-
};
|
|
613
|
-
var handleTimeUpdate = function (event) {
|
|
614
|
-
var currentTime = event.target.currentTime;
|
|
615
|
-
send({ type: AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE, context: { currentTime: currentTime } });
|
|
616
|
-
};
|
|
617
|
-
var handleCanPlay = function () {
|
|
618
|
-
send({ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY });
|
|
619
|
-
};
|
|
620
|
-
var handleEnded = function () {
|
|
621
|
-
send({ type: AUDIO_PLAYER_EVENT_TYPES.RESET });
|
|
622
|
-
};
|
|
623
|
-
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('durationchange', handleDurationChange);
|
|
624
|
-
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('timeupdate', handleTimeUpdate);
|
|
625
|
-
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('canplay', handleCanPlay);
|
|
626
|
-
(_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleEnded);
|
|
627
|
-
return function () {
|
|
628
|
-
var _a, _b, _c, _d;
|
|
629
|
-
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('durationchange', handleDurationChange);
|
|
630
|
-
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('timeupdate', handleTimeUpdate);
|
|
631
|
-
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('canplay', handleCanPlay);
|
|
632
|
-
(_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('ended', handleEnded);
|
|
633
|
-
};
|
|
634
|
-
}; };
|
|
635
|
-
|
|
636
|
-
var AudioPlayer = function (props) {
|
|
637
|
-
var _a, _b, _c, _d, _f;
|
|
638
|
-
var src = props.src;
|
|
639
|
-
var volumeRef = useRef(null);
|
|
640
|
-
var audioRef = useRef(null);
|
|
641
|
-
var spacing = useTheme().spacing;
|
|
642
|
-
var _g = useState(false), disableRipple = _g[0], setDisableRipple = _g[1];
|
|
643
|
-
var _h = useReducer(audioPlayerReducer, __assign(__assign({}, initialAudioPlayerState), { context: __assign(__assign({}, initialAudioPlayerState.context), { audioRef: audioRef }) })), state = _h[0], send = _h[1];
|
|
644
|
-
useEffect(setupAudioRef({ audioRef: audioRef, send: send }), [audioRef]);
|
|
645
|
-
var PlaybackIcon = state.playback !== PLAYBACK_STATES.PAUSED ? SvgPause : SvgPlay;
|
|
646
|
-
var VolumeIcon = useMemo(function () { return useVolumeIcon(state); }, [state.context.volume, (_a = state.context.audioRef.current) === null || _a === void 0 ? void 0 : _a.muted]);
|
|
647
|
-
var togglePlayback = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK }); };
|
|
648
|
-
var toggleVolumeControl = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL }); };
|
|
649
|
-
var toggleMute = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE }); };
|
|
650
|
-
var setTime = function (_e, time) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.SET_TIME, context: { time: time } }); };
|
|
651
|
-
var setVolume = function (_e, volume) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE, context: { volume: volume } }); };
|
|
652
|
-
return (React__default.createElement(Box, { display: "flex", alignItems: "center", gridGap: spacing(1) },
|
|
653
|
-
React__default.createElement("audio", { ref: audioRef, src: src }),
|
|
654
|
-
React__default.createElement(Box, null,
|
|
655
|
-
React__default.createElement(IconButton, { "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback },
|
|
656
|
-
React__default.createElement(Icon, { icon: PlaybackIcon })),
|
|
657
|
-
React__default.createElement(IconButton, { "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple },
|
|
658
|
-
React__default.createElement(Icon, { icon: VolumeIcon }),
|
|
659
|
-
React__default.createElement(Popper, { onClick: function (e) { return e.stopPropagation(); }, onMouseEnter: function () { return setDisableRipple(true); }, onMouseLeave: function () { return setDisableRipple(false); }, open: state.volumeControls === VOLUME_CONTROL_STATES.SHOW, anchorEl: function () { return volumeRef.current; }, transition: true, placement: "top" }, function (_a) {
|
|
660
|
-
var TransitionProps = _a.TransitionProps;
|
|
661
|
-
return (React__default.createElement(Grow, __assign({}, TransitionProps),
|
|
662
|
-
React__default.createElement(Paper, { elevation: 1 },
|
|
663
|
-
React__default.createElement(Box, { py: 1, height: 80 },
|
|
664
|
-
React__default.createElement(Slider, { color: "secondary", orientation: "vertical", value: state.context.volume, onChange: setVolume, max: 1, step: 0.01 })))));
|
|
665
|
-
}))),
|
|
666
|
-
React__default.createElement(Box, { display: "flex", flexGrow: 1, alignItems: "center", gridGap: spacing(1) },
|
|
667
|
-
React__default.createElement(Box, { flexBasis: 60, flexShrink: 0 },
|
|
668
|
-
React__default.createElement(Typography, null, formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))),
|
|
669
|
-
React__default.createElement(Slider, { color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }),
|
|
670
|
-
React__default.createElement(Box, { flexBasis: 60, flexShrink: 0, textAlign: "end" },
|
|
671
|
-
React__default.createElement(Typography, null, formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0))))));
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
var LoadingStatus;
|
|
675
|
-
(function (LoadingStatus) {
|
|
676
|
-
LoadingStatus["ERROR"] = "ERROR";
|
|
677
|
-
LoadingStatus["LOADED"] = "LOADED";
|
|
678
|
-
LoadingStatus["PENDING"] = "PENDING";
|
|
679
|
-
})(LoadingStatus || (LoadingStatus = {}));
|
|
680
|
-
/**
|
|
681
|
-
* Hook returns [imgProps, loaded]
|
|
682
|
-
* ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
|
|
683
|
-
* loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
|
|
684
|
-
*/
|
|
685
|
-
var useImgProps = function (avatarProps) {
|
|
686
|
-
var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
687
|
-
var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
|
|
688
|
-
var _a, _b;
|
|
689
|
-
setLoaded(LoadingStatus.ERROR);
|
|
690
|
-
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
691
|
-
}, onLoad: function (event) {
|
|
692
|
-
var _a, _b;
|
|
693
|
-
setLoaded(LoadingStatus.LOADED);
|
|
694
|
-
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
695
|
-
} });
|
|
696
|
-
return { imgProps: imgProps, loaded: loaded };
|
|
697
|
-
};
|
|
698
|
-
|
|
699
|
-
var getAvatarDimensions = function (theme, props) {
|
|
700
|
-
var factors = {
|
|
701
|
-
'extra-small': 3,
|
|
702
|
-
small: 4,
|
|
703
|
-
medium: 5,
|
|
704
|
-
large: 6,
|
|
705
|
-
'extra-large': 12.5,
|
|
706
|
-
};
|
|
707
|
-
var sizeFactor = factors[props.size || 'medium'];
|
|
708
|
-
return theme.spacing(sizeFactor);
|
|
709
|
-
};
|
|
710
|
-
var getAvatarFontSize = function (props) {
|
|
711
|
-
var fontSizes = {
|
|
712
|
-
'extra-small': '0.75rem',
|
|
713
|
-
small: '1rem',
|
|
714
|
-
medium: '1rem',
|
|
715
|
-
large: '1.25rem',
|
|
716
|
-
'extra-large': '3.5rem',
|
|
717
|
-
};
|
|
718
|
-
return fontSizes[props.size || 'medium'];
|
|
719
|
-
};
|
|
720
|
-
var getAvatarBackground = function (props) {
|
|
721
|
-
var src = props.src, loaded = props.loaded;
|
|
722
|
-
var background = props.background;
|
|
723
|
-
if (src && loaded === LoadingStatus.LOADED) {
|
|
724
|
-
background = 'transparent';
|
|
725
|
-
}
|
|
726
|
-
return background;
|
|
727
|
-
};
|
|
728
|
-
var useAvatarStyles = makeStyles$1(function (theme) { return ({
|
|
729
|
-
root: {
|
|
730
|
-
width: function (props) { return getAvatarDimensions(theme, props); },
|
|
731
|
-
height: function (props) { return getAvatarDimensions(theme, props); },
|
|
732
|
-
fontSize: function (props) { return getAvatarFontSize(props); },
|
|
733
|
-
backgroundColor: function (props) { return getAvatarBackground(props); },
|
|
734
|
-
color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
735
|
-
objectFit: function (props) { return props.fit; },
|
|
736
|
-
},
|
|
737
|
-
silhouette: {
|
|
738
|
-
'& path': {
|
|
739
|
-
fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
740
|
-
},
|
|
741
|
-
},
|
|
742
|
-
}); });
|
|
743
|
-
|
|
744
|
-
var _path$2;
|
|
745
|
-
|
|
746
|
-
function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
747
|
-
|
|
748
|
-
function SvgSilhouetteFemale(props) {
|
|
749
|
-
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
750
|
-
viewBox: "0 0 300 300",
|
|
751
|
-
fill: "none",
|
|
752
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
753
|
-
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
754
|
-
d: "M179.417 182.917a3.362 3.362 0 00-2.951 1.076 3.461 3.461 0 00-.875 3.021c1.916 10.069 8.368 23.889 28.173 32.493 2.347 1.014 5.972 1.805 10.57 2.799 17.208 3.722 45.986 9.958 53.055 36.333a3.488 3.488 0 001.622 2.11 3.491 3.491 0 002.639.345 3.488 3.488 0 002.109-1.622 3.473 3.473 0 00.345-2.639c-8.173-30.465-40.777-37.527-58.298-41.319-4.056-.882-7.563-1.639-9.278-2.389-11.903-5.167-19.59-12.833-22.924-22.819 33.07 2.458 48.042-10.716 48.702-11.313a3.469 3.469 0 001.121-2.951 3.478 3.478 0 00-1.732-2.639c-19.084-10.903-19.084-48.577-19.084-62.764 0-39.674-26.722-71.125-60.979-71.618-.326-.011-.652-.018-.979-.021h-.007c-34.757.194-63.035 31.68-63.035 70.194 0 14.188 0 51.868-19.083 62.764a3.5 3.5 0 00-1.73 2.769 3.494 3.494 0 001.313 2.988c.959.743 22.14 16.952 48.202 12.028-3.486 9.569-11.07 16.931-22.625 21.951-1.674.73-5.007 1.528-8.868 2.445-17.64 4.194-50.48 12.007-58.702 42.687a3.481 3.481 0 00.348 2.638 3.475 3.475 0 006.368-.839c7.145-26.694 36.229-33.604 53.597-37.743 4.354-1.035 7.791-1.854 10.028-2.82 19.805-8.604 26.25-22.423 28.173-32.493a3.45 3.45 0 00-1.104-3.243 3.457 3.457 0 00-3.347-.722c-18.799 5.917-36.167-2.222-43.757-6.736 18.132-15.181 18.132-50.118 18.132-65.674 0-34.7 25.18-63.076 56.389-63.263l.736.041c30.778.438 53.986 28.236 53.986 64.667 0 15.562 0 50.576 18.208 65.757-6.271 3.583-20.569 9.382-44.458 6.521z",
|
|
755
|
-
fill: "#2E3042"
|
|
756
|
-
})));
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
var _path$1;
|
|
760
|
-
|
|
761
|
-
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
762
|
-
|
|
763
|
-
function SvgSilhouetteMale(props) {
|
|
764
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
765
|
-
viewBox: "0 0 300 300",
|
|
766
|
-
fill: "none",
|
|
767
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
768
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
769
|
-
d: "M27.594 261.886a3.513 3.513 0 004.281-2.478c7.204-26.904 36.484-33.877 53.984-38.05 4.386-1.043 7.848-1.869 10.1-2.842 19.935-8.66 26.433-22.592 28.377-32.757a3.493 3.493 0 00-.133-1.81 3.492 3.492 0 00-1.021-1.501c-10.38-8.968-19.137-22.431-24.663-37.917a3.447 3.447 0 00-.72-1.197c-7.31-7.953-11.506-16.361-11.506-23.06 0-3.914 1.475-6.539 4.798-8.52a3.5 3.5 0 001.7-2.857c1.545-35.662 26.922-63.735 58.047-63.917l.749.049c31.279.434 56.495 29.11 57.397 65.275a3.487 3.487 0 001.245 2.584c2.189 1.855 3.211 4.207 3.211 7.4 0 5.607-2.987 12.503-8.401 19.406a3.633 3.633 0 00-.587 1.106c-5.596 17.754-15.64 33.429-27.545 43.02a3.517 3.517 0 00-1.245 3.381c1.945 10.159 8.442 24.083 28.377 32.757 2.357 1.022 6.015 1.821 10.653 2.822 17.325 3.752 46.318 10.046 53.431 36.628a3.503 3.503 0 002.926 2.562 3.494 3.494 0 003.922-3.019 3.52 3.52 0 00-.091-1.363c-8.219-30.713-41.065-37.833-58.705-41.655-4.092-.889-7.625-1.652-9.345-2.408-13.01-5.657-21.026-14.275-23.859-25.658 12.08-10.383 22.187-26.401 27.965-44.365 6.134-7.981 9.505-16.2 9.505-23.221 0-4.684-1.511-8.59-4.504-11.643-1.665-39.232-29.636-70.127-64.35-70.624L150.545 38c-34.085.182-62.175 30.264-64.63 68.818-4.379 3.22-6.603 7.736-6.603 13.47 0 8.282 4.68 18.188 12.87 27.275 5.659 15.563 14.43 29.235 24.873 38.805-2.819 11.426-10.842 20.072-23.88 25.735-1.685.735-5.043 1.541-8.932 2.465-17.773 4.228-50.843 12.104-59.125 43.034a3.501 3.501 0 002.476 4.284z",
|
|
770
|
-
fill: "#2E3042"
|
|
771
|
-
})));
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
var _path;
|
|
775
|
-
|
|
776
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
777
|
-
|
|
778
|
-
function SvgSilhouetteNeutral(props) {
|
|
779
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
780
|
-
viewBox: "0 0 300 300",
|
|
781
|
-
fill: "none",
|
|
782
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
783
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
784
|
-
fillRule: "evenodd",
|
|
785
|
-
clipRule: "evenodd",
|
|
786
|
-
d: "M209 121c0 32.585-26.415 59-59 59s-59-26.415-59-59 26.415-59 59-59 59 26.415 59 59zm8 0c0 37.003-29.997 67-67 67s-67-29.997-67-67 29.997-67 67-67 67 29.997 67 67zm35 137.333V284h8v-25.667c0-13.614-5.821-26.671-16.182-36.298C233.456 212.408 219.403 207 204.75 207H94.25c-14.653 0-28.706 5.408-39.068 15.035C44.821 231.662 39 244.719 39 258.333V284h8v-25.667c0-11.295 4.824-22.257 13.628-30.437C69.45 219.698 81.537 215 94.25 215h110.5c12.714 0 24.799 4.698 33.622 12.896 8.804 8.18 13.628 19.142 13.628 30.437z",
|
|
787
|
-
fill: "#2E3042"
|
|
788
|
-
})));
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
var silhouettes = {
|
|
792
|
-
female: SvgSilhouetteFemale,
|
|
793
|
-
male: SvgSilhouetteMale,
|
|
794
|
-
neutral: SvgSilhouetteNeutral,
|
|
795
|
-
};
|
|
796
|
-
var Avatar = forwardRef(function (props, ref) {
|
|
797
|
-
var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
|
|
798
|
-
var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
|
|
799
|
-
var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
|
|
800
|
-
var Silhouette = silhouettes[silhouette];
|
|
801
|
-
var fallback = muiProps.src || silhouette === 'none' ? '' : React__default.createElement(Silhouette, { className: classes.silhouette });
|
|
802
|
-
return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
|
|
803
|
-
});
|
|
804
|
-
Avatar.defaultProps = {
|
|
805
|
-
size: 'medium',
|
|
806
|
-
fit: 'cover',
|
|
807
|
-
background: '#E0E0E0',
|
|
808
|
-
silhouette: 'neutral',
|
|
809
|
-
};
|
|
810
|
-
Avatar.displayName = 'Avatar';
|
|
811
|
-
|
|
812
|
-
var useButtonStyles = makeStyles$1(function () { return ({
|
|
813
|
-
root: {
|
|
814
|
-
minWidth: 'unset',
|
|
815
|
-
},
|
|
816
|
-
label: {
|
|
817
|
-
textTransform: function (_a) {
|
|
818
|
-
var textTransform = _a.textTransform;
|
|
819
|
-
return textTransform;
|
|
820
|
-
},
|
|
821
|
-
},
|
|
822
|
-
}); });
|
|
823
|
-
|
|
824
|
-
var Button = forwardRef(function (props, ref) {
|
|
825
|
-
props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest(props, ["textTransform", "loading", "classes", "className"]);
|
|
826
|
-
props.classes; var styleProps = __rest(props, ["classes"]);
|
|
827
|
-
var classes = useButtonStyles(styleProps);
|
|
828
|
-
var typography = useTheme$1().typography;
|
|
829
|
-
var loadingIndicator = {
|
|
830
|
-
startIcon: React__default.createElement(CircularProgress, { color: "inherit", size: typography.button.fontSize }),
|
|
831
|
-
disabled: true,
|
|
832
|
-
};
|
|
833
|
-
return (React__default.createElement(MuiButton, __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
|
|
834
|
-
});
|
|
835
|
-
Button.displayName = 'Button';
|
|
836
|
-
|
|
837
|
-
var Checkbox = forwardRef(function (props, ref) {
|
|
838
|
-
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
839
|
-
var control = React__default.createElement(MuiCheckbox, __assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
840
|
-
return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
841
|
-
});
|
|
842
|
-
Checkbox.displayName = 'Checkbox';
|
|
843
|
-
|
|
844
|
-
var getFadeStop = function (_a, typographyVariant) {
|
|
845
|
-
var typography = _a.typography;
|
|
846
|
-
return !isNaN(Number(typography[typographyVariant].lineHeight))
|
|
847
|
-
? typography[typographyVariant].lineHeight + "rem"
|
|
848
|
-
: typography[typographyVariant].lineHeight;
|
|
849
|
-
};
|
|
850
|
-
var useCollapsibleTextStyles = makeStyles(function (theme) { return ({
|
|
851
|
-
overlay: {
|
|
852
|
-
position: 'absolute',
|
|
853
|
-
top: 0,
|
|
854
|
-
left: 0,
|
|
855
|
-
height: '100%',
|
|
856
|
-
width: '100%',
|
|
857
|
-
background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
|
|
858
|
-
},
|
|
859
|
-
}); });
|
|
860
|
-
|
|
861
|
-
var CollapsibleText = function (props) {
|
|
862
|
-
var _a = props, text = _a.text, open = _a.open, previewLines = _a.previewLines, _b = _a.typographyVariant, typographyVariant = _b === void 0 ? 'body1' : _b, collapsible = _a.collapsible, setCollapsible = _a.setCollapsible;
|
|
863
|
-
var classes = useCollapsibleTextStyles(props);
|
|
864
|
-
var typographyRef = useRef(null);
|
|
865
|
-
var typography = useTheme().typography;
|
|
866
|
-
var collapsedSize = previewLines * parseFloat(typography[typographyVariant].lineHeight);
|
|
867
|
-
useEffect(function () {
|
|
868
|
-
var typographyNode = typographyRef.current;
|
|
869
|
-
var observer = new ResizeObserver(function (entries) {
|
|
870
|
-
var typographyHeight = entries[0].contentRect.height;
|
|
871
|
-
var collapsedPxSize = collapsedSize * 16;
|
|
872
|
-
var collapsible = typographyHeight > collapsedPxSize;
|
|
873
|
-
setCollapsible(collapsible);
|
|
874
|
-
});
|
|
875
|
-
observer.observe(typographyNode);
|
|
876
|
-
return function () {
|
|
877
|
-
observer.unobserve(typographyNode);
|
|
878
|
-
};
|
|
879
|
-
}, []);
|
|
880
|
-
return (React__default.createElement(Fragment, null,
|
|
881
|
-
React__default.createElement(Box, { position: "relative", overflow: "hidden" },
|
|
882
|
-
React__default.createElement(Collapse, { in: open, collapsedSize: collapsedSize + 'rem' },
|
|
883
|
-
React__default.createElement(Typography, { ref: typographyRef, variant: typographyVariant }, text)),
|
|
884
|
-
collapsible && !open && React__default.createElement(Box, { className: classes.overlay }))));
|
|
885
|
-
};
|
|
886
|
-
CollapsibleText.defaultProps = {
|
|
887
|
-
previewLines: 2,
|
|
888
|
-
typographyVariant: 'body1',
|
|
889
|
-
};
|
|
890
|
-
|
|
891
|
-
var SemanticColors;
|
|
892
|
-
(function (SemanticColors) {
|
|
893
|
-
SemanticColors["PRIMARY_MAIN"] = "primary.main";
|
|
894
|
-
SemanticColors["PRIMARY_DARK"] = "primary.dark";
|
|
895
|
-
SemanticColors["PRIMARY_LIGHT"] = "primary.light";
|
|
896
|
-
SemanticColors["SECONDARY_MAIN"] = "secondary.main";
|
|
897
|
-
SemanticColors["SECONDARY_DARK"] = "secondary.dark";
|
|
898
|
-
SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
|
|
899
|
-
})(SemanticColors || (SemanticColors = {}));
|
|
900
|
-
var useStyles = makeStyles(function (theme) { return ({
|
|
901
|
-
dividerRoot: {
|
|
902
|
-
gap: theme.spacing(2),
|
|
903
|
-
},
|
|
904
|
-
textRoot: {
|
|
905
|
-
color: function (props) {
|
|
906
|
-
var textColor = props.textColor;
|
|
907
|
-
if (Object.values(SemanticColors).includes(textColor)) {
|
|
908
|
-
var _a = textColor.split('.'), semanticColor = _a[0], shade = _a[1];
|
|
909
|
-
return theme.palette[semanticColor][shade];
|
|
910
|
-
}
|
|
911
|
-
else if (textColor) {
|
|
912
|
-
return textColor;
|
|
913
|
-
}
|
|
914
|
-
else {
|
|
915
|
-
return 'black';
|
|
916
|
-
}
|
|
917
|
-
},
|
|
918
|
-
textTransform: function (props) { return props.textTransform; },
|
|
919
|
-
},
|
|
920
|
-
dividerLine: {
|
|
921
|
-
backgroundColor: function (props) {
|
|
922
|
-
var dividerColor = props.dividerColor;
|
|
923
|
-
if (Object.values(SemanticColors).includes(dividerColor)) {
|
|
924
|
-
var _a = dividerColor.split('.'), semanticColor = _a[0], shade = _a[1];
|
|
925
|
-
return theme.palette[semanticColor][shade];
|
|
926
|
-
}
|
|
927
|
-
else if (dividerColor) {
|
|
928
|
-
return dividerColor;
|
|
929
|
-
}
|
|
930
|
-
else {
|
|
931
|
-
return theme.palette.grey[500];
|
|
932
|
-
}
|
|
933
|
-
},
|
|
934
|
-
},
|
|
935
|
-
}); });
|
|
936
|
-
var Divider = function (props) {
|
|
937
|
-
var className = props.className, text = props.text, textTransform = props.textTransform, TypographyProps = props.TypographyProps;
|
|
938
|
-
var classes = useStyles(props);
|
|
939
|
-
var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
|
|
940
|
-
return (React__default.createElement(Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
|
|
941
|
-
React__default.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
|
|
942
|
-
text && (React__default.createElement(React__default.Fragment, null,
|
|
943
|
-
React__default.createElement(Typography, __assign({ className: classes.textRoot }, TypographyProps), text),
|
|
944
|
-
React__default.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset })))));
|
|
945
|
-
};
|
|
946
|
-
Divider.displayName = 'Divider';
|
|
947
|
-
Divider.defaultProps = {
|
|
948
|
-
textTransform: 'lowercase',
|
|
949
|
-
};
|
|
950
|
-
|
|
951
|
-
var getLinkColor = function (_a, _b) {
|
|
952
|
-
var palette = _a.palette;
|
|
953
|
-
var _c = _b.color, color = _c === void 0 ? 'info' : _c;
|
|
954
|
-
var resolved;
|
|
955
|
-
if (['primary', 'secondary', 'info', 'error'].includes(color)) {
|
|
956
|
-
resolved = palette[color].main;
|
|
957
|
-
}
|
|
958
|
-
else if (['textPrimary', 'textSecondary'].includes(color)) {
|
|
959
|
-
resolved = palette.text[color.substring(4).toLowerCase()];
|
|
960
|
-
}
|
|
961
|
-
else if (color === 'inherit') {
|
|
962
|
-
resolved = color;
|
|
963
|
-
}
|
|
964
|
-
return resolved;
|
|
965
|
-
};
|
|
966
|
-
var useLinkStyles = makeStyles$1(function (theme) {
|
|
967
|
-
var _a;
|
|
968
|
-
return ({
|
|
969
|
-
root: (_a = {
|
|
970
|
-
display: 'flex',
|
|
971
|
-
color: function (props) { return getLinkColor(theme, props); }
|
|
972
|
-
},
|
|
973
|
-
_a["& ." + iconStaticClassName] = {
|
|
974
|
-
alignSelf: 'center',
|
|
975
|
-
},
|
|
976
|
-
_a),
|
|
977
|
-
});
|
|
978
|
-
});
|
|
979
|
-
|
|
980
|
-
var Link = forwardRef(function (props, ref) {
|
|
981
|
-
var children = props.children; props.color; var muiProps = __rest(props, ["children", "color"]);
|
|
982
|
-
var classes = useLinkStyles(props);
|
|
983
|
-
return (React__default.createElement(MuiLink, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
|
|
984
|
-
});
|
|
985
|
-
Link.defaultProps = {
|
|
986
|
-
color: 'info',
|
|
987
|
-
variant: 'body1',
|
|
988
|
-
};
|
|
989
|
-
Link.displayName = 'Link';
|
|
990
|
-
|
|
991
|
-
var PaperContent = function (props) {
|
|
992
|
-
var children = props.children;
|
|
993
|
-
return React__default.createElement(Box, { padding: 4 }, children);
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
var Radio = forwardRef(function (props, ref) {
|
|
997
|
-
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
998
|
-
var control = React__default.createElement(MuiRadio, __assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
999
|
-
return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
1000
|
-
});
|
|
1001
|
-
Radio.displayName = 'Radio';
|
|
1002
|
-
|
|
1003
|
-
var useSplitInputStyles = makeStyles$1(function () { return ({
|
|
1004
|
-
textfield: {
|
|
1005
|
-
background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
|
|
1006
|
-
borderTopLeftRadius: 4,
|
|
1007
|
-
borderBottomLeftRadius: 4,
|
|
1008
|
-
'& fieldset': {
|
|
1009
|
-
borderRight: 'none',
|
|
1010
|
-
borderTopRightRadius: 0,
|
|
1011
|
-
borderBottomRightRadius: 0,
|
|
1012
|
-
},
|
|
1013
|
-
},
|
|
1014
|
-
button: {
|
|
1015
|
-
borderTopLeftRadius: 0,
|
|
1016
|
-
borderBottomLeftRadius: 0,
|
|
1017
|
-
alignSelf: 'stretch',
|
|
1018
|
-
},
|
|
1019
|
-
input: {
|
|
1020
|
-
color: function (props) { return props.inputTextColor || 'inherit'; },
|
|
1021
|
-
'&$focused fieldset': {
|
|
1022
|
-
top: -4,
|
|
1023
|
-
},
|
|
1024
|
-
},
|
|
1025
|
-
focused: {},
|
|
1026
|
-
}); });
|
|
1027
|
-
|
|
1028
|
-
var SplitInput = function (props) {
|
|
1029
|
-
var TextFieldProps = props.TextFieldProps, ButtonProps = props.ButtonProps, color = props.color, onChange = props.onChange, onClick = props.onClick;
|
|
1030
|
-
var classes = useSplitInputStyles(props);
|
|
1031
|
-
return (React__default.createElement(Box, { display: "flex" },
|
|
1032
|
-
React__default.createElement(TextField, __assign({ classes: { root: classes.textfield }, InputProps: { classes: { root: classes.input, focused: classes.focused } }, color: color, variant: "outlined", onChange: onChange }, TextFieldProps)),
|
|
1033
|
-
React__default.createElement(Button, __assign({ classes: { root: classes.button }, disableElevation: true, color: color, variant: "contained", onClick: onClick }, ButtonProps), "Submit")));
|
|
1034
|
-
};
|
|
1035
|
-
SplitInput.displayName = 'SplitInput';
|
|
1036
|
-
SplitInput.defaultProps = {
|
|
1037
|
-
backgroundTransparency: true,
|
|
1038
|
-
color: 'primary',
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
var useSwitchStyles = makeStyles$1(function (theme) { return ({
|
|
1042
|
-
checked: {
|
|
1043
|
-
'& $thumb': {
|
|
1044
|
-
background: theme.palette.success.main,
|
|
1045
|
-
},
|
|
1046
|
-
'&& + $track': {
|
|
1047
|
-
backgroundColor: theme.palette.success.main,
|
|
1048
|
-
},
|
|
1049
|
-
},
|
|
1050
|
-
thumb: {},
|
|
1051
|
-
track: {},
|
|
1052
|
-
}); });
|
|
1053
|
-
|
|
1054
|
-
var Switch = forwardRef(function (props, ref) {
|
|
1055
|
-
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
1056
|
-
var classes = useSwitchStyles(props);
|
|
1057
|
-
var control = React__default.createElement(MuiSwitch, __assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
|
|
1058
|
-
return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
1059
|
-
});
|
|
1060
|
-
Switch.displayName = 'Switch';
|
|
1061
|
-
|
|
1062
5
|
var reactTable = {exports: {}};
|
|
1063
6
|
|
|
1064
7
|
var reactTable_production_min = {exports: {}};
|
|
@@ -5644,282 +4587,5 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
5644
4587
|
reactTable.exports = reactTable_development.exports;
|
|
5645
4588
|
}
|
|
5646
4589
|
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
};
|
|
5650
|
-
|
|
5651
|
-
var TableHeader = function (props) {
|
|
5652
|
-
var children = props.children, restProps = __rest(props, ["children"]);
|
|
5653
|
-
return React__default.createElement("thead", __assign({}, restProps), children);
|
|
5654
|
-
};
|
|
5655
|
-
|
|
5656
|
-
var getWidth = function (props) {
|
|
5657
|
-
var isActionColumn = props.column.isActionColumn, fullWidth = props.tableProps.fullWidth;
|
|
5658
|
-
var width;
|
|
5659
|
-
if (fullWidth && isActionColumn) {
|
|
5660
|
-
width = '0.0000000001%';
|
|
5661
|
-
}
|
|
5662
|
-
if (fullWidth && !isActionColumn) {
|
|
5663
|
-
width = '1%';
|
|
5664
|
-
}
|
|
5665
|
-
if (!fullWidth && isActionColumn) {
|
|
5666
|
-
width = 72;
|
|
5667
|
-
}
|
|
5668
|
-
if (!fullWidth && !isActionColumn) {
|
|
5669
|
-
width = undefined;
|
|
5670
|
-
}
|
|
5671
|
-
return width;
|
|
5672
|
-
};
|
|
5673
|
-
var useTableHeaderCellStyles = makeStyles(function (theme) { return ({
|
|
5674
|
-
root: function (props) {
|
|
5675
|
-
var width = getWidth(props);
|
|
5676
|
-
return {
|
|
5677
|
-
borderBottomStyle: 'solid',
|
|
5678
|
-
borderBottomWidth: 2,
|
|
5679
|
-
borderBottomColor: theme.palette.grey[100],
|
|
5680
|
-
padding: theme.spacing(2),
|
|
5681
|
-
textAlign: 'left',
|
|
5682
|
-
fontWeight: 500,
|
|
5683
|
-
width: width,
|
|
5684
|
-
};
|
|
5685
|
-
},
|
|
5686
|
-
}); });
|
|
5687
|
-
|
|
5688
|
-
var TableHeaderCell = function (props) {
|
|
5689
|
-
var children = props.children, column = props.column; props.tableProps; var restProps = __rest(props, ["children", "column", "tableProps"]);
|
|
5690
|
-
var root = useTableHeaderCellStyles(props).root;
|
|
5691
|
-
var _a = useTheme(), palette = _a.palette, spacing = _a.spacing;
|
|
5692
|
-
//@ts-expect-error @types/react-table issue
|
|
5693
|
-
var canSort = column.canSort, isSorted = column.isSorted, isSortedDesc = column.isSortedDesc, isActionColumn = column.isActionColumn;
|
|
5694
|
-
var showSortIndicator = canSort && !isActionColumn;
|
|
5695
|
-
return (React__default.createElement("th", __assign({ className: root }, restProps),
|
|
5696
|
-
React__default.createElement(Box, { display: "flex", alignItems: "center", gridGap: spacing(1) },
|
|
5697
|
-
children,
|
|
5698
|
-
showSortIndicator && (React__default.createElement(Icon, { icon: isSortedDesc ? SvgChevronDown : SvgChevronUp, color: isSorted ? palette.text.primary : palette.text.disabled, size: "large" })))));
|
|
5699
|
-
};
|
|
5700
|
-
|
|
5701
|
-
var TableHeaderRow = function (props) {
|
|
5702
|
-
var children = props.children, restProps = __rest(props, ["children"]);
|
|
5703
|
-
return React__default.createElement("tr", __assign({}, restProps), children);
|
|
5704
|
-
};
|
|
5705
|
-
|
|
5706
|
-
var useTableRowStyles = makeStyles(function (theme) { return ({
|
|
5707
|
-
root: function () { return ({
|
|
5708
|
-
'&:nth-child(even)': {
|
|
5709
|
-
backgroundColor: theme.palette.grey[100],
|
|
5710
|
-
},
|
|
5711
|
-
}); },
|
|
5712
|
-
}); });
|
|
5713
|
-
|
|
5714
|
-
var TableRow = function (props) {
|
|
5715
|
-
var children = props.children, restProps = __rest(props, ["children"]);
|
|
5716
|
-
var root = useTableRowStyles(props).root;
|
|
5717
|
-
return (React__default.createElement("tr", __assign({ className: root }, restProps), children));
|
|
5718
|
-
};
|
|
5719
|
-
|
|
5720
|
-
var TableBody = function (props) {
|
|
5721
|
-
var children = props.children, restProps = __rest(props, ["children"]);
|
|
5722
|
-
return React__default.createElement("tbody", __assign({}, restProps), children);
|
|
5723
|
-
};
|
|
5724
|
-
|
|
5725
|
-
var useTableCellStyles = makeStyles(function (theme) { return ({
|
|
5726
|
-
root: function () { return ({
|
|
5727
|
-
padding: theme.spacing(2),
|
|
5728
|
-
}); },
|
|
5729
|
-
}); });
|
|
5730
|
-
|
|
5731
|
-
var TableCell = function (props) {
|
|
5732
|
-
var children = props.children, restProps = __rest(props, ["children"]);
|
|
5733
|
-
var root = useTableCellStyles(props).root;
|
|
5734
|
-
return (React__default.createElement("td", __assign({ className: root }, restProps), children));
|
|
5735
|
-
};
|
|
5736
|
-
|
|
5737
|
-
var useTableStyles = makeStyles(function (_a) {
|
|
5738
|
-
var typography = _a.typography;
|
|
5739
|
-
return ({
|
|
5740
|
-
root: function (_a) {
|
|
5741
|
-
var fullWidth = _a.fullWidth;
|
|
5742
|
-
return ({
|
|
5743
|
-
display: fullWidth ? 'flex' : 'inline-flex',
|
|
5744
|
-
flexDirection: 'column',
|
|
5745
|
-
});
|
|
5746
|
-
},
|
|
5747
|
-
table: function (_a) {
|
|
5748
|
-
var fullWidth = _a.fullWidth;
|
|
5749
|
-
return (__assign(__assign({ borderCollapse: 'collapse' }, (fullWidth && { width: '100%' })), typography.body1));
|
|
5750
|
-
},
|
|
5751
|
-
tableWrap: function () { return ({
|
|
5752
|
-
maxWidth: '100%',
|
|
5753
|
-
overflowX: 'auto',
|
|
5754
|
-
overflowY: 'hidden',
|
|
5755
|
-
}); },
|
|
5756
|
-
});
|
|
5757
|
-
});
|
|
5758
|
-
|
|
5759
|
-
var TableActionsCell = function (props) {
|
|
5760
|
-
var _a = props.actions, primary = _a.primary, secondary = _a.secondary, intermediate = __rest(_a, ["primary", "secondary"]);
|
|
5761
|
-
var tertiary = intermediate.tertiary, restActions = __rest(intermediate, ["tertiary"]);
|
|
5762
|
-
var overflow = Object.keys(props.actions).length > 3;
|
|
5763
|
-
var _b = React__default.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
5764
|
-
var openMenu = function (event) {
|
|
5765
|
-
setAnchorEl(event.currentTarget);
|
|
5766
|
-
};
|
|
5767
|
-
var closeMenu = function () {
|
|
5768
|
-
setAnchorEl(null);
|
|
5769
|
-
};
|
|
5770
|
-
var handleItemClick = function (action) {
|
|
5771
|
-
action(props.cell);
|
|
5772
|
-
closeMenu();
|
|
5773
|
-
};
|
|
5774
|
-
return (React__default.createElement(Box, { display: "flex" },
|
|
5775
|
-
primary && primary.icon && (React__default.createElement(IconButton, { size: "small", onClick: function () { return primary.action(props.cell); } },
|
|
5776
|
-
React__default.createElement(Icon, { icon: primary.icon }))),
|
|
5777
|
-
secondary && secondary.icon && (React__default.createElement(IconButton, { size: "small", onClick: function () { return secondary.action(props.cell); } },
|
|
5778
|
-
React__default.createElement(Icon, { icon: secondary.icon }))),
|
|
5779
|
-
!overflow && tertiary && tertiary.icon && (React__default.createElement(IconButton, { size: "small", onClick: function () { return tertiary.action(props.cell); } },
|
|
5780
|
-
React__default.createElement(Icon, { icon: tertiary.icon }))),
|
|
5781
|
-
overflow && restActions && (React__default.createElement(React__default.Fragment, null,
|
|
5782
|
-
React__default.createElement(IconButton, { size: "small", onClick: openMenu },
|
|
5783
|
-
React__default.createElement(Icon, { icon: SvgMore })),
|
|
5784
|
-
React__default.createElement(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: closeMenu }, Object.values(__assign({ tertiary: tertiary }, restActions))
|
|
5785
|
-
.filter(function (value) { return value; })
|
|
5786
|
-
.map(function (_a, i) {
|
|
5787
|
-
var label = _a.label, action = _a.action;
|
|
5788
|
-
return (React__default.createElement(MenuItem, { key: i, onClick: function () { return handleItemClick(action); } }, label));
|
|
5789
|
-
}))))));
|
|
5790
|
-
};
|
|
5791
|
-
|
|
5792
|
-
var makeColumns = function (config) {
|
|
5793
|
-
var columns = config.columns, actions = config.actions, actionColumnId = config.actionColumnId;
|
|
5794
|
-
var actionColumn;
|
|
5795
|
-
var memoizedColumns = __spreadArray([], columns);
|
|
5796
|
-
if (actions) {
|
|
5797
|
-
var CellComponent = function (props) { return React__default.createElement(TableActionsCell, __assign({}, props, { actions: actions })); };
|
|
5798
|
-
actionColumn = {
|
|
5799
|
-
id: actionColumnId,
|
|
5800
|
-
Header: function () { return null; },
|
|
5801
|
-
Cell: CellComponent,
|
|
5802
|
-
};
|
|
5803
|
-
memoizedColumns = __spreadArray(__spreadArray([], columns), [actionColumn]);
|
|
5804
|
-
}
|
|
5805
|
-
return memoizedColumns;
|
|
5806
|
-
};
|
|
5807
|
-
|
|
5808
|
-
/* eslint-disable react/jsx-key */
|
|
5809
|
-
var Table = function (props) {
|
|
5810
|
-
var actionColumnId = 'table-actions-column';
|
|
5811
|
-
var rawColumns = props.columns, data = props.data, actions = props.actions, sortable = props.sortable, emptyMessage = props.emptyMessage, EmptyImage = props.EmptyImage, isLoading = props.loading, enableMinHeight = props.enableMinHeight;
|
|
5812
|
-
var classes = useTableStyles(props);
|
|
5813
|
-
var columns = useMemo(function () { return makeColumns({ columns: rawColumns, actions: actions, actionColumnId: actionColumnId }); }, [rawColumns, actions]);
|
|
5814
|
-
// @ts-expect-error @types/react-table issue
|
|
5815
|
-
var instance = reactTable.exports.useTable({ columns: columns, data: data, disableSortBy: !sortable }, reactTable.exports.useSortBy, reactTable.exports.usePagination);
|
|
5816
|
-
// @ts-expect-error @types/react-table issue
|
|
5817
|
-
var getTableProps = instance.getTableProps, getTableBodyProps = instance.getTableBodyProps, headerGroups = instance.headerGroups, page = instance.page, prepareRow = instance.prepareRow, pageCount = instance.pageCount, gotoPage = instance.gotoPage, state = instance.state, rows = instance.rows;
|
|
5818
|
-
var isPaginated = pageCount > 1;
|
|
5819
|
-
var isEmpty = rows.length === 0;
|
|
5820
|
-
var handlePagination = function (_e, pageNumber) {
|
|
5821
|
-
gotoPage(pageNumber - 1);
|
|
5822
|
-
};
|
|
5823
|
-
return (React__default.createElement(Box, { className: classes.root, minHeight: (isLoading || isEmpty) && enableMinHeight ? 618 : 'unset' },
|
|
5824
|
-
React__default.createElement(Box, { className: classes.tableWrap, minHeight: page.length > 0 && !isLoading && enableMinHeight ? 618 : 'unset' },
|
|
5825
|
-
React__default.createElement("table", __assign({ className: classes.table }, getTableProps()),
|
|
5826
|
-
React__default.createElement(TableHeader, null, headerGroups.map(function (headerGroup) { return (React__default.createElement(TableHeaderRow, __assign({}, headerGroup.getHeaderGroupProps()), headerGroup.headers.map(function (column) { return (React__default.createElement(TableHeaderCell
|
|
5827
|
-
// @ts-expect-error @types/react-table issue
|
|
5828
|
-
, __assign({}, column.getHeaderProps(column.getSortByToggleProps()), { column: __assign(__assign({}, column), { isActionColumn: column.id === actionColumnId }), tableProps: props }), column.render('Header'))); }))); })),
|
|
5829
|
-
!isEmpty && !isLoading && (React__default.createElement(TableBody, __assign({}, getTableBodyProps()), page.map(function (row) {
|
|
5830
|
-
prepareRow(row);
|
|
5831
|
-
return (React__default.createElement(TableRow, __assign({}, row.getRowProps()), row.cells.map(function (cell) { return (React__default.createElement(TableCell, __assign({}, cell.getCellProps()), cell.render('Cell'))); })));
|
|
5832
|
-
}))))),
|
|
5833
|
-
isEmpty && (React__default.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", p: 2, flexGrow: 1 },
|
|
5834
|
-
EmptyImage && EmptyImage(),
|
|
5835
|
-
React__default.createElement(Typography, null, emptyMessage))),
|
|
5836
|
-
isLoading && (React__default.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", p: 2, flexGrow: 1 },
|
|
5837
|
-
React__default.createElement(CircularProgress, { size: 80, color: "inherit" }))),
|
|
5838
|
-
isPaginated && !isLoading && (React__default.createElement(TableFooter, null,
|
|
5839
|
-
React__default.createElement(Pagination, { count: pageCount, page: state.pageIndex + 1, onChange: handlePagination })))));
|
|
5840
|
-
};
|
|
5841
|
-
Table.defaultProps = {
|
|
5842
|
-
emptyMessage: 'No results.',
|
|
5843
|
-
enableMinHeight: true,
|
|
5844
|
-
};
|
|
5845
|
-
|
|
5846
|
-
var useToggleButtonStyles = makeStyles$1(function (theme) { return ({
|
|
5847
|
-
root: {
|
|
5848
|
-
color: theme.palette.text.primary,
|
|
5849
|
-
},
|
|
5850
|
-
selected: {
|
|
5851
|
-
'&&': {
|
|
5852
|
-
'&:hover': {
|
|
5853
|
-
backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
|
|
5854
|
-
},
|
|
5855
|
-
backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
|
|
5856
|
-
color: 'white',
|
|
5857
|
-
},
|
|
5858
|
-
},
|
|
5859
|
-
}); });
|
|
5860
|
-
|
|
5861
|
-
var ToggleButton = forwardRef(function (props, ref) {
|
|
5862
|
-
var children = props.children, muiProps = __rest(props, ["children"]);
|
|
5863
|
-
var classes = useToggleButtonStyles(props);
|
|
5864
|
-
return (React__default.createElement(MuiToggleButton, __assign({ ref: ref, classes: {
|
|
5865
|
-
root: classes.root,
|
|
5866
|
-
selected: classes.selected,
|
|
5867
|
-
} }, muiProps), children));
|
|
5868
|
-
});
|
|
5869
|
-
ToggleButton.defaultProps = {
|
|
5870
|
-
color: 'primary',
|
|
5871
|
-
};
|
|
5872
|
-
ToggleButton.displayName = 'ToggleButton';
|
|
5873
|
-
|
|
5874
|
-
var useToggleButtonGroupStyles = makeStyles$1(function (theme) { return ({
|
|
5875
|
-
root: {
|
|
5876
|
-
'&&': {
|
|
5877
|
-
backgroundColor: theme.palette.grey[300],
|
|
5878
|
-
},
|
|
5879
|
-
},
|
|
5880
|
-
}); });
|
|
5881
|
-
|
|
5882
|
-
var ToggleButtonGroup = forwardRef(function (props, ref) {
|
|
5883
|
-
var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = __rest(props, ["children", "color"]);
|
|
5884
|
-
var classes = useToggleButtonGroupStyles(props);
|
|
5885
|
-
var childrenWithProps = React__default.Children.map(children, function (child) {
|
|
5886
|
-
if (!React__default.isValidElement(child)) {
|
|
5887
|
-
return null;
|
|
5888
|
-
}
|
|
5889
|
-
return React__default.cloneElement(child, { color: color });
|
|
5890
|
-
});
|
|
5891
|
-
return (React__default.createElement(MuiToggleButtonGroup, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
|
|
5892
|
-
});
|
|
5893
|
-
ToggleButtonGroup.displayName = 'ToggleButtonGroup';
|
|
5894
|
-
|
|
5895
|
-
var useTooltipStyles = makeStyles$1(function (_a) {
|
|
5896
|
-
var typography = _a.typography;
|
|
5897
|
-
return ({
|
|
5898
|
-
tooltip: {
|
|
5899
|
-
fontSize: typography.pxToRem(16),
|
|
5900
|
-
},
|
|
5901
|
-
});
|
|
5902
|
-
});
|
|
5903
|
-
|
|
5904
|
-
var Tooltip = forwardRef(function (props, ref) {
|
|
5905
|
-
var classes = useTooltipStyles(props);
|
|
5906
|
-
return React__default.createElement(MuiTooltip, __assign({ ref: ref, classes: classes }, props));
|
|
5907
|
-
});
|
|
5908
|
-
Tooltip.displayName = 'Tooltip';
|
|
5909
|
-
|
|
5910
|
-
var useCollapsibleText = function () {
|
|
5911
|
-
var _a = useState(false), open = _a[0], setOpen = _a[1];
|
|
5912
|
-
var _b = useState(false), collapsible = _b[0], setCollapsible = _b[1];
|
|
5913
|
-
var toggle = function () { return collapsible && setOpen(!open); };
|
|
5914
|
-
return {
|
|
5915
|
-
collapsibleText: {
|
|
5916
|
-
open: open,
|
|
5917
|
-
collapsible: collapsible,
|
|
5918
|
-
setCollapsible: setCollapsible,
|
|
5919
|
-
},
|
|
5920
|
-
toggle: toggle,
|
|
5921
|
-
};
|
|
5922
|
-
};
|
|
5923
|
-
|
|
5924
|
-
export { AudioPlayer, Avatar, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, Paper, PaperContent, Radio, SplitInput, Switch, Table, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText };
|
|
5925
|
-
//# sourceMappingURL=index.es.js.map
|
|
4590
|
+
export { reactTable as r };
|
|
4591
|
+
//# sourceMappingURL=react-table-de7bf68c.js.map
|