@sis-cc/dotstatsuite-visions 6.6.0 → 6.6.4
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/es/Alert/Alert.js +135 -66
- package/es/Alert/index.js +1 -0
- package/es/ApiQueries/ApiQueries.js +79 -45
- package/es/ApiQueries/Query.js +105 -65
- package/es/ApiQueries/index.js +1 -0
- package/es/AuthDialog/index.js +103 -62
- package/es/Breadcrumbs/Breadcrumbs.js +38 -21
- package/es/Breadcrumbs/index.js +1 -0
- package/es/Button/Button.js +28 -11
- package/es/Button/index.js +1 -0
- package/es/ChartsConfig/Axis.js +76 -72
- package/es/ChartsConfig/ButtonGroup.js +51 -29
- package/es/ChartsConfig/ChartsConfig.js +187 -87
- package/es/ChartsConfig/ContainerTitle.js +36 -15
- package/es/ChartsConfig/Focus.js +48 -37
- package/es/ChartsConfig/Frequency.js +36 -24
- package/es/ChartsConfig/Series.js +43 -28
- package/es/ChartsConfig/Size.js +50 -36
- package/es/ChartsConfig/index.js +1 -0
- package/es/ChartsConfig/styles.js +4 -4
- package/es/ChartsConfig/utils.js +5 -1
- package/es/Chips/Chips.js +154 -99
- package/es/Chips/index.js +1 -0
- package/es/CollapseButtons/CollapseButtons.js +101 -61
- package/es/CollapseButtons/Item.js +70 -45
- package/es/CollapseButtons/Paper.js +21 -7
- package/es/CollapseButtons/index.js +1 -0
- package/es/DataEdit/DataEdit.js +124 -67
- package/es/DataEdit/Input.js +58 -27
- package/es/DataEdit/index.js +1 -0
- package/es/DataFooter/DataFooter.js +115 -68
- package/es/DataFooter/index.js +1 -0
- package/es/DataHeader/DataHeader.js +113 -75
- package/es/DataHeader/Flags.js +21 -8
- package/es/DataHeader/Title.js +15 -2
- package/es/DataHeader/TooltipHeader.js +63 -33
- package/es/DataHeader/index.js +1 -0
- package/es/DataHeader/utils.js +8 -8
- package/es/Dataflow/Dataflow.js +226 -132
- package/es/Dataflow/index.js +1 -0
- package/es/ExpansionPanel/ExpansionPanel.js +79 -42
- package/es/ExpansionPanel/index.js +1 -0
- package/es/ExpansionPanel/styles.js +5 -3
- package/es/Icons/AccessibilityFilled.js +8 -6
- package/es/Icons/AccessibilityOutlined.js +8 -6
- package/es/Icons/AccountFilled.js +8 -6
- package/es/Icons/AccountOutlined.js +8 -6
- package/es/Icons/Api.js +8 -6
- package/es/Icons/Asterisk.js +8 -6
- package/es/Icons/Bar.js +8 -6
- package/es/Icons/CopyContent.js +8 -6
- package/es/Icons/Cross.js +8 -6
- package/es/Icons/HSymbol.js +8 -6
- package/es/Icons/Row.js +8 -6
- package/es/Icons/Scatter.js +8 -6
- package/es/Icons/StackedBar.js +8 -6
- package/es/Icons/StackedRow.js +8 -6
- package/es/Icons/Timeline.js +8 -6
- package/es/Icons/VSymbol.js +8 -6
- package/es/Icons/Warning.js +14 -11
- package/es/Icons/index.js +1 -0
- package/es/Input/Input.js +56 -26
- package/es/Input/index.js +1 -0
- package/es/Input/with-input.js +25 -30
- package/es/InputNumber/InputNumber.js +51 -31
- package/es/InputNumber/index.js +1 -0
- package/es/LabelDivider/LabelDivider.js +18 -7
- package/es/LabelDivider/index.js +1 -0
- package/es/Loading/Loading.js +18 -9
- package/es/Loading/index.js +1 -0
- package/es/Logo/Logo.js +17 -11
- package/es/Logo/index.js +1 -0
- package/es/NoData/NoData.js +25 -17
- package/es/NoData/index.js +1 -0
- package/es/Pagination/Pagination.js +114 -70
- package/es/Pagination/index.js +1 -0
- package/es/PeriodPicker/PeriodPicker.js +124 -101
- package/es/PeriodPicker/constants.js +13 -78
- package/es/PeriodPicker/index.js +1 -0
- package/es/PeriodPicker/lib.js +23 -37
- package/es/PeriodPicker/styles.js +1 -0
- package/es/ScopeList/Header.js +60 -41
- package/es/ScopeList/Item.js +144 -98
- package/es/ScopeList/ScopeList.js +184 -132
- package/es/ScopeList/Selection.js +93 -51
- package/es/ScopeList/index.js +1 -0
- package/es/ScopeList/styles.js +3 -2
- package/es/ScopeList/with-scope-list.js +88 -151
- package/es/Select/Select.js +60 -44
- package/es/Select/index.js +1 -0
- package/es/Share/Form.js +88 -58
- package/es/Share/Mode.js +98 -36
- package/es/Share/Share.js +64 -41
- package/es/Share/index.js +10 -1
- package/es/SisccFooter/SisccFooter.js +36 -29
- package/es/SisccFooter/index.js +1 -0
- package/es/Spotlight/Fields.js +71 -37
- package/es/Spotlight/Spotlight.js +92 -51
- package/es/Spotlight/index.js +1 -0
- package/es/Spotlight/useSpotlight.js +13 -33
- package/es/Spotlight/useStyles.js +4 -2
- package/es/Table/Table.js +71 -50
- package/es/Table/header.js +50 -36
- package/es/Table/index.js +1 -0
- package/es/Table/itemCell.js +25 -13
- package/es/Table/row-header.js +50 -31
- package/es/Table/section-header.js +55 -30
- package/es/Table/section-rows.js +62 -38
- package/es/Table/styles.js +8 -2
- package/es/Table/tableCell.js +17 -7
- package/es/Table/tooltip.js +41 -21
- package/es/Table/useStyles.js +3 -2
- package/es/Table/valueCell.js +41 -26
- package/es/TableFooter/TableFooter.js +70 -42
- package/es/TableFooter/index.js +1 -0
- package/es/TableHeader/TableHeader.js +36 -18
- package/es/TableHeader/index.js +1 -0
- package/es/TableHtml5/TableHtml5.js +72 -60
- package/es/TableHtml5/cell.js +55 -35
- package/es/TableHtml5/flags.js +58 -29
- package/es/TableHtml5/header.js +85 -53
- package/es/TableHtml5/index.js +1 -0
- package/es/TableHtml5/section.js +131 -86
- package/es/TableHtml5/sectionHeader.js +72 -45
- package/es/TableHtml5/subHeader.js +70 -47
- package/es/TableLayout/Box.js +66 -33
- package/es/TableLayout/DnDItem.js +68 -37
- package/es/TableLayout/TableLayout.js +177 -105
- package/es/TableLayout/constants.js +2 -0
- package/es/TableLayout/index.js +1 -0
- package/es/TableLayout/lib.js +3 -1
- package/es/TablePreview/TablePreview.js +176 -99
- package/es/TablePreview/index.js +1 -0
- package/es/TablePreview/lib.js +4 -5
- package/es/TablePreview/styles.js +1 -0
- package/es/Tag/Tag.js +21 -5
- package/es/Tag/index.js +1 -0
- package/es/ToggleButton/ToggleButton.js +29 -17
- package/es/ToggleButton/index.js +1 -0
- package/es/Tooltip/Tooltip.js +32 -20
- package/es/Tooltip/index.js +1 -0
- package/es/VerticalButton/VerticalButton.js +22 -17
- package/es/VerticalButton/index.js +1 -0
- package/es/index.js +4 -2
- package/es/theme.js +14 -22
- package/es/utils.js +14 -16
- package/lib/Alert/Alert.js +168 -87
- package/lib/Alert/index.js +12 -7
- package/lib/ApiQueries/ApiQueries.js +105 -61
- package/lib/ApiQueries/Query.js +132 -85
- package/lib/ApiQueries/index.js +12 -7
- package/lib/AuthDialog/index.js +137 -82
- package/lib/Breadcrumbs/Breadcrumbs.js +68 -39
- package/lib/Breadcrumbs/index.js +12 -7
- package/lib/Button/Button.js +47 -28
- package/lib/Button/index.js +12 -7
- package/lib/ChartsConfig/Axis.js +100 -88
- package/lib/ChartsConfig/ButtonGroup.js +74 -43
- package/lib/ChartsConfig/ChartsConfig.js +236 -113
- package/lib/ChartsConfig/ContainerTitle.js +59 -30
- package/lib/ChartsConfig/Focus.js +71 -53
- package/lib/ChartsConfig/Frequency.js +59 -39
- package/lib/ChartsConfig/Series.js +70 -45
- package/lib/ChartsConfig/Size.js +77 -53
- package/lib/ChartsConfig/index.js +12 -7
- package/lib/ChartsConfig/styles.js +11 -16
- package/lib/ChartsConfig/utils.js +13 -14
- package/lib/Chips/Chips.js +192 -122
- package/lib/Chips/index.js +12 -7
- package/lib/CollapseButtons/CollapseButtons.js +134 -84
- package/lib/CollapseButtons/Item.js +98 -64
- package/lib/CollapseButtons/Paper.js +41 -19
- package/lib/CollapseButtons/index.js +12 -7
- package/lib/DataEdit/DataEdit.js +156 -88
- package/lib/DataEdit/Input.js +82 -42
- package/lib/DataEdit/index.js +12 -7
- package/lib/DataFooter/DataFooter.js +144 -88
- package/lib/DataFooter/index.js +12 -7
- package/lib/DataHeader/DataHeader.js +158 -106
- package/lib/DataHeader/Flags.js +34 -18
- package/lib/DataHeader/Title.js +27 -11
- package/lib/DataHeader/TooltipHeader.js +79 -48
- package/lib/DataHeader/index.js +12 -7
- package/lib/DataHeader/utils.js +10 -16
- package/lib/Dataflow/Dataflow.js +277 -159
- package/lib/Dataflow/index.js +12 -7
- package/lib/ExpansionPanel/ExpansionPanel.js +116 -63
- package/lib/ExpansionPanel/index.js +12 -7
- package/lib/ExpansionPanel/styles.js +12 -15
- package/lib/Icons/AccessibilityFilled.js +17 -15
- package/lib/Icons/AccessibilityOutlined.js +17 -15
- package/lib/Icons/AccountFilled.js +17 -15
- package/lib/Icons/AccountOutlined.js +17 -15
- package/lib/Icons/Api.js +17 -15
- package/lib/Icons/Asterisk.js +17 -15
- package/lib/Icons/Bar.js +17 -15
- package/lib/Icons/CopyContent.js +17 -15
- package/lib/Icons/Cross.js +17 -15
- package/lib/Icons/HSymbol.js +17 -15
- package/lib/Icons/Row.js +17 -15
- package/lib/Icons/Scatter.js +17 -15
- package/lib/Icons/StackedBar.js +17 -15
- package/lib/Icons/StackedRow.js +17 -15
- package/lib/Icons/Timeline.js +17 -15
- package/lib/Icons/VSymbol.js +17 -15
- package/lib/Icons/Warning.js +31 -27
- package/lib/Icons/index.js +152 -68
- package/lib/Input/Input.js +85 -47
- package/lib/Input/index.js +12 -7
- package/lib/Input/with-input.js +35 -38
- package/lib/InputNumber/InputNumber.js +80 -50
- package/lib/InputNumber/index.js +12 -7
- package/lib/LabelDivider/LabelDivider.js +37 -23
- package/lib/LabelDivider/index.js +12 -7
- package/lib/Loading/Loading.js +35 -20
- package/lib/Loading/index.js +12 -7
- package/lib/Logo/Logo.js +28 -20
- package/lib/Logo/index.js +12 -7
- package/lib/NoData/NoData.js +42 -28
- package/lib/NoData/index.js +12 -7
- package/lib/Pagination/Pagination.js +150 -91
- package/lib/Pagination/index.js +12 -7
- package/lib/PeriodPicker/PeriodPicker.js +150 -121
- package/lib/PeriodPicker/constants.js +37 -126
- package/lib/PeriodPicker/index.js +12 -7
- package/lib/PeriodPicker/lib.js +61 -99
- package/lib/PeriodPicker/styles.js +4 -7
- package/lib/ScopeList/Header.js +88 -58
- package/lib/ScopeList/Item.js +177 -116
- package/lib/ScopeList/ScopeList.js +234 -160
- package/lib/ScopeList/Selection.js +131 -70
- package/lib/ScopeList/index.js +12 -7
- package/lib/ScopeList/styles.js +9 -10
- package/lib/ScopeList/with-scope-list.js +108 -199
- package/lib/Select/Select.js +80 -59
- package/lib/Select/index.js +12 -7
- package/lib/Share/Form.js +119 -77
- package/lib/Share/Mode.js +130 -54
- package/lib/Share/Share.js +91 -59
- package/lib/Share/index.js +12 -7
- package/lib/SisccFooter/SisccFooter.js +63 -44
- package/lib/SisccFooter/index.js +12 -7
- package/lib/Spotlight/Fields.js +100 -54
- package/lib/Spotlight/Spotlight.js +136 -75
- package/lib/Spotlight/index.js +12 -7
- package/lib/Spotlight/useSpotlight.js +20 -44
- package/lib/Spotlight/useStyles.js +12 -15
- package/lib/Table/Table.js +102 -69
- package/lib/Table/header.js +70 -51
- package/lib/Table/index.js +12 -7
- package/lib/Table/itemCell.js +41 -25
- package/lib/Table/row-header.js +75 -49
- package/lib/Table/section-header.js +82 -50
- package/lib/Table/section-rows.js +94 -60
- package/lib/Table/styles.js +25 -23
- package/lib/Table/tableCell.js +37 -19
- package/lib/Table/tooltip.js +54 -36
- package/lib/Table/useStyles.js +8 -11
- package/lib/Table/valueCell.js +59 -39
- package/lib/TableFooter/TableFooter.js +93 -57
- package/lib/TableFooter/index.js +12 -7
- package/lib/TableHeader/TableHeader.js +56 -32
- package/lib/TableHeader/index.js +12 -7
- package/lib/TableHtml5/TableHtml5.js +100 -78
- package/lib/TableHtml5/cell.js +84 -52
- package/lib/TableHtml5/flags.js +82 -48
- package/lib/TableHtml5/header.js +115 -70
- package/lib/TableHtml5/index.js +17 -8
- package/lib/TableHtml5/section.js +171 -109
- package/lib/TableHtml5/sectionHeader.js +102 -64
- package/lib/TableHtml5/subHeader.js +98 -65
- package/lib/TableLayout/Box.js +97 -54
- package/lib/TableLayout/DnDItem.js +98 -58
- package/lib/TableLayout/TableLayout.js +232 -140
- package/lib/TableLayout/constants.js +6 -8
- package/lib/TableLayout/index.js +12 -7
- package/lib/TableLayout/lib.js +9 -14
- package/lib/TablePreview/TablePreview.js +205 -118
- package/lib/TablePreview/index.js +12 -7
- package/lib/TablePreview/lib.js +19 -30
- package/lib/TablePreview/styles.js +6 -7
- package/lib/Tag/Tag.js +38 -19
- package/lib/Tag/index.js +12 -7
- package/lib/ToggleButton/ToggleButton.js +55 -33
- package/lib/ToggleButton/index.js +12 -7
- package/lib/Tooltip/Tooltip.js +50 -34
- package/lib/Tooltip/index.js +12 -7
- package/lib/VerticalButton/VerticalButton.js +46 -40
- package/lib/VerticalButton/index.js +12 -7
- package/lib/index.js +304 -137
- package/lib/theme.js +17 -31
- package/lib/utils.js +31 -46
- package/package.json +10 -2
package/es/Alert/Alert.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
var _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; };
|
|
2
|
+
|
|
3
|
+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
4
|
+
|
|
4
5
|
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
5
7
|
import clsx from 'clsx';
|
|
6
8
|
import { withStyles, lighten, darken } from '@material-ui/core/styles';
|
|
7
9
|
import Paper from '@material-ui/core/Paper';
|
|
@@ -12,9 +14,11 @@ import InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';
|
|
|
12
14
|
import CloseIcon from '@material-ui/icons/Close';
|
|
13
15
|
import IconButton from '@material-ui/core/IconButton';
|
|
14
16
|
import { capitalize } from '@material-ui/core/utils';
|
|
17
|
+
|
|
15
18
|
export var styles = function styles(theme) {
|
|
16
19
|
var getColor = theme.palette.type === 'light' ? darken : lighten;
|
|
17
20
|
var getBackgroundColor = theme.palette.type === 'light' ? lighten : darken;
|
|
21
|
+
|
|
18
22
|
return {
|
|
19
23
|
/* Styles applied to the root element. */
|
|
20
24
|
root: _extends({}, theme.typography.body2, {
|
|
@@ -23,7 +27,6 @@ export var styles = function styles(theme) {
|
|
|
23
27
|
display: 'flex',
|
|
24
28
|
padding: '6px 16px'
|
|
25
29
|
}),
|
|
26
|
-
|
|
27
30
|
/* Styles applied to the root element if `variant="standard"` and `color="success"`. */
|
|
28
31
|
standardSuccess: {
|
|
29
32
|
color: getColor(theme.palette.success.main, 0.6),
|
|
@@ -32,7 +35,6 @@ export var styles = function styles(theme) {
|
|
|
32
35
|
color: theme.palette.success.main
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
|
-
|
|
36
38
|
/* Styles applied to the root element if `variant="standard"` and `color="info"`. */
|
|
37
39
|
standardInfo: {
|
|
38
40
|
color: getColor(theme.palette.info.main, 0.6),
|
|
@@ -41,7 +43,6 @@ export var styles = function styles(theme) {
|
|
|
41
43
|
color: theme.palette.info.main
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
|
-
|
|
45
46
|
/* Styles applied to the root element if `variant="standard"` and `color="warning"`. */
|
|
46
47
|
standardWarning: {
|
|
47
48
|
color: getColor(theme.palette.warning.main, 0.6),
|
|
@@ -50,7 +51,6 @@ export var styles = function styles(theme) {
|
|
|
50
51
|
color: theme.palette.warning.main
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
|
-
|
|
54
54
|
/* Styles applied to the root element if `variant="standard"` and `color="error"`. */
|
|
55
55
|
standardError: {
|
|
56
56
|
color: getColor(theme.palette.error.main, 0.6),
|
|
@@ -59,71 +59,62 @@ export var styles = function styles(theme) {
|
|
|
59
59
|
color: theme.palette.error.main
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
|
|
63
62
|
/* Styles applied to the root element if `variant="outlined"` and `color="success"`. */
|
|
64
63
|
outlinedSuccess: {
|
|
65
64
|
color: getColor(theme.palette.success.main, 0.6),
|
|
66
|
-
border:
|
|
65
|
+
border: '1px solid ' + theme.palette.success.main,
|
|
67
66
|
'& $icon': {
|
|
68
67
|
color: theme.palette.success.main
|
|
69
68
|
}
|
|
70
69
|
},
|
|
71
|
-
|
|
72
70
|
/* Styles applied to the root element if `variant="outlined"` and `color="info"`. */
|
|
73
71
|
outlinedInfo: {
|
|
74
72
|
color: getColor(theme.palette.info.main, 0.6),
|
|
75
|
-
border:
|
|
73
|
+
border: '1px solid ' + theme.palette.info.main,
|
|
76
74
|
'& $icon': {
|
|
77
75
|
color: theme.palette.info.main
|
|
78
76
|
}
|
|
79
77
|
},
|
|
80
|
-
|
|
81
78
|
/* Styles applied to the root element if `variant="outlined"` and `color="warning"`. */
|
|
82
79
|
outlinedWarning: {
|
|
83
80
|
color: getColor(theme.palette.warning.main, 0.6),
|
|
84
|
-
border:
|
|
81
|
+
border: '1px solid ' + theme.palette.warning.main,
|
|
85
82
|
'& $icon': {
|
|
86
83
|
color: theme.palette.warning.main
|
|
87
84
|
}
|
|
88
85
|
},
|
|
89
|
-
|
|
90
86
|
/* Styles applied to the root element if `variant="outlined"` and `color="error"`. */
|
|
91
87
|
outlinedError: {
|
|
92
88
|
color: getColor(theme.palette.error.main, 0.6),
|
|
93
|
-
border:
|
|
89
|
+
border: '1px solid ' + theme.palette.error.main,
|
|
94
90
|
'& $icon': {
|
|
95
91
|
color: theme.palette.error.main
|
|
96
92
|
}
|
|
97
93
|
},
|
|
98
|
-
|
|
99
94
|
/* Styles applied to the root element if `variant="filled"` and `color="success"`. */
|
|
100
95
|
filledSuccess: {
|
|
101
96
|
color: '#fff',
|
|
102
97
|
fontWeight: theme.typography.fontWeightMedium,
|
|
103
98
|
backgroundColor: theme.palette.success.main
|
|
104
99
|
},
|
|
105
|
-
|
|
106
100
|
/* Styles applied to the root element if `variant="filled"` and `color="info"`. */
|
|
107
101
|
filledInfo: {
|
|
108
102
|
color: '#fff',
|
|
109
103
|
fontWeight: theme.typography.fontWeightMedium,
|
|
110
104
|
backgroundColor: theme.palette.info.main
|
|
111
105
|
},
|
|
112
|
-
|
|
113
106
|
/* Styles applied to the root element if `variant="filled"` and `color="warning"`. */
|
|
114
107
|
filledWarning: {
|
|
115
108
|
color: '#fff',
|
|
116
109
|
fontWeight: theme.typography.fontWeightMedium,
|
|
117
110
|
backgroundColor: theme.palette.warning.main
|
|
118
111
|
},
|
|
119
|
-
|
|
120
112
|
/* Styles applied to the root element if `variant="filled"` and `color="error"`. */
|
|
121
113
|
filledError: {
|
|
122
114
|
color: '#fff',
|
|
123
115
|
fontWeight: theme.typography.fontWeightMedium,
|
|
124
116
|
backgroundColor: theme.palette.error.main
|
|
125
117
|
},
|
|
126
|
-
|
|
127
118
|
/* Styles applied to the icon wrapper element. */
|
|
128
119
|
icon: {
|
|
129
120
|
marginRight: 12,
|
|
@@ -132,7 +123,6 @@ export var styles = function styles(theme) {
|
|
|
132
123
|
fontSize: 22,
|
|
133
124
|
opacity: 0.9
|
|
134
125
|
},
|
|
135
|
-
|
|
136
126
|
/* Styles applied to the message wrapper element. */
|
|
137
127
|
message: {
|
|
138
128
|
padding: '8px 0',
|
|
@@ -140,7 +130,6 @@ export var styles = function styles(theme) {
|
|
|
140
130
|
flexDirection: 'column',
|
|
141
131
|
justifyContent: 'center'
|
|
142
132
|
},
|
|
143
|
-
|
|
144
133
|
/* Styles applied to the action wrapper element if `action` is provided. */
|
|
145
134
|
action: {
|
|
146
135
|
display: 'flex',
|
|
@@ -151,64 +140,144 @@ export var styles = function styles(theme) {
|
|
|
151
140
|
}
|
|
152
141
|
};
|
|
153
142
|
};
|
|
143
|
+
|
|
154
144
|
var defaultIconMapping = {
|
|
155
|
-
success:
|
|
156
|
-
|
|
157
|
-
}),
|
|
158
|
-
|
|
159
|
-
fontSize: "inherit"
|
|
160
|
-
}),
|
|
161
|
-
error: /*#__PURE__*/React.createElement(ErrorOutlineIcon, {
|
|
162
|
-
fontSize: "inherit"
|
|
163
|
-
}),
|
|
164
|
-
info: /*#__PURE__*/React.createElement(InfoOutlinedIcon, {
|
|
165
|
-
fontSize: "inherit"
|
|
166
|
-
})
|
|
145
|
+
success: React.createElement(SuccessOutlinedIcon, { fontSize: 'inherit' }),
|
|
146
|
+
warning: React.createElement(ReportProblemOutlinedIcon, { fontSize: 'inherit' }),
|
|
147
|
+
error: React.createElement(ErrorOutlineIcon, { fontSize: 'inherit' }),
|
|
148
|
+
info: React.createElement(InfoOutlinedIcon, { fontSize: 'inherit' })
|
|
167
149
|
};
|
|
150
|
+
|
|
168
151
|
var Alert = React.forwardRef(function Alert(props, ref) {
|
|
169
152
|
var action = props.action,
|
|
170
153
|
children = props.children,
|
|
171
154
|
classes = props.classes,
|
|
172
155
|
className = props.className,
|
|
173
156
|
_props$closeText = props.closeText,
|
|
174
|
-
closeText = _props$closeText ===
|
|
157
|
+
closeText = _props$closeText === undefined ? 'Close' : _props$closeText,
|
|
175
158
|
color = props.color,
|
|
176
159
|
icon = props.icon,
|
|
177
160
|
_props$iconMapping = props.iconMapping,
|
|
178
|
-
iconMapping = _props$iconMapping ===
|
|
161
|
+
iconMapping = _props$iconMapping === undefined ? defaultIconMapping : _props$iconMapping,
|
|
179
162
|
onClose = props.onClose,
|
|
180
163
|
_props$role = props.role,
|
|
181
|
-
role = _props$role ===
|
|
164
|
+
role = _props$role === undefined ? 'alert' : _props$role,
|
|
182
165
|
_props$severity = props.severity,
|
|
183
|
-
severity = _props$severity ===
|
|
166
|
+
severity = _props$severity === undefined ? 'success' : _props$severity,
|
|
184
167
|
_props$variant = props.variant,
|
|
185
|
-
variant = _props$variant ===
|
|
186
|
-
other =
|
|
168
|
+
variant = _props$variant === undefined ? 'standard' : _props$variant,
|
|
169
|
+
other = _objectWithoutProperties(props, ['action', 'children', 'classes', 'className', 'closeText', 'color', 'icon', 'iconMapping', 'onClose', 'role', 'severity', 'variant']);
|
|
187
170
|
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
171
|
+
return React.createElement(
|
|
172
|
+
Paper,
|
|
173
|
+
_extends({
|
|
174
|
+
role: role,
|
|
175
|
+
square: true,
|
|
176
|
+
elevation: 0,
|
|
177
|
+
className: clsx(classes.root, classes['' + variant + capitalize(color || severity)], className),
|
|
178
|
+
ref: ref
|
|
179
|
+
}, other),
|
|
180
|
+
icon !== false ? React.createElement(
|
|
181
|
+
'div',
|
|
182
|
+
{ className: classes.icon },
|
|
183
|
+
icon || iconMapping[severity] || defaultIconMapping[severity]
|
|
184
|
+
) : null,
|
|
185
|
+
React.createElement(
|
|
186
|
+
'div',
|
|
187
|
+
{ className: classes.message },
|
|
188
|
+
children
|
|
189
|
+
),
|
|
190
|
+
action != null ? React.createElement(
|
|
191
|
+
'div',
|
|
192
|
+
{ className: classes.action },
|
|
193
|
+
action
|
|
194
|
+
) : null,
|
|
195
|
+
action == null && onClose ? React.createElement(
|
|
196
|
+
'div',
|
|
197
|
+
{ className: classes.action },
|
|
198
|
+
React.createElement(
|
|
199
|
+
IconButton,
|
|
200
|
+
{
|
|
201
|
+
size: 'small',
|
|
202
|
+
'aria-label': closeText,
|
|
203
|
+
title: closeText,
|
|
204
|
+
color: 'inherit',
|
|
205
|
+
onClick: onClose
|
|
206
|
+
},
|
|
207
|
+
React.createElement(CloseIcon, { fontSize: 'small' })
|
|
208
|
+
)
|
|
209
|
+
) : null
|
|
210
|
+
);
|
|
211
211
|
});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
|
|
213
|
+
Alert.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
214
|
+
// ----------------------------- Warning --------------------------------
|
|
215
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
216
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
217
|
+
// ----------------------------------------------------------------------
|
|
218
|
+
/**
|
|
219
|
+
* The action to display. It renders after the message, at the end of the alert.
|
|
220
|
+
*/
|
|
221
|
+
action: PropTypes.node,
|
|
222
|
+
/**
|
|
223
|
+
* The content of the component.
|
|
224
|
+
*/
|
|
225
|
+
children: PropTypes.node,
|
|
226
|
+
/**
|
|
227
|
+
* Override or extend the styles applied to the component.
|
|
228
|
+
* See [CSS API](#css) below for more details.
|
|
229
|
+
*/
|
|
230
|
+
classes: PropTypes.object,
|
|
231
|
+
/**
|
|
232
|
+
* @ignore
|
|
233
|
+
*/
|
|
234
|
+
className: PropTypes.string,
|
|
235
|
+
/**
|
|
236
|
+
* Override the default label for the *close popup* icon button.
|
|
237
|
+
*
|
|
238
|
+
* For localization purposes, you can use the provided [translations](/guides/localization/).
|
|
239
|
+
*/
|
|
240
|
+
closeText: PropTypes.string,
|
|
241
|
+
/**
|
|
242
|
+
* The main color for the alert. Unless provided, the value is taken from the `severity` prop.
|
|
243
|
+
*/
|
|
244
|
+
color: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
|
|
245
|
+
/**
|
|
246
|
+
* Override the icon displayed before the children.
|
|
247
|
+
* Unless provided, the icon is mapped to the value of the `severity` prop.
|
|
248
|
+
*/
|
|
249
|
+
icon: PropTypes.node,
|
|
250
|
+
/**
|
|
251
|
+
* The component maps the `severity` prop to a range of different icons,
|
|
252
|
+
* for instance success to `<SuccessOutlined>`.
|
|
253
|
+
* If you wish to change this mapping, you can provide your own.
|
|
254
|
+
* Alternatively, you can use the `icon` prop to override the icon displayed.
|
|
255
|
+
*/
|
|
256
|
+
iconMapping: PropTypes.shape({
|
|
257
|
+
error: PropTypes.node,
|
|
258
|
+
info: PropTypes.node,
|
|
259
|
+
success: PropTypes.node,
|
|
260
|
+
warning: PropTypes.node
|
|
261
|
+
}),
|
|
262
|
+
/**
|
|
263
|
+
* Callback fired when the component requests to be closed.
|
|
264
|
+
* When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.
|
|
265
|
+
*
|
|
266
|
+
* @param {object} event The event source of the callback.
|
|
267
|
+
*/
|
|
268
|
+
onClose: PropTypes.func,
|
|
269
|
+
/**
|
|
270
|
+
* The ARIA role attribute of the element.
|
|
271
|
+
*/
|
|
272
|
+
role: PropTypes.string,
|
|
273
|
+
/**
|
|
274
|
+
* The severity of the alert. This defines the color and icon used.
|
|
275
|
+
*/
|
|
276
|
+
severity: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
|
|
277
|
+
/**
|
|
278
|
+
* The variant to use.
|
|
279
|
+
*/
|
|
280
|
+
variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])
|
|
281
|
+
} : {};
|
|
282
|
+
|
|
283
|
+
export default withStyles(styles, { name: 'MuiAlert' })(Alert);
|
package/es/Alert/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import * as R from 'ramda';
|
|
3
4
|
import Typography from '@material-ui/core/Typography';
|
|
4
5
|
import Divider from '@material-ui/core/Divider';
|
|
5
6
|
import Grid from '@material-ui/core/Grid';
|
|
6
7
|
import { makeStyles } from '@material-ui/core/styles';
|
|
7
8
|
import Query from './Query';
|
|
9
|
+
|
|
8
10
|
var useStyles = makeStyles(function (theme) {
|
|
9
11
|
return {
|
|
10
12
|
divider: {
|
|
@@ -16,55 +18,87 @@ var useStyles = makeStyles(function (theme) {
|
|
|
16
18
|
|
|
17
19
|
var ApiQueries = function ApiQueries(_ref) {
|
|
18
20
|
var _ref$queries = _ref.queries,
|
|
19
|
-
queries = _ref$queries ===
|
|
21
|
+
queries = _ref$queries === undefined ? [] : _ref$queries,
|
|
20
22
|
labels = _ref.labels,
|
|
21
23
|
_ref$delay = _ref.delay,
|
|
22
|
-
delay = _ref$delay ===
|
|
24
|
+
delay = _ref$delay === undefined ? 1000 : _ref$delay;
|
|
25
|
+
|
|
23
26
|
var classes = useStyles();
|
|
24
27
|
var hasQueries = R.not(R.isEmpty(queries));
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
28
|
+
return React.createElement(
|
|
29
|
+
Grid,
|
|
30
|
+
{ container: true, 'data-testid': 'apiqueries-test-id' },
|
|
31
|
+
React.createElement(
|
|
32
|
+
Grid,
|
|
33
|
+
{ item: true, xs: 12 },
|
|
34
|
+
React.createElement(
|
|
35
|
+
Typography,
|
|
36
|
+
{ className: classes.title, variant: 'h6' },
|
|
37
|
+
R.prop('title')(labels)
|
|
38
|
+
),
|
|
39
|
+
R.map(function (description) {
|
|
40
|
+
return React.createElement(
|
|
41
|
+
Typography,
|
|
42
|
+
{ key: description, display: 'block', variant: 'body2' },
|
|
43
|
+
description
|
|
44
|
+
);
|
|
45
|
+
})(R.propOr([], 'descriptions', labels))
|
|
46
|
+
),
|
|
47
|
+
hasQueries && React.createElement(
|
|
48
|
+
Grid,
|
|
49
|
+
{ item: true, xs: 12, className: classes.divider },
|
|
50
|
+
React.createElement(Divider, null)
|
|
51
|
+
),
|
|
52
|
+
React.createElement(
|
|
53
|
+
Grid,
|
|
54
|
+
{ item: true, container: true, spacing: 2 },
|
|
55
|
+
R.map(function (_ref2) {
|
|
56
|
+
var id = _ref2.id,
|
|
57
|
+
title = _ref2.title,
|
|
58
|
+
_ref2$contents = _ref2.contents,
|
|
59
|
+
contents = _ref2$contents === undefined ? [] : _ref2$contents;
|
|
60
|
+
return React.createElement(Query, {
|
|
61
|
+
key: id,
|
|
62
|
+
title: title,
|
|
63
|
+
contents: contents,
|
|
64
|
+
selectedId: R.pipe(R.head, R.prop('id'))(contents),
|
|
65
|
+
labels: labels,
|
|
66
|
+
delay: delay
|
|
67
|
+
});
|
|
68
|
+
})(queries)
|
|
69
|
+
),
|
|
70
|
+
hasQueries && React.createElement(
|
|
71
|
+
Grid,
|
|
72
|
+
{ item: true, xs: 12, className: classes.divider },
|
|
73
|
+
React.createElement(Divider, null)
|
|
74
|
+
),
|
|
75
|
+
React.createElement(
|
|
76
|
+
Typography,
|
|
77
|
+
{ variant: 'body2' },
|
|
78
|
+
R.prop('notice')(labels)
|
|
79
|
+
)
|
|
80
|
+
);
|
|
68
81
|
};
|
|
69
82
|
|
|
83
|
+
ApiQueries.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
84
|
+
labels: PropTypes.shape({
|
|
85
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
86
|
+
copy: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
87
|
+
copied: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
88
|
+
descriptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.element])),
|
|
89
|
+
notice: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
90
|
+
buttonsLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
91
|
+
}),
|
|
92
|
+
delay: PropTypes.number,
|
|
93
|
+
queries: PropTypes.arrayOf(PropTypes.shape({
|
|
94
|
+
contents: PropTypes.arrayOf(PropTypes.shape({
|
|
95
|
+
id: PropTypes.string,
|
|
96
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
97
|
+
value: PropTypes.string
|
|
98
|
+
})),
|
|
99
|
+
id: PropTypes.string,
|
|
100
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
101
|
+
}))
|
|
102
|
+
} : {};
|
|
103
|
+
|
|
70
104
|
export default ApiQueries;
|