@ray-js/components 1.7.78 → 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/Slider/props.d.ts
CHANGED
|
@@ -1,91 +1,71 @@
|
|
|
1
|
-
import { GenericEvent } from '@ray-js/adapter';
|
|
2
1
|
import { BaseProps } from '../types';
|
|
2
|
+
import { BaseEvent } from '@ray-js/adapter';
|
|
3
|
+
/** slider 事件数据 */
|
|
4
|
+
export interface SliderEventDetail {
|
|
5
|
+
/** 当前取值 */
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
/** slider change 事件对象 */
|
|
9
|
+
export interface SliderChangeEvent extends BaseEvent {
|
|
10
|
+
/** 事件类型 */
|
|
11
|
+
type: 'change';
|
|
12
|
+
/** 事件数据 */
|
|
13
|
+
detail: SliderEventDetail;
|
|
14
|
+
/** 当前取值 */
|
|
15
|
+
value: number;
|
|
16
|
+
}
|
|
17
|
+
/** slider changing 事件对象 */
|
|
18
|
+
export interface SliderChangingEvent extends BaseEvent {
|
|
19
|
+
/** 事件类型 */
|
|
20
|
+
type: 'changing';
|
|
21
|
+
/** 事件数据 */
|
|
22
|
+
detail: SliderEventDetail;
|
|
23
|
+
/** 当前取值 */
|
|
24
|
+
value: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 滑动选择器,通过拖动滑块在数值区间内选取结果。
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
* @alias Slider
|
|
31
|
+
* @since @ray-js/ray 0.5.10
|
|
32
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
33
|
+
*
|
|
34
|
+
* @example 自定义样式 ./demos/custom-style/index.tsx sandbox ide e2e
|
|
35
|
+
* @example 禁用与拖动事件 ./demos/disabled-drag/index.tsx sandbox ide e2e
|
|
36
|
+
*/
|
|
3
37
|
export interface SliderProps extends BaseProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description.en min
|
|
6
|
-
* @description.zh 最小值
|
|
7
|
-
* @default 0
|
|
8
|
-
*/
|
|
38
|
+
/** 最小值 */
|
|
9
39
|
min?: number;
|
|
10
|
-
/**
|
|
11
|
-
* @description.en max
|
|
12
|
-
* @description.zh 最大值
|
|
13
|
-
* @default 100
|
|
14
|
-
*/
|
|
40
|
+
/** 最大值 */
|
|
15
41
|
max?: number;
|
|
16
|
-
/**
|
|
17
|
-
* @description.en The value must be greater than 0 and divisible by (max-min)
|
|
18
|
-
* @description.zh 步长,取值必须大于 0,并且可被(max - min)整除
|
|
19
|
-
* @default 1
|
|
20
|
-
*/
|
|
42
|
+
/** 步长,取值必须大于 0,并且可被 (max - min) 整除 */
|
|
21
43
|
step?: number;
|
|
22
|
-
/**
|
|
23
|
-
* @description.en disabled
|
|
24
|
-
* @description.zh 是否禁用
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
44
|
+
/** 是否禁用 */
|
|
27
45
|
disabled?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @description.en value
|
|
30
|
-
* @description.zh 当前取值
|
|
31
|
-
* @default 0
|
|
32
|
-
*/
|
|
46
|
+
/** 当前取值 */
|
|
33
47
|
value?: number;
|
|
34
|
-
/**
|
|
35
|
-
* @description.en activeColor
|
|
36
|
-
* @description.zh 已选择的颜色
|
|
37
|
-
* @default #007aff
|
|
38
|
-
*/
|
|
48
|
+
/** 已选择的颜色 */
|
|
39
49
|
activeColor?: string;
|
|
40
|
-
/**
|
|
41
|
-
* @description.en backgroundColor
|
|
42
|
-
* @description.zh 背景条的颜色
|
|
43
|
-
* @default rgba(0,0,0,.2)
|
|
44
|
-
*/
|
|
50
|
+
/** 背景条的颜色 */
|
|
45
51
|
backgroundColor?: string;
|
|
46
|
-
/**
|
|
47
|
-
* @description.en blockSize
|
|
48
|
-
* @description.zh 滑块的大小,取值范围为 12 - 28
|
|
49
|
-
* @default 28
|
|
50
|
-
*/
|
|
52
|
+
/** 滑块的大小,取值范围为 12~28 */
|
|
51
53
|
blockSize?: number;
|
|
52
|
-
/**
|
|
53
|
-
* @description.en blockColor
|
|
54
|
-
* @description.zh 滑块的颜色
|
|
55
|
-
* @default #ffffff
|
|
56
|
-
*/
|
|
54
|
+
/** 滑块的颜色 */
|
|
57
55
|
blockColor?: string;
|
|
58
|
-
/**
|
|
59
|
-
* @description.en showValue
|
|
60
|
-
* @description.zh 是否显示当前 value
|
|
61
|
-
* @default false
|
|
62
|
-
*/
|
|
56
|
+
/** 是否显示当前 value */
|
|
63
57
|
showValue?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
value: any;
|
|
71
|
-
}>) => void;
|
|
72
|
-
/**
|
|
73
|
-
* @description.en onChanging
|
|
74
|
-
* @description.zh 拖动过程中触发的事件,event.detail = {value}
|
|
75
|
-
* @default undefined
|
|
76
|
-
*/
|
|
77
|
-
onChanging?: (event: GenericEvent<{
|
|
78
|
-
value: any;
|
|
79
|
-
}>) => void;
|
|
58
|
+
/** 表单控件名称,提交表单时作为键名 */
|
|
59
|
+
name?: string;
|
|
60
|
+
/** 完成一次拖动后触发 */
|
|
61
|
+
onChange?: (event: SliderChangeEvent) => void;
|
|
62
|
+
/** 拖动过程中触发 */
|
|
63
|
+
onChanging?: (event: SliderChangingEvent) => void;
|
|
80
64
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
disabled: boolean;
|
|
89
|
-
value: number;
|
|
90
|
-
step: number;
|
|
91
|
-
};
|
|
65
|
+
/**
|
|
66
|
+
* Slider 组件默认值
|
|
67
|
+
*
|
|
68
|
+
* @belong Slider
|
|
69
|
+
* @defaults
|
|
70
|
+
*/
|
|
71
|
+
export declare const sliderDefault: SliderProps;
|
package/lib/Slider/props.js
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/** slider 事件数据 */
|
|
2
|
+
|
|
3
|
+
/** slider change 事件对象 */
|
|
4
|
+
|
|
5
|
+
/** slider changing 事件对象 */
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 滑动选择器,通过拖动滑块在数值区间内选取结果。
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @alias Slider
|
|
12
|
+
* @since @ray-js/ray 0.5.10
|
|
13
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
14
|
+
*
|
|
15
|
+
* @example 自定义样式 ./demos/custom-style/index.tsx sandbox ide e2e
|
|
16
|
+
* @example 禁用与拖动事件 ./demos/disabled-drag/index.tsx sandbox ide e2e
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Slider 组件默认值
|
|
21
|
+
*
|
|
22
|
+
* @belong Slider
|
|
23
|
+
* @defaults
|
|
24
|
+
*/
|
|
1
25
|
export const sliderDefault = {
|
|
2
26
|
blockSize: 28,
|
|
3
27
|
activeColor: '#007AFF',
|
|
@@ -7,5 +31,6 @@ export const sliderDefault = {
|
|
|
7
31
|
max: 100,
|
|
8
32
|
disabled: false,
|
|
9
33
|
value: 0,
|
|
10
|
-
step: 1
|
|
34
|
+
step: 1,
|
|
35
|
+
showValue: false
|
|
11
36
|
};
|
package/lib/Swiper/props.d.ts
CHANGED
|
@@ -1,181 +1,94 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseProps } from '../types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { BaseEvent } from '@ray-js/adapter';
|
|
4
|
+
/** Swiper 滑块变更事件数据(change 与 afterChange 共用) */
|
|
5
|
+
export interface SwiperChangeDetail {
|
|
6
|
+
/** 当前滑块索引 */
|
|
7
|
+
current: number;
|
|
8
|
+
/** 当前滑块 id */
|
|
9
|
+
currentItemId?: string;
|
|
10
|
+
/** 触发原因 */
|
|
11
|
+
source: '' | 'autoplay' | 'touch';
|
|
8
12
|
}
|
|
9
|
-
|
|
13
|
+
/** Swiper current 变更回调事件(components 层) */
|
|
14
|
+
export interface SwiperComponentChangeEvent extends BaseEvent {
|
|
15
|
+
/** 事件类型 */
|
|
16
|
+
type: 'change';
|
|
17
|
+
/** 当前滑块索引 */
|
|
18
|
+
current: number;
|
|
19
|
+
/** 触发原因 */
|
|
20
|
+
source: '' | 'autoplay' | 'touch';
|
|
21
|
+
/** 事件数据 */
|
|
22
|
+
detail: SwiperChangeDetail;
|
|
23
|
+
}
|
|
24
|
+
/** Swiper 动画结束回调事件(components 层,对应 animationfinish) */
|
|
25
|
+
export interface SwiperComponentAfterChangeEvent extends BaseEvent {
|
|
26
|
+
/** 事件类型 */
|
|
27
|
+
type: 'afterChange';
|
|
28
|
+
/** 当前滑块索引 */
|
|
29
|
+
current: number;
|
|
30
|
+
/** 触发原因 */
|
|
31
|
+
source: '' | 'autoplay' | 'touch';
|
|
32
|
+
/** 事件数据 */
|
|
33
|
+
detail: SwiperChangeDetail;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 幻灯片/轮播容器,支持自动切换、衔接滑动与指示点;使用时需明确整体高度。
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
* @alias Swiper
|
|
40
|
+
* @since @ray-js/ray 0.5.10
|
|
41
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
42
|
+
*
|
|
43
|
+
* @example 自动轮播与 dataSource ./demos/autoplay-datasource/index.tsx sandbox ide e2e
|
|
44
|
+
* @example 纵向轮播与指示点颜色 ./demos/vertical-dots-color/index.tsx sandbox ide e2e
|
|
45
|
+
*/
|
|
46
|
+
export interface SwiperProps<I = any> extends BaseProps {
|
|
10
47
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @description.zh 是否显示面板指示点
|
|
13
|
-
* @default false
|
|
48
|
+
* 是否显示面板指示点
|
|
14
49
|
*/
|
|
15
50
|
dots?: boolean;
|
|
16
51
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @description.zh 指示点颜色
|
|
19
|
-
* @default rgba(0, 0, 0, .3)
|
|
52
|
+
* 指示点颜色
|
|
20
53
|
*/
|
|
21
54
|
dotColor?: string;
|
|
22
55
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @description.zh 当前选中的指示点颜色
|
|
25
|
-
* @default #000000
|
|
56
|
+
* 当前选中的指示点颜色
|
|
26
57
|
*/
|
|
27
58
|
dotActiveColor?: string;
|
|
28
|
-
/**
|
|
29
|
-
* @description.en Automatic switch or not
|
|
30
|
-
* @description.zh 是否自动切换
|
|
31
|
-
* @default false
|
|
32
|
-
*/
|
|
59
|
+
/** 是否自动切换 */
|
|
33
60
|
autoplay?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* @description.en Index of the current slider
|
|
36
|
-
* @description.zh 当前所在滑块的 index
|
|
37
|
-
* @default 0
|
|
38
|
-
*/
|
|
61
|
+
/** 当前所在滑块的 index */
|
|
39
62
|
current?: number;
|
|
40
|
-
/**
|
|
41
|
-
* @description.en Automatically switch the time interval
|
|
42
|
-
* @description.zh 自动切换时间间隔
|
|
43
|
-
* @default 5000
|
|
44
|
-
*/
|
|
63
|
+
/** 自动切换时间间隔 */
|
|
45
64
|
interval?: number;
|
|
46
|
-
/**
|
|
47
|
-
* @description.en Sliding animation duration
|
|
48
|
-
* @description.zh 滑动动画时长
|
|
49
|
-
* @default 500
|
|
50
|
-
*/
|
|
65
|
+
/** 滑动动画时长 */
|
|
51
66
|
duration?: number;
|
|
52
|
-
/**
|
|
53
|
-
* @description.en Whether to use cohesive sliding
|
|
54
|
-
* @description.zh 是否采用衔接滑动
|
|
55
|
-
* @default false
|
|
56
|
-
*/
|
|
67
|
+
/** 是否采用衔接滑动 */
|
|
57
68
|
circular?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* @description.en Whether the sliding direction is longitudinal
|
|
60
|
-
* @description.zh 滑动方向是否为纵向
|
|
61
|
-
* @default false
|
|
62
|
-
*/
|
|
69
|
+
/** 滑动方向是否为纵向 */
|
|
63
70
|
vertical?: boolean;
|
|
64
|
-
/** 前边距,可用于露出前一项的一小部分 */
|
|
65
|
-
/** 后边距,可用于露出后一项的一小部分 */
|
|
66
71
|
/**
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* "a": "b"
|
|
86
|
-
* }
|
|
87
|
-
* },
|
|
88
|
-
* "target": {
|
|
89
|
-
* "offsetTop": 12,
|
|
90
|
-
* "offsetLeft": 12,
|
|
91
|
-
* "id": "",
|
|
92
|
-
* "dataset": {
|
|
93
|
-
* "a": "b"
|
|
94
|
-
* }
|
|
95
|
-
* },
|
|
96
|
-
* "detail": {
|
|
97
|
-
* "current": 2,
|
|
98
|
-
* "currentItemId": "",
|
|
99
|
-
* "source": "touch"
|
|
100
|
-
* }
|
|
101
|
-
* }
|
|
102
|
-
*/
|
|
103
|
-
origin?: {
|
|
104
|
-
type: 'change';
|
|
105
|
-
timeStamp: number;
|
|
106
|
-
currentTarget: Target;
|
|
107
|
-
target: Target;
|
|
108
|
-
detail: {
|
|
109
|
-
current: number;
|
|
110
|
-
currentItemId: string;
|
|
111
|
-
source: '' | 'autoplay' | 'touch';
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
detail: {
|
|
115
|
-
current: number;
|
|
116
|
-
source: '' | 'autoplay' | 'touch';
|
|
117
|
-
};
|
|
118
|
-
}) => void;
|
|
119
|
-
/** swiper-item 的位置发生改变时会触发 transition 事件,event.detail = {dx: dx, dy: dy} 2.4.3 */
|
|
120
|
-
/** 动画结束时会触发 onAfterChange 事件 */
|
|
121
|
-
onAfterChange?: (event: {
|
|
122
|
-
type: 'afterChange';
|
|
123
|
-
current: number;
|
|
124
|
-
source: '' | 'autoplay' | 'touch';
|
|
125
|
-
/**
|
|
126
|
-
* @description.en Original event object
|
|
127
|
-
* @description.zh 原始事件对象
|
|
128
|
-
* @example
|
|
129
|
-
* {
|
|
130
|
-
* "type": "animationfinish",
|
|
131
|
-
* "timeStamp": 6144,
|
|
132
|
-
* "currentTarget": {
|
|
133
|
-
* "offsetTop": 12,
|
|
134
|
-
* "offsetLeft": 12,
|
|
135
|
-
* "id": "",
|
|
136
|
-
* "dataset": {
|
|
137
|
-
* "a": "b"
|
|
138
|
-
* }
|
|
139
|
-
* },
|
|
140
|
-
* "target": {
|
|
141
|
-
* "offsetTop": 12,
|
|
142
|
-
* "offsetLeft": 12,
|
|
143
|
-
* "id": "",
|
|
144
|
-
* "dataset": {
|
|
145
|
-
* "a": "b"
|
|
146
|
-
* }
|
|
147
|
-
* },
|
|
148
|
-
* "detail": {
|
|
149
|
-
* "current": 2,
|
|
150
|
-
* "currentItemId": "",
|
|
151
|
-
* "source": "touch"
|
|
152
|
-
* }
|
|
153
|
-
* }
|
|
154
|
-
*/
|
|
155
|
-
origin?: {
|
|
156
|
-
type: 'animationfinish';
|
|
157
|
-
timeStamp: number;
|
|
158
|
-
currentTarget: Target;
|
|
159
|
-
target: Target;
|
|
160
|
-
detail: {
|
|
161
|
-
current: number;
|
|
162
|
-
currentItemId: string;
|
|
163
|
-
source: '' | 'autoplay' | 'touch';
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
detail: {
|
|
167
|
-
value: any;
|
|
168
|
-
};
|
|
169
|
-
}) => void;
|
|
170
|
-
/** 列表数据 */
|
|
171
|
-
dataSource: I[];
|
|
172
|
-
/** 渲染列表项目 */
|
|
173
|
-
renderItem: (item: I, index: number) => React.ReactNode;
|
|
174
|
-
};
|
|
175
|
-
export declare const defaultSwiperProps: Partial<SwiperProps<any>>;
|
|
72
|
+
* 列表数据,用于与 `renderItem` 组合渲染;泛型 `I` 会推断出每一项的数据类型。
|
|
73
|
+
* 也可不传 `dataSource`,直接以 `SwiperItem` 作为 children 渲染。
|
|
74
|
+
*/
|
|
75
|
+
dataSource?: I[];
|
|
76
|
+
/** 渲染列表每一项,`item` 类型由 `dataSource` 的泛型 `I` 推断 */
|
|
77
|
+
renderItem?: (item: I, index: number) => React.ReactNode;
|
|
78
|
+
/** current 改变时触发 */
|
|
79
|
+
onChange?: (event: SwiperComponentChangeEvent) => void;
|
|
80
|
+
/** 动画结束时触发 */
|
|
81
|
+
onAfterChange?: (event: SwiperComponentAfterChangeEvent) => void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Swiper 组件默认值
|
|
85
|
+
*
|
|
86
|
+
* @belong Swiper
|
|
87
|
+
* @defaults
|
|
88
|
+
*/
|
|
89
|
+
export declare const defaultSwiperProps: Partial<SwiperProps>;
|
|
176
90
|
export declare const SwiperPropsAlias: {
|
|
177
91
|
dotActiveColor: string;
|
|
178
92
|
dotColor: string;
|
|
179
93
|
dots: string;
|
|
180
94
|
};
|
|
181
|
-
export {};
|
package/lib/Swiper/props.js
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/** Swiper 滑块变更事件数据(change 与 afterChange 共用) */
|
|
2
|
+
|
|
3
|
+
/** Swiper current 变更回调事件(components 层) */
|
|
4
|
+
|
|
5
|
+
/** Swiper 动画结束回调事件(components 层,对应 animationfinish) */
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 幻灯片/轮播容器,支持自动切换、衔接滑动与指示点;使用时需明确整体高度。
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @alias Swiper
|
|
12
|
+
* @since @ray-js/ray 0.5.10
|
|
13
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
14
|
+
*
|
|
15
|
+
* @example 自动轮播与 dataSource ./demos/autoplay-datasource/index.tsx sandbox ide e2e
|
|
16
|
+
* @example 纵向轮播与指示点颜色 ./demos/vertical-dots-color/index.tsx sandbox ide e2e
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Swiper 组件默认值
|
|
21
|
+
*
|
|
22
|
+
* @belong Swiper
|
|
23
|
+
* @defaults
|
|
24
|
+
*/
|
|
1
25
|
export const defaultSwiperProps = {
|
|
2
26
|
autoplay: false,
|
|
3
27
|
circular: false,
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { BaseProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 滑块视图容器子项,仅可放置在 Swiper 组件中,宽高自动设置为 100%。
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @alias SwiperItem
|
|
8
|
+
* @since @ray-js/ray 0.5.10
|
|
9
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
10
|
+
*/
|
|
2
11
|
export interface SwiperItemProps extends BaseProps {
|
|
3
12
|
children?: React.ReactNode | string;
|
|
4
13
|
}
|
package/lib/Switch/props.d.ts
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { BaseProps } from '../types';
|
|
3
|
+
import { BaseEvent } from '@ray-js/adapter';
|
|
4
|
+
/** switch change 事件数据 */
|
|
5
|
+
export interface SwitchChangeDetail {
|
|
6
|
+
/** 当前选中状态 */
|
|
7
|
+
value: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** switch change 事件对象 */
|
|
10
|
+
export interface SwitchChangeEvent extends BaseEvent {
|
|
11
|
+
/** 事件类型 */
|
|
12
|
+
type: 'change';
|
|
13
|
+
/** 事件数据,通过 detail.value 获取当前取值 */
|
|
14
|
+
detail: SwitchChangeDetail;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 开关选择器,用于在两种互斥状态间切换。
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
* @alias Switch
|
|
21
|
+
* @since @ray-js/ray 0.5.10
|
|
22
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
23
|
+
*
|
|
24
|
+
* @example 不同状态 ./demos/states/index.tsx sandbox ide e2e
|
|
25
|
+
*/
|
|
3
26
|
export interface SwitchProps extends BaseProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description.en onChange
|
|
6
|
-
* @description.zh checked 改变时触发 change 事件,event.detail={ value}
|
|
7
|
-
* @default undefined
|
|
8
|
-
*/
|
|
9
|
-
onChange?: (event: GenericEvent<{
|
|
10
|
-
value: any;
|
|
11
|
-
}>) => void;
|
|
12
|
-
/**
|
|
13
|
-
* @description.en checked
|
|
14
|
-
* @description.zh 当前是否选中
|
|
15
|
-
* @default false
|
|
16
|
-
*/
|
|
27
|
+
/** 当前是否选中 */
|
|
17
28
|
checked?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* @description.en disabled
|
|
20
|
-
* @description.zh 是否禁用
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
29
|
+
/** 是否禁用 */
|
|
23
30
|
disabled?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* @description.en color
|
|
26
|
-
* @description.zh Switch 的颜色,同 css 的 color
|
|
27
|
-
* @default #007AFF
|
|
28
|
-
*/
|
|
31
|
+
/** 开关颜色,同 CSS 的 color */
|
|
29
32
|
color?: string;
|
|
30
|
-
/**
|
|
31
|
-
* @description.en type
|
|
32
|
-
* @description.zh 可选值 switch checkbox
|
|
33
|
-
* @default switch
|
|
34
|
-
*/
|
|
33
|
+
/** 样式类型,可选 switch、checkbox */
|
|
35
34
|
type?: 'switch' | 'checkbox';
|
|
36
|
-
/**
|
|
37
|
-
* @description.en style
|
|
38
|
-
* @description.zh 风格
|
|
39
|
-
* @default undefined
|
|
40
|
-
*/
|
|
35
|
+
/** 组件样式 */
|
|
41
36
|
style?: React.CSSProperties;
|
|
37
|
+
/** 表单控件名称,提交表单时作为键名 */
|
|
38
|
+
name?: string;
|
|
39
|
+
/** 选中状态改变时触发,detail 含 value */
|
|
40
|
+
onChange?: (event: SwitchChangeEvent) => void;
|
|
42
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Switch 组件默认值
|
|
44
|
+
*
|
|
45
|
+
* @belong Switch
|
|
46
|
+
* @defaults
|
|
47
|
+
*/
|
|
43
48
|
export declare const defaultSwitchProps: {
|
|
44
49
|
type: string;
|
|
45
50
|
color: string;
|
package/lib/Switch/props.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/** switch change 事件数据 */
|
|
2
|
+
|
|
3
|
+
/** switch change 事件对象 */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 开关选择器,用于在两种互斥状态间切换。
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
* @alias Switch
|
|
10
|
+
* @since @ray-js/ray 0.5.10
|
|
11
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
12
|
+
*
|
|
13
|
+
* @example 不同状态 ./demos/states/index.tsx sandbox ide e2e
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Switch 组件默认值
|
|
18
|
+
*
|
|
19
|
+
* @belong Switch
|
|
20
|
+
* @defaults
|
|
21
|
+
*/
|
|
1
22
|
export const defaultSwitchProps = {
|
|
2
23
|
type: 'switch',
|
|
3
24
|
color: '#007AFF',
|
package/lib/Text/props.d.ts
CHANGED
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { BaseProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 文本内容组件,用于显示文本信息。
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
* @alias Text
|
|
7
|
+
* @since @ray-js/ray 0.5.10
|
|
8
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
9
|
+
* @example 可选择文本 ./demos/selectable/index.tsx sandbox ide e2e
|
|
10
|
+
*/
|
|
2
11
|
export interface TextProps extends BaseProps {
|
|
12
|
+
/** 文本是否可选 */
|
|
13
|
+
userSelect?: boolean;
|
|
3
14
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
* @default false
|
|
15
|
+
* 文本是否可选
|
|
16
|
+
* @deprecated 请使用 `userSelect` 替代
|
|
7
17
|
*/
|
|
8
18
|
selectable?: boolean;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
19
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
13
|
-
* @default false
|
|
20
|
+
* 是否显示连续的空格
|
|
21
|
+
* @internal
|
|
14
22
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
type: string;
|
|
22
|
-
timeStamp: number;
|
|
23
|
-
pageX: number;
|
|
24
|
-
pageY: number;
|
|
25
|
-
origin: any;
|
|
26
|
-
}) => void;
|
|
23
|
+
space?: '' | 'ensp' | 'emsp' | 'nbsp';
|
|
24
|
+
/**
|
|
25
|
+
* 是否解码 HTML 字符实体(如 `&`、`<`)
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
decode?: boolean;
|
|
27
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Text 组件文档用默认值(与运行时 defaultProps 分离)
|
|
32
|
+
*
|
|
33
|
+
* @belong Text
|
|
34
|
+
* @defaults
|
|
35
|
+
*/
|
|
36
|
+
export declare const textDefaultProps: {
|
|
37
|
+
userSelect: boolean;
|
|
38
|
+
};
|
package/lib/Text/props.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 文本内容组件,用于显示文本信息。
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
* @alias Text
|
|
6
|
+
* @since @ray-js/ray 0.5.10
|
|
7
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
8
|
+
* @example 可选择文本 ./demos/selectable/index.tsx sandbox ide e2e
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Text 组件文档用默认值(与运行时 defaultProps 分离)
|
|
13
|
+
*
|
|
14
|
+
* @belong Text
|
|
15
|
+
* @defaults
|
|
16
|
+
*/
|
|
17
|
+
export const textDefaultProps = {
|
|
18
|
+
userSelect: false
|
|
19
|
+
};
|