@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,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
4
5
|
import AppBar from '@material-ui/core/AppBar';
|
|
@@ -6,6 +7,7 @@ import Toolbar from '@material-ui/core/Toolbar';
|
|
|
6
7
|
import Grid from '@material-ui/core/Grid';
|
|
7
8
|
import Typography from '@material-ui/core/Typography';
|
|
8
9
|
import { getIsRtl } from '../utils';
|
|
10
|
+
|
|
9
11
|
var useStyles = makeStyles(function (theme) {
|
|
10
12
|
return {
|
|
11
13
|
appBar: {
|
|
@@ -38,38 +40,43 @@ var SisccFooter = function SisccFooter(_ref) {
|
|
|
38
40
|
|
|
39
41
|
var leftLabel = _ref.leftLabel,
|
|
40
42
|
_ref$rightLabel = _ref.rightLabel,
|
|
41
|
-
rightLabel = _ref$rightLabel ===
|
|
43
|
+
rightLabel = _ref$rightLabel === undefined ? [] : _ref$rightLabel;
|
|
44
|
+
|
|
42
45
|
var classes = useStyles();
|
|
43
46
|
var theme = useTheme();
|
|
44
47
|
var isRtl = getIsRtl(theme);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className: classes.appBar
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
root: classes.root,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, rightLabel))));
|
|
48
|
+
|
|
49
|
+
return React.createElement(
|
|
50
|
+
AppBar,
|
|
51
|
+
{ 'data-testid': 'footer-bar-test-id', position: 'static', className: classes.appBar },
|
|
52
|
+
React.createElement(
|
|
53
|
+
Toolbar,
|
|
54
|
+
{ classes: { root: classes.root, gutters: classes.gutters } },
|
|
55
|
+
React.createElement(
|
|
56
|
+
Grid,
|
|
57
|
+
{ xs: 4, item: true, container: true, justifyContent: 'flex-start', alignItems: 'flex-start' },
|
|
58
|
+
React.createElement(
|
|
59
|
+
Typography,
|
|
60
|
+
{ variant: 'body2', className: cx(classes.leftLabel, (_cx = {}, _cx[classes.rtl] = isRtl, _cx)) },
|
|
61
|
+
leftLabel
|
|
62
|
+
)
|
|
63
|
+
),
|
|
64
|
+
React.createElement(
|
|
65
|
+
Grid,
|
|
66
|
+
{ xs: 8, item: true, container: true, justifyContent: 'flex-end', alignItems: 'flex-start' },
|
|
67
|
+
React.createElement(
|
|
68
|
+
Typography,
|
|
69
|
+
{ variant: 'body2', className: cx(classes.rightLabel, (_cx2 = {}, _cx2[classes.rtl] = !isRtl, _cx2)) },
|
|
70
|
+
rightLabel
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
);
|
|
73
75
|
};
|
|
74
76
|
|
|
77
|
+
SisccFooter.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
78
|
+
leftLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
79
|
+
rightLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
80
|
+
} : {};
|
|
81
|
+
|
|
75
82
|
export default SisccFooter;
|
package/es/SisccFooter/index.js
CHANGED
package/es/Spotlight/Fields.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import * as R from 'ramda';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import cx from 'classnames';
|
|
4
5
|
import Popover from '@material-ui/core/Popover';
|
|
5
6
|
import Button from '@material-ui/core/Button';
|
|
6
7
|
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
|
|
7
8
|
import Check from '@material-ui/icons/Check';
|
|
9
|
+
|
|
8
10
|
export var Field = function Field(_ref) {
|
|
9
11
|
var spotlight = _ref.spotlight,
|
|
10
12
|
onChangeField = _ref.onChangeField,
|
|
@@ -25,45 +27,77 @@ export var Field = function Field(_ref) {
|
|
|
25
27
|
|
|
26
28
|
var open = Boolean(anchorEl);
|
|
27
29
|
var id = open ? 'visions-spotlight-popover' : undefined;
|
|
28
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
29
|
-
"aria-describedby": id,
|
|
30
|
-
onClick: handleClick
|
|
31
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
32
|
-
className: classes.buttonContainer
|
|
33
|
-
}, R.prop('searchLabel', spotlight), /*#__PURE__*/React.createElement(ArrowDropDownIcon, {
|
|
34
|
-
fontSize: "small"
|
|
35
|
-
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
36
|
-
id: id,
|
|
37
|
-
open: open,
|
|
38
|
-
anchorEl: anchorEl,
|
|
39
|
-
onClose: handleClose,
|
|
40
|
-
anchorOrigin: {
|
|
41
|
-
vertical: 'bottom',
|
|
42
|
-
horizontal: 'center'
|
|
43
|
-
},
|
|
44
|
-
transformOrigin: {
|
|
45
|
-
vertical: 'top',
|
|
46
|
-
horizontal: 'center'
|
|
47
|
-
}
|
|
48
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
dir: isRtl ? 'rtl' : 'ltr',
|
|
50
|
-
className: classes.popoverButton
|
|
51
|
-
}, R.pipe(R.values, R.map(function (field) {
|
|
52
|
-
var _cx;
|
|
53
30
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
31
|
+
return React.createElement(
|
|
32
|
+
Fragment,
|
|
33
|
+
null,
|
|
34
|
+
React.createElement(
|
|
35
|
+
Button,
|
|
36
|
+
{ 'aria-describedby': id, onClick: handleClick },
|
|
37
|
+
React.createElement(
|
|
38
|
+
'div',
|
|
39
|
+
{ className: classes.buttonContainer },
|
|
40
|
+
R.prop('searchLabel', spotlight),
|
|
41
|
+
React.createElement(ArrowDropDownIcon, { fontSize: 'small' })
|
|
42
|
+
)
|
|
43
|
+
),
|
|
44
|
+
React.createElement(
|
|
45
|
+
Popover,
|
|
46
|
+
{
|
|
47
|
+
id: id,
|
|
48
|
+
open: open,
|
|
49
|
+
anchorEl: anchorEl,
|
|
50
|
+
onClose: handleClose,
|
|
51
|
+
anchorOrigin: {
|
|
52
|
+
vertical: 'bottom',
|
|
53
|
+
horizontal: 'center'
|
|
54
|
+
},
|
|
55
|
+
transformOrigin: {
|
|
56
|
+
vertical: 'top',
|
|
57
|
+
horizontal: 'center'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
React.createElement(
|
|
61
|
+
'div',
|
|
62
|
+
{ dir: isRtl ? 'rtl' : 'ltr', className: classes.popoverButton },
|
|
63
|
+
R.pipe(R.values, R.map(function (field) {
|
|
64
|
+
var _cx;
|
|
65
|
+
|
|
66
|
+
return React.createElement(
|
|
67
|
+
Button,
|
|
68
|
+
{
|
|
69
|
+
key: field.id,
|
|
70
|
+
className: classes.buttonContainer,
|
|
71
|
+
onClick: onChangeField(field),
|
|
72
|
+
disabled: field.disabled
|
|
73
|
+
},
|
|
74
|
+
React.createElement(Check, {
|
|
75
|
+
fontSize: 'small',
|
|
76
|
+
className: cx((_cx = {}, _cx[classes.selected] = !R.prop('isSelected')(field), _cx))
|
|
77
|
+
}),
|
|
78
|
+
React.createElement(spotlight.FieldLabelRenderer, { id: field.id })
|
|
79
|
+
);
|
|
80
|
+
}))(R.prop('fields', spotlight))
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
);
|
|
66
84
|
};
|
|
85
|
+
|
|
86
|
+
Field.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
87
|
+
classes: PropTypes.object,
|
|
88
|
+
spotlight: PropTypes.shape({
|
|
89
|
+
fields: PropTypes.shape({
|
|
90
|
+
id: PropTypes.string,
|
|
91
|
+
isSelected: PropTypes.bool,
|
|
92
|
+
disabled: PropTypes.bool
|
|
93
|
+
}),
|
|
94
|
+
searchLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
95
|
+
FieldLabelRenderer: PropTypes.func
|
|
96
|
+
}),
|
|
97
|
+
onChangeField: PropTypes.func.isRequired,
|
|
98
|
+
isRtl: PropTypes.bool
|
|
99
|
+
} : {};
|
|
100
|
+
|
|
67
101
|
Field.defaultProps = {
|
|
68
102
|
spotlight: {}
|
|
69
103
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import * as R from 'ramda';
|
|
4
5
|
import ArrowForward from '@material-ui/icons/ArrowForward';
|
|
@@ -13,6 +14,7 @@ import { Field } from './Fields';
|
|
|
13
14
|
import { useStyles } from './useStyles';
|
|
14
15
|
import { useSpotlight } from './useSpotlight';
|
|
15
16
|
import Cross from '../Icons/Cross';
|
|
17
|
+
|
|
16
18
|
var size = R.pipe(R.values, R.length);
|
|
17
19
|
|
|
18
20
|
var Spotlight = function Spotlight(_ref) {
|
|
@@ -28,7 +30,7 @@ var Spotlight = function Spotlight(_ref) {
|
|
|
28
30
|
fullWidth = _ref.fullWidth,
|
|
29
31
|
className = _ref.className,
|
|
30
32
|
_ref$testId = _ref.testId,
|
|
31
|
-
testId = _ref$testId ===
|
|
33
|
+
testId = _ref$testId === undefined ? 'spotlight' : _ref$testId;
|
|
32
34
|
|
|
33
35
|
var _useSpotlight = useSpotlight(hasCommit, term, defaultSpotlight, action),
|
|
34
36
|
value = _useSpotlight.value,
|
|
@@ -44,57 +46,96 @@ var Spotlight = function Spotlight(_ref) {
|
|
|
44
46
|
var classes = useStyles();
|
|
45
47
|
var theme = useTheme();
|
|
46
48
|
var isRtl = R.equals('rtl', R.prop('direction', theme));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
54
|
-
className: classes.leftIcon,
|
|
55
|
-
disabled: true,
|
|
56
|
-
"aria-label": "search"
|
|
57
|
-
}, /*#__PURE__*/React.createElement(Search, null)), /*#__PURE__*/React.createElement(InputBase, {
|
|
58
|
-
inputProps: {
|
|
59
|
-
'aria-label': placeholder,
|
|
60
|
-
'data-testid': testId + "_input"
|
|
61
|
-
},
|
|
62
|
-
className: classes.input,
|
|
63
|
-
classes: {
|
|
64
|
-
root: classes.inputBase,
|
|
65
|
-
input: classes.inputBaseMargin
|
|
66
|
-
},
|
|
67
|
-
placeholder: placeholder,
|
|
68
|
-
onKeyPress: onKeyPress,
|
|
69
|
-
value: value,
|
|
70
|
-
onChange: onChangeTerm,
|
|
71
|
-
onFocus: function onFocus() {
|
|
72
|
-
return setFocus(true);
|
|
49
|
+
|
|
50
|
+
return React.createElement(
|
|
51
|
+
'div',
|
|
52
|
+
{
|
|
53
|
+
'data-testid': testId,
|
|
54
|
+
className: cx(R.prop('container', className), (_cx = {}, _cx[classes.container] = withBorder, _cx[classes.containerFocus] = isFocus, _cx[classes.fullWidth] = fullWidth, _cx[classes.defaultWidth] = !fullWidth, _cx))
|
|
73
55
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
56
|
+
React.createElement(
|
|
57
|
+
Paper,
|
|
58
|
+
{ className: classes.root, elevation: 0 },
|
|
59
|
+
React.createElement(
|
|
60
|
+
IconButton,
|
|
61
|
+
{ className: classes.leftIcon, disabled: true, 'aria-label': 'search' },
|
|
62
|
+
React.createElement(Search, null)
|
|
63
|
+
),
|
|
64
|
+
React.createElement(InputBase, {
|
|
65
|
+
inputProps: {
|
|
66
|
+
'aria-label': placeholder,
|
|
67
|
+
'data-testid': testId + '_input'
|
|
68
|
+
},
|
|
69
|
+
className: classes.input,
|
|
70
|
+
classes: { root: classes.inputBase, input: classes.inputBaseMargin },
|
|
71
|
+
placeholder: placeholder,
|
|
72
|
+
onKeyPress: onKeyPress,
|
|
73
|
+
value: value,
|
|
74
|
+
onChange: onChangeTerm,
|
|
75
|
+
onFocus: function onFocus() {
|
|
76
|
+
return setFocus(true);
|
|
77
|
+
},
|
|
78
|
+
onBlur: function onBlur() {
|
|
79
|
+
return setFocus(false);
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
hasClearAll && !R.isEmpty(value) ? React.createElement(
|
|
83
|
+
IconButton,
|
|
84
|
+
{
|
|
85
|
+
'aria-label': 'Clear',
|
|
86
|
+
onClick: onClearTerm,
|
|
87
|
+
className: cx(classes.rightIcon, classes.clear)
|
|
88
|
+
},
|
|
89
|
+
React.createElement(Cross, null)
|
|
90
|
+
) : null,
|
|
91
|
+
R.gt(size(R.prop('fields', spotlight)), 1) ? React.createElement(
|
|
92
|
+
Fragment,
|
|
93
|
+
null,
|
|
94
|
+
React.createElement(Divider, { className: classes.divider }),
|
|
95
|
+
React.createElement(Field, {
|
|
96
|
+
spotlight: spotlight,
|
|
97
|
+
onChangeField: onChangeField,
|
|
98
|
+
isRtl: isRtl,
|
|
99
|
+
term: value,
|
|
100
|
+
classes: classes
|
|
101
|
+
})
|
|
102
|
+
) : null,
|
|
103
|
+
hasCommit ? React.createElement(
|
|
104
|
+
Fragment,
|
|
105
|
+
null,
|
|
106
|
+
React.createElement(Divider, { className: classes.divider }),
|
|
107
|
+
React.createElement(
|
|
108
|
+
IconButton,
|
|
109
|
+
{
|
|
110
|
+
disabled: R.isEmpty(value),
|
|
111
|
+
color: 'primary',
|
|
112
|
+
className: classes.rightIcon,
|
|
113
|
+
'aria-label': 'commit',
|
|
114
|
+
onClick: onCommitTerm
|
|
115
|
+
},
|
|
116
|
+
isRtl ? React.createElement(ArrowBack, null) : React.createElement(ArrowForward, null)
|
|
117
|
+
)
|
|
118
|
+
) : null
|
|
119
|
+
)
|
|
120
|
+
);
|
|
98
121
|
};
|
|
99
122
|
|
|
123
|
+
Spotlight.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
124
|
+
term: PropTypes.string,
|
|
125
|
+
testId: PropTypes.string,
|
|
126
|
+
placeholder: PropTypes.string,
|
|
127
|
+
defaultSpotlight: PropTypes.shape({
|
|
128
|
+
fields: PropTypes.object,
|
|
129
|
+
searchLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
130
|
+
FieldLabelRenderer: PropTypes.func
|
|
131
|
+
}),
|
|
132
|
+
action: PropTypes.func,
|
|
133
|
+
hasClearAll: PropTypes.bool,
|
|
134
|
+
hasCommit: PropTypes.bool,
|
|
135
|
+
withBorder: PropTypes.bool,
|
|
136
|
+
fullWidth: PropTypes.bool,
|
|
137
|
+
classes: PropTypes.object,
|
|
138
|
+
className: PropTypes.object
|
|
139
|
+
} : {};
|
|
140
|
+
|
|
100
141
|
export default Spotlight;
|
package/es/Spotlight/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
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 { useState, useEffect } from 'react';
|
|
3
4
|
import * as R from 'ramda';
|
|
4
|
-
export var useSpotlight = function useSpotlight(hasCommit, defaultTerm, defaultSpotlight, action) {
|
|
5
|
-
if (defaultTerm === void 0) {
|
|
6
|
-
defaultTerm = '';
|
|
7
|
-
}
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export var useSpotlight = function useSpotlight(hasCommit) {
|
|
7
|
+
var defaultTerm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
8
|
+
var defaultSpotlight = arguments[2];
|
|
9
|
+
var action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};
|
|
12
10
|
|
|
13
11
|
var _useState = useState(defaultTerm),
|
|
14
12
|
term = _useState[0],
|
|
@@ -16,7 +14,7 @@ export var useSpotlight = function useSpotlight(hasCommit, defaultTerm, defaultS
|
|
|
16
14
|
|
|
17
15
|
var _useState2 = useState(defaultSpotlight),
|
|
18
16
|
_useState2$ = _useState2[0],
|
|
19
|
-
spotlight = _useState2$ ===
|
|
17
|
+
spotlight = _useState2$ === undefined ? {} : _useState2$,
|
|
20
18
|
setSpotlight = _useState2[1];
|
|
21
19
|
|
|
22
20
|
var _useState3 = useState(false),
|
|
@@ -29,36 +27,25 @@ export var useSpotlight = function useSpotlight(hasCommit, defaultTerm, defaultS
|
|
|
29
27
|
}, [defaultTerm, defaultSpotlight]);
|
|
30
28
|
|
|
31
29
|
var onKeyPress = function onKeyPress(event) {
|
|
32
|
-
if (event.key === 'Enter') return action({
|
|
33
|
-
term: term,
|
|
34
|
-
spotlight: spotlight
|
|
35
|
-
});
|
|
30
|
+
if (event.key === 'Enter') return action({ term: term, spotlight: spotlight });
|
|
36
31
|
};
|
|
37
32
|
|
|
38
33
|
var onClearTerm = function onClearTerm(event) {
|
|
39
34
|
event.preventDefault();
|
|
40
35
|
setTerm('');
|
|
41
|
-
return action({
|
|
42
|
-
term: ''
|
|
43
|
-
});
|
|
36
|
+
return action({ term: '' });
|
|
44
37
|
};
|
|
45
38
|
|
|
46
39
|
var onChangeTerm = function onChangeTerm(event) {
|
|
47
40
|
event.preventDefault();
|
|
48
41
|
var newTerm = R.propOr('', 'value')(event.target);
|
|
49
42
|
setTerm(newTerm);
|
|
50
|
-
return hasCommit ? null : action({
|
|
51
|
-
term: newTerm,
|
|
52
|
-
spotlight: spotlight
|
|
53
|
-
});
|
|
43
|
+
return hasCommit ? null : action({ term: newTerm, spotlight: spotlight });
|
|
54
44
|
};
|
|
55
45
|
|
|
56
46
|
var onCommitTerm = function onCommitTerm(event) {
|
|
57
47
|
event.preventDefault();
|
|
58
|
-
return action({
|
|
59
|
-
term: term,
|
|
60
|
-
spotlight: spotlight
|
|
61
|
-
});
|
|
48
|
+
return action({ term: term, spotlight: spotlight });
|
|
62
49
|
};
|
|
63
50
|
|
|
64
51
|
var onChangeField = function onChangeField(field) {
|
|
@@ -66,18 +53,11 @@ export var useSpotlight = function useSpotlight(hasCommit, defaultTerm, defaultS
|
|
|
66
53
|
var _extends2;
|
|
67
54
|
|
|
68
55
|
event.preventDefault();
|
|
69
|
-
|
|
70
56
|
var newSpotlight = _extends({}, spotlight, {
|
|
71
|
-
fields: _extends({}, spotlight.fields, (_extends2 = {}, _extends2[field.id] = _extends({}, field, {
|
|
72
|
-
isSelected: !field.isSelected
|
|
73
|
-
}), _extends2))
|
|
57
|
+
fields: _extends({}, spotlight.fields, (_extends2 = {}, _extends2[field.id] = _extends({}, field, { isSelected: !field.isSelected }), _extends2))
|
|
74
58
|
});
|
|
75
|
-
|
|
76
59
|
setSpotlight(newSpotlight);
|
|
77
|
-
return action({
|
|
78
|
-
term: term,
|
|
79
|
-
spotlight: newSpotlight
|
|
80
|
-
});
|
|
60
|
+
return action({ term: term, spotlight: newSpotlight });
|
|
81
61
|
};
|
|
82
62
|
};
|
|
83
63
|
|
|
@@ -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 * as R from 'ramda';
|
|
3
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
+
|
|
4
6
|
export var useStyles = makeStyles(function (theme) {
|
|
5
7
|
return {
|
|
6
8
|
container: {
|
|
@@ -22,7 +24,7 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
22
24
|
root: {
|
|
23
25
|
display: 'flex',
|
|
24
26
|
alignItems: 'center',
|
|
25
|
-
border:
|
|
27
|
+
border: 'solid 1px ' + theme.palette.grey[400],
|
|
26
28
|
paddingRight: theme.spacing(1)
|
|
27
29
|
},
|
|
28
30
|
input: {
|