@gravity-ui/chartkit 0.8.0 → 0.9.1

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.1](https://github.com/gravity-ui/chartkit/compare/v0.9.0...v0.9.1) (2022-11-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * fix yagr theme ininitialization ([7247873](https://github.com/gravity-ui/chartkit/commit/724787380b8d81f6dfdaae1f6e5c1b806af32e3c))
9
+ * fix yagr theme initialization ([#59](https://github.com/gravity-ui/chartkit/issues/59)) ([7247873](https://github.com/gravity-ui/chartkit/commit/724787380b8d81f6dfdaae1f6e5c1b806af32e3c))
10
+
11
+ ## [0.9.0](https://github.com/gravity-ui/chartkit/compare/v0.8.0...v0.9.0) (2022-11-08)
12
+
13
+
14
+ ### Features
15
+
16
+ * add isMobile property ([#57](https://github.com/gravity-ui/chartkit/issues/57)) ([a2e87ed](https://github.com/gravity-ui/chartkit/commit/a2e87edf1d05705fb92c2571b5a71496c48d9215))
17
+
3
18
  ## [0.8.0](https://github.com/gravity-ui/chartkit/compare/v0.7.2...v0.8.0) (2022-10-04)
4
19
 
5
20
 
@@ -1,4 +1,8 @@
1
1
  .chartkit {
2
2
  height: 100%;
3
3
  width: 100%;
4
+ }
5
+
6
+ .chartkit_mobile .chartkit-scrollable-node {
7
+ max-height: 3000px;
4
8
  }
@@ -10,6 +10,7 @@ export declare const ChartKit: <T extends keyof import("../types").ChartkitWidge
10
10
  type: T;
11
11
  data: import("../types").ChartkitWidget[T]["data"];
12
12
  id?: string | undefined;
13
+ isMobile?: boolean | undefined;
13
14
  onLoad?: ((data?: import("../types").ChartKitOnLoadData<T> | undefined) => void) | undefined;
14
15
  onError?: import("../types").ChartKitOnError | undefined;
15
16
  formatNumber?: import("../types").ChartKitFormatNumber | undefined;
@@ -11,7 +11,7 @@ import './ChartKit.css';
11
11
  const b = block('chartkit');
12
12
  const ChartKitComponent = (props) => {
13
13
  const widgetRef = React.useRef();
14
- const { instanceRef, id = getRandomCKId(), type, data, onLoad } = props, restProps = __rest(props, ["instanceRef", "id", "type", "data", "onLoad"]);
14
+ const { instanceRef, id = getRandomCKId(), type, data, onLoad, isMobile } = props, restProps = __rest(props, ["instanceRef", "id", "type", "data", "onLoad", "isMobile"]);
15
15
  const lang = settings.get('lang');
16
16
  const plugins = settings.get('plugins');
17
17
  const plugin = plugins.find((iteratedPlugin) => iteratedPlugin.type === type);
@@ -31,7 +31,7 @@ const ChartKitComponent = (props) => {
31
31
  },
32
32
  }), []);
33
33
  return (React.createElement(React.Suspense, { fallback: React.createElement(Loader, null) },
34
- React.createElement("div", { className: b() },
34
+ React.createElement("div", { className: b({ mobile: isMobile }) },
35
35
  React.createElement(ChartComponent, Object.assign({ ref: widgetRef, id: id, lang: lang, data: data, onLoad: onLoad }, restProps)))));
36
36
  };
37
37
  const ChartKitComponentWithErrorBoundary = React.forwardRef((props, ref) => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import moment from 'moment';
3
3
  import debounce from 'lodash/debounce';
4
- import { useThemeValue } from '@gravity-ui/uikit';
4
+ import { useThemeType } from '@gravity-ui/uikit';
5
5
  import YagrComponent from 'yagr/dist/react';
6
6
  import { defaults, } from 'yagr';
7
7
  import { formatTooltip } from './tooltip/tooltip';
@@ -79,7 +79,7 @@ const YagrWidget = React.forwardRef((props, forwardedRef) => {
79
79
  const yagrRef = React.useRef(null);
80
80
  const { data, libraryConfig } = props.data;
81
81
  const { id, onLoad } = props;
82
- const theme = useThemeValue();
82
+ const theme = useThemeType();
83
83
  const handlers = {
84
84
  mouseMove: null,
85
85
  mouseDown: null,
@@ -20,6 +20,7 @@ export declare type ChartKitProps<T extends ChartkitType> = {
20
20
  type: T;
21
21
  data: ChartkitWidget[T]['data'];
22
22
  id?: string;
23
+ isMobile?: boolean;
23
24
  onLoad?: (data?: ChartKitOnLoadData<T>) => void;
24
25
  onError?: ChartKitOnError;
25
26
  formatNumber?: ChartKitFormatNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "React component used to render charts based on any sources you need",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:gravity-ui/ChartKit.git",
@@ -23,7 +23,7 @@
23
23
  "@gravity-ui/prettier-config": "^1.0.1",
24
24
  "@gravity-ui/stylelint-config": "^1.0.1",
25
25
  "@gravity-ui/tsconfig": "^1.0.0",
26
- "@gravity-ui/uikit": "^3.0.2",
26
+ "@gravity-ui/uikit": "^3.5.0",
27
27
  "@storybook/addon-essentials": "^6.5.9",
28
28
  "@storybook/addon-knobs": "^6.4.0",
29
29
  "@storybook/preset-scss": "^1.0.3",