hy-app 0.5.11 → 0.5.13
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/components/hy-button/hy-button.vue +289 -275
- package/components/hy-button/index.scss +24 -1
- package/components/hy-button/props.ts +143 -135
- package/components/hy-button/typing.d.ts +35 -30
- package/components/hy-coupon/hy-coupon.vue +183 -172
- package/components/hy-coupon/index.scss +20 -23
- package/components/hy-coupon/props.ts +108 -103
- package/components/hy-form/hy-form.vue +220 -220
- package/components/hy-input/hy-input.vue +333 -333
- package/components/hy-input/index.scss +1 -2
- package/components/hy-input/props.ts +186 -186
- package/components/hy-notice-bar/hy-row-notice.vue +121 -121
- package/components/hy-parse/node/node.vue +619 -422
- package/components/hy-parse/parser.js +1253 -1060
- package/components/hy-table/hy-table.vue +579 -358
- package/components/hy-table/index.scss +134 -159
- package/components/hy-table/props.ts +62 -47
- package/components/hy-table/typing.d.ts +29 -34
- package/components/hy-tabs/hy-tabs.vue +335 -335
- package/components/hy-tag/index.scss +1 -0
- package/components/hy-text/hy-text.vue +237 -237
- package/components/hy-text/props.ts +115 -115
- package/components/hy-textarea/hy-textarea.vue +198 -197
- package/components/hy-textarea/index.scss +2 -3
- package/components/hy-toast/hy-toast.vue +190 -190
- package/libs/css/theme.scss +1 -0
- package/libs/css/vars.scss +2 -2
- package/libs/typing/modules/common.d.ts +139 -139
- package/libs/utils/inside.ts +336 -350
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1,135 +1,143 @@
|
|
|
1
|
-
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
-
import type { HyIconProps } from '../hy-icon/typing'
|
|
3
|
-
|
|
4
|
-
const buttonProps = {
|
|
5
|
-
/** 是否显示按钮的细边框 */
|
|
6
|
-
hairline: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: true
|
|
9
|
-
},
|
|
10
|
-
/** 是否显示按钮的边框 */
|
|
11
|
-
border: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: true
|
|
14
|
-
},
|
|
15
|
-
/**
|
|
16
|
-
* 按钮的预置样式
|
|
17
|
-
* @values info,primary,error,warning,success
|
|
18
|
-
* */
|
|
19
|
-
type: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: 'primary'
|
|
22
|
-
},
|
|
23
|
-
/**
|
|
24
|
-
* 按钮尺寸
|
|
25
|
-
* @values large,medium,small,mini
|
|
26
|
-
* */
|
|
27
|
-
size: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: 'medium'
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* 按钮形状
|
|
33
|
-
* @values circle,square
|
|
34
|
-
* */
|
|
35
|
-
shape: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: 'square'
|
|
38
|
-
},
|
|
39
|
-
/** 按钮是否镂空,背景色透明 */
|
|
40
|
-
plain: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
/** 是否禁用 */
|
|
45
|
-
disabled: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: false
|
|
48
|
-
},
|
|
49
|
-
/** 按钮名称前是否带 loading 图标 */
|
|
50
|
-
loading: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: false
|
|
53
|
-
},
|
|
54
|
-
/** 加载中提示文字 */
|
|
55
|
-
loadingText: String,
|
|
56
|
-
/**
|
|
57
|
-
* 加载状态图标类型
|
|
58
|
-
* @values spinner,circle,semicircle
|
|
59
|
-
* */
|
|
60
|
-
loadingMode: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: 'spinner'
|
|
63
|
-
},
|
|
64
|
-
/** 加载图标大小 */
|
|
65
|
-
loadingSize: {
|
|
66
|
-
type: [Number, String],
|
|
67
|
-
default: 13
|
|
68
|
-
},
|
|
69
|
-
/** 开放能力,具体请看uniapp稳定关于button组件部分说明 */
|
|
70
|
-
openType: String,
|
|
71
|
-
/** 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件 */
|
|
72
|
-
formType: String,
|
|
73
|
-
/** 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 (注:只微信小程序、QQ小程序有效) */
|
|
74
|
-
appParameter: String,
|
|
75
|
-
/** 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 */
|
|
76
|
-
hoverStopPropagation: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
default: true
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
82
|
-
* @values zh_CN,zh_TW,en
|
|
83
|
-
* */
|
|
84
|
-
lang: {
|
|
85
|
-
type: String,
|
|
86
|
-
default: 'en'
|
|
87
|
-
},
|
|
88
|
-
/** 会话来源,openType="contact"时有效 */
|
|
89
|
-
sessionFrom: String,
|
|
90
|
-
/** 会话内消息卡片标题,openType="contact"时有效 */
|
|
91
|
-
sendMessageTitle: String,
|
|
92
|
-
/** 会话内消息卡片点击跳转小程序路径,openType="contact"时有效 */
|
|
93
|
-
sendMessagePath: String,
|
|
94
|
-
/** 会话内消息卡片图片,openType="contact"时有效 */
|
|
95
|
-
sendMessageImg: String,
|
|
96
|
-
/** 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效 */
|
|
97
|
-
showMessageCard: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: false
|
|
100
|
-
},
|
|
101
|
-
/** 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 */
|
|
102
|
-
dataName: String,
|
|
103
|
-
/** 节流时间,一定时间内只能触发一次 */
|
|
104
|
-
throttleTime: {
|
|
105
|
-
type: Number,
|
|
106
|
-
default: 0
|
|
107
|
-
},
|
|
108
|
-
/** 按住后多久出现点击态,单位毫秒 */
|
|
109
|
-
hoverStartTime: {
|
|
110
|
-
type: Number,
|
|
111
|
-
default: 0
|
|
112
|
-
},
|
|
113
|
-
/** 手指松开后点击态保留时间,单位毫秒 */
|
|
114
|
-
hoverStayTime: {
|
|
115
|
-
type: Number,
|
|
116
|
-
default: 200
|
|
117
|
-
},
|
|
118
|
-
/** 按钮文字,之所以通过props传入,是因为slot传入的话(注:nvue中无法控制文字的样式) */
|
|
119
|
-
text: String,
|
|
120
|
-
/** 按钮图标api集合 */
|
|
121
|
-
icon: Object as PropType<HyIconProps>,
|
|
122
|
-
/** 按钮颜色,支持传入linear-gradient渐变色 */
|
|
123
|
-
color: String,
|
|
124
|
-
/** 定义需要用到的外部样式 */
|
|
125
|
-
customStyle: Object as PropType<CSSProperties>,
|
|
126
|
-
/** 自定义外部类名 */
|
|
127
|
-
customClass: String,
|
|
128
|
-
/** 阻止事件冒泡 */
|
|
129
|
-
stop: {
|
|
130
|
-
type: Boolean,
|
|
131
|
-
default: true
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
+
import type { HyIconProps } from '../hy-icon/typing'
|
|
3
|
+
|
|
4
|
+
const buttonProps = {
|
|
5
|
+
/** 是否显示按钮的细边框 */
|
|
6
|
+
hairline: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: true
|
|
9
|
+
},
|
|
10
|
+
/** 是否显示按钮的边框 */
|
|
11
|
+
border: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: true
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* 按钮的预置样式
|
|
17
|
+
* @values info,primary,error,warning,success
|
|
18
|
+
* */
|
|
19
|
+
type: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'primary'
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* 按钮尺寸
|
|
25
|
+
* @values large,medium,small,mini
|
|
26
|
+
* */
|
|
27
|
+
size: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'medium'
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* 按钮形状
|
|
33
|
+
* @values circle,square
|
|
34
|
+
* */
|
|
35
|
+
shape: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'square'
|
|
38
|
+
},
|
|
39
|
+
/** 按钮是否镂空,背景色透明 */
|
|
40
|
+
plain: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
/** 是否禁用 */
|
|
45
|
+
disabled: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
/** 按钮名称前是否带 loading 图标 */
|
|
50
|
+
loading: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
/** 加载中提示文字 */
|
|
55
|
+
loadingText: String,
|
|
56
|
+
/**
|
|
57
|
+
* 加载状态图标类型
|
|
58
|
+
* @values spinner,circle,semicircle
|
|
59
|
+
* */
|
|
60
|
+
loadingMode: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'spinner'
|
|
63
|
+
},
|
|
64
|
+
/** 加载图标大小 */
|
|
65
|
+
loadingSize: {
|
|
66
|
+
type: [Number, String],
|
|
67
|
+
default: 13
|
|
68
|
+
},
|
|
69
|
+
/** 开放能力,具体请看uniapp稳定关于button组件部分说明 */
|
|
70
|
+
openType: String,
|
|
71
|
+
/** 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件 */
|
|
72
|
+
formType: String,
|
|
73
|
+
/** 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 (注:只微信小程序、QQ小程序有效) */
|
|
74
|
+
appParameter: String,
|
|
75
|
+
/** 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 */
|
|
76
|
+
hoverStopPropagation: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: true
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
82
|
+
* @values zh_CN,zh_TW,en
|
|
83
|
+
* */
|
|
84
|
+
lang: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: 'en'
|
|
87
|
+
},
|
|
88
|
+
/** 会话来源,openType="contact"时有效 */
|
|
89
|
+
sessionFrom: String,
|
|
90
|
+
/** 会话内消息卡片标题,openType="contact"时有效 */
|
|
91
|
+
sendMessageTitle: String,
|
|
92
|
+
/** 会话内消息卡片点击跳转小程序路径,openType="contact"时有效 */
|
|
93
|
+
sendMessagePath: String,
|
|
94
|
+
/** 会话内消息卡片图片,openType="contact"时有效 */
|
|
95
|
+
sendMessageImg: String,
|
|
96
|
+
/** 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效 */
|
|
97
|
+
showMessageCard: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false
|
|
100
|
+
},
|
|
101
|
+
/** 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 */
|
|
102
|
+
dataName: String,
|
|
103
|
+
/** 节流时间,一定时间内只能触发一次 */
|
|
104
|
+
throttleTime: {
|
|
105
|
+
type: Number,
|
|
106
|
+
default: 0
|
|
107
|
+
},
|
|
108
|
+
/** 按住后多久出现点击态,单位毫秒 */
|
|
109
|
+
hoverStartTime: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: 0
|
|
112
|
+
},
|
|
113
|
+
/** 手指松开后点击态保留时间,单位毫秒 */
|
|
114
|
+
hoverStayTime: {
|
|
115
|
+
type: Number,
|
|
116
|
+
default: 200
|
|
117
|
+
},
|
|
118
|
+
/** 按钮文字,之所以通过props传入,是因为slot传入的话(注:nvue中无法控制文字的样式) */
|
|
119
|
+
text: String,
|
|
120
|
+
/** 按钮图标api集合 */
|
|
121
|
+
icon: Object as PropType<HyIconProps>,
|
|
122
|
+
/** 按钮颜色,支持传入linear-gradient渐变色 */
|
|
123
|
+
color: String,
|
|
124
|
+
/** 定义需要用到的外部样式 */
|
|
125
|
+
customStyle: Object as PropType<CSSProperties>,
|
|
126
|
+
/** 自定义外部类名 */
|
|
127
|
+
customClass: String,
|
|
128
|
+
/** 阻止事件冒泡 */
|
|
129
|
+
stop: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: true
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* 在支付宝小程序使用,当 open-type 为 getAuthorize 时有效。
|
|
135
|
+
* @values userInfo,phoneNumber
|
|
136
|
+
* */
|
|
137
|
+
scope: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: ''
|
|
140
|
+
}
|
|
141
|
+
} as const
|
|
142
|
+
|
|
143
|
+
export default buttonProps
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import type buttonProps from './props'
|
|
3
|
+
|
|
4
|
+
export interface HyButtonProps extends ExtractPropTypes<typeof buttonProps> {}
|
|
5
|
+
|
|
6
|
+
export interface IButtonEmits {
|
|
7
|
+
/**
|
|
8
|
+
* 点击按钮事件
|
|
9
|
+
* */
|
|
10
|
+
(e: 'click', event: Event): void
|
|
11
|
+
/**
|
|
12
|
+
* 仅限微信小程序,当使用开放能力时,发生错误的回调
|
|
13
|
+
* */
|
|
14
|
+
(e: 'error', event: Event): void
|
|
15
|
+
/**
|
|
16
|
+
* 微信小程序获取手机号
|
|
17
|
+
* */
|
|
18
|
+
(e: 'getphonenumber', event: Event): void
|
|
19
|
+
/**
|
|
20
|
+
* 微信小程序用户点击该按钮时,会返回获取到的用户信息,从返回参数的detail中获取到的值同uni.getUserInfo
|
|
21
|
+
* */
|
|
22
|
+
(e: 'getuserinfo', event: Event): void
|
|
23
|
+
/**
|
|
24
|
+
* 仅限微信小程序,在打开授权设置页并关闭后回调
|
|
25
|
+
* */
|
|
26
|
+
(e: 'opensetting', event: Event): void
|
|
27
|
+
/**
|
|
28
|
+
* 仅限微信小程序,打开 APP 成功的回调
|
|
29
|
+
* */
|
|
30
|
+
(e: 'launchapp', event: Event): void
|
|
31
|
+
/**
|
|
32
|
+
* 仅限微信小程序,用户同意隐私协议事件回调,open-type="agreePrivacyAuthorization"时有效
|
|
33
|
+
* */
|
|
34
|
+
(e: 'agreeprivacyauthorization', event: Event): void
|
|
35
|
+
}
|