dhx-chart 8.0.3 → 8.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.
@@ -1,10 +1,11 @@
1
1
  import { View } from "../../ts-common/view";
2
+ import { IPDFConfig, IPNGConfig } from "../../ts-common/types";
2
3
  export declare class Exporter {
3
4
  private _name;
4
5
  private _view;
5
6
  private _version;
6
7
  constructor(_name: string, _view: View);
7
- pdf(config: any): void;
8
- png(config: any): void;
9
- protected _rawExport(config: any, mode: string, view: View): void;
8
+ pdf(config?: IPDFConfig): void;
9
+ png(config?: IPNGConfig): void;
10
+ private _rawExport;
10
11
  }
@@ -42,3 +42,34 @@ export interface ITouchParam {
42
42
  timeStamp?: number;
43
43
  dblDuration?: number;
44
44
  }
45
+ export declare type TExportType = "pdf" | "png";
46
+ export declare type TPaperFormat = "Letter" | "Legal" | "Tabloid" | "Ledger" | "A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6";
47
+ export interface IExportFileConfig {
48
+ url?: string;
49
+ name?: string;
50
+ header?: string;
51
+ footer?: string;
52
+ exportStyles?: boolean | string[];
53
+ theme?: string;
54
+ }
55
+ export interface IPDFConfig extends IExportFileConfig {
56
+ pdf?: {
57
+ scale?: number;
58
+ landscape?: boolean;
59
+ format?: TPaperFormat;
60
+ margin?: {
61
+ top?: string | number;
62
+ right?: string | number;
63
+ bottom?: string | number;
64
+ left?: string | number;
65
+ };
66
+ width?: string;
67
+ height?: string;
68
+ pageRanges?: string;
69
+ displayHeaderFooter?: boolean;
70
+ footerTemplate?: string;
71
+ headerTemplate?: string;
72
+ printBackground?: boolean;
73
+ };
74
+ }
75
+ export declare type IPNGConfig = IExportFileConfig;
@@ -58,6 +58,7 @@ export interface IDataConfig {
58
58
  update?: anyFunction;
59
59
  approximate?: IApproximate;
60
60
  autoload?: string;
61
+ collapsed?: boolean;
61
62
  }
