@gravity-ui/chartkit 0.10.0 → 0.11.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.11.0](https://github.com/gravity-ui/chartkit/compare/v0.10.1...v0.11.0) (2022-11-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * types improvements ([#67](https://github.com/gravity-ui/chartkit/issues/67)) ([33b4f07](https://github.com/gravity-ui/chartkit/commit/33b4f07a24abdfde52005ddbbf17fb7a25817beb))
9
+
10
+ ## [0.10.1](https://github.com/gravity-ui/chartkit/compare/v0.10.0...v0.10.1) (2022-11-18)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **Highcharts plugin:** add Highcharts lib type export ([#65](https://github.com/gravity-ui/chartkit/issues/65)) ([de24a26](https://github.com/gravity-ui/chartkit/commit/de24a264197441b21261438808838e5fbd0a8402))
16
+
3
17
  ## [0.10.0](https://github.com/gravity-ui/chartkit/compare/v0.9.1...v0.10.0) (2022-11-18)
4
18
 
5
19
 
@@ -10,7 +24,6 @@
10
24
 
11
25
  ### Bug Fixes
12
26
 
13
- * **Highcharts plaugin:** fix error handling and reflow method ([#63](https://github.com/gravity-ui/chartkit/issues/63)) ([ba4f2ad](https://github.com/gravity-ui/chartkit/commit/ba4f2ada96ae642a93ebd203438463f72883e245))
14
27
  * yagr & indicator types fixes ([#64](https://github.com/gravity-ui/chartkit/issues/64)) ([479c552](https://github.com/gravity-ui/chartkit/commit/479c552f5ce1890451f3f104fc8efb730f2baf67))
15
28
 
16
29
  ## [0.9.1](https://github.com/gravity-ui/chartkit/compare/v0.9.0...v0.9.1) (2022-11-14)
@@ -18,7 +31,6 @@
18
31
 
19
32
  ### Bug Fixes
20
33
 
21
- * fix yagr theme ininitialization ([7247873](https://github.com/gravity-ui/chartkit/commit/724787380b8d81f6dfdaae1f6e5c1b806af32e3c))
22
34
  * fix yagr theme initialization ([#59](https://github.com/gravity-ui/chartkit/issues/59)) ([7247873](https://github.com/gravity-ui/chartkit/commit/724787380b8d81f6dfdaae1f6e5c1b806af32e3c))
23
35
 
24
36
  ## [0.9.0](https://github.com/gravity-ui/chartkit/compare/v0.8.0...v0.9.0) (2022-11-08)
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
- import type { ChartkitType, ChartKitRef, ChartKitProps } from '../types';
2
+ import type { ChartKitType, ChartKitRef, ChartKitProps } from '../types';
3
3
  import '@gravity-ui/uikit/styles/styles.css';
4
4
  import './ChartKit.css';
5
- declare type ChartKitComponentProps<T extends ChartkitType> = Omit<ChartKitProps<T>, 'onError'> & {
5
+ declare type ChartKitComponentProps<T extends ChartKitType> = Omit<ChartKitProps<T>, 'onError'> & {
6
6
  instanceRef?: React.ForwardedRef<ChartKitRef | undefined>;
7
7
  };
8
- declare const ChartKitComponent: <T extends keyof import("../types").ChartkitWidget>(props: ChartKitComponentProps<T>) => JSX.Element;
9
- export declare const ChartKit: <T extends keyof import("../types").ChartkitWidget>(props: {
8
+ declare const ChartKitComponent: <T extends keyof import("../types").ChartKitWidget>(props: ChartKitComponentProps<T>) => JSX.Element;
9
+ export declare const ChartKit: <T extends keyof import("../types").ChartKitWidget>(props: {
10
10
  type: T;
11
- data: import("../types").ChartkitWidget[T]["data"];
11
+ data: import("../types").ChartKitWidget[T]["data"];
12
12
  id?: string | undefined;
13
13
  isMobile?: boolean | undefined;
14
14
  onLoad?: ((data?: import("../types").ChartKitOnLoadData<T> | undefined) => void) | undefined;
15
15
  onError?: import("../types").ChartKitOnError | undefined;
16
- } & { [key in keyof Omit<import("../types").ChartkitWidget[T], "widget" | "data">]: import("../types").ChartkitWidget[T][key]; } & {
16
+ } & { [key in keyof Omit<import("../types").ChartKitWidget[T], "widget" | "data">]: import("../types").ChartKitWidget[T][key]; } & {
17
17
  ref?: React.ForwardedRef<ChartKitRef | undefined> | undefined;
18
18
  }) => ReturnType<typeof ChartKitComponent>;
19
19
  export {};
package/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ChartKit } from './components/ChartKit';
2
2
  import { settings } from './libs';
3
- export type { ChartKitLang, ChartKitOnLoadData, ChartKitOnError, ChartKitPlugin, ChartKitProps, ChartKitRef, ChartKitWidgetRef, ChartkitType, ChartkitWidget, } from './types';
3
+ export type { ChartKitLang, ChartKitOnLoadData, ChartKitOnError, ChartKitPlugin, ChartKitProps, ChartKitRef, ChartKitWidgetRef, ChartKitType, ChartKitWidget, } from './types';
4
4
  export { settings };
5
5
  export default ChartKit;
@@ -550,8 +550,8 @@ export declare class HighchartsComponent extends React.PureComponent<Props, Stat
550
550
  text: any;
551
551
  };
552
552
  series: any;
553
- _externalComments: import("../../types").ChartKitComment[];
554
- _internalComments: import("../../types").ChartKitComment[];
553
+ _externalComments: import("../../types").HighchartsComment[];
554
+ _internalComments: import("../../types").HighchartsComment[];
555
555
  };
556
556
  callback: (chart: import("../../types").ExtendedHChart) => void;
557
557
  isError: boolean;
@@ -1,11 +1,11 @@
1
1
  import type { ChartKitHolidays } from '../../../../types';
2
- import type { HighchartsWidgetData, ChartKitComment, ExtendedHChart } from '../../types';
2
+ import type { HighchartsWidgetData, HighchartsComment, ExtendedHChart } from '../../types';
3
3
  import type { ConfigOptions } from './types';
4
4
  import './graph.css';
5
5
  declare type GetGraphArgs = {
6
6
  options: ConfigOptions;
7
7
  data: HighchartsWidgetData['data'];
8
- comments?: ChartKitComment[];
8
+ comments?: HighchartsComment[];
9
9
  holidays?: ChartKitHolidays;
10
10
  isMobile?: boolean;
11
11
  };
@@ -544,8 +544,8 @@ declare function getGraph({ options, data, comments, isMobile, holidays }: GetGr
544
544
  text: any;
545
545
  };
546
546
  series: any;
547
- _externalComments: ChartKitComment[];
548
- _internalComments: ChartKitComment[];
547
+ _externalComments: HighchartsComment[];
548
+ _internalComments: HighchartsComment[];
549
549
  };
550
550
  callback: (chart: ExtendedHChart) => void;
551
551
  };
@@ -47,5 +47,5 @@ interface CommentFlagX extends CommentBase {
47
47
  shape: string;
48
48
  };
49
49
  }
50
- export declare type ChartKitComment = CommentDotXY | CommentBandX | CommentLineX | CommentFlagX;
50
+ export declare type HighchartsComment = CommentDotXY | CommentBandX | CommentLineX | CommentFlagX;
51
51
  export {};
@@ -1,4 +1,4 @@
1
1
  export type { Highcharts } from './lib';
2
2
  export type { HighchartsWidgetData } from './widget';
3
3
  export type { DrillDownConfig, ExtendedHChart, StringParams, XAxisItem } from './misc';
4
- export type { ChartKitComment } from './comments';
4
+ export type { HighchartsComment } from './comments';
@@ -1,4 +1,4 @@
1
- import type { ChartKitComment } from './comments';
1
+ import type { HighchartsComment } from './comments';
2
2
  export declare type StringParams = Record<string, string | string[]>;
3
3
  export declare type DrillDownConfig = {
4
4
  breadcrumbs: string[];
@@ -10,9 +10,9 @@ export declare type XAxisItem = Highcharts.Axis & {
10
10
  };
11
11
  export declare type ExtendedHChart = Highcharts.Chart & {
12
12
  userOptions: Highcharts.Options & {
13
- _internalComments: ChartKitComment[];
14
- _externalComments: ChartKitComment[];
15
- _getComments: () => ChartKitComment[];
13
+ _internalComments: HighchartsComment[];
14
+ _externalComments: HighchartsComment[];
15
+ _getComments: () => HighchartsComment[];
16
16
  };
17
17
  xAxis: XAxisItem[];
18
18
  navigator?: Highcharts.Options['navigator'];
@@ -1,5 +1,5 @@
1
1
  import type { Highcharts } from './lib';
2
- import type { ChartKitComment } from './comments';
2
+ import type { HighchartsComment } from './comments';
3
3
  import type { DrillDownConfig, StringParams } from './misc';
4
4
  declare type GraphWidgetSeriesOptions = Highcharts.SeriesOptionsType & {
5
5
  title?: string;
@@ -16,7 +16,7 @@ export declare type HighchartsWidgetData = {
16
16
  } | {
17
17
  graphs: GraphWidgetSeriesOptions[];
18
18
  }) & {
19
- comments?: ChartKitComment[];
19
+ comments?: HighchartsComment[];
20
20
  };
21
21
  config: {
22
22
  hideComments?: boolean;
@@ -41,7 +41,7 @@ export declare type HighchartsWidgetData = {
41
41
  };
42
42
  libraryConfig: Highcharts.Options;
43
43
  params?: StringParams;
44
- comments?: ChartKitComment[];
44
+ comments?: HighchartsComment[];
45
45
  sideMarkdown?: string;
46
46
  };
47
47
  export {};
@@ -3,4 +3,4 @@ export type { Yagr, YagrWidgetData } from './yagr/types';
3
3
  export { IndicatorPlugin } from './indicator';
4
4
  export type { IndicatorWidgetData } from './indicator/types';
5
5
  export { HighchartsPlugin } from './highcharts';
6
- export type { HighchartsWidgetData } from './highcharts/types';
6
+ export type { Highcharts, HighchartsWidgetData, HighchartsComment } from './highcharts/types';
@@ -1,33 +1,33 @@
1
1
  /// <reference types="react" />
2
- import type { ChartkitWidget } from './widget';
2
+ import type { ChartKitWidget } from './widget';
3
3
  export type { ChartKitHolidays } from './misc';
4
4
  export declare type ChartKitLang = 'ru' | 'en';
5
- export declare type ChartkitType = keyof ChartkitWidget;
5
+ export declare type ChartKitType = keyof ChartKitWidget;
6
6
  export declare type ChartKitRef = {
7
7
  reflow: (details?: unknown) => void;
8
8
  };
9
9
  export declare type ChartKitWidgetRef = {
10
10
  reflow?: ChartKitRef['reflow'];
11
11
  };
12
- export declare type ChartKitOnLoadData<T extends ChartkitType> = {
13
- widget?: ChartkitWidget[T]['widget'];
12
+ export declare type ChartKitOnLoadData<T extends ChartKitType> = {
13
+ widget?: ChartKitWidget[T]['widget'];
14
14
  widgetRendering?: number;
15
15
  };
16
16
  export declare type ChartKitOnError = (data: {
17
17
  error: any;
18
18
  }) => void;
19
- export declare type ChartKitProps<T extends ChartkitType> = {
19
+ export declare type ChartKitProps<T extends ChartKitType> = {
20
20
  type: T;
21
- data: ChartkitWidget[T]['data'];
21
+ data: ChartKitWidget[T]['data'];
22
22
  id?: string;
23
23
  isMobile?: boolean;
24
24
  onLoad?: (data?: ChartKitOnLoadData<T>) => void;
25
25
  onError?: ChartKitOnError;
26
26
  } & {
27
- [key in keyof Omit<ChartkitWidget[T], 'data' | 'widget'>]: ChartkitWidget[T][key];
27
+ [key in keyof Omit<ChartKitWidget[T], 'data' | 'widget'>]: ChartKitWidget[T][key];
28
28
  };
29
29
  export declare type ChartKitPlugin = {
30
- type: ChartkitType;
30
+ type: ChartKitType;
31
31
  renderer: React.LazyExoticComponent<any>;
32
32
  };
33
- export type { ChartkitWidget };
33
+ export type { ChartKitWidget };
@@ -2,7 +2,7 @@ import type Yagr from 'yagr';
2
2
  import type { YagrWidgetData } from '../plugins/yagr/types';
3
3
  import type { IndicatorWidgetData } from '../plugins/indicator/types';
4
4
  import type { Highcharts, HighchartsWidgetData, StringParams } from '../plugins/highcharts/types';
5
- export interface ChartkitWidget {
5
+ export interface ChartKitWidget {
6
6
  yagr: {
7
7
  data: YagrWidgetData;
8
8
  widget: Yagr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
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",