Skip to content

Commit

Permalink
releases 4.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Sep 27, 2024
1 parent 19910db commit f9d560a
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/views/modal/ModalTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

<p>
<vxe-button content="自定义模板" @click="demo1.value5 = true"></vxe-button>
<vxe-modal v-model="demo1.value5" width="600" :lock-view="false" :mask="false" show-zoom show-footer>
<vxe-modal v-model="demo1.value5" width="600" :lock-view="false" :mask="false" show-zoom>
<template #title>
<span style="color:red">自定义标题</span>
</template>
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.2.8",
"version": "4.2.9",
"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 @@ -200,7 +200,8 @@ export default {
zoomIn: 'Maximize',
zoomOut: 'Reduction',
close: 'Close',
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.'
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.',
footPropErr: '"show-footer" is only used to enable table tails and needs to be used in conjunction with "show-confirm-button" | "show-cancel-button" | slots'
},
drawer: {
close: 'Close'
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 @@ -200,7 +200,8 @@ export default {
zoomIn: 'Maximize',
zoomOut: 'Reducir',
close: 'Cerrar',
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.'
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.',
footPropErr: '"show-footer" is only used to enable table tails and needs to be used in conjunction with "show-confirm-button" | "show-cancel-button" | slots'
},
drawer: {
close: 'Cerrar'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export default {
zoomIn: 'maximalizálni',
zoomOut: 'csökkentés',
close: 'bezárás',
miniMaxSize: 'A minimalizált ablakok száma nem haladhatja meg a következőt: {0}'
miniMaxSize: 'A minimalizált ablakok száma nem haladhatja meg a következőt: {0}',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: 'bezárás'
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 @@ -200,7 +200,8 @@ export default {
zoomIn: '最大化',
zoomOut: '縮小',
close: '閉じる',
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.'
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: '閉じる'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export default {
zoomIn: '最大化',
zoomOut: '还原',
close: '关闭',
miniMaxSize: '最小化窗口的数量不能超过 {0} 个'
miniMaxSize: '最小化窗口的数量不能超过 {0} 个',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: '关闭'
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 @@ -200,7 +200,8 @@ export default {
zoomIn: 'Maximize',
zoomOut: 'Restaurar',
close: 'Fechar',
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.'
miniMaxSize: 'The number of minimized Windows cannot exceed {0}.',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: 'Fechar'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export default {
zoomIn: 'максимизировать',
zoomOut: 'снижение',
close: 'закрытие',
miniMaxSize: 'Количество свернутых окон не может превышать {0}.'
miniMaxSize: 'Количество свернутых окон не может превышать {0}.',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: 'закрытие'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/uk-UA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export default {
zoomIn: '最大化',
zoomOut: '还原',
close: '关闭',
miniMaxSize: '最小化窗口的数量不能超过 {0} 个'
miniMaxSize: '最小化窗口的数量不能超过 {0} 个',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: '关闭'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/vi-VN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export default {
zoomIn: '最大化',
zoomOut: '还原',
close: '关闭',
miniMaxSize: '最小化窗口的数量不能超过 {0} 个'
miniMaxSize: '最小化窗口的数量不能超过 {0} 个',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: '关闭'
Expand Down
3 changes: 2 additions & 1 deletion packages/language/zh-CHT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export default {
zoomIn: '最大化',
zoomOut: '還原',
close: '關閉',
miniMaxSize: '最小化視窗的數量不能超過 {0} 個'
miniMaxSize: '最小化視窗的數量不能超過 {0} 個',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: '關閉'
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 @@ -200,7 +200,8 @@ export default {
zoomIn: '最大化',
zoomOut: '还原',
close: '关闭',
miniMaxSize: '最小化窗口的数量不能超过 {0} 个'
miniMaxSize: '最小化窗口的数量不能超过 {0} 个',
footPropErr: 'show-footer 仅用于启用表尾,需配合 show-confirm-button | show-cancel-button | 插槽使用'
},
drawer: {
close: '关闭'
Expand Down
7 changes: 6 additions & 1 deletion packages/modal/src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { VxeUI, getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, cr
import VxeButtonComponent from '../../button/src/button'
import VxeLoadingComponent from '../../loading/index'
import { getSlotVNs } from '../../ui/src/vn'
import { errLog } from '../../ui/src/log'
import { warnLog, errLog } from '../../ui/src/log'

import type { VxeModalConstructor, VxeModalPropTypes, ModalReactData, ModalInternalData, VxeModalEmits, VxeModalPrivateComputed, ModalEventTypes, VxeButtonInstance, ModalMethods, ModalPrivateRef, VxeModalMethods, ValueOf } from '../../../types'

Expand Down Expand Up @@ -1359,6 +1359,11 @@ export default defineComponent({
})

onMounted(() => {
if (process.env.VUE_APP_VXE_ENV === 'development') {
if (props.type === 'modal' && props.showFooter && !(props.showConfirmButton || props.showCancelButton || slots.footer)) {
warnLog('vxe.modal.footPropErr')
}
}
nextTick(() => {
if (props.storage && !props.id) {
errLog('vxe.error.reqProp', ['modal.id'])
Expand Down
30 changes: 18 additions & 12 deletions packages/text-ellipsis/src/text-ellipsis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ export default defineComponent({
const el = refElem.value
const ryEl = realityElem.value
if (el && ryEl) {
let fontSize = 10
let fontSize = 12
try {
fontSize = Math.max(10, XEUtils.toNumber(getComputedStyle(ryEl).fontSize))
} catch (e) {}
const ctextContent = computeTextContent.value
const textContent = computeTextContent.value
let currIndex = Math.floor((targetWidth) / fontSize)
let currStr = ctextContent.slice(0, currIndex)
let currStr = textContent.slice(0, currIndex)
ryEl.textContent = currStr
reactData.visibleLen = currStr.length
let maxCount = 0
Expand All @@ -102,20 +102,18 @@ export default defineComponent({
const offsetIndex = Math.floor((targetWidth - ryEl.clientWidth) / fontSize)
if (offsetIndex) {
currIndex += offsetIndex
currStr = ctextContent.slice(0, currIndex)
currStr = textContent.slice(0, currIndex)
ryEl.textContent = currStr
reactData.visibleLen = currStr.length
} else {
break
}
}
Object.assign(ryEl.style, {
display: '',
position: '',
top: '',
left: ''
})
ryEl.textContent = ''
ryEl.style.display = ''
ryEl.style.position = ''
ryEl.style.top = ''
ryEl.style.left = ''
}
}

Expand Down Expand Up @@ -158,9 +156,9 @@ export default defineComponent({
const el = refElem.value
if (el && textLineClamp > 1) {
if (window.ResizeObserver) {
const observerObj = new window.ResizeObserver(() => {
const observerObj = new window.ResizeObserver(XEUtils.throttle(() => {
updateStyle()
})
}, 300, { leading: true, trailing: true }))
observerObj.observe(el)
reactData.resizeObserver = observerObj
}
Expand Down Expand Up @@ -215,7 +213,15 @@ export default defineComponent({

onBeforeUnmount(() => {
const { resizeObserver } = reactData
const el = refElem.value
const ryEl = realityElem.value
if (ryEl) {
ryEl.textContent = ''
}
if (resizeObserver) {
if (el) {
resizeObserver.unobserve(el)
}
resizeObserver.disconnect()
reactData.resizeObserver = null
}
Expand Down

0 comments on commit f9d560a

Please sign in to comment.