uview-plus 3.7.0 → 3.7.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.
Files changed (52) hide show
  1. package/changelog.md +82 -0
  2. package/components/u-action-sheet/actionSheet.js +2 -0
  3. package/components/u-action-sheet/props.js +10 -0
  4. package/components/u-action-sheet/u-action-sheet.vue +3 -3
  5. package/components/u-box/box.js +24 -0
  6. package/components/u-box/props.js +37 -7
  7. package/components/u-box/u-box.vue +29 -14
  8. package/components/u-canvas/u-canvas.vue +301 -24
  9. package/components/u-cascader/u-cascader.vue +1 -0
  10. package/components/u-checkbox-group/u-checkbox-group.vue +4 -1
  11. package/components/u-copy/u-copy.vue +1 -1
  12. package/components/u-coupon/u-coupon.vue +1 -2
  13. package/components/u-form/u-form.vue +2 -2
  14. package/components/u-form-item/u-form-item.vue +6 -6
  15. package/components/u-loading-icon/u-loading-icon.vue +2 -1
  16. package/components/u-qrcode/u-qrcode.vue +1 -1
  17. package/components/u-select/u-select.vue +198 -178
  18. package/components/u-signature/u-signature.vue +137 -137
  19. package/components/u-slider/props.js +17 -2
  20. package/components/u-slider/slider.js +6 -3
  21. package/components/u-slider/u-slider.vue +112 -35
  22. package/components/u-steps/u-steps.vue +1 -1
  23. package/components/u-switch/props.js +10 -0
  24. package/components/u-switch/switch.js +2 -0
  25. package/components/u-switch/u-switch.vue +15 -13
  26. package/components/u-table2/u-table2.vue +266 -110
  27. package/components/u-tabs/u-tabs.vue +83 -95
  28. package/libs/css/flex.scss +2 -1
  29. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  30. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  31. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  32. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  33. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  34. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  35. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  36. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  37. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  38. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  39. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  40. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  41. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  42. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  43. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  44. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  45. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  46. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  47. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  48. package/libs/util/gcanvas/env/canvas.js +0 -0
  49. package/libs/util/gcanvas/env/image.js +0 -0
  50. package/libs/util/gcanvas/env/tool.js +0 -0
  51. package/libs/util/gcanvas/index.js +0 -0
  52. package/package.json +1 -3
@@ -163,6 +163,7 @@
163
163
  border-radius: 8rpx;
164
164
  background: #ffebf0;
165
165
  color: $u-main-color;
166
+ width: 100%;
166
167
 
