uview-plus 3.3.42 → 3.3.45

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.
Files changed (35) hide show
  1. package/changelog.md +7 -0
  2. package/components/u-button/u-button.vue +1 -1
  3. package/components/u-button/vue.scss +1 -1
  4. package/components/u-float-button/u-float-button.vue +73 -28
  5. package/components/u-image/u-image.vue +7 -13
  6. package/components/u-navbar/navbar.js +1 -0
  7. package/components/u-navbar/props.js +5 -0
  8. package/components/u-navbar/u-navbar.vue +4 -2
  9. package/components/u-waterfall/u-waterfall.vue +19 -8
  10. package/libs/function/index.js +12 -0
  11. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  12. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  13. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  14. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  15. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  16. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  17. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  18. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  19. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  20. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  21. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  22. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  23. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  24. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  25. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  26. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  27. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  28. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  29. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  30. package/libs/util/gcanvas/env/canvas.js +0 -0
  31. package/libs/util/gcanvas/env/image.js +0 -0
  32. package/libs/util/gcanvas/env/tool.js +0 -0
  33. package/libs/util/gcanvas/index.js +0 -0
  34. package/package.json +2 -2
  35. package/types/comps.d.ts +1 -1
package/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 3.3.43(2024-11-18)
2
+ fix: 支持瀑布流组件v-model置为[]
3
+
4
+ add: 新增字符串路径访问工具方法getValueByPath
5
+
6
+ add: 新增float-button悬浮按钮组件
7
+
1
8
  ## 3.3.42(2024-11-15)
2
9
  add: button组件支持stop参数阻止冒泡
3
10
 
@@ -276,7 +276,7 @@ export default {
276
276
  if (!this.disabled && !this.loading) {
277
277
  // 进行节流控制,每this.throttle毫秒内,只在开始处执行
278
278
  throttle(() => {
279
- this.$emit("click");
279
+ this.$emit("click", e);
280
280
  }, this.throttleTime);
281
281
  }
282
282
  // 是否阻止事件传播
@@ -12,7 +12,7 @@ $u-button-icon-margin-left:4px !default;
12
12
  $u-button-plain-u-button-info-color:$u-info;
13
13
  $u-button-plain-u-button-success-color:$u-success;
14
14
  $u-button-plain-u-button-error-color:$u-error;
15
- $u-button-plain-u-button-warning-color:$u-error;
15
+ $u-button-plain-u-button-warning-color:$u-warning;
16
16
 
17
17
  .u-button {
18
18
  width: 100%;
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <view
3
- class="u-float-button" :class="class">
4
- <view class="u-float-button__main" @click.stop="clickHandler" :style="{
3
+ class="u-float-button" :style="{
4
+ position: 'fixed',
5
+ top: top,
6
+ bottom: bottom,
7
+ right: right,
8
+ }">
9
+ <view class="u-float-button__main" @click="clickHandler" :style="{
5
10
  backgroundColor: backgroundColor,
6
11
  color: color,
7
12
  flexDirection: 'row',
@@ -9,37 +14,33 @@
9
14
  alignItems: 'center',
10
15
  width: width,
11
16
  height: height,
12
- position: 'absolute',
13
- bottom: bottom,
14
- right: right,
15
17
  borderRadius: '50%',
16
18
  borderColor: borderColor,
17
19
  }">
18
20
  <slot :showList="showList">
19
- <up-icon :class="{'show-list': showList}" name="plus" :color="color"></up-icon>
21
+ <up-icon class="cursor-pointer" :class="{'show-list': showList}" name="plus" :color="color"></up-icon>
20
22
  </slot>
21
- <slot name="list">
22
- <view class="u-float-button__list" :style="{
23
- bottom: bottom,
24
- right: right
25
- }">
23
+ <view v-if="showList" class="u-float-button__list" :style="{
24
+ bottom: height
25
+ }">
26
+ <slot name="list">
26
27
  <template v-for="item in list">
27
28
  <view class="u-float-button__item" :style="{
