Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Mar 11, 2021
1 parent 8e5b383 commit e3b1c85
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
node_modules
/dist
package-lock.json
yarn.lock

# local env files
.env.local
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vxe-table-plugin-antd

[![gitee star](https://gitee.com/xuliangzhan_admin/vxe-table-plugin-antd/badge/star.svg?theme=dark)](https://gitee.com/xuliangzhan_admin/vxe-table-plugin-antd/stargazers)
[![gitee star](https://gitee.com/x-extends/vxe-table-plugin-antd/badge/star.svg?theme=dark)](https://gitee.com/x-extends/vxe-table-plugin-antd/stargazers)
[![npm version](https://img.shields.io/npm/v/vxe-table-plugin-antd.svg?style=flat-square)](https://www.npmjs.com/package/vxe-table-plugin-antd)
[![npm downloads](https://img.shields.io/npm/dm/vxe-table-plugin-antd.svg?style=flat-square)](http://npm-stat.com/charts.html?package=vxe-table-plugin-antd)
[![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
Expand All @@ -15,6 +15,7 @@ npm install xe-utils vxe-table vxe-table-plugin-antd ant-design-vue

```javascript
// ...
import VXETable from 'vxe-table'
import VXETablePluginAntd from 'vxe-table-plugin-antd'
import 'vxe-table-plugin-antd/dist/style.css'
// ...
Expand Down Expand Up @@ -83,8 +84,6 @@ VXETable.use(VXETablePluginAntd)
height="600"
:data="tableData"
:edit-config="{trigger: 'click', mode: 'cell'}">
<vxe-table-column type="selection" width="60"></vxe-table-column>
<vxe-table-column type="index" title="Number" width="80"></vxe-table-column>
<vxe-table-column field="name" title="AInput" min-width="140" :edit-render="{name: 'AInput'}"></vxe-table-column>
<vxe-table-column field="age" title="AInputNumber" width="160" :edit-render="{name: 'AInputNumber', props: {max: 35, min: 18}}"></vxe-table-column>
<vxe-table-column field="sex" title="ASelect" width="140" :edit-render="{name: 'ASelect', options: sexList}"></vxe-table-column>
Expand Down Expand Up @@ -124,7 +123,6 @@ export default {
border
height="600"
:data="tableData">
<vxe-table-column type="index" width="60"></vxe-table-column>
<vxe-table-column field="name" title="Name"></vxe-table-column>
<vxe-table-column field="age" title="Age"></vxe-table-column>
<vxe-table-column field="date" title="Date" :filters="[{data: []}]" :filter-render="{name: 'AInput'}"></vxe-table-column>
Expand Down
4 changes: 0 additions & 4 deletions depend.ts

This file was deleted.

4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ gulp.task('build_style', function () {
})

gulp.task('build_commonjs', function () {
return gulp.src(['depend.ts', 'index.ts'])
return gulp.src(['index.ts'])
.pipe(sourcemaps.init())
.pipe(ts(tsconfig.compilerOptions))
.pipe(babel({
Expand All @@ -46,7 +46,7 @@ gulp.task('build_commonjs', function () {
})

gulp.task('build_umd', function () {
return gulp.src(['depend.ts', 'index.ts'])
return gulp.src(['index.ts'])
.pipe(ts(tsconfig.compilerOptions))
.pipe(replace(`import XEUtils from 'xe-utils/ctor';`, `import XEUtils from 'xe-utils';`))
.pipe(babel({
Expand Down
46 changes: 26 additions & 20 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable no-unused-vars */
import { CreateElement } from 'vue'
import XEUtils from 'xe-utils/ctor'
import XEUtils from 'xe-utils'
import {
VXETable,
RenderParams,
Expand All @@ -20,7 +19,6 @@ import {
ColumnExportCellRenderParams,
FormItemRenderParams
} from 'vxe-table'
/* eslint-enable no-unused-vars */

function isEmptyValue (cellValue: any) {
return cellValue === null || cellValue === undefined || cellValue === ''
Expand Down Expand Up @@ -472,7 +470,7 @@ export const VXETablePluginAntd = {
renderItemContent: createFormItemRender()
},
ASelect: {
renderEdit (h: CreateElement, renderOpts: ColumnEditRenderOptions, params: ColumnEditRenderParams) {
renderEdit (h, renderOpts, params) {
const { options = [], optionGroups, optionProps = {}, optionGroupProps = {} } = renderOpts
const { row, column } = params
const { attrs } = renderOpts
Expand Down Expand Up @@ -511,10 +509,10 @@ export const VXETablePluginAntd = {
}, renderOptions(h, options, optionProps))
]
},
renderCell (h: CreateElement, renderOpts: ColumnCellRenderOptions, params: ColumnCellRenderParams) {
renderCell (h, renderOpts, params) {
return cellText(h, getSelectCellValue(renderOpts, params))
},
renderFilter (h: CreateElement, renderOpts: ColumnFilterRenderOptions, params: ColumnFilterRenderParams) {
renderFilter (h, renderOpts, params) {
const { options = [], optionGroups, optionProps = {}, optionGroupProps = {} } = renderOpts
const groupOptions = optionGroupProps.options || 'options'
const groupLabel = optionGroupProps.label || 'label'
Expand Down Expand Up @@ -565,7 +563,7 @@ export const VXETablePluginAntd = {
}))
]
},
filterMethod (params: ColumnFilterMethodParams) {
filterMethod (params) {
const { option, row, column } = params
const { data } = option
const { property, filterRender: renderOpts } = column
Expand Down Expand Up @@ -619,7 +617,7 @@ export const VXETablePluginAntd = {
}, renderOptions(h, options, optionProps))
]
},
renderItemContent (h: CreateElement, renderOpts: FormItemRenderOptions, params: FormItemRenderParams) {
renderItemContent (h, renderOpts, params) {
const { options = [], optionGroups, optionProps = {}, optionGroupProps = {} } = renderOpts
const { data, property } = params
const { attrs } = renderOpts
Expand Down Expand Up @@ -658,62 +656,70 @@ export const VXETablePluginAntd = {
}, renderOptions(h, options, optionProps))
]
},
cellExportMethod: createExportMethod(getSelectCellValue)
cellExportMethod: createExportMethod(getSelectCellValue),
exportMethod: createExportMethod(getSelectCellValue)
},
ACascader: {
renderEdit: createEditRender(),
renderCell (h: CreateElement, renderOpts: ColumnCellRenderOptions, params: ColumnEditRenderParams) {
renderCell (h, renderOpts, params) {
return cellText(h, getCascaderCellValue(renderOpts, params))
},
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createExportMethod(getCascaderCellValue)
cellExportMethod: createExportMethod(getCascaderCellValue),
exportMethod: createExportMethod(getCascaderCellValue)
},
ADatePicker: {
renderEdit: createEditRender(),
renderCell: formatDatePicker('YYYY-MM-DD'),
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createDatePickerExportMethod('YYYY-MM-DD')
cellExportMethod: createDatePickerExportMethod('YYYY-MM-DD'),
exportMethod: createDatePickerExportMethod('YYYY-MM-DD')
},
AMonthPicker: {
renderEdit: createEditRender(),
renderCell: formatDatePicker('YYYY-MM'),
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createDatePickerExportMethod('YYYY-MM')
cellExportMethod: createDatePickerExportMethod('YYYY-MM'),
exportMethod: createDatePickerExportMethod('YYYY-MM')
},
ARangePicker: {
renderEdit: createEditRender(),
renderCell (h: CreateElement, renderOpts: ColumnCellRenderOptions, params: ColumnEditRenderParams) {
renderCell (h, renderOpts, params) {
return cellText(h, getRangePickerCellValue(renderOpts, params))
},
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createExportMethod(getRangePickerCellValue)
cellExportMethod: createExportMethod(getRangePickerCellValue),
exportMethod: createExportMethod(getRangePickerCellValue)
},
AWeekPicker: {
renderEdit: createEditRender(),
renderCell: formatDatePicker('YYYY-WW周'),
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createDatePickerExportMethod('YYYY-WW周')
cellExportMethod: createDatePickerExportMethod('YYYY-WW周'),
exportMethod: createDatePickerExportMethod('YYYY-WW周')
},
ATimePicker: {
renderEdit: createEditRender(),
renderCell: formatDatePicker('HH:mm:ss'),
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createDatePickerExportMethod('HH:mm:ss')
cellExportMethod: createDatePickerExportMethod('HH:mm:ss'),
exportMethod: createDatePickerExportMethod('HH:mm:ss')
},
ATreeSelect: {
renderEdit: createEditRender(),
renderCell (h: CreateElement, renderOpts: ColumnCellRenderOptions, params: ColumnEditRenderParams) {
renderCell (h, renderOpts, params) {
return cellText(h, getTreeSelectCellValue(renderOpts, params))
},
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createExportMethod(getTreeSelectCellValue)
cellExportMethod: createExportMethod(getTreeSelectCellValue),
exportMethod: createExportMethod(getTreeSelectCellValue)
},
ARate: {
renderDefault: createEditRender(),
Expand All @@ -726,7 +732,7 @@ export const VXETablePluginAntd = {
ASwitch: {
renderDefault: createEditRender(),
renderEdit: createEditRender(),
renderFilter (h: CreateElement, renderOpts: ColumnFilterRenderOptions, params: ColumnFilterRenderParams) {
renderFilter (h, renderOpts, params) {
const { column } = params
const { name, attrs } = renderOpts
const nativeOn = getNativeOns(renderOpts, params)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"typescript": "^4.0.5",
"vue": "^2.6.12",
"vxe-table": "^2.10.0",
"xe-utils": "^3.1.8"
"xe-utils": "^3.1.11"
},
"peerDependencies": {
"vxe-table": ">= 2.10"
"vxe-table": "^2.10.0"
},
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"files": [
"index.ts",
"depend.ts"
"index.ts"
],
"compilerOptions": {
"strict": true,
Expand Down

0 comments on commit e3b1c85

Please sign in to comment.