uview-plus 3.5.25 → 3.5.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 3.5.28(2025-08-29)
2
+ feat: 多语言增加泰语
3
+
4
+ ## 3.5.27(2025-08-29)
5
+ feat: 新增基于tooltip的popover组件
6
+
7
+ ## 3.5.26(2025-08-29)
8
+ improvment: 增强多语言兼容性
9
+
1
10
  ## 3.5.25(2025-08-28)
2
11
  fix: 修复左侧与右侧弹出时页面打开闪现问题
3
12
 
@@ -0,0 +1,59 @@
1
+ import { defineMixin } from '../../libs/vue'
2
+ import defProps from '../../libs/config/props.js'
3
+
4
+ export const props = defineMixin({
5
+ props: {
6
+ // 显示的文字内容
7
+ text: {
8
+ type: [String, Number],
9
+ default: ''
10
+ },
11
+ // 文字颜色
12
+ color: {
13
+ type: String,
14
+ default: '#333'
15
+ },
16
+ // 背景颜色
17
+ bgColor: {
18
+ type: String,
19
+ default: '#f7f7f7'
20
+ },
21
+ // 弹出框背景颜色
22
+ popupBgColor: {
23
+ type: String,
24
+ default: '#f7f7f7'
25
+ },
26
+ // 弹出框位置
27
+ placement: {
28
+ type: String,
29
+ default: 'top'
30
+ },
31
+ // 触发方式
32
+ triggerMode: {
33
+ type: String,
34
+ default: 'click'
35
+ },
36
+ // 是否显示 (manual模式下使用)
37
+ show: {
38
+ type: Boolean,
39
+ default: false
40
+ },
41
+ // z-index值
42
+ zIndex: {
43
+ type: [Number, String],
44
+ default: 10070
45
+ },
46
+ // 强制定位
47
+ forcePosition: {
48
+ type: Object,
49
+ default() {
50
+ return {}
51
+ }
52
+ },
53
+ // 弹出方向
54
+ direction: {
55
+ type: String,
56
+ default: 'top'
57
+ }
58
+ }
59
+ })
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <view class="up-popover">
3
+ <up-tooltip
4
+ ref="tooltip"
5
+ :text="text"
6
+ :color="color"
7
+ :bg-color="bgColor"
8
+ :popup-bg-color="popupBgColor"
9
+ :placement="placement"
10
+ :trigger-mode="triggerMode"
11
+ :show="show"
12
+ :z-index="zIndex"
13
+ :force-position="forcePosition"
14
+ :direction="direction"
15
+ @open="onOpen"
16
+ @close="onClose"
17
+ @click="onClick"
18
+ >
19
+ <template #trigger>
20
+ <slot name="trigger"></slot>
21
+ </template>
22
+ <template #content>
23
+ <view class="up-popover__content">
24
+ <slot name="content">
25
+ <text>{{text}}</text>
26
+ </slot>
27
+ </view>
28
+ </template>
29
+ </up-tooltip>
30
+ </view>
31
+ </template>
32
+
33
+ <script>
34
+ import { props } from './props';
35
+ import { mpMixin } from '../../libs/mixin/mpMixin';
36
+ import { mixin } from '../../libs/mixin/mixin';
37
+ /**
38
+ * popover 气泡弹出框
39
+ * @description 基于tooltip二次封装的popover组件,用于展示更丰富的内容
40
+ * @tutorial https://www.uviewui.com/components/popover.html
41
+ * @property {String | Number} text 显示的文字内容
42
+ * @property {String} color 文字颜色
43
+ * @property {String} bgColor 背景颜色
44
+ * @property {String} popupBgColor 弹出框背景颜色
45
+ * @property {String} placement 弹出框位置 (top, bottom, left, right)
46
+ * @property {String} triggerMode 触发方式 (hover, click, manual)
47
+ * @property {Boolean} show 是否显示 (manual模式下使用)
48
+ * @property {Number | String} zIndex z-index值
49
+ * @property {Object} forcePosition 强制定位 {top, left, right, bottom}
50
+ * @property {String} direction 弹出方向 (top, bottom, left, right)
51
+ * @event {Function} open 弹出框打开时触发
52
+ * @event {Function} close 弹出框关闭时触发
53
+ * @event {Function} click 点击触发器时触发
54
+ * @example <up-popover text="提示内容"><template #trigger><up-button>点击</up-button></template></up-popover>
55
+ */
56
+ export default {
57
+ name: 'up-popover',
58
+ mixins: [mpMixin, mixin, props],
59
+ data() {
60
+ return {
61
+
62
+ }
63
+ },
64
+ methods: {
65
+ onOpen() {
66
+ this.$emit('open');
67
+ },
68
+ onClose() {
69
+ this.$emit('close');
70
+ },
71
+ onClick() {
72
+ this.$emit('click');
73
+ },
74
+ // 打开popover
75
+ open() {
76
+ this.$refs.tooltip && this.$refs.tooltip.open();
77
+ },
78
+ // 关闭popover
79
+ close() {
80
+ this.$refs.tooltip && this.$refs.tooltip.close();
81
+ }
82
+ }
83
+ }
84
+ </script>
85
+
86
+ <style lang="scss" scoped>
87
+ .up-popover {
88
+
89
+ &__content {
90
+ @include flex;
91
+ align-items: center;
92
+ padding: 12px 16px;
93
+ }
94
+ }
95
+ </style>
@@ -145,7 +145,7 @@
145
145
  left: 0
