dhx-chart 8.0.3 → 8.1.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.
@@ -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
  }
@@ -4,8 +4,9 @@ import { Id, ITouchParam } from "../../ts-common/types";
4
4
  import { View } from "../../ts-common/view";
5
5
  import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap } from "../../ts-data";
6
6
  import { Exporter } from "./Exporter";
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";
7
+ import { Dirs, EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISelection, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, ISortingState, SortFunction, IHeaderFilter, IAdjustColumns } 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>;
@@ -63,7 +64,7 @@ export declare class Grid extends View implements IGrid {
63
64
  protected _checkFilters(): void;
64
65
  protected _adjustColumns(): void;
65
66
  protected _prepareData(data: IDataItem[] | IDataCollection): any[] | IDataItem[];
66
- protected _adjustColumnsWidth(rows: IRow[], cols: ICol[], adjust?: IAdjustBy): IColumnsWidth;
67
+ protected _adjustColumnsWidth({ rows, cols, adjust, }: IAdjustColumns): IColumnsWidth;
67
68
  protected _prepareColumnData(data: any, type: "header" | "footer"): IRow[];
68
69
  protected _dragStart(event: any): void;
69
70
  protected _getRowGhost(ids: Id[]): HTMLDivElement;
@@ -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,3 @@
1
- import { Id } from "../../../ts-common/types";
2
- import { ICol, IRow, ISpan } from "./../types";
1
+ import { ICol, IRow } from "./../types";
3
2
  export declare function getWidth(columns: ICol[], colspan: number, index: number): number;
4
3
  export declare function getHeight(dataRows: IRow[], rowspan: number, index: number): number;
5
- export declare function getSpan(rowId: Id, colId: Id, conf: any): ISpan;
@@ -1,8 +1,8 @@
1
1
  import { IContainerConfig } from "../../../ts-common/core";
2
- import { ICol, IColumnsWidth, IGridConfig, IRendererConfig, IRow, colType } from "./../types";
2
+ import { ICol, IColumnsWidth, IGridConfig, 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
- export declare function calculatePositions(width: number, height: number, scroll: any, conf: IRendererConfig, data: IRow[]): {
5
+ export declare function calculatePositions(width: number, height: number, scroll: any, conf: IGridConfig, data: IRow[]): {
6
6
  xStart: number;
7
7
  xEnd: number;
8
8
  yStart: number;
@@ -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;
@@ -101,6 +104,8 @@ interface IFixedRows {
101
104
  export interface IRendererConfig extends IGridConfig {
102
105
  scroll?: IScrollState;
103
106
  datacollection: any;
107
+ columns?: ICol[];
108
+ filteredColumns?: ICol[];
104
109
  currentColumns?: ICol[];
105
110
  currentRows?: IRow[];
106
111
  fixedColumns?: IFixedColumns;
@@ -191,6 +196,11 @@ export interface IHeaderFilter {
191
196
  export interface ICellRect extends ICoords, ISizes {
192
197
  }
193
198
  export declare type colType = "string" | "number" | "boolean" | "date" | "percent" | any;
199
+ export interface IOption {
200
+ id: Id;
201
+ value: string;
202
+ }
203
+ export declare type TOption = IOption | string;
194
204
  export interface ICol {
195
205
  id: Id;
196
206
  width?: number;
@@ -206,7 +216,7 @@ export interface ICol {
206
216
  editable?: boolean;
207
217
  resizable?: boolean;
208
218
  sortable?: boolean;
209
- options?: any[];
219
+ options?: (col: ICol, row?: IRow) => TOption[] | TOption[];
210
220
  draggable?: boolean;
211
221
  htmlEnable?: boolean;
212
222
  template?: (cellValue: any, row: IRow, col: ICol) => string;
@@ -224,6 +234,7 @@ export interface ICol {
224
234
  $width?: number;
225
235
  $fixed?: boolean;
226
236
  $htmlEnable?: boolean;
237
+ $customOptions?: any;
227
238
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
228
239
  dateFormat?: string;
229
240
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
@@ -506,6 +517,12 @@ export declare type IDirection = "horizontal" | "vertical";
506
517
  export declare type IDragType = "row" | "column" | "both";
507
518
  export declare type AdjustTargetType = "data" | "header" | "footer";
508
519
  export declare type IAdjustBy = AdjustTargetType | boolean;
520
+ export interface IAdjustColumns {
521
+ rows: IRow[];
522
+ cols: ICol[];
523
+ totalCols?: ICol[];
524
+ adjust?: IAdjustBy;
525
+ }
509
526
  export interface ISelectionConfig {
510
527
  disabled?: boolean;
511
528
  }
@@ -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.1",
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.1 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,29 @@
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)
1
+ Version 8.1.1 (May 18, 2023)
8
2
  ----------------------------
9
3
 
4
+ # Version 8.1 (April 18, 2023)
5
+
6
+ ### New functionality
7
+
8
+ - New "exportStyles" property
9
+
10
+ ### Updates
11
+
12
+ - The "pdf()" method was updated:
13
+ - new options of the export object are added: "theme", "exportStyles"
14
+ - new options of the pdf object are added: "pageRanges", "displayHeaderFooter", "footerTemplate", "headerTemplate"
15
+ - The "png()" method was updated:
16
+ - new options of the export object are added: "theme", "exportStyles"
17
+
18
+ Version 8.0.3 (April 12, 2023)
19
+ ----------------------------
20
+
21
+ Version 8.0.2 (March 20, 2023)
22
+ ----------------------------
23
+
24
+ Version 8.0.1 (March 13, 2023)
25
+ ----------------------------
26
+
10
27
  Version 8.0.0 (February 24, 2023)
11
28
 
12
29
  ### New functionality