@sis-cc/dotstatsuite-visions 7.17.13 → 7.18.0
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/ChartsConfig/ChartsConfig.js +368 -116
- package/es/ChartsConfig/Input.js +1 -0
- package/es/ChartsConfig/InputProxy.js +54 -0
- package/es/ChartsConfig/Proxy.js +20 -0
- package/es/ChartsConfig/Title.js +38 -0
- package/es/ChartsConfig/index.js +1 -1
- package/es/ChartsConfig/useAxisOptions.js +9 -0
- package/es/ChartsConfig/useDimensionOptions.js +12 -0
- package/es/ChartsConfig/useFocusOptions.js +22 -0
- package/es/ChartsConfig/utils.js +3 -9
- package/es/DataEdit/DataEdit.js +50 -75
- package/es/Select/Select.js +11 -4
- package/lib/ChartsConfig/ChartsConfig.js +380 -128
- package/lib/ChartsConfig/Input.js +1 -0
- package/lib/ChartsConfig/InputProxy.js +75 -0
- package/lib/ChartsConfig/Proxy.js +34 -0
- package/lib/ChartsConfig/Title.js +57 -0
- package/lib/ChartsConfig/useAxisOptions.js +18 -0
- package/lib/ChartsConfig/useDimensionOptions.js +22 -0
- package/lib/ChartsConfig/useFocusOptions.js +32 -0
- package/lib/ChartsConfig/utils.js +4 -10
- package/lib/DataEdit/DataEdit.js +50 -79
- package/lib/Select/Select.js +12 -4
- package/package.json +1 -1
- package/es/ChartsConfig/Axis.js +0 -96
- package/es/ChartsConfig/ButtonGroup.js +0 -66
- package/es/ChartsConfig/ContainerTitle.js +0 -55
- package/es/ChartsConfig/Focus.js +0 -69
- package/es/ChartsConfig/Frequency.js +0 -51
- package/es/ChartsConfig/Series.js +0 -66
- package/es/ChartsConfig/Size.js +0 -67
- package/es/ChartsConfig/styles.js +0 -52
- package/lib/ChartsConfig/Axis.js +0 -128
- package/lib/ChartsConfig/ButtonGroup.js +0 -92
- package/lib/ChartsConfig/ContainerTitle.js +0 -82
- package/lib/ChartsConfig/Focus.js +0 -97
- package/lib/ChartsConfig/Frequency.js +0 -78
- package/lib/ChartsConfig/Series.js +0 -97
- package/lib/ChartsConfig/Size.js +0 -98
- package/lib/ChartsConfig/styles.js +0 -62
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import * as R from 'ramda';
|
|
3
|
+
|
|
4
|
+
var hasUniqUnlabelledOption = R.allPass([R.pipe(R.length, R.equals(1)), R.pipe(R.head, R.prop('label'), R.anyPass([R.isNil, R.isEmpty]))]);
|
|
5
|
+
|
|
6
|
+
var useFocusOptions = function useFocusOptions() {
|
|
7
|
+
var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
+
var labels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9
|
+
|
|
10
|
+
var options = useMemo(function () {
|
|
11
|
+
return R.when(hasUniqUnlabelledOption, R.set(R.lensPath([0, 'label']), R.prop('uniqFocusOption', labels)))(focus.options);
|
|
12
|
+
}, [labels, focus.options]);
|
|
13
|
+
|
|
14
|
+
var indexedOptions = useMemo(function () {
|
|
15
|
+
if (!options) return {};
|
|
16
|
+
return R.indexBy(R.prop('value'), options);
|
|
17
|
+
}, [options]);
|
|
18
|
+
|
|
19
|
+
return [options, indexedOptions];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default useFocusOptions;
|
package/es/ChartsConfig/utils.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import * as R from 'ramda';
|
|
2
2
|
|
|
3
|
-
export var isActive = R.propOr(false, 'isActive');
|
|
4
|
-
|
|
5
|
-
export var seriesProperties = ['scatterDimension', 'scatterX', 'scatterY', 'symbolDimension', 'stackedDimension', 'stackedMode'];
|
|
6
|
-
|
|
7
|
-
export var isActivePanel = R.curry(function (propIds, properties) {
|
|
8
|
-
return R.pipe(R.props(propIds), R.pluck('isActive'), R.any(R.identity))(properties);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
3
|
// adapters for new Select which has not the same API as react-select
|
|
12
|
-
export var extractMultipleValue = R.pipe(R.
|
|
4
|
+
export var extractMultipleValue = R.pipe(R.propOr([], 'value'), R.pluck('value'));
|
|
5
|
+
|
|
6
|
+
export var getValue = R.ifElse(R.is(String), R.identity, R.prop('value'));
|
package/es/DataEdit/DataEdit.js
CHANGED
|
@@ -5,34 +5,14 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import * as R from 'ramda';
|
|
6
6
|
import Grid from '@material-ui/core/Grid';
|
|
7
7
|
import Typography from '@material-ui/core/Typography';
|
|
8
|
-
import Container from '@material-ui/core/Container';
|
|
9
8
|
import Checkbox from '@material-ui/core/Checkbox';
|
|
10
|
-
import { makeStyles } from '@material-ui/styles';
|
|
11
9
|
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
12
10
|
import Input from './Input';
|
|
13
11
|
import { withBlank } from '../utils';
|
|
14
12
|
|
|
15
|
-
var useStyles = makeStyles(function (theme) {
|
|
16
|
-
return {
|
|
17
|
-
root: _extends({
|
|
18
|
-
padding: theme.spacing(0, 2, 1, 2)
|
|
19
|
-
}, R.pathOr({}, ['mixins', 'dataEdit', 'root'], theme)),
|
|
20
|
-
title: {
|
|
21
|
-
fontFamily: 'inherit'
|
|
22
|
-
},
|
|
23
|
-
checkboxes: {
|
|
24
|
-
display: 'flex',
|
|
25
|
-
justifyContent: 'space-around',
|
|
26
|
-
marginTop: theme.spacing(1)
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
|
|
31
13
|
var DataEdit = function DataEdit(_ref) {
|
|
32
14
|
var labels = _ref.labels,
|
|
33
15
|
properties = _ref.properties;
|
|
34
|
-
|
|
35
|
-
var classes = useStyles();
|
|
36
16
|
var _properties$title = properties.title,
|
|
37
17
|
title = _properties$title === undefined ? {} : _properties$title,
|
|
38
18
|
_properties$subtitle = properties.subtitle,
|
|
@@ -48,66 +28,61 @@ var DataEdit = function DataEdit(_ref) {
|
|
|
48
28
|
|
|
49
29
|
return React.createElement(
|
|
50
30
|
Grid,
|
|
51
|
-
{ 'data-testid': 'data-edit-test-id',
|
|
31
|
+
{ 'data-testid': 'data-edit-test-id', container: true, spacing: 1 },
|
|
52
32
|
React.createElement(
|
|
53
33
|
Grid,
|
|
54
34
|
{ item: true, xs: 12 },
|
|
55
35
|
React.createElement(
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
|
|
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
|
-
)
|
|
36
|
+
Typography,
|
|
37
|
+
{ variant: 'h6' },
|
|
38
|
+
'Information'
|
|
110
39
|
)
|
|
40
|
+
),
|
|
41
|
+
R.prop('isActive', title) && React.createElement(
|
|
42
|
+
Grid,
|
|
43
|
+
{ item: true, xs: 12, style: { minWidth: 220 } },
|
|
44
|
+
React.createElement(Input, _extends({
|
|
45
|
+
fullWidth: true,
|
|
46
|
+
label: R.prop('title', labels),
|
|
47
|
+
resetLabel: resetLabel
|
|
48
|
+
}, R.dissoc('isDefault', title)))
|
|
49
|
+
),
|
|
50
|
+
R.prop('isActive', subtitle) && React.createElement(
|
|
51
|
+
Grid,
|
|
52
|
+
{ item: true, xs: 12, style: { minWidth: 220 } },
|
|
53
|
+
React.createElement(Input, _extends({
|
|
54
|
+
fullWidth: true,
|
|
55
|
+
label: R.prop('subtitle', labels),
|
|
56
|
+
resetLabel: resetLabel
|
|
57
|
+
}, R.dissoc('isDefault', subtitle)))
|
|
58
|
+
),
|
|
59
|
+
R.prop('isActive', source) && React.createElement(
|
|
60
|
+
Grid,
|
|
61
|
+
{ item: true, xs: 12, style: { minWidth: 220 } },
|
|
62
|
+
React.createElement(Input, _extends({
|
|
63
|
+
fullWidth: true,
|
|
64
|
+
label: R.prop('source', labels),
|
|
65
|
+
resetLabel: resetLabel
|
|
66
|
+
}, R.dissoc('isDefault', source)))
|
|
67
|
+
),
|
|
68
|
+
React.createElement(
|
|
69
|
+
Grid,
|
|
70
|
+
{ item: true, container: true, xs: 12, justifyContent: 'space-around' },
|
|
71
|
+
R.map(function (item) {
|
|
72
|
+
if (R.pipe(R.prop('isActive'), R.not)(item)) return;
|
|
73
|
+
var id = R.prop('id')(item);
|
|
74
|
+
return React.createElement(
|
|
75
|
+
Grid,
|
|
76
|
+
{ item: true, key: id },
|
|
77
|
+
React.createElement(FormControlLabel, {
|
|
78
|
+
control: React.createElement(Checkbox, _extends({
|
|
79
|
+
color: 'primary',
|
|
80
|
+
inputProps: { 'aria-label': R.prop(id)(labels) }
|
|
81
|
+
}, R.omit(['isActive'])(item))),
|
|
82
|
+
label: R.prop(id)(labels)
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
})([logo, copyright])
|
|
111
86
|
)
|
|
112
87
|
);
|
|
113
88
|
};
|
package/es/Select/Select.js
CHANGED
|
@@ -6,12 +6,16 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
7
7
|
import TextField from '@material-ui/core/TextField';
|
|
8
8
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
9
|
+
import { Typography } from '@material-ui/core';
|
|
9
10
|
|
|
10
11
|
var useStyles = makeStyles(function (theme) {
|
|
11
12
|
return {
|
|
12
13
|
root: _extends({}, theme.typography.body2),
|
|
13
14
|
paper: {
|
|
14
15
|
maxHeight: 320
|
|
16
|
+
},
|
|
17
|
+
typo: {
|
|
18
|
+
whiteSpace: 'break-spaces'
|
|
15
19
|
}
|
|
16
20
|
};
|
|
17
21
|
});
|
|
@@ -51,9 +55,7 @@ var Select = function Select(_ref) {
|
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
useEffect(function () {
|
|
54
|
-
if (ref.current && open)
|
|
55
|
-
setWidth(ref.current.clientWidth);
|
|
56
|
-
}
|
|
58
|
+
if (ref.current && open) setWidth(ref.current.clientWidth);
|
|
57
59
|
}, [open]);
|
|
58
60
|
|
|
59
61
|
var getter = function getter(key) {
|
|
@@ -80,6 +82,7 @@ var Select = function Select(_ref) {
|
|
|
80
82
|
title: R.join(', ', labels),
|
|
81
83
|
onChange: handleChange,
|
|
82
84
|
variant: 'outlined',
|
|
85
|
+
margin: 'dense',
|
|
83
86
|
size: 'small',
|
|
84
87
|
fullWidth: true,
|
|
85
88
|
SelectProps: {
|
|
@@ -119,7 +122,11 @@ var Select = function Select(_ref) {
|
|
|
119
122
|
'aria-label': label,
|
|
120
123
|
title: label
|
|
121
124
|
},
|
|
122
|
-
label
|
|
125
|
+
isMultiple ? label : React.createElement(
|
|
126
|
+
Typography,
|
|
127
|
+
{ variant: 'inherit', className: classes.typo },
|
|
128
|
+
label
|
|
129
|
+
)
|
|
123
130
|
);
|
|
124
131
|
})(items)
|
|
125
132
|
);
|