Skip to content

Commit

Permalink
releases 4.0.46
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jul 3, 2024
1 parent c733bc1 commit f0d88fc
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 18 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.0.44",
"version": "4.0.46",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
3 changes: 2 additions & 1 deletion packages/language/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default {
colTitle: 'Title',
colResizable: 'Column width (px)',
colVisible: 'Display',
colFixed: 'Freeze columns (Max. {0})',
colFixed: 'Freeze columns',
colFixedMax: 'Freeze columns (Max. {0})',
fixedLeft: 'Left',
fixedUnset: 'Unset',
fixedRight: 'Right'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default {
colTitle: 'Title',
colResizable: 'Column width (px)',
colVisible: 'Display',
colFixed: 'Freeze columns (Max {0})',
colFixed: 'Freeze columns',
colFixedMax: 'Freeze columns (Max {0})',
fixedLeft: 'Left',
fixedUnset: 'Unset',
fixedRight: 'Right'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default {
colTitle: 'タイトル',
colResizable: 'Column width (px)',
colVisible: 'Display',
colFixed: '冻结列(最多 {0} 列)',
colFixed: '冻结列',
colFixedMax: '冻结列(最多 {0} 列)',
fixedLeft: '左側',
fixedUnset: '指定しない',
fixedRight: '右側'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default {
colTitle: 'Title',
colResizable: 'Column width (px)',
colVisible: 'Display',
colFixed: 'Freeze columns (Max {0})',
colFixed: 'Freeze columns',
colFixedMax: 'Freeze columns (Max {0})',
fixedLeft: 'Left',
fixedUnset: 'Unset',
fixedRight: 'Right'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default {
colTitle: '标题',
colResizable: '列宽(像素)',
colVisible: '是否显示',
colFixed: '冻结列(最多 {0} 列)',
colFixed: '冻结列',
colFixedMax: '冻结列(最多 {0} 列)',
fixedLeft: '左侧',
fixedUnset: '不设置',
fixedRight: '右侧'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/zh-TC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default {
colTitle: '標題',
colResizable: '列宽(像素)',
colVisible: '是否顯示',
colFixed: '冻结列(最多 {0} 列)',
colFixed: '冻结列',
colFixedMax: '冻结列(最多 {0} 列)',
fixedLeft: '左側',
fixedUnset: '不設定',
fixedRight: '右側'
Expand Down
20 changes: 14 additions & 6 deletions packages/modal/src/modal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineComponent, h, Teleport, ref, Ref, computed, reactive, nextTick, watch, PropType, VNode, onMounted, onUnmounted, createCommentVNode } from 'vue'
import XEUtils from 'xe-utils'
import { getDomNode, getEventTargetNode } from '../../ui/src/dom'
import { getLastZIndex, nextZIndex, getFuncText } from '../../ui/src/utils'
import { getLastZIndex, nextZIndex, getFuncText, handleBooleanDefaultValue } from '../../ui/src/utils'
import { getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, createEvent, useSize } from '../../ui'
import VxeButtonComponent from '../../button/src/button'
import VxeLoadingComponent from '../../loading/index'
Expand Down Expand Up @@ -43,6 +43,14 @@ export default defineComponent({
showHeader: { type: Boolean as PropType<VxeModalPropTypes.ShowHeader>, default: () => getConfig().modal.showHeader },
showFooter: { type: Boolean as PropType<VxeModalPropTypes.ShowFooter>, default: () => getConfig().modal.showFooter },
showZoom: Boolean as PropType<VxeModalPropTypes.ShowZoom>,
showMaximize: {
type: Boolean as PropType<VxeModalPropTypes.ShowMaximize>,
default: () => handleBooleanDefaultValue(getConfig().modal.showMaximize)
},
showMinimize: {
type: Boolean as PropType<VxeModalPropTypes.ShowMinimize>,
default: () => handleBooleanDefaultValue(getConfig().modal.showMinimize)
},
showClose: { type: Boolean as PropType<VxeModalPropTypes.ShowClose>, default: () => getConfig().modal.showClose },
dblclickZoom: { type: Boolean as PropType<VxeModalPropTypes.DblclickZoom>, default: () => getConfig().modal.dblclickZoom },
width: [Number, String] as PropType<VxeModalPropTypes.Width>,
Expand Down Expand Up @@ -814,7 +822,7 @@ export default defineComponent({
Object.assign($xeModal, modalMethods)

const renderTitles = () => {
const { slots: propSlots = {}, showClose, showZoom, title } = props
const { slots: propSlots = {}, showClose, showZoom, showMaximize, showMinimize, title } = props
const { zoomStatus } = reactData
const titleSlot = slots.title || propSlots.title
const cornerSlot = slots.corner || propSlots.corner
Expand All @@ -830,7 +838,7 @@ export default defineComponent({
class: 'vxe-modal--corner-wrapper'
}, getSlotVNs(cornerSlot({ $modal: $xeModal })))
: createCommentVNode(),
showZoom && zoomStatus !== 'maximize'
(XEUtils.isBoolean(showMinimize) ? showMinimize : showZoom) && zoomStatus !== 'maximize'
? h('span', {
class: ['vxe-modal--zoom-btn', 'trigger--btn'],
title: getI18n(`vxe.modal.zoom${zoomStatus === 'minimize' ? 'Out' : 'Min'}`),
Expand All @@ -841,7 +849,7 @@ export default defineComponent({
})
])
: createCommentVNode(),
showZoom && zoomStatus !== 'minimize'
(XEUtils.isBoolean(showMaximize) ? showMaximize : showZoom) && zoomStatus !== 'minimize'
? h('span', {
class: ['vxe-modal--zoom-btn', 'trigger--btn'],
title: getI18n(`vxe.modal.zoom${zoomStatus === 'maximize' ? 'Out' : 'In'}`),
Expand All @@ -868,7 +876,7 @@ export default defineComponent({
}

const renderHeaders = () => {
const { slots: propSlots = {}, showZoom, draggable } = props
const { slots: propSlots = {}, showZoom, showMaximize, draggable } = props
const isMsg = computeIsMsg.value
const headerSlot = slots.header || propSlots.header
const headVNs: VNode[] = []
Expand All @@ -877,7 +885,7 @@ export default defineComponent({
if (draggable) {
headerOns.onMousedown = mousedownEvent
}
if (showZoom && props.dblclickZoom && props.type === 'modal') {
if ((XEUtils.isBoolean(showMaximize) ? showMaximize : showZoom) && props.dblclickZoom && props.type === 'modal') {
headerOns.onDblclick = toggleZoomMaxEvent
}
headVNs.push(
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ export function getFuncText (content: string | number | boolean | null | undefin
export function eqEmptyValue (cellValue: any) {
return cellValue === null || cellValue === undefined || cellValue === ''
}

export function handleBooleanDefaultValue (value: boolean | undefined | null) {
return XEUtils.isBoolean(value) ? value : null
}
12 changes: 9 additions & 3 deletions types/components/column.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,19 @@ export namespace VxeColumnPropTypes {
}) => string | number)
export type SortType = 'auto' | 'string' | 'number' | null

export interface Filter {
export interface FilterItem {
label?: string | number
value?: any
data?: any
resetValue?: any
checked?: boolean
}
export type Filters = Filter[]
/**
* 请使用 FilterItem
* @deprecated
*/
export interface Filter extends FilterItem {}
export type Filters = FilterItem[]

export type FilterMultiple = boolean

Expand Down Expand Up @@ -116,6 +121,7 @@ export namespace VxeColumnPropTypes {
*/
children?: any[]

enabled?: boolean
options?: any[]
optionProps?: VxeGlobalRendererHandles.RenderOptionProps
optionGroups?: any[]
Expand Down Expand Up @@ -407,7 +413,7 @@ export type VxeColumnProps<D = any> = {
/**
* 配置筛选条件数组
*/
filters?: VxeColumnPropTypes.Filter[]
filters?: VxeColumnPropTypes.Filters
/**
* 筛选是否允许多选
*/
Expand Down
4 changes: 4 additions & 0 deletions types/components/modal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export namespace VxeModalPropTypes {
export type ShowHeader = boolean
export type ShowFooter = boolean
export type ShowZoom = boolean
export type ShowMaximize = boolean
export type ShowMinimize = boolean
export type ShowClose = boolean
export type DblclickZoom = boolean
export type Width = number | string
Expand Down Expand Up @@ -123,6 +125,8 @@ export type VxeModalProps = {
showHeader?: VxeModalPropTypes.ShowHeader
showFooter?: VxeModalPropTypes.ShowFooter
showZoom?: VxeModalPropTypes.ShowZoom
showMaximize?: VxeModalPropTypes.ShowMaximize
showMinimize?: VxeModalPropTypes.ShowMinimize
showClose?: VxeModalPropTypes.ShowClose
dblclickZoom?: VxeModalPropTypes.DblclickZoom
draggable?: VxeModalPropTypes.Draggable
Expand Down
3 changes: 2 additions & 1 deletion types/components/table-module/filter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export interface TableFilterMethods<D = any> {
* 在筛选条件更新之后可以调用 updateData 函数处理表格数据
* @param columnOrField 列对象或字段名
* @param options 选项列表
* @param update 是否同时更新数据
*/
setFilter(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>, options: VxeColumnPropTypes.Filter[]): Promise<void>
setFilter(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>, options: VxeColumnPropTypes.FilterItem[], update?: boolean): Promise<void>
/**
* 手动清空筛选条件
* 如果不传 column 则清空所有筛选条件,数据会恢复成未筛选的状态
Expand Down
9 changes: 8 additions & 1 deletion types/components/table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ export namespace VxeTablePropTypes {
height?: VxeModalPropTypes.Height
minHeight?: VxeModalPropTypes.MinHeight
className?: VxeModalPropTypes.ClassName
showZoom?: VxeModalPropTypes.ShowZoom
showMaximize?: VxeModalPropTypes.ShowMaximize
showMinimize?: VxeModalPropTypes.ShowMinimize
mask?: VxeModalPropTypes.Mask
lockView?: VxeModalPropTypes.LockView
resize?: VxeModalPropTypes.Resize
escClosable?: VxeModalPropTypes.EscClosable
}
trigger?: 'manual' | 'hover' | 'click' | '' | null
immediate?: boolean
Expand Down Expand Up @@ -3252,7 +3259,7 @@ export namespace VxeTableDefines {
sortable: VxeColumnPropTypes.Sortable
sortBy: VxeColumnPropTypes.SortBy
sortType: VxeColumnPropTypes.SortType
filters: VxeColumnPropTypes.Filter[]
filters: VxeColumnPropTypes.FilterItem[]
filterMultiple: VxeColumnPropTypes.FilterMultiple
filterMethod: VxeColumnPropTypes.FilterMethod<D>
filterRender: VxeColumnPropTypes.FilterRender
Expand Down

0 comments on commit f0d88fc

Please sign in to comment.