167
168
  &--coupon {
168
169
  border-radius: 16rpx;
@@ -210,8 +211,6 @@
210
211
  &--card {
211
212
  border-radius: 16rpx;
212
213
  }
213
-
214
- width: 100%;
215
214
 
216
215
  &--small {
217
216
  // width: 520rpx;
@@ -121,7 +121,7 @@
121
121
  this.children.map((child) => {
122
122
  // 如果u-form-item的prop在props数组中,则清除对应的校验结果信息
123
123
  if (props[0] === undefined || props.includes(child.prop)) {
124
- child.message = null;
124
+ child.message = '';
125
125
  }
126
126
  });
127
127
  },
@@ -194,7 +194,7 @@
194
194
  //没有配置,或者配置了showErrorMsg为true时候,才修改子组件message,默认没有配置
195
195
  if(!options||options?.showErrorMsg==true){
196
196
  child.message =
197
- childErrors[0]?.message ? childErrors[0].message : null;
197
+ childErrors[0]?.message ? childErrors[0].message : '';
198
198
  }
199
199
  if (i == (rules.length - 1)) {
200
200
  resolve(errorsRes)
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="u-form-item" :class="{'u-form-item--error':(!!message && parentData['errorType'] === 'message')}">
2
+ <view class="u-form-item" :class="{'u-form-item--error':(message != '' && parentData['errorType'] === 'message')}">
3
3
  <view
4
4
  class="u-form-item__body"
5
5
  @tap="clickHandler"
@@ -59,7 +59,7 @@
59
59
  </view>
60
60
  <slot name="error">
61
61
  <text
62
- v-if="!!message && parentData['errorType'] === 'message'"
62
+ v-if="message != '' && parentData['errorType'] === 'message'"
63
63
  class="u-form-item__body__right__message"
64
64
  :style="{
65
65
  marginLeft: addUnit((labelPosition || parentData['labelPosition']) === 'top' ? 0 : (labelWidth || parentData['labelWidth']))
@@ -68,8 +68,8 @@
68
68
  </slot>
69
69
  <u-line
70
70
  v-if="borderBottom"
71
- :color="message && parentData['errorType'] === 'border-bottom' ? color['error'] : propsLine['color']"
72
- :customStyle="`margin-top: ${message && parentData['errorType'] === 'message' ? '5px' : 0}`"
71
+ :color="message != '' && parentData['errorType'] === 'border-bottom' ? color['error'] : propsLine['color']"
72
+ :customStyle="`margin-top: ${message != '' && parentData['errorType'] === 'message' ? '5px' : 0}`"
73
73
  ></u-line>
74
74
  </view>
75
75
  </template>
@@ -167,7 +167,7 @@
167
167
  },
168
168
  // 移除u-form-item的校验结果
169
169
  clearValidate() {
170
- this.message = null
170
+ this.message = ''
171
171
  },
172
172
  // 清空当前的组件的校验结果,并重置为初始值
173
173
  resetField() {
@@ -176,7 +176,7 @@
176
176
  // 将up-form的model的prop属性链还原原始值
177
177
  setProperty(this.parent.$props['model'], this.prop, value)
178
178
  // 移除校验结果
179
- this.message = null
179
+ this.message = ''
180
180
  },
181
181
  // 点击组件
182
182
  clickHandler() {
@@ -68,7 +68,7 @@
68
68
  // #endif
69
69
  /**
70
70
  * loading 加载动画
71
- * @description 警此组件为一个小动画,目前用在uView的loadmore加载更多和switch开关等组件的正在加载状态场景。
71
+ * @description 此组件为一个小动画,目前用在uView的loadmore加载更多和switch开关等组件的正在加载状态场景。
72
72
  * @tutorial https://uview-plus.jiangruyi.com/components/loading.html
73
73
  * @property {Boolean} show 是否显示组件 (默认 true)
74
74
  * @property {String} color 动画活动区域的颜色,只对 mode = flower 模式有效(默认color['u-tips-color'])
@@ -346,3 +346,4 @@
346
346
 
347
347
  /* #endif */
348
348
  </style>
349
+
@@ -135,7 +135,7 @@ export default {
135
135
  default: () => false
136
136
  },
137
137
  },
138
- emits: ['result', 'longpressCallback'],
138
+ emits: ['preview', 'result', 'longpressCallback'],
139
139
  data() {
140
140
  return {
141
141
  loading: false,
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view class="u-select">
3
- <view class="u-select__content">
3
+ <view :class="['u-select__content', disabled && 'disabled']">
4
4
  <view class="u-select__label" @click="openSelect">
5
5
  <slot name="text" :currentLabel="currentLabel">
6
6
  <text class="u-select__text" v-if="showOptionsLabel">
@@ -14,26 +14,16 @@
14
14
  <up-icon name="arrow-down" :size="iconSize" :color="iconColor"></up-icon>
15
15
  </slot>
16
16
  </view>
17
- <u-overlay
18
- :show="isOpen"
19
- @click="overlayClick"
20
- v-if="overlay"
21
- :zIndex="zIndex"
22
- :duration="duration + 50"
23
- :customStyle="overlayStyle"
24
- :opacity="overlayOpacity"
25
- @touchmove.stop.prevent="noop"
26
- ></u-overlay>
17
+ <u-overlay :show="isOpen" @click="overlayClick" v-if="overlay" :zIndex="zIndex" :duration="duration + 50"
18
+ :customStyle="overlayStyle" :opacity="overlayOpacity" @touchmove.stop.prevent="noop"></u-overlay>
27
19
  <view class="u-select__options__wrap"
28
20
  :style="{ overflowY: 'auto', zIndex: zIndex + 1, left: optionsWrapLeft, right: optionsWrapRight, maxHeight: maxHeight}">
29
21
  <view class="u-select__options" v-if="isOpen">
30
22
  <slot name="options">
31
- <view class="u-select__options_item"
32
- :class="current == item[keyName] ? 'active': ''"
33
- :key="index" v-for="(item, index) in options"
34
- @click="selectItem(item)">
23
+ <view class="u-select__options_item" :class="current == item[keyName] ? 'active': ''"
24
+ :key="index" v-for="(item, index) in options" @click="selectItem(item)">
35
25
  <slot name="optionItem" :item="item">
36
- <text class="u-select__item_text" :style="{color: itemColor}">
26
+ <text class="u-select__item_text" :style="{color: itemColor}">
37
27
  {{item[labelName]}}
38
28
  </text>
39
29
  </slot>
@@ -46,176 +36,206 @@
46
36
  </template>
47
37
 
48
38
  <script>
49
- import { mpMixin } from '../../libs/mixin/mpMixin';
50
- import { mixin } from '../../libs/mixin/mixin';
51
- import { getWindowInfo } from '../../libs/function/index';
52
- export default {
53
- name:"up-select",
54
- mixins: [mpMixin, mixin],
55
- emits: ['update:current', 'select'],
56
- props: {
57
- maxHeight: {
58
- type: String,
59
- default: '90vh'
60
- },
61
- overlay: {
62
- type: Boolean,
63
- default: true
64
- },
65
- overlayOpacity: {
66
- type: Number,
67
- default: 0.01
68
- },
69
- overlayStyle: {
70
- type: Object,
71
- default: () => {
72
- return {}
39
+ import {
40
+ mpMixin
41
+ } from '../../libs/mixin/mpMixin';
42
+ import {
43
+ mixin
44
+ } from '../../libs/mixin/mixin';
45
+ import {
46
+ getWindowInfo
47
+ } from '../../libs/function/index';
48
+ export default {
49
+ name: "up-select",
50
+ mixins: [mpMixin, mixin],
51
+ emits: ['update:current', 'select'],
52
+ props: {
53
+ maxHeight: {
54
+ type: String,
55
+ default: '90vh'
56
+ },
57
+ overlay: {
58
+ type: Boolean,
59
+ default: true
60
+ },
61
+ overlayOpacity: {
62
+ type: Number,
63
+ default: 0.01
64
+ },
65
+ overlayStyle: {
66
+ type: Object,
67
+ default: () => {
68
+ return {}
69
+ }
70
+ },
71
+ duration: {
72
+ type: Number,
73
+ default: 300
74
+ },
75
+ label: {
76
+ type: String,
77
+ default: '选项'
78
+ },
79
+ options: {
80
+ type: Array,
81
+ default: () => {
82
+ return []
83
+ }
84
+ },
85
+ keyName: {
86
+ type: String,
87
+ default: 'id'
88
+ },
89
+ labelName: {
90
+ type: String,
91
+ default: 'name'
92
+ },
93
+ showOptionsLabel: {
94
+ type: Boolean,
95
+ default: false
96
+ },
97
+ current: {
98
+ type: [String, Number],
99
+ default: ''
100
+ },
101
+ zIndex: {
102
+ type: Number,
103
+ default: 11000
104
+ },
105
+ itemColor: {
106
+ type: String,
107
+ default: '#333333'
108
+ },
109
+ iconColor: {
110
+ type: String,
111
+ default: ''
112
+ },
113
+ iconSize: {
114
+ type: [String],
115
+ default: '13px'
116
+ },
117
+ // 是否禁用
118
+ disabled: {
119
+ type: Boolean,
120
+ default: false
73
121
  }
74
122
  },
75
- duration: {
76
- type: Number,
77
- default: 300
78
- },
79
- label: {
80
- type: String,
81
- default: '选项'
82
- },
83
- options: {
84
- type: Array,
85
- default: () => {
86
- return []
123
+ data() {
124
+ return {
125
+ isOpen: false,
126
+ optionsWrapLeft: 'auto',
127
+ optionsWrapRight: 'auto'
87
128
  }
88
129
  },
89
- keyName: {
90
- type: String,
91
- default: 'id'
92
- },
93
- labelName: {
94
- type: String,
95
- default: 'name'
96
- },
97
- showOptionsLabel: {
98
- type: Boolean,
99
- default: false
100
- },
101
- current: {
102
- type: [String, Number],
103
- default: ''
104
- },
105
- zIndex: {
106
- type: Number,
107
- default: 11000
108
- },
109
- itemColor: {
110
- type: String,
111
- default: '#333333'
112
- },
113
- iconColor: {
114
- type: String,
115
- default: ''
116
- },
117
- iconSize: {
118
- type: [String],
119
- default: '13px'
120
- }
121
- },
122
- data() {
123
- return {
124
- isOpen: false,
125
- optionsWrapLeft: 'auto',
126
- optionsWrapRight: 'auto'
127
- }
128
- },
129
- computed: {
130
- currentLabel() {
131
- let name = '';
132
- this.options.forEach((ele) => {
133
- if (ele[this.keyName] === this.current) {
134
- name = ele[this.labelName];
135
- }
136
- });
137
- return name;
138
- }
139
- },
140
- methods: {
141
- openSelect() {
142
- this.isOpen = true;
143
- this.$nextTick(() => {
144
- if (this.isOpen) {
145
- this.adjustOptionsWrapPosition();
130
+ computed: {
131
+ currentLabel() {
132
+ let name = '';
133
+ this.options.forEach((ele) => {
134
+ if (ele[this.keyName] === this.current) {
135
+ name = ele[this.labelName];
136
+ }
137
+ });
138
+ return name;
146
139
  }
147
- });
148
- },
149
- overlayClick() {
150
- this.isOpen = false;
151
- },
152
- selectItem(item) {
153
- this.isOpen = false;
154
- this.$emit('update:current', item[this.keyName]);
155
- this.$emit('select', item);
156
- },
157
- adjustOptionsWrapPosition() {
158
- let wi = getWindowInfo();
159
- let windowWidth = wi.windowWidth;
160
- this.$uGetRect('.u-select__options__wrap').then(rect => {
161
- if (rect.left + rect.width > windowWidth) {
162
- // 如果右侧被遮挡,则调整到左侧
163
- this.optionsWrapLeft = 'auto';
164
- this.optionsWrapRight = `0px`;
140
+ },
141
+ methods: {
142
+ openSelect() {
143
+ if (this.disabled) return;
144
+ this.isOpen = true;
145
+ this.$nextTick(() => {
146
+ if (this.isOpen) {
147
+ this.adjustOptionsWrapPosition();
148
+ }
149
+ });
150
+ },
151
+ closeSelect() {
152
+ this.isOpen = false;
153
+ },
154
+ overlayClick() {
155
+ this.isOpen = false;
156
+ },
157
+ selectItem(item) {
158
+ this.isOpen = false;
159
+ this.$emit('update:current', item[this.keyName]);
160
+ this.$emit('select', item);
161
+ },
162
+ adjustOptionsWrapPosition() {
163
+ let wi = getWindowInfo();
164
+ let windowWidth = wi.windowWidth;
165
+ this.$uGetRect('.u-select__options__wrap').then(rect => {
166
+ if (rect.left + rect.width > windowWidth) {
167
+ // 如果右侧被遮挡,则调整到左侧
168
+ this.optionsWrapLeft = 'auto';
169
+ this.optionsWrapRight = `0px`;
170
+ }
171
+ });
165
172
  }
166
- });
167
- }
168
- }
169
- }
173
+ }
174
+ }
170
175
  </script>
171
176
 
172
177
  <style lang="scss" scoped>
173
- .u-select__content {
174
- position: relative;
175
- .u-select__label {
176
- display: flex;
177
- justify-content: space-between;
178
- /* #ifdef H5 */
179
- &:hover {
180
- cursor: pointer;
181
- }
182
- /* #endif */
183
- }
184
- .u-select__text {
185
- margin-right: 2px;
186
- }
187
- .u-select__options__wrap {
188
- margin-bottom: 46px;
189
- position: absolute;
190
- top: 20px;
191
- left: 0;
178
+ .u-select__content {
179
+ position: relative;
180
+
181
+ .u-select__label {
182
+ display: flex;
183
+ justify-content: space-between;
184
+
185
+ /* #ifdef H5 */
186
+ &:hover {
187
+ cursor: pointer;
188
+ }
189
+
190
+ /* #endif */
191
+ }
192
+
193
+ .u-select__text {
194
+ margin-right: 2px;
195
+ }
196
+
197
+ &.disabled {
198
+ opacity: 0.6;
199
+ pointer-events: none;
200
+ }
201
+
202
+ .u-select__options__wrap {
203
+ margin-bottom: 46px;
204
+ position: absolute;
205
+ top: 20px;
206
+ left: 0;
207
+ }
208
+
209
+ .u-select__options {
210
+ min-width: 100px;
211
+ box-sizing: border-box;
212
+ border-radius: 4px;
213
+ border: 1px solid #f1f1f1;
214
+ background-color: #fff;
215
+
216
+ .u-select__options_item {
217
+ padding: 10px 12px;
218
+ box-sizing: border-box;
219
+ width: 100%;
220
+ height: 100%;
221
+
222
+ &:hover {
223
+ background-color: #f7f7f7;
224
+ }
225
+
226
+ /* #ifdef H5 */
227
+ &:hover {
228
+ cursor: pointer;
229
+ }
230
+
231
+ .u-select__item_text {
232
+ &:hover {
233
+ cursor: pointer;
234
+ }
235
+ }
236
+
237
+ /* #endif */
238
+ }
239
+ }
192
240
  }
193
- .u-select__options {
194
- min-width: 100px;
195
- box-sizing: border-box;
196
- border-radius: 4px;
197
- border: 1px solid #f1f1f1;
198
- background-color: #fff;
199
- .u-select__options_item {
200
- padding: 10px 12px;
201
- box-sizing: border-box;
202
- width: 100%;
203
- height: 100%;
204
- &:hover {
205
- background-color: #f7f7f7;
206
- }
207
- /* #ifdef H5 */
208
- &:hover {
209
- cursor: pointer;
210
- }
211
- .u-select__item_text {
212
- &:hover {
213
- cursor: pointer;
214
- }
215
- }
216
- /* #endif */
217
- }
218
- }
219
- }
220
241
  </style>
221
-