@gravity-ui/dashkit 8.3.0-beta.1 → 8.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/DashKit/DashKit.d.ts +3 -3
- package/build/cjs/components/GridLayout/ReactGridLayout.js +8 -2
- package/build/cjs/typings/config.d.ts +1 -1
- package/build/esm/components/DashKit/DashKit.d.ts +3 -3
- package/build/esm/components/GridLayout/ReactGridLayout.js +8 -2
- package/build/esm/typings/config.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Config, ConfigItem, GlobalParams, ItemDropProps, ItemsStateAndParams } from '../../shared';
|
|
3
|
-
import { ContextProps,
|
|
3
|
+
import { ContextProps, DashKitGroup, Plugin, SetConfigItem, SetNewItemOptions, Settings, SettingsProps } from '../../typings';
|
|
4
4
|
import GridLayout from '../GridLayout/GridLayout';
|
|
5
5
|
import { OverlayControlItem } from '../OverlayControls/OverlayControls';
|
|
6
6
|
interface DashKitGeneralProps {
|
|
@@ -14,7 +14,7 @@ interface DashKitDefaultProps {
|
|
|
14
14
|
onChange: (data: {
|
|
15
15
|
config: Config;
|
|
16
16
|
itemsStateAndParams: ItemsStateAndParams;
|
|
17
|
-
groups?:
|
|
17
|
+
groups?: DashKitGroup[];
|
|
18
18
|
}) => void;
|
|
19
19
|
onDrop: (dropProps: ItemDropProps) => void;
|
|
20
20
|
defaultGlobalParams: GlobalParams;
|
|
@@ -24,7 +24,7 @@ interface DashKitDefaultProps {
|
|
|
24
24
|
context: ContextProps;
|
|
25
25
|
noOverlay: boolean;
|
|
26
26
|
focusable?: boolean;
|
|
27
|
-
groups?:
|
|
27
|
+
groups?: DashKitGroup[];
|
|
28
28
|
}
|
|
29
29
|
export interface DashKitProps extends DashKitGeneralProps, Partial<DashKitDefaultProps> {
|
|
30
30
|
}
|
|
@@ -24,9 +24,9 @@ class DragOverLayout extends react_grid_layout_1.default {
|
|
|
24
24
|
this.dragReset();
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
this.parentOnDrag = this.onDrag;
|
|
28
28
|
this.onDrag = (i, x, y, sintE) => {
|
|
29
|
-
|
|
29
|
+
this.parentOnDrag(i, x, y, sintE);
|
|
30
30
|
this.mouseLeaveHandler(sintE.e);
|
|
31
31
|
};
|
|
32
32
|
}
|
|
@@ -38,6 +38,12 @@ class DragOverLayout extends react_grid_layout_1.default {
|
|
|
38
38
|
componentWillUnmount() {
|
|
39
39
|
window.removeEventListener('dragend', this.dragReset);
|
|
40
40
|
}
|
|
41
|
+
containerHeight() {
|
|
42
|
+
if (this.props.autoSize && this.state.layout.length === 0) {
|
|
43
|
+
return 'unset';
|
|
44
|
+
}
|
|
45
|
+
return super.containerHeight();
|
|
46
|
+
}
|
|
41
47
|
processGridItem(child, isDroppingItem) {
|
|
42
48
|
var _a;
|
|
43
49
|
const gridItem = (_a = super.processGridItem) === null || _a === void 0 ? void 0 : _a.call(this, child, isDroppingItem);
|
|
@@ -18,7 +18,7 @@ export interface DashkitGroupRenderProps {
|
|
|
18
18
|
items: ConfigItem[];
|
|
19
19
|
layout: ConfigLayout[];
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface DashKitGroup {
|
|
22
22
|
id?: string;
|
|
23
23
|
render?: (id: string, children: React.ReactNode, props: DashkitGroupRenderProps) => React.ReactNode;
|
|
24
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Config, ConfigItem, GlobalParams, ItemDropProps, ItemsStateAndParams } from '../../shared';
|
|
3
|
-
import { ContextProps,
|
|
3
|
+
import { ContextProps, DashKitGroup, Plugin, SetConfigItem, SetNewItemOptions, Settings, SettingsProps } from '../../typings';
|
|
4
4
|
import GridLayout from '../GridLayout/GridLayout';
|
|
5
5
|
import { OverlayControlItem } from '../OverlayControls/OverlayControls';
|
|
6
6
|
interface DashKitGeneralProps {
|
|
@@ -14,7 +14,7 @@ interface DashKitDefaultProps {
|
|
|
14
14
|
onChange: (data: {
|
|
15
15
|
config: Config;
|
|
16
16
|
itemsStateAndParams: ItemsStateAndParams;
|
|
17
|
-
groups?:
|
|
17
|
+
groups?: DashKitGroup[];
|
|
18
18
|
}) => void;
|
|
19
19
|
onDrop: (dropProps: ItemDropProps) => void;
|
|
20
20
|
defaultGlobalParams: GlobalParams;
|
|
@@ -24,7 +24,7 @@ interface DashKitDefaultProps {
|
|
|
24
24
|
context: ContextProps;
|
|
25
25
|
noOverlay: boolean;
|
|
26
26
|
focusable?: boolean;
|
|
27
|
-
groups?:
|
|
27
|
+
groups?: DashKitGroup[];
|
|
28
28
|
}
|
|
29
29
|
export interface DashKitProps extends DashKitGeneralProps, Partial<DashKitDefaultProps> {
|
|
30
30
|
}
|
|
@@ -20,9 +20,9 @@ class DragOverLayout extends ReactGridLayout {
|
|
|
20
20
|
this.dragReset();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
this.parentOnDrag = this.onDrag;
|
|
24
24
|
this.onDrag = (i, x, y, sintE) => {
|
|
25
|
-
|
|
25
|
+
this.parentOnDrag(i, x, y, sintE);
|
|
26
26
|
this.mouseLeaveHandler(sintE.e);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
@@ -34,6 +34,12 @@ class DragOverLayout extends ReactGridLayout {
|
|
|
34
34
|
componentWillUnmount() {
|
|
35
35
|
window.removeEventListener('dragend', this.dragReset);
|
|
36
36
|
}
|
|
37
|
+
containerHeight() {
|
|
38
|
+
if (this.props.autoSize && this.state.layout.length === 0) {
|
|
39
|
+
return 'unset';
|
|
40
|
+
}
|
|
41
|
+
return super.containerHeight();
|
|
42
|
+
}
|
|
37
43
|
processGridItem(child, isDroppingItem) {
|
|
38
44
|
var _a;
|
|
39
45
|
const gridItem = (_a = super.processGridItem) === null || _a === void 0 ? void 0 : _a.call(this, child, isDroppingItem);
|
|
@@ -18,7 +18,7 @@ export interface DashkitGroupRenderProps {
|
|
|
18
18
|
items: ConfigItem[];
|
|
19
19
|
layout: ConfigLayout[];
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface DashKitGroup {
|
|
22
22
|
id?: string;
|
|
23
23
|
render?: (id: string, children: React.ReactNode, props: DashkitGroupRenderProps) => React.ReactNode;
|
|
24
24
|
}
|