@gravity-ui/dashkit 6.2.1 → 6.4.0
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/build/cjs/components/ActionPanel/ActionPanel.d.ts +1 -0
- package/build/cjs/components/ActionPanel/ActionPanel.js +1 -1
- package/build/cjs/components/DashKit/DashKit.d.ts +4 -3
- package/build/cjs/components/DashKit/DashKit.js +1 -0
- package/build/cjs/components/GridItem/GridItem.css +3 -0
- package/build/cjs/components/GridItem/GridItem.js +2 -1
- package/build/cjs/hocs/withContext.js +2 -0
- package/build/esm/components/ActionPanel/ActionPanel.d.ts +1 -0
- package/build/esm/components/ActionPanel/ActionPanel.js +1 -1
- package/build/esm/components/DashKit/DashKit.d.ts +4 -3
- package/build/esm/components/DashKit/DashKit.js +1 -0
- package/build/esm/components/GridItem/GridItem.css +3 -0
- package/build/esm/components/GridItem/GridItem.js +2 -1
- package/build/esm/hocs/withContext.js +2 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ const cn_1 = require("../../utils/cn");
|
|
|
7
7
|
const b = (0, cn_1.cn)('dashkit-action-panel');
|
|
8
8
|
const ActionPanel = (props) => {
|
|
9
9
|
return (react_1.default.createElement("div", { className: b(null, props.className) }, props.items.map((item) => {
|
|
10
|
-
return (react_1.default.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick },
|
|
10
|
+
return (react_1.default.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick, "data-qa": item.qa },
|
|
11
11
|
react_1.default.createElement("div", { className: b('icon') }, item.icon),
|
|
12
12
|
react_1.default.createElement("div", { className: b('title'), title: item.title }, item.title)));
|
|
13
13
|
})));
|
|
@@ -6,6 +6,8 @@ import { OverlayControlItem } from '../OverlayControls/OverlayControls';
|
|
|
6
6
|
interface DashKitGeneralProps {
|
|
7
7
|
config: Config;
|
|
8
8
|
editMode: boolean;
|
|
9
|
+
draggableHandleClassName?: string;
|
|
10
|
+
overlayControls?: Record<string, OverlayControlItem[]>;
|
|
9
11
|
}
|
|
10
12
|
interface DashKitDefaultProps {
|
|
11
13
|
onItemEdit: (item: ConfigItem) => void;
|
|
@@ -18,9 +20,8 @@ interface DashKitDefaultProps {
|
|
|
18
20
|
itemsStateAndParams: ItemsStateAndParams;
|
|
19
21
|
settings: SettingsProps;
|
|
20
22
|
context: ContextProps;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
draggableHandleClassName?: string;
|
|
23
|
+
noOverlay: boolean;
|
|
24
|
+
_experimentDisableItemAnimation: boolean;
|
|
24
25
|
}
|
|
25
26
|
export interface DashKitProps extends DashKitGeneralProps, Partial<DashKitDefaultProps> {
|
|
26
27
|
}
|
|
@@ -25,7 +25,7 @@ class GridItem extends react_1.default.PureComponent {
|
|
|
25
25
|
// из-за бага, что Grid Items unmounts при изменении static, isDraggable, isResaizable
|
|
26
26
|
// https://github.com/STRML/react-grid-layout/issues/721
|
|
27
27
|
const { style, onMouseDown, onMouseUp, onTouchEnd, onTouchStart, children, className, isDragging, noOverlay, withCustomHandle, } = this.props;
|
|
28
|
-
const { editMode } = this.context;
|
|
28
|
+
const { editMode, _experimentDisableItemAnimation } = this.context;
|
|
29
29
|
const width = Number.parseInt(style.width, 10);
|
|
30
30
|
const height = Number.parseInt(style.height, 10);
|
|
31
31
|
const transform = style.transform;
|
|
@@ -40,6 +40,7 @@ class GridItem extends react_1.default.PureComponent {
|
|
|
40
40
|
return (react_1.default.createElement("div", Object.assign({ className: b({
|
|
41
41
|
'is-dragging': isDragging,
|
|
42
42
|
'with-custom-handle': withCustomHandle,
|
|
43
|
+
'disable-animation': _experimentDisableItemAnimation,
|
|
43
44
|
}, preparedClassName), "data-qa": "dashkit-grid-item", style: style, ref: this.props.forwardedRef }, reactGridLayoutProps),
|
|
44
45
|
react_1.default.createElement("div", { className: b('item', { editMode: editMode && !_editActive && !noOverlay }) },
|
|
45
46
|
react_1.default.createElement(Item_1.default, { id: this.props.id, item: this.props.item, shouldItemUpdate: !isDragging, width: width, height: height, transform: transform, adjustWidgetLayout: this.props.adjustWidgetLayout, layout: this.props.layout, forwardedPluginRef: this.props.forwardedPluginRef })),
|
|
@@ -145,6 +145,7 @@ function useMemoStateContext(props) {
|
|
|
145
145
|
revertToOriginalLayout,
|
|
146
146
|
forwardedMetaRef: props.forwardedMetaRef,
|
|
147
147
|
draggableHandleClassName: props.draggableHandleClassName,
|
|
148
|
+
_experimentDisableItemAnimation: props._experimentDisableItemAnimation,
|
|
148
149
|
}), [
|
|
149
150
|
resultLayout,
|
|
150
151
|
props.config,
|
|
@@ -166,6 +167,7 @@ function useMemoStateContext(props) {
|
|
|
166
167
|
revertToOriginalLayout,
|
|
167
168
|
props.forwardedMetaRef,
|
|
168
169
|
props.draggableHandleClassName,
|
|
170
|
+
props._experimentDisableItemAnimation,
|
|
169
171
|
]);
|
|
170
172
|
}
|
|
171
173
|
function withContext(Component) {
|
|
@@ -4,7 +4,7 @@ import './ActionPanel.css';
|
|
|
4
4
|
const b = cn('dashkit-action-panel');
|
|
5
5
|
export const ActionPanel = (props) => {
|
|
6
6
|
return (React.createElement("div", { className: b(null, props.className) }, props.items.map((item) => {
|
|
7
|
-
return (React.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick },
|
|
7
|
+
return (React.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick, "data-qa": item.qa },
|
|
8
8
|
React.createElement("div", { className: b('icon') }, item.icon),
|
|
9
9
|
React.createElement("div", { className: b('title'), title: item.title }, item.title)));
|
|
10
10
|
})));
|
|
@@ -6,6 +6,8 @@ import { OverlayControlItem } from '../OverlayControls/OverlayControls';
|
|
|
6
6
|
interface DashKitGeneralProps {
|
|
7
7
|
config: Config;
|
|
8
8
|
editMode: boolean;
|
|
9
|
+
draggableHandleClassName?: string;
|
|
10
|
+
overlayControls?: Record<string, OverlayControlItem[]>;
|
|
9
11
|
}
|
|
10
12
|
interface DashKitDefaultProps {
|
|
11
13
|
onItemEdit: (item: ConfigItem) => void;
|
|
@@ -18,9 +20,8 @@ interface DashKitDefaultProps {
|
|
|
18
20
|
itemsStateAndParams: ItemsStateAndParams;
|
|
19
21
|
settings: SettingsProps;
|
|
20
22
|
context: ContextProps;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
draggableHandleClassName?: string;
|
|
23
|
+
noOverlay: boolean;
|
|
24
|
+
_experimentDisableItemAnimation: boolean;
|
|
24
25
|
}
|
|
25
26
|
export interface DashKitProps extends DashKitGeneralProps, Partial<DashKitDefaultProps> {
|
|
26
27
|
}
|
|
@@ -23,7 +23,7 @@ class GridItem extends React.PureComponent {
|
|
|
23
23
|
// из-за бага, что Grid Items unmounts при изменении static, isDraggable, isResaizable
|
|
24
24
|
// https://github.com/STRML/react-grid-layout/issues/721
|
|
25
25
|
const { style, onMouseDown, onMouseUp, onTouchEnd, onTouchStart, children, className, isDragging, noOverlay, withCustomHandle, } = this.props;
|
|
26
|
-
const { editMode } = this.context;
|
|
26
|
+
const { editMode, _experimentDisableItemAnimation } = this.context;
|
|
27
27
|
const width = Number.parseInt(style.width, 10);
|
|
28
28
|
const height = Number.parseInt(style.height, 10);
|
|
29
29
|
const transform = style.transform;
|
|
@@ -38,6 +38,7 @@ class GridItem extends React.PureComponent {
|
|
|
38
38
|
return (React.createElement("div", Object.assign({ className: b({
|
|
39
39
|
'is-dragging': isDragging,
|
|
40
40
|
'with-custom-handle': withCustomHandle,
|
|
41
|
+
'disable-animation': _experimentDisableItemAnimation,
|
|
41
42
|
}, preparedClassName), "data-qa": "dashkit-grid-item", style: style, ref: this.props.forwardedRef }, reactGridLayoutProps),
|
|
42
43
|
React.createElement("div", { className: b('item', { editMode: editMode && !_editActive && !noOverlay }) },
|
|
43
44
|
React.createElement(Item, { id: this.props.id, item: this.props.item, shouldItemUpdate: !isDragging, width: width, height: height, transform: transform, adjustWidgetLayout: this.props.adjustWidgetLayout, layout: this.props.layout, forwardedPluginRef: this.props.forwardedPluginRef })),
|
|
@@ -141,6 +141,7 @@ function useMemoStateContext(props) {
|
|
|
141
141
|
revertToOriginalLayout,
|
|
142
142
|
forwardedMetaRef: props.forwardedMetaRef,
|
|
143
143
|
draggableHandleClassName: props.draggableHandleClassName,
|
|
144
|
+
_experimentDisableItemAnimation: props._experimentDisableItemAnimation,
|
|
144
145
|
}), [
|
|
145
146
|
resultLayout,
|
|
146
147
|
props.config,
|
|
@@ -162,6 +163,7 @@ function useMemoStateContext(props) {
|
|
|
162
163
|
revertToOriginalLayout,
|
|
163
164
|
props.forwardedMetaRef,
|
|
164
165
|
props.draggableHandleClassName,
|
|
166
|
+
props._experimentDisableItemAnimation,
|
|
165
167
|
]);
|
|
166
168
|
}
|
|
167
169
|
export function withContext(Component) {
|