Skip to content

Commit

Permalink
releases 4.3.64
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jan 5, 2025
1 parent df0c777 commit 050250c
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 69 deletions.
27 changes: 20 additions & 7 deletions examples/views/date-picker/DatePickerTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,17 @@
<vxe-date-picker v-model="demo1.val6" placeholder="周选择,周五开始" type="week" :start-day="5" clearable></vxe-date-picker>
<vxe-date-picker v-model="demo1.val7" placeholder="周选择,周六开始" type="week" :start-day="6" clearable></vxe-date-picker>

<vxe-date-picker v-model="demo1.val8" placeholder="可选日期限制" start-date="2000-01-01" end-date="2040-01-01"></vxe-date-picker>
<vxe-date-picker v-model="demo1.val8" placeholder="可选日期限制" start-date="2000-01-01" end-date="2040-01-01" :shortcut-config="shortcutConfig1"></vxe-date-picker>

<vxe-date-picker v-model="demo1.val828" placeholder="时:分" type="time" value-format="HH:mm" label-format="HH:mm" clearable></vxe-date-picker>
<vxe-date-picker v-model="demo1.val829" placeholder="" type="time" value-format="HH" label-format="HH" clearable></vxe-date-picker>
</p>
</div>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'
import { VxeInputPropTypes, VxeInputDefines } from '../../../types'
import { ref, reactive } from 'vue'
import { VxeDatePickerPropTypes, VxeInputDefines } from '../../../types'
import XEUtils from 'xe-utils'
const demo1 = reactive({
Expand Down Expand Up @@ -183,10 +186,20 @@ const demo1 = reactive({
value803: '',
value804: '',
value805: '',
value900: '11111111'
value900: '11111111',
val828: '',
val829: ''
})
const shortcutConfig1 = ref<VxeDatePickerPropTypes.ShortcutConfig>({
options: [
{ content: '上一周' },
{ content: '本周' },
{ content: '下一周' }
]
})
const disabledDateMethod: VxeInputPropTypes.DisabledMethod = (params) => {
const disabledDateMethod: VxeDatePickerPropTypes.DisabledMethod = (params) => {
const { date } = params
const dd = date.getDate()
return dd > 15
Expand All @@ -213,7 +226,7 @@ const noticeMaps: { [key: string]: VxeInputDefines.DateFestivalInfo } = {
label: '游泳'
}
}
const festivalNoticeMethod: VxeInputPropTypes.FestivalMethod = (params) => {
const festivalNoticeMethod: VxeDatePickerPropTypes.FestivalMethod = (params) => {
const { date, viewType } = params
if (viewType === 'day') {
const ymd = XEUtils.toDateString(date, 'yyyyMMdd')
Expand Down Expand Up @@ -271,7 +284,7 @@ const calendarMaps: { [key: string]: VxeInputDefines.DateFestivalInfo } = {
}
}
}
const festivalCalendarMethod: VxeInputPropTypes.FestivalMethod = (params) => {
const festivalCalendarMethod: VxeDatePickerPropTypes.FestivalMethod = (params) => {
const { date, viewType } = params
if (viewType === 'day') {
const ymd = XEUtils.toDateString(date, 'yyyyMMdd')
Expand Down
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.3.63",
"version": "4.3.64",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
1 change: 1 addition & 0 deletions packages/button/src/button-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineComponent({
round: Boolean as PropType<VxeButtonGroupPropTypes.Round>,
vertical: Boolean as PropType<VxeButtonGroupPropTypes.Vertical>,
circle: Boolean as PropType<VxeButtonGroupPropTypes.Circle>,
align: String as PropType<VxeButtonGroupPropTypes.Align>,
className: [String, Function] as PropType<VxeButtonGroupPropTypes.ClassName>,
disabled: Boolean as PropType<VxeButtonGroupPropTypes.Disabled>,
permissionCode: [String, Number] as PropType<VxeButtonGroupPropTypes.PermissionCode>,
Expand Down
22 changes: 17 additions & 5 deletions packages/button/src/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ export default defineComponent({
return ''
})

const computeBtnAlign = computed(() => {
const { align } = props
if (align) {
return align
}
if ($xeButtonGroup) {
return $xeButtonGroup.props.align
}
return false
})

const computeBtnRound = computed(() => {
const { round } = props
if (round) {
Expand Down Expand Up @@ -551,12 +562,13 @@ export default defineComponent({
Object.assign($xeButton, buttonMethods)

const renderVN = () => {
const { className, popupClassName, align, trigger, title, routerLink, type, destroyOnClose, name, loading } = props
const { className, popupClassName, trigger, title, routerLink, type, destroyOnClose, name, loading } = props
const { initialized, isAniVisible, visiblePanel } = reactData
const isFormBtn = computeIsFormBtn.value
const btnMode = computeBtnMode.value
const btnStatus = computeBtnStatus.value
const btnRound = computeBtnRound.value
const btnAlign = computeBtnAlign.value
const btnCircle = computeBtnCircle.value
const btnTransfer = computeBtnTransfer.value
const btnDisabled = computeBtnDisabled.value
Expand Down Expand Up @@ -588,7 +600,7 @@ export default defineComponent({
routerLink
? h(resolveComponent('router-link'), {
ref: refButton,
class: ['vxe-button', 'vxe-button--link', `type--${btnMode}`, align ? `align--${align}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
class: ['vxe-button', 'vxe-button--link', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
[`size--${vSize}`]: vSize,
[`theme--${btnStatus}`]: btnStatus,
'is--round': btnRound,
Expand All @@ -614,7 +626,7 @@ export default defineComponent({
})
: h('button', {
ref: refButton,
class: ['vxe-button', `type--${btnMode}`, align ? `align--${align}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
class: ['vxe-button', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
[`size--${vSize}`]: vSize,
[`theme--${btnStatus}`]: btnStatus,
'is--round': btnRound,
Expand Down Expand Up @@ -662,7 +674,7 @@ export default defineComponent({
if (routerLink) {
return h(resolveComponent('router-link'), {
ref: refButton,
class: ['vxe-button', 'vxe-button--link', `type--${btnMode}`, align ? `align--${align}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
class: ['vxe-button', 'vxe-button--link', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
[`size--${vSize}`]: vSize,
[`theme--${btnStatus}`]: btnStatus,
'is--round': btnRound,
Expand All @@ -686,7 +698,7 @@ export default defineComponent({
}
return h('button', {
ref: refButton,
class: ['vxe-button', `type--${btnMode}`, align ? `align--${align}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
class: ['vxe-button', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
[`size--${vSize}`]: vSize,
[`theme--${btnStatus}`]: btnStatus,
'is--round': btnRound,
Expand Down
Loading

0 comments on commit 050250c

Please sign in to comment.