@atlaskit/editor-plugin-table 7.16.8 → 7.16.10
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 +16 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +4 -0
- package/dist/cjs/nodeviews/TableComponent.js +28 -5
- package/dist/cjs/nodeviews/TableContainer.js +32 -11
- package/dist/cjs/nodeviews/TableResizer.js +15 -9
- package/dist/cjs/toolbar.js +17 -7
- package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/cjs/ui/DragHandle/index.js +10 -3
- package/dist/cjs/ui/DragPreview/index.js +1 -0
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +12 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +3 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
- package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +7 -2
- package/dist/cjs/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +7 -2
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +61 -57
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +36 -14
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +13 -4
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +50 -43
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
- package/dist/cjs/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
- package/dist/cjs/ui/TableFloatingControls/index.js +80 -76
- package/dist/cjs/ui/icons/DragHandleDisabledIcon.js +3 -1
- package/dist/cjs/ui/icons/DragInMotionIcon.js +3 -1
- package/dist/cjs/ui/icons/MinimisedHandle.js +1 -0
- package/dist/cjs/utils/guidelines.js +5 -2
- package/dist/cjs/utils/snapping.js +16 -7
- package/dist/es2019/nodeviews/ExternalDropTargets.js +4 -0
- package/dist/es2019/nodeviews/TableComponent.js +28 -5
- package/dist/es2019/nodeviews/TableContainer.js +32 -11
- package/dist/es2019/nodeviews/TableResizer.js +13 -9
- package/dist/es2019/toolbar.js +13 -3
- package/dist/es2019/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/es2019/ui/DragHandle/index.js +10 -3
- package/dist/es2019/ui/DragPreview/index.js +1 -0
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +12 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +3 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
- package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +7 -2
- package/dist/es2019/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +7 -2
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +56 -52
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +36 -14
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +13 -4
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +47 -40
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
- package/dist/es2019/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
- package/dist/es2019/ui/TableFloatingControls/index.js +78 -74
- package/dist/es2019/ui/icons/DragHandleDisabledIcon.js +3 -1
- package/dist/es2019/ui/icons/DragInMotionIcon.js +3 -1
- package/dist/es2019/ui/icons/MinimisedHandle.js +1 -0
- package/dist/es2019/utils/guidelines.js +5 -2
- package/dist/es2019/utils/snapping.js +16 -7
- package/dist/esm/nodeviews/ExternalDropTargets.js +4 -0
- package/dist/esm/nodeviews/TableComponent.js +28 -5
- package/dist/esm/nodeviews/TableContainer.js +32 -11
- package/dist/esm/nodeviews/TableResizer.js +15 -9
- package/dist/esm/toolbar.js +16 -4
- package/dist/esm/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/esm/ui/DragHandle/index.js +10 -3
- package/dist/esm/ui/DragPreview/index.js +1 -0
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +12 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +3 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
- package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +7 -2
- package/dist/esm/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +7 -2
- package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +61 -57
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +36 -14
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +13 -4
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +50 -43
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
- package/dist/esm/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
- package/dist/esm/ui/TableFloatingControls/index.js +80 -76
- package/dist/esm/ui/icons/DragHandleDisabledIcon.js +3 -1
- package/dist/esm/ui/icons/DragInMotionIcon.js +3 -1
- package/dist/esm/ui/icons/MinimisedHandle.js +1 -0
- package/dist/esm/utils/guidelines.js +5 -2
- package/dist/esm/utils/snapping.js +16 -7
- package/dist/types/toolbar.d.ts +2 -1
- package/dist/types/utils/guidelines.d.ts +2 -1
- package/dist/types/utils/snapping.d.ts +6 -2
- package/dist/types-ts4.5/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/utils/guidelines.d.ts +2 -1
- package/dist/types-ts4.5/utils/snapping.d.ts +6 -2
- package/docs/0-intro.tsx +1 -0
- package/package.json +1 -1
- package/src/nodeviews/ExternalDropTargets.tsx +4 -0
- package/src/nodeviews/TableComponent.tsx +19 -1
- package/src/nodeviews/TableContainer.tsx +12 -0
- package/src/nodeviews/TableResizer.tsx +20 -10
- package/src/toolbar.tsx +20 -1
- package/src/ui/ColumnResizeWidget/index.tsx +2 -0
- package/src/ui/DragHandle/index.tsx +3 -0
- package/src/ui/DragPreview/index.tsx +1 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +10 -0
- package/src/ui/FloatingContextualButton/index.tsx +1 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +3 -0
- package/src/ui/FloatingDeleteButton/DeleteButton.tsx +4 -0
- package/src/ui/FloatingDeleteButton/index.tsx +2 -0
- package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +3 -0
- package/src/ui/FloatingInsertButton/InsertButton.tsx +14 -0
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +16 -1
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/index.tsx +1 -0
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +6 -0
- package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +4 -0
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +5 -0
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +5 -0
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +15 -1
- package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -0
- package/src/ui/TableFloatingControls/index.tsx +1 -0
- package/src/ui/icons/DragHandleDisabledIcon.tsx +1 -0
- package/src/ui/icons/DragInMotionIcon.tsx +1 -0
- package/src/ui/icons/MinimisedHandle.tsx +1 -0
- package/src/utils/guidelines.ts +6 -2
- package/src/utils/snapping.ts +32 -19
|
@@ -120,20 +120,26 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
120
120
|
startMeasure = _useMeasureFramerate.startMeasure,
|
|
121
121
|
endMeasure = _useMeasureFramerate.endMeasure,
|
|
122
122
|
countFrames = _useMeasureFramerate.countFrames;
|
|
123
|
+
var excludeGuidelineConfig = useMemo(function () {
|
|
124
|
+
return {
|
|
125
|
+
innerGuidelines: !!isTableAlignmentEnabled,
|
|
126
|
+
breakoutPoints: !!(isTableAlignmentEnabled && tableState !== null && tableState !== void 0 && tableState.isFullWidthModeEnabled)
|
|
127
|
+
};
|
|
128
|
+
}, [tableState, isTableAlignmentEnabled]);
|
|
123
129
|
var updateActiveGuidelines = useCallback(function (_ref3) {
|
|
124
130
|
var gap = _ref3.gap,
|
|
125
131
|
keys = _ref3.keys;
|
|
126
132
|
if (gap !== currentGap.current) {
|
|
127
133
|
currentGap.current = gap;
|
|
128
|
-
var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth,
|
|
134
|
+
var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth);
|
|
129
135
|
displayGuideline(getGuidelinesWithHighlights(gap, TABLE_SNAP_GAP, keys, visibleGuidelines));
|
|
130
136
|
}
|
|
131
|
-
}, [isTableScalingEnabled,
|
|
137
|
+
}, [isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline]);
|
|
132
138
|
var guidelineSnaps = useMemo(function () {
|
|
133
139
|
return snappingEnabled ? {
|
|
134
|
-
x: isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth,
|
|
140
|
+
x: isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, excludeGuidelineConfig) : defaultSnappingWidths
|
|
135
141
|
} : undefined;
|
|
136
|
-
}, [snappingEnabled, isTableScalingEnabled,
|
|
142
|
+
}, [snappingEnabled, isTableScalingEnabled, excludeGuidelineConfig, containerWidth]);
|
|
137
143
|
var switchToCenterAlignment = useCallback(function (pos, node, newWidth, state, dispatch) {
|
|
138
144
|
if (isTableAlignmentEnabled && node && node.attrs.layout === ALIGN_START && newWidth > lineLength && lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH &&
|
|
139
145
|
// We don't want to switch alignment in Full-width editor
|
|
@@ -183,12 +189,12 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
183
189
|
name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
|
|
184
190
|
});
|
|
185
191
|
dispatch(tr);
|
|
186
|
-
var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth,
|
|
192
|
+
var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth);
|
|
187
193
|
setSnappingEnabled(displayGuideline(visibleGuidelines));
|
|
188
194
|
if (onResizeStart) {
|
|
189
195
|
onResizeStart();
|
|
190
196
|
}
|
|
191
|
-
}, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled,
|
|
197
|
+
}, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline, onResizeStart]);
|
|
192
198
|
var handleResize = useCallback(function (originalState, delta) {
|
|
193
199
|
var _node$attrs$localId, _node$attrs;
|
|
194
200
|
countFrames();
|
|
@@ -208,14 +214,14 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
208
214
|
start: pos + 1,
|
|
209
215
|
parentWidth: newWidth
|
|
210
216
|
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled);
|
|
211
|
-
var closestSnap = findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth,
|
|
217
|
+
var closestSnap = findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
|
|
212
218
|
updateActiveGuidelines(closestSnap);
|
|
213
219
|
|
|
214
220
|
// When snapping to the full width guideline, resize the table to be 1800px
|
|
215
221
|
var state = editorView.state,
|
|
216
222
|
dispatch = editorView.dispatch;
|
|
217
223
|
var currentTableNodeLocalId = (_node$attrs$localId = node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== null && _node$attrs$localId !== void 0 ? _node$attrs$localId : '';
|
|
218
|
-
var fullWidthGuideline = defaultGuidelinesForPreserveTable(containerWidth,
|
|
224
|
+
var fullWidthGuideline = defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig).filter(function (guideline) {
|
|
219
225
|
return guideline.isFullWidth;
|
|
220
226
|
})[0];
|
|
221
227
|
var isFullWidthGuidelineActive = closestSnap.keys.includes(fullWidthGuideline.key);
|
|
@@ -225,7 +231,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
225
231
|
}, updateWidthToWidest(_defineProperty({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
|
|
226
232
|
updateWidth(shouldUpdateWidthToWidest ? TABLE_MAX_WIDTH : newWidth);
|
|
227
233
|
return newWidth;
|
|
228
|
-
}, [countFrames, isTableScalingEnabled,
|
|
234
|
+
}, [countFrames, isTableScalingEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos, switchToCenterAlignment]);
|
|
229
235
|
var scheduleResize = useMemo(function () {
|
|
230
236
|
return rafSchd(handleResize);
|
|
231
237
|
}, [handleResize]);
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
6
|
/** @jsx jsx */
|
|
4
7
|
import { jsx } from '@emotion/react';
|
|
5
8
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
@@ -320,7 +323,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
320
323
|
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
|
|
321
324
|
var alignmentMenu;
|
|
322
325
|
var isNested = pluginState.tablePos && isTableNested(state, pluginState.tablePos);
|
|
323
|
-
alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI) : [];
|
|
326
|
+
alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth) : [];
|
|
324
327
|
var cellItems;
|
|
325
328
|
cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled);
|
|
326
329
|
var columnSettingsItems;
|
|
@@ -584,7 +587,7 @@ var highlightColumnsHandler = function highlightColumnsHandler(state, dispatch)
|
|
|
584
587
|
}
|
|
585
588
|
return false;
|
|
586
589
|
};
|
|
587
|
-
export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI) {
|
|
590
|
+
export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth) {
|
|
588
591
|
var formatMessage = _ref6.formatMessage;
|
|
589
592
|
var tableObject = findTable(editorState.selection);
|
|
590
593
|
if (!tableObject) {
|
|
@@ -610,14 +613,16 @@ export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editor
|
|
|
610
613
|
value = alignmentIcon.value,
|
|
611
614
|
icon = alignmentIcon.icon;
|
|
612
615
|
var currentLayout = tableObject.node.attrs.layout;
|
|
613
|
-
return {
|
|
616
|
+
return _objectSpread({
|
|
614
617
|
id: id,
|
|
615
618
|
type: 'button',
|
|
616
619
|
icon: icon,
|
|
617
620
|
title: formatMessage(layoutToMessages[value]),
|
|
618
621
|
selected: normaliseAlignment(currentLayout) === value,
|
|
619
622
|
onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB)
|
|
620
|
-
}
|
|
623
|
+
}, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth) && {
|
|
624
|
+
disabled: value !== 'center'
|
|
625
|
+
});
|
|
621
626
|
});
|
|
622
627
|
var alignmentItemOptions = {
|
|
623
628
|
render: function render(props) {
|
|
@@ -644,4 +649,11 @@ export var getSelectedAlignmentIcon = function getSelectedAlignmentIcon(alignmen
|
|
|
644
649
|
return alignmentIcons.find(function (icon) {
|
|
645
650
|
return icon.value === normaliseAlignment(selectedAlignment);
|
|
646
651
|
});
|
|
652
|
+
};
|
|
653
|
+
export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth) {
|
|
654
|
+
var lineLength = getEditorContainerWidth().lineLength;
|
|
655
|
+
if (selectedNode && lineLength && selectedNode.attrs.width > lineLength) {
|
|
656
|
+
return true;
|
|
657
|
+
}
|
|
658
|
+
return false;
|
|
647
659
|
};
|
|
@@ -14,6 +14,7 @@ export var ColumnResizeWidget = function ColumnResizeWidget(_ref) {
|
|
|
14
14
|
formatMessage = _useIntl.formatMessage;
|
|
15
15
|
if (!includeTooltip) {
|
|
16
16
|
return jsx("div", {
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
17
18
|
className: TableCssClassName.RESIZE_HANDLE_DECORATION,
|
|
18
19
|
"data-start-index": startIndex,
|
|
19
20
|
"data-end-index": endIndex
|
|
@@ -30,6 +31,7 @@ export var ColumnResizeWidget = function ColumnResizeWidget(_ref) {
|
|
|
30
31
|
mousePosition: "auto-start"
|
|
31
32
|
}, function (tooltipProps) {
|
|
32
33
|
return jsx("div", _extends({
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
33
35
|
className: TableCssClassName.RESIZE_HANDLE_DECORATION,
|
|
34
36
|
"data-start-index": startIndex,
|
|
35
37
|
"data-end-index": endIndex
|
|
@@ -146,7 +146,9 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
146
146
|
}, [tableLocalId, direction, indexes, isRow, editorView.state.selection, hasMergedCells]);
|
|
147
147
|
var showDragMenuAnchorId = isRow ? 'drag-handle-button-row' : 'drag-handle-button-column';
|
|
148
148
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
|
|
149
|
-
type: "button"
|
|
149
|
+
type: "button"
|
|
150
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
151
|
+
,
|
|
150
152
|
className: ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE,
|
|
151
153
|
"data-testid": "table-drag-handle-clickable-zone-button",
|
|
152
154
|
style: {
|
|
@@ -171,7 +173,9 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
171
173
|
onClick: onClick
|
|
172
174
|
}), /*#__PURE__*/React.createElement("button", {
|
|
173
175
|
type: "button",
|
|
174
|
-
id: isDragMenuTarget ? showDragMenuAnchorId : undefined
|
|
176
|
+
id: isDragMenuTarget ? showDragMenuAnchorId : undefined
|
|
177
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
178
|
+
,
|
|
175
179
|
className: classnames(ClassName.DRAG_HANDLE_BUTTON_CONTAINER, appearance, _defineProperty({}, ClassName.DRAG_HANDLE_DISABLED, hasMergedCells)),
|
|
176
180
|
ref: dragHandleDivRef,
|
|
177
181
|
style: {
|
|
@@ -198,7 +202,10 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
198
202
|
}
|
|
199
203
|
}, appearance !== 'placeholder' ?
|
|
200
204
|
// cannot block pointer events in Firefox as it breaks Dragging functionality
|
|
201
|
-
browser.gecko ? /*#__PURE__*/React.createElement(HandleIconComponent, handleIconProps) :
|
|
205
|
+
browser.gecko ? /*#__PURE__*/React.createElement(HandleIconComponent, handleIconProps) :
|
|
206
|
+
/*#__PURE__*/
|
|
207
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
208
|
+
React.createElement("span", {
|
|
202
209
|
style: {
|
|
203
210
|
pointerEvents: 'none'
|
|
204
211
|
}
|
|
@@ -23,6 +23,7 @@ export var DragPreview = function DragPreview(_ref) {
|
|
|
23
23
|
}
|
|
24
24
|
}, /*#__PURE__*/React.createElement(DragInMotionIcon, {
|
|
25
25
|
style: {
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
26
27
|
position: 'absolute',
|
|
27
28
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
28
29
|
marginLeft: "".concat(marginLeft, "px"),
|
|
@@ -91,19 +91,26 @@ export var FixedButton = function FixedButton(_ref2) {
|
|
|
91
91
|
React.createElement("div", {
|
|
92
92
|
ref: observerTargetRef,
|
|
93
93
|
style: {
|
|
94
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
94
95
|
position: 'absolute',
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
95
97
|
top: "var(--ds-space-0, 0px)",
|
|
98
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
96
99
|
left: "var(--ds-space-0, 0px)",
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
97
101
|
width: "var(--ds-space-250, 20px)",
|
|
98
102
|
// BUTTON_WIDTH
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
99
104
|
height: "var(--ds-space-250, 20px)" // BUTTON_WIDTH
|
|
100
105
|
}
|
|
101
106
|
}, /*#__PURE__*/React.createElement("div", {
|
|
102
107
|
ref: fixedButtonRef,
|
|
103
108
|
style: {
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
104
110
|
position: 'fixed',
|
|
105
111
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
106
112
|
top: stickyHeader.top + stickyHeader.padding + offset * 2,
|
|
113
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
107
114
|
zIndex: akEditorTableCellOnStickyHeaderZIndex,
|
|
108
115
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
109
116
|
left: calcLeftPos({
|
|
@@ -112,10 +119,14 @@ export var FixedButton = function FixedButton(_ref2) {
|
|
|
112
119
|
cellRefWidth: targetCellRef.clientWidth,
|
|
113
120
|
offset: offset
|
|
114
121
|
}),
|
|
122
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
115
123
|
width: "var(--ds-space-250, 20px)",
|
|
116
124
|
// BUTTON_WIDTH
|
|
125
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
117
126
|
height: "var(--ds-space-250, 20px)" // BUTTON_WIDTH
|
|
118
|
-
}
|
|
127
|
+
}
|
|
128
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
129
|
+
,
|
|
119
130
|
className: ClassName.CONTEXTUAL_MENU_BUTTON_FIXED
|
|
120
131
|
}, children)), mountTo);
|
|
121
132
|
};
|
|
@@ -46,7 +46,9 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
46
46
|
var labelCellOptions = formatMessage(messages.cellOptions);
|
|
47
47
|
var button = jsx("div", {
|
|
48
48
|
css: [tableFloatingCellButtonStyles(), isContextualMenuOpen && tableFloatingCellButtonSelectedStyles()]
|
|
49
|
-
}, jsx(ToolbarButton
|
|
49
|
+
}, jsx(ToolbarButton
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
51
|
+
, {
|
|
50
52
|
className: ClassName.CONTEXTUAL_MENU_BUTTON,
|
|
51
53
|
selected: isContextualMenuOpen,
|
|
52
54
|
title: labelCellOptions,
|
|
@@ -89,12 +89,17 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
89
89
|
label: formatMessage(messages.backgroundColor),
|
|
90
90
|
size: "medium"
|
|
91
91
|
})) : undefined,
|
|
92
|
-
elemAfter:
|
|
92
|
+
elemAfter:
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
94
|
+
jsx("div", {
|
|
93
95
|
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
94
96
|
}, jsx("div", {
|
|
95
|
-
css: cellColourPreviewStyles(background)
|
|
97
|
+
css: cellColourPreviewStyles(background)
|
|
98
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
99
|
+
,
|
|
96
100
|
className: isDragAndDropEnabled ? ClassName.CONTEXTUAL_MENU_ICON_SMALL : ClassName.CONTEXTUAL_MENU_ICON
|
|
97
101
|
}), isSubmenuOpen && jsx("div", {
|
|
102
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
98
103
|
className: ClassName.CONTEXTUAL_SUBMENU,
|
|
99
104
|
ref: _this.handleSubMenuRef
|
|
100
105
|
}, jsx(ColorPalette, {
|
|
@@ -9,7 +9,10 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
9
9
|
removeLabel = _ref.removeLabel,
|
|
10
10
|
formatMessage = _ref.intl.formatMessage;
|
|
11
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
13
|
+
className: ClassName.CONTROLS_DELETE_BUTTON_WRAP
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
15
|
+
,
|
|
13
16
|
style: style,
|
|
14
17
|
onMouseEnter: onMouseEnter,
|
|
15
18
|
onMouseLeave: onMouseLeave
|
|
@@ -17,7 +20,9 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
17
20
|
type: "button",
|
|
18
21
|
"aria-label": formatMessage(removeLabel, {
|
|
19
22
|
0: 1
|
|
20
|
-
})
|
|
23
|
+
})
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
25
|
+
,
|
|
21
26
|
className: ClassName.CONTROLS_DELETE_BUTTON,
|
|
22
27
|
onMouseDown: onClick,
|
|
23
28
|
onMouseMove: function onMouseMove(e) {
|
|
@@ -198,9 +198,11 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
198
198
|
});
|
|
199
199
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", {
|
|
200
200
|
style: {
|
|
201
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
201
202
|
position: 'fixed',
|
|
202
203
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
203
204
|
top: pos.top,
|
|
205
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
204
206
|
zIndex: stickyRowZIndex,
|
|
205
207
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
206
208
|
left: rect.left + (pos.left || 0) - (this.state.selectionType === 'column' ? this.state.scrollLeft : 0) - (this.props.isNumberColumnEnabled ? akEditorTableNumberColumnWidth : 0)
|
|
@@ -251,12 +251,17 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
251
251
|
size: "medium"
|
|
252
252
|
})),
|
|
253
253
|
elemAfter: jsx("div", {
|
|
254
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
254
255
|
className: DropdownMenuSharedCssClassName.SUBMENU,
|
|
255
256
|
css: dragMenuBackgroundColorStyles
|
|
256
257
|
}, jsx("div", {
|
|
257
|
-
css: cellColourPreviewStyles(background)
|
|
258
|
+
css: cellColourPreviewStyles(background)
|
|
259
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
260
|
+
,
|
|
258
261
|
className: ClassName.DRAG_SUBMENU_ICON
|
|
259
|
-
}), isSubmenuOpen &&
|
|
262
|
+
}), isSubmenuOpen &&
|
|
263
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
264
|
+
jsx("div", {
|
|
260
265
|
className: ClassName.DRAG_SUBMENU,
|
|
261
266
|
ref: handleSubMenuRef
|
|
262
267
|
}, jsx(ArrowKeyNavigationProvider, {
|
|
@@ -82,69 +82,73 @@ export var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
82
82
|
}));
|
|
83
83
|
})));
|
|
84
84
|
};
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
85
|
+
return (
|
|
86
|
+
/*#__PURE__*/
|
|
87
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
88
|
+
React.createElement("div", {
|
|
89
|
+
className: "drag-dropdown-menu-wrapper"
|
|
90
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: "drag-dropdown-menu-popup-ref",
|
|
92
|
+
ref: handleRef
|
|
93
|
+
}), /*#__PURE__*/React.createElement(Popup, {
|
|
94
|
+
target: targetRefDiv,
|
|
95
|
+
mountTo: mountPoint,
|
|
96
|
+
boundariesElement: boundariesElement,
|
|
97
|
+
scrollableElement: scrollableElement,
|
|
98
|
+
onPlacementChanged: function onPlacementChanged(placement) {
|
|
99
|
+
setPopupPlacement(placement);
|
|
100
|
+
},
|
|
101
|
+
fitHeight: fitHeight,
|
|
102
|
+
fitWidth: fitWidth,
|
|
103
|
+
zIndex: akEditorFloatingPanelZIndex,
|
|
104
|
+
offset: [offsetX, offsetY],
|
|
105
|
+
allowOutOfBounds: true // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
106
|
+
}, disableKeyboardHandling ? innerMenu() : /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
107
|
+
closeOnTab: true,
|
|
108
|
+
type: ArrowKeyNavigationType.MENU,
|
|
109
|
+
handleClose: function handleClose() {
|
|
110
|
+
return _handleClose('handle');
|
|
111
|
+
},
|
|
112
|
+
onSelection: function onSelection(index) {
|
|
113
|
+
var results = items.flatMap(function (item) {
|
|
114
|
+
return 'items' in item ? item.items : item;
|
|
115
|
+
});
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
125
|
-
if (firstIndex === -1 || index <= firstIndex) {
|
|
126
|
-
onItemActivated && onItemActivated({
|
|
127
|
-
item: results[index]
|
|
117
|
+
// onSelection is called when any focusable element is 'activated'
|
|
118
|
+
// this is an issue as some menu items have toggles, which cause the index value
|
|
119
|
+
// in the callback to be outside of array length.
|
|
120
|
+
// The logic below normalises the index value based on the number
|
|
121
|
+
// of menu items with 2 focusable elements, and adjusts the index to ensure
|
|
122
|
+
// the correct menu item is sent in onItemActivated callback
|
|
123
|
+
var keys = ['row_numbers', 'header_row', 'header_column'];
|
|
124
|
+
var doubleItemCount = 0;
|
|
125
|
+
var firstIndex = results.findIndex(function (value) {
|
|
126
|
+
return keys.includes(value.key);
|
|
128
127
|
});
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
for (var i = firstIndex; i < results.length; i += 1) {
|
|
132
|
-
if (keys.includes(results[i].key)) {
|
|
133
|
-
doubleItemCount += 1;
|
|
134
|
-
}
|
|
135
|
-
if (firstIndex % 2 === 0 && index - doubleItemCount === i) {
|
|
128
|
+
if (firstIndex === -1 || index <= firstIndex) {
|
|
136
129
|
onItemActivated && onItemActivated({
|
|
137
|
-
item: results[
|
|
130
|
+
item: results[index]
|
|
138
131
|
});
|
|
139
132
|
return;
|
|
140
133
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
134
|
+
for (var i = firstIndex; i < results.length; i += 1) {
|
|
135
|
+
if (keys.includes(results[i].key)) {
|
|
136
|
+
doubleItemCount += 1;
|
|
137
|
+
}
|
|
138
|
+
if (firstIndex % 2 === 0 && index - doubleItemCount === i) {
|
|
139
|
+
onItemActivated && onItemActivated({
|
|
140
|
+
item: results[i]
|
|
141
|
+
});
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (firstIndex % 2 === 1 && index - doubleItemCount === i) {
|
|
145
|
+
onItemActivated && onItemActivated({
|
|
146
|
+
item: results[i]
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
|
-
}
|
|
149
|
-
|
|
152
|
+
}, innerMenu())))
|
|
153
|
+
);
|
|
150
154
|
};
|
|
@@ -68,12 +68,16 @@ export var InsertButtonForDragAndDrop = function InsertButtonForDragAndDrop(_ref
|
|
|
68
68
|
}),
|
|
69
69
|
position: "top"
|
|
70
70
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
71
72
|
className: classnames(ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, (_classnames = {}, _defineProperty(_classnames, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW, isRow), _defineProperty(_classnames, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN, !isRow), _classnames))
|
|
72
73
|
}, /*#__PURE__*/React.createElement("button", {
|
|
73
|
-
type: "button"
|
|
74
|
+
type: "button"
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
76
|
+
,
|
|
74
77
|
className: ClassName.DRAG_CONTROLS_INSERT_BUTTON,
|
|
75
78
|
onMouseDown: onMouseDown
|
|
76
79
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
77
81
|
className: ClassName.CONTROLS_BUTTON_ICON,
|
|
78
82
|
width: "16",
|
|
79
83
|
height: "16",
|
|
@@ -84,7 +88,10 @@ export var InsertButtonForDragAndDrop = function InsertButtonForDragAndDrop(_ref
|
|
|
84
88
|
d: "M8 4C7.44771 4 7 4.44771 7 5V7H5C4.44771 7 4 7.44771 4 8C4 8.55229 4.44771 9 5 9H7V11C7 11.5523 7.44771 12 8 12C8.55229 12 9 11.5523 9 11V9H11C11.5523 9 12 8.55229 12 8C12 7.44771 11.5523 7 11 7H9V5C9 4.44771 8.55229 4 8 4Z",
|
|
85
89
|
fill: "currentColor"
|
|
86
90
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
87
|
-
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
92
|
+
className: ClassName.CONTROLS_INSERT_LINE
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
94
|
+
,
|
|
88
95
|
style: type === 'row' ? {
|
|
89
96
|
width: getInsertLineWidth(tableRef, true),
|
|
90
97
|
left: "var(--ds-space-150, 12px)"
|
|
@@ -95,11 +102,16 @@ export var InsertButtonForDragAndDrop = function InsertButtonForDragAndDrop(_ref
|
|
|
95
102
|
}
|
|
96
103
|
})));
|
|
97
104
|
var floatingButtonClassName = isRow ? ClassName.CONTROLS_FLOATING_BUTTON_ROW : ClassName.CONTROLS_FLOATING_BUTTON_COLUMN;
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
return (
|
|
106
|
+
/*#__PURE__*/
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
108
|
+
React.createElement("div", {
|
|
109
|
+
className: floatingButtonClassName
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
112
|
+
className: "".concat(ClassName.DRAG_CONTROLS_INSERT_BUTTON_WRAP, " ").concat(ClassName.CONTROLS_INSERT_ROW)
|
|
113
|
+
}, content))
|
|
114
|
+
);
|
|
103
115
|
};
|
|
104
116
|
export var DragAndDropInsertButton = injectIntl(InsertButtonForDragAndDrop);
|
|
105
117
|
var InsertButton = function InsertButton(_ref3) {
|
|
@@ -117,7 +129,9 @@ var InsertButton = function InsertButton(_ref3) {
|
|
|
117
129
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
118
130
|
className: ClassName.CONTROLS_INSERT_BUTTON_INNER
|
|
119
131
|
}, /*#__PURE__*/React.createElement("button", {
|
|
120
|
-
type: "button"
|
|
132
|
+
type: "button"
|
|
133
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
134
|
+
,
|
|
121
135
|
className: ClassName.CONTROLS_INSERT_BUTTON,
|
|
122
136
|
onMouseDown: onMouseDown
|
|
123
137
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
@@ -127,7 +141,10 @@ var InsertButton = function InsertButton(_ref3) {
|
|
|
127
141
|
fill: "currentColor",
|
|
128
142
|
fillRule: "evenodd"
|
|
129
143
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
130
|
-
|
|
144
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
145
|
+
className: ClassName.CONTROLS_INSERT_LINE
|
|
146
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
147
|
+
,
|
|
131
148
|
style: type === 'row' ? {
|
|
132
149
|
width: getInsertLineWidth(tableRef)
|
|
133
150
|
} : {
|
|
@@ -135,10 +152,15 @@ var InsertButton = function InsertButton(_ref3) {
|
|
|
135
152
|
}
|
|
136
153
|
})));
|
|
137
154
|
var floatingButtonClassName = type === 'column' ? ClassName.CONTROLS_FLOATING_BUTTON_COLUMN : ClassName.CONTROLS_FLOATING_BUTTON_ROW;
|
|
138
|
-
return
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
155
|
+
return (
|
|
156
|
+
/*#__PURE__*/
|
|
157
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
158
|
+
React.createElement("div", {
|
|
159
|
+
className: floatingButtonClassName
|
|
160
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
162
|
+
className: "".concat(ClassName.CONTROLS_INSERT_BUTTON_WRAP, " ").concat(ClassName.CONTROLS_INSERT_ROW)
|
|
163
|
+
}, content))
|
|
164
|
+
);
|
|
143
165
|
};
|
|
144
166
|
export default injectIntl(InsertButton);
|
|
@@ -129,14 +129,23 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
129
129
|
key: type,
|
|
130
130
|
style: {
|
|
131
131
|
gridColumn: gridColumn,
|
|
132
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
132
133
|
gridRow: '1',
|
|
134
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
133
135
|
display: 'flex',
|
|
136
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
134
137
|
justifyContent: 'center',
|
|
138
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
135
139
|
alignItems: 'center',
|
|
140
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
136
141
|
height: 'fit-content',
|
|
142
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
137
143
|
placeSelf: 'center',
|
|
144
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
138
145
|
zIndex: 99,
|
|
146
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
139
147
|
width: '100%',
|
|
148
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
140
149
|
position: 'relative'
|
|
141
150
|
},
|
|
142
151
|
"data-testid": "table-floating-column-".concat(isHover ? colIndex : isPlaceholder ? appearance : selectedColIndexes[0], "-drag-handle")
|
|
@@ -178,15 +187,19 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
178
187
|
};
|
|
179
188
|
var containerWidth = isNumberColumnEnabled && tableContainerWidth ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth;
|
|
180
189
|
return /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
181
191
|
className: ClassName.DRAG_COLUMN_CONTROLS,
|
|
182
192
|
onMouseMove: handleMouseMove
|
|
183
193
|
}, /*#__PURE__*/React.createElement("div", {
|
|
184
|
-
ref: columnControlsRef
|
|
194
|
+
ref: columnControlsRef
|
|
195
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
196
|
+
,
|
|
185
197
|
className: ClassName.DRAG_COLUMN_CONTROLS_INNER,
|
|
186
198
|
"data-testid": "table-floating-column-controls",
|
|
187
199
|
style: {
|
|
200
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
188
201
|
gridTemplateColumns: widths,
|
|
189
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
202
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
190
203
|
marginTop: marginTop,
|
|
191
204
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
192
205
|
width: stickyTop ? containerWidth : undefined,
|
|
@@ -201,12 +214,17 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
201
214
|
gridColumn: "".concat(startIndex + 1, " / span 1")
|
|
202
215
|
},
|
|
203
216
|
"data-start-index": startIndex,
|
|
204
|
-
"data-end-index": endIndex
|
|
217
|
+
"data-end-index": endIndex
|
|
218
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
219
|
+
,
|
|
205
220
|
className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER,
|
|
206
221
|
contentEditable: false,
|
|
207
222
|
key: index
|
|
208
223
|
}, /*#__PURE__*/React.createElement("div", {
|
|
209
|
-
|
|
224
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
225
|
+
className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT
|
|
226
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
227
|
+
,
|
|
210
228
|
style: columnParams.length - 1 === index ? {
|
|
211
229
|
right: '0'
|
|
212
230
|
} : {}
|
|
@@ -80,7 +80,9 @@ export var ColumnDropTarget = function ColumnDropTarget(_ref) {
|
|
|
80
80
|
height: height && "".concat(height, "px"),
|
|
81
81
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
82
82
|
marginTop: marginTop && "".concat(marginTop, "px"),
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
83
84
|
pointerEvents: 'auto',
|
|
85
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
84
86
|
flexShrink: 0
|
|
85
87
|
},
|
|
86
88
|
"data-drop-target-index": index,
|