@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, useRef, useEffect, useState } from 'react';
|
|
3
4
|
import * as R from 'ramda';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
4
6
|
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer';
|
|
5
7
|
import VirtualizedList from 'react-virtualized/dist/commonjs/List';
|
|
6
8
|
import { useTheme } from '@material-ui/core';
|
|
@@ -18,6 +20,7 @@ import { ExpansionPanel, Tag as InternalTag, VerticalButton, Tooltip } from '../
|
|
|
18
20
|
import { useStyles, height as rowHeight } from './styles';
|
|
19
21
|
import { withBlank, getIsRtl } from '../utils';
|
|
20
22
|
import { getItemsGroupByLevel } from './with-scope-list';
|
|
23
|
+
|
|
21
24
|
var getLevels = R.pipe(R.map(R.all(R.prop('isSelected'))), R.toPairs, R.when(R.pipe(R.length, R.equals(1)), R.always([])));
|
|
22
25
|
|
|
23
26
|
var ScopeList = function ScopeList(props) {
|
|
@@ -25,7 +28,7 @@ var ScopeList = function ScopeList(props) {
|
|
|
25
28
|
items = props.items,
|
|
26
29
|
itemsById = props.itemsById,
|
|
27
30
|
_props$list = props.list,
|
|
28
|
-
list = _props$list ===
|
|
31
|
+
list = _props$list === undefined ? [] : _props$list,
|
|
29
32
|
currentItem = props.currentItem,
|
|
30
33
|
changeList = props.changeList,
|
|
31
34
|
changeSelection = props.changeSelection,
|
|
@@ -42,13 +45,13 @@ var ScopeList = function ScopeList(props) {
|
|
|
42
45
|
labels = props.labels,
|
|
43
46
|
accessibility = props.accessibility,
|
|
44
47
|
_props$expansionPanel = props.expansionPanelProps,
|
|
45
|
-
expansionPanelProps = _props$expansionPanel ===
|
|
48
|
+
expansionPanelProps = _props$expansionPanel === undefined ? {} : _props$expansionPanel,
|
|
46
49
|
isCurrentListAllSelected = props.isCurrentListAllSelected,
|
|
47
50
|
bulkSelection = props.bulkSelection,
|
|
48
51
|
changeMultiSelectionKeyUp = props.changeMultiSelectionKeyUp,
|
|
49
52
|
changeMouseSelection = props.changeMouseSelection,
|
|
50
53
|
_props$labelRenderer = props.labelRenderer,
|
|
51
|
-
labelRenderer = _props$labelRenderer ===
|
|
54
|
+
labelRenderer = _props$labelRenderer === undefined ? R.prop('label') : _props$labelRenderer,
|
|
52
55
|
disableAccessor = props.disableAccessor;
|
|
53
56
|
|
|
54
57
|
var _useState = useState(false),
|
|
@@ -60,9 +63,7 @@ var ScopeList = function ScopeList(props) {
|
|
|
60
63
|
setScrollTop = _useState2[1];
|
|
61
64
|
|
|
62
65
|
var ref = useRef();
|
|
63
|
-
var classes = useStyles({
|
|
64
|
-
accessibility: accessibility
|
|
65
|
-
});
|
|
66
|
+
var classes = useStyles({ accessibility: accessibility });
|
|
66
67
|
var theme = useTheme();
|
|
67
68
|
|
|
68
69
|
var _useState3 = useState(false),
|
|
@@ -82,6 +83,7 @@ var ScopeList = function ScopeList(props) {
|
|
|
82
83
|
var selectionLabels = R.prop('selection')(labels);
|
|
83
84
|
var rowCount = R.length(list);
|
|
84
85
|
var maxHeight = R.pipe(R.length, R.multiply(rowHeight), R.ifElse(R.gt(250), R.add(10), R.always(250)))(list);
|
|
86
|
+
|
|
85
87
|
useEffect(function () {
|
|
86
88
|
if (!isLoading) return;
|
|
87
89
|
setTimeout(function () {
|
|
@@ -91,9 +93,9 @@ var ScopeList = function ScopeList(props) {
|
|
|
91
93
|
setIsLoading(false);
|
|
92
94
|
}, 0);
|
|
93
95
|
}, [isLoading, items, itemsById, disableAccessor]);
|
|
96
|
+
|
|
94
97
|
useEffect(function () {
|
|
95
98
|
var current = ref.current;
|
|
96
|
-
|
|
97
99
|
var handler = function handler(event) {
|
|
98
100
|
if (R.or(event.ctrlKey, event.shiftKey)) {
|
|
99
101
|
// ugly hack, to get div element created by react-virtuliase (get scroll height)
|
|
@@ -101,155 +103,205 @@ var ScopeList = function ScopeList(props) {
|
|
|
101
103
|
var scrollEl = R.path(['children', 0, 'children', 0], current);
|
|
102
104
|
var isBottom = R.gte(R.add(R.prop('scrollTop')(scrollEl), R.prop('clientHeight')(scrollEl)), R.prop('scrollHeight')(scrollEl));
|
|
103
105
|
var nextpos = (scrollTop || 0) + event.deltaY / 2;
|
|
104
|
-
|
|
105
106
|
if (R.or(event.deltaY < 0, event.deltaY > 0 && R.not(isBottom))) {
|
|
106
107
|
setScrollTop(nextpos < 0 ? 0 : nextpos);
|
|
107
108
|
}
|
|
108
|
-
|
|
109
109
|
event.preventDefault();
|
|
110
110
|
}
|
|
111
|
-
|
|
112
111
|
if (R.not(event.ctrlKey) && R.not(event.shiftKey)) {
|
|
113
112
|
setScrollTop(undefined); // should be undefined if the user want use the normal scroll
|
|
114
113
|
}
|
|
115
114
|
};
|
|
116
|
-
|
|
117
115
|
if (R.isNil(current)) return;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
});
|
|
116
|
+
|
|
117
|
+
current.addEventListener('wheel', handler, { passive: false });
|
|
121
118
|
return function () {
|
|
122
|
-
current.removeEventListener('wheel', handler, {
|
|
123
|
-
passive: false
|
|
124
|
-
});
|
|
119
|
+
current.removeEventListener('wheel', handler, { passive: false });
|
|
125
120
|
};
|
|
126
121
|
}, [scrollTop]);
|
|
127
122
|
|
|
128
123
|
var handleMenu = function handleMenu() {
|
|
129
124
|
setIsMenuOpen(!isMenuOpen);
|
|
130
|
-
|
|
131
125
|
if (R.not(isMenuOpen)) {
|
|
132
126
|
setIsLoading(true);
|
|
133
127
|
}
|
|
134
128
|
};
|
|
135
129
|
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
label: labelRenderer(props),
|
|
141
|
-
onChangeActivePanel: onChangeActivePanel,
|
|
142
|
-
overflow: true,
|
|
143
|
-
topElementComponent: /*#__PURE__*/React.createElement(Fragment, null, TopElementComponent && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Container, {
|
|
144
|
-
disableGutters: true,
|
|
145
|
-
className: classes.spotlightContainer
|
|
146
|
-
}, /*#__PURE__*/React.createElement(TopElementComponent, _extends({
|
|
147
|
-
className: {
|
|
148
|
-
container: classes.middle
|
|
149
|
-
}
|
|
150
|
-
}, topElementProps, props)), bulkSelection && /*#__PURE__*/React.createElement(Tooltip, {
|
|
151
|
-
key: id,
|
|
152
|
-
placement: "bottom",
|
|
153
|
-
variant: "light",
|
|
154
|
-
title: R.prop('title')(selectionLabels)
|
|
155
|
-
}, /*#__PURE__*/React.createElement(VerticalButton, {
|
|
156
|
-
"aria-label": R.prop('title')(selectionLabels),
|
|
157
|
-
classes: {
|
|
158
|
-
root: classes.bulkSelectionIcon
|
|
159
|
-
},
|
|
160
|
-
onClick: handleMenu,
|
|
161
|
-
selected: isMenuOpen
|
|
162
|
-
}, isLoading ? /*#__PURE__*/React.createElement(HourglassEmptyIcon, {
|
|
163
|
-
size: 24,
|
|
164
|
-
color: "primary"
|
|
165
|
-
}) : /*#__PURE__*/React.createElement(PlaylistAddCheckIcon, {
|
|
166
|
-
color: "primary"
|
|
167
|
-
})))), bulkSelection && /*#__PURE__*/React.createElement(Selection, {
|
|
130
|
+
return React.createElement(
|
|
131
|
+
ExpansionPanel,
|
|
132
|
+
_extends({
|
|
133
|
+
isOpen: R.equals(id, activePanelId),
|
|
168
134
|
id: id,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
135
|
+
testId: '' + testId,
|
|
136
|
+
label: labelRenderer(props),
|
|
137
|
+
onChangeActivePanel: onChangeActivePanel,
|
|
138
|
+
overflow: true,
|
|
139
|
+
topElementComponent: React.createElement(
|
|
140
|
+
Fragment,
|
|
141
|
+
null,
|
|
142
|
+
TopElementComponent && React.createElement(
|
|
143
|
+
Fragment,
|
|
144
|
+
null,
|
|
145
|
+
React.createElement(
|
|
146
|
+
Container,
|
|
147
|
+
{ disableGutters: true, className: classes.spotlightContainer },
|
|
148
|
+
React.createElement(TopElementComponent, _extends({
|
|
149
|
+
className: { container: classes.middle }
|
|
150
|
+
}, topElementProps, props)),
|
|
151
|
+
bulkSelection && React.createElement(
|
|
152
|
+
Tooltip,
|
|
153
|
+
{
|
|
154
|
+
key: id,
|
|
155
|
+
placement: 'bottom',
|
|
156
|
+
variant: 'light',
|
|
157
|
+
title: R.prop('title')(selectionLabels)
|
|
158
|
+
},
|
|
159
|
+
React.createElement(
|
|
160
|
+
VerticalButton,
|
|
161
|
+
{
|
|
162
|
+
'aria-label': R.prop('title')(selectionLabels),
|
|
163
|
+
classes: { root: classes.bulkSelectionIcon },
|
|
164
|
+
onClick: handleMenu,
|
|
165
|
+
selected: isMenuOpen
|
|
166
|
+
},
|
|
167
|
+
isLoading ? React.createElement(HourglassEmptyIcon, { size: 24, color: 'primary' }) : React.createElement(PlaylistAddCheckIcon, { color: 'primary' })
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
),
|
|
171
|
+
bulkSelection && React.createElement(Selection, {
|
|
172
|
+
id: id,
|
|
173
|
+
setIsLoading: setIsLoading,
|
|
174
|
+
isOpen: isMenuOpen,
|
|
175
|
+
classes: classes,
|
|
176
|
+
items: items,
|
|
177
|
+
levels: levels,
|
|
178
|
+
itemsGroupByLevel: itemGroupByLevel,
|
|
179
|
+
itemsById: itemsById,
|
|
180
|
+
labels: selectionLabels,
|
|
181
|
+
isCurrentListAllSelected: isCurrentListAllSelected,
|
|
182
|
+
changeMutliSelection: changeMutliSelection,
|
|
183
|
+
changeLevelSelection: changeLevelSelection
|
|
184
|
+
})
|
|
185
|
+
),
|
|
186
|
+
currentItem && React.createElement(
|
|
187
|
+
'div',
|
|
188
|
+
{ className: classes.containerHeader },
|
|
189
|
+
React.createElement(Header, {
|
|
190
|
+
testId: testId,
|
|
191
|
+
classes: classes,
|
|
192
|
+
isRtl: isRtl,
|
|
193
|
+
changeList: changeList,
|
|
194
|
+
accessibility: accessibility,
|
|
195
|
+
items: currentItem,
|
|
196
|
+
labels: labels,
|
|
197
|
+
labelRenderer: labelRenderer
|
|
198
|
+
})
|
|
199
|
+
)
|
|
200
|
+
),
|
|
201
|
+
tag: React.createElement(
|
|
202
|
+
Chip,
|
|
203
|
+
{ items: list },
|
|
204
|
+
tagValue
|
|
205
|
+
),
|
|
206
|
+
isBlank: isBlank
|
|
207
|
+
}, expansionPanelProps),
|
|
208
|
+
React.createElement(
|
|
209
|
+
List,
|
|
210
|
+
{
|
|
211
|
+
disablePadding: true,
|
|
212
|
+
style: { height: maxHeight },
|
|
213
|
+
onKeyUp: changeMultiSelectionKeyUp,
|
|
214
|
+
onMouseLeave: R.is(Function, changeMouseSelection) ? changeMouseSelection(null, { isUp: true }) : null,
|
|
215
|
+
ref: ref
|
|
216
|
+
},
|
|
217
|
+
React.createElement(
|
|
218
|
+
AutoSizer,
|
|
219
|
+
null,
|
|
220
|
+
function (_ref) {
|
|
221
|
+
var height = _ref.height,
|
|
222
|
+
width = _ref.width;
|
|
223
|
+
return React.createElement(VirtualizedList, {
|
|
224
|
+
ref: ref,
|
|
225
|
+
overscan: 10,
|
|
226
|
+
tabIndex: -1,
|
|
227
|
+
height: height,
|
|
228
|
+
width: width,
|
|
229
|
+
scrollTop: scrollTop // control scroll position with ctrl or shift key
|
|
230
|
+
, rowCount: rowCount,
|
|
231
|
+
rowHeight: R.add(1)(rowHeight) // 1 is space between elements
|
|
232
|
+
, rowRenderer: function rowRenderer(_ref2) {
|
|
233
|
+
var index = _ref2.index,
|
|
234
|
+
style = _ref2.style;
|
|
235
|
+
|
|
236
|
+
//if (isScrolling) return <div style={style}>...</div>
|
|
237
|
+
var item = R.nth(index, list);
|
|
238
|
+
return React.createElement(Item, _extends({
|
|
239
|
+
labelRenderer: labelRenderer,
|
|
240
|
+
index: index,
|
|
241
|
+
style: style,
|
|
242
|
+
testId: testId + '_' + id,
|
|
243
|
+
key: item.id,
|
|
244
|
+
classes: classes,
|
|
245
|
+
isRtl: isRtl,
|
|
246
|
+
changeList: changeList,
|
|
247
|
+
changeSelection: changeSelection,
|
|
248
|
+
changeMouseSelection: changeMouseSelection,
|
|
249
|
+
ariaLabel: R.prop('navigateNext')(labels),
|
|
250
|
+
NavigateIcon: isRtl ? NavigateBefore : NavigateNext,
|
|
251
|
+
accessibility: accessibility
|
|
252
|
+
}, item, {
|
|
253
|
+
isDisabled: disableAccessor(item),
|
|
254
|
+
label: labelRenderer(item)
|
|
255
|
+
}));
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
)
|
|
261
|
+
);
|
|
246
262
|
};
|
|
247
263
|
|
|
264
|
+
ScopeList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
265
|
+
testId: PropTypes.string,
|
|
266
|
+
accessibility: PropTypes.bool,
|
|
267
|
+
bulkSelection: PropTypes.bool,
|
|
268
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
269
|
+
list: PropTypes.array,
|
|
270
|
+
currentItem: PropTypes.array,
|
|
271
|
+
classes: PropTypes.object,
|
|
272
|
+
changeList: PropTypes.func,
|
|
273
|
+
changeSelection: PropTypes.func,
|
|
274
|
+
changeMutliSelection: PropTypes.func,
|
|
275
|
+
changeLevelSelection: PropTypes.func,
|
|
276
|
+
changeMultiSelectionKeyUp: PropTypes.func,
|
|
277
|
+
changeMouseSelection: PropTypes.func,
|
|
278
|
+
onChangeActivePanel: PropTypes.func,
|
|
279
|
+
activePanelId: PropTypes.string,
|
|
280
|
+
TopElementComponent: PropTypes.func,
|
|
281
|
+
topElementProps: PropTypes.object,
|
|
282
|
+
Tag: PropTypes.func,
|
|
283
|
+
tagValue: PropTypes.node,
|
|
284
|
+
isBlank: PropTypes.bool,
|
|
285
|
+
isCurrentListAllSelected: PropTypes.bool,
|
|
286
|
+
labels: PropTypes.shape({
|
|
287
|
+
navigateNext: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
288
|
+
backHelper: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
289
|
+
selection: PropTypes.shape({
|
|
290
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
291
|
+
currentLevel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
292
|
+
level: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
293
|
+
})
|
|
294
|
+
}),
|
|
295
|
+
expansionPanelProps: PropTypes.object,
|
|
296
|
+
labelRenderer: PropTypes.func,
|
|
297
|
+
disableAccessor: PropTypes.func,
|
|
298
|
+
items: PropTypes.array,
|
|
299
|
+
itemsById: PropTypes.object
|
|
300
|
+
} : {};
|
|
301
|
+
|
|
248
302
|
export default R.compose(withBlank(function (_ref3) {
|
|
249
303
|
var _ref3$items = _ref3.items,
|
|
250
|
-
items = _ref3$items ===
|
|
304
|
+
items = _ref3$items === undefined ? [] : _ref3$items,
|
|
251
305
|
isBlank = _ref3.isBlank;
|
|
252
|
-
return {
|
|
253
|
-
isBlank: R.or(R.isEmpty(items), isBlank)
|
|
254
|
-
};
|
|
306
|
+
return { isBlank: R.or(R.isEmpty(items), isBlank) };
|
|
255
307
|
}), withScopeList)(ScopeList);
|
|
@@ -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 List from '@material-ui/core/List';
|
|
4
5
|
import ListItem from '@material-ui/core/ListItem';
|
|
5
6
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
@@ -16,27 +17,38 @@ var CustomListItem = function CustomListItem(_ref) {
|
|
|
16
17
|
classes = _ref.classes,
|
|
17
18
|
action = _ref.action,
|
|
18
19
|
isSelected = _ref.isSelected;
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
return React.createElement(
|
|
21
|
+
ListItem,
|
|
22
|
+
{
|
|
23
|
+
dense: true,
|
|
24
|
+
button: true,
|
|
25
|
+
onClick: function onClick(e) {
|
|
26
|
+
return action(e);
|
|
27
|
+
},
|
|
28
|
+
onKeyPress: function onKeyPress(e) {
|
|
29
|
+
if (e.key === 'Enter') {
|
|
30
|
+
action(e);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
className: cx(classes.listItemContainer, (_cx = {}, _cx[classes.listItemSelected] = isSelected, _cx))
|
|
24
34
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
React.createElement(ListItemText, {
|
|
36
|
+
primary: label,
|
|
37
|
+
primaryTypographyProps: {
|
|
38
|
+
color: 'primary',
|
|
39
|
+
variant: 'body2'
|
|
28
40
|
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
}, /*#__PURE__*/React.createElement(ListItemText, {
|
|
32
|
-
primary: label,
|
|
33
|
-
primaryTypographyProps: {
|
|
34
|
-
color: 'primary',
|
|
35
|
-
variant: 'body2'
|
|
36
|
-
}
|
|
37
|
-
}));
|
|
41
|
+
})
|
|
42
|
+
);
|
|
38
43
|
};
|
|
39
44
|
|
|
45
|
+
CustomListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
46
|
+
classes: PropTypes.object,
|
|
47
|
+
label: PropTypes.string,
|
|
48
|
+
action: PropTypes.func,
|
|
49
|
+
isSelected: PropTypes.bool
|
|
50
|
+
} : {};
|
|
51
|
+
|
|
40
52
|
var Selection = function Selection(_ref2) {
|
|
41
53
|
var id = _ref2.id,
|
|
42
54
|
labels = _ref2.labels,
|
|
@@ -48,40 +60,70 @@ var Selection = function Selection(_ref2) {
|
|
|
48
60
|
levels = _ref2.levels,
|
|
49
61
|
itemsGroupByLevel = _ref2.itemsGroupByLevel,
|
|
50
62
|
setIsLoading = _ref2.setIsLoading;
|
|
51
|
-
return
|
|
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
|
-
|
|
63
|
+
return React.createElement(
|
|
64
|
+
Collapse,
|
|
65
|
+
{ 'in': isOpen },
|
|
66
|
+
React.createElement(
|
|
67
|
+
Paper,
|
|
68
|
+
{ elevation: 2 },
|
|
69
|
+
React.createElement(
|
|
70
|
+
'div',
|
|
71
|
+
{ className: classes.selectionContainer },
|
|
72
|
+
React.createElement(
|
|
73
|
+
List,
|
|
74
|
+
null,
|
|
75
|
+
React.createElement(
|
|
76
|
+
ListItem,
|
|
77
|
+
{ dense: true },
|
|
78
|
+
React.createElement(
|
|
79
|
+
Typography,
|
|
80
|
+
{ variant: 'body2' },
|
|
81
|
+
R.prop('title')(labels)
|
|
82
|
+
)
|
|
83
|
+
),
|
|
84
|
+
React.createElement(CustomListItem, {
|
|
85
|
+
classes: classes,
|
|
86
|
+
label: R.prop('currentLevel')(labels),
|
|
87
|
+
action: function action(e) {
|
|
88
|
+
// move setLoading in the main file when with-scope-list will be deleted
|
|
89
|
+
setIsLoading(true);
|
|
90
|
+
changeMutliSelection(e);
|
|
91
|
+
},
|
|
92
|
+
isSelected: isCurrentListAllSelected
|
|
93
|
+
}),
|
|
94
|
+
R.not(R.isEmpty(levels)) && React.createElement(Divider, null),
|
|
95
|
+
R.map(function (_ref3) {
|
|
96
|
+
var level = _ref3[0],
|
|
97
|
+
isLevelSelected = _ref3[1];
|
|
98
|
+
return React.createElement(CustomListItem, {
|
|
99
|
+
key: 'bulkSelection-' + id + '-' + level,
|
|
100
|
+
classes: classes,
|
|
101
|
+
label: R.prop('level')(labels) + ' ' + R.add(1)(Number(level)),
|
|
102
|
+
action: function action(e) {
|
|
103
|
+
// move setLoading in the main file when with-scope-list will be deleted
|
|
104
|
+
setIsLoading(true);
|
|
105
|
+
changeLevelSelection(itemsGroupByLevel)(level, isLevelSelected)(e);
|
|
106
|
+
},
|
|
107
|
+
isSelected: isLevelSelected
|
|
108
|
+
});
|
|
109
|
+
})(levels)
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
);
|
|
85
114
|
};
|
|
86
115
|
|
|
116
|
+
Selection.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
117
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
118
|
+
labels: PropTypes.object,
|
|
119
|
+
isOpen: PropTypes.bool,
|
|
120
|
+
classes: PropTypes.object,
|
|
121
|
+
changeMutliSelection: PropTypes.func,
|
|
122
|
+
changeLevelSelection: PropTypes.func,
|
|
123
|
+
isCurrentListAllSelected: PropTypes.bool,
|
|
124
|
+
levels: PropTypes.array,
|
|
125
|
+
itemsGroupByLevel: PropTypes.object,
|
|
126
|
+
setIsLoading: PropTypes.func
|
|
127
|
+
} : {};
|
|
128
|
+
|
|
87
129
|
export default Selection;
|
package/es/ScopeList/index.js
CHANGED
package/es/ScopeList/styles.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core/styles';
|
|
2
2
|
export var height = 30;
|
|
3
|
+
|
|
3
4
|
export var useStyles = makeStyles(function (theme) {
|
|
4
5
|
return {
|
|
5
6
|
middle: {
|
|
@@ -9,7 +10,7 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
9
10
|
margin: theme.spacing(1)
|
|
10
11
|
},
|
|
11
12
|
containerHeader: {
|
|
12
|
-
borderBottom:
|
|
13
|
+
borderBottom: '6px solid ' + theme.palette.grey[100],
|
|
13
14
|
marginBottom: '1px'
|
|
14
15
|
},
|
|
15
16
|
listItemContainer: {
|
|
@@ -121,7 +122,7 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
121
122
|
},
|
|
122
123
|
containerArrow: {
|
|
123
124
|
paddingLeft: 4,
|
|
124
|
-
borderLeft:
|
|
125
|
+
borderLeft: '1px solid ' + theme.palette.grey[800],
|
|
125
126
|
color: theme.palette.primary.main,
|
|
126
127
|
height: '100%',
|
|
127
128
|
display: 'flex',
|