@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,31 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("/builds/sis-cc/.stat-suite/dotstatsuite-visions/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
1
|
+
'use strict';
|
|
4
2
|
|
|
5
3
|
exports.__esModule = true;
|
|
6
|
-
exports.withScopeList = exports.
|
|
4
|
+
exports.withScopeList = exports.setSelection = exports.setAllTo = exports.getIsAllSelected = exports.getItemsGroupByLevel = exports.getItemsIds = exports.getEnhancedNode = exports.getScopeList = exports.getList = exports.getMainList = exports.getCurrentList = exports.withHasChild = exports.getPlaceholder = exports.getItemsIndexedByParentId = exports.getIsBlank = undefined;
|
|
5
|
+
|
|
6
|
+
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; }; /* eslint react/prop-types: 0 */
|
|
7
|
+
|
|
7
8
|
|
|
8
|
-
var
|
|
9
|
+
var _react = require('react');
|
|
9
10
|
|
|
10
|
-
var
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
11
12
|
|
|
12
|
-
var
|
|
13
|
+
var _ramda = require('ramda');
|
|
13
14
|
|
|
14
|
-
var
|
|
15
|
+
var R = _interopRequireWildcard(_ramda);
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
+
var _utils = require('../utils');
|
|
17
18
|
|
|
18
|
-
var
|
|
19
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
25
26
|
|
|
26
|
-
function
|
|
27
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
27
28
|
|
|
28
|
-
function
|
|
29
|
+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
29
30
|
|
|
30
31
|
var range = function range(tab) {
|
|
31
32
|
if (R.isEmpty(tab)) return tab;
|
|
@@ -35,22 +36,18 @@ var range = function range(tab) {
|
|
|
35
36
|
var getCounter = function getCounter(items, displayAccessor, tagAccessor) {
|
|
36
37
|
var count = R.pipe(R.filter(R.prop('isSelected')), R.length)(items);
|
|
37
38
|
var total = R.pipe(R.when(R.always(R.is(Function, displayAccessor)), R.filter(displayAccessor)), R.length)(items);
|
|
38
|
-
|
|
39
39
|
if (R.is(Function, tagAccessor)) {
|
|
40
40
|
return tagAccessor(count, total);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
return count + "/" + total;
|
|
42
|
+
return count + '/' + total;
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
var getIsBlank = function getIsBlank(items, displayAccessor, limitDisplay) {
|
|
45
|
+
var getIsBlank = exports.getIsBlank = function getIsBlank(items, displayAccessor, limitDisplay) {
|
|
47
46
|
if (R.not(R.is(Function)(displayAccessor))) return R.pipe(R.length, R.gte(limitDisplay))(items);
|
|
48
47
|
return R.pipe(R.filter(displayAccessor), R.length, R.gte(limitDisplay))(items);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
exports.getIsBlank = getIsBlank;
|
|
48
|
+
};
|
|
53
49
|
|
|
50
|
+
//----------------------------------------------------------------------------------DisplayOrDisable
|
|
54
51
|
var addDisableProps = function addDisableProps(displayAccessor) {
|
|
55
52
|
return function (list) {
|
|
56
53
|
if (R.not(R.is(Function)(displayAccessor))) return list;
|
|
@@ -61,30 +58,26 @@ var addDisableProps = function addDisableProps(displayAccessor) {
|
|
|
61
58
|
};
|
|
62
59
|
|
|
63
60
|
var indexByParentId = R.indexBy(R.prop('parentId'));
|
|
64
|
-
|
|
65
61
|
var indexByParentIdWithHasData = function indexByParentIdWithHasData(displayAccessor) {
|
|
66
62
|
return R.indexBy(R.ifElse(displayAccessor, R.prop('parentId'), R.always(undefined)));
|
|
67
63
|
};
|
|
68
|
-
|
|
69
|
-
var getItemsIndexedByParentId = function getItemsIndexedByParentId(displayAccessor) {
|
|
64
|
+
var getItemsIndexedByParentId = exports.getItemsIndexedByParentId = function getItemsIndexedByParentId(displayAccessor) {
|
|
70
65
|
return function (items) {
|
|
71
66
|
if (R.not(R.is(Function)(displayAccessor))) return indexByParentId(items);
|
|
72
67
|
return R.converge(R.mergeRight, [indexByParentId, indexByParentIdWithHasData(displayAccessor)])(items);
|
|
73
68
|
};
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
exports.getItemsIndexedByParentId = getItemsIndexedByParentId;
|
|
69
|
+
};
|
|
78
70
|
|
|
71
|
+
//-----------------------------------------------------------------------------------------Spotlight
|
|
79
72
|
var getSpotlightedList = function getSpotlightedList(_ref) {
|
|
80
73
|
var topElementProps = _ref.topElementProps,
|
|
81
74
|
_ref$term = _ref.term,
|
|
82
|
-
term = _ref$term ===
|
|
75
|
+
term = _ref$term === undefined ? '' : _ref$term,
|
|
83
76
|
items = _ref.items,
|
|
84
77
|
itemsById = _ref.itemsById,
|
|
85
78
|
noPath = _ref.noPath,
|
|
86
79
|
hasPath = _ref.hasPath;
|
|
87
|
-
return topElementProps.defaultSpotlight.engine((
|
|
80
|
+
return topElementProps.defaultSpotlight.engine(_extends({}, topElementProps.defaultSpotlight, {
|
|
88
81
|
term: term,
|
|
89
82
|
items: items,
|
|
90
83
|
itemsById: itemsById,
|
|
@@ -93,29 +86,24 @@ var getSpotlightedList = function getSpotlightedList(_ref) {
|
|
|
93
86
|
}));
|
|
94
87
|
};
|
|
95
88
|
|
|
96
|
-
var getPlaceholder = function getPlaceholder(_ref2) {
|
|
89
|
+
var getPlaceholder = exports.getPlaceholder = function getPlaceholder(_ref2) {
|
|
97
90
|
var _ref2$placeholder = _ref2.placeholder,
|
|
98
|
-
placeholder = _ref2$placeholder ===
|
|
91
|
+
placeholder = _ref2$placeholder === undefined ? '' : _ref2$placeholder,
|
|
99
92
|
mainPlaceholder = _ref2.mainPlaceholder,
|
|
100
93
|
secondaryPlaceholder = _ref2.secondaryPlaceholder,
|
|
101
94
|
currentItem = _ref2.currentItem;
|
|
95
|
+
|
|
102
96
|
if (R.and(R.isNil(mainPlaceholder), R.isNil(secondaryPlaceholder))) return placeholder;
|
|
103
97
|
if (R.isNil(currentItem)) return mainPlaceholder;
|
|
104
98
|
return secondaryPlaceholder;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
exports.getPlaceholder = getPlaceholder;
|
|
109
|
-
|
|
110
|
-
var withHasChild = function withHasChild(itemsByParentId) {
|
|
99
|
+
};
|
|
100
|
+
//----------------------------------------------------------------------------------------------List
|
|
101
|
+
var withHasChild = exports.withHasChild = function withHasChild(itemsByParentId) {
|
|
111
102
|
return function (item) {
|
|
112
103
|
return R.assoc('hasChild', R.pipe(R.prop(item.id), R.isNil, R.not)(itemsByParentId))(item);
|
|
113
104
|
};
|
|
114
105
|
};
|
|
115
|
-
|
|
116
|
-
exports.withHasChild = withHasChild;
|
|
117
|
-
|
|
118
|
-
var getCurrentList = function getCurrentList(_ref3) {
|
|
106
|
+
var getCurrentList = exports.getCurrentList = function getCurrentList(_ref3) {
|
|
119
107
|
var currentItemId = _ref3.currentItemId,
|
|
120
108
|
itemsByParentId = _ref3.itemsByParentId,
|
|
121
109
|
items = _ref3.items;
|
|
@@ -123,16 +111,11 @@ var getCurrentList = function getCurrentList(_ref3) {
|
|
|
123
111
|
if (R.equals(currentItemId, item.parentId)) {
|
|
124
112
|
return [].concat(acc, [withHasChild(itemsByParentId)(item)]);
|
|
125
113
|
}
|
|
126
|
-
|
|
127
114
|
return acc;
|
|
128
115
|
}, [])(items);
|
|
129
116
|
};
|
|
130
|
-
|
|
131
|
-
exports.
|
|
132
|
-
var getMainList = R.filter(R.pipe(R.prop('parentId'), R.isNil));
|
|
133
|
-
exports.getMainList = getMainList;
|
|
134
|
-
|
|
135
|
-
var getList = function getList(_ref4) {
|
|
117
|
+
var getMainList = exports.getMainList = R.filter(R.pipe(R.prop('parentId'), R.isNil));
|
|
118
|
+
var getList = exports.getList = function getList(_ref4) {
|
|
136
119
|
var items = _ref4.items,
|
|
137
120
|
itemsByParentId = _ref4.itemsByParentId,
|
|
138
121
|
itemsById = _ref4.itemsById,
|
|
@@ -141,43 +124,25 @@ var getList = function getList(_ref4) {
|
|
|
141
124
|
term = _ref4.term,
|
|
142
125
|
hasPath = _ref4.hasPath,
|
|
143
126
|
displayAccessor = _ref4.displayAccessor;
|
|
144
|
-
var currentItemId = currentItem ? R.prop('id')(currentItem) : null;
|
|
145
127
|
|
|
128
|
+
var currentItemId = currentItem ? R.prop('id')(currentItem) : null;
|
|
146
129
|
if (R.or(R.isEmpty(term), R.isNil(R.prop('defaultSpotlight')(topElementProps)))) {
|
|
147
130
|
var itemsByParentIdDisplayed = getItemsIndexedByParentId(displayAccessor)(items);
|
|
148
131
|
if (R.isNil(currentItemId)) return R.pipe(getMainList, R.map(function (item) {
|
|
149
132
|
return withHasChild(itemsByParentIdDisplayed)(item);
|
|
150
133
|
}))(items);
|
|
151
|
-
return getCurrentList({
|
|
152
|
-
currentItemId: currentItemId,
|
|
153
|
-
itemsByParentId: itemsByParentIdDisplayed,
|
|
154
|
-
items: items
|
|
155
|
-
});
|
|
134
|
+
return getCurrentList({ currentItemId: currentItemId, itemsByParentId: itemsByParentIdDisplayed, items: items });
|
|
156
135
|
}
|
|
157
|
-
|
|
158
|
-
if (R.isNil(currentItemId)) return getSpotlightedList({
|
|
159
|
-
topElementProps: topElementProps,
|
|
160
|
-
term: term,
|
|
161
|
-
items: items,
|
|
162
|
-
itemsById: itemsById,
|
|
163
|
-
hasPath: hasPath
|
|
164
|
-
});
|
|
136
|
+
if (R.isNil(currentItemId)) return getSpotlightedList({ topElementProps: topElementProps, term: term, items: items, itemsById: itemsById, hasPath: hasPath });
|
|
165
137
|
return getSpotlightedList({
|
|
166
138
|
topElementProps: topElementProps,
|
|
167
139
|
term: term,
|
|
168
|
-
items: getCurrentList({
|
|
169
|
-
currentItemId: currentItemId,
|
|
170
|
-
itemsByParentId: itemsByParentId,
|
|
171
|
-
items: items
|
|
172
|
-
}),
|
|
140
|
+
items: getCurrentList({ currentItemId: currentItemId, itemsByParentId: itemsByParentId, items: items }),
|
|
173
141
|
noPath: true,
|
|
174
142
|
hasPath: hasPath
|
|
175
143
|
});
|
|
176
144
|
};
|
|
177
|
-
|
|
178
|
-
exports.getList = getList;
|
|
179
|
-
|
|
180
|
-
var getScopeList = function getScopeList(_ref5) {
|
|
145
|
+
var getScopeList = exports.getScopeList = function getScopeList(_ref5) {
|
|
181
146
|
var isActivePanel = _ref5.isActivePanel,
|
|
182
147
|
displayAccessor = _ref5.displayAccessor,
|
|
183
148
|
items = _ref5.items,
|
|
@@ -187,6 +152,7 @@ var getScopeList = function getScopeList(_ref5) {
|
|
|
187
152
|
currentItem = _ref5.currentItem,
|
|
188
153
|
term = _ref5.term,
|
|
189
154
|
hasPath = _ref5.hasPath;
|
|
155
|
+
|
|
190
156
|
if (R.not(isActivePanel)) return [];
|
|
191
157
|
return R.pipe(getList, addDisableProps(displayAccessor))({
|
|
192
158
|
items: items,
|
|
@@ -198,12 +164,9 @@ var getScopeList = function getScopeList(_ref5) {
|
|
|
198
164
|
hasPath: hasPath,
|
|
199
165
|
displayAccessor: displayAccessor
|
|
200
166
|
});
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
exports.getScopeList = getScopeList;
|
|
205
|
-
|
|
206
|
-
var getEnhancedNode = function getEnhancedNode(currentItem, items, itemsById, hasPath) {
|
|
167
|
+
};
|
|
168
|
+
//----------------------------------------------------------------------------------------------Node
|
|
169
|
+
var getEnhancedNode = exports.getEnhancedNode = function getEnhancedNode(currentItem, items, itemsById, hasPath) {
|
|
207
170
|
if (R.isNil(currentItem)) return currentItem;
|
|
208
171
|
var id = R.prop('id')(currentItem);
|
|
209
172
|
var item = R.find(R.propEq('id', id))(items);
|
|
@@ -211,28 +174,26 @@ var getEnhancedNode = function getEnhancedNode(currentItem, items, itemsById, ha
|
|
|
211
174
|
return R.append(currentItem, path);
|
|
212
175
|
};
|
|
213
176
|
|
|
214
|
-
exports.getEnhancedNode = getEnhancedNode;
|
|
215
|
-
|
|
216
177
|
var getCurrentItem = function getCurrentItem(_ref6) {
|
|
217
178
|
var isActivePanel = _ref6.isActivePanel,
|
|
218
179
|
currentItem = _ref6.currentItem,
|
|
219
180
|
items = _ref6.items,
|
|
220
181
|
itemsById = _ref6.itemsById,
|
|
221
182
|
hasPath = _ref6.hasPath;
|
|
183
|
+
|
|
222
184
|
if (R.not(isActivePanel)) return null;
|
|
223
185
|
return getEnhancedNode(currentItem, items, itemsById, hasPath);
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var getItemsIds = R.curry(function (disableAccessor, _ref7, items) {
|
|
186
|
+
};
|
|
187
|
+
//---------------------------------------------------------------------------------------------Multi
|
|
188
|
+
var getItemsIds = exports.getItemsIds = R.curry(function (disableAccessor, _ref7, items) {
|
|
228
189
|
var isSelected = _ref7.isSelected;
|
|
190
|
+
|
|
229
191
|
return R.reduce(function (acc, item) {
|
|
230
192
|
if (disableAccessor(item)) return acc;
|
|
231
193
|
if (R.equals(R.not(R.prop('isSelected', item)), isSelected)) return acc;
|
|
232
194
|
return R.append(R.prop('id', item), acc);
|
|
233
195
|
}, [])(items);
|
|
234
196
|
});
|
|
235
|
-
exports.getItemsIds = getItemsIds;
|
|
236
197
|
|
|
237
198
|
var updateIndexSelected = function updateIndexSelected(index) {
|
|
238
199
|
return R.ifElse(R.isEmpty, R.always([index, index]), R.update(1, index));
|
|
@@ -246,83 +207,76 @@ var getItemsGroupByLevel = function getItemsGroupByLevel(disableAccessor) {
|
|
|
246
207
|
}, []), R.reduceBy(function (acc, _ref8) {
|
|
247
208
|
var id = _ref8.id,
|
|
248
209
|
isSelected = _ref8.isSelected,
|
|
249
|
-
rest = (
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
isSelected: isSelected
|
|
253
|
-
}), acc);
|
|
210
|
+
rest = _objectWithoutProperties(_ref8, ['id', 'isSelected']);
|
|
211
|
+
|
|
212
|
+
return R.append(_extends({}, rest, { id: id, isSelected: isSelected }), acc);
|
|
254
213
|
}, [], R.prop('level')));
|
|
255
214
|
};
|
|
256
215
|
};
|
|
257
216
|
|
|
258
217
|
exports.getItemsGroupByLevel = getItemsGroupByLevel;
|
|
259
|
-
|
|
260
|
-
var getIsAllSelected = function getIsAllSelected(disableAccessor) {
|
|
218
|
+
var getIsAllSelected = exports.getIsAllSelected = function getIsAllSelected(disableAccessor) {
|
|
261
219
|
return R.pipe(R.reject(disableAccessor), R.all(R.prop('isSelected')));
|
|
262
220
|
};
|
|
263
|
-
|
|
264
|
-
exports.getIsAllSelected = getIsAllSelected;
|
|
265
|
-
|
|
266
|
-
var setAllTo = function setAllTo(list) {
|
|
221
|
+
var setAllTo = exports.setAllTo = function setAllTo(list) {
|
|
267
222
|
return R.pipe(R.map(function (index) {
|
|
268
223
|
return R.nth(index, list);
|
|
269
224
|
}), R.head, R.prop('isSelected'));
|
|
270
225
|
};
|
|
271
226
|
|
|
272
|
-
exports.setAllTo = setAllTo;
|
|
273
227
|
var setPreviewSelectedList = R.curry(function (indexes, setValue, list) {
|
|
274
228
|
return R.reduce(function (acc, index) {
|
|
275
229
|
return R.over(R.lensIndex(index), R.over(R.lensProp('isSelected'), setValue))(acc);
|
|
276
230
|
})(list, indexes);
|
|
277
231
|
});
|
|
232
|
+
|
|
278
233
|
var getRangeIndexes = R.pipe(R.sort(function (a, b) {
|
|
279
234
|
return a - b;
|
|
280
235
|
}), R.over(R.lensIndex(1), R.add(1)), range);
|
|
281
236
|
|
|
282
|
-
var setSelection = function setSelection(_ref9, list) {
|
|
237
|
+
var setSelection = exports.setSelection = function setSelection(_ref9, list) {
|
|
283
238
|
var isBulkSelection = _ref9.isBulkSelection,
|
|
284
239
|
isDiscrete = _ref9.isDiscrete,
|
|
285
240
|
_ref9$items = _ref9.items,
|
|
286
|
-
items = _ref9$items ===
|
|
241
|
+
items = _ref9$items === undefined ? [] : _ref9$items;
|
|
287
242
|
var _items$ = items[0],
|
|
288
|
-
indexes = _items$ ===
|
|
243
|
+
indexes = _items$ === undefined ? [] : _items$,
|
|
289
244
|
_items$2 = items[1],
|
|
290
|
-
applyToSelected = _items$2 ===
|
|
291
|
-
if (R.or(R.isEmpty(indexes), isBulkSelection)) return list;
|
|
245
|
+
applyToSelected = _items$2 === undefined ? R.identity : _items$2;
|
|
292
246
|
|
|
247
|
+
if (R.or(R.isEmpty(indexes), isBulkSelection)) return list;
|
|
293
248
|
if (isDiscrete) {
|
|
294
249
|
return setPreviewSelectedList(indexes, R.not)(list);
|
|
295
250
|
}
|
|
296
|
-
|
|
297
251
|
var isSelected = R.pipe(setAllTo(list), applyToSelected)(indexes);
|
|
298
252
|
return setPreviewSelectedList(getRangeIndexes(indexes), R.always(isSelected))(list);
|
|
299
253
|
};
|
|
300
254
|
|
|
301
|
-
exports.setSelection = setSelection;
|
|
302
255
|
var getPropByIndex = R.curry(function (fn, indexes, list) {
|
|
303
256
|
return R.map(R.pipe(R.nth(R.__, list), fn))(indexes);
|
|
304
257
|
});
|
|
305
258
|
|
|
306
259
|
var allEquals = function allEquals(list) {
|
|
307
260
|
return R.all(R.equals(R.head(list)))(list);
|
|
308
|
-
};
|
|
309
|
-
|
|
261
|
+
};
|
|
310
262
|
|
|
311
|
-
|
|
312
|
-
|
|
263
|
+
//-----------------------------------------------------------------------------------------------Hoc
|
|
264
|
+
var withScopeList = exports.withScopeList = function withScopeList(Component) {
|
|
265
|
+
var _class, _temp2;
|
|
313
266
|
|
|
314
|
-
return
|
|
315
|
-
(
|
|
267
|
+
return _temp2 = _class = function (_React$Component) {
|
|
268
|
+
_inherits(_class, _React$Component);
|
|
316
269
|
|
|
317
270
|
function _class() {
|
|
318
|
-
var _this;
|
|
271
|
+
var _temp, _this, _ret;
|
|
272
|
+
|
|
273
|
+
_classCallCheck(this, _class);
|
|
319
274
|
|
|
320
|
-
for (var _len = arguments.length, args =
|
|
275
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
321
276
|
args[_key] = arguments[_key];
|
|
322
277
|
}
|
|
323
278
|
|
|
324
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args))
|
|
325
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
279
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
|
326
280
|
term: R.propOr('', 'term')(_this.props),
|
|
327
281
|
levels: [],
|
|
328
282
|
shiftSelection: [],
|
|
@@ -330,156 +284,120 @@ var withScopeList = function withScopeList(Component) {
|
|
|
330
284
|
mouseSelection: [],
|
|
331
285
|
isMousePreSelection: false,
|
|
332
286
|
applyToShiftSelected: R.identity
|
|
333
|
-
})
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
currentItem: R.prop(id)(_this.state.itemsById),
|
|
337
|
-
term: ''
|
|
338
|
-
});
|
|
339
|
-
});
|
|
340
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeSelection", function (panelId) {
|
|
287
|
+
}, _this.changeList = function (id) {
|
|
288
|
+
return _this.setState({ currentItem: R.prop(id)(_this.state.itemsById), term: '' });
|
|
289
|
+
}, _this.changeSelection = function (panelId) {
|
|
341
290
|
return function (id) {
|
|
342
291
|
return function (event) {
|
|
343
292
|
event.preventDefault();
|
|
344
|
-
|
|
345
293
|
if (R.is(Function, _this.props.changeSelection)) {
|
|
346
294
|
return _this.props.changeSelection(panelId, [id]);
|
|
347
295
|
}
|
|
348
296
|
};
|
|
349
297
|
};
|
|
350
|
-
})
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
term: R.propOr('', 'term')(spotlight)
|
|
354
|
-
});
|
|
355
|
-
});
|
|
356
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeMutliSelection", function (panelId) {
|
|
298
|
+
}, _this.changeSpotlight = function (spotlight) {
|
|
299
|
+
return _this.setState({ term: R.propOr('', 'term')(spotlight) });
|
|
300
|
+
}, _this.changeMutliSelection = function (panelId) {
|
|
357
301
|
return function (ids) {
|
|
358
302
|
return function (event) {
|
|
359
303
|
event.preventDefault();
|
|
360
304
|
if (R.isEmpty(ids)) return;
|
|
361
|
-
|
|
362
305
|
if (R.is(Function, _this.props.changeSelection)) {
|
|
363
306
|
return _this.props.changeSelection(panelId, ids);
|
|
364
307
|
}
|
|
365
|
-
|
|
366
308
|
return null;
|
|
367
309
|
};
|
|
368
310
|
};
|
|
369
|
-
})
|
|
370
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeLevelSelection", function (panelId, disableAccessor) {
|
|
311
|
+
}, _this.changeLevelSelection = function (panelId, disableAccessor) {
|
|
371
312
|
return function (itemsGroupByLevel) {
|
|
372
313
|
return function (level, isSelected) {
|
|
373
314
|
return function (event) {
|
|
374
315
|
event.preventDefault();
|
|
375
|
-
|
|
376
316
|
if (R.is(Function, _this.props.changeSelection)) {
|
|
377
317
|
return _this.props.changeSelection(panelId, R.pipe(R.prop(level), function (items) {
|
|
378
|
-
return getItemsIds(disableAccessor)({
|
|
379
|
-
isSelected: isSelected
|
|
380
|
-
}, items);
|
|
318
|
+
return getItemsIds(disableAccessor)({ isSelected: isSelected }, items);
|
|
381
319
|
})(itemsGroupByLevel));
|
|
382
320
|
}
|
|
383
|
-
|
|
384
321
|
return;
|
|
385
322
|
};
|
|
386
323
|
};
|
|
387
324
|
};
|
|
388
|
-
})
|
|
389
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeBulkPreSelections", function (id, index) {
|
|
325
|
+
}, _this.changeBulkPreSelections = function (id, index) {
|
|
390
326
|
return function (event) {
|
|
391
327
|
event.preventDefault();
|
|
392
|
-
|
|
393
328
|
if (event.shiftKey && !R.isEmpty(_this.state.shiftSelection)) {
|
|
394
329
|
return _this.setState({
|
|
395
330
|
shiftSelection: updateIndexSelected(index)(_this.state.shiftSelection)
|
|
396
331
|
});
|
|
397
332
|
}
|
|
398
|
-
|
|
399
333
|
if (event.shiftKey && R.isEmpty(_this.state.shiftSelection)) {
|
|
400
334
|
_this.setState({
|
|
401
335
|
shiftSelection: [index, index],
|
|
402
336
|
applyToShiftSelected: R.not
|
|
403
337
|
});
|
|
404
338
|
}
|
|
405
|
-
|
|
406
339
|
if (event.ctrlKey) {
|
|
407
340
|
return _this.setState({
|
|
408
341
|
ctrlSelection: R.ifElse(R.includes(index), R.without([index]), R.append(index))(_this.state.ctrlSelection)
|
|
409
342
|
});
|
|
410
343
|
}
|
|
411
344
|
};
|
|
412
|
-
})
|
|
413
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeMultiSelectionKeyUp", function (disableAccessor) {
|
|
345
|
+
}, _this.changeMultiSelectionKeyUp = function (disableAccessor) {
|
|
414
346
|
return function (_ref10) {
|
|
415
347
|
var list = _ref10.list,
|
|
416
348
|
id = _ref10.id;
|
|
417
349
|
return function (e) {
|
|
418
350
|
var shiftSelection = _this.state.shiftSelection;
|
|
419
|
-
var ctrlSelection = _this.state.ctrlSelection;
|
|
351
|
+
var ctrlSelection = _this.state.ctrlSelection;
|
|
420
352
|
|
|
353
|
+
// e.shiftKey doesn't work
|
|
421
354
|
if (R.and(e.key === 'Shift', R.not(R.isEmpty(shiftSelection)))) {
|
|
422
355
|
if (allEquals(shiftSelection)) return;
|
|
423
356
|
var items = R.pipe(getPropByIndex(R.identity), R.reject(disableAccessor))(getRangeIndexes(shiftSelection), list);
|
|
424
357
|
var indexFirstElement = R.head(shiftSelection);
|
|
425
|
-
|
|
426
358
|
_this.changeMutliSelection(id)(getItemsIds(disableAccessor)({
|
|
427
359
|
isSelected: !R.pipe(R.nth(indexFirstElement), R.prop('isSelected'), _this.state.applyToShiftSelected)(list)
|
|
428
360
|
})(items))(e);
|
|
429
|
-
|
|
430
361
|
return _this.setState({
|
|
431
362
|
shiftSelection: [R.last(shiftSelection), R.last(shiftSelection)],
|
|
432
363
|
applyToShiftSelected: R.identity
|
|
433
364
|
});
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
365
|
+
}
|
|
366
|
+
// e.ctrlKey doesn't work
|
|
437
367
|
if (R.and(e.key === 'Control', R.not(R.isEmpty(ctrlSelection)))) {
|
|
438
368
|
_this.changeMutliSelection(id)(getPropByIndex(R.prop('id'), ctrlSelection, list))(e);
|
|
439
|
-
|
|
440
369
|
return _this.setState({
|
|
441
370
|
ctrlSelection: [],
|
|
442
371
|
shiftSelection: [R.last(ctrlSelection), R.last(ctrlSelection)]
|
|
443
372
|
});
|
|
444
373
|
}
|
|
445
|
-
|
|
446
374
|
return;
|
|
447
375
|
};
|
|
448
376
|
};
|
|
449
|
-
})
|
|
450
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeMouseSelection", function (disableAccessor) {
|
|
377
|
+
}, _this.changeMouseSelection = function (disableAccessor) {
|
|
451
378
|
return function (_ref11) {
|
|
452
379
|
var list = _ref11.list,
|
|
453
380
|
id = _ref11.id;
|
|
454
381
|
return function (index, mouseAction) {
|
|
455
382
|
return function (e) {
|
|
456
|
-
if (R.or(e.ctrlKey, e.shiftKey)) return _this.setState({
|
|
457
|
-
mouseSelection: []
|
|
458
|
-
});
|
|
383
|
+
if (R.or(e.ctrlKey, e.shiftKey)) return _this.setState({ mouseSelection: [] });
|
|
459
384
|
var mouseSelection = _this.state.mouseSelection;
|
|
460
385
|
var isMousePreSelection = _this.state.isMousePreSelection;
|
|
461
|
-
|
|
462
386
|
if (R.prop('isDown')(mouseAction)) {
|
|
463
387
|
return _this.setState({
|
|
464
388
|
mouseSelection: updateIndexSelected(index)(mouseSelection),
|
|
465
389
|
isMousePreSelection: true
|
|
466
390
|
});
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
|
|
391
|
+
}
|
|
392
|
+
// if (R.isEmpty(mouseSelection)) return;
|
|
470
393
|
if (R.and(R.prop('isOver')(mouseAction), isMousePreSelection)) {
|
|
471
394
|
return _this.setState({
|
|
472
395
|
mouseSelection: updateIndexSelected(index)(mouseSelection)
|
|
473
396
|
});
|
|
474
397
|
}
|
|
475
|
-
|
|
476
398
|
if (R.prop('isUp')(mouseAction) && isMousePreSelection) {
|
|
477
399
|
var items = R.pipe(getPropByIndex(R.identity), R.reject(disableAccessor))(getRangeIndexes(mouseSelection), list);
|
|
478
|
-
|
|
479
|
-
_this.changeMutliSelection(id)(getItemsIds(disableAccessor)({
|
|
480
|
-
isSelected: R.prop('isSelected', R.head(items))
|
|
481
|
-
})(items))(e);
|
|
482
|
-
|
|
400
|
+
_this.changeMutliSelection(id)(getItemsIds(disableAccessor)({ isSelected: R.prop('isSelected', R.head(items)) })(items))(e);
|
|
483
401
|
return _this.setState({
|
|
484
402
|
mouseSelection: [],
|
|
485
403
|
isMousePreSelection: false,
|
|
@@ -489,25 +407,24 @@ var withScopeList = function withScopeList(Component) {
|
|
|
489
407
|
};
|
|
490
408
|
};
|
|
491
409
|
};
|
|
492
|
-
})
|
|
493
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "render", function () {
|
|
410
|
+
}, _this.render = function () {
|
|
494
411
|
// "items", "itemsByParentId", "itemsById" are the same collection,
|
|
495
412
|
// but only "items" is updated by the selection (on hold the selection): { isSelected: true/false }
|
|
496
413
|
var _this$props = _this.props,
|
|
497
414
|
displayAccessor = _this$props.displayAccessor,
|
|
498
415
|
_this$props$disableAc = _this$props.disableAccessor,
|
|
499
|
-
disableAccessor = _this$props$disableAc ===
|
|
416
|
+
disableAccessor = _this$props$disableAc === undefined ? R.prop('isDisabled') : _this$props$disableAc,
|
|
500
417
|
tagAccessor = _this$props.tagAccessor,
|
|
501
418
|
items = _this$props.items,
|
|
502
419
|
_this$props$topElemen = _this$props.topElementProps,
|
|
503
|
-
topElementProps = _this$props$topElemen ===
|
|
420
|
+
topElementProps = _this$props$topElemen === undefined ? {} : _this$props$topElemen,
|
|
504
421
|
activePanelId = _this$props.activePanelId,
|
|
505
422
|
id = _this$props.id,
|
|
506
423
|
hasPath = _this$props.hasPath,
|
|
507
424
|
_this$props$testId = _this$props.testId,
|
|
508
|
-
testId = _this$props$testId ===
|
|
425
|
+
testId = _this$props$testId === undefined ? 'scopeList' : _this$props$testId,
|
|
509
426
|
_this$props$limitDisp = _this$props.limitDisplay,
|
|
510
|
-
limitDisplay = _this$props$limitDisp ===
|
|
427
|
+
limitDisplay = _this$props$limitDisp === undefined ? 0 : _this$props$limitDisp,
|
|
511
428
|
bulkSelection = _this$props.bulkSelection;
|
|
512
429
|
var _this$state = _this.state,
|
|
513
430
|
currentItem = _this$state.currentItem,
|
|
@@ -518,6 +435,7 @@ var withScopeList = function withScopeList(Component) {
|
|
|
518
435
|
ctrlSelection = _this$state.ctrlSelection,
|
|
519
436
|
mouseSelection = _this$state.mouseSelection,
|
|
520
437
|
applyToShiftSelected = _this$state.applyToShiftSelected;
|
|
438
|
+
|
|
521
439
|
var isActivePanel = R.equals(activePanelId, id);
|
|
522
440
|
var list = getScopeList({
|
|
523
441
|
items: items,
|
|
@@ -531,7 +449,7 @@ var withScopeList = function withScopeList(Component) {
|
|
|
531
449
|
displayAccessor: displayAccessor,
|
|
532
450
|
disableAccessor: disableAccessor
|
|
533
451
|
});
|
|
534
|
-
return
|
|
452
|
+
return _react2.default.createElement(Component, _extends({}, _this.props, {
|
|
535
453
|
disableAccessor: disableAccessor,
|
|
536
454
|
itemsById: itemsById,
|
|
537
455
|
items: items,
|
|
@@ -547,7 +465,7 @@ var withScopeList = function withScopeList(Component) {
|
|
|
547
465
|
}),
|
|
548
466
|
action: _this.changeSpotlight,
|
|
549
467
|
term: term,
|
|
550
|
-
placeholder: getPlaceholder((
|
|
468
|
+
placeholder: getPlaceholder(_extends({}, topElementProps, {
|
|
551
469
|
currentItem: currentItem
|
|
552
470
|
})),
|
|
553
471
|
changeSelect: _this.changeSelect,
|
|
@@ -561,32 +479,23 @@ var withScopeList = function withScopeList(Component) {
|
|
|
561
479
|
})([[ctrlSelection], [mouseSelection, R.not], [shiftSelection, applyToShiftSelected]])
|
|
562
480
|
}, list) : list,
|
|
563
481
|
changeSelection: bulkSelection ? _this.changeBulkPreSelections : _this.changeSelection(id),
|
|
564
|
-
changeMutliSelection: bulkSelection ? _this.changeMutliSelection(id)(getItemsIds(disableAccessor)({
|
|
565
|
-
isSelected: getIsAllSelected(disableAccessor)(list)
|
|
566
|
-
}, list)) : null,
|
|
482
|
+
changeMutliSelection: bulkSelection ? _this.changeMutliSelection(id)(getItemsIds(disableAccessor)({ isSelected: getIsAllSelected(disableAccessor)(list) }, list)) : null,
|
|
567
483
|
changeLevelSelection: bulkSelection ? _this.changeLevelSelection(id, disableAccessor) : null,
|
|
568
484
|
isCurrentListAllSelected: bulkSelection ? getIsAllSelected(disableAccessor)(list) : null,
|
|
569
|
-
changeMultiSelectionKeyUp: bulkSelection ? _this.changeMultiSelectionKeyUp(disableAccessor)({
|
|
570
|
-
|
|
571
|
-
id: id
|
|
572
|
-
}) : null,
|
|
573
|
-
changeMouseSelection: bulkSelection ? _this.changeMouseSelection(disableAccessor)({
|
|
574
|
-
list: list,
|
|
575
|
-
id: id
|
|
576
|
-
}) : null
|
|
485
|
+
changeMultiSelectionKeyUp: bulkSelection ? _this.changeMultiSelectionKeyUp(disableAccessor)({ list: list, id: id }) : null,
|
|
486
|
+
changeMouseSelection: bulkSelection ? _this.changeMouseSelection(disableAccessor)({ list: list, id: id }) : null
|
|
577
487
|
}));
|
|
578
|
-
});
|
|
579
|
-
return _this;
|
|
488
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
580
489
|
}
|
|
581
490
|
|
|
491
|
+
//---------------------------------------------------------------------------------bulkSelection
|
|
492
|
+
|
|
493
|
+
|
|
582
494
|
return _class;
|
|
583
|
-
}(
|
|
584
|
-
return (
|
|
495
|
+
}(_react2.default.Component), _class.getDerivedStateFromProps = function (props, state) {
|
|
496
|
+
return _extends({}, state, {
|
|
585
497
|
itemsById: R.indexBy(R.prop('id'), props.items),
|
|
586
498
|
itemsByParentId: getItemsIndexedByParentId(props.displayAccessor)(props.items) // only use for hasChild, same keys are overide
|
|
587
|
-
|
|
588
499
|
});
|
|
589
|
-
}
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
exports.withScopeList = withScopeList;
|
|
500
|
+
}, _temp2;
|
|
501
|
+
};
|