@carbon/ibm-products 1.18.1 → 1.19.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/css/components/Datagrid/styles/draggableElement.css +57 -0
- package/css/components/Datagrid/styles/draggableElement.css.map +1 -0
- package/css/components/Datagrid/styles/index.css +80 -0
- package/css/components/Datagrid/styles/index.css.map +1 -1
- package/css/index-full-carbon.css +98 -3
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon.css +98 -3
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +98 -3
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/css/index.min.css.map +1 -1
- package/es/components/ActionSet/ActionSet.js +1 -0
- package/es/components/AddSelect/AddSelectFilter.js +9 -3
- package/es/components/AddSelect/AddSelectSidebar.js +3 -2
- package/es/components/ComboButton/ComboButton.js +1 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +5 -3
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +38 -8
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +26 -10
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +8 -6
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +65 -34
- package/es/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +17 -3
- package/es/components/DataSpreadsheet/utils/getCellSize.js +10 -10
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +113 -19
- package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +4 -3
- package/es/components/Datagrid/Datagrid/DraggableElement.js +9 -19
- package/es/components/ExportModal/ExportModal.js +1 -1
- package/es/global/js/hooks/useWindowResize.js +2 -1
- package/es/global/js/hooks/useWindowScroll.js +2 -1
- package/es/global/js/utils/scrollableAncestor.js +2 -1
- package/lib/components/ActionSet/ActionSet.js +1 -0
- package/lib/components/AddSelect/AddSelectFilter.js +10 -3
- package/lib/components/AddSelect/AddSelectSidebar.js +3 -2
- package/lib/components/ComboButton/ComboButton.js +2 -4
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +5 -3
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +38 -8
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +26 -10
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +8 -7
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +66 -34
- package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +17 -3
- package/lib/components/DataSpreadsheet/utils/getCellSize.js +4 -4
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +112 -19
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +4 -3
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +11 -19
- package/lib/components/ExportModal/ExportModal.js +1 -1
- package/lib/global/js/hooks/useWindowResize.js +3 -1
- package/lib/global/js/hooks/useWindowScroll.js +5 -1
- package/lib/global/js/utils/scrollableAncestor.js +6 -1
- package/package.json +4 -4
- package/scss/components/AddSelect/_add-select.scss +6 -0
- package/scss/components/ComboButton/_combo-button.scss +2 -1
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +7 -0
- package/scss/components/Datagrid/_datagrid.scss +1 -10
- package/scss/components/Datagrid/styles/draggableElement.scss +58 -0
- package/scss/components/Datagrid/styles/index.scss +2 -1
@@ -1,3 +1,4 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
3
|
// @flow
|
3
4
|
|
@@ -13,10 +14,12 @@ import PropTypes from 'prop-types';
|
|
13
14
|
import { Draggable16 } from '@carbon/icons-react';
|
14
15
|
import { useDrag, useDrop } from 'react-dnd';
|
15
16
|
import cx from 'classnames';
|
17
|
+
import { pkg } from '../../../settings';
|
16
18
|
var useEffect = React.useEffect,
|
17
19
|
useRef = React.useRef,
|
18
20
|
useState = React.useState;
|
19
|
-
var
|
21
|
+
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
22
|
+
var DRAG_TYPE = "".concat(blockClass, "__shared-ui-draggable-element");
|
20
23
|
|
21
24
|
var DraggableElement = function DraggableElement(_ref) {
|
22
25
|
var id = _ref.id,
|
@@ -55,7 +58,6 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
55
58
|
var dragIndex = item.index;
|
56
59
|
var hoverIndex = index; // Don't replace items with themselves
|
57
60
|
|
58
|
-
// Don't replace items with themselves
|
59
61
|
if (dragIndex === hoverIndex || disabled) {
|
60
62
|
return;
|
61
63
|
}
|
@@ -67,12 +69,6 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
67
69
|
// to avoid expensive index searches.
|
68
70
|
// eslint-disable-next-line no-param-reassign
|
69
71
|
|
70
|
-
// Time to actually perform the action
|
71
|
-
// Note: we're mutating the monitor item here!
|
72
|
-
// Generally it's better to avoid mutations,
|
73
|
-
// but it's good here for the sake of performance
|
74
|
-
// to avoid expensive index searches.
|
75
|
-
// eslint-disable-next-line no-param-reassign
|
76
72
|
item.index = hoverIndex;
|
77
73
|
}
|
78
74
|
}),
|
@@ -120,14 +116,10 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
120
116
|
var content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
121
117
|
className: cx({
|
122
118
|
disabled: disabled
|
123
|
-
},
|
119
|
+
}, "".concat(blockClass, "__draggable-handleStyle"))
|
124
120
|
}, /*#__PURE__*/React.createElement(Draggable16, null)), children);
|
125
121
|
return /*#__PURE__*/React.createElement("li", {
|
126
|
-
className: cx({
|
127
|
-
'wkc-draggable-handleHolder-isOver': isOver && !disabled
|
128
|
-
}, {
|
129
|
-
'wkc-draggable-handleHolder--grabbed': isGrabbed
|
130
|
-
}, 'wkc-draggable-handleHolder'),
|
122
|
+
className: cx(_defineProperty({}, "".concat(blockClass, "__draggable-handleHolder-isOver"), isOver && !disabled), _defineProperty({}, "".concat(blockClass, "__wkc-draggable-handleHolder--grabbed"), isGrabbed), "".concat(blockClass, "__draggable-handleHolder")),
|
131
123
|
ref: ref,
|
132
124
|
"aria-selected": isFocused,
|
133
125
|
role: "option",
|
@@ -155,17 +147,15 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
155
147
|
setIsFocusedOnItem(e.currentTarget === e.target);
|
156
148
|
}
|
157
149
|
}, /*#__PURE__*/React.createElement("span", {
|
158
|
-
className: "
|
150
|
+
className: "".concat(blockClass, "__shared-ui--assistive-text")
|
159
151
|
}, ariaLabel), isDragging && !isOver ? /*#__PURE__*/React.createElement("div", {
|
160
152
|
ref: preview,
|
161
|
-
className: "
|
153
|
+
className: "${blockClass}__draggable-handleHolder-droppable"
|
162
154
|
}, content) : /*#__PURE__*/React.createElement("div", {
|
163
155
|
ref: drag,
|
164
156
|
"aria-hidden": isFocused && isFocusedOnItem // if focus on li, hide the children from aria
|
165
157
|
,
|
166
|
-
className: cx({
|
167
|
-
'wkc-draggable-handleStyle': !disabled
|
168
|
-
}, 'wkc-draggable-handleHolder-droppable')
|
158
|
+
className: cx(_defineProperty({}, "".concat(blockClass, "__draggable-handleStyle"), !disabled), ["".concat(blockClass, "__draggable-handleHolder-droppable")])
|
169
159
|
}, (!isOver || disabled) && content));
|
170
160
|
};
|
171
161
|
|
@@ -79,7 +79,7 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
79
79
|
|
80
80
|
setName(filename);
|
81
81
|
setExtension(preformattedExtensions === null || preformattedExtensions === void 0 ? void 0 : (_preformattedExtensio = preformattedExtensions[0]) === null || _preformattedExtensio === void 0 ? void 0 : _preformattedExtensio.extension);
|
82
|
-
}, [filename, preformattedExtensions]);
|
82
|
+
}, [filename, preformattedExtensions, open]);
|
83
83
|
|
84
84
|
var onNameChangeHandler = function onNameChangeHandler(evt) {
|
85
85
|
setName(evt.target.value);
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
2
3
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
5
|
|
5
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
7
|
|
7
8
|
import { useRef, useLayoutEffect } from 'react';
|
8
|
-
var windowExists = typeof window !== "undefined";
|
9
|
+
var windowExists = (typeof window === "undefined" ? "undefined" : _typeof(window)) !== "undefined";
|
9
10
|
|
10
11
|
var getWindowSize = function getWindowSize() {
|
11
12
|
if (!windowExists) {
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
1
2
|
import { useRef, useLayoutEffect } from 'react';
|
2
3
|
import { scrollableAncestor } from '../utils/scrollableAncestor';
|
3
|
-
var windowExists = typeof window !== "undefined";
|
4
|
+
var windowExists = (typeof window === "undefined" ? "undefined" : _typeof(window)) !== "undefined";
|
4
5
|
|
5
6
|
var useTargetScroll = function useTargetScroll(target, effect, deps, throttleInterval) {
|
6
7
|
var scrollPosition = useRef({});
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
2
|
+
var windowExists = (typeof window === "undefined" ? "undefined" : _typeof(window)) !== "undefined"; // determine whether the target is scrollable
|
2
3
|
|
3
4
|
var scrollable = function scrollable(target) {
|
4
5
|
var style = window.getComputedStyle(target);
|
@@ -148,6 +148,7 @@ ActionSet.validateActions = function (sizeFn) {
|
|
148
148
|
var problems = [];
|
149
149
|
|
150
150
|
if (actions > 0) {
|
151
|
+
// eslint-disable-next-line react/prop-types
|
151
152
|
var size = sizeFn ? sizeFn(props) : props.size || defaults.size;
|
152
153
|
var stacking = willStack(size, actions);
|
153
154
|
|
@@ -17,6 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
18
18
|
var _carbonComponentsReact = require("carbon-components-react");
|
19
19
|
|
20
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
21
|
+
|
20
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
21
23
|
|
22
24
|
var _iconsReact = require("@carbon/icons-react");
|
@@ -79,6 +81,7 @@ var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
79
81
|
|
80
82
|
|
81
83
|
var applyFilters = function applyFilters() {
|
84
|
+
setOpen(false);
|
82
85
|
handleFilter(filters);
|
83
86
|
};
|
84
87
|
|
@@ -104,6 +107,8 @@ var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
104
107
|
};
|
105
108
|
|
106
109
|
var showFilter = multi && (filterOpts === null || filterOpts === void 0 ? void 0 : filterOpts.length) > 0;
|
110
|
+
var filterBtnClassnames = (0, _classnames.default)("".concat(blockClass, "-toggle"), (0, _defineProperty2.default)({}, "".concat(blockClass, "-toggle--open"), open));
|
111
|
+
var dirtyInput = Object.keys(filters).length > 0;
|
107
112
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
108
113
|
className: "".concat(blockClass, "-search")
|
109
114
|
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.TextInput, {
|
@@ -120,7 +125,7 @@ var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
120
125
|
return setOpen(!open);
|
121
126
|
},
|
122
127
|
iconDescription: iconDescription,
|
123
|
-
className:
|
128
|
+
className: filterBtnClassnames,
|
124
129
|
size: "md"
|
125
130
|
}), open && /*#__PURE__*/_react.default.createElement("div", {
|
126
131
|
className: blockClass
|
@@ -146,11 +151,13 @@ var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
146
151
|
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
147
152
|
kind: "secondary",
|
148
153
|
onClick: resetFilters,
|
149
|
-
className: "".concat(blockClass, "-button")
|
154
|
+
className: "".concat(blockClass, "-button"),
|
155
|
+
disabled: !dirtyInput
|
150
156
|
}, secondaryButtonText), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
151
157
|
kind: "primary",
|
152
158
|
onClick: applyFilters,
|
153
|
-
className: "".concat(blockClass, "-button")
|
159
|
+
className: "".concat(blockClass, "-button"),
|
160
|
+
disabled: !dirtyInput && !hasFiltersApplied
|
154
161
|
}, primaryButtonText)))), hasFiltersApplied && /*#__PURE__*/_react.default.createElement("div", {
|
155
162
|
className: "".concat(blockClass, "-applied")
|
156
163
|
}, Object.keys(appliedFilters).map(function (filterType) {
|
@@ -23,7 +23,7 @@ var _settings = require("../../settings");
|
|
23
23
|
|
24
24
|
var _AddSelectMetaPanel = require("./AddSelectMetaPanel");
|
25
25
|
|
26
|
-
var _excluded = ["icon", "avatar"];
|
26
|
+
var _excluded = ["meta", "icon", "avatar"];
|
27
27
|
var componentName = 'AddSelectSidebar';
|
28
28
|
|
29
29
|
var AddSelectSidebar = function AddSelectSidebar(_ref) {
|
@@ -53,7 +53,8 @@ var AddSelectSidebar = function AddSelectSidebar(_ref) {
|
|
53
53
|
}); // certain properties should not be displayed in the sidebar
|
54
54
|
// eslint-disable-next-line no-unused-vars
|
55
55
|
|
56
|
-
var
|
56
|
+
var meta = selectedItem.meta,
|
57
|
+
icon = selectedItem.icon,
|
57
58
|
avatar = selectedItem.avatar,
|
58
59
|
newItem = (0, _objectWithoutProperties2.default)(selectedItem, _excluded);
|
59
60
|
acc.push(newItem);
|
@@ -23,8 +23,6 @@ var _iconsReact = require("@carbon/icons-react");
|
|
23
23
|
|
24
24
|
var _carbonComponentsReact = require("carbon-components-react");
|
25
25
|
|
26
|
-
var _OverflowMenu = require("carbon-components-react/lib/components/OverflowMenu/OverflowMenu");
|
27
|
-
|
28
26
|
var _setupGetInstanceId = _interopRequireDefault(require("carbon-components-react/lib/tools/setupGetInstanceId"));
|
29
27
|
|
30
28
|
var _classnames = _interopRequireDefault(require("classnames"));
|
@@ -83,7 +81,7 @@ var ComboButton = function ComboButton(_ref) {
|
|
83
81
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
84
82
|
className: (0, _classnames.default)(blockClass, className),
|
85
83
|
"data-floating-menu-container": true
|
86
|
-
}), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, primaryAction), restActions.length > 0 && /*#__PURE__*/_react.default.createElement(
|
84
|
+
}), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, primaryAction), restActions.length > 0 && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.OverflowMenu, (0, _extends2.default)({}, overflowMenu, {
|
87
85
|
className: "".concat(blockClass, "__overflow-menu"),
|
88
86
|
menuOptionsClass: "".concat(blockClass, "__overflow-menu__list"),
|
89
87
|
onClick: function onClick() {
|
@@ -121,5 +119,5 @@ ComboButton.propTypes = {
|
|
121
119
|
className: _propTypes.string,
|
122
120
|
|
123
121
|
/** Provide the [props of the `OverflowMenu`](https://react.carbondesignsystem.com/?path=/docs/overflowmenu) */
|
124
|
-
overflowMenu: (0, _propTypes.shape)(
|
122
|
+
overflowMenu: (0, _propTypes.shape)(_carbonComponentsReact.OverflowMenu.propTypes)
|
125
123
|
};
|
@@ -81,7 +81,7 @@ var blockClass = "".concat(_settings.pkg.prefix, "--data-spreadsheet");
|
|
81
81
|
var componentName = 'DataSpreadsheet'; // Default values for props
|
82
82
|
|
83
83
|
var defaults = {
|
84
|
-
cellSize: '
|
84
|
+
cellSize: 'sm',
|
85
85
|
columns: Object.freeze([]),
|
86
86
|
data: Object.freeze([]),
|
87
87
|
defaultEmptyRowCount: 16,
|
@@ -701,7 +701,8 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
701
701
|
spreadsheetRef: spreadsheetRef,
|
702
702
|
isKeyboard: isKeyboard,
|
703
703
|
setSelectionAreaData: setSelectionAreaData,
|
704
|
-
index: index
|
704
|
+
index: index,
|
705
|
+
currentMatcher: currentMatcher
|
705
706
|
}; // Select an entire column
|
706
707
|
|
707
708
|
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
|
@@ -802,6 +803,7 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
802
803
|
activeCellCoordinates: activeCellCoordinates,
|
803
804
|
cellSize: cellSize,
|
804
805
|
columns: columns,
|
806
|
+
currentMatcher: currentMatcher,
|
805
807
|
defaultColumn: defaultColumn,
|
806
808
|
headerGroups: headerGroups,
|
807
809
|
rows: rows,
|
@@ -900,7 +902,7 @@ DataSpreadsheet.propTypes = {
|
|
900
902
|
/**
|
901
903
|
* Specifies the cell height
|
902
904
|
*/
|
903
|
-
cellSize: _propTypes.default.oneOf(['
|
905
|
+
cellSize: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg']),
|
904
906
|
|
905
907
|
/**
|
906
908
|
* Provide an optional class to be applied to the containing node.
|
@@ -96,7 +96,8 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
96
96
|
var contentScrollRef = (0, _react.useRef)();
|
97
97
|
var previousState = (0, _hooks.usePreviousValue)({
|
98
98
|
selectionAreaData: selectionAreaData,
|
99
|
-
clickAndHoldActive: clickAndHoldActive
|
99
|
+
clickAndHoldActive: clickAndHoldActive,
|
100
|
+
rowHeight: defaultColumn.rowHeight
|
100
101
|
}); // Set custom css property containing the spreadsheet total width
|
101
102
|
|
102
103
|
(0, _react.useEffect)(function () {
|
@@ -176,7 +177,7 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
176
177
|
|
177
178
|
for (var rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {
|
178
179
|
for (var columnIndex = columnStart; columnIndex <= columnEnd; columnIndex++) {
|
179
|
-
cellContainer.push([rowIndex, columnIndex]);
|
180
|
+
cellContainer.push([rowIndex, columnIndex, "".concat(blockClass, "__cell--").concat(rowIndex, "--").concat(columnIndex)]);
|
180
181
|
}
|
181
182
|
}
|
182
183
|
|
@@ -196,18 +197,47 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
196
197
|
setActiveCellCoordinates: setActiveCellCoordinates,
|
197
198
|
rows: rows,
|
198
199
|
activeCellCoordinates: activeCellCoordinates,
|
199
|
-
defaultColumn: defaultColumn
|
200
|
+
defaultColumn: defaultColumn,
|
201
|
+
selectionAreas: selectionAreas
|
200
202
|
}); // Make sure that if the cellSize prop changes, the active
|
201
|
-
// cell also gets updated with the new size
|
203
|
+
// cell also gets updated with the new size and new top placement
|
204
|
+
// value. All of the cell selections will be updated as well
|
202
205
|
|
203
206
|
(0, _react.useEffect)(function () {
|
204
207
|
var listContainer = spreadsheetBodyRef === null || spreadsheetBodyRef === void 0 ? void 0 : spreadsheetBodyRef.current;
|
205
208
|
var activeCellButton = listContainer.querySelector(".".concat(blockClass, "__active-cell--highlight"));
|
206
209
|
|
207
|
-
if (activeCellButton) {
|
210
|
+
if (activeCellButton && defaultColumn.rowHeight !== previousState.rowHeight) {
|
208
211
|
activeCellButton.style.height = "".concat(defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeight, "px");
|
212
|
+
|
213
|
+
if (activeCellCoordinates) {
|
214
|
+
var activeTargetElement = ref.current.querySelector("[data-row-index=\"".concat(activeCellCoordinates.row, "\"][data-column-index=\"").concat(activeCellCoordinates.column, "\"]"));
|
215
|
+
|
216
|
+
var _listContainer = ref.current.querySelector(".".concat(blockClass, "__list--container"));
|
217
|
+
|
218
|
+
var newActiveCellTopPosition = activeTargetElement.getBoundingClientRect().top - _listContainer.getBoundingClientRect().top;
|
219
|
+
|
220
|
+
activeCellButton.style.top = (0, _layout.px)(newActiveCellTopPosition);
|
221
|
+
(0, _removeCellSelections.removeCellSelections)({
|
222
|
+
spreadsheetRef: ref
|
223
|
+
});
|
224
|
+
selectionAreas.map(function (area) {
|
225
|
+
if (!area.areaCreated && area.point1 && area.point2 && area.matcher) {
|
226
|
+
return (0, _createCellSelectionArea.createCellSelectionArea)({
|
227
|
+
ref: ref,
|
228
|
+
area: area,
|
229
|
+
blockClass: blockClass,
|
230
|
+
defaultColumn: defaultColumn,
|
231
|
+
selectionAreas: selectionAreas,
|
232
|
+
setSelectionAreas: setSelectionAreas,
|
233
|
+
setActiveCellInsideSelectionArea: setActiveCellInsideSelectionArea,
|
234
|
+
visibleColumns: visibleColumns
|
235
|
+
});
|
236
|
+
}
|
237
|
+
});
|
238
|
+
}
|
209
239
|
}
|
210
|
-
}, [defaultColumn === null ||
|
240
|
+
}, [defaultColumn, ref, activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.rowHeight, selectionAreas, setActiveCellInsideSelectionArea, setSelectionAreas, visibleColumns]); // onClick fn for each cell in the data spreadsheet body,
|
211
241
|
// adds the active cell highlight
|
212
242
|
|
213
243
|
var handleBodyCellClick = (0, _react.useCallback)(function (cell, columnIndex) {
|
@@ -392,7 +422,7 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
392
422
|
"data-column-index": "header",
|
393
423
|
type: "button",
|
394
424
|
onClick: handleRowHeaderClick(index),
|
395
|
-
className: (0, _classnames.default)("".concat(blockClass, "__td"), "".concat(blockClass, "__td-th"), "".concat(blockClass, "--interactive-cell-element"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__td-th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === index || (0, _checkActiveHeaderCell.checkActiveHeaderCell)(index, selectionAreas, 'row')), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__td-th--selected-header"), (0, _checkSelectedHeaderCell.checkSelectedHeaderCell)(index, selectionAreas, 'row')), _cx)),
|
425
|
+
className: (0, _classnames.default)("".concat(blockClass, "__td"), "".concat(blockClass, "__td-th"), "".concat(blockClass, "--interactive-cell-element"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__td-th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === index || (0, _checkActiveHeaderCell.checkActiveHeaderCell)(index, selectionAreas, 'row')), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__td-th--selected-header"), (0, _checkSelectedHeaderCell.checkSelectedHeaderCell)(index, selectionAreas, 'row', columns)), _cx)),
|
396
426
|
style: {
|
397
427
|
width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth
|
398
428
|
}
|
@@ -421,7 +451,7 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
421
451
|
}, cell.render('Cell')));
|
422
452
|
}));
|
423
453
|
}
|
424
|
-
}, [prepareRow, rows, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClick, handleBodyCellClick, handleBodyCellHover, defaultColumn]);
|
454
|
+
}, [prepareRow, rows, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClick, handleBodyCellClick, handleBodyCellHover, defaultColumn, columns]);
|
425
455
|
var spreadsheetBodyRef = (0, _react.useRef)();
|
426
456
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
427
457
|
ref: spreadsheetBodyRef,
|
@@ -52,6 +52,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
52
52
|
var activeCellCoordinates = _ref.activeCellCoordinates,
|
53
53
|
cellSize = _ref.cellSize,
|
54
54
|
columns = _ref.columns,
|
55
|
+
currentMatcher = _ref.currentMatcher,
|
55
56
|
defaultColumn = _ref.defaultColumn,
|
56
57
|
headerGroups = _ref.headerGroups,
|
57
58
|
scrollBarSize = _ref.scrollBarSize,
|
@@ -94,6 +95,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
94
95
|
var handleColumnHeaderClick = function handleColumnHeaderClick(index) {
|
95
96
|
return function (event) {
|
96
97
|
var isHoldingCommandKey = event.metaKey || event.ctrlKey;
|
98
|
+
var isHoldingShiftKey = event.shiftKey;
|
97
99
|
(0, _handleHeaderCellSelection.handleHeaderCellSelection)({
|
98
100
|
type: 'column',
|
99
101
|
activeCellCoordinates: activeCellCoordinates,
|
@@ -105,7 +107,9 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
105
107
|
spreadsheetRef: ref,
|
106
108
|
index: index,
|
107
109
|
setSelectionAreaData: setSelectionAreaData,
|
108
|
-
isHoldingCommandKey: isHoldingCommandKey
|
110
|
+
isHoldingCommandKey: isHoldingCommandKey,
|
111
|
+
isHoldingShiftKey: isHoldingShiftKey,
|
112
|
+
currentMatcher: currentMatcher
|
109
113
|
});
|
110
114
|
};
|
111
115
|
};
|
@@ -126,23 +130,30 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
126
130
|
return function (event) {
|
127
131
|
var _selectionAreaToClone;
|
128
132
|
|
133
|
+
if (event.shiftKey) {
|
134
|
+
// Remove columns, need to call handleHeaderCellSelection
|
135
|
+
return;
|
136
|
+
}
|
137
|
+
|
129
138
|
setSelectedHeaderReorderActive(true);
|
139
|
+
var selectionAreaToClone = selectionAreas.filter(function (item) {
|
140
|
+
return (item === null || item === void 0 ? void 0 : item.matcher) === currentMatcher;
|
141
|
+
});
|
142
|
+
var selectionAreaElement = ref.current.querySelector("[data-matcher-id=\"".concat((_selectionAreaToClone = selectionAreaToClone[0]) === null || _selectionAreaToClone === void 0 ? void 0 : _selectionAreaToClone.matcher, "\"]"));
|
130
143
|
var clickXPosition = event.clientX;
|
131
144
|
var headerButtonCoords = event.target.getBoundingClientRect();
|
145
|
+
var headerIndex = event.target.getAttribute('data-column-index');
|
132
146
|
var offsetXValue = clickXPosition - headerButtonCoords.left;
|
147
|
+
var lowestColumnIndexFromSelectionArea = Math.min(selectionAreaToClone[0].point1.column, selectionAreaToClone[0].point2.column);
|
148
|
+
var selectionAreaCoords = selectionAreaElement.getBoundingClientRect();
|
149
|
+
var updatedOffsetDifference = lowestColumnIndexFromSelectionArea < parseInt(headerIndex) ? offsetXValue + (headerButtonCoords.left - selectionAreaCoords.left) : offsetXValue;
|
133
150
|
var bodyContainer = document.querySelector(".".concat(blockClass, "__list--container")).firstElementChild;
|
134
|
-
var selectionAreaToClone = selectionAreas.filter(function (item) {
|
135
|
-
var _item$header;
|
136
|
-
|
137
|
-
return (item === null || item === void 0 ? void 0 : (_item$header = item.header) === null || _item$header === void 0 ? void 0 : _item$header.index) === index;
|
138
|
-
});
|
139
|
-
var selectionAreaElement = ref.current.querySelector("[data-matcher-id=\"".concat((_selectionAreaToClone = selectionAreaToClone[0]) === null || _selectionAreaToClone === void 0 ? void 0 : _selectionAreaToClone.matcher, "\"]"));
|
140
151
|
var selectionAreaClonedElement = selectionAreaElement.cloneNode();
|
141
152
|
var reorderIndicatorLine = selectionAreaElement.cloneNode();
|
142
153
|
reorderIndicatorLine.className = "".concat(blockClass, "__reorder-indicator-line");
|
143
154
|
reorderIndicatorLine.style.width = (0, _layout.px)(2);
|
144
155
|
selectionAreaClonedElement.classList.add("".concat(blockClass, "__selection-area--element-cloned"));
|
145
|
-
selectionAreaClonedElement.setAttribute('data-clone-offset-x',
|
156
|
+
selectionAreaClonedElement.setAttribute('data-clone-offset-x', updatedOffsetDifference);
|
146
157
|
selectionAreaClonedElement.setAttribute('data-column-index-original', index);
|
147
158
|
bodyContainer.appendChild(selectionAreaClonedElement);
|
148
159
|
bodyContainer.appendChild(reorderIndicatorLine);
|
@@ -192,7 +203,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
192
203
|
}, "\xA0")), headerGroup.headers.map(function (column, index) {
|
193
204
|
var _cx2;
|
194
205
|
|
195
|
-
var selectedHeader = (0, _checkSelectedHeaderCell.checkSelectedHeaderCell)(index, selectionAreas, 'column');
|
206
|
+
var selectedHeader = (0, _checkSelectedHeaderCell.checkSelectedHeaderCell)(index, selectionAreas, 'column', rows);
|
196
207
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
197
208
|
key: "column_".concat(index),
|
198
209
|
role: "columnheader",
|
@@ -230,13 +241,18 @@ DataSpreadsheetHeader.propTypes = {
|
|
230
241
|
/**
|
231
242
|
* Specifies the cell height
|
232
243
|
*/
|
233
|
-
cellSize: _propTypes.default.oneOf(['
|
244
|
+
cellSize: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg']),
|
234
245
|
|
235
246
|
/**
|
236
247
|
* All of the spreadsheet columns
|
237
248
|
*/
|
238
249
|
columns: _propTypes.default.array,
|
239
250
|
|
251
|
+
/**
|
252
|
+
* uuid that corresponds to the current selection area
|
253
|
+
*/
|
254
|
+
currentMatcher: _propTypes.default.string,
|
255
|
+
|
240
256
|
/**
|
241
257
|
* Default spreadsheet sizing values
|
242
258
|
*/
|
@@ -11,8 +11,6 @@ var _layout = require("@carbon/layout");
|
|
11
11
|
|
12
12
|
var _settings = require("../../../settings");
|
13
13
|
|
14
|
-
var _getScrollbarWidth = require("../../../global/js/utils/getScrollbarWidth");
|
15
|
-
|
16
14
|
var _moveColumnIndicatorLine = require("../utils/moveColumnIndicatorLine");
|
17
15
|
|
18
16
|
/**
|
@@ -38,21 +36,24 @@ var useSpreadsheetMouseMove = function useSpreadsheetMouseMove(_ref) {
|
|
38
36
|
}
|
39
37
|
|
40
38
|
var spreadsheetCoords = ref.current.getBoundingClientRect();
|
39
|
+
var listContainer = ref.current.querySelector(".".concat(blockClass, "__list--container"));
|
40
|
+
var scrollAmount = listContainer.scrollLeft;
|
41
41
|
(0, _moveColumnIndicatorLine.moveColumnIndicatorLine)({
|
42
42
|
clonedSelectionElement: clonedSelectionElement,
|
43
43
|
ref: ref,
|
44
|
-
spreadsheetCoords: spreadsheetCoords
|
44
|
+
spreadsheetCoords: spreadsheetCoords,
|
45
|
+
leftScrollAmount: scrollAmount
|
45
46
|
});
|
46
|
-
var scrollbarWidth = (0, _getScrollbarWidth.getScrollbarWidth)();
|
47
47
|
var spreadsheetWrapperElement = ref.current;
|
48
48
|
spreadsheetWrapperElement.getBoundingClientRect();
|
49
49
|
var xPositionRelativeToSpreadsheet = event.clientX - spreadsheetCoords.left;
|
50
50
|
var offsetXValue = clonedSelectionElement === null || clonedSelectionElement === void 0 ? void 0 : clonedSelectionElement.getAttribute('data-clone-offset-x');
|
51
|
-
var
|
51
|
+
var totalSpreadsheetScrollingWidth = listContainer.scrollWidth;
|
52
52
|
var clonedSelectionWidth = clonedSelectionElement.offsetWidth;
|
53
|
-
var clonePlacement = Math.max(xPositionRelativeToSpreadsheet - offsetXValue, defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth); // Moves the position of the cloned selection area to follow mouse
|
53
|
+
var clonePlacement = Math.max(xPositionRelativeToSpreadsheet - offsetXValue, defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth); // Moves the position of the cloned selection area to follow mouse, and
|
54
|
+
// add the amount horizontally scrolled
|
54
55
|
|
55
|
-
clonedSelectionElement.style.left = (0, _layout.px)(
|
56
|
+
clonedSelectionElement.style.left = (0, _layout.px)(totalSpreadsheetScrollingWidth - clonedSelectionWidth >= clonePlacement ? clonePlacement + scrollAmount : totalSpreadsheetScrollingWidth - clonedSelectionWidth);
|
56
57
|
};
|
57
58
|
|
58
59
|
if (headerCellHoldActive) {
|
@@ -38,7 +38,8 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
38
38
|
setActiveCellCoordinates = _ref.setActiveCellCoordinates,
|
39
39
|
activeCellCoordinates = _ref.activeCellCoordinates,
|
40
40
|
rows = _ref.rows,
|
41
|
-
defaultColumn = _ref.defaultColumn
|
41
|
+
defaultColumn = _ref.defaultColumn,
|
42
|
+
selectionAreas = _ref.selectionAreas;
|
42
43
|
(0, _react.useEffect)(function () {
|
43
44
|
var handleMouseUp = function handleMouseUp(event) {
|
44
45
|
// Remove the cloned selection area on mouse up
|
@@ -53,8 +54,12 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
53
54
|
|
54
55
|
if (selectionAreaCloneElement) {
|
55
56
|
var closestCell = event.target.closest(".".concat(blockClass, "--interactive-cell-element"));
|
56
|
-
var newColumnIndex = closestCell === null || closestCell === void 0 ? void 0 : closestCell.getAttribute('data-column-index');
|
57
|
-
var originalColumnIndex = selectionAreaCloneElement === null || selectionAreaCloneElement === void 0 ? void 0 : selectionAreaCloneElement.getAttribute('data-column-index-original');
|
57
|
+
var newColumnIndex = parseInt === null || parseInt === void 0 ? void 0 : parseInt(closestCell === null || closestCell === void 0 ? void 0 : closestCell.getAttribute('data-column-index'));
|
58
|
+
var originalColumnIndex = parseInt === null || parseInt === void 0 ? void 0 : parseInt(selectionAreaCloneElement === null || selectionAreaCloneElement === void 0 ? void 0 : selectionAreaCloneElement.getAttribute('data-column-index-original'));
|
59
|
+
var selectionAreaToClone = selectionAreas.filter(function (item) {
|
60
|
+
return (item === null || item === void 0 ? void 0 : item.matcher) === currentMatcher;
|
61
|
+
});
|
62
|
+
var selectionAreaIndexArray = selectionAreaToClone[0].header.selectedIndexList;
|
58
63
|
var columnToMoveToElement = ref.current.querySelector("[data-row-index=\"header\"][data-column-index=\"".concat(newColumnIndex, "\"]")); // Mouse up element was not part of the spreadsheet component
|
59
64
|
|
60
65
|
if (!columnToMoveToElement) {
|
@@ -63,22 +68,11 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
63
68
|
|
64
69
|
var selectionAreaToMove = ref.current.querySelector("[data-matcher-id=\"".concat(currentMatcher, "\"]"));
|
65
70
|
var spreadsheetPosition = ref.current.getBoundingClientRect();
|
66
|
-
var
|
67
|
-
var
|
68
|
-
var cloneColumnWidth = selectionAreaCloneElement.offsetWidth;
|
69
|
-
var columnsWidthUpToNewIndex = 0;
|
71
|
+
var listContainer = ref.current.querySelector(".".concat(blockClass, "__list--container"));
|
72
|
+
var leftScrollAmount = listContainer.scrollLeft;
|
70
73
|
var newIndexLessThanStarting = newColumnIndex < originalColumnIndex;
|
71
|
-
|
72
|
-
|
73
|
-
return;
|
74
|
-
}
|
75
|
-
|
76
|
-
if (index <= newColumnIndex) {
|
77
|
-
columnsWidthUpToNewIndex += (item === null || item === void 0 ? void 0 : item.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width);
|
78
|
-
}
|
79
|
-
});
|
80
|
-
var updatedSelectionAreaPlacement = newIndexLessThanStarting ? relativeNewPosition : columnsWidthUpToNewIndex - cloneColumnWidth + (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth);
|
81
|
-
selectionAreaToMove.style.left = (0, _layout.px)(updatedSelectionAreaPlacement);
|
74
|
+
var newIndexGreater = newColumnIndex > originalColumnIndex;
|
75
|
+
var differenceBetweenOldNewIndex = newIndexGreater ? newColumnIndex - originalColumnIndex : originalColumnIndex - newColumnIndex;
|
82
76
|
setSelectionAreas(function (prev) {
|
83
77
|
var selectionAreaClone = (0, _deepCloneObject.deepCloneObject)(prev);
|
84
78
|
|
@@ -94,26 +88,64 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
94
88
|
return prev;
|
95
89
|
}
|
96
90
|
|
97
|
-
|
98
|
-
|
99
|
-
|
91
|
+
if (!selectionAreaIndexArray.includes(newColumnIndex)) {
|
92
|
+
// We need to not add just the newColumnIndex, but an array of indexes
|
93
|
+
// if there are multiple columns
|
94
|
+
var newIndexArray = newIndexGreater ? selectionAreaIndexArray.map(function (num) {
|
95
|
+
return num + differenceBetweenOldNewIndex;
|
96
|
+
}) : selectionAreaIndexArray.map(function (num) {
|
97
|
+
return num - differenceBetweenOldNewIndex;
|
98
|
+
});
|
99
|
+
selectionAreaClone[indexOfItemToUpdate].header.selectedIndexList = newIndexArray;
|
100
|
+
selectionAreaClone[indexOfItemToUpdate].point1.column = Math.min.apply(Math, (0, _toConsumableArray2.default)(newIndexArray));
|
101
|
+
selectionAreaClone[indexOfItemToUpdate].point2.column = Math.max.apply(Math, (0, _toConsumableArray2.default)(newIndexArray));
|
102
|
+
}
|
103
|
+
|
100
104
|
return selectionAreaClone;
|
101
|
-
});
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
105
|
+
}); // Only reorder columns if the new index is _not_ part of the
|
106
|
+
// selectionAreaIndexArray, meaning the new placement is outside
|
107
|
+
// of the current selection area. Similarly, the active cell position
|
108
|
+
// should only be changed under the same condition.
|
109
|
+
|
110
|
+
if (!selectionAreaIndexArray.includes(newColumnIndex)) {
|
111
|
+
var deleteCount = selectionAreaIndexArray.length;
|
112
|
+
var startIndex = Math.min.apply(Math, (0, _toConsumableArray2.default)(selectionAreaIndexArray));
|
113
|
+
var columnIdArray = visibleColumns.map(function (column) {
|
114
|
+
return column.id;
|
115
|
+
});
|
116
|
+
var columnIdArrayClone = (0, _toConsumableArray2.default)(columnIdArray);
|
106
117
|
|
107
|
-
|
118
|
+
var getNewColumnOrder = function getNewColumnOrder() {
|
119
|
+
var newColumnList = [];
|
120
|
+
selectionAreaIndexArray.map(function (index) {
|
121
|
+
return newColumnList.push(columnIdArray[index]);
|
122
|
+
});
|
123
|
+
return newColumnList;
|
124
|
+
}; // Remove one element at the original index
|
108
125
|
|
109
|
-
columnIdArrayClone.splice(newColumnIndex, 0, columnIdArray[originalColumnIndex]);
|
110
|
-
setColumnOrder(columnIdArrayClone); // Function provided by useTable (react-table) hook to reorder columns
|
111
126
|
|
112
|
-
|
113
|
-
|
114
|
-
|
127
|
+
columnIdArrayClone.splice(startIndex, deleteCount);
|
128
|
+
var originalPointIndex = selectionAreaIndexArray.findIndex(function (item) {
|
129
|
+
return item === originalColumnIndex;
|
130
|
+
});
|
131
|
+
var updatedNewIndexWithNewOrder = newColumnIndex - originalPointIndex; // Add one element at the new index
|
132
|
+
|
133
|
+
columnIdArrayClone.splice.apply(columnIdArrayClone, [updatedNewIndexWithNewOrder, 0].concat((0, _toConsumableArray2.default)(getNewColumnOrder())));
|
134
|
+
setColumnOrder(columnIdArrayClone); // Function provided by useTable (react-table) hook to reorder columns
|
135
|
+
|
136
|
+
var newCellCoords = _objectSpread(_objectSpread({}, activeCellCoordinates), {}, {
|
137
|
+
column: newIndexGreater ? activeCellCoordinates.column + differenceBetweenOldNewIndex : activeCellCoordinates.column - differenceBetweenOldNewIndex
|
138
|
+
});
|
139
|
+
|
140
|
+
setActiveCellCoordinates(newCellCoords);
|
141
|
+
var firstSelectedHeader = Array.from(ref.current.querySelectorAll(".".concat(blockClass, "__th--selected-header")))[0];
|
142
|
+
var firstSelectedHeaderCoords = firstSelectedHeader.getBoundingClientRect();
|
143
|
+
var newRelativePosition = firstSelectedHeaderCoords.left - spreadsheetPosition.left + leftScrollAmount; // console.log(firstSelectedHeaderCoords.left - spreadsheetPosition.left + leftScrollAmount);
|
144
|
+
|
145
|
+
var updatedSelectionAreaPlacement = newIndexLessThanStarting ? newRelativePosition : newColumnIndex === originalColumnIndex ? selectionAreaToMove.style.left : newRelativePosition;
|
146
|
+
selectionAreaToMove.style.left = (0, _layout.px)(updatedSelectionAreaPlacement);
|
147
|
+
} // Remove the cloned column and indicator elements
|
115
148
|
|
116
|
-
setActiveCellCoordinates(newCellCoords); // Remove the cloned column and indicator elements
|
117
149
|
|
118
150
|
var indicatorLineElement = ref.current.querySelector(".".concat(blockClass, "__reorder-indicator-line"));
|
119
151
|
indicatorLineElement === null || indicatorLineElement === void 0 ? void 0 : indicatorLineElement.remove();
|
@@ -155,7 +187,7 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
155
187
|
return function () {
|
156
188
|
document.removeEventListener('mouseup', handleMouseUp);
|
157
189
|
};
|
158
|
-
}, [blockClass, currentMatcher, setSelectionAreas, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn]);
|
190
|
+
}, [blockClass, currentMatcher, setSelectionAreas, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn, selectionAreas]);
|
159
191
|
};
|
160
192
|
|
161
193
|
exports.useSpreadsheetMouseUp = useSpreadsheetMouseUp;
|