@gravity-ui/dashkit 8.14.0 → 8.14.1

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.
@@ -362,7 +362,7 @@ class GridLayout extends react_1.default.PureComponent {
362
362
  // Group properties
363
363
  , Object.assign({}, properties, {
364
364
  // Layout props
365
- compactType: compactType, layout: layout, key: `group_${group}`, isDraggable: editMode, isResizable: editMode, draggableCancel: `.${constants_1.OVERLAY_CONTROLS_CLASS_NAME}` }, (draggableHandleClassName
365
+ compactType: compactType, layout: layout, key: `group_${group}`, isDraggable: editMode, isResizable: editMode, draggableCancel: `.${constants_1.DRAGGABLE_CANCEL_CLASS_NAME}` }, (draggableHandleClassName
366
366
  ? { draggableHandle: `.${draggableHandleClassName}` }
367
367
  : null), {
368
368
  // Default callbacks
@@ -105,7 +105,7 @@ class OverlayControls extends react_1.default.Component {
105
105
  const controls = hasCustomControlsWithWidgets
106
106
  ? this.getCustomControlsWithWidgets()
107
107
  : this.renderControls();
108
- return react_1.default.createElement("div", { className: b({ position }) }, controls);
108
+ return react_1.default.createElement("div", { className: b({ position }, [constants_1.DRAGGABLE_CANCEL_CLASS_NAME]) }, controls);
109
109
  }
110
110
  getDropDownMenuItemConfig(menuName, isDefaultMenu) {
111
111
  switch (menuName) {
@@ -203,7 +203,9 @@ class OverlayControls extends react_1.default.Component {
203
203
  return null;
204
204
  }
205
205
  return (react_1.default.createElement(uikit_1.DropdownMenu, { items: items, renderSwitcher: (props) => (react_1.default.createElement(uikit_1.Button, Object.assign({}, props, { view: view, size: size, pin: isOnlyOneItem ? 'round-round' : 'brick-round', qa: "dashkit-overlay-control-menu" }),
206
- react_1.default.createElement(uikit_1.Icon, { data: icons_1.Ellipsis, size: constants_1.OVERLAY_ICON_SIZE }))) }));
206
+ react_1.default.createElement(uikit_1.Icon, { data: icons_1.Ellipsis, size: constants_1.OVERLAY_ICON_SIZE }))), popupProps: {
207
+ contentClassName: constants_1.DRAGGABLE_CANCEL_CLASS_NAME,
208
+ } }));
207
209
  }
