uview-plus 3.3.64 → 3.3.66

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,8 @@
1
+ ## 3.3.66(2025-02-09)
2
+ feat: steps-item增加content插槽
3
+
4
+ ## 3.3.65(2025-02-05)
5
+ feat: number-box组件新增按钮圆角/按钮宽度/数据框背景色/迷你模式
1
6
  ## 3.3.64(2025-01-18)
2
7
  feat: 日历组件支持自定义星期文案
3
8
 
@@ -12,9 +12,11 @@
12
12
  <text v-if="!$slots['tabItem']" class="u-line-1">{{item[tabKeyName]}}</text>
13
13
  </view>
14
14
  </scroll-view>
15
- <scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="u-cate-tab__right-box" @scroll="rightScroll">
15
+ <scroll-view :scroll-top="scrollRightTop" scroll-with-animation
16
+ scroll-y class="u-cate-tab__right-box" @scroll="rightScroll">
16
17
  <view class="u-cate-tab__page-view">
17
- <view class="u-cate-tab__page-item" :id="'item' + index" v-for="(item , index) in tabList" :key="index">
18
+ <view class="u-cate-tab__page-item" :id="'item' + index"
19
+ v-for="(item , index) in tabList" :key="index">
18
20
  <slot name="itemList" :item="item">
19
21
  </slot>
20
22
  <template v-if="!$slots['itemList']">
@@ -115,7 +115,6 @@
115
115
  if (!n) {
116
116
  // 如果传入null或者'',或者false,或者undefined,标记为错误状态
117
117
  this.isError = true
118
-
119
118
  } else {
120
119
  this.isError = false;
121
120
  this.loading = true;
@@ -25,11 +25,15 @@ export default {
25
25
  decimalLength: null,
26
26
  longPress: true,
27
27
  color: '#323233',
28
+ buttonWidth: 30,
28
29
  buttonSize: 30,
30
+ buttonRadius: '0px',
29
31
  bgColor: '#EBECEE',
32
+ inputBgColor: '#EBECEE',
30
33
  cursorSpacing: 100,
31
34
  disableMinus: false,
32
35
  disablePlus: false,
33
- iconStyle: ''
36
+ iconStyle: '',
37
+ miniMode: false
34
38
  }
35
39
  }
@@ -86,16 +86,31 @@ export const props = defineMixin({
86
86
  type: String,
87
87
  default: () => defProps.numberBox.color
88
88
  },
89
+ // 按钮宽度
90
+ buttonWidth: {
91
+ type: [String, Number],
92
+ default: () => defProps.numberBox.buttonWidth
93
+ },
89
94
  // 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
90
95
  buttonSize: {
91
96
  type: [String, Number],
92
97
  default: () => defProps.numberBox.buttonSize
93
98
  },
99
+ // 按钮圆角
100
+ buttonRadius: {
101
+ type: [String],
102
+ default: () => defProps.numberBox.buttonRadius
103
+ },
94
104
  // 输入框和按钮的背景颜色
95
105
  bgColor: {
96
106
  type: String,
97
107
  default: () => defProps.numberBox.bgColor
98
108
  },
109
+ // 输入框背景颜色
110
+ inputBgColor: {
111
+ type: String,
112
+ default: () => defProps.numberBox.inputBgColor
113
+ },
99
114
  // 指定光标于键盘的距离,避免键盘遮挡输入框,单位px
100
115
  cursorSpacing: {
101
116
  type: [String, Number],
@@ -115,6 +130,11 @@ export const props = defineMixin({
115
130
  iconStyle: {
116
131
  type: [Object, String],
117
132
  default: () => defProps.numberBox.iconStyle
118
- }
133
+ },
134
+ // 迷你模式
135
+ miniMode: {
136
+ type: Boolean,
137
+ default: () => defProps.numberBox.miniMode
138
+ },
119
139
  }
120
140
  })
@@ -5,12 +5,12 @@
5
5
  @tap.stop="clickHandler('minus')"
6
6
  @touchstart="onTouchStart('minus')"
7
7
  @touchend.stop="clearTimeout"
8
- v-if="showMinus && $slots.minus"
8
+ v-if="showMinus && !hideMinus && $slots.minus"
9
9
  >
10
10
  <slot name="minus" />
11
11
  </view>
12
12
  <view
13
- v-else-if="showMinus"
13
+ v-else-if="showMinus && !hideMinus"
14
14
  class="u-number-box__minus cursor-pointer"
15
15
  @tap.stop="clickHandler('minus')"
16
16
  @touchstart="onTouchStart('minus')"
@@ -29,36 +29,38 @@
29
29
  ></u-icon>
30
30
  </view>
31
31
 
