@popmenu/dashboard 0.31.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/README.md +9 -0
- package/build/components/KpiMetric/KpiMetric.d.ts +14 -0
- package/build/components/KpiMetric/KpiMetricProps.d.ts +15 -0
- package/build/components/KpiMetric/KpiMetricStyles.d.ts +2 -0
- package/build/components/KpiMetric/index.d.ts +2 -0
- package/build/components/KpiMetricTile/KpiMetricTile.d.ts +3 -0
- package/build/components/KpiMetricTile/KpiMetricTileProps.d.ts +5 -0
- package/build/components/KpiMetricTile/index.d.ts +2 -0
- package/build/components/Tile/Tile.d.ts +3 -0
- package/build/components/Tile/TileProps.d.ts +7 -0
- package/build/components/Tile/TileStyles.d.ts +1 -0
- package/build/components/Tile/index.d.ts +2 -0
- package/build/components/index.d.ts +3 -0
- package/build/index.d.ts +1 -0
- package/build/index.es.js +801 -0
- package/build/index.es.js.map +1 -0
- package/build/index.js +844 -0
- package/build/index.js.map +1 -0
- package/package.json +32 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,844 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
require('@material-ui/lab/Alert');
|
|
7
|
+
var core = require('@material-ui/core');
|
|
8
|
+
require('@material-ui/core/AppBar');
|
|
9
|
+
var MuiAvatar = require('@material-ui/core/Avatar');
|
|
10
|
+
var styles = require('@material-ui/core/styles');
|
|
11
|
+
require('@material-ui/core/Badge');
|
|
12
|
+
var MuiButton = require('@material-ui/core/Button');
|
|
13
|
+
var CircularProgress = require('@material-ui/core/CircularProgress');
|
|
14
|
+
require('@material-ui/core/ButtonGroup');
|
|
15
|
+
var Card = require('@material-ui/core/Card');
|
|
16
|
+
require('@material-ui/core/CardActionArea');
|
|
17
|
+
require('@material-ui/core/CardActions');
|
|
18
|
+
var CardContent = require('@material-ui/core/CardContent');
|
|
19
|
+
require('@material-ui/core/CardHeader');
|
|
20
|
+
require('@material-ui/core/CardMedia');
|
|
21
|
+
var MuiCheckbox = require('@material-ui/core/Checkbox');
|
|
22
|
+
var FormControlLabel = require('@material-ui/core/FormControlLabel');
|
|
23
|
+
require('@material-ui/core/Chip');
|
|
24
|
+
require('@material-ui/core/Collapse');
|
|
25
|
+
require('@material-ui/core/Dialog');
|
|
26
|
+
require('@material-ui/core/DialogActions');
|
|
27
|
+
require('@material-ui/core/DialogContent');
|
|
28
|
+
require('@material-ui/core/DialogTitle');
|
|
29
|
+
require('@material-ui/core/Drawer');
|
|
30
|
+
require('@material-ui/core/FormControl');
|
|
31
|
+
require('@material-ui/core/Grid');
|
|
32
|
+
var MuiIconButton = require('@material-ui/core/IconButton');
|
|
33
|
+
require('@material-ui/core/InputAdornment');
|
|
34
|
+
require('@material-ui/core/LinearProgress');
|
|
35
|
+
require('@material-ui/core/List');
|
|
36
|
+
require('@material-ui/core/ListItem');
|
|
37
|
+
require('@material-ui/core/ListItemIcon');
|
|
38
|
+
require('@material-ui/core/ListItemSecondaryAction');
|
|
39
|
+
require('@material-ui/core/ListItemText');
|
|
40
|
+
require('@material-ui/core/Menu');
|
|
41
|
+
require('@material-ui/core/MenuItem');
|
|
42
|
+
require('@material-ui/core/MenuList');
|
|
43
|
+
var MuiRadio = require('@material-ui/core/Radio');
|
|
44
|
+
require('@material-ui/core/TextField');
|
|
45
|
+
var MuiSwitch = require('@material-ui/core/Switch');
|
|
46
|
+
require('@material-ui/core/Tab');
|
|
47
|
+
require('@material-ui/core/Tabs');
|
|
48
|
+
var MuiToggleButton = require('@material-ui/lab/ToggleButton');
|
|
49
|
+
var MuiToggleButtonGroup = require('@material-ui/lab/ToggleButtonGroup');
|
|
50
|
+
var MuiTooltip = require('@material-ui/core/Tooltip');
|
|
51
|
+
|
|
52
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
53
|
+
|
|
54
|
+
function _interopNamespace(e) {
|
|
55
|
+
if (e && e.__esModule) return e;
|
|
56
|
+
var n = Object.create(null);
|
|
57
|
+
if (e) {
|
|
58
|
+
Object.keys(e).forEach(function (k) {
|
|
59
|
+
if (k !== 'default') {
|
|
60
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
61
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () {
|
|
64
|
+
return e[k];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
n['default'] = e;
|
|
71
|
+
return Object.freeze(n);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
75
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
76
|
+
var MuiAvatar__default = /*#__PURE__*/_interopDefaultLegacy(MuiAvatar);
|
|
77
|
+
var MuiButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiButton);
|
|
78
|
+
var CircularProgress__default = /*#__PURE__*/_interopDefaultLegacy(CircularProgress);
|
|
79
|
+
var Card__default = /*#__PURE__*/_interopDefaultLegacy(Card);
|
|
80
|
+
var CardContent__default = /*#__PURE__*/_interopDefaultLegacy(CardContent);
|
|
81
|
+
var MuiCheckbox__default = /*#__PURE__*/_interopDefaultLegacy(MuiCheckbox);
|
|
82
|
+
var FormControlLabel__default = /*#__PURE__*/_interopDefaultLegacy(FormControlLabel);
|
|
83
|
+
var MuiIconButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiIconButton);
|
|
84
|
+
var MuiRadio__default = /*#__PURE__*/_interopDefaultLegacy(MuiRadio);
|
|
85
|
+
var MuiSwitch__default = /*#__PURE__*/_interopDefaultLegacy(MuiSwitch);
|
|
86
|
+
var MuiToggleButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiToggleButton);
|
|
87
|
+
var MuiToggleButtonGroup__default = /*#__PURE__*/_interopDefaultLegacy(MuiToggleButtonGroup);
|
|
88
|
+
var MuiTooltip__default = /*#__PURE__*/_interopDefaultLegacy(MuiTooltip);
|
|
89
|
+
|
|
90
|
+
/*! *****************************************************************************
|
|
91
|
+
Copyright (c) Microsoft Corporation.
|
|
92
|
+
|
|
93
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
94
|
+
purpose with or without fee is hereby granted.
|
|
95
|
+
|
|
96
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
97
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
98
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
99
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
100
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
101
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
102
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
103
|
+
***************************************************************************** */
|
|
104
|
+
|
|
105
|
+
var __assign$1 = function() {
|
|
106
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
107
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
108
|
+
s = arguments[i];
|
|
109
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
110
|
+
}
|
|
111
|
+
return t;
|
|
112
|
+
};
|
|
113
|
+
return __assign$1.apply(this, arguments);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
function __rest$1(s, e) {
|
|
117
|
+
var t = {};
|
|
118
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
119
|
+
t[p] = s[p];
|
|
120
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
121
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
122
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
123
|
+
t[p[i]] = s[p[i]];
|
|
124
|
+
}
|
|
125
|
+
return t;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var _path$D;
|
|
129
|
+
|
|
130
|
+
function _extends$16() { _extends$16 = 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$16.apply(this, arguments); }
|
|
131
|
+
|
|
132
|
+
function SvgUser(props) {
|
|
133
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$16({
|
|
134
|
+
viewBox: "0 0 16 16",
|
|
135
|
+
fill: "none",
|
|
136
|
+
strokeLinecap: "round",
|
|
137
|
+
strokeLinejoin: "round",
|
|
138
|
+
width: "1em",
|
|
139
|
+
height: "1em"
|
|
140
|
+
}, props), _path$D || (_path$D = /*#__PURE__*/React__namespace.createElement("path", {
|
|
141
|
+
d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z",
|
|
142
|
+
stroke: "currentColor"
|
|
143
|
+
})));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var useIconStyles = core.makeStyles(function (_a) {
|
|
147
|
+
var spacing = _a.spacing, palette = _a.palette;
|
|
148
|
+
var getFontSize = function (_a) {
|
|
149
|
+
var size = _a.size;
|
|
150
|
+
var sizes = {
|
|
151
|
+
inherit: 'inherit',
|
|
152
|
+
small: spacing(1.5),
|
|
153
|
+
medium: spacing(2),
|
|
154
|
+
large: spacing(2.5),
|
|
155
|
+
'extra-large': spacing(3),
|
|
156
|
+
};
|
|
157
|
+
return size ? sizes[size] : 'inherit';
|
|
158
|
+
};
|
|
159
|
+
var getColor = function (props) {
|
|
160
|
+
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
161
|
+
var value = 'inherit';
|
|
162
|
+
if (props.color) {
|
|
163
|
+
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
164
|
+
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
165
|
+
value = palette[color][variant];
|
|
166
|
+
}
|
|
167
|
+
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
168
|
+
value = props.color;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return value;
|
|
172
|
+
};
|
|
173
|
+
return {
|
|
174
|
+
root: {
|
|
175
|
+
color: getColor,
|
|
176
|
+
fontSize: getFontSize,
|
|
177
|
+
strokeWidth: '1.3px',
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
var classnames = {exports: {}};
|
|
183
|
+
|
|
184
|
+
/*!
|
|
185
|
+
Copyright (c) 2018 Jed Watson.
|
|
186
|
+
Licensed under the MIT License (MIT), see
|
|
187
|
+
http://jedwatson.github.io/classnames
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
(function (module) {
|
|
191
|
+
/* global define */
|
|
192
|
+
|
|
193
|
+
(function () {
|
|
194
|
+
|
|
195
|
+
var hasOwn = {}.hasOwnProperty;
|
|
196
|
+
|
|
197
|
+
function classNames() {
|
|
198
|
+
var classes = [];
|
|
199
|
+
|
|
200
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
201
|
+
var arg = arguments[i];
|
|
202
|
+
if (!arg) continue;
|
|
203
|
+
|
|
204
|
+
var argType = typeof arg;
|
|
205
|
+
|
|
206
|
+
if (argType === 'string' || argType === 'number') {
|
|
207
|
+
classes.push(arg);
|
|
208
|
+
} else if (Array.isArray(arg)) {
|
|
209
|
+
if (arg.length) {
|
|
210
|
+
var inner = classNames.apply(null, arg);
|
|
211
|
+
if (inner) {
|
|
212
|
+
classes.push(inner);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
} else if (argType === 'object') {
|
|
216
|
+
if (arg.toString === Object.prototype.toString) {
|
|
217
|
+
for (var key in arg) {
|
|
218
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
219
|
+
classes.push(key);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
} else {
|
|
223
|
+
classes.push(arg.toString());
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return classes.join(' ');
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (module.exports) {
|
|
232
|
+
classNames.default = classNames;
|
|
233
|
+
module.exports = classNames;
|
|
234
|
+
} else {
|
|
235
|
+
window.classNames = classNames;
|
|
236
|
+
}
|
|
237
|
+
}());
|
|
238
|
+
}(classnames));
|
|
239
|
+
|
|
240
|
+
var classNames = classnames.exports;
|
|
241
|
+
|
|
242
|
+
var iconStaticClassName = 'pop-icon';
|
|
243
|
+
var Icon = function (props) {
|
|
244
|
+
var icon = props.icon, className = props.className, restProps = __rest$1(props, ["icon", "className"]);
|
|
245
|
+
var classes = useIconStyles(props);
|
|
246
|
+
var isValid = true;
|
|
247
|
+
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
248
|
+
isValid = false;
|
|
249
|
+
}
|
|
250
|
+
return isValid
|
|
251
|
+
? React.createElement(icon, __assign$1({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
252
|
+
: null;
|
|
253
|
+
};
|
|
254
|
+
Icon.defaultProps = {
|
|
255
|
+
size: 'inherit',
|
|
256
|
+
color: 'inherit',
|
|
257
|
+
};
|
|
258
|
+
Icon.displayName = 'Icon';
|
|
259
|
+
|
|
260
|
+
var LoadingStatus;
|
|
261
|
+
(function (LoadingStatus) {
|
|
262
|
+
LoadingStatus["ERROR"] = "ERROR";
|
|
263
|
+
LoadingStatus["LOADED"] = "LOADED";
|
|
264
|
+
LoadingStatus["PENDING"] = "PENDING";
|
|
265
|
+
})(LoadingStatus || (LoadingStatus = {}));
|
|
266
|
+
var useImgProps = function (avatarProps) {
|
|
267
|
+
var _a = React__default['default'].useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
268
|
+
var imgProps = __assign$1(__assign$1({}, avatarProps.imgProps), { onLoad: function (event) {
|
|
269
|
+
var _a, _b;
|
|
270
|
+
setLoaded(LoadingStatus.LOADED);
|
|
271
|
+
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
272
|
+
} });
|
|
273
|
+
return { imgProps: imgProps, loaded: loaded };
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
var getAvatarDimensions = function (theme, props) {
|
|
277
|
+
var factors = {
|
|
278
|
+
'extra-small': 3,
|
|
279
|
+
small: 4,
|
|
280
|
+
medium: 5,
|
|
281
|
+
large: 6,
|
|
282
|
+
'extra-large': 12.5,
|
|
283
|
+
};
|
|
284
|
+
var sizeFactor = factors[props.size || 'medium'];
|
|
285
|
+
return theme.spacing(sizeFactor);
|
|
286
|
+
};
|
|
287
|
+
var getAvatarFontSize = function (props) {
|
|
288
|
+
var fontSizes = {
|
|
289
|
+
'extra-small': '0.75rem',
|
|
290
|
+
small: '1rem',
|
|
291
|
+
medium: '1rem',
|
|
292
|
+
large: '1.25rem',
|
|
293
|
+
'extra-large': '3.5rem',
|
|
294
|
+
};
|
|
295
|
+
return fontSizes[props.size];
|
|
296
|
+
};
|
|
297
|
+
var useAvatarStyles = styles.makeStyles(function (theme) { return ({
|
|
298
|
+
root: function (props) { return ({
|
|
299
|
+
width: getAvatarDimensions(theme, props),
|
|
300
|
+
height: getAvatarDimensions(theme, props),
|
|
301
|
+
fontSize: getAvatarFontSize(props),
|
|
302
|
+
backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
|
|
303
|
+
color: theme.palette.getContrastText(props.background),
|
|
304
|
+
objectFit: props.fit,
|
|
305
|
+
}); },
|
|
306
|
+
fallback: function (props) { return ({
|
|
307
|
+
fontSize: getAvatarDimensions(theme, props),
|
|
308
|
+
strokeWidth: 1,
|
|
309
|
+
}); },
|
|
310
|
+
}); });
|
|
311
|
+
|
|
312
|
+
var Avatar = React.forwardRef(function (props, ref) {
|
|
313
|
+
var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = __rest$1(props, ["children", "src", "alt", "fallback"]);
|
|
314
|
+
var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
|
|
315
|
+
var classes = useAvatarStyles(__assign$1(__assign$1({}, props), { loaded: loaded }));
|
|
316
|
+
var displayAltTextFallback = src && alt;
|
|
317
|
+
var displayNoFallback = fallback === 'none';
|
|
318
|
+
var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
|
|
319
|
+
var Fallback;
|
|
320
|
+
if (displayAltTextFallback) {
|
|
321
|
+
Fallback = null;
|
|
322
|
+
}
|
|
323
|
+
else if (displayNoFallback) {
|
|
324
|
+
Fallback = ' ';
|
|
325
|
+
}
|
|
326
|
+
else if (displayCustomFallback) {
|
|
327
|
+
Fallback = fallback;
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
Fallback = React__default['default'].createElement(Icon, { icon: SvgUser, className: classes.fallback });
|
|
331
|
+
}
|
|
332
|
+
return (React__default['default'].createElement(MuiAvatar__default['default'], __assign$1({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
|
|
333
|
+
});
|
|
334
|
+
Avatar.defaultProps = {
|
|
335
|
+
size: 'medium',
|
|
336
|
+
fit: 'cover',
|
|
337
|
+
background: '#E0E0E0',
|
|
338
|
+
};
|
|
339
|
+
Avatar.displayName = 'Avatar';
|
|
340
|
+
|
|
341
|
+
var useButtonStyles = styles.makeStyles(function () { return ({
|
|
342
|
+
root: {
|
|
343
|
+
minWidth: 'unset',
|
|
344
|
+
},
|
|
345
|
+
label: {
|
|
346
|
+
textTransform: function (_a) {
|
|
347
|
+
var textTransform = _a.textTransform;
|
|
348
|
+
return textTransform;
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
}); });
|
|
352
|
+
|
|
353
|
+
var Button = React.forwardRef(function (props, ref) {
|
|
354
|
+
props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest$1(props, ["textTransform", "loading", "classes", "className"]);
|
|
355
|
+
props.classes; var styleProps = __rest$1(props, ["classes"]);
|
|
356
|
+
var classes = useButtonStyles(styleProps);
|
|
357
|
+
var typography = styles.useTheme().typography;
|
|
358
|
+
var loadingIndicator = {
|
|
359
|
+
startIcon: React__default['default'].createElement(CircularProgress__default['default'], { color: "inherit", size: typography.button.fontSize }),
|
|
360
|
+
disabled: true,
|
|
361
|
+
};
|
|
362
|
+
return (React__default['default'].createElement(MuiButton__default['default'], __assign$1({ ref: ref, classes: __assign$1(__assign$1({}, classes), classesOverride), className: classNames([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
|
|
363
|
+
});
|
|
364
|
+
Button.displayName = 'Button';
|
|
365
|
+
|
|
366
|
+
var Checkbox = React.forwardRef(function (props, ref) {
|
|
367
|
+
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest$1(props, ["label", "disabled", "LabelProps"]);
|
|
368
|
+
var control = React__default['default'].createElement(MuiCheckbox__default['default'], __assign$1({ disabled: label ? undefined : disabled }, muiProps));
|
|
369
|
+
return label ? (React__default['default'].createElement(FormControlLabel__default['default'], __assign$1({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
370
|
+
});
|
|
371
|
+
Checkbox.displayName = 'Checkbox';
|
|
372
|
+
|
|
373
|
+
var defaultTypographyProps = {
|
|
374
|
+
variant: 'body1',
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
var weights = {
|
|
378
|
+
regular: 400,
|
|
379
|
+
medium: 500,
|
|
380
|
+
'semi-bold': 600,
|
|
381
|
+
bold: 700,
|
|
382
|
+
};
|
|
383
|
+
var getCustomColor = function (theme, color) {
|
|
384
|
+
var isCommonColor = color && ['white', 'black'].includes(color);
|
|
385
|
+
var isGreyColor = color && color.match(/^grey\.\d{3}/);
|
|
386
|
+
var isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
|
|
387
|
+
var isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
|
|
388
|
+
switch (true) {
|
|
389
|
+
case isCommonColor:
|
|
390
|
+
return theme.palette.common[color];
|
|
391
|
+
case Boolean(isGreyColor):
|
|
392
|
+
var scale = color.split('.')[1];
|
|
393
|
+
return theme.palette.grey[scale] || theme.palette.grey[900];
|
|
394
|
+
case Boolean(isSemanticColor):
|
|
395
|
+
var _a = color.split('.'), paletteKey = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
396
|
+
return theme.palette[paletteKey][variant];
|
|
397
|
+
case isTextColor:
|
|
398
|
+
return theme.palette.text[color.slice(4).toLowerCase()];
|
|
399
|
+
default:
|
|
400
|
+
return undefined;
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
var useTypographyStyles = styles.makeStyles(function (theme) {
|
|
404
|
+
var _a;
|
|
405
|
+
return ({
|
|
406
|
+
root: (_a = {},
|
|
407
|
+
_a["& ." + iconStaticClassName] = {
|
|
408
|
+
position: 'relative',
|
|
409
|
+
top: '0.125em',
|
|
410
|
+
padding: '0 0.125em',
|
|
411
|
+
boxSizing: 'content-box',
|
|
412
|
+
},
|
|
413
|
+
_a.fontFamily = theme.typography.fontFamily,
|
|
414
|
+
_a.fontWeight = function (_a) {
|
|
415
|
+
var variant = _a.variant, weight = _a.weight;
|
|
416
|
+
return (weight ? weights[weight] : theme.typography[variant].fontWeight);
|
|
417
|
+
},
|
|
418
|
+
_a.fontSize = function (_a) {
|
|
419
|
+
var variant = _a.variant;
|
|
420
|
+
return theme.typography[variant].fontSize;
|
|
421
|
+
},
|
|
422
|
+
_a.lineHeight = function (_a) {
|
|
423
|
+
var variant = _a.variant;
|
|
424
|
+
return theme.typography[variant].lineHeight;
|
|
425
|
+
},
|
|
426
|
+
_a.textTransform = function (_a) {
|
|
427
|
+
var variant = _a.variant;
|
|
428
|
+
return theme.typography[variant].textTransform;
|
|
429
|
+
},
|
|
430
|
+
_a.color = function (_a) {
|
|
431
|
+
var color = _a.color, variant = _a.variant;
|
|
432
|
+
return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
|
|
433
|
+
},
|
|
434
|
+
_a),
|
|
435
|
+
caption: {
|
|
436
|
+
display: 'inline',
|
|
437
|
+
},
|
|
438
|
+
overline: {
|
|
439
|
+
display: 'inline',
|
|
440
|
+
},
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
var Typography = React.forwardRef(function (props, ref) {
|
|
445
|
+
props.weight; props.color; var restProps = __rest$1(props, ["weight", "color"]);
|
|
446
|
+
var classes = useTypographyStyles(__assign$1({}, props));
|
|
447
|
+
var variantMapping = { subtitle1: 'p' };
|
|
448
|
+
return React__default['default'].createElement(core.Typography, __assign$1({ ref: ref, classes: classes, variantMapping: variantMapping }, restProps));
|
|
449
|
+
});
|
|
450
|
+
Typography.displayName = 'Typography';
|
|
451
|
+
Typography.defaultProps = defaultTypographyProps;
|
|
452
|
+
|
|
453
|
+
var getFadeStop = function (_a, typographyVariant) {
|
|
454
|
+
var typography = _a.typography;
|
|
455
|
+
return !isNaN(Number(typography[typographyVariant].lineHeight))
|
|
456
|
+
? typography[typographyVariant].lineHeight + "rem"
|
|
457
|
+
: typography[typographyVariant].lineHeight;
|
|
458
|
+
};
|
|
459
|
+
core.makeStyles(function (theme) { return ({
|
|
460
|
+
overlay: {
|
|
461
|
+
position: 'absolute',
|
|
462
|
+
top: 0,
|
|
463
|
+
left: 0,
|
|
464
|
+
height: '100%',
|
|
465
|
+
width: '100%',
|
|
466
|
+
background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
|
|
467
|
+
},
|
|
468
|
+
}); });
|
|
469
|
+
|
|
470
|
+
var SemanticColors;
|
|
471
|
+
(function (SemanticColors) {
|
|
472
|
+
SemanticColors["PRIMARY_MAIN"] = "primary.main";
|
|
473
|
+
SemanticColors["PRIMARY_DARK"] = "primary.dark";
|
|
474
|
+
SemanticColors["PRIMARY_LIGHT"] = "primary.light";
|
|
475
|
+
SemanticColors["SECONDARY_MAIN"] = "secondary.main";
|
|
476
|
+
SemanticColors["SECONDARY_DARK"] = "secondary.dark";
|
|
477
|
+
SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
|
|
478
|
+
})(SemanticColors || (SemanticColors = {}));
|
|
479
|
+
core.makeStyles(function (theme) { return ({
|
|
480
|
+
dividerRoot: {
|
|
481
|
+
gap: theme.spacing(2),
|
|
482
|
+
},
|
|
483
|
+
textRoot: {
|
|
484
|
+
color: function (props) {
|
|
485
|
+
var textColor = props.textColor;
|
|
486
|
+
if (Object.values(SemanticColors).includes(textColor)) {
|
|
487
|
+
var _a = textColor.split('.'), semanticColor = _a[0], shade = _a[1];
|
|
488
|
+
return theme.palette[semanticColor][shade];
|
|
489
|
+
}
|
|
490
|
+
else if (textColor) {
|
|
491
|
+
return textColor;
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
return 'black';
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
textTransform: function (props) { return props.textTransform; },
|
|
498
|
+
},
|
|
499
|
+
dividerLine: {
|
|
500
|
+
backgroundColor: function (props) {
|
|
501
|
+
var dividerColor = props.dividerColor;
|
|
502
|
+
if (Object.values(SemanticColors).includes(dividerColor)) {
|
|
503
|
+
var _a = dividerColor.split('.'), semanticColor = _a[0], shade = _a[1];
|
|
504
|
+
return theme.palette[semanticColor][shade];
|
|
505
|
+
}
|
|
506
|
+
else if (dividerColor) {
|
|
507
|
+
return dividerColor;
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
return theme.palette.grey[500];
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
}); });
|
|
515
|
+
|
|
516
|
+
var IconButton = React.forwardRef(function (props, ref) {
|
|
517
|
+
return React__default['default'].createElement(MuiIconButton__default['default'], __assign$1({ ref: ref }, props));
|
|
518
|
+
});
|
|
519
|
+
IconButton.displayName = 'IconButton';
|
|
520
|
+
IconButton.defaultProps = {
|
|
521
|
+
color: 'secondary',
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
var useLinkStyles = styles.makeStyles(function (theme) { return ({
|
|
525
|
+
root: function (props) {
|
|
526
|
+
var _a;
|
|
527
|
+
return (__assign$1(__assign$1({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
|
|
528
|
+
alignSelf: 'center',
|
|
529
|
+
}, _a)));
|
|
530
|
+
},
|
|
531
|
+
}); });
|
|
532
|
+
|
|
533
|
+
var Link = React.forwardRef(function (props, ref) {
|
|
534
|
+
var children = props.children, muiProps = __rest$1(props, ["children"]);
|
|
535
|
+
var classes = useLinkStyles(props);
|
|
536
|
+
return (React__default['default'].createElement(core.Link, __assign$1({ ref: ref, classes: { root: classes.root } }, muiProps), children));
|
|
537
|
+
});
|
|
538
|
+
Link.defaultProps = {
|
|
539
|
+
variant: 'body1',
|
|
540
|
+
};
|
|
541
|
+
Link.displayName = 'Link';
|
|
542
|
+
|
|
543
|
+
var useStyles = core.makeStyles(function (_a) {
|
|
544
|
+
var spacing = _a.spacing;
|
|
545
|
+
return ({
|
|
546
|
+
root: {
|
|
547
|
+
'&:last-child': {
|
|
548
|
+
marginBottom: 0,
|
|
549
|
+
},
|
|
550
|
+
marginBottom: spacing(4),
|
|
551
|
+
padding: spacing(4),
|
|
552
|
+
},
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
var Paper = React.forwardRef(function (props, ref) {
|
|
556
|
+
var legacyStyles = props.legacyStyles, restProps = __rest$1(props, ["legacyStyles"]);
|
|
557
|
+
var classes = useStyles(props);
|
|
558
|
+
return React__default['default'].createElement(core.Paper, __assign$1({}, ref, { classes: __assign$1({}, (legacyStyles && classes)) }, restProps));
|
|
559
|
+
});
|
|
560
|
+
Paper.displayName = 'Paper';
|
|
561
|
+
Paper.defaultProps = {
|
|
562
|
+
legacyStyles: false,
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
var Radio = React.forwardRef(function (props, ref) {
|
|
566
|
+
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest$1(props, ["label", "disabled", "LabelProps"]);
|
|
567
|
+
var control = React__default['default'].createElement(MuiRadio__default['default'], __assign$1({ disabled: label ? undefined : disabled }, muiProps));
|
|
568
|
+
return label ? (React__default['default'].createElement(FormControlLabel__default['default'], __assign$1({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
569
|
+
});
|
|
570
|
+
Radio.displayName = 'Radio';
|
|
571
|
+
|
|
572
|
+
styles.makeStyles(function () { return ({
|
|
573
|
+
textfield: {
|
|
574
|
+
background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
|
|
575
|
+
borderTopLeftRadius: 4,
|
|
576
|
+
borderBottomLeftRadius: 4,
|
|
577
|
+
'& fieldset': {
|
|
578
|
+
borderRight: 'none',
|
|
579
|
+
borderTopRightRadius: 0,
|
|
580
|
+
borderBottomRightRadius: 0,
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
button: {
|
|
584
|
+
borderTopLeftRadius: 0,
|
|
585
|
+
borderBottomLeftRadius: 0,
|
|
586
|
+
alignSelf: 'stretch',
|
|
587
|
+
},
|
|
588
|
+
input: {
|
|
589
|
+
color: function (props) { return props.inputTextColor || 'inherit'; },
|
|
590
|
+
'&$focused fieldset': {
|
|
591
|
+
top: -4,
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
focused: {},
|
|
595
|
+
}); });
|
|
596
|
+
|
|
597
|
+
var useSwitchStyles = styles.makeStyles(function (theme) { return ({
|
|
598
|
+
checked: {
|
|
599
|
+
'& $thumb': {
|
|
600
|
+
background: theme.palette.success.main,
|
|
601
|
+
},
|
|
602
|
+
'&& + $track': {
|
|
603
|
+
backgroundColor: theme.palette.success.main,
|
|
604
|
+
},
|
|
605
|
+
},
|
|
606
|
+
thumb: {},
|
|
607
|
+
track: {},
|
|
608
|
+
}); });
|
|
609
|
+
|
|
610
|
+
var Switch = React.forwardRef(function (props, ref) {
|
|
611
|
+
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest$1(props, ["label", "disabled", "LabelProps"]);
|
|
612
|
+
var classes = useSwitchStyles(props);
|
|
613
|
+
var control = React__default['default'].createElement(MuiSwitch__default['default'], __assign$1({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
|
|
614
|
+
return label ? (React__default['default'].createElement(FormControlLabel__default['default'], __assign$1({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
615
|
+
});
|
|
616
|
+
Switch.displayName = 'Switch';
|
|
617
|
+
|
|
618
|
+
var useToggleButtonStyles = styles.makeStyles(function (theme) { return ({
|
|
619
|
+
root: {
|
|
620
|
+
color: theme.palette.text.primary,
|
|
621
|
+
},
|
|
622
|
+
selected: {
|
|
623
|
+
'&&': {
|
|
624
|
+
'&:hover': {
|
|
625
|
+
backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
|
|
626
|
+
},
|
|
627
|
+
backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
|
|
628
|
+
color: 'white',
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
}); });
|
|
632
|
+
|
|
633
|
+
var ToggleButton = React.forwardRef(function (props, ref) {
|
|
634
|
+
var children = props.children, muiProps = __rest$1(props, ["children"]);
|
|
635
|
+
var classes = useToggleButtonStyles(props);
|
|
636
|
+
return (React__default['default'].createElement(MuiToggleButton__default['default'], __assign$1({ ref: ref, classes: {
|
|
637
|
+
root: classes.root,
|
|
638
|
+
selected: classes.selected,
|
|
639
|
+
} }, muiProps), children));
|
|
640
|
+
});
|
|
641
|
+
ToggleButton.defaultProps = {
|
|
642
|
+
color: 'primary',
|
|
643
|
+
};
|
|
644
|
+
ToggleButton.displayName = 'ToggleButton';
|
|
645
|
+
|
|
646
|
+
var useToggleButtonGroupStyles = styles.makeStyles(function (theme) { return ({
|
|
647
|
+
root: {
|
|
648
|
+
'&&': {
|
|
649
|
+
backgroundColor: theme.palette.grey[300],
|
|
650
|
+
},
|
|
651
|
+
},
|
|
652
|
+
}); });
|
|
653
|
+
|
|
654
|
+
var ToggleButtonGroup = React.forwardRef(function (props, ref) {
|
|
655
|
+
var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = __rest$1(props, ["children", "color"]);
|
|
656
|
+
var classes = useToggleButtonGroupStyles(props);
|
|
657
|
+
var childrenWithProps = React__default['default'].Children.map(children, function (child) {
|
|
658
|
+
if (!React__default['default'].isValidElement(child)) {
|
|
659
|
+
return null;
|
|
660
|
+
}
|
|
661
|
+
return React__default['default'].cloneElement(child, { color: color });
|
|
662
|
+
});
|
|
663
|
+
return (React__default['default'].createElement(MuiToggleButtonGroup__default['default'], __assign$1({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
|
|
664
|
+
});
|
|
665
|
+
ToggleButtonGroup.displayName = 'ToggleButtonGroup';
|
|
666
|
+
|
|
667
|
+
var useTooltipStyles = styles.makeStyles(function (_a) {
|
|
668
|
+
var typography = _a.typography;
|
|
669
|
+
return ({
|
|
670
|
+
tooltip: {
|
|
671
|
+
fontSize: typography.pxToRem(16),
|
|
672
|
+
},
|
|
673
|
+
});
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
var Tooltip = React.forwardRef(function (props, ref) {
|
|
677
|
+
var classes = useTooltipStyles(props);
|
|
678
|
+
return React__default['default'].createElement(MuiTooltip__default['default'], __assign$1({ ref: ref, classes: classes }, props));
|
|
679
|
+
});
|
|
680
|
+
Tooltip.displayName = 'Tooltip';
|
|
681
|
+
|
|
682
|
+
core.makeStyles(function () { return ({
|
|
683
|
+
root: {
|
|
684
|
+
height: 56,
|
|
685
|
+
},
|
|
686
|
+
}); });
|
|
687
|
+
core.makeStyles(function (theme) { return ({
|
|
688
|
+
root: {
|
|
689
|
+
height: '100%',
|
|
690
|
+
width: 'min-content',
|
|
691
|
+
borderRadius: theme.spacing(1),
|
|
692
|
+
},
|
|
693
|
+
input: {
|
|
694
|
+
'&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
695
|
+
display: 'none',
|
|
696
|
+
},
|
|
697
|
+
'-moz-appearance': 'textfield',
|
|
698
|
+
minWidth: 40,
|
|
699
|
+
padding: 0,
|
|
700
|
+
textAlign: 'center',
|
|
701
|
+
},
|
|
702
|
+
adornedStart: {
|
|
703
|
+
padding: 0,
|
|
704
|
+
},
|
|
705
|
+
adornedEnd: {
|
|
706
|
+
padding: 0,
|
|
707
|
+
},
|
|
708
|
+
}); });
|
|
709
|
+
|
|
710
|
+
var _g$w;
|
|
711
|
+
|
|
712
|
+
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); }
|
|
713
|
+
|
|
714
|
+
function SvgTrend(props) {
|
|
715
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$18({
|
|
716
|
+
viewBox: "0 0 16 16",
|
|
717
|
+
fill: "none",
|
|
718
|
+
strokeLinecap: "round",
|
|
719
|
+
strokeLinejoin: "round",
|
|
720
|
+
width: "1em",
|
|
721
|
+
height: "1em"
|
|
722
|
+
}, props), _g$w || (_g$w = /*#__PURE__*/React__namespace.createElement("g", {
|
|
723
|
+
stroke: "currentColor"
|
|
724
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
725
|
+
d: "M15.333 4L9 10.333 5.667 7l-5 5"
|
|
726
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
727
|
+
d: "M11.333 4h4v4"
|
|
728
|
+
}))));
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
var _g$v;
|
|
732
|
+
|
|
733
|
+
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); }
|
|
734
|
+
|
|
735
|
+
function SvgTrendDown(props) {
|
|
736
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$17({
|
|
737
|
+
viewBox: "0 0 16 16",
|
|
738
|
+
fill: "none",
|
|
739
|
+
strokeLinecap: "round",
|
|
740
|
+
strokeLinejoin: "round",
|
|
741
|
+
width: "1em",
|
|
742
|
+
height: "1em"
|
|
743
|
+
}, props), _g$v || (_g$v = /*#__PURE__*/React__namespace.createElement("g", {
|
|
744
|
+
stroke: "currentColor"
|
|
745
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
746
|
+
d: "M15.333 12L9 5.667 5.667 9l-5-5"
|
|
747
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
748
|
+
d: "M11.333 12h4V8"
|
|
749
|
+
}))));
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
var useKpiMetricStyles = core.makeStyles(function (theme) { return ({
|
|
753
|
+
trendIcon: {
|
|
754
|
+
'&&': {
|
|
755
|
+
paddingInlineEnd: theme.spacing(1),
|
|
756
|
+
},
|
|
757
|
+
},
|
|
758
|
+
}); });
|
|
759
|
+
|
|
760
|
+
var defaultProps = {
|
|
761
|
+
trendStatus: 'natural',
|
|
762
|
+
trendMessage: 'data unavailable',
|
|
763
|
+
};
|
|
764
|
+
var KpiMetric = function (props) {
|
|
765
|
+
var KpiIcon = props.Icon, metric = props.metric, value = props.value, trend = props.trend, trendMessage = props.trendMessage, trendStatus = props.trendStatus;
|
|
766
|
+
var classes = useKpiMetricStyles(props);
|
|
767
|
+
var trendColors = trendStatus === 'natural' ? ['success', 'warning'] : ['warning', 'success'];
|
|
768
|
+
var trendColorMap = { up: 0, down: 1, level: 1 };
|
|
769
|
+
return (React__default['default'].createElement(core.Box, { display: "flex", flexDirection: "column", alignItems: "center", fontSize: '0.75rem' },
|
|
770
|
+
KpiIcon && (React__default['default'].createElement(core.Box, { fontSize: 24, display: "flex", bgcolor: "grey.100", borderRadius: "50%", padding: 2, mb: 2 },
|
|
771
|
+
React__default['default'].createElement(Icon, { icon: KpiIcon, size: "inherit" }))),
|
|
772
|
+
React__default['default'].createElement(Typography, { color: "secondary.light", variant: "body2" }, metric),
|
|
773
|
+
React__default['default'].createElement(Typography, { color: "secondary", variant: "h4" }, value ? value : '-'),
|
|
774
|
+
React__default['default'].createElement(Typography, { style: { fontSize: 'inherit' }, variant: "body2", color: trend ? trendColors[trendColorMap[trend]] : 'grey.500' },
|
|
775
|
+
trend === 'up' && React__default['default'].createElement(Icon, { className: classes.trendIcon, icon: SvgTrend, size: "inherit" }),
|
|
776
|
+
trend === 'down' && React__default['default'].createElement(Icon, { className: classes.trendIcon, icon: SvgTrendDown, size: "inherit" }),
|
|
777
|
+
trendMessage)));
|
|
778
|
+
};
|
|
779
|
+
KpiMetric.defaultProps = defaultProps;
|
|
780
|
+
|
|
781
|
+
/*! *****************************************************************************
|
|
782
|
+
Copyright (c) Microsoft Corporation.
|
|
783
|
+
|
|
784
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
785
|
+
purpose with or without fee is hereby granted.
|
|
786
|
+
|
|
787
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
788
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
789
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
790
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
791
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
792
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
793
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
794
|
+
***************************************************************************** */
|
|
795
|
+
|
|
796
|
+
var __assign = function() {
|
|
797
|
+
__assign = Object.assign || function __assign(t) {
|
|
798
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
799
|
+
s = arguments[i];
|
|
800
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
801
|
+
}
|
|
802
|
+
return t;
|
|
803
|
+
};
|
|
804
|
+
return __assign.apply(this, arguments);
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
function __rest(s, e) {
|
|
808
|
+
var t = {};
|
|
809
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
810
|
+
t[p] = s[p];
|
|
811
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
812
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
813
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
814
|
+
t[p[i]] = s[p[i]];
|
|
815
|
+
}
|
|
816
|
+
return t;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
var useTileStyles = core.makeStyles(function (theme) { return ({
|
|
820
|
+
root: {
|
|
821
|
+
borderRadius: theme.spacing(1),
|
|
822
|
+
},
|
|
823
|
+
content: {
|
|
824
|
+
padding: theme.spacing(3),
|
|
825
|
+
},
|
|
826
|
+
}); });
|
|
827
|
+
|
|
828
|
+
var Tile = function (props) {
|
|
829
|
+
var children = props.children, CardContentProps = props.CardContentProps, restProps = __rest(props, ["children", "CardContentProps"]);
|
|
830
|
+
var classes = useTileStyles(props);
|
|
831
|
+
return (React__default['default'].createElement(Card__default['default'], __assign({ classes: { root: classes.root } }, restProps),
|
|
832
|
+
React__default['default'].createElement(CardContent__default['default'], __assign({ classes: { root: classes.content } }, CardContentProps), children)));
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
var KpiMetricTile = function (props) {
|
|
836
|
+
var TileProps = props.TileProps, restProps = __rest(props, ["TileProps"]);
|
|
837
|
+
return (React__default['default'].createElement(Tile, __assign({}, TileProps),
|
|
838
|
+
React__default['default'].createElement(KpiMetric, __assign({}, restProps))));
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
exports.KpiMetric = KpiMetric;
|
|
842
|
+
exports.KpiMetricTile = KpiMetricTile;
|
|
843
|
+
exports.Tile = Tile;
|
|
844
|
+
//# sourceMappingURL=index.js.map
|