208
210
  getControlItemPinStyle(index, itemsLength) {
209
211
  const isOnlyOneItem = itemsLength === 1;
@@ -13,3 +13,4 @@ export declare const DEFAULT_WIDGET_HEIGHT = 3;
13
13
  export declare const DEFAULT_WIDGET_WIDTH = 3;
14
14
  export declare const DEFAULT_GROUP = "__default";
15
15
  export declare const COMPACT_TYPE_HORIZONTAL_NOWRAP = "horizontal-nowrap";
16
+ export declare const DRAGGABLE_CANCEL_CLASS_NAME = "dashkit_draggable_cancel";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMPACT_TYPE_HORIZONTAL_NOWRAP = exports.DEFAULT_GROUP = exports.DEFAULT_WIDGET_WIDTH = exports.DEFAULT_WIDGET_HEIGHT = exports.MenuItems = exports.TEMPORARY_ITEM_ID = exports.OVERLAY_ICON_SIZE = exports.OVERLAY_CLASS_NAME = exports.OVERLAY_CONTROLS_CLASS_NAME = exports.DEFAULT_NAMESPACE = exports.COPIED_WIDGET_STORE_KEY = void 0;
3
+ exports.DRAGGABLE_CANCEL_CLASS_NAME = exports.COMPACT_TYPE_HORIZONTAL_NOWRAP = exports.DEFAULT_GROUP = exports.DEFAULT_WIDGET_WIDTH = exports.DEFAULT_WIDGET_HEIGHT = exports.MenuItems = exports.TEMPORARY_ITEM_ID = exports.OVERLAY_ICON_SIZE = exports.OVERLAY_CLASS_NAME = exports.OVERLAY_CONTROLS_CLASS_NAME = exports.DEFAULT_NAMESPACE = exports.COPIED_WIDGET_STORE_KEY = void 0;
4
4
  exports.COPIED_WIDGET_STORE_KEY = 'dashCopiedItem';
5
5
  exports.DEFAULT_NAMESPACE = 'default';
6
6
  exports.OVERLAY_CONTROLS_CLASS_NAME = 'dashkit-overlay-controls';
@@ -16,3 +16,4 @@ exports.DEFAULT_WIDGET_HEIGHT = 3;
16
16
  exports.DEFAULT_WIDGET_WIDTH = 3;
17
17
  exports.DEFAULT_GROUP = '__default';
18
18
  exports.COMPACT_TYPE_HORIZONTAL_NOWRAP = 'horizontal-nowrap';
19
+ exports.DRAGGABLE_CANCEL_CLASS_NAME = 'dashkit_draggable_cancel';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { COMPACT_TYPE_HORIZONTAL_NOWRAP, DEFAULT_GROUP, OVERLAY_CONTROLS_CLASS_NAME, TEMPORARY_ITEM_ID, } from '../../constants';
2
+ import { COMPACT_TYPE_HORIZONTAL_NOWRAP, DEFAULT_GROUP, DRAGGABLE_CANCEL_CLASS_NAME, TEMPORARY_ITEM_ID, } from '../../constants';
3
3
  import { DashKitContext } from '../../context/DashKitContext';
4
4
  import { resolveLayoutGroup } from '../../utils';
5
5
  import GridItem from '../GridItem/GridItem';
@@ -359,7 +359,7 @@ class GridLayout extends React.PureComponent {
359
359
  // Group properties
360
360
  , Object.assign({}, properties, {
361
361
  // Layout props
362
- compactType: compactType, layout: layout, key: `group_${group}`, isDraggable: editMode, isResizable: editMode, draggableCancel: `.${OVERLAY_CONTROLS_CLASS_NAME}` }, (draggableHandleClassName
362
+ compactType: compactType, layout: layout, key: `group_${group}`, isDraggable: editMode, isResizable: editMode, draggableCancel: `.${DRAGGABLE_CANCEL_CLASS_NAME}` }, (draggableHandleClassName
363
363
  ? { draggableHandle: `.${draggableHandleClassName}` }
364
364
  : null), {
365
365
  // Default callbacks
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Ellipsis, Gear, Xmark } from '@gravity-ui/icons';
3
3
  import { Button, DropdownMenu, Icon, } from '@gravity-ui/uikit';
4
4
  import noop from 'lodash/noop';
5
- import { COPIED_WIDGET_STORE_KEY, MenuItems, OVERLAY_CONTROLS_CLASS_NAME, OVERLAY_ICON_SIZE, } from '../../constants';
5
+ import { COPIED_WIDGET_STORE_KEY, DRAGGABLE_CANCEL_CLASS_NAME, MenuItems, OVERLAY_CONTROLS_CLASS_NAME, OVERLAY_ICON_SIZE, } from '../../constants';
6
6
  import { DashkitOvelayControlsContext } from '../../context/DashKitContext';
7
7
  import { i18n } from '../../i18n';
8
8
  import { cn } from '../../utils/cn';
@@ -102,7 +102,7 @@ class OverlayControls extends React.Component {
102
102
  const controls = hasCustomControlsWithWidgets
103
103
  ? this.getCustomControlsWithWidgets()
104
104
  : this.renderControls();
105
- return React.createElement("div", { className: b({ position }) }, controls);
105
+ return React.createElement("div", { className: b({ position }, [DRAGGABLE_CANCEL_CLASS_NAME]) }, controls);
106
106
  }
107
107
  getDropDownMenuItemConfig(menuName, isDefaultMenu) {
108
108
  switch (menuName) {
@@ -200,7 +200,9 @@ class OverlayControls extends React.Component {
200
200
  return null;
201
201
  }
202
202
  return (React.createElement(DropdownMenu, { items: items, renderSwitcher: (props) => (React.createElement(Button, Object.assign({}, props, { view: view, size: size, pin: isOnlyOneItem ? 'round-round' : 'brick-round', qa: "dashkit-overlay-control-menu" }),
203
- React.createElement(Icon, { data: Ellipsis, size: OVERLAY_ICON_SIZE }))) }));
203
+ React.createElement(Icon, { data: Ellipsis, size: OVERLAY_ICON_SIZE }))), popupProps: {
204
+ contentClassName: DRAGGABLE_CANCEL_CLASS_NAME,
205
+ } }));
204
206
  }
205
207
  getControlItemPinStyle(index, itemsLength) {
206
208
  const isOnlyOneItem = itemsLength === 1;
@@ -13,3 +13,4 @@ export declare const DEFAULT_WIDGET_HEIGHT = 3;
13
13
  export declare const DEFAULT_WIDGET_WIDTH = 3;
14
14
  export declare const DEFAULT_GROUP = "__default";
15
15
  export declare const COMPACT_TYPE_HORIZONTAL_NOWRAP = "horizontal-nowrap";
16
+ export declare const DRAGGABLE_CANCEL_CLASS_NAME = "dashkit_draggable_cancel";
@@ -13,3 +13,4 @@ export const DEFAULT_WIDGET_HEIGHT = 3;
13
13
  export const DEFAULT_WIDGET_WIDTH = 3;
14
14
  export const DEFAULT_GROUP = '__default';
15
15
  export const COMPACT_TYPE_HORIZONTAL_NOWRAP = 'horizontal-nowrap';
16
+ export const DRAGGABLE_CANCEL_CLASS_NAME = 'dashkit_draggable_cancel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dashkit",
3
- "version": "8.14.0",
3
+ "version": "8.14.1",
4
4
  "description": "Library for rendering dashboard grid layout",
5
5
  "license": "MIT",
6
6
  "repository": {