@gravity-ui/dashkit 3.4.0 → 4.0.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/CHANGELOG.md +20 -0
- package/README.md +1 -2
- package/build/cjs/components/GridItem/GridItem.js +3 -2
- package/build/cjs/components/GridLayout/GridLayout.js +1 -1
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/plugins/Text/Text.d.ts +4 -4
- package/build/cjs/plugins/Text/index.d.ts +2 -0
- package/build/cjs/plugins/Text/index.js +7 -0
- package/build/cjs/plugins/Title/index.d.ts +2 -0
- package/build/cjs/plugins/Title/index.js +7 -0
- package/build/cjs/plugins/index.d.ts +2 -0
- package/build/cjs/plugins/index.js +5 -0
- package/build/esm/components/GridItem/GridItem.js +3 -2
- package/build/esm/components/GridLayout/GridLayout.js +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/plugins/Text/Text.d.ts +4 -4
- package/build/esm/plugins/Text/index.d.ts +2 -0
- package/build/esm/plugins/Text/index.js +2 -0
- package/build/esm/plugins/Title/index.d.ts +2 -0
- package/build/esm/plugins/Title/index.js +2 -0
- package/build/esm/plugins/index.d.ts +2 -0
- package/build/esm/plugins/index.js +2 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.0.0](https://github.com/gravity-ui/dashkit/compare/v3.5.0...v4.0.0) (2022-12-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* rename types in plugin Text ([#33](https://github.com/gravity-ui/dashkit/issues/33))
|
|
9
|
+
* change grid item forward ref behavior
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* rename types in plugin Text ([#33](https://github.com/gravity-ui/dashkit/issues/33)) ([c55917f](https://github.com/gravity-ui/dashkit/commit/c55917f918a4592c680e4e3bf3173fb53514b185))
|
|
14
|
+
* update react-grid-layout major release ([#31](https://github.com/gravity-ui/dashkit/issues/31)) ([e31ff70](https://github.com/gravity-ui/dashkit/commit/e31ff707f48038435a63d95ad34b8685c39fb1ba))
|
|
15
|
+
|
|
16
|
+
## [3.5.0](https://github.com/gravity-ui/dashkit/compare/v3.4.0...v3.5.0) (2022-12-19)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* export plugins ([#29](https://github.com/gravity-ui/dashkit/issues/29)) ([d589546](https://github.com/gravity-ui/dashkit/commit/d5895469e9917f4c5f43aaf5802b5d8a865bd185))
|
|
22
|
+
|
|
3
23
|
## [3.4.0](https://github.com/gravity-ui/dashkit/compare/v3.3.0...v3.4.0) (2022-11-16)
|
|
4
24
|
|
|
5
25
|
|
package/README.md
CHANGED
|
@@ -95,8 +95,7 @@ Before using `DashKit` as a react component, it must be configured.
|
|
|
95
95
|
|
|
96
96
|
```js
|
|
97
97
|
import {DashKit} from '@gravity-ui/dashkit';
|
|
98
|
-
import pluginTitle from '@gravity-ui/dashkit
|
|
99
|
-
import pluginText from '@gravity-ui/dashkit/build/esm/plugins/Text/Text';
|
|
98
|
+
import {pluginTitle, pluginText} from '@gravity-ui/dashkit';
|
|
100
99
|
|
|
101
100
|
DashKit.registerPlugins(
|
|
102
101
|
pluginTitle,
|
|
@@ -40,7 +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
|
-
}, preparedClassName), "data-qa": "dashkit-grid-item", style: style }, reactGridLayoutProps),
|
|
43
|
+
}, preparedClassName), "data-qa": "dashkit-grid-item", style: style, ref: this.props.forwardedRef }, reactGridLayoutProps),
|
|
44
44
|
react_1.default.createElement("div", { className: b('item', { editMode: editMode && !_editActive && !noOverlay }) },
|
|
45
45
|
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 })),
|
|
46
46
|
!noOverlay && this.renderOverlay(),
|
|
@@ -54,6 +54,7 @@ GridItem.propTypes = {
|
|
|
54
54
|
isDragging: prop_types_1.default.bool,
|
|
55
55
|
layout: prop_types_1.default.array,
|
|
56
56
|
overlayControls: prop_types_1.default.object,
|
|
57
|
+
forwardedRef: prop_types_1.default.any,
|
|
57
58
|
forwardedPluginRef: prop_types_1.default.any,
|
|
58
59
|
// from react-grid-layout:
|
|
59
60
|
children: prop_types_1.default.node,
|
|
@@ -68,5 +69,5 @@ GridItem.propTypes = {
|
|
|
68
69
|
};
|
|
69
70
|
GridItem.contextType = DashKitContext_1.DashKitContext;
|
|
70
71
|
exports.default = react_1.default.forwardRef((props, ref) => {
|
|
71
|
-
return react_1.default.createElement(GridItem, Object.assign({}, props, {
|
|
72
|
+
return react_1.default.createElement(GridItem, Object.assign({}, props, { forwardedRef: ref }));
|
|
72
73
|
});
|
|
@@ -76,7 +76,7 @@ class GridLayout extends react_1.default.PureComponent {
|
|
|
76
76
|
return (react_1.default.createElement(Layout, Object.assign({}, registerManager.gridLayout, { layout: layout, isDraggable: editMode, isResizable: editMode, onDragStart: this._onStart, onDragStop: this._onStop, onResizeStart: this._onStart, onResizeStop: this._onStop }, (draggableHandleClassName
|
|
77
77
|
? { draggableHandle: `.${draggableHandleClassName}` }
|
|
78
78
|
: null)), config.items.map((item, i) => {
|
|
79
|
-
return (react_1.default.createElement(GridItem_1.default, {
|
|
79
|
+
return (react_1.default.createElement(GridItem_1.default, { forwardedPluginRef: (pluginRef) => {
|
|
80
80
|
this.pluginsRefs[i] = pluginRef;
|
|
81
81
|
}, key: item.id, id: item.id, item: item, layout: layout, adjustWidgetLayout: this.adjustWidgetLayout, isDragging: this.state.isDragging, noOverlay: noOverlay, withCustomHandle: Boolean(draggableHandleClassName), overlayControls: this.props.overlayControls }));
|
|
82
82
|
})));
|
package/build/cjs/index.d.ts
CHANGED
package/build/cjs/index.js
CHANGED
|
@@ -41,12 +41,12 @@ export declare class PluginText extends React.PureComponent<PluginTextProps, Plu
|
|
|
41
41
|
get withMarkdown(): boolean;
|
|
42
42
|
}
|
|
43
43
|
declare type PluginDataProps = Omit<PluginTextProps, 'apiHandler'>;
|
|
44
|
-
export declare type
|
|
44
|
+
export declare type PluginTextObjectSettings = {
|
|
45
45
|
apiHandler?: PluginTextApiHandler;
|
|
46
46
|
};
|
|
47
|
-
export declare type
|
|
48
|
-
setSettings: (settings:
|
|
47
|
+
export declare type PluginTextObject = Plugin<PluginDataProps> & {
|
|
48
|
+
setSettings: (settings: PluginTextObjectSettings) => PluginTextObject;
|
|
49
49
|
_apiHandler?: PluginTextApiHandler;
|
|
50
50
|
};
|
|
51
|
-
declare const plugin:
|
|
51
|
+
declare const plugin: PluginTextObject;
|
|
52
52
|
export default plugin;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pluginText = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./Text"), exports);
|
|
6
|
+
var Text_1 = require("./Text");
|
|
7
|
+
Object.defineProperty(exports, "pluginText", { enumerable: true, get: function () { return tslib_1.__importDefault(Text_1).default; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pluginTitle = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./Title"), exports);
|
|
6
|
+
var Title_1 = require("./Title");
|
|
7
|
+
Object.defineProperty(exports, "pluginTitle", { enumerable: true, get: function () { return tslib_1.__importDefault(Title_1).default; } });
|
|
@@ -38,7 +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
|
-
}, preparedClassName), "data-qa": "dashkit-grid-item", style: style }, reactGridLayoutProps),
|
|
41
|
+
}, preparedClassName), "data-qa": "dashkit-grid-item", style: style, ref: this.props.forwardedRef }, reactGridLayoutProps),
|
|
42
42
|
React.createElement("div", { className: b('item', { editMode: editMode && !_editActive && !noOverlay }) },
|
|
43
43
|
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 })),
|
|
44
44
|
!noOverlay && this.renderOverlay(),
|
|
@@ -52,6 +52,7 @@ GridItem.propTypes = {
|
|
|
52
52
|
isDragging: PropTypes.bool,
|
|
53
53
|
layout: PropTypes.array,
|
|
54
54
|
overlayControls: PropTypes.object,
|
|
55
|
+
forwardedRef: PropTypes.any,
|
|
55
56
|
forwardedPluginRef: PropTypes.any,
|
|
56
57
|
// from react-grid-layout:
|
|
57
58
|
children: PropTypes.node,
|
|
@@ -66,5 +67,5 @@ GridItem.propTypes = {
|
|
|
66
67
|
};
|
|
67
68
|
GridItem.contextType = DashKitContext;
|
|
68
69
|
export default React.forwardRef((props, ref) => {
|
|
69
|
-
return React.createElement(GridItem, Object.assign({}, props, {
|
|
70
|
+
return React.createElement(GridItem, Object.assign({}, props, { forwardedRef: ref }));
|
|
70
71
|
});
|
|
@@ -73,7 +73,7 @@ export default class GridLayout extends React.PureComponent {
|
|
|
73
73
|
return (React.createElement(Layout, Object.assign({}, registerManager.gridLayout, { layout: layout, isDraggable: editMode, isResizable: editMode, onDragStart: this._onStart, onDragStop: this._onStop, onResizeStart: this._onStart, onResizeStop: this._onStop }, (draggableHandleClassName
|
|
74
74
|
? { draggableHandle: `.${draggableHandleClassName}` }
|
|
75
75
|
: null)), config.items.map((item, i) => {
|
|
76
|
-
return (React.createElement(GridItem, {
|
|
76
|
+
return (React.createElement(GridItem, { forwardedPluginRef: (pluginRef) => {
|
|
77
77
|
this.pluginsRefs[i] = pluginRef;
|
|
78
78
|
}, key: item.id, id: item.id, item: item, layout: layout, adjustWidgetLayout: this.adjustWidgetLayout, isDragging: this.state.isDragging, noOverlay: noOverlay, withCustomHandle: Boolean(draggableHandleClassName), overlayControls: this.props.overlayControls }));
|
|
79
79
|
})));
|
package/build/esm/index.d.ts
CHANGED
package/build/esm/index.js
CHANGED
|
@@ -42,12 +42,12 @@ export declare class PluginText extends React.PureComponent<PluginTextProps, Plu
|
|
|
42
42
|
get withMarkdown(): boolean;
|
|
43
43
|
}
|
|
44
44
|
declare type PluginDataProps = Omit<PluginTextProps, 'apiHandler'>;
|
|
45
|
-
export declare type
|
|
45
|
+
export declare type PluginTextObjectSettings = {
|
|
46
46
|
apiHandler?: PluginTextApiHandler;
|
|
47
47
|
};
|
|
48
|
-
export declare type
|
|
49
|
-
setSettings: (settings:
|
|
48
|
+
export declare type PluginTextObject = Plugin<PluginDataProps> & {
|
|
49
|
+
setSettings: (settings: PluginTextObjectSettings) => PluginTextObject;
|
|
50
50
|
_apiHandler?: PluginTextApiHandler;
|
|
51
51
|
};
|
|
52
|
-
declare const plugin:
|
|
52
|
+
declare const plugin: PluginTextObject;
|
|
53
53
|
export default plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/dashkit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Library for rendering dashboard grid layout",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"prepublishOnly": "npm run lint && npm run test && npm run build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@gravity-ui/i18n": "^1.0.0",
|
|
38
39
|
"hashids": "^2.2.8",
|
|
39
40
|
"immutability-helper": "^3.1.1",
|
|
40
|
-
"react-grid-layout": "^
|
|
41
|
-
"@gravity-ui/i18n": "^1.0.0"
|
|
41
|
+
"react-grid-layout": "^1.3.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@gravity-ui/uikit": "^3.0.0",
|