uview-plus 3.4.30 → 3.4.32
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 +16 -0
- package/components/u-cate-tab/u-cate-tab.vue +2 -0
- package/components/u-modal/u-modal.vue +3 -0
- package/components/u-navbar/props.js +5 -0
- package/components/u-navbar/u-navbar.vue +3 -2
- package/components/u-parse/node/node.vue +39 -28
- package/components/u-parse/parse.js +5 -5
- package/components/u-parse/parser.js +78 -15
- package/components/u-parse/u-parse.vue +1 -1
- package/components/u-qrcode/qrcode.js +14 -6
- package/components/u-qrcode/u-qrcode.vue +10 -0
- package/components/u-upload/u-upload.vue +1 -1
- package/libs/function/test.js +8 -1
- package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
- package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
- package/libs/util/gcanvas/context-webgl/Program.js +0 -0
- package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
- package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
- package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
- package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
- package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
- package/libs/util/gcanvas/env/canvas.js +0 -0
- package/libs/util/gcanvas/env/image.js +0 -0
- package/libs/util/gcanvas/env/tool.js +0 -0
- package/libs/util/gcanvas/index.js +0 -0
- package/package.json +1 -1
- package/types/comps/navbar.d.ts +5 -0
package/changelog.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 3.4.32(2025-05-26)
|
|
2
|
+
feat: 增加状态栏独立颜色配置支持支付宝小程序状态栏对背景色识别的不友好的情况
|
|
3
|
+
|
|
4
|
+
fix: 抖音二维码兼容修复
|
|
5
|
+
|
|
6
|
+
feat: cate-tab组件增加rightTop插槽 #715
|
|
7
|
+
|
|
8
|
+
fix: 修改 test.promise(res) 预期结果不一致
|
|
9
|
+
|
|
10
|
+
## 3.4.31(2025-05-17)
|
|
11
|
+
fix: 修复parse富文本组件导致鸿蒙运行白屏
|
|
12
|
+
|
|
13
|
+
fix: 去除演示项目中uni.$u用法便于兼容鸿蒙
|
|
14
|
+
|
|
15
|
+
feat: modal新增popupBottom插槽适用类似关闭按钮与内容区域分离的场景
|
|
16
|
+
|
|
1
17
|
## 3.4.30(2025-05-16)
|
|
2
18
|
feat: 新增pagination分页器组件
|
|
3
19
|
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
</scroll-view>
|
|
15
15
|
<scroll-view :scroll-top="scrollRightTop" scroll-with-animation
|
|
16
16
|
scroll-y class="u-cate-tab__right-box" @scroll="rightScroll">
|
|
17
|
+
<slot name="rightTop" :tabList="tabList">
|
|
18
|
+
</slot>
|
|
17
19
|
<view class="u-cate-tab__page-view">
|
|
18
20
|
<view class="u-cate-tab__page-item" :id="'item' + index"
|
|
19
21
|
v-for="(item , index) in tabList" :key="index">
|
|
@@ -58,6 +58,11 @@ export const props = defineMixin({
|
|
|
58
58
|
type: String,
|
|
59
59
|
default: () => defProps.navbar.bgColor
|
|
60
60
|
},
|
|
61
|
+
// 状态栏背景颜色 不写会使用背景颜色bgColor
|
|
62
|
+
statusBarBgColor: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: () => ''
|
|
65
|
+
},
|
|
61
66
|
// 标题的宽度
|
|
62
67
|
titleWidth: {
|
|
63
68
|
type: [String, Number],
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<view :class="[fixed && 'u-navbar--fixed']">
|
|
11
11
|
<u-status-bar
|
|
12
12
|
v-if="safeAreaInsetTop"
|
|
13
|
-
:bgColor="bgColor"
|
|
13
|
+
:bgColor="statusBarBgColor ? statusBarBgColor : bgColor"
|
|
14
14
|
></u-status-bar>
|
|
15
15
|
<view
|
|
16
16
|
class="u-navbar__content"
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
* @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
|
|
95
95
|
* @property {String} titleColor 文字颜色 (默认 '' )
|
|
96
96
|
* @property {String} bgColor 导航栏背景设置 (默认 '#ffffff' )
|
|
97
|
+
* @property {String} statusBarBgColor 状态栏背景颜色 不写同导航栏背景设置
|
|
97
98
|
* @property {String | Number} titleWidth 导航栏标题的最大宽度,内容超出会以省略号隐藏 (默认 '400rpx' )
|
|
98
99
|
* @property {String | Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上)(默认 '44px' )
|
|
99
100
|
* @property {String | Number} leftIconSize 左侧返回图标的大小(默认 20px )
|
|
@@ -170,7 +171,7 @@
|
|
|
170
171
|
|
|
171
172
|
&__left {
|
|
172
173
|
left: 0;
|
|
173
|
-
|
|
174
|
+
|
|
174
175
|
&--hover {
|
|
175
176
|
opacity: 0.7;
|
|
176
177
|
}
|
|
@@ -10,13 +10,19 @@
|
|
|
10
10
|
<!-- #endif -->
|
|
11
11
|
<!-- #ifndef H5 || (APP-PLUS && VUE2) -->
|
|
12
12
|
<!-- 表格中的图片,使用 rich-text 防止大小不正确 -->
|
|
13
|
-
<rich-text v-if="n.name==='img'&&n.t" :style="'display:'+n.t" :nodes="
|
|
13
|
+
<rich-text v-if="n.name==='img'&&n.t" :style="'display:'+n.t" :nodes="[{attrs:{style:n.attrs.style||'',src:n.attrs.src},name:'img'}]" :data-i="i" @tap.stop="imgTap" />
|
|
14
14
|
<!-- #endif -->
|
|
15
|
-
<!-- #
|
|
16
|
-
<image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+
|
|
15
|
+
<!-- #ifdef APP-HARMONY -->
|
|
16
|
+
<image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+ctrl[i]+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
|
|
17
|
+
<!-- #endif -->
|
|
18
|
+
<!-- #ifndef H5 || APP-PLUS || MP-KUAISHOU -->
|
|
19
|
+
<image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;height:1px;'+n.attrs.style" :src="n.attrs.src" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))" :lazy-load="opts[0]" :webp="n.webp" :show-menu-by-longpress="opts[3]&&!n.attrs.ignore" :image-menu-prevent="!opts[3]||n.attrs.ignore" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
|
|
20
|
+
<!-- #endif -->
|
|
21
|
+
<!-- #ifdef MP-KUAISHOU -->
|
|
22
|
+
<image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+n.attrs.style" :src="n.attrs.src" :lazy-load="opts[0]" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap"></image>
|
|
17
23
|
<!-- #endif -->
|
|
18
24
|
<!-- #ifdef APP-PLUS && VUE3 -->
|
|
19
|
-
<image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':'')" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
|
|
25
|
+
<image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||''))" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
|
|
20
26
|
<!-- #endif -->
|
|
21
27
|
<!-- 文本 -->
|
|
22
28
|
<!-- #ifdef MP-WEIXIN -->
|
|
@@ -25,14 +31,14 @@
|
|
|
25
31
|
<!-- #ifndef MP-WEIXIN || MP-BAIDU || MP-ALIPAY || MP-TOUTIAO -->
|
|
26
32
|
<text v-else-if="n.text" decode>{{n.text}}</text>
|
|
27
33
|
<!-- #endif -->
|
|
28
|
-
<text v-else-if="n.name==='br'"
|
|
34
|
+
<text v-else-if="n.name==='br'">{{'\n'}}</text>
|
|
29
35
|
<!-- 链接 -->
|
|
30
36
|
<view v-else-if="n.name==='a'" :id="n.attrs.id" :class="(n.attrs.href?'_a ':'')+n.attrs.class" hover-class="_hover" :style="'display:inline;'+n.attrs.style" :data-i="i" @tap.stop="linkTap">
|
|
31
37
|
<node name="span" :childs="n.children" :opts="opts" style="display:inherit" />
|
|
32
38
|
</view>
|
|
33
39
|
<!-- 视频 -->
|
|
34
40
|
<!-- #ifdef APP-PLUS -->
|
|
35
|
-
<view v-else-if="n.html" :id="n.attrs.id" :class="'_video '+n.attrs.class" :style="n.attrs.style" v-html="n.html" @vplay.stop="play" />
|
|
41
|
+
<view v-else-if="n.html" :id="n.attrs.id" :class="'_video '+n.attrs.class" :style="n.attrs.style" v-html="n.html" :data-i="i" @vplay.stop="play" />
|
|
36
42
|
<!-- #endif -->
|
|
37
43
|
<!-- #ifndef APP-PLUS -->
|
|
38
44
|
<video v-else-if="n.name==='video'" :id="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style" :autoplay="n.attrs.autoplay" :controls="n.attrs.controls" :loop="n.attrs.loop" :muted="n.attrs.muted" :object-fit="n.attrs['object-fit']" :poster="n.attrs.poster" :src="n.src[ctrl[i]||0]" :data-i="i" @play="play" @error="mediaError" />
|
|
@@ -61,13 +67,13 @@
|
|
|
61
67
|
</block>
|
|
62
68
|
</view>
|
|
63
69
|
</view>
|
|
64
|
-
|
|
70
|
+
<!-- insert -->
|
|
65
71
|
<!-- 富文本 -->
|
|
66
72
|
<!-- #ifdef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
|
|
67
73
|
<rich-text v-else-if="!n.c&&!handler.isInline(n.name, n.attrs.style)" :id="n.attrs.id" :style="n.f" :user-select="opts[4]" :nodes="[n]" />
|
|
68
74
|
<!-- #endif -->
|
|
69
75
|
<!-- #ifndef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
|
|
70
|
-
<rich-text v-else-if="!n.c" :id="n.attrs.id" :style="
|
|
76
|
+
<rich-text v-else-if="!n.c" :id="n.attrs.id" :style="'display:inline;'+n.f" :preview="false" :selectable="opts[4]" :user-select="opts[4]" :nodes="[n]" />
|
|
71
77
|
<!-- #endif -->
|
|
72
78
|
<!-- 继续递归 -->
|
|
73
79
|
<view v-else-if="n.c===2" :id="n.attrs.id" :class="'_block _'+n.name+' '+n.attrs.class" :style="n.f+';'+n.attrs.style">
|
|
@@ -106,7 +112,6 @@ module.exports = {
|
|
|
106
112
|
}
|
|
107
113
|
</script>
|
|
108
114
|
<script>
|
|
109
|
-
|
|
110
115
|
import node from './node'
|
|
111
116
|
export default {
|
|
112
117
|
name: 'node',
|
|
@@ -122,7 +127,7 @@ export default {
|
|
|
122
127
|
return {
|
|
123
128
|
ctrl: {},
|
|
124
129
|
// #ifdef MP-WEIXIN
|
|
125
|
-
isiOS: uni.
|
|
130
|
+
isiOS: uni.getSystemInfoSync().system.includes('iOS')
|
|
126
131
|
// #endif
|
|
127
132
|
}
|
|
128
133
|
},
|
|
@@ -138,14 +143,13 @@ export default {
|
|
|
138
143
|
opts: Array
|
|
139
144
|
},
|
|
140
145
|
components: {
|
|
141
|
-
|
|
142
|
-
// #ifndef (H5 || APP-PLUS) && VUE3
|
|
146
|
+
// #ifndef ((H5 || APP-PLUS) && VUE3) || APP-HARMONY
|
|
143
147
|
node
|
|
144
148
|
// #endif
|
|
145
149
|
},
|
|
146
150
|
mounted () {
|
|
147
151
|
this.$nextTick(() => {
|
|
148
|
-
for (this.root = this.$parent; this.root.$options.name !== '
|
|
152
|
+
for (this.root = this.$parent; this.root.$options.name !== 'mp-html'; this.root = this.root.$parent);
|
|
149
153
|
})
|
|
150
154
|
// #ifdef H5 || APP-PLUS
|
|
151
155
|
if (this.opts[0]) {
|
|
@@ -168,14 +172,14 @@ export default {
|
|
|
168
172
|
}
|
|
169
173
|
// #endif
|
|
170
174
|
},
|
|
171
|
-
|
|
175
|
+
beforeDestroy () {
|
|
172
176
|
// #ifdef H5 || APP-PLUS
|
|
173
177
|
if (this.observer) {
|
|
174
178
|
this.observer.disconnect()
|
|
175
179
|
}
|
|
176
180
|
// #endif
|
|
177
181
|
},
|
|
178
|
-
methods:{
|
|
182
|
+
methods: {
|
|
179
183
|
// #ifdef MP-WEIXIN
|
|
180
184
|
toJSON () { return this },
|
|
181
185
|
// #endif
|
|
@@ -184,7 +188,15 @@ export default {
|
|
|
184
188
|
* @param {Event} e
|
|
185
189
|
*/
|
|
186
190
|
play (e) {
|
|
187
|
-
|
|
191
|
+
const i = e.currentTarget.dataset.i
|
|
192
|
+
const node = this.childs[i]
|
|
193
|
+
this.root.$emit('play', {
|
|
194
|
+
source: node.name,
|
|
195
|
+
attrs: {
|
|
196
|
+
...node.attrs,
|
|
197
|
+
src: node.src[this.ctrl[i] || 0]
|
|
198
|
+
}
|
|
199
|
+
})
|
|
188
200
|
// #ifndef APP-PLUS
|
|
189
201
|
if (this.root.pauseVideo) {
|
|
190
202
|
let flag = false
|
|
@@ -227,7 +239,14 @@ export default {
|
|
|
227
239
|
// #ifdef H5 || APP-PLUS
|
|
228
240
|
node.attrs.src = node.attrs.src || node.attrs['data-src']
|
|
229
241
|
// #endif
|
|
230
|
-
|
|
242
|
+
// #ifndef APP-HARMONY
|
|
243
|
+
this.root.$emit('imgtap', node.attrs)
|
|
244
|
+
// #endif
|
|
245
|
+
// #ifdef APP-HARMONY
|
|
246
|
+
this.root.$emit('imgtap', {
|
|
247
|
+
...node.attrs
|
|
248
|
+
})
|
|
249
|
+
// #endif
|
|
231
250
|
// 自动预览图片
|
|
232
251
|
if (this.root.previewImg) {
|
|
233
252
|
uni.previewImage({
|
|
@@ -299,7 +318,7 @@ export default {
|
|
|
299
318
|
* @description 检查是否所有图片加载完毕
|
|
300
319
|
*/
|
|
301
320
|
checkReady () {
|
|
302
|
-
if (!this.root.lazyLoad) {
|
|
321
|
+
if (this.root && !this.root.lazyLoad) {
|
|
303
322
|
this.root._unloadimgs -= 1
|
|
304
323
|
if (!this.root._unloadimgs) {
|
|
305
324
|
setTimeout(() => {
|
|
@@ -321,7 +340,7 @@ export default {
|
|
|
321
340
|
const node = e.currentTarget ? this.childs[e.currentTarget.dataset.i] : {}
|
|
322
341
|
const attrs = node.attrs || e
|
|
323
342
|
const href = attrs.href
|
|
324
|
-
this.root.$emit('
|
|
343
|
+
this.root.$emit('linktap', Object.assign({
|
|
325
344
|
innerText: this.root.getText(node.children || []) // 链接内的文本内容
|
|
326
345
|
}, attrs))
|
|
327
346
|
if (href) {
|
|
@@ -407,9 +426,7 @@ export default {
|
|
|
407
426
|
._a {
|
|
408
427
|
padding: 1.5px 0 1.5px 0;
|
|
409
428
|
color: #366092;
|
|
410
|
-
/* #ifndef APP-NVUE */
|
|
411
429
|
word-break: break-all;
|
|
412
|
-
/* #endif */
|
|
413
430
|
}
|
|
414
431
|
|
|
415
432
|
/* a 标签点击态效果 */
|
|
@@ -427,9 +444,7 @@ export default {
|
|
|
427
444
|
/* 内部样式 */
|
|
428
445
|
|
|
429
446
|
._block {
|
|
430
|
-
/* #ifndef APP-NVUE */
|
|
431
447
|
display: block;
|
|
432
|
-
/* #endif */
|
|
433
448
|
}
|
|
434
449
|
|
|
435
450
|
._b,
|
|
@@ -476,9 +491,7 @@ export default {
|
|
|
476
491
|
._h4,
|
|
477
492
|
._h5,
|
|
478
493
|
._h6 {
|
|
479
|
-
/* #ifndef APP-NVUE */
|
|
480
494
|
display: block;
|
|
481
|
-
/* #endif */
|
|
482
495
|
font-weight: bold;
|
|
483
496
|
}
|
|
484
497
|
|
|
@@ -500,9 +513,7 @@ export default {
|
|
|
500
513
|
|
|
501
514
|
._ol,
|
|
502
515
|
._ul {
|
|
503
|
-
/* #ifndef APP-NVUE */
|
|
504
516
|
display: block;
|
|
505
|
-
/* #endif */
|
|
506
517
|
padding-left: 40px;
|
|
507
518
|
margin: 1em 0;
|
|
508
519
|
}
|
|
@@ -581,4 +592,4 @@ export default {
|
|
|
581
592
|
height: 225px;
|
|
582
593
|
}
|
|
583
594
|
/* #endif */
|
|
584
|
-
</style>
|
|
595
|
+
</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @Author :
|
|
2
|
+
* @Author : jry
|
|
3
3
|
* @Description :
|
|
4
|
-
* @version :
|
|
4
|
+
* @version : 3.0
|
|
5
5
|
* @Date : 2021-08-20 16:44:21
|
|
6
|
-
* @LastAuthor :
|
|
7
|
-
* @lastTime :
|
|
8
|
-
* @FilePath : /
|
|
6
|
+
* @LastAuthor : jry
|
|
7
|
+
* @lastTime : 2025-05-17 17:17:33
|
|
8
|
+
* @FilePath : /uview-plus/libs/config/props/parse.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// parse
|
|
@@ -71,19 +71,23 @@ const config = {
|
|
|
71
71
|
viewbox: 'viewBox',
|
|
72
72
|
attributename: 'attributeName',
|
|
73
73
|
repeatcount: 'repeatCount',
|
|
74
|
-
repeatdur: 'repeatDur'
|
|
74
|
+
repeatdur: 'repeatDur',
|
|
75
|
+
foreignobject: 'foreignObject'
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
const tagSelector={}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const tagSelector = {}
|
|
79
|
+
let windowWidth, system
|
|
80
|
+
// #ifdef MP-WEIXIN
|
|
81
|
+
if (uni.canIUse('getWindowInfo')) {
|
|
82
|
+
windowWidth = uni.getWindowInfo().windowWidth
|
|
83
|
+
system = uni.getDeviceInfo().system
|
|
84
|
+
} else {
|
|
81
85
|
// #endif
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
system
|
|
86
|
-
}
|
|
86
|
+
const systemInfo = uni.getSystemInfoSync()
|
|
87
|
+
windowWidth = systemInfo.windowWidth
|
|
88
|
+
// #ifdef MP-WEIXIN
|
|
89
|
+
system = systemInfo.system
|
|
90
|
+
}
|
|
87
91
|
// #endif
|
|
88
92
|
const blankChar = makeMap(' ,\r,\n,\t,\f')
|
|
89
93
|
let idIndex = 0
|
|
@@ -325,6 +329,7 @@ Parser.prototype.onTagName = function (name) {
|
|
|
325
329
|
this.tagName = this.xml ? name : name.toLowerCase()
|
|
326
330
|
if (this.tagName === 'svg') {
|
|
327
331
|
this.xml = (this.xml || 0) + 1 // svg 标签内大小写敏感
|
|
332
|
+
config.ignoreTags.style = undefined // svg 标签内 style 可用
|
|
328
333
|
}
|
|
329
334
|
}
|
|
330
335
|
|
|
@@ -335,12 +340,18 @@ Parser.prototype.onTagName = function (name) {
|
|
|
335
340
|
*/
|
|
336
341
|
Parser.prototype.onAttrName = function (name) {
|
|
337
342
|
name = this.xml ? name : name.toLowerCase()
|
|
343
|
+
// #ifdef (VUE3 && (H5 || APP-PLUS)) || APP-PLUS-NVUE
|
|
344
|
+
if (name.includes('?') || name.includes(';')) {
|
|
345
|
+
this.attrName = undefined
|
|
346
|
+
return
|
|
347
|
+
}
|
|
348
|
+
// #endif
|
|
338
349
|
if (name.substr(0, 5) === 'data-') {
|
|
339
350
|
if (name === 'data-src' && !this.attrs.src) {
|
|
340
351
|
// data-src 自动转为 src
|
|
341
352
|
this.attrName = 'src'
|
|
342
353
|
} else if (this.tagName === 'img' || this.tagName === 'a') {
|
|
343
|
-
// a 和 img 标签保留 data- 的属性,可以在
|
|
354
|
+
// a 和 img 标签保留 data- 的属性,可以在 imgtap 和 linktap 事件中使用
|
|
344
355
|
this.attrName = name
|
|
345
356
|
} else {
|
|
346
357
|
// 剩余的移除以减小大小
|
|
@@ -461,7 +472,7 @@ Parser.prototype.onOpenTag = function (selfClose) {
|
|
|
461
472
|
node.webp = 'T'
|
|
462
473
|
}
|
|
463
474
|
// data url 图片如果没有设置 original-src 默认为不可预览的小图片
|
|
464
|
-
if (attrs.src.includes('data:') && !attrs['original-src']) {
|
|
475
|
+
if (attrs.src.includes('data:') && this.options.previewImg !== 'all' && !attrs['original-src']) {
|
|
465
476
|
attrs.ignore = 'T'
|
|
466
477
|
}
|
|
467
478
|
if (!attrs.ignore || node.webp || attrs.src.includes('cloud://')) {
|
|
@@ -555,6 +566,13 @@ Parser.prototype.onOpenTag = function (selfClose) {
|
|
|
555
566
|
if (!isNaN(parseInt(styleObj.height)) && (!styleObj.height.includes('%') || (parent && (parent.attrs.style || '').includes('height')))) {
|
|
556
567
|
node.h = 'T'
|
|
557
568
|
}
|
|
569
|
+
if (node.w && node.h && styleObj['object-fit']) {
|
|
570
|
+
if (styleObj['object-fit'] === 'contain') {
|
|
571
|
+
node.m = 'aspectFit'
|
|
572
|
+
} else if (styleObj['object-fit'] === 'cover') {
|
|
573
|
+
node.m = 'aspectFill'
|
|
574
|
+
}
|
|
575
|
+
}
|
|
558
576
|
} else if (node.name === 'svg') {
|
|
559
577
|
siblings.push(node)
|
|
560
578
|
this.stack.push(node)
|
|
@@ -681,11 +699,19 @@ Parser.prototype.popNode = function () {
|
|
|
681
699
|
return
|
|
682
700
|
}
|
|
683
701
|
const name = config.svgDict[node.name] || node.name
|
|
702
|
+
if (name === 'foreignObject') {
|
|
703
|
+
for (const child of (node.children || [])) {
|
|
704
|
+
if (child.attrs && !child.attrs.xmlns) {
|
|
705
|
+
child.attrs.xmlns = 'http://www.w3.org/1999/xhtml'
|
|
706
|
+
break
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|
|
684
710
|
src += '<' + name
|
|
685
711
|
for (const item in node.attrs) {
|
|
686
712
|
const val = node.attrs[item]
|
|
687
713
|
if (val) {
|
|
688
|
-
src += ` ${config.svgDict[item] || item}="${val}"`
|
|
714
|
+
src += ` ${config.svgDict[item] || item}="${val.replace(/"/g, '')}"`
|
|
689
715
|
}
|
|
690
716
|
}
|
|
691
717
|
if (!node.children) {
|
|
@@ -707,6 +733,7 @@ Parser.prototype.popNode = function () {
|
|
|
707
733
|
node.children = undefined
|
|
708
734
|
// #endif
|
|
709
735
|
this.xml = false
|
|
736
|
+
config.ignoreTags.style = true
|
|
710
737
|
return
|
|
711
738
|
}
|
|
712
739
|
|
|
@@ -843,6 +870,10 @@ Parser.prototype.popNode = function () {
|
|
|
843
870
|
if (node.flag && node.c) {
|
|
844
871
|
// 有 colspan 或 rowspan 且含有链接的表格通过 grid 布局实现
|
|
845
872
|
styleObj.display = 'grid'
|
|
873
|
+
if (styleObj['border-collapse'] === 'collapse') {
|
|
874
|
+
styleObj['border-collapse'] = undefined
|
|
875
|
+
spacing = 0
|
|
876
|
+
}
|
|
846
877
|
if (spacing) {
|
|
847
878
|
styleObj['grid-gap'] = spacing + 'px'
|
|
848
879
|
styleObj.padding = spacing + 'px'
|
|
@@ -860,6 +891,23 @@ Parser.prototype.popNode = function () {
|
|
|
860
891
|
for (let i = 0; i < nodes.length; i++) {
|
|
861
892
|
if (nodes[i].name === 'tr') {
|
|
862
893
|
trList.push(nodes[i])
|
|
894
|
+
} else if (nodes[i].name === 'colgroup') {
|
|
895
|
+
let colI = 1
|
|
896
|
+
for (const col of (nodes[i].children || [])) {
|
|
897
|
+
if (col.name === 'col') {
|
|
898
|
+
const style = col.attrs.style || ''
|
|
899
|
+
const start = style.indexOf('width') ? style.indexOf(';width') : 0
|
|
900
|
+
// 提取出宽度
|
|
901
|
+
if (start !== -1) {
|
|
902
|
+
let end = style.indexOf(';', start + 6)
|
|
903
|
+
if (end === -1) {
|
|
904
|
+
end = style.length
|
|
905
|
+
}
|
|
906
|
+
width[colI] = style.substring(start ? start + 7 : 6, end)
|
|
907
|
+
}
|
|
908
|
+
colI += 1
|
|
909
|
+
}
|
|
910
|
+
}
|
|
863
911
|
} else {
|
|
864
912
|
traversal(nodes[i].children || [])
|
|
865
913
|
}
|
|
@@ -986,11 +1034,26 @@ Parser.prototype.popNode = function () {
|
|
|
986
1034
|
node.children = [table]
|
|
987
1035
|
attrs = table.attrs
|
|
988
1036
|
}
|
|
1037
|
+
} else if ((node.name === 'tbody' || node.name === 'tr') && node.flag && node.c) {
|
|
1038
|
+
node.flag = undefined;
|
|
1039
|
+
(function traversal (nodes) {
|
|
1040
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
1041
|
+
if (nodes[i].name === 'td') {
|
|
1042
|
+
// 颜色样式设置给单元格避免丢失
|
|
1043
|
+
for (const style of ['color', 'background', 'background-color']) {
|
|
1044
|
+
if (styleObj[style]) {
|
|
1045
|
+
nodes[i].attrs.style = style + ':' + styleObj[style] + ';' + (nodes[i].attrs.style || '')
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
} else {
|
|
1049
|
+
traversal(nodes[i].children || [])
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
})(children)
|
|
989
1053
|
} else if ((node.name === 'td' || node.name === 'th') && (attrs.colspan || attrs.rowspan)) {
|
|
990
1054
|
for (let i = this.stack.length; i--;) {
|
|
991
|
-
if (this.stack[i].name === 'table') {
|
|
1055
|
+
if (this.stack[i].name === 'table' || this.stack[i].name === 'tbody' || this.stack[i].name === 'tr') {
|
|
992
1056
|
this.stack[i].flag = 1 // 指示含有合并单元格
|
|
993
|
-
break
|
|
994
1057
|
}
|
|
995
1058
|
}
|
|
996
1059
|
} else if (node.name === 'ruby') {
|
|
@@ -1128,12 +1128,20 @@ let QRCode = {};
|
|
|
1128
1128
|
ctxi.setLineWidth(lineWidth);
|
|
1129
1129
|
ctxi.setFillStyle(options.background);
|
|
1130
1130
|
ctxi.setStrokeStyle(options.background);
|
|
1131
|
-
ctxi.beginPath(); // draw top and top right corner
|
|
1131
|
+
ctxi.beginPath(); // draw top and top right corner
|
|
1132
1132
|
ctxi.moveTo(x + r, y);
|
|
1133
|
-
ctxi.
|
|
1134
|
-
ctxi.
|
|
1135
|
-
|
|
1136
|
-
ctxi.
|
|
1133
|
+
ctxi.lineTo(x + width, y); // move to top-right corner
|
|
1134
|
+
ctxi.arc(x + width - r, y + r, r, -Math.PI / 2, 0); // draw right side and bottom right corner
|
|
1135
|
+
|
|
1136
|
+
ctxi.lineTo(x + width, y + height - r);
|
|
1137
|
+
ctxi.arc(x + width - r, y + height - r, r, 0, Math.PI / 2); // draw bottom and bottom left corner
|
|
1138
|
+
|
|
1139
|
+
ctxi.lineTo(x + r, y + height);
|
|
1140
|
+
ctxi.arc(x + r, y + height - r, r, Math.PI / 2, Math.PI);// draw left and top left corner
|
|
1141
|
+
|
|
1142
|
+
ctxi.lineTo(x, y + r);
|
|
1143
|
+
ctxi.arc(x + r, y + r, r, Math.PI, Math.PI * 3 / 2);
|
|
1144
|
+
|
|
1137
1145
|
ctxi.closePath();
|
|
1138
1146
|
if (fill) {
|
|
1139
1147
|
ctxi.fill();
|
|
@@ -1232,4 +1240,4 @@ let QRCode = {};
|
|
|
1232
1240
|
};
|
|
1233
1241
|
})()
|
|
1234
1242
|
|
|
1235
|
-
export default QRCode
|
|
1243
|
+
export default QRCode
|
|
@@ -290,6 +290,16 @@ export default {
|
|
|
290
290
|
left: 0;
|
|
291
291
|
right: 0;
|
|
292
292
|
}
|
|
293
|
+
|
|
294
|
+
/* #ifdef MP-TOUTIAO */
|
|
295
|
+
/**字节小程序在编译时会出现一个 [hidde]:{ display: none !important; } 这个样式
|
|
296
|
+
* 会导致canvas 隐藏掉 没有找到具体原因先这样处理
|
|
297
|
+
*/
|
|
298
|
+
&__canvas {
|
|
299
|
+
display: block !important;
|
|
300
|
+
}
|
|
301
|
+
/* #endif */
|
|
302
|
+
|
|
293
303
|
&__content {
|
|
294
304
|
position: relative;
|
|
295
305
|
|
package/libs/function/test.js
CHANGED
|
@@ -237,6 +237,13 @@ export function object(value) {
|
|
|
237
237
|
return Object.prototype.toString.call(value) === '[object Object]'
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
/**
|
|
241
|
+
* 是否是Promise对象
|
|
242
|
+
*/
|
|
243
|
+
export function objectPromise(value) {
|
|
244
|
+
return Object.prototype.toString.call(value) === '[object Promise]';
|
|
245
|
+
}
|
|
246
|
+
|
|
240
247
|
/**
|
|
241
248
|
* 是否短信验证码
|
|
242
249
|
*/
|
|
@@ -257,7 +264,7 @@ export function func(value) {
|
|
|
257
264
|
* @param {Object} value
|
|
258
265
|
*/
|
|
259
266
|
export function promise(value) {
|
|
260
|
-
return
|
|
267
|
+
return objectPromise(value) && func(value.then) && func(value.catch)
|
|
261
268
|
}
|
|
262
269
|
|
|
263
270
|
/** 是否图片格式
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
package/types/comps/navbar.d.ts
CHANGED