@sis-cc/dotstatsuite-visions 6.6.0 → 6.6.1
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 +46 -30
- package/es/Share/Share.js +64 -41
- package/es/Share/index.js +1 -0
- 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 +67 -48
- package/es/TableHtml5/index.js +1 -0
- package/es/TableHtml5/section.js +121 -83
- package/es/TableHtml5/sectionHeader.js +72 -45
- package/es/TableHtml5/subHeader.js +63 -44
- 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 +78 -49
- 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 +97 -66
- package/lib/TableHtml5/index.js +17 -8
- package/lib/TableHtml5/section.js +163 -108
- package/lib/TableHtml5/sectionHeader.js +102 -64
- package/lib/TableHtml5/subHeader.js +93 -64
- 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,6 +1,8 @@
|
|
|
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, { Fragment } from 'react';
|
|
3
4
|
import * as R from 'ramda';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
4
6
|
import Typography from '@material-ui/core/Typography';
|
|
5
7
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
8
|
import Lens from '@material-ui/icons/Lens';
|
|
@@ -8,14 +10,15 @@ import TableCell from '@material-ui/core/TableCell';
|
|
|
8
10
|
import TableRow from '@material-ui/core/TableRow';
|
|
9
11
|
import Flags from './flags';
|
|
10
12
|
import { getDark } from '../utils';
|
|
13
|
+
|
|
11
14
|
var useStyles = makeStyles(function (theme) {
|
|
12
15
|
return {
|
|
13
16
|
section: {
|
|
14
17
|
backgroundColor: getDark(theme) || theme.palette.secondary.dark,
|
|
15
18
|
border: 'inherit',
|
|
16
|
-
borderBottom:
|
|
17
|
-
borderRight:
|
|
18
|
-
padding: theme.spacing(0.5) +
|
|
19
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
20
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
21
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
19
22
|
color: theme.palette.grey['A700'],
|
|
20
23
|
verticalAlign: 'middle'
|
|
21
24
|
},
|
|
@@ -52,49 +55,73 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
52
55
|
currentSection = _ref.currentSection,
|
|
53
56
|
xLayoutDataLength = _ref.xLayoutDataLength,
|
|
54
57
|
headerHeight = _ref.headerHeight;
|
|
58
|
+
|
|
55
59
|
var classes = useStyles();
|
|
56
60
|
if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(section)) return null;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
61
|
+
|
|
62
|
+
return React.createElement(
|
|
63
|
+
TableRow,
|
|
64
|
+
{
|
|
65
|
+
key: section.key,
|
|
66
|
+
className: classes.stickyHeaderSection,
|
|
67
|
+
style: { top: headerHeight, zIndex: 2 }
|
|
68
|
+
},
|
|
69
|
+
React.createElement(
|
|
70
|
+
TableCell,
|
|
71
|
+
{
|
|
72
|
+
component: 'th',
|
|
73
|
+
className: classes.section,
|
|
74
|
+
colSpan: R.pipe(R.length, R.inc, R.add(xLayoutDataLength))(headerData),
|
|
75
|
+
id: currentSection
|
|
76
|
+
},
|
|
77
|
+
React.createElement(
|
|
78
|
+
Typography,
|
|
79
|
+
{ noWrap: true, variant: 'body1', component: 'div', className: classes.containerSection },
|
|
80
|
+
React.createElement(
|
|
81
|
+
'div',
|
|
82
|
+
null,
|
|
83
|
+
mapIndexed(function (sectionHeader, index) {
|
|
84
|
+
return React.createElement(
|
|
85
|
+
Fragment,
|
|
86
|
+
{ key: index },
|
|
87
|
+
index !== 0 && React.createElement(Lens, { className: classes.lens }),
|
|
88
|
+
React.createElement(
|
|
89
|
+
Typography,
|
|
90
|
+
{
|
|
91
|
+
noWrap: true,
|
|
92
|
+
variant: 'body1',
|
|
93
|
+
component: 'span',
|
|
94
|
+
tabIndex: 0,
|
|
95
|
+
className: classes.label
|
|
96
|
+
},
|
|
97
|
+
R.path(['dimension', 'label'], sectionHeader),
|
|
98
|
+
':'
|
|
99
|
+
),
|
|
100
|
+
React.createElement(
|
|
101
|
+
Typography,
|
|
102
|
+
{ noWrap: true, variant: 'body1', component: 'span', tabIndex: 0 },
|
|
103
|
+
R.path(['value', 'label'], sectionHeader),
|
|
104
|
+
React.createElement(Flags, { flags: R.path(['value', 'flags'], sectionHeader) })
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
}, R.path([0, 'data'], section))
|
|
108
|
+
),
|
|
109
|
+
React.createElement(
|
|
110
|
+
'div',
|
|
111
|
+
{ className: classes.flag },
|
|
112
|
+
React.createElement(Flags, { flags: R.path([0, 'flags'], section) })
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
);
|
|
98
117
|
};
|
|
99
118
|
|
|
119
|
+
SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
120
|
+
headerData: PropTypes.array,
|
|
121
|
+
section: PropTypes.array,
|
|
122
|
+
currentSection: PropTypes.string,
|
|
123
|
+
xLayoutDataLength: PropTypes.number,
|
|
124
|
+
headerHeight: PropTypes.number
|
|
125
|
+
} : {};
|
|
126
|
+
|
|
100
127
|
export default SectionHeader;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as R from 'ramda';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import cx from 'classnames';
|
|
4
5
|
import Typography from '@material-ui/core/Typography';
|
|
5
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -7,23 +8,24 @@ import TableCell from '@material-ui/core/TableCell';
|
|
|
7
8
|
import TableRow from '@material-ui/core/TableRow';
|
|
8
9
|
import { getLight } from '../utils';
|
|
9
10
|
import Flags from './flags';
|
|
11
|
+
|
|
10
12
|
var useStyles = makeStyles(function (theme) {
|
|
11
13
|
return {
|
|
12
14
|
columnsTitle: {
|
|
13
15
|
backgroundColor: getLight(theme) || theme.palette.secondary.light,
|
|
14
16
|
border: 'inherit',
|
|
15
|
-
borderBottom:
|
|
16
|
-
borderRight:
|
|
17
|
-
padding: theme.spacing(0.5) +
|
|
17
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
18
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
19
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
18
20
|
color: theme.palette.grey['A700'],
|
|
19
21
|
verticalAlign: 'middle'
|
|
20
22
|
},
|
|
21
23
|
fillerCell: {
|
|
22
24
|
backgroundColor: theme.palette.grey[200],
|
|
23
25
|
border: 'inherit',
|
|
24
|
-
borderBottom:
|
|
25
|
-
borderRight:
|
|
26
|
-
padding: theme.spacing(0.5) +
|
|
26
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
27
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
28
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
27
29
|
verticalAlign: 'middle',
|
|
28
30
|
textAlign: 'center',
|
|
29
31
|
color: theme.palette.grey['A700']
|
|
@@ -39,51 +41,68 @@ var useStyles = makeStyles(function (theme) {
|
|
|
39
41
|
highlight: theme.mixins.table.cellHighlight
|
|
40
42
|
};
|
|
41
43
|
});
|
|
44
|
+
|
|
42
45
|
var mapIndexed = R.addIndex(R.map);
|
|
46
|
+
|
|
43
47
|
var SubHeader = React.forwardRef(function (_ref, refs) {
|
|
44
48
|
var headerData = _ref.headerData,
|
|
45
49
|
xLayoutData = _ref.xLayoutData,
|
|
46
50
|
activeCellIds = _ref.activeCellIds,
|
|
47
51
|
subHeadCellsWidth = _ref.subHeadCellsWidth;
|
|
52
|
+
|
|
48
53
|
var classes = useStyles();
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
54
|
+
return React.createElement(
|
|
55
|
+
TableRow,
|
|
56
|
+
null,
|
|
57
|
+
mapIndexed(function (rowItem, index) {
|
|
58
|
+
return React.createElement(
|
|
59
|
+
TableCell,
|
|
60
|
+
{
|
|
61
|
+
component: 'th',
|
|
62
|
+
className: classes.columnsTitle,
|
|
63
|
+
key: index,
|
|
64
|
+
id: 'subHeader_' + index,
|
|
65
|
+
style: { position: 'sticky', left: subHeadCellsWidth[index], zIndex: 1 },
|
|
66
|
+
ref: function ref(element) {
|
|
67
|
+
return refs.current[index] = element;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
React.createElement(
|
|
71
|
+
'div',
|
|
72
|
+
{ className: classes.cellContent },
|
|
73
|
+
React.createElement(
|
|
74
|
+
Typography,
|
|
75
|
+
{ variant: 'body1', tabIndex: 0, className: classes.label },
|
|
76
|
+
R.path(['dimension', 'label'], rowItem),
|
|
77
|
+
React.createElement(Flags, { flags: R.path(['dimension', 'flags'], rowItem) })
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
}, xLayoutData),
|
|
82
|
+
React.createElement(TableCell, {
|
|
83
|
+
className: classes.fillerCell,
|
|
84
|
+
style: { position: 'sticky', left: R.last(subHeadCellsWidth) }
|
|
85
|
+
}),
|
|
86
|
+
mapIndexed(function (item, index) {
|
|
87
|
+
var _cx;
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
return React.createElement(
|
|
90
|
+
TableCell,
|
|
91
|
+
{
|
|
92
|
+
key: index,
|
|
93
|
+
className: cx(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
94
|
+
},
|
|
95
|
+
React.createElement(Flags, { flags: R.prop('flags', item) })
|
|
96
|
+
);
|
|
97
|
+
}, headerData)
|
|
98
|
+
);
|
|
88
99
|
});
|
|
100
|
+
|
|
101
|
+
SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
102
|
+
activeCellIds: PropTypes.object,
|
|
103
|
+
headerData: PropTypes.array,
|
|
104
|
+
xLayoutData: PropTypes.array,
|
|
105
|
+
subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
|
|
106
|
+
} : {};
|
|
107
|
+
|
|
89
108
|
export default SubHeader;
|
package/es/TableLayout/Box.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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 Grid from '@material-ui/core/Grid';
|
|
@@ -8,6 +9,7 @@ import { Droppable } from 'react-beautiful-dnd';
|
|
|
8
9
|
import DnDItem from './DnDItem';
|
|
9
10
|
import { getLight, getDark } from '../utils';
|
|
10
11
|
import { BOX } from './constants';
|
|
12
|
+
|
|
11
13
|
export var useStyles = makeStyles(function (theme) {
|
|
12
14
|
var _ref;
|
|
13
15
|
|
|
@@ -26,11 +28,11 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
26
28
|
canDrop: {
|
|
27
29
|
borderStyle: 'dashed'
|
|
28
30
|
}
|
|
29
|
-
}, _ref[BOX.sections +
|
|
31
|
+
}, _ref[BOX.sections + 'Container'] = {
|
|
30
32
|
borderColor: getDark(theme) || theme.palette.secondary.dark
|
|
31
|
-
}, _ref[BOX.rows +
|
|
33
|
+
}, _ref[BOX.rows + 'Container'] = {
|
|
32
34
|
borderColor: getLight(theme) || theme.palette.secondary.light
|
|
33
|
-
}, _ref[BOX.header +
|
|
35
|
+
}, _ref[BOX.header + 'Container'] = {
|
|
34
36
|
borderColor: theme.palette.primary.main
|
|
35
37
|
}, _ref.iconTitle = {
|
|
36
38
|
display: 'flex',
|
|
@@ -50,39 +52,70 @@ var Box = function Box(_ref2) {
|
|
|
50
52
|
itemButtonProps = _ref2.itemButtonProps,
|
|
51
53
|
accessibility = _ref2.accessibility,
|
|
52
54
|
md = _ref2.md;
|
|
55
|
+
|
|
53
56
|
var classes = useStyles();
|
|
54
57
|
var canDrag = R.equals(dropZoneLabel, BOX.rows) ? R.pipe(R.length, R.lt(1))(items) : R.T();
|
|
55
|
-
return /*#__PURE__*/React.createElement(Grid, {
|
|
56
|
-
item: true,
|
|
57
|
-
xs: accessibility ? 4 : 12,
|
|
58
|
-
md: md
|
|
59
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: classes.iconTitle
|
|
61
|
-
}, /*#__PURE__*/React.createElement(Icon, null), /*#__PURE__*/React.createElement("span", {
|
|
62
|
-
className: classes.title
|
|
63
|
-
}, title), /*#__PURE__*/React.createElement(Typography, {
|
|
64
|
-
variant: "srOnly"
|
|
65
|
-
}, title)), /*#__PURE__*/React.createElement(Droppable, {
|
|
66
|
-
droppableId: dropZoneLabel
|
|
67
|
-
}, function (provided, snapshot) {
|
|
68
|
-
var _cx;
|
|
69
58
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
59
|
+
return React.createElement(
|
|
60
|
+
Grid,
|
|
61
|
+
{ item: true, xs: accessibility ? 4 : 12, md: md },
|
|
62
|
+
React.createElement(
|
|
63
|
+
'div',
|
|
64
|
+
{ className: classes.iconTitle },
|
|
65
|
+
React.createElement(Icon, null),
|
|
66
|
+
React.createElement(
|
|
67
|
+
'span',
|
|
68
|
+
{ className: classes.title },
|
|
69
|
+
title
|
|
70
|
+
),
|
|
71
|
+
React.createElement(
|
|
72
|
+
Typography,
|
|
73
|
+
{ variant: 'srOnly' },
|
|
74
|
+
title
|
|
75
|
+
)
|
|
76
|
+
),
|
|
77
|
+
React.createElement(
|
|
78
|
+
Droppable,
|
|
79
|
+
{ droppableId: dropZoneLabel },
|
|
80
|
+
function (provided, snapshot) {
|
|
81
|
+
var _cx;
|
|
82
|
+
|
|
83
|
+
return React.createElement(
|
|
84
|
+
'div',
|
|
85
|
+
{
|
|
86
|
+
ref: provided.innerRef,
|
|
87
|
+
className: cx(classes.blockDnd, R.prop(dropZoneLabel + 'Container')(classes), (_cx = {}, _cx[classes.canDrop] = snapshot.isDraggingOver, _cx))
|
|
88
|
+
},
|
|
89
|
+
R.addIndex(R.map)(function (item, index) {
|
|
90
|
+
return React.createElement(DnDItem, {
|
|
91
|
+
key: item.id,
|
|
92
|
+
index: index,
|
|
93
|
+
item: item,
|
|
94
|
+
itemRenderer: itemRenderer,
|
|
95
|
+
dropZoneLabel: dropZoneLabel,
|
|
96
|
+
onChangeLayout: onChangeLayout,
|
|
97
|
+
itemButtonProps: itemButtonProps,
|
|
98
|
+
canDrag: canDrag
|
|
99
|
+
});
|
|
100
|
+
})(R.values(items)),
|
|
101
|
+
provided.placeholder
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
);
|
|
86
106
|
};
|
|
87
107
|
|
|
108
|
+
Box.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
109
|
+
items: PropTypes.array,
|
|
110
|
+
itemRenderer: PropTypes.func,
|
|
111
|
+
dropZoneLabel: PropTypes.string,
|
|
112
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
113
|
+
Icon: PropTypes.object,
|
|
114
|
+
onChangeLayout: PropTypes.func,
|
|
115
|
+
putItem: PropTypes.func,
|
|
116
|
+
itemButtonProps: PropTypes.object,
|
|
117
|
+
accessibility: PropTypes.bool,
|
|
118
|
+
md: PropTypes.number
|
|
119
|
+
} : {};
|
|
120
|
+
|
|
88
121
|
export default Box;
|
|
@@ -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, { Fragment } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
3
5
|
import * as R from 'ramda';
|
|
4
6
|
import cx from 'classnames';
|
|
5
7
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -9,6 +11,7 @@ import MenuItem from '@material-ui/core/MenuItem';
|
|
|
9
11
|
import { Draggable } from 'react-beautiful-dnd';
|
|
10
12
|
import { getLight, getDark } from '../utils';
|
|
11
13
|
import { BOX, wcagId } from './constants';
|
|
14
|
+
|
|
12
15
|
export var useStyles = makeStyles(function (theme) {
|
|
13
16
|
var _ref;
|
|
14
17
|
|
|
@@ -31,13 +34,13 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
31
34
|
opacity: 1,
|
|
32
35
|
flexFlow: 'wrap'
|
|
33
36
|
}
|
|
34
|
-
}, _ref[BOX.sections +
|
|
37
|
+
}, _ref[BOX.sections + 'Item'] = {
|
|
35
38
|
color: theme.palette.getContrastText(getDark(theme) || theme.palette.secondary.dark),
|
|
36
39
|
backgroundColor: getDark(theme) || theme.palette.secondary.dark
|
|
37
|
-
}, _ref[BOX.rows +
|
|
40
|
+
}, _ref[BOX.rows + 'Item'] = {
|
|
38
41
|
color: theme.palette.getContrastText(getLight(theme) || theme.palette.secondary.light),
|
|
39
42
|
backgroundColor: getLight(theme) || theme.palette.secondary.light
|
|
40
|
-
}, _ref[BOX.header +
|
|
43
|
+
}, _ref[BOX.header + 'Item'] = {
|
|
41
44
|
color: theme.palette.getContrastText(theme.palette.primary.main),
|
|
42
45
|
backgroundColor: theme.palette.primary.main
|
|
43
46
|
}, _ref.cantMove = {
|
|
@@ -65,42 +68,70 @@ var DnDItem = function DnDItem(_ref2) {
|
|
|
65
68
|
dropZoneLabel = _ref2.dropZoneLabel,
|
|
66
69
|
itemButtonProps = _ref2.itemButtonProps,
|
|
67
70
|
canDrag = _ref2.canDrag;
|
|
71
|
+
|
|
68
72
|
var classes = useStyles();
|
|
69
73
|
var selectItem = R.prop(item.id)(itemButtonProps);
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
draggableId: item.id,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, function (provided) {
|
|
76
|
-
var _cx, _cx2;
|
|
74
|
+
return React.createElement(
|
|
75
|
+
Draggable,
|
|
76
|
+
{ key: item.id, draggableId: item.id, index: index, isDragDisabled: R.not(canDrag) },
|
|
77
|
+
function (provided) {
|
|
78
|
+
var _cx, _cx2;
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
80
|
+
return React.createElement(
|
|
81
|
+
'div',
|
|
82
|
+
_extends({
|
|
83
|
+
ref: provided.innerRef
|
|
84
|
+
}, provided.draggableProps, provided.dragHandleProps, {
|
|
85
|
+
className: cx(classes.styledItemContainer, classes.containerButton, [R.prop(dropZoneLabel + 'Item')(classes)], (_cx = {}, _cx[classes.cantMove] = R.not(canDrag), _cx)),
|
|
86
|
+
'aria-label': itemRenderer(item),
|
|
87
|
+
'aria-describedby': wcagId
|
|
88
|
+
}),
|
|
89
|
+
React.createElement(
|
|
90
|
+
Fragment,
|
|
91
|
+
null,
|
|
92
|
+
React.createElement(
|
|
93
|
+
Typography,
|
|
94
|
+
{
|
|
95
|
+
variant: 'body2',
|
|
96
|
+
className: cx(classes.text, (_cx2 = {}, _cx2[classes.spaceButton] = selectItem, _cx2))
|
|
97
|
+
},
|
|
98
|
+
itemRenderer(item)
|
|
99
|
+
),
|
|
100
|
+
selectItem && React.createElement(
|
|
101
|
+
Select,
|
|
102
|
+
{
|
|
103
|
+
id: item.id,
|
|
104
|
+
value: selectItem.value,
|
|
105
|
+
onChange: function onChange(e) {
|
|
106
|
+
return selectItem.onChange(e.target.value);
|
|
107
|
+
},
|
|
108
|
+
classes: { root: classes.select },
|
|
109
|
+
variant: 'outlined'
|
|
110
|
+
},
|
|
111
|
+
R.map(function (v) {
|
|
112
|
+
return React.createElement(
|
|
113
|
+
MenuItem,
|
|
114
|
+
{ key: v, value: v },
|
|
115
|
+
v
|
|
116
|
+
);
|
|
117
|
+
})(selectItem.options)
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
104
123
|
};
|
|
105
124
|
|
|
125
|
+
DnDItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
126
|
+
item: PropTypes.object,
|
|
127
|
+
index: PropTypes.number,
|
|
128
|
+
itemRenderer: PropTypes.func,
|
|
129
|
+
dropZoneLabel: PropTypes.string,
|
|
130
|
+
onChangeLayout: PropTypes.func,
|
|
131
|
+
itemButtonProps: PropTypes.object,
|
|
132
|
+
handleChangeBox: PropTypes.func,
|
|
133
|
+
canDrag: PropTypes.bool,
|
|
134
|
+
dropZoneIndex: PropTypes.number
|
|
135
|
+
} : {};
|
|
136
|
+
|
|
106
137
|
export default DnDItem;
|