62
63
  export interface IDataCollection<T extends IDataItem = IDataItem> {
63
64
  config: IDataConfig;
@@ -1,7 +1,12 @@
1
1
  import { ICsvExportConfig, IGrid, IXlsxExportConfig } from "./types";
2
+ import { IPDFConfig, IPNGConfig, TExportType } from "../../ts-common/types";
2
3
  export declare class Exporter {
4
+ private _name;
5
+ private _version;
3
6
  private _view;
4
- constructor(_view: IGrid);
7
+ constructor(_name: string, _version: string, _view: IGrid);
8
+ pdf(config?: IPDFConfig): void;
9
+ png(config?: IPNGConfig): void;
5
10
  xlsx(config?: IXlsxExportConfig): {
6
11
  name: string;
7
12
  columns: any[];
@@ -22,4 +27,5 @@ export declare class Exporter {
22
27
  private _export;
23
28
  private getFlatCSV;
24
29
  private _getCSV;
30
+ protected _rawExport(config: IPNGConfig | IPDFConfig, mode: TExportType, view: any): void;
25
31
  }
@@ -6,6 +6,7 @@ import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataI
6
6
  import { Exporter } from "./Exporter";
7
7
  import { Dirs, EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISelection, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, ISortingState, SortFunction, IHeaderFilter } from "./types";
8
8
  export declare class Grid extends View implements IGrid {
9
+ version: string;
9
10
  data: IDataCollection;
10
11
  config: IGridConfig;
11
12
  events: IEventSystem<DataEvents | GridEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
@@ -76,4 +77,5 @@ export declare class Grid extends View implements IGrid {
76
77
  private _destroyContent;
77
78
  private _render;
78
79
  private _initHotKey;
80
+ private _normalizeConfig;
79
81
  }
@@ -1,5 +1,5 @@
1
1
  import { IContainerConfig } from "../../../ts-common/core";
2
- import { ICol, IColumnsWidth, IGridConfig, IRendererConfig, IRow, colType } from "./../types";
2
+ import { ICol, IColumnsWidth, IGridConfig, IRendererConfig, IRow, colType, TOption } from "./../types";
3
3
  export declare function normalizeColumns({ columns, htmlEnable }: IGridConfig, configChanged?: boolean): void;
4
4
  export declare function countColumns(config: IGridConfig, columns: ICol[]): number;
5
5
  export declare function calculatePositions(width: number, height: number, scroll: any, conf: IRendererConfig, data: IRow[]): {
@@ -17,3 +17,4 @@ export declare const getCalculatedRowHeight: (height: number, config?: {
17
17
  export declare const getTreeCellWidthOffset: (row: IRow) => number;
18
18
  export declare const getMaxColsWidth: (rows: IRow[], cols: ICol[], config?: IContainerConfig, target?: import("../../../ts-grid").AdjustTargetType) => IColumnsWidth;
19
19
  export declare function toFormat(value: any, type?: colType, format?: string): any;
20
+ export declare function getEditorOptions(col: ICol, row?: IRow): TOption[];
@@ -14,7 +14,7 @@ export interface IGridConfig extends IDragConfig {
14
14
  data?: any[];
15
15
  type?: "tree";
16
16
  width?: number;
17
- height?: number;
17
+ height?: number | "auto";
18
18
  sortable?: boolean;
19
19
  rowCss?: (row: IRow) => string;
20
20
  leftSplit?: number;
@@ -43,7 +43,10 @@ export interface IGridConfig extends IDragConfig {
43
43
  [className: string]: (event: Event, item: ICellObj) => void;
44
44
  };
45
45
  };
46
+ exportStyles?: boolean | string[];
46
47
  rootParent?: Id;
48
+ $width?: number;
49
+ $height?: number;
47
50
  $headerLevel?: number;
48
51
  $footerLevel?: number;
49
52
  $totalWidth?: number;
@@ -191,6 +194,11 @@ export interface IHeaderFilter {
191
194
  export interface ICellRect extends ICoords, ISizes {
192
195
  }
193
196
  export declare type colType = "string" | "number" | "boolean" | "date" | "percent" | any;
197
+ export interface IOption {
198
+ id: Id;
199
+ value: string;
200
+ }
201
+ export declare type TOption = IOption | string;
194
202
  export interface ICol {
195
203
  id: Id;
196
204
  width?: number;
@@ -206,7 +214,7 @@ export interface ICol {
206
214
  editable?: boolean;
207
215
  resizable?: boolean;
208
216
  sortable?: boolean;
209
- options?: any[];
217
+ options?: (col: ICol, row?: IRow) => TOption[] | TOption[];
210
218
  draggable?: boolean;
211
219
  htmlEnable?: boolean;
212
220
  template?: (cellValue: any, row: IRow, col: ICol) => string;
@@ -224,6 +232,7 @@ export interface ICol {
224
232
  $width?: number;
225
233
  $fixed?: boolean;
226
234
  $htmlEnable?: boolean;
235
+ $customOptions?: any;
227
236
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
228
237
  dateFormat?: string;
229
238
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
@@ -1,6 +1,9 @@
1
1
  import { IGrid, IGridConfig, IProGrid, IRendererConfig, IRow, Split, IScrollBarWidth } from "../types";
2
2
  export declare const BORDERS = 2;
3
- export declare function calcScrollBarWidth(config: IGridConfig | IRendererConfig, customScroll?: boolean): IScrollBarWidth;
3
+ export declare function calcScrollBarWidth(config: IGridConfig | IRendererConfig, customScroll?: boolean, sizes?: {
4
+ width: number;
5
+ height: number;
6
+ }): IScrollBarWidth;
4
7
  export declare function getCurrFixedCols(config: IGridConfig, split: Split.left | Split.right): import("../types").ICol[];
5
8
  export declare function getRenderConfig(obj: any, data: IRow[], wrapperSizes: any): IRendererConfig;
6
9
  export declare function getEvents(config: IRendererConfig, mode?: Split): {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhx-chart",
3
- "version": "8.0.3",
3
+ "version": "8.1.0",
4
4
  "description": "dhtmlxChart widget",
5
5
  "homepage":"https://docs.dhtmlx.com/chart",
6
6
  "license":"GPL",
package/readme.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
3
 
4
- dhtmlxChart v.8.0.3 Standard
4
+ dhtmlxChart v.8.1.0 Standard
5
5
  This software is covered by GPL-2.0 License. Usage without proper license is prohibited.
6
6
 
7
7
  (c) XB Software.
package/whatsnew.txt CHANGED
@@ -1,12 +1,26 @@
1
- Version 8.0.3 (April 12, 2023)
2
- ----------------------------
3
-
4
- Version 8.0.2 (March 20, 2023)
5
- ----------------------------
6
-
7
- Version 8.0.1 (March 13, 2023)
8
- ----------------------------
9
-
1
+ # Version 8.1 (April 18, 2023)
2
+
3
+ ### New functionality
4
+
5
+ - New "exportStyles" property
6
+
7
+ ### Updates
8
+
9
+ - The "pdf()" method was updated:
10
+ - new options of the export object are added: "theme", "exportStyles"
11
+ - new options of the pdf object are added: "pageRanges", "displayHeaderFooter", "footerTemplate", "headerTemplate"
12
+ - The "png()" method was updated:
13
+ - new options of the export object are added: "theme", "exportStyles"
14
+
15
+ Version 8.0.3 (April 12, 2023)
16
+ ----------------------------
17
+
18
+ Version 8.0.2 (March 20, 2023)
19
+ ----------------------------
20
+
21
+ Version 8.0.1 (March 13, 2023)
22
+ ----------------------------
23
+
10
24
  Version 8.0.0 (February 24, 2023)
11
25
 
12
26
  ### New functionality