Skip to content

Commit

Permalink
releases 4.2.54
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Nov 15, 2024
1 parent 50802a1 commit 4c1898a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-pc-ui",
"version": "4.2.53",
"version": "4.2.54",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
19 changes: 12 additions & 7 deletions packages/select/src/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,13 @@ export default defineComponent({
internalData.optGroupKeyMaps = groupKeyMaps
internalData.optFullValMaps = fullKeyMaps
reactData.reactFlag++
refreshOption()
handleOption()
}

/**
* 刷新选项,当选项被动态显示/隐藏时可能会用到
* 处理选项,当选项被动态显示/隐藏时可能会用到
*/
const refreshOption = () => {
const handleOption = () => {
const { filterable, filterMethod } = props
const { searchValue } = reactData
const { fullData, optFullValMaps } = internalData
Expand Down Expand Up @@ -478,7 +478,8 @@ export default defineComponent({
reactData.isActivated = true
reactData.isAniVisible = true
if (filterable) {
refreshOption()
handleOption()
updateYData()
}
setTimeout(() => {
reactData.visiblePanel = true
Expand Down Expand Up @@ -733,11 +734,11 @@ export default defineComponent({
.catch(() => nextTick())
.finally(() => {
reactData.searchLoading = false
refreshOption()
handleOption()
updateYData()
})
} else {
refreshOption()
handleOption()
updateYData()
}
}
Expand Down Expand Up @@ -1023,7 +1024,11 @@ export default defineComponent({
}
return nextTick()
},
refreshOption,
refreshOption () {
handleOption()
updateYData()
return nextTick()
},
focus () {
const $input = refInput.value
reactData.isActivated = true
Expand Down
19 changes: 17 additions & 2 deletions types/components/table-module/validator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,31 @@ export interface TableValidatorMethods<D = any> {
*/
clearValidate(rows?: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | VxeColumnPropTypes.Field[] | VxeTableDefines.ColumnInfo<any>[]): Promise<void>
/**
* 完整校验,默认校验当前表格数据,和 validate 的区别就是默认校验当前表格数据并且给有效数据中的每一行进行校验
* 完整校验行,默认校验当前表格数据,和 validate 的区别就是默认校验当前表格数据并且给有效数据中的每一行进行校验
* @param rows 指定行
*/
fullValidate(rows?: boolean | object | any[] | ((errMap: VxeTableDefines.ValidatorErrorMapParams<D>) => void), callback?: (errMap: VxeTableDefines.ValidatorErrorMapParams<D>) => void): Promise<VxeTableDefines.ValidatorErrorMapParams<D>>
/**
* 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
* 快速校验行,默认校验当前表格数据,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
* 如果第一个参数为 true 则校验当前表格数据,如果指定 row 或 rows 则校验指定一行或多行,如果不指定数据,则默认只校验临时变动的数据,例如新增或修改。该回调函数会在校验结束后被调用 callback(errMap)。若不传入回调函数,则会返回一个 promise
* @param rows 指定行
*/
validate(rows?: boolean | object | any[] | ((errMap?: VxeTableDefines.ValidatorErrorMapParams<D>) => void), callback?: (errMap?: VxeTableDefines.ValidatorErrorMapParams<D>) => void): Promise<VxeTableDefines.ValidatorErrorMapParams<D>>

/**
* 完整校验单元格,默认校验当前表格数据,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
* 如果第一个参数为 true 则校验当前表格数据,如果指定 row 或 rows 则校验指定一行或多行,如果不指定数据,则默认只校验临时变动的数据,例如新增或修改。返回一个 promise
* @param rows 指定行
* @param fieldOrColumn 指定字段
*/
fullValidateField(rows?: boolean | object | any[], fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | VxeColumnPropTypes.Field[] | VxeTableDefines.ColumnInfo<any>[]): Promise<VxeTableDefines.ValidatorErrorMapParams<D>>
/**
* 快速校定单元格,默认校验当前表格数据,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
* 如果第一个参数为 true 则校验当前表格数据,如果指定 row 或 rows 则校验指定一行或多行,如果不指定数据,则默认只校验临时变动的数据,例如新增或修改。返回一个 promise
* @param rows 指定行
* @param fieldOrColumn 指定字段
*/
validateField(rows?: boolean | object | any[], fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | VxeColumnPropTypes.Field[] | VxeTableDefines.ColumnInfo<any>[]): Promise<VxeTableDefines.ValidatorErrorMapParams<D>>
}

export interface TableValidatorPrivateMethods<D = any> {
Expand Down
2 changes: 1 addition & 1 deletion types/components/table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3303,7 +3303,7 @@ export interface TablePrivateMethods<D = any> {
getExcludeHeight(): number
defineField(records: any[]): any[]
handleTableData(force?: boolean): Promise<any>
cacheRowMap(isSource?: boolean): void
cacheRowMap(isSource?: boolean, force?: boolean): void
cacheSourceMap(fullData: any[]): void
saveCustomStore(type: 'confirm' | 'reset' | 'update:width' | 'update:fixed' | 'update:sort' | 'update:visible'): Promise<any>
analyColumnWidth(): void
Expand Down

0 comments on commit 4c1898a

Please sign in to comment.