Skip to content

Commit e61b2b8

Browse files
authored
Merge pull request #1 from imsuvesh/fix/typescript-import-issue
Fix/typescript import issue
2 parents 094f67f + e6814df commit e61b2b8

File tree

4 files changed

+189
-10
lines changed

4 files changed

+189
-10
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
<a name="0.7.0"></a>
6+
# 0.7.0 (2023-05-16)
7+
8+
9+
### Bug Fixes
10+
11+
* Fixed[#41](https://github.com/securedeveloper/react-data-export/issues/41), Fixed[#55](https://github.com/securedeveloper/react-data-export/issues/55), Fixed[#66](https://github.com/securedeveloper/react-data-export/issues/66), Fixed[#67](https://github.com/securedeveloper/react-data-export/issues/67), Fixed[#68](https://github.com/securedeveloper/react-data-export/issues/68), Fixed[#69](https://github.com/securedeveloper/react-data-export/issues/69), Fixed[#72](https://github.com/securedeveloper/react-data-export/issues/72) ([0144afc](https://github.com/securedeveloper/react-data-export/commit/0144afc))
12+
* improve types to represent children, fix types to represent ExcelCellData with arrays (as in ex2 - multiDataSet) ([5f0d69d](https://github.com/securedeveloper/react-data-export/commit/5f0d69d))
13+
* int cells were not supported in dataSet format ([513ae48](https://github.com/securedeveloper/react-data-export/commit/513ae48))
14+
* package vulnerabilities. ([082947a](https://github.com/securedeveloper/react-data-export/commit/082947a))
15+
* package vulnerabilities. ([d66eb9e](https://github.com/securedeveloper/react-data-export/commit/d66eb9e))
16+
* package.json to reduce vulnerabilities ([cfc5ecb](https://github.com/securedeveloper/react-data-export/commit/cfc5ecb))
17+
* remove package.lock to stabalize ([6e66121](https://github.com/securedeveloper/react-data-export/commit/6e66121))
18+
* updated package to tempa-xlsx, updated jest test environment and imports. ([b4f03ac](https://github.com/securedeveloper/react-data-export/commit/b4f03ac))
19+
* **graphite:** move to npm package ([560b2f9](https://github.com/securedeveloper/react-data-export/commit/560b2f9)), closes [issue#41](https://github.com/issue/issues/41)
20+
21+
22+
### Features
23+
24+
* add excel data export ([94530e3](https://github.com/securedeveloper/react-data-export/commit/94530e3))
25+
* add jest support ([ff3a2ba](https://github.com/securedeveloper/react-data-export/commit/ff3a2ba))
26+
* add react component typings ([25528dd](https://github.com/securedeveloper/react-data-export/commit/25528dd))
27+
* if the header has style then the style should be used ([855d37a](https://github.com/securedeveloper/react-data-export/commit/855d37a))
28+
* support col width ([dc6dc60](https://github.com/securedeveloper/react-data-export/commit/dc6dc60))
29+
* update example with col widths ([4863aaf](https://github.com/securedeveloper/react-data-export/commit/4863aaf))
30+
31+
32+
533
<a name="0.6.0"></a>
634
# [0.6.0](https://github.com/securedeveloper/react-data-export/compare/v0.5.0...v0.6.0) (2020-01-20)
735

dist/index.d.ts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/* index.d.ts (C) react-data-export */
2+
3+
// TypeScript Version: 2.2
4+
declare module 'react-data-export' {
5+
import * as React from 'react';
6+
7+
export interface ExcelFileProps {
8+
filename?: string;
9+
fileExtension?: string;
10+
element?: any; //Download Element
11+
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelSheetProps>;
12+
}
13+
14+
export interface ExcelSheetProps {
15+
name: string;
16+
data?: Array<object>;
17+
dataSet?: Array<ExcelSheetData>;
18+
value?: Array<string> | Function;
19+
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelColumnProps>
20+
}
21+
22+
export interface ExcelSheetData {
23+
xSteps?: number;
24+
ySteps?: number;
25+
columns: Array<string> | Array<ExcelCellHeader>;
26+
data: Array<Array<ExcelCellData>>;
27+
}
28+
29+
export type ExcelCellData = ExcelValue | ExcelCell | Array<ExcelValue>;
30+
export type ExcelValue = string | number | Date | boolean;
31+
32+
export interface ExcelCellHeader {
33+
title: string;
34+
style?: ExcelStyle;
35+
}
36+
37+
export interface ExcelCell {
38+
value: ExcelValue;
39+
style?: ExcelStyle;
40+
}
41+
42+
export interface ExcelColumnProps {
43+
label: string;
44+
value: number | boolean | string | Function;
45+
}
46+
47+
export interface ExcelStyle {
48+
fill?: ExcelCellFillType;
49+
font?: ExcelFont;
50+
numFmt?: ExcelNumFormat;
51+
alignment?: ExcelAlignment;
52+
border?: ExcelBorder;
53+
}
54+
55+
/* ExcelCell Fill Type */
56+
export type ExcelCellPatternType = "solid" | "none";
57+
58+
export interface ExcelColorSpec {
59+
auto?: number; //default 1
60+
rgb?: string; //hex ARGB color
61+
theme?: ExcelTheme;
62+
indexed?: number;
63+
}
64+
65+
export interface ExcelTheme {
66+
theme: string;
67+
tint: string;
68+
}
69+
70+
export interface ExcelCellFillType {
71+
patternType?: ExcelCellPatternType;
72+
fgColor?: ExcelColorSpec;
73+
bgColor?: ExcelColorSpec;
74+
}
75+
76+
/* Excel Font */
77+
export interface ExcelFont {
78+
name?: string; // default `"Calibri"`
79+
sz?: number; //font size in points default 11
80+
color?: ExcelColorSpec;
81+
bold?: boolean;
82+
underline?: boolean;
83+
italic?: boolean;
84+
strike?: boolean;
85+
outline?: boolean;
86+
shadow?: boolean;
87+
vertAlign?: boolean;
88+
}
89+
90+
/* ExcelNumFormat */
91+
export type ExcelNumFormat = "0" | "0.00%" | "0.0%" | "0.00%;\\(0.00%\\);\\-;@" | "m/dd/yy" | string;
92+
93+
/* ExcelAlignment */
94+
export interface ExcelAlignment {
95+
vertical?: ExcelAlignmentType;
96+
horizontal?: ExcelAlignmentType;
97+
wrapText?: boolean;
98+
readingOrder?: ExcelReadingOrder;
99+
textRotation?: ExcelTextRotation;
100+
}
101+
102+
export type ExcelTextRotation = 0 | 45 | 90 | 135 | 180 | 255;
103+
104+
export enum ExcelReadingOrder { LeftToRight = 1, RightToLeft}
105+
106+
export type ExcelAlignmentType = "bottom" | "center" | "top";
107+
108+
/* ExcelBorder */
109+
export interface ExcelBorder {
110+
style: ExcelBorderStyle;
111+
color: ExcelColorSpec;
112+
}
113+
114+
export type ExcelBorderStyle =
115+
"thin"
116+
| "medium"
117+
| "thick"
118+
| "dotted"
119+
| "hair"
120+
| "dashed"
121+
| "mediumDashed"
122+
| "dashDot"
123+
| "mediumDashDot"
124+
| "dashDotDot"
125+
| "mediumDashDotDot"
126+
| "slantDashDot";
127+
128+
export class ExcelColumn extends React.Component<ExcelColumnProps, any> {
129+
}
130+
131+
export class ExcelSheet extends React.Component<ExcelSheetProps, any> {
132+
}
133+
134+
export class ExcelFile extends React.Component<ExcelFileProps, any> {
135+
}
136+
137+
export namespace ReactExport {
138+
export class ExcelFile extends React.Component<ExcelFileProps, any> {
139+
static ExcelSheet: React.ElementType<ExcelSheetProps>;
140+
static ExcelColumn: React.ElementType<ExcelColumnProps>;
141+
}
142+
}
143+
export default ReactExport
144+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-data-export",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"main": "dist/index.js",
55
"types": "types/index.d.ts",
66
"description": "A set of tools to export dataset from react to different formats.",

types/index.d.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
11
/* index.d.ts (C) react-data-export */
22

33
// TypeScript Version: 2.2
4-
declare module 'react-data-export' {
5-
import * as React from 'react'
4+
// declare module 'react-data-export' {
5+
import * as React from 'react';
66

77
export interface ExcelFileProps {
88
filename?: string;
99
fileExtension?: string;
1010
element?: any; //Download Element
11-
children?: Array<React.ReactChild> | React.ReactChild; // Array<ExcelSheetProps>;
11+
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelSheetProps>;
1212
}
1313

1414
export interface ExcelSheetProps {
1515
name: string;
1616
data?: Array<object>;
1717
dataSet?: Array<ExcelSheetData>;
1818
value?: Array<string> | Function;
19-
children?: Array<React.ReactChild> | React.ReactChild; // Array<ExcelColumnProps>
19+
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelColumnProps>
2020
}
2121

2222
export interface ExcelSheetData {
2323
xSteps?: number;
2424
ySteps?: number;
25-
columns: Array<string>;
26-
data: Array<ExcelCellData>;
25+
columns: Array<string> | Array<ExcelCellHeader>;
26+
data: Array<Array<ExcelCellData>>;
2727
}
2828

2929
export type ExcelCellData = ExcelValue | ExcelCell | Array<ExcelValue>;
3030
export type ExcelValue = string | number | Date | boolean;
3131

32+
export interface ExcelCellHeader {
33+
title: string;
34+
style?: ExcelStyle;
35+
}
36+
3237
export interface ExcelCell {
33-
value: ExcelCell;
34-
style: ExcelStyle;
38+
value: ExcelValue;
39+
style?: ExcelStyle;
3540
}
3641

3742
export interface ExcelColumnProps {
@@ -131,7 +136,9 @@ declare module 'react-data-export' {
131136

132137
export namespace ReactExport {
133138
export class ExcelFile extends React.Component<ExcelFileProps, any> {
139+
static ExcelSheet: React.ElementType<ExcelSheetProps>;
140+
static ExcelColumn: React.ElementType<ExcelColumnProps>;
134141
}
135142
}
136143
export default ReactExport
137-
}
144+
// }

0 commit comments

Comments
 (0)