Skip to content

Commit

Permalink
releases 4.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jun 17, 2024
1 parent 4b60d80 commit b290904
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-pc-ui",
"version": "4.0.18",
"version": "4.0.19",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand All @@ -25,7 +25,7 @@
"style": "lib/style.css",
"typings": "types/index.d.ts",
"dependencies": {
"@vxe-ui/core": "^1.0.6"
"@vxe-ui/core": "^1.0.7"
},
"devDependencies": {
"@types/resize-observer-browser": "^0.1.11",
Expand Down
18 changes: 17 additions & 1 deletion types/ui/commands.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@ import { VxeGridConstructor } from '../components/grid'
import { VxeToolbarPropTypes } from '../components/toolbar'
import { VxeTableConstructor } from '../components/table'

/* eslint-disable no-use-before-define */

declare module '@vxe-ui/core' {
export namespace VxeGlobalCommandsHandles {
export interface CommandMethodParams {
export interface CommandsOptions {
/**
* 表格 - 自定义工具栏或数据代理的指令方法
*/
tableCommandMethod?: (params: TableCommandMethodParams, ...args: any[]) => void

/**
* 已废弃,请使用 tableCommandMethod
* @deprecated
*/
commandMethod?: (params: TableCommandMethodParams, ...args: any[]) => void
}

export interface TableCommandMethodParams {
$grid: VxeGridConstructor | null
$table: VxeTableConstructor
button?: VxeToolbarPropTypes.ButtonConfig | null
code?: string
}
}
}
16 changes: 15 additions & 1 deletion types/ui/formats.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { VxeTableDefines } from '../components/table'

/* eslint-disable no-use-before-define */

declare module '@vxe-ui/core' {
export namespace VxeGlobalFormatsHandles {
export interface FormatMethodParams {
export interface FormatsOptions {
/**
* 表格 - 自定义单元格格式化方法
*/
tableCellFormatMethod?: (params: TableCellFormatMethodParams, ...args: any[]) => string | number

/**
* 已废弃,请使用 tableCellFormatMethod
* @deprecated
*/
cellFormatMethod?: (params: TableCellFormatMethodParams, ...args: any[]) => string | number
}
export interface TableCellFormatMethodParams {
cellValue: any
row: any
column: VxeTableDefines.ColumnInfo
Expand Down
7 changes: 7 additions & 0 deletions types/ui/interceptor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import { VxeGridConstructor, VxeGridPrivateMethods } from '../components/grid'

declare module '@vxe-ui/core' {
export namespace VxeGlobalInterceptorHandles {
export interface InterceptorOptions {
/**
* 表格 - 自定义菜单方法
*/
tableInterceptorMethod?: (params: any) => any
}

export type HookType = 'created' | 'mounted' | 'activated' | 'beforeUnmount' | 'unmounted'
export type EventType = 'event.clearEdit' | 'event.clearActived' | 'event.clearFilter' | 'event.clearAreas' | 'event.showMenu' | 'event.keydown' | 'event.export' | 'event.import'
export type Type = HookType | EventType
Expand Down
17 changes: 16 additions & 1 deletion types/ui/menus.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@ import { VxeTableConstructor, VxeTableDefines, VxeTablePrivateMethods } from '..
import { VxeGridConstructor } from '../components/grid'
import { VxeGlobalRendererHandles } from '@vxe-ui/core'

/* eslint-disable no-use-before-define */

declare module '@vxe-ui/core' {
export namespace VxeGlobalMenusHandles {
export interface MenuMethodParams extends VxeGlobalRendererHandles.RenderCellParams {
export interface MenusOption {
/**
* 表格 - 自定义菜单方法
*/
tableMenuMethod?: (params: TableMenuMethodParams, event: Event) => any

/**
* 已废弃,请使用 tableMenuMethod
* @deprecated
*/
menuMethod?: (params: TableMenuMethodParams, event: Event) => any
}

export interface TableMenuMethodParams extends VxeGlobalRendererHandles.RenderCellParams {
$grid: VxeGridConstructor | null
$table: VxeTableConstructor & VxeTablePrivateMethods
$event: MouseEvent
Expand Down
19 changes: 12 additions & 7 deletions types/ui/validators.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ import { VxeTableDefines } from '../components/table'
declare module '@vxe-ui/core' {
export namespace VxeGlobalValidatorsHandles {
export interface ValidatorsOptions {
formItemValidatorMethod?: ItemValidatorMethod
cellValidatorMethod?: CellValidatorMethod
formItemValidatorMethod?: FormItemValidatorMethod
tableCellValidatorMethod?: TableCellValidatorMethod

/**
* 已废弃,请使用 tableCellValidatorMethod
* @deprecated
*/
cellValidatorMethod?: TableCellValidatorMethod
/**
* 已废弃,请使用 formItemValidatorMethod
* @deprecated
*/
itemValidatorMethod?: ItemValidatorMethod
itemValidatorMethod?: FormItemValidatorMethod
}

export type ItemValidatorMethod = (params: ItemValidatorParams, ...args: any[]) => void | Error | Promise<any>
export interface ItemValidatorParams extends VxeFormDefines.RuleValidatorParams {}
export type FormItemValidatorMethod = (params: FormItemValidatorParams, ...args: any[]) => void | Error | Promise<any>
export interface FormItemValidatorParams extends VxeFormDefines.RuleValidatorParams {}

export type CellValidatorMethod<D = any> = (params: CellValidatorParams<D>, ...args: any[]) => void | Error | Promise<any>
export interface CellValidatorParams<D = any> extends VxeTableDefines.RuleValidatorParams<D> {}
export type TableCellValidatorMethod<D = any> = (params: TableCellValidatorParams<D>, ...args: any[]) => void | Error | Promise<any>
export interface TableCellValidatorParams<D = any> extends VxeTableDefines.RuleValidatorParams<D> {}
}
}

0 comments on commit b290904

Please sign in to comment.