mirror of
https://gitee.com/xuliangzhan_admin/vxe-table.git
synced 2026-01-21 05:27:57 +08:00
重构 4.0 next 版本
This commit is contained in:
@@ -190,7 +190,7 @@ const apis = [
|
||||
},
|
||||
{
|
||||
name: 'prevent-submit',
|
||||
desc: '禁用默认提交方式,禁用后配合 validate() 方法可以更加自由的控制提交逻辑',
|
||||
desc: '是否禁用默认的回车提交方式,禁用后配合 validate() 方法可以更加自由的控制提交逻辑',
|
||||
version: '',
|
||||
type: 'boolean',
|
||||
enum: '',
|
||||
|
||||
@@ -216,15 +216,6 @@ const apis = [
|
||||
defVal: '继承 setup.input.labelFormat',
|
||||
list: []
|
||||
},
|
||||
// {
|
||||
// name: 'parse-format',
|
||||
// desc: '只对 type=date|datetime|week|month|year 有效,绑定值的解析格式,如果是值为字符串时可能会用到',
|
||||
// version: '',
|
||||
// type: 'string',
|
||||
// enum: '',
|
||||
// defVal: '继承 setup.input.parseFormat',
|
||||
// list: []
|
||||
// },
|
||||
{
|
||||
name: 'value-format',
|
||||
desc: '只对 type=date|datetime|week|month|year 有效,绑定值的返回格式,默认返回 Date 类型,如果指定格式则返回字符串',
|
||||
|
||||
31
gulpfile.js
31
gulpfile.js
@@ -87,6 +87,9 @@ gulp.task('build_modules', () => {
|
||||
})
|
||||
|
||||
gulp.task('build_i18n', () => {
|
||||
languages.forEach(code => {
|
||||
fs.writeFileSync(`lib/locale/lang/${code}.d.ts`, `declare const langMsgs: { [key: string]: any }\nexport default langMsgs`)
|
||||
})
|
||||
const rest = languages.map(code => {
|
||||
const name = XEUtils.camelCase(code).replace(/^[a-z]/, firstChat => firstChat.toUpperCase())
|
||||
const isZHTC = ['zh-HK', 'zh-MO', 'zh-TW'].includes(code)
|
||||
@@ -142,7 +145,7 @@ gulp.task('build_lib', () => {
|
||||
suffix: '.common.dev',
|
||||
extname: '.js'
|
||||
}))
|
||||
.pipe(gulp.dest('lib')),
|
||||
.pipe(gulp.dest('lib')),
|
||||
gulp.src('lib_dev/index.umd.js')
|
||||
.pipe(gulp.dest('lib')),
|
||||
gulp.src('lib_pro/index.umd.min.js')
|
||||
@@ -163,7 +166,7 @@ gulp.task('build_lib', () => {
|
||||
})
|
||||
|
||||
gulp.task('build_style', gulp.series('build_modules', 'build_i18n', 'copy_ts', () => {
|
||||
const rest = components.map(name => {
|
||||
const rest = components.map(name => {
|
||||
return gulp.src(`styles/${name}.scss`)
|
||||
.pipe(replace(/(\/\*\*Variable\*\*\/)/, `@import './variable.scss';\n`))
|
||||
.pipe(sass())
|
||||
@@ -291,26 +294,26 @@ gulp.task('update_plugin_docs', gulp.series('build_html_docs', 'build_css_docs',
|
||||
|
||||
gulp.task('copy_docs_v1', () => {
|
||||
return gulp.src('docs/v1/index.html')
|
||||
.pipe(rename({
|
||||
basename: '404'
|
||||
}))
|
||||
.pipe(gulp.dest('docs/v1'))
|
||||
.pipe(rename({
|
||||
basename: '404'
|
||||
}))
|
||||
.pipe(gulp.dest('docs/v1'))
|
||||
})
|
||||
|
||||
gulp.task('copy_docs_v2', () => {
|
||||
return gulp.src('docs/v2/index.html')
|
||||
.pipe(rename({
|
||||
basename: '404'
|
||||
}))
|
||||
.pipe(gulp.dest('docs/v2'))
|
||||
.pipe(rename({
|
||||
basename: '404'
|
||||
}))
|
||||
.pipe(gulp.dest('docs/v2'))
|
||||
})
|
||||
|
||||
gulp.task('copy_docs_v3', () => {
|
||||
return gulp.src('docs/v3/index.html')
|
||||
.pipe(rename({
|
||||
basename: '404'
|
||||
}))
|
||||
.pipe(gulp.dest('docs/v3'))
|
||||
.pipe(rename({
|
||||
basename: '404'
|
||||
}))
|
||||
.pipe(gulp.dest('docs/v3'))
|
||||
})
|
||||
|
||||
gulp.task('copy_docs_index', gulp.parallel('copy_docs_v1', 'copy_docs_v2', 'copy_docs_v3', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vxe-table",
|
||||
"version": "4.0.0-alpha.3",
|
||||
"version": "4.0.0-alpha.4",
|
||||
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟滚动、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、虚拟列表、模态窗口、自定义模板、渲染器、贼灵活的配置项、扩展接口等...",
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
||||
@@ -99,7 +99,6 @@ export default defineComponent({
|
||||
maxDate: { type: [String, Number, Date] as PropType<VxeInputPropTypes.MaxDate>, default: () => GlobalConfig.input.maxDate },
|
||||
startWeek: { type: Number as PropType<VxeInputPropTypes.StartWeek>, default: () => GlobalConfig.input.startWeek },
|
||||
labelFormat: { type: String as PropType<VxeInputPropTypes.LabelFormat>, default: () => GlobalConfig.input.labelFormat },
|
||||
parseFormat: { type: String as PropType<VxeInputPropTypes.ParseFormat>, default: () => GlobalConfig.input.parseFormat },
|
||||
valueFormat: { type: String as PropType<VxeInputPropTypes.ValueFormat>, default: () => GlobalConfig.input.valueFormat },
|
||||
editable: { type: Boolean as PropType<VxeInputPropTypes.Editable>, default: true },
|
||||
festivalMethod: { type: Function as PropType<VxeInputPropTypes.FestivalMethod>, default: () => GlobalConfig.input.festivalMethod },
|
||||
@@ -596,7 +595,7 @@ export default defineComponent({
|
||||
|
||||
const dateParseValue = (value?: VxeInputPropTypes.ModelValue) => {
|
||||
const { type } = props
|
||||
const { parseFormat } = props
|
||||
const { valueFormat } = props
|
||||
const dateLabelFormat = computeDateLabelFormat.value
|
||||
let dValue: Date | null = null
|
||||
let dLabel = ''
|
||||
@@ -604,7 +603,7 @@ export default defineComponent({
|
||||
if (type === 'time') {
|
||||
dValue = toStringTimeDate(value)
|
||||
} else {
|
||||
dValue = XEUtils.toStringDate(value, parseFormat)
|
||||
dValue = XEUtils.toStringDate(value, valueFormat)
|
||||
}
|
||||
}
|
||||
if (XEUtils.isValidDate(dValue)) {
|
||||
|
||||
@@ -283,9 +283,7 @@ export default defineComponent({
|
||||
'animat--leave': animatVisible,
|
||||
'animat--enter': visiblePanel
|
||||
}],
|
||||
attrs: {
|
||||
'data-placement': panelPlacement
|
||||
},
|
||||
'data-placement': panelPlacement,
|
||||
style: panelStyle
|
||||
}, slots.dropdown ? (!inited || (destroyOnClose && !visiblePanel && !animatVisible) ? [] : slots.dropdown({ $pulldown: $xepulldown })) : [])
|
||||
])
|
||||
|
||||
2
types/edit.d.ts
vendored
2
types/edit.d.ts
vendored
@@ -17,7 +17,7 @@ export interface TableEditMethods {
|
||||
* @param records 新数据
|
||||
* @param row 指定行
|
||||
*/
|
||||
insertAt(records: RecordInfo | RecordInfo[], row: RowInfo | number | null): Promise<{ row: RowInfo, rows: RowInfo[] }>;
|
||||
insertAt(records: RecordInfo | RecordInfo[], row: RowInfo | -1 | null): Promise<{ row: RowInfo, rows: RowInfo[] }>;
|
||||
/**
|
||||
* 删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据
|
||||
* @param rows 指定行
|
||||
|
||||
2
types/input.d.ts
vendored
2
types/input.d.ts
vendored
@@ -57,7 +57,6 @@ export namespace VxeInputPropTypes {
|
||||
export type MaxDate = string | number | Date;
|
||||
export type StartWeek = number;
|
||||
export type LabelFormat = string;
|
||||
export type ParseFormat = string;
|
||||
export type ValueFormat = string;
|
||||
export type Editable = boolean;
|
||||
export type FestivalMethod = (params: VxeInputDefines.DateFestivalParams) => VxeInputDefines.DateFestivalInfo | null | void;
|
||||
@@ -98,7 +97,6 @@ export interface VxeInputProps {
|
||||
maxDate?: VxeInputPropTypes.MaxDate;
|
||||
startWeek?: VxeInputPropTypes.StartWeek;
|
||||
labelFormat?: VxeInputPropTypes.LabelFormat;
|
||||
parseFormat?: VxeInputPropTypes.ParseFormat;
|
||||
valueFormat?: VxeInputPropTypes.ValueFormat;
|
||||
editable?: VxeInputPropTypes.Editable;
|
||||
festivalMethod?: VxeInputPropTypes.FestivalMethod;
|
||||
|
||||
Reference in New Issue
Block a user