@ray-js/components 1.7.79 → 1.7.80
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/lib/Button/props.d.ts +38 -64
- package/lib/Button/props.js +23 -2
- package/lib/Checkbox/props.d.ts +25 -20
- package/lib/Checkbox/props.js +22 -1
- package/lib/CheckboxGroup/props.d.ts +52 -24
- package/lib/CheckboxGroup/props.js +34 -1
- package/lib/CoverView/props.d.ts +3 -1
- package/lib/Form/props.d.ts +39 -22
- package/lib/Form/props.js +22 -1
- package/lib/Image/props.d.ts +98 -1
- package/lib/Image/props.js +32 -1
- package/lib/Input/Input.js +3 -1
- package/lib/Input/props.d.ts +84 -76
- package/lib/Input/props.js +29 -0
- package/lib/Label/props.d.ts +18 -3
- package/lib/Label/props.js +18 -1
- package/lib/PageContainer/props.d.ts +47 -16
- package/lib/PageContainer/props.js +23 -1
- package/lib/Radio/props.d.ts +25 -20
- package/lib/Radio/props.js +22 -1
- package/lib/RadioGroup/props.d.ts +52 -20
- package/lib/RadioGroup/props.js +34 -1
- package/lib/Slider/props.d.ts +58 -78
- package/lib/Slider/props.js +26 -1
- package/lib/Swiper/props.d.ts +70 -157
- package/lib/Swiper/props.js +24 -0
- package/lib/SwiperItem/props.d.ts +9 -0
- package/lib/Switch/props.d.ts +39 -34
- package/lib/Switch/props.js +21 -0
- package/lib/Text/props.d.ts +30 -19
- package/lib/Text/props.js +19 -1
- package/lib/Textarea/props.d.ts +5 -81
- package/lib/Textarea/props.js +3 -79
- package/lib/View/props.d.ts +27 -15
- package/lib/View/props.js +25 -0
- package/lib/types/index.d.ts +47 -0
- package/lib/types/index.js +5 -0
- package/package.json +5 -5
package/lib/Textarea/props.d.ts
CHANGED
|
@@ -73,96 +73,20 @@ export interface TextareaLineChangeEvent extends BaseEvent {
|
|
|
73
73
|
* @public
|
|
74
74
|
* @alias Textarea
|
|
75
75
|
* @since @ray-js/ray 0.5.10
|
|
76
|
-
* @example 基础用法
|
|
77
|
-
* ```tsx | sandbox previewTitle="基础用法"
|
|
78
|
-
* import React from 'react';
|
|
79
|
-
* import { Textarea, View } from '@ray-js/ray';
|
|
76
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
80
77
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* <View style={{ padding: '20px' }}>
|
|
84
|
-
* <Textarea placeholder="请输入内容..." />
|
|
85
|
-
* </View>
|
|
86
|
-
* );
|
|
87
|
-
* }
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* @example 多行输入
|
|
91
|
-
* ```tsx | sandbox previewTitle="多行输入"
|
|
92
|
-
* import React, { useState } from 'react';
|
|
93
|
-
* import { Textarea, Button, View, Text } from '@ray-js/ray';
|
|
94
|
-
*
|
|
95
|
-
* export default function () {
|
|
96
|
-
* const [value, setValue] = useState('');
|
|
97
|
-
*
|
|
98
|
-
* return (
|
|
99
|
-
* <View style={{ padding: '20px' }}>
|
|
100
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
101
|
-
* <Textarea
|
|
102
|
-
* value={value}
|
|
103
|
-
* placeholder="请输入..."
|
|
104
|
-
* maxLength={200}
|
|
105
|
-
* onInput={(e) => setValue(e.value)}
|
|
106
|
-
* style={{ marginTop: '8px', minHeight: '80px' }}
|
|
107
|
-
* />
|
|
108
|
-
* <Text style={{ marginTop: '8px', fontSize: '12px', color: '#999' }}>
|
|
109
|
-
* 已输入 {value.length} / 200 字符
|
|
110
|
-
* </Text>
|
|
111
|
-
* </View>
|
|
112
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
113
|
-
* <Text>自动增高:</Text>
|
|
114
|
-
* <Textarea
|
|
115
|
-
* autoHeight
|
|
116
|
-
* placeholder="输入内容会自动增高..."
|
|
117
|
-
* style={{ marginTop: '8px', minHeight: '40px' }}
|
|
118
|
-
* />
|
|
119
|
-
* </View>
|
|
120
|
-
* </View>
|
|
121
|
-
* );
|
|
122
|
-
* }
|
|
123
|
-
* ```
|
|
124
|
-
* @example 禁用与事件
|
|
125
|
-
* ```tsx | sandbox previewTitle="禁用与事件"
|
|
126
|
-
* import React from 'react';
|
|
127
|
-
* import { Textarea, View, Text } from '@ray-js/ray';
|
|
128
|
-
*
|
|
129
|
-
* export default function () {
|
|
130
|
-
* return (
|
|
131
|
-
* <View style={{ padding: '20px' }}>
|
|
132
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
133
|
-
* <Text>禁用状态:</Text>
|
|
134
|
-
* <Textarea
|
|
135
|
-
* disabled
|
|
136
|
-
* value="不可编辑的内容"
|
|
137
|
-
* placeholderStyle={{ color: '#ccc' }}
|
|
138
|
-
* style={{ marginTop: '8px' }}
|
|
139
|
-
* />
|
|
140
|
-
* </View>
|
|
141
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
142
|
-
* <Text>事件监听:</Text>
|
|
143
|
-
* <Textarea
|
|
144
|
-
* name="feedback"
|
|
145
|
-
* placeholder="输入反馈内容..."
|
|
146
|
-
* onFocus={(e) => console.log('聚焦:', e.detail.value)}
|
|
147
|
-
* onBlur={(e) => console.log('失焦:', e.detail.value)}
|
|
148
|
-
* onLinechange={(e) => console.log('行数变化:', e.detail.lineCount)}
|
|
149
|
-
* style={{ marginTop: '8px', minHeight: '80px' }}
|
|
150
|
-
* />
|
|
151
|
-
* </View>
|
|
152
|
-
* </View>
|
|
153
|
-
* );
|
|
154
|
-
* }
|
|
155
|
-
* ```
|
|
78
|
+
* @example 多行输入 ./demos/multiline/index.tsx sandbox ide e2e
|
|
79
|
+
* @example 禁用与事件 ./demos/disabled-events/index.tsx sandbox ide e2e
|
|
156
80
|
*/
|
|
157
81
|
export interface TextareaProps extends BaseProps {
|
|
158
|
-
/**
|
|
82
|
+
/** 表单控件名称,提交表单时作为键名 */
|
|
159
83
|
name?: string;
|
|
160
84
|
/** 输入框的内容 */
|
|
161
85
|
value?: string;
|
|
162
86
|
/** 输入框为空时占位符 */
|
|
163
87
|
placeholder?: string;
|
|
164
88
|
/** 指定 placeholder 的样式,目前仅支持 color、fontSize 和 fontWeight(对象或 CSS 声明字符串) */
|
|
165
|
-
placeholderStyle?: React.CSSProperties;
|
|
89
|
+
placeholderStyle?: string | React.CSSProperties;
|
|
166
90
|
/** 是否禁用 */
|
|
167
91
|
disabled?: boolean;
|
|
168
92
|
/** 最大输入长度,设置为 -1 的时候不限制最大长度 */
|
package/lib/Textarea/props.js
CHANGED
|
@@ -24,86 +24,10 @@
|
|
|
24
24
|
* @public
|
|
25
25
|
* @alias Textarea
|
|
26
26
|
* @since @ray-js/ray 0.5.10
|
|
27
|
-
* @example 基础用法
|
|
28
|
-
* ```tsx | sandbox previewTitle="基础用法"
|
|
29
|
-
* import React from 'react';
|
|
30
|
-
* import { Textarea, View } from '@ray-js/ray';
|
|
27
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
31
28
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* <View style={{ padding: '20px' }}>
|
|
35
|
-
* <Textarea placeholder="请输入内容..." />
|
|
36
|
-
* </View>
|
|
37
|
-
* );
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @example 多行输入
|
|
42
|
-
* ```tsx | sandbox previewTitle="多行输入"
|
|
43
|
-
* import React, { useState } from 'react';
|
|
44
|
-
* import { Textarea, Button, View, Text } from '@ray-js/ray';
|
|
45
|
-
*
|
|
46
|
-
* export default function () {
|
|
47
|
-
* const [value, setValue] = useState('');
|
|
48
|
-
*
|
|
49
|
-
* return (
|
|
50
|
-
* <View style={{ padding: '20px' }}>
|
|
51
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
52
|
-
* <Textarea
|
|
53
|
-
* value={value}
|
|
54
|
-
* placeholder="请输入..."
|
|
55
|
-
* maxLength={200}
|
|
56
|
-
* onInput={(e) => setValue(e.value)}
|
|
57
|
-
* style={{ marginTop: '8px', minHeight: '80px' }}
|
|
58
|
-
* />
|
|
59
|
-
* <Text style={{ marginTop: '8px', fontSize: '12px', color: '#999' }}>
|
|
60
|
-
* 已输入 {value.length} / 200 字符
|
|
61
|
-
* </Text>
|
|
62
|
-
* </View>
|
|
63
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
64
|
-
* <Text>自动增高:</Text>
|
|
65
|
-
* <Textarea
|
|
66
|
-
* autoHeight
|
|
67
|
-
* placeholder="输入内容会自动增高..."
|
|
68
|
-
* style={{ marginTop: '8px', minHeight: '40px' }}
|
|
69
|
-
* />
|
|
70
|
-
* </View>
|
|
71
|
-
* </View>
|
|
72
|
-
* );
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
75
|
-
* @example 禁用与事件
|
|
76
|
-
* ```tsx | sandbox previewTitle="禁用与事件"
|
|
77
|
-
* import React from 'react';
|
|
78
|
-
* import { Textarea, View, Text } from '@ray-js/ray';
|
|
79
|
-
*
|
|
80
|
-
* export default function () {
|
|
81
|
-
* return (
|
|
82
|
-
* <View style={{ padding: '20px' }}>
|
|
83
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
84
|
-
* <Text>禁用状态:</Text>
|
|
85
|
-
* <Textarea
|
|
86
|
-
* disabled
|
|
87
|
-
* value="不可编辑的内容"
|
|
88
|
-
* placeholderStyle={{ color: '#ccc' }}
|
|
89
|
-
* style={{ marginTop: '8px' }}
|
|
90
|
-
* />
|
|
91
|
-
* </View>
|
|
92
|
-
* <View style={{ marginBottom: '16px' }}>
|
|
93
|
-
* <Text>事件监听:</Text>
|
|
94
|
-
* <Textarea
|
|
95
|
-
* name="feedback"
|
|
96
|
-
* placeholder="输入反馈内容..."
|
|
97
|
-
* onFocus={(e) => console.log('聚焦:', e.detail.value)}
|
|
98
|
-
* onBlur={(e) => console.log('失焦:', e.detail.value)}
|
|
99
|
-
* onLinechange={(e) => console.log('行数变化:', e.detail.lineCount)}
|
|
100
|
-
* style={{ marginTop: '8px', minHeight: '80px' }}
|
|
101
|
-
* />
|
|
102
|
-
* </View>
|
|
103
|
-
* </View>
|
|
104
|
-
* );
|
|
105
|
-
* }
|
|
106
|
-
* ```
|
|
29
|
+
* @example 多行输入 ./demos/multiline/index.tsx sandbox ide e2e
|
|
30
|
+
* @example 禁用与事件 ./demos/disabled-events/index.tsx sandbox ide e2e
|
|
107
31
|
*/
|
|
108
32
|
|
|
109
33
|
/**
|
package/lib/View/props.d.ts
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import { BaseProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 用于页面布局的容器组件,支持 flex 布局、自定义样式等,是构建页面的基础块级元素。
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
* @alias View
|
|
7
|
+
* @since @ray-js/ray 0.5.10
|
|
8
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
9
|
+
* @example Flex 布局 ./demos/flex-layout/index.tsx sandbox ide e2e
|
|
10
|
+
* @example Hover 点击态 ./demos/hover/index.tsx sandbox ide e2e
|
|
11
|
+
*/
|
|
2
12
|
export interface ViewProps extends BaseProps {
|
|
3
|
-
/**
|
|
4
|
-
* @description.en hoverClassName
|
|
5
|
-
* @description.zh hover 样式
|
|
6
|
-
* @default undefined
|
|
7
|
-
*/
|
|
13
|
+
/** 指定按下去的样式类;为 `none` 时没有点击态效果 */
|
|
8
14
|
hoverClassName?: string;
|
|
9
|
-
/**
|
|
10
|
-
* @description.en How long after the click appears in ms
|
|
11
|
-
* @description.zh 按住后多久出现点击态 单位 ms
|
|
12
|
-
* @default 20
|
|
13
|
-
*/
|
|
15
|
+
/** 按住后多久出现点击态,单位毫秒 */
|
|
14
16
|
hoverStartTime?: number;
|
|
15
|
-
/**
|
|
16
|
-
* @description.en Click retention time ms after finger release
|
|
17
|
-
* @description.zh 手指松开后点击态保留时间 ms
|
|
18
|
-
* @default 70
|
|
19
|
-
*/
|
|
17
|
+
/** 手指松开后点击态保留时间,单位毫秒 */
|
|
20
18
|
hoverStayTime?: number;
|
|
19
|
+
/** 是否启用可触摸响应的 hover 样式 */
|
|
21
20
|
hoverable?: boolean;
|
|
22
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* View 组件文档用默认值(与运行时 defaultProps 分离)
|
|
24
|
+
*
|
|
25
|
+
* @belong View
|
|
26
|
+
* @defaults
|
|
27
|
+
*/
|
|
28
|
+
export declare const viewDefaultProps: {
|
|
29
|
+
hoverClassName: string;
|
|
30
|
+
hoverStartTime: number;
|
|
31
|
+
hoverStayTime: number;
|
|
32
|
+
hoverable: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** 运行时 defaultProps */
|
|
23
35
|
export declare const defaultViewProps: Partial<ViewProps>;
|
package/lib/View/props.js
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 用于页面布局的容器组件,支持 flex 布局、自定义样式等,是构建页面的基础块级元素。
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
* @alias View
|
|
6
|
+
* @since @ray-js/ray 0.5.10
|
|
7
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
8
|
+
* @example Flex 布局 ./demos/flex-layout/index.tsx sandbox ide e2e
|
|
9
|
+
* @example Hover 点击态 ./demos/hover/index.tsx sandbox ide e2e
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* View 组件文档用默认值(与运行时 defaultProps 分离)
|
|
14
|
+
*
|
|
15
|
+
* @belong View
|
|
16
|
+
* @defaults
|
|
17
|
+
*/
|
|
18
|
+
export const viewDefaultProps = {
|
|
19
|
+
hoverClassName: 'none',
|
|
20
|
+
hoverStartTime: 20,
|
|
21
|
+
hoverStayTime: 70,
|
|
22
|
+
hoverable: true
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** 运行时 defaultProps */
|
|
1
26
|
export const defaultViewProps = {
|
|
2
27
|
hoverStartTime: 20,
|
|
3
28
|
hoverStayTime: 70
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 基础属性
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
2
6
|
export interface BaseProps extends TouchEventHandler {
|
|
3
7
|
/**
|
|
4
8
|
* @description.en id
|
|
@@ -31,6 +35,49 @@ export interface BaseProps extends TouchEventHandler {
|
|
|
31
35
|
* @deprecated 该属性仅在小程序基础组件中使用, 不建议在 React DSL 中使用
|
|
32
36
|
*/
|
|
33
37
|
slot?: string;
|
|
38
|
+
/**
|
|
39
|
+
* @description.en onClick
|
|
40
|
+
* @description.zh 点击回调
|
|
41
|
+
* @default undefined
|
|
42
|
+
*/
|
|
43
|
+
onClick?: (e: TouchEvent) => any;
|
|
44
|
+
/**
|
|
45
|
+
* @description.en Long press the trigger
|
|
46
|
+
* @description.zh 长按触发
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
onLongClick?: (e: TouchEvent) => any;
|
|
50
|
+
/**
|
|
51
|
+
* @description.en onLongPress event callback, no longer trigger click event
|
|
52
|
+
* @description.zh 长按事件回调, 不再触发点击事件
|
|
53
|
+
* @default undefined
|
|
54
|
+
* @param e
|
|
55
|
+
*/
|
|
56
|
+
onLongPress?: (e: TouchEvent) => any;
|
|
57
|
+
/**
|
|
58
|
+
* @description.en onTouchStart
|
|
59
|
+
* @description.zh 开始触摸事件回调
|
|
60
|
+
* @default undefined
|
|
61
|
+
*/
|
|
62
|
+
onTouchStart?: (e: TouchEvent) => any;
|
|
63
|
+
/**
|
|
64
|
+
* @description.en onTouchMove
|
|
65
|
+
* @description.zh 触摸移动事件回调
|
|
66
|
+
* @default undefined
|
|
67
|
+
*/
|
|
68
|
+
onTouchMove?: (e: TouchEvent) => any;
|
|
69
|
+
/**
|
|
70
|
+
* @description.en onTouchEnd
|
|
71
|
+
* @description.zh 触摸结束事件回调
|
|
72
|
+
* @default undefined
|
|
73
|
+
*/
|
|
74
|
+
onTouchEnd?: (e: TouchEvent) => any;
|
|
75
|
+
/**
|
|
76
|
+
* @description.en onTouchCancel
|
|
77
|
+
* @description.zh 触摸取消事件回调
|
|
78
|
+
* @default undefined
|
|
79
|
+
*/
|
|
80
|
+
onTouchCancel?: (e: TouchEvent) => any;
|
|
34
81
|
}
|
|
35
82
|
export interface HoverableProps {
|
|
36
83
|
/**
|
package/lib/types/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/components",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.80",
|
|
4
4
|
"description": "Ray basic components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ray-core/macro": "^0.4.9",
|
|
31
31
|
"@ray-core/wechat": "^0.4.9",
|
|
32
|
-
"@ray-js/adapter": "1.7.
|
|
33
|
-
"@ray-js/framework-shared": "1.7.
|
|
32
|
+
"@ray-js/adapter": "1.7.80",
|
|
33
|
+
"@ray-js/framework-shared": "1.7.80",
|
|
34
34
|
"ahooks": "^3.8.5",
|
|
35
35
|
"clsx": "^1.2.1",
|
|
36
36
|
"core-js": "^3.43.0",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"style-to-object": "^0.3.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@ray-js/cli": "1.7.
|
|
43
|
+
"@ray-js/cli": "1.7.80"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public",
|
|
47
47
|
"registry": "https://registry.npmjs.org"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "5d4ad7b9ccd4016df3075f438c5dd8743bc1766b"
|
|
50
50
|
}
|