uview-plus 3.4.32 → 3.4.34
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 +10 -0
- package/components/u-album/u-album.vue +18 -3
- package/components/u-cate-tab/u-cate-tab.vue +3 -3
- package/components/u-datetime-picker/u-datetime-picker.vue +6 -3
- package/components/u-table2/u-table2.vue +55 -14
- 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/changelog.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 3.4.34(2025-05-28)
|
|
2
|
+
feat: table2支持自定义标题和单元格样式
|
|
3
|
+
|
|
4
|
+
## 3.4.33(2025-05-27)
|
|
5
|
+
fix: 修复小程序cate-tab第一次切换时没反应 感谢@jiaruiyan
|
|
6
|
+
|
|
7
|
+
fix: 修复datetimepicker传入空字符串时导致组件崩溃 感谢@jiaruiyan
|
|
8
|
+
|
|
9
|
+
fix: 修复album带单位的字符串参与计算导致的计算数据错误 感谢@jiaruiyan
|
|
10
|
+
|
|
1
11
|
## 3.4.32(2025-05-26)
|
|
2
12
|
feat: 增加状态栏独立颜色配置支持支付宝小程序状态栏对背景色识别的不友好的情况
|
|
3
13
|
|
|
@@ -213,14 +213,29 @@ export default {
|
|
|
213
213
|
uni.getImageInfo({
|
|
214
214
|
src,
|
|
215
215
|
success: (res) => {
|
|
216
|
+
let singleSize = this.singleSize;
|
|
217
|
+
// 单位
|
|
218
|
+
let unit = '';
|
|
219
|
+
if (Number.isNaN(Number(this.singleSize))) {
|
|
220
|
+
// 大小中有字符 则记录字符
|
|
221
|
+
unit = this.singleSize.replace(/\d+/g, ''); // 单位
|
|
222
|
+
singleSize = Number(this.singleSize.replace(/\D+/g, ''), 10); // 具体值
|
|
223
|
+
}
|
|
224
|
+
|
|
216
225
|
// 判断图片横向还是竖向展示方式
|
|
217
226
|
const isHorizotal = res.width >= res.height
|
|
218
227
|
this.singleWidth = isHorizotal
|
|
219
|
-
?
|
|
220
|
-
: (res.width / res.height) *
|
|
228
|
+
? singleSize
|
|
229
|
+
: (res.width / res.height) * singleSize
|
|
221
230
|
this.singleHeight = !isHorizotal
|
|
222
|
-
?
|
|
231
|
+
? singleSize
|
|
223
232
|
: (res.height / res.width) * this.singleWidth
|
|
233
|
+
|
|
234
|
+
// 如果有单位统一设置单位
|
|
235
|
+
if(unit != null && unit !== ''){
|
|
236
|
+
this.singleWidth = this.singleWidth + unit
|
|
237
|
+
this.singleHeight = this.singleHeight + unit
|
|
238
|
+
}
|
|
224
239
|
},
|
|
225
240
|
fail: () => {
|
|
226
241
|
this.getComponentWidth()
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<slot name="rightTop" :tabList="tabList">
|
|
18
18
|
</slot>
|
|
19
19
|
<view class="u-cate-tab__page-view">
|
|
20
|
-
<view class="u-cate-tab__page-item" :id="'item' + index"
|
|
20
|
+
<view class="u-cate-tab__page-item" :id="'item' + index"
|
|
21
21
|
v-for="(item , index) in tabList" :key="index">
|
|
22
22
|
<slot name="itemList" :item="item">
|
|
23
23
|
</slot>
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
},
|
|
168
168
|
// 获取右边菜单每个item到顶部的距离
|
|
169
169
|
getMenuItemTop() {
|
|
170
|
-
new Promise(resolve => {
|
|
170
|
+
return new Promise(resolve => {
|
|
171
171
|
let selectorQuery = uni.createSelectorQuery().in(this);
|
|
172
172
|
selectorQuery.selectAll('.u-cate-tab__page-item').boundingClientRect((rects) => {
|
|
173
173
|
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
rects.forEach((rect) => {
|
|
182
182
|
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
|
|
183
183
|
this.arr.push(rect.top - rects[0].top);
|
|
184
|
-
resolve();
|
|
185
184
|
})
|
|
185
|
+
resolve();
|
|
186
186
|
}).exec()
|
|
187
187
|
})
|
|
188
188
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="u-datetime-picker">
|
|
3
3
|
<view v-if="hasInput" class="u-datetime-picker__has-input"
|
|
4
|
-
@click="onShowByClickInput"
|
|
4
|
+
@click="onShowByClickInput"
|
|
5
5
|
>
|
|
6
6
|
<slot name="trigger" :value="inputValue">
|
|
7
7
|
<up-input
|
|
@@ -436,7 +436,10 @@
|
|
|
436
436
|
},
|
|
437
437
|
// 根据minDate、maxDate、minHour、maxHour等边界值,判断各列的开始和结束边界值
|
|
438
438
|
getBoundary(type, innerValue) {
|
|
439
|
-
|
|
439
|
+
let value = new Date(innerValue)
|
|
440
|
+
if(isNaN(value.getTime())){
|
|
441
|
+
value = new Date()
|
|
442
|
+
}
|
|
440
443
|
const boundary = new Date(this[`${type}Date`])
|
|
441
444
|
const year = dayjs(boundary).year()
|
|
442
445
|
let month = 1
|
|
@@ -475,7 +478,7 @@
|
|
|
475
478
|
if(!this.disabled){
|
|
476
479
|
this.showByClickInput = !this.showByClickInput
|
|
477
480
|
}
|
|
478
|
-
|
|
481
|
+
|
|
479
482
|
}
|
|
480
483
|
}
|
|
481
484
|
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
<view v-if="showHeader" class="u-table-header" :class="{ 'u-table-sticky': fixedHeader }" :style="{minWidth: scrollWidth}">
|
|
5
5
|
<view class="u-table-row">
|
|
6
6
|
<view v-for="(col, colIndex) in columns" :key="col.key" class="u-table-cell"
|
|
7
|
-
:style="
|
|
7
|
+
:style="headerColStyle(col)"
|
|
8
|
+
:class="[
|
|
8
9
|
col.align ? 'u-text-' + col.align : '',
|
|
9
10
|
headerCellClassName ? headerCellClassName(col) : '',
|
|
10
11
|
col.fixed === 'left' ? 'u-table-fixed-left' : '',
|
|
@@ -27,24 +28,29 @@
|
|
|
27
28
|
rowClassName ? rowClassName(row, index) : '',
|
|
28
29
|
stripe && index % 2 === 1 ? 'u-table-row-zebra' : ''
|
|
29
30
|
]" @click="handleRowClick(row)">
|
|
30
|
-
<view v-for="(col, colIndex) in columns" :key="col.key"
|
|
31
|
+
<view v-for="(col, colIndex) in columns" :key="col.key"
|
|
32
|
+
class="u-table-cell" :class="[
|
|
31
33
|
col.align ? 'u-text-' + col.align : '',
|
|
32
34
|
cellClassName ? cellClassName(row, col) : '',
|
|
33
35
|
col.fixed === 'left' ? 'u-table-fixed-left' : '',
|
|
34
36
|
col.fixed === 'right' ? 'u-table-fixed-right' : ''
|
|
35
|
-
]" :style="{
|
|
37
|
+
]" :style="cellStyleInner({row: row, column: col,
|
|
38
|
+
rowIndex: index, columnIndex: colIndex, level: 0})">
|
|
36
39
|
<!-- 复选框列 -->
|
|
37
40
|
<view v-if="col.type === 'selection'">
|
|
38
|
-
<checkbox :checked="isSelected(row)"
|
|
41
|
+
<checkbox :checked="isSelected(row)"
|
|
42
|
+
@click.stop="toggleSelect(row)" />
|
|
39
43
|
</view>
|
|
40
44
|
|
|
41
45
|
<!-- 树形结构展开图标 -->
|
|
42
|
-
<view v-else-if="col.type === 'expand'"
|
|
46
|
+
<view v-else-if="col.type === 'expand'"
|
|
47
|
+
@click.stop="toggleExpand(row)">
|
|
43
48
|
{{ isExpanded(row) ? '▼' : '▶' }}
|
|
44
49
|
</view>
|
|
45
50
|
|
|
46
51
|
<!-- 默认插槽或文本 -->
|
|
47
|
-
<slot name="cell" :row="row" :
|
|
52
|
+
<slot name="cell" :row="row" :column="col"
|
|
53
|
+
:rowIndex="index" :columnIndex="colIndex">
|
|
48
54
|
<view class="u-table-cell_content">
|
|
49
55
|
{{ row[col.key] }}
|
|
50
56
|
</view>
|
|
@@ -54,13 +60,15 @@
|
|
|
54
60
|
|
|
55
61
|
<!-- 子级渲染 -->
|
|
56
62
|
<template v-if="isExpanded(row) && row[treeProps.children] && row[treeProps.children].length">
|
|
57
|
-
<view v-for="
|
|
63
|
+
<view v-for="childRow in row[treeProps.children]" :key="childRow[rowKey]"
|
|
58
64
|
class="u-table-row u-table-row-child">
|
|
59
|
-
<view v-for="
|
|
60
|
-
:style="{
|
|
61
|
-
|
|
65
|
+
<view v-for="(col2, col2Index) in columns" :key="col2.key" class="u-table-cell"
|
|
66
|
+
:style="cellStyleInner({row: childRow, column: col2,
|
|
67
|
+
rowIndex: index, columnIndex: col2Index, level: 1})">
|
|
68
|
+
<slot name="cell" :row="childRow" :column="col2" :prow="row"
|
|
69
|
+
:rowIndex="index" :columnIndex="col2Index" :level="1">
|
|
62
70
|
<view class="u-table-cell_content">
|
|
63
|
-
{{
|
|
71
|
+
{{ childRow[col2.key] }}
|
|
64
72
|
</view>
|
|
65
73
|
</slot>
|
|
66
74
|
</view>
|
|
@@ -141,7 +149,11 @@ export default {
|
|
|
141
149
|
cellClassName: {
|
|
142
150
|
type: Function,
|
|
143
151
|
default: null
|
|
144
|
-
},
|
|
152
|
+
},
|
|
153
|
+
cellStyle: {
|
|
154
|
+
type: Function,
|
|
155
|
+
default: null
|
|
156
|
+
},
|
|
145
157
|
headerCellClassName: {
|
|
146
158
|
type: Function,
|
|
147
159
|
default: null
|
|
@@ -227,9 +239,38 @@ export default {
|
|
|
227
239
|
},
|
|
228
240
|
mounted() {
|
|
229
241
|
this.getComponentWidth()
|
|
230
|
-
},
|
|
242
|
+
},
|
|
243
|
+
computed: {
|
|
244
|
+
},
|
|
231
245
|
methods: {
|
|
232
|
-
addUnit,
|
|
246
|
+
addUnit,
|
|
247
|
+
headerColStyle(col) {
|
|
248
|
+
let style = {
|
|
249
|
+
width: col.width ? addUnit(col.width) : 'auto',
|
|
250
|
+
flex: col.width ? 'none' : 1
|
|
251
|
+
};
|
|
252
|
+
if (col?.style) {
|
|
253
|
+
style = {...style, ...col?.style};
|
|
254
|
+
}
|
|
255
|
+
return style;
|
|
256
|
+
},
|
|
257
|
+
setCellStyle(e) {
|
|
258
|
+
this.cellStyle = e
|
|
259
|
+
},
|
|
260
|
+
cellStyleInner(scope) {
|
|
261
|
+
let style = {
|
|
262
|
+
width: scope.column?.width ? addUnit(scope.column.width) : 'auto',
|
|
263
|
+
flex: scope.column?.width ? 'none' : 1,
|
|
264
|
+
paddingLeft: (24 * scope.level) + 'px'
|
|
265
|
+
};
|
|
266
|
+
if (this.cellStyle != null) {
|
|
267
|
+
let styleCalc = this.cellStyle(scope)
|
|
268
|
+
if (styleCalc != null) {
|
|
269
|
+
style = {...style, ...styleCalc}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return style;
|
|
273
|
+
},
|
|
233
274
|
// 获取组件的宽度
|
|
234
275
|
async getComponentWidth() {
|
|
235
276
|
// 延时一定时间,以获取dom尺寸
|
|
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