@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
|
@@ -5,15 +5,10 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
|
|
17
12
|
import React, { createRef } from 'react';
|
|
18
13
|
import classnames from 'classnames';
|
|
19
14
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -25,7 +20,6 @@ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
|
25
20
|
import { toggleTableLayoutWithAnalytics } from '../../commands-with-analytics';
|
|
26
21
|
import { TableCssClassName as ClassName } from '../../types';
|
|
27
22
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
28
|
-
|
|
29
23
|
var addPopupOffset = function addPopupOffset(pos) {
|
|
30
24
|
return _objectSpread(_objectSpread({}, pos), {}, {
|
|
31
25
|
// add 12 pixels to align y position with
|
|
@@ -33,76 +27,61 @@ var addPopupOffset = function addPopupOffset(pos) {
|
|
|
33
27
|
top: pos.top ? pos.top + 12 : undefined
|
|
34
28
|
});
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
var getMessage = function getMessage(layout) {
|
|
38
31
|
switch (layout) {
|
|
39
32
|
case 'default':
|
|
40
33
|
return commonMessages.layoutWide;
|
|
41
|
-
|
|
42
34
|
case 'wide':
|
|
43
35
|
return commonMessages.layoutFullWidth;
|
|
44
|
-
|
|
45
36
|
default:
|
|
46
37
|
return commonMessages.layoutFixedWidth;
|
|
47
38
|
}
|
|
48
39
|
};
|
|
49
|
-
|
|
50
40
|
var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
51
41
|
_inherits(LayoutButton, _React$Component);
|
|
52
|
-
|
|
53
42
|
var _super = _createSuper(LayoutButton);
|
|
54
|
-
|
|
55
43
|
function LayoutButton() {
|
|
56
44
|
var _this;
|
|
57
|
-
|
|
58
45
|
_classCallCheck(this, LayoutButton);
|
|
59
|
-
|
|
60
46
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
61
47
|
args[_key] = arguments[_key];
|
|
62
48
|
}
|
|
63
|
-
|
|
64
49
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
65
|
-
|
|
66
50
|
_defineProperty(_assertThisInitialized(_this), "stickyButtonRef", /*#__PURE__*/createRef());
|
|
67
|
-
|
|
68
51
|
_defineProperty(_assertThisInitialized(_this), "resizeObserver", new ResizeObserver(function (entries) {
|
|
69
52
|
entries.forEach(function (entry) {
|
|
70
53
|
var resizeButton = _this.stickyButtonRef.current;
|
|
71
54
|
var tableWrapper = _this.props.targetRef;
|
|
72
|
-
|
|
73
55
|
if (resizeButton && tableWrapper) {
|
|
74
56
|
var clientRect = tableWrapper.getBoundingClientRect();
|
|
75
57
|
resizeButton.style.left = "".concat(clientRect.right, "px");
|
|
76
58
|
}
|
|
77
59
|
});
|
|
78
60
|
}));
|
|
79
|
-
|
|
80
61
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function () {
|
|
81
62
|
var _this$props$editorVie = _this.props.editorView,
|
|
82
|
-
|
|
83
|
-
|
|
63
|
+
state = _this$props$editorVie.state,
|
|
64
|
+
dispatch = _this$props$editorVie.dispatch;
|
|
84
65
|
toggleTableLayoutWithAnalytics(_this.props.editorAnalyticsAPI)(state, dispatch);
|
|
85
66
|
});
|
|
86
|
-
|
|
87
67
|
return _this;
|
|
88
68
|
}
|
|
89
|
-
|
|
90
69
|
_createClass(LayoutButton, [{
|
|
91
70
|
key: "getTitle",
|
|
92
71
|
value: function getTitle() {
|
|
93
72
|
var _this$props = this.props,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
73
|
+
formatMessage = _this$props.intl.formatMessage,
|
|
74
|
+
_this$props$layout = _this$props.layout,
|
|
75
|
+
layout = _this$props$layout === void 0 ? 'default' : _this$props$layout;
|
|
97
76
|
return formatMessage(getMessage(layout));
|
|
98
77
|
}
|
|
99
78
|
}, {
|
|
100
79
|
key: "toolbarButton",
|
|
101
80
|
value: function toolbarButton() {
|
|
102
81
|
var _this$props2 = this.props,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
82
|
+
isResizing = _this$props2.isResizing,
|
|
83
|
+
_this$props2$layout = _this$props2.layout,
|
|
84
|
+
layout = _this$props2$layout === void 0 ? 'default' : _this$props2$layout;
|
|
106
85
|
var title = this.getTitle();
|
|
107
86
|
return /*#__PURE__*/React.createElement("div", {
|
|
108
87
|
className: classnames(ClassName.LAYOUT_BUTTON, _defineProperty({}, ClassName.IS_RESIZING, isResizing))
|
|
@@ -128,11 +107,9 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
128
107
|
key: "renderSticky",
|
|
129
108
|
value: function renderSticky(button, targetRef, tableRef) {
|
|
130
109
|
var title = this.getTitle();
|
|
131
|
-
|
|
132
110
|
if (!(targetRef instanceof HTMLElement) || !(tableRef instanceof HTMLElement)) {
|
|
133
111
|
return null;
|
|
134
112
|
}
|
|
135
|
-
|
|
136
113
|
var pos = targetRef.getBoundingClientRect();
|
|
137
114
|
var tablePos = tableRef.getBoundingClientRect();
|
|
138
115
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -149,15 +126,13 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
149
126
|
key: "renderPopup",
|
|
150
127
|
value: function renderPopup(button) {
|
|
151
128
|
var _this$props3 = this.props,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
129
|
+
mountPoint = _this$props3.mountPoint,
|
|
130
|
+
boundariesElement = _this$props3.boundariesElement,
|
|
131
|
+
scrollableElement = _this$props3.scrollableElement,
|
|
132
|
+
targetRef = _this$props3.targetRef;
|
|
157
133
|
if (!targetRef) {
|
|
158
134
|
return null;
|
|
159
135
|
}
|
|
160
|
-
|
|
161
136
|
var title = this.getTitle();
|
|
162
137
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
163
138
|
ariaLabel: title,
|
|
@@ -178,7 +153,6 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
178
153
|
var stickyHeader = this.props.stickyHeader;
|
|
179
154
|
var button = this.toolbarButton();
|
|
180
155
|
var stickyTargetRef = stickyHeader && stickyHeader.sticky && stickyHeader.pos ? this.getStickyTargetRef(stickyHeader.pos) : null;
|
|
181
|
-
|
|
182
156
|
if (stickyTargetRef && this.props.targetRef) {
|
|
183
157
|
return this.renderSticky(button, stickyTargetRef, this.props.targetRef);
|
|
184
158
|
} else {
|
|
@@ -190,7 +164,6 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
190
164
|
value: function componentDidMount() {
|
|
191
165
|
var dom = this.props.editorView.dom;
|
|
192
166
|
var scrollPanel = dom.closest('.fabric-editor-popup-scroll-parent');
|
|
193
|
-
|
|
194
167
|
if (scrollPanel instanceof HTMLElement) {
|
|
195
168
|
this.resizeObserver.observe(scrollPanel);
|
|
196
169
|
}
|
|
@@ -200,7 +173,6 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
200
173
|
value: function componentWillUnmount() {
|
|
201
174
|
var dom = this.props.editorView.dom;
|
|
202
175
|
var scrollPanel = dom.closest('.fabric-editor-popup-scroll-parent');
|
|
203
|
-
|
|
204
176
|
if (scrollPanel instanceof HTMLElement) {
|
|
205
177
|
this.resizeObserver.unobserve(scrollPanel);
|
|
206
178
|
}
|
|
@@ -209,17 +181,14 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
209
181
|
key: "shouldComponentUpdate",
|
|
210
182
|
value: function shouldComponentUpdate(nextProps) {
|
|
211
183
|
var _this$props4 = this.props,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
184
|
+
targetRef = _this$props4.targetRef,
|
|
185
|
+
layout = _this$props4.layout,
|
|
186
|
+
isResizing = _this$props4.isResizing,
|
|
187
|
+
stickyHeader = _this$props4.stickyHeader;
|
|
216
188
|
return stickyHeader !== nextProps.stickyHeader || targetRef !== nextProps.targetRef || layout !== nextProps.layout || isResizing !== nextProps.isResizing;
|
|
217
189
|
}
|
|
218
190
|
}]);
|
|
219
|
-
|
|
220
191
|
return LayoutButton;
|
|
221
192
|
}(React.Component);
|
|
222
|
-
|
|
223
193
|
_defineProperty(LayoutButton, "displayName", 'LayoutButton');
|
|
224
|
-
|
|
225
194
|
export default injectIntl(LayoutButton);
|
|
@@ -5,11 +5,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
import React, { Component } from 'react';
|
|
14
11
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
15
12
|
import classnames from 'classnames';
|
|
@@ -24,76 +21,60 @@ var messages = defineMessages({
|
|
|
24
21
|
description: 'A button on the upper left corner of the table that shows up when the table is in focus. Clicking on it will select the entire table.'
|
|
25
22
|
}
|
|
26
23
|
});
|
|
27
|
-
|
|
28
24
|
var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
29
25
|
_inherits(CornerControlComponent, _Component);
|
|
30
|
-
|
|
31
26
|
var _super = _createSuper(CornerControlComponent);
|
|
32
|
-
|
|
33
27
|
function CornerControlComponent() {
|
|
34
28
|
var _this;
|
|
35
|
-
|
|
36
29
|
_classCallCheck(this, CornerControlComponent);
|
|
37
|
-
|
|
38
30
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39
31
|
args[_key] = arguments[_key];
|
|
40
32
|
}
|
|
41
|
-
|
|
42
33
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
43
|
-
|
|
44
34
|
_defineProperty(_assertThisInitialized(_this), "isActive", function () {
|
|
45
35
|
var _this$props = _this.props,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
editorView = _this$props.editorView,
|
|
37
|
+
hoveredRows = _this$props.hoveredRows,
|
|
38
|
+
isResizing = _this$props.isResizing;
|
|
49
39
|
var selection = editorView.state.selection;
|
|
50
40
|
var table = findTable(selection);
|
|
51
|
-
|
|
52
41
|
if (!table) {
|
|
53
42
|
return false;
|
|
54
43
|
}
|
|
55
|
-
|
|
56
44
|
return isTableSelected(selection) || hoveredRows && hoveredRows.length === TableMap.get(table.node).height && !isResizing;
|
|
57
45
|
});
|
|
58
|
-
|
|
59
46
|
_defineProperty(_assertThisInitialized(_this), "clearHoverSelection", function () {
|
|
60
47
|
var _this$props$editorVie = _this.props.editorView,
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
state = _this$props$editorVie.state,
|
|
49
|
+
dispatch = _this$props$editorVie.dispatch;
|
|
63
50
|
clearHoverSelection()(state, dispatch);
|
|
64
51
|
});
|
|
65
|
-
|
|
66
52
|
_defineProperty(_assertThisInitialized(_this), "selectTable", function () {
|
|
67
53
|
var _this$props$editorVie2 = _this.props.editorView,
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
state = _this$props$editorVie2.state,
|
|
55
|
+
dispatch = _this$props$editorVie2.dispatch;
|
|
70
56
|
dispatch(selectTable(state.tr).setMeta('addToHistory', false));
|
|
71
57
|
});
|
|
72
|
-
|
|
73
58
|
_defineProperty(_assertThisInitialized(_this), "hoverTable", function () {
|
|
74
59
|
var _this$props$editorVie3 = _this.props.editorView,
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
state = _this$props$editorVie3.state,
|
|
61
|
+
dispatch = _this$props$editorVie3.dispatch;
|
|
77
62
|
hoverTable()(state, dispatch);
|
|
78
63
|
});
|
|
79
|
-
|
|
80
64
|
return _this;
|
|
81
65
|
}
|
|
82
|
-
|
|
83
66
|
_createClass(CornerControlComponent, [{
|
|
84
67
|
key: "render",
|
|
85
68
|
value: function render() {
|
|
86
69
|
var _this$props2 = this.props,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
70
|
+
isInDanger = _this$props2.isInDanger,
|
|
71
|
+
tableRef = _this$props2.tableRef,
|
|
72
|
+
isHeaderColumnEnabled = _this$props2.isHeaderColumnEnabled,
|
|
73
|
+
isHeaderRowEnabled = _this$props2.isHeaderRowEnabled,
|
|
74
|
+
formatMessage = _this$props2.intl.formatMessage;
|
|
93
75
|
if (!tableRef) {
|
|
94
76
|
return null;
|
|
95
77
|
}
|
|
96
|
-
|
|
97
78
|
var isActive = this.isActive();
|
|
98
79
|
return /*#__PURE__*/React.createElement("div", {
|
|
99
80
|
className: classnames(ClassName.CORNER_CONTROLS, {
|
|
@@ -124,8 +105,6 @@ var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
|
124
105
|
})));
|
|
125
106
|
}
|
|
126
107
|
}]);
|
|
127
|
-
|
|
128
108
|
return CornerControlComponent;
|
|
129
109
|
}(Component);
|
|
130
|
-
|
|
131
110
|
export var CornerControls = injectIntl(CornerControlComponent);
|
|
@@ -5,94 +5,78 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
import React, { Component } from 'react';
|
|
14
11
|
import { Selection } from 'prosemirror-state';
|
|
15
12
|
import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
16
13
|
import { clearHoverSelection } from '../../../commands';
|
|
17
14
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
18
15
|
import { getRowHeights } from '../../../utils';
|
|
19
|
-
|
|
20
16
|
var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
21
17
|
_inherits(NumberColumn, _Component);
|
|
22
|
-
|
|
23
18
|
var _super = _createSuper(NumberColumn);
|
|
24
|
-
|
|
25
19
|
function NumberColumn() {
|
|
26
20
|
var _this;
|
|
27
|
-
|
|
28
21
|
_classCallCheck(this, NumberColumn);
|
|
29
|
-
|
|
30
22
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
23
|
args[_key] = arguments[_key];
|
|
32
24
|
}
|
|
33
|
-
|
|
34
25
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
|
-
|
|
36
26
|
_defineProperty(_assertThisInitialized(_this), "hoverRows", function (index) {
|
|
37
27
|
return _this.props.tableActive ? _this.props.hoverRows([index]) : null;
|
|
38
28
|
});
|
|
39
|
-
|
|
40
29
|
_defineProperty(_assertThisInitialized(_this), "selectRow", function (index, event) {
|
|
41
30
|
var _this$props = _this.props,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
tableActive = _this$props.tableActive,
|
|
32
|
+
editorView = _this$props.editorView,
|
|
33
|
+
selectRow = _this$props.selectRow;
|
|
34
|
+
// If selection is outside the table then first reset the selection inside table
|
|
46
35
|
if (!tableActive && event.target && event.target instanceof Node) {
|
|
47
36
|
var _editorView$state = editorView.state,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
doc = _editorView$state.doc,
|
|
38
|
+
selection = _editorView$state.selection,
|
|
39
|
+
tr = _editorView$state.tr;
|
|
51
40
|
var pos = editorView.posAtDOM(event.target, 1);
|
|
52
41
|
var $pos = doc.resolve(pos);
|
|
53
|
-
var newPos = selection.head > pos ?
|
|
42
|
+
var newPos = selection.head > pos ?
|
|
43
|
+
// Selection is after table
|
|
54
44
|
// nodeSize - 3 will move the position inside last table cell
|
|
55
|
-
Selection.near(doc.resolve(pos + ($pos.parent.nodeSize - 3)), -1) :
|
|
45
|
+
Selection.near(doc.resolve(pos + ($pos.parent.nodeSize - 3)), -1) :
|
|
46
|
+
// Selection is before table
|
|
56
47
|
Selection.near($pos);
|
|
57
48
|
editorView.dispatch(tr.setSelection(newPos));
|
|
58
49
|
}
|
|
59
|
-
|
|
60
50
|
selectRow(index, event.shiftKey);
|
|
61
51
|
});
|
|
62
|
-
|
|
63
52
|
_defineProperty(_assertThisInitialized(_this), "clearHoverSelection", function () {
|
|
64
53
|
var _this$props2 = _this.props,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
tableActive = _this$props2.tableActive,
|
|
55
|
+
editorView = _this$props2.editorView;
|
|
68
56
|
if (tableActive) {
|
|
69
57
|
var state = editorView.state,
|
|
70
|
-
|
|
58
|
+
dispatch = editorView.dispatch;
|
|
71
59
|
clearHoverSelection()(state, dispatch);
|
|
72
60
|
}
|
|
73
61
|
});
|
|
74
|
-
|
|
75
62
|
_defineProperty(_assertThisInitialized(_this), "getClassNames", function (index) {
|
|
76
63
|
var _this$props3 = _this.props,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
hoveredRows = _this$props3.hoveredRows,
|
|
65
|
+
editorView = _this$props3.editorView,
|
|
66
|
+
isInDanger = _this$props3.isInDanger,
|
|
67
|
+
isResizing = _this$props3.isResizing;
|
|
81
68
|
var isActive = isRowSelected(index)(editorView.state.selection) || (hoveredRows || []).indexOf(index) !== -1 && !isResizing;
|
|
82
69
|
return [ClassName.NUMBERED_COLUMN_BUTTON, isActive ? ClassName.HOVERED_CELL_ACTIVE : '', isActive && isInDanger ? ClassName.HOVERED_CELL_IN_DANGER : ''].join(' ');
|
|
83
70
|
});
|
|
84
|
-
|
|
85
71
|
return _this;
|
|
86
72
|
}
|
|
87
|
-
|
|
88
73
|
_createClass(NumberColumn, [{
|
|
89
74
|
key: "render",
|
|
90
75
|
value: function render() {
|
|
91
76
|
var _this2 = this;
|
|
92
|
-
|
|
93
77
|
var _this$props4 = this.props,
|
|
94
|
-
|
|
95
|
-
|
|
78
|
+
tableRef = _this$props4.tableRef,
|
|
79
|
+
hasHeaderRow = _this$props4.hasHeaderRow;
|
|
96
80
|
var rowHeights = getRowHeights(tableRef);
|
|
97
81
|
return /*#__PURE__*/React.createElement("div", {
|
|
98
82
|
className: ClassName.NUMBERED_COLUMN,
|
|
@@ -120,8 +104,6 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
120
104
|
}));
|
|
121
105
|
}
|
|
122
106
|
}]);
|
|
123
|
-
|
|
124
107
|
return NumberColumn;
|
|
125
108
|
}(Component);
|
|
126
|
-
|
|
127
109
|
export { NumberColumn as default };
|
|
@@ -5,11 +5,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
import React, { Component } from 'react';
|
|
14
11
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
15
12
|
import { clearHoverSelection } from '../../../commands';
|
|
@@ -23,50 +20,38 @@ var messages = defineMessages({
|
|
|
23
20
|
description: 'A button on the left of each row that shows up when the table is in focus. Clicking on it will select the entire row.'
|
|
24
21
|
}
|
|
25
22
|
});
|
|
26
|
-
|
|
27
23
|
var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
28
24
|
_inherits(RowControlsComponent, _Component);
|
|
29
|
-
|
|
30
25
|
var _super = _createSuper(RowControlsComponent);
|
|
31
|
-
|
|
32
26
|
function RowControlsComponent() {
|
|
33
27
|
var _this;
|
|
34
|
-
|
|
35
28
|
_classCallCheck(this, RowControlsComponent);
|
|
36
|
-
|
|
37
29
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
30
|
args[_key] = arguments[_key];
|
|
39
31
|
}
|
|
40
|
-
|
|
41
32
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
|
-
|
|
43
33
|
_defineProperty(_assertThisInitialized(_this), "clearHoverSelection", function () {
|
|
44
34
|
var _this$props$editorVie = _this.props.editorView,
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
state = _this$props$editorVie.state,
|
|
36
|
+
dispatch = _this$props$editorVie.dispatch;
|
|
47
37
|
clearHoverSelection()(state, dispatch);
|
|
48
38
|
});
|
|
49
|
-
|
|
50
39
|
return _this;
|
|
51
40
|
}
|
|
52
|
-
|
|
53
41
|
_createClass(RowControlsComponent, [{
|
|
54
42
|
key: "render",
|
|
55
43
|
value: function render() {
|
|
56
44
|
var _this2 = this;
|
|
57
|
-
|
|
58
45
|
var _this$props = this.props,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
editorView = _this$props.editorView,
|
|
47
|
+
tableRef = _this$props.tableRef,
|
|
48
|
+
hoveredRows = _this$props.hoveredRows,
|
|
49
|
+
isInDanger = _this$props.isInDanger,
|
|
50
|
+
isResizing = _this$props.isResizing,
|
|
51
|
+
formatMessage = _this$props.intl.formatMessage;
|
|
66
52
|
if (!tableRef) {
|
|
67
53
|
return null;
|
|
68
54
|
}
|
|
69
|
-
|
|
70
55
|
var selection = editorView.state.selection;
|
|
71
56
|
var rowHeights = getRowHeights(tableRef);
|
|
72
57
|
var rowsParams = getRowsParams(rowHeights);
|
|
@@ -78,15 +63,13 @@ var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
|
78
63
|
className: ClassName.ROW_CONTROLS_INNER
|
|
79
64
|
}, rowsParams.map(function (_ref, index) {
|
|
80
65
|
var startIndex = _ref.startIndex,
|
|
81
|
-
|
|
82
|
-
|
|
66
|
+
endIndex = _ref.endIndex,
|
|
67
|
+
height = _ref.height;
|
|
83
68
|
// if previous row was header row, add its height to our margin
|
|
84
69
|
var marginTop = -1;
|
|
85
|
-
|
|
86
70
|
if (index === 1 && hasHeaderRow && _this2.props.stickyTop !== undefined) {
|
|
87
71
|
marginTop += rowHeights[index - 1] + tableToolbarSize;
|
|
88
72
|
}
|
|
89
|
-
|
|
90
73
|
var thisRowSticky = _this2.props.stickyTop !== undefined && index === 0 && hasHeaderRow;
|
|
91
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
92
75
|
className: "".concat(ClassName.ROW_CONTROLS_BUTTON_WRAP, " ").concat(getRowClassNames(startIndex, selection, hoveredRows, isInDanger, isResizing), " ").concat(thisRowSticky ? 'sticky' : ''),
|
|
@@ -116,8 +99,6 @@ var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
|
116
99
|
})));
|
|
117
100
|
}
|
|
118
101
|
}]);
|
|
119
|
-
|
|
120
102
|
return RowControlsComponent;
|
|
121
103
|
}(Component);
|
|
122
|
-
|
|
123
104
|
export var RowControls = injectIntl(RowControlsComponent);
|