uview-plus 3.1.52 → 3.2.5

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 (134) hide show
  1. package/changelog.md +51 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +1 -1
  3. package/components/u-album/u-album.vue +261 -261
  4. package/components/u-avatar/u-avatar.vue +3 -2
  5. package/components/u-avatar-group/u-avatar-group.vue +106 -106
  6. package/components/u-button/u-button.vue +6 -1
  7. package/components/u-calendar/u-calendar.vue +4 -3
  8. package/components/u-cell/u-cell.vue +4 -2
  9. package/components/u-checkbox/props.js +5 -0
  10. package/components/u-checkbox/u-checkbox.vue +29 -17
  11. package/components/u-code/u-code.vue +1 -1
  12. package/components/u-dropdown/props.js +8 -14
  13. package/components/u-dropdown/u-dropdown.vue +202 -77
  14. package/components/u-dropdown-item/props.js +45 -36
  15. package/components/u-dropdown-item/u-dropdown-item.vue +121 -148
  16. package/components/u-form/u-form.vue +1 -1
  17. package/components/u-form-item/props.js +6 -1
  18. package/components/u-form-item/u-form-item.vue +1 -1
  19. package/components/u-grid/u-grid.vue +4 -2
  20. package/components/u-grid-item/u-grid-item.vue +8 -7
  21. package/components/u-input/u-input.vue +1 -1
  22. package/components/u-lazy-load/u-lazy-load.vue +251 -0
  23. package/components/u-number-box/u-number-box.vue +4 -4
  24. package/components/u-picker/u-picker.vue +5 -2
  25. package/components/u-popup/u-popup.vue +1 -1
  26. package/components/u-radio/u-radio.vue +2 -2
  27. package/components/u-rate/u-rate.vue +1 -1
  28. package/components/u-read-more/u-read-more.vue +164 -160
  29. package/components/u-slider/u-slider.vue +6 -6
  30. package/components/u-steps-item/u-steps-item.vue +318 -318
  31. package/components/u-subsection/u-subsection.vue +35 -21
  32. package/components/u-swiper/u-swiper.vue +6 -8
  33. package/components/u-switch/u-switch.vue +1 -1
  34. package/components/u-tabbar-item/u-tabbar-item.vue +1 -1
  35. package/components/u-tabs/u-tabs.vue +1 -0
  36. package/components/u-tag/props.js +5 -2
  37. package/components/u-tag/u-tag.vue +1 -1
  38. package/components/u-text/u-text.vue +226 -226
  39. package/components/u-textarea/u-textarea.vue +275 -275
  40. package/components/u-transition/u-transition.vue +1 -1
  41. package/components/u-waterfall/u-waterfall.vue +225 -0
  42. package/index.js +5 -2
  43. package/libs/config/props/formItem.js +1 -0
  44. package/libs/config/props/tag.js +30 -29
  45. package/libs/css/common.scss +4 -1
  46. package/libs/css/components.scss +5 -5
  47. package/libs/css/flex.scss +45 -45
  48. package/libs/mixin/mixin.js +2 -2
  49. package/libs/mixin/mpShare.js +15 -13
  50. package/package.json +1 -1
  51. package/types/comps/_common.d.ts +9 -0
  52. package/types/comps/actionSheet.d.ts +121 -0
  53. package/types/comps/album.d.ts +72 -0
  54. package/types/comps/alert.d.ts +55 -0
  55. package/types/comps/avatar.d.ts +85 -0
  56. package/types/comps/avatarGroup.d.ts +62 -0
  57. package/types/comps/backTop.d.ts +74 -0
  58. package/types/comps/badge.d.ts +76 -0
  59. package/types/comps/button.d.ts +169 -0
  60. package/types/comps/calendar.d.ts +164 -0
  61. package/types/comps/cell.d.ts +133 -0
  62. package/types/comps/cellGroup.d.ts +27 -0
  63. package/types/comps/checkbox.d.ts +69 -0
  64. package/types/comps/checkboxGroup.d.ts +93 -0
  65. package/types/comps/code.d.ts +69 -0
  66. package/types/comps/codeInput.d.ts +98 -0
  67. package/types/comps/col.d.ts +43 -0
  68. package/types/comps/collapse.d.ts +52 -0
  69. package/types/comps/collapseItem.d.ts +83 -0
  70. package/types/comps/countDown.d.ts +60 -0
  71. package/types/comps/countTo.d.ts +88 -0
  72. package/types/comps/datetimePicker.d.ts +146 -0
  73. package/types/comps/divider.d.ts +58 -0
  74. package/types/comps/empty.d.ts +72 -0
  75. package/types/comps/form.d.ts +76 -0
  76. package/types/comps/formItem.d.ts +68 -0
  77. package/types/comps/gap.d.ts +35 -0
  78. package/types/comps/grid.d.ts +34 -0
  79. package/types/comps/gridItem.d.ts +28 -0
  80. package/types/comps/icon.d.ts +93 -0
  81. package/types/comps/image.d.ts +119 -0
  82. package/types/comps/indexAnchor.d.ts +38 -0
  83. package/types/comps/indexItem.d.ts +18 -0
  84. package/types/comps/indexList.d.ts +39 -0
  85. package/types/comps/input.d.ts +234 -0
  86. package/types/comps/keyboard.d.ts +125 -0
  87. package/types/comps/line.d.ts +44 -0
  88. package/types/comps/lineProgress.d.ts +51 -0
  89. package/types/comps/link.d.ts +51 -0
  90. package/types/comps/list.d.ts +92 -0
  91. package/types/comps/listItem.d.ts +18 -0
  92. package/types/comps/loadMore.d.ts +108 -0
  93. package/types/comps/loadingIcon.d.ts +68 -0
  94. package/types/comps/loadingPage.d.ts +58 -0
  95. package/types/comps/modal.d.ts +115 -0
  96. package/types/comps/navbar.d.ts +113 -0
  97. package/types/comps/noNetwork.d.ts +40 -0
  98. package/types/comps/noticeBar.d.ts +85 -0
  99. package/types/comps/notify.d.ts +73 -0
  100. package/types/comps/numberBox.d.ts +155 -0
  101. package/types/comps/overlay.d.ts +46 -0
  102. package/types/comps/parse.d.ts +101 -0
  103. package/types/comps/picker.d.ts +115 -0
  104. package/types/comps/popup.d.ts +103 -0
  105. package/types/comps/radio.d.ts +77 -0
  106. package/types/comps/radioGroup.d.ts +97 -0
  107. package/types/comps/rate.d.ts +85 -0
  108. package/types/comps/readMore.d.ts +80 -0
  109. package/types/comps/row.d.ts +34 -0
  110. package/types/comps/scrollList.d.ts +51 -0
  111. package/types/comps/search.d.ts +167 -0
  112. package/types/comps/skeleton.d.ts +70 -0
  113. package/types/comps/slider.d.ts +79 -0
  114. package/types/comps/steps.d.ts +48 -0
  115. package/types/comps/stepsItem.d.ts +41 -0
  116. package/types/comps/sticky.d.ts +48 -0
  117. package/types/comps/subsection.d.ts +64 -0
  118. package/types/comps/swipeAction.d.ts +24 -0
  119. package/types/comps/swipeActionItem.d.ts +58 -0
  120. package/types/comps/swiper.d.ts +142 -0
  121. package/types/comps/swiperIndicator.d.ts +37 -0
  122. package/types/comps/switch.d.ts +73 -0
  123. package/types/comps/tabbar.d.ts +54 -0
  124. package/types/comps/tabbarItem.d.ts +52 -0
  125. package/types/comps/tabs.d.ts +85 -0
  126. package/types/comps/tag.d.ts +93 -0
  127. package/types/comps/text.d.ts +110 -0
  128. package/types/comps/textarea.d.ts +158 -0
  129. package/types/comps/toast.d.ts +59 -0
  130. package/types/comps/tooltip.d.ts +71 -0
  131. package/types/comps/transition.d.ts +61 -0
  132. package/types/comps/upload.d.ts +163 -0
  133. package/types/comps.d.ts +99 -0
  134. package/types/index.d.ts +47 -0