32
- <slot name="input">
33
- <!-- #ifdef MP-WEIXIN -->
34
- <input
35
- :disabled="disabledInput || disabled"
36
- :cursor-spacing="getCursorSpacing"
37
- :class="{ 'u-number-box__input--disabled': disabled || disabledInput }"
38
- :value="currentValue"
39
- class="u-number-box__input"
40
- @blur="onBlur"
41
- @focus="onFocus"
42
- @input="onInput"
43
- type="number"
44
- :style="[inputStyle]"
45
- />
46
- <!-- #endif -->
47
- <!-- #ifndef MP-WEIXIN -->
48
- <input
49
- :disabled="disabledInput || disabled"
50
- :cursor-spacing="getCursorSpacing"
51
- :class="{ 'u-number-box__input--disabled': disabled || disabledInput }"
52
- v-model="currentValue"
53
- class="u-number-box__input"
54
- @blur="onBlur"
55
- @focus="onFocus"
56
- @input="onInput"
57
- type="number"
58
- :style="[inputStyle]"
59
- />
60
- <!-- #endif -->
61
- </slot>
32
+ <template v-if="!hideMinus">
33
+ <slot name="input">
34
+ <!-- #ifdef MP-WEIXIN -->
35
+ <input
36
+ :disabled="disabledInput || disabled"
37
+ :cursor-spacing="getCursorSpacing"
38
+ :class="{ 'u-number-box__input--disabled': disabled || disabledInput }"
39
+ :value="currentValue"
40
+ class="u-number-box__input"
41
+ @blur="onBlur"
42
+ @focus="onFocus"
43
+ @input="onInput"
44
+ type="number"
45
+ :style="[inputStyle]"
46
+ />
47
+ <!-- #endif -->
48
+ <!-- #ifndef MP-WEIXIN -->
49
+ <input
50
+ :disabled="disabledInput || disabled"
51
+ :cursor-spacing="getCursorSpacing"
52
+ :class="{ 'u-number-box__input--disabled': disabled || disabledInput }"
53
+ v-model="currentValue"
54
+ class="u-number-box__input"
55
+ @blur="onBlur"
56
+ @focus="onFocus"
57
+ @input="onInput"
58
+ type="number"
59
+ :style="[inputStyle]"
60
+ />
61
+ <!-- #endif -->
62
+ </slot>
63
+ </template>
62
64
  <view
63
65
  class="u-number-box__slot cursor-pointer"
64
66
  @tap.stop="clickHandler('plus')"
@@ -164,6 +166,9 @@
164
166
  // #endif
165
167
  },
166
168
  computed: {
169
+ hideMinus() {
170
+ return this.currentValue == 0 && this.miniMode == true
171
+ },
167
172
  getCursorSpacing() {
168
173
  // 判断传入的单位,如果为px单位,需要转成px
169
174
  return getPx(this.cursorSpacing)
@@ -173,8 +178,10 @@
173
178
  return (type) => {
174
179
  const style = {
175
180
  backgroundColor: this.bgColor,
181
+ width: addUnit(this.buttonWidth),
176
182
  height: addUnit(this.buttonSize),
177
- color: this.color
183
+ color: this.color,
184
+ borderRadius: this.buttonRadius
178
185
  }
179
186
  if (this.isDisabled(type)) {
180
187
  style.backgroundColor = '#f7f8fa'
@@ -187,7 +194,7 @@
187
194
  const disabled = this.disabled || this.disabledInput
188
195
  const style = {
189
196
  color: this.color,
190
- backgroundColor: this.bgColor,
197
+ backgroundColor: this.inputBgColor || this.bgColor,
191
198
  height: addUnit(this.buttonSize),
192
199
  width: addUnit(this.inputWidth)
193
200
  }
@@ -26,7 +26,7 @@
26
26
  mixins: [mpMixin, mixin, props],
27
27
  data() {
28
28
  return {
29
- isH5: true
29
+ isH5: false
30
30
  }
31
31
  },
32
32
  created() {
@@ -38,7 +38,12 @@
38
38
  style() {
39
39
  const style = {}
40
40
  // 状态栏高度,由于某些安卓和微信开发工具无法识别css的顶部状态栏变量,所以使用js获取的方式
41
- style.height = addUnit(getWindowInfo().statusBarHeight, 'px')
41
+ let sheight = getWindowInfo().statusBarHeight
42
+ if (sheight == 0) {
43
+ this.isH5 = true
44
+ } else {
45
+ style.height = addUnit(sheight, 'px')
46
+ }
42
47
  style.backgroundColor = this.bgColor
43
48
  return deepMerge(style, addStyle(this.customStyle))
44
49
  }
@@ -31,12 +31,16 @@
31
31
  </slot>
32
32
  </view>
33
33
  <view class="u-steps-item__content" :class="[`u-steps-item__content--${parentData.direction}`]"
34
- :style="[contentStyle]">
35
- <up-text :text="title" :type="parentData.current == index ? 'main' : 'content'" lineHeight="20px"
36
- :size="parentData.current == index ? 14 : 13"></up-text>
37
- <slot name="desc">
38
- <up-text :text="desc" type="tips" size="12"></up-text>
39
- </slot>
34
+ :style="[contentStyle]">
35
+ <slot name="content">
36
+ </slot>
37
+ <template v-if="!$slots['content']">
38
+ <up-text :text="title" :type="parentData.current == index ? 'main' : 'content'" lineHeight="20px"
39
+ :size="parentData.current == index ? 14 : 13"></up-text>
40
+ <slot name="desc">
41
+ <up-text :text="desc" type="tips" size="12"></up-text>
42
+ </slot>
43
+ </template>
40
44
  </view>
41
45
  <!-- <view
42
46
  class="u-steps-item__line"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
5
- "version": "3.3.64",
5
+ "version": "3.3.66",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",