146
146
  },
147
147
  // 文本的位置信息
148
- textInfo: {
148
+ triggerInfo: {
149
149
  width: 0,
150
150
  left: 0
151
151
  },
@@ -182,8 +182,8 @@
182
182
  // 右侧显示逻辑
183
183
  style.transform = ``
184
184
  // 垂直居中对齐
185
- style.top = '-' + addUnit((this.textInfo.height - this.tooltipInfo.height) / 2, 'px')
186
- style.right = addUnit(this.textInfo.width + this.indicatorWidth, 'px')
185
+ style.top = '-' + addUnit((this.triggerInfo.height - this.tooltipInfo.height) / 2, 'px')
186
+ style.right = addUnit(this.triggerInfo.width + this.indicatorWidth, 'px')
187
187
  this.indicatorStyle = {}
188
188
  this.indicatorStyle.right = '-4px'
189
189
  this.indicatorStyle.top = addUnit((this.tooltipInfo.height - this.indicatorWidth) / 2, 'px')
@@ -191,27 +191,27 @@
191
191
  // 右侧显示逻辑
192
192
  style.transform = ``
193
193
  // 垂直居中对齐
194
- style.top = '-' + addUnit((this.textInfo.height - this.tooltipInfo.height) / 2, 'px')
195
- style.left = addUnit(this.textInfo.width + this.indicatorWidth, 'px')
194
+ style.top = '-' + addUnit((this.triggerInfo.height - this.tooltipInfo.height) / 2, 'px')
195
+ style.left = addUnit(this.triggerInfo.width + this.indicatorWidth, 'px')
196
196
  this.indicatorStyle = {}
197
197
  this.indicatorStyle.left = '-4px'
198
- this.indicatorStyle.top = addUnit((this.textInfo.height - this.indicatorWidth) / 2, 'px')
198
+ this.indicatorStyle.top = addUnit((this.triggerInfo.height - this.indicatorWidth) / 2, 'px')
199
199
  } else if (this.direction === 'top' || this.direction === 'bottom') {
200
200
  style.transform = `translateY(${this.direction === 'top' ? '-100%' : '100%'})`
201
- if (this.tooltipInfo.width / 2 > this.textInfo.left + this.textInfo.width / 2 - this.screenGap) {
201
+ if (this.tooltipInfo.width / 2 > this.triggerInfo.left + this.triggerInfo.width / 2 - this.screenGap) {
202
202
  this.indicatorStyle = {}
203
- style.left = `-${addUnit(this.textInfo.left - this.screenGap)}`
204
- this.indicatorStyle.left = addUnit(this.textInfo.width / 2 - getPx(style.left) - this.indicatorWidth /
203
+ style.left = `-${addUnit(this.triggerInfo.left - this.screenGap)}`
204
+ this.indicatorStyle.left = addUnit(this.triggerInfo.width / 2 - getPx(style.left) - this.indicatorWidth /
205
205
  2, 'px')
206
- } else if (this.tooltipInfo.width / 2 > sysInfo.windowWidth - this.textInfo.right + this.textInfo.width / 2 -
206
+ } else if (this.tooltipInfo.width / 2 > sysInfo.windowWidth - this.triggerInfo.right + this.triggerInfo.width / 2 -
207
207
  this.screenGap) {
208
208
  this.indicatorStyle = {}
209
- style.right = `-${addUnit(sysInfo.windowWidth - this.textInfo.right - this.screenGap)}`
210
- this.indicatorStyle.right = addUnit(this.textInfo.width / 2 - getPx(style.right) - this
209
+ style.right = `-${addUnit(sysInfo.windowWidth - this.triggerInfo.right - this.screenGap)}`
210
+ this.indicatorStyle.right = addUnit(this.triggerInfo.width / 2 - getPx(style.right) - this
211
211
  .indicatorWidth / 2)
212
212
  } else {
213
- const left = Math.abs(this.textInfo.width / 2 - this.tooltipInfo.width / 2)
214
- style.left = this.textInfo.width > this.tooltipInfo.width ? addUnit(left) : -addUnit(left)
213
+ const left = Math.abs(this.triggerInfo.width / 2 - this.tooltipInfo.width / 2)
214
+ style.left = this.triggerInfo.width > this.tooltipInfo.width ? addUnit(left) : -addUnit(left)
215
215
  this.indicatorStyle = {}
216
216
  }
217
217
  if (this.direction === 'top') {
@@ -296,7 +296,7 @@
296
296
  this.tooltipInfo = await this.queryRect(this.tooltipId)
297
297
  // 获取气泡尺寸之后,将其隐藏,为了让下次切换气泡显示与隐藏时,有淡入淡出的效果
298
298
  this.showTooltip = false
299
- this.textInfo = await this.queryRect(this.textId)
299
+ this.triggerInfo = await this.queryRect(this.textId)
300
300
  sleep(500).then(() => {
301
301
  this.calcReacted = true
302
302
  })
@@ -33,7 +33,11 @@ uni.onLocaleChange((locale) => {
33
33
  export function t(value, params = {}) {
34
34
  // console.log(settings.locales[settings.lang])
35
35
  if (value) {
36
- let result = settings.locales[settings.lang][value] || value;
36
+ let lang = settings.lang
37
+ if (!settings.locales[settings.lang]) {
38
+ lang = 'zh-Hans'
39
+ }
40
+ let result = settings.locales[lang][value] || value;
37
41
  // 替换{xxx}格式的变量
38
42
  Object.keys(params).forEach(key => {
39
43
  const reg = new RegExp(`{${key}}`, 'g');
@@ -0,0 +1,80 @@
1
+ {
2
+ "up.common.cancel": "ยกเลิก",
3
+ "up.common.confirm": "ยืนยัน",
4
+ "up.common.start": "เริ่มต้น",
5
+ "up.common.end": "สิ้นสุด",
6
+ "up.common.stop": "หยุด",
7
+ "up.common.copy": "คัดลอก",
8
+ "up.common.none": "ไม่มี",
9
+ "up.common.tip": "คำแนะนำ",
10
+ "up.common.success": "สำเร็จ",
11
+ "up.common.fail": "ล้มเหลว",
12
+ "up.common.close": "ปิด",
13
+ "up.common.preview": "ดูตัวอย่าง",
14
+ "up.common.re-select": "เลือกใหม่",
15
+ "up.common.rotate": "หมุน",
16
+ "up.common.pleaseChoose": "กรุณาเลือก",
17
+ "up.common.loading": "กำลังโหลด",
18
+ "up.common.loading2": "กำลังโหลด",
19
+ "up.common.inOperation": "กำลังดำเนินการ",
20
+ "up.common.settings": "การตั้งค่า",
21
+ "up.common.retry": "ลองใหม่",
22
+ "up.common.search": "ค้นหา",
23
+ "up.common.more": "เพิ่มเติม",
24
+ "up.common.video": "วิดีโอ",
25
+ "up.common.file": "ไฟล์",
26
+ "up.week.one": "จันทร์",
27
+ "up.week.two": "อังคาร",
28
+ "up.week.three": "พุธ",
29
+ "up.week.four": "พฤหัสบดี",
30
+ "up.week.five": "ศุกร์",
31
+ "up.week.six": "เสาร์",
32
+ "up.week.seven": "อาทิตย์",
33
+ "up.barcode.error": "สร้างบาร์โค้ดไม่สำเร็จ",
34
+ "up.calendar.chooseDates": "เลือกวันที่",
35
+ "up.calendar.disabled": "วันที่นี้ถูกปิดการใช้งาน",
36
+ "up.calendar.daysExceed": "จำนวนวันที่เลือกต้องไม่เกิน {days} วัน",
37
+ "up.cityLocate.locateCity": "ระบุตำแหน่งเมือง",
38
+ "up.cityLocate.fail": "การระบุตำแหน่งล้มเหลว กรุณาคลิกเพื่อลองใหม่",
39
+ "up.cityLocate.locating": "กำลังระบุตำแหน่ง",
40
+ "up.code.send": "รับรหัสยืนยัน",
41
+ "up.code.resendAfter": "ส่งใหม่ใน X วินาที",
42
+ "up.code.resend": "ส่งใหม่",
43
+ "up.cropper.emptyWidhtOrHeight": "ไม่ได้ตั้งค่าความกว้างหรือความสูงของกรอบตัดภาพ",
44
+ "up.empty.car": "รถเข็นว่างเปล่า",
45
+ "up.empty.page": "ไม่มีหน้านี้",
46
+ "up.empty.search": "ไม่มีผลลัพธ์การค้นหา",
47
+ "up.empty.address": "ไม่มีที่อยู่จัดส่ง",
48
+ "up.empty.wifi": "ไม่มี WiFi",
49
+ "up.empty.order": "ไม่มีคำสั่งซื้อ",
50
+ "up.empty.coupon": "ไม่มีคูปอง",
51
+ "up.empty.favor": "ไม่มีรายการโปรด",
52
+ "up.empty.permission": "ไม่มีสิทธิ์",
53
+ "up.empty.history": "ไม่มีประวัติ",
54
+ "up.empty.news": "ไม่มีรายการข่าว",
55
+ "up.empty.message": "รายการข้อความว่างเปล่า",
56
+ "up.empty.list": "รายการว่างเปล่า",
57
+ "up.empty.data": "ข้อมูลว่างเปล่า",
58
+ "up.empty.comment": "ไม่มีความคิดเห็น",
59
+ "up.link.copyed": "คัดลอกลิงก์แล้ว กรุณาเปิดในเบราว์เซอร์",
60
+ "up.loadmoe.loadmore": "โหลดเพิ่มเติม",
61
+ "up.loadmoe.nomore": "ไม่มีข้อมูลเพิ่มเติม",
62
+ "up.noNetwork.text": "อ๊ะ ขาดการเชื่อมต่อเครือข่าย",
63
+ "up.noNetwork.pleaseCheck": "กรุณาตรวจสอบเครือข่าย หรือไปที่",
64
+ "up.noNetwork.connect": "เชื่อมต่อเครือข่ายแล้ว",
65
+ "up.noNetwork.disconnect": "ไม่มีการเชื่อมต่อเครือข่าย",
66
+ "up.pagination.previous": "หน้าก่อนหน้า",
67
+ "up.pagination.next": "หน้าถัดไป",
68
+ "up.pullRefresh.pull": "ดึงเพื่อรีเฟรช",
69
+ "up.pullRefresh.release": "ปล่อยเพื่อรีเฟรช",
70
+ "up.pullRefresh.refreshing": "กำลังรีเฟรช",
71
+ "up.readMore.expand": "ขยายเพื่ออ่านทั้งหมด",
72
+ "up.readMore.fold": "ย่อ",
73
+ "up.search.placeholder": "กรุณาใส่คำสำคัญ",
74
+ "up.signature.penSize": "ขนาดเส้น",
75
+ "up.signature.penColor": "สีเส้น",
76
+ "up.upload.sizeExceed": "เกินขนาดที่กำหนด",
77
+ "up.upload.uploading": "กำลังอัปโหลด",
78
+ "up.upload.previewImageFail": "ดูตัวอย่างภาพไม่สำเร็จ",
79
+ "up.upload.previewVideoFail": "ดูตัวอย่างวิดีโอไม่สำเร็จ"
80
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙跨端移动组件库,组件丰富维护更新稳定。",
5
- "version": "3.5.25",
5
+ "version": "3.5.28",
6
6
  "description": "零云®uview-plus已兼容vue3支持多语言,100+全面的组件和便捷的工具会让您信手拈来。近期新增拖动排序、条码、图片裁剪、下拉刷新、虚拟列表、签名、Markdown等。",
7
7
  "keywords": [
8
8
  "uview",