@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
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
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
|
+
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
3
5
|
import * as R from 'ramda';
|
|
4
6
|
import useSize from '@react-hook/size';
|
|
5
7
|
import cx from 'classnames';
|
|
@@ -13,6 +15,7 @@ import Flags from './Flags';
|
|
|
13
15
|
import TooltipHeader from './TooltipHeader';
|
|
14
16
|
import { getReducedContent } from './utils';
|
|
15
17
|
import { Tooltip, Warning as WarningIcon } from '../';
|
|
18
|
+
|
|
16
19
|
var useStyles = makeStyles(function (theme) {
|
|
17
20
|
return {
|
|
18
21
|
header: {
|
|
@@ -98,9 +101,10 @@ var DataHeader = function DataHeader(_ref4) {
|
|
|
98
101
|
var children = _ref4.children,
|
|
99
102
|
title = _ref4.title,
|
|
100
103
|
_ref4$subtitle = _ref4.subtitle,
|
|
101
|
-
subtitle = _ref4$subtitle ===
|
|
104
|
+
subtitle = _ref4$subtitle === undefined ? [] : _ref4$subtitle,
|
|
102
105
|
uprs = _ref4.uprs,
|
|
103
106
|
disclaimer = _ref4.disclaimer;
|
|
107
|
+
|
|
104
108
|
var target = React.useRef(null);
|
|
105
109
|
|
|
106
110
|
var _useSize = useSize(target),
|
|
@@ -108,84 +112,118 @@ var DataHeader = function DataHeader(_ref4) {
|
|
|
108
112
|
|
|
109
113
|
var isWidthUp = R.gte(width);
|
|
110
114
|
var isWidthLess = R.lt(width);
|
|
111
|
-
var classes = useStyles({
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
isWidthLess: isWidthLess,
|
|
116
|
-
title: title,
|
|
117
|
-
subtitle: subtitle,
|
|
118
|
-
uprs: uprs,
|
|
119
|
-
disclaimer: disclaimer
|
|
120
|
-
});
|
|
115
|
+
var classes = useStyles({ isWidthLess: isWidthLess });
|
|
116
|
+
|
|
117
|
+
var reducedContent = getReducedContent({ isWidthLess: isWidthLess, title: title, subtitle: subtitle, uprs: uprs, disclaimer: disclaimer });
|
|
118
|
+
|
|
121
119
|
var theme = useTheme();
|
|
122
120
|
var iconColor = R.path(['mixins', 'dataHeader', 'icon', 'color'], theme);
|
|
123
121
|
var warningColor = R.path(['palette', 'highlight', 'hl1'], theme) || theme.palette.primary.dark;
|
|
124
122
|
var warningTextColor = theme.palette.getContrastText(warningColor);
|
|
123
|
+
|
|
125
124
|
var subtitleLength = R.length(subtitle);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
125
|
+
|
|
126
|
+
return React.createElement(
|
|
127
|
+
'div',
|
|
128
|
+
{ className: classes.header, ref: target },
|
|
129
|
+
React.createElement(
|
|
130
|
+
'div',
|
|
131
|
+
{ className: classes.container },
|
|
132
|
+
isWidthUp(T4_BREAKPOINTS.xs2) && title && React.createElement(
|
|
133
|
+
Typography,
|
|
134
|
+
{ variant: 'h1', className: classes.title },
|
|
135
|
+
title.label,
|
|
136
|
+
React.createElement(Flags, { classes: classes, content: R.propOr([], 'flags', title) }),
|
|
137
|
+
disclaimer && React.createElement(
|
|
138
|
+
Tooltip,
|
|
139
|
+
{
|
|
140
|
+
className: cx(classes.title, classes.disclaimer),
|
|
141
|
+
title: disclaimer,
|
|
142
|
+
tabIndex: 0,
|
|
143
|
+
variant: 'warning',
|
|
144
|
+
'aria-hidden': false,
|
|
145
|
+
placement: 'bottom',
|
|
146
|
+
PopperProps: {
|
|
147
|
+
modifiers: {
|
|
148
|
+
flip: {
|
|
149
|
+
behavior: ['bottom', 'top', 'left', 'right']
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
React.createElement(WarningIcon, { pathBackgroundColor: warningColor, pathColor: warningTextColor })
|
|
155
|
+
)
|
|
156
|
+
),
|
|
157
|
+
isWidthUp(T4_BREAKPOINTS.xs3) && subtitle && R.not(R.isEmpty(subtitle)) && React.createElement(
|
|
158
|
+
'div',
|
|
159
|
+
{ className: classes.wrapperSubtitle },
|
|
160
|
+
R.pipe(R.addIndex(R.map)(function (sub, index) {
|
|
161
|
+
return React.createElement(
|
|
162
|
+
'div',
|
|
163
|
+
{ key: 'subtitle-' + index, className: classes.subtitle },
|
|
164
|
+
React.createElement(Title, { header: sub.header }),
|
|
165
|
+
React.createElement(
|
|
166
|
+
Typography,
|
|
167
|
+
{ variant: 'inherit' },
|
|
168
|
+
sub.label
|
|
169
|
+
),
|
|
170
|
+
R.not(R.isEmpty(R.propOr([], 'flags', sub))) && React.createElement(Flags, { classes: classes, content: R.prop('flags', sub) }),
|
|
171
|
+
R.lt(index + 1, subtitleLength) && React.createElement(
|
|
172
|
+
'svg',
|
|
173
|
+
{ width: '24', height: '8' },
|
|
174
|
+
React.createElement('circle', { cx: '12', cy: '4', r: '3', stroke: iconColor, fill: iconColor })
|
|
175
|
+
)
|
|
176
|
+
);
|
|
177
|
+
}))(subtitle)
|
|
178
|
+
),
|
|
179
|
+
isWidthUp(T4_BREAKPOINTS.xs3) && uprs && React.createElement(
|
|
180
|
+
Typography,
|
|
181
|
+
{ className: classes.subtitle },
|
|
182
|
+
React.createElement(Title, { header: uprs.header }),
|
|
183
|
+
uprs.label
|
|
184
|
+
)
|
|
185
|
+
),
|
|
186
|
+
React.createElement(
|
|
187
|
+
'div',
|
|
188
|
+
{ className: classes.children },
|
|
189
|
+
R.not(R.isEmpty(reducedContent)) && React.createElement(
|
|
190
|
+
TooltipHeader,
|
|
191
|
+
{ classes: classes, content: reducedContent },
|
|
192
|
+
React.createElement(Info, { className: classes.infoIcon })
|
|
193
|
+
),
|
|
194
|
+
children
|
|
195
|
+
)
|
|
196
|
+
);
|
|
189
197
|
};
|
|
190
198
|
|
|
199
|
+
DataHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
200
|
+
title: PropTypes.shape({
|
|
201
|
+
label: PropTypes.string,
|
|
202
|
+
flags: PropTypes.arrayOf(PropTypes.shape({
|
|
203
|
+
header: PropTypes.string,
|
|
204
|
+
label: PropTypes.string,
|
|
205
|
+
sub: PropTypes.arrayOf(PropTypes.shape({
|
|
206
|
+
label: PropTypes.string
|
|
207
|
+
}))
|
|
208
|
+
}))
|
|
209
|
+
}),
|
|
210
|
+
subtitle: PropTypes.arrayOf(PropTypes.shape({
|
|
211
|
+
header: PropTypes.string,
|
|
212
|
+
label: PropTypes.string,
|
|
213
|
+
flags: PropTypes.arrayOf(PropTypes.shape({
|
|
214
|
+
header: PropTypes.string,
|
|
215
|
+
label: PropTypes.string,
|
|
216
|
+
sub: PropTypes.arrayOf(PropTypes.shape({
|
|
217
|
+
label: PropTypes.string
|
|
218
|
+
}))
|
|
219
|
+
}))
|
|
220
|
+
})),
|
|
221
|
+
uprs: PropTypes.shape({
|
|
222
|
+
header: PropTypes.string,
|
|
223
|
+
label: PropTypes.string
|
|
224
|
+
}),
|
|
225
|
+
disclaimer: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
226
|
+
children: PropTypes.node
|
|
227
|
+
} : {};
|
|
228
|
+
|
|
191
229
|
export default DataHeader;
|
package/es/DataHeader/Flags.js
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { Asterisk } from '../';
|
|
3
4
|
import { TooltipHeader } from './TooltipHeader';
|
|
4
5
|
|
|
5
6
|
var Flags = function Flags(_ref) {
|
|
6
7
|
var classes = _ref.classes,
|
|
7
8
|
content = _ref.content;
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
content: content
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
return React.createElement(
|
|
10
|
+
TooltipHeader,
|
|
11
|
+
{ classes: classes, content: content },
|
|
12
|
+
React.createElement(
|
|
13
|
+
'sup',
|
|
14
|
+
{ className: classes.svgWrapper },
|
|
15
|
+
React.createElement(Asterisk, { className: classes.svg })
|
|
16
|
+
)
|
|
17
|
+
);
|
|
16
18
|
};
|
|
17
19
|
|
|
20
|
+
Flags.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
21
|
+
classes: PropTypes.object,
|
|
22
|
+
content: PropTypes.arrayOf(PropTypes.shape({
|
|
23
|
+
header: PropTypes.string,
|
|
24
|
+
label: PropTypes.string,
|
|
25
|
+
sub: PropTypes.arrayOf(PropTypes.shape({
|
|
26
|
+
label: PropTypes.string
|
|
27
|
+
}))
|
|
28
|
+
}))
|
|
29
|
+
} : {};
|
|
30
|
+
|
|
18
31
|
export default Flags;
|
package/es/DataHeader/Title.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { isNil } from 'ramda';
|
|
3
4
|
|
|
4
5
|
var Title = function Title(_ref) {
|
|
@@ -7,8 +8,20 @@ var Title = function Title(_ref) {
|
|
|
7
8
|
if (isNil(header)) {
|
|
8
9
|
return '';
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
return React.createElement(
|
|
12
|
+
'b',
|
|
13
|
+
null,
|
|
14
|
+
React.createElement(
|
|
15
|
+
'i',
|
|
16
|
+
null,
|
|
17
|
+
header
|
|
18
|
+
),
|
|
19
|
+
'\xA0'
|
|
20
|
+
);
|
|
12
21
|
};
|
|
13
22
|
|
|
23
|
+
Title.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
24
|
+
header: PropTypes.string
|
|
25
|
+
} : {};
|
|
26
|
+
|
|
14
27
|
export default Title;
|
|
@@ -1,46 +1,76 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import * as R from 'ramda';
|
|
3
4
|
import { Tooltip } from '../';
|
|
4
5
|
import Title from './Title';
|
|
6
|
+
|
|
5
7
|
export var TooltipHeader = function TooltipHeader(_ref) {
|
|
6
8
|
var children = _ref.children,
|
|
7
9
|
classes = _ref.classes,
|
|
8
10
|
_ref$content = _ref.content,
|
|
9
|
-
content = _ref$content ===
|
|
11
|
+
content = _ref$content === undefined ? [] : _ref$content;
|
|
12
|
+
|
|
10
13
|
if (R.isEmpty(content)) return null;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
|
|
15
|
+
var listContent = React.createElement(
|
|
16
|
+
'ul',
|
|
17
|
+
{ className: classes.content },
|
|
18
|
+
R.addIndex(R.map)(function (_ref2, index) {
|
|
19
|
+
var header = _ref2.header,
|
|
20
|
+
label = _ref2.label,
|
|
21
|
+
_ref2$sub = _ref2.sub,
|
|
22
|
+
sub = _ref2$sub === undefined ? [] : _ref2$sub;
|
|
23
|
+
return React.createElement(
|
|
24
|
+
'li',
|
|
25
|
+
{ key: label + '-' + index },
|
|
26
|
+
React.createElement(Title, { header: header }),
|
|
27
|
+
label,
|
|
28
|
+
R.not(R.isEmpty(sub)) && React.createElement(
|
|
29
|
+
'ul',
|
|
30
|
+
{ className: classes.subContent },
|
|
31
|
+
R.addIndex(R.map)(function (_ref3, index) {
|
|
32
|
+
var label = _ref3.label;
|
|
33
|
+
return React.createElement(
|
|
34
|
+
'li',
|
|
35
|
+
{ key: label + '-' + index },
|
|
36
|
+
label
|
|
37
|
+
);
|
|
38
|
+
}, sub)
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
}, content)
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return React.createElement(
|
|
45
|
+
Tooltip,
|
|
46
|
+
{
|
|
47
|
+
title: listContent,
|
|
48
|
+
tabIndex: 0,
|
|
49
|
+
'aria-label': R.pipe(R.pluck('label'), R.join(', '))(content),
|
|
50
|
+
'aria-hidden': false,
|
|
51
|
+
placement: 'top',
|
|
52
|
+
PopperProps: {
|
|
53
|
+
modifiers: {
|
|
54
|
+
flip: {
|
|
55
|
+
behavior: ['top', 'bottom', 'left', 'right']
|
|
56
|
+
}
|
|
41
57
|
}
|
|
42
58
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
59
|
+
},
|
|
60
|
+
children
|
|
61
|
+
);
|
|
45
62
|
};
|
|
63
|
+
|
|
64
|
+
TooltipHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
65
|
+
children: PropTypes.node,
|
|
66
|
+
classes: PropTypes.object,
|
|
67
|
+
content: PropTypes.arrayOf(PropTypes.shape({
|
|
68
|
+
header: PropTypes.string,
|
|
69
|
+
label: PropTypes.string,
|
|
70
|
+
sub: PropTypes.arrayOf(PropTypes.shape({
|
|
71
|
+
label: PropTypes.string
|
|
72
|
+
}))
|
|
73
|
+
}))
|
|
74
|
+
} : {};
|
|
75
|
+
|
|
46
76
|
export default TooltipHeader;
|
package/es/DataHeader/index.js
CHANGED
package/es/DataHeader/utils.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
3
|
import * as R from 'ramda';
|
|
4
4
|
import { T4_BREAKPOINTS } from '../theme';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
var getReducedContent = function getReducedContent(_ref) {
|
|
6
7
|
var isWidthLess = _ref.isWidthLess,
|
|
7
|
-
rest =
|
|
8
|
+
rest = _objectWithoutProperties(_ref, ['isWidthLess']);
|
|
8
9
|
|
|
9
10
|
return R.pipe(R.evolve({
|
|
10
11
|
title: R.of,
|
|
11
12
|
subtitle: R.identity,
|
|
12
13
|
uprs: R.of,
|
|
13
14
|
disclaimer: function disclaimer(label) {
|
|
14
|
-
return [{
|
|
15
|
-
label: label
|
|
16
|
-
}];
|
|
15
|
+
return [{ label: label }];
|
|
17
16
|
}
|
|
18
17
|
}), R.props(['title', 'subtitle', 'uprs', 'disclaimer']), R.cond([[R.always(isWidthLess(T4_BREAKPOINTS.xs2)), R.identity], [R.always(isWidthLess(T4_BREAKPOINTS.xs3)), R.tail], [R.T, R.always([])]]), R.unnest, R.reject(R.isNil))(rest);
|
|
19
|
-
};
|
|
18
|
+
};
|
|
19
|
+
export { getReducedContent };
|