@atlaskit/editor-plugin-table 7.16.11 → 7.16.13
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/.eslintrc.js +3 -3
- package/CHANGELOG.md +16 -0
- package/dist/cjs/commands/misc.js +3 -3
- package/dist/cjs/nodeviews/TableCell.js +10 -10
- package/dist/cjs/nodeviews/TableContainer.js +83 -27
- package/dist/cjs/nodeviews/TableResizer.js +40 -19
- package/dist/cjs/nodeviews/TableRow.js +23 -23
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +3 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +4 -4
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +3 -3
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/cjs/ui/FloatingDragMenu/styles.js +1 -1
- package/dist/cjs/ui/common-styles.js +13 -13
- package/dist/cjs/ui/ui-styles.js +25 -25
- package/dist/cjs/utils/guidelines.js +7 -4
- package/dist/cjs/utils/merged-cells.js +3 -3
- package/dist/cjs/utils/snapping.js +7 -8
- package/dist/es2019/commands/misc.js +3 -3
- package/dist/es2019/nodeviews/TableContainer.js +70 -9
- package/dist/es2019/nodeviews/TableResizer.js +42 -21
- package/dist/es2019/nodeviews/TableRow.js +21 -21
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +3 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +4 -4
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +3 -3
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +47 -47
- package/dist/es2019/ui/FloatingDragMenu/styles.js +30 -30
- package/dist/es2019/ui/common-styles.js +802 -816
- package/dist/es2019/ui/ui-styles.js +665 -678
- package/dist/es2019/utils/guidelines.js +5 -2
- package/dist/es2019/utils/merged-cells.js +3 -3
- package/dist/es2019/utils/snapping.js +5 -6
- package/dist/esm/commands/misc.js +3 -3
- package/dist/esm/nodeviews/TableCell.js +10 -10
- package/dist/esm/nodeviews/TableContainer.js +85 -29
- package/dist/esm/nodeviews/TableResizer.js +42 -21
- package/dist/esm/nodeviews/TableRow.js +23 -23
- package/dist/esm/pm-plugins/table-resizing/plugin.js +3 -3
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +4 -4
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +3 -3
- package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/esm/ui/FloatingDragMenu/styles.js +1 -1
- package/dist/esm/ui/common-styles.js +13 -13
- package/dist/esm/ui/ui-styles.js +25 -25
- package/dist/esm/utils/guidelines.js +6 -3
- package/dist/esm/utils/merged-cells.js +3 -3
- package/dist/esm/utils/snapping.js +6 -7
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/pm-plugins/decorations/utils/index.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/utils/getDragBehaviour.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +1 -1
- package/dist/types/ui/ColumnResizeWidget/index.d.ts +1 -1
- package/dist/types/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +1 -1
- package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
- package/dist/types/utils/guidelines.d.ts +2 -1
- package/dist/types/utils/snapping.d.ts +3 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/decorations/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/getDragBehaviour.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
- package/dist/types-ts4.5/utils/guidelines.d.ts +2 -1
- package/dist/types-ts4.5/utils/snapping.d.ts +3 -2
- package/docs/0-intro.tsx +9 -7
- package/package.json +3 -3
- package/report.api.md +67 -66
- package/src/commands/clear.ts +36 -44
- package/src/commands/collapse.ts +8 -8
- package/src/commands/column-resize.ts +412 -452
- package/src/commands/delete.ts +14 -14
- package/src/commands/display-mode.ts +10 -11
- package/src/commands/go-to-next-cell.ts +48 -54
- package/src/commands/hover.ts +210 -227
- package/src/commands/index.ts +35 -35
- package/src/commands/insert.ts +208 -235
- package/src/commands/misc.ts +655 -748
- package/src/commands/referentiality.ts +9 -9
- package/src/commands/selection.ts +433 -563
- package/src/commands/sort.ts +68 -86
- package/src/commands/split-cell.ts +14 -14
- package/src/commands/toggle.ts +69 -67
- package/src/commands-with-analytics.ts +570 -639
- package/src/create-plugin-config.ts +13 -13
- package/src/event-handlers.ts +513 -612
- package/src/handlers.ts +120 -133
- package/src/nodeviews/ExternalDropTargets.tsx +68 -73
- package/src/nodeviews/OverflowShadowsObserver.ts +148 -157
- package/src/nodeviews/TableCell.ts +47 -54
- package/src/nodeviews/TableComponent.tsx +1018 -1112
- package/src/nodeviews/TableComponentWithSharedState.tsx +91 -94
- package/src/nodeviews/TableContainer.tsx +384 -340
- package/src/nodeviews/TableNodeViewBase.ts +19 -24
- package/src/nodeviews/TableResizer.tsx +642 -653
- package/src/nodeviews/TableRow.ts +580 -629
- package/src/nodeviews/TableStickyScrollbar.ts +173 -190
- package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +8 -8
- package/src/nodeviews/__mocks__/OverridableMock.ts +14 -15
- package/src/nodeviews/table.tsx +345 -375
- package/src/nodeviews/types.ts +21 -24
- package/src/nodeviews/update-overflow-shadows.ts +8 -14
- package/src/plugin.tsx +578 -603
- package/src/pm-plugins/analytics/actions.ts +10 -12
- package/src/pm-plugins/analytics/commands.ts +31 -37
- package/src/pm-plugins/analytics/plugin-factory.ts +4 -2
- package/src/pm-plugins/analytics/plugin-key.ts +1 -3
- package/src/pm-plugins/analytics/plugin.ts +60 -70
- package/src/pm-plugins/analytics/reducer.ts +19 -19
- package/src/pm-plugins/analytics/types.ts +10 -10
- package/src/pm-plugins/analytics/utils/moved-event.ts +38 -38
- package/src/pm-plugins/decorations/plugin.ts +58 -77
- package/src/pm-plugins/decorations/utils/column-controls.ts +59 -71
- package/src/pm-plugins/decorations/utils/column-resizing.ts +50 -57
- package/src/pm-plugins/decorations/utils/compose-decorations.ts +6 -6
- package/src/pm-plugins/decorations/utils/index.ts +3 -6
- package/src/pm-plugins/decorations/utils/types.ts +7 -12
- package/src/pm-plugins/default-table-selection.ts +3 -3
- package/src/pm-plugins/drag-and-drop/actions.ts +25 -25
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +158 -190
- package/src/pm-plugins/drag-and-drop/commands.ts +154 -170
- package/src/pm-plugins/drag-and-drop/consts.ts +4 -5
- package/src/pm-plugins/drag-and-drop/plugin-factory.ts +23 -20
- package/src/pm-plugins/drag-and-drop/plugin-key.ts +1 -3
- package/src/pm-plugins/drag-and-drop/plugin.ts +329 -383
- package/src/pm-plugins/drag-and-drop/reducer.ts +30 -30
- package/src/pm-plugins/drag-and-drop/types.ts +8 -8
- package/src/pm-plugins/drag-and-drop/utils/autoscrollers.ts +38 -41
- package/src/pm-plugins/drag-and-drop/utils/getDragBehaviour.ts +3 -6
- package/src/pm-plugins/drag-and-drop/utils/monitor.ts +57 -70
- package/src/pm-plugins/keymap.ts +208 -220
- package/src/pm-plugins/main.ts +348 -400
- package/src/pm-plugins/plugin-factory.ts +32 -34
- package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +83 -97
- package/src/pm-plugins/sticky-headers/commands.ts +2 -6
- package/src/pm-plugins/sticky-headers/plugin-key.ts +1 -3
- package/src/pm-plugins/sticky-headers/plugin-state.ts +41 -44
- package/src/pm-plugins/sticky-headers/plugin.ts +4 -4
- package/src/pm-plugins/sticky-headers/types.ts +8 -8
- package/src/pm-plugins/sticky-headers/util.ts +10 -10
- package/src/pm-plugins/table-analytics.ts +70 -72
- package/src/pm-plugins/table-local-id.ts +180 -184
- package/src/pm-plugins/table-resizing/commands.ts +72 -85
- package/src/pm-plugins/table-resizing/event-handlers.ts +298 -317
- package/src/pm-plugins/table-resizing/plugin-factory.ts +10 -10
- package/src/pm-plugins/table-resizing/plugin-key.ts +1 -3
- package/src/pm-plugins/table-resizing/plugin.ts +61 -68
- package/src/pm-plugins/table-resizing/reducer.ts +30 -33
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +84 -84
- package/src/pm-plugins/table-resizing/utils/column-state.ts +78 -81
- package/src/pm-plugins/table-resizing/utils/content-width.ts +94 -114
- package/src/pm-plugins/table-resizing/utils/dom.ts +93 -110
- package/src/pm-plugins/table-resizing/utils/index.ts +29 -34
- package/src/pm-plugins/table-resizing/utils/misc.ts +94 -119
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +93 -106
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +240 -257
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +343 -372
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +202 -207
- package/src/pm-plugins/table-resizing/utils/types.ts +17 -17
- package/src/pm-plugins/table-resizing/utils/unit-to-number.ts +1 -2
- package/src/pm-plugins/table-selection-keymap.ts +25 -51
- package/src/pm-plugins/table-width.ts +191 -204
- package/src/pm-plugins/view-mode-sort/index.ts +223 -227
- package/src/pm-plugins/view-mode-sort/plugin-key.ts +3 -2
- package/src/pm-plugins/view-mode-sort/types.ts +12 -12
- package/src/pm-plugins/view-mode-sort/utils.ts +108 -117
- package/src/reducer.ts +139 -155
- package/src/toolbar.tsx +815 -905
- package/src/transforms/column-width.ts +186 -213
- package/src/transforms/delete-columns.ts +208 -222
- package/src/transforms/delete-rows.ts +117 -121
- package/src/transforms/fix-tables.ts +190 -215
- package/src/transforms/merge.ts +263 -269
- package/src/transforms/replace-table.ts +27 -43
- package/src/transforms/split.ts +65 -75
- package/src/types.ts +421 -427
- package/src/ui/ColumnResizeWidget/index.tsx +40 -47
- package/src/ui/DragHandle/HandleIconComponent.tsx +9 -13
- package/src/ui/DragHandle/index.tsx +221 -250
- package/src/ui/DragPreview/index.tsx +35 -35
- package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +33 -41
- package/src/ui/FloatingContextualButton/FixedButton.tsx +154 -157
- package/src/ui/FloatingContextualButton/index.tsx +109 -115
- package/src/ui/FloatingContextualButton/styles.ts +43 -46
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +634 -694
- package/src/ui/FloatingContextualMenu/index.tsx +83 -101
- package/src/ui/FloatingContextualMenu/styles.ts +57 -65
- package/src/ui/FloatingDeleteButton/DeleteButton.tsx +37 -37
- package/src/ui/FloatingDeleteButton/getPopUpOptions.ts +47 -57
- package/src/ui/FloatingDeleteButton/index.tsx +319 -350
- package/src/ui/FloatingDragMenu/DragMenu.tsx +555 -596
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +152 -162
- package/src/ui/FloatingDragMenu/index.tsx +88 -102
- package/src/ui/FloatingDragMenu/styles.ts +51 -54
- package/src/ui/FloatingInsertButton/InsertButton.tsx +204 -217
- package/src/ui/FloatingInsertButton/getPopupOptions.ts +100 -115
- package/src/ui/FloatingInsertButton/index.tsx +248 -292
- package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +24 -29
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +308 -329
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +85 -94
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +46 -46
- package/src/ui/TableFloatingColumnControls/index.tsx +116 -136
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +79 -91
- package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +95 -102
- package/src/ui/TableFloatingControls/CornerControls/index.tsx +1 -4
- package/src/ui/TableFloatingControls/CornerControls/types.ts +8 -8
- package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +50 -50
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +111 -124
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +86 -105
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +305 -341
- package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +72 -75
- package/src/ui/TableFloatingControls/index.tsx +191 -193
- package/src/ui/TableFullWidthLabel/index.tsx +20 -20
- package/src/ui/common-styles.ts +880 -912
- package/src/ui/consts.ts +29 -74
- package/src/ui/icons/AddColLeftIcon.tsx +33 -39
- package/src/ui/icons/AddColRightIcon.tsx +33 -39
- package/src/ui/icons/AddRowAboveIcon.tsx +16 -22
- package/src/ui/icons/AddRowBelowIcon.tsx +33 -39
- package/src/ui/icons/DisplayModeIcon.tsx +31 -31
- package/src/ui/icons/DragHandleDisabledIcon.tsx +19 -21
- package/src/ui/icons/DragHandleIcon.tsx +12 -12
- package/src/ui/icons/DragInMotionIcon.tsx +45 -52
- package/src/ui/icons/MergeCellsIcon.tsx +22 -28
- package/src/ui/icons/MinimisedHandle.tsx +9 -9
- package/src/ui/icons/SplitCellIcon.tsx +30 -36
- package/src/ui/ui-styles.ts +769 -798
- package/src/utils/alignment.ts +1 -1
- package/src/utils/analytics.ts +192 -208
- package/src/utils/collapse.ts +55 -64
- package/src/utils/column-controls.ts +237 -254
- package/src/utils/create.ts +30 -30
- package/src/utils/decoration.ts +482 -502
- package/src/utils/dom.ts +127 -134
- package/src/utils/drag-menu.ts +322 -373
- package/src/utils/get-allow-add-column-custom-step.ts +4 -5
- package/src/utils/guidelines.ts +16 -21
- package/src/utils/index.ts +68 -68
- package/src/utils/merged-cells.ts +245 -254
- package/src/utils/nodes.ts +91 -106
- package/src/utils/paste.ts +119 -135
- package/src/utils/row-controls.ts +199 -213
- package/src/utils/selection.ts +77 -87
- package/src/utils/snapping.ts +87 -100
- package/src/utils/table.ts +44 -44
- package/src/utils/transforms.ts +5 -5
- package/src/utils/update-plugin-state-decorations.ts +5 -9
package/src/ui/ui-styles.ts
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
tableCellBorderWidth,
|
|
6
|
+
tableMarginTop,
|
|
7
|
+
tableMarginTopWithControl,
|
|
8
8
|
} from '@atlaskit/editor-common/styles';
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
akEditorShadowZIndex,
|
|
11
|
+
akEditorTableBorder,
|
|
12
|
+
akEditorTableNumberColumnWidth,
|
|
13
|
+
akEditorUnitZIndex,
|
|
14
14
|
} from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
|
|
16
16
|
import { token } from '@atlaskit/tokens';
|
|
@@ -18,502 +18,482 @@ import { token } from '@atlaskit/tokens';
|
|
|
18
18
|
import { TableCssClassName as ClassName } from '../types';
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
columnControlsDecorationHeight,
|
|
22
|
+
columnControlsSelectedZIndex,
|
|
23
|
+
columnControlsZIndex,
|
|
24
|
+
dragTableInsertColumnButtonSize,
|
|
25
|
+
insertLineWidth,
|
|
26
|
+
lineMarkerSize,
|
|
27
|
+
resizeHandlerAreaWidth,
|
|
28
|
+
resizeHandlerZIndex,
|
|
29
|
+
resizeLineWidth,
|
|
30
|
+
tableBorderColor,
|
|
31
|
+
tableBorderDeleteColor,
|
|
32
|
+
tableBorderSelectedColor,
|
|
33
|
+
tableCellDeleteColor,
|
|
34
|
+
tableCellHoverDeleteIconBackground,
|
|
35
|
+
tableCellHoverDeleteIconColor,
|
|
36
|
+
tableCellSelectedDeleteIconBackground,
|
|
37
|
+
tableCellSelectedDeleteIconColor,
|
|
38
|
+
tableDeleteButtonSize,
|
|
39
|
+
tableHeaderCellBackgroundColor,
|
|
40
|
+
tableInsertColumnButtonSize,
|
|
41
|
+
tableOverflowShadowWidthWide,
|
|
42
|
+
tableToolbarDeleteColor,
|
|
43
|
+
tableToolbarSelectedColor,
|
|
44
|
+
tableToolbarSize,
|
|
45
45
|
} from './consts';
|
|
46
46
|
|
|
47
47
|
const InsertLine = (cssString?: string) => css`
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
.${ClassName.CONTROLS_INSERT_LINE} {
|
|
49
|
+
background: ${tableBorderSelectedColor};
|
|
50
|
+
display: none;
|
|
51
|
+
position: absolute;
|
|
52
|
+
z-index: ${akEditorUnitZIndex};
|
|
53
|
+
${cssString}
|
|
54
|
+
}
|
|
55
55
|
`;
|
|
56
56
|
|
|
57
57
|
const Marker = () =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
css({
|
|
59
|
+
backgroundColor: tableBorderColor,
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
height: `${lineMarkerSize}px`,
|
|
62
|
+
width: `${lineMarkerSize}px`,
|
|
63
|
+
borderRadius: '50%',
|
|
64
|
+
pointerEvents: 'none',
|
|
65
|
+
});
|
|
66
66
|
|
|
67
67
|
export const InsertMarker = (cssString?: string) => css`
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
.${ClassName.CONTROLS_INSERT_MARKER} {
|
|
69
|
+
${Marker()};
|
|
70
|
+
${cssString}
|
|
71
|
+
}
|
|
72
72
|
`;
|
|
73
73
|
|
|
74
74
|
const Button = (cssString?: string) => css`
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
border-radius: ${token('border.radius', '3px')};
|
|
76
|
+
border-width: 0px;
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
max-width: 100%;
|
|
79
|
+
text-align: center;
|
|
80
|
+
margin: 0px;
|
|
81
|
+
padding: 0px;
|
|
82
|
+
text-decoration: none;
|
|
83
|
+
transition:
|
|
84
|
+
background 0.1s ease-out 0s,
|
|
85
|
+
box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;
|
|
86
|
+
outline: none !important;
|
|
87
|
+
cursor: none;
|
|
88
|
+
|
|
89
|
+
> .${ClassName.CONTROLS_BUTTON_ICON} {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
max-height: 100%;
|
|
92
|
+
max-width: 100%;
|
|
93
|
+
}
|
|
94
|
+
${cssString}
|
|
94
95
|
`;
|
|
95
96
|
|
|
96
97
|
// Explicit pixel values required here to ensure classic row controls align correctly
|
|
97
98
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
98
99
|
export const HeaderButton = (cssString?: string) => css`
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
100
|
+
.${ClassName.CONTROLS_BUTTON} {
|
|
101
|
+
background: ${tableHeaderCellBackgroundColor};
|
|
102
|
+
border: 1px solid ${tableBorderColor};
|
|
103
|
+
display: block;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
padding: 0;
|
|
106
|
+
|
|
107
|
+
:focus {
|
|
108
|
+
outline: none;
|
|
109
|
+
}
|
|
110
|
+
${cssString}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.${ClassName.ROW_CONTROLS_BUTTON}::after {
|
|
114
|
+
content: ' ';
|
|
115
|
+
background-color: transparent;
|
|
116
|
+
left: -15px;
|
|
117
|
+
top: 0;
|
|
118
|
+
position: absolute;
|
|
119
|
+
width: 15px;
|
|
120
|
+
height: 100%;
|
|
121
|
+
z-index: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.active .${ClassName.CONTROLS_BUTTON} {
|
|
125
|
+
color: ${token('color.icon.inverse', N0)};
|
|
126
|
+
background-color: ${tableToolbarSelectedColor};
|
|
127
|
+
border-color: ${tableBorderSelectedColor};
|
|
128
|
+
}
|
|
128
129
|
`;
|
|
129
130
|
|
|
130
131
|
export const HeaderButtonHover = () => css`
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
.${ClassName.CONTROLS_BUTTON}:hover {
|
|
133
|
+
color: ${token('color.icon.inverse', N0)};
|
|
134
|
+
background-color: ${tableToolbarSelectedColor};
|
|
135
|
+
border-color: ${tableBorderSelectedColor};
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
}
|
|
137
138
|
`;
|
|
138
139
|
|
|
139
140
|
export const HeaderButtonDanger = () => css`
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.CONTROLS_BUTTON} {
|
|
142
|
+
background-color: ${tableToolbarDeleteColor};
|
|
143
|
+
border-color: ${tableBorderDeleteColor};
|
|
144
|
+
position: relative;
|
|
145
|
+
z-index: ${akEditorUnitZIndex};
|
|
146
|
+
}
|
|
146
147
|
`;
|
|
147
148
|
|
|
148
149
|
const InsertButton = () => css`
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
${Button(`
|
|
150
|
+
.${ClassName.CONTROLS_INSERT_BUTTON_INNER} {
|
|
151
|
+
position: absolute;
|
|
152
|
+
z-index: ${akEditorUnitZIndex + 10};
|
|
153
|
+
bottom: 0;
|
|
154
|
+
}
|
|
155
|
+
.${ClassName.CONTROLS_INSERT_BUTTON_INNER}, .${ClassName.CONTROLS_INSERT_BUTTON} {
|
|
156
|
+
height: ${tableInsertColumnButtonSize}px;
|
|
157
|
+
width: ${tableInsertColumnButtonSize}px;
|
|
158
|
+
}
|
|
159
|
+
.${ClassName.CONTROLS_INSERT_BUTTON} {
|
|
160
|
+
${Button(`
|
|
161
161
|
background: ${token('elevation.surface.overlay', 'white')};
|
|
162
|
-
box-shadow: ${token(
|
|
163
|
-
'elevation.shadow.overlay',
|
|
164
|
-
`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`,
|
|
165
|
-
)};
|
|
162
|
+
box-shadow: ${token('elevation.shadow.overlay', `0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`)};
|
|
166
163
|
color: ${token('color.icon', N300)};
|
|
167
164
|
`)}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
165
|
+
}
|
|
166
|
+
.${ClassName.CONTROLS_INSERT_LINE} {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
&:hover .${ClassName.CONTROLS_INSERT_LINE} {
|
|
170
|
+
display: flex;
|
|
171
|
+
}
|
|
175
172
|
`;
|
|
176
173
|
|
|
177
174
|
const InsertButtonHover = () => css`
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
.${ClassName.CONTROLS_INSERT_BUTTON}:hover {
|
|
176
|
+
background: ${token('color.background.brand.bold', B300)};
|
|
177
|
+
color: ${token('color.icon.inverse', 'white')};
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
}
|
|
183
180
|
`;
|
|
184
181
|
|
|
185
182
|
export const dragInsertButtonWrapper = () => css`
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
183
|
+
.${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER} {
|
|
184
|
+
position: absolute;
|
|
185
|
+
z-index: ${akEditorUnitZIndex + 10};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN} {
|
|
189
|
+
bottom: -3px;
|
|
190
|
+
left: 2px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW} {
|
|
194
|
+
left: -3px;
|
|
195
|
+
bottom: -2px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.${ClassName.DRAG_CONTROLS_INSERT_BUTTON} {
|
|
199
|
+
${Button(`
|
|
203
200
|
background: ${token('elevation.surface.overlay', 'white')};
|
|
204
201
|
color: ${token('color.icon', N300)};
|
|
205
|
-
border: 1px solid ${token(
|
|
206
|
-
'color.background.accent.gray.subtler',
|
|
207
|
-
'#C1C7D0',
|
|
208
|
-
)};
|
|
202
|
+
border: 1px solid ${token('color.background.accent.gray.subtler', '#C1C7D0')};
|
|
209
203
|
border-radius: 50%;
|
|
210
204
|
height: ${dragTableInsertColumnButtonSize}px;
|
|
211
205
|
width: ${dragTableInsertColumnButtonSize}px;
|
|
212
206
|
`)}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.${ClassName.DRAG_CONTROLS_INSERT_BUTTON}:hover {
|
|
210
|
+
background: ${token('color.background.brand.bold', B300)};
|
|
211
|
+
border: 1px solid ${token('color.background.brand.bold', B300)};
|
|
212
|
+
color: ${token('color.icon.inverse', 'white')};
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
}
|
|
221
215
|
`;
|
|
222
216
|
|
|
223
217
|
// Explicit pixel values required here to ensure corner button aligns correctly
|
|
224
218
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
225
219
|
export const dragCornerControlButton = () => css`
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
height: 5px;
|
|
274
|
-
position: relative;
|
|
275
|
-
}
|
|
220
|
+
.${ClassName.DRAG_CORNER_BUTTON} {
|
|
221
|
+
width: 15px;
|
|
222
|
+
height: 15px;
|
|
223
|
+
display: flex;
|
|
224
|
+
justify-content: center;
|
|
225
|
+
align-items: center;
|
|
226
|
+
position: absolute;
|
|
227
|
+
top: -17px;
|
|
228
|
+
left: -5px;
|
|
229
|
+
background-color: transparent;
|
|
230
|
+
border: none;
|
|
231
|
+
padding: 0;
|
|
232
|
+
outline: none;
|
|
233
|
+
z-index: ${akEditorUnitZIndex * 99};
|
|
234
|
+
|
|
235
|
+
&.active .${ClassName.DRAG_CORNER_BUTTON_INNER} {
|
|
236
|
+
background-color: ${token('color.border.selected', '#0C66E4')};
|
|
237
|
+
width: 10px;
|
|
238
|
+
height: 10px;
|
|
239
|
+
border-width: 2px;
|
|
240
|
+
border-radius: 4px;
|
|
241
|
+
|
|
242
|
+
top: 3px;
|
|
243
|
+
left: 2px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&:hover {
|
|
247
|
+
cursor: pointer;
|
|
248
|
+
|
|
249
|
+
.${ClassName.DRAG_CORNER_BUTTON_INNER} {
|
|
250
|
+
width: 10px;
|
|
251
|
+
height: 10px;
|
|
252
|
+
border-radius: 4px;
|
|
253
|
+
top: 3px;
|
|
254
|
+
left: 2px;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.${ClassName.DRAG_CORNER_BUTTON_INNER} {
|
|
260
|
+
border: 1px solid ${token('color.border.inverse', '#FFF')};
|
|
261
|
+
background-color: ${token('color.background.accent.gray.subtler', '#DCDFE4')};
|
|
262
|
+
border-radius: 2px;
|
|
263
|
+
width: 5px;
|
|
264
|
+
height: 5px;
|
|
265
|
+
position: relative;
|
|
266
|
+
}
|
|
276
267
|
`;
|
|
277
268
|
|
|
278
269
|
export const insertColumnButtonWrapper = () =>
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
270
|
+
css(
|
|
271
|
+
InsertButton(),
|
|
272
|
+
InsertButtonHover(),
|
|
273
|
+
InsertLine(
|
|
274
|
+
`
|
|
284
275
|
width: 2px;
|
|
285
276
|
left: 9px;
|
|
286
277
|
`,
|
|
287
|
-
|
|
288
|
-
|
|
278
|
+
),
|
|
279
|
+
);
|
|
289
280
|
|
|
290
281
|
export const insertRowButtonWrapper = () =>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
282
|
+
css(
|
|
283
|
+
InsertButton(),
|
|
284
|
+
InsertButtonHover(),
|
|
285
|
+
InsertLine(
|
|
286
|
+
`
|
|
296
287
|
height: 2px;
|
|
297
288
|
top: -11px;
|
|
298
289
|
left: ${tableInsertColumnButtonSize - 1}px;
|
|
299
290
|
`,
|
|
300
|
-
|
|
301
|
-
|
|
291
|
+
),
|
|
292
|
+
);
|
|
302
293
|
|
|
303
294
|
export const columnControlsLineMarker = () => css`
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
.${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS}
|
|
309
|
-
table
|
|
310
|
-
tr:first-of-type
|
|
311
|
-
th {
|
|
312
|
-
position: relative;
|
|
313
|
-
}
|
|
295
|
+
.${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS} table tr:first-of-type td,
|
|
296
|
+
.${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS} table tr:first-of-type th {
|
|
297
|
+
position: relative;
|
|
298
|
+
}
|
|
314
299
|
`;
|
|
315
300
|
|
|
316
301
|
export const DeleteButton = () => css`
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
${Button(`
|
|
302
|
+
.${ClassName.CONTROLS_DELETE_BUTTON_WRAP}, .${ClassName.CONTROLS_DELETE_BUTTON} {
|
|
303
|
+
height: ${tableDeleteButtonSize}px;
|
|
304
|
+
width: ${tableDeleteButtonSize}px;
|
|
305
|
+
}
|
|
306
|
+
.${ClassName.CONTROLS_DELETE_BUTTON_WRAP} {
|
|
307
|
+
.${ClassName.CONTROLS_DELETE_BUTTON} {
|
|
308
|
+
${Button(`
|
|
325
309
|
background: ${tableCellSelectedDeleteIconBackground};
|
|
326
310
|
color: ${tableCellSelectedDeleteIconColor};
|
|
327
311
|
`)}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.${ClassName.CONTROLS_DELETE_BUTTON}:hover {
|
|
316
|
+
background: ${tableCellHoverDeleteIconBackground};
|
|
317
|
+
color: ${tableCellHoverDeleteIconColor};
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
}
|
|
336
320
|
`;
|
|
337
321
|
|
|
338
|
-
export const OverflowShadow = (
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
}
|
|
322
|
+
export const OverflowShadow = (isDragAndDropEnabled: boolean | undefined) => css`
|
|
323
|
+
.${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
|
|
324
|
+
display: block;
|
|
325
|
+
height: calc(100% - ${tableMarginTop}px);
|
|
326
|
+
position: absolute;
|
|
327
|
+
pointer-events: none;
|
|
328
|
+
top: ${tableMarginTop}px;
|
|
329
|
+
z-index: ${akEditorShadowZIndex};
|
|
330
|
+
width: ${tableOverflowShadowWidthWide}px;
|
|
331
|
+
}
|
|
332
|
+
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
333
|
+
background: linear-gradient(
|
|
334
|
+
to left,
|
|
335
|
+
transparent 0,
|
|
336
|
+
${token('elevation.shadow.overflow.spread', N40A)} 140%
|
|
337
|
+
),
|
|
338
|
+
linear-gradient(
|
|
339
|
+
to right,
|
|
340
|
+
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
|
|
341
|
+
transparent 1px
|
|
342
|
+
);
|
|
343
|
+
left: 0px;
|
|
344
|
+
}
|
|
345
|
+
.${ClassName.TABLE_CONTAINER}[data-number-column='true'] > :not(.${ClassName.TABLE_STICKY_SHADOW}).${ClassName.TABLE_LEFT_SHADOW} {
|
|
346
|
+
left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
347
|
+
}
|
|
348
|
+
.${ClassName.TABLE_RIGHT_SHADOW} {
|
|
349
|
+
background: linear-gradient(
|
|
350
|
+
to right,
|
|
351
|
+
transparent 0,
|
|
352
|
+
${token('elevation.shadow.overflow.spread', N40A)} 140%
|
|
353
|
+
),
|
|
354
|
+
linear-gradient(
|
|
355
|
+
to left,
|
|
356
|
+
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
|
|
357
|
+
transparent 1px
|
|
358
|
+
);
|
|
359
|
+
left: calc(100% - ${tableOverflowShadowWidthWide}px);
|
|
360
|
+
}
|
|
361
|
+
.${ClassName.WITH_CONTROLS} {
|
|
362
|
+
${overflowShadowWidhoutDnD(isDragAndDropEnabled)}
|
|
363
|
+
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
364
|
+
border-left: 1px solid ${tableBorderColor};
|
|
365
|
+
}
|
|
366
|
+
}
|
|
385
367
|
`;
|
|
386
368
|
|
|
387
|
-
const overflowShadowWidhoutDnD = (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
`;
|
|
397
|
-
}
|
|
369
|
+
const overflowShadowWidhoutDnD = (isDragAndDropEnabled: boolean | undefined) => {
|
|
370
|
+
if (!isDragAndDropEnabled) {
|
|
371
|
+
return css`
|
|
372
|
+
.${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
|
|
373
|
+
height: calc(100% - ${tableMarginTopWithControl}px);
|
|
374
|
+
top: ${tableMarginTopWithControl}px;
|
|
375
|
+
}
|
|
376
|
+
`;
|
|
377
|
+
}
|
|
398
378
|
};
|
|
399
379
|
|
|
400
380
|
const columnHeaderButton = (cssString?: string) => {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
381
|
+
return css(
|
|
382
|
+
{
|
|
383
|
+
background: tableHeaderCellBackgroundColor,
|
|
384
|
+
display: 'block',
|
|
385
|
+
boxSizing: 'border-box',
|
|
386
|
+
padding: 0,
|
|
387
|
+
':focus': {
|
|
388
|
+
outline: 'none',
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
cssString,
|
|
392
|
+
);
|
|
413
393
|
};
|
|
414
394
|
|
|
415
395
|
const columnHeaderButtonSelected = () =>
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
396
|
+
css({
|
|
397
|
+
color: token('color.text.inverse', N0),
|
|
398
|
+
backgroundColor: tableToolbarSelectedColor,
|
|
399
|
+
borderColor: tableBorderSelectedColor,
|
|
400
|
+
zIndex: columnControlsSelectedZIndex,
|
|
401
|
+
});
|
|
422
402
|
|
|
423
403
|
const getFloatingDotOverrides = () => {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
404
|
+
return css`
|
|
405
|
+
tr
|
|
406
|
+
th:last-child
|
|
407
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::before,
|
|
408
|
+
tr
|
|
409
|
+
td:last-child
|
|
410
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::before {
|
|
411
|
+
content: '';
|
|
412
|
+
background-color: ${tableBorderColor};
|
|
413
|
+
position: absolute;
|
|
414
|
+
height: ${lineMarkerSize}px;
|
|
415
|
+
width: ${lineMarkerSize}px;
|
|
416
|
+
border-radius: 50%;
|
|
417
|
+
pointer-events: none;
|
|
418
|
+
top: ${token('space.025', '2px')};
|
|
419
|
+
right: 0px;
|
|
420
|
+
}
|
|
421
|
+
`;
|
|
442
422
|
};
|
|
443
423
|
|
|
444
424
|
export const floatingColumnControls = () => {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
425
|
+
return css`
|
|
426
|
+
.${ClassName.DRAG_COLUMN_DROP_TARGET_CONTROLS} {
|
|
427
|
+
box-sizing: border-box;
|
|
428
|
+
position: absolute;
|
|
429
|
+
top: 0;
|
|
430
|
+
|
|
431
|
+
.${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
|
|
432
|
+
display: flex;
|
|
433
|
+
flex-direction: row;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.${ClassName.DRAG_COLUMN_CONTROLS} {
|
|
438
|
+
box-sizing: border-box;
|
|
439
|
+
|
|
440
|
+
.${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
|
|
441
|
+
display: grid;
|
|
442
|
+
justify-items: center;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
`;
|
|
466
446
|
};
|
|
467
447
|
|
|
468
448
|
export const rowControlsWrapperDotStyle = () => {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
449
|
+
return css`
|
|
450
|
+
// override for DnD controls
|
|
451
|
+
div.${ClassName.WITH_CONTROLS}>.${ClassName.DRAG_ROW_CONTROLS_WRAPPER}::after {
|
|
452
|
+
display: none;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
|
|
456
|
+
content: ' ';
|
|
457
|
+
background-color: ${tableBorderColor};
|
|
458
|
+
position: absolute;
|
|
459
|
+
height: ${lineMarkerSize}px;
|
|
460
|
+
width: ${lineMarkerSize}px;
|
|
461
|
+
border-radius: 50%;
|
|
462
|
+
pointer-events: none;
|
|
463
|
+
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
464
|
+
right: -1px;
|
|
465
|
+
}
|
|
466
|
+
`;
|
|
487
467
|
};
|
|
488
468
|
|
|
489
469
|
export const columnControlsDecoration = () => {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
470
|
+
return css`
|
|
471
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
472
|
+
display: none;
|
|
473
|
+
cursor: pointer;
|
|
474
|
+
position: absolute;
|
|
475
|
+
width: 100%;
|
|
476
|
+
left: 0;
|
|
477
|
+
top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
|
|
478
|
+
height: ${columnControlsDecorationHeight}px;
|
|
479
|
+
// floating dot for adding column button
|
|
480
|
+
&::before {
|
|
481
|
+
content: ' ';
|
|
482
|
+
background-color: ${tableBorderColor};
|
|
483
|
+
position: absolute;
|
|
484
|
+
height: ${lineMarkerSize}px;
|
|
485
|
+
width: ${lineMarkerSize}px;
|
|
486
|
+
border-radius: 50%;
|
|
487
|
+
pointer-events: none;
|
|
488
|
+
top: 2px;
|
|
489
|
+
right: ${token('space.negative.025', '-2px')};
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
&::after {
|
|
493
|
+
content: ' ';
|
|
494
|
+
|
|
495
|
+
${columnHeaderButton(
|
|
496
|
+
`
|
|
517
497
|
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
518
498
|
border-top: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
519
499
|
border-bottom: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
@@ -525,251 +505,245 @@ export const columnControlsDecoration = () => {
|
|
|
525
505
|
left: 0px;
|
|
526
506
|
z-index: ${columnControlsZIndex};
|
|
527
507
|
`,
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
`;
|
|
508
|
+
)}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// floating dot for adding column button - overriding style on last column to avoid scroll
|
|
513
|
+
${getFloatingDotOverrides()}
|
|
514
|
+
|
|
515
|
+
.${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
516
|
+
display: block;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
table
|
|
520
|
+
tr:first-of-type
|
|
521
|
+
td.${ClassName.TABLE_CELL},table
|
|
522
|
+
tr:first-of-type
|
|
523
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
524
|
+
&.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_TABLE} {
|
|
525
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
526
|
+
${columnHeaderButtonSelected()};
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
&.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
530
|
+
background-color: ${tableToolbarDeleteColor};
|
|
531
|
+
border-color: ${tableBorderDeleteColor};
|
|
532
|
+
z-index: ${akEditorUnitZIndex * 100};
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
table
|
|
538
|
+
tr:first-of-type
|
|
539
|
+
td.${ClassName.TABLE_CELL},table
|
|
540
|
+
tr:first-of-type
|
|
541
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
542
|
+
&.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
|
|
543
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
544
|
+
${columnHeaderButtonSelected()};
|
|
545
|
+
border-left: ${tableCellBorderWidth}px solid ${tableBorderSelectedColor};
|
|
546
|
+
left: -${tableCellBorderWidth}px;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
table
|
|
552
|
+
tr:first-of-type
|
|
553
|
+
td.${ClassName.TABLE_CELL},
|
|
554
|
+
table
|
|
555
|
+
tr:first-of-type
|
|
556
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
557
|
+
&.${ClassName.HOVERED_COLUMN} {
|
|
558
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
559
|
+
${columnHeaderButtonSelected()};
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
&.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
563
|
+
background-color: ${tableToolbarDeleteColor};
|
|
564
|
+
border-color: ${tableBorderDeleteColor};
|
|
565
|
+
border-left: ${tableCellBorderWidth}px solid ${tableBorderDeleteColor};
|
|
566
|
+
left: -${tableCellBorderWidth}px;
|
|
567
|
+
z-index: ${akEditorUnitZIndex * 100};
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.${ClassName.TABLE_SELECTED}
|
|
573
|
+
table
|
|
574
|
+
tr:first-of-type
|
|
575
|
+
td.${ClassName.TABLE_CELL},
|
|
576
|
+
.${ClassName.TABLE_SELECTED}
|
|
577
|
+
table
|
|
578
|
+
tr:first-of-type
|
|
579
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
580
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
581
|
+
${columnHeaderButtonSelected()};
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
`;
|
|
608
585
|
};
|
|
609
586
|
|
|
610
587
|
export const hoveredDeleteButton = () => css`
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
}
|
|
588
|
+
.${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
|
|
589
|
+
.${ClassName.SELECTED_CELL}, .${ClassName.COLUMN_SELECTED}, .${ClassName.HOVERED_CELL} {
|
|
590
|
+
border: 1px solid ${tableBorderDeleteColor};
|
|
591
|
+
}
|
|
592
|
+
.${ClassName.SELECTED_CELL}::after {
|
|
593
|
+
background: ${tableCellDeleteColor};
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
597
|
+
td.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
|
|
598
|
+
background: ${tableCellDeleteColor};
|
|
599
|
+
border: 1px solid ${tableBorderDeleteColor};
|
|
600
|
+
}
|
|
601
|
+
th.${ClassName.HOVERED_NO_HIGHLIGHT} {
|
|
602
|
+
background-color: unset;
|
|
603
|
+
}
|
|
604
|
+
th.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
|
|
605
|
+
background: ${tableCellDeleteColor};
|
|
606
|
+
border: 1px solid ${tableBorderDeleteColor};
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
635
610
|
`;
|
|
636
611
|
|
|
637
612
|
export const hoveredCell = () => css`
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
613
|
+
:not(.${ClassName.IS_RESIZING})
|
|
614
|
+
.${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
|
|
615
|
+
.${ClassName.HOVERED_CELL} {
|
|
616
|
+
position: relative;
|
|
617
|
+
border: 1px solid ${tableBorderSelectedColor};
|
|
618
|
+
}
|
|
619
|
+
.${ClassName.HOVERED_CELL}.${ClassName.HOVERED_NO_HIGHLIGHT} {
|
|
620
|
+
position: relative;
|
|
621
|
+
border: 1px solid ${tableBorderColor};
|
|
622
|
+
}
|
|
623
|
+
}
|
|
649
624
|
`;
|
|
650
625
|
|
|
651
626
|
export const hoveredWarningCell = css`
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
627
|
+
:not(.${ClassName.IS_RESIZING})
|
|
628
|
+
.${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
|
|
629
|
+
td.${ClassName.HOVERED_CELL_WARNING} {
|
|
630
|
+
background-color: ${token(
|
|
631
|
+
'color.background.warning',
|
|
632
|
+
Y50,
|
|
633
|
+
)} !important; // We need to override the background-color added to the cell
|
|
634
|
+
border: 1px solid ${token('color.border.warning', Y200)};
|
|
635
|
+
}
|
|
636
|
+
}
|
|
662
637
|
`;
|
|
663
638
|
|
|
664
639
|
// Explicit pixel values required here to ensure correct positioning and sizes of column resize handle
|
|
665
640
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
666
641
|
const resizeHandleOverrides = (isDragAndDropEnabled: boolean | undefined) => {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
`;
|
|
642
|
+
if (isDragAndDropEnabled) {
|
|
643
|
+
return css`
|
|
644
|
+
th.${ClassName.WITH_RESIZE_LINE}::before, td.${ClassName.WITH_RESIZE_LINE}::before {
|
|
645
|
+
content: ' ';
|
|
646
|
+
position: absolute;
|
|
647
|
+
left: ${token('space.negative.025', '-2px')};
|
|
648
|
+
top: -1px;
|
|
649
|
+
width: ${resizeLineWidth}px;
|
|
650
|
+
height: calc(100% + 2px);
|
|
651
|
+
background-color: ${tableBorderSelectedColor};
|
|
652
|
+
z-index: ${columnControlsZIndex * 2};
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
th.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before,
|
|
656
|
+
td.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
|
|
657
|
+
content: ' ';
|
|
658
|
+
position: absolute;
|
|
659
|
+
right: -1px;
|
|
660
|
+
top: -1px;
|
|
661
|
+
width: ${resizeLineWidth}px;
|
|
662
|
+
height: calc(100% + 2px);
|
|
663
|
+
background-color: ${tableBorderSelectedColor};
|
|
664
|
+
z-index: ${columnControlsZIndex * 2};
|
|
665
|
+
}
|
|
666
|
+
`;
|
|
667
|
+
}
|
|
668
|
+
return css`
|
|
669
|
+
td.${ClassName.WITH_RESIZE_LINE}::before {
|
|
670
|
+
content: ' ';
|
|
671
|
+
position: absolute;
|
|
672
|
+
left: ${token('space.negative.025', '-2px')};
|
|
673
|
+
top: -1px;
|
|
674
|
+
width: ${resizeLineWidth}px;
|
|
675
|
+
height: calc(100% + 2px);
|
|
676
|
+
background-color: ${tableBorderSelectedColor};
|
|
677
|
+
z-index: ${columnControlsZIndex * 2};
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
th.${ClassName.WITH_RESIZE_LINE}::before {
|
|
681
|
+
content: ' ';
|
|
682
|
+
left: ${token('space.negative.025', '-2px')};
|
|
683
|
+
position: absolute;
|
|
684
|
+
width: ${resizeLineWidth}px;
|
|
685
|
+
height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
|
|
686
|
+
background-color: ${tableBorderSelectedColor};
|
|
687
|
+
z-index: ${columnControlsZIndex * 2};
|
|
688
|
+
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
td.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
|
|
692
|
+
content: ' ';
|
|
693
|
+
position: absolute;
|
|
694
|
+
right: -1px;
|
|
695
|
+
top: -1px;
|
|
696
|
+
width: ${resizeLineWidth}px;
|
|
697
|
+
height: calc(100% + 2px);
|
|
698
|
+
background-color: ${tableBorderSelectedColor};
|
|
699
|
+
z-index: ${columnControlsZIndex * 2};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
th.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
|
|
703
|
+
content: ' ';
|
|
704
|
+
right: -1px;
|
|
705
|
+
position: absolute;
|
|
706
|
+
width: ${resizeLineWidth}px;
|
|
707
|
+
height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
|
|
708
|
+
background-color: ${tableBorderSelectedColor};
|
|
709
|
+
z-index: ${columnControlsZIndex * 2};
|
|
710
|
+
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
711
|
+
}
|
|
712
|
+
`;
|
|
739
713
|
};
|
|
740
714
|
|
|
741
715
|
export const resizeHandle = (isDragAndDropEnabled: boolean | undefined) => css`
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
716
|
+
.${ClassName.TABLE_CONTAINER} {
|
|
717
|
+
.${ClassName.RESIZE_HANDLE_DECORATION} {
|
|
718
|
+
background-color: transparent;
|
|
719
|
+
position: absolute;
|
|
720
|
+
width: ${resizeHandlerAreaWidth}px;
|
|
721
|
+
height: 100%;
|
|
722
|
+
top: 0;
|
|
723
|
+
right: -${resizeHandlerAreaWidth / 2}px;
|
|
724
|
+
cursor: col-resize;
|
|
725
|
+
z-index: ${resizeHandlerZIndex};
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
tr
|
|
729
|
+
th:last-child
|
|
730
|
+
.${ClassName.RESIZE_HANDLE_DECORATION},
|
|
731
|
+
tr
|
|
732
|
+
td:last-child
|
|
733
|
+
.${ClassName.RESIZE_HANDLE_DECORATION} {
|
|
734
|
+
background-color: transparent;
|
|
735
|
+
position: absolute;
|
|
736
|
+
width: ${resizeHandlerAreaWidth / 2}px;
|
|
737
|
+
height: 100%;
|
|
738
|
+
top: 0;
|
|
739
|
+
right: 0;
|
|
740
|
+
cursor: col-resize;
|
|
741
|
+
z-index: ${resizeHandlerZIndex};
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
${resizeHandleOverrides(isDragAndDropEnabled)}
|
|
745
|
+
|
|
746
|
+
table
|
|
773
747
|
tr:first-of-type
|
|
774
748
|
th.${ClassName.WITH_RESIZE_LINE}
|
|
775
749
|
.${ClassName.RESIZE_HANDLE_DECORATION}::after,
|
|
@@ -777,176 +751,173 @@ export const resizeHandle = (isDragAndDropEnabled: boolean | undefined) => css`
|
|
|
777
751
|
tr:first-of-type
|
|
778
752
|
td.${ClassName.WITH_RESIZE_LINE}
|
|
779
753
|
.${ClassName.RESIZE_HANDLE_DECORATION}::after {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
754
|
+
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
755
|
+
height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
784
758
|
`;
|
|
785
759
|
|
|
786
760
|
// Drag and Drop: drop target insert line
|
|
787
761
|
const tableCellColumnInsertLineStyles = css({
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
762
|
+
content: "' '",
|
|
763
|
+
position: 'absolute',
|
|
764
|
+
height: `calc(100% + ${tableCellBorderWidth * 2}px)`,
|
|
765
|
+
width: `${insertLineWidth}px`,
|
|
766
|
+
zIndex: columnControlsZIndex * 2,
|
|
793
767
|
});
|
|
794
768
|
|
|
795
769
|
const tableCellRowInsertLineStyles = css({
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
770
|
+
content: "' '",
|
|
771
|
+
position: 'absolute',
|
|
772
|
+
left: token('space.negative.025', '-2px'),
|
|
773
|
+
height: `${insertLineWidth}px`,
|
|
774
|
+
width: `calc(100% + ${tableCellBorderWidth * 2}px)`,
|
|
775
|
+
zIndex: columnControlsZIndex * 2,
|
|
802
776
|
});
|
|
803
777
|
|
|
804
778
|
const insertLineActiveColor = css({
|
|
805
|
-
|
|
779
|
+
backgroundColor: tableBorderSelectedColor,
|
|
806
780
|
});
|
|
807
781
|
|
|
808
782
|
const insertLineInactiveColor = css({
|
|
809
|
-
|
|
810
|
-
'color.background.accent.gray.subtler',
|
|
811
|
-
akEditorTableBorder,
|
|
812
|
-
),
|
|
783
|
+
backgroundColor: token('color.background.accent.gray.subtler', akEditorTableBorder),
|
|
813
784
|
});
|
|
814
785
|
|
|
815
786
|
// Explicit pixel values required here to ensure correct positioning of line that is show on row
|
|
816
787
|
// or column drag
|
|
817
788
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
818
789
|
export const insertLine = () => css`
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
790
|
+
.${ClassName.TABLE_CONTAINER} {
|
|
791
|
+
td.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE}::before {
|
|
792
|
+
${tableCellColumnInsertLineStyles}
|
|
793
|
+
left: -1px;
|
|
794
|
+
top: -1px;
|
|
795
|
+
${insertLineActiveColor}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
td.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE_INACTIVE}::before {
|
|
799
|
+
${tableCellColumnInsertLineStyles}
|
|
800
|
+
left: -1px;
|
|
801
|
+
top: -1px;
|
|
802
|
+
${insertLineInactiveColor}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
th.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE}::before {
|
|
806
|
+
${tableCellColumnInsertLineStyles}
|
|
807
|
+
left: -1px;
|
|
808
|
+
top: -${tableCellBorderWidth}px;
|
|
809
|
+
${insertLineActiveColor}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
th.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE_INACTIVE}::before {
|
|
813
|
+
${tableCellColumnInsertLineStyles}
|
|
814
|
+
left: -1px;
|
|
815
|
+
top: -${tableCellBorderWidth}px;
|
|
816
|
+
${insertLineInactiveColor}
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
td.${ClassName.WITH_COLUMN_INSERT_LINE}::before {
|
|
820
|
+
${tableCellColumnInsertLineStyles}
|
|
821
|
+
left: ${token('space.negative.025', '-2px')};
|
|
822
|
+
top: -1px;
|
|
823
|
+
${insertLineActiveColor}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
td.${ClassName.WITH_COLUMN_INSERT_LINE_INACTIVE}::before {
|
|
827
|
+
${tableCellColumnInsertLineStyles}
|
|
828
|
+
left: ${token('space.negative.025', '-2px')};
|
|
829
|
+
top: -1px;
|
|
830
|
+
${insertLineInactiveColor}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
th.${ClassName.WITH_COLUMN_INSERT_LINE}::before {
|
|
834
|
+
${tableCellColumnInsertLineStyles}
|
|
835
|
+
left: ${token('space.negative.025', '-2px')};
|
|
836
|
+
top: -${tableCellBorderWidth}px;
|
|
837
|
+
${insertLineActiveColor}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
th.${ClassName.WITH_COLUMN_INSERT_LINE_INACTIVE}::before {
|
|
841
|
+
${tableCellColumnInsertLineStyles}
|
|
842
|
+
left: ${token('space.negative.025', '-2px')};
|
|
843
|
+
top: -${tableCellBorderWidth}px;
|
|
844
|
+
${insertLineInactiveColor}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
td.${ClassName.WITH_LAST_COLUMN_INSERT_LINE}::before {
|
|
848
|
+
${tableCellColumnInsertLineStyles}
|
|
849
|
+
right: -1px;
|
|
850
|
+
top: -1px;
|
|
851
|
+
${insertLineActiveColor}
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
td.${ClassName.WITH_LAST_COLUMN_INSERT_LINE_INACTIVE}::before {
|
|
855
|
+
${tableCellColumnInsertLineStyles}
|
|
856
|
+
right: -1px;
|
|
857
|
+
top: -1px;
|
|
858
|
+
${insertLineInactiveColor}
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
th.${ClassName.WITH_LAST_COLUMN_INSERT_LINE}::before {
|
|
862
|
+
${tableCellColumnInsertLineStyles}
|
|
863
|
+
right: -1px;
|
|
864
|
+
top: -${tableCellBorderWidth}px;
|
|
865
|
+
${insertLineActiveColor}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
th.${ClassName.WITH_LAST_COLUMN_INSERT_LINE_INACTIVE}::before {
|
|
869
|
+
${tableCellColumnInsertLineStyles}
|
|
870
|
+
right: -1px;
|
|
871
|
+
top: -${tableCellBorderWidth}px;
|
|
872
|
+
${insertLineInactiveColor}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
td.${ClassName.WITH_ROW_INSERT_LINE}::before {
|
|
876
|
+
${tableCellRowInsertLineStyles}
|
|
877
|
+
top: -1px;
|
|
878
|
+
${insertLineActiveColor}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
td.${ClassName.WITH_ROW_INSERT_LINE_INACTIVE}::before {
|
|
882
|
+
${tableCellRowInsertLineStyles}
|
|
883
|
+
top: -1px;
|
|
884
|
+
${insertLineInactiveColor}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
th.${ClassName.WITH_ROW_INSERT_LINE}::before {
|
|
888
|
+
${tableCellRowInsertLineStyles}
|
|
889
|
+
top: -1px;
|
|
890
|
+
${insertLineActiveColor}
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
th.${ClassName.WITH_ROW_INSERT_LINE_INACTIVE}::before {
|
|
894
|
+
${tableCellRowInsertLineStyles}
|
|
895
|
+
top: -1px;
|
|
896
|
+
${insertLineInactiveColor}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
td.${ClassName.WITH_LAST_ROW_INSERT_LINE}::before {
|
|
900
|
+
${tableCellRowInsertLineStyles}
|
|
901
|
+
bottom: 0;
|
|
902
|
+
${insertLineActiveColor}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
td.${ClassName.WITH_LAST_ROW_INSERT_LINE_INACTIVE}::before {
|
|
906
|
+
${tableCellRowInsertLineStyles}
|
|
907
|
+
bottom: 0;
|
|
908
|
+
${insertLineInactiveColor}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
th.${ClassName.WITH_LAST_ROW_INSERT_LINE}::before {
|
|
912
|
+
${tableCellRowInsertLineStyles}
|
|
913
|
+
bottom: 0;
|
|
914
|
+
${insertLineActiveColor}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
th.${ClassName.WITH_LAST_ROW_INSERT_LINE_INACTIVE}::before {
|
|
918
|
+
${tableCellRowInsertLineStyles}
|
|
919
|
+
bottom: 0;
|
|
920
|
+
${insertLineInactiveColor}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
952
923
|
`;
|