uview-plus 3.1.35 → 3.1.37

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 (63) hide show
  1. package/changelog.md +4 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +1 -0
  3. package/components/u-album/u-album.vue +1 -0
  4. package/components/u-alert/u-alert.vue +1 -0
  5. package/components/u-avatar/u-avatar.vue +1 -0
  6. package/components/u-avatar-group/u-avatar-group.vue +1 -0
  7. package/components/u-back-top/u-back-top.vue +2 -1
  8. package/components/u-badge/u-badge.vue +1 -1
  9. package/components/u-calendar/u-calendar.vue +1 -0
  10. package/components/u-car-keyboard/u-car-keyboard.vue +312 -311
  11. package/components/u-cell/u-cell.vue +1 -1
  12. package/components/u-cell-group/u-cell-group.vue +1 -1
  13. package/components/u-checkbox/u-checkbox.vue +2 -1
  14. package/components/u-code/u-code.vue +1 -0
  15. package/components/u-code-input/props.js +13 -5
  16. package/components/u-code-input/u-code-input.vue +8 -2
  17. package/components/u-col/u-col.vue +1 -0
  18. package/components/u-collapse/u-collapse.vue +1 -0
  19. package/components/u-column-notice/u-column-notice.vue +1 -0
  20. package/components/u-count-down/u-count-down.vue +164 -163
  21. package/components/u-count-to/u-count-to.vue +1 -0
  22. package/components/u-divider/u-divider.vue +1 -0
  23. package/components/u-dropdown/u-dropdown.vue +127 -129
  24. package/components/u-form-item/u-form-item.vue +1 -0
  25. package/components/u-image/u-image.vue +1 -1
  26. package/components/u-index-anchor/u-index-anchor.vue +1 -1
  27. package/components/u-index-item/u-index-item.vue +1 -1
  28. package/components/u-index-list/u-index-list.vue +1 -1
  29. package/components/u-input/u-input.vue +3 -3
  30. package/components/u-keyboard/u-keyboard.vue +1 -0
  31. package/components/u-link/u-link.vue +1 -0
  32. package/components/u-list/u-list.vue +1 -0
  33. package/components/u-loadmore/u-loadmore.vue +1 -0
  34. package/components/u-modal/u-modal.vue +230 -229
  35. package/components/u-navbar/u-navbar.vue +1 -1
  36. package/components/u-no-network/u-no-network.vue +1 -0
  37. package/components/u-notice-bar/u-notice-bar.vue +1 -0
  38. package/components/u-number-box/u-number-box.vue +1 -1
  39. package/components/u-number-keyboard/u-number-keyboard.vue +1 -1
  40. package/components/u-overlay/u-overlay.vue +1 -0
  41. package/components/u-parse/node/node.vue +2 -2
  42. package/components/u-parse/parser.js +1333 -1333
  43. package/components/u-parse/u-parse.vue +5 -5
  44. package/components/u-popup/u-popup.vue +307 -306
  45. package/components/u-radio/u-radio.vue +1 -1
  46. package/components/u-read-more/u-read-more.vue +1 -0
  47. package/components/u-row/u-row.vue +1 -0
  48. package/components/u-row-notice/u-row-notice.vue +1 -0
  49. package/components/u-scroll-list/u-scroll-list.vue +1 -0
  50. package/components/u-search/u-search.vue +6 -2
  51. package/components/u-slider/props.js +13 -5
  52. package/components/u-slider/u-slider.vue +66 -55
  53. package/components/u-status-bar/u-status-bar.vue +1 -1
  54. package/components/u-steps/u-steps.vue +1 -1
  55. package/components/u-steps-item/u-steps-item.vue +1 -1
  56. package/components/u-subsection/u-subsection.vue +1 -0
  57. package/components/u-swiper/u-swiper.vue +10 -9
  58. package/components/u-tabbar-item/u-tabbar-item.vue +1 -0
  59. package/components/u-tag/u-tag.vue +362 -361
  60. package/components/u-toolbar/u-toolbar.vue +1 -0
  61. package/components/u-tooltip/u-tooltip.vue +1 -0
  62. package/components/u-upload/u-upload.vue +1 -1
  63. package/package.json +1 -1
