diff --git a/package.json b/package.json index 1f6b8ab1..cb64973a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/calendar/src/calendar.ts b/packages/calendar/src/calendar.ts index a5fc5f13..8cf9a54f 100644 --- a/packages/calendar/src/calendar.ts +++ b/packages/calendar/src/calendar.ts @@ -51,10 +51,6 @@ export default defineComponent({ const quarterSize = 8 const reactData = reactive({ - panelIndex: 0, - panelStyle: null, - panelPlacement: '', - isActivated: false, selectValue: props.modelValue, inputValue: props.modelValue, datePanelValue: null, diff --git a/packages/select/src/select.ts b/packages/select/src/select.ts index 056be7f7..1a21e697 100644 --- a/packages/select/src/select.ts +++ b/packages/select/src/select.ts @@ -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) } diff --git a/types/components/calendar.d.ts b/types/components/calendar.d.ts index f3df3617..6bae9316 100644 --- a/types/components/calendar.d.ts +++ b/types/components/calendar.d.ts @@ -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 */ @@ -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 = { @@ -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 } @@ -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 = {} diff --git a/types/components/date-picker.d.ts b/types/components/date-picker.d.ts index 2f6cebdf..28dd9730 100644 --- a/types/components/date-picker.d.ts +++ b/types/components/date-picker.d.ts @@ -138,7 +138,7 @@ export interface DatePickerReactData { datetimePanelValue: any datePanelValue: Date | null datePanelLabel: string - datePanelType: DatePanelType + datePanelType: VxeDatePickerDefines.DatePanelType selectMonth: any currentDate: any } @@ -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 @@ -239,6 +237,8 @@ export namespace VxeDatePickerDefines { label: string; } + export type DatePanelType = 'year' | 'quarter' | 'month' | 'week' | 'day' + interface DateFestivalItem { /** * 显示名称 diff --git a/types/components/input.d.ts b/types/components/input.d.ts index 2f52b763..cf8d8e60 100644 --- a/types/components/input.d.ts +++ b/types/components/input.d.ts @@ -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 @@ -169,7 +167,7 @@ export interface InputReactData { datetimePanelValue: any datePanelValue: Date | null datePanelLabel: string - datePanelType: DatePanelType + datePanelType: VxeInputDefines.DatePanelType selectMonth: any currentDate: any } @@ -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 diff --git a/types/components/table.d.ts b/types/components/table.d.ts index e1144260..1dcb826b 100644 --- a/types/components/table.d.ts +++ b/types/components/table.d.ts @@ -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 @@ -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