@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,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
4
|
import Paper from '@material-ui/core/Paper';
|
|
4
5
|
import Grid from '@material-ui/core/Grid';
|
|
5
6
|
import cx from 'classnames';
|
|
7
|
+
|
|
6
8
|
var useStyles = makeStyles(function (theme) {
|
|
7
9
|
return {
|
|
8
10
|
paper: {
|
|
@@ -23,14 +25,26 @@ var CustomPaper = function CustomPaper(_ref) {
|
|
|
23
25
|
|
|
24
26
|
var isMobileView = _ref.isMobileView,
|
|
25
27
|
children = _ref.children;
|
|
28
|
+
|
|
26
29
|
var classes = useStyles();
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return React.createElement(
|
|
31
|
+
Paper,
|
|
32
|
+
{
|
|
33
|
+
classes: {
|
|
34
|
+
root: cx(classes.paper, (_cx = {}, _cx[classes.mobileView] = isMobileView, _cx))
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
React.createElement(
|
|
38
|
+
Grid,
|
|
39
|
+
{ container: true },
|
|
40
|
+
children
|
|
41
|
+
)
|
|
42
|
+
);
|
|
34
43
|
};
|
|
35
44
|
|
|
45
|
+
CustomPaper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
46
|
+
isMobileView: PropTypes.bool,
|
|
47
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
|
|
48
|
+
} : {};
|
|
49
|
+
|
|
36
50
|
export default CustomPaper;
|
package/es/DataEdit/DataEdit.js
CHANGED
|
@@ -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 Grid from '@material-ui/core/Grid';
|
|
5
7
|
import Typography from '@material-ui/core/Typography';
|
|
@@ -9,6 +11,7 @@ import { makeStyles } from '@material-ui/styles';
|
|
|
9
11
|
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
10
12
|
import Input from './Input';
|
|
11
13
|
import { withBlank } from '../utils';
|
|
14
|
+
|
|
12
15
|
var useStyles = makeStyles(function (theme) {
|
|
13
16
|
return {
|
|
14
17
|
root: _extends({
|
|
@@ -28,85 +31,139 @@ var useStyles = makeStyles(function (theme) {
|
|
|
28
31
|
var DataEdit = function DataEdit(_ref) {
|
|
29
32
|
var labels = _ref.labels,
|
|
30
33
|
properties = _ref.properties;
|
|
34
|
+
|
|
31
35
|
var classes = useStyles();
|
|
32
36
|
var _properties$title = properties.title,
|
|
33
|
-
title = _properties$title ===
|
|
37
|
+
title = _properties$title === undefined ? {} : _properties$title,
|
|
34
38
|
_properties$subtitle = properties.subtitle,
|
|
35
|
-
subtitle = _properties$subtitle ===
|
|
39
|
+
subtitle = _properties$subtitle === undefined ? {} : _properties$subtitle,
|
|
36
40
|
_properties$source = properties.source,
|
|
37
|
-
source = _properties$source ===
|
|
41
|
+
source = _properties$source === undefined ? {} : _properties$source,
|
|
38
42
|
_properties$logo = properties.logo,
|
|
39
|
-
logo = _properties$logo ===
|
|
43
|
+
logo = _properties$logo === undefined ? {} : _properties$logo,
|
|
40
44
|
_properties$copyright = properties.copyright,
|
|
41
|
-
copyright = _properties$copyright ===
|
|
45
|
+
copyright = _properties$copyright === undefined ? {} : _properties$copyright;
|
|
46
|
+
|
|
42
47
|
var resetLabel = R.prop('reset', labels);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
container: true,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
48
|
+
|
|
49
|
+
return React.createElement(
|
|
50
|
+
Grid,
|
|
51
|
+
{ 'data-testid': 'data-edit-test-id', spacing: 2, container: true, className: classes.root },
|
|
52
|
+
React.createElement(
|
|
53
|
+
Grid,
|
|
54
|
+
{ item: true, xs: 12 },
|
|
55
|
+
React.createElement(
|
|
56
|
+
Grid,
|
|
57
|
+
{ container: true },
|
|
58
|
+
React.createElement(
|
|
59
|
+
Grid,
|
|
60
|
+
{ item: true, xs: 12 },
|
|
61
|
+
React.createElement(
|
|
62
|
+
Typography,
|
|
63
|
+
{ variant: 'h6', className: classes.title },
|
|
64
|
+
'Information'
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
),
|
|
68
|
+
React.createElement(
|
|
69
|
+
Grid,
|
|
70
|
+
{ spacing: 2, container: true },
|
|
71
|
+
R.or(R.prop('isActive')(title), R.prop('isActive')(subtitle)) && React.createElement(
|
|
72
|
+
Grid,
|
|
73
|
+
{ item: true, xs: 12, sm: 12, md: 12, lg: 6 },
|
|
74
|
+
R.prop('isActive')(title) && React.createElement(Input, _extends({
|
|
75
|
+
fullWidth: true,
|
|
76
|
+
label: R.prop('title', labels),
|
|
77
|
+
resetLabel: resetLabel
|
|
78
|
+
}, R.dissoc('isDefault', title))),
|
|
79
|
+
R.prop('isActive')(subtitle) && React.createElement(Input, _extends({
|
|
80
|
+
fullWidth: true,
|
|
81
|
+
label: R.prop('subtitle', labels),
|
|
82
|
+
resetLabel: resetLabel
|
|
83
|
+
}, R.dissoc('isDefault', subtitle)))
|
|
84
|
+
),
|
|
85
|
+
React.createElement(
|
|
86
|
+
Grid,
|
|
87
|
+
{ item: true, xs: 12, sm: 12, md: 12, lg: 6 },
|
|
88
|
+
R.prop('isActive')(source) && React.createElement(Input, _extends({
|
|
89
|
+
fullWidth: true,
|
|
90
|
+
label: R.prop('source', labels),
|
|
91
|
+
resetLabel: resetLabel
|
|
92
|
+
}, R.dissoc('isDefault', source))),
|
|
93
|
+
React.createElement(
|
|
94
|
+
Container,
|
|
95
|
+
{ disableGutters: true, className: classes.checkboxes },
|
|
96
|
+
R.map(function (item) {
|
|
97
|
+
if (R.pipe(R.prop('isActive'), R.not)(item)) return;
|
|
98
|
+
var id = R.prop('id')(item);
|
|
99
|
+
return React.createElement(FormControlLabel, {
|
|
100
|
+
key: id,
|
|
101
|
+
control: React.createElement(Checkbox, _extends({
|
|
102
|
+
color: 'primary',
|
|
103
|
+
inputProps: { 'aria-label': R.prop(id)(labels) }
|
|
104
|
+
}, R.omit(['isActive'])(item))),
|
|
105
|
+
label: R.prop(id)(labels)
|
|
106
|
+
});
|
|
107
|
+
})([logo, copyright])
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
);
|
|
103
113
|
};
|
|
104
114
|
|
|
115
|
+
DataEdit.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
116
|
+
labels: PropTypes.shape({
|
|
117
|
+
title: PropTypes.string,
|
|
118
|
+
subtitle: PropTypes.string,
|
|
119
|
+
source: PropTypes.string,
|
|
120
|
+
logo: PropTypes.string,
|
|
121
|
+
copyright: PropTypes.string,
|
|
122
|
+
reset: PropTypes.string
|
|
123
|
+
}),
|
|
124
|
+
properties: PropTypes.shape({
|
|
125
|
+
title: PropTypes.shape({
|
|
126
|
+
id: PropTypes.string,
|
|
127
|
+
isActive: PropTypes.bool,
|
|
128
|
+
onSubmit: PropTypes.func,
|
|
129
|
+
onReset: PropTypes.func,
|
|
130
|
+
value: PropTypes.string
|
|
131
|
+
}),
|
|
132
|
+
subtitle: PropTypes.shape({
|
|
133
|
+
id: PropTypes.string,
|
|
134
|
+
isActive: PropTypes.bool,
|
|
135
|
+
onSubmit: PropTypes.func,
|
|
136
|
+
onReset: PropTypes.func,
|
|
137
|
+
value: PropTypes.string
|
|
138
|
+
}),
|
|
139
|
+
source: PropTypes.shape({
|
|
140
|
+
id: PropTypes.string,
|
|
141
|
+
isActive: PropTypes.bool,
|
|
142
|
+
onSubmit: PropTypes.func,
|
|
143
|
+
onReset: PropTypes.func,
|
|
144
|
+
value: PropTypes.string
|
|
145
|
+
}),
|
|
146
|
+
logo: PropTypes.shape({
|
|
147
|
+
id: PropTypes.string,
|
|
148
|
+
isActive: PropTypes.bool,
|
|
149
|
+
onChange: PropTypes.func,
|
|
150
|
+
checked: PropTypes.bool
|
|
151
|
+
}),
|
|
152
|
+
copyright: PropTypes.shape({
|
|
153
|
+
id: PropTypes.string,
|
|
154
|
+
isActive: PropTypes.bool,
|
|
155
|
+
onChange: PropTypes.func,
|
|
156
|
+
checked: PropTypes.bool
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
} : {};
|
|
160
|
+
|
|
105
161
|
var isAllInactive = R.pipe(R.pluck('isActive'), R.all(R.identity), R.not);
|
|
162
|
+
|
|
106
163
|
export default withBlank(function (_ref2) {
|
|
107
164
|
var isBlank = _ref2.isBlank,
|
|
108
165
|
_ref2$properties = _ref2.properties,
|
|
109
|
-
properties = _ref2$properties ===
|
|
166
|
+
properties = _ref2$properties === undefined ? {} : _ref2$properties;
|
|
110
167
|
return {
|
|
111
168
|
isBlank: R.any(R.identity)([isBlank, R.isEmpty(properties), isAllInactive(properties)])
|
|
112
169
|
};
|
package/es/DataEdit/Input.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, { useEffect, useState } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
5
7
|
import * as R from 'ramda';
|
|
6
8
|
import { makeStyles } from '@material-ui/core/styles';
|
|
7
9
|
import TextField from '@material-ui/core/TextField';
|
|
@@ -9,6 +11,7 @@ import InputAdornment from '@material-ui/core/InputAdornment';
|
|
|
9
11
|
import IconButton from '@material-ui/core/IconButton';
|
|
10
12
|
import Done from '@material-ui/icons/Done';
|
|
11
13
|
import RotateLeftIcon from '@material-ui/icons/RotateLeft';
|
|
14
|
+
|
|
12
15
|
var useStyles = makeStyles(function (theme) {
|
|
13
16
|
return {
|
|
14
17
|
visibility: {
|
|
@@ -28,29 +31,40 @@ var useStyles = makeStyles(function (theme) {
|
|
|
28
31
|
|
|
29
32
|
var LefttIcon = function LefttIcon(_ref) {
|
|
30
33
|
var Icon = _ref.Icon;
|
|
31
|
-
return
|
|
34
|
+
return React.createElement(Icon, null);
|
|
32
35
|
};
|
|
33
36
|
|
|
37
|
+
LefttIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
38
|
+
Icon: PropTypes.object
|
|
39
|
+
} : {};
|
|
40
|
+
|
|
34
41
|
var RightIcon = function RightIcon(_ref2) {
|
|
35
42
|
var onSubmit = _ref2.onSubmit,
|
|
36
43
|
_ref2$Icon = _ref2.Icon,
|
|
37
|
-
Icon = _ref2$Icon ===
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
onClick: function onClick() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
Icon = _ref2$Icon === undefined ? Done : _ref2$Icon;
|
|
45
|
+
return React.createElement(
|
|
46
|
+
IconButton,
|
|
47
|
+
{ color: 'primary', onClick: function onClick() {
|
|
48
|
+
return onSubmit();
|
|
49
|
+
} },
|
|
50
|
+
React.createElement(Icon, null)
|
|
51
|
+
);
|
|
44
52
|
};
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
RightIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
55
|
+
Icon: PropTypes.object,
|
|
56
|
+
onSubmit: PropTypes.func,
|
|
57
|
+
classes: PropTypes.object
|
|
58
|
+
} : {};
|
|
59
|
+
|
|
60
|
+
var MyInput = function MyInput(_ref3) {
|
|
47
61
|
var id = _ref3.id,
|
|
48
62
|
value = _ref3.value,
|
|
49
63
|
onSubmit = _ref3.onSubmit,
|
|
50
64
|
onReset = _ref3.onReset,
|
|
51
65
|
resetLabel = _ref3.resetLabel,
|
|
52
66
|
placeholder = _ref3.placeholder,
|
|
53
|
-
props =
|
|
67
|
+
props = _objectWithoutProperties(_ref3, ['id', 'value', 'onSubmit', 'onReset', 'resetLabel', 'placeholder']);
|
|
54
68
|
|
|
55
69
|
var classes = useStyles();
|
|
56
70
|
|
|
@@ -61,7 +75,8 @@ export var MyInput = function MyInput(_ref3) {
|
|
|
61
75
|
useEffect(function () {
|
|
62
76
|
setInputValue(value);
|
|
63
77
|
}, [value]);
|
|
64
|
-
|
|
78
|
+
|
|
79
|
+
var resetId = 'reset-' + id;
|
|
65
80
|
|
|
66
81
|
var handleBlur = function handleBlur(event) {
|
|
67
82
|
if (R.is(Function, onSubmit) && inputValue !== value) {
|
|
@@ -89,23 +104,28 @@ export var MyInput = function MyInput(_ref3) {
|
|
|
89
104
|
setInputValue(event.target.value);
|
|
90
105
|
};
|
|
91
106
|
|
|
92
|
-
var endAdornment = R.is(Function, onReset) || inputValue !== value ?
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
var endAdornment = R.is(Function, onReset) || inputValue !== value ? React.createElement(
|
|
108
|
+
InputAdornment,
|
|
109
|
+
{ position: 'end' },
|
|
110
|
+
React.createElement(
|
|
111
|
+
IconButton,
|
|
112
|
+
{
|
|
113
|
+
id: resetId,
|
|
114
|
+
'aria-label': resetLabel,
|
|
115
|
+
onKeyPress: onEnterLabel,
|
|
116
|
+
onClick: handleReset
|
|
117
|
+
},
|
|
118
|
+
React.createElement(RotateLeftIcon, { fontSize: 'small' })
|
|
119
|
+
)
|
|
120
|
+
) : null;
|
|
121
|
+
|
|
122
|
+
return React.createElement(TextField, _extends({
|
|
103
123
|
inputProps: {
|
|
104
124
|
className: classes.input
|
|
105
125
|
},
|
|
106
126
|
onBlur: handleBlur,
|
|
107
|
-
margin:
|
|
108
|
-
variant:
|
|
127
|
+
margin: 'dense',
|
|
128
|
+
variant: 'outlined',
|
|
109
129
|
onKeyPress: onEnterLabel,
|
|
110
130
|
onChange: handleChange,
|
|
111
131
|
id: id,
|
|
@@ -116,4 +136,15 @@ export var MyInput = function MyInput(_ref3) {
|
|
|
116
136
|
placeholder: R.is(Number)(placeholder) ? R.toString(placeholder) : placeholder
|
|
117
137
|
}, R.omit(['isActive'])(props)));
|
|
118
138
|
};
|
|
139
|
+
|
|
140
|
+
export { MyInput };
|
|
141
|
+
MyInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
142
|
+
id: PropTypes.string,
|
|
143
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
144
|
+
onSubmit: PropTypes.func,
|
|
145
|
+
onReset: PropTypes.func,
|
|
146
|
+
resetLabel: PropTypes.string,
|
|
147
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
148
|
+
} : {};
|
|
149
|
+
|
|
119
150
|
export default MyInput;
|
package/es/DataEdit/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import * as R from 'ramda';
|
|
3
4
|
import useSize from '@react-hook/size';
|
|
4
5
|
import Grid from '@material-ui/core/Grid';
|
|
@@ -7,7 +8,9 @@ import Link from '@material-ui/core/Link';
|
|
|
7
8
|
import { makeStyles } from '@material-ui/core/styles';
|
|
8
9
|
import { Tooltip } from '../';
|
|
9
10
|
import { T4_BREAKPOINTS } from '../theme';
|
|
11
|
+
|
|
10
12
|
var HEIGHT = 42;
|
|
13
|
+
|
|
11
14
|
var useStyles = makeStyles(function (theme) {
|
|
12
15
|
return {
|
|
13
16
|
footer: {
|
|
@@ -20,6 +23,7 @@ var useStyles = makeStyles(function (theme) {
|
|
|
20
23
|
padding: function padding(_ref) {
|
|
21
24
|
var isWidthUp = _ref.isWidthUp,
|
|
22
25
|
isSourced = _ref.isSourced;
|
|
26
|
+
|
|
23
27
|
if (isWidthUp(T4_BREAKPOINTS.sm) && isSourced) return 0;
|
|
24
28
|
return theme.spacing(0, 1, 0, 1);
|
|
25
29
|
}
|
|
@@ -30,6 +34,7 @@ var useStyles = makeStyles(function (theme) {
|
|
|
30
34
|
typo: {
|
|
31
35
|
fontSize: function fontSize(_ref2) {
|
|
32
36
|
var isWidthUp = _ref2.isWidthUp;
|
|
37
|
+
|
|
33
38
|
if (isWidthUp(T4_BREAKPOINTS.lg)) return 14;
|
|
34
39
|
return 12;
|
|
35
40
|
}
|
|
@@ -46,6 +51,7 @@ var DataFooter = function DataFooter(_ref3) {
|
|
|
46
51
|
source = _ref3.source,
|
|
47
52
|
copyright = _ref3.copyright,
|
|
48
53
|
legend = _ref3.legend;
|
|
54
|
+
|
|
49
55
|
var target = React.useRef(null);
|
|
50
56
|
|
|
51
57
|
var _useSize = useSize(target),
|
|
@@ -54,74 +60,115 @@ var DataFooter = function DataFooter(_ref3) {
|
|
|
54
60
|
var isWidthUp = R.gt(width);
|
|
55
61
|
var isSourced = source && source.label && source.link;
|
|
56
62
|
var isCopyrighted = copyright && copyright.label && copyright.content;
|
|
57
|
-
var classes = useStyles({
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
63
|
+
var classes = useStyles({ isWidthUp: isWidthUp, isSourced: isSourced });
|
|
64
|
+
|
|
65
|
+
if (!isWidthUp(T4_BREAKPOINTS.xs)) return React.createElement(Grid, { ref: target });
|
|
66
|
+
|
|
67
|
+
return React.createElement(
|
|
68
|
+
Grid,
|
|
69
|
+
{
|
|
70
|
+
ref: target,
|
|
71
|
+
container: true,
|
|
72
|
+
className: classes.footer,
|
|
73
|
+
direction: 'row',
|
|
74
|
+
justifyContent: 'flex-end',
|
|
75
|
+
alignItems: 'center'
|
|
76
|
+
},
|
|
77
|
+
React.createElement(
|
|
78
|
+
Grid,
|
|
79
|
+
{ item: true, className: classes.legend },
|
|
80
|
+
isWidthUp(T4_BREAKPOINTS.sm) && legend
|
|
81
|
+
),
|
|
82
|
+
React.createElement(
|
|
83
|
+
Grid,
|
|
84
|
+
{ item: true, style: { alignSelf: 'flex-end' } },
|
|
85
|
+
React.createElement(
|
|
86
|
+
Grid,
|
|
87
|
+
{
|
|
88
|
+
container: true,
|
|
89
|
+
justifyContent: 'flex-end',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
className: classes.footer,
|
|
92
|
+
spacing: 0
|
|
93
|
+
},
|
|
94
|
+
React.createElement(
|
|
95
|
+
Grid,
|
|
96
|
+
{ item: true, className: classes.copyright },
|
|
97
|
+
isCopyrighted && React.createElement(
|
|
98
|
+
Fragment,
|
|
99
|
+
null,
|
|
100
|
+
React.createElement(
|
|
101
|
+
Tooltip,
|
|
102
|
+
{
|
|
103
|
+
title: React.createElement(
|
|
104
|
+
Typography,
|
|
105
|
+
{ variant: 'body2' },
|
|
106
|
+
copyright.content
|
|
107
|
+
),
|
|
108
|
+
variant: 'light',
|
|
109
|
+
tabIndex: 0,
|
|
110
|
+
'aria-hidden': false,
|
|
111
|
+
placement: 'top',
|
|
112
|
+
enterNextDelay: 100,
|
|
113
|
+
interactive: true,
|
|
114
|
+
arrow: true
|
|
115
|
+
},
|
|
116
|
+
React.createElement(
|
|
117
|
+
Typography,
|
|
118
|
+
{
|
|
119
|
+
variant: 'body2',
|
|
120
|
+
className: classes.typo,
|
|
121
|
+
style: { cursor: 'pointer' }
|
|
122
|
+
},
|
|
123
|
+
copyright.label
|
|
124
|
+
)
|
|
125
|
+
),
|
|
126
|
+
React.createElement(
|
|
127
|
+
Typography,
|
|
128
|
+
{ variant: 'srOnly' },
|
|
129
|
+
copyright.content
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
),
|
|
133
|
+
isWidthUp(T4_BREAKPOINTS.sm) && isSourced && React.createElement(
|
|
134
|
+
Grid,
|
|
135
|
+
{ item: true, className: classes.source },
|
|
136
|
+
React.createElement(
|
|
137
|
+
Typography,
|
|
138
|
+
{ variant: 'body2', className: classes.typo },
|
|
139
|
+
React.createElement(
|
|
140
|
+
Link,
|
|
141
|
+
{
|
|
142
|
+
href: source.link,
|
|
143
|
+
rel: 'noopener noreferrer',
|
|
144
|
+
target: '_blank',
|
|
145
|
+
variant: 'body2'
|
|
146
|
+
},
|
|
147
|
+
source.label
|
|
148
|
+
)
|
|
149
|
+
)
|
|
150
|
+
),
|
|
151
|
+
isWidthUp(T4_BREAKPOINTS.xs) && logo && React.createElement(
|
|
152
|
+
Grid,
|
|
153
|
+
{ item: true },
|
|
154
|
+
React.createElement('img', { src: logo, alt: 'logo', className: classes.logo })
|
|
155
|
+
)
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
);
|
|
125
159
|
};
|
|
126
160
|
|
|
161
|
+
DataFooter.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
162
|
+
logo: PropTypes.string,
|
|
163
|
+
source: PropTypes.shape({
|
|
164
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
165
|
+
link: PropTypes.string
|
|
166
|
+
}),
|
|
167
|
+
copyright: PropTypes.shape({
|
|
168
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
169
|
+
content: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
170
|
+
}),
|
|
171
|
+
legend: PropTypes.element
|
|
172
|
+
} : {};
|
|
173
|
+
|
|
127
174
|
export default DataFooter;
|