@ray-js/smart-ui 1.0.0-beta.1 → 1.0.1-beta-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/README.md +54 -1
- package/dist/@types/action-sheet/index.d.ts +115 -0
- package/dist/@types/area/index.d.ts +120 -0
- package/dist/@types/area/index.js +2 -0
- package/dist/@types/base/component.d.ts +11 -0
- package/dist/@types/base/component.js +2 -0
- package/dist/@types/base/events.d.ts +27 -0
- package/dist/@types/base/events.js +2 -0
- package/dist/@types/base/external-class-name.d.ts +12 -0
- package/dist/@types/base/external-class-name.js +2 -0
- package/dist/@types/base/index.d.ts +4 -0
- package/dist/{card → @types/base}/index.js +4 -8
- package/dist/@types/base/open-type.d.ts +175 -0
- package/dist/@types/base/open-type.js +2 -0
- package/dist/@types/battery/index.d.ts +58 -0
- package/dist/@types/battery/index.js +2 -0
- package/dist/@types/button/index.d.ts +109 -0
- package/dist/@types/button/index.js +2 -0
- package/dist/@types/calendar/index.d.ts +264 -0
- package/dist/@types/calendar/index.js +2 -0
- package/dist/@types/card/index.d.ts +92 -0
- package/dist/@types/card/index.js +2 -0
- package/dist/@types/cascader/index.d.ts +139 -0
- package/dist/@types/cascader/index.js +2 -0
- package/dist/@types/cell/index.d.ts +128 -0
- package/dist/@types/cell/index.js +2 -0
- package/dist/@types/cell-group/index.d.ts +21 -0
- package/dist/@types/cell-group/index.js +2 -0
- package/dist/@types/checkbox/index.d.ts +85 -0
- package/dist/@types/checkbox/index.js +2 -0
- package/dist/@types/checkbox-group/index.d.ts +38 -0
- package/dist/@types/checkbox-group/index.js +2 -0
- package/dist/@types/circle/index.d.ts +58 -0
- package/dist/@types/circle/index.js +2 -0
- package/dist/@types/col/index.d.ts +13 -0
- package/dist/@types/col/index.js +2 -0
- package/dist/@types/collapse/index.d.ts +60 -0
- package/dist/@types/collapse/index.js +2 -0
- package/dist/@types/collapse-item/index.d.ts +62 -0
- package/dist/@types/collapse-item/index.js +2 -0
- package/dist/@types/config-provider/index.d.ts +9 -0
- package/dist/@types/config-provider/index.js +2 -0
- package/dist/@types/config-provider/theme-vars.d.ts +63 -0
- package/dist/@types/config-provider/theme-vars.js +2 -0
- package/dist/@types/count-down/index.d.ts +81 -0
- package/dist/@types/count-down/index.js +2 -0
- package/dist/@types/custom-keyboard/index.d.ts +97 -0
- package/dist/@types/custom-keyboard/index.js +2 -0
- package/dist/@types/datetime-picker/index.d.ts +150 -0
- package/dist/@types/datetime-picker/index.js +2 -0
- package/dist/@types/dialog/dialog.d.ts +137 -0
- package/dist/@types/dialog/dialog.js +2 -0
- package/dist/@types/dialog/index.d.ts +168 -0
- package/dist/@types/dialog/index.js +2 -0
- package/dist/@types/divider/index.d.ts +24 -0
- package/dist/@types/divider/index.js +2 -0
- package/dist/@types/dropdown-item/index.d.ts +92 -0
- package/dist/@types/dropdown-item/index.js +2 -0
- package/dist/@types/dropdown-menu/index.d.ts +44 -0
- package/dist/@types/dropdown-menu/index.js +2 -0
- package/dist/@types/empty/index.d.ts +14 -0
- package/dist/@types/empty/index.js +2 -0
- package/dist/@types/field/index.d.ts +332 -0
- package/dist/@types/field/index.js +2 -0
- package/dist/@types/goods-action/index.d.ts +10 -0
- package/dist/@types/goods-action/index.js +2 -0
- package/dist/@types/goods-action-button/index.d.ts +67 -0
- package/dist/@types/goods-action-button/index.js +2 -0
- package/dist/@types/goods-action-icon/index.d.ts +60 -0
- package/dist/@types/goods-action-icon/index.js +2 -0
- package/dist/@types/grid/index.d.ts +63 -0
- package/dist/@types/grid/index.js +2 -0
- package/dist/@types/grid-item/index.d.ts +70 -0
- package/dist/@types/grid-item/index.js +2 -0
- package/dist/@types/icon/index.d.ts +47 -0
- package/dist/@types/icon/index.js +2 -0
- package/dist/@types/image/index.d.ts +117 -0
- package/dist/@types/image/index.js +2 -0
- package/dist/@types/index-anchor/index.d.ts +14 -0
- package/dist/@types/index-anchor/index.js +2 -0
- package/dist/@types/index-bar/index.d.ts +50 -0
- package/dist/@types/index-bar/index.js +2 -0
- package/dist/@types/index.d.ts +71 -0
- package/dist/@types/index.js +87 -0
- package/dist/@types/loading/index.d.ts +39 -0
- package/dist/@types/loading/index.js +2 -0
- package/dist/@types/nav-bar/index.d.ts +96 -0
- package/dist/@types/nav-bar/index.js +2 -0
- package/dist/@types/notice-bar/index.d.ts +71 -0
- package/dist/@types/notice-bar/index.js +2 -0
- package/dist/@types/notify/index.d.ts +1 -0
- package/dist/@types/notify/index.js +2 -0
- package/dist/@types/notify/notify.d.ts +84 -0
- package/dist/@types/notify/notify.js +2 -0
- package/dist/@types/overlay/index.d.ts +49 -0
- package/dist/@types/overlay/index.js +2 -0
- package/dist/@types/panel/index.d.ts +26 -0
- package/dist/@types/panel/index.js +2 -0
- package/dist/@types/picker/index.d.ts +154 -0
- package/dist/@types/picker/index.js +2 -0
- package/dist/@types/popup/index.d.ts +107 -0
- package/dist/@types/popup/index.js +2 -0
- package/dist/@types/progress/index.d.ts +59 -0
- package/dist/@types/progress/index.js +2 -0
- package/dist/@types/radio/index.d.ts +69 -0
- package/dist/@types/radio/index.js +2 -0
- package/dist/@types/radio-group/index.d.ts +37 -0
- package/dist/@types/radio-group/index.js +2 -0
- package/dist/@types/rate/index.d.ts +103 -0
- package/dist/@types/rate/index.js +2 -0
- package/dist/@types/row/index.d.ts +9 -0
- package/dist/@types/row/index.js +2 -0
- package/dist/@types/search/index.d.ts +166 -0
- package/dist/@types/search/index.js +2 -0
- package/dist/@types/share-sheet/index.d.ts +95 -0
- package/dist/@types/share-sheet/index.js +2 -0
- package/dist/@types/sidebar/index.d.ts +27 -0
- package/dist/@types/sidebar/index.js +2 -0
- package/dist/@types/sidebar-item/index.d.ts +52 -0
- package/dist/@types/sidebar-item/index.js +2 -0
- package/dist/@types/skeleton/index.d.ts +56 -0
- package/dist/@types/skeleton/index.js +2 -0
- package/dist/@types/slider/index.d.ts +103 -0
- package/dist/@types/slider/index.js +2 -0
- package/dist/@types/stepper/index.d.ts +169 -0
- package/dist/@types/stepper/index.js +2 -0
- package/dist/@types/steps/index.d.ts +83 -0
- package/dist/@types/steps/index.js +2 -0
- package/dist/@types/sticky/index.d.ts +36 -0
- package/dist/@types/sticky/index.js +2 -0
- package/dist/@types/submit-bar/index.d.ts +86 -0
- package/dist/@types/submit-bar/index.js +2 -0
- package/dist/@types/swipe-cell/index.d.ts +75 -0
- package/dist/@types/swipe-cell/index.js +2 -0
- package/dist/@types/switch/index.d.ts +75 -0
- package/dist/@types/switch/index.js +2 -0
- package/dist/@types/tab/index.d.ts +41 -0
- package/dist/@types/tab/index.js +2 -0
- package/dist/@types/tabbar/index.d.ts +68 -0
- package/dist/@types/tabbar/index.js +2 -0
- package/dist/@types/tabbar-item/index.d.ts +28 -0
- package/dist/@types/tabbar-item/index.js +2 -0
- package/dist/@types/tabs/index.d.ts +174 -0
- package/dist/@types/tabs/index.js +2 -0
- package/dist/@types/tag/index.d.ts +50 -0
- package/dist/@types/tag/index.js +2 -0
- package/dist/@types/toast/index.d.ts +2 -0
- package/dist/@types/toast/index.js +2 -0
- package/dist/@types/toast/toast.d.ts +112 -0
- package/dist/@types/toast/toast.js +3 -0
- package/dist/@types/transition/index.d.ts +105 -0
- package/dist/@types/transition/index.js +2 -0
- package/dist/@types/tree-select/index.d.ts +126 -0
- package/dist/@types/tree-select/index.js +2 -0
- package/dist/@types/uploader/index.d.ts +157 -0
- package/dist/@types/uploader/index.js +2 -0
- package/dist/action-sheet/PropTypes.d.ts +1 -1
- package/dist/area/PropTypes.d.ts +1 -1
- package/dist/base/index.d.ts +1 -1
- package/dist/battery/PropTypes.d.ts +1 -1
- package/dist/button/PropTypes.d.ts +1 -1
- package/dist/calendar/PropTypes.d.ts +1 -1
- package/dist/cascader/PropTypes.d.ts +1 -1
- package/dist/cell/PropTypes.d.ts +1 -1
- package/dist/cell-group/PropTypes.d.ts +1 -1
- package/dist/checkbox/PropTypes.d.ts +1 -1
- package/dist/checkbox-group/PropTypes.d.ts +1 -1
- package/dist/circle/PropTypes.d.ts +1 -1
- package/dist/col/PropTypes.d.ts +1 -1
- package/dist/collapse/PropTypes.d.ts +1 -1
- package/dist/collapse-item/PropTypes.d.ts +1 -1
- package/dist/config-provider/PropTypes.d.ts +1 -1
- package/dist/count-down/PropTypes.d.ts +1 -1
- package/dist/custom-keyboard/PropTypes.d.ts +1 -1
- package/dist/datetime-picker/PropTypes.d.ts +1 -1
- package/dist/dialog/Dialog.d.ts +4 -2
- package/dist/dialog/Dialog.js +2 -1
- package/dist/dialog/PropTypes.d.ts +1 -1
- package/dist/divider/PropTypes.d.ts +1 -1
- package/dist/dropdown-item/PropTypes.d.ts +1 -1
- package/dist/dropdown-menu/PropTypes.d.ts +1 -1
- package/dist/empty/PropTypes.d.ts +1 -1
- package/dist/field/PropTypes.d.ts +1 -1
- package/dist/grid/PropTypes.d.ts +1 -1
- package/dist/grid-item/PropTypes.d.ts +1 -1
- package/dist/icon/PropTypes.d.ts +1 -1
- package/dist/image/PropTypes.d.ts +1 -1
- package/dist/index-anchor/PropTypes.d.ts +1 -1
- package/dist/index-bar/PropTypes.d.ts +1 -1
- package/dist/loading/PropTypes.d.ts +1 -1
- package/dist/nav-bar/PropTypes.d.ts +1 -1
- package/dist/notice-bar/PropTypes.d.ts +1 -1
- package/dist/notify/PropTypes.d.ts +1 -1
- package/dist/overlay/PropTypes.d.ts +1 -1
- package/dist/picker/PropTypes.d.ts +1 -1
- package/dist/popup/PropTypes.d.ts +1 -1
- package/dist/radio/PropTypes.d.ts +1 -1
- package/dist/radio-group/PropTypes.d.ts +1 -1
- package/dist/rate/PropTypes.d.ts +1 -1
- package/dist/row/PropTypes.d.ts +1 -1
- package/dist/search/PropTypes.d.ts +1 -1
- package/dist/share-sheet/PropTypes.d.ts +1 -1
- package/dist/sidebar/PropTypes.d.ts +1 -1
- package/dist/sidebar-item/PropTypes.d.ts +1 -1
- package/dist/skeleton/PropTypes.d.ts +1 -1
- package/dist/slider/PropTypes.d.ts +1 -1
- package/dist/slider/index.d.ts +4 -4
- package/dist/stepper/PropTypes.d.ts +1 -1
- package/dist/steps/PropTypes.d.ts +1 -1
- package/dist/sticky/PropTypes.d.ts +1 -1
- package/dist/swipe-cell/PropTypes.d.ts +1 -1
- package/dist/switch/PropTypes.d.ts +1 -1
- package/dist/tab/PropTypes.d.ts +1 -1
- package/dist/tabbar/PropTypes.d.ts +1 -1
- package/dist/tabbar-item/PropTypes.d.ts +1 -1
- package/dist/tabs/PropTypes.d.ts +1 -1
- package/dist/tag/PropTypes.d.ts +1 -1
- package/dist/toast/PropTypes.d.ts +1 -1
- package/dist/toast/index.d.ts +2 -1
- package/dist/transition/PropTypes.d.ts +1 -1
- package/dist/tree-select/PropTypes.d.ts +1 -1
- package/package.json +45 -8
- package/dist/card/Card.d.ts +0 -2
- package/dist/card/Card.js +0 -8
- package/dist/card/PropTypes.d.ts +0 -2
- package/dist/card/index.d.ts +0 -5
- /package/dist/{card/PropTypes.js → @types/action-sheet/index.js} +0 -0
- /package/dist/notify/{Notify.d.ts → notify.d.ts} +0 -0
- /package/dist/notify/{Notify.js → notify.js} +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,56 @@
|
|
|
1
|
+
English | [简体中文](./README-zh_CN.md)
|
|
2
|
+
|
|
1
3
|
# @ray-js/smart-ui
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
`@ray-js/smart-ui` is a React component library based on the `Ray` framework and `@tuya-miniapp/smart-ui`, aimed at providing lightweight and reliable UI components that adhere to the design specifications for smart mini programs on mobile devices. By combining the `Ray` specification adaptation layer and built-in comprehensive TypeScript types, we offer a complete set of React components suitable for smart mini programs, allowing developers to quickly build mobile applications that meet design standards.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+
Scan the QR code below with your smart mini program to experience the component library demo.
|
|
12
|
+
|
|
13
|
+
<img src="./explorer.png" width="200" height="200" style="margin-top: 10px;" >
|
|
14
|
+
|
|
15
|
+
## Before Getting Started
|
|
16
|
+
|
|
17
|
+
Before using Smart UI, make sure you have already studied the [Ray Development Overview](https://developer.tuya.com/en/miniapp/develop/ray/guide/overview) and [Ray Component Introduction](https://developer.tuya.com/en/miniapp/develop/ray/framework/component) from the smart mini program official documentation.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Install via yarn (recommended)
|
|
23
|
+
yarn add @ray-js/smart-ui
|
|
24
|
+
|
|
25
|
+
# Install via npm
|
|
26
|
+
npm i @ray-js/smart-ui
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Using Components
|
|
30
|
+
|
|
31
|
+
Using the button component as an example:
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
import { Button } from '@ray-js/smart-ui';
|
|
35
|
+
|
|
36
|
+
export default function Demo() {
|
|
37
|
+
return <Button type="info">Info Button</Button>;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Preview in Developer Tools
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Install project dependencies
|
|
45
|
+
$ yarn
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Open [Tuya MiniApp Tools](https://developer.tuya.com/cn/miniapp/devtools/tools), add the `apps/smart-ui-demo` directory, and you can preview the demo.
|
|
49
|
+
|
|
50
|
+
## Base Library Version
|
|
51
|
+
|
|
52
|
+
@ray-js/smart-ui provides stable support starting from the smart mini program base library version `2.19.0` and `@ray-js/ray@^1.5.1`.
|
|
53
|
+
|
|
54
|
+
## Open Source License
|
|
55
|
+
|
|
56
|
+
This project is licensed under the [MIT](https://en.wikipedia.org/wiki/MIT_License) license. Feel free to enjoy and contribute to the open source community.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { VantOpenTypeCamelCaseProps, VantComponent, VantEventHandler } from '../base';
|
|
2
|
+
import { VantTransitionEvents } from '../transition';
|
|
3
|
+
export interface VantAction extends Omit<VantOpenTypeCamelCaseProps, 'businessId'> {
|
|
4
|
+
/**
|
|
5
|
+
* 标题
|
|
6
|
+
*/
|
|
7
|
+
name?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 二级标题
|
|
10
|
+
*/
|
|
11
|
+
subname?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 选项文字颜色
|
|
14
|
+
*/
|
|
15
|
+
color?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 是否为加载状态
|
|
18
|
+
*/
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 是否为选中状态
|
|
22
|
+
*/
|
|
23
|
+
checked?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 是否为禁用状态
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 为对应列添加额外的 `class` 类名
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface VantActionSheetProps {
|
|
34
|
+
/**
|
|
35
|
+
* 是否显示动作面板
|
|
36
|
+
*/
|
|
37
|
+
show?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 菜单选项
|
|
40
|
+
*
|
|
41
|
+
* @default []
|
|
42
|
+
*/
|
|
43
|
+
actions?: VantAction[];
|
|
44
|
+
/**
|
|
45
|
+
* 标题
|
|
46
|
+
*/
|
|
47
|
+
title?: string;
|
|
48
|
+
/**
|
|
49
|
+
* 选项上方的描述信息
|
|
50
|
+
*/
|
|
51
|
+
description?: string;
|
|
52
|
+
/**
|
|
53
|
+
* `z-index` 层级
|
|
54
|
+
*
|
|
55
|
+
* @default 100
|
|
56
|
+
*/
|
|
57
|
+
zIndex?: number;
|
|
58
|
+
/**
|
|
59
|
+
* 取消按钮文字
|
|
60
|
+
*/
|
|
61
|
+
cancelText?: string;
|
|
62
|
+
/**
|
|
63
|
+
* 确认按钮文字
|
|
64
|
+
*/
|
|
65
|
+
confirmText?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 是否显示遮罩层
|
|
68
|
+
*/
|
|
69
|
+
overlay?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* 是否显示圆角
|
|
72
|
+
*
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
round?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* 是否在点击选项后关闭
|
|
78
|
+
*
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
closeOnClickAction?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* 点击遮罩是否关闭菜单
|
|
84
|
+
*/
|
|
85
|
+
closeOnClickOverlay?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* 是否为 `iPhoneX` 留出底部安全距离
|
|
88
|
+
*
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
safeAreaInsetBottom?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface VantActionSheetEvents extends VantTransitionEvents {
|
|
94
|
+
/**
|
|
95
|
+
* 选中选项时触发,禁用或加载状态下不会触发
|
|
96
|
+
*/
|
|
97
|
+
onSelect?: VantEventHandler<VantAction>;
|
|
98
|
+
/**
|
|
99
|
+
* 关闭时触发
|
|
100
|
+
*/
|
|
101
|
+
onClose?: VantEventHandler;
|
|
102
|
+
/**
|
|
103
|
+
* 取消按钮点击时触发
|
|
104
|
+
*/
|
|
105
|
+
onCancel?: VantEventHandler;
|
|
106
|
+
/**
|
|
107
|
+
* 确认按钮点击时触发
|
|
108
|
+
*/
|
|
109
|
+
onConfirm?: VantEventHandler;
|
|
110
|
+
/**
|
|
111
|
+
* 点击遮罩层时触发
|
|
112
|
+
*/
|
|
113
|
+
onClickOverlay?: VantEventHandler;
|
|
114
|
+
}
|
|
115
|
+
export type VantActionSheet = VantComponent<VantActionSheetProps, VantActionSheetEvents>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { VantComponent, VantEventHandler } from '../base';
|
|
2
|
+
export interface VantAreaList {
|
|
3
|
+
province_list: Record<number, string>;
|
|
4
|
+
city_list: Record<number, string>;
|
|
5
|
+
county_list: Record<number, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface VantAreaProps {
|
|
8
|
+
/**
|
|
9
|
+
* 当前选中的省市区`code`
|
|
10
|
+
*/
|
|
11
|
+
value?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 顶部栏标题
|
|
14
|
+
*/
|
|
15
|
+
title?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 省市区数据
|
|
18
|
+
*/
|
|
19
|
+
'area-list'?: VantAreaList;
|
|
20
|
+
/**
|
|
21
|
+
* 省市区显示列数,3-省市区,2-省市,1-省
|
|
22
|
+
*
|
|
23
|
+
* @default 3
|
|
24
|
+
*/
|
|
25
|
+
'columns-num'?: string | number;
|
|
26
|
+
/**
|
|
27
|
+
* 列占位提示文字
|
|
28
|
+
*
|
|
29
|
+
* @default []
|
|
30
|
+
*/
|
|
31
|
+
'columns-placeholder'?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* 是否显示加载状态
|
|
34
|
+
*
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 选项高度
|
|
40
|
+
*
|
|
41
|
+
* @default 44
|
|
42
|
+
*/
|
|
43
|
+
'item-height'?: number;
|
|
44
|
+
/**
|
|
45
|
+
* 可见的选项个数
|
|
46
|
+
*
|
|
47
|
+
* @default 6
|
|
48
|
+
*/
|
|
49
|
+
'visible-item-count'?: number;
|
|
50
|
+
/**
|
|
51
|
+
* 确认按钮文字
|
|
52
|
+
*
|
|
53
|
+
* @default '确认'
|
|
54
|
+
*/
|
|
55
|
+
'confirm-button-text'?: string;
|
|
56
|
+
/**
|
|
57
|
+
* 取消按钮文字
|
|
58
|
+
*
|
|
59
|
+
* @default '取消'
|
|
60
|
+
*/
|
|
61
|
+
'cancel-button-text'?: string;
|
|
62
|
+
/**
|
|
63
|
+
* 是否显示顶部栏
|
|
64
|
+
*
|
|
65
|
+
* @default true
|
|
66
|
+
*
|
|
67
|
+
* @since `v1.10.3`
|
|
68
|
+
*/
|
|
69
|
+
'show-toolbar'?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 选中列数据
|
|
73
|
+
*/
|
|
74
|
+
export interface VantAreaColumn {
|
|
75
|
+
/**
|
|
76
|
+
* 被选中的地区编码
|
|
77
|
+
*/
|
|
78
|
+
code: string;
|
|
79
|
+
/**
|
|
80
|
+
* 被选中的地区名称
|
|
81
|
+
*/
|
|
82
|
+
name: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 基础事件详情
|
|
86
|
+
*/
|
|
87
|
+
export interface VantAreaBaseEventDetail {
|
|
88
|
+
/**
|
|
89
|
+
* 每个数据对应一列选项中被选中项的序号
|
|
90
|
+
*/
|
|
91
|
+
index: number[];
|
|
92
|
+
/**
|
|
93
|
+
* 每个数据对应一列选项中被选中的数据
|
|
94
|
+
*/
|
|
95
|
+
values: VantAreaColumn[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* `bind:change`事件详情
|
|
99
|
+
*/
|
|
100
|
+
export interface VantAreaChangeEventDetail extends VantAreaBaseEventDetail {
|
|
101
|
+
/**
|
|
102
|
+
* Picker 实例
|
|
103
|
+
*/
|
|
104
|
+
picker: Record<string, any>;
|
|
105
|
+
}
|
|
106
|
+
export interface VantAreaEvents {
|
|
107
|
+
/**
|
|
108
|
+
* 点击右上方完成按钮
|
|
109
|
+
*/
|
|
110
|
+
'bind:confirm'?: VantEventHandler<VantAreaBaseEventDetail>;
|
|
111
|
+
/**
|
|
112
|
+
* 点击取消按钮时
|
|
113
|
+
*/
|
|
114
|
+
'bind:cancel'?: VantEventHandler<VantAreaBaseEventDetail>;
|
|
115
|
+
/**
|
|
116
|
+
* 选项改变时触发
|
|
117
|
+
*/
|
|
118
|
+
'bind:change'?: VantEventHandler<VantAreaChangeEventDetail>;
|
|
119
|
+
}
|
|
120
|
+
export type VantArea = VantComponent<VantAreaProps, VantAreaEvents>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="miniprogram-api-typings" />
|
|
2
|
+
/**
|
|
3
|
+
* 普通事件类型
|
|
4
|
+
*/
|
|
5
|
+
export interface VantEvent<Detail = unknown> extends WechatMiniprogram.BaseEvent {
|
|
6
|
+
detail: Detail;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 触摸事件类型
|
|
10
|
+
*/
|
|
11
|
+
export interface VantTouchEvent<Detail = unknown> extends Omit<WechatMiniprogram.TouchEvent, 'detail'>, VantEvent<Detail> {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 普通事件处理类型
|
|
15
|
+
*/
|
|
16
|
+
export type VantEventHandler<Detail = unknown> = (event: VantEvent<Detail>) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Touch 事件处理类型
|
|
19
|
+
*/
|
|
20
|
+
export type VantTouchEventHandler<Detail = unknown> = (event: VantTouchEvent<Detail>) => void;
|
|
21
|
+
/**
|
|
22
|
+
* 触摸坐标详情
|
|
23
|
+
*/
|
|
24
|
+
export interface TouchPositionDetail {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}
|
|
@@ -13,12 +13,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
16
|
exports.__esModule = true;
|
|
20
|
-
exports
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports
|
|
24
|
-
__exportStar(require("./PropTypes"), exports);
|
|
17
|
+
__exportStar(require("./component"), exports);
|
|
18
|
+
__exportStar(require("./events"), exports);
|
|
19
|
+
__exportStar(require("./external-class-name"), exports);
|
|
20
|
+
__exportStar(require("./open-type"), exports);
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/// <reference types="miniprogram-api-typings" />
|
|
2
|
+
export type WechatOpenType =
|
|
3
|
+
/**
|
|
4
|
+
* 打开客服会话,如果用户在会话中点击消息卡片后返回小程序
|
|
5
|
+
*
|
|
6
|
+
* 可以从 `bindcontact` 回调中获得具体信息
|
|
7
|
+
*
|
|
8
|
+
* [具体说明](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html)
|
|
9
|
+
*
|
|
10
|
+
* (*小程序插件中不能使用*)
|
|
11
|
+
*/
|
|
12
|
+
'contact'
|
|
13
|
+
/**
|
|
14
|
+
* 触发用户转发
|
|
15
|
+
*
|
|
16
|
+
* 使用前建议先阅读[使用指引](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引)
|
|
17
|
+
*/
|
|
18
|
+
| 'share'
|
|
19
|
+
/**
|
|
20
|
+
* 获取用户手机号
|
|
21
|
+
*
|
|
22
|
+
* 可以从 `bindgetphonenumber` 回调中获取到用户信息
|
|
23
|
+
*
|
|
24
|
+
* [具体说明](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html)
|
|
25
|
+
*
|
|
26
|
+
* (*小程序插件中不能使用*)
|
|
27
|
+
*/
|
|
28
|
+
| 'getPhoneNumber'
|
|
29
|
+
/**
|
|
30
|
+
* 获取用户信息
|
|
31
|
+
*
|
|
32
|
+
* 可以从 `bindgetuserinfo` 回调中获取到用户信息
|
|
33
|
+
*
|
|
34
|
+
* (*小程序插件中不能使用*)
|
|
35
|
+
*/
|
|
36
|
+
| 'getUserInfo'
|
|
37
|
+
/**
|
|
38
|
+
* 打开 `APP`
|
|
39
|
+
*
|
|
40
|
+
* 以通过 `app-parameter` 属性设定向APP传的参数[具体说明](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html)
|
|
41
|
+
*/
|
|
42
|
+
| 'launchApp'
|
|
43
|
+
/**
|
|
44
|
+
* 打开授权设置页
|
|
45
|
+
*/
|
|
46
|
+
| 'openSetting'
|
|
47
|
+
/**
|
|
48
|
+
* 打开“意见反馈”页面
|
|
49
|
+
*
|
|
50
|
+
* 用户可提交反馈内容并上传[日志](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html)
|
|
51
|
+
*
|
|
52
|
+
* 开发者可以登录小程序[管理后台](https://mp.weixin.qq.com)后进入左侧菜单“客服反馈”页面获取到反馈内容
|
|
53
|
+
*/
|
|
54
|
+
| 'feedback'
|
|
55
|
+
/**
|
|
56
|
+
* 获取用户头像,可以从 `bindchooseavatar` 回调中获取到头像信息
|
|
57
|
+
*/
|
|
58
|
+
| 'chooseAvatar';
|
|
59
|
+
export interface VantOpenTypeProps {
|
|
60
|
+
/**
|
|
61
|
+
* 打开 `APP` 时,向 `APP` 传递的参数
|
|
62
|
+
*
|
|
63
|
+
* @requires `'launchApp'`
|
|
64
|
+
*/
|
|
65
|
+
appParameter?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 指定返回用户信息的语言
|
|
68
|
+
*
|
|
69
|
+
* @requires `'getUserInfo'`
|
|
70
|
+
*
|
|
71
|
+
* `zh_CN` 简体中文
|
|
72
|
+
*
|
|
73
|
+
* `zh_TW` 繁体中文
|
|
74
|
+
*
|
|
75
|
+
* `en` 英文
|
|
76
|
+
*
|
|
77
|
+
* @default 'en'
|
|
78
|
+
*/
|
|
79
|
+
lang?: 'zh_CN' | 'zh_TW' | 'en';
|
|
80
|
+
/**
|
|
81
|
+
* 会话来源
|
|
82
|
+
*
|
|
83
|
+
* @requires `'contact'`
|
|
84
|
+
*/
|
|
85
|
+
sessionFrom?: string;
|
|
86
|
+
/**
|
|
87
|
+
* 客服消息子商户 `id`
|
|
88
|
+
*
|
|
89
|
+
* @requires `'contact'`
|
|
90
|
+
*/
|
|
91
|
+
businessId?: number;
|
|
92
|
+
/**
|
|
93
|
+
* 会话内消息卡片标题
|
|
94
|
+
*
|
|
95
|
+
* @requires `'contact'`
|
|
96
|
+
*
|
|
97
|
+
* @default 当前标题
|
|
98
|
+
*/
|
|
99
|
+
sendMessageTitle?: string;
|
|
100
|
+
/**
|
|
101
|
+
* 会话内消息卡片点击跳转小程序路径
|
|
102
|
+
*
|
|
103
|
+
* @requires `'contact'`
|
|
104
|
+
*
|
|
105
|
+
* @default 当前分享路径
|
|
106
|
+
*/
|
|
107
|
+
sendMessagePath?: string;
|
|
108
|
+
/**
|
|
109
|
+
* sendMessageImg
|
|
110
|
+
*
|
|
111
|
+
* @requires `'contact'`
|
|
112
|
+
*
|
|
113
|
+
* @default '截图'
|
|
114
|
+
*/
|
|
115
|
+
sendMessageImg?: string;
|
|
116
|
+
/**
|
|
117
|
+
* 显示会话内消息卡片
|
|
118
|
+
*
|
|
119
|
+
* @requires `'contact'`
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
showMessageCard?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface VantOpenTypeCamelCaseProps {
|
|
126
|
+
appParameter?: VantOpenTypeProps['appParameter'];
|
|
127
|
+
lang?: VantOpenTypeProps['lang'];
|
|
128
|
+
sessionFrom?: VantOpenTypeProps['sessionFrom'];
|
|
129
|
+
businessId?: VantOpenTypeProps['businessId'];
|
|
130
|
+
sendMessageTitle?: VantOpenTypeProps['sendMessageTitle'];
|
|
131
|
+
sendMessagePath?: VantOpenTypeProps['sendMessagePath'];
|
|
132
|
+
sendMessageImg?: VantOpenTypeProps['sendMessageImg'];
|
|
133
|
+
showMessageCard?: VantOpenTypeProps['showMessageCard'];
|
|
134
|
+
}
|
|
135
|
+
export interface VantOpenTypeEvents {
|
|
136
|
+
/**
|
|
137
|
+
* 用户点击该按钮时,会返回获取到的用户信息,
|
|
138
|
+
* 从返回参数的`detail`中获取到的值同`wx.getUserInfo`
|
|
139
|
+
*
|
|
140
|
+
* @platform WeChat only
|
|
141
|
+
*/
|
|
142
|
+
onGetuserinfo?: (event: WechatMiniprogram.ButtonGetUserInfo) => void;
|
|
143
|
+
/**
|
|
144
|
+
* 客服消息回调
|
|
145
|
+
*
|
|
146
|
+
* @platform WeChat only
|
|
147
|
+
*/
|
|
148
|
+
onContact?: (event: WechatMiniprogram.ButtonContact) => void;
|
|
149
|
+
/**
|
|
150
|
+
* 获取用户手机号回调
|
|
151
|
+
*
|
|
152
|
+
* @platform WeChat only
|
|
153
|
+
*/
|
|
154
|
+
onGetphonenumber?: (event: WechatMiniprogram.ButtonGetPhoneNumber) => void;
|
|
155
|
+
/**
|
|
156
|
+
* 当使用开放能力时,发生错误的回调
|
|
157
|
+
*
|
|
158
|
+
* @platform WeChat only
|
|
159
|
+
*/
|
|
160
|
+
onError?: (event: WechatMiniprogram.ButtonError) => void;
|
|
161
|
+
/**
|
|
162
|
+
* 在打开授权设置页后回调
|
|
163
|
+
*
|
|
164
|
+
* @platform WeChat only
|
|
165
|
+
*/
|
|
166
|
+
onOpensetting?: (event: WechatMiniprogram.ButtonOpenSetting) => void;
|
|
167
|
+
/**
|
|
168
|
+
* 打开 APP 成功的回调
|
|
169
|
+
*
|
|
170
|
+
* `openType="launchApp"`时有效
|
|
171
|
+
*
|
|
172
|
+
* @platform WeChat only
|
|
173
|
+
*/
|
|
174
|
+
onLaunchapp?: (event: WechatMiniprogram.ButtonLaunchApp) => void;
|
|
175
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { VantComponent } from '../base';
|
|
2
|
+
export interface VantBatteryProps {
|
|
3
|
+
/**
|
|
4
|
+
* 横向展示还是竖向展示
|
|
5
|
+
*
|
|
6
|
+
* @default 'vertical'
|
|
7
|
+
*/
|
|
8
|
+
type?: 'horizontal' | 'vertical';
|
|
9
|
+
/**
|
|
10
|
+
* 大小
|
|
11
|
+
*
|
|
12
|
+
* @default 10
|
|
13
|
+
*/
|
|
14
|
+
size?: number;
|
|
15
|
+
/**
|
|
16
|
+
* 值
|
|
17
|
+
*
|
|
18
|
+
* @default 70
|
|
19
|
+
*/
|
|
20
|
+
value?: number;
|
|
21
|
+
/**
|
|
22
|
+
* 进度条颜色,传入对象格式可以定义渐变色
|
|
23
|
+
*
|
|
24
|
+
* @default '#1989fa'
|
|
25
|
+
*/
|
|
26
|
+
color?: string | Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* 电量高的颜色
|
|
29
|
+
*
|
|
30
|
+
* @default '#70CF98'
|
|
31
|
+
*/
|
|
32
|
+
'high-color'?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 电量中的颜色
|
|
35
|
+
*
|
|
36
|
+
* @default '#F5A623'
|
|
37
|
+
*/
|
|
38
|
+
'middle-color'?: string;
|
|
39
|
+
/**
|
|
40
|
+
* 电量低的颜色
|
|
41
|
+
*
|
|
42
|
+
* @default '#FF4444'
|
|
43
|
+
*/
|
|
44
|
+
'low-color'?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 电量背景色
|
|
47
|
+
*
|
|
48
|
+
* @default 'rgba(0, 0, 0, .5)'
|
|
49
|
+
*/
|
|
50
|
+
'background-color'?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 电量颜色计算规则回调函数,返回计算后的颜色值即可
|
|
53
|
+
*
|
|
54
|
+
* @default null
|
|
55
|
+
*/
|
|
56
|
+
'on-calc-color'?: () => string;
|
|
57
|
+
}
|
|
58
|
+
export type VantBattery = VantComponent<VantBatteryProps>;
|