@gravity-ui/dashkit 6.1.0-beta.2 → 6.1.0-beta.3

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.
@@ -8,5 +8,6 @@ export type ActionPanelItem = {
8
8
  };
9
9
  export type ActionPanelProps = {
10
10
  items: ActionPanelItem[];
11
+ className?: string;
11
12
  };
12
13
  export declare const ActionPanel: (props: ActionPanelProps) => JSX.Element;
@@ -6,7 +6,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const cn_1 = require("../../utils/cn");
7
7
  const b = (0, cn_1.cn)('dashkit-action-panel');
8
8
  const ActionPanel = (props) => {
9
- return (react_1.default.createElement("div", { className: b() }, props.items.map((item) => {
9
+ return (react_1.default.createElement("div", { className: b(null, props.className) }, props.items.map((item) => {
10
10
  return (react_1.default.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick },
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)));
@@ -0,0 +1 @@
1
+ export * from './ActionPanel';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./ActionPanel"), exports);
@@ -3,7 +3,7 @@ import GridLayout from '../GridLayout/GridLayout';
3
3
  import { SetConfigItem, Settings, SettingsProps, ContextProps, Plugin, SetItemOptions } from '../../typings';
4
4
  import { GlobalParams, Config, ConfigItem, ItemsStateAndParams } from '../../shared';
5
5
  import { OverlayControlItem } from '../OverlayControls/OverlayControls';
6
- import { ActionPanelItem } from '../ActionPanel/ActionPanel';
6
+ import type { ActionPanelItem } from '../ActionPanel/ActionPanel';
7
7
  interface DashKitGeneralProps {
8
8
  config: Config;
9
9
  editMode: boolean;
@@ -8,7 +8,7 @@ const MobileLayout_1 = tslib_1.__importDefault(require("../MobileLayout/MobileLa
8
8
  const withContext_1 = require("../../hocs/withContext");
9
9
  const useCalcLayout_1 = require("../../hooks/useCalcLayout");
10
10
  const cn_1 = require("../../utils/cn");
11
- const ActionPanel_1 = require("../ActionPanel/ActionPanel");
11
+ const ActionPanel_1 = tslib_1.__importDefault(require("../ActionPanel/ActionPanel"));
12
12
  const b = (0, cn_1.cn)('dashkit');
13
13
  function DashKitView(props) {
14
14
  var _a;
@@ -16,7 +16,7 @@ function DashKitView(props) {
16
16
  const { registerManager, forwardedMetaRef, editMode } = context;
17
17
  return (react_1.default.createElement("div", { className: b({ theme: registerManager.settings.theme }) },
18
18
  registerManager.settings.isMobile ? (react_1.default.createElement(MobileLayout_1.default, null)) : (react_1.default.createElement(GridLayout_1.default, { ref: forwardedMetaRef, overlayControls: props.overlayControls })),
19
- Boolean(((_a = props.actionPanel) === null || _a === void 0 ? void 0 : _a.length) && editMode) && (react_1.default.createElement(ActionPanel_1.ActionPanel, { items: props.actionPanel }))));
19
+ Boolean(((_a = props.actionPanel) === null || _a === void 0 ? void 0 : _a.length) && editMode) && (react_1.default.createElement(ActionPanel_1.default, { items: props.actionPanel }))));
20
20
  }
21
21
  const DashKitViewWithContext = (0, withContext_1.withContext)(DashKitView);
22
22
  const DashKitViewForwardedMeta = react_1.default.forwardRef((props, ref) => {
@@ -1,3 +1,3 @@
1
1
  export * from './DashKit';
2
2
  export type { OverlayControlItem } from './OverlayControls/OverlayControls';
3
- export { ActionPanel, ActionPanelProps, ActionPanelItem } from './ActionPanel/ActionPanel';
3
+ export * from './ActionPanel';
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionPanel = void 0;
4
3
  const tslib_1 = require("tslib");
5
4
  tslib_1.__exportStar(require("./DashKit"), exports);
6
- var ActionPanel_1 = require("./ActionPanel/ActionPanel");
7
- Object.defineProperty(exports, "ActionPanel", { enumerable: true, get: function () { return ActionPanel_1.ActionPanel; } });
5
+ tslib_1.__exportStar(require("./ActionPanel"), exports);
@@ -1,7 +1,7 @@
1
1
  import { OverlayCustomControlItem } from '../components/OverlayControls/OverlayControls';
2
2
  import { MenuItems } from '../constants';
3
3
  import type { ReactGridLayoutProps } from 'react-grid-layout';
4
- import { ActionPanelItem } from '../components/ActionPanel/ActionPanel';
4
+ import type { ActionPanelItem } from '../components/ActionPanel/ActionPanel';
5
5
  export interface Settings {
6
6
  gridLayout?: ReactGridLayoutProps;
7
7
  theme?: string;
@@ -9,5 +9,6 @@ export type ActionPanelItem = {
9
9
  };
10
10
  export type ActionPanelProps = {
11
11
  items: ActionPanelItem[];
12
+ className?: string;
12
13
  };
13
14
  export declare const ActionPanel: (props: ActionPanelProps) => JSX.Element;
@@ -3,7 +3,7 @@ import { cn } from '../../utils/cn';
3
3
  import './ActionPanel.css';
4
4
  const b = cn('dashkit-action-panel');
5
5
  export const ActionPanel = (props) => {
6
- return (React.createElement("div", { className: b() }, props.items.map((item) => {
6
+ return (React.createElement("div", { className: b(null, props.className) }, props.items.map((item) => {
7
7
  return (React.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick },
8
8
  React.createElement("div", { className: b('icon') }, item.icon),
9
9
  React.createElement("div", { className: b('title'), title: item.title }, item.title)));
@@ -0,0 +1 @@
1
+ export * from './ActionPanel';
@@ -0,0 +1 @@
1
+ export * from './ActionPanel';
@@ -3,7 +3,7 @@ import GridLayout from '../GridLayout/GridLayout';
3
3
  import { SetConfigItem, Settings, SettingsProps, ContextProps, Plugin, SetItemOptions } from '../../typings';
4
4
  import { GlobalParams, Config, ConfigItem, ItemsStateAndParams } from '../../shared';
5
5
  import { OverlayControlItem } from '../OverlayControls/OverlayControls';
6
- import { ActionPanelItem } from '../ActionPanel/ActionPanel';
6
+ import type { ActionPanelItem } from '../ActionPanel/ActionPanel';
7
7
  interface DashKitGeneralProps {
8
8
  config: Config;
9
9
  editMode: boolean;
@@ -5,7 +5,7 @@ import MobileLayout from '../MobileLayout/MobileLayout';
5
5
  import { withContext } from '../../hocs/withContext';
6
6
  import { useCalcPropsLayout } from '../../hooks/useCalcLayout';
7
7
  import { cn } from '../../utils/cn';
8
- import { ActionPanel } from '../ActionPanel/ActionPanel';
8
+ import ActionPanel from '../ActionPanel/ActionPanel';
9
9
  import './DashKitView.css';
10
10
  const b = cn('dashkit');
11
11
  function DashKitView(props) {
@@ -1,3 +1,3 @@
1
1
  export * from './DashKit';
2
2
  export type { OverlayControlItem } from './OverlayControls/OverlayControls';
3
- export { ActionPanel, ActionPanelProps, ActionPanelItem } from './ActionPanel/ActionPanel';
3
+ export * from './ActionPanel';
@@ -1,2 +1,2 @@
1
1
  export * from './DashKit';
2
- export { ActionPanel } from './ActionPanel/ActionPanel';
2
+ export * from './ActionPanel';
@@ -1,7 +1,7 @@
1
1
  import { OverlayCustomControlItem } from '../components/OverlayControls/OverlayControls';
2
2
  import { MenuItems } from '../constants';
3
3
  import type { ReactGridLayoutProps } from 'react-grid-layout';
4
- import { ActionPanelItem } from '../components/ActionPanel/ActionPanel';
4
+ import type { ActionPanelItem } from '../components/ActionPanel/ActionPanel';
5
5
  export interface Settings {
6
6
  gridLayout?: ReactGridLayoutProps;
7
7
  theme?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dashkit",
3
- "version": "6.1.0-beta.2",
3
+ "version": "6.1.0-beta.3",
4
4
  "description": "Library for rendering dashboard grid layout",
5
5
  "license": "MIT",
6
6
  "repository": {