@sis-cc/dotstatsuite-visions 6.5.2 → 6.6.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/Alert/Alert.js +66 -135
- package/es/Alert/index.js +0 -1
- package/es/ApiQueries/ApiQueries.js +45 -79
- package/es/ApiQueries/Query.js +65 -105
- package/es/ApiQueries/index.js +0 -1
- package/es/AuthDialog/index.js +62 -103
- package/es/Breadcrumbs/Breadcrumbs.js +21 -38
- package/es/Breadcrumbs/index.js +0 -1
- package/es/Button/Button.js +11 -28
- package/es/Button/index.js +0 -1
- package/es/ChartsConfig/Axis.js +72 -76
- package/es/ChartsConfig/ButtonGroup.js +29 -51
- package/es/ChartsConfig/ChartsConfig.js +87 -187
- package/es/ChartsConfig/ContainerTitle.js +15 -36
- package/es/ChartsConfig/Focus.js +37 -48
- package/es/ChartsConfig/Frequency.js +24 -36
- package/es/ChartsConfig/Series.js +28 -43
- package/es/ChartsConfig/Size.js +36 -50
- package/es/ChartsConfig/index.js +0 -1
- package/es/ChartsConfig/styles.js +4 -4
- package/es/ChartsConfig/utils.js +1 -5
- package/es/Chips/Chips.js +99 -154
- package/es/Chips/index.js +0 -1
- package/es/CollapseButtons/CollapseButtons.js +61 -101
- package/es/CollapseButtons/Item.js +45 -70
- package/es/CollapseButtons/Paper.js +7 -21
- package/es/CollapseButtons/index.js +0 -1
- package/es/DataEdit/DataEdit.js +67 -124
- package/es/DataEdit/Input.js +27 -58
- package/es/DataEdit/index.js +0 -1
- package/es/DataFooter/DataFooter.js +68 -115
- package/es/DataFooter/index.js +0 -1
- package/es/DataHeader/DataHeader.js +75 -113
- package/es/DataHeader/Flags.js +8 -21
- package/es/DataHeader/Title.js +2 -15
- package/es/DataHeader/TooltipHeader.js +33 -63
- package/es/DataHeader/index.js +0 -1
- package/es/DataHeader/utils.js +8 -8
- package/es/Dataflow/Dataflow.js +132 -226
- package/es/Dataflow/index.js +0 -1
- package/es/ExpansionPanel/ExpansionPanel.js +42 -79
- package/es/ExpansionPanel/index.js +0 -1
- package/es/ExpansionPanel/styles.js +3 -5
- package/es/Icons/AccessibilityFilled.js +6 -8
- package/es/Icons/AccessibilityOutlined.js +6 -8
- package/es/Icons/AccountFilled.js +6 -8
- package/es/Icons/AccountOutlined.js +6 -8
- package/es/Icons/Api.js +6 -8
- package/es/Icons/Asterisk.js +6 -8
- package/es/Icons/Bar.js +6 -8
- package/es/Icons/CopyContent.js +6 -8
- package/es/Icons/Cross.js +6 -8
- package/es/Icons/HSymbol.js +6 -8
- package/es/Icons/Row.js +6 -8
- package/es/Icons/Scatter.js +6 -8
- package/es/Icons/StackedBar.js +6 -8
- package/es/Icons/StackedRow.js +6 -8
- package/es/Icons/Timeline.js +6 -8
- package/es/Icons/VSymbol.js +6 -8
- package/es/Icons/Warning.js +11 -14
- package/es/Icons/index.js +0 -1
- package/es/Input/Input.js +26 -56
- package/es/Input/index.js +0 -1
- package/es/Input/with-input.js +30 -25
- package/es/InputNumber/InputNumber.js +31 -51
- package/es/InputNumber/index.js +0 -1
- package/es/LabelDivider/LabelDivider.js +7 -18
- package/es/LabelDivider/index.js +0 -1
- package/es/Loading/Loading.js +9 -18
- package/es/Loading/index.js +0 -1
- package/es/Logo/Logo.js +11 -17
- package/es/Logo/index.js +0 -1
- package/es/NoData/NoData.js +17 -25
- package/es/NoData/index.js +0 -1
- package/es/Pagination/Pagination.js +70 -114
- package/es/Pagination/index.js +0 -1
- package/es/PeriodPicker/PeriodPicker.js +101 -124
- package/es/PeriodPicker/constants.js +78 -13
- package/es/PeriodPicker/index.js +0 -1
- package/es/PeriodPicker/lib.js +37 -23
- package/es/PeriodPicker/styles.js +0 -1
- package/es/ScopeList/Header.js +41 -60
- package/es/ScopeList/Item.js +98 -144
- package/es/ScopeList/ScopeList.js +132 -184
- package/es/ScopeList/Selection.js +51 -93
- package/es/ScopeList/index.js +0 -1
- package/es/ScopeList/styles.js +2 -3
- package/es/ScopeList/with-scope-list.js +151 -88
- package/es/Select/Select.js +44 -60
- package/es/Select/index.js +0 -1
- package/es/Share/Form.js +58 -88
- package/es/Share/Mode.js +30 -46
- package/es/Share/Share.js +41 -64
- package/es/Share/index.js +0 -1
- package/es/SisccFooter/SisccFooter.js +29 -36
- package/es/SisccFooter/index.js +0 -1
- package/es/Spotlight/Fields.js +37 -71
- package/es/Spotlight/Spotlight.js +51 -92
- package/es/Spotlight/index.js +0 -1
- package/es/Spotlight/useSpotlight.js +33 -13
- package/es/Spotlight/useStyles.js +2 -4
- package/es/Table/Table.js +50 -71
- package/es/Table/header.js +36 -50
- package/es/Table/index.js +0 -1
- package/es/Table/itemCell.js +13 -25
- package/es/Table/row-header.js +31 -50
- package/es/Table/section-header.js +30 -55
- package/es/Table/section-rows.js +38 -62
- package/es/Table/styles.js +2 -8
- package/es/Table/tableCell.js +7 -17
- package/es/Table/tooltip.js +21 -41
- package/es/Table/useStyles.js +2 -3
- package/es/Table/valueCell.js +26 -41
- package/es/TableFooter/TableFooter.js +42 -70
- package/es/TableFooter/index.js +0 -1
- package/es/TableHeader/TableHeader.js +18 -36
- package/es/TableHeader/index.js +0 -1
- package/es/TableHtml5/TableHtml5.js +71 -68
- package/es/TableHtml5/cell.js +35 -55
- package/es/TableHtml5/flags.js +29 -58
- package/es/TableHtml5/header.js +48 -66
- package/es/TableHtml5/index.js +0 -1
- package/es/TableHtml5/section.js +86 -120
- package/es/TableHtml5/sectionHeader.js +45 -72
- package/es/TableHtml5/subHeader.js +48 -58
- package/es/TableLayout/Box.js +33 -66
- package/es/TableLayout/DnDItem.js +37 -68
- package/es/TableLayout/TableLayout.js +105 -177
- package/es/TableLayout/constants.js +0 -2
- package/es/TableLayout/index.js +0 -1
- package/es/TableLayout/lib.js +1 -3
- package/es/TablePreview/TablePreview.js +99 -176
- package/es/TablePreview/index.js +0 -1
- package/es/TablePreview/lib.js +5 -4
- package/es/TablePreview/styles.js +0 -1
- package/es/Tag/Tag.js +5 -21
- package/es/Tag/index.js +0 -1
- package/es/ToggleButton/ToggleButton.js +17 -29
- package/es/ToggleButton/index.js +0 -1
- package/es/Tooltip/Tooltip.js +20 -32
- package/es/Tooltip/index.js +0 -1
- package/es/VerticalButton/VerticalButton.js +17 -22
- package/es/VerticalButton/index.js +0 -1
- package/es/index.js +2 -4
- package/es/theme.js +22 -14
- package/es/utils.js +16 -14
- package/lib/Alert/Alert.js +87 -168
- package/lib/Alert/index.js +7 -12
- package/lib/ApiQueries/ApiQueries.js +61 -105
- package/lib/ApiQueries/Query.js +85 -132
- package/lib/ApiQueries/index.js +7 -12
- package/lib/AuthDialog/index.js +82 -137
- package/lib/Breadcrumbs/Breadcrumbs.js +39 -68
- package/lib/Breadcrumbs/index.js +7 -12
- package/lib/Button/Button.js +28 -47
- package/lib/Button/index.js +7 -12
- package/lib/ChartsConfig/Axis.js +88 -100
- package/lib/ChartsConfig/ButtonGroup.js +43 -74
- package/lib/ChartsConfig/ChartsConfig.js +113 -236
- package/lib/ChartsConfig/ContainerTitle.js +30 -59
- package/lib/ChartsConfig/Focus.js +53 -71
- package/lib/ChartsConfig/Frequency.js +39 -59
- package/lib/ChartsConfig/Series.js +45 -70
- package/lib/ChartsConfig/Size.js +53 -77
- package/lib/ChartsConfig/index.js +7 -12
- package/lib/ChartsConfig/styles.js +16 -11
- package/lib/ChartsConfig/utils.js +14 -13
- package/lib/Chips/Chips.js +122 -192
- package/lib/Chips/index.js +7 -12
- package/lib/CollapseButtons/CollapseButtons.js +84 -134
- package/lib/CollapseButtons/Item.js +64 -98
- package/lib/CollapseButtons/Paper.js +19 -41
- package/lib/CollapseButtons/index.js +7 -12
- package/lib/DataEdit/DataEdit.js +88 -156
- package/lib/DataEdit/Input.js +42 -82
- package/lib/DataEdit/index.js +7 -12
- package/lib/DataFooter/DataFooter.js +88 -144
- package/lib/DataFooter/index.js +7 -12
- package/lib/DataHeader/DataHeader.js +106 -158
- package/lib/DataHeader/Flags.js +18 -34
- package/lib/DataHeader/Title.js +11 -27
- package/lib/DataHeader/TooltipHeader.js +48 -79
- package/lib/DataHeader/index.js +7 -12
- package/lib/DataHeader/utils.js +16 -10
- package/lib/Dataflow/Dataflow.js +159 -277
- package/lib/Dataflow/index.js +7 -12
- package/lib/ExpansionPanel/ExpansionPanel.js +63 -116
- package/lib/ExpansionPanel/index.js +7 -12
- package/lib/ExpansionPanel/styles.js +15 -12
- package/lib/Icons/AccessibilityFilled.js +15 -17
- package/lib/Icons/AccessibilityOutlined.js +15 -17
- package/lib/Icons/AccountFilled.js +15 -17
- package/lib/Icons/AccountOutlined.js +15 -17
- package/lib/Icons/Api.js +15 -17
- package/lib/Icons/Asterisk.js +15 -17
- package/lib/Icons/Bar.js +15 -17
- package/lib/Icons/CopyContent.js +15 -17
- package/lib/Icons/Cross.js +15 -17
- package/lib/Icons/HSymbol.js +15 -17
- package/lib/Icons/Row.js +15 -17
- package/lib/Icons/Scatter.js +15 -17
- package/lib/Icons/StackedBar.js +15 -17
- package/lib/Icons/StackedRow.js +15 -17
- package/lib/Icons/Timeline.js +15 -17
- package/lib/Icons/VSymbol.js +15 -17
- package/lib/Icons/Warning.js +27 -31
- package/lib/Icons/index.js +68 -152
- package/lib/Input/Input.js +47 -85
- package/lib/Input/index.js +7 -12
- package/lib/Input/with-input.js +38 -35
- package/lib/InputNumber/InputNumber.js +50 -80
- package/lib/InputNumber/index.js +7 -12
- package/lib/LabelDivider/LabelDivider.js +23 -37
- package/lib/LabelDivider/index.js +7 -12
- package/lib/Loading/Loading.js +20 -35
- package/lib/Loading/index.js +7 -12
- package/lib/Logo/Logo.js +20 -28
- package/lib/Logo/index.js +7 -12
- package/lib/NoData/NoData.js +28 -42
- package/lib/NoData/index.js +7 -12
- package/lib/Pagination/Pagination.js +91 -150
- package/lib/Pagination/index.js +7 -12
- package/lib/PeriodPicker/PeriodPicker.js +121 -150
- package/lib/PeriodPicker/constants.js +126 -37
- package/lib/PeriodPicker/index.js +7 -12
- package/lib/PeriodPicker/lib.js +99 -61
- package/lib/PeriodPicker/styles.js +7 -4
- package/lib/ScopeList/Header.js +58 -88
- package/lib/ScopeList/Item.js +116 -177
- package/lib/ScopeList/ScopeList.js +160 -234
- package/lib/ScopeList/Selection.js +70 -131
- package/lib/ScopeList/index.js +7 -12
- package/lib/ScopeList/styles.js +10 -9
- package/lib/ScopeList/with-scope-list.js +199 -108
- package/lib/Select/Select.js +59 -80
- package/lib/Select/index.js +7 -12
- package/lib/Share/Form.js +77 -119
- package/lib/Share/Mode.js +49 -78
- package/lib/Share/Share.js +59 -91
- package/lib/Share/index.js +7 -12
- package/lib/SisccFooter/SisccFooter.js +44 -63
- package/lib/SisccFooter/index.js +7 -12
- package/lib/Spotlight/Fields.js +54 -100
- package/lib/Spotlight/Spotlight.js +75 -136
- package/lib/Spotlight/index.js +7 -12
- package/lib/Spotlight/useSpotlight.js +44 -20
- package/lib/Spotlight/useStyles.js +15 -12
- package/lib/Table/Table.js +69 -102
- package/lib/Table/header.js +51 -70
- package/lib/Table/index.js +7 -12
- package/lib/Table/itemCell.js +25 -41
- package/lib/Table/row-header.js +49 -75
- package/lib/Table/section-header.js +50 -82
- package/lib/Table/section-rows.js +60 -94
- package/lib/Table/styles.js +23 -25
- package/lib/Table/tableCell.js +19 -37
- package/lib/Table/tooltip.js +36 -54
- package/lib/Table/useStyles.js +11 -8
- package/lib/Table/valueCell.js +39 -59
- package/lib/TableFooter/TableFooter.js +57 -93
- package/lib/TableFooter/index.js +7 -12
- package/lib/TableHeader/TableHeader.js +32 -56
- package/lib/TableHeader/index.js +7 -12
- package/lib/TableHtml5/TableHtml5.js +90 -97
- package/lib/TableHtml5/cell.js +52 -84
- package/lib/TableHtml5/flags.js +48 -82
- package/lib/TableHtml5/header.js +66 -96
- package/lib/TableHtml5/index.js +8 -17
- package/lib/TableHtml5/section.js +111 -162
- package/lib/TableHtml5/sectionHeader.js +64 -102
- package/lib/TableHtml5/subHeader.js +68 -88
- package/lib/TableLayout/Box.js +54 -97
- package/lib/TableLayout/DnDItem.js +58 -98
- package/lib/TableLayout/TableLayout.js +140 -232
- package/lib/TableLayout/constants.js +8 -6
- package/lib/TableLayout/index.js +7 -12
- package/lib/TableLayout/lib.js +14 -9
- package/lib/TablePreview/TablePreview.js +118 -205
- package/lib/TablePreview/index.js +7 -12
- package/lib/TablePreview/lib.js +30 -19
- package/lib/TablePreview/styles.js +7 -6
- package/lib/Tag/Tag.js +19 -38
- package/lib/Tag/index.js +7 -12
- package/lib/ToggleButton/ToggleButton.js +33 -55
- package/lib/ToggleButton/index.js +7 -12
- package/lib/Tooltip/Tooltip.js +34 -50
- package/lib/Tooltip/index.js +7 -12
- package/lib/VerticalButton/VerticalButton.js +40 -46
- package/lib/VerticalButton/index.js +7 -12
- package/lib/index.js +137 -304
- package/lib/theme.js +31 -17
- package/lib/utils.js +46 -31
- package/package.json +2 -10
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import _extends from "/builds/sis-cc/.stat-suite/dotstatsuite-visions/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/extends";
|
|
3
2
|
import React, { Fragment, useRef, useEffect, useState } from 'react';
|
|
4
3
|
import * as R from 'ramda';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
4
|
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer';
|
|
7
5
|
import VirtualizedList from 'react-virtualized/dist/commonjs/List';
|
|
8
6
|
import { useTheme } from '@material-ui/core';
|
|
@@ -20,7 +18,6 @@ import { ExpansionPanel, Tag as InternalTag, VerticalButton, Tooltip } from '../
|
|
|
20
18
|
import { useStyles, height as rowHeight } from './styles';
|
|
21
19
|
import { withBlank, getIsRtl } from '../utils';
|
|
22
20
|
import { getItemsGroupByLevel } from './with-scope-list';
|
|
23
|
-
|
|
24
21
|
var getLevels = R.pipe(R.map(R.all(R.prop('isSelected'))), R.toPairs, R.when(R.pipe(R.length, R.equals(1)), R.always([])));
|
|
25
22
|
|
|
26
23
|
var ScopeList = function ScopeList(props) {
|
|
@@ -28,7 +25,7 @@ var ScopeList = function ScopeList(props) {
|
|
|
28
25
|
items = props.items,
|
|
29
26
|
itemsById = props.itemsById,
|
|
30
27
|
_props$list = props.list,
|
|
31
|
-
list = _props$list ===
|
|
28
|
+
list = _props$list === void 0 ? [] : _props$list,
|
|
32
29
|
currentItem = props.currentItem,
|
|
33
30
|
changeList = props.changeList,
|
|
34
31
|
changeSelection = props.changeSelection,
|
|
@@ -45,13 +42,13 @@ var ScopeList = function ScopeList(props) {
|
|
|
45
42
|
labels = props.labels,
|
|
46
43
|
accessibility = props.accessibility,
|
|
47
44
|
_props$expansionPanel = props.expansionPanelProps,
|
|
48
|
-
expansionPanelProps = _props$expansionPanel ===
|
|
45
|
+
expansionPanelProps = _props$expansionPanel === void 0 ? {} : _props$expansionPanel,
|
|
49
46
|
isCurrentListAllSelected = props.isCurrentListAllSelected,
|
|
50
47
|
bulkSelection = props.bulkSelection,
|
|
51
48
|
changeMultiSelectionKeyUp = props.changeMultiSelectionKeyUp,
|
|
52
49
|
changeMouseSelection = props.changeMouseSelection,
|
|
53
50
|
_props$labelRenderer = props.labelRenderer,
|
|
54
|
-
labelRenderer = _props$labelRenderer ===
|
|
51
|
+
labelRenderer = _props$labelRenderer === void 0 ? R.prop('label') : _props$labelRenderer,
|
|
55
52
|
disableAccessor = props.disableAccessor;
|
|
56
53
|
|
|
57
54
|
var _useState = useState(false),
|
|
@@ -63,7 +60,9 @@ var ScopeList = function ScopeList(props) {
|
|
|
63
60
|
setScrollTop = _useState2[1];
|
|
64
61
|
|
|
65
62
|
var ref = useRef();
|
|
66
|
-
var classes = useStyles({
|
|
63
|
+
var classes = useStyles({
|
|
64
|
+
accessibility: accessibility
|
|
65
|
+
});
|
|
67
66
|
var theme = useTheme();
|
|
68
67
|
|
|
69
68
|
var _useState3 = useState(false),
|
|
@@ -83,7 +82,6 @@ var ScopeList = function ScopeList(props) {
|
|
|
83
82
|
var selectionLabels = R.prop('selection')(labels);
|
|
84
83
|
var rowCount = R.length(list);
|
|
85
84
|
var maxHeight = R.pipe(R.length, R.multiply(rowHeight), R.ifElse(R.gt(250), R.add(10), R.always(250)))(list);
|
|
86
|
-
|
|
87
85
|
useEffect(function () {
|
|
88
86
|
if (!isLoading) return;
|
|
89
87
|
setTimeout(function () {
|
|
@@ -93,9 +91,9 @@ var ScopeList = function ScopeList(props) {
|
|
|
93
91
|
setIsLoading(false);
|
|
94
92
|
}, 0);
|
|
95
93
|
}, [isLoading, items, itemsById, disableAccessor]);
|
|
96
|
-
|
|
97
94
|
useEffect(function () {
|
|
98
95
|
var current = ref.current;
|
|
96
|
+
|
|
99
97
|
var handler = function handler(event) {
|
|
100
98
|
if (R.or(event.ctrlKey, event.shiftKey)) {
|
|
101
99
|
// ugly hack, to get div element created by react-virtuliase (get scroll height)
|
|
@@ -103,205 +101,155 @@ var ScopeList = function ScopeList(props) {
|
|
|
103
101
|
var scrollEl = R.path(['children', 0, 'children', 0], current);
|
|
104
102
|
var isBottom = R.gte(R.add(R.prop('scrollTop')(scrollEl), R.prop('clientHeight')(scrollEl)), R.prop('scrollHeight')(scrollEl));
|
|
105
103
|
var nextpos = (scrollTop || 0) + event.deltaY / 2;
|
|
104
|
+
|
|
106
105
|
if (R.or(event.deltaY < 0, event.deltaY > 0 && R.not(isBottom))) {
|
|
107
106
|
setScrollTop(nextpos < 0 ? 0 : nextpos);
|
|
108
107
|
}
|
|
108
|
+
|
|
109
109
|
event.preventDefault();
|
|
110
110
|
}
|
|
111
|
+
|
|
111
112
|
if (R.not(event.ctrlKey) && R.not(event.shiftKey)) {
|
|
112
113
|
setScrollTop(undefined); // should be undefined if the user want use the normal scroll
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
|
-
if (R.isNil(current)) return;
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
if (R.isNil(current)) return;
|
|
118
|
+
current.addEventListener('wheel', handler, {
|
|
119
|
+
passive: false
|
|
120
|
+
});
|
|
118
121
|
return function () {
|
|
119
|
-
current.removeEventListener('wheel', handler, {
|
|
122
|
+
current.removeEventListener('wheel', handler, {
|
|
123
|
+
passive: false
|
|
124
|
+
});
|
|
120
125
|
};
|
|
121
126
|
}, [scrollTop]);
|
|
122
127
|
|
|
123
128
|
var handleMenu = function handleMenu() {
|
|
124
129
|
setIsMenuOpen(!isMenuOpen);
|
|
130
|
+
|
|
125
131
|
if (R.not(isMenuOpen)) {
|
|
126
132
|
setIsLoading(true);
|
|
127
133
|
}
|
|
128
134
|
};
|
|
129
135
|
|
|
130
|
-
return React.createElement(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
|
136
|
+
return /*#__PURE__*/React.createElement(ExpansionPanel, _extends({
|
|
137
|
+
isOpen: R.equals(id, activePanelId),
|
|
138
|
+
id: id,
|
|
139
|
+
testId: "" + testId,
|
|
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
|
|
216
159
|
},
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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, {
|
|
168
|
+
id: id,
|
|
169
|
+
setIsLoading: setIsLoading,
|
|
170
|
+
isOpen: isMenuOpen,
|
|
171
|
+
classes: classes,
|
|
172
|
+
items: items,
|
|
173
|
+
levels: levels,
|
|
174
|
+
itemsGroupByLevel: itemGroupByLevel,
|
|
175
|
+
itemsById: itemsById,
|
|
176
|
+
labels: selectionLabels,
|
|
177
|
+
isCurrentListAllSelected: isCurrentListAllSelected,
|
|
178
|
+
changeMutliSelection: changeMutliSelection,
|
|
179
|
+
changeLevelSelection: changeLevelSelection
|
|
180
|
+
})), currentItem && /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: classes.containerHeader
|
|
182
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
183
|
+
testId: testId,
|
|
184
|
+
classes: classes,
|
|
185
|
+
isRtl: isRtl,
|
|
186
|
+
changeList: changeList,
|
|
187
|
+
accessibility: accessibility,
|
|
188
|
+
items: currentItem,
|
|
189
|
+
labels: labels,
|
|
190
|
+
labelRenderer: labelRenderer
|
|
191
|
+
}))),
|
|
192
|
+
tag: /*#__PURE__*/React.createElement(Chip, {
|
|
193
|
+
items: list
|
|
194
|
+
}, tagValue),
|
|
195
|
+
isBlank: isBlank
|
|
196
|
+
}, expansionPanelProps), /*#__PURE__*/React.createElement(List, {
|
|
197
|
+
disablePadding: true,
|
|
198
|
+
style: {
|
|
199
|
+
height: maxHeight
|
|
200
|
+
},
|
|
201
|
+
onKeyUp: changeMultiSelectionKeyUp,
|
|
202
|
+
onMouseLeave: R.is(Function, changeMouseSelection) ? changeMouseSelection(null, {
|
|
203
|
+
isUp: true
|
|
204
|
+
}) : null,
|
|
205
|
+
ref: ref
|
|
206
|
+
}, /*#__PURE__*/React.createElement(AutoSizer, null, function (_ref) {
|
|
207
|
+
var height = _ref.height,
|
|
208
|
+
width = _ref.width;
|
|
209
|
+
return /*#__PURE__*/React.createElement(VirtualizedList, {
|
|
210
|
+
ref: ref,
|
|
211
|
+
overscan: 10,
|
|
212
|
+
tabIndex: -1,
|
|
213
|
+
height: height,
|
|
214
|
+
width: width,
|
|
215
|
+
scrollTop: scrollTop // control scroll position with ctrl or shift key
|
|
216
|
+
,
|
|
217
|
+
rowCount: rowCount,
|
|
218
|
+
rowHeight: R.add(1)(rowHeight) // 1 is space between elements
|
|
219
|
+
,
|
|
220
|
+
rowRenderer: function rowRenderer(_ref2) {
|
|
221
|
+
var index = _ref2.index,
|
|
222
|
+
style = _ref2.style;
|
|
223
|
+
//if (isScrolling) return <div style={style}>...</div>
|
|
224
|
+
var item = R.nth(index, list);
|
|
225
|
+
return /*#__PURE__*/React.createElement(Item, _extends({
|
|
226
|
+
labelRenderer: labelRenderer,
|
|
227
|
+
index: index,
|
|
228
|
+
style: style,
|
|
229
|
+
testId: testId + "_" + id,
|
|
230
|
+
key: item.id,
|
|
231
|
+
classes: classes,
|
|
232
|
+
isRtl: isRtl,
|
|
233
|
+
changeList: changeList,
|
|
234
|
+
changeSelection: changeSelection,
|
|
235
|
+
changeMouseSelection: changeMouseSelection,
|
|
236
|
+
ariaLabel: R.prop('navigateNext')(labels),
|
|
237
|
+
NavigateIcon: isRtl ? NavigateBefore : NavigateNext,
|
|
238
|
+
accessibility: accessibility
|
|
239
|
+
}, item, {
|
|
240
|
+
isDisabled: disableAccessor(item),
|
|
241
|
+
label: labelRenderer(item)
|
|
242
|
+
}));
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
})));
|
|
262
246
|
};
|
|
263
247
|
|
|
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
|
-
|
|
302
248
|
export default R.compose(withBlank(function (_ref3) {
|
|
303
249
|
var _ref3$items = _ref3.items,
|
|
304
|
-
items = _ref3$items ===
|
|
250
|
+
items = _ref3$items === void 0 ? [] : _ref3$items,
|
|
305
251
|
isBlank = _ref3.isBlank;
|
|
306
|
-
return {
|
|
252
|
+
return {
|
|
253
|
+
isBlank: R.or(R.isEmpty(items), isBlank)
|
|
254
|
+
};
|
|
307
255
|
}), withScopeList)(ScopeList);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as R from 'ramda';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import List from '@material-ui/core/List';
|
|
5
4
|
import ListItem from '@material-ui/core/ListItem';
|
|
6
5
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
@@ -17,38 +16,27 @@ var CustomListItem = function CustomListItem(_ref) {
|
|
|
17
16
|
classes = _ref.classes,
|
|
18
17
|
action = _ref.action,
|
|
19
18
|
isSelected = _ref.isSelected;
|
|
20
|
-
return React.createElement(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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))
|
|
19
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
20
|
+
dense: true,
|
|
21
|
+
button: true,
|
|
22
|
+
onClick: function onClick(e) {
|
|
23
|
+
return action(e);
|
|
34
24
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
color: 'primary',
|
|
39
|
-
variant: 'body2'
|
|
25
|
+
onKeyPress: function onKeyPress(e) {
|
|
26
|
+
if (e.key === 'Enter') {
|
|
27
|
+
action(e);
|
|
40
28
|
}
|
|
41
|
-
}
|
|
42
|
-
|
|
29
|
+
},
|
|
30
|
+
className: cx(classes.listItemContainer, (_cx = {}, _cx[classes.listItemSelected] = isSelected, _cx))
|
|
31
|
+
}, /*#__PURE__*/React.createElement(ListItemText, {
|
|
32
|
+
primary: label,
|
|
33
|
+
primaryTypographyProps: {
|
|
34
|
+
color: 'primary',
|
|
35
|
+
variant: 'body2'
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
43
38
|
};
|
|
44
39
|
|
|
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
|
-
|
|
52
40
|
var Selection = function Selection(_ref2) {
|
|
53
41
|
var id = _ref2.id,
|
|
54
42
|
labels = _ref2.labels,
|
|
@@ -60,70 +48,40 @@ var Selection = function Selection(_ref2) {
|
|
|
60
48
|
levels = _ref2.levels,
|
|
61
49
|
itemsGroupByLevel = _ref2.itemsGroupByLevel,
|
|
62
50
|
setIsLoading = _ref2.setIsLoading;
|
|
63
|
-
return React.createElement(
|
|
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
|
-
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
|
-
);
|
|
51
|
+
return /*#__PURE__*/React.createElement(Collapse, {
|
|
52
|
+
in: isOpen
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Paper, {
|
|
54
|
+
elevation: 2
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: classes.selectionContainer
|
|
57
|
+
}, /*#__PURE__*/React.createElement(List, null, /*#__PURE__*/React.createElement(ListItem, {
|
|
58
|
+
dense: true
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
60
|
+
variant: "body2"
|
|
61
|
+
}, R.prop('title')(labels))), /*#__PURE__*/React.createElement(CustomListItem, {
|
|
62
|
+
classes: classes,
|
|
63
|
+
label: R.prop('currentLevel')(labels),
|
|
64
|
+
action: function action(e) {
|
|
65
|
+
// move setLoading in the main file when with-scope-list will be deleted
|
|
66
|
+
setIsLoading(true);
|
|
67
|
+
changeMutliSelection(e);
|
|
68
|
+
},
|
|
69
|
+
isSelected: isCurrentListAllSelected
|
|
70
|
+
}), R.not(R.isEmpty(levels)) && /*#__PURE__*/React.createElement(Divider, null), R.map(function (_ref3) {
|
|
71
|
+
var level = _ref3[0],
|
|
72
|
+
isLevelSelected = _ref3[1];
|
|
73
|
+
return /*#__PURE__*/React.createElement(CustomListItem, {
|
|
74
|
+
key: "bulkSelection-" + id + "-" + level,
|
|
75
|
+
classes: classes,
|
|
76
|
+
label: R.prop('level')(labels) + " " + R.add(1)(Number(level)),
|
|
77
|
+
action: function action(e) {
|
|
78
|
+
// move setLoading in the main file when with-scope-list will be deleted
|
|
79
|
+
setIsLoading(true);
|
|
80
|
+
changeLevelSelection(itemsGroupByLevel)(level, isLevelSelected)(e);
|
|
81
|
+
},
|
|
82
|
+
isSelected: isLevelSelected
|
|
83
|
+
});
|
|
84
|
+
})(levels)))));
|
|
114
85
|
};
|
|
115
86
|
|
|
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
|
-
|
|
129
87
|
export default Selection;
|
package/es/ScopeList/index.js
CHANGED
package/es/ScopeList/styles.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core/styles';
|
|
2
2
|
export var height = 30;
|
|
3
|
-
|
|
4
3
|
export var useStyles = makeStyles(function (theme) {
|
|
5
4
|
return {
|
|
6
5
|
middle: {
|
|
@@ -10,7 +9,7 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
10
9
|
margin: theme.spacing(1)
|
|
11
10
|
},
|
|
12
11
|
containerHeader: {
|
|
13
|
-
borderBottom:
|
|
12
|
+
borderBottom: "6px solid " + theme.palette.grey[100],
|
|
14
13
|
marginBottom: '1px'
|
|
15
14
|
},
|
|
16
15
|
listItemContainer: {
|
|
@@ -122,7 +121,7 @@ export var useStyles = makeStyles(function (theme) {
|
|
|
122
121
|
},
|
|
123
122
|
containerArrow: {
|
|
124
123
|
paddingLeft: 4,
|
|
125
|
-
borderLeft:
|
|
124
|
+
borderLeft: "1px solid " + theme.palette.grey[800],
|
|
126
125
|
color: theme.palette.primary.main,
|
|
127
126
|
height: '100%',
|
|
128
127
|
display: 'flex',
|