@zamlia/mini-ui 0.0.1
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/es/components/common/BottomPopup/index.d.ts +78 -0
- package/es/components/common/BottomPopup/index.d.ts.map +1 -0
- package/es/components/common/Card/index.d.ts +33 -0
- package/es/components/common/Card/index.d.ts.map +1 -0
- package/es/components/common/CardItem/index.d.ts +60 -0
- package/es/components/common/CardItem/index.d.ts.map +1 -0
- package/es/components/common/DataSelect/index.d.ts +15 -0
- package/es/components/common/DataSelect/index.d.ts.map +1 -0
- package/es/components/common/Modal/index.d.ts +31 -0
- package/es/components/common/Modal/index.d.ts.map +1 -0
- package/es/components/common/NavBar/index.d.ts +38 -0
- package/es/components/common/NavBar/index.d.ts.map +1 -0
- package/es/components/common/Page/index.d.ts +16 -0
- package/es/components/common/Page/index.d.ts.map +1 -0
- package/es/components/common/PullToPushRefresh/index.d.ts +94 -0
- package/es/components/common/PullToPushRefresh/index.d.ts.map +1 -0
- package/es/components/common/Radio/index.d.ts +26 -0
- package/es/components/common/Radio/index.d.ts.map +1 -0
- package/es/components/common/TabPane/index.d.ts +9 -0
- package/es/components/common/TabPane/index.d.ts.map +1 -0
- package/es/components/common/Tabs/index.d.ts +27 -0
- package/es/components/common/Tabs/index.d.ts.map +1 -0
- package/es/components/common/UploadFile/index.d.ts +50 -0
- package/es/components/common/UploadFile/index.d.ts.map +1 -0
- package/es/components/common/UploadFile/upload.d.ts +11 -0
- package/es/components/common/UploadFile/upload.d.ts.map +1 -0
- package/es/components/common/UploadFile/utils.d.ts +20 -0
- package/es/components/common/UploadFile/utils.d.ts.map +1 -0
- package/es/components/common/VideoView/index.d.ts +14 -0
- package/es/components/common/VideoView/index.d.ts.map +1 -0
- package/es/components/common/index.d.ts +23 -0
- package/es/components/common/index.d.ts.map +1 -0
- package/es/components/industry/CitySelectButton/index.d.ts +17 -0
- package/es/components/industry/CitySelectButton/index.d.ts.map +1 -0
- package/es/components/industry/CitySelectModal/index.d.ts +13 -0
- package/es/components/industry/CitySelectModal/index.d.ts.map +1 -0
- package/es/components/industry/PaymentMethodSelect/index.d.ts +59 -0
- package/es/components/industry/PaymentMethodSelect/index.d.ts.map +1 -0
- package/es/components/industry/index.d.ts +5 -0
- package/es/components/industry/index.d.ts.map +1 -0
- package/es/config/classPrefix.d.ts +36 -0
- package/es/config/classPrefix.d.ts.map +1 -0
- package/es/index.d.ts +4 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +5334 -0
- package/es/index.js.map +1 -0
- package/es/styles/_base.scss +4 -0
- package/es/styles/index.scss +19 -0
- package/es/styles/mixins.scss +15 -0
- package/es/styles/variables.scss +2 -0
- package/es/utils/city.d.ts +4005 -0
- package/es/utils/city.d.ts.map +1 -0
- package/es/utils/index.d.ts +50 -0
- package/es/utils/index.d.ts.map +1 -0
- package/lib/components/common/BottomPopup/index.d.ts +78 -0
- package/lib/components/common/BottomPopup/index.d.ts.map +1 -0
- package/lib/components/common/Card/index.d.ts +33 -0
- package/lib/components/common/Card/index.d.ts.map +1 -0
- package/lib/components/common/CardItem/index.d.ts +60 -0
- package/lib/components/common/CardItem/index.d.ts.map +1 -0
- package/lib/components/common/DataSelect/index.d.ts +15 -0
- package/lib/components/common/DataSelect/index.d.ts.map +1 -0
- package/lib/components/common/Modal/index.d.ts +31 -0
- package/lib/components/common/Modal/index.d.ts.map +1 -0
- package/lib/components/common/NavBar/index.d.ts +38 -0
- package/lib/components/common/NavBar/index.d.ts.map +1 -0
- package/lib/components/common/Page/index.d.ts +16 -0
- package/lib/components/common/Page/index.d.ts.map +1 -0
- package/lib/components/common/PullToPushRefresh/index.d.ts +94 -0
- package/lib/components/common/PullToPushRefresh/index.d.ts.map +1 -0
- package/lib/components/common/Radio/index.d.ts +26 -0
- package/lib/components/common/Radio/index.d.ts.map +1 -0
- package/lib/components/common/TabPane/index.d.ts +9 -0
- package/lib/components/common/TabPane/index.d.ts.map +1 -0
- package/lib/components/common/Tabs/index.d.ts +27 -0
- package/lib/components/common/Tabs/index.d.ts.map +1 -0
- package/lib/components/common/UploadFile/index.d.ts +50 -0
- package/lib/components/common/UploadFile/index.d.ts.map +1 -0
- package/lib/components/common/UploadFile/upload.d.ts +11 -0
- package/lib/components/common/UploadFile/upload.d.ts.map +1 -0
- package/lib/components/common/UploadFile/utils.d.ts +20 -0
- package/lib/components/common/UploadFile/utils.d.ts.map +1 -0
- package/lib/components/common/VideoView/index.d.ts +14 -0
- package/lib/components/common/VideoView/index.d.ts.map +1 -0
- package/lib/components/common/index.d.ts +23 -0
- package/lib/components/common/index.d.ts.map +1 -0
- package/lib/components/industry/CitySelectButton/index.d.ts +17 -0
- package/lib/components/industry/CitySelectButton/index.d.ts.map +1 -0
- package/lib/components/industry/CitySelectModal/index.d.ts +13 -0
- package/lib/components/industry/CitySelectModal/index.d.ts.map +1 -0
- package/lib/components/industry/PaymentMethodSelect/index.d.ts +59 -0
- package/lib/components/industry/PaymentMethodSelect/index.d.ts.map +1 -0
- package/lib/components/industry/index.d.ts +5 -0
- package/lib/components/industry/index.d.ts.map +1 -0
- package/lib/config/classPrefix.d.ts +36 -0
- package/lib/config/classPrefix.d.ts.map +1 -0
- package/lib/index.d.ts +585 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5349 -0
- package/lib/index.js.map +1 -0
- package/lib/styles/_base.scss +4 -0
- package/lib/styles/index.scss +19 -0
- package/lib/styles/mixins.scss +15 -0
- package/lib/styles/variables.scss +2 -0
- package/lib/utils/city.d.ts +4005 -0
- package/lib/utils/city.d.ts.map +1 -0
- package/lib/utils/index.d.ts +50 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/package.json +81 -0
- package/src/components/common/BottomPopup/index.scss +34 -0
- package/src/components/common/BottomPopup/index.tsx +129 -0
- package/src/components/common/Card/index.scss +160 -0
- package/src/components/common/Card/index.tsx +72 -0
- package/src/components/common/CardItem/index.tsx +153 -0
- package/src/components/common/DataSelect/index.tsx +86 -0
- package/src/components/common/Modal/index.scss +49 -0
- package/src/components/common/Modal/index.tsx +105 -0
- package/src/components/common/NavBar/index.scss +26 -0
- package/src/components/common/NavBar/index.tsx +81 -0
- package/src/components/common/Page/index.scss +19 -0
- package/src/components/common/Page/index.tsx +56 -0
- package/src/components/common/PullToPushRefresh/index.scss +38 -0
- package/src/components/common/PullToPushRefresh/index.tsx +338 -0
- package/src/components/common/Radio/index.scss +15 -0
- package/src/components/common/Radio/index.tsx +56 -0
- package/src/components/common/TabPane/index.tsx +26 -0
- package/src/components/common/Tabs/index.scss +60 -0
- package/src/components/common/Tabs/index.tsx +107 -0
- package/src/components/common/UploadFile/index.scss +59 -0
- package/src/components/common/UploadFile/index.tsx +321 -0
- package/src/components/common/UploadFile/upload.ts +63 -0
- package/src/components/common/UploadFile/utils.ts +81 -0
- package/src/components/common/VideoView/index.tsx +50 -0
- package/src/components/common/index.ts +23 -0
- package/src/components/industry/CitySelectButton/index.tsx +76 -0
- package/src/components/industry/CitySelectModal/index.scss +122 -0
- package/src/components/industry/CitySelectModal/index.tsx +121 -0
- package/src/components/industry/PaymentMethodSelect/index.scss +146 -0
- package/src/components/industry/PaymentMethodSelect/index.tsx +316 -0
- package/src/components/industry/index.ts +5 -0
- package/src/config/classPrefix.ts +44 -0
- package/src/index.ts +9 -0
- package/src/styles/_base.scss +4 -0
- package/src/styles/index.scss +19 -0
- package/src/styles/mixins.scss +15 -0
- package/src/styles/variables.scss +2 -0
- package/src/utils/city.ts +4072 -0
- package/src/utils/index.ts +155 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import React, { CSSProperties, PropsWithChildren, MutableRefObject } from 'react';
|
|
2
|
+
import { PopupProps, DialogProps } from '@nutui/nutui-react-taro';
|
|
3
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
4
|
+
|
|
5
|
+
type BottomPopupProps = {
|
|
6
|
+
/**
|
|
7
|
+
* 标题
|
|
8
|
+
*/
|
|
9
|
+
title?: string | React.ReactElement;
|
|
10
|
+
/**
|
|
11
|
+
* 弹窗是否开启
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 弹窗高度
|
|
17
|
+
*/
|
|
18
|
+
height?: number;
|
|
19
|
+
/**
|
|
20
|
+
* 是否展示关闭按钮
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
showClose?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 点击遮罩是否关闭
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
maskClose?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 自定义头部导航样式
|
|
31
|
+
*/
|
|
32
|
+
customHeaderStyles?: CSSProperties;
|
|
33
|
+
/**
|
|
34
|
+
* 底部固定区域
|
|
35
|
+
*/
|
|
36
|
+
bottomFixedCard?: React.ReactElement;
|
|
37
|
+
} & Partial<Omit<PopupProps, 'round' | 'transition' | 'position' | 'title'>>;
|
|
38
|
+
type BottomPopupRef = {
|
|
39
|
+
/** 打开弹窗 */
|
|
40
|
+
open: () => void;
|
|
41
|
+
/** 关闭弹窗 */
|
|
42
|
+
close: () => void;
|
|
43
|
+
} | undefined;
|
|
44
|
+
declare const _default: React.ForwardRefExoticComponent<{
|
|
45
|
+
/**
|
|
46
|
+
* 标题
|
|
47
|
+
*/
|
|
48
|
+
title?: string | React.ReactElement;
|
|
49
|
+
/**
|
|
50
|
+
* 弹窗是否开启
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
visible?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* 弹窗高度
|
|
56
|
+
*/
|
|
57
|
+
height?: number;
|
|
58
|
+
/**
|
|
59
|
+
* 是否展示关闭按钮
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
showClose?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 点击遮罩是否关闭
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
maskClose?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 自定义头部导航样式
|
|
70
|
+
*/
|
|
71
|
+
customHeaderStyles?: CSSProperties;
|
|
72
|
+
/**
|
|
73
|
+
* 底部固定区域
|
|
74
|
+
*/
|
|
75
|
+
bottomFixedCard?: React.ReactElement;
|
|
76
|
+
} & Partial<Omit<PopupProps, "round" | "transition" | "position" | "title">> & {
|
|
77
|
+
children?: React.ReactNode | undefined;
|
|
78
|
+
} & React.RefAttributes<BottomPopupRef>>;
|
|
79
|
+
|
|
80
|
+
type CardItemProps = {
|
|
81
|
+
/** label */
|
|
82
|
+
label: string | React.ReactElement;
|
|
83
|
+
/** 值 */
|
|
84
|
+
value: string | number | React.ReactElement | null;
|
|
85
|
+
/**
|
|
86
|
+
* label分割方式
|
|
87
|
+
* @default :
|
|
88
|
+
*/
|
|
89
|
+
labelDivider?: string;
|
|
90
|
+
/**
|
|
91
|
+
* 是隐藏分割符
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
disabledLabelDivider?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* 右边区域
|
|
97
|
+
* x轴排列方向 justify = 'start' 才显示
|
|
98
|
+
*/
|
|
99
|
+
extra?: React.ReactElement | string | number | null;
|
|
100
|
+
/**
|
|
101
|
+
* x轴排列方向
|
|
102
|
+
* @default start
|
|
103
|
+
*/
|
|
104
|
+
justify?: 'start' | 'between';
|
|
105
|
+
/**
|
|
106
|
+
* y轴排列方向
|
|
107
|
+
* @default center
|
|
108
|
+
*/
|
|
109
|
+
align?: 'center' | 'start' | 'end';
|
|
110
|
+
/**
|
|
111
|
+
* 排列方式
|
|
112
|
+
* @default inline
|
|
113
|
+
*/
|
|
114
|
+
layout?: 'inline' | 'vertical';
|
|
115
|
+
/**
|
|
116
|
+
* value DOM是否脱离文档流
|
|
117
|
+
* 仅在layout == 'inline' 支持
|
|
118
|
+
* 不会影响上下item的间距
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
valueAbsolute?: boolean;
|
|
122
|
+
/** 自定义字体样式 */
|
|
123
|
+
labelStyle?: CSSProperties;
|
|
124
|
+
valueStyle?: CSSProperties;
|
|
125
|
+
className?: string;
|
|
126
|
+
/** 点击事件 */
|
|
127
|
+
onClick?: (e: ITouchEvent) => void;
|
|
128
|
+
/**
|
|
129
|
+
* 是否隐藏该组件
|
|
130
|
+
* @default false
|
|
131
|
+
*/
|
|
132
|
+
hide?: boolean;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
type CardProps = {
|
|
136
|
+
/**
|
|
137
|
+
* 是否显示Header
|
|
138
|
+
* @default true
|
|
139
|
+
*/
|
|
140
|
+
showHeader?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* 是否显示Header Border
|
|
143
|
+
* @default true
|
|
144
|
+
*/
|
|
145
|
+
showHeaderBorder?: boolean;
|
|
146
|
+
/** 标题 */
|
|
147
|
+
title?: string | React.ReactElement;
|
|
148
|
+
/** header右边区域 */
|
|
149
|
+
extra?: React.ReactElement;
|
|
150
|
+
/**
|
|
151
|
+
* 底部模块
|
|
152
|
+
* @type {React.ReactElement | React.ReactElement[]}
|
|
153
|
+
* 如果是类型是数组 则是一个按钮集群,
|
|
154
|
+
* 超出部分可以一点点点显示剩下的按钮
|
|
155
|
+
*/
|
|
156
|
+
footer?: React.ReactElement | React.ReactElement[];
|
|
157
|
+
className?: string;
|
|
158
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
159
|
+
};
|
|
160
|
+
interface CardComponent extends React.FC<PropsWithChildren<CardProps>> {
|
|
161
|
+
Item: React.FC<CardItemProps>;
|
|
162
|
+
}
|
|
163
|
+
declare const Card: CardComponent;
|
|
164
|
+
|
|
165
|
+
type ModalProps = {
|
|
166
|
+
/** 底部 */
|
|
167
|
+
content?: React.ReactElement | string;
|
|
168
|
+
/**
|
|
169
|
+
* 是否显示右上角关闭按钮
|
|
170
|
+
* @default true
|
|
171
|
+
*/
|
|
172
|
+
showCloseIcon?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* 是否显示取消按钮
|
|
175
|
+
* @default true
|
|
176
|
+
*/
|
|
177
|
+
showCancel?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* 是否显示确认按钮
|
|
180
|
+
* @default true
|
|
181
|
+
*/
|
|
182
|
+
showConfirm?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
*自定义确定按钮文字
|
|
185
|
+
*/
|
|
186
|
+
confirmText?: React.ReactElement | string;
|
|
187
|
+
className?: string;
|
|
188
|
+
onCancel?: () => void;
|
|
189
|
+
onConfirm?: () => void;
|
|
190
|
+
} & Omit<DialogProps, 'content' | 'onCancel' | 'onConfirm' | 'confirmText'>;
|
|
191
|
+
declare const Modal: React.FC<PropsWithChildren<ModalProps>>;
|
|
192
|
+
|
|
193
|
+
type NavBarProps = {
|
|
194
|
+
title?: string | React.ReactElement;
|
|
195
|
+
/**
|
|
196
|
+
* 标题剧中
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
titleCenter?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* 是否是头像
|
|
202
|
+
* @default false
|
|
203
|
+
* @description 如果该值是true titleCenter则为true
|
|
204
|
+
*/
|
|
205
|
+
isHeader?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* 背景颜色
|
|
208
|
+
* @default transparent
|
|
209
|
+
* @description 只有isHeader才生效
|
|
210
|
+
*/
|
|
211
|
+
backageColor?: string;
|
|
212
|
+
/**
|
|
213
|
+
* 是否穿透
|
|
214
|
+
* @default false
|
|
215
|
+
*/
|
|
216
|
+
fixed?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* 返回按钮
|
|
219
|
+
* @default false
|
|
220
|
+
*/
|
|
221
|
+
back?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* 返回事件
|
|
224
|
+
*/
|
|
225
|
+
onBack?: () => void;
|
|
226
|
+
};
|
|
227
|
+
declare const NavBar: React.FC<NavBarProps>;
|
|
228
|
+
|
|
229
|
+
type PageProps = {
|
|
230
|
+
error: boolean;
|
|
231
|
+
loading: boolean;
|
|
232
|
+
loadingColor?: string;
|
|
233
|
+
loadingText?: string;
|
|
234
|
+
errorText?: string;
|
|
235
|
+
emptyDataText?: string;
|
|
236
|
+
emptyDataRender?: React.ReactElement;
|
|
237
|
+
dataSource: Array<any> | any;
|
|
238
|
+
onRequest?: () => void;
|
|
239
|
+
renderLoading?: any;
|
|
240
|
+
};
|
|
241
|
+
declare const Page: React.FC<PropsWithChildren<PageProps>>;
|
|
242
|
+
|
|
243
|
+
type PullToPushRefreshProps<T = Record<string, any>> = {
|
|
244
|
+
pageSize?: number;
|
|
245
|
+
/** 没有数据展示内容 */
|
|
246
|
+
emptyRender?: React.ReactElement;
|
|
247
|
+
/** 加载文案
|
|
248
|
+
* @default 加载中...
|
|
249
|
+
*/
|
|
250
|
+
loadingText?: string;
|
|
251
|
+
/**
|
|
252
|
+
* 错误文案
|
|
253
|
+
* @default 加载失败,请点击重试
|
|
254
|
+
*/
|
|
255
|
+
errorText?: string;
|
|
256
|
+
/**
|
|
257
|
+
* 没有数据文案
|
|
258
|
+
* @default emptyText
|
|
259
|
+
* */
|
|
260
|
+
emptyText?: string;
|
|
261
|
+
/**
|
|
262
|
+
* 底部文案
|
|
263
|
+
* @default 没有更多了
|
|
264
|
+
* */
|
|
265
|
+
bottomText?: string;
|
|
266
|
+
/**
|
|
267
|
+
* 是否展示底部文案
|
|
268
|
+
* @default true
|
|
269
|
+
*/
|
|
270
|
+
showBottomText?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* 是否展示加载图标
|
|
273
|
+
* @default true
|
|
274
|
+
*/
|
|
275
|
+
showLoding?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* 下拉刷新文案
|
|
278
|
+
* @default '松开即可刷新'
|
|
279
|
+
*/
|
|
280
|
+
refreshText?: string;
|
|
281
|
+
/**
|
|
282
|
+
* show页面是否加载数据
|
|
283
|
+
* @default false
|
|
284
|
+
*/
|
|
285
|
+
showPageRequest?: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* 是否首次进入页面自动掉接口
|
|
288
|
+
* @default true
|
|
289
|
+
*/
|
|
290
|
+
hasFirstPageAutoRequest?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* 自定义每条数据的内容
|
|
293
|
+
* @param {T} item 当前条数据
|
|
294
|
+
* @param {number} index
|
|
295
|
+
*/
|
|
296
|
+
renderItem: (item: T, index: number) => React.ReactElement;
|
|
297
|
+
/**
|
|
298
|
+
* 请求方法
|
|
299
|
+
* @param {T} skip 当前页码
|
|
300
|
+
* @param {T} first pageSize
|
|
301
|
+
* @param {Record<string, any>} restParams 可以传其余的饿默认参数
|
|
302
|
+
*/
|
|
303
|
+
request: (skip: number, first: number, restParams?: Record<string, any>) => void;
|
|
304
|
+
};
|
|
305
|
+
type PullToPushRefreshRef = {
|
|
306
|
+
/**
|
|
307
|
+
* 刷新
|
|
308
|
+
* @param isFirst 是否是第一次调用
|
|
309
|
+
* @param restParams 可以传其余的饿默认参数
|
|
310
|
+
*/
|
|
311
|
+
reload: (isFirst?: boolean, restParams?: Record<string, any>) => void;
|
|
312
|
+
/**
|
|
313
|
+
* 设置是否可以页面show刷新
|
|
314
|
+
* @param {boolean}bol
|
|
315
|
+
*/
|
|
316
|
+
showPageRequest: (bol: boolean) => void;
|
|
317
|
+
} | undefined;
|
|
318
|
+
type WrappedPullToPushRefreshProps<T> = {
|
|
319
|
+
actionRef: MutableRefObject<PullToPushRefreshRef>;
|
|
320
|
+
} & PullToPushRefreshProps<T>;
|
|
321
|
+
declare const WrappedPullToPushRefresh: <T extends Record<string, any>>(props: WrappedPullToPushRefreshProps<T>) => React.JSX.Element;
|
|
322
|
+
|
|
323
|
+
type TabPaneProps = {
|
|
324
|
+
/** 标题 */
|
|
325
|
+
title: string;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
type TabsProps = {
|
|
329
|
+
/**
|
|
330
|
+
* 标签栏样式
|
|
331
|
+
* @default {}
|
|
332
|
+
*/
|
|
333
|
+
tabStyle?: CSSProperties;
|
|
334
|
+
/**
|
|
335
|
+
* 当前激活 tab 面板的值
|
|
336
|
+
* @default 0
|
|
337
|
+
*/
|
|
338
|
+
value: number;
|
|
339
|
+
className?: string;
|
|
340
|
+
/** 是否需要滚动 */
|
|
341
|
+
scroll?: boolean;
|
|
342
|
+
tabsRender?: (dom: {
|
|
343
|
+
tabsDom: React.ReactNode;
|
|
344
|
+
}) => React.ReactNode;
|
|
345
|
+
onChange: (value: number) => void;
|
|
346
|
+
};
|
|
347
|
+
interface TabsComponent extends React.FC<PropsWithChildren<TabsProps>> {
|
|
348
|
+
TabPane: React.FC<PropsWithChildren<TabPaneProps>>;
|
|
349
|
+
}
|
|
350
|
+
declare const Tabs: TabsComponent;
|
|
351
|
+
|
|
352
|
+
type VideoViewProps = {
|
|
353
|
+
url: string;
|
|
354
|
+
hasToH5Show?: boolean;
|
|
355
|
+
width?: number;
|
|
356
|
+
height?: number;
|
|
357
|
+
onH5Open?: (url: string) => void;
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* 视频显示
|
|
361
|
+
*/
|
|
362
|
+
declare const VideoView: React.FC<VideoViewProps>;
|
|
363
|
+
|
|
364
|
+
type UploadFileOption = {
|
|
365
|
+
file: string;
|
|
366
|
+
dir: string;
|
|
367
|
+
/**
|
|
368
|
+
* 扩展参数
|
|
369
|
+
*/
|
|
370
|
+
extraData?: Record<string, any>;
|
|
371
|
+
host: string;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
type UploadFileProps = {
|
|
375
|
+
host: string;
|
|
376
|
+
/**
|
|
377
|
+
* 可上传文件类型
|
|
378
|
+
*/
|
|
379
|
+
fileTypes?: string[];
|
|
380
|
+
value?: any;
|
|
381
|
+
/**
|
|
382
|
+
* 最大文件大小,单位MB(暂时没有)
|
|
383
|
+
*/
|
|
384
|
+
maxSize?: number;
|
|
385
|
+
/**
|
|
386
|
+
* 最多上传多少个文件
|
|
387
|
+
* 最多是8张图片
|
|
388
|
+
*/
|
|
389
|
+
maxCount?: number;
|
|
390
|
+
/**
|
|
391
|
+
* 是否展示删除按钮
|
|
392
|
+
*/
|
|
393
|
+
showDelete?: boolean;
|
|
394
|
+
chooseType?: 'img' | 'video' | 'media';
|
|
395
|
+
dir?: string;
|
|
396
|
+
/**
|
|
397
|
+
* 扩展参数
|
|
398
|
+
*/
|
|
399
|
+
extraData?: Record<string, any>;
|
|
400
|
+
onChange?: (v?: any) => void;
|
|
401
|
+
};
|
|
402
|
+
interface UploadFileConponent extends React.FC<UploadFileProps> {
|
|
403
|
+
upload?: (options: UploadFileOption) => Promise<string>;
|
|
404
|
+
/** 文件类型 */
|
|
405
|
+
UPLOAD_TYPES: string[];
|
|
406
|
+
/** 图片类型 */
|
|
407
|
+
UPLOAD_IMAGE_TYPES: string[];
|
|
408
|
+
/** 视频类型 */
|
|
409
|
+
UPLOAD_VIDEO_TYPES: string[];
|
|
410
|
+
}
|
|
411
|
+
type UploadFile = {
|
|
412
|
+
url: string;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
*
|
|
416
|
+
* @param props
|
|
417
|
+
* @returns React.ReactElement
|
|
418
|
+
*/
|
|
419
|
+
declare const UploadFile: UploadFileConponent;
|
|
420
|
+
|
|
421
|
+
type RadioProps = {
|
|
422
|
+
/**
|
|
423
|
+
* 是否选中
|
|
424
|
+
* @default false
|
|
425
|
+
*/
|
|
426
|
+
visible: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* 大小 大小等同于圆圈宽度
|
|
429
|
+
* @default 10
|
|
430
|
+
*/
|
|
431
|
+
size?: number;
|
|
432
|
+
/**
|
|
433
|
+
* 边框颜色
|
|
434
|
+
* @default '#AAAAAA'
|
|
435
|
+
*/
|
|
436
|
+
borderColor?: string;
|
|
437
|
+
/**
|
|
438
|
+
* 边框宽度
|
|
439
|
+
* @default 1
|
|
440
|
+
*/
|
|
441
|
+
borderWidth?: number;
|
|
442
|
+
};
|
|
443
|
+
declare const Radio: React.FC<RadioProps>;
|
|
444
|
+
|
|
445
|
+
type DataSelectProps = {
|
|
446
|
+
dataSource: any[];
|
|
447
|
+
rangeKey: string;
|
|
448
|
+
remoteValue?: any;
|
|
449
|
+
onChange: (currentItem: any) => void;
|
|
450
|
+
childRender?: (currentItem: any) => React.ReactElement;
|
|
451
|
+
defaultSeletItem?: any;
|
|
452
|
+
defaultValue?: string;
|
|
453
|
+
isSelectFirstItem?: boolean;
|
|
454
|
+
classNmaes?: string;
|
|
455
|
+
};
|
|
456
|
+
declare const DataSelect: React.FC<DataSelectProps>;
|
|
457
|
+
|
|
458
|
+
type PaymentMethod = 'WECHAT' | 'ALIPAY';
|
|
459
|
+
interface PaymentMethodSelectProps {
|
|
460
|
+
/**
|
|
461
|
+
* 实例 ID,用于区分多个实例
|
|
462
|
+
*/
|
|
463
|
+
id: string;
|
|
464
|
+
/**
|
|
465
|
+
* 默认选中的支付方式
|
|
466
|
+
* @default 'wechat'
|
|
467
|
+
*/
|
|
468
|
+
defaultMethod?: PaymentMethod;
|
|
469
|
+
/**
|
|
470
|
+
* 确认按钮文本
|
|
471
|
+
* @default '确认支付'
|
|
472
|
+
*/
|
|
473
|
+
confirmText?: string;
|
|
474
|
+
}
|
|
475
|
+
declare const PaymentMethodSelectComponent: React.FC<PaymentMethodSelectProps>;
|
|
476
|
+
declare const PaymentMethodSelect: typeof PaymentMethodSelectComponent & {
|
|
477
|
+
/**
|
|
478
|
+
* 打开支付方式选择弹窗(静态方法)
|
|
479
|
+
*
|
|
480
|
+
* @param id 实例 ID,需要在页面中先渲染 <PaymentMethodSelect id={id} />
|
|
481
|
+
* @param options 可选配置
|
|
482
|
+
* @returns Promise<PaymentMethod | null> 返回选择的支付方式,取消时返回 null
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* ```tsx
|
|
486
|
+
* // 在页面中渲染组件
|
|
487
|
+
* <PaymentMethodSelect id="payment" />
|
|
488
|
+
*
|
|
489
|
+
* // 然后调用静态方法
|
|
490
|
+
* const method = await PaymentMethodSelect.open('payment')
|
|
491
|
+
* if (method) {
|
|
492
|
+
* console.log('选择的支付方式:', method) // 'wechat' | 'alipay'
|
|
493
|
+
* } else {
|
|
494
|
+
* console.log('用户取消了选择')
|
|
495
|
+
* }
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
open: (id: string, options?: {
|
|
499
|
+
defaultMethod?: PaymentMethod;
|
|
500
|
+
confirmText?: string;
|
|
501
|
+
}) => Promise<PaymentMethod | null>;
|
|
502
|
+
/**
|
|
503
|
+
* 关闭支付方式选择弹窗(静态方法)
|
|
504
|
+
*
|
|
505
|
+
* @param id 实例 ID
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* ```tsx
|
|
509
|
+
* PaymentMethodSelect.close('payment')
|
|
510
|
+
* ```
|
|
511
|
+
*/
|
|
512
|
+
close: (id: string) => void;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
type CityData = {
|
|
516
|
+
id: string;
|
|
517
|
+
value: string;
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
type CitySelectButtonProps = {
|
|
521
|
+
className?: string;
|
|
522
|
+
onChange?: (value: CityData) => void;
|
|
523
|
+
/**
|
|
524
|
+
* @param {CityData} value
|
|
525
|
+
* @returns {React.ReactElement}
|
|
526
|
+
*/
|
|
527
|
+
buttonRender: (value: CityData) => React.ReactElement;
|
|
528
|
+
};
|
|
529
|
+
/**
|
|
530
|
+
* 顶部选择城市按钮
|
|
531
|
+
*/
|
|
532
|
+
declare const CitySelectButton: React.FC<CitySelectButtonProps>;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* 工具函数
|
|
536
|
+
*/
|
|
537
|
+
declare const Utils: {
|
|
538
|
+
/**
|
|
539
|
+
* 检查值是否为空
|
|
540
|
+
* @param value 要检查的值
|
|
541
|
+
* @returns 如果值为空返回 true,否则返回 false
|
|
542
|
+
*/
|
|
543
|
+
isEmpty(value: any): boolean;
|
|
544
|
+
/**
|
|
545
|
+
* 深拷贝对象
|
|
546
|
+
* @param obj 要拷贝的对象
|
|
547
|
+
* @returns 深拷贝后的新对象
|
|
548
|
+
*/
|
|
549
|
+
cloneDeep<T>(obj: T): T;
|
|
550
|
+
/**
|
|
551
|
+
* 判断 URL 是否是图片
|
|
552
|
+
* @param url 要检查的 URL
|
|
553
|
+
* @returns 如果是图片返回 true,否则返回 false
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* isImg('https://example.com/image.jpg') // => true
|
|
557
|
+
* isImg('https://example.com/image.png') // => true
|
|
558
|
+
* isImg('https://example.com/video.mp4') // => false
|
|
559
|
+
*/
|
|
560
|
+
isImg(url: string): boolean;
|
|
561
|
+
/**
|
|
562
|
+
* 判断 URL 是否是视频
|
|
563
|
+
* @param url 要检查的 URL
|
|
564
|
+
* @returns 如果是视频返回 true,否则返回 false
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* isVideo('https://example.com/video.mp4') // => true
|
|
568
|
+
* isVideo('https://example.com/video.mov') // => true
|
|
569
|
+
* isVideo('https://example.com/image.jpg') // => false
|
|
570
|
+
*/
|
|
571
|
+
isVideo(url: string): boolean;
|
|
572
|
+
/**
|
|
573
|
+
* 将字符串多余长度转化为...
|
|
574
|
+
* @param str 字符串
|
|
575
|
+
* @param len 字符串长度
|
|
576
|
+
*/
|
|
577
|
+
substr(str: string, len: number): string;
|
|
578
|
+
/**
|
|
579
|
+
* 等待
|
|
580
|
+
*/
|
|
581
|
+
delay: (delayTime?: number) => Promise<void>;
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
export { _default as BottomPopup, Card, CitySelectButton, DataSelect, Modal, NavBar, Page, PaymentMethodSelect, WrappedPullToPushRefresh as PullToPushRefresh, Radio, Tabs, UploadFile, Utils, VideoView };
|
|
585
|
+
export type { BottomPopupProps, CardProps, CitySelectButtonProps, DataSelectProps, ModalProps, NavBarProps, PageProps, PaymentMethod, PaymentMethodSelectProps, PullToPushRefreshProps, RadioProps, TabsProps, UploadFileProps, VideoViewProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAA;AAGnC,cAAc,uBAAuB,CAAA;AAGrC,cAAc,SAAS,CAAA"}
|