28
- backgroundColor: item?.bgColor || bgColor,
29
- color: item?.color || color,
29
+ backgroundColor: item?.backgroundColor ? item?.backgroundColor : backgroundColor,
30
+ color: item?.color ? item?.color : color,
30
31
  flexDirection: 'row',
31
32
  justifyContent: 'center',
32
33
  alignItems: 'center',
33
34
  width: width,
34
35
  height: height,
35
36
  borderRadius: '50%',
36
- borderColor: item?.borderColor || borderColor,
37
+ borderColor: item?.borderColor ? item?.borderColor : borderColor,
37
38
  }" @click="itemClick(item, index)">
38
- <up-icon :name="item.name" :color="item?.color || color"></up-icon>
39
+ <up-icon :name="item.name" :color="item?.color ? item?.color : color"></up-icon>
39
40
  </view>
40
41
  </template>
41
- </view>
42
- </slot>
42
+ </slot>
43
+ </view>
43
44
  </view>
44
45
  </view>
45
46
  </template>
@@ -52,9 +53,9 @@ import { addStyle, addUnit, deepMerge } from '../../libs/function/index';
52
53
  * FloatButton 悬浮按钮
53
54
  * @description 悬浮按钮常用于屏幕右下角点击展开的操作菜单
54
55
  * @tutorial https://ijry.github.io/uview-plus/components/floatButton.html
55
- * @property {String} bgColor 背景颜色
56
+ * @property {String} backgroundColor 背景颜色
56
57
  * @event {Function} click 点击触发事件
57
- * @example <up-view></up-view>
58
+ * @example <up-float-button></up-float-button>
58
59
  */
