Skip to content

Commit

Permalink
update ts
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Nov 16, 2020
1 parent 0d40e91 commit 9d7ab6b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 44 deletions.
17 changes: 3 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ const replace = require('gulp-replace')
const sourcemaps = require('gulp-sourcemaps')
const ts = require('gulp-typescript')
const pack = require('./package.json')
const tsconfig = require('./tsconfig.json')

const exportModuleName = 'VXETablePluginExportPDF'

gulp.task('build_commonjs', function () {
return gulp.src(['depend.ts', 'index.ts'])
.pipe(sourcemaps.init())
.pipe(ts({
strict: true,
moduleResolution: 'node',
noImplicitAny: true,
target: 'es6',
lib: ['dom', 'es6']
}))
.pipe(ts(tsconfig.compilerOptions))
.pipe(babel({
presets: ['@babel/env']
}))
Expand All @@ -33,13 +28,7 @@ gulp.task('build_commonjs', function () {

gulp.task('build_umd', function () {
return gulp.src(['depend.ts', 'index.ts'])
.pipe(ts({
strict: true,
moduleResolution: 'node',
noImplicitAny: true,
target: 'es6',
lib: ['dom', 'es6']
}))
.pipe(ts(tsconfig.compilerOptions))
.pipe(replace(`import XEUtils from 'xe-utils/ctor';`, `import XEUtils from 'xe-utils';`))
.pipe(babel({
moduleId: pack.name,
Expand Down
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Table,
InterceptorExportParams,
ColumnConfig,
ExportOptons
TableExportConfig
} from 'vxe-table/lib/vxe-table'
import jsPDF from 'jspdf'
/* eslint-enable no-unused-vars */
Expand All @@ -18,12 +18,12 @@ function getCellText (cellValue: any) {
return cellValue || ' '
}

function getFooterCellValue ($table: Table, opts: ExportOptons, rows: any[], column: ColumnConfig) {
function getFooterCellValue ($table: Table, opts: TableExportConfig, rows: any[], column: ColumnConfig) {
const cellValue = XEUtils.toString(rows[$table.$getColumnIndex(column)])
return getCellText(cellValue)
}

function getFooterData (opts: ExportOptons, footerData: any[][]) {
function getFooterData (opts: TableExportConfig, footerData: any[][]) {
const { footerFilterMethod } = opts
return footerFilterMethod ? footerData.filter((items, index) => footerFilterMethod({ items, $rowIndex: index })) : footerData
}
Expand Down
49 changes: 24 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-table-plugin-export-pdf",
"version": "1.8.8",
"version": "1.9.0",
"description": "基于 vxe-table 的表格插件,支持导出 pdf 格式",
"scripts": {
"lib": "gulp build"
Expand All @@ -18,22 +18,22 @@
"style": "dist/style.css",
"typings": "index.ts",
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/runtime": "^7.4.4",
"@typescript-eslint/eslint-plugin": "^2.3.1",
"@typescript-eslint/parser": "^2.3.1",
"del": "^5.1.0",
"eslint": "^5.15.1",
"eslint-config-prettier": "^6.3.0",
"eslint-config-standard": "^12.0.0",
"@babel/core": "^7.12.3",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"del": "^6.0.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-standard": "^16.0.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.2",
"eslint-plugin-typescript": "^0.14.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
Expand All @@ -46,17 +46,16 @@
"gulp-sourcemaps": "^2.6.5",
"gulp-typescript": "^5.0.1",
"gulp-uglify": "^3.0.2",
"jspdf": "^2.1.0",
"markdown-doctest": "^0.9.1",
"prettier": "^1.18.2",
"typescript": "^3.9.3",
"vue": "^2.6.11",
"vxe-table": "^2.9.25",
"xe-utils": "^2.7.13"
"jspdf": "^2.1.1",
"markdown-doctest": "^1.1.0",
"prettier": "^2.1.2",
"typescript": "^4.0.5",
"vue": "^2.6.12",
"vxe-table": "^2.10.0",
"xe-utils": "^3.0.1"
},
"peerDependencies": {
"vxe-table": ">= 2.9.25",
"jspdf": ">= 2.1.0"
"vxe-table": ">= 2.9"
},
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
"strict": true,
"moduleResolution": "node",
"noImplicitAny": true,
"target": "es6",
"target": "esnext",
"lib": [
"esnext",
"dom",
"es6"
"dom.iterable"
]
}
}

0 comments on commit 9d7ab6b

Please sign in to comment.