@gmcb/uv-ui 0.3.2 → 0.3.4
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 +16 -0
- package/LICENSE +21 -0
- package/components/uv-alert/uv-alert.vue +3 -1
- package/components/uv-button/props.js +5 -0
- package/components/uv-button/uv-button.vue +12 -3
- package/components/uv-popup/props.js +88 -0
- package/components/uv-popup/uv-popup.vue +13 -84
- package/docs/components/button.md +2 -0
- package/docs/components/popup.md +3 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.3.4](http://10.10.10.16/caoben/front-end/compare/@gmcb/uv-ui@0.3.3...@gmcb/uv-ui@0.3.4) (2026-07-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @gmcb/uv-ui
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.3.3](http://10.10.10.16/caoben/front-end/compare/@gmcb/uv-ui@0.3.2...@gmcb/uv-ui@0.3.3) (2026-06-23)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @gmcb/uv-ui
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.3.2](http://10.10.10.16/caoben/front-end/compare/@gmcb/uv-ui@0.3.1...@gmcb/uv-ui@0.3.2) (2026-06-15)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @gmcb/uv-ui
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 aniu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -78,12 +78,13 @@
|
|
|
78
78
|
* @property {String | Number} fontSize 字体大小 (默认 14 )
|
|
79
79
|
* @property {Object} customStyle 定义需要用到的外部样式
|
|
80
80
|
* @event {Function} click 点击组件时触发
|
|
81
|
+
* @event {Function} close 关闭组件时触发
|
|
81
82
|
* @example <uv-alert :title="title" type = "warning" :closable="closable" :description = "description"></uv-alert>
|
|
82
83
|
*/
|
|
83
84
|
export default {
|
|
84
85
|
name: 'uv-alert',
|
|
85
86
|
mixins: [mpMixin, mixin, props],
|
|
86
|
-
emits: ['click'],
|
|
87
|
+
emits: ['click', 'close'],
|
|
87
88
|
data() {
|
|
88
89
|
return {
|
|
89
90
|
show: true
|
|
@@ -124,6 +125,7 @@
|
|
|
124
125
|
// 点击关闭按钮
|
|
125
126
|
closeHandler() {
|
|
126
127
|
this.show = false
|
|
128
|
+
this.$emit('close')
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
@im="onIm"
|
|
37
37
|
:hover-class="!disabled && !loading && !plain ? 'uv-button--active' : ''"
|
|
38
38
|
class="uv-button uv-reset-button"
|
|
39
|
-
:style="[baseColor, $uv.addStyle(customStyle)]"
|
|
39
|
+
:style="[baseColor, radiusStyle, $uv.addStyle(customStyle)]"
|
|
40
40
|
@tap="clickHandler"
|
|
41
41
|
:class="bemClass"
|
|
42
42
|
>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
:show-message-card="showMessageCard"
|
|
59
59
|
:hover-class="!disabled && !loading && !plain ? 'uv-button--active' : ''"
|
|
60
60
|
class="uv-button uv-reset-button"
|
|
61
|
-
:style="[baseColor, $uv.addStyle(customStyle)]"
|
|
61
|
+
:style="[baseColor, radiusStyle, $uv.addStyle(customStyle)]"
|
|
62
62
|
@tap="clickHandler"
|
|
63
63
|
:class="bemClass"
|
|
64
64
|
>
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
:hover-class="!disabled && !loading && !plain ? 'uv-button--active' : ''"
|
|
107
107
|
@tap="clickHandler"
|
|
108
108
|
:class="bemClass"
|
|
109
|
-
:style="[baseColor, $uv.addStyle(customStyle)]"
|
|
109
|
+
:style="[baseColor, radiusStyle, $uv.addStyle(customStyle)]"
|
|
110
110
|
>
|
|
111
111
|
<template v-if="loading">
|
|
112
112
|
<uv-loading-icon
|
|
@@ -160,6 +160,7 @@ import props from "./props.js";
|
|
|
160
160
|
* @property {String} type 按钮的预置样式,info,primary,error,warning,success (默认 'info' )
|
|
161
161
|
* @property {String} size 按钮尺寸,large,normal,mini (默认 normal)
|
|
162
162
|
* @property {String} shape 按钮形状,circle(两边为半圆),square(带圆角) (默认 'square' )
|
|
163
|
+
* @property {String | Number} radius 按钮圆角大小,仅在shape为square时有效,单位px (默认 null )
|
|
163
164
|
* @property {Boolean} plain 按钮是否镂空,背景色透明 (默认 false)
|
|
164
165
|
* @property {Boolean} disabled 是否禁用 (默认 false)
|
|
165
166
|
* @property {Boolean} loading 按钮名称前是否带 loading 图标(App-nvue 平台,在 ios 上为雪花,Android上为圆圈) (默认 false)
|
|
@@ -269,6 +270,14 @@ export default {
|
|
|
269
270
|
}
|
|
270
271
|
return style;
|
|
271
272
|
},
|
|
273
|
+
// 按钮圆角样式,仅在square形状且设置了radius时生效
|
|
274
|
+
radiusStyle() {
|
|
275
|
+
const style = {};
|
|
276
|
+
if (this.shape === 'square' && this.radius !== null && this.radius !== '') {
|
|
277
|
+
style.borderRadius = this.$uv.addUnit(this.radius);
|
|
278
|
+
}
|
|
279
|
+
return style;
|
|
280
|
+
},
|
|
272
281
|
// nvue版本按钮的字体不会继承父组件的颜色,需要对每一个text组件进行单独的设置
|
|
273
282
|
nvueTextStyle() {
|
|
274
283
|
let style = {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
|
4
|
+
// message: 消息提示 ; dialog : 对话框
|
|
5
|
+
mode: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'center'
|
|
8
|
+
},
|
|
9
|
+
// 动画时长,单位ms
|
|
10
|
+
duration: {
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
default: 300
|
|
13
|
+
},
|
|
14
|
+
// 层级
|
|
15
|
+
zIndex: {
|
|
16
|
+
type: [String, Number],
|
|
17
|
+
default: 10075
|
|
18
|
+
},
|
|
19
|
+
bgColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: '#ffffff'
|
|
22
|
+
},
|
|
23
|
+
safeArea: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
// 是否显示遮罩
|
|
28
|
+
overlay: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
},
|
|
32
|
+
// 点击遮罩是否关闭弹窗
|
|
33
|
+
closeOnClickOverlay: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
// 遮罩的透明度,0-1之间
|
|
38
|
+
overlayOpacity: {
|
|
39
|
+
type: [Number, String],
|
|
40
|
+
default: 0.4
|
|
41
|
+
},
|
|
42
|
+
// 自定义遮罩的样式
|
|
43
|
+
overlayStyle: {
|
|
44
|
+
type: [Object, String],
|
|
45
|
+
default: ''
|
|
46
|
+
},
|
|
47
|
+
// 是否为iPhoneX留出底部安全距离
|
|
48
|
+
safeAreaInsetBottom: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
// 是否留出顶部安全距离(状态栏高度)
|
|
53
|
+
safeAreaInsetTop: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
// 是否显示关闭图标
|
|
58
|
+
closeable: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
// 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
|
|
63
|
+
closeIconPos: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: 'top-right'
|
|
66
|
+
},
|
|
67
|
+
// 关闭图标颜色
|
|
68
|
+
closeIconColor: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: '#909399'
|
|
71
|
+
},
|
|
72
|
+
// 关闭图标大小
|
|
73
|
+
closeIconSize: {
|
|
74
|
+
type: [String, Number],
|
|
75
|
+
default: 18
|
|
76
|
+
},
|
|
77
|
+
// mode=center,也即中部弹出时,是否使用缩放模式
|
|
78
|
+
zoom: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: true
|
|
81
|
+
},
|
|
82
|
+
round: {
|
|
83
|
+
type: [Number, String],
|
|
84
|
+
default: 8
|
|
85
|
+
},
|
|
86
|
+
...uni.$uv?.props?.popup
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -44,12 +44,14 @@
|
|
|
44
44
|
hover-class="uv-popup__content__close--hover"
|
|
45
45
|
hover-stay-time="150"
|
|
46
46
|
>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
<slot name="close">
|
|
48
|
+
<uv-icon
|
|
49
|
+
name="close"
|
|
50
|
+
:color="closeIconColor"
|
|
51
|
+
:size="closeIconSize"
|
|
52
|
+
bold
|
|
53
|
+
></uv-icon>
|
|
54
|
+
</slot>
|
|
53
55
|
</view>
|
|
54
56
|
</view>
|
|
55
57
|
</uv-transition>
|
|
@@ -66,6 +68,7 @@
|
|
|
66
68
|
// #endif
|
|
67
69
|
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
68
70
|
import mixin from '../../libs/mixin/mixin.js'
|
|
71
|
+
import props from './props.js'
|
|
69
72
|
/**
|
|
70
73
|
* PopUp 弹出层
|
|
71
74
|
* @description 弹出层组件,为了解决遮罩弹层的问题
|
|
@@ -78,7 +81,7 @@
|
|
|
78
81
|
* @value right 右侧弹出
|
|
79
82
|
* @property {Number} duration 动画时长,默认300
|
|
80
83
|
* @property {Boolean} overlay 是否显示遮罩,默认true
|
|
81
|
-
* @property {Boolean} overlayOpacity 遮罩透明度,默认0.
|
|
84
|
+
* @property {Boolean} overlayOpacity 遮罩透明度,默认0.4
|
|
82
85
|
* @property {Object} overlayStyle 遮罩自定义样式
|
|
83
86
|
* @property {Boolean} closeOnClickOverlay = [true|false] 蒙版点击是否关闭弹窗,默认true
|
|
84
87
|
* @property {Number | String} zIndex 弹出层的层级
|
|
@@ -86,6 +89,8 @@
|
|
|
86
89
|
* @property {Boolean} safeAreaInsetBottom 是否为留出底部安全区适配,默认true
|
|
87
90
|
* @property {Boolean} closeable 是否显示关闭图标,默认false
|
|
88
91
|
* @property {Boolean} closeIconPos 自定义关闭图标位置,`top-left`-左上角,`top-right`-右上角,`bottom-left`-左下角,`bottom-right`-右下角,默认top-right
|
|
92
|
+
* @property {String} closeIconColor 关闭图标颜色,默认#909399
|
|
93
|
+
* @property {String | Number} closeIconSize 关闭图标大小,默认18
|
|
89
94
|
* @property {String} bgColor 主窗口背景色
|
|
90
95
|
* @property {String} maskBackgroundColor 蒙版颜色
|
|
91
96
|
* @property {Boolean} customStyle 自定义样式
|
|
@@ -99,84 +104,8 @@
|
|
|
99
104
|
keypress
|
|
100
105
|
// #endif
|
|
101
106
|
},
|
|
102
|
-
mixins: [mpMixin, mixin],
|
|
107
|
+
mixins: [mpMixin, mixin, props],
|
|
103
108
|
emits: ['change', 'maskClick', 'close'],
|
|
104
|
-
props: {
|
|
105
|
-
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
|
106
|
-
// message: 消息提示 ; dialog : 对话框
|
|
107
|
-
mode: {
|
|
108
|
-
type: String,
|
|
109
|
-
default: 'center'
|
|
110
|
-
},
|
|
111
|
-
// 动画时长,单位ms
|
|
112
|
-
duration: {
|
|
113
|
-
type: [String, Number],
|
|
114
|
-
default: 300
|
|
115
|
-
},
|
|
116
|
-
// 层级
|
|
117
|
-
zIndex: {
|
|
118
|
-
type: [String, Number],
|
|
119
|
-
default: 10075
|
|
120
|
-
},
|
|
121
|
-
bgColor: {
|
|
122
|
-
type: String,
|
|
123
|
-
default: '#ffffff'
|
|
124
|
-
},
|
|
125
|
-
safeArea: {
|
|
126
|
-
type: Boolean,
|
|
127
|
-
default: true
|
|
128
|
-
},
|
|
129
|
-
// 是否显示遮罩
|
|
130
|
-
overlay: {
|
|
131
|
-
type: Boolean,
|
|
132
|
-
default: true
|
|
133
|
-
},
|
|
134
|
-
// 点击遮罩是否关闭弹窗
|
|
135
|
-
closeOnClickOverlay: {
|
|
136
|
-
type: Boolean,
|
|
137
|
-
default: true
|
|
138
|
-
},
|
|
139
|
-
// 遮罩的透明度,0-1之间
|
|
140
|
-
overlayOpacity: {
|
|
141
|
-
type: [Number, String],
|
|
142
|
-
default: 0.4
|
|
143
|
-
},
|
|
144
|
-
// 自定义遮罩的样式
|
|
145
|
-
overlayStyle: {
|
|
146
|
-
type: [Object, String],
|
|
147
|
-
default: ''
|
|
148
|
-
},
|
|
149
|
-
// 是否为iPhoneX留出底部安全距离
|
|
150
|
-
safeAreaInsetBottom: {
|
|
151
|
-
type: Boolean,
|
|
152
|
-
default: true
|
|
153
|
-
},
|
|
154
|
-
// 是否留出顶部安全距离(状态栏高度)
|
|
155
|
-
safeAreaInsetTop: {
|
|
156
|
-
type: Boolean,
|
|
157
|
-
default: false
|
|
158
|
-
},
|
|
159
|
-
// 是否显示关闭图标
|
|
160
|
-
closeable: {
|
|
161
|
-
type: Boolean,
|
|
162
|
-
default: false
|
|
163
|
-
},
|
|
164
|
-
// 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
|
|
165
|
-
closeIconPos: {
|
|
166
|
-
type: String,
|
|
167
|
-
default: 'top-right'
|
|
168
|
-
},
|
|
169
|
-
// mode=center,也即中部弹出时,是否使用缩放模式
|
|
170
|
-
zoom: {
|
|
171
|
-
type: Boolean,
|
|
172
|
-
default: true
|
|
173
|
-
},
|
|
174
|
-
round: {
|
|
175
|
-
type: [Number, String],
|
|
176
|
-
default: 0
|
|
177
|
-
},
|
|
178
|
-
...uni.$uv?.props?.popup
|
|
179
|
-
},
|
|
180
109
|
watch: {
|
|
181
110
|
/**
|
|
182
111
|
* 监听type类型
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
- 通过`loading`值设置是否开启加载图标,`loadingText`设置加载中文字
|
|
45
45
|
- 通过`icon`值设置是否显示图标
|
|
46
46
|
- 通过`shape`值设置按钮形状,circle为圆角
|
|
47
|
+
- 通过`radius`值设置按钮圆角大小,仅在shape为square时有效,不设置时默认3px
|
|
47
48
|
- 通过`color`值设置按钮渐变颜色
|
|
48
49
|
- 通过`size`值设置按钮的大小
|
|
49
50
|
|
|
@@ -128,6 +129,7 @@ const customStyle = computed(() => {
|
|
|
128
129
|
|type |按钮的样式类型 |String |info |info | primary | error | warning | success |
|
|
129
130
|
|size |按钮的大小 |String |normal |normal | large | mini |
|
|
130
131
|
|shape |按钮外观形状,见[上方说明](/components/button.html#设置按钮的多种形态) |String |square |square | circle |
|
|
132
|
+
|radius |按钮圆角大小,仅在shape为square时有效,单位px |String | Number |- |- |
|
|
131
133
|
|plain |按钮是否镂空,背景色透明 |Boolean |false |true | false |
|
|
132
134
|
|disabled |是否禁用 |Boolean |false |true | false |
|
|
133
135
|
|loading |按钮名称前是否带 loading 图标 |Boolean |false |true | false |App-nvue 平台,在 ios 上为雪花,Android上为圆圈|
|
package/docs/components/popup.md
CHANGED
|
@@ -188,6 +188,8 @@ function open() {
|
|
|
188
188
|
| safeAreaInsetBottom | 是否为留出<a href="/guide/safeAreaInset.html" target="_blank">底部安全区适配</a> | Boolean | true | true | false |
|
|
189
189
|
| closeable | 是否显示关闭图标 | Boolean | false | true | false |
|
|
190
190
|
| closeIconPos | 自定义关闭图标位置,`top-left`-左上角,`top-right`-右上角,`bottom-left`-左下角,`bottom-right`-右下角 | String | top-right | top-right | top-left | bottom-left | bottom-right |
|
|
191
|
+
| closeIconColor | 关闭图标颜色 | String | #909399 | - |
|
|
192
|
+
| closeIconSize | 关闭图标大小 | String | Number | 18 | - |
|
|
191
193
|
| zoom | 当`mode=center`时 是否开启缩放 | Boolean | true | true | false |
|
|
192
194
|
| bgColor | 背景色,设置为""或none可去除默认的白色背景 | String | none | - |
|
|
193
195
|
| round | 设置圆角值,仅对`mode = top | bottom | center`有效 | Number | String | 0 | - |
|
|
@@ -213,6 +215,7 @@ function open() {
|
|
|
213
215
|
|名称| 说明|
|
|
214
216
|
|:- |:- |
|
|
215
217
|
|default| 弹窗内容 |
|
|
218
|
+
|close| 自定义关闭图标内容 |
|
|
216
219
|
|
|
217
220
|
<style scoped>
|
|
218
221
|
h3[id=popup-slots] + table thead tr th:nth-child(2){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmcb/uv-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "uv-ui 破釜沉舟之兼容vue3+2、nvue、app、h5、小程序等多端基于uni-app和uView2.x的生态框架,支持单独导入,开箱即用,利剑出击。",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"homepage": "https://git.keeprisk.cn/gmcb/front-end/tree/master/packages/uv-ui",
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"README.md",
|
|
29
29
|
"index.scss",
|
|
30
30
|
"theme.scss"
|
|
31
|
-
]
|
|
31
|
+
],
|
|
32
|
+
"gitHead": "b490689211c85faf2324dce167666aed87f7a66a"
|
|
32
33
|
}
|