59
60
  export default {
60
61
  name: 'u-float-button',
@@ -66,17 +67,59 @@ export default {
66
67
  // #endif
67
68
  emits: ['click', 'item-click'],
68
69
  computed: {
69
- valueStyle() {}
70
70
  },
71
71
  props: {
72
- bgColor: '#2979ff',
73
- color: '#fff',
74
- width: '50px',
75
- height: '50px',
76
- borderColor: '',
77
- right: '80px',
78
- bottom: '100px',
79
- isMenu: false
72
+ // 背景颜色
73
+ backgroundColor: {
74
+ type: String,
75
+ default: '#2979ff'
76
+ },
77
+ // 文字颜色
78
+ color: {
79
+ type: String,
80
+ default: '#fff'
81
+ },
82
+ // 宽度
83
+ width: {
84
+ type: String,
85
+ default: '50px'
86
+ },
87
+ // 高度
88
+ height: {
89
+ type: String,
90
+ default: '50px'
91
+ },
92
+ // 边框颜色,默认为空字符串表示无边框
93
+ borderColor: {
94
+ type: String,
95
+ default: ''
96
+ },
97
+ // 右侧偏移量
98
+ right: {
99
+ type: [String, Number],
100
+ default: '30px'
101
+ },
102
+ // 顶部偏移量,未提供默认值,可能需要根据具体情况设置
103
+ top: {
104
+ type: [String, Number],
105
+ default: '',
106
+ },
107
+ // 底部偏移量
108
+ bottom: {
109
+ type: String,
110
+ default: ''
111
+ },
112
+ // 是否为菜单项
113
+ isMenu: {
114
+ type: Boolean,
115
+ default: false
116
+ },
117
+ list: {
118
+ type: Array,
119
+ default: () => {
120
+ return []
121
+ }
122
+ }
80
123
  },
81
124
  data() {
82
125
  return {
@@ -88,6 +131,7 @@ export default {
88
131
  clickHandler(e) {
89
132
  if (this.isMenu) {
90
133
  this.showList = !this.showList
134
+ this.$emit('click', e)
91
135
  } else {
92
136
  this.$emit('click', e)
93
137
  }
@@ -106,6 +150,7 @@ export default {
106
150
  @import '../../libs/css/components.scss';
107
151
 
108
152
  .u-float-button {
153
+ z-index: 999;
109
154
  .show-list {
110
155
  transform: rotate(45deg);
111
156
  }
@@ -6,7 +6,7 @@
6
6
  :duration="fade ? 1000 : 0"
7
7
  >
8
8
  <view
9
- class="u-image"
9
+ class="u-image box-border"
10
10
  @tap="onClick"
11
11
  :style="[wrapStyle, backgroundStyle]"
12
12
  >
@@ -20,9 +20,7 @@
20
20
  :lazy-load="lazyLoad"
21
21
  class="u-image__image"
22
22
  :style="{
23
- borderRadius: shape == 'circle' ? '10000px' : addUnit(radius),
24
- width: addUnit(width),
25
- height: addUnit(height)
23
+ borderRadius: shape == 'circle' ? '10000px' : addUnit(radius)
26
24
  }"
27
25
  ></image>
28
26
  <view
@@ -38,8 +36,6 @@
38
36
  <slot name="loading">
39
37
  <u-icon
40
38
  :name="loadingIcon"
41
- :width="width"
42
- :height="height"
43
39
  ></u-icon>
44
40
  </slot>
45
41
  </view>
@@ -47,16 +43,12 @@
47
43
  v-if="showError && isError && !loading"
48
44
  class="u-image__error"
49
45
  :style="{
50
- borderRadius: shape == 'circle' ? '50%' : addUnit(radius),
51
- width: addUnit(width),
52
- height: addUnit(height)
46
+ borderRadius: shape == 'circle' ? '50%' : addUnit(radius)
53
47
  }"
54
48
  >
55
49
  <slot name="error">
56
50
  <u-icon
57
51
  :name="errorIcon"
58
- :width="width"
59
- :height="height"
60
52
  ></u-icon>
61
53
  </slot>
62
54
  </view>
@@ -140,8 +132,10 @@
140
132
  wrapStyle() {
141
133
  let style = {};
142
134
  // 通过调用addUnit()方法,如果有单位,如百分比,px单位等,直接返回,如果是纯粹的数值,则加上rpx单位
143
- style.width = addUnit(this.width);
144
- style.height = addUnit(this.height);
135
+ // style.width = addUnit(this.width);
136
+ // style.height = addUnit(this.height);
137
+ style.width = '100%';
138
+ style.height = '100%';
145
139
  // 如果是显示圆形,设置一个很多的半径值即可
146
140
  style.borderRadius = this.shape == 'circle' ? '10000px' : addUnit(this.radius)
147
141
  // 如果设置圆角,必须要有hidden,否则可能圆角无效
@@ -20,6 +20,7 @@ export default {
20
20
  rightText: '',
21
21
  rightIcon: '',
22
22
  title: '',
23
+ titleColor: '',
23
24
  bgColor: '#ffffff',
24
25
  titleWidth: '400rpx',
25
26
  height: '44px',
@@ -48,6 +48,11 @@ export const props = defineMixin({
48
48
  type: [String, Number],
49
49
  default: () => defProps.navbar.title
50
50
  },
51
+ // 标题颜色
52
+ titleColor: {
53
+ type: String,
54
+ default: () => defProps.navbar.titleColor
55
+ },
51
56
  // 背景颜色
52
57
  bgColor: {
53
58
  type: String,
@@ -47,6 +47,7 @@
47
47
  class="u-line-1 u-navbar__content__title"
48
48
  :style="[{
49
49
  width: addUnit(titleWidth),
50
+ color: titleColor,
50
51
  }, addStyle(titleStyle)]"
51
52
  >{{ title }}</text>
52
53
  </slot>
@@ -85,11 +86,12 @@
85
86
  * @property {Boolean} placeholder 固定在顶部时,是否生成一个等高元素,以防止塌陷 (默认 false )
86
87
  * @property {Boolean} fixed 导航栏是否固定在顶部 (默认 false )
87
88
  * @property {Boolean} border 导航栏底部是否显示下边框 (默认 false )
88
- * @property {String} leftIcon 左边返回图标的名称,只能为uView自带的图标 (默认 'arrow-left' )
89
+ * @property {String} leftIcon 左边返回图标的名称,只能为uview-pls自带的图标 (默认 'arrow-left' )
89
90
  * @property {String} leftText 左边的提示文字
90
91
  * @property {String} rightText 右边的提示文字
91
- * @property {String} rightIcon 右边返回图标的名称,只能为uView自带的图标
92
+ * @property {String} rightIcon 右边返回图标的名称,只能为uview-plus自带的图标
92
93
  * @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
94
+ * @property {String} titleColor 文字颜色 (默认 '' )
93
95
  * @property {String} bgColor 导航栏背景设置 (默认 '#ffffff' )
94
96
  * @property {String | Number} titleWidth 导航栏标题的最大宽度,内容超出会以省略号隐藏 (默认 '400rpx' )
95
97
  * @property {String | Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上)(默认 '44px' )
@@ -67,11 +67,16 @@
67
67
  },
68
68
  watch: {
69
69
  copyFlowList(nVal, oVal) {
70
- // 取差值,即这一次数组变化新增的部分
71
- let startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
72
- // 拼接上原有数据
73
- this.tempList = this.tempList.concat(this.cloneData(nVal.slice(startIndex)));
74
- this.splitData();
70
+ if (!nVal || nVal.length == 0) {
71
+ this.clear();
72
+ // console.log('clear');
73
+ } else {
74
+ // 取差值,即这一次数组变化新增的部分
75
+ let startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
76
+ // 拼接上原有数据
77
+ this.tempList = this.tempList.concat(this.cloneData(nVal.slice(startIndex)));
78
+ this.splitData();
79
+ }
75
80
  }
76
81
  },
77
82
  mounted() {
@@ -81,12 +86,18 @@
81
86
  computed: {
82
87
  // 破坏flowList变量的引用,否则watch的结果新旧值是一样的
83
88
  copyFlowList() {
89
+ // #ifdef VUE3
90
+ if (!this.modelValue || this.modelValue.length == 0) {
91
+ this.clear();
92
+ // console.log('clear');
93
+ return [];
94
+ } else {
95
+ return this.cloneData(this.modelValue);
96
+ }
97
+ // #endif
84
98
  // #ifdef VUE2
85
99
  return this.cloneData(this.value);
86
100
  // #endif
87
- // #ifdef VUE3
88
- return this.cloneData(this.modelValue);
89
- // #endif
90
101
  }
91
102
  },
92
103
  emits: ['update:modelValue'],
@@ -694,6 +694,17 @@ export function pages() {
694
694
  return pages
695
695
  }
696
696
 
697
+ export function getValueByPath(obj, path) {
698
+ // 将路径字符串按 '.' 分割成数组
699
+ const pathArr = path.split('.');
700
+ // 使用 reduce 方法从 obj 开始,逐级访问嵌套属性
701
+ return pathArr.reduce((acc, curr) => {
702
+ // 如果当前累加器(acc)是对象且包含当前键(curr),则返回该键对应的值
703
+ // 否则返回 undefined(表示路径不存在)
704
+ return acc && acc[curr] !== undefined ? acc[curr] : undefined;
705
+ }, obj);
706
+ }
707
+
697
708
  export default {
698
709
  range,
699
710
  getPx,
@@ -724,5 +735,6 @@ export default {
724
735
  setProperty,
725
736
  page,
726
737
  pages,
738
+ getValueByPath,
727
739
  // setConfig
728
740
  }
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
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
- "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3移动组件库。",
5
- "version": "3.3.42",
4
+ "displayName": "uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
5
+ "version": "3.3.45",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
package/types/comps.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module '@vue/runtime-core' {
1
+ declare module 'vue' {
2
2
  export interface GlobalComponents {
3
3
  // 基础组件
4
4
  ['up-icon']: typeof import('./comps/icon')['Icon']