hy-app 0.5.3 → 0.5.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.
- package/components/hy-action-sheet/typing.d.ts +1 -63
- package/components/hy-address-picker/hy-address-picker.vue +7 -6
- package/components/hy-address-picker/typing.d.ts +0 -84
- package/components/hy-avatar/hy-avatar.vue +4 -3
- package/components/hy-avatar/typing.d.ts +0 -66
- package/components/hy-back-top/typing.d.ts +0 -47
- package/components/hy-badge/hy-badge.vue +3 -3
- package/components/hy-badge/index.scss +0 -1
- package/components/hy-badge/props.ts +6 -1
- package/components/hy-badge/typing.d.ts +0 -62
- package/components/hy-button/typing.d.ts +28 -162
- package/components/hy-calendar/hy-calendar.vue +2 -2
- package/components/hy-calendar/typing.d.ts +0 -128
- package/components/hy-card/hy-card.vue +12 -12
- package/components/hy-card/index.scss +17 -5
- package/components/hy-card/props.ts +1 -2
- package/components/hy-card/typing.d.ts +1 -114
- package/components/hy-cell/props.ts +1 -1
- package/components/hy-cell/typing.d.ts +0 -55
- package/components/hy-check-button/typing.d.ts +0 -43
- package/components/hy-checkbox/typing.d.ts +1 -73
- package/components/hy-checkbox-group/typing.d.ts +0 -65
- package/components/hy-code-input/typing.d.ts +0 -70
- package/components/hy-count-down/typing.d.ts +1 -20
- package/components/hy-count-to/typing.d.ts +0 -47
- package/components/hy-coupon/index.scss +7 -2
- package/components/hy-coupon/props.ts +7 -4
- package/components/hy-coupon/typing.d.ts +1 -134
- package/components/hy-datetime-picker/props.ts +1 -3
- package/components/hy-datetime-picker/typing.d.ts +0 -119
- package/components/hy-dropdown-item/typing.d.ts +12 -31
- package/components/hy-empty/typing.d.ts +1 -59
- package/components/hy-float-button/typing.d.ts +24 -113
- package/components/hy-folding-panel/props.ts +1 -1
- package/components/hy-folding-panel/typing.d.ts +0 -38
- package/components/hy-folding-panel-item/hy-folding-panel-item.vue +2 -3
- package/components/hy-folding-panel-item/typing.d.ts +14 -0
- package/components/hy-form/typing.d.ts +0 -27
- package/components/hy-form-item/hy-form-item.vue +7 -5
- package/components/hy-form-item/typing.d.ts +0 -19
- package/components/hy-grid/typing.d.ts +0 -43
- package/components/hy-icon/hy-icon.vue +3 -8
- package/components/hy-icon/typing.d.ts +0 -86
- package/components/hy-image/typing.d.ts +0 -80
- package/components/hy-input/typing.d.ts +0 -149
- package/components/hy-list/props.ts +1 -1
- package/components/hy-list/typing.d.ts +0 -51
- package/components/hy-menu/typing.d.ts +0 -35
- package/components/hy-modal/typing.d.ts +9 -84
- package/components/hy-navbar/typing.d.ts +0 -81
- package/components/hy-notice-bar/typing.d.ts +2 -65
- package/components/hy-number-step/typing.d.ts +0 -110
- package/components/hy-overlay/typing.d.ts +2 -27
- package/components/hy-pagination/typing.d.ts +6 -49
- package/components/hy-picker/typing.d.ts +27 -124
- package/components/hy-popover/typing.d.ts +25 -66
- package/components/hy-popup/hy-popup.vue +0 -1
- package/components/hy-popup/typing.d.ts +8 -77
- package/components/hy-price/typing.d.ts +0 -41
- package/components/hy-qrcode/hy-qrcode.vue +67 -2
- package/components/hy-qrcode/index.scss +3 -4
- package/components/hy-qrcode/typing.d.ts +0 -66
- package/components/hy-radio/typing.d.ts +1 -86
- package/components/hy-rate/typing.d.ts +0 -62
- package/components/hy-read-more/typing.d.ts +4 -49
- package/components/hy-scroll-list/typing.d.ts +4 -33
- package/components/hy-search/typing.d.ts +19 -120
- package/components/hy-signature/hy-signature.vue +25 -22
- package/components/hy-signature/index.scss +0 -4
- package/components/hy-signature/typing.d.ts +0 -101
- package/components/hy-slider/typing.d.ts +8 -77
- package/components/hy-steps/typing.d.ts +16 -60
- package/components/hy-submit-bar/typing.d.ts +0 -72
- package/components/hy-subsection/typing.d.ts +0 -49
- package/components/hy-swipe-action/index.ts +13 -22
- package/components/hy-swipe-action/typing.d.ts +1 -38
- package/components/hy-swiper/typing.d.ts +0 -101
- package/components/hy-switch/typing.d.ts +0 -62
- package/components/hy-tabbar/hy-tabbar.vue +137 -0
- package/components/{hy-tabBar → hy-tabbar}/index.scss +31 -31
- package/components/hy-tabbar/props.ts +59 -0
- package/components/hy-tabbar/typing.d.ts +21 -0
- package/components/hy-tabbar-group/hy-tabbar-group.vue +87 -0
- package/components/hy-tabbar-group/index.scss +57 -0
- package/components/hy-tabbar-group/props.ts +78 -0
- package/components/hy-tabbar-group/typing.ts +16 -0
- package/components/hy-tabbar-item/hy-tabbar-item.vue +103 -0
- package/components/hy-tabbar-item/index.scss +43 -0
- package/components/hy-tabbar-item/props.ts +24 -0
- package/components/hy-tabbar-item/typing.ts +10 -0
- package/components/hy-tabs/typing.d.ts +25 -92
- package/components/hy-tag/props.ts +8 -2
- package/components/hy-tag/typing.d.ts +9 -78
- package/components/hy-text/props.ts +8 -2
- package/components/hy-text/typing.d.ts +3 -100
- package/components/hy-textarea/props.ts +4 -1
- package/components/hy-textarea/typing.d.ts +0 -27
- package/components/hy-tooltip/props.ts +1 -4
- package/components/hy-tooltip/typing.d.ts +2 -55
- package/components/hy-transition/typing.d.ts +14 -43
- package/components/hy-upload/props.ts +1 -1
- package/components/hy-upload/typing.d.ts +56 -164
- package/components/hy-warn/typing.d.ts +4 -45
- package/components/index.ts +177 -177
- package/global.d.ts +87 -85
- package/package.json +2 -2
- package/web-types.json +1 -1
- package/components/hy-config-provider/typing.d.ts +0 -24
- package/components/hy-divider/typing.d.ts +0 -64
- package/components/hy-dropdown/typing.d.ts +0 -48
- package/components/hy-form-group/typing.d.ts +0 -0
- package/components/hy-line/typing.d.ts +0 -32
- package/components/hy-line-progress/typing.d.ts +0 -32
- package/components/hy-loading/typing.d.ts +0 -52
- package/components/hy-notify/typing.d.ts +0 -48
- package/components/hy-status-bar/typing.d.ts +0 -12
- package/components/hy-tabBar/hy-tabBar.vue +0 -109
- package/components/hy-tabBar/props.ts +0 -13
- package/components/hy-tabBar/typing.d.ts +0 -54
- package/components/hy-waterfall/typing.d.ts +0 -14
- package/components/hy-watermark/typing.d.ts +0 -76
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
1
|
export interface IActionSheetAction {
|
|
3
2
|
/**
|
|
4
3
|
* 选项名称
|
|
@@ -21,6 +20,7 @@ export interface IActionSheetAction {
|
|
|
21
20
|
*/
|
|
22
21
|
loading?: boolean
|
|
23
22
|
}
|
|
23
|
+
|
|
24
24
|
export interface IActionSheetPanel {
|
|
25
25
|
/**
|
|
26
26
|
* 图片地址
|
|
@@ -31,68 +31,6 @@ export interface IActionSheetPanel {
|
|
|
31
31
|
*/
|
|
32
32
|
name: string
|
|
33
33
|
}
|
|
34
|
-
export interface HyActionSheetProps {
|
|
35
|
-
/**
|
|
36
|
-
* 操作菜单是否展示 ( 默认 false )
|
|
37
|
-
* */
|
|
38
|
-
modelValue?: boolean
|
|
39
|
-
/**
|
|
40
|
-
* 菜单选项
|
|
41
|
-
* */
|
|
42
|
-
actions?: IActionSheetAction[]
|
|
43
|
-
/**
|
|
44
|
-
* 自定义面板项,可以为字符串数组,也可以为对象数组,如果为二维数组,则为多行展示
|
|
45
|
-
* */
|
|
46
|
-
panels?: Array<IActionSheetPanel | IActionSheetPanel[]>
|
|
47
|
-
/**
|
|
48
|
-
* 圆角值 (默认 20 )
|
|
49
|
-
* */
|
|
50
|
-
round?: string | number
|
|
51
|
-
/**
|
|
52
|
-
* 标题
|
|
53
|
-
* */
|
|
54
|
-
title?: string
|
|
55
|
-
/**
|
|
56
|
-
* 标题文字位置
|
|
57
|
-
* */
|
|
58
|
-
titleAlign?: HyApp.RowCenterType
|
|
59
|
-
/**
|
|
60
|
-
* 取消按钮的提示文字,不为空时显示按钮
|
|
61
|
-
* */
|
|
62
|
-
cancelText?: string
|
|
63
|
-
/**
|
|
64
|
-
* 点击某个菜单项时是否关闭弹窗 (默认 true )
|
|
65
|
-
* */
|
|
66
|
-
closeOnClickAction?: boolean
|
|
67
|
-
/**
|
|
68
|
-
* 点击遮罩是否允许关闭 (默认 true )
|
|
69
|
-
* */
|
|
70
|
-
closeOnClickOverlay?: boolean
|
|
71
|
-
/**
|
|
72
|
-
* 弹框动画持续时间 ( 默认 200 )
|
|
73
|
-
* */
|
|
74
|
-
duration?: number
|
|
75
|
-
/**
|
|
76
|
-
* 菜单层级 ( 默认 100 )
|
|
77
|
-
* */
|
|
78
|
-
zIndex?: number
|
|
79
|
-
/**
|
|
80
|
-
* 处理底部安全区 (默认 true )
|
|
81
|
-
* */
|
|
82
|
-
safeAreaInsetBottom?: boolean
|
|
83
|
-
/**
|
|
84
|
-
* 自定义外部样式
|
|
85
|
-
* */
|
|
86
|
-
customStyle?: CSSProperties
|
|
87
|
-
/**
|
|
88
|
-
* 自定义外部类名
|
|
89
|
-
* */
|
|
90
|
-
customClass?: string
|
|
91
|
-
/**
|
|
92
|
-
* 自定义标题类名
|
|
93
|
-
* */
|
|
94
|
-
customHeaderClass?: string
|
|
95
|
-
}
|
|
96
34
|
|
|
97
35
|
interface SelectEventParams {
|
|
98
36
|
/**
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
<view class="hy-address-picker">
|
|
3
3
|
<view v-if="hasInput" class="hy-address-picker__has-input" @tap="onShowByClickInput">
|
|
4
4
|
<!-- @slot 自定义输入框 -->
|
|
5
|
-
<slot name="trigger" :value="inputValue">
|
|
6
|
-
|
|
5
|
+
<slot v-if="$slots.trigger" name="trigger" :value="inputValue"></slot>
|
|
6
|
+
<template v-else>
|
|
7
|
+
<hy-input
|
|
7
8
|
v-model="inputValue"
|
|
8
9
|
:readonly="true"
|
|
9
10
|
:disabled="input?.disabled"
|
|
@@ -19,11 +20,11 @@
|
|
|
19
20
|
:placeholderStyle="input?.placeholderStyle"
|
|
20
21
|
:placeholderClass="input?.placeholderClass"
|
|
21
22
|
:customStyle="Object.assign({ 'pointer-events': 'none' }, input?.customStyle)"
|
|
22
|
-
></
|
|
23
|
+
></hy-input>
|
|
23
24
|
<view class="input-cover"></view>
|
|
24
|
-
</
|
|
25
|
+
</template>
|
|
25
26
|
</view>
|
|
26
|
-
<
|
|
27
|
+
<hy-picker
|
|
27
28
|
ref="uPickerRef"
|
|
28
29
|
:show="show || (hasInput && showByClickInput)"
|
|
29
30
|
:popupMode="popupMode"
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
<!-- @slot 工具栏下面内容,自定义底部内容 -->
|
|
56
57
|
<slot name="toolbar-bottom"></slot>
|
|
57
58
|
</template>
|
|
58
|
-
</
|
|
59
|
+
</hy-picker>
|
|
59
60
|
</view>
|
|
60
61
|
</template>
|
|
61
62
|
|
|
@@ -1,87 +1,3 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
import type HyInputProps from '../hy-input/typing'
|
|
3
|
-
|
|
4
|
-
export default interface HyAddressPickerProps {
|
|
5
|
-
/**
|
|
6
|
-
* @description 用于控制选择器的弹出和收起 ( 默认 false )
|
|
7
|
-
* */
|
|
8
|
-
show?: boolean
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @description 弹出层弹出方向
|
|
12
|
-
* */
|
|
13
|
-
popupMode?: HyApp.LayoutType
|
|
14
|
-
/**
|
|
15
|
-
* @description 是否显示顶部的操作栏 ( 默认 true )
|
|
16
|
-
* */
|
|
17
|
-
showToolbar?: boolean
|
|
18
|
-
/**
|
|
19
|
-
* @description 绑定值
|
|
20
|
-
* */
|
|
21
|
-
modelValue: string
|
|
22
|
-
/**
|
|
23
|
-
* @description 顶部标题
|
|
24
|
-
* */
|
|
25
|
-
title?: string
|
|
26
|
-
/**
|
|
27
|
-
* @description 字符串截取数组条件
|
|
28
|
-
* */
|
|
29
|
-
separator?: string
|
|
30
|
-
/**
|
|
31
|
-
* @description 是否显示加载中状态 ( 默认 false )
|
|
32
|
-
* */
|
|
33
|
-
loading?: boolean
|
|
34
|
-
/**
|
|
35
|
-
* @description 各列中,单个选项的高度 ( 默认 44 )
|
|
36
|
-
* */
|
|
37
|
-
itemHeight?: number
|
|
38
|
-
/**
|
|
39
|
-
* @description 取消按钮的文字 ( 默认 '取消' )
|
|
40
|
-
* */
|
|
41
|
-
cancelText?: string
|
|
42
|
-
/**
|
|
43
|
-
* @description 确认按钮的文字 ( 默认 '确认' )
|
|
44
|
-
* */
|
|
45
|
-
confirmText?: string
|
|
46
|
-
/**
|
|
47
|
-
* @description 取消按钮的颜色 ( 默认 '#909193' )
|
|
48
|
-
* */
|
|
49
|
-
cancelColor?: string
|
|
50
|
-
/**
|
|
51
|
-
* @description 确认按钮的颜色 ( 默认 '#3c9cff' )
|
|
52
|
-
* */
|
|
53
|
-
confirmColor?: string
|
|
54
|
-
/**
|
|
55
|
-
* @description 每列中可见选项的数量 ( 默认 5 )
|
|
56
|
-
* */
|
|
57
|
-
visibleItemCount?: number
|
|
58
|
-
/**
|
|
59
|
-
* @description 是否允许点击遮罩关闭选择器 ( 默认 false )
|
|
60
|
-
* */
|
|
61
|
-
closeOnClickOverlay?: boolean
|
|
62
|
-
/**
|
|
63
|
-
* @description 各列的默认索引
|
|
64
|
-
* @note 类型有问题,需要调整
|
|
65
|
-
* */
|
|
66
|
-
defaultIndex?: Array<any>
|
|
67
|
-
/**
|
|
68
|
-
* @description 是否显示输入框 ( 默认 false )
|
|
69
|
-
* */
|
|
70
|
-
hasInput?: boolean
|
|
71
|
-
/**
|
|
72
|
-
* @description 输入框集合属性
|
|
73
|
-
* */
|
|
74
|
-
input?: Partial<HyInputProps>
|
|
75
|
-
/**
|
|
76
|
-
* @description 右边插槽
|
|
77
|
-
* */
|
|
78
|
-
toolbarRightSlot?: boolean
|
|
79
|
-
/**
|
|
80
|
-
* @description 自定义输入框外部样式
|
|
81
|
-
* */
|
|
82
|
-
customStyle?: CSSProperties
|
|
83
|
-
}
|
|
84
|
-
|
|
85
1
|
export type ConfirmParams = {
|
|
86
2
|
/** 选中值 */
|
|
87
3
|
value: string
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="hy-avatar" :class="avatarClass" :style="avatarStyle" @tap="clickHandler">
|
|
3
|
-
<slot>
|
|
3
|
+
<slot v-if="$slots.default"></slot>
|
|
4
|
+
<template v-else>
|
|
4
5
|
<!-- #ifdef MP-WEIXIN || MP-QQ || MP-BAIDU -->
|
|
5
6
|
<open-data
|
|
6
7
|
v-if="mpAvatar && allowMp"
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
<!-- #ifndef MP-WEIXIN && MP-QQ && MP-BAIDU -->
|
|
17
18
|
<template v-if="mpAvatar && allowMp"></template>
|
|
18
19
|
<!-- #endif -->
|
|
19
|
-
<
|
|
20
|
+
<hy-icon v-else-if="icon" :name="icon" :size="fontSize" :color="color"></hy-icon>
|
|
20
21
|
<text
|
|
21
22
|
v-else-if="text"
|
|
22
23
|
:style="{
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
:mode="mode"
|
|
37
38
|
@error="errorHandler"
|
|
38
39
|
></image>
|
|
39
|
-
</
|
|
40
|
+
</template>
|
|
40
41
|
</view>
|
|
41
42
|
</template>
|
|
42
43
|
|
|
@@ -1,69 +1,3 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyAvatarProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 头像路径,如加载失败,将会显示默认头像(不能为相对路径)
|
|
6
|
-
* */
|
|
7
|
-
src?: string
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @description 头像形状 ( circle (默认) | square)
|
|
11
|
-
* */
|
|
12
|
-
shape?: HyApp.ShapeType
|
|
13
|
-
/**
|
|
14
|
-
* @description 头像尺寸,可以为指定字符串(large, default, mini),或者数值 (默认 40 )
|
|
15
|
-
* */
|
|
16
|
-
size?: number | HyApp.SizeType
|
|
17
|
-
/**
|
|
18
|
-
* @description 头像图片的裁剪类型,与uni的image组件的mode参数一致,如效果达不到需求,可尝试传widthFix值 (默认 'scaleToFill' )
|
|
19
|
-
* */
|
|
20
|
-
mode?: string
|
|
21
|
-
/**
|
|
22
|
-
* @description 用文字替代图片,级别优先于src
|
|
23
|
-
* */
|
|
24
|
-
text?: string
|
|
25
|
-
/**
|
|
26
|
-
* @description 背景颜色,一般显示文字时用 (默认 '#c0c4cc' )
|
|
27
|
-
* */
|
|
28
|
-
bgColor?: string
|
|
29
|
-
/**
|
|
30
|
-
* @description 文字颜色 (默认 '#ffffff' )
|
|
31
|
-
* */
|
|
32
|
-
color?: string
|
|
33
|
-
/**
|
|
34
|
-
* @description 文字大小 (默认 18 )
|
|
35
|
-
* */
|
|
36
|
-
fontSize?: number | string
|
|
37
|
-
/**
|
|
38
|
-
* @description 显示的图标
|
|
39
|
-
* */
|
|
40
|
-
icon?: string
|
|
41
|
-
/**
|
|
42
|
-
* @description 显示小程序头像,只对百度,微信,QQ小程序有效 (默认 false )
|
|
43
|
-
* */
|
|
44
|
-
mpAvatar?: boolean
|
|
45
|
-
/**
|
|
46
|
-
* @description 是否使用随机背景色 (默认 false )
|
|
47
|
-
* */
|
|
48
|
-
randomBgColor?: boolean
|
|
49
|
-
/**
|
|
50
|
-
* @description 加载失败的默认头像(组件有内置默认图片)
|
|
51
|
-
* */
|
|
52
|
-
defaultUrl?: string
|
|
53
|
-
/**
|
|
54
|
-
* @description 如果配置了randomBgColor为true,且配置了此值,则从默认的背景色数组中取出对应索引的颜色值,取值0-19之间
|
|
55
|
-
* */
|
|
56
|
-
colorIndex?: number
|
|
57
|
-
/**
|
|
58
|
-
* @description 组件标识符 (默认 'level' )
|
|
59
|
-
* */
|
|
60
|
-
name?: string
|
|
61
|
-
/**
|
|
62
|
-
* @description 定义需要用到的外部样式
|
|
63
|
-
* */
|
|
64
|
-
customStyle?: CSSProperties
|
|
65
|
-
}
|
|
66
|
-
|
|
67
1
|
export interface IAvatarEmit {
|
|
68
2
|
/** 点击头像触发 */
|
|
69
3
|
(e: 'click', name: string, e: Event): void
|
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
import type HyIconProps from '../hy-icon/typing'
|
|
3
|
-
|
|
4
|
-
export default interface HyBackTopProps {
|
|
5
|
-
/**
|
|
6
|
-
* @description 返回顶部的形状,circle-圆形,square-方形 (默认 'circle' )
|
|
7
|
-
* */
|
|
8
|
-
mode?: HyApp.ShapeType
|
|
9
|
-
/**
|
|
10
|
-
* @description 自定义图标属性集合
|
|
11
|
-
* */
|
|
12
|
-
icon?: Partial<HyIconProps>
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description 提示文字
|
|
16
|
-
* */
|
|
17
|
-
text?: string
|
|
18
|
-
/**
|
|
19
|
-
* @description 返回顶部滚动时间 (默认 500)
|
|
20
|
-
* */
|
|
21
|
-
duration?: number
|
|
22
|
-
/**
|
|
23
|
-
* @description 滚动距离 (默认 0 )
|
|
24
|
-
* */
|
|
25
|
-
scrollTop: number
|
|
26
|
-
/**
|
|
27
|
-
* @description 距离顶部多少距离显示,单位px (默认 400 )
|
|
28
|
-
* */
|
|
29
|
-
top?: number | string
|
|
30
|
-
/**
|
|
31
|
-
* @description 返回顶部按钮到底部的距离,单位px (默认 100 )
|
|
32
|
-
* */
|
|
33
|
-
bottom?: number | string
|
|
34
|
-
/**
|
|
35
|
-
* @description 返回顶部按钮到右边的距离,单位px (默认 20 )
|
|
36
|
-
* */
|
|
37
|
-
right?: number | string
|
|
38
|
-
/**
|
|
39
|
-
* @description 层级 (默认 888 )
|
|
40
|
-
* */
|
|
41
|
-
zIndex?: number
|
|
42
|
-
/**
|
|
43
|
-
* @description 定义需要用到的外部样式(默认{transform: "rotate(180deg)"})
|
|
44
|
-
* */
|
|
45
|
-
customStyle?: CSSProperties
|
|
46
|
-
}
|
|
47
|
-
|
|
48
1
|
export interface IBackTopEmit {
|
|
49
2
|
/** 点击触发 */
|
|
50
3
|
(e: 'click'): void
|
|
@@ -47,9 +47,9 @@ const emit = defineEmits<IBadgeEmit>()
|
|
|
47
47
|
* @description 整个组件的样式
|
|
48
48
|
* */
|
|
49
49
|
const badgeStyle = computed<CSSProperties>(() => {
|
|
50
|
-
const style: CSSProperties = {
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const style: CSSProperties = {
|
|
51
|
+
zIndex: props.zIndex,
|
|
52
|
+
color: props.color
|
|
53
53
|
}
|
|
54
54
|
if (props.bgColor && !props.inverted) {
|
|
55
55
|
style.backgroundColor = props.bgColor
|
|
@@ -8,7 +8,7 @@ const badgeProps = {
|
|
|
8
8
|
},
|
|
9
9
|
/** 显示的内容 */
|
|
10
10
|
value: {
|
|
11
|
-
type: Number,
|
|
11
|
+
type: [String, Number],
|
|
12
12
|
default: 0
|
|
13
13
|
},
|
|
14
14
|
/** 是否显示 */
|
|
@@ -21,6 +21,11 @@ const badgeProps = {
|
|
|
21
21
|
type: Number,
|
|
22
22
|
default: 999
|
|
23
23
|
},
|
|
24
|
+
/** 层级 */
|
|
25
|
+
zIndex: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 999
|
|
28
|
+
},
|
|
24
29
|
/**
|
|
25
30
|
* 主题类型
|
|
26
31
|
* @values error,warning,success,primary,info
|
|
@@ -1,65 +1,3 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyBadgeProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 是否显示圆点 (默认 false )
|
|
6
|
-
* */
|
|
7
|
-
isDot?: boolean
|
|
8
|
-
/**
|
|
9
|
-
* @description 显示的内容
|
|
10
|
-
* */
|
|
11
|
-
value?: number
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @description 是否显示 (默认 true )
|
|
15
|
-
* */
|
|
16
|
-
show?: boolean
|
|
17
|
-
/**
|
|
18
|
-
* @description 最大值,超过最大值会显示 '{max}+' (默认999)
|
|
19
|
-
* */
|
|
20
|
-
max?: number
|
|
21
|
-
/**
|
|
22
|
-
* @description 主题类型,error|warning|success|primary|info (默认 'error' )
|
|
23
|
-
* */
|
|
24
|
-
type?: HyApp.ThemeType
|
|
25
|
-
/**
|
|
26
|
-
* @description 当数值为 0 时,是否展示 Badge (默认 false )
|
|
27
|
-
* */
|
|
28
|
-
showZero?: boolean
|
|
29
|
-
/**
|
|
30
|
-
* @description 背景颜色,优先级比type高,如设置,type参数会失效
|
|
31
|
-
* */
|
|
32
|
-
bgColor?: string | null
|
|
33
|
-
/**
|
|
34
|
-
* @description 字体颜色 (默认 '#ffffff' )
|
|
35
|
-
* */
|
|
36
|
-
color?: string | null
|
|
37
|
-
/**
|
|
38
|
-
* @description 徽标形状,circle-四角均为圆角,horn-左下角为直角 (默认 'circle' )
|
|
39
|
-
* */
|
|
40
|
-
shape?: 'circle' | 'horn'
|
|
41
|
-
/**
|
|
42
|
-
* @description 设置数字的显示方式,overflow|ellipsis|limit (默认 'overflow' )
|
|
43
|
-
* */
|
|
44
|
-
numberType?: 'overflow' | 'ellipsis' | 'limit'
|
|
45
|
-
/**
|
|
46
|
-
* @description 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效
|
|
47
|
-
* */
|
|
48
|
-
offset?: number[] | null
|
|
49
|
-
/**
|
|
50
|
-
* @description 是否反转背景和字体颜色(默认 false )
|
|
51
|
-
* */
|
|
52
|
-
inverted?: boolean
|
|
53
|
-
/**
|
|
54
|
-
* @description 是否绝对定位(默认 false )
|
|
55
|
-
* */
|
|
56
|
-
absolute?: boolean
|
|
57
|
-
/**
|
|
58
|
-
* @description 定义需要用到的外部样式
|
|
59
|
-
* */
|
|
60
|
-
customStyle?: CSSProperties
|
|
61
|
-
}
|
|
62
|
-
|
|
63
1
|
export interface IBadgeEmit {
|
|
64
2
|
/** 点击触发 */
|
|
65
3
|
(e: 'click', event: Event): void
|
|
@@ -1,164 +1,30 @@
|
|
|
1
|
-
import type { CSSProperties } from "vue";
|
|
2
|
-
import type HyIconProps from "../hy-icon/typing";
|
|
3
|
-
|
|
4
|
-
export interface HyButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* 是否显示按钮的细边框
|
|
7
|
-
* @default true
|
|
8
|
-
* @type {boolean}
|
|
9
|
-
* */
|
|
10
|
-
hairline?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 按钮的预置样式
|
|
13
|
-
* @type {ThemeType}
|
|
14
|
-
* @default 'primary'
|
|
15
|
-
* @values info, primary, error, warning, success
|
|
16
|
-
* */
|
|
17
|
-
type?: HyApp.ThemeType;
|
|
18
|
-
/**
|
|
19
|
-
* 按钮尺寸
|
|
20
|
-
* @type {'large' | 'medium' | 'small' | 'mini'}
|
|
21
|
-
* @default 'medium'
|
|
22
|
-
* */
|
|
23
|
-
size?: "large" | "medium" | "small" | "mini";
|
|
24
|
-
/**
|
|
25
|
-
* 按钮形状,circle(两边为半圆),square(带圆角) (默认 'square' )
|
|
26
|
-
* */
|
|
27
|
-
shape?: HyApp.ShapeType;
|
|
28
|
-
/**
|
|
29
|
-
* 按钮是否镂空,背景色透明 (默认 false)
|
|
30
|
-
* */
|
|
31
|
-
plain?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* 是否禁用 (默认 false)
|
|
34
|
-
* */
|
|
35
|
-
disabled?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* 按钮名称前是否带 loading 图标(App-nvue 平台,在 ios 上为雪花,Android上为圆圈) (默认 false)
|
|
38
|
-
* */
|
|
39
|
-
loading?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* 加载中提示文字
|
|
42
|
-
* */
|
|
43
|
-
loadingText?: string;
|
|
44
|
-
/**
|
|
45
|
-
* 加载状态图标类型 (默认 'spinner' )
|
|
46
|
-
* */
|
|
47
|
-
loadingMode?: HyApp.LoadingMode;
|
|
48
|
-
/**
|
|
49
|
-
* 加载图标大小 (默认 13 )
|
|
50
|
-
* */
|
|
51
|
-
loadingSize?: number;
|
|
52
|
-
/**
|
|
53
|
-
* 开放能力,具体请看uniapp稳定关于button组件部分说明
|
|
54
|
-
* */
|
|
55
|
-
openType?: string;
|
|
56
|
-
/**
|
|
57
|
-
* 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
|
|
58
|
-
* */
|
|
59
|
-
formType?: string;
|
|
60
|
-
/**
|
|
61
|
-
* 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 (注:只微信小程序、QQ小程序有效)
|
|
62
|
-
* */
|
|
63
|
-
appParameter?: string;
|
|
64
|
-
/**
|
|
65
|
-
* 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效(默认 true )
|
|
66
|
-
* */
|
|
67
|
-
hoverStopPropagation?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
70
|
-
* */
|
|
71
|
-
lang?: string;
|
|
72
|
-
/**
|
|
73
|
-
* 会话来源,openType="contact"时有效
|
|
74
|
-
* */
|
|
75
|
-
sessionFrom?: string;
|
|
76
|
-
/**
|
|
77
|
-
* 会话内消息卡片标题,openType="contact"时有效
|
|
78
|
-
* */
|
|
79
|
-
sendMessageTitle?: string;
|
|
80
|
-
/**
|
|
81
|
-
* 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
|
|
82
|
-
* */
|
|
83
|
-
sendMessagePath?: string;
|
|
84
|
-
/**
|
|
85
|
-
* 会话内消息卡片图片,openType="contact"时有效
|
|
86
|
-
* */
|
|
87
|
-
sendMessageImg?: string;
|
|
88
|
-
/**
|
|
89
|
-
* 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效(默认false)
|
|
90
|
-
* */
|
|
91
|
-
showMessageCard?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
|
|
94
|
-
* */
|
|
95
|
-
dataName?: string;
|
|
96
|
-
/**
|
|
97
|
-
* 节流时间,一定时间内只能触发一次 (默认 0 )
|
|
98
|
-
* */
|
|
99
|
-
throttleTime?: number;
|
|
100
|
-
/**
|
|
101
|
-
* 按住后多久出现点击态,单位毫秒 (默认 0 )
|
|
102
|
-
* */
|
|
103
|
-
hoverStartTime?: number;
|
|
104
|
-
/**
|
|
105
|
-
* 手指松开后点击态保留时间,单位毫秒 (默认 200 )
|
|
106
|
-
* */
|
|
107
|
-
hoverStayTime?: number;
|
|
108
|
-
/**
|
|
109
|
-
* 按钮文字,之所以通过props传入,是因为slot传入的话(注:nvue中无法控制文字的样式)
|
|
110
|
-
* */
|
|
111
|
-
text?: string;
|
|
112
|
-
/**
|
|
113
|
-
* 按钮图标api集合
|
|
114
|
-
* */
|
|
115
|
-
icon?: Partial<HyIconProps>;
|
|
116
|
-
/**
|
|
117
|
-
* 按钮颜色,支持传入linear-gradient渐变色
|
|
118
|
-
* */
|
|
119
|
-
color?: string;
|
|
120
|
-
/**
|
|
121
|
-
* 阻止事件冒泡
|
|
122
|
-
* */
|
|
123
|
-
stop?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* 定义需要用到的外部样式
|
|
126
|
-
* @note 类型问题
|
|
127
|
-
* */
|
|
128
|
-
customStyle?: CSSProperties;
|
|
129
|
-
/**
|
|
130
|
-
* 自定义外部类名
|
|
131
|
-
* */
|
|
132
|
-
customClass?: string;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
1
|
export interface IButtonEmits {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
2
|
+
/**
|
|
3
|
+
* 点击按钮事件
|
|
4
|
+
* */
|
|
5
|
+
(e: 'click', event: Event): void
|
|
6
|
+
/**
|
|
7
|
+
* 仅限微信小程序,当使用开放能力时,发生错误的回调
|
|
8
|
+
* */
|
|
9
|
+
(e: 'error', event: Event): void
|
|
10
|
+
/**
|
|
11
|
+
* 微信小程序获取手机号
|
|
12
|
+
* */
|
|
13
|
+
(e: 'getphonenumber', event: Event): void
|
|
14
|
+
/**
|
|
15
|
+
* 微信小程序用户点击该按钮时,会返回获取到的用户信息,从返回参数的detail中获取到的值同uni.getUserInfo
|
|
16
|
+
* */
|
|
17
|
+
(e: 'getuserinfo', event: Event): void
|
|
18
|
+
/**
|
|
19
|
+
* 仅限微信小程序,在打开授权设置页并关闭后回调
|
|
20
|
+
* */
|
|
21
|
+
(e: 'opensetting', event: Event): void
|
|
22
|
+
/**
|
|
23
|
+
* 仅限微信小程序,打开 APP 成功的回调
|
|
24
|
+
* */
|
|
25
|
+
(e: 'launchapp', event: Event): void
|
|
26
|
+
/**
|
|
27
|
+
* 仅限微信小程序,用户同意隐私协议事件回调,open-type="agreePrivacyAuthorization"时有效
|
|
28
|
+
* */
|
|
29
|
+
(e: 'agreeprivacyauthorization', event: Event): void
|
|
164
30
|
}
|