diff --git a/examples/api/form.ts b/examples/api/form.ts index b0116df1a..4520def8a 100644 --- a/examples/api/form.ts +++ b/examples/api/form.ts @@ -190,7 +190,7 @@ const apis = [ }, { name: 'prevent-submit', - desc: '禁用默认提交方式,禁用后配合 validate() 方法可以更加自由的控制提交逻辑', + desc: '是否禁用默认的回车提交方式,禁用后配合 validate() 方法可以更加自由的控制提交逻辑', version: '', type: 'boolean', enum: '', diff --git a/examples/api/input.ts b/examples/api/input.ts index a7a6e7e9c..bdabd2025 100644 --- a/examples/api/input.ts +++ b/examples/api/input.ts @@ -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 类型,如果指定格式则返回字符串', diff --git a/gulpfile.js b/gulpfile.js index fb6c48042..8b2f9fb2b 100644 --- a/gulpfile.js +++ b/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', () => { diff --git a/package.json b/package.json index e0d920f68..faf1eeb01 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/input/src/input.ts b/packages/input/src/input.ts index da965f6c1..fb2ae8542 100644 --- a/packages/input/src/input.ts +++ b/packages/input/src/input.ts @@ -99,7 +99,6 @@ export default defineComponent({ maxDate: { type: [String, Number, Date] as PropType, default: () => GlobalConfig.input.maxDate }, startWeek: { type: Number as PropType, default: () => GlobalConfig.input.startWeek }, labelFormat: { type: String as PropType, default: () => GlobalConfig.input.labelFormat }, - parseFormat: { type: String as PropType, default: () => GlobalConfig.input.parseFormat }, valueFormat: { type: String as PropType, default: () => GlobalConfig.input.valueFormat }, editable: { type: Boolean as PropType, default: true }, festivalMethod: { type: Function as PropType, 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)) { diff --git a/packages/pulldown/src/pulldown.ts b/packages/pulldown/src/pulldown.ts index 722778361..9e55d62a7 100644 --- a/packages/pulldown/src/pulldown.ts +++ b/packages/pulldown/src/pulldown.ts @@ -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 })) : []) ]) diff --git a/types/edit.d.ts b/types/edit.d.ts index 7e75858b5..19b11d425 100644 --- a/types/edit.d.ts +++ b/types/edit.d.ts @@ -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 指定行 diff --git a/types/input.d.ts b/types/input.d.ts index 1ff976349..f159c1399 100644 --- a/types/input.d.ts +++ b/types/input.d.ts @@ -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;