Skip to content

Commit

Permalink
releases 4.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Aug 26, 2024
1 parent a2b65e2 commit c16d6ea
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 23 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.1.6",
"version": "4.1.7",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
4 changes: 0 additions & 4 deletions packages/calendar/src/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ export default defineComponent({
const quarterSize = 8

const reactData = reactive<CalendarReactData>({
panelIndex: 0,
panelStyle: null,
panelPlacement: '',
isActivated: false,
selectValue: props.modelValue,
inputValue: props.modelValue,
datePanelValue: null,
Expand Down
9 changes: 5 additions & 4 deletions packages/select/src/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,20 @@ export default defineComponent({
const isGroup = computeIsGroup.value
const groupLabelField = computeGroupLabelField.value
const labelField = computeLabelField.value
const searchStr = `${searchValue || ''}`.toLowerCase()
if (isGroup) {
if (filterable && filterMethod) {
reactData.visibleGroupList = fullGroupList.filter(group => isOptionVisible(group) && filterMethod({ group, option: null, searchValue }))
reactData.visibleGroupList = fullGroupList.filter(group => isOptionVisible(group) && filterMethod({ group, option: null, searchValue: searchStr }))
} else if (filterable) {
reactData.visibleGroupList = fullGroupList.filter(group => isOptionVisible(group) && (!searchValue || `${group[groupLabelField]}`.indexOf(searchValue) > -1))
reactData.visibleGroupList = fullGroupList.filter(group => isOptionVisible(group) && (!searchStr || `${group[groupLabelField]}`.toLowerCase().indexOf(searchStr) > -1))
} else {
reactData.visibleGroupList = fullGroupList.filter(isOptionVisible)
}
} else {
if (filterable && filterMethod) {
reactData.visibleOptionList = fullOptionList.filter(option => isOptionVisible(option) && filterMethod({ group: null, option, searchValue }))
reactData.visibleOptionList = fullOptionList.filter(option => isOptionVisible(option) && filterMethod({ group: null, option, searchValue: searchStr }))
} else if (filterable) {
reactData.visibleOptionList = fullOptionList.filter(option => isOptionVisible(option) && (!searchValue || `${option[labelField]}`.indexOf(searchValue) > -1))
reactData.visibleOptionList = fullOptionList.filter(option => isOptionVisible(option) && (!searchStr || `${option[labelField]}`.toLowerCase().indexOf(searchStr) > -1))
} else {
reactData.visibleOptionList = fullOptionList.filter(isOptionVisible)
}
Expand Down
55 changes: 47 additions & 8 deletions types/components/calendar.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RenderFunction, SetupContext, Ref, ComponentPublicInstance, DefineComponent } from 'vue'
import { defineVxeComponent, VxeComponentBaseOptions, VxeComponentEventParams, ValueOf } from '@vxe-ui/core'
import { defineVxeComponent, VxeComponentBaseOptions, VxeComponentEventParams, ValueOf, VxeComponentStyleType, VxeComponentSizeType } from '@vxe-ui/core'

/* eslint-disable no-use-before-define,@typescript-eslint/ban-types */

Expand Down Expand Up @@ -36,8 +36,8 @@ export namespace VxeCalendarPropTypes {
export type SelectDay = 0 | 1 | 2 | 3 | 4 | 5 | 6
export type LabelFormat = string
export type ValueFormat = string
export type FestivalMethod = (params: VxeDatePickerDefines.DateFestivalParams) => VxeDatePickerDefines.DateFestivalInfo | null | void
export type DisabledMethod = (params: VxeDatePickerDefines.DateDisabledParams) => boolean
export type FestivalMethod = (params: VxeCalendarDefines.DateFestivalParams) => VxeCalendarDefines.DateFestivalInfo | null | void
export type DisabledMethod = (params: VxeCalendarDefines.DateDisabledParams) => boolean
}

export type VxeCalendarProps = {
Expand All @@ -63,15 +63,11 @@ export interface CalendarPrivateComputed {
export interface VxeCalendarPrivateComputed extends CalendarPrivateComputed { }

export interface CalendarReactData {
panelIndex: number
panelStyle: VxeComponentStyleType | null
panelPlacement: VxeDatePickerPropTypes.Placement
isActivated: boolean
selectValue: VxeCalendarPropTypes.ModelValue | undefined
inputValue: any
datePanelValue: Date | null
datePanelLabel: string
datePanelType: DatePanelType
datePanelType: VxeCalendarDefines.DatePanelType
selectMonth: any
currentDate: any
}
Expand All @@ -97,6 +93,49 @@ export namespace VxeCalendarDefines {
export interface CalendarEventParams extends VxeComponentEventParams {
$calendar: VxeCalendarConstructor
}

export type DatePanelType = 'year' | 'quarter' | 'month' | 'week' | 'day'

interface DateFestivalItem {
/**
* 显示名称
*/
label?: string
/**
* 标记为重要信息
*/
important?: boolean
className?: string
style?: VxeComponentStyleType
}

/**
* 日期节日对象
*/
export interface DateFestivalInfo extends DateFestivalItem {
/**
* 显示左上角小圆点通知
*/
notice?: boolean
/**
* 显示右上角信息
*/
extra?: string | DateFestivalItem
}

export interface DateFestivalParams {
$calendar: VxeCalendarConstructor
type: string
viewType: DatePanelType
date: Date
}

export interface DateDisabledParams {
$calendar: VxeCalendarConstructor
type: string
viewType: DatePanelType
date: Date
}
}

export type VxeCalendarEventProps = {}
Expand Down
6 changes: 3 additions & 3 deletions types/components/date-picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export interface DatePickerReactData {
datetimePanelValue: any
datePanelValue: Date | null
datePanelLabel: string
datePanelType: DatePanelType
datePanelType: VxeDatePickerDefines.DatePanelType
selectMonth: any
currentDate: any
}
Expand Down Expand Up @@ -190,8 +190,6 @@ export type VxeDatePickerEmits = [
'date-next'
]

type DatePanelType = 'year' | 'quarter' | 'month' | 'week' | 'day'

export namespace VxeDatePickerDefines {
export interface DatePickerEventParams extends VxeComponentEventParams {
$datePicker: VxeDatePickerConstructor
Expand Down Expand Up @@ -239,6 +237,8 @@ export namespace VxeDatePickerDefines {
label: string;
}

export type DatePanelType = 'year' | 'quarter' | 'month' | 'week' | 'day'

interface DateFestivalItem {
/**
* 显示名称
Expand Down
6 changes: 3 additions & 3 deletions types/components/input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export namespace VxeInputPropTypes {
export type Maxlength = string | number
}

type DatePanelType = 'year' | 'quarter' | 'month' | 'week' | 'day'

export type VxeInputProps = {
size?: VxeInputPropTypes.Size
modelValue?: VxeInputPropTypes.ModelValue
Expand Down Expand Up @@ -169,7 +167,7 @@ export interface InputReactData {
datetimePanelValue: any
datePanelValue: Date | null
datePanelLabel: string
datePanelType: DatePanelType
datePanelType: VxeInputDefines.DatePanelType
selectMonth: any
currentDate: any
}
Expand Down Expand Up @@ -253,6 +251,8 @@ export namespace VxeInputDefines {
extra?: string | DateFestivalItem
}

export type DatePanelType = 'year' | 'quarter' | 'month' | 'week' | 'day'

export interface DateFestivalParams {
$input: VxeInputConstructor
type: string
Expand Down
35 changes: 35 additions & 0 deletions types/components/table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3806,7 +3806,25 @@ export namespace VxeTableDefines {
export interface MenuFirstOption {
code?: string
name?: string
prefixConfig?: {
icon?: string
content?: string
className?: string
}
/**
* 请使用 prefixConfig
* @deprecated
*/
prefixIcon?: string
suffixConfig?: {
icon?: string
content?: string
className?: string
}
/**
* 请使用 suffixConfig
* @deprecated
*/
suffixIcon?: string
className?: string
visible?: boolean
Expand All @@ -3818,7 +3836,24 @@ export namespace VxeTableDefines {
export interface MenuChildOption {
code?: string
name?: string
prefixConfig?: {
icon?: string
content?: string
}
/**
* 请使用 prefixConfig
* @deprecated
*/
prefixIcon?: string
suffixConfig?: {
icon?: string
content?: string
}
/**
* 请使用 suffixConfig
* @deprecated
*/
suffixIcon?: string
className?: string
visible?: boolean
disabled?: boolean
Expand Down

0 comments on commit c16d6ea

Please sign in to comment.