@@ -1,229 +1,230 @@
1
- <template>
2
- <u-popup
3
- mode="center"
4
- :zoom="zoom"
5
- :show="show"
6
- :customStyle="{
7
- borderRadius: '6px',
8
- overflow: 'hidden',
9
- marginTop: `-${$u.addUnit(negativeTop)}`
10
- }"
11
- :closeOnClickOverlay="closeOnClickOverlay"
12
- :safeAreaInsetBottom="false"
13
- :duration="400"
14
- @click="clickHandler"
15
- >
16
- <view
17
- class="u-modal"
18
- :style="{
19
- width: $u.addUnit(width),
20
- }"
21
- >
22
- <text
23
- class="u-modal__title"
24
- v-if="title"
25
- >{{ title }}</text>
26
- <view
27
- class="u-modal__content"
28
- :style="{
29
- paddingTop: `${title ? 12 : 25}px`
30
- }"
31
- >
32
- <slot>
33
- <text class="u-modal__content__text">{{ content }}</text>
34
- </slot>
35
- </view>
36
- <view
37
- class="u-modal__button-group--confirm-button"
38
- v-if="$slots.confirmButton"
39
- >
40
- <slot name="confirmButton"></slot>
41
- </view>
42
- <template v-else>
43
- <u-line></u-line>
44
- <view
45
- class="u-modal__button-group"
46
- :style="{
47
- flexDirection: buttonReverse ? 'row-reverse' : 'row'
48
- }"
49
- >
50
- <view
51
- class="u-modal__button-group__wrapper u-modal__button-group__wrapper--cancel"
52
- :hover-stay-time="150"
53
- hover-class="u-modal__button-group__wrapper--hover"
54
- :class="[showCancelButton && !showConfirmButton && 'u-modal__button-group__wrapper--only-cancel']"
55
- v-if="showCancelButton"
56
- @tap="cancelHandler"
57
- >
58
- <text
59
- class="u-modal__button-group__wrapper__text"
60
- :style="{
61
- color: cancelColor
62
- }"
63
- >{{ cancelText }}</text>
64
- </view>
65
- <u-line
66
- direction="column"
67
- v-if="showConfirmButton && showCancelButton"
68
- ></u-line>
69
- <view
70
- class="u-modal__button-group__wrapper u-modal__button-group__wrapper--confirm"
71
- :hover-stay-time="150"
72
- hover-class="u-modal__button-group__wrapper--hover"
73
- :class="[!showCancelButton && showConfirmButton && 'u-modal__button-group__wrapper--only-confirm']"
74
- v-if="showConfirmButton"
75
- @tap="confirmHandler"
76
- >
77
- <u-loading-icon v-if="loading"></u-loading-icon>
78
- <text
79
- v-else
80
- class="u-modal__button-group__wrapper__text"
81
- :style="{
82
- color: confirmColor
83
- }"
84
- >{{ confirmText }}</text>
85
- </view>
86
- </view>
87
- </template>
88
- </view>
89
- </u-popup>
90
- </template>
91
-
92
- <script>
93
- import props from './props.js';
94
- import mpMixin from '../../libs/mixin/mpMixin.js';
95
- import mixin from '../../libs/mixin/mixin.js';
96
- /**
97
- * Modal 模态框
98
- * @description 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作。
99
- * @tutorial https://ijry.github.io/uview-plus/components/modul.html
100
- * @property {Boolean} show 是否显示模态框,请赋值给show (默认 false )
101
- * @property {String} title 标题内容
102
- * @property {String} content 模态框内容,如传入slot内容,则此参数无效
103
- * @property {String} confirmText 确认按钮的文字 (默认 '确认' )
104
- * @property {String} cancelText 取消按钮的文字 (默认 '取消' )
105
- * @property {Boolean} showConfirmButton 是否显示确认按钮 (默认 true )
106
- * @property {Boolean} showCancelButton 是否显示取消按钮 (默认 false )
107
- * @property {String} confirmColor 确认按钮的颜色 (默认 '#2979ff' )
108
- * @property {String} cancelColor 取消按钮的颜色 (默认 '#606266' )
109
- * @property {Boolean} buttonReverse 对调确认和取消的位置 (默认 false )
110
- * @property {Boolean} zoom 是否开启缩放模式 (默认 true )
111
- * @property {Boolean} asyncClose 是否异步关闭,只对确定按钮有效,见上方说明 (默认 false )
112
- * @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭Modal (默认 false )
113
- * @property {String | Number} negativeTop 往上偏移的值,给一个负的margin-top,往上偏移,避免和键盘重合的情况,单位任意,数值则默认为px单位 (默认 0 )
114
- * @property {String | Number} width modal宽度,不支持百分比,可以数值,px,rpx单位 (默认 '650rpx' )
115
- * @property {String} confirmButtonShape 确认按钮的样式,如设置,将不会显示取消按钮
116
- * @event {Function} confirm 点击确认按钮时触发
117
- * @event {Function} cancel 点击取消按钮时触发
118
- * @event {Function} close 点击遮罩关闭出发,closeOnClickOverlay为true有效
119
- * @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
120
- */
121
- export default {
122
- name: 'u-modal',
123
- mixins: [mpMixin, mixin, props],
124
- data() {
125
- return {
126
- loading: false
127
- }
128
- },
129
- watch: {
130
- show(n) {
131
- // 为了避免第一次打开modal,又使用了异步关闭的loading
132
- // 第二次打开modal时,loading依然存在的情况
133
- if (n && this.loading) this.loading = false
134
- }
135
- },
136
- methods: {
137
- // 点击确定按钮
138
- confirmHandler() {
139
- // 如果配置了异步关闭,将按钮值为loading状态
140
- if (this.asyncClose) {
141
- this.loading = true;
142
- }
143
- this.$emit('confirm')
144
- },
145
- // 点击取消按钮
146
- cancelHandler() {
147
- this.$emit('cancel')
148
- },
149
- // 点击遮罩
150
- // 从原理上来说,modal的遮罩点击,并不是真的点击到了遮罩
151
- // 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽有然遮罩,但是为了让弹窗内容能flex居中
152
- // 多了一个透明的遮罩,此透明的遮罩会覆盖在灰色的遮罩上,所以实际上是点击不到灰色遮罩的,popup内部在
153
- // 透明遮罩的子元素做了.stop处理,所以点击内容区,也不会导致误触发
154
- clickHandler() {
155
- if (this.closeOnClickOverlay) {
156
- this.$emit('close')
157
- }
158
- }
159
- }
160
- }
161
- </script>
162
-
163
- <style lang="scss" scoped>
164
- @import "../../libs/css/components.scss";
165
- $u-modal-border-radius: 6px;
166
-
167
- .u-modal {
168
- width: 650rpx;
169
- border-radius: $u-modal-border-radius;
170
- overflow: hidden;
171
-
172
- &__title {
173
- font-size: 16px;
174
- font-weight: bold;
175
- color: $u-content-color;
176
- text-align: center;
177
- padding-top: 25px;
178
- }
179
-
180
- &__content {
181
- padding: 12px 25px 25px 25px;
182
- @include flex;
183
- justify-content: center;
184
-
185
- &__text {
186
- font-size: 15px;
187
- color: $u-content-color;
188
- flex: 1;
189
- }
190
- }
191
-
192
- &__button-group {
193
- @include flex;
194
-
195
- &--confirm-button {
196
- flex-direction: column;
197
- padding: 0px 25px 15px 25px;
198
- }
199
-
200
- &__wrapper {
201
- flex: 1;
202
- @include flex;
203
- justify-content: center;
204
- align-items: center;
205
- height: 48px;
206
-
207
- &--confirm,
208
- &--only-cancel {
209
- border-bottom-right-radius: $u-modal-border-radius;
210
- }
211
-
212
- &--cancel,
213
- &--only-confirm {
214
- border-bottom-left-radius: $u-modal-border-radius;
215
- }
216
-
217
- &--hover {
218
- background-color: $u-bg-color;
219
- }
220
-
221
- &__text {
222
- color: $u-content-color;
223
- font-size: 16px;
224
- text-align: center;
225
- }
226
- }
227
- }
228
- }
229
- </style>
1
+ <template>
2
+ <u-popup
3
+ mode="center"
4
+ :zoom="zoom"
5
+ :show="show"
6
+ :customStyle="{
7
+ borderRadius: '6px',
8
+ overflow: 'hidden',
9
+ marginTop: `-${$u.addUnit(negativeTop)}`
10
+ }"
11
+ :closeOnClickOverlay="closeOnClickOverlay"
12
+ :safeAreaInsetBottom="false"
13
+ :duration="400"
14
+ @click="clickHandler"
15
+ >
16
+ <view
17
+ class="u-modal"
18
+ :style="{
19
+ width: $u.addUnit(width),
20
+ }"
21
+ >
22
+ <text
23
+ class="u-modal__title"
24
+ v-if="title"
25
+ >{{ title }}</text>
26
+ <view
27
+ class="u-modal__content"
28
+ :style="{
29
+ paddingTop: `${title ? 12 : 25}px`
30
+ }"
31
+ >
32
+ <slot>
33
+ <text class="u-modal__content__text">{{ content }}</text>
34
+ </slot>
35
+ </view>
36
+ <view
37
+ class="u-modal__button-group--confirm-button"
38
+ v-if="$slots.confirmButton"
39
+ >
40
+ <slot name="confirmButton"></slot>
41
+ </view>
42
+ <template v-else>
43
+ <u-line></u-line>
44
+ <view
45
+ class="u-modal__button-group"
46
+ :style="{
47
+ flexDirection: buttonReverse ? 'row-reverse' : 'row'
48
+ }"
49
+ >
50
+ <view
51
+ class="u-modal__button-group__wrapper u-modal__button-group__wrapper--cancel"
52
+ :hover-stay-time="150"
53
+ hover-class="u-modal__button-group__wrapper--hover"
54
+ :class="[showCancelButton && !showConfirmButton && 'u-modal__button-group__wrapper--only-cancel']"
55
+ v-if="showCancelButton"
56
+ @tap="cancelHandler"
57
+ >
58
+ <text
59
+ class="u-modal__button-group__wrapper__text"
60
+ :style="{
61
+ color: cancelColor
62
+ }"
63
+ >{{ cancelText }}</text>
64
+ </view>
65
+ <u-line
66
+ direction="column"
67
+ v-if="showConfirmButton && showCancelButton"
68
+ ></u-line>
69
+ <view
70
+ class="u-modal__button-group__wrapper u-modal__button-group__wrapper--confirm"
71
+ :hover-stay-time="150"
72
+ hover-class="u-modal__button-group__wrapper--hover"
73
+ :class="[!showCancelButton && showConfirmButton && 'u-modal__button-group__wrapper--only-confirm']"
74
+ v-if="showConfirmButton"
75
+ @tap="confirmHandler"
76
+ >
77
+ <u-loading-icon v-if="loading"></u-loading-icon>
78
+ <text
79
+ v-else
80
+ class="u-modal__button-group__wrapper__text"
81
+ :style="{
82
+ color: confirmColor
83
+ }"
84
+ >{{ confirmText }}</text>
85
+ </view>
86
+ </view>
87
+ </template>
88
+ </view>
89
+ </u-popup>
90
+ </template>
91
+
92
+ <script>
93
+ import props from './props.js';
94
+ import mpMixin from '../../libs/mixin/mpMixin.js';
95
+ import mixin from '../../libs/mixin/mixin.js';
96
+ /**
97
+ * Modal 模态框
98
+ * @description 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作。
99
+ * @tutorial https://ijry.github.io/uview-plus/components/modul.html
100
+ * @property {Boolean} show 是否显示模态框,请赋值给show (默认 false )
101
+ * @property {String} title 标题内容
102
+ * @property {String} content 模态框内容,如传入slot内容,则此参数无效
103
+ * @property {String} confirmText 确认按钮的文字 (默认 '确认' )
104
+ * @property {String} cancelText 取消按钮的文字 (默认 '取消' )
105
+ * @property {Boolean} showConfirmButton 是否显示确认按钮 (默认 true )
106
+ * @property {Boolean} showCancelButton 是否显示取消按钮 (默认 false )
107
+ * @property {String} confirmColor 确认按钮的颜色 (默认 '#2979ff' )
108
+ * @property {String} cancelColor 取消按钮的颜色 (默认 '#606266' )
109
+ * @property {Boolean} buttonReverse 对调确认和取消的位置 (默认 false )
110
+ * @property {Boolean} zoom 是否开启缩放模式 (默认 true )
111
+ * @property {Boolean} asyncClose 是否异步关闭,只对确定按钮有效,见上方说明 (默认 false )
112
+ * @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭Modal (默认 false )
113
+ * @property {String | Number} negativeTop 往上偏移的值,给一个负的margin-top,往上偏移,避免和键盘重合的情况,单位任意,数值则默认为px单位 (默认 0 )
114
+ * @property {String | Number} width modal宽度,不支持百分比,可以数值,px,rpx单位 (默认 '650rpx' )
115
+ * @property {String} confirmButtonShape 确认按钮的样式,如设置,将不会显示取消按钮
116
+ * @event {Function} confirm 点击确认按钮时触发
117
+ * @event {Function} cancel 点击取消按钮时触发
118
+ * @event {Function} close 点击遮罩关闭出发,closeOnClickOverlay为true有效
119
+ * @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
120
+ */
121
+ export default {
122
+ name: 'u-modal',
123
+ mixins: [mpMixin, mixin, props],
124
+ data() {
125
+ return {
126
+ loading: false
127
+ }
128
+ },
129
+ watch: {
130
+ show(n) {
131
+ // 为了避免第一次打开modal,又使用了异步关闭的loading
132
+ // 第二次打开modal时,loading依然存在的情况
133
+ if (n && this.loading) this.loading = false
134
+ }
135
+ },
136
+ emits: ["confirm", "cancel", "close"],
137
+ methods: {
138
+ // 点击确定按钮
139
+ confirmHandler() {
140
+ // 如果配置了异步关闭,将按钮值为loading状态
141
+ if (this.asyncClose) {
142
+ this.loading = true;
143
+ }
144
+ this.$emit('confirm')
145
+ },
146
+ // 点击取消按钮
147
+ cancelHandler() {
148
+ this.$emit('cancel')
149
+ },
150
+ // 点击遮罩
151
+ // 从原理上来说,modal的遮罩点击,并不是真的点击到了遮罩
152
+ // 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽有然遮罩,但是为了让弹窗内容能flex居中
153
+ // 多了一个透明的遮罩,此透明的遮罩会覆盖在灰色的遮罩上,所以实际上是点击不到灰色遮罩的,popup内部在
154
+ // 透明遮罩的子元素做了.stop处理,所以点击内容区,也不会导致误触发
155
+ clickHandler() {
156
+ if (this.closeOnClickOverlay) {
157
+ this.$emit('close')
158
+ }
159
+ }
160
+ }
161
+ }
162
+ </script>
163
+
164
+ <style lang="scss" scoped>
165
+ @import "../../libs/css/components.scss";
166
+ $u-modal-border-radius: 6px;
167
+
168
+ .u-modal {
169
+ width: 650rpx;
170
+ border-radius: $u-modal-border-radius;
171
+ overflow: hidden;
172
+
173
+ &__title {
174
+ font-size: 16px;
175
+ font-weight: bold;
176
+ color: $u-content-color;
177
+ text-align: center;
178
+ padding-top: 25px;
179
+ }
180
+
181
+ &__content {
182
+ padding: 12px 25px 25px 25px;
183
+ @include flex;
184
+ justify-content: center;
185
+
186
+ &__text {
187
+ font-size: 15px;
188
+ color: $u-content-color;
189
+ flex: 1;
190
+ }
191
+ }
192
+
193
+ &__button-group {
194
+ @include flex;
195
+
196
+ &--confirm-button {
197
+ flex-direction: column;
198
+ padding: 0px 25px 15px 25px;
199
+ }
200
+
201
+ &__wrapper {
202
+ flex: 1;
203
+ @include flex;
204
+ justify-content: center;
205
+ align-items: center;
206
+ height: 48px;
207
+
208
+ &--confirm,
209
+ &--only-cancel {
210
+ border-bottom-right-radius: $u-modal-border-radius;
211
+ }
212
+
213
+ &--cancel,
214
+ &--only-confirm {
215
+ border-bottom-left-radius: $u-modal-border-radius;
216
+ }
217
+
218
+ &--hover {
219
+ background-color: $u-bg-color;
220
+ }
221
+
222
+ &__text {
223
+ color: $u-content-color;
224
+ font-size: 16px;
225
+ text-align: center;
226
+ }
227
+ }
228
+ }
229
+ }
230
+ </style>
@@ -105,9 +105,9 @@
105
105
  mixins: [mpMixin, mixin, props],
106
106
  data() {
107
107
  return {
108
-
109
108
  }
110
109
  },
110
+ emits: ["leftClick", "rightClick"],
111
111
  methods: {
112
112
  // 点击左侧区域
113
113
  leftClick() {
@@ -85,6 +85,7 @@
85
85
  }
86
86
  })
87
87
  },
88
+ emits: ["disconnected", "connected"],
88
89
  methods: {
89
90
  retry() {
90
91
  // 重新检查网络
@@ -74,6 +74,7 @@
74
74
  show: true
75
75
  }
76
76
  },
77
+ emits: ["click", "close"],
77
78
  methods: {
78
79
  // 点击通告栏
79
80
  click(index) {
@@ -81,7 +81,7 @@
81
81
  /**
82
82
  * numberBox 步进器
83
83
  * @description 该组件一般用于商城购物选择物品数量的场景。
84
- * @tutorial https://uviewui.com/components/numberBox.html
84
+ * @tutorial https://uiadmin.net/uview-plus/components/numberBox.html
85
85
  * @property {String | Number} name 步进器标识符,在change回调返回
86
86
  * @property {String | Number} value 用于双向绑定的值,初始化时设置设为默认min值(最小值) (默认 0 )
87
87
  * @property {String | Number} min 最小值 (默认 1 )
@@ -106,8 +106,8 @@
106
106
  },
107
107
  },
108
108
  created() {
109
-
110
109
  },
110
+ emits: ["backspace", "change"],
111
111
  methods: {
112
112
  // 点击退格键
113
113
  backspaceClick() {
@@ -44,6 +44,7 @@
44
44
  return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
45
45
  }
46
46
  },
47
+ emits: ["click"],
47
48
  methods: {
48
49
  clickHandler() {
49
50
  this.$emit('click')
@@ -227,7 +227,7 @@ export default {
227
227
  // #ifdef H5 || APP-PLUS
228
228
  node.attrs.src = node.attrs.src || node.attrs['data-src']
229
229
  // #endif
230
- this.root.$emit('imgtap', node.attrs)
230
+ this.root.$emit('imgTap', node.attrs)
231
231
  // 自动预览图片
232
232
  if (this.root.previewImg) {
233
233
  uni.previewImage({
@@ -321,7 +321,7 @@ export default {
321
321
  const node = e.currentTarget ? this.childs[e.currentTarget.dataset.i] : {}
322
322
  const attrs = node.attrs || e
323
323
  const href = attrs.href
324
- this.root.$emit('linktap', Object.assign({
324
+ this.root.$emit('linkTap', Object.assign({
325
325
  innerText: this.root.getText(node.children || []) // 链接内的文本内容
326
326
  }, attrs))
327
327
  if (href) {