uview-plus 3.3.23 → 3.3.25

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,10 @@
1
+ ## 3.3.25(2024-08-21)
2
+ fix: 修复slider在app-vue下样式问题
3
+ ## 3.3.24(2024-08-19)
4
+ fix: 修复时间选择器hasInput模式小程序不生效
5
+
6
+ feat: 支持H5导入所有组件
7
+
1
8
  ## 3.3.23(2024-08-17)
2
9
  feat: swipe-action增加closeAll方法
3
10
 
@@ -5,7 +12,6 @@ fix: 兼容tabs在某些场景下index小于0时自动设置为0
5
12
 
6
13
  add: 通用mixin新增navTo页面跳转方法
7
14
 
8
-
9
15
  ## 3.3.21(2024-08-15)
10
16
  improvement: 优化二维码组件loading及支持预览与长按事件 #351
11
17
 
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
  <script>
7
7
  export default {
8
- name: "xy-copy",
8
+ name: "up-copy",
9
9
  props: {
10
10
  content: {
11
11
  type: String,
@@ -1,43 +1,46 @@
1
1
  <template>
2
- <view v-if="hasInput" class="u-datetime-picker">
3
- <u-input
4
- :placeholder="placeholder"
5
- :readonly="!!showByClickInput"
6
- border="surround"
7
- v-model="inputValue"
2
+ <view class="u-datetime-picker">
3
+ <view v-if="hasInput" class="u-datetime-picker__has-input"
8
4
  @click="showByClickInput = !showByClickInput"
9
- ></u-input>
5
+ >
6
+ <up-input
7
+ :placeholder="placeholder"
8
+ :readonly="!!showByClickInput"
9
+ border="surround"
10
+ v-model="inputValue"
11
+ ></up-input>
12
+ </view>
13
+ <u-picker
14
+ ref="picker"
15
+ :show="show || (hasInput && showByClickInput)"
16
+ :popupMode="popupMode"
17
+ :closeOnClickOverlay="closeOnClickOverlay"
18
+ :columns="columns"
19
+ :title="title"
20
+ :itemHeight="itemHeight"
21
+ :showToolbar="showToolbar"
22
+ :visibleItemCount="visibleItemCount"
23
+ :defaultIndex="innerDefaultIndex"
24
+ :cancelText="cancelText"
25
+ :confirmText="confirmText"
26
+ :cancelColor="cancelColor"
27
+ :confirmColor="confirmColor"
28
+ :toolbarRightSlot="toolbarRightSlot"
29
+ @close="close"
30
+ @cancel="cancel"
31
+ @confirm="confirm"
32
+ @change="change"
33
+ >
34
+ <template #toolbar-right>
35
+ <slot name="toolbar-right">
36
+ </slot>
37
+ </template>
38
+ <template #toolbar-bottom>
39
+ <slot name="toolbar-bottom">
40
+ </slot>
41
+ </template>
42
+ </u-picker>
10
43
  </view>
11
- <u-picker
12
- ref="picker"
13
- :show="show || (hasInput && showByClickInput)"
14
- :popupMode="popupMode"
15
- :closeOnClickOverlay="closeOnClickOverlay"
16
- :columns="columns"
17
- :title="title"
18
- :itemHeight="itemHeight"
19
- :showToolbar="showToolbar"
20
- :visibleItemCount="visibleItemCount"
21
- :defaultIndex="innerDefaultIndex"
22
- :cancelText="cancelText"
23
- :confirmText="confirmText"
24
- :cancelColor="cancelColor"
25
- :confirmColor="confirmColor"
26
- :toolbarRightSlot="toolbarRightSlot"
27
- @close="close"
28
- @cancel="cancel"
29
- @confirm="confirm"
30
- @change="change"
31
- >
32
- <template #toolbar-right>
33
- <slot name="toolbar-right">
34
- </slot>
35
- </template>
36
- <template #toolbar-bottom>
37
- <slot name="toolbar-bottom">
38
- </slot>
39
- </template>
40
- </u-picker>
41
44
  </template>
42
45
 
43
46
  <script>
@@ -88,7 +91,7 @@
88
91
  * @example <u-datetime-picker :show="show" :value="value1" mode="datetime" ></u-datetime-picker>
89
92
  */
90
93
  export default {
91
- name: 'datetime-picker',
94
+ name: 'up-datetime-picker',
92
95
  mixins: [mpMixin, mixin, props],
93
96
  data() {
94
97
  return {
@@ -460,6 +463,10 @@
460
463
  <style lang="scss" scoped>
461
464
  @import '../../libs/css/components.scss';
462
465
  .u-datetime-picker {
463
- width: 100%;
466
+ &__has-input {
467
+ /* #ifndef APP-NVUE */
468
+ width: 100%;
469
+ /* #endif */
470
+ }
464
471
  }
465
472
  </style>
@@ -361,16 +361,16 @@
361
361
  // pageY += sys().windowTop
362
362
  // #endif
363
363
  // 对第一和最后一个字母做边界处理,因为用户可能在字母列表上触摸到两端的尽头后依然继续滑动
364
- console.log('top1', top)
365
- console.log('height', height)
364
+ // console.log('top1', top)
365
+ // console.log('height', height)
366
366
  top = top - (height / 2) // 减去transfrom的translateY值导致的高度
367
367
  pageY = pageY - this.topOffset
368
368
  // if (this.safeBottomFix) {
369
369
  // pageY = pageY + 34
370
370
  // }
371
- console.log('topOffset', this.topOffset)
372
- console.log('pageY', pageY)
373
- console.log('top2', top)
371
+ // console.log('topOffset', this.topOffset)
372
+ // console.log('pageY', pageY)
373
+ // console.log('top2', top)
374
374
  if (pageY < top) {
375
375
  index = 0
376
376
  } else if (pageY >= top + height) {
@@ -401,7 +401,7 @@
401
401
  const header = await this.getHeaderRect()
402
402
  // item的top值,在nvue下,模拟出的anchor的top,类似非nvue下的index-item的top
403
403
  let top = header.height
404
- console.log(top)
404
+ // console.log(top)
405
405
  const anchors = this.anchors
406
406
  // 由于list组件无法获取cell的top值,这里通过header slot和各个item之间的height,模拟出类似非nvue下的位置信息
407
407
  let children = this.children.map((item, index) => {
@@ -426,7 +426,7 @@
426
426
  // #ifdef APP-NVUE
427
427
  // 在nvue中,由于cell和header为同级元素,所以实际是需要对header(anchor)进行偏移
428
428
  const anchor = `u-index-anchor-${this.uIndexList[currentIndex]}`
429
- console.log(anchor)
429
+ // console.log(anchor)
430
430
  dom.scrollToElement(this.anchors[currentIndex].$refs[anchor], {
431
431
  offset: 0,
432
432
  animated: false
@@ -219,7 +219,7 @@
219
219
  contentObserver.relativeToViewport({
220
220
  bottom: this.getThreshold,
221
221
  }).observe('.u-lazy-item-' + this.elIndex, (res) => {
222
- console.log('relativeToViewport', res)
222
+ // console.log('relativeToViewport', res)
223
223
  if (res.intersectionRatio > 0) {
224
224
  // 懒加载状态改变
225
225
  this.isShow = true;
@@ -42,7 +42,6 @@
42
42
 
43
43
  <script>
44
44
  import { props } from './props';
45
- console.log(props)
46
45
  import { mpMixin } from '../../libs/mixin/mpMixin';
47
46
  import { mixin } from '../../libs/mixin/mixin';
48
47
  import { addUnit, addStyle, getPx, sys } from '../../libs/function/index';
@@ -1,7 +1,7 @@
1
- // import { defineMixin } from '../../libs/vue'
1
+ import { defineMixin } from '../../libs/vue'
2
2
  import defProps from '../../libs/config/props.js'
3
3
  export const props = defineMixin({
4
4
  props: {
5
5
 
6
6
  }
7
- }
7
+ })
@@ -151,7 +151,7 @@ export default {
151
151
  },
152
152
  preview() {
153
153
  // 预览图片
154
- console.log(this.result)
154
+ // console.log(this.result)
155
155
  uni.previewImage({
156
156
  urls: [this.result],
157
157
  longPressActions: {
@@ -414,6 +414,8 @@
414
414
 
415
415
  &-inner {
416
416
  flex: 1;
417
+ display: flex;
418
+ flex-direction: column;
417
419
  position: relative;
418
420
  border-radius: 999px;
419
421
  padding: 10px 18px;
@@ -1,7 +1,7 @@
1
- // import { defineMixin } from '../../libs/vue'
1
+ import { defineMixin } from '../../libs/vue'
2
2
  import defProps from '../../libs/config/props.js'
3
3
  export const props = defineMixin({
4
4
  props: {
5
5
 
6
6
  }
7
- }
7
+ })
@@ -1,7 +1,7 @@
1
- // import { defineMixin } from '../../libs/vue'
1
+ import { defineMixin } from '../../libs/vue'
2
2
  import defProps from '../../libs/config/props.js'
3
3
  export const props = defineMixin({
4
4
  props: {
5
5
 
6
6
  }
7
- }
7
+ })
@@ -4,4 +4,4 @@ export const props = defineMixin({
4
4
  props: {
5
5
 
6
6
  }
7
- }
7
+ })
@@ -70,7 +70,7 @@
70
70
  mixins: [mpMixin, mixin, props],
71
71
  emits: ["confirm", "cancel"],
72
72
  created() {
73
- console.log(this.$slots)
73
+ // console.log(this.$slots)
74
74
  },
75
75
  methods: {
76
76
  // 点击取消按钮
@@ -1,7 +1,7 @@
1
- // import { defineMixin } from '../../libs/vue'
1
+ import { defineMixin } from '../../libs/vue'
2
2
  import defProps from '../../libs/config/props.js'
3
3
  export const props = defineMixin({
4
4
  props: {
5
5
 
6
6
  }
7
- }
7
+ })
package/index.js CHANGED
@@ -77,7 +77,46 @@ const $u = {
77
77
  platform
78
78
  }
79
79
 
80
+ export const mount$u = function() {
81
+ uni.$u = $u
82
+ }
83
+
84
+ // #ifdef H5
85
+ const importFn = import.meta.glob('./components/u-*/u-*.vue', { eager: true })
86
+ let components = [];
87
+
88
+ // 批量注册全局组件
89
+ for (const key in importFn) {
90
+ let component = importFn[key].default;
91
+ if (component.name && component.name.indexOf('u--') !== 0) {
92
+ const name = component.name.replace(/u-([a-zA-Z0-9-_]+)/g, 'up-$1');
93
+ component.name = name;
94
+ console.log('component', component.name)
95
+ component.install = function (Vue) {
96
+ Vue.component(component.name, component);
97
+ };
98
+
99
+ // 导入组件
100
+ components.push(component);
101
+ }
102
+ }
103
+ // #endif
104
+
105
+ function toCamelCase(str) {
106
+ return str.replace(/-([a-z])/g, function(match, group1) {
107
+ return group1.toUpperCase();
108
+ }).replace(/^[a-z]/, function(match) {
109
+ return match.toUpperCase();
110
+ });
111
+ }
112
+
80
113
  const install = (Vue) => {
114
+ // #ifdef H5
115
+ components.forEach(function(component) {
116
+ Vue.component(component.name, component);
117
+ });
118
+ // #endif
119
+
81
120
  // 同时挂载到uni和Vue.prototype中
82
121
  // $u挂载到uni对象上
83
122
  uni.$u = $u
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.23",
5
+ "version": "3.3.25",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
@@ -15,7 +15,7 @@ declare interface ButtonProps {
15
15
  * 按钮的大小
16
16
  * @default "normal"
17
17
  */
18
- size?: 'normal' | 'large' | 'mini'
18
+ size?: 'normal' | 'large' | 'small' | 'mini'
19
19
  /**
20
20
  * 按钮外观形状
21
21
  * @default "square"
@@ -0,0 +1,16 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface SafeBottomProps {
4
+ /**
5
+ * 定义需要用到的外部样式
6
+ */
7
+ customStyle?: unknown
8
+ }
9
+
10
+ declare interface _SafeBottom {
11
+ new (): {
12
+ $props: AllowedComponentProps & VNodeProps & SafeBottomProps
13
+ }
14
+ }
15
+
16
+ export declare const SafeBottom: _SafeBottom
@@ -0,0 +1,22 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface StatusBarProps {
4
+
5
+ /**
6
+ * 背景色
7
+ */
8
+ bgColor?: string
9
+
10
+ /**
11
+ * 定义需要用到的外部样式
12
+ */
13
+ customStyle?: unknown
14
+ }
15
+
16
+ declare interface _StatusBar {
17
+ new (): {
18
+ $props: AllowedComponentProps & VNodeProps & StatusBarProps
19
+ }
20
+ }
21
+
22
+ export declare const StatusBar: _StatusBar
package/types/comps.d.ts CHANGED
@@ -86,13 +86,15 @@ declare module '@vue/runtime-core' {
86
86
  // 其他组件
87
87
  ['up-parse']: typeof import('./comps/parse')['Parse']
88
88
  ['up-code-input']: typeof import('./comps/codeInput')['CodeInput']
89
- ['up-load-more']: typeof import('./comps/loadMore')['LoadMore']
89
+ ['up-loadmore']: typeof import('./comps/loadMore')['LoadMore']
90
90
  ['up-read-more']: typeof import('./comps/readMore')['ReadMore']
91
91
  ['up-gap']: typeof import('./comps/gap')['Gap']
92
92
  ['up-avatar']: typeof import('./comps/avatar')['Avatar']
93
93
  ['up-avatar-group']: typeof import('./comps/avatarGroup')['AvatarGroup']
94
94
  ['up-link']: typeof import('./comps/link')['Link']
95
95
  ['up-transition']: typeof import('./comps/transition')['Transition']
96
+ ['up-status-bar']: typeof import('./comps/statusBar')['StatusBar']
97
+ ['up-safe-bottom']: typeof import('./comps/safeBottom')['SafeBottom']
96
98
  }
97
99
  }
98
100