uview-pro 0.6.0 → 0.6.2

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,37 @@
1
+ ## 0.6.2(2026-05-15)
2
+
3
+ ### 🐛 Bug Fixes | Bug 修复
4
+
5
+ - **u-checkbox:** 修复多选框在头条、抖音小程序图标偏移的问题 ([8ea1838](https://github.com/anyup/uView-Pro/commit/8ea18383b94b421cabea7d080a6867f4b6133ff5))
6
+ - **u-radio:** 修复单选框在头条、抖音小程序图标偏移的问题 ([dd7d6fe](https://github.com/anyup/uView-Pro/commit/dd7d6fee5a22bb39b3dcea9a24b9a06da40ee20e))
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ - 添加 u-input 组件禁用状态样式 (#155) ([1145d99](https://github.com/anyup/uView-Pro/commit/1145d996ca111da769665ee5dca1bf07a0a1968d))
11
+
12
+ ### 👥 Contributors
13
+
14
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a> <a href="https://github.com/1361176289"><img src="https://github.com/1361176289.png?size=40" width="40" height="40" alt="小陆同学" title="小陆同学"/></a>
15
+
16
+ ## 0.6.1(2026-05-13)
17
+
18
+ ### ✨ Features | 新功能
19
+
20
+ - **theme:** 添加默认颜色变量的RGB值支持 ([59af59f](https://github.com/anyup/uView-Pro/commit/59af59f5ea160155939ec4c6c3e33f968910c3e4))
21
+ - **u-picker:** 支持自定义标题插槽并调整样式 ([c3f2967](https://github.com/anyup/uView-Pro/commit/c3f296718a53449665cf14441ed1adef817274d1))
22
+
23
+ ### 🚀 Chore | 构建/工程依赖/工具
24
+
25
+ - **release:** bump version to 0.6.0 ([cb7351f](https://github.com/anyup/uView-Pro/commit/cb7351fe85e96a5abcd2d4eea0c1771f62148fd0))
26
+
27
+ ### 🐛 Bug Fixes | Bug 修复
28
+
29
+ - **canvas:** 修复头条小程序中CanvasContext的Illegal invocation错误 ([05ebe29](https://github.com/anyup/uView-Pro/commit/05ebe2998007421cf2d2db8664bbe2963419129f))
30
+
31
+ ### 👥 Contributors
32
+
33
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
34
+
1
35
  ## 0.6.0(2026-05-12)
2
36
 
3
37
  ### ✨ Features | 新功能
@@ -1,12 +1,7 @@
1
1
  <template>
2
2
  <view class="u-checkbox" :style="$u.toStyle(checkboxStyle, customStyle)" :class="customClass">
3
3
  <view class="u-checkbox__icon-wrap" @tap="toggle" :class="iconClass" :style="$u.toStyle(iconStyle)">
4
- <u-icon
5
- custom-class="u-checkbox__icon-wrap__icon"
6
- name="checkbox-mark"
7
- :size="checkboxIconSize"
8
- :color="iconColor"
9
- />
4
+ <u-icon name="checkbox-mark" :size="checkboxIconSize" :color="iconColor" />
10
5
  </view>
11
6
  <view
12
7
  class="u-checkbox__label"
@@ -323,11 +318,9 @@ defineExpose({
323
318
  font-size: 20px;
324
319
  border: 1px solid var(--u-border-color);
325
320
  transition-duration: 0.2s;
326
-
327
321
  /* #ifdef MP-TOUTIAO */
328
- &__icon {
329
- line-height: 0;
330
- }
322
+ // 头条小程序兼容性问题,需要设置行高为0,否则图标偏下
323
+ line-height: 0;
331
324
  /* #endif */
332
325
 
333
326
  &--circle {
@@ -248,7 +248,7 @@ function onScroll() {
248
248
  */
249
249
  function onTouchMove(event: TouchEvent) {
250
250
  touchmove.value = true;
251
- const sidebarLength = children.length;
251
+ const sidebarLength = indexList.value.length;
252
252
  const touch = event.touches[0];
253
253
  const itemHeight = sidebar.height / sidebarLength;
254
254
  let clientY = touch.clientY;
@@ -4,7 +4,8 @@
4
4
  :class="[
5
5
  {
6
6
  'u-input--border': border,
7
- 'u-input--error': validateState
7
+ 'u-input--error': validateState,
8
+ 'u-input--disabled': disabled
8
9
  },
9
10
  customClass
10
11
  ]"
@@ -328,6 +329,7 @@ function onClear(event: any) {
328
329
  }
329
330
 
330
331
  function inputClick() {
332
+ if (props.disabled) return;
331
333
  emit('click');
332
334
  }
333
335
 
@@ -391,6 +393,25 @@ defineExpose({
391
393
  border-color: $u-type-error !important;
392
394
  }
393
395
 
396
+ &--disabled {
397
+ background-color: $u-bg-gray-light;
398
+ }
399
+
400
+ &--disabled &__input {
401
+ background-color: transparent;
402
+ color: $u-light-color;
403
+ -webkit-text-fill-color: $u-light-color;
404
+ padding-left: 10rpx;
405
+ }
406
+
407
+ &--disabled &__textarea {
408
+ background-color: transparent;
409
+ color: $u-light-color;
410
+ -webkit-text-fill-color: $u-light-color;
411
+ padding-left: 10rpx;
412
+ padding-top: 10rpx;
413
+ }
414
+
394
415
  &__right-icon {
395
416
  position: relative;
396
417
  z-index: 2;
@@ -21,7 +21,11 @@
21
21
  >
22
22
  {{ cancelText }}
23
23
  </view>
24
- <view class="u-picker__title u-line-1">{{ title }}</view>
24
+ <view class="u-picker__title u-line-1">
25
+ <slot name="title">
26
+ {{ title }}
27
+ </slot>
28
+ </view>
25
29
  <view
26
30
  class="u-btn-picker u-btn-picker--primary"
27
31
  :style="{ color: moving ? cancelColor : confirmColor }"
@@ -777,7 +781,7 @@ onMounted(() => {
777
781
 
778
782
  .u-picker-header {
779
783
  width: 100%;
780
- height: 90rpx;
784
+ min-height: 90rpx;
781
785
  @include vue-flex;
782
786
  justify-content: space-between;
783
787
  align-items: center;
@@ -1,12 +1,7 @@
1
1
  <template>
2
2
  <view class="u-radio" :style="$u.toStyle(radioStyle, customStyle)" :class="customClass">
3
3
  <view class="u-radio__icon-wrap" @tap="toggle" :class="iconClass" :style="$u.toStyle(iconStyle)">
4
- <u-icon
5
- custom-class="u-radio__icon-wrap__icon"
6
- name="checkbox-mark"
7
- :size="elIconSize"
8
- :color="iconColor"
9
- />
4
+ <u-icon name="checkbox-mark" :size="elIconSize" :color="iconColor" />
10
5
  </view>
11
6
  <view
12
7
  class="u-radio__label"
@@ -309,12 +304,9 @@ function setRadioCheckedStatus() {
309
304
  font-size: 20px;
310
305
  border: 1px solid var(--u-border-color);
311
306
  transition-duration: 0.2s;
312
-
313
307
  /* #ifdef MP-TOUTIAO */
314
308
  // 头条小程序兼容性问题,需要设置行高为0,否则图标偏下
315
- &__icon {
316
- line-height: 0;
317
- }
309
+ line-height: 0;
318
310
  /* #endif */
319
311
 
320
312
  &--circle {
@@ -395,6 +395,14 @@ defineExpose({
395
395
  background-color: $u-bg-gray-light;
396
396
  }
397
397
 
398
+ &--disabled &__field {
399
+ background-color: transparent;
400
+ color: $u-light-color;
401
+ -webkit-text-fill-color: $u-light-color;
402
+ padding-left: 10rpx;
403
+ padding-top: 10rpx;
404
+ }
405
+
398
406
  &__field {
399
407
  flex: 1;
400
408
  font-size: 28rpx;
@@ -4,7 +4,46 @@
4
4
  * @returns
5
5
  */
6
6
  export function canvas2d(ctx: CanvasRenderingContext2D): UniApp.CanvasContext {
7
- return Object.assign(ctx, {
7
+ // 绑定 this 到 ctx,避免头条小程序等环境中出现 Illegal invocation 错误
8
+ const boundCtx = {
9
+ arc: ctx.arc.bind(ctx),
10
+ arcTo: ctx.arcTo.bind(ctx),
11
+ beginPath: ctx.beginPath.bind(ctx),
12
+ bezierCurveTo: ctx.bezierCurveTo.bind(ctx),
13
+ clearRect: ctx.clearRect.bind(ctx),
14
+ clip: ctx.clip.bind(ctx),
15
+ closePath: ctx.closePath.bind(ctx),
16
+ createImageData: ctx.createImageData.bind(ctx),
17
+ createLinearGradient: ctx.createLinearGradient.bind(ctx),
18
+ createPattern: ctx.createPattern.bind(ctx),
19
+ createRadialGradient: ctx.createRadialGradient.bind(ctx),
20
+ drawImage: ctx.drawImage.bind(ctx),
21
+ fill: ctx.fill.bind(ctx),
22
+ fillRect: ctx.fillRect.bind(ctx),
23
+ fillText: ctx.fillText.bind(ctx),
24
+ getImageData: ctx.getImageData.bind(ctx),
25
+ getLineDash: ctx.getLineDash.bind(ctx),
26
+ isPointInPath: ctx.isPointInPath.bind(ctx),
27
+ isPointInStroke: ctx.isPointInStroke.bind(ctx),
28
+ lineTo: ctx.lineTo.bind(ctx),
29
+ measureText: ctx.measureText.bind(ctx),
30
+ moveTo: ctx.moveTo.bind(ctx),
31
+ putImageData: ctx.putImageData.bind(ctx),
32
+ quadraticCurveTo: ctx.quadraticCurveTo.bind(ctx),
33
+ rect: ctx.rect.bind(ctx),
34
+ restore: ctx.restore.bind(ctx),
35
+ rotate: ctx.rotate.bind(ctx),
36
+ save: ctx.save.bind(ctx),
37
+ scale: ctx.scale.bind(ctx),
38
+ setLineDash: ctx.setLineDash.bind(ctx),
39
+ setTransform: ctx.setTransform.bind(ctx),
40
+ stroke: ctx.stroke.bind(ctx),
41
+ strokeRect: ctx.strokeRect.bind(ctx),
42
+ strokeText: ctx.strokeText.bind(ctx),
43
+ transform: ctx.transform.bind(ctx),
44
+ translate: ctx.translate.bind(ctx),
45
+ resetTransform: ctx.resetTransform?.bind(ctx),
46
+ roundRect: (ctx as any).roundRect?.bind(ctx),
8
47
  setFillStyle(color: string | CanvasGradient) {
9
48
  ctx.fillStyle = color;
10
49
  },
@@ -45,5 +84,99 @@ export function canvas2d(ctx: CanvasRenderingContext2D): UniApp.CanvasContext {
45
84
  createCircularGradient() {},
46
85
  draw() {},
47
86
  addColorStop() {}
48
- }) as unknown as UniApp.CanvasContext;
87
+ };
88
+ // 复制属性访问器
89
+ Object.defineProperties(boundCtx, {
90
+ fillStyle: {
91
+ get: () => ctx.fillStyle,
92
+ set: value => {
93
+ ctx.fillStyle = value;
94
+ }
95
+ },
96
+ strokeStyle: {
97
+ get: () => ctx.strokeStyle,
98
+ set: value => {
99
+ ctx.strokeStyle = value;
100
+ }
101
+ },
102
+ lineWidth: {
103
+ get: () => ctx.lineWidth,
104
+ set: value => {
105
+ ctx.lineWidth = value;
106
+ }
107
+ },
108
+ lineCap: {
109
+ get: () => ctx.lineCap,
110
+ set: value => {
111
+ ctx.lineCap = value;
112
+ }
113
+ },
114
+ lineJoin: {
115
+ get: () => ctx.lineJoin,
116
+ set: value => {
117
+ ctx.lineJoin = value;
118
+ }
119
+ },
120
+ miterLimit: {
121
+ get: () => ctx.miterLimit,
122
+ set: value => {
123
+ ctx.miterLimit = value;
124
+ }
125
+ },
126
+ globalAlpha: {
127
+ get: () => ctx.globalAlpha,
128
+ set: value => {
129
+ ctx.globalAlpha = value;
130
+ }
131
+ },
132
+ globalCompositeOperation: {
133
+ get: () => ctx.globalCompositeOperation,
134
+ set: value => {
135
+ ctx.globalCompositeOperation = value;
136
+ }
137
+ },
138
+ font: {
139
+ get: () => ctx.font,
140
+ set: value => {
141
+ ctx.font = value;
142
+ }
143
+ },
144
+ textAlign: {
145
+ get: () => ctx.textAlign,
146
+ set: value => {
147
+ ctx.textAlign = value;
148
+ }
149
+ },
150
+ textBaseline: {
151
+ get: () => ctx.textBaseline,
152
+ set: value => {
153
+ ctx.textBaseline = value;
154
+ }
155
+ },
156
+ shadowOffsetX: {
157
+ get: () => ctx.shadowOffsetX,
158
+ set: value => {
159
+ ctx.shadowOffsetX = value;
160
+ }
161
+ },
162
+ shadowOffsetY: {
163
+ get: () => ctx.shadowOffsetY,
164
+ set: value => {
165
+ ctx.shadowOffsetY = value;
166
+ }
167
+ },
168
+ shadowBlur: {
169
+ get: () => ctx.shadowBlur,
170
+ set: value => {
171
+ ctx.shadowBlur = value;
172
+ }
173
+ },
174
+ shadowColor: {
175
+ get: () => ctx.shadowColor,
176
+ set: value => {
177
+ ctx.shadowColor = value;
178
+ }
179
+ }
180
+ });
181
+ return boundCtx as unknown as UniApp.CanvasContext;
49
182
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-pro",
3
3
  "name": "uview-pro",
4
4
  "displayName": "【支持鸿蒙】uView Pro|基于Vue3+TS的高质量UI组件库,支持多主题、暗黑模式、多语言",
5
- "version": "0.6.0",
5
+ "version": "0.6.2",
6
6
  "description": "uView Pro是基于Vue3+TS的多平台UI框架,提供80+高质量组件、便捷工具和常用模板,支持多主题、暗黑模式、多语言,支持H5/APP/鸿蒙/小程序多端开发。已在鸿蒙应用商店上架,欢迎体验!",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",