Skip to content

Commit

Permalink
releases 4.0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jun 27, 2024
1 parent dd6a8c1 commit 4a6a098
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 62 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.37",
"version": "4.0.38",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
82 changes: 38 additions & 44 deletions packages/date-picker/src/date-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default defineComponent({
modelValue: [String, Number, Date] as PropType<VxeDatePickerPropTypes.ModelValue>,
immediate: { type: Boolean as PropType<VxeDatePickerPropTypes.Immediate>, default: true },
name: String as PropType<VxeDatePickerPropTypes.Name>,
type: { type: String as PropType<VxeDatePickerPropTypes.Type>, default: 'text' },
type: { type: String as PropType<VxeDatePickerPropTypes.Type>, default: 'date' },
clearable: { type: Boolean as PropType<VxeDatePickerPropTypes.Clearable>, default: () => getConfig().datePicker.clearable },
readonly: Boolean as PropType<VxeDatePickerPropTypes.Readonly>,
disabled: Boolean as PropType<VxeDatePickerPropTypes.Disabled>,
Expand Down Expand Up @@ -1921,17 +1921,6 @@ export default defineComponent({
return createCommentVNode()
}

const renderDatePickerIcon = () => {
return h('div', {
class: 'vxe-date-picker--control-icon',
onClick: datePickerOpenEvent
}, [
h('i', {
class: ['vxe-date-picker--date-picker-icon', getIcon().INPUT_DATE]
})
])
}

const renderPrefixIcon = () => {
const { prefixIcon } = props
const prefixSlot = slots.prefix
Expand All @@ -1958,41 +1947,46 @@ export default defineComponent({
const { inputValue } = reactData
const suffixSlot = slots.suffix
const isClearable = computeIsClearable.value
return isClearable || suffixSlot || suffixIcon
? h('div', {
class: ['vxe-date-picker--suffix', {
'is--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
}]
}, [
isClearable
? h('div', {
class: 'vxe-date-picker--clear-icon',
onClick: clearValueEvent
}, [
h('i', {
class: getIcon().INPUT_CLEAR
})
])
: createCommentVNode(),
renderExtraSuffixIcon(),
suffixSlot || suffixIcon
? h('div', {
class: 'vxe-date-picker--suffix-icon',
onClick: clickSuffixEvent
}, suffixSlot
? getSlotVNs(suffixSlot({}))
: [
h('i', {
class: suffixIcon
})
])
: createCommentVNode()
])
: null
return h('div', {
class: ['vxe-date-picker--suffix', {
'is--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
}]
}, [
isClearable
? h('div', {
class: 'vxe-date-picker--clear-icon',
onClick: clearValueEvent
}, [
h('i', {
class: getIcon().INPUT_CLEAR
})
])
: createCommentVNode(),
renderExtraSuffixIcon(),
suffixSlot || suffixIcon
? h('div', {
class: 'vxe-date-picker--suffix-icon',
onClick: clickSuffixEvent
}, suffixSlot
? getSlotVNs(suffixSlot({}))
: [
h('i', {
class: suffixIcon
})
])
: createCommentVNode()
])
}

const renderExtraSuffixIcon = () => {
return renderDatePickerIcon()
return h('div', {
class: 'vxe-date-picker--control-icon',
onClick: datePickerOpenEvent
}, [
h('i', {
class: ['vxe-date-picker--date-picker-icon', getIcon().DATE_PICKER_DATE]
})
])
}

datePickerMethods = {
Expand Down
3 changes: 3 additions & 0 deletions packages/form/render/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ renderer.mixin({
VxeSwitch: {
renderItemContent: defaultItemRender
},
VxeUpload: {
renderItemContent: defaultItemRender
},

// 以下已废弃
$input: {
Expand Down
8 changes: 4 additions & 4 deletions packages/input/src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2201,7 +2201,7 @@ export default defineComponent({
onMouseleave: numberStopDown
}, [
h('i', {
class: getIcon().INPUT_PREV_NUM
class: getIcon().NUMBER_INPUT_PREV_NUM
})
]),
h('div', {
Expand All @@ -2213,7 +2213,7 @@ export default defineComponent({
onMouseleave: numberStopDown
}, [
h('i', {
class: getIcon().INPUT_NEXT_NUM
class: getIcon().NUMBER_INPUT_NEXT_NUM
})
])
])
Expand All @@ -2226,7 +2226,7 @@ export default defineComponent({
onClick: datePickerOpenEvent
}, [
h('i', {
class: ['vxe-input--date-picker-icon', getIcon().INPUT_DATE]
class: ['vxe-input--date-picker-icon', getIcon().DATE_PICKER_DATE]
})
])
}
Expand All @@ -2249,7 +2249,7 @@ export default defineComponent({
onClick: passwordToggleEvent
}, [
h('i', {
class: ['vxe-input--password-icon', showPwd ? getIcon().INPUT_SHOW_PWD : getIcon().INPUT_PWD]
class: ['vxe-input--password-icon', showPwd ? getIcon().PASSWORD_INPUT_SHOW_PWD : getIcon().PASSWORD_INPUT_HIDE_PWD]
})
])
}
Expand Down
4 changes: 2 additions & 2 deletions packages/number-input/src/number-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export default defineComponent({
onMouseleave: numberStopDown
}, [
h('i', {
class: getIcon().INPUT_PREV_NUM
class: getIcon().NUMBER_INPUT_PREV_NUM
})
]),
h('div', {
Expand All @@ -550,7 +550,7 @@ export default defineComponent({
onMouseleave: numberStopDown
}, [
h('i', {
class: getIcon().INPUT_NEXT_NUM
class: getIcon().NUMBER_INPUT_NEXT_NUM
})
])
])
Expand Down
2 changes: 1 addition & 1 deletion packages/password-input/src/password-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default defineComponent({
onClick: passwordToggleEvent
}, [
h('i', {
class: ['password-input--password-icon', showPwd ? getIcon().INPUT_SHOW_PWD : getIcon().INPUT_PWD]
class: ['password-input--password-icon', showPwd ? getIcon().PASSWORD_INPUT_SHOW_PWD : getIcon().PASSWORD_INPUT_HIDE_PWD]
})
])
}
Expand Down
16 changes: 11 additions & 5 deletions packages/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,19 @@ setIcon({

// input
INPUT_CLEAR: iconPrefix + 'error-circle-fill',
INPUT_PWD: iconPrefix + 'eye-fill',
INPUT_SHOW_PWD: iconPrefix + 'eye-fill-close',
INPUT_PREV_NUM: iconPrefix + 'caret-up',
INPUT_NEXT_NUM: iconPrefix + 'caret-down',
INPUT_DATE: iconPrefix + 'calendar',
INPUT_SEARCH: iconPrefix + 'search',

// number-picker
NUMBER_INPUT_PREV_NUM: iconPrefix + 'caret-up',
NUMBER_INPUT_NEXT_NUM: iconPrefix + 'caret-down',

// date-picker
DATE_PICKER_DATE: iconPrefix + 'calendar',

// password-input
PASSWORD_INPUT_SHOW_PWD: iconPrefix + 'eye-fill-close',
PASSWORD_INPUT_HIDE_PWD: iconPrefix + 'eye-fill',

// modal
MODAL_ZOOM_MIN: iconPrefix + 'minus',
MODAL_ZOOM_REVERT: iconPrefix + 'recover',
Expand Down
16 changes: 11 additions & 5 deletions types/ui/global-icon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,19 @@ declare module '@vxe-ui/core' {

// input
INPUT_CLEAR?: string
INPUT_PWD?: string
INPUT_SHOW_PWD?: string
INPUT_PREV_NUM?: string
INPUT_NEXT_NUM?: string
INPUT_DATE?: string
INPUT_SEARCH?: string

// number-picker
NUMBER_INPUT_PREV_NUM?: string
NUMBER_INPUT_NEXT_NUM?: string

// date-picker
DATE_PICKER_DATE?: string

// password-input
PASSWORD_INPUT_SHOW_PWD?: string
PASSWORD_INPUT_HIDE_PWD?: string

// modal
MODAL_ZOOM_MIN?: string
MODAL_ZOOM_REVERT?: string
Expand Down

0 comments on commit 4a6a098

Please sign in to comment.