@atlaskit/editor-plugin-table 1.1.0 → 1.1.2
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 +12 -0
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/plugins/table/commands/clear.js +4 -16
- package/dist/cjs/plugins/table/commands/collapse.js +0 -6
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +7 -18
- package/dist/cjs/plugins/table/commands/hover.js +7 -37
- package/dist/cjs/plugins/table/commands/index.js +0 -8
- package/dist/cjs/plugins/table/commands/insert.js +17 -56
- package/dist/cjs/plugins/table/commands/misc.js +36 -132
- package/dist/cjs/plugins/table/commands/referentiality.js +0 -4
- package/dist/cjs/plugins/table/commands/selection.js +21 -87
- package/dist/cjs/plugins/table/commands/sort.js +2 -23
- package/dist/cjs/plugins/table/commands/split-cell.js +3 -11
- package/dist/cjs/plugins/table/commands/toggle.js +8 -34
- package/dist/cjs/plugins/table/commands-with-analytics.js +50 -139
- package/dist/cjs/plugins/table/create-plugin-config.js +0 -6
- package/dist/cjs/plugins/table/event-handlers.js +58 -160
- package/dist/cjs/plugins/table/handlers.js +10 -39
- package/dist/cjs/plugins/table/index.js +47 -91
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -41
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +82 -188
- package/dist/cjs/plugins/table/nodeviews/table.js +12 -70
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +15 -39
- package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +3 -15
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +0 -18
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +8 -27
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +8 -20
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/index.js +0 -3
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -15
- package/dist/cjs/plugins/table/pm-plugins/main.js +20 -72
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +25 -42
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -8
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +4 -23
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/commands.js +0 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/index.js +0 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -13
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +56 -138
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-key.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-state.js +15 -30
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +0 -6
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/util.js +0 -5
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +13 -44
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +12 -42
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +16 -52
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/index.js +0 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -10
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-key.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +5 -19
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/reducer.js +0 -10
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -15
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -28
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/content-width.js +3 -23
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +4 -46
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/index.js +0 -9
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +15 -36
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-column.js +1 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +15 -71
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +34 -82
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +12 -36
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.js +0 -2
- package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +0 -5
- package/dist/cjs/plugins/table/reducer.js +0 -24
- package/dist/cjs/plugins/table/toolbar.js +14 -94
- package/dist/cjs/plugins/table/transforms/column-width.js +12 -45
- package/dist/cjs/plugins/table/transforms/delete-columns.js +11 -76
- package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -42
- package/dist/cjs/plugins/table/transforms/fix-tables.js +24 -61
- package/dist/cjs/plugins/table/transforms/index.js +0 -7
- package/dist/cjs/plugins/table/transforms/merge.js +14 -90
- package/dist/cjs/plugins/table/transforms/metadata.js +0 -5
- package/dist/cjs/plugins/table/transforms/replace-table.js +2 -13
- package/dist/cjs/plugins/table/transforms/split.js +18 -32
- package/dist/cjs/plugins/table/types.js +0 -11
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +10 -51
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +0 -12
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +46 -145
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +12 -35
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +0 -11
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +5 -12
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +3 -16
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +19 -89
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +6 -31
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +5 -22
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +25 -80
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +16 -64
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +14 -47
- package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +20 -48
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/index.js +10 -43
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +33 -74
- package/dist/cjs/plugins/table/ui/common-styles.js +6 -19
- package/dist/cjs/plugins/table/ui/consts.js +3 -8
- package/dist/cjs/plugins/table/ui/messages.js +0 -3
- package/dist/cjs/plugins/table/ui/ui-styles.js +0 -32
- package/dist/cjs/plugins/table/utils/analytics.js +4 -19
- package/dist/cjs/plugins/table/utils/collapse.js +4 -21
- package/dist/cjs/plugins/table/utils/column-controls.js +25 -61
- package/dist/cjs/plugins/table/utils/decoration.js +46 -114
- package/dist/cjs/plugins/table/utils/dom.js +4 -51
- package/dist/cjs/plugins/table/utils/get-allow-add-column-custom-step.js +0 -2
- package/dist/cjs/plugins/table/utils/index.js +0 -10
- package/dist/cjs/plugins/table/utils/nodes.js +5 -48
- package/dist/cjs/plugins/table/utils/paste.js +22 -47
- package/dist/cjs/plugins/table/utils/row-controls.js +6 -67
- package/dist/cjs/plugins/table/utils/selection.js +3 -36
- package/dist/cjs/plugins/table/utils/table.js +0 -11
- package/dist/cjs/plugins/table/utils/update-plugin-state-decorations.js +0 -4
- package/dist/cjs/plugins/table-plugin.js +0 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/clear.js +3 -8
- package/dist/es2019/plugins/table/commands/collapse.js +0 -3
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +4 -7
- package/dist/es2019/plugins/table/commands/hover.js +7 -17
- package/dist/es2019/plugins/table/commands/insert.js +16 -36
- package/dist/es2019/plugins/table/commands/misc.js +37 -67
- package/dist/es2019/plugins/table/commands/selection.js +7 -62
- package/dist/es2019/plugins/table/commands/sort.js +0 -12
- package/dist/es2019/plugins/table/commands/split-cell.js +0 -4
- package/dist/es2019/plugins/table/commands/toggle.js +13 -15
- package/dist/es2019/plugins/table/commands-with-analytics.js +4 -14
- package/dist/es2019/plugins/table/event-handlers.js +14 -62
- package/dist/es2019/plugins/table/handlers.js +16 -26
- package/dist/es2019/plugins/table/index.js +12 -25
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -40
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +27 -100
- package/dist/es2019/plugins/table/nodeviews/table.js +3 -33
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +7 -16
- package/dist/es2019/plugins/table/nodeviews/update-overflow-shadows.js +3 -10
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +0 -5
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +4 -13
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-resizing.js +0 -3
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/main.js +19 -43
- package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +2 -6
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -3
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -12
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -9
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +55 -130
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -9
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/util.js +0 -3
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +20 -39
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +7 -15
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +9 -27
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin-factory.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/reducer.js +8 -8
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -11
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/content-width.js +4 -21
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -22
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +10 -18
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +29 -59
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +54 -51
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +9 -14
- package/dist/es2019/plugins/table/reducer.js +26 -30
- package/dist/es2019/plugins/table/toolbar.js +5 -48
- package/dist/es2019/plugins/table/transforms/column-width.js +16 -28
- package/dist/es2019/plugins/table/transforms/delete-columns.js +17 -58
- package/dist/es2019/plugins/table/transforms/delete-rows.js +8 -25
- package/dist/es2019/plugins/table/transforms/fix-tables.js +25 -42
- package/dist/es2019/plugins/table/transforms/merge.js +22 -70
- package/dist/es2019/plugins/table/transforms/metadata.js +3 -2
- package/dist/es2019/plugins/table/transforms/replace-table.js +0 -2
- package/dist/es2019/plugins/table/transforms/split.js +16 -19
- package/dist/es2019/plugins/table/types.js +2 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +2 -16
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +8 -54
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +4 -13
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +0 -2
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +2 -11
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +13 -49
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +0 -8
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +16 -24
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +3 -31
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +2 -29
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +0 -12
- package/dist/es2019/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +6 -12
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/index.js +0 -9
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +4 -19
- package/dist/es2019/plugins/table/ui/common-styles.js +6 -5
- package/dist/es2019/plugins/table/ui/consts.js +4 -3
- package/dist/es2019/plugins/table/ui/ui-styles.js +0 -10
- package/dist/es2019/plugins/table/utils/analytics.js +0 -8
- package/dist/es2019/plugins/table/utils/collapse.js +3 -14
- package/dist/es2019/plugins/table/utils/column-controls.js +22 -37
- package/dist/es2019/plugins/table/utils/decoration.js +13 -51
- package/dist/es2019/plugins/table/utils/dom.js +3 -19
- package/dist/es2019/plugins/table/utils/nodes.js +2 -15
- package/dist/es2019/plugins/table/utils/paste.js +17 -22
- package/dist/es2019/plugins/table/utils/row-controls.js +12 -45
- package/dist/es2019/plugins/table/utils/selection.js +0 -21
- package/dist/es2019/plugins/table/utils/table.js +0 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/clear.js +3 -8
- package/dist/esm/plugins/table/commands/collapse.js +0 -3
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +6 -9
- package/dist/esm/plugins/table/commands/hover.js +8 -18
- package/dist/esm/plugins/table/commands/insert.js +16 -36
- package/dist/esm/plugins/table/commands/misc.js +39 -78
- package/dist/esm/plugins/table/commands/selection.js +21 -78
- package/dist/esm/plugins/table/commands/sort.js +2 -14
- package/dist/esm/plugins/table/commands/split-cell.js +3 -8
- package/dist/esm/plugins/table/commands/toggle.js +11 -20
- package/dist/esm/plugins/table/commands-with-analytics.js +50 -85
- package/dist/esm/plugins/table/create-plugin-config.js +0 -3
- package/dist/esm/plugins/table/event-handlers.js +58 -123
- package/dist/esm/plugins/table/handlers.js +11 -29
- package/dist/esm/plugins/table/index.js +47 -60
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +8 -44
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +82 -181
- package/dist/esm/plugins/table/nodeviews/table.js +12 -52
- package/dist/esm/plugins/table/nodeviews/tableCell.js +15 -33
- package/dist/esm/plugins/table/nodeviews/update-overflow-shadows.js +3 -10
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +0 -5
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +8 -19
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-resizing.js +8 -13
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/keymap.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/main.js +20 -47
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +25 -37
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +8 -3
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +3 -15
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +4 -9
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +58 -147
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin-state.js +15 -27
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/util.js +0 -3
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +14 -37
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +12 -24
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +16 -36
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -6
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +5 -8
- package/dist/esm/plugins/table/pm-plugins/table-resizing/reducer.js +0 -7
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +0 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +8 -12
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/content-width.js +5 -22
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +4 -23
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +15 -23
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +15 -60
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +34 -55
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +12 -24
- package/dist/esm/plugins/table/reducer.js +0 -20
- package/dist/esm/plugins/table/toolbar.js +13 -63
- package/dist/esm/plugins/table/transforms/column-width.js +12 -32
- package/dist/esm/plugins/table/transforms/delete-columns.js +11 -62
- package/dist/esm/plugins/table/transforms/delete-rows.js +4 -30
- package/dist/esm/plugins/table/transforms/fix-tables.js +24 -49
- package/dist/esm/plugins/table/transforms/merge.js +16 -75
- package/dist/esm/plugins/table/transforms/metadata.js +3 -2
- package/dist/esm/plugins/table/transforms/replace-table.js +2 -6
- package/dist/esm/plugins/table/transforms/split.js +18 -29
- package/dist/esm/plugins/table/types.js +0 -6
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +10 -31
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +0 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +46 -126
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +13 -24
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +0 -2
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +5 -7
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.js +3 -13
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +19 -68
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +6 -14
- package/dist/esm/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +5 -18
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +25 -57
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +16 -47
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +14 -35
- package/dist/esm/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +20 -38
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/index.js +10 -29
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +33 -62
- package/dist/esm/plugins/table/ui/common-styles.js +6 -7
- package/dist/esm/plugins/table/ui/consts.js +4 -3
- package/dist/esm/plugins/table/ui/ui-styles.js +0 -12
- package/dist/esm/plugins/table/utils/analytics.js +4 -13
- package/dist/esm/plugins/table/utils/collapse.js +4 -15
- package/dist/esm/plugins/table/utils/column-controls.js +25 -41
- package/dist/esm/plugins/table/utils/decoration.js +46 -88
- package/dist/esm/plugins/table/utils/dom.js +4 -20
- package/dist/esm/plugins/table/utils/nodes.js +5 -18
- package/dist/esm/plugins/table/utils/paste.js +24 -29
- package/dist/esm/plugins/table/utils/row-controls.js +6 -46
- package/dist/esm/plugins/table/utils/selection.js +3 -26
- package/dist/esm/plugins/table/utils/table.js +0 -2
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
- package/src/__tests__/visual-regression/cell-options-menu.ts +1 -12
|
@@ -1,97 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
13
|
-
|
|
14
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
|
-
|
|
16
11
|
var _pmPlugins = require("@atlaskit/editor-tables/pm-plugins");
|
|
17
|
-
|
|
18
12
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
19
|
-
|
|
20
13
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
21
|
-
|
|
22
14
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
23
|
-
|
|
24
15
|
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
25
|
-
|
|
26
16
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
27
|
-
|
|
28
17
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
29
|
-
|
|
30
18
|
var _icons = require("@atlaskit/editor-common/icons");
|
|
31
|
-
|
|
32
19
|
var _createPluginConfig = require("./create-plugin-config");
|
|
33
|
-
|
|
34
20
|
var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
35
|
-
|
|
36
21
|
var _safariDelayedDomSelectionSyncingWorkaround = require("./pm-plugins/safari-delayed-dom-selection-syncing-workaround");
|
|
37
|
-
|
|
38
22
|
var _safariDeleteCompositionTextIssueWorkaround = require("./pm-plugins/safari-delete-composition-text-issue-workaround");
|
|
39
|
-
|
|
40
23
|
var _plugin = require("./pm-plugins/decorations/plugin");
|
|
41
|
-
|
|
42
24
|
var _keymap = require("./pm-plugins/keymap");
|
|
43
|
-
|
|
44
25
|
var _tableSelectionKeymap = require("./pm-plugins/table-selection-keymap");
|
|
45
|
-
|
|
46
26
|
var _main = require("./pm-plugins/main");
|
|
47
|
-
|
|
48
27
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
49
|
-
|
|
50
28
|
var _stickyHeaders = require("./pm-plugins/sticky-headers");
|
|
51
|
-
|
|
52
29
|
var _tableResizing = require("./pm-plugins/table-resizing");
|
|
53
|
-
|
|
54
30
|
var _toolbar = require("./toolbar");
|
|
55
|
-
|
|
56
31
|
var _FloatingContextualButton = _interopRequireDefault(require("./ui/FloatingContextualButton"));
|
|
57
|
-
|
|
58
32
|
var _FloatingContextualMenu = _interopRequireDefault(require("./ui/FloatingContextualMenu"));
|
|
59
|
-
|
|
60
33
|
var _FloatingDeleteButton = _interopRequireDefault(require("./ui/FloatingDeleteButton"));
|
|
61
|
-
|
|
62
34
|
var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertButton"));
|
|
63
|
-
|
|
64
35
|
var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
|
|
65
|
-
|
|
66
36
|
var _utils3 = require("./utils");
|
|
67
|
-
|
|
68
37
|
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
69
|
-
|
|
70
38
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
71
39
|
return {};
|
|
72
40
|
};
|
|
73
|
-
|
|
74
41
|
var tablesPlugin = function tablesPlugin(options) {
|
|
75
42
|
var editorViewRef = {
|
|
76
43
|
current: null
|
|
77
44
|
};
|
|
78
|
-
|
|
79
45
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
80
46
|
if (!editorViewRef.current) {
|
|
81
47
|
var _document, _document$body;
|
|
82
|
-
|
|
83
48
|
return {
|
|
84
49
|
width: ((_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) || 500
|
|
85
50
|
};
|
|
86
51
|
}
|
|
52
|
+
var state = editorViewRef.current.state;
|
|
87
53
|
|
|
88
|
-
|
|
54
|
+
// TODO: ED-15663
|
|
89
55
|
// Please, do not copy or use this kind of code below
|
|
90
56
|
// @ts-ignore
|
|
91
|
-
|
|
92
57
|
return state['widthPlugin$'];
|
|
93
58
|
};
|
|
94
|
-
|
|
95
59
|
return {
|
|
96
60
|
name: 'table',
|
|
97
61
|
nodes: function nodes() {
|
|
@@ -114,34 +78,29 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
114
78
|
name: 'table',
|
|
115
79
|
plugin: function plugin(_ref) {
|
|
116
80
|
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
81
|
+
dispatch = _ref.dispatch,
|
|
82
|
+
portalProviderAPI = _ref.portalProviderAPI,
|
|
83
|
+
eventDispatcher = _ref.eventDispatcher;
|
|
121
84
|
var _ref2 = options || {},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
85
|
+
fullWidthEnabled = _ref2.fullWidthEnabled,
|
|
86
|
+
wasFullWidthEnabled = _ref2.wasFullWidthEnabled,
|
|
87
|
+
breakoutEnabled = _ref2.breakoutEnabled,
|
|
88
|
+
tableOptions = _ref2.tableOptions,
|
|
89
|
+
editorAnalyticsAPI = _ref2.editorAnalyticsAPI,
|
|
90
|
+
getEditorFeatureFlags = _ref2.getEditorFeatureFlags;
|
|
129
91
|
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI);
|
|
130
92
|
}
|
|
131
93
|
}, {
|
|
132
94
|
name: 'tablePMColResizing',
|
|
133
95
|
plugin: function plugin(_ref3) {
|
|
134
96
|
var dispatch = _ref3.dispatch;
|
|
135
|
-
|
|
136
97
|
var _ref4 = options || {},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
98
|
+
fullWidthEnabled = _ref4.fullWidthEnabled,
|
|
99
|
+
tableOptions = _ref4.tableOptions,
|
|
100
|
+
editorAnalyticsAPI = _ref4.editorAnalyticsAPI,
|
|
101
|
+
getEditorFeatureFlags = _ref4.getEditorFeatureFlags;
|
|
142
102
|
var _pluginConfig = (0, _createPluginConfig.pluginConfig)(tableOptions),
|
|
143
|
-
|
|
144
|
-
|
|
103
|
+
allowColumnResizing = _pluginConfig.allowColumnResizing;
|
|
145
104
|
return allowColumnResizing ? (0, _tableResizing.createPlugin)(dispatch, {
|
|
146
105
|
lastColumnResizable: !fullWidthEnabled
|
|
147
106
|
}, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, editorAnalyticsAPI) : undefined;
|
|
@@ -151,7 +110,8 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
151
110
|
plugin: function plugin() {
|
|
152
111
|
return (0, _plugin.createPlugin)();
|
|
153
112
|
}
|
|
154
|
-
},
|
|
113
|
+
},
|
|
114
|
+
// Needs to be lower priority than editor-tables.tableEditing
|
|
155
115
|
// plugin as it is currently swallowing backspace events inside tables
|
|
156
116
|
{
|
|
157
117
|
name: 'tableKeymap',
|
|
@@ -169,10 +129,9 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
169
129
|
return (0, _pmPlugins.tableEditing)({
|
|
170
130
|
reportFixedTable: function reportFixedTable(_ref5) {
|
|
171
131
|
var _options$editorAnalyt;
|
|
172
|
-
|
|
173
132
|
var state = _ref5.state,
|
|
174
|
-
|
|
175
|
-
|
|
133
|
+
tr = _ref5.tr,
|
|
134
|
+
reason = _ref5.reason;
|
|
176
135
|
options === null || options === void 0 ? void 0 : (_options$editorAnalyt = options.editorAnalyticsAPI) === null || _options$editorAnalyt === void 0 ? void 0 : _options$editorAnalyt.attachAnalyticsEvent({
|
|
177
136
|
action: _analytics.TABLE_ACTION.FIXED,
|
|
178
137
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
@@ -189,7 +148,7 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
189
148
|
name: 'tableStickyHeaders',
|
|
190
149
|
plugin: function plugin(_ref6) {
|
|
191
150
|
var dispatch = _ref6.dispatch,
|
|
192
|
-
|
|
151
|
+
eventDispatcher = _ref6.eventDispatcher;
|
|
193
152
|
return options && options.tableOptions.stickyHeaders ? (0, _stickyHeaders.createPlugin)(dispatch, eventDispatcher, function () {
|
|
194
153
|
return [];
|
|
195
154
|
}, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined;
|
|
@@ -214,12 +173,14 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
214
173
|
}
|
|
215
174
|
});
|
|
216
175
|
}
|
|
217
|
-
}];
|
|
176
|
+
}];
|
|
177
|
+
|
|
178
|
+
// workaround for prosemirrors delayed dom selection syncing during pointer drag
|
|
218
179
|
// causing issues with table selections in Safari
|
|
219
180
|
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
181
|
+
|
|
220
182
|
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
221
183
|
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
222
|
-
|
|
223
184
|
if (_utils.browser.safari) {
|
|
224
185
|
plugins.push({
|
|
225
186
|
name: 'tableSafariDelayedDomSelectionSyncingWorkaround',
|
|
@@ -227,10 +188,10 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
227
188
|
return (0, _safariDelayedDomSelectionSyncingWorkaround.createPlugin)();
|
|
228
189
|
}
|
|
229
190
|
});
|
|
230
|
-
}
|
|
231
|
-
// https://github.com/ProseMirror/prosemirror/issues/934
|
|
232
|
-
|
|
191
|
+
}
|
|
233
192
|
|
|
193
|
+
// Workaround for table element breaking issue caused by composition event with an inputType of deleteCompositionText.
|
|
194
|
+
// https://github.com/ProseMirror/prosemirror/issues/934
|
|
234
195
|
if (_utils.browser.safari) {
|
|
235
196
|
plugins.push({
|
|
236
197
|
name: 'tableSafariDeleteCompositionTextIssueWorkaround',
|
|
@@ -239,15 +200,14 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
239
200
|
}
|
|
240
201
|
});
|
|
241
202
|
}
|
|
242
|
-
|
|
243
203
|
return plugins;
|
|
244
204
|
},
|
|
245
205
|
contentComponent: function contentComponent(_ref8) {
|
|
246
206
|
var editorView = _ref8.editorView,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
207
|
+
popupsMountPoint = _ref8.popupsMountPoint,
|
|
208
|
+
popupsBoundariesElement = _ref8.popupsBoundariesElement,
|
|
209
|
+
popupsScrollableElement = _ref8.popupsScrollableElement,
|
|
210
|
+
dispatchAnalyticsEvent = _ref8.dispatchAnalyticsEvent;
|
|
251
211
|
return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
252
212
|
component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
|
|
253
213
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
@@ -260,23 +220,23 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
260
220
|
},
|
|
261
221
|
render: function render(_ref9) {
|
|
262
222
|
var resizingPluginState = _ref9.tableResizingPluginState,
|
|
263
|
-
|
|
264
|
-
|
|
223
|
+
stickyHeadersState = _ref9.stickyHeadersState,
|
|
224
|
+
tablePluginState = _ref9.tablePluginState;
|
|
265
225
|
var state = editorView.state;
|
|
266
226
|
var isDragging = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
267
227
|
var _ref10 = tablePluginState,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
228
|
+
tableNode = _ref10.tableNode,
|
|
229
|
+
tablePos = _ref10.tablePos,
|
|
230
|
+
targetCellPosition = _ref10.targetCellPosition,
|
|
231
|
+
isContextualMenuOpen = _ref10.isContextualMenuOpen,
|
|
232
|
+
layout = _ref10.layout,
|
|
233
|
+
tableRef = _ref10.tableRef,
|
|
234
|
+
pluginConfig = _ref10.pluginConfig,
|
|
235
|
+
insertColumnButtonIndex = _ref10.insertColumnButtonIndex,
|
|
236
|
+
insertRowButtonIndex = _ref10.insertRowButtonIndex,
|
|
237
|
+
isHeaderColumnEnabled = _ref10.isHeaderColumnEnabled,
|
|
238
|
+
isHeaderRowEnabled = _ref10.isHeaderRowEnabled,
|
|
239
|
+
tableWrapperTarget = _ref10.tableWrapperTarget;
|
|
280
240
|
var allowControls = pluginConfig.allowControls;
|
|
281
241
|
var stickyHeader = stickyHeadersState ? (0, _stickyHeaders.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
282
242
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, targetCellPosition && tableRef && !isDragging && options && options.allowContextualMenu && /*#__PURE__*/_react.default.createElement(_FloatingContextualButton.default, {
|
|
@@ -343,13 +303,11 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
343
303
|
// For now, we are using this on (insert-api/api.ts) but we may create a proper place for it
|
|
344
304
|
createNodeHandler: function createNodeHandler(_ref11) {
|
|
345
305
|
var nodeName = _ref11.nodeName,
|
|
346
|
-
|
|
347
|
-
|
|
306
|
+
schema = _ref11.schema;
|
|
348
307
|
// An EditorPlugin may manage more than one node.
|
|
349
308
|
if (nodeName !== 'table') {
|
|
350
309
|
return null;
|
|
351
310
|
}
|
|
352
|
-
|
|
353
311
|
var table = (0, _utils2.createTable)({
|
|
354
312
|
schema: schema
|
|
355
313
|
});
|
|
@@ -369,7 +327,6 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
369
327
|
},
|
|
370
328
|
action: function action(insert, state) {
|
|
371
329
|
var _options$editorAnalyt2;
|
|
372
|
-
|
|
373
330
|
var tr = insert((0, _utils2.createTable)({
|
|
374
331
|
schema: state.schema
|
|
375
332
|
}));
|
|
@@ -392,6 +349,5 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
392
349
|
}
|
|
393
350
|
};
|
|
394
351
|
};
|
|
395
|
-
|
|
396
352
|
var _default = tablesPlugin;
|
|
397
353
|
exports.default = _default;
|
|
@@ -1,68 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.OverflowShadowsObserver = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
11
|
var _types = require("../types");
|
|
17
|
-
|
|
18
12
|
var _consts = require("../ui/consts");
|
|
19
|
-
|
|
20
13
|
var _updateOverflowShadows = require("./update-overflow-shadows");
|
|
21
|
-
|
|
22
14
|
var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
23
15
|
// updateShadowState is a method to update shadow key
|
|
24
16
|
function OverflowShadowsObserver(updateShadowState, _table, wrapper) {
|
|
25
17
|
var _this = this;
|
|
26
|
-
|
|
27
18
|
(0, _classCallCheck2.default)(this, OverflowShadowsObserver);
|
|
28
19
|
(0, _defineProperty2.default)(this, "firstCell", null);
|
|
29
20
|
(0, _defineProperty2.default)(this, "lastCell", null);
|
|
30
21
|
(0, _defineProperty2.default)(this, "getFirstCell", function (isSticky, hasHeaderRow) {
|
|
31
22
|
var _this$table;
|
|
32
|
-
|
|
33
23
|
return (_this$table = _this.table) === null || _this$table === void 0 ? void 0 : _this$table.querySelector(isSticky || !hasHeaderRow ? 'table tbody tr td' : 'table tbody tr th');
|
|
34
24
|
});
|
|
35
25
|
(0, _defineProperty2.default)(this, "getLastCell", function (isSticky, hasHeaderRow) {
|
|
36
26
|
var _this$table2;
|
|
37
|
-
|
|
38
27
|
return (_this$table2 = _this.table) === null || _this$table2 === void 0 ? void 0 : _this$table2.querySelector(isSticky || !hasHeaderRow ? 'table tbody tr td:last-child' : 'table tbody tr th:last-child');
|
|
39
28
|
});
|
|
40
29
|
(0, _defineProperty2.default)(this, "isSticky", false);
|
|
41
30
|
(0, _defineProperty2.default)(this, "stickyRowHeight", 0);
|
|
42
31
|
(0, _defineProperty2.default)(this, "init", function () {
|
|
43
32
|
var table = _this.table;
|
|
44
|
-
|
|
45
33
|
if (!_this.wrapper || !table) {
|
|
46
34
|
return;
|
|
47
35
|
}
|
|
48
|
-
|
|
49
36
|
if (!_this.tableIntersectionObserver) {
|
|
50
37
|
var intersectonOnbserverCallback = function intersectonOnbserverCallback(entry) {
|
|
51
38
|
var _entry$rootBounds, _entry$rootBounds2;
|
|
52
|
-
|
|
53
39
|
if (!((_entry$rootBounds = entry.rootBounds) !== null && _entry$rootBounds !== void 0 && _entry$rootBounds.height) && !((_entry$rootBounds2 = entry.rootBounds) !== null && _entry$rootBounds2 !== void 0 && _entry$rootBounds2.width)) {
|
|
54
40
|
return;
|
|
55
41
|
}
|
|
56
|
-
|
|
57
42
|
if (entry.target !== _this.firstCell && entry.target !== _this.lastCell) {
|
|
58
43
|
return;
|
|
59
44
|
}
|
|
60
|
-
|
|
61
45
|
_this.updateStickyShadowsHeightIfChanged();
|
|
62
|
-
|
|
63
46
|
_this.checkIntersectionEvent(entry, _this.firstCell === entry.target ? _types.ShadowEvent.SHOW_BEFORE_SHADOW : _types.ShadowEvent.SHOW_AFTER_SHADOW);
|
|
64
47
|
};
|
|
65
|
-
|
|
66
48
|
_this.tableIntersectionObserver = new IntersectionObserver(function (entries, _) {
|
|
67
49
|
entries.forEach(function (entry) {
|
|
68
50
|
return intersectonOnbserverCallback(entry);
|
|
@@ -76,57 +58,49 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
76
58
|
}
|
|
77
59
|
});
|
|
78
60
|
(0, _defineProperty2.default)(this, "checkIntersectionEvent", function (entry, shadowKey) {
|
|
79
|
-
if (
|
|
61
|
+
if (
|
|
62
|
+
// If it's in full view, don't show shadow.
|
|
80
63
|
entry.isIntersecting && entry.intersectionRatio === 1) {
|
|
81
64
|
_this.updateShadowState(shadowKey, false);
|
|
82
|
-
} else if (
|
|
65
|
+
} else if (
|
|
66
|
+
// If it's in partial view, show a shadow
|
|
83
67
|
entry.intersectionRatio < 1) {
|
|
84
68
|
_this.updateShadowState(shadowKey, true);
|
|
85
69
|
}
|
|
86
70
|
});
|
|
87
71
|
(0, _defineProperty2.default)(this, "observeCells", function (isSticky, hasHeaderRow) {
|
|
88
72
|
var stickyChanged = !!isSticky !== _this.isSticky;
|
|
89
|
-
_this.isSticky = !!isSticky;
|
|
73
|
+
_this.isSticky = !!isSticky;
|
|
90
74
|
|
|
75
|
+
// update sticky shadows
|
|
91
76
|
_this.updateStickyShadowsHeightIfChanged();
|
|
92
|
-
|
|
93
77
|
if (!stickyChanged) {
|
|
94
78
|
var firstCell = _this.getFirstCell(isSticky, hasHeaderRow);
|
|
95
|
-
|
|
96
79
|
var lastCell = _this.getLastCell(isSticky, hasHeaderRow);
|
|
97
|
-
|
|
98
80
|
if (!firstCell || !lastCell || firstCell === _this.firstCell && lastCell === _this.lastCell) {
|
|
99
81
|
return;
|
|
100
82
|
}
|
|
101
83
|
}
|
|
102
|
-
|
|
103
84
|
_this.firstCell = _this.getFirstCell(isSticky, hasHeaderRow);
|
|
104
85
|
_this.lastCell = _this.getLastCell(isSticky, hasHeaderRow);
|
|
105
|
-
|
|
106
86
|
if (_this.tableIntersectionObserver && _this.firstCell && _this.lastCell) {
|
|
107
87
|
_this.tableIntersectionObserver.disconnect();
|
|
108
|
-
|
|
109
88
|
_this.tableIntersectionObserver.observe(_this.firstCell);
|
|
110
|
-
|
|
111
89
|
_this.tableIntersectionObserver.observe(_this.lastCell);
|
|
112
90
|
}
|
|
113
91
|
});
|
|
114
92
|
(0, _defineProperty2.default)(this, "updateStickyShadows", function (stickyRowHeight) {
|
|
115
93
|
var _this$wrapper, _this$wrapper2, _this$wrapper2$parent, _this$wrapper3, _this$wrapper3$parent;
|
|
116
|
-
|
|
117
94
|
if (!_this.isSticky) {
|
|
118
95
|
return;
|
|
119
96
|
}
|
|
120
|
-
|
|
121
97
|
var stickyCell = _this.getStickyCell();
|
|
122
|
-
|
|
123
98
|
if (!stickyCell || !((_this$wrapper = _this.wrapper) !== null && _this$wrapper !== void 0 && _this$wrapper.parentElement)) {
|
|
124
99
|
return;
|
|
125
100
|
}
|
|
126
|
-
|
|
127
|
-
|
|
101
|
+
var heightStyleOrCompute = "".concat(stickyRowHeight || stickyCell.clientHeight + 1, "px");
|
|
102
|
+
// Use getElementsByClassName here for a live node list to capture
|
|
128
103
|
// sticky shadows
|
|
129
|
-
|
|
130
104
|
var liveRightShadows = (_this$wrapper2 = _this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : (_this$wrapper2$parent = _this$wrapper2.parentElement) === null || _this$wrapper2$parent === void 0 ? void 0 : _this$wrapper2$parent.getElementsByClassName("".concat(_types.TableCssClassName.TABLE_RIGHT_SHADOW));
|
|
131
105
|
var liveLeftShadows = (_this$wrapper3 = _this.wrapper) === null || _this$wrapper3 === void 0 ? void 0 : (_this$wrapper3$parent = _this$wrapper3.parentElement) === null || _this$wrapper3$parent === void 0 ? void 0 : _this$wrapper3$parent.getElementsByClassName("".concat(_types.TableCssClassName.TABLE_LEFT_SHADOW));
|
|
132
106
|
(0, _updateOverflowShadows.updateShadowListForStickyStyles)(heightStyleOrCompute, liveLeftShadows);
|
|
@@ -137,22 +111,17 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
137
111
|
this.wrapper = wrapper;
|
|
138
112
|
this.init();
|
|
139
113
|
}
|
|
140
|
-
|
|
141
114
|
(0, _createClass2.default)(OverflowShadowsObserver, [{
|
|
142
115
|
key: "updateStickyShadowsHeightIfChanged",
|
|
143
116
|
value: function updateStickyShadowsHeightIfChanged() {
|
|
144
117
|
if (!this.isSticky) {
|
|
145
118
|
return;
|
|
146
119
|
}
|
|
147
|
-
|
|
148
120
|
var stickyCell = this.getStickyCell();
|
|
149
|
-
|
|
150
121
|
if (!stickyCell) {
|
|
151
122
|
return;
|
|
152
123
|
}
|
|
153
|
-
|
|
154
124
|
var newStickyRowHeight = stickyCell.clientHeight + 1;
|
|
155
|
-
|
|
156
125
|
if (newStickyRowHeight === this.stickyRowHeight) {
|
|
157
126
|
this.stickyRowHeight = newStickyRowHeight;
|
|
158
127
|
this.updateStickyShadows(this.stickyRowHeight);
|
|
@@ -162,7 +131,6 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
162
131
|
key: "getStickyCell",
|
|
163
132
|
value: function getStickyCell() {
|
|
164
133
|
var _this$wrapper4;
|
|
165
|
-
|
|
166
134
|
var stickyRow = (_this$wrapper4 = this.wrapper) === null || _this$wrapper4 === void 0 ? void 0 : _this$wrapper4.querySelector('tr.sticky');
|
|
167
135
|
var stickyCell = stickyRow && stickyRow.firstElementChild;
|
|
168
136
|
return stickyCell;
|
|
@@ -178,5 +146,4 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
178
146
|
}]);
|
|
179
147
|
return OverflowShadowsObserver;
|
|
180
148
|
}();
|
|
181
|
-
|
|
182
149
|
exports.OverflowShadowsObserver = OverflowShadowsObserver;
|