aefis-core-ui 2.3.0-rc17 → 2.3.0-rc19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.modern.js +255 -186
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -55,7 +55,7 @@ import IconButton$2 from '@mui/material/IconButton';
|
|
|
55
55
|
import Edit$1 from '@mui/icons-material/Edit';
|
|
56
56
|
import AutorenewIcon from '@mui/icons-material/Autorenew';
|
|
57
57
|
import { VerticalTimeline, VerticalTimelineElement } from 'react-vertical-timeline-component';
|
|
58
|
-
import
|
|
58
|
+
import require$$0 from 'moment';
|
|
59
59
|
import AddIcon from '@mui/icons-material/Add';
|
|
60
60
|
import { useInView } from 'react-intersection-observer';
|
|
61
61
|
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
|
|
@@ -1303,20 +1303,13 @@ AvatarBox.propTypes = {
|
|
|
1303
1303
|
hasShadow: PropTypes.bool
|
|
1304
1304
|
};
|
|
1305
1305
|
|
|
1306
|
-
// Copyright (c) 2022 HelioCampus Inc., all rights reserved.
|
|
1307
1306
|
const useStyles$G = makeStyles$1(theme => ({
|
|
1308
1307
|
formattedContainer: {
|
|
1309
|
-
display: "flex"
|
|
1310
|
-
alignItems: "center",
|
|
1311
|
-
padding: theme.spacing(2),
|
|
1312
|
-
boxSizing: "border-box",
|
|
1313
|
-
width: "100%"
|
|
1308
|
+
display: "flex"
|
|
1314
1309
|
},
|
|
1315
1310
|
container: {
|
|
1316
1311
|
display: "flex",
|
|
1317
|
-
|
|
1318
|
-
boxSizing: "border-box",
|
|
1319
|
-
width: "100%"
|
|
1312
|
+
boxSizing: "border-box"
|
|
1320
1313
|
},
|
|
1321
1314
|
avatar: {
|
|
1322
1315
|
flex: "0 0 auto",
|
|
@@ -1324,10 +1317,7 @@ const useStyles$G = makeStyles$1(theme => ({
|
|
|
1324
1317
|
},
|
|
1325
1318
|
title: {
|
|
1326
1319
|
color: "rgb(0, 0, 0)",
|
|
1327
|
-
fontWeight: 500
|
|
1328
|
-
font: "inherit",
|
|
1329
|
-
lineHeight: 1.43,
|
|
1330
|
-
letterSpacing: "0.01071em"
|
|
1320
|
+
fontWeight: 500
|
|
1331
1321
|
},
|
|
1332
1322
|
subtitle: {
|
|
1333
1323
|
letterSpacing: "0.01em",
|
|
@@ -1361,176 +1351,169 @@ const icon = {
|
|
|
1361
1351
|
|
|
1362
1352
|
/** Component to display a title, subtitle, and caption along with an icon avatar. */
|
|
1363
1353
|
|
|
1364
|
-
const AvatarTitle = /*#__PURE__*/React.memo(function AvatarTitle(
|
|
1354
|
+
const AvatarTitle = /*#__PURE__*/React.memo(function AvatarTitle({
|
|
1355
|
+
type = "default",
|
|
1356
|
+
avatar,
|
|
1357
|
+
avatarVariant = "round",
|
|
1358
|
+
title,
|
|
1359
|
+
titleComponent = "div",
|
|
1360
|
+
subtitle,
|
|
1361
|
+
caption,
|
|
1362
|
+
avatarColor,
|
|
1363
|
+
formatContent = true,
|
|
1364
|
+
size = "medium",
|
|
1365
|
+
titleCase = "default",
|
|
1366
|
+
subtitleCase = "default",
|
|
1367
|
+
contentAlignment = "center",
|
|
1368
|
+
avatarShadow = false,
|
|
1369
|
+
emphasizeSubtitle = false
|
|
1370
|
+
}) {
|
|
1365
1371
|
const classes = useStyles$G();
|
|
1366
1372
|
const avatarStyle = {
|
|
1367
1373
|
info: {
|
|
1368
1374
|
backgroundColor: info.default,
|
|
1369
|
-
boxShadow:
|
|
1370
|
-
borderRadius:
|
|
1375
|
+
boxShadow: avatarShadow ? "rgb(58 53 65 / 42%) 0px 4px 8px -4px" : "none",
|
|
1376
|
+
borderRadius: avatarVariant === "square" ? "6px" : "50%"
|
|
1371
1377
|
},
|
|
1372
1378
|
success: {
|
|
1373
1379
|
backgroundColor: success.default,
|
|
1374
|
-
boxShadow:
|
|
1375
|
-
borderRadius:
|
|
1380
|
+
boxShadow: avatarShadow ? "rgb(58 53 65 / 42%) 0px 4px 8px -4px" : "none",
|
|
1381
|
+
borderRadius: avatarVariant === "square" ? "6px" : "50%"
|
|
1376
1382
|
},
|
|
1377
1383
|
error: {
|
|
1378
1384
|
backgroundColor: danger.default,
|
|
1379
|
-
boxShadow:
|
|
1380
|
-
borderRadius:
|
|
1385
|
+
boxShadow: avatarShadow ? "rgb(58 53 65 / 42%) 0px 4px 8px -4px" : "none",
|
|
1386
|
+
borderRadius: avatarVariant === "square" ? "6px" : "50%"
|
|
1381
1387
|
},
|
|
1382
1388
|
warning: {
|
|
1383
1389
|
backgroundColor: warning.default,
|
|
1384
|
-
boxShadow:
|
|
1385
|
-
borderRadius:
|
|
1390
|
+
boxShadow: avatarShadow ? "rgb(58 53 65 / 42%) 0px 4px 8px -4px" : "none",
|
|
1391
|
+
borderRadius: avatarVariant === "square" ? "6px" : "50%"
|
|
1386
1392
|
},
|
|
1387
1393
|
custom: {
|
|
1388
|
-
backgroundColor:
|
|
1389
|
-
boxShadow:
|
|
1390
|
-
borderRadius:
|
|
1394
|
+
backgroundColor: avatarColor,
|
|
1395
|
+
boxShadow: avatarShadow ? "rgb(58 53 65 / 42%) 0px 4px 8px -4px" : "none",
|
|
1396
|
+
borderRadius: avatarVariant === "square" ? "6px" : "50%"
|
|
1391
1397
|
}
|
|
1392
1398
|
};
|
|
1399
|
+
const defaultTitleStyle = {
|
|
1400
|
+
color: emphasizeSubtitle ? "rgba(58,53,65,0.6)" : "#000000",
|
|
1401
|
+
textTransform: titleCase === "default" ? "none" : titleCase === "upper" ? "uppercase" : "lowercase"
|
|
1402
|
+
};
|
|
1403
|
+
const defaultSubtitleStyle = {
|
|
1404
|
+
fontWeight: emphasizeSubtitle ? "bolder" : "normal",
|
|
1405
|
+
textTransform: subtitleCase === "default" ? "none" : subtitleCase === "upper" ? "uppercase" : "lowercase"
|
|
1406
|
+
};
|
|
1407
|
+
const defaultCaptionStyle = {
|
|
1408
|
+
textTransform: subtitleCase === "default" ? "none" : subtitleCase === "upper" ? "uppercase" : "lowercase"
|
|
1409
|
+
};
|
|
1393
1410
|
const titleStyle = {
|
|
1394
|
-
xsmall: {
|
|
1395
|
-
fontSize: "0.
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1411
|
+
xsmall: _extends({
|
|
1412
|
+
fontSize: emphasizeSubtitle ? "0.675rem" : "0.7775rem",
|
|
1413
|
+
lineHeight: 0.9,
|
|
1414
|
+
letterSpacing: "0.5px"
|
|
1415
|
+
}, defaultTitleStyle),
|
|
1416
|
+
small: _extends({
|
|
1417
|
+
fontSize: "0.975rem"
|
|
1418
|
+
}, defaultTitleStyle),
|
|
1419
|
+
medium: _extends({
|
|
1401
1420
|
fontSize: "1.1rem"
|
|
1402
|
-
},
|
|
1403
|
-
large: {
|
|
1421
|
+
}, defaultTitleStyle),
|
|
1422
|
+
large: _extends({
|
|
1404
1423
|
fontSize: "1.2rem"
|
|
1405
|
-
}
|
|
1424
|
+
}, defaultTitleStyle)
|
|
1406
1425
|
};
|
|
1407
1426
|
const subtitleStyle = {
|
|
1408
|
-
xsmall: {
|
|
1409
|
-
fontSize: "0.775rem",
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
},
|
|
1417
|
-
medium: {
|
|
1418
|
-
fontSize: "0.875rem"
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
textTransform: props.subtitleCase === "default" ? "none" : props.subtitleCase === "upper" ? "uppercase" : "lowercase"
|
|
1424
|
-
}
|
|
1427
|
+
xsmall: _extends({
|
|
1428
|
+
fontSize: emphasizeSubtitle ? "0.875rem" : "0.775rem",
|
|
1429
|
+
lineHeight: 0.975,
|
|
1430
|
+
marginTop: "2px",
|
|
1431
|
+
letterSpacing: "0.15px"
|
|
1432
|
+
}, defaultSubtitleStyle),
|
|
1433
|
+
small: _extends({
|
|
1434
|
+
fontSize: "0.775rem"
|
|
1435
|
+
}, defaultSubtitleStyle),
|
|
1436
|
+
medium: _extends({
|
|
1437
|
+
fontSize: "0.875rem"
|
|
1438
|
+
}, defaultSubtitleStyle),
|
|
1439
|
+
large: _extends({
|
|
1440
|
+
fontSize: "0.875rem"
|
|
1441
|
+
}, defaultSubtitleStyle)
|
|
1425
1442
|
};
|
|
1426
1443
|
const captionStyle = {
|
|
1427
|
-
xsmall: {
|
|
1428
|
-
fontSize: "0.675rem"
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
small: {
|
|
1444
|
+
xsmall: _extends({
|
|
1445
|
+
fontSize: "0.675rem"
|
|
1446
|
+
}, defaultCaptionStyle),
|
|
1447
|
+
small: _extends({
|
|
1432
1448
|
fontSize: "0.675rem",
|
|
1433
|
-
fontWeight: "bolder"
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
fontSize: "0.775rem",
|
|
1442
|
-
textTransform: props.subtitleCase === "default" ? "none" : props.subtitleCase === "upper" ? "uppercase" : "lowercase"
|
|
1443
|
-
}
|
|
1449
|
+
fontWeight: "bolder"
|
|
1450
|
+
}, defaultCaptionStyle),
|
|
1451
|
+
medium: _extends({
|
|
1452
|
+
fontSize: "0.775rem"
|
|
1453
|
+
}, defaultCaptionStyle),
|
|
1454
|
+
large: _extends({
|
|
1455
|
+
fontSize: "0.775rem"
|
|
1456
|
+
}, defaultCaptionStyle)
|
|
1444
1457
|
};
|
|
1445
1458
|
const avatarContainerStyle = {
|
|
1446
1459
|
display: "flex",
|
|
1447
|
-
alignItems:
|
|
1448
|
-
width: "100%"
|
|
1460
|
+
alignItems: contentAlignment === "top" ? "flex-start" : "center"
|
|
1449
1461
|
};
|
|
1450
|
-
const avatarIcon =
|
|
1451
|
-
return /*#__PURE__*/
|
|
1452
|
-
className:
|
|
1453
|
-
children: /*#__PURE__*/
|
|
1462
|
+
const avatarIcon = type === "custom" ? avatar : icon[type];
|
|
1463
|
+
return /*#__PURE__*/jsxs(Box$1, {
|
|
1464
|
+
className: formatContent ? classes.formattedContainer : classes.container,
|
|
1465
|
+
children: [/*#__PURE__*/jsxs(Box$1, {
|
|
1466
|
+
sx: avatarContainerStyle,
|
|
1467
|
+
children: [size === "xsmall" && /*#__PURE__*/jsx(XSmallAvatar, {
|
|
1468
|
+
className: classes.avatar,
|
|
1469
|
+
style: avatarStyle[type],
|
|
1470
|
+
variant: avatarVariant,
|
|
1471
|
+
children: avatarIcon
|
|
1472
|
+
}), size === "small" && /*#__PURE__*/jsx(SmallAvatar, {
|
|
1473
|
+
className: classes.avatar,
|
|
1474
|
+
style: avatarStyle[type],
|
|
1475
|
+
variant: avatarVariant,
|
|
1476
|
+
children: avatarIcon
|
|
1477
|
+
}), size === "medium" && /*#__PURE__*/jsx(Avatar$1, {
|
|
1478
|
+
className: classes.avatar,
|
|
1479
|
+
style: avatarStyle[type],
|
|
1480
|
+
variant: avatarVariant,
|
|
1481
|
+
children: avatarIcon
|
|
1482
|
+
}), size === "large" && /*#__PURE__*/jsx(LargeAvatar, {
|
|
1483
|
+
variant: avatarVariant,
|
|
1484
|
+
className: classes.avatar,
|
|
1485
|
+
style: avatarStyle[type],
|
|
1486
|
+
children: avatarIcon
|
|
1487
|
+
})]
|
|
1488
|
+
}), /*#__PURE__*/jsxs(Box$1, {
|
|
1454
1489
|
sx: {
|
|
1455
|
-
|
|
1456
|
-
|
|
1490
|
+
display: "flex",
|
|
1491
|
+
flexDirection: "column"
|
|
1457
1492
|
},
|
|
1458
|
-
children: /*#__PURE__*/
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
children: avatarIcon
|
|
1481
|
-
})]
|
|
1482
|
-
}), /*#__PURE__*/jsx(Box$1, {
|
|
1483
|
-
sx: {
|
|
1484
|
-
display: "flex",
|
|
1485
|
-
alignItems: "center"
|
|
1486
|
-
},
|
|
1487
|
-
children: /*#__PURE__*/jsxs(Box$1, {
|
|
1488
|
-
sx: {
|
|
1489
|
-
display: "block"
|
|
1490
|
-
},
|
|
1491
|
-
children: [/*#__PURE__*/jsx(Box$1, {
|
|
1492
|
-
children: typeof props.title === "string" ? /*#__PURE__*/jsx(Typography, {
|
|
1493
|
-
variant: "h6",
|
|
1494
|
-
component: props.titleComponent,
|
|
1495
|
-
style: titleStyle[props.size],
|
|
1496
|
-
className: classes.title,
|
|
1497
|
-
children: props.title
|
|
1498
|
-
}) : props.title
|
|
1499
|
-
}), props.subtitle && /*#__PURE__*/jsx(Box$1, {
|
|
1500
|
-
children: typeof props.subtitle === "string" ? /*#__PURE__*/jsx(Typography, {
|
|
1501
|
-
variant: "body1",
|
|
1502
|
-
component: "div",
|
|
1503
|
-
style: subtitleStyle[props.size],
|
|
1504
|
-
color: "textSecondary",
|
|
1505
|
-
className: classes.subtitle,
|
|
1506
|
-
children: props.subtitle
|
|
1507
|
-
}) : props.subtitle
|
|
1508
|
-
}), props.caption && /*#__PURE__*/jsx(Box$1, {
|
|
1509
|
-
children: typeof props.subtitle === "string" ? /*#__PURE__*/jsx(Typography, {
|
|
1510
|
-
variant: "body1",
|
|
1511
|
-
component: "div",
|
|
1512
|
-
style: captionStyle[props.size],
|
|
1513
|
-
color: "textSecondary",
|
|
1514
|
-
className: classes.subtitle,
|
|
1515
|
-
children: props.caption
|
|
1516
|
-
}) : props.caption
|
|
1517
|
-
})]
|
|
1518
|
-
})
|
|
1519
|
-
})]
|
|
1520
|
-
})
|
|
1521
|
-
})
|
|
1493
|
+
children: [typeof title === "string" ? /*#__PURE__*/jsx(Typography, {
|
|
1494
|
+
variant: "h6",
|
|
1495
|
+
component: titleComponent,
|
|
1496
|
+
style: titleStyle[size],
|
|
1497
|
+
className: classes.title,
|
|
1498
|
+
children: title
|
|
1499
|
+
}) : title, subtitle && typeof subtitle === "string" ? /*#__PURE__*/jsx(Typography, {
|
|
1500
|
+
variant: "body1",
|
|
1501
|
+
component: "div",
|
|
1502
|
+
style: subtitleStyle[size],
|
|
1503
|
+
color: "textSecondary",
|
|
1504
|
+
className: classes.subtitle,
|
|
1505
|
+
children: subtitle
|
|
1506
|
+
}) : subtitle, caption && typeof subtitle === "string" ? /*#__PURE__*/jsx(Typography, {
|
|
1507
|
+
variant: "body1",
|
|
1508
|
+
component: "div",
|
|
1509
|
+
style: captionStyle[size],
|
|
1510
|
+
color: "textSecondary",
|
|
1511
|
+
className: classes.subtitle,
|
|
1512
|
+
children: caption
|
|
1513
|
+
}) : caption]
|
|
1514
|
+
})]
|
|
1522
1515
|
});
|
|
1523
1516
|
});
|
|
1524
|
-
AvatarTitle.defaultProps = {
|
|
1525
|
-
formatContent: true,
|
|
1526
|
-
size: "medium",
|
|
1527
|
-
type: "default",
|
|
1528
|
-
titleComponent: "div",
|
|
1529
|
-
subtitleCase: "default",
|
|
1530
|
-
contentAlignment: "center",
|
|
1531
|
-
avatarVariant: "round",
|
|
1532
|
-
avatarShadow: false
|
|
1533
|
-
};
|
|
1534
1517
|
AvatarTitle.propTypes = {
|
|
1535
1518
|
/** The type of avatar title. This will determine how the avatar color and icon is set. If "custom" is given, you can provide your own icon and color. */
|
|
1536
1519
|
type: PropTypes.oneOf(["info", "success", "warning", "error", "custom"]),
|
|
@@ -1553,11 +1536,15 @@ AvatarTitle.propTypes = {
|
|
|
1553
1536
|
/** The size of the avatar title */
|
|
1554
1537
|
size: PropTypes.oneOf(["xsmall", "small", "medium", "large"]),
|
|
1555
1538
|
/** The case used to display the subtitle and caption. */
|
|
1539
|
+
titleCase: PropTypes.oneOf(["default", "lower", "upper"]),
|
|
1540
|
+
/** The case used to display the subtitle and caption. */
|
|
1556
1541
|
subtitleCase: PropTypes.oneOf(["default", "lower", "upper"]),
|
|
1557
1542
|
/** How to align the content. */
|
|
1558
1543
|
contentAlignment: PropTypes.oneOf(["center", "top"]),
|
|
1559
1544
|
/** Display a slight shadow around the avatar? */
|
|
1560
|
-
avatarShadow: PropTypes.bool
|
|
1545
|
+
avatarShadow: PropTypes.bool,
|
|
1546
|
+
/** Emphasize value */
|
|
1547
|
+
emphasizeSubtitle: PropTypes.bool
|
|
1561
1548
|
};
|
|
1562
1549
|
|
|
1563
1550
|
const IconButton = /*#__PURE__*/forwardRef(function IconButton(props, ref) {
|
|
@@ -1732,7 +1719,7 @@ Button.defaultProps = {
|
|
|
1732
1719
|
variant: "text",
|
|
1733
1720
|
disableElevation: true
|
|
1734
1721
|
};
|
|
1735
|
-
Button.propTypes = {
|
|
1722
|
+
Button.propTypes = _extends({
|
|
1736
1723
|
/** A descriptive name of the button. Used by screen readers to explain the intent of the button. If not provided, the button content is used. */
|
|
1737
1724
|
name: PropTypes.string,
|
|
1738
1725
|
/** Remove the elevation from the button. */
|
|
@@ -1745,7 +1732,7 @@ Button.propTypes = {
|
|
|
1745
1732
|
disabled: PropTypes.bool,
|
|
1746
1733
|
/** The content of the button */
|
|
1747
1734
|
children: PropTypes.any
|
|
1748
|
-
};
|
|
1735
|
+
}, Button$1.propTypes);
|
|
1749
1736
|
|
|
1750
1737
|
const AnimatedExpandMoreIcon = ({
|
|
1751
1738
|
isOpen,
|
|
@@ -1836,15 +1823,18 @@ const MenuButton = /*#__PURE__*/forwardRef(function MenuButton(_ref, ref) {
|
|
|
1836
1823
|
"aria-haspopup": true,
|
|
1837
1824
|
"aria-expanded": Boolean(anchorEl)
|
|
1838
1825
|
};
|
|
1839
|
-
const buttonProps = {
|
|
1826
|
+
const buttonProps = _extends({
|
|
1840
1827
|
id: buttonId,
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1828
|
+
name: name
|
|
1829
|
+
}, displayType === "default" && {
|
|
1830
|
+
color
|
|
1831
|
+
}, icon && displayType === "default" && {
|
|
1832
|
+
startIcon: /*#__PURE__*/jsx(Icon$1, {
|
|
1844
1833
|
name: props.icon
|
|
1845
|
-
})
|
|
1846
|
-
|
|
1847
|
-
|
|
1834
|
+
})
|
|
1835
|
+
}, displayType === "default" && {
|
|
1836
|
+
variant
|
|
1837
|
+
});
|
|
1848
1838
|
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
1849
1839
|
children: [displayType === "icon" ? /*#__PURE__*/jsx(IconButton, _extends({}, buttonProps, a11yprops, {
|
|
1850
1840
|
onClick: e => handleClick(e, link, buttonId),
|
|
@@ -1917,7 +1907,7 @@ MenuButton.propTypes = {
|
|
|
1917
1907
|
name: PropTypes.string,
|
|
1918
1908
|
icon: PropTypes.any,
|
|
1919
1909
|
divider: PropTypes.any,
|
|
1920
|
-
onClick: PropTypes.
|
|
1910
|
+
onClick: PropTypes.func
|
|
1921
1911
|
})),
|
|
1922
1912
|
/** The function to execute when the button is clicked. */
|
|
1923
1913
|
onClick: PropTypes.func
|
|
@@ -10139,6 +10129,33 @@ Drawer.propTypes = {
|
|
|
10139
10129
|
titleComponent: PropTypes.oneOf(["h1", "h2", "h3", "div"])
|
|
10140
10130
|
};
|
|
10141
10131
|
|
|
10132
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
10133
|
+
|
|
10134
|
+
function getDefaultExportFromCjs (x) {
|
|
10135
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
10136
|
+
}
|
|
10137
|
+
|
|
10138
|
+
function createCommonjsModule(fn) {
|
|
10139
|
+
var module = { exports: {} };
|
|
10140
|
+
return fn(module, module.exports), module.exports;
|
|
10141
|
+
}
|
|
10142
|
+
|
|
10143
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
10144
|
+
!function(e,t){module.exports=t(require$$0,React);}(commonjsGlobal,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r});},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){e.exports=n(3)();},function(t,n){t.exports=e;},function(e,n){e.exports=t;},function(e,t,n){var r=n(4);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n};},function(e,t,n){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";},function(e,t,n){var r,o,i,a,l;
|
|
10145
|
+
/*! Moment Duration Format v2.2.2
|
|
10146
|
+
* https://github.com/jsmreese/moment-duration-format
|
|
10147
|
+
* Date: 2018-02-16
|
|
10148
|
+
*
|
|
10149
|
+
* Duration format plugin function for the Moment.js library
|
|
10150
|
+
* http://momentjs.com/
|
|
10151
|
+
*
|
|
10152
|
+
* Copyright 2018 John Madhavan-Reese
|
|
10153
|
+
* Released under the MIT license
|
|
10154
|
+
*/a=this,l=function(e){var t=!1,n=!1,r=!1,o=!1,i="escape years months weeks days hours minutes seconds milliseconds general".split(" "),a=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function l(e,t){return !(t.length>e.length)&&-1!==e.indexOf(t)}function u(e){for(var t="";e;)t+="0",e-=1;return t}function s(e,t){var n=e+"+"+v(V(t).sort(),(function(e){return e+":"+t[e]})).join(",");return s.cache[n]||(s.cache[n]=Intl.NumberFormat(e,t)),s.cache[n]}function c(e,t,i){var a,l,f,m=t.useToLocaleString,p=t.useGrouping,g=p&&t.grouping.slice(),y=t.maximumSignificantDigits,h=t.minimumIntegerDigits||1,d=t.fractionDigits||0,v=t.groupingSeparator,b=t.decimalSeparator;if(m&&i){var w,S={minimumIntegerDigits:h,useGrouping:p};return d&&(S.maximumFractionDigits=d,S.minimumFractionDigits=d),y&&e>0&&(S.maximumSignificantDigits=y),r?(o||((w=x({},t)).useGrouping=!1,w.decimalSeparator=".",e=parseFloat(c(e,w),10)),s(i,S).format(e)):(n||((w=x({},t)).useGrouping=!1,w.decimalSeparator=".",e=parseFloat(c(e,w),10)),e.toLocaleString(i,S))}var T=(y?e.toPrecision(y+1):e.toFixed(d+1)).split("e");f=T[1]||"",l=(T=T[0].split("."))[1]||"";var O=(a=T[0]||"").length,_=l.length,V=O+_,D=a+l;(y&&V===y+1||!y&&_===d+1)&&((D=function(e){for(var t=e.split("").reverse(),n=0,r=!0;r&&n<t.length;)n?"9"===t[n]?t[n]="0":(t[n]=(parseInt(t[n],10)+1).toString(),r=!1):(parseInt(t[n],10)<5&&(r=!1),t[n]="0"),n+=1;return r&&t.push("1"),t.reverse().join("")}(D)).length===V+1&&(O+=1),_&&(D=D.slice(0,-1)),a=D.slice(0,O),l=D.slice(O)),y&&(l=l.replace(/0*$/,""));var j=parseInt(f,10);j>0?l.length<=j?(a+=l+=u(j-l.length),l=""):(a+=l.slice(0,j),l=l.slice(j)):j<0&&(l=u(Math.abs(j)-a.length)+a+l,a="0"),y||((l=l.slice(0,d)).length<d&&(l+=u(d-l.length)),a.length<h&&(a=u(h-a.length)+a));var M,P="";if(p)for(T=a;T.length;)g.length&&(M=g.shift()),P&&(P=v+P),P=T.slice(-M)+P,T=T.slice(0,-M);else P=a;return l&&(P=P+b+l),P}function f(e,t){return e.label.length>t.label.length?-1:e.label.length<t.label.length?1:0}function m(e,t){var n=[];return d(V(t),(function(r){if("_durationLabels"===r.slice(0,15)){var o=r.slice(15).toLowerCase();d(V(t[r]),(function(i){i.slice(0,1)===e&&n.push({type:o,key:i,label:t[r][i]});}));}})),n}s.cache={};var p={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:function(e,t,n){return 1===t&&null===n?e:e+e}};function g(e){return "[object Array]"===Object.prototype.toString.call(e)}function y(e){return "[object Object]"===Object.prototype.toString.call(e)}function h(e,t){var n,r=0,o=e&&e.length||0;for("function"!=typeof t&&(n=t,t=function(e){return e===n});r<o;){if(t(e[r]))return e[r];r+=1;}}function d(e,t){var n=0,r=e.length;if(e&&r)for(;n<r;){if(!1===t(e[n],n))return;n+=1;}}function v(e,t){var n=0,r=e.length,o=[];if(!e||!r)return o;for(;n<r;)o[n]=t(e[n],n),n+=1;return o}function b(e,t){return v(e,(function(e){return e[t]}))}function w(e){var t=[];return d(e,(function(e){e&&t.push(e);})),t}function S(e){var t=[];return d(e,(function(e){h(t,e)||t.push(e);})),t}function T(e,t){var n=[];return d(e,(function(e){d(t,(function(t){e===t&&n.push(e);}));})),S(n)}function O(e,t){var n=[];return d(e,(function(r,o){if(!t(r))return n=e.slice(o),!1})),n}function _(e,t){return O(e.slice().reverse(),t).reverse()}function x(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function V(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function D(e,t){var n=0,r=e.length;if(!e||!r)return !1;for(;n<r;){if(!0===t(e[n],n))return !0;n+=1;}return !1}function j(e){var t=[];return d(e,(function(e){t=t.concat(e);})),t}function M(e){return "3.6"===e(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})}function P(e){var t=!0;return !!((t=(t=(t=t&&"1"===e(1,"en",{minimumIntegerDigits:1}))&&"01"===e(1,"en",{minimumIntegerDigits:2}))&&"001"===e(1,"en",{minimumIntegerDigits:3}))&&(t=(t=(t=(t=t&&"100"===e(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0}))&&"100.0"===e(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1}))&&"99.99"===e(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2}))&&"99.990"===e(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3}))&&(t=(t=(t=(t=(t=t&&"100"===e(99.99,"en",{maximumSignificantDigits:1}))&&"100"===e(99.99,"en",{maximumSignificantDigits:2}))&&"100"===e(99.99,"en",{maximumSignificantDigits:3}))&&"99.99"===e(99.99,"en",{maximumSignificantDigits:4}))&&"99.99"===e(99.99,"en",{maximumSignificantDigits:5}))&&(t=(t=t&&"1,000"===e(1e3,"en",{useGrouping:!0}))&&"1000"===e(1e3,"en",{useGrouping:!1})))}function k(){var e,t=[].slice.call(arguments),n={};if(d(t,(function(t,r){if(!r){if(!g(t))throw "Expected array as the first argument to durationsFormat.";e=t;}"string"!=typeof t&&"function"!=typeof t?"number"!=typeof t?y(t)&&x(n,t):n.precision=t:n.template=t;})),!e||!e.length)return [];n.returnMomentTypes=!0;var r=v(e,(function(e){return e.format(n)})),o=T(i,S(b(j(r),"type"))),a=n.largest;return a&&(o=o.slice(0,a)),n.returnMomentTypes=!1,n.outputTypes=o,v(e,(function(e){return e.format(n)}))}function E(){var n=[].slice.call(arguments),o=x({},this.format.defaults),u=this.asMilliseconds(),s=this.asMonths();"function"==typeof this.isValid&&!1===this.isValid()&&(u=0,s=0);var j=u<0,M=e.duration(Math.abs(u),"milliseconds"),P=e.duration(Math.abs(s),"months");d(n,(function(e){"string"!=typeof e&&"function"!=typeof e?"number"!=typeof e?y(e)&&x(o,e):o.precision=e:o.template=e;}));var k={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},E={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};o.types=i;var L=function(e){return h(i,(function(t){return E[t].test(e)}))},F=new RegExp(v(i,(function(e){return E[e].source})).join("|"),"g");o.duration=this;var I="function"==typeof o.template?o.template.apply(o):o.template,N=o.outputTypes,C=o.returnMomentTypes,R=o.largest,G=[];N||(g(o.stopTrim)&&(o.stopTrim=o.stopTrim.join("")),o.stopTrim&&d(o.stopTrim.match(F),(function(e){var t=L(e);"escape"!==t&&"general"!==t&&G.push(t);})));var U=e.localeData();U||(U={}),d(V(p),(function(e){"function"!=typeof p[e]?U["_"+e]||(U["_"+e]=p[e]):U[e]||(U[e]=p[e]);})),d(V(U._durationTimeTemplates),(function(e){I=I.replace("_"+e+"_",U._durationTimeTemplates[e]);}));var q=o.userLocale||e.locale(),z=o.useLeftUnits,H=o.usePlural,W=o.precision,$=o.forceLength,A=o.useGrouping,B=o.trunc,K=o.useSignificantDigits&&W>0,Y=K?o.precision:0,J=Y,Q=o.minValue,X=!1,Z=o.maxValue,ee=!1,te=o.useToLocaleString,ne=o.groupingSeparator,re=o.decimalSeparator,oe=o.grouping;te=te&&(t||r);var ie=o.trim;g(ie)&&(ie=ie.join(" ")),null===ie&&(R||Z||K)&&(ie="all"),null!==ie&&!0!==ie&&"left"!==ie&&"right"!==ie||(ie="large"),!1===ie&&(ie="");var ae=function(e){return e.test(ie)},le=/large/,ue=/small/,se=/both/,ce=/mid/,fe=/^all|[^sm]all/,me=/final/,pe=R>0||D([le,se,fe],ae),ge=D([ue,se,fe],ae),ye=D([ce,fe],ae),he=D([me,fe],ae),de=v(I.match(F),(function(e,t){var n=L(e);return "*"===e.slice(0,1)&&(e=e.slice(1),"escape"!==n&&"general"!==n&&G.push(n)),{index:t,length:e.length,text:"",token:"escape"===n?e.replace(E.escape,"$1"):e,type:"escape"===n||"general"===n?null:n}})),ve={index:0,length:0,token:"",text:"",type:null},be=[];z&&de.reverse(),d(de,(function(e){if(e.type)return (ve.type||ve.text)&&be.push(ve),void(ve=e);z?ve.text=e.token+ve.text:ve.text+=e.token;})),(ve.type||ve.text)&&be.push(ve),z&&be.reverse();var we=T(i,S(w(b(be,"type"))));if(!we.length)return b(be,"text").join("");we=v(we,(function(e,t){var n,r=t+1===we.length,i=!t;n="years"===e||"months"===e?P.as(e):M.as(e);var a=Math.floor(n),l=n-a,u=h(be,(function(t){return e===t.type}));return i&&Z&&n>Z&&(ee=!0),r&&Q&&Math.abs(o.duration.as(e))<Q&&(X=!0),i&&null===$&&u.length>1&&($=!0),M.subtract(a,e),P.subtract(a,e),{rawValue:n,wholeValue:a,decimalValue:r?l:0,isSmallest:r,isLargest:i,type:e,tokenLength:u.length}}));var Se=B?Math.floor:Math.round,Te=function(e,t){var n=Math.pow(10,t);return Se(e*n)/n},Oe=!1,_e=!1,xe=function(e,t){var n={useGrouping:A,groupingSeparator:ne,decimalSeparator:re,grouping:oe,useToLocaleString:te};return K&&(Y<=0?(e.rawValue=0,e.wholeValue=0,e.decimalValue=0):(n.maximumSignificantDigits=Y,e.significantDigits=Y)),ee&&!_e&&(e.isLargest?(e.wholeValue=Z,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),X&&!_e&&(e.isSmallest?(e.wholeValue=Q,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),e.isSmallest||e.significantDigits&&e.significantDigits-e.wholeValue.toString().length<=0?W<0?e.value=Te(e.wholeValue,W):0===W?e.value=Se(e.wholeValue+e.decimalValue):K?(e.value=B?Te(e.rawValue,Y-e.wholeValue.toString().length):e.rawValue,e.wholeValue&&(Y-=e.wholeValue.toString().length)):(n.fractionDigits=W,e.value=B?e.wholeValue+Te(e.decimalValue,W):e.wholeValue+e.decimalValue):K&&e.wholeValue?(e.value=Math.round(Te(e.wholeValue,e.significantDigits-e.wholeValue.toString().length)),Y-=e.wholeValue.toString().length):e.value=e.wholeValue,e.tokenLength>1&&($||Oe)&&(n.minimumIntegerDigits=e.tokenLength,_e&&n.maximumSignificantDigits<e.tokenLength&&delete n.maximumSignificantDigits),!Oe&&(e.value>0||""===ie||h(G,e.type)||h(N,e.type))&&(Oe=!0),e.formattedValue=c(e.value,n,q),n.useGrouping=!1,n.decimalSeparator=".",e.formattedValueEn=c(e.value,n,"en"),2===e.tokenLength&&"milliseconds"===e.type&&(e.formattedValueMS=c(e.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),e};if((we=w(we=v(we,xe))).length>1){var Ve=function(e){return h(we,(function(t){return t.type===e}))},De=function(e){var t=Ve(e.type);t&&d(e.targets,(function(e){var n=Ve(e.type);n&&parseInt(t.formattedValueEn,10)===e.value&&(t.rawValue=0,t.wholeValue=0,t.decimalValue=0,n.rawValue+=1,n.wholeValue+=1,n.decimalValue=0,n.formattedValueEn=n.wholeValue.toString(),_e=!0);}));};d(a,De);}return _e&&(Oe=!1,Y=J,we=w(we=v(we,xe))),!N||ee&&!o.trim?(pe&&(we=O(we,(function(e){return !e.isSmallest&&!e.wholeValue&&!h(G,e.type)}))),R&&we.length&&(we=we.slice(0,R)),ge&&we.length>1&&(we=_(we,(function(e){return !e.wholeValue&&!h(G,e.type)&&!e.isLargest}))),ye&&(we=w(we=v(we,(function(e,t){return t>0&&t<we.length-1&&!e.wholeValue?null:e})))),!he||1!==we.length||we[0].wholeValue||!B&&we[0].isSmallest&&we[0].rawValue<Q||(we=[])):we=w(we=v(we,(function(e){return h(N,(function(t){return e.type===t}))?e:null}))),C?we:(d(be,(function(e){var t=k[e.type],n=h(we,(function(t){return t.type===e.type}));if(t&&n){var r=n.formattedValueEn.split(".");r[0]=parseInt(r[0],10),r[1]?r[1]=parseFloat("0."+r[1],10):r[1]=null;var o=U.durationPluralKey(t,r[0],r[1]),i=m(t,U),a=!1,u={};d(U._durationLabelTypes,(function(t){var n=h(i,(function(e){return e.type===t.type&&e.key===o}));n&&(u[n.type]=n.label,l(e.text,t.string)&&(e.text=e.text.replace(t.string,n.label),a=!0));})),H&&!a&&(i.sort(f),d(i,(function(t){return u[t.type]===t.label?!l(e.text,t.label)&&void 0:l(e.text,t.label)?(e.text=e.text.replace(t.label,u[t.type]),!1):void 0})));}})),(be=v(be,(function(e){if(!e.type)return e.text;var t=h(we,(function(t){return t.type===e.type}));if(!t)return "";var n="";return z&&(n+=e.text),(j&&ee||!j&&X)&&(n+="< ",ee=!1,X=!1),(j&&X||!j&&ee)&&(n+="> ",ee=!1,X=!1),j&&(t.value>0||""===ie||h(G,t.type)||h(N,t.type))&&(n+="-",j=!1),"milliseconds"===e.type&&t.formattedValueMS?n+=t.formattedValueMS:n+=t.formattedValue,z||(n+=e.text),n}))).join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function L(){var e=this.duration,t=function(t){return e._data[t]},n=h(this.types,t),r=function(e,t){for(var n=e.length;n-=1;)if(t(e[n]))return e[n]}(this.types,t);switch(n){case"milliseconds":return "S __";case"seconds":case"minutes":return "*_MS_";case"hours":return "_HMS_";case"days":if(n===r)return "d __";case"weeks":return n===r?"w __":(null===this.trim&&(this.trim="both"),"w __, d __, h __");case"months":if(n===r)return "M __";case"years":return n===r?"y __":(null===this.trim&&(this.trim="both"),"y __, M __, d __");default:return null===this.trim&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function F(e){if(!e)throw "Moment Duration Format init cannot find moment instance.";e.duration.format=k,e.duration.fn.format=E,e.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:L,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},e.updateLocale("en",p);}var I=function(e,t,n){return e.toLocaleString(t,n)};t=function(){try{(0).toLocaleString("i");}catch(e){return "RangeError"===e.name}return !1}()&&P(I),n=t&&M(I);var N=function(e,t,n){if("undefined"!=typeof window&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(t,n).format(e)};return r=P(N),o=r&&M(N),F(e),F},o=[n(1)],void 0===(i="function"==typeof(r=l)?r.apply(t,o):r)||(e.exports=i),a&&(a.momentDurationFormatSetup=a.moment?l(a.moment):l);},function(e,t,n){n.r(t),n.d(t,"default",(function(){return _}));var r=n(2),o=n.n(r),i=n(0),a=n.n(i),l=n(1),u=n.n(l);n(5);function s(e){return (s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r);}return n}function f(e,t){if(null==e)return {};var n,r,o=function(e,t){if(null==e)return {};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);}return o}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function p(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),e}function g(e,t){return (g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return !1}}();return function(){var n,r=v(e);if(t){var o=v(this).constructor;n=Reflect.construct(r,arguments,o);}else n=r.apply(this,arguments);return h(this,n)}}function h(e,t){return !t||"object"!==s(t)&&"function"!=typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return (v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=[a.a.string,a.a.number,a.a.array,a.a.object],S=[a.a.string,a.a.array],T=[a.a.object,a.a.bool],O=[a.a.string,a.a.bool],_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t);}(n,e);var t=y(n);function n(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),b(d(r=t.call(this,e)),"setTimer",(function(){var e=r.props.interval;r.clearTimer(),n.pooledTimer||0===e||(r.timer=setInterval((function(){r.update(r.props);}),e));})),b(d(r),"getTitle",(function(){var e=r.props.titleFormat,t=n.getDatetime(r.props),o=e||n.globalFormat;return t.format(o)})),b(d(r),"clearTimer",(function(){!n.pooledTimer&&r.timer&&(clearInterval(r.timer),r.timer=null),n.pooledTimer&&!r.timer&&n.removePooledElement(d(r));})),n.globalMoment||(n.globalMoment=u.a),r.state={content:""},r.timer=null,r}return p(n,null,[{key:"startPooledTimer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e4;n.clearPooledTimer(),n.pooledTimer=setInterval((function(){n.pooledElements.forEach((function(e){0!==e.props.interval&&e.update();}));}),e);}},{key:"clearPooledTimer",value:function(){n.pooledTimer&&(clearInterval(n.pooledTimer),n.pooledTimer=null,n.pooledElements=[]);}},{key:"pushPooledElement",value:function(e){e instanceof n?-1===n.pooledElements.indexOf(e)&&n.pooledElements.push(e):console.error("Element not an instance of Moment.");}},{key:"removePooledElement",value:function(e){var t=n.pooledElements.indexOf(e);-1!==t&&n.pooledElements.splice(t,1);}},{key:"getDatetime",value:function(e){var t=e.utc,r=e.unix,o=e.date,i=e.locale,a=e.parse,l=e.tz,u=e.local;o=o||e.children,a=a||n.globalParse,u=u||n.globalLocal,l=l||n.globalTimezone,i=n.globalLocale?n.globalLocale:i||n.globalMoment.locale();var s=null;return s=t?n.globalMoment.utc(o,a,i):r?n.globalMoment(1e3*o,a,i):n.globalMoment(o,a,i),l?s=s.tz(l):u&&(s=s.local()),s}},{key:"getContent",value:function(e){var t=e.fromNow,r=e.fromNowDuring,o=e.from,i=e.add,a=e.subtract,l=e.toNow,s=e.to,c=e.ago,f=e.calendar,m=e.diff,p=e.duration,g=e.durationFromNow,y=e.unit,h=e.decimal,d=e.trim,v=e.format;v=v||n.globalFormat;var b=n.getDatetime(e);i&&b.add(i),a&&b.subtract(a);var w=Boolean(r)&&-b.diff(u()())<r,S="";return S=!v||w||g||p?o?b.from(o,c):t||w?b.fromNow(c):s?b.to(s,c):l?b.toNow(c):f?b.calendar(null,f):m?b.diff(m,y,h):p?b.diff(p):g?u()().diff(b):b.toString():b.format(v),(p||g)&&(S=(S=u.a.duration(S)).format(v,{trim:d})),S=(n.globalFilter||e.filter)(S)}}]),p(n,[{key:"componentDidMount",value:function(){this.setTimer(),n.pooledTimer&&n.pushPooledElement(this);}},{key:"componentDidUpdate",value:function(e){var t=this.props.interval;e.interval!==t&&this.setTimer();}},{key:"componentWillUnmount",value:function(){this.clearTimer();}},{key:"update",value:function(e){var t=e||this.props,r=t.onChange,o=n.getContent(t);this.setState({content:o},(function(){r(o);}));}},{key:"render",value:function(){var e,t,r,i,a=this.props,l=a.withTitle,u=a.element,s=f(a,["withTitle","element"]),m=this.state.content,p=(e=s,t=n.propTypes,r=Object.keys(t),i=Object.assign({},e),Object.keys(i).filter((function(e){return -1!==r.indexOf(e)})).forEach((function(e){return delete i[e]})),i);return l&&(p.title=this.getTitle()),o.a.createElement(u||n.globalElement,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){b(e,t,n[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t));}));}return e}({dateTime:n.getDatetime(this.props)},p),m)}}],[{key:"getDerivedStateFromProps",value:function(e){return {content:n.getContent(e)}}}]),n}(o.a.Component);b(_,"propTypes",{element:a.a.any,date:a.a.oneOfType(w),parse:a.a.oneOfType(S),format:a.a.string,add:a.a.object,subtract:a.a.object,ago:a.a.bool,fromNow:a.a.bool,fromNowDuring:a.a.number,from:a.a.oneOfType(w),toNow:a.a.bool,to:a.a.oneOfType(w),calendar:a.a.oneOfType(T),unix:a.a.bool,utc:a.a.bool,local:a.a.bool,tz:a.a.string,withTitle:a.a.bool,titleFormat:a.a.string,locale:a.a.string,interval:a.a.number,diff:a.a.oneOfType(w),duration:a.a.oneOfType(w),durationFromNow:a.a.bool,trim:a.a.oneOfType(O),unit:a.a.string,decimal:a.a.bool,filter:a.a.func,onChange:a.a.func}),b(_,"defaultProps",{element:null,fromNow:!1,toNow:!1,calendar:!1,ago:!1,unix:!1,utc:!1,local:!1,unit:null,withTitle:!1,trim:!1,decimal:!1,titleFormat:"",interval:6e4,filter:function(e){return e},onChange:function(){}}),b(_,"globalMoment",null),b(_,"globalLocale",null),b(_,"globalLocal",null),b(_,"globalFormat",null),b(_,"globalParse",null),b(_,"globalFilter",null),b(_,"globalElement","time"),b(_,"globalTimezone",null),b(_,"pooledElements",[]),b(_,"pooledTimer",null);}])}));
|
|
10155
|
+
});
|
|
10156
|
+
|
|
10157
|
+
var Moment = /*@__PURE__*/getDefaultExportFromCjs(dist);
|
|
10158
|
+
|
|
10142
10159
|
// Copyright (c) 2022 HelioCampus Inc., all rights reserved.
|
|
10143
10160
|
const useStyles$h = makeStyles(() => ({
|
|
10144
10161
|
rootContainer: {
|
|
@@ -11012,9 +11029,7 @@ const useAutoCompleteValue = (propValue, multiple) => {
|
|
|
11012
11029
|
const useSkipOnMount = (fn, deps) => {
|
|
11013
11030
|
const didMountRef = useRef();
|
|
11014
11031
|
useEffect(() => {
|
|
11015
|
-
if (didMountRef.current)
|
|
11016
|
-
fn();
|
|
11017
|
-
}
|
|
11032
|
+
if (didMountRef.current) fn();
|
|
11018
11033
|
didMountRef.current = true;
|
|
11019
11034
|
}, deps);
|
|
11020
11035
|
};
|
|
@@ -15285,6 +15300,9 @@ function Row({
|
|
|
15285
15300
|
// rule value
|
|
15286
15301
|
template: ruleTemplate,
|
|
15287
15302
|
onRuleDelete,
|
|
15303
|
+
onRuleMoveUp,
|
|
15304
|
+
onRuleMoveDown,
|
|
15305
|
+
onCreateRuleBelow,
|
|
15288
15306
|
onTemplateSelect,
|
|
15289
15307
|
onTemplateValueChange,
|
|
15290
15308
|
templateInputMap,
|
|
@@ -15301,8 +15319,7 @@ function Row({
|
|
|
15301
15319
|
// index,
|
|
15302
15320
|
// ruleIndex
|
|
15303
15321
|
});
|
|
15304
|
-
});
|
|
15305
|
-
|
|
15322
|
+
}, 200);
|
|
15306
15323
|
const templateValueField = useMemo(() => {
|
|
15307
15324
|
if (!templateSelectionCode) return null;
|
|
15308
15325
|
const TemplateInputField = templateInputMap[templateSelectionCode].component;
|
|
@@ -15316,7 +15333,7 @@ function Row({
|
|
|
15316
15333
|
|
|
15317
15334
|
// TODO: take out index from here together with onChange handler
|
|
15318
15335
|
// index, ruleIndex,
|
|
15319
|
-
}, [groupId, ruleId, templateSelectionCode, ruleValue, ruleTemplate]);
|
|
15336
|
+
}, [groupId, ruleId, templateSelectionCode, ruleValue, ruleTemplate, handleChange]);
|
|
15320
15337
|
return /*#__PURE__*/jsxs(Box$1, {
|
|
15321
15338
|
sx: {
|
|
15322
15339
|
display: "flex",
|
|
@@ -15379,19 +15396,41 @@ function Row({
|
|
|
15379
15396
|
marginTop: "22px"
|
|
15380
15397
|
},
|
|
15381
15398
|
children: /*#__PURE__*/jsx(MenuButton, {
|
|
15399
|
+
name: "rule operation",
|
|
15382
15400
|
displayType: "icon",
|
|
15383
15401
|
menuConfiguration: [{
|
|
15384
15402
|
name: "Move Up",
|
|
15385
15403
|
icon: /*#__PURE__*/jsx(KeyboardArrowUpIcon, {}),
|
|
15386
|
-
onClick: ()
|
|
15404
|
+
onClick: function () {
|
|
15405
|
+
onRuleMoveUp({
|
|
15406
|
+
ruleId,
|
|
15407
|
+
index,
|
|
15408
|
+
ruleIndex,
|
|
15409
|
+
groupId
|
|
15410
|
+
});
|
|
15411
|
+
}
|
|
15387
15412
|
}, {
|
|
15388
15413
|
name: "Move Down",
|
|
15389
15414
|
icon: /*#__PURE__*/jsx(KeyboardArrowDownIcon, {}),
|
|
15390
|
-
onClick: () => {
|
|
15415
|
+
onClick: () => {
|
|
15416
|
+
onRuleMoveDown({
|
|
15417
|
+
ruleId,
|
|
15418
|
+
index,
|
|
15419
|
+
ruleIndex,
|
|
15420
|
+
groupId
|
|
15421
|
+
});
|
|
15422
|
+
}
|
|
15391
15423
|
}, {
|
|
15392
15424
|
name: "Add Rule Below",
|
|
15393
15425
|
icon: /*#__PURE__*/jsx(AddIcon, {}),
|
|
15394
|
-
onClick: () => {
|
|
15426
|
+
onClick: () => {
|
|
15427
|
+
onCreateRuleBelow({
|
|
15428
|
+
ruleId,
|
|
15429
|
+
index,
|
|
15430
|
+
ruleIndex,
|
|
15431
|
+
groupId
|
|
15432
|
+
});
|
|
15433
|
+
}
|
|
15395
15434
|
}, {
|
|
15396
15435
|
name: "Delete",
|
|
15397
15436
|
icon: /*#__PURE__*/jsx(DeleteOutlineOutlinedIcon, {}),
|
|
@@ -15572,12 +15611,17 @@ const TextBuilder = /*#__PURE__*/memo(({
|
|
|
15572
15611
|
|
|
15573
15612
|
// TODO: change rows => RuleGroups
|
|
15574
15613
|
const [rows, setRows] = useState(_value);
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
useEffect(() => {
|
|
15614
|
+
|
|
15615
|
+
// TODO: think on better implementation
|
|
15616
|
+
useSkipOnMount(() => {
|
|
15579
15617
|
_onChange(rows);
|
|
15580
15618
|
}, [rows]);
|
|
15619
|
+
const setMutatableRows = useCallback(setterFn => {
|
|
15620
|
+
setRows(rows => {
|
|
15621
|
+
const res = produce(rows, setterFn);
|
|
15622
|
+
return res;
|
|
15623
|
+
});
|
|
15624
|
+
}, []);
|
|
15581
15625
|
const handleAddGroup = () => {
|
|
15582
15626
|
// TODO use setMutatableRows
|
|
15583
15627
|
setRows([...rows, {
|
|
@@ -15596,20 +15640,48 @@ const TextBuilder = /*#__PURE__*/memo(({
|
|
|
15596
15640
|
};
|
|
15597
15641
|
const handleRuleDelete = ({
|
|
15598
15642
|
index,
|
|
15599
|
-
ruleIndex,
|
|
15600
|
-
groupId,
|
|
15601
15643
|
ruleId
|
|
15602
15644
|
}) => {
|
|
15603
15645
|
setMutatableRows(groups => {
|
|
15604
15646
|
groups[index].rules = groups[index].rules.filter(rule => rule.id !== ruleId);
|
|
15605
15647
|
});
|
|
15606
15648
|
};
|
|
15649
|
+
const handleRuleMoveUp = ({
|
|
15650
|
+
index,
|
|
15651
|
+
ruleIndex
|
|
15652
|
+
}) => {
|
|
15653
|
+
setMutatableRows(groups => {
|
|
15654
|
+
if (ruleIndex === 0) return;
|
|
15655
|
+
const nextRow = ruleIndex - 1 ;
|
|
15656
|
+
[groups[index].rules[ruleIndex], groups[index].rules[nextRow]] = [groups[index].rules[nextRow], groups[index].rules[ruleIndex]];
|
|
15657
|
+
});
|
|
15658
|
+
};
|
|
15659
|
+
const handleRuleMoveDown = ({
|
|
15660
|
+
index,
|
|
15661
|
+
ruleIndex
|
|
15662
|
+
}) => {
|
|
15663
|
+
setMutatableRows(groups => {
|
|
15664
|
+
if (groups[index].rules.length - 1 === ruleIndex) return;
|
|
15665
|
+
const nextRow = ruleIndex + 1;
|
|
15666
|
+
[groups[index].rules[ruleIndex], groups[index].rules[nextRow]] = [groups[index].rules[nextRow], groups[index].rules[ruleIndex]];
|
|
15667
|
+
});
|
|
15668
|
+
};
|
|
15669
|
+
const handleCreateRuleBelow = ({
|
|
15670
|
+
index,
|
|
15671
|
+
ruleIndex,
|
|
15672
|
+
templateCode
|
|
15673
|
+
}) => {
|
|
15674
|
+
setMutatableRows(groups => {
|
|
15675
|
+
const newRule = _extends({
|
|
15676
|
+
id: v4()
|
|
15677
|
+
}, defaultRule);
|
|
15678
|
+
groups[index].rules = [...groups[index].rules.slice(0, ruleIndex + 1), newRule, ...groups[index].rules.slice(ruleIndex + 1)];
|
|
15679
|
+
});
|
|
15680
|
+
};
|
|
15607
15681
|
|
|
15608
15682
|
// TODO change name
|
|
15609
15683
|
const handleRuleTemplateSelect = ({
|
|
15610
|
-
groupId,
|
|
15611
15684
|
index,
|
|
15612
|
-
ruleId,
|
|
15613
15685
|
ruleIndex,
|
|
15614
15686
|
templateCode
|
|
15615
15687
|
}) => {
|
|
@@ -15623,19 +15695,14 @@ const TextBuilder = /*#__PURE__*/memo(({
|
|
|
15623
15695
|
value,
|
|
15624
15696
|
template,
|
|
15625
15697
|
groupId,
|
|
15626
|
-
|
|
15627
|
-
ruleId,
|
|
15628
|
-
ruleIndex
|
|
15698
|
+
ruleId
|
|
15629
15699
|
}) => {
|
|
15630
15700
|
setMutatableRows(groups => {
|
|
15631
15701
|
const rule = groups.find(group => group.groupId === groupId).rules.find(rule => rule.id === ruleId);
|
|
15632
15702
|
rule.value = value;
|
|
15633
15703
|
rule.template = template;
|
|
15634
|
-
// groups[index].rules[ruleIndex].value = value;
|
|
15635
|
-
// groups[index].rules[ruleIndex].template = template;
|
|
15636
15704
|
});
|
|
15637
15705
|
};
|
|
15638
|
-
|
|
15639
15706
|
const moveGroupPosition = ({
|
|
15640
15707
|
index
|
|
15641
15708
|
}, isUp) => {
|
|
@@ -15647,7 +15714,6 @@ const TextBuilder = /*#__PURE__*/memo(({
|
|
|
15647
15714
|
const handleAddRule = ({
|
|
15648
15715
|
groupId
|
|
15649
15716
|
}) => {
|
|
15650
|
-
// TODO use setMutatableRows
|
|
15651
15717
|
const newRules = rows.map(row => {
|
|
15652
15718
|
if (row.groupId !== groupId) return row;
|
|
15653
15719
|
return _extends({}, row, {
|
|
@@ -15698,6 +15764,9 @@ const TextBuilder = /*#__PURE__*/memo(({
|
|
|
15698
15764
|
templateOptions: templateOptions,
|
|
15699
15765
|
templateInputMap: templateInputMap,
|
|
15700
15766
|
onRuleDelete: handleRuleDelete,
|
|
15767
|
+
onRuleMoveUp: handleRuleMoveUp,
|
|
15768
|
+
onRuleMoveDown: handleRuleMoveDown,
|
|
15769
|
+
onCreateRuleBelow: handleCreateRuleBelow,
|
|
15701
15770
|
onTemplateSelect: handleRuleTemplateSelect,
|
|
15702
15771
|
onTemplateValueChange: handleRuleTemplateValueChange
|
|
15703
15772
|
}), /*#__PURE__*/jsx(RuleGroupFooter, {
|