Skip to content

Commit

Permalink
releases 4.3.50
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Dec 30, 2024
1 parent cfa373f commit c61e023
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 79 deletions.
2 changes: 1 addition & 1 deletion helper/vetur/attributes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion helper/vetur/tags.json

Large diffs are not rendered by default.

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.3.49",
"version": "4.3.50",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
3 changes: 3 additions & 0 deletions types/components/calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export namespace VxeCalendarDefines {
date: Date
}

export interface InputEventParams extends CalendarEventParams {
value: string
}
export interface ChangeEventParams extends CalendarEventParams {
value: string
}
Expand Down
129 changes: 81 additions & 48 deletions types/components/grid.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RenderFunction, SetupContext, Ref, ComputedRef } from 'vue'
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, VxeComponentSizeType, VxeComponentSlotType, ValueOf } from '@vxe-ui/core'
import { VxeToolbarInstance, VxeToolbarProps, VxeToolbarPropTypes } from './toolbar'
import { VxeToolbarInstance, VxeToolbarProps, VxeToolbarPropTypes, VxeToolbarSlotTypes } from './toolbar'
import { VxeTableDefines, VxeTableInstance, VxeTableEmits, VxeTableConstructor, VxeTableProps, TableMethods } from './table'
import { VxePagerInstance, VxePagerProps, VxePagerDefines } from './pager'
import { VxeFormInstance, VxeFormProps, VxeFormDefines } from './form'
Expand Down Expand Up @@ -188,9 +188,34 @@ export namespace VxeGridPropTypes {
iconIn?: string
iconOut?: string
}
/**
* 自定义插槽模板
*/
slots?: {
buttons?: string | ((params: { [key: string]: any }) => VxeComponentSlotType | VxeComponentSlotType[])
tools?: string | ((params: { [key: string]: any }) => VxeComponentSlotType | VxeComponentSlotType[])
/**
* 自定义左侧按钮列表
*/
buttons?: string | ((params: VxeToolbarSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
/**
* 自定义左侧按钮列表前缀插槽模板
*/
buttonPrefix?: string | ((params: VxeToolbarSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
/**
* 自定义左侧按钮列表后缀插槽模板
*/
buttonSuffix?: string | ((params: VxeToolbarSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
/**
* 自定义右侧工具列表
*/
tools?: string | ((params: VxeToolbarSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
/**
* 自定义右侧工具列表前缀插槽模板
*/
toolPrefix?: string | ((params: VxeToolbarSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
/**
* 自定义右侧工具列表后缀插槽模板
*/
toolSuffix?: string | ((params: VxeToolbarSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
}
}

Expand Down Expand Up @@ -632,23 +657,40 @@ export namespace VxeGridEvents {
}

export namespace VxeGridSlotTypes {
export interface DefaultSlotParams {}
}

export interface VxeGridSlots<D = any> {
/**
* 自定义插槽模板
*/
[key: string]: ((params: {
export interface DefaultSlotParams<D = any> {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
/**
* 当前行对象,支持数据双向绑定
*/
row: D
/**
* 相对于 data 中的索引,等同于 getRowIndex(row)
*/
rowIndex: number
/**
* 相对于可视区渲染中的行索引,等同于 getVMRowIndex(row)
*/
$rowIndex: number
/**
* 相对于当前表格数据的索引,等同于 getVTRowIndex(row)
*/
_rowIndex: number
/**
* 当前列对象
*/
column: VxeTableDefines.ColumnInfo<D>
/**
* 相对于 columns 中的索引,等同于 getTColumnIndex(column)
*/
columnIndex: number
/**
* 相对于可视区渲染中的列索引,等同于 getVMColumnIndex(column)
*/
$columnIndex: number
/**
* 相对于当前表格列的索引,等同于 getVTColumnIndex(column)
*/
_columnIndex: number

checked?: boolean
Expand All @@ -657,71 +699,62 @@ export interface VxeGridSlots<D = any> {
items: D[]

[key: string]: any
}) => any) | undefined
}

export interface BaseSlotParams<D = any> {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}
export interface EmptySlotParams<D = any> extends BaseSlotParams<D> {}
export interface LoadingSlotParams<D = any> extends BaseSlotParams<D> {}
export interface FormSlotParams<D = any> extends BaseSlotParams<D> {}
export interface ToolbarSlotParams<D = any> extends BaseSlotParams<D> {}
export interface TopSlotParams<D = any> extends BaseSlotParams<D> {}
export interface BottomSlotParams<D = any> extends BaseSlotParams<D> {}
export interface LeftSlotParams<D = any> extends BaseSlotParams<D> {}
export interface RightSlotParams<D = any> extends BaseSlotParams<D> {}
export interface PagerSlotParams<D = any> extends BaseSlotParams<D> {}
}

export interface VxeGridSlots<D = any> {
[key: string]: ((params: VxeGridSlotTypes.DefaultSlotParams<D>) => any) | undefined

/**
* 自定义空数据时显示模板
*/
empty?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
empty?(params: VxeGridSlotTypes.EmptySlotParams<D>): any
/**
* 自定义加载中模板
*/
loading?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
loading?(params: VxeGridSlotTypes.LoadingSlotParams<D>): any
/**
* 自定义表单模板
*/
form?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
form?(params: VxeGridSlotTypes.FormSlotParams<D>): any
/**
* 自定义工具栏模板
*/
toolbar?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
toolbar?(params: VxeGridSlotTypes.ToolbarSlotParams<D>): any
/**
* 自定义表格顶部模板
*/
top?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
top?(params: VxeGridSlotTypes.TopSlotParams<D>): any
/**
* 自定义表格底部模板
*/
bottom?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
bottom?(params: VxeGridSlotTypes.BottomSlotParams<D>): any
/**
* 自定义表格左侧模板
*/
left?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
left?(params: VxeGridSlotTypes.LeftSlotParams<D>): any
/**
* 自定义表格右侧模板
*/
right?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
right?(params: VxeGridSlotTypes.RightSlotParams<D>): any
/**
* 自定义分页模板
*/
pager?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
pager?(params: VxeGridSlotTypes.PagerSlotParams<D>): any
}

export const Grid: typeof VxeGrid
Expand Down
12 changes: 6 additions & 6 deletions types/components/menu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@ export namespace VxeMenuEvents {

export namespace VxeMenuSlotTypes {
export interface DefaultSlotParams {}
export interface OptionSlotParams {
option: Required<VxeMenuPropTypes.MenuOption>
collapsed: boolean
}
}

export interface VxeMenuSlots {
default?: (params: VxeMenuSlotTypes.DefaultSlotParams) => any
/**
* 自定义弹窗容器选项模板
* 自定义菜单项的模板
*/
option?: ((params: {
option: Required<MenuOption>
collapsed: boolean
[key: string]: any
}) => any) | undefined
option?: (params: VxeMenuSlotTypes.OptionSlotParams) => any
}

export const Menu: typeof VxeMenu
Expand Down
61 changes: 45 additions & 16 deletions types/components/table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1892,11 +1892,19 @@ export namespace VxeTablePropTypes {
/**
* 文件名
*/
filename?: string
filename?: string | ((params: {
$table: VxeTableConstructor
$grid?: VxeGridConstructor | null
options: ExportOpts
}) => string)
/**
* 表名
*/
sheetName?: string
sheetName?: string | ((params: {
$table: VxeTableConstructor
$grid?: VxeGridConstructor | null
options: ExportOpts
}) => string)
/**
* 文件类型
*/
Expand Down Expand Up @@ -1984,13 +1992,18 @@ export namespace VxeTablePropTypes {
*/
exportMethod?(params: {
$table: VxeTableConstructor
$grid?: VxeGridConstructor
$grid?: VxeGridConstructor | null
options: ExportHandleOptions
}): Promise<any>
beforeExportMethod?(params: {
$table: VxeTableConstructor
$grid?: VxeGridConstructor | null
options: ExportHandleOptions
}): void
afterExportMethod?(params: {
$table: VxeTableConstructor
$grid?: VxeGridConstructor | null
status: boolean
options: ExportHandleOptions
}): void

Expand All @@ -2006,10 +2019,21 @@ export namespace VxeTablePropTypes {
}
}
export interface ExportOpts extends ExportConfig { }
export interface ExportHandleOptions extends ExportConfig {
export interface ExportHandleOptions extends Exclude<ExportConfig, 'filename' | 'sheetName'> {
filename: string
sheetName: string
data: any[]
columns: VxeTableDefines.ColumnInfo[]
colgroups: VxeTableDefines.ColumnInfo[][]

/**
* @private
*/
_isCustomColumn?: boolean
/**
* @private
*/
print?: boolean
}

/**
Expand All @@ -2019,7 +2043,11 @@ export namespace VxeTablePropTypes {
/**
* 表名
*/
sheetName?: string
sheetName?: string | ((params: {
$table: VxeTableConstructor
$grid?: VxeGridConstructor | null
options: ExportOpts
}) => string)
/**
* 导出数据的方式
*/
Expand Down Expand Up @@ -2722,7 +2750,7 @@ export interface TableReactData<D = any> {
type: any
modeList: any[]
typeList: any[]
filename: any
filename: string
visible: boolean
},
importParams: {
Expand All @@ -2745,8 +2773,8 @@ export interface TableReactData<D = any> {
visible: boolean
},
exportParams: {
filename: any
sheetName: any
filename: string
sheetName: string
mode: any
type: any
isColgroup: boolean
Expand Down Expand Up @@ -4862,23 +4890,24 @@ export namespace VxeTableEvents {

export namespace VxeTableSlotTypes {
export interface DefaultSlotParams {}

export interface BaseSlotParams<D = any> {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}
export interface EmptySlotParams<D = any> extends BaseSlotParams<D> {}
export interface LoadingSlotParams<D = any> extends BaseSlotParams<D> {}
}

export interface VxeTableSlots<D = any> {
/**
* 自定义空数据时显示模板
*/
empty?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
empty?(params: VxeTableSlotTypes.EmptySlotParams<D>): any
/**
* 自定义加载中模板
*/
loading?(params: {
$table: VxeTableConstructor<D>
$grid: VxeGridConstructor<D> | null | undefined
}): any
loading?(params: VxeTableSlotTypes.LoadingSlotParams<D>): any
}

export * from './table-module'
Expand Down
Loading

0 comments on commit c61e023

Please sign in to comment.