From 5c0a1e2780322e480696cbcb1aa3b77efc5f1404 Mon Sep 17 00:00:00 2001 From: msz <2473872761@qq.com> Date: Wed, 27 May 2020 16:36:01 +0800 Subject: [PATCH 1/5] rewrite with TS --- .npmignore | 4 +- .npmrc | 4 ++ .yarnrc | 2 + components/cell.js | 49 ---------------------- components/cols.js | 63 ----------------------------- components/rows.js | 66 ------------------------------ components/table.js | 57 -------------------------- package.json | 75 ++++++++++++++++++---------------- publish.sh | 4 ++ src/components/cell.tsx | 55 +++++++++++++++++++++++++ src/components/cols.tsx | 74 ++++++++++++++++++++++++++++++++++ src/components/rows.tsx | 87 ++++++++++++++++++++++++++++++++++++++++ src/components/table.tsx | 64 +++++++++++++++++++++++++++++ src/index.ts | 4 ++ src/utils/index.ts | 3 ++ tsconfig.json | 72 +++++++++++++++++++++++++++++++++ tslint.json | 69 +++++++++++++++++++++++++++++++ utils/index.js | 1 - 18 files changed, 481 insertions(+), 272 deletions(-) create mode 100644 .npmrc create mode 100644 .yarnrc delete mode 100644 components/cell.js delete mode 100644 components/cols.js delete mode 100644 components/rows.js delete mode 100644 components/table.js create mode 100644 publish.sh create mode 100644 src/components/cell.tsx create mode 100644 src/components/cols.tsx create mode 100644 src/components/rows.tsx create mode 100644 src/components/table.tsx create mode 100644 src/index.ts create mode 100644 src/utils/index.ts create mode 100644 tsconfig.json create mode 100644 tslint.json delete mode 100644 utils/index.js diff --git a/.npmignore b/.npmignore index 96236f8..d1db253 100644 --- a/.npmignore +++ b/.npmignore @@ -1 +1,3 @@ -example \ No newline at end of file +src/ +tsconfig.json +tslint.json \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..8d58cb1 --- /dev/null +++ b/.npmrc @@ -0,0 +1,4 @@ +registry=http://192.168.1.23:7001 +phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs +puppeteer_download_host=https://npm.taobao.org/mirrors +package-lock=false diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 0000000..0127c9c --- /dev/null +++ b/.yarnrc @@ -0,0 +1,2 @@ +--registry "https://registry.npm.taobao.org" +--no-lockfile true \ No newline at end of file diff --git a/components/cell.js b/components/cell.js deleted file mode 100644 index aa6a3ee..0000000 --- a/components/cell.js +++ /dev/null @@ -1,49 +0,0 @@ -import React, { Component } from 'react'; -import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; - -export class Cell extends Component { - static propTypes = { - style: ViewPropTypes.style, - textStyle: Text.propTypes.style, - borderStyle: ViewPropTypes.style - }; - - render() { - const { data, width, height, flex, style, textStyle, borderStyle, ...props } = this.props; - const textDom = React.isValidElement(data) ? ( - data - ) : ( - - {data} - - ); - const borderTopWidth = (borderStyle && borderStyle.borderWidth) || 0; - const borderRightWidth = borderTopWidth; - const borderColor = (borderStyle && borderStyle.borderColor) || '#000'; - - return ( - - {textDom} - - ); - } -} - -const styles = StyleSheet.create({ - cell: { justifyContent: 'center' }, - text: { backgroundColor: 'transparent' } -}); \ No newline at end of file diff --git a/components/cols.js b/components/cols.js deleted file mode 100644 index c039ebe..0000000 --- a/components/cols.js +++ /dev/null @@ -1,63 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; -import { Cell } from './cell'; -import { sum } from '../utils'; - -export class Col extends Component { - static propTypes = { - width: PropTypes.number, - style: ViewPropTypes.style, - textStyle: Text.propTypes.style - }; - - render() { - const { data, style, width, heightArr, flex, textStyle, ...props } = this.props; - - return data ? ( - - {data.map((item, i) => { - const height = heightArr && heightArr[i]; - return ; - })} - - ) : null; - } -} - -export class Cols extends Component { - static propTypes = { - style: ViewPropTypes.style, - textStyle: Text.propTypes.style - }; - - render() { - const { data, style, widthArr, heightArr, flexArr, textStyle, ...props } = this.props; - let width = widthArr ? sum(widthArr) : 0; - - return data ? ( - - {data.map((item, i) => { - const flex = flexArr && flexArr[i]; - const wth = widthArr && widthArr[i]; - return ( - - ); - })} - - ) : null; - } -} - -const styles = StyleSheet.create({ - cols: { flexDirection: 'row' } -}); diff --git a/components/rows.js b/components/rows.js deleted file mode 100644 index a125f04..0000000 --- a/components/rows.js +++ /dev/null @@ -1,66 +0,0 @@ -import React, { Component } from 'react'; -import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; -import { Cell } from './cell'; -import { sum } from '../utils'; - -export class Row extends Component { - static propTypes = { - style: ViewPropTypes.style, - textStyle: Text.propTypes.style - }; - - render() { - const { data, style, widthArr, height, flexArr, textStyle, ...props } = this.props; - let width = widthArr ? sum(widthArr) : 0; - - return data ? ( - - {data.map((item, i) => { - const flex = flexArr && flexArr[i]; - const wth = widthArr && widthArr[i]; - return ; - })} - - ) : null; - } -} - -export class Rows extends Component { - static propTypes = { - style: ViewPropTypes.style, - textStyle: Text.propTypes.style - }; - - render() { - const { data, style, widthArr, heightArr, flexArr, textStyle, ...props } = this.props; - const flex = flexArr ? sum(flexArr) : 0; - const width = widthArr ? sum(widthArr) : 0; - - return data ? ( - - {data.map((item, i) => { - const height = heightArr && heightArr[i]; - return ( - - ); - })} - - ) : null; - } -} - -const styles = StyleSheet.create({ - row: { - flexDirection: 'row', - overflow: 'hidden' - } -}); \ No newline at end of file diff --git a/components/table.js b/components/table.js deleted file mode 100644 index aa5dea2..0000000 --- a/components/table.js +++ /dev/null @@ -1,57 +0,0 @@ -import React, { Component } from 'react'; -import { View, ViewPropTypes } from 'react-native'; - -export class Table extends Component { - static propTypes = { - style: ViewPropTypes.style, - borderStyle: ViewPropTypes.style - }; - - _renderChildren(props) { - return React.Children.map(props.children, child => - React.cloneElement( - child, - props.borderStyle && child.type.displayName !== 'ScrollView' ? { borderStyle: props.borderStyle } : {} - ) - ); - } - - render() { - const { borderStyle } = this.props; - const borderLeftWidth = (borderStyle && borderStyle.borderWidth) || 0; - const borderBottomWidth = borderLeftWidth; - const borderColor = (borderStyle && borderStyle.borderColor) || '#000'; - - return ( - - {this._renderChildren(this.props)} - - ); - } -} - -export class TableWrapper extends Component { - static propTypes = { - style: ViewPropTypes.style - }; - - _renderChildren(props) { - return React.Children.map(props.children, child => - React.cloneElement(child, props.borderStyle ? { borderStyle: props.borderStyle } : {}) - ); - } - - render() { - const { style } = this.props; - return {this._renderChildren(this.props)}; - } -} diff --git a/package.json b/package.json index 5ea97fe..469921a 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,41 @@ { - "name": "react-native-table-component", - "version": "1.2.1", - "description": "Build table for react native.", - "main": "index.js", - "scripts": { - "lint": "eslint .", - "prettify": "prettier --write components/**/*.js utils/**/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Gil2015/react-native-table-component.git" - }, - "keywords": [ - "react-native", - "table", - "react-native-cell", - "react-native-table", - "react-native-table-component" - ], - "author": "gil2015", - "license": "MIT", - "bugs": { - "url": "https://github.com/Gil2015/react-native-table-component/issues" - }, - "homepage": "https://github.com/Gil2015/react-native-table-component#readme", - "devDependencies": { - "babel-eslint": "^10.0.1", - "eslint": "^5.10.0", - "eslint-plugin-react": "^7.11.1", - "eslint-plugin-react-native": "^3.5.0", - "prettier": "^1.15.3", - "react": "^16.7.0", - "react-native": "^0.57.8" - } -} + "name": "react-native-table-component", + "version": "1.2.1", + "description": "Build table for react native.", + "main": "dist/index.js", + "scripts": { + "test": "tsc -w", + "lint": "tslint -p tsconfig.json", + "prettify": "prettier --write components/**/*.js utils/**/*.js", + "compile": "tsc", + "build": "npm run lint && npm run compile" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Gil2015/react-native-table-component.git" + }, + "keywords": [ + "react-native", + "table", + "react-native-cell", + "react-native-table", + "react-native-table-component" + ], + "author": "gil2015", + "license": "MIT", + "bugs": { + "url": "https://github.com/Gil2015/react-native-table-component/issues" + }, + "homepage": "https://github.com/Gil2015/react-native-table-component#readme", + "devDependencies": { + "prettier": "^1.15.3", + "@types/react": "latest", + "@types/react-native": "latest", + "del": "latest", + "prompts": "latest", + "react": "latest", + "react-native": "latest", + "tslint": "latest", + "typescript": "next" + } +} \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100644 index 0000000..9896f0f --- /dev/null +++ b/publish.sh @@ -0,0 +1,4 @@ +#! /bin/bash +npm version '4.6.'$(date +%Y%m%d%H%M) +npm run build +npm publish --tag latest --access public diff --git a/src/components/cell.tsx b/src/components/cell.tsx new file mode 100644 index 0000000..755dc3c --- /dev/null +++ b/src/components/cell.tsx @@ -0,0 +1,55 @@ +import React, { Component } from 'react'; +import { View, Text, StyleSheet, ViewStyle, TextStyle } from 'react-native'; + +interface ICellOptions { + data: string | JSX.Element; + width?: number; + height?: number; + flex?: number; + style?: ViewStyle; + textStyle?: TextStyle; + borderStyle?: ViewStyle; +} + +export class Cell extends Component { + + public render() { + const { data, width, height, flex, style, textStyle, borderStyle, ...props } = this.props; + const textDom = React.isValidElement(data) ? ( + data + ) : ( + + {data} + + ); + const borderTopWidth = (borderStyle && borderStyle.borderWidth) || 0; + const borderRightWidth = borderTopWidth; + const borderColor = (borderStyle && borderStyle.borderColor) || '#000'; + + return ( + + {textDom} + + ); + } + +} + +const styles = StyleSheet.create({ + cell: { justifyContent: 'center' }, + text: { backgroundColor: 'transparent' } +}); diff --git a/src/components/cols.tsx b/src/components/cols.tsx new file mode 100644 index 0000000..6570e07 --- /dev/null +++ b/src/components/cols.tsx @@ -0,0 +1,74 @@ +import React, { Component } from 'react'; +import { View, StyleSheet, ViewStyle, TextStyle } from 'react-native'; +import { Cell } from './cell'; +import { sum } from '../utils'; + +interface IColOptions { + data: string[] | JSX.Element[]; + style?: ViewStyle; + width?: number; + heightArr: number[]; + flex: number; + textStyle?: TextStyle; +} + +export class Col extends Component { + + public render() { + const { data, style, width, heightArr, flex, textStyle, ...props } = this.props; + + return data ? ( + + {[...data].map((item, i) => { + const height = heightArr && heightArr[i]; + return ; + })} + + ) : null; + } + +} + + +interface IColsOptions { + data: string[][] | JSX.Element[][]; + style?: ViewStyle; + widthArr: number[]; + heightArr: number[]; + flexArr: number[]; + textStyle?: TextStyle; +} + +// tslint:disable-next-line: max-classes-per-file +export class Cols extends Component { + + public render() { + const { data, style, widthArr, heightArr, flexArr, textStyle, ...props } = this.props; + const width = widthArr ? sum(widthArr) : 0; + + return data ? ( + + {[...data].map((item, i) => { + const flex = flexArr && flexArr[i]; + const wth = widthArr && widthArr[i]; + return ( + + ); + })} + + ) : null; + } +} + +const styles = StyleSheet.create({ + cols: { flexDirection: 'row' } +}); diff --git a/src/components/rows.tsx b/src/components/rows.tsx new file mode 100644 index 0000000..a3ae568 --- /dev/null +++ b/src/components/rows.tsx @@ -0,0 +1,87 @@ +import React, { Component } from 'react'; +import { View, StyleSheet, ViewStyle, TextStyle } from 'react-native'; +import { Cell } from './cell'; +import { sum } from '../utils'; + +interface IRowOptions { + data: string[] | JSX.Element[]; + style?: ViewStyle; + widthArr?: number[]; + height: number; + flexArr: number[]; + textStyle?: TextStyle; +} + +export class Row extends Component { + + public render() { + const { data, style, widthArr, height, flexArr, textStyle, ...props } = this.props; + const width = widthArr ? sum(widthArr) : 0; + + return data ? ( + + {[...data].map((item, i) => { + const flex = flexArr && flexArr[i]; + const wth = widthArr && widthArr[i]; + return ; + })} + + ) : null; + } + +} + + +interface IRowsOptions { + data: string[][] | JSX.Element[][]; + style?: ViewStyle; + widthArr?: number[]; + heightArr: number[]; + flexArr: number[]; + textStyle?: TextStyle; +} + +// tslint:disable-next-line: max-classes-per-file +export class Rows extends Component { + + public render() { + const { data, style, widthArr, heightArr, flexArr, textStyle, ...props } = this.props; + const flex = flexArr ? sum(flexArr) : 0; + const width = widthArr ? sum(widthArr) : 0; + + return data ? ( + + {[...data].map((item, i) => { + const height = heightArr && heightArr[i]; + return ( + + ); + })} + + ) : null; + } + +} + +const styles = StyleSheet.create({ + row: { + flexDirection: 'row', + overflow: 'hidden' + } +}); \ No newline at end of file diff --git a/src/components/table.tsx b/src/components/table.tsx new file mode 100644 index 0000000..36e7123 --- /dev/null +++ b/src/components/table.tsx @@ -0,0 +1,64 @@ +import React, { Component, ReactNode, ReactElement } from 'react'; +import { View, ViewStyle } from 'react-native'; + +interface ITableOptions { + style?: ViewStyle; + borderStyle?: ViewStyle; +} + +export class Table extends Component { + + private _renderChildren(props: Readonly & Readonly<{ children?: ReactNode }>) { + return React.Children.map(props.children, child => + React.cloneElement( + (child as unknown as ReactElement), + props.borderStyle && (child as unknown as { type: { displayName: string } }).type.displayName !== 'ScrollView' ? { borderStyle: props.borderStyle } : {} + ) + ); + } + + public render() { + const { borderStyle } = this.props; + const borderLeftWidth = (borderStyle && borderStyle.borderWidth) || 0; + const borderBottomWidth = borderLeftWidth; + const borderColor = (borderStyle && borderStyle.borderColor) || '#000'; + + return ( + + {this._renderChildren(this.props)} + + ); + } + +} + + +interface ITableWrapperOptions { + style?: ViewStyle; + borderStyle?: ViewStyle; +} + +// tslint:disable-next-line: max-classes-per-file +export class TableWrapper extends Component { + + private _renderChildren(props: Readonly & Readonly<{ children?: ReactNode }>) { + return React.Children.map(props.children, child => + React.cloneElement((child as unknown as ReactElement), props.borderStyle ? { borderStyle: props.borderStyle } : {}) + ); + } + + public render() { + const { style } = this.props; + return {this._renderChildren(this.props)}; + } + +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..0187de7 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,4 @@ +export { Row, Rows } from './components/rows'; +export { Col, Cols } from './components/cols'; +export { Table, TableWrapper } from './components/table'; +export { Cell } from './components/cell'; diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..36b5954 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,3 @@ +export function sum(arr: number[]) { + return arr.reduce((acc, n) => acc + n, 0); +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f81be80 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,72 @@ +{ + "include": [ + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": [ + "./dist/" + ], + "compileOnSave": false, + "compilerOptions": { + "module": "commonjs", + "target": "esnext", + "jsx": "react", + "noImplicitAny": true, + "sourceMap": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "strictNullChecks": true, + "noImplicitThis": true, + "rootDir": "./src/", + "rootDirs": [], + "outDir": "./dist/", + "allowJs": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "alwaysStrict": true, + "baseUrl": "", + "charset": "utf8", + "declaration": true, + "inlineSourceMap": false, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "diagnostics": false, + "emitBOM": false, + "forceConsistentCasingInFileNames": false, + "importHelpers": false, + "inlineSources": false, + "isolatedModules": false, + "lib": [ + "esnext" + ], + "listFiles": false, + "listEmittedFiles": false, + "locale": "zh_CN", + "newLine": "lf", + "noEmit": false, + "moduleResolution": "node", + "noEmitHelpers": false, + "noEmitOnError": false, + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "maxNodeModuleJsDepth": 0, + "noLib": false, + "noFallthroughCasesInSwitch": true, + "noResolve": false, + "noUnusedLocals": true, + "noUnusedParameters": true, + "paths": {}, + "preserveConstEnums": false, + "pretty": true, + "removeComments": false, + "skipDefaultLibCheck": true, + "skipLibCheck": true, + "stripInternal": false, + "suppressExcessPropertyErrors": false, + "suppressImplicitAnyIndexErrors": true, + "traceResolution": false, + "typeRoots": [], + "types": [], + "watch": false + } +} \ No newline at end of file diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..65af5aa --- /dev/null +++ b/tslint.json @@ -0,0 +1,69 @@ +{ + "extends": "tslint:recommended", + "rulesDirectory": [ + "./" + ], + "rules": { + "no-any": true, + "forin": false, + "prefer-for-of": false, + "no-unused-expression": true, + "unified-signatures": false, + "whitespace": [ + true, + "check-branch", + "check-operator" + ], + "indent": [ + true, + "tabs", + 2 + ], + "quotemark": [ + true, + "single", + "avoid-escape", + "avoid-template" + ], + "max-line-length": false, + "trailing-comma": [ + true, + { + "multiline": "never", + "singleline": "never" + } + ], + "variable-name": [ + true, + "ban-keywords", + "check-format", + "allow-leading-underscore", + "allow-snake-case" + ], + "interface-name": false, + "object-literal-key-quotes": [ + true, + "as-needed" + ], + "no-bitwise": false, + "no-empty": false, + "align": [ + true, + "elements", + "members", + "statements" + ], + "new-parens": true, + "no-arg": true, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": false, + "no-console": false + }, + "jsRules": { + "max-line-length": { + "options": [ + 120 + ] + } + } +} \ No newline at end of file diff --git a/utils/index.js b/utils/index.js deleted file mode 100644 index 39426c6..0000000 --- a/utils/index.js +++ /dev/null @@ -1 +0,0 @@ -export const sum = arr => arr.reduce((acc, n) => acc + n, 0); From 4e8f8582290b25789c8303ef19205d007572437b Mon Sep 17 00:00:00 2001 From: msz <2473872761@qq.com> Date: Wed, 27 May 2020 16:36:29 +0800 Subject: [PATCH 2/5] 4.6.202005271636 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 469921a..84fde40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-table-component", - "version": "1.2.1", + "version": "4.6.202005271636", "description": "Build table for react native.", "main": "dist/index.js", "scripts": { @@ -38,4 +38,4 @@ "tslint": "latest", "typescript": "next" } -} \ No newline at end of file +} From d070abee0c341b940f55bcda5fe9a462500e0581 Mon Sep 17 00:00:00 2001 From: msz <2473872761@qq.com> Date: Wed, 27 May 2020 16:37:22 +0800 Subject: [PATCH 3/5] 4.6.202005271637 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84fde40..c17c4ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-table-component", - "version": "4.6.202005271636", + "version": "4.6.202005271637", "description": "Build table for react native.", "main": "dist/index.js", "scripts": { From 79dc8b7e9c66c17e6998763e4127181e5cc90321 Mon Sep 17 00:00:00 2001 From: msz <2473872761@qq.com> Date: Wed, 27 May 2020 16:58:01 +0800 Subject: [PATCH 4/5] fix config --- .eslintignore | 5 ----- .eslintrc | 24 ------------------------ .npmignore | 11 ++++++++++- package.json | 10 ++++++++-- publish.sh | 1 - src/components/cols.tsx | 10 +++++----- src/components/rows.tsx | 8 ++++---- tsconfig.json | 2 +- 8 files changed, 28 insertions(+), 43 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index a273f56..0000000 --- a/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -lib* -build - -example \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0c7d041..0000000 --- a/.eslintrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parser": "babel-eslint", - "env": { - "browser": true, - "node": true - }, - "plugins": ["react", "react-native"], - "extends": ["eslint:recommended", "plugin:react/recommended"], - "globals": { - "describe": false, - "it": false, - "expect": false, - "beforeEach": false, - "before": false, - "afterEach": false, - "after": false, - "jest": false, - "global": false - }, - "rules": { - "quotes": ["error", "single", { "allowTemplateLiterals": true }], - "semi": ["error", "always"] - } -} \ No newline at end of file diff --git a/.npmignore b/.npmignore index d1db253..8ec6214 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,12 @@ src/ +node_modules/ +.vscode/ tsconfig.json -tslint.json \ No newline at end of file +tslint.json +.babelrc +.cnpmrc +.gitignore +.npmignore +.npmrc +.yarnrc +publish.sh \ No newline at end of file diff --git a/package.json b/package.json index c17c4ea..9621bb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-table-component", - "version": "4.6.202005271637", + "version": "1.2.1", "description": "Build table for react native.", "main": "dist/index.js", "scripts": { @@ -22,6 +22,12 @@ "react-native-table-component" ], "author": "gil2015", + "maintainers": [ + { + "name": "mashizhen", + "email": "dohard@163.com" + } + ], "license": "MIT", "bugs": { "url": "https://github.com/Gil2015/react-native-table-component/issues" @@ -38,4 +44,4 @@ "tslint": "latest", "typescript": "next" } -} +} \ No newline at end of file diff --git a/publish.sh b/publish.sh index 9896f0f..c8625a4 100644 --- a/publish.sh +++ b/publish.sh @@ -1,4 +1,3 @@ #! /bin/bash -npm version '4.6.'$(date +%Y%m%d%H%M) npm run build npm publish --tag latest --access public diff --git a/src/components/cols.tsx b/src/components/cols.tsx index 6570e07..a3589d5 100644 --- a/src/components/cols.tsx +++ b/src/components/cols.tsx @@ -7,8 +7,8 @@ interface IColOptions { data: string[] | JSX.Element[]; style?: ViewStyle; width?: number; - heightArr: number[]; - flex: number; + heightArr?: number[]; + flex?: number; textStyle?: TextStyle; } @@ -33,9 +33,9 @@ export class Col extends Component { interface IColsOptions { data: string[][] | JSX.Element[][]; style?: ViewStyle; - widthArr: number[]; - heightArr: number[]; - flexArr: number[]; + widthArr?: number[]; + heightArr?: number[]; + flexArr?: number[]; textStyle?: TextStyle; } diff --git a/src/components/rows.tsx b/src/components/rows.tsx index a3ae568..1fffa4b 100644 --- a/src/components/rows.tsx +++ b/src/components/rows.tsx @@ -7,8 +7,8 @@ interface IRowOptions { data: string[] | JSX.Element[]; style?: ViewStyle; widthArr?: number[]; - height: number; - flexArr: number[]; + height?: number; + flexArr?: number[]; textStyle?: TextStyle; } @@ -40,8 +40,8 @@ interface IRowsOptions { data: string[][] | JSX.Element[][]; style?: ViewStyle; widthArr?: number[]; - heightArr: number[]; - flexArr: number[]; + heightArr?: number[]; + flexArr?: number[]; textStyle?: TextStyle; } diff --git a/tsconfig.json b/tsconfig.json index f81be80..03dfff3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ ], "compileOnSave": false, "compilerOptions": { - "module": "commonjs", + "module": "CommonJS", "target": "esnext", "jsx": "react", "noImplicitAny": true, From cafe6c34f1498c404a63050ff8319c87b5f19331 Mon Sep 17 00:00:00 2001 From: msz <2473872761@qq.com> Date: Wed, 27 May 2020 17:50:35 +0800 Subject: [PATCH 5/5] remove --- .npmrc | 4 ---- .yarnrc | 2 -- 2 files changed, 6 deletions(-) delete mode 100644 .npmrc delete mode 100644 .yarnrc diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 8d58cb1..0000000 --- a/.npmrc +++ /dev/null @@ -1,4 +0,0 @@ -registry=http://192.168.1.23:7001 -phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs -puppeteer_download_host=https://npm.taobao.org/mirrors -package-lock=false diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index 0127c9c..0000000 --- a/.yarnrc +++ /dev/null @@ -1,2 +0,0 @@ ---registry "https://registry.npm.taobao.org" ---no-lockfile true \ No newline at end of file