@atlaskit/editor-plugin-table 5.4.17 → 5.4.19
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/CHANGELOG.md +13 -0
- package/dist/cjs/plugins/table/ui/DragHandle/HandleIconComponent.js +5 -3
- package/dist/cjs/plugins/table/ui/DragHandle/index.js +13 -6
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +33 -62
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +31 -62
- package/dist/es2019/plugins/table/ui/DragHandle/HandleIconComponent.js +5 -3
- package/dist/es2019/plugins/table/ui/DragHandle/index.js +11 -3
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +33 -63
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +29 -61
- package/dist/esm/plugins/table/ui/DragHandle/HandleIconComponent.js +5 -3
- package/dist/esm/plugins/table/ui/DragHandle/index.js +11 -4
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +33 -62
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +29 -60
- package/dist/types/plugins/table/types.d.ts +0 -1
- package/dist/types/plugins/table/ui/DragHandle/HandleIconComponent.d.ts +0 -1
- package/dist/types/plugins/table/ui/DragHandle/index.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/ui/DragHandle/HandleIconComponent.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/ui/DragHandle/index.d.ts +1 -2
- package/package.json +1 -1
- package/src/plugins/table/types.ts +0 -2
- package/src/plugins/table/ui/DragHandle/HandleIconComponent.tsx +9 -10
- package/src/plugins/table/ui/DragHandle/index.tsx +17 -6
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +48 -118
- package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +41 -126
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.4.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#59403](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59403) [`4edf50cbdc01`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4edf50cbdc01) - Fixed DnD preview bug which was impacting safari when the preview snapshot was taken, other html elements below the preview zone would be included.
|
|
8
|
+
|
|
9
|
+
## 5.4.18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#59374](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59374) [`7c5ff172f275`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7c5ff172f275) - Fix firefox issue with dragging when child element has pointer elements blocked
|
|
14
|
+
- [#59400](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59400) [`92bff40b42a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/92bff40b42a1) - revert changes to make drag handle visible when menu is open
|
|
15
|
+
|
|
3
16
|
## 5.4.17
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -9,7 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _icons = require("../icons");
|
|
10
10
|
var HandleIconComponent = exports.HandleIconComponent = function HandleIconComponent(props) {
|
|
11
11
|
var direction = props.direction,
|
|
12
|
-
forceDefaultHandle = props.forceDefaultHandle,
|
|
13
12
|
isDragMenuOpen = props.isDragMenuOpen,
|
|
14
13
|
isRowHandleHovered = props.isRowHandleHovered,
|
|
15
14
|
isColumnHandleHovered = props.isColumnHandleHovered,
|
|
@@ -20,8 +19,11 @@ var HandleIconComponent = exports.HandleIconComponent = function HandleIconCompo
|
|
|
20
19
|
var isHandleHovered = isRowHandleHovered || isColumnHandleHovered;
|
|
21
20
|
var isCurrentRowOrColumnSelected = isCurrentRowSelected || isCurrentColumnSelected;
|
|
22
21
|
var isDragMenuOpenOnCurrentRowOrColumn = isDragMenuOpen && dragMenuDirection === direction && isCurrentRowOrColumnSelected;
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
var showNormalHandle = hasMergedCells ? /*#__PURE__*/_react.default.createElement(_icons.DragHandleDisabledIcon, null) : /*#__PURE__*/_react.default.createElement(_icons.DragHandleIcon, null);
|
|
23
|
+
|
|
24
|
+
// hoverred handle or open drag menu
|
|
25
|
+
if (isHandleHovered || isDragMenuOpenOnCurrentRowOrColumn) {
|
|
26
|
+
return showNormalHandle;
|
|
25
27
|
}
|
|
26
28
|
return /*#__PURE__*/_react.default.createElement(_icons.MinimisedHandleIcon, null);
|
|
27
29
|
};
|
|
@@ -11,12 +11,13 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
14
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
15
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
15
16
|
var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview");
|
|
16
17
|
var _pluginFactory = require("../../pm-plugins/drag-and-drop/plugin-factory");
|
|
17
18
|
var _pluginFactory2 = require("../../pm-plugins/plugin-factory");
|
|
18
19
|
var _types = require("../../types");
|
|
19
|
-
var
|
|
20
|
+
var _utils2 = require("../../utils");
|
|
20
21
|
var _DragPreview = require("../DragPreview");
|
|
21
22
|
var _HandleIconComponent = require("./HandleIconComponent");
|
|
22
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -28,8 +29,6 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
28
29
|
_ref$appearance = _ref.appearance,
|
|
29
30
|
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
30
31
|
indexes = _ref.indexes,
|
|
31
|
-
_ref$forceDefaultHand = _ref.forceDefaultHandle,
|
|
32
|
-
forceDefaultHandle = _ref$forceDefaultHand === void 0 ? false : _ref$forceDefaultHand,
|
|
33
32
|
previewWidth = _ref.previewWidth,
|
|
34
33
|
previewHeight = _ref.previewHeight,
|
|
35
34
|
onMouseOver = _ref.onMouseOver,
|
|
@@ -56,12 +55,11 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
56
55
|
var isRowHandleHovered = direction === 'row' && hoveredRows.length > 0;
|
|
57
56
|
var isColumnHandleHovered = direction === 'column' && hoveredColumns.length > 0;
|
|
58
57
|
var hasMergedCells = (0, _react.useMemo)(function () {
|
|
59
|
-
return direction === 'row' ? (0,
|
|
58
|
+
return direction === 'row' ? (0, _utils2.hasMergedCellsInRow)(indexes[0])(selection) : (0, _utils2.hasMergedCellsInColumn)(indexes[0])(selection);
|
|
60
59
|
}, [indexes, direction, selection]);
|
|
61
60
|
var handleIconProps = {
|
|
62
61
|
hasMergedCells: hasMergedCells,
|
|
63
62
|
direction: direction,
|
|
64
|
-
forceDefaultHandle: forceDefaultHandle,
|
|
65
63
|
isDragMenuOpen: isDragMenuOpen,
|
|
66
64
|
isRowHandleHovered: isRowHandleHovered,
|
|
67
65
|
isColumnHandleHovered: isColumnHandleHovered,
|
|
@@ -90,6 +88,15 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
90
88
|
getOffset: function getOffset(_ref3) {
|
|
91
89
|
var container = _ref3.container;
|
|
92
90
|
var rect = container.getBoundingClientRect();
|
|
91
|
+
if (_utils.browser.safari) {
|
|
92
|
+
// See: https://product-fabric.atlassian.net/browse/ED-21442
|
|
93
|
+
// We need to ensure that the preview is not overlaying screen content when the snapshot is taken, otherwise
|
|
94
|
+
// safari will composite the screen text elements into the bitmap snapshot. The container is a wrapper which is already
|
|
95
|
+
// positioned fixed at top/left 0.
|
|
96
|
+
// IMPORTANT: we must not exceed more then the width of the container off-screen otherwise not preview will
|
|
97
|
+
// be generated.
|
|
98
|
+
container.style.left = "-".concat(rect.width - 0.0001, "px");
|
|
99
|
+
}
|
|
93
100
|
if (direction === 'row') {
|
|
94
101
|
return {
|
|
95
102
|
x: 16,
|
|
@@ -131,7 +138,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
131
138
|
_onMouseUp && _onMouseUp(e);
|
|
132
139
|
},
|
|
133
140
|
onClick: onClick
|
|
134
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
141
|
+
}, _utils.browser.gecko ? /*#__PURE__*/_react.default.createElement(_HandleIconComponent.HandleIconComponent, handleIconProps) : /*#__PURE__*/_react.default.createElement("span", {
|
|
135
142
|
style: {
|
|
136
143
|
pointerEvents: 'none'
|
|
137
144
|
}
|
|
@@ -10,14 +10,11 @@ var _editorTables = require("@atlaskit/editor-tables");
|
|
|
10
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
11
|
var _commands = require("../../../commands");
|
|
12
12
|
var _commands2 = require("../../../pm-plugins/drag-and-drop/commands");
|
|
13
|
-
var _pluginFactory = require("../../../pm-plugins/drag-and-drop/plugin-factory");
|
|
14
13
|
var _types = require("../../../types");
|
|
15
14
|
var _utils2 = require("../../../utils");
|
|
16
15
|
var _DragHandle = require("../../DragHandle");
|
|
17
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
20
|
-
|
|
21
18
|
var getSelectedColumns = function getSelectedColumns(selection) {
|
|
22
19
|
if (selection instanceof _editorTables.CellSelection && selection.isColSelection()) {
|
|
23
20
|
var rect = (0, _utils.getSelectionRect)(selection);
|
|
@@ -29,7 +26,7 @@ var getSelectedColumns = function getSelectedColumns(selection) {
|
|
|
29
26
|
return [];
|
|
30
27
|
};
|
|
31
28
|
var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
|
|
32
|
-
var _colWidths$map$join, _rowHeights$, _rowHeights$reduce;
|
|
29
|
+
var _colWidths$map$join, _rowHeights$, _rowHeights$reduce, _colWidths;
|
|
33
30
|
var editorView = _ref.editorView,
|
|
34
31
|
tableActive = _ref.tableActive,
|
|
35
32
|
tableRef = _ref.tableRef,
|
|
@@ -49,6 +46,13 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
|
|
|
49
46
|
var columnParams = (0, _utils2.getRowsParams)(colWidths !== null && colWidths !== void 0 ? colWidths : []);
|
|
50
47
|
var colIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex;
|
|
51
48
|
var selectedColIndexes = getSelectedColumns(editorView.state.selection);
|
|
49
|
+
var gridColumnPosition = (0, _react.useMemo)(function () {
|
|
50
|
+
// if more than one row is selected, ensure the handle spans over the selected range
|
|
51
|
+
if (selectedColIndexes.includes(colIndex)) {
|
|
52
|
+
return "".concat(selectedColIndexes[0] + 1, " / span ").concat(selectedColIndexes.length);
|
|
53
|
+
}
|
|
54
|
+
return "".concat(colIndex + 1, " / span 1");
|
|
55
|
+
}, [colIndex, selectedColIndexes]);
|
|
52
56
|
var firstRow = tableRef.querySelector('tr');
|
|
53
57
|
var hasHeaderRow = firstRow ? firstRow.getAttribute('data-header-row') : false;
|
|
54
58
|
var marginTop = hasHeaderRow && stickyTop !== undefined ? (_rowHeights$ = rowHeights === null || rowHeights === void 0 ? void 0 : rowHeights[0]) !== null && _rowHeights$ !== void 0 ? _rowHeights$ : 0 : 0;
|
|
@@ -100,63 +104,6 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
|
|
|
100
104
|
var previewHeight = (_rowHeights$reduce = rowHeights === null || rowHeights === void 0 ? void 0 : rowHeights.reduce(function (sum, cur) {
|
|
101
105
|
return sum + cur;
|
|
102
106
|
}, 0)) !== null && _rowHeights$reduce !== void 0 ? _rowHeights$reduce : 0;
|
|
103
|
-
var generateHandleByType = (0, _react.useCallback)(function (type) {
|
|
104
|
-
var _colWidths;
|
|
105
|
-
if (!hoveredCell) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
var _getDragDropPluginSta = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
109
|
-
isDragMenuOpen = _getDragDropPluginSta.isDragMenuOpen,
|
|
110
|
-
dragMenuIndex = _getDragDropPluginSta.dragMenuIndex,
|
|
111
|
-
dragMenuDirection = _getDragDropPluginSta.dragMenuDirection;
|
|
112
|
-
var isHover = type === 'hover';
|
|
113
|
-
var isHoveredOnSelectedColumn = isDragMenuOpen && dragMenuDirection === 'column' && dragMenuIndex === colIndex;
|
|
114
|
-
var showCondition = isHover ? !isHoveredOnSelectedColumn && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : isDragMenuOpen && dragMenuDirection === 'column';
|
|
115
|
-
if (!showCondition) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
var selectedColumnPosition = "".concat(dragMenuIndex + 1, " / span ").concat(selectedColIndexes.length);
|
|
119
|
-
var gridColumnPosition = selectedColIndexes.includes(colIndex) ? "".concat(selectedColIndexes[0] + 1, " / span ").concat(selectedColIndexes.length) : "".concat(colIndex + 1, " / span 1");
|
|
120
|
-
var selectedApprearance = isInDanger ? 'danger' : 'selected';
|
|
121
|
-
var hoveredAppearance = selectedColIndexes.includes(colIndex) ? isInDanger ? 'danger' : 'selected' : 'default';
|
|
122
|
-
return showCondition && /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
-
key: type,
|
|
124
|
-
style: {
|
|
125
|
-
gridColumn: isHover ? gridColumnPosition : selectedColumnPosition,
|
|
126
|
-
display: 'flex',
|
|
127
|
-
justifyContent: 'center',
|
|
128
|
-
alignItems: 'center',
|
|
129
|
-
height: 'fit-content',
|
|
130
|
-
placeSelf: 'center',
|
|
131
|
-
zIndex: 99
|
|
132
|
-
},
|
|
133
|
-
"data-column-control-index": hoveredCell.colIndex,
|
|
134
|
-
"data-testid": isHover ? 'table-floating-column-control' : 'table-floating-column-control-selected'
|
|
135
|
-
}, /*#__PURE__*/_react.default.createElement(_DragHandle.DragHandle, {
|
|
136
|
-
direction: "column",
|
|
137
|
-
tableLocalId: localId || '',
|
|
138
|
-
indexes: isHover ? colIndexes : selectedColIndexes,
|
|
139
|
-
forceDefaultHandle: !isHover,
|
|
140
|
-
previewWidth: (_colWidths = colWidths === null || colWidths === void 0 ? void 0 : colWidths[colIndex]) !== null && _colWidths !== void 0 ? _colWidths : 48,
|
|
141
|
-
previewHeight: previewHeight,
|
|
142
|
-
appearance: isHover ? hoveredAppearance : selectedApprearance,
|
|
143
|
-
onClick: handleClick,
|
|
144
|
-
onMouseOver: handleMouseOver,
|
|
145
|
-
onMouseOut: handleMouseOut,
|
|
146
|
-
onMouseUp: handleMouseUp,
|
|
147
|
-
editorView: editorView
|
|
148
|
-
}));
|
|
149
|
-
}, [colIndex, previewHeight, colWidths, colIndexes, editorView, handleClick, handleMouseOut, handleMouseOver, handleMouseUp, hoveredCell, isInDanger, localId, selectedColIndexes]);
|
|
150
|
-
var columnHandles = (0, _react.useCallback)(function (hoveredCell) {
|
|
151
|
-
if (!hoveredCell) {
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
if (hoveredCell.colIndex === undefined) {
|
|
155
|
-
return generateHandleByType('selected');
|
|
156
|
-
}
|
|
157
|
-
var sortedHandles = [generateHandleByType('hover'), generateHandleByType('selected')];
|
|
158
|
-
return hoveredCell.colIndex < selectedColIndexes[0] ? sortedHandles : sortedHandles.reverse();
|
|
159
|
-
}, [generateHandleByType, selectedColIndexes]);
|
|
160
107
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
161
108
|
className: _types.TableCssClassName.DRAG_COLUMN_CONTROLS,
|
|
162
109
|
onMouseMove: handleMouseMove
|
|
@@ -185,6 +132,30 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
|
|
|
185
132
|
right: '0'
|
|
186
133
|
} : {}
|
|
187
134
|
}));
|
|
188
|
-
}), tableActive && !isResizing &&
|
|
135
|
+
}), tableActive && !isResizing && isTableHovered && !!hoveredCell && Number.isFinite(hoveredCell.colIndex) && /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
+
style: {
|
|
137
|
+
gridColumn: gridColumnPosition,
|
|
138
|
+
display: 'flex',
|
|
139
|
+
justifyContent: 'center',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
height: 'fit-content',
|
|
142
|
+
placeSelf: 'center',
|
|
143
|
+
zIndex: 99
|
|
144
|
+
},
|
|
145
|
+
"data-column-control-index": hoveredCell.colIndex,
|
|
146
|
+
"data-testid": "table-floating-column-control"
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement(_DragHandle.DragHandle, {
|
|
148
|
+
direction: "column",
|
|
149
|
+
tableLocalId: localId || '',
|
|
150
|
+
indexes: colIndexes,
|
|
151
|
+
previewWidth: (_colWidths = colWidths === null || colWidths === void 0 ? void 0 : colWidths[colIndex]) !== null && _colWidths !== void 0 ? _colWidths : 48,
|
|
152
|
+
previewHeight: previewHeight,
|
|
153
|
+
appearance: selectedColIndexes.includes(hoveredCell.colIndex) ? isInDanger ? 'danger' : 'selected' : 'default',
|
|
154
|
+
onClick: handleClick,
|
|
155
|
+
onMouseOver: handleMouseOver,
|
|
156
|
+
onMouseOut: handleMouseOut,
|
|
157
|
+
onMouseUp: handleMouseUp,
|
|
158
|
+
editorView: editorView
|
|
159
|
+
}))));
|
|
189
160
|
};
|
|
190
161
|
var _default = exports.default = ColumnControls;
|
|
@@ -14,8 +14,7 @@ var _utils = require("@atlaskit/editor-tables/utils");
|
|
|
14
14
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
15
15
|
var _commands = require("../../../commands");
|
|
16
16
|
var _commands2 = require("../../../pm-plugins/drag-and-drop/commands");
|
|
17
|
-
var _pluginFactory = require("../../../pm-plugins/
|
|
18
|
-
var _pluginFactory2 = require("../../../pm-plugins/plugin-factory");
|
|
17
|
+
var _pluginFactory = require("../../../pm-plugins/plugin-factory");
|
|
19
18
|
var _types = require("../../../types");
|
|
20
19
|
var _utils2 = require("../../../utils");
|
|
21
20
|
var _consts = require("../../consts");
|
|
@@ -23,8 +22,6 @@ var _DragHandle = require("../../DragHandle");
|
|
|
23
22
|
var _RowDropTarget = _interopRequireDefault(require("../RowDropTarget"));
|
|
24
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
-
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
27
|
-
|
|
28
25
|
var getSelectedRows = function getSelectedRows(selection) {
|
|
29
26
|
if (selection instanceof _editorTables.CellSelection && selection.isRowSelection()) {
|
|
30
27
|
var rect = (0, _utils.getSelectionRect)(selection);
|
|
@@ -71,7 +68,7 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
71
68
|
if (!indexes || !localId || type !== 'table-row') {
|
|
72
69
|
return false;
|
|
73
70
|
}
|
|
74
|
-
var _getTablePluginState = (0,
|
|
71
|
+
var _getTablePluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
75
72
|
tableNode = _getTablePluginState.tableNode;
|
|
76
73
|
// If the draggable localId is the same as the current selected table localId then we will allow the monitor
|
|
77
74
|
// watch for changes
|
|
@@ -89,6 +86,13 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
89
86
|
(0, _commands2.toggleDragMenu)(undefined, 'row', hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex)(editorView.state, editorView.dispatch);
|
|
90
87
|
}, [editorView, hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex]);
|
|
91
88
|
var rowIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex;
|
|
89
|
+
var gridRowPosition = (0, _react.useMemo)(function () {
|
|
90
|
+
// if more than one row is selected, ensure the handle spans over the selected range
|
|
91
|
+
if (selectedRowIndexes.includes(rowIndex)) {
|
|
92
|
+
return "".concat(selectedRowIndexes[0] + 1, " / span ").concat(selectedRowIndexes.length);
|
|
93
|
+
}
|
|
94
|
+
return "".concat(rowIndex + 1, " / span 1");
|
|
95
|
+
}, [rowIndex, selectedRowIndexes]);
|
|
92
96
|
var handleMouseOut = (0, _react.useCallback)(function () {
|
|
93
97
|
if (tableActive) {
|
|
94
98
|
var state = editorView.state,
|
|
@@ -115,62 +119,6 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
115
119
|
var handleClick = (0, _react.useCallback)(function (e) {
|
|
116
120
|
selectRow(rowIndex, e === null || e === void 0 ? void 0 : e.shiftKey);
|
|
117
121
|
}, [rowIndex, selectRow]);
|
|
118
|
-
var generateHandleByType = (0, _react.useCallback)(function (type) {
|
|
119
|
-
if (!hoveredCell) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
var _getDragDropPluginSta = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
123
|
-
isDragMenuOpen = _getDragDropPluginSta.isDragMenuOpen,
|
|
124
|
-
dragMenuIndex = _getDragDropPluginSta.dragMenuIndex,
|
|
125
|
-
dragMenuDirection = _getDragDropPluginSta.dragMenuDirection;
|
|
126
|
-
var isHover = type === 'hover';
|
|
127
|
-
var isHoveredOnSelectedRow = isDragMenuOpen && dragMenuDirection === 'row' && dragMenuIndex === rowIndex;
|
|
128
|
-
var showCondition = isHover ? !isHoveredOnSelectedRow && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : isDragMenuOpen && dragMenuDirection === 'row' && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
|
|
129
|
-
if (!showCondition) {
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
var gridRowPosition =
|
|
133
|
-
// if more than one row is selected, ensure the handle spans over the selected range
|
|
134
|
-
selectedRowIndexes.includes(rowIndex) ? "".concat(selectedRowIndexes[0] + 1, " / span ").concat(selectedRowIndexes.length) : "".concat(rowIndex + 1, " / span 1");
|
|
135
|
-
var selectedRowPosition = "".concat(dragMenuIndex + 1, " / span ").concat(selectedRowIndexes.length);
|
|
136
|
-
var selectedApprearance = isInDanger ? 'danger' : 'selected';
|
|
137
|
-
var hoveredAppearance = selectedRowIndexes.includes(rowIndex) ? isInDanger ? 'danger' : 'selected' : 'default';
|
|
138
|
-
return showCondition && /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
-
key: type,
|
|
140
|
-
style: {
|
|
141
|
-
gridRow: isHover ? gridRowPosition : selectedRowPosition,
|
|
142
|
-
gridColumn: '2',
|
|
143
|
-
display: 'flex',
|
|
144
|
-
height: '100%',
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
justifyContent: 'center'
|
|
147
|
-
},
|
|
148
|
-
"data-testid": isHover ? 'table-floating-row-drag-handle' : 'table-floating-row-control-selected'
|
|
149
|
-
}, /*#__PURE__*/_react.default.createElement(_DragHandle.DragHandle, {
|
|
150
|
-
direction: "row",
|
|
151
|
-
tableLocalId: currentNodeLocalId,
|
|
152
|
-
indexes: isHover ? rowIndexes : selectedRowIndexes,
|
|
153
|
-
forceDefaultHandle: !isHover,
|
|
154
|
-
previewWidth: tableWidth,
|
|
155
|
-
previewHeight: rowHeights[rowIndex],
|
|
156
|
-
appearance: isHover ? hoveredAppearance : selectedApprearance,
|
|
157
|
-
onClick: handleClick,
|
|
158
|
-
onMouseOver: handleMouseOver,
|
|
159
|
-
onMouseOut: handleMouseOut,
|
|
160
|
-
onMouseUp: onMouseUp,
|
|
161
|
-
editorView: editorView
|
|
162
|
-
}));
|
|
163
|
-
}, [currentNodeLocalId, editorView, handleClick, handleMouseOut, handleMouseOver, hoveredCell, isInDanger, onMouseUp, rowHeights, rowIndex, rowIndexes, selectedRowIndexes, tableWidth]);
|
|
164
|
-
var rowHandles = (0, _react.useCallback)(function (hoveredCell) {
|
|
165
|
-
if (!hoveredCell) {
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
if (hoveredCell.rowIndex === undefined) {
|
|
169
|
-
return generateHandleByType('selected');
|
|
170
|
-
}
|
|
171
|
-
var sortedHandles = [generateHandleByType('hover'), generateHandleByType('selected')];
|
|
172
|
-
return hoveredCell.rowIndex < selectedRowIndexes[0] ? sortedHandles : sortedHandles.reverse();
|
|
173
|
-
}, [generateHandleByType, selectedRowIndexes]);
|
|
174
122
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
175
123
|
className: _types.TableCssClassName.DRAG_ROW_CONTROLS,
|
|
176
124
|
style: {
|
|
@@ -210,6 +158,27 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
210
158
|
left: "var(--ds-space-negative-100, -8px)"
|
|
211
159
|
}
|
|
212
160
|
}));
|
|
213
|
-
}), !isResizing && Number.isFinite(rowIndex) &&
|
|
161
|
+
}), !isResizing && isTableHovered && Number.isFinite(rowIndex) && /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
+
style: {
|
|
163
|
+
gridRow: gridRowPosition,
|
|
164
|
+
gridColumn: '2',
|
|
165
|
+
display: 'flex',
|
|
166
|
+
height: '100%',
|
|
167
|
+
alignItems: 'center',
|
|
168
|
+
justifyContent: 'center'
|
|
169
|
+
},
|
|
170
|
+
"data-testid": "table-floating-row-drag-handle"
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement(_DragHandle.DragHandle, {
|
|
172
|
+
tableLocalId: currentNodeLocalId,
|
|
173
|
+
indexes: rowIndexes,
|
|
174
|
+
previewWidth: tableWidth,
|
|
175
|
+
previewHeight: rowHeights[rowIndex],
|
|
176
|
+
appearance: selectedRowIndexes.includes(rowIndex) ? isInDanger ? 'danger' : 'selected' : 'default',
|
|
177
|
+
onClick: handleClick,
|
|
178
|
+
onMouseOver: handleMouseOver,
|
|
179
|
+
onMouseOut: handleMouseOut,
|
|
180
|
+
onMouseUp: onMouseUp,
|
|
181
|
+
editorView: editorView
|
|
182
|
+
})));
|
|
214
183
|
};
|
|
215
184
|
var DragControls = exports.DragControls = (0, _reactIntlNext.injectIntl)(DragControlsComponent);
|
|
@@ -3,7 +3,6 @@ import { DragHandleDisabledIcon, DragHandleIcon, MinimisedHandleIcon } from '../
|
|
|
3
3
|
export const HandleIconComponent = props => {
|
|
4
4
|
const {
|
|
5
5
|
direction,
|
|
6
|
-
forceDefaultHandle,
|
|
7
6
|
isDragMenuOpen,
|
|
8
7
|
isRowHandleHovered,
|
|
9
8
|
isColumnHandleHovered,
|
|
@@ -15,8 +14,11 @@ export const HandleIconComponent = props => {
|
|
|
15
14
|
const isHandleHovered = isRowHandleHovered || isColumnHandleHovered;
|
|
16
15
|
const isCurrentRowOrColumnSelected = isCurrentRowSelected || isCurrentColumnSelected;
|
|
17
16
|
const isDragMenuOpenOnCurrentRowOrColumn = isDragMenuOpen && dragMenuDirection === direction && isCurrentRowOrColumnSelected;
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const showNormalHandle = hasMergedCells ? /*#__PURE__*/React.createElement(DragHandleDisabledIcon, null) : /*#__PURE__*/React.createElement(DragHandleIcon, null);
|
|
18
|
+
|
|
19
|
+
// hoverred handle or open drag menu
|
|
20
|
+
if (isHandleHovered || isDragMenuOpenOnCurrentRowOrColumn) {
|
|
21
|
+
return showNormalHandle;
|
|
20
22
|
}
|
|
21
23
|
return /*#__PURE__*/React.createElement(MinimisedHandleIcon, null);
|
|
22
24
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
5
6
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
|
|
6
7
|
import { getPluginState as getDragDropPluginState } from '../../pm-plugins/drag-and-drop/plugin-factory';
|
|
@@ -14,7 +15,6 @@ export const DragHandle = ({
|
|
|
14
15
|
direction = 'row',
|
|
15
16
|
appearance = 'default',
|
|
16
17
|
indexes,
|
|
17
|
-
forceDefaultHandle = false,
|
|
18
18
|
previewWidth,
|
|
19
19
|
previewHeight,
|
|
20
20
|
onMouseOver,
|
|
@@ -46,7 +46,6 @@ export const DragHandle = ({
|
|
|
46
46
|
const handleIconProps = {
|
|
47
47
|
hasMergedCells,
|
|
48
48
|
direction,
|
|
49
|
-
forceDefaultHandle,
|
|
50
49
|
isDragMenuOpen,
|
|
51
50
|
isRowHandleHovered,
|
|
52
51
|
isColumnHandleHovered,
|
|
@@ -77,6 +76,15 @@ export const DragHandle = ({
|
|
|
77
76
|
container
|
|
78
77
|
}) => {
|
|
79
78
|
const rect = container.getBoundingClientRect();
|
|
79
|
+
if (browser.safari) {
|
|
80
|
+
// See: https://product-fabric.atlassian.net/browse/ED-21442
|
|
81
|
+
// We need to ensure that the preview is not overlaying screen content when the snapshot is taken, otherwise
|
|
82
|
+
// safari will composite the screen text elements into the bitmap snapshot. The container is a wrapper which is already
|
|
83
|
+
// positioned fixed at top/left 0.
|
|
84
|
+
// IMPORTANT: we must not exceed more then the width of the container off-screen otherwise not preview will
|
|
85
|
+
// be generated.
|
|
86
|
+
container.style.left = `-${rect.width - 0.0001}px`;
|
|
87
|
+
}
|
|
80
88
|
if (direction === 'row') {
|
|
81
89
|
return {
|
|
82
90
|
x: 16,
|
|
@@ -119,7 +127,7 @@ export const DragHandle = ({
|
|
|
119
127
|
onMouseUp && onMouseUp(e);
|
|
120
128
|
},
|
|
121
129
|
onClick: onClick
|
|
122
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
130
|
+
}, browser.gecko ? /*#__PURE__*/React.createElement(HandleIconComponent, handleIconProps) : /*#__PURE__*/React.createElement("span", {
|
|
123
131
|
style: {
|
|
124
132
|
pointerEvents: 'none'
|
|
125
133
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
2
|
-
|
|
3
1
|
import React, { useCallback, useMemo } from 'react';
|
|
4
2
|
import { CellSelection } from '@atlaskit/editor-tables';
|
|
5
3
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
6
4
|
import { clearHoverSelection, hoverCell, hoverColumns, selectColumn } from '../../../commands';
|
|
7
5
|
import { toggleDragMenu } from '../../../pm-plugins/drag-and-drop/commands';
|
|
8
|
-
import { getPluginState as getDragDropPluginState } from '../../../pm-plugins/drag-and-drop/plugin-factory';
|
|
9
6
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
10
7
|
import { getRowsParams, getSelectedColumnIndexes } from '../../../utils';
|
|
11
8
|
import { DragHandle } from '../../DragHandle';
|
|
@@ -33,12 +30,19 @@ export const ColumnControls = ({
|
|
|
33
30
|
hasHeaderColumn,
|
|
34
31
|
isTableHovered
|
|
35
32
|
}) => {
|
|
36
|
-
var _colWidths$map$join, _rowHeights$, _rowHeights$reduce;
|
|
33
|
+
var _colWidths$map$join, _rowHeights$, _rowHeights$reduce, _colWidths;
|
|
37
34
|
const widths = (_colWidths$map$join = colWidths === null || colWidths === void 0 ? void 0 : colWidths.map(width => width ? `${width - 1}px` : '0px').join(' ')) !== null && _colWidths$map$join !== void 0 ? _colWidths$map$join : '0px';
|
|
38
35
|
// TODO: reusing getRowsParams here because it's generic enough to work for columns -> rename
|
|
39
36
|
const columnParams = getRowsParams(colWidths !== null && colWidths !== void 0 ? colWidths : []);
|
|
40
37
|
const colIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex;
|
|
41
38
|
const selectedColIndexes = getSelectedColumns(editorView.state.selection);
|
|
39
|
+
const gridColumnPosition = useMemo(() => {
|
|
40
|
+
// if more than one row is selected, ensure the handle spans over the selected range
|
|
41
|
+
if (selectedColIndexes.includes(colIndex)) {
|
|
42
|
+
return `${selectedColIndexes[0] + 1} / span ${selectedColIndexes.length}`;
|
|
43
|
+
}
|
|
44
|
+
return `${colIndex + 1} / span 1`;
|
|
45
|
+
}, [colIndex, selectedColIndexes]);
|
|
42
46
|
const firstRow = tableRef.querySelector('tr');
|
|
43
47
|
const hasHeaderRow = firstRow ? firstRow.getAttribute('data-header-row') : false;
|
|
44
48
|
const marginTop = hasHeaderRow && stickyTop !== undefined ? (_rowHeights$ = rowHeights === null || rowHeights === void 0 ? void 0 : rowHeights[0]) !== null && _rowHeights$ !== void 0 ? _rowHeights$ : 0 : 0;
|
|
@@ -98,64 +102,6 @@ export const ColumnControls = ({
|
|
|
98
102
|
return [colIndex];
|
|
99
103
|
}, [colIndex]);
|
|
100
104
|
const previewHeight = (_rowHeights$reduce = rowHeights === null || rowHeights === void 0 ? void 0 : rowHeights.reduce((sum, cur) => sum + cur, 0)) !== null && _rowHeights$reduce !== void 0 ? _rowHeights$reduce : 0;
|
|
101
|
-
const generateHandleByType = useCallback(type => {
|
|
102
|
-
var _colWidths;
|
|
103
|
-
if (!hoveredCell) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
const {
|
|
107
|
-
isDragMenuOpen,
|
|
108
|
-
dragMenuIndex,
|
|
109
|
-
dragMenuDirection
|
|
110
|
-
} = getDragDropPluginState(editorView.state);
|
|
111
|
-
const isHover = type === 'hover';
|
|
112
|
-
const isHoveredOnSelectedColumn = isDragMenuOpen && dragMenuDirection === 'column' && dragMenuIndex === colIndex;
|
|
113
|
-
const showCondition = isHover ? !isHoveredOnSelectedColumn && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : isDragMenuOpen && dragMenuDirection === 'column';
|
|
114
|
-
if (!showCondition) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
const selectedColumnPosition = `${dragMenuIndex + 1} / span ${selectedColIndexes.length}`;
|
|
118
|
-
const gridColumnPosition = selectedColIndexes.includes(colIndex) ? `${selectedColIndexes[0] + 1} / span ${selectedColIndexes.length}` : `${colIndex + 1} / span 1`;
|
|
119
|
-
const selectedApprearance = isInDanger ? 'danger' : 'selected';
|
|
120
|
-
const hoveredAppearance = selectedColIndexes.includes(colIndex) ? isInDanger ? 'danger' : 'selected' : 'default';
|
|
121
|
-
return showCondition && /*#__PURE__*/React.createElement("div", {
|
|
122
|
-
key: type,
|
|
123
|
-
style: {
|
|
124
|
-
gridColumn: isHover ? gridColumnPosition : selectedColumnPosition,
|
|
125
|
-
display: 'flex',
|
|
126
|
-
justifyContent: 'center',
|
|
127
|
-
alignItems: 'center',
|
|
128
|
-
height: 'fit-content',
|
|
129
|
-
placeSelf: 'center',
|
|
130
|
-
zIndex: 99
|
|
131
|
-
},
|
|
132
|
-
"data-column-control-index": hoveredCell.colIndex,
|
|
133
|
-
"data-testid": isHover ? 'table-floating-column-control' : 'table-floating-column-control-selected'
|
|
134
|
-
}, /*#__PURE__*/React.createElement(DragHandle, {
|
|
135
|
-
direction: "column",
|
|
136
|
-
tableLocalId: localId || '',
|
|
137
|
-
indexes: isHover ? colIndexes : selectedColIndexes,
|
|
138
|
-
forceDefaultHandle: !isHover,
|
|
139
|
-
previewWidth: (_colWidths = colWidths === null || colWidths === void 0 ? void 0 : colWidths[colIndex]) !== null && _colWidths !== void 0 ? _colWidths : 48,
|
|
140
|
-
previewHeight: previewHeight,
|
|
141
|
-
appearance: isHover ? hoveredAppearance : selectedApprearance,
|
|
142
|
-
onClick: handleClick,
|
|
143
|
-
onMouseOver: handleMouseOver,
|
|
144
|
-
onMouseOut: handleMouseOut,
|
|
145
|
-
onMouseUp: handleMouseUp,
|
|
146
|
-
editorView: editorView
|
|
147
|
-
}));
|
|
148
|
-
}, [colIndex, previewHeight, colWidths, colIndexes, editorView, handleClick, handleMouseOut, handleMouseOver, handleMouseUp, hoveredCell, isInDanger, localId, selectedColIndexes]);
|
|
149
|
-
const columnHandles = useCallback(hoveredCell => {
|
|
150
|
-
if (!hoveredCell) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
if (hoveredCell.colIndex === undefined) {
|
|
154
|
-
return generateHandleByType('selected');
|
|
155
|
-
}
|
|
156
|
-
const sortedHandles = [generateHandleByType('hover'), generateHandleByType('selected')];
|
|
157
|
-
return hoveredCell.colIndex < selectedColIndexes[0] ? sortedHandles : sortedHandles.reverse();
|
|
158
|
-
}, [generateHandleByType, selectedColIndexes]);
|
|
159
105
|
return /*#__PURE__*/React.createElement("div", {
|
|
160
106
|
className: ClassName.DRAG_COLUMN_CONTROLS,
|
|
161
107
|
onMouseMove: handleMouseMove
|
|
@@ -183,6 +129,30 @@ export const ColumnControls = ({
|
|
|
183
129
|
style: columnParams.length - 1 === index ? {
|
|
184
130
|
right: '0'
|
|
185
131
|
} : {}
|
|
186
|
-
}))), tableActive && !isResizing &&
|
|
132
|
+
}))), tableActive && !isResizing && isTableHovered && !!hoveredCell && Number.isFinite(hoveredCell.colIndex) && /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
style: {
|
|
134
|
+
gridColumn: gridColumnPosition,
|
|
135
|
+
display: 'flex',
|
|
136
|
+
justifyContent: 'center',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
height: 'fit-content',
|
|
139
|
+
placeSelf: 'center',
|
|
140
|
+
zIndex: 99
|
|
141
|
+
},
|
|
142
|
+
"data-column-control-index": hoveredCell.colIndex,
|
|
143
|
+
"data-testid": "table-floating-column-control"
|
|
144
|
+
}, /*#__PURE__*/React.createElement(DragHandle, {
|
|
145
|
+
direction: "column",
|
|
146
|
+
tableLocalId: localId || '',
|
|
147
|
+
indexes: colIndexes,
|
|
148
|
+
previewWidth: (_colWidths = colWidths === null || colWidths === void 0 ? void 0 : colWidths[colIndex]) !== null && _colWidths !== void 0 ? _colWidths : 48,
|
|
149
|
+
previewHeight: previewHeight,
|
|
150
|
+
appearance: selectedColIndexes.includes(hoveredCell.colIndex) ? isInDanger ? 'danger' : 'selected' : 'default',
|
|
151
|
+
onClick: handleClick,
|
|
152
|
+
onMouseOver: handleMouseOver,
|
|
153
|
+
onMouseOut: handleMouseOut,
|
|
154
|
+
onMouseUp: handleMouseUp,
|
|
155
|
+
editorView: editorView
|
|
156
|
+
}))));
|
|
187
157
|
};
|
|
188
158
|
export default ColumnControls;
|