@@ -1,226 +1,226 @@
1
- <template>
2
- <view
3
- class="u-text"
4
- :class="[]"
5
- v-if="show"
6
- :style="{
7
- margin: margin,
8
- justifyContent: align === 'left' ? 'flex-start' : align === 'center' ? 'center' : 'flex-end'
9
- }"
10
- @tap="clickHandler"
11
- >
12
- <text
13
- :class="['u-text__price', type && `u-text__value--${type}`]"
14
- v-if="mode === 'price'"
15
- :style="[valueStyle]"
16
- >¥</text
17
- >
18
- <view class="u-text__prefix-icon" v-if="prefixIcon">
19
- <u-icon
20
- :name="prefixIcon"
21
- :customStyle="$u.addStyle(iconStyle)"
22
- ></u-icon>
23
- </view>
24
- <u-link
25
- v-if="mode === 'link'"
26
- :style="{fontWeight: valueStyle.fontWeight, wordWrap: valueStyle.wordWrap, fontSize: valueStyle.fontSize}"
27
- :href="href"
28
- underLine
29
- ></u-link>
30
- <template v-else-if="openType && isMp">
31
- <button
32
- class="u-reset-button u-text__value"
33
- :style="[valueStyle]"
34
- :data-index="index"
35
- :openType="openType"
36
- @getuserinfo="onGetUserInfo"
37
- @contact="onContact"
38
- @getphonenumber="onGetPhoneNumber"
39
- @error="onError"
40
- @launchapp="onLaunchApp"
41
- @opensetting="onOpenSetting"
42
- :lang="lang"
43
- :session-from="sessionFrom"
44
- :send-message-title="sendMessageTitle"
45
- :send-message-path="sendMessagePath"
46
- :send-message-img="sendMessageImg"
47
- :show-message-card="showMessageCard"
48
- :app-parameter="appParameter"
49
- >
50
- {{ value }}
51
- </button>
52
- </template>
53
- <text
54
- v-else
55
- class="u-text__value"
56
- :style="[valueStyle]"
57
- :class="[
58
- type && `u-text__value--${type}`,
59
- lines && `u-line-${lines}`
60
- ]"
61
- >{{ value }}</text
62
- >
63
- <view class="u-text__suffix-icon" v-if="suffixIcon">
64
- <u-icon
65
- :name="suffixIcon"
66
- :customStyle="$u.addStyle(iconStyle)"
67
- ></u-icon>
68
- </view>
69
- </view>
70
- </template>
71
-
72
- <script>
73
- import value from './value.js'
74
- import mpMixin from '../../libs/mixin/mpMixin.js';
75
- import mixin from '../../libs/mixin/mixin.js';
76
- import button from '../../libs/mixin/button.js'
77
- import openType from '../../libs/mixin/openType.js'
78
- import props from './props.js'
79
- /**
80
- * Text 文本
81
- * @description 此组件集成了文本类在项目中的常用功能,包括状态,拨打电话,格式化日期,*替换,超链接...等功能。 您大可不必在使用特殊文本时自己定义,text组件几乎涵盖您能使用的大部分场景。
82
- * @tutorial https://ijry.github.io/uview-plus/components/loading.html
83
- * @property {String} type 主题颜色
84
- * @property {Boolean} show 是否显示(默认 true )
85
- * @property {String | Number} text 显示的值
86
- * @property {String} prefixIcon 前置图标
87
- * @property {String} suffixIcon 后置图标
88
- * @property {String} mode 文本处理的匹配模式 text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
89
- * @property {String} href mode=link下,配置的链接
90
- * @property {String | Function} format 格式化规则
91
- * @property {Boolean} call mode=phone时,点击文本是否拨打电话(默认 false )
92
- * @property {String} openType 小程序的打开方式
93
- * @property {Boolean} bold 是否粗体,默认normal(默认 false )
94
- * @property {Boolean} block 是否块状(默认 false )
95
- * @property {String | Number} lines 文本显示的行数,如果设置,超出此行数,将会显示省略号
96
- * @property {String} color 文本颜色(默认 '#303133' )
97
- * @property {String | Number} size 字体大小(默认 15 )
98
- * @property {Object | String} iconStyle 图标的样式 (默认 {fontSize: '15px'} )
99
- * @property {String} decoration 文字装饰,下划线,中划线等,可选值 none|underline|line-through(默认 'none' )
100
- * @property {Object | String | Number} margin 外边距,对象、字符串,数值形式均可(默认 0 )
101
- * @property {String | Number} lineHeight 文本行高
102
- * @property {String} align 文本对齐方式,可选值left|center|right(默认 'left' )
103
- * @property {String} wordWrap 文字换行,可选值break-word|normal|anywhere(默认 'normal' )
104
- * @event {Function} click 点击触发事件
105
- * @example <u--text text="我用十年青春,赴你最后之约"></u--text>
106
- */
107
- export default {
108
- name: 'u--text',
109
- // #ifdef MP
110
- mixins: [mpMixin, mixin, value, button, openType, props],
111
- // #endif
112
- // #ifndef MP
113
- mixins: [mpMixin, mixin, value, props],
114
- // #endif
115
- emits: ['click'],
116
- computed: {
117
- valueStyle() {
118
- const style = {
119
- textDecoration: this.decoration,
120
- fontWeight: this.bold ? 'bold' : 'normal',
121
- wordWrap: this.wordWrap,
122
- fontSize: uni.$u.addUnit(this.size)
123
- }
124
- !this.type && (style.color = this.color)
125
- this.isNvue && this.lines && (style.lines = this.lines)
126
- this.lineHeight &&
127
- (style.lineHeight = uni.$u.addUnit(this.lineHeight))
128
- !this.isNvue && this.block && (style.display = 'block')
129
- return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
130
- },
131
- isNvue() {
132
- let nvue = false
133
- // #ifdef APP-NVUE
134
- nvue = true
135
- // #endif
136
- return nvue
137
- },
138
- isMp() {
139
- let mp = false
140
- // #ifdef MP
141
- mp = true
142
- // #endif
143
- return mp
144
- }
145
- },
146
- data() {
147
- return {}
148
- },
149
- methods: {
150
- clickHandler() {
151
- // 如果为手机号模式,拨打电话
152
- if (this.call && this.mode === 'phone') {
153
- uni.makePhoneCall({
154
- phoneNumber: this.text
155
- })
156
- }
157
- this.$emit('click')
158
- }
159
- }
160
- }
161
- </script>
162
-
163
- <style lang="scss" scoped>
164
- @import '../../libs/css/components.scss';
165
-
166
- .u-text {
167
- @include flex(row);
168
- align-items: center;
169
- flex-wrap: nowrap;
170
- flex: 1;
171
- /* #ifndef APP-NVUE */
172
- width: 100%;
173
- /* #endif */
174
-
175
- &__price {
176
- font-size: 14px;
177
- color: $u-content-color;
178
- }
179
-
180
- &__value {
181
- font-size: 14px;
182
- @include flex;
183
- color: $u-content-color;
184
- flex-wrap: wrap;
185
- // flex: 1;
186
- text-overflow: ellipsis;
187
- align-items: center;
188
-
189
- &--primary {
190
- color: $u-primary;
191
- }
192
-
193
- &--warning {
194
- color: $u-warning;
195
- }
196
-
197
- &--success {
198
- color: $u-success;
199
- }
200
-
201
- &--info {
202
- color: $u-info;
203
- }
204
-
205
- &--error {
206
- color: $u-error;
207
- }
208
-
209
- &--main {
210
- color: $u-main-color;
211
- }
212
-
213
- &--content {
214
- color: $u-content-color;
215
- }
216
-
217
- &--tips {
218
- color: $u-tips-color;
219
- }
220
-
221
- &--light {
222
- color: $u-light-color;
223
- }
224
- }
225
- }
226
- </style>
1
+ <template>
2
+ <view
3
+ class="u-text"
4
+ :class="[]"
5
+ v-if="show"
6
+ :style="{
7
+ margin: margin,
8
+ justifyContent: align === 'left' ? 'flex-start' : align === 'center' ? 'center' : 'flex-end'
9
+ }"
10
+ @tap="clickHandler"
11
+ >
12
+ <text
13
+ :class="['u-text__price', type && `u-text__value--${type}`]"
14
+ v-if="mode === 'price'"
15
+ :style="[valueStyle]"
16
+ >¥</text
17
+ >
18
+ <view class="u-text__prefix-icon" v-if="prefixIcon">
19
+ <u-icon
20
+ :name="prefixIcon"
21
+ :customStyle="$u.addStyle(iconStyle)"
22
+ ></u-icon>
23
+ </view>
24
+ <u-link
25
+ v-if="mode === 'link'" class="u-text__value"
26
+ :style="{fontWeight: valueStyle.fontWeight, wordWrap: valueStyle.wordWrap, fontSize: valueStyle.fontSize}" :class="[ type && `u-text__value--${type}`, lines && `u-line-${lines}` ]" :text="value"
27
+ :href="href"
28
+ underLine
29
+ ></u-link>
30
+ <template v-else-if="openType && isMp">
31
+ <button
32
+ class="u-reset-button u-text__value"
33
+ :style="[valueStyle]"
34
+ :data-index="index"
35
+ :openType="openType"
36
+ @getuserinfo="onGetUserInfo"
37
+ @contact="onContact"
38
+ @getphonenumber="onGetPhoneNumber"
39
+ @error="onError"
40
+ @launchapp="onLaunchApp"
41
+ @opensetting="onOpenSetting"
42
+ :lang="lang"
43
+ :session-from="sessionFrom"
44
+ :send-message-title="sendMessageTitle"
45
+ :send-message-path="sendMessagePath"
46
+ :send-message-img="sendMessageImg"
47
+ :show-message-card="showMessageCard"
48
+ :app-parameter="appParameter"
49
+ >
50
+ {{ value }}
51
+ </button>
52
+ </template>
53
+ <text
54
+ v-else
55
+ class="u-text__value"
56
+ :style="[valueStyle]"
57
+ :class="[
58
+ type && `u-text__value--${type}`,
59
+ lines && `u-line-${lines}`
60
+ ]"
61
+ >{{ value }}</text
62
+ >
63
+ <view class="u-text__suffix-icon" v-if="suffixIcon">
64
+ <u-icon
65
+ :name="suffixIcon"
66
+ :customStyle="$u.addStyle(iconStyle)"
67
+ ></u-icon>
68
+ </view>
69
+ </view>
70
+ </template>
71
+
72
+ <script>
73
+ import value from './value.js'
74
+ import mpMixin from '../../libs/mixin/mpMixin.js';
75
+ import mixin from '../../libs/mixin/mixin.js';
76
+ import button from '../../libs/mixin/button.js'
77
+ import openType from '../../libs/mixin/openType.js'
78
+ import props from './props.js'
79
+ /**
80
+ * Text 文本
81
+ * @description 此组件集成了文本类在项目中的常用功能,包括状态,拨打电话,格式化日期,*替换,超链接...等功能。 您大可不必在使用特殊文本时自己定义,text组件几乎涵盖您能使用的大部分场景。
82
+ * @tutorial https://ijry.github.io/uview-plus/components/loading.html
83
+ * @property {String} type 主题颜色
84
+ * @property {Boolean} show 是否显示(默认 true )
85
+ * @property {String | Number} text 显示的值
86
+ * @property {String} prefixIcon 前置图标
87
+ * @property {String} suffixIcon 后置图标
88
+ * @property {String} mode 文本处理的匹配模式 text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
89
+ * @property {String} href mode=link下,配置的链接
90
+ * @property {String | Function} format 格式化规则
91
+ * @property {Boolean} call mode=phone时,点击文本是否拨打电话(默认 false )
92
+ * @property {String} openType 小程序的打开方式
93
+ * @property {Boolean} bold 是否粗体,默认normal(默认 false )
94
+ * @property {Boolean} block 是否块状(默认 false )
95
+ * @property {String | Number} lines 文本显示的行数,如果设置,超出此行数,将会显示省略号
96
+ * @property {String} color 文本颜色(默认 '#303133' )
97
+ * @property {String | Number} size 字体大小(默认 15 )
98
+ * @property {Object | String} iconStyle 图标的样式 (默认 {fontSize: '15px'} )
99
+ * @property {String} decoration 文字装饰,下划线,中划线等,可选值 none|underline|line-through(默认 'none' )
100
+ * @property {Object | String | Number} margin 外边距,对象、字符串,数值形式均可(默认 0 )
101
+ * @property {String | Number} lineHeight 文本行高
102
+ * @property {String} align 文本对齐方式,可选值left|center|right(默认 'left' )
103
+ * @property {String} wordWrap 文字换行,可选值break-word|normal|anywhere(默认 'normal' )
104
+ * @event {Function} click 点击触发事件
105
+ * @example <up-text text="我用十年青春,赴你最后之约"></up-text>
106
+ */
107
+ export default {
108
+ name: 'u--text',
109
+ // #ifdef MP
110
+ mixins: [mpMixin, mixin, value, button, openType, props],
111
+ // #endif
112
+ // #ifndef MP
113
+ mixins: [mpMixin, mixin, value, props],
114
+ // #endif
115
+ emits: ['click'],
116
+ computed: {
117
+ valueStyle() {
118
+ const style = {
119
+ textDecoration: this.decoration,
120
+ fontWeight: this.bold ? 'bold' : 'normal',
121
+ wordWrap: this.wordWrap,
122
+ fontSize: uni.$u.addUnit(this.size)
123
+ }
124
+ !this.type && (style.color = this.color)
125
+ this.isNvue && this.lines && (style.lines = this.lines)
126
+ this.lineHeight &&
127
+ (style.lineHeight = uni.$u.addUnit(this.lineHeight))
128
+ !this.isNvue && this.block && (style.display = 'block')
129
+ return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
130
+ },
131
+ isNvue() {
132
+ let nvue = false
133
+ // #ifdef APP-NVUE
134
+ nvue = true
135
+ // #endif
136
+ return nvue
137
+ },
138
+ isMp() {
139
+ let mp = false
140
+ // #ifdef MP
141
+ mp = true
142
+ // #endif
143
+ return mp
144
+ }
145
+ },
146
+ data() {
147
+ return {}
148
+ },
149
+ methods: {
150
+ clickHandler() {
151
+ // 如果为手机号模式,拨打电话
152
+ if (this.call && this.mode === 'phone') {
153
+ uni.makePhoneCall({
154
+ phoneNumber: this.text
155
+ })
156
+ }
157
+ this.$emit('click')
158
+ }
159
+ }
160
+ }
161
+ </script>
162
+
163
+ <style lang="scss" scoped>
164
+ @import '../../libs/css/components.scss';
165
+
166
+ .u-text {
167
+ @include flex(row);
168
+ align-items: center;
169
+ flex-wrap: nowrap;
170
+ flex: 1;
171
+ /* #ifndef APP-NVUE */
172
+ width: 100%;
173
+ /* #endif */
174
+
175
+ &__price {
176
+ font-size: 14px;
177
+ color: $u-content-color;
178
+ }
179
+
180
+ &__value {
181
+ font-size: 14px;
182
+ @include flex;
183
+ color: $u-content-color;
184
+ flex-wrap: wrap;
185
+ // flex: 1;
186
+ text-overflow: ellipsis;
187
+ align-items: center;
188
+
189
+ &--primary {
190
+ color: $u-primary;
191
+ }
192
+
193
+ &--warning {
194
+ color: $u-warning;
195
+ }
196
+
197
+ &--success {
198
+ color: $u-success;
199
+ }
200
+
201
+ &--info {
202
+ color: $u-info;
203
+ }
204
+
205
+ &--error {
206
+ color: $u-error;
207
+ }
208
+
209
+ &--main {
210
+ color: $u-main-color;
211
+ }
212
+
213
+ &--content {
214
+ color: $u-content-color;
215
+ }
216
+
217
+ &--tips {
218
+ color: $u-tips-color;
219
+ }
220
+
221
+ &--light {
222
+ color: $u-light-color;
223
+ }
224
+ }
225
+ }
226
+ </style>