im-ui-mobile 0.1.0 → 0.1.2
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/im-avatar/im-avatar.vue +7 -7
- package/components/im-badge/im-badge.vue +326 -0
- package/components/im-button/im-button.vue +71 -34
- package/components/im-card/im-card.vue +563 -0
- package/components/im-chat-item/im-chat-item.vue +5 -4
- package/components/im-col/im-col.vue +191 -0
- package/components/im-dialog/im-dialog.vue +543 -0
- package/components/im-double-tap-view/im-double-tap-view.vue +93 -0
- package/components/im-emoji-picker/im-emoji-picker.vue +1143 -0
- package/components/im-friend-item/im-friend-item.vue +1 -1
- package/components/im-group-item/im-group-item.vue +1 -1
- package/components/im-group-member-selector/im-group-member-selector.vue +5 -5
- package/components/im-group-rtc-join/im-group-rtc-join.vue +8 -8
- package/components/im-icon/im-icon.vue +593 -0
- package/components/im-image-upload/im-image-upload.vue +0 -2
- package/components/im-link/im-link.vue +628 -0
- package/components/im-loading/im-loading.vue +13 -4
- package/components/im-mention-picker/im-mention-picker.vue +8 -7
- package/components/im-message-action/im-message-action.vue +678 -0
- package/components/im-message-item/im-message-item.vue +28 -26
- package/components/im-message-list/im-message-list.vue +1108 -0
- package/components/im-modal/im-modal.vue +373 -0
- package/components/im-nav-bar/im-nav-bar.vue +689 -75
- package/components/im-parse/im-parse.vue +1054 -0
- package/components/im-popup/im-popup.vue +467 -0
- package/components/im-read-receipt/im-read-receipt.vue +10 -10
- package/components/im-row/im-row.vue +189 -0
- package/components/im-search/im-search.vue +762 -0
- package/components/im-sku/im-sku.vue +720 -0
- package/components/im-sku/utils/helper.ts +182 -0
- package/components/im-stepper/im-stepper.vue +585 -0
- package/components/im-stepper/utils/helper.ts +167 -0
- package/components/im-tabs/im-tabs.vue +1022 -0
- package/components/im-tabs/tabs-navigation.vue +489 -0
- package/components/im-tabs/utils/helper.ts +181 -0
- package/components/im-tabs-tab-pane/im-tabs-tab-pane.vue +145 -0
- package/components/im-upload/im-upload.vue +1236 -0
- package/components/im-voice-input/im-voice-input.vue +1 -1
- package/index.js +3 -5
- package/index.scss +19 -0
- package/libs/emoji-data.ts +229 -0
- package/libs/index.ts +16 -16
- package/package.json +1 -2
- package/styles/button.scss +33 -33
- package/theme.scss +2 -2
- package/types/components/badge.d.ts +42 -0
- package/types/components/button.d.ts +2 -1
- package/types/components/card.d.ts +122 -0
- package/types/components/col.d.ts +37 -0
- package/types/components/dialog.d.ts +125 -0
- package/types/components/double-tap-view.d.ts +31 -0
- package/types/components/emoji-picker.d.ts +121 -0
- package/types/components/group-rtc-join.d.ts +1 -1
- package/types/components/icon.d.ts +77 -0
- package/types/components/link.d.ts +55 -0
- package/types/components/loading.d.ts +1 -0
- package/types/components/message-action.d.ts +96 -0
- package/types/components/message-item.d.ts +2 -2
- package/types/components/message-list.d.ts +136 -0
- package/types/components/modal.d.ts +106 -0
- package/types/components/nav-bar.d.ts +125 -0
- package/types/components/parse.d.ts +90 -0
- package/types/components/popup.d.ts +58 -0
- package/types/components/row.d.ts +31 -0
- package/types/components/search.d.ts +54 -0
- package/types/components/sku.d.ts +195 -0
- package/types/components/stepper.d.ts +99 -0
- package/types/components/tabs-tab-pane.d.ts +27 -0
- package/types/components/tabs.d.ts +117 -0
- package/types/components/upload.d.ts +137 -0
- package/types/components.d.ts +19 -1
- package/types/index.d.ts +38 -1
- package/types/libs/index.d.ts +10 -10
- package/types/utils/base64.d.ts +5 -0
- package/types/utils/dom.d.ts +3 -0
- package/types/utils/enums.d.ts +4 -5
- package/types/utils/validator.d.ts +74 -0
- package/utils/base64.js +18 -0
- package/utils/dom.js +353 -1
- package/utils/enums.js +4 -5
- package/utils/validator.js +230 -0
- package/components/im-file-upload/im-file-upload.vue +0 -309
- package/plugins/uview-plus.js +0 -29
- package/types/components/arrow-bar.d.ts +0 -14
- package/types/components/file-upload.d.ts +0 -58
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { AllowedComponentProps, VNodeProps } from '../common'
|
|
2
|
+
|
|
3
|
+
export interface _SkuAttr {
|
|
4
|
+
/** 属性名称 */
|
|
5
|
+
name: string;
|
|
6
|
+
/** 属性值列表 */
|
|
7
|
+
values: AttrValue[];
|
|
8
|
+
/** 属性ID */
|
|
9
|
+
id?: string | number;
|
|
10
|
+
/** 是否必选 */
|
|
11
|
+
required?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface _SkuAttrValue {
|
|
15
|
+
/** 属性值名称 */
|
|
16
|
+
name: string;
|
|
17
|
+
/** 属性值ID */
|
|
18
|
+
id?: string | number;
|
|
19
|
+
/** 是否禁用 */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** 自定义样式 */
|
|
22
|
+
style?: Record<string, any>;
|
|
23
|
+
/** 图片URL(用于显示图片规格) */
|
|
24
|
+
imgUrl?: string;
|
|
25
|
+
/** 预览图片URL */
|
|
26
|
+
previewImgUrl?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface _SkuSpec {
|
|
30
|
+
/** 规格名称 */
|
|
31
|
+
name: string;
|
|
32
|
+
/** 规格值列表 */
|
|
33
|
+
values: SkuValue[];
|
|
34
|
+
/** 规格ID */
|
|
35
|
+
id?: string | number;
|
|
36
|
+
/** 是否必选 */
|
|
37
|
+
required?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface _SkuValue {
|
|
41
|
+
/** 规格值名称 */
|
|
42
|
+
name: string;
|
|
43
|
+
/** 规格值ID */
|
|
44
|
+
id?: string | number;
|
|
45
|
+
/** 是否禁用 */
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/** 自定义样式 */
|
|
48
|
+
style?: Record<string, any>;
|
|
49
|
+
/** 图片URL(用于显示图片规格) */
|
|
50
|
+
imgUrl?: string;
|
|
51
|
+
/** 预览图片URL */
|
|
52
|
+
previewImgUrl?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface _SkuItem {
|
|
56
|
+
/** SKU ID */
|
|
57
|
+
id: string | number;
|
|
58
|
+
/** 商品ID */
|
|
59
|
+
goodsId?: string | number;
|
|
60
|
+
/** 规格组合,如:{颜色: '红色', 尺寸: 'L'} */
|
|
61
|
+
specs: Record<string, string>;
|
|
62
|
+
/** 价格(分) */
|
|
63
|
+
price: number;
|
|
64
|
+
/** 原价(分) */
|
|
65
|
+
originPrice?: number;
|
|
66
|
+
/** 库存 */
|
|
67
|
+
stock: number;
|
|
68
|
+
/** 商品图片 */
|
|
69
|
+
imgUrl?: string;
|
|
70
|
+
/** 商品名称 */
|
|
71
|
+
name?: string;
|
|
72
|
+
/** 商品编码 */
|
|
73
|
+
code?: string;
|
|
74
|
+
/** 是否禁用 */
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface _SkuGoodsInfo {
|
|
79
|
+
/** 商品ID */
|
|
80
|
+
id: string | number;
|
|
81
|
+
/** 商品标题 */
|
|
82
|
+
title: string;
|
|
83
|
+
/** 商品副标题 */
|
|
84
|
+
subtitle?: string;
|
|
85
|
+
/** 商品图片 */
|
|
86
|
+
imgUrl: string;
|
|
87
|
+
/** 商品图片列表 */
|
|
88
|
+
imgUrls?: string[];
|
|
89
|
+
/** 商品描述 */
|
|
90
|
+
description?: string;
|
|
91
|
+
/** 默认价格(分) */
|
|
92
|
+
price: number;
|
|
93
|
+
/** 原价(分) */
|
|
94
|
+
originPrice?: number;
|
|
95
|
+
/** 库存 */
|
|
96
|
+
stock?: number;
|
|
97
|
+
/** 商品编码 */
|
|
98
|
+
code?: string;
|
|
99
|
+
/** 商品单位 */
|
|
100
|
+
unit?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface _SelectedSku {
|
|
104
|
+
/** 选中的属性组合 */
|
|
105
|
+
selectedAttrs: Record<string, string>;
|
|
106
|
+
/** 选中的规格组合 */
|
|
107
|
+
selectedSpecs: Record<string, string>;
|
|
108
|
+
/** 选中的SKU ID */
|
|
109
|
+
skuId?: string | number;
|
|
110
|
+
/** 数量 */
|
|
111
|
+
quantity: number;
|
|
112
|
+
/** 价格(分) */
|
|
113
|
+
price: number;
|
|
114
|
+
/** 原价(分) */
|
|
115
|
+
originPrice?: number;
|
|
116
|
+
/** 库存 */
|
|
117
|
+
stock: number;
|
|
118
|
+
/** 是否有效 */
|
|
119
|
+
valid: boolean;
|
|
120
|
+
/** 商品信息 */
|
|
121
|
+
goodsInfo?: SkuGoodsInfo;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare interface _SkuProps {
|
|
125
|
+
/** 是否显示SKU选择器 */
|
|
126
|
+
visible: boolean;
|
|
127
|
+
/** 商品信息 */
|
|
128
|
+
goods: SkuGoodsInfo;
|
|
129
|
+
/** 属性列表 */
|
|
130
|
+
attrs: SkuAttr[];
|
|
131
|
+
/** 规格列表 */
|
|
132
|
+
specs: SkuSpec[];
|
|
133
|
+
/** SKU列表 */
|
|
134
|
+
skus: SkuItem[];
|
|
135
|
+
/** 初始选中的规格 */
|
|
136
|
+
initialSku?: SelectedSku;
|
|
137
|
+
/** 购买数量限制 */
|
|
138
|
+
quantityLimit?: {
|
|
139
|
+
min?: number;
|
|
140
|
+
max?: number;
|
|
141
|
+
step?: number;
|
|
142
|
+
};
|
|
143
|
+
/** 自定义操作按钮 */
|
|
144
|
+
customActions?: Array<{
|
|
145
|
+
text: string;
|
|
146
|
+
type?: 'primary' | 'default' | 'warning' | 'danger';
|
|
147
|
+
style?: Record<string, any>;
|
|
148
|
+
onClick?: () => void;
|
|
149
|
+
}>;
|
|
150
|
+
/** 是否显示快速购买按钮 */
|
|
151
|
+
showQuickBuy?: boolean;
|
|
152
|
+
/** 是否显示加入购物车按钮 */
|
|
153
|
+
showAddToCart?: boolean;
|
|
154
|
+
/** 是否显示库存 */
|
|
155
|
+
showStock?: boolean;
|
|
156
|
+
/** 是否显示价格 */
|
|
157
|
+
showPrice?: boolean;
|
|
158
|
+
/** 是否禁用 */
|
|
159
|
+
disabled?: boolean;
|
|
160
|
+
/** 关闭时是否重置 */
|
|
161
|
+
resetOnClose?: boolean;
|
|
162
|
+
/** 自定义样式类名 */
|
|
163
|
+
customClass?: string;
|
|
164
|
+
showClose?: boolean
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare interface _SkuEmits {
|
|
168
|
+
(e: 'update:visible', visible: boolean): void;
|
|
169
|
+
(e: 'confirm', data: SelectedSku): void;
|
|
170
|
+
(e: 'add-to-cart', data: SelectedSku): void;
|
|
171
|
+
(e: 'buy-now', data: SelectedSku): void;
|
|
172
|
+
(e: 'spec-change', data: SelectedSku): void;
|
|
173
|
+
(e: 'quantity-change', quantity: number): void;
|
|
174
|
+
(e: 'close'): void;
|
|
175
|
+
(e: 'custom-action', index: number): void;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare interface _Sku {
|
|
179
|
+
new(): {
|
|
180
|
+
$props: AllowedComponentProps & VNodeProps & _SkuProps
|
|
181
|
+
$emit: _SkuEmits
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export declare const Sku: _Sku
|
|
186
|
+
export declare type SkuProps = _SkuProps
|
|
187
|
+
export declare type SkuEmits = _SkuEmits
|
|
188
|
+
export declare type SkuAttr = _SkuAttr
|
|
189
|
+
export declare type SkuAttrValue = _SkuAttrValue
|
|
190
|
+
export declare type SkuSpec = _SkuSpec
|
|
191
|
+
export declare type SkuValue = _SkuValue
|
|
192
|
+
export declare type SkuItem = _SkuItem
|
|
193
|
+
export declare type SkuGoodsInfo = _SkuGoodsInfo
|
|
194
|
+
export declare type SelectedSku = _SelectedSku
|
|
195
|
+
export declare type SkuCurrent = _SkuCurrent
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { AllowedComponentProps, VNodeProps } from '../common'
|
|
2
|
+
|
|
3
|
+
declare interface _StepperProps {
|
|
4
|
+
/** 当前值 */
|
|
5
|
+
modelValue?: number;
|
|
6
|
+
/** 默认值 */
|
|
7
|
+
defaultValue?: number;
|
|
8
|
+
/** 最小值 */
|
|
9
|
+
min?: number;
|
|
10
|
+
/** 最大值 */
|
|
11
|
+
max?: number;
|
|
12
|
+
/** 步进值 */
|
|
13
|
+
step?: number;
|
|
14
|
+
/** 输入框宽度(单位px) */
|
|
15
|
+
inputWidth?: number | string;
|
|
16
|
+
/** 按钮大小(单位px) */
|
|
17
|
+
buttonSize?: number | string;
|
|
18
|
+
/** 是否禁用 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** 是否禁用输入框 */
|
|
21
|
+
disableInput?: boolean;
|
|
22
|
+
/** 是否禁用减按钮 */
|
|
23
|
+
disableMinus?: boolean;
|
|
24
|
+
/** 是否禁用加按钮 */
|
|
25
|
+
disablePlus?: boolean;
|
|
26
|
+
/** 是否显示限制按钮(达到边界时禁用) */
|
|
27
|
+
showLimit?: boolean;
|
|
28
|
+
/** 是否显示输入框 */
|
|
29
|
+
showInput?: boolean;
|
|
30
|
+
/** 是否显示加号减号按钮 */
|
|
31
|
+
showPlus?: boolean;
|
|
32
|
+
/** 是否显示减号按钮 */
|
|
33
|
+
showMinus?: boolean;
|
|
34
|
+
/** 是否允许长按 */
|
|
35
|
+
longPress?: boolean;
|
|
36
|
+
/** 长按间隔时间(毫秒) */
|
|
37
|
+
longPressInterval?: number;
|
|
38
|
+
/** 是否自动聚焦 */
|
|
39
|
+
autofocus?: boolean;
|
|
40
|
+
/** 输入框占位符 */
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/** 是否只能输入整数 */
|
|
43
|
+
integer?: boolean;
|
|
44
|
+
/** 自定义减按钮图标 */
|
|
45
|
+
minusIcon?: string;
|
|
46
|
+
/** 自定义加按钮图标 */
|
|
47
|
+
plusIcon?: string;
|
|
48
|
+
/** 自定义减按钮文字 */
|
|
49
|
+
minusText?: string;
|
|
50
|
+
/** 自定义加按钮文字 */
|
|
51
|
+
plusText?: string;
|
|
52
|
+
/** 自定义样式类名 */
|
|
53
|
+
customClass?: string;
|
|
54
|
+
/** 自定义减按钮类名 */
|
|
55
|
+
minusClass?: string;
|
|
56
|
+
/** 自定义加按钮类名 */
|
|
57
|
+
plusClass?: string;
|
|
58
|
+
/** 自定义输入框类名 */
|
|
59
|
+
inputClass?: string;
|
|
60
|
+
/** 主题样式 */
|
|
61
|
+
theme?: 'default' | 'round' | 'square';
|
|
62
|
+
/** 按钮形状 */
|
|
63
|
+
shape?: 'circle' | 'square';
|
|
64
|
+
/** 按钮背景色 */
|
|
65
|
+
buttonColor?: string;
|
|
66
|
+
/** 按钮激活背景色 */
|
|
67
|
+
buttonActiveColor?: string;
|
|
68
|
+
/** 按钮文字颜色 */
|
|
69
|
+
buttonTextColor?: string;
|
|
70
|
+
/** 输入框背景色 */
|
|
71
|
+
inputBgColor?: string;
|
|
72
|
+
/** 输入框文字颜色 */
|
|
73
|
+
inputTextColor?: string;
|
|
74
|
+
/** 禁用状态颜色 */
|
|
75
|
+
disabledColor?: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface _StepperEmits {
|
|
79
|
+
(e: 'update:modelValue', value: number): void;
|
|
80
|
+
(e: 'change', value: number): void;
|
|
81
|
+
(e: 'overlimit', type: 'minus' | 'plus'): void;
|
|
82
|
+
(e: 'minus', value: number): void;
|
|
83
|
+
(e: 'plus', value: number): void;
|
|
84
|
+
(e: 'blur', value: number): void;
|
|
85
|
+
(e: 'focus', value: number): void;
|
|
86
|
+
(e: 'input', value: number): void;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
declare interface _Stepper {
|
|
91
|
+
new(): {
|
|
92
|
+
$props: AllowedComponentProps & VNodeProps & _StepperProps
|
|
93
|
+
$emit: _StepperEmits
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export declare const Stepper: _Stepper
|
|
98
|
+
export declare type StepperProps = _StepperProps
|
|
99
|
+
export declare type StepperEmits = _StepperEmits
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AllowedComponentProps, VNodeProps } from '../common'
|
|
2
|
+
|
|
3
|
+
declare interface _TabsTabPaneProps {
|
|
4
|
+
/** 标签索引 */
|
|
5
|
+
index?: number;
|
|
6
|
+
/** 标签标识符 */
|
|
7
|
+
id?: string | number;
|
|
8
|
+
/** 是否延迟渲染 */
|
|
9
|
+
lazy?: boolean;
|
|
10
|
+
/** 是否激活 */
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/** 是否销毁 */
|
|
13
|
+
destroyOnInactive?: boolean;
|
|
14
|
+
/** 自定义CSS类 */
|
|
15
|
+
customClass?:string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
declare interface _TabsTabPane {
|
|
20
|
+
new(): {
|
|
21
|
+
$props: AllowedComponentProps & VNodeProps & _TabsTabPaneProps
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export declare const TabsTabPane: _TabsTabPane
|
|
27
|
+
export declare const TabsTabPaneProps: _TabsTabPaneProps
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { AllowedComponentProps, VNodeProps } from '../common'
|
|
2
|
+
|
|
3
|
+
declare interface _TabItem {
|
|
4
|
+
/** 标签名称 */
|
|
5
|
+
title: string;
|
|
6
|
+
/** 标签标识符 */
|
|
7
|
+
id?: string | number;
|
|
8
|
+
/** 是否禁用 */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** 徽标数字 */
|
|
11
|
+
badge?: number;
|
|
12
|
+
/** 徽标文字 */
|
|
13
|
+
badgeText?: string;
|
|
14
|
+
/** 徽标类型 */
|
|
15
|
+
badgeType?: 'dot' | 'number' | 'text';
|
|
16
|
+
/** 自定义图标 */
|
|
17
|
+
icon?: string;
|
|
18
|
+
/** 选中时的图标 */
|
|
19
|
+
activeIcon?: string;
|
|
20
|
+
/** 是否显示红点 */
|
|
21
|
+
showRedDot?: boolean;
|
|
22
|
+
/** 自定义样式 */
|
|
23
|
+
style?: Record<string, any>;
|
|
24
|
+
/** 自定义类名 */
|
|
25
|
+
class?: string;
|
|
26
|
+
/** 自定义渲染函数 */
|
|
27
|
+
renderTitle?: (tab: TabItem, isActive: boolean) => any;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare interface _TabsProps {
|
|
31
|
+
/** 当前激活的标签索引 */
|
|
32
|
+
modelValue?: number;
|
|
33
|
+
/** 当前激活的标签标识符 */
|
|
34
|
+
activeKey?: string | number;
|
|
35
|
+
/** 标签列表 */
|
|
36
|
+
items: TabItem[];
|
|
37
|
+
/** 标签栏位置 */
|
|
38
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
39
|
+
/** 标签栏样式 */
|
|
40
|
+
type?: 'line' | 'card' | 'button' | 'segment';
|
|
41
|
+
/** 是否可滑动切换 */
|
|
42
|
+
swipeable?: boolean;
|
|
43
|
+
/** 是否显示底部滑动条 */
|
|
44
|
+
showSlider?: boolean;
|
|
45
|
+
/** 滑动条宽度(单位px或%) */
|
|
46
|
+
sliderWidth?: string | number;
|
|
47
|
+
/** 滑动条高度(单位px) */
|
|
48
|
+
sliderHeight?: number;
|
|
49
|
+
/** 滑动条颜色 */
|
|
50
|
+
sliderColor?: string;
|
|
51
|
+
/** 是否显示底部边框 */
|
|
52
|
+
border?: boolean;
|
|
53
|
+
/** 标签栏背景色 */
|
|
54
|
+
background?: string;
|
|
55
|
+
/** 标签栏高度(单位px) */
|
|
56
|
+
height?: number;
|
|
57
|
+
/** 标签最小宽度(单位px) */
|
|
58
|
+
minTabWidth?: number;
|
|
59
|
+
/** 标签最大宽度(单位px) */
|
|
60
|
+
maxTabWidth?: number;
|
|
61
|
+
/** 是否开启粘性布局 */
|
|
62
|
+
sticky?: boolean;
|
|
63
|
+
/** 粘性布局吸顶距离(单位px) */
|
|
64
|
+
stickyOffsetTop?: number;
|
|
65
|
+
/** 是否开启滚动导航 */
|
|
66
|
+
scrollable?: boolean;
|
|
67
|
+
/** 标签栏是否居中 */
|
|
68
|
+
centered?: boolean;
|
|
69
|
+
/** 是否在切换标签时保留状态 */
|
|
70
|
+
keepAlive?: boolean;
|
|
71
|
+
/** 是否开启懒加载 */
|
|
72
|
+
lazy?: boolean;
|
|
73
|
+
/** 切换动画持续时间(毫秒) */
|
|
74
|
+
duration?: number;
|
|
75
|
+
/** 是否在初始化时滚动到激活标签 */
|
|
76
|
+
scrollOnInit?: boolean;
|
|
77
|
+
/** 点击标签前回调,返回 false 可阻止切换 */
|
|
78
|
+
beforeChange?: (index: number, tab: TabItem) => boolean | Promise<boolean>;
|
|
79
|
+
/** 自定义类名 */
|
|
80
|
+
customClass?: string;
|
|
81
|
+
/** 自定义标签栏类名 */
|
|
82
|
+
navClass?: string;
|
|
83
|
+
/** 自定义内容类名 */
|
|
84
|
+
contentClass?: string;
|
|
85
|
+
/** 标签间距(单位px) */
|
|
86
|
+
gutter?: number;
|
|
87
|
+
/** 是否显示标签图标 */
|
|
88
|
+
showIcon?: boolean;
|
|
89
|
+
/** 图标位置 */
|
|
90
|
+
iconPosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
91
|
+
/** 动画类型 */
|
|
92
|
+
animation?: 'slide' | 'fade' | 'none';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare interface _TabsEmits {
|
|
96
|
+
(e: 'update:modelValue', index: number): void;
|
|
97
|
+
(e: 'update:activeKey', id: string | number): void;
|
|
98
|
+
(e: 'change', index: number, tab: TabItem): void;
|
|
99
|
+
(e: 'click', index: number, tab: TabItem): void;
|
|
100
|
+
(e: 'disabled', index: number, tab: TabItem): void;
|
|
101
|
+
(e: 'scroll', event: any): void;
|
|
102
|
+
(e: 'sticky', isSticky: boolean): void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare interface _Tabs {
|
|
106
|
+
new(): {
|
|
107
|
+
$props: AllowedComponentProps & VNodeProps & _TabsProps
|
|
108
|
+
$emit: _TabsEmits
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
export declare const Tabs: _Tabs
|
|
114
|
+
export declare type TabItem = _TabItem
|
|
115
|
+
export declare type TabsProps = _TabsProps
|
|
116
|
+
export declare type TabsEmits = _TabsEmits
|
|
117
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { AllowedComponentProps, VNodeProps } from '../common'
|
|
2
|
+
|
|
3
|
+
// 上传文件状态
|
|
4
|
+
type UploadFileStatus = 'pending' | 'uploading' | 'done' | 'error'
|
|
5
|
+
|
|
6
|
+
// 上传文件接口
|
|
7
|
+
declare interface UploadFile {
|
|
8
|
+
uid: string
|
|
9
|
+
name: string
|
|
10
|
+
size: number
|
|
11
|
+
type?: string
|
|
12
|
+
url?: string
|
|
13
|
+
thumbUrl?: string
|
|
14
|
+
status: UploadFileStatus
|
|
15
|
+
progress?: number
|
|
16
|
+
response?: any
|
|
17
|
+
error?: Error
|
|
18
|
+
rawFile?: any
|
|
19
|
+
file?: File
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 上传组件 Props
|
|
23
|
+
declare interface UploadProps {
|
|
24
|
+
// 值
|
|
25
|
+
modelValue?: UploadFile[]
|
|
26
|
+
|
|
27
|
+
// 上传类型
|
|
28
|
+
type?: 'button' | 'card' | 'avatar' | 'drag'
|
|
29
|
+
|
|
30
|
+
// 按钮配置
|
|
31
|
+
buttonText?: string
|
|
32
|
+
buttonType?: 'primary' | 'default' | 'warning' | 'error'
|
|
33
|
+
buttonSize?: 'small' | 'medium' | 'large'
|
|
34
|
+
|
|
35
|
+
// 卡片配置
|
|
36
|
+
cardText?: string
|
|
37
|
+
|
|
38
|
+
// 头像配置
|
|
39
|
+
avatarText?: string
|
|
40
|
+
avatarSize?: number | string
|
|
41
|
+
avatarRadius?: string
|
|
42
|
+
|
|
43
|
+
// 拖拽配置
|
|
44
|
+
dragText?: string
|
|
45
|
+
|
|
46
|
+
// 通用配置
|
|
47
|
+
hint?: string
|
|
48
|
+
tip?: string
|
|
49
|
+
showTip?: boolean
|
|
50
|
+
showActions?: boolean
|
|
51
|
+
showUploadAll?: boolean
|
|
52
|
+
showClear?: boolean
|
|
53
|
+
|
|
54
|
+
// 文件配置
|
|
55
|
+
accept?: string
|
|
56
|
+
multiple?: boolean
|
|
57
|
+
maxCount?: number
|
|
58
|
+
maxSize?: number
|
|
59
|
+
|
|
60
|
+
// 上传配置
|
|
61
|
+
action?: string
|
|
62
|
+
headers?: Record<string, string>
|
|
63
|
+
data?: Record<string, any>
|
|
64
|
+
name?: string
|
|
65
|
+
withCredentials?: boolean
|
|
66
|
+
timeout?: number
|
|
67
|
+
autoUpload?: boolean
|
|
68
|
+
beforeUpload?: (file: File) => boolean | Promise<boolean> // // 上传前钩子
|
|
69
|
+
|
|
70
|
+
// 响应格式化
|
|
71
|
+
responseFormatter?: (response: any) => { url: string;[key: string]: any }
|
|
72
|
+
|
|
73
|
+
// 列表配置
|
|
74
|
+
showList?: boolean
|
|
75
|
+
listType?: 'text' | 'picture'
|
|
76
|
+
removable?: boolean
|
|
77
|
+
previewable?: boolean
|
|
78
|
+
|
|
79
|
+
// 状态
|
|
80
|
+
disabled?: boolean
|
|
81
|
+
readonly?: boolean
|
|
82
|
+
|
|
83
|
+
// 自定义上传
|
|
84
|
+
customRequest?: (file: File, onProgress: (percent: number) => void) => Promise<any>
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// 上传组件方法
|
|
88
|
+
declare interface UploadMethods {
|
|
89
|
+
// 手动上传文件
|
|
90
|
+
upload: (file: File) => Promise<void>
|
|
91
|
+
|
|
92
|
+
// 清空文件列表
|
|
93
|
+
clearFiles: () => void
|
|
94
|
+
|
|
95
|
+
// 取消指定上传
|
|
96
|
+
abortUpload: (uid: string) => void
|
|
97
|
+
|
|
98
|
+
// 上传所有文件
|
|
99
|
+
uploadAll: () => Promise<void>
|
|
100
|
+
|
|
101
|
+
// 获取文件列表
|
|
102
|
+
getFiles: () => UploadFile[]
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare interface _Upload {
|
|
106
|
+
new(): {
|
|
107
|
+
$props: AllowedComponentProps & VNodeProps & UploadProps
|
|
108
|
+
|
|
109
|
+
$emit: {
|
|
110
|
+
'update:modelValue': (files: UploadFile[]) => void
|
|
111
|
+
'change': (files: UploadFile[]) => void
|
|
112
|
+
'select': (file: File) => void
|
|
113
|
+
'upload': (file: UploadFile) => void
|
|
114
|
+
'success': (response: any, file: UploadFile) => void
|
|
115
|
+
'error': (error: Error, file: UploadFile) => void
|
|
116
|
+
'progress': (percent: number, file: UploadFile) => void
|
|
117
|
+
'remove': (file: UploadFile, index: number) => void
|
|
118
|
+
'preview': (file: UploadFile) => void
|
|
119
|
+
'exceed': (files: File[]) => void
|
|
120
|
+
'before-upload': (file: UploadFile) => void
|
|
121
|
+
'after-upload': (file: UploadFile) => void
|
|
122
|
+
}
|
|
123
|
+
} & UploadMethods
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare const Upload: _Upload
|
|
127
|
+
|
|
128
|
+
// 导出类型
|
|
129
|
+
export type {
|
|
130
|
+
UploadFile,
|
|
131
|
+
UploadFileStatus,
|
|
132
|
+
UploadProps,
|
|
133
|
+
UploadMethods
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 默认导出
|
|
137
|
+
export default Upload
|
package/types/components.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ declare module 'vue' {
|
|
|
3
3
|
['im-cell']: typeof import('./components/cell')['Cell']
|
|
4
4
|
['im-cell-group']: typeof import('./components/cell-group')['CellGroup']
|
|
5
5
|
['im-button']: typeof import('./components/button')['Button']
|
|
6
|
+
['im-badge']: typeof import('./components/badge')['Badge']
|
|
6
7
|
['im-mention-picker']: typeof import('./components/mention-picker')['MentionPicker']
|
|
7
8
|
['im-read-receipt']: typeof import('./components/read-receipt')['ReadReceipt']
|
|
8
9
|
['im-chat-item']: typeof import('./components/chat-item')['ChatItem']
|
|
9
10
|
['im-message-item']: typeof import('./components/message-item')['MessageItem']
|
|
10
11
|
['im-voice-input']: typeof import('./components/voice-input')['VoiceInput']
|
|
11
|
-
['im-file-upload']: typeof import('./components/file-upload')['FileUpload']
|
|
12
12
|
['im-friend-item']: typeof import('./components/friend-item')['FriendItem']
|
|
13
13
|
['im-group-item']: typeof import('./components/group-item')['GroupItem']
|
|
14
14
|
['im-group-member-selector']: typeof import('./components/group-member-selector')['GroupMemberSelector']
|
|
@@ -17,6 +17,24 @@ declare module 'vue' {
|
|
|
17
17
|
['im-loading']: typeof import('./components/loading')['Loading']
|
|
18
18
|
['im-context-menu']: typeof import('./components/context-menu')['ContextMenu']
|
|
19
19
|
['im-virtual-list']: typeof import('./components/virtual-list')['VirtualList']
|
|
20
|
+
['im-double-tap-view']: typeof import('./components/double-tap-view')['DoubleTapView']
|
|
21
|
+
['im-icon']: typeof import('./components/icon')['Icon']
|
|
22
|
+
['im-nav-bar']: typeof import('./components/nav-bar')['NavBar']
|
|
23
|
+
['im-card']: typeof import('./components/card')['Card']
|
|
24
|
+
['im-message-list']: typeof import('./components/message-list')['MessageList']
|
|
25
|
+
['im-message-action']: typeof import('./components/message-action')['MessageAction']
|
|
26
|
+
['im-emoji-picker']: typeof import('./components/emoji-picker')['EmojiPicker']
|
|
27
|
+
['im-popup']: typeof import('./components/popup')['Popup']
|
|
28
|
+
['im-modal']: typeof import('./components/modal')['Modal']
|
|
29
|
+
['im-dialog']: typeof import('./components/dialog')['Dialog']
|
|
30
|
+
['im-upload']: typeof import('./components/upload')['Upload']
|
|
31
|
+
['im-search']: typeof import('./components/search')['Search']
|
|
32
|
+
['im-parse']: typeof import('./components/parse')['Parse']
|
|
33
|
+
['im-link']: typeof import('./components/link')['Link']
|
|
34
|
+
['im-sku']: typeof import('./components/sku')['Sku']
|
|
35
|
+
['im-stepper']: typeof import('./components/stepper')['Stepper']
|
|
36
|
+
['im-tabs']: typeof import('./components/tabs')['Tabs']
|
|
37
|
+
['im-tabs-tab-pane']: typeof import('./components/tabs-tab-pane')['TabsTabPane']
|
|
20
38
|
}
|
|
21
39
|
}
|
|
22
40
|
|
package/types/index.d.ts
CHANGED
|
@@ -36,6 +36,20 @@ import type {
|
|
|
36
36
|
UserInfo,
|
|
37
37
|
Response
|
|
38
38
|
} from './libs';
|
|
39
|
+
import validator, {
|
|
40
|
+
PasswordValidationOptions,
|
|
41
|
+
PasswordValidationResult,
|
|
42
|
+
ValidatorModule,
|
|
43
|
+
ValidationResult,
|
|
44
|
+
isNumber,
|
|
45
|
+
isInteger,
|
|
46
|
+
isMobilePhone,
|
|
47
|
+
isEmail,
|
|
48
|
+
isChineseIDCard,
|
|
49
|
+
validatePassword
|
|
50
|
+
} from './utils/validator.d.ts'
|
|
51
|
+
import { EmojiType, EmojiCategoryType } from './components/emoji-picker'
|
|
52
|
+
import * as base64 from "./utils/base64.d.ts";
|
|
39
53
|
|
|
40
54
|
declare module 'im-ui-mobile' {
|
|
41
55
|
export function install(): void
|
|
@@ -47,6 +61,27 @@ declare module 'im-ui-mobile' {
|
|
|
47
61
|
|
|
48
62
|
function getConfig(): Config;
|
|
49
63
|
|
|
64
|
+
// 导出类型
|
|
65
|
+
export type {
|
|
66
|
+
PasswordValidationOptions,
|
|
67
|
+
PasswordValidationResult,
|
|
68
|
+
ValidatorModule,
|
|
69
|
+
ValidationResult,
|
|
70
|
+
EmojiType,
|
|
71
|
+
EmojiCategoryType,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 导出常用函数
|
|
75
|
+
export {
|
|
76
|
+
isNumber,
|
|
77
|
+
isInteger,
|
|
78
|
+
isMobilePhone,
|
|
79
|
+
isEmail,
|
|
80
|
+
isChineseIDCard,
|
|
81
|
+
validatePassword
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 导出类型/函数
|
|
50
85
|
export {
|
|
51
86
|
getConfig,
|
|
52
87
|
eventBus,
|
|
@@ -60,6 +95,8 @@ declare module 'im-ui-mobile' {
|
|
|
60
95
|
WebSocket,
|
|
61
96
|
RecorderApp,
|
|
62
97
|
RecorderH5,
|
|
98
|
+
validator,
|
|
99
|
+
base64,
|
|
63
100
|
|
|
64
101
|
// 枚举类型
|
|
65
102
|
RTC_STATE,
|
|
@@ -92,4 +129,4 @@ declare module 'im-ui-mobile' {
|
|
|
92
129
|
}
|
|
93
130
|
}
|
|
94
131
|
|
|
95
|
-
export { MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS }
|
|
132
|
+
// export { MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS }
|