Skip to content

Fix/typescript import issue #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@

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.

<a name="0.7.0"></a>
# 0.7.0 (2023-05-16)


### Bug Fixes

* 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))
* 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))
* int cells were not supported in dataSet format ([513ae48](https://github.com/securedeveloper/react-data-export/commit/513ae48))
* package vulnerabilities. ([082947a](https://github.com/securedeveloper/react-data-export/commit/082947a))
* package vulnerabilities. ([d66eb9e](https://github.com/securedeveloper/react-data-export/commit/d66eb9e))
* package.json to reduce vulnerabilities ([cfc5ecb](https://github.com/securedeveloper/react-data-export/commit/cfc5ecb))
* remove package.lock to stabalize ([6e66121](https://github.com/securedeveloper/react-data-export/commit/6e66121))
* updated package to tempa-xlsx, updated jest test environment and imports. ([b4f03ac](https://github.com/securedeveloper/react-data-export/commit/b4f03ac))
* **graphite:** move to npm package ([560b2f9](https://github.com/securedeveloper/react-data-export/commit/560b2f9)), closes [issue#41](https://github.com/issue/issues/41)


### Features

* add excel data export ([94530e3](https://github.com/securedeveloper/react-data-export/commit/94530e3))
* add jest support ([ff3a2ba](https://github.com/securedeveloper/react-data-export/commit/ff3a2ba))
* add react component typings ([25528dd](https://github.com/securedeveloper/react-data-export/commit/25528dd))
* if the header has style then the style should be used ([855d37a](https://github.com/securedeveloper/react-data-export/commit/855d37a))
* support col width ([dc6dc60](https://github.com/securedeveloper/react-data-export/commit/dc6dc60))
* update example with col widths ([4863aaf](https://github.com/securedeveloper/react-data-export/commit/4863aaf))



<a name="0.6.0"></a>
# [0.6.0](https://github.com/securedeveloper/react-data-export/compare/v0.5.0...v0.6.0) (2020-01-20)

Expand Down
144 changes: 144 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/* index.d.ts (C) react-data-export */

// TypeScript Version: 2.2
declare module 'react-data-export' {
import * as React from 'react';

export interface ExcelFileProps {
filename?: string;
fileExtension?: string;
element?: any; //Download Element
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelSheetProps>;
}

export interface ExcelSheetProps {
name: string;
data?: Array<object>;
dataSet?: Array<ExcelSheetData>;
value?: Array<string> | Function;
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelColumnProps>
}

export interface ExcelSheetData {
xSteps?: number;
ySteps?: number;
columns: Array<string> | Array<ExcelCellHeader>;
data: Array<Array<ExcelCellData>>;
}

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

export interface ExcelCellHeader {
title: string;
style?: ExcelStyle;
}

export interface ExcelCell {
value: ExcelValue;
style?: ExcelStyle;
}

export interface ExcelColumnProps {
label: string;
value: number | boolean | string | Function;
}

export interface ExcelStyle {
fill?: ExcelCellFillType;
font?: ExcelFont;
numFmt?: ExcelNumFormat;
alignment?: ExcelAlignment;
border?: ExcelBorder;
}

/* ExcelCell Fill Type */
export type ExcelCellPatternType = "solid" | "none";

export interface ExcelColorSpec {
auto?: number; //default 1
rgb?: string; //hex ARGB color
theme?: ExcelTheme;
indexed?: number;
}

export interface ExcelTheme {
theme: string;
tint: string;
}

export interface ExcelCellFillType {
patternType?: ExcelCellPatternType;
fgColor?: ExcelColorSpec;
bgColor?: ExcelColorSpec;
}

/* Excel Font */
export interface ExcelFont {
name?: string; // default `"Calibri"`
sz?: number; //font size in points default 11
color?: ExcelColorSpec;
bold?: boolean;
underline?: boolean;
italic?: boolean;
strike?: boolean;
outline?: boolean;
shadow?: boolean;
vertAlign?: boolean;
}

/* ExcelNumFormat */
export type ExcelNumFormat = "0" | "0.00%" | "0.0%" | "0.00%;\\(0.00%\\);\\-;@" | "m/dd/yy" | string;

/* ExcelAlignment */
export interface ExcelAlignment {
vertical?: ExcelAlignmentType;
horizontal?: ExcelAlignmentType;
wrapText?: boolean;
readingOrder?: ExcelReadingOrder;
textRotation?: ExcelTextRotation;
}

export type ExcelTextRotation = 0 | 45 | 90 | 135 | 180 | 255;

export enum ExcelReadingOrder { LeftToRight = 1, RightToLeft}

export type ExcelAlignmentType = "bottom" | "center" | "top";

/* ExcelBorder */
export interface ExcelBorder {
style: ExcelBorderStyle;
color: ExcelColorSpec;
}

export type ExcelBorderStyle =
"thin"
| "medium"
| "thick"
| "dotted"
| "hair"
| "dashed"
| "mediumDashed"
| "dashDot"
| "mediumDashDot"
| "dashDotDot"
| "mediumDashDotDot"
| "slantDashDot";

export class ExcelColumn extends React.Component<ExcelColumnProps, any> {
}

export class ExcelSheet extends React.Component<ExcelSheetProps, any> {
}

export class ExcelFile extends React.Component<ExcelFileProps, any> {
}

export namespace ReactExport {
export class ExcelFile extends React.Component<ExcelFileProps, any> {
static ExcelSheet: React.ElementType<ExcelSheetProps>;
static ExcelColumn: React.ElementType<ExcelColumnProps>;
}
}
export default ReactExport
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-data-export",
"version": "0.6.0",
"version": "0.7.0",
"main": "dist/index.js",
"types": "types/index.d.ts",
"description": "A set of tools to export dataset from react to different formats.",
Expand Down
25 changes: 16 additions & 9 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
/* index.d.ts (C) react-data-export */

// TypeScript Version: 2.2
declare module 'react-data-export' {
import * as React from 'react'
// declare module 'react-data-export' {
import * as React from 'react';

export interface ExcelFileProps {
filename?: string;
fileExtension?: string;
element?: any; //Download Element
children?: Array<React.ReactChild> | React.ReactChild; // Array<ExcelSheetProps>;
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelSheetProps>;
}

export interface ExcelSheetProps {
name: string;
data?: Array<object>;
dataSet?: Array<ExcelSheetData>;
value?: Array<string> | Function;
children?: Array<React.ReactChild> | React.ReactChild; // Array<ExcelColumnProps>
children?: Array<React.ReactElement> | React.ReactElement; // Array<ExcelColumnProps>
}

export interface ExcelSheetData {
xSteps?: number;
ySteps?: number;
columns: Array<string>;
data: Array<ExcelCellData>;
columns: Array<string> | Array<ExcelCellHeader>;
data: Array<Array<ExcelCellData>>;
}

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

export interface ExcelCellHeader {
title: string;
style?: ExcelStyle;
}

export interface ExcelCell {
value: ExcelCell;
style: ExcelStyle;
value: ExcelValue;
style?: ExcelStyle;
}

export interface ExcelColumnProps {
Expand Down Expand Up @@ -131,7 +136,9 @@ declare module 'react-data-export' {

export namespace ReactExport {
export class ExcelFile extends React.Component<ExcelFileProps, any> {
static ExcelSheet: React.ElementType<ExcelSheetProps>;
static ExcelColumn: React.ElementType<ExcelColumnProps>;
}
}
export default ReactExport
}
// }