diff --git a/CHANGELOG.md b/CHANGELOG.md index 922c4487..2a9f63be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. + +# 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)) + + + # [0.6.0](https://github.com/securedeveloper/react-data-export/compare/v0.5.0...v0.6.0) (2020-01-20) diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 00000000..4faae14b --- /dev/null +++ b/dist/index.d.ts @@ -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; // Array; + } + + export interface ExcelSheetProps { + name: string; + data?: Array; + dataSet?: Array; + value?: Array | Function; + children?: Array | React.ReactElement; // Array + } + + export interface ExcelSheetData { + xSteps?: number; + ySteps?: number; + columns: Array | Array; + data: Array>; + } + + export type ExcelCellData = ExcelValue | ExcelCell | Array; + 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 { + } + + export class ExcelSheet extends React.Component { + } + + export class ExcelFile extends React.Component { + } + + export namespace ReactExport { + export class ExcelFile extends React.Component { + static ExcelSheet: React.ElementType; + static ExcelColumn: React.ElementType; + } + } + export default ReactExport +} \ No newline at end of file diff --git a/package.json b/package.json index 6313f869..c23f52f5 100644 --- a/package.json +++ b/package.json @@ -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.", diff --git a/types/index.d.ts b/types/index.d.ts index 1ee4149a..750a7608 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,14 +1,14 @@ /* 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; // Array; + children?: Array | React.ReactElement; // Array; } export interface ExcelSheetProps { @@ -16,22 +16,27 @@ declare module 'react-data-export' { data?: Array; dataSet?: Array; value?: Array | Function; - children?: Array | React.ReactChild; // Array + children?: Array | React.ReactElement; // Array } export interface ExcelSheetData { xSteps?: number; ySteps?: number; - columns: Array; - data: Array; + columns: Array | Array; + data: Array>; } export type ExcelCellData = ExcelValue | ExcelCell | Array; 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 { @@ -131,7 +136,9 @@ declare module 'react-data-export' { export namespace ReactExport { export class ExcelFile extends React.Component { + static ExcelSheet: React.ElementType; + static ExcelColumn: React.ElementType; } } export default ReactExport -} +// } \ No newline at end of file