@gravity-ui/dashkit 6.0.0-beta.2 → 6.1.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/DashKitView/DashKitView.js +2 -2
- package/build/cjs/components/GridItem/GridItem.js +2 -2
- package/build/cjs/components/Item/Item.js +2 -2
- package/build/cjs/components/MobileLayout/MobileLayout.js +2 -2
- package/build/cjs/components/OverlayControls/OverlayControls.js +2 -2
- package/build/cjs/components/index.d.ts +0 -2
- package/build/cjs/components/index.js +0 -3
- package/build/cjs/plugins/Text/Text.js +2 -2
- package/build/cjs/plugins/Title/Title.js +2 -2
- package/build/cjs/utils/cn.d.ts +1 -0
- package/build/cjs/utils/cn.js +5 -0
- package/build/esm/components/DashKitView/DashKitView.js +2 -2
- package/build/esm/components/GridItem/GridItem.js +2 -2
- package/build/esm/components/Item/Item.js +2 -2
- package/build/esm/components/MobileLayout/MobileLayout.js +2 -2
- package/build/esm/components/OverlayControls/OverlayControls.js +2 -2
- package/build/esm/components/index.d.ts +0 -2
- package/build/esm/components/index.js +0 -1
- package/build/esm/plugins/Text/Text.js +2 -2
- package/build/esm/plugins/Title/Title.js +2 -2
- package/build/esm/utils/cn.d.ts +1 -0
- package/build/esm/utils/cn.js +2 -0
- package/package.json +5 -5
- package/build/cjs/components/ActionsToolbar/ActionsToolbar.css +0 -26
- package/build/cjs/components/ActionsToolbar/ActionsToolbar.d.ts +0 -13
- package/build/cjs/components/ActionsToolbar/ActionsToolbar.js +0 -17
- package/build/esm/components/ActionsToolbar/ActionsToolbar.css +0 -26
- package/build/esm/components/ActionsToolbar/ActionsToolbar.d.ts +0 -14
- package/build/esm/components/ActionsToolbar/ActionsToolbar.js +0 -13
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
6
5
|
const DashKitContext_1 = require("../../context/DashKitContext");
|
|
7
6
|
const GridLayout_1 = tslib_1.__importDefault(require("../GridLayout/GridLayout"));
|
|
8
7
|
const MobileLayout_1 = tslib_1.__importDefault(require("../MobileLayout/MobileLayout"));
|
|
9
8
|
const withContext_1 = require("../../hocs/withContext");
|
|
10
9
|
const useCalcLayout_1 = require("../../hooks/useCalcLayout");
|
|
11
|
-
const
|
|
10
|
+
const cn_1 = require("../../utils/cn");
|
|
11
|
+
const b = (0, cn_1.cn)('dashkit');
|
|
12
12
|
function DashKitView(props) {
|
|
13
13
|
const context = react_1.default.useContext(DashKitContext_1.DashKitContext);
|
|
14
14
|
const { registerManager, forwardedMetaRef } = context;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const prop_types_1 = tslib_1.__importDefault(require("prop-types"));
|
|
6
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
7
6
|
const Item_1 = tslib_1.__importDefault(require("../Item/Item"));
|
|
8
7
|
const DashKitContext_1 = require("../../context/DashKitContext");
|
|
8
|
+
const cn_1 = require("../../utils/cn");
|
|
9
9
|
const OverlayControls_1 = tslib_1.__importDefault(require("../OverlayControls/OverlayControls"));
|
|
10
|
-
const b = (0,
|
|
10
|
+
const b = (0, cn_1.cn)('dashkit-grid-item');
|
|
11
11
|
class GridItem extends react_1.default.PureComponent {
|
|
12
12
|
renderOverlay() {
|
|
13
13
|
const { overlayControls } = this.props;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
6
5
|
const prop_types_1 = tslib_1.__importDefault(require("prop-types"));
|
|
7
6
|
const prepareItem_1 = require("../../hocs/prepareItem");
|
|
8
|
-
const
|
|
7
|
+
const cn_1 = require("../../utils/cn");
|
|
8
|
+
const b = (0, cn_1.cn)('dashkit-item');
|
|
9
9
|
// TODO: getDerivedStateFromError и заглушка с ошибкой
|
|
10
10
|
const Item = ({ registerManager, rendererProps, type, forwardedPluginRef }) => {
|
|
11
11
|
if (!registerManager.check(type)) {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
6
5
|
const Item_1 = tslib_1.__importDefault(require("../Item/Item"));
|
|
7
6
|
const DashKitContext_1 = require("../../context/DashKitContext");
|
|
7
|
+
const cn_1 = require("../../utils/cn");
|
|
8
8
|
const helpers_1 = require("./helpers");
|
|
9
|
-
const b = (0,
|
|
9
|
+
const b = (0, cn_1.cn)('dashkit-mobile-layout');
|
|
10
10
|
class MobileLayout extends react_1.default.PureComponent {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OverlayControlsPosition = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
7
6
|
const i18n_1 = tslib_1.__importDefault(require("../../i18n"));
|
|
8
7
|
const noop_1 = tslib_1.__importDefault(require("lodash/noop"));
|
|
9
8
|
const DashKitContext_1 = require("../../context/DashKitContext");
|
|
@@ -12,7 +11,8 @@ const constants_1 = require("../../constants");
|
|
|
12
11
|
const DotsIcon_1 = require("../../icons/DotsIcon");
|
|
13
12
|
const CogIcon_1 = require("../../icons/CogIcon");
|
|
14
13
|
const CloseIcon_1 = require("../../icons/CloseIcon");
|
|
15
|
-
const
|
|
14
|
+
const cn_1 = require("../../utils/cn");
|
|
15
|
+
const b = (0, cn_1.cn)('dashkit-overlay-controls');
|
|
16
16
|
var OverlayControlsPosition;
|
|
17
17
|
(function (OverlayControlsPosition) {
|
|
18
18
|
OverlayControlsPosition["TopRight"] = "top_right";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionsToolbar = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
4
|
tslib_1.__exportStar(require("./DashKit"), exports);
|
|
6
|
-
var ActionsToolbar_1 = require("./ActionsToolbar/ActionsToolbar");
|
|
7
|
-
Object.defineProperty(exports, "ActionsToolbar", { enumerable: true, get: function () { return ActionsToolbar_1.ActionsToolbar; } });
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PluginText = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
7
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
7
|
const i18n_1 = tslib_1.__importDefault(require("../../i18n"));
|
|
8
|
+
const cn_1 = require("../../utils/cn");
|
|
9
9
|
// need to set markdown styles separately
|
|
10
10
|
// for instance can use yfm-transform
|
|
11
|
-
const b = (0,
|
|
11
|
+
const b = (0, cn_1.cn)('dashkit-plugin-text');
|
|
12
12
|
var LoadStatus;
|
|
13
13
|
(function (LoadStatus) {
|
|
14
14
|
LoadStatus["Pending"] = "pending";
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PluginTitle = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const
|
|
7
|
-
const b = (0,
|
|
6
|
+
const cn_1 = require("../../utils/cn");
|
|
7
|
+
const b = (0, cn_1.cn)('dashkit-plugin-title');
|
|
8
8
|
class PluginTitle extends react_1.default.Component {
|
|
9
9
|
render() {
|
|
10
10
|
const { data } = this.props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cn: import("@bem-react/classname").ClassNameInitilizer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import block from 'bem-cn-lite';
|
|
3
2
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
4
3
|
import GridLayout from '../GridLayout/GridLayout';
|
|
5
4
|
import MobileLayout from '../MobileLayout/MobileLayout';
|
|
6
5
|
import { withContext } from '../../hocs/withContext';
|
|
7
6
|
import { useCalcPropsLayout } from '../../hooks/useCalcLayout';
|
|
7
|
+
import { cn } from '../../utils/cn';
|
|
8
8
|
import './DashKitView.css';
|
|
9
|
-
const b =
|
|
9
|
+
const b = cn('dashkit');
|
|
10
10
|
function DashKitView(props) {
|
|
11
11
|
const context = React.useContext(DashKitContext);
|
|
12
12
|
const { registerManager, forwardedMetaRef } = context;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import block from 'bem-cn-lite';
|
|
4
3
|
import Item from '../Item/Item';
|
|
5
4
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
6
|
import './GridItem.css';
|
|
7
7
|
import OverlayControls from '../OverlayControls/OverlayControls';
|
|
8
|
-
const b =
|
|
8
|
+
const b = cn('dashkit-grid-item');
|
|
9
9
|
class GridItem extends React.PureComponent {
|
|
10
10
|
renderOverlay() {
|
|
11
11
|
const { overlayControls } = this.props;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import block from 'bem-cn-lite';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import { prepareItem } from '../../hocs/prepareItem';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
5
|
import './Item.css';
|
|
6
|
-
const b =
|
|
6
|
+
const b = cn('dashkit-item');
|
|
7
7
|
// TODO: getDerivedStateFromError и заглушка с ошибкой
|
|
8
8
|
const Item = ({ registerManager, rendererProps, type, forwardedPluginRef }) => {
|
|
9
9
|
if (!registerManager.check(type)) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import block from 'bem-cn-lite';
|
|
3
2
|
import Item from '../Item/Item';
|
|
4
3
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
5
|
import { getSortedConfigItems } from './helpers';
|
|
6
6
|
import './MobileLayout.css';
|
|
7
|
-
const b =
|
|
7
|
+
const b = cn('dashkit-mobile-layout');
|
|
8
8
|
export default class MobileLayout extends React.PureComponent {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import block from 'bem-cn-lite';
|
|
3
2
|
import i18n from '../../i18n';
|
|
4
3
|
import noop from 'lodash/noop';
|
|
5
4
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
@@ -8,8 +7,9 @@ import { COPIED_WIDGET_STORE_KEY, MenuItems } from '../../constants';
|
|
|
8
7
|
import { DotsIcon } from '../../icons/DotsIcon';
|
|
9
8
|
import { CogIcon } from '../../icons/CogIcon';
|
|
10
9
|
import { CloseIcon } from '../../icons/CloseIcon';
|
|
10
|
+
import { cn } from '../../utils/cn';
|
|
11
11
|
import './OverlayControls.css';
|
|
12
|
-
const b =
|
|
12
|
+
const b = cn('dashkit-overlay-controls');
|
|
13
13
|
export var OverlayControlsPosition;
|
|
14
14
|
(function (OverlayControlsPosition) {
|
|
15
15
|
OverlayControlsPosition["TopRight"] = "top_right";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import block from 'bem-cn-lite';
|
|
3
2
|
import { Loader, Button } from '@gravity-ui/uikit';
|
|
4
3
|
import i18n from '../../i18n';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
5
|
import './Text.css';
|
|
6
6
|
// need to set markdown styles separately
|
|
7
7
|
// for instance can use yfm-transform
|
|
8
|
-
const b =
|
|
8
|
+
const b = cn('dashkit-plugin-text');
|
|
9
9
|
var LoadStatus;
|
|
10
10
|
(function (LoadStatus) {
|
|
11
11
|
LoadStatus["Pending"] = "pending";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import './Title.css';
|
|
4
|
-
const b =
|
|
4
|
+
const b = cn('dashkit-plugin-title');
|
|
5
5
|
export class PluginTitle extends React.Component {
|
|
6
6
|
render() {
|
|
7
7
|
const { data } = this.props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cn: import("@bem-react/classname").ClassNameInitilizer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/dashkit",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Library for rendering dashboard grid layout",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,18 +41,19 @@
|
|
|
41
41
|
"react-grid-layout": "^1.3.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
44
|
+
"@bem-react/classname": "^1.6.0",
|
|
45
|
+
"@gravity-ui/uikit": "^5.0.0",
|
|
46
46
|
"react": "^16.8.0 || ^17 || ^18"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
+
"@bem-react/classname": "^1.6.0",
|
|
49
50
|
"@commitlint/cli": "^17.0.3",
|
|
50
51
|
"@commitlint/config-conventional": "^17.0.3",
|
|
51
52
|
"@gravity-ui/eslint-config": "^1.0.2",
|
|
52
53
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
53
54
|
"@gravity-ui/stylelint-config": "^1.0.1",
|
|
54
55
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
55
|
-
"@gravity-ui/uikit": "^5.
|
|
56
|
+
"@gravity-ui/uikit": "^5.9.0",
|
|
56
57
|
"@storybook/addon-essentials": "^7.0.18",
|
|
57
58
|
"@storybook/addon-knobs": "^7.0.2",
|
|
58
59
|
"@storybook/cli": "^7.0.18",
|
|
@@ -65,7 +66,6 @@
|
|
|
65
66
|
"@types/react": "^18.0.27",
|
|
66
67
|
"@types/react-grid-layout": "^1.3.2",
|
|
67
68
|
"babel-jest": "^26.6.3",
|
|
68
|
-
"bem-cn-lite": "^4.0.0",
|
|
69
69
|
"copyfiles": "^2.4.1",
|
|
70
70
|
"enzyme": "^3.11.0",
|
|
71
71
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.actions-toolbar {
|
|
2
|
-
display: flex;
|
|
3
|
-
position: fixed;
|
|
4
|
-
width: fit-content;
|
|
5
|
-
padding: 8px;
|
|
6
|
-
border-radius: var(--g-border-radius-l);
|
|
7
|
-
background-color: var(--g-color-base-background);
|
|
8
|
-
box-shadow: 0px 5px 6px 0px var(--g-color-sfx-shadow);
|
|
9
|
-
}
|
|
10
|
-
.actions-toolbar__button {
|
|
11
|
-
transition: all 0.2s ease;
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
align-items: center;
|
|
16
|
-
width: 98px;
|
|
17
|
-
height: 68px;
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
border-radius: var(--g-border-radius-s);
|
|
20
|
-
}
|
|
21
|
-
.actions-toolbar__button:hover {
|
|
22
|
-
background-color: var(--g-color-base-generic);
|
|
23
|
-
}
|
|
24
|
-
.actions-toolbar__icon {
|
|
25
|
-
margin-bottom: 10px;
|
|
26
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IconProps } from '@gravity-ui/uikit';
|
|
3
|
-
export interface ActionsToolbarProps {
|
|
4
|
-
controls: ActionsToolbarButton[];
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ActionsToolbarButton {
|
|
8
|
-
icon: IconProps['data'];
|
|
9
|
-
text: React.ReactNode;
|
|
10
|
-
handler: () => void;
|
|
11
|
-
iconSize?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare const ActionsToolbar: React.FC<ActionsToolbarProps>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionsToolbar = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
7
|
-
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
-
const b = (0, bem_cn_lite_1.default)('actions-toolbar');
|
|
9
|
-
const WidgetButton = ({ icon, text, handler }) => (react_1.default.createElement("div", { className: b('button'), onClick: handler },
|
|
10
|
-
react_1.default.createElement(uikit_1.Icon, { size: '18', className: b('icon'), data: icon }),
|
|
11
|
-
react_1.default.createElement(uikit_1.Text, { variant: 'body-1' }, text)));
|
|
12
|
-
const ActionsToolbar = (props) => {
|
|
13
|
-
return (react_1.default.createElement("div", { className: `${b()} ${props.className}` }, props.controls.map((button, index) => {
|
|
14
|
-
return (react_1.default.createElement(WidgetButton, { key: index, icon: button.icon, text: button.text, handler: button.handler }));
|
|
15
|
-
})));
|
|
16
|
-
};
|
|
17
|
-
exports.ActionsToolbar = ActionsToolbar;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.actions-toolbar {
|
|
2
|
-
display: flex;
|
|
3
|
-
position: fixed;
|
|
4
|
-
width: fit-content;
|
|
5
|
-
padding: 8px;
|
|
6
|
-
border-radius: var(--g-border-radius-l);
|
|
7
|
-
background-color: var(--g-color-base-background);
|
|
8
|
-
box-shadow: 0px 5px 6px 0px var(--g-color-sfx-shadow);
|
|
9
|
-
}
|
|
10
|
-
.actions-toolbar__button {
|
|
11
|
-
transition: all 0.2s ease;
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
align-items: center;
|
|
16
|
-
width: 98px;
|
|
17
|
-
height: 68px;
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
border-radius: var(--g-border-radius-s);
|
|
20
|
-
}
|
|
21
|
-
.actions-toolbar__button:hover {
|
|
22
|
-
background-color: var(--g-color-base-generic);
|
|
23
|
-
}
|
|
24
|
-
.actions-toolbar__icon {
|
|
25
|
-
margin-bottom: 10px;
|
|
26
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IconProps } from '@gravity-ui/uikit';
|
|
3
|
-
import './ActionsToolbar.css';
|
|
4
|
-
export interface ActionsToolbarProps {
|
|
5
|
-
controls: ActionsToolbarButton[];
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ActionsToolbarButton {
|
|
9
|
-
icon: IconProps['data'];
|
|
10
|
-
text: React.ReactNode;
|
|
11
|
-
handler: () => void;
|
|
12
|
-
iconSize?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare const ActionsToolbar: React.FC<ActionsToolbarProps>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import block from 'bem-cn-lite';
|
|
3
|
-
import { Icon, Text } from '@gravity-ui/uikit';
|
|
4
|
-
import './ActionsToolbar.css';
|
|
5
|
-
const b = block('actions-toolbar');
|
|
6
|
-
const WidgetButton = ({ icon, text, handler }) => (React.createElement("div", { className: b('button'), onClick: handler },
|
|
7
|
-
React.createElement(Icon, { size: '18', className: b('icon'), data: icon }),
|
|
8
|
-
React.createElement(Text, { variant: 'body-1' }, text)));
|
|
9
|
-
export const ActionsToolbar = (props) => {
|
|
10
|
-
return (React.createElement("div", { className: `${b()} ${props.className}` }, props.controls.map((button, index) => {
|
|
11
|
-
return (React.createElement(WidgetButton, { key: index, icon: button.icon, text: button.text, handler: button.handler }));
|
|
12
|
-
})));
|
|
13
|
-
};
|