@ray-js/smart-ui 1.3.1-beta-4 → 2.0.0-beta-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/dist/@types/bottom-sheet/index.d.ts +79 -0
- package/dist/@types/bottom-sheet/index.js +2 -0
- package/dist/@types/calendar/index.d.ts +2 -2
- package/dist/@types/checkbox/index.d.ts +17 -1
- package/dist/@types/collapse-item/index.d.ts +29 -1
- package/dist/@types/empty/index.d.ts +34 -3
- package/dist/@types/field/index.d.ts +5 -1
- package/dist/@types/image/index.d.ts +21 -1
- package/dist/@types/index.d.ts +2 -0
- package/dist/@types/index.js +2 -0
- package/dist/@types/nav-bar/index.d.ts +45 -0
- package/dist/@types/notice-bar/index.d.ts +108 -5
- package/dist/@types/picker/index.d.ts +13 -0
- package/dist/@types/search/index.d.ts +41 -5
- package/dist/@types/switch/index.d.ts +6 -0
- package/dist/@types/tabbar/index.d.ts +1 -1
- package/dist/@types/tabs/index.d.ts +31 -0
- package/dist/bottom-sheet/BottomSheet.d.ts +2 -0
- package/dist/bottom-sheet/BottomSheet.js +9 -0
- package/dist/bottom-sheet/PropTypes.d.ts +2 -0
- package/dist/bottom-sheet/PropTypes.js +2 -0
- package/dist/bottom-sheet/index.d.ts +5 -0
- package/dist/bottom-sheet/index.js +24 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/package.json +4 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { SmartBaseExternalClassName, SmartComponent, SmartEventHandler } from '../base';
|
|
2
|
+
import { SmartTransitionEvents } from '../transition';
|
|
3
|
+
export interface SmartBottomSheetProps {
|
|
4
|
+
/**
|
|
5
|
+
* 是否显示动作面板
|
|
6
|
+
*/
|
|
7
|
+
show?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 标题
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 标题中关闭按钮的颜色
|
|
14
|
+
* @default --app-B4-N3 || rgba(0, 0, 0, 0.5)
|
|
15
|
+
*/
|
|
16
|
+
iconColor?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 标题中关闭按钮的大小
|
|
19
|
+
* @default 24
|
|
20
|
+
*/
|
|
21
|
+
iconSize?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 是否显示圆角
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
round?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* `z-index` 层级
|
|
29
|
+
*
|
|
30
|
+
* @default 100
|
|
31
|
+
*/
|
|
32
|
+
zIndex?: number;
|
|
33
|
+
/**
|
|
34
|
+
* 是否显示遮罩层
|
|
35
|
+
*/
|
|
36
|
+
overlay?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 点击遮罩是否关闭菜单
|
|
39
|
+
*/
|
|
40
|
+
closeOnClickOverlay?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface SmartBottomSheetEvents extends SmartTransitionEvents {
|
|
43
|
+
/**
|
|
44
|
+
* 关闭时触发
|
|
45
|
+
*/
|
|
46
|
+
onClose?: SmartEventHandler;
|
|
47
|
+
/**
|
|
48
|
+
* 遮罩进入前触发
|
|
49
|
+
*/
|
|
50
|
+
onBeforeEnter?: SmartEventHandler;
|
|
51
|
+
/**
|
|
52
|
+
* 遮罩进入中触发
|
|
53
|
+
*/
|
|
54
|
+
onEnter?: SmartEventHandler;
|
|
55
|
+
/**
|
|
56
|
+
* 遮罩进入后触发
|
|
57
|
+
*/
|
|
58
|
+
onAfterEnter?: SmartEventHandler;
|
|
59
|
+
/**
|
|
60
|
+
* 遮罩离开前触发
|
|
61
|
+
*/
|
|
62
|
+
onBeforeLeave?: SmartEventHandler;
|
|
63
|
+
/**
|
|
64
|
+
* 遮罩离开中触发
|
|
65
|
+
*/
|
|
66
|
+
onLeave?: SmartEventHandler;
|
|
67
|
+
/**
|
|
68
|
+
* 遮罩离开后触发
|
|
69
|
+
*/
|
|
70
|
+
onAfterLeave?: SmartEventHandler;
|
|
71
|
+
/**
|
|
72
|
+
* 点击遮罩层时触发
|
|
73
|
+
*/
|
|
74
|
+
onClickOverlay?: SmartEventHandler;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Since 2.0.0
|
|
78
|
+
*/
|
|
79
|
+
export type SmartBottomSheet = SmartComponent<SmartBottomSheetProps, SmartBottomSheetEvents, SmartBaseExternalClassName>;
|
|
@@ -117,13 +117,13 @@ export interface SmartCalendarProps extends SmartCalendarRangeProps, SmartCalend
|
|
|
117
117
|
*
|
|
118
118
|
* `single` 表示选择单个日期
|
|
119
119
|
*
|
|
120
|
-
* `
|
|
120
|
+
* `week` 表示选择一个周
|
|
121
121
|
*
|
|
122
122
|
* `range` 表示选择日期区间
|
|
123
123
|
*
|
|
124
124
|
* @default 'single'
|
|
125
125
|
*/
|
|
126
|
-
type?: 'single' | '
|
|
126
|
+
type?: 'single' | 'week' | 'range' | 'month' | 'year';
|
|
127
127
|
/**
|
|
128
128
|
* 日历标题
|
|
129
129
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="miniprogram-api-typings" />
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { SmartBaseExternalClassName, SmartComponent, SmartEventHandler } from '../base';
|
|
3
4
|
interface OtherProps {
|
|
4
5
|
/**
|
|
@@ -81,5 +82,20 @@ export interface SmartCheckboxExternalClassName extends SmartBaseExternalClassNa
|
|
|
81
82
|
*/
|
|
82
83
|
labelClass?: string;
|
|
83
84
|
}
|
|
84
|
-
export
|
|
85
|
+
export interface SmartCheckboxSlot {
|
|
86
|
+
/**
|
|
87
|
+
* 自定义文本
|
|
88
|
+
*/
|
|
89
|
+
children?: React.ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* Checkbox Slot
|
|
92
|
+
*/
|
|
93
|
+
slot?: {
|
|
94
|
+
/**
|
|
95
|
+
* 自定义图标
|
|
96
|
+
*/
|
|
97
|
+
icon?: React.ReactNode;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export type SmartCheckbox = SmartComponent<SmartCheckboxProps, SmartCheckboxEvents, SmartCheckboxExternalClassName, SmartCheckboxSlot>;
|
|
85
101
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { SmartBaseExternalClassName, SmartComponent } from '../base';
|
|
2
3
|
export interface SmartCollapseItemProps {
|
|
3
4
|
/**
|
|
@@ -51,10 +52,37 @@ export interface SmartCollapseItemProps {
|
|
|
51
52
|
*/
|
|
52
53
|
size?: 'large';
|
|
53
54
|
}
|
|
55
|
+
export interface SmartCollapseItemSlot {
|
|
56
|
+
/**
|
|
57
|
+
* 自定义底部内容
|
|
58
|
+
*/
|
|
59
|
+
children?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Empty Slot
|
|
62
|
+
*/
|
|
63
|
+
slot?: {
|
|
64
|
+
/**
|
|
65
|
+
* 标题
|
|
66
|
+
*/
|
|
67
|
+
title?: React.ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* icon
|
|
70
|
+
*/
|
|
71
|
+
icon?: React.ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* 值
|
|
74
|
+
*/
|
|
75
|
+
value?: React.ReactNode;
|
|
76
|
+
/**
|
|
77
|
+
* 右侧图标
|
|
78
|
+
*/
|
|
79
|
+
rightIcon?: React.ReactNode;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
54
82
|
export interface SmartCollapseItemExternalClassName extends SmartBaseExternalClassName {
|
|
55
83
|
/**
|
|
56
84
|
* 内容样式类
|
|
57
85
|
*/
|
|
58
86
|
contentClass?: string;
|
|
59
87
|
}
|
|
60
|
-
export type SmartCollapseItem = SmartComponent<SmartCollapseItemProps, {}, SmartCollapseItemExternalClassName>;
|
|
88
|
+
export type SmartCollapseItem = SmartComponent<SmartCollapseItemProps, {}, SmartCollapseItemExternalClassName, SmartCollapseItemSlot>;
|
|
@@ -2,15 +2,45 @@
|
|
|
2
2
|
import { SmartBaseExternalClassName, SmartComponent } from '../base';
|
|
3
3
|
export interface SmartEmptyProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 图片,支持传入图片 URL
|
|
6
6
|
*
|
|
7
7
|
* @default 'default'
|
|
8
8
|
*/
|
|
9
|
-
image?: 'default' |
|
|
9
|
+
image?: 'default' | string;
|
|
10
|
+
/**
|
|
11
|
+
* 图片下方的标题
|
|
12
|
+
*
|
|
13
|
+
* @default ''
|
|
14
|
+
* @since `v2.0.0`
|
|
15
|
+
*/
|
|
16
|
+
title?: string;
|
|
10
17
|
/**
|
|
11
18
|
* 图片下方的描述文字
|
|
19
|
+
*
|
|
20
|
+
* @default ''
|
|
12
21
|
*/
|
|
13
22
|
description?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 图片的样式
|
|
25
|
+
*
|
|
26
|
+
* @default ''
|
|
27
|
+
* @since `v2.0.0`
|
|
28
|
+
*/
|
|
29
|
+
imageStyle?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 标题的样式
|
|
32
|
+
*
|
|
33
|
+
* @default ''
|
|
34
|
+
* @since `v2.0.0`
|
|
35
|
+
*/
|
|
36
|
+
titleStyle?: string;
|
|
37
|
+
/**
|
|
38
|
+
* 描述文字的样式
|
|
39
|
+
*
|
|
40
|
+
* @default ''
|
|
41
|
+
* @since `v2.0.0`
|
|
42
|
+
*/
|
|
43
|
+
descriptionStyle?: string;
|
|
14
44
|
}
|
|
15
45
|
export interface SmartEmptySlot {
|
|
16
46
|
/**
|
|
@@ -23,8 +53,9 @@ export interface SmartEmptySlot {
|
|
|
23
53
|
slot?: {
|
|
24
54
|
/**
|
|
25
55
|
* 自定义图标
|
|
56
|
+
* @since `v2.0.0`
|
|
26
57
|
*/
|
|
27
|
-
|
|
58
|
+
title?: React.ReactNode;
|
|
28
59
|
/**
|
|
29
60
|
* 自定义描述文字
|
|
30
61
|
*/
|
|
@@ -23,7 +23,7 @@ export interface SmartFieldProps {
|
|
|
23
23
|
*
|
|
24
24
|
* @default 'text'
|
|
25
25
|
*/
|
|
26
|
-
type?: 'number' | 'idcard' | 'textarea' | 'digit' | 'text' | 'safe-password' | 'nickname';
|
|
26
|
+
type?: 'number' | 'idcard' | 'textarea' | 'digit' | 'text' | 'safe-password' | 'nickname' | 'password';
|
|
27
27
|
/**
|
|
28
28
|
* 如果`type`为`textarea`且在一个`position:fixed`的区域,需要显示指定属性`fixed`为`true`
|
|
29
29
|
*
|
|
@@ -303,6 +303,10 @@ export interface SmartFieldEvents {
|
|
|
303
303
|
* 点击输入区域时触发
|
|
304
304
|
*/
|
|
305
305
|
onClickInput?: SmartEventHandler<TouchPositionDetail>;
|
|
306
|
+
/**
|
|
307
|
+
* 点击清空控件时触发
|
|
308
|
+
*/
|
|
309
|
+
onTap?: SmartEventHandler;
|
|
306
310
|
/**
|
|
307
311
|
* 输入框行数变化时调用,只对 `textarea` 有效
|
|
308
312
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TouchPositionDetail, SmartBaseExternalClassName, SmartBaseLoadingExternalClassName, SmartComponent, SmartEventHandler } from '../base';
|
|
2
3
|
export interface SmartImageProps {
|
|
3
4
|
/**
|
|
@@ -114,4 +115,23 @@ export interface SmartImageExternalClassName extends SmartBaseExternalClassName,
|
|
|
114
115
|
*/
|
|
115
116
|
errorClass?: string;
|
|
116
117
|
}
|
|
117
|
-
export
|
|
118
|
+
export interface SmartImageSlot {
|
|
119
|
+
/**
|
|
120
|
+
* 自定义底部内容
|
|
121
|
+
*/
|
|
122
|
+
children?: React.ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* Empty Slot
|
|
125
|
+
*/
|
|
126
|
+
slot?: {
|
|
127
|
+
/**
|
|
128
|
+
* loading 图标
|
|
129
|
+
*/
|
|
130
|
+
loading?: React.ReactNode;
|
|
131
|
+
/**
|
|
132
|
+
* error 图标
|
|
133
|
+
*/
|
|
134
|
+
error?: React.ReactNode;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export type SmartImage = SmartComponent<SmartImageProps, SmartImageEvents, SmartImageExternalClassName, SmartImageSlot>;
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './action-sheet';
|
|
2
2
|
export * from './base';
|
|
3
3
|
export * from './button';
|
|
4
|
+
export * from './bottom-sheet';
|
|
4
5
|
export * from './calendar';
|
|
5
6
|
export * from './cell';
|
|
6
7
|
export * from './cell-group';
|
|
@@ -60,3 +61,4 @@ export * from './tree-select';
|
|
|
60
61
|
export * from './cascader';
|
|
61
62
|
export * from './battery';
|
|
62
63
|
export * from './custom-keyboard';
|
|
64
|
+
export * from './bottom-sheet';
|
package/dist/@types/index.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.__esModule = true;
|
|
|
17
17
|
__exportStar(require("./action-sheet"), exports);
|
|
18
18
|
__exportStar(require("./base"), exports);
|
|
19
19
|
__exportStar(require("./button"), exports);
|
|
20
|
+
__exportStar(require("./bottom-sheet"), exports);
|
|
20
21
|
__exportStar(require("./calendar"), exports);
|
|
21
22
|
__exportStar(require("./cell"), exports);
|
|
22
23
|
__exportStar(require("./cell-group"), exports);
|
|
@@ -76,3 +77,4 @@ __exportStar(require("./tree-select"), exports);
|
|
|
76
77
|
__exportStar(require("./cascader"), exports);
|
|
77
78
|
__exportStar(require("./battery"), exports);
|
|
78
79
|
__exportStar(require("./custom-keyboard"), exports);
|
|
80
|
+
__exportStar(require("./bottom-sheet"), exports);
|
|
@@ -13,6 +13,27 @@ export interface SmartNavBarProps {
|
|
|
13
13
|
* @default ''
|
|
14
14
|
*/
|
|
15
15
|
leftText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 左侧文案样式类型,默认为 back
|
|
18
|
+
*
|
|
19
|
+
* @version 2.0.0
|
|
20
|
+
* @default 'back'
|
|
21
|
+
*/
|
|
22
|
+
leftTextType?: 'home' | 'title' | 'back';
|
|
23
|
+
/**
|
|
24
|
+
* 左侧 Icon
|
|
25
|
+
*
|
|
26
|
+
* @version 2.0.0
|
|
27
|
+
* @default ''
|
|
28
|
+
*/
|
|
29
|
+
leftIcon?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 左侧 Icon 大小,默认为 32
|
|
32
|
+
*
|
|
33
|
+
* @version 2.0.0
|
|
34
|
+
* @default 32
|
|
35
|
+
*/
|
|
36
|
+
leftIconSize?: string | number;
|
|
16
37
|
/**
|
|
17
38
|
* 右侧文案
|
|
18
39
|
*
|
|
@@ -69,12 +90,36 @@ export interface SmartNavBarEvents {
|
|
|
69
90
|
* 点击右侧按钮时触发
|
|
70
91
|
*/
|
|
71
92
|
onClickRight?: SmartEventHandler;
|
|
93
|
+
/**
|
|
94
|
+
* 点击中央标题时触发
|
|
95
|
+
*
|
|
96
|
+
* @version 2.0.0
|
|
97
|
+
*/
|
|
98
|
+
onClickTitle?: SmartEventHandler;
|
|
99
|
+
/**
|
|
100
|
+
* 点击左侧 icon 时触发
|
|
101
|
+
*
|
|
102
|
+
* @version 2.0.0
|
|
103
|
+
*/
|
|
104
|
+
onClickLeftIcon?: SmartEventHandler;
|
|
105
|
+
/**
|
|
106
|
+
* 点击左侧文本时触发
|
|
107
|
+
*
|
|
108
|
+
* @version 2.0.0
|
|
109
|
+
*/
|
|
110
|
+
onClickLeftText?: SmartEventHandler;
|
|
72
111
|
}
|
|
73
112
|
export interface SmartNavBarExternalClassName extends SmartBaseExternalClassName {
|
|
74
113
|
/**
|
|
75
114
|
* 标题样式类
|
|
76
115
|
*/
|
|
77
116
|
titleClass?: string;
|
|
117
|
+
/**
|
|
118
|
+
* 左侧 Icon 样式类
|
|
119
|
+
*
|
|
120
|
+
* @version 2.0.0
|
|
121
|
+
*/
|
|
122
|
+
leftIconClass?: string;
|
|
78
123
|
}
|
|
79
124
|
export interface SmartNavBarSlot {
|
|
80
125
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TouchPositionDetail, SmartBaseExternalClassName, SmartComponent, SmartEventHandler, SmartTouchEventHandler } from '../base';
|
|
2
3
|
export interface SmartNoticeBarProps {
|
|
3
4
|
/**
|
|
@@ -6,28 +7,107 @@ export interface SmartNoticeBarProps {
|
|
|
6
7
|
* @default ''
|
|
7
8
|
*/
|
|
8
9
|
mode?: 'closeable' | 'link';
|
|
10
|
+
/**
|
|
11
|
+
* 通知栏类型
|
|
12
|
+
*
|
|
13
|
+
* @default 'info'
|
|
14
|
+
*
|
|
15
|
+
* @since `v2.0.0`
|
|
16
|
+
*/
|
|
17
|
+
type?: 'info' | 'warning' | 'error';
|
|
9
18
|
/**
|
|
10
19
|
* 通知文本内容
|
|
11
20
|
*
|
|
12
21
|
* @default ''
|
|
13
22
|
*/
|
|
14
23
|
text?: string;
|
|
24
|
+
/**
|
|
25
|
+
* 文本结尾处的按钮文本内容
|
|
26
|
+
*
|
|
27
|
+
* @default ''
|
|
28
|
+
* @since `v2.0.0`
|
|
29
|
+
*/
|
|
30
|
+
btnText?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 按钮文本颜色
|
|
33
|
+
*
|
|
34
|
+
* @default ''
|
|
35
|
+
* @since `v2.0.0`
|
|
36
|
+
*/
|
|
37
|
+
btnTextColor?: string;
|
|
15
38
|
/**
|
|
16
39
|
* 通知文本颜色
|
|
17
40
|
*
|
|
18
|
-
* @default '
|
|
41
|
+
* @default ''
|
|
19
42
|
*/
|
|
20
43
|
color?: string;
|
|
21
44
|
/**
|
|
22
|
-
*
|
|
45
|
+
* 背景
|
|
23
46
|
*
|
|
24
|
-
* @default '
|
|
47
|
+
* @default ''
|
|
25
48
|
*/
|
|
26
49
|
background?: string;
|
|
27
50
|
/**
|
|
28
|
-
*
|
|
51
|
+
* 左侧图标链接,同icon组件name属性
|
|
52
|
+
*
|
|
53
|
+
* @default ''
|
|
29
54
|
*/
|
|
30
55
|
leftIcon?: string;
|
|
56
|
+
/**
|
|
57
|
+
* link 模式时,点击组件的跳转路由地址
|
|
58
|
+
*
|
|
59
|
+
* @since `v2.0.0`
|
|
60
|
+
*/
|
|
61
|
+
url?: string;
|
|
62
|
+
/**
|
|
63
|
+
* link 模式时,点击组件的跳转路由方法
|
|
64
|
+
*
|
|
65
|
+
* @default 'navigateTo'
|
|
66
|
+
* @since `v2.0.0`
|
|
67
|
+
*/
|
|
68
|
+
openType?: 'navigateTo' | 'navigateTo';
|
|
69
|
+
/**
|
|
70
|
+
* 右侧图标颜色
|
|
71
|
+
*
|
|
72
|
+
* @default 'rgba(0, 0, 0, 0.2)'
|
|
73
|
+
* @since `v2.0.0`
|
|
74
|
+
*/
|
|
75
|
+
rightIconColor?: string;
|
|
76
|
+
/**
|
|
77
|
+
* 左侧图标颜色,默认在不同的type类型下会有对应的初始颜色
|
|
78
|
+
*
|
|
79
|
+
* @default ''
|
|
80
|
+
* @since `v2.0.0`
|
|
81
|
+
*/
|
|
82
|
+
leftIconColor?: string;
|
|
83
|
+
/**
|
|
84
|
+
* 跟节点样式
|
|
85
|
+
*
|
|
86
|
+
* @default ''
|
|
87
|
+
* @since `v2.0.0`
|
|
88
|
+
*/
|
|
89
|
+
customStyle?: string;
|
|
90
|
+
/**
|
|
91
|
+
* 跟节点点击时的样式类
|
|
92
|
+
*
|
|
93
|
+
* @default ''
|
|
94
|
+
* @since `v2.0.0`
|
|
95
|
+
*/
|
|
96
|
+
customHoverClass?: string;
|
|
97
|
+
/**
|
|
98
|
+
* 右侧图标样式
|
|
99
|
+
*
|
|
100
|
+
* @default ''
|
|
101
|
+
* @since `v2.0.0`
|
|
102
|
+
*/
|
|
103
|
+
rightIconStyle?: string;
|
|
104
|
+
/**
|
|
105
|
+
* 左侧图标样式
|
|
106
|
+
*
|
|
107
|
+
* @default ''
|
|
108
|
+
* @since `v2.0.0`
|
|
109
|
+
*/
|
|
110
|
+
leftIconStyle?: string;
|
|
31
111
|
/**
|
|
32
112
|
* 动画延迟时间 (s)
|
|
33
113
|
*
|
|
@@ -56,10 +136,33 @@ export interface SmartNoticeBarEvents {
|
|
|
56
136
|
* 点击通知栏时触发
|
|
57
137
|
*/
|
|
58
138
|
onClick?: SmartTouchEventHandler;
|
|
139
|
+
/**
|
|
140
|
+
* 点击文末按钮文本时的触发
|
|
141
|
+
*/
|
|
142
|
+
btnClick?: SmartTouchEventHandler;
|
|
59
143
|
/**
|
|
60
144
|
* 关闭通知栏时触发
|
|
61
145
|
*/
|
|
62
146
|
onClose?: SmartEventHandler<TouchPositionDetail>;
|
|
63
147
|
}
|
|
148
|
+
export interface SmartNoticeBarSlot {
|
|
149
|
+
/**
|
|
150
|
+
* 通知文本内容,仅在 `text` 属性为空时有效
|
|
151
|
+
*/
|
|
152
|
+
children?: React.ReactNode;
|
|
153
|
+
/**
|
|
154
|
+
* NoticeBar Slot
|
|
155
|
+
*/
|
|
156
|
+
slot?: {
|
|
157
|
+
/**
|
|
158
|
+
* 自定义左侧图标
|
|
159
|
+
*/
|
|
160
|
+
leftIcon?: React.ReactNode;
|
|
161
|
+
/**
|
|
162
|
+
* 自定义右侧图标
|
|
163
|
+
*/
|
|
164
|
+
rightIcon?: React.ReactNode;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
64
167
|
export type SmartNoticeBarExternalClassName = SmartBaseExternalClassName;
|
|
65
|
-
export type SmartNoticeBar = SmartComponent<SmartNoticeBarProps, SmartNoticeBarEvents, SmartNoticeBarExternalClassName>;
|
|
168
|
+
export type SmartNoticeBar = SmartComponent<SmartNoticeBarProps, SmartNoticeBarEvents, SmartNoticeBarExternalClassName, SmartNoticeBarSlot>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SmartBaseExternalClassName, SmartComponent, SmartEventHandler } from '../base';
|
|
2
3
|
export type SmartPickerSingleColumn = string | Record<string, unknown>;
|
|
3
4
|
export interface SmartPickerMultipleColumn {
|
|
@@ -5,6 +6,11 @@ export interface SmartPickerMultipleColumn {
|
|
|
5
6
|
* 列中对应的备选值
|
|
6
7
|
*/
|
|
7
8
|
values: SmartPickerSingleColumn[];
|
|
9
|
+
/**
|
|
10
|
+
* 列的样式
|
|
11
|
+
* @version v2.0.0
|
|
12
|
+
*/
|
|
13
|
+
style?: React.CSSProperties;
|
|
8
14
|
/**
|
|
9
15
|
* 初始选中项的索引,默认为 `0`
|
|
10
16
|
*
|
|
@@ -102,6 +108,12 @@ export interface SmartPickerProps {
|
|
|
102
108
|
* @default 0
|
|
103
109
|
*/
|
|
104
110
|
unit?: string;
|
|
111
|
+
/**
|
|
112
|
+
* 选中状态的样式
|
|
113
|
+
* @version 2.0.0
|
|
114
|
+
* @default ''
|
|
115
|
+
*/
|
|
116
|
+
activeStyle?: React.CSSProperties;
|
|
105
117
|
}
|
|
106
118
|
export interface SmartPickerBaseEventDetail {
|
|
107
119
|
index: number | number[];
|
|
@@ -140,6 +152,7 @@ export interface SmartPickerEvents {
|
|
|
140
152
|
export interface SmartPickerExternalClassName extends SmartBaseExternalClassName {
|
|
141
153
|
/**
|
|
142
154
|
* 选中项样式类
|
|
155
|
+
* @deprecated
|
|
143
156
|
*/
|
|
144
157
|
activeClass?: string;
|
|
145
158
|
/**
|
|
@@ -24,7 +24,6 @@ export interface SmartSearchProps {
|
|
|
24
24
|
/**
|
|
25
25
|
* 搜索框背景色
|
|
26
26
|
*
|
|
27
|
-
* @default '#f2f2f2'
|
|
28
27
|
*/
|
|
29
28
|
background?: string;
|
|
30
29
|
/**
|
|
@@ -34,9 +33,10 @@ export interface SmartSearchProps {
|
|
|
34
33
|
*/
|
|
35
34
|
showAction?: boolean;
|
|
36
35
|
/**
|
|
37
|
-
*
|
|
36
|
+
* 取取消按钮文本
|
|
37
|
+
* @default 'cancel'
|
|
38
38
|
*/
|
|
39
|
-
actionText
|
|
39
|
+
actionText?: string;
|
|
40
40
|
/**
|
|
41
41
|
* 获取焦点
|
|
42
42
|
*
|
|
@@ -75,7 +75,7 @@ export interface SmartSearchProps {
|
|
|
75
75
|
*/
|
|
76
76
|
clearTrigger?: 'always' | 'focus';
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* 清除图标svg字符串或图片链接
|
|
79
79
|
*
|
|
80
80
|
* @default 'clear'
|
|
81
81
|
*/
|
|
@@ -128,6 +128,42 @@ export interface SmartSearchProps {
|
|
|
128
128
|
* 输入框右侧图标名称或图片链接,可选值见`Icon`组件(如果设置了`use-right-icon-slot`,则该属性无效)
|
|
129
129
|
*/
|
|
130
130
|
rightIcon?: string;
|
|
131
|
+
/**
|
|
132
|
+
* 搜索按钮文本
|
|
133
|
+
* @default 'Search'
|
|
134
|
+
* @version v2.0.0
|
|
135
|
+
*/
|
|
136
|
+
searchText?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface SmartSearchSlot {
|
|
139
|
+
/**
|
|
140
|
+
* Field Slot
|
|
141
|
+
*/
|
|
142
|
+
slot?: {
|
|
143
|
+
/**
|
|
144
|
+
* 自定义搜索框右侧按钮
|
|
145
|
+
* 需要在`useActionSlot`为 true 时才会启效
|
|
146
|
+
*/
|
|
147
|
+
action?: React.ReactNode;
|
|
148
|
+
/**
|
|
149
|
+
* 自定义搜索框左侧文本,如果设置了label属性则不生效
|
|
150
|
+
*/
|
|
151
|
+
label?: React.ReactNode;
|
|
152
|
+
/**
|
|
153
|
+
* 自定义搜索框左侧文本
|
|
154
|
+
* 需要在`useLeftIconSlot`为 true 时才会启效
|
|
155
|
+
*/
|
|
156
|
+
leftIcon?: React.ReactNode;
|
|
157
|
+
/**
|
|
158
|
+
* 自定义输入框尾部图标
|
|
159
|
+
* 需要在`useRightIconSlot`为 true 时才会启效
|
|
160
|
+
*/
|
|
161
|
+
rightIcon?: React.ReactNode;
|
|
162
|
+
/**
|
|
163
|
+
* 自定义搜索按钮
|
|
164
|
+
*/
|
|
165
|
+
searchButton?: React.ReactNode;
|
|
166
|
+
};
|
|
131
167
|
}
|
|
132
168
|
/**
|
|
133
169
|
* @deprecated
|
|
@@ -159,4 +195,4 @@ export interface SmartSearchExternalClassName extends SmartBaseExternalClassName
|
|
|
159
195
|
*/
|
|
160
196
|
cancelClass?: string;
|
|
161
197
|
}
|
|
162
|
-
export type SmartSearch = SmartComponent<SmartSearchProps, SmartSearchEvents, SmartSearchExternalClassName>;
|
|
198
|
+
export type SmartSearch = SmartComponent<SmartSearchProps, SmartSearchEvents, SmartSearchExternalClassName, SmartSearchSlot>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="miniprogram-api-typings" />
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { SmartBaseExternalClassName, SmartComponent, SmartEventHandler } from '../base';
|
|
3
4
|
export interface SmartSwitchProps {
|
|
4
5
|
/**
|
|
@@ -29,6 +30,11 @@ export interface SmartSwitchProps {
|
|
|
29
30
|
* @default '30px'
|
|
30
31
|
*/
|
|
31
32
|
size?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 样式
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
style?: React.CSSProperties;
|
|
32
38
|
/**
|
|
33
39
|
* 打开时的背景色
|
|
34
40
|
*
|
|
@@ -95,6 +95,11 @@ export interface SmartTabsProps {
|
|
|
95
95
|
* @default 1
|
|
96
96
|
*/
|
|
97
97
|
zIndex?: number;
|
|
98
|
+
/**
|
|
99
|
+
* 是否开启切换前校验
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
useBeforeChange?: boolean;
|
|
98
103
|
}
|
|
99
104
|
/**
|
|
100
105
|
* @deprecated
|
|
@@ -124,6 +129,28 @@ export interface SmartTabsScrollEventDetail {
|
|
|
124
129
|
*/
|
|
125
130
|
isFixed: boolean;
|
|
126
131
|
}
|
|
132
|
+
export interface SmartTabsBeforeEventDetail {
|
|
133
|
+
/**
|
|
134
|
+
* 标题
|
|
135
|
+
*/
|
|
136
|
+
title: string;
|
|
137
|
+
/**
|
|
138
|
+
* 索引
|
|
139
|
+
*/
|
|
140
|
+
index: number;
|
|
141
|
+
/**
|
|
142
|
+
* 名称
|
|
143
|
+
*/
|
|
144
|
+
name: string;
|
|
145
|
+
/**
|
|
146
|
+
* 是否吸顶
|
|
147
|
+
*/
|
|
148
|
+
isFixed: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* 继续执行回调
|
|
151
|
+
*/
|
|
152
|
+
callback: (status?: boolean) => void;
|
|
153
|
+
}
|
|
127
154
|
export interface SmartTabsEvents {
|
|
128
155
|
/**
|
|
129
156
|
* 点击标签时触发
|
|
@@ -141,6 +168,10 @@ export interface SmartTabsEvents {
|
|
|
141
168
|
* 滚动时触发
|
|
142
169
|
*/
|
|
143
170
|
onScroll?: SmartEventHandler<SmartTabsScrollEventDetail>;
|
|
171
|
+
/**
|
|
172
|
+
* 切换之前的回调
|
|
173
|
+
*/
|
|
174
|
+
onBeforeChange?: SmartEventHandler<SmartTabsBeforeEventDetail>;
|
|
144
175
|
}
|
|
145
176
|
export interface SmartTabsExternalClassName extends SmartBaseExternalClassName {
|
|
146
177
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
var index_1 = __importDefault(require("@tuya-miniapp/smart-ui/lib/bottom-sheet/index"));
|
|
8
|
+
var withReactProps_1 = require("../common/withReactProps");
|
|
9
|
+
exports["default"] = (0, withReactProps_1.withReactProps)(index_1["default"]);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
exports.__esModule = true;
|
|
20
|
+
exports.BottomSheet = void 0;
|
|
21
|
+
var BottomSheet_1 = __importDefault(require("./BottomSheet"));
|
|
22
|
+
var BottomSheet = BottomSheet_1["default"];
|
|
23
|
+
exports.BottomSheet = BottomSheet;
|
|
24
|
+
__exportStar(require("./PropTypes"), exports);
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -17,7 +17,8 @@ exports.__esModule = true;
|
|
|
17
17
|
__exportStar(require("./action-sheet"), exports);
|
|
18
18
|
__exportStar(require("./base"), exports);
|
|
19
19
|
__exportStar(require("./button"), exports);
|
|
20
|
-
|
|
20
|
+
__exportStar(require("./bottom-sheet"), exports);
|
|
21
|
+
__exportStar(require("./calendar"), exports);
|
|
21
22
|
__exportStar(require("./cascader"), exports);
|
|
22
23
|
__exportStar(require("./cell"), exports);
|
|
23
24
|
__exportStar(require("./cell-group"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/smart-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta-2",
|
|
4
4
|
"author": "MiniApp Team",
|
|
5
5
|
"description": "轻量、可靠的智能小程序 UI 组件库",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@ray-js/components-ty-progress-bar": "^0.1.1",
|
|
38
38
|
"@ray-js/components-ty-progress-circle": "^0.1.6",
|
|
39
39
|
"@ray-js/components-ty-slider": "^0.2.48",
|
|
40
|
-
"@tuya-miniapp/smart-ui": "
|
|
40
|
+
"@tuya-miniapp/smart-ui": "2.0.0-beta-2",
|
|
41
41
|
"lodash-es": "^4.17.21"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@commitlint/config-conventional": "^9.0.1",
|
|
47
47
|
"@ray-js/cli": "^1.5.6",
|
|
48
48
|
"@ray-js/code-sandbox": "0.0.3-beta-3",
|
|
49
|
-
"@ray-js/panel-sdk": "^1.13.0
|
|
49
|
+
"@ray-js/panel-sdk": "^1.13.0",
|
|
50
50
|
"@ray-js/ray": "^1.5.34",
|
|
51
|
-
"@tuya-miniapp/icons": "^
|
|
51
|
+
"@tuya-miniapp/icons": "^2.0.0",
|
|
52
52
|
"@types/fs-extra": "^9.0.13",
|
|
53
53
|
"@types/lodash-es": "^4.17.12",
|
|
54
54
|
"@types/react": "^17.0.25",
|