@ray-js/adapter 1.7.79 → 1.7.81
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/cjs/hostComponents/Camera/index.d.ts +105 -10
- package/cjs/hostComponents/Camera/index.js +16 -1
- package/cjs/hostComponents/Canvas/index.d.ts +197 -15
- package/cjs/hostComponents/Canvas/index.js +12 -1
- package/cjs/hostComponents/CoverView/index.d.ts +8 -1
- package/cjs/hostComponents/Iframe/index.d.ts +59 -19
- package/cjs/hostComponents/Iframe/index.js +8 -1
- package/cjs/hostComponents/Iframe/node.d.ts +1 -0
- package/cjs/hostComponents/Iframe/node.js +1 -1
- package/cjs/hostComponents/Input/index.d.ts +1 -1
- package/cjs/hostComponents/IpcPlayer/index.d.ts +297 -172
- package/cjs/hostComponents/IpcPlayer/index.js +26 -1
- package/cjs/hostComponents/Map/index.d.ts +202 -49
- package/cjs/hostComponents/Map/index.js +17 -1
- package/cjs/hostComponents/MovableArea/index.d.ts +18 -0
- package/cjs/hostComponents/MovableArea/index.js +10 -1
- package/cjs/hostComponents/MovableView/index.d.ts +92 -6
- package/cjs/hostComponents/MovableView/index.js +19 -3
- package/cjs/hostComponents/NativeVideo/index.d.ts +172 -14
- package/cjs/hostComponents/NativeVideo/index.js +24 -1
- package/cjs/hostComponents/Navigator/index.d.ts +126 -22
- package/cjs/hostComponents/Navigator/index.js +16 -4
- package/cjs/hostComponents/Picker/index.d.ts +98 -43
- package/cjs/hostComponents/Picker/index.js +19 -1
- package/cjs/hostComponents/PickerView/index.d.ts +64 -14
- package/cjs/hostComponents/PickerView/index.js +12 -1
- package/cjs/hostComponents/PickerViewColumn/index.d.ts +11 -1
- package/cjs/hostComponents/Progress/index.d.ts +39 -1
- package/cjs/hostComponents/Progress/index.js +19 -2
- package/cjs/hostComponents/RichText/index.d.ts +50 -7
- package/cjs/hostComponents/RichText/index.js +8 -1
- package/cjs/hostComponents/ScrollView/index.d.ts +190 -54
- package/cjs/hostComponents/ScrollView/index.js +26 -1
- package/cjs/hostComponents/Slider/node.d.ts +1 -0
- package/cjs/hostComponents/Slider/node.js +1 -1
- package/cjs/hostComponents/SvgRender/index.d.ts +16 -1
- package/cjs/hostComponents/SvgRender/index.js +13 -1
- package/cjs/hostComponents/Swiper/node.js +1 -1
- package/cjs/hostComponents/SwiperItem/index.d.ts +86 -1
- package/cjs/hostComponents/Video/index.d.ts +176 -28
- package/cjs/hostComponents/Video/index.js +41 -1
- package/cjs/hostComponents/WebView/index.d.ts +64 -14
- package/cjs/hostComponents/WebView/index.js +10 -1
- package/cjs/types/component.d.ts +15 -6
- package/cjs/types/index.d.ts +2 -2
- package/cjs/types/index.js +1 -1
- package/esm/hostComponents/Camera/index.d.ts +105 -10
- package/esm/hostComponents/Camera/index.js +15 -0
- package/esm/hostComponents/Canvas/index.d.ts +197 -15
- package/esm/hostComponents/Canvas/index.js +11 -0
- package/esm/hostComponents/CoverView/index.d.ts +8 -1
- package/esm/hostComponents/Iframe/index.d.ts +59 -19
- package/esm/hostComponents/Iframe/index.js +7 -0
- package/esm/hostComponents/Iframe/node.d.ts +1 -0
- package/esm/hostComponents/Iframe/node.js +1 -1
- package/esm/hostComponents/Input/index.d.ts +1 -1
- package/esm/hostComponents/IpcPlayer/index.d.ts +297 -172
- package/esm/hostComponents/IpcPlayer/index.js +25 -0
- package/esm/hostComponents/Map/index.d.ts +202 -49
- package/esm/hostComponents/Map/index.js +16 -0
- package/esm/hostComponents/MovableArea/index.d.ts +18 -0
- package/esm/hostComponents/MovableArea/index.js +9 -0
- package/esm/hostComponents/MovableView/index.d.ts +92 -6
- package/esm/hostComponents/MovableView/index.js +18 -2
- package/esm/hostComponents/NativeVideo/index.d.ts +172 -14
- package/esm/hostComponents/NativeVideo/index.js +23 -0
- package/esm/hostComponents/Navigator/index.d.ts +126 -22
- package/esm/hostComponents/Navigator/index.js +15 -3
- package/esm/hostComponents/Picker/index.d.ts +98 -43
- package/esm/hostComponents/Picker/index.js +18 -0
- package/esm/hostComponents/PickerView/index.d.ts +64 -14
- package/esm/hostComponents/PickerView/index.js +11 -0
- package/esm/hostComponents/PickerViewColumn/index.d.ts +11 -1
- package/esm/hostComponents/Progress/index.d.ts +39 -1
- package/esm/hostComponents/Progress/index.js +18 -1
- package/esm/hostComponents/RichText/index.d.ts +50 -7
- package/esm/hostComponents/RichText/index.js +7 -0
- package/esm/hostComponents/ScrollView/index.d.ts +190 -54
- package/esm/hostComponents/ScrollView/index.js +25 -0
- package/esm/hostComponents/Slider/node.d.ts +1 -0
- package/esm/hostComponents/Slider/node.js +1 -1
- package/esm/hostComponents/SvgRender/index.d.ts +16 -1
- package/esm/hostComponents/SvgRender/index.js +12 -0
- package/esm/hostComponents/Swiper/node.js +1 -1
- package/esm/hostComponents/SwiperItem/index.d.ts +86 -1
- package/esm/hostComponents/Video/index.d.ts +176 -28
- package/esm/hostComponents/Video/index.js +40 -0
- package/esm/hostComponents/WebView/index.d.ts +64 -14
- package/esm/hostComponents/WebView/index.js +9 -0
- package/esm/types/component.d.ts +15 -6
- package/esm/types/index.d.ts +2 -2
- package/esm/types/index.js +1 -1
- package/node.js +1 -1
- package/package.json +3 -3
|
@@ -1,19 +1,69 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseEvent, BaseProps } from '../../types/component';
|
|
3
|
+
/** picker-view 选中项索引数据 */
|
|
4
|
+
export interface PickerViewValueDetail {
|
|
5
|
+
/** 各列当前选中项的索引数组(下标从 0 开始) */
|
|
6
|
+
value: number[];
|
|
7
|
+
}
|
|
8
|
+
/** picker-view 值变更事件对象 */
|
|
9
|
+
export interface PickerViewChangeEvent extends BaseEvent {
|
|
10
|
+
/** 事件类型 */
|
|
11
|
+
type: 'change';
|
|
12
|
+
/** 事件详情 */
|
|
13
|
+
detail: PickerViewValueDetail;
|
|
14
|
+
/** 各列当前选中项的索引数组(与 detail.value 一致) */
|
|
15
|
+
value: number[];
|
|
16
|
+
}
|
|
17
|
+
/** picker-view 滚动开始事件对象 */
|
|
18
|
+
export interface PickerViewPickstartEvent extends BaseEvent {
|
|
19
|
+
/** 事件类型 */
|
|
20
|
+
type: 'pickstart';
|
|
21
|
+
/** 事件详情 */
|
|
22
|
+
detail: PickerViewValueDetail;
|
|
23
|
+
/** 各列当前选中项的索引数组(与 detail.value 一致) */
|
|
24
|
+
value: number[];
|
|
25
|
+
}
|
|
26
|
+
/** picker-view 滚动结束事件对象 */
|
|
27
|
+
export interface PickerViewPickendEvent extends BaseEvent {
|
|
28
|
+
/** 事件类型 */
|
|
29
|
+
type: 'pickend';
|
|
30
|
+
/** 事件详情 */
|
|
31
|
+
detail: PickerViewValueDetail;
|
|
32
|
+
/** 各列当前选中项的索引数组(与 detail.value 一致) */
|
|
33
|
+
value: number[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 嵌入页面的滚动选择器。其中只可放置 PickerViewColumn 组件,其它节点不会显示。
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
* @alias PickerView
|
|
40
|
+
* @since @ray-js/ray 0.5.10
|
|
41
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
42
|
+
* @example 多列选择 ./demos/multi-column/index.tsx sandbox ide e2e
|
|
43
|
+
*/
|
|
3
44
|
export interface PickerViewProps extends BaseProps {
|
|
4
|
-
/** 数组中的数字依次表示 picker-view 内的 picker-view-column 选择的第几项(下标从 0 开始),数字大于 picker-view-column
|
|
45
|
+
/** 数组中的数字依次表示 picker-view 内的 picker-view-column 选择的第几项(下标从 0 开始),数字大于 picker-view-column 可选项长度时,选择最后一项 */
|
|
5
46
|
value?: number[];
|
|
6
|
-
/**
|
|
7
|
-
indicatorStyle?: React.CSSProperties;
|
|
8
|
-
/**
|
|
9
|
-
maskStyle?: React.CSSProperties;
|
|
10
|
-
/** 滚动选择时触发
|
|
11
|
-
onChange?: (event:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/** 当滚动选择结束时候触发事件 */
|
|
17
|
-
onPickend?: (event: GenericEvent) => any;
|
|
47
|
+
/** 设置选择器中间选中框的样式(对象或 CSS 声明字符串) */
|
|
48
|
+
indicatorStyle?: string | React.CSSProperties;
|
|
49
|
+
/** 设置蒙层的样式(对象或 CSS 声明字符串) */
|
|
50
|
+
maskStyle?: string | React.CSSProperties;
|
|
51
|
+
/** 滚动选择时触发 */
|
|
52
|
+
onChange?: (event: PickerViewChangeEvent) => void;
|
|
53
|
+
/** 当滚动选择开始时触发 */
|
|
54
|
+
onPickstart?: (event: PickerViewPickstartEvent) => void;
|
|
55
|
+
/** 当滚动选择结束时触发 */
|
|
56
|
+
onPickend?: (event: PickerViewPickendEvent) => void;
|
|
18
57
|
}
|
|
19
58
|
export declare const PickerView: React.ComponentType<PickerViewProps>;
|
|
59
|
+
/**
|
|
60
|
+
* PickerView 组件默认值
|
|
61
|
+
*
|
|
62
|
+
* @belong PickerView
|
|
63
|
+
* @defaults
|
|
64
|
+
*/
|
|
65
|
+
export declare const pickerViewDefaultProps: {
|
|
66
|
+
value: number[];
|
|
67
|
+
indicatorStyle: React.CSSProperties;
|
|
68
|
+
maskStyle: React.CSSProperties;
|
|
69
|
+
};
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import createHostComponent from '../createHostComponent.js';
|
|
2
2
|
export const PickerView = createHostComponent('picker-view');
|
|
3
|
+
/**
|
|
4
|
+
* PickerView 组件默认值
|
|
5
|
+
*
|
|
6
|
+
* @belong PickerView
|
|
7
|
+
* @defaults
|
|
8
|
+
*/
|
|
9
|
+
export const pickerViewDefaultProps = {
|
|
10
|
+
value: [],
|
|
11
|
+
indicatorStyle: {},
|
|
12
|
+
maskStyle: {},
|
|
13
|
+
};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseProps } from '../../types/component.js';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 滚动选择器子项,仅可放置于 PickerView 中,高度自动与选中框一致。
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @alias PickerViewColumn
|
|
8
|
+
* @since @ray-js/ray 0.5.10
|
|
9
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
10
|
+
* @example 多列使用 ./demos/multi-column/index.tsx sandbox ide e2e
|
|
11
|
+
*/
|
|
12
|
+
export interface PickerViewColumnProps extends BaseProps {
|
|
13
|
+
}
|
|
4
14
|
export declare const PickerViewColumn: React.ComponentType<PickerViewColumnProps>;
|
|
@@ -1,14 +1,52 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseProps } from '../../types/component.js';
|
|
3
|
+
/**
|
|
4
|
+
* 进度条组件,用于展示操作或任务的当前进度。
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @alias Progress
|
|
8
|
+
* @since @ray-js/ray 0.6.15
|
|
9
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
10
|
+
*
|
|
11
|
+
* @example 显示百分比 ./demos/show-percent/index.tsx sandbox ide e2e
|
|
12
|
+
* @example 自定义样式 ./demos/custom-style/index.tsx sandbox ide e2e
|
|
13
|
+
* @example 进度动画 ./demos/progress-animation/index.tsx sandbox ide e2e
|
|
14
|
+
*/
|
|
3
15
|
export interface ProgressProps extends BaseProps {
|
|
16
|
+
/** 当前进度,取值范围 0~100 */
|
|
4
17
|
percent?: number;
|
|
18
|
+
/** 是否在进度条右侧显示百分比 */
|
|
5
19
|
showInfo?: boolean;
|
|
20
|
+
/** 圆角大小,默认单位 rpx */
|
|
6
21
|
borderRadius?: number | string;
|
|
22
|
+
/** 右侧百分比字体大小,默认单位 px */
|
|
7
23
|
fontSize?: number | string;
|
|
24
|
+
/** 进度条线宽,默认单位 rpx */
|
|
8
25
|
strokeWidth?: number | string;
|
|
26
|
+
/** 已完成部分的颜色 */
|
|
9
27
|
activeColor?: string;
|
|
28
|
+
/** 未完成部分的颜色 */
|
|
10
29
|
backgroundColor?: string;
|
|
30
|
+
/** 是否开启从左到右的进度动画 */
|
|
11
31
|
active?: boolean;
|
|
12
|
-
|
|
32
|
+
/** 动画播放模式,`backwards` 从头播放,`forwards` 从上次结束点继续播放 */
|
|
33
|
+
activeMode?: 'backwards' | 'forwards';
|
|
13
34
|
}
|
|
14
35
|
export declare const Progress: React.ComponentType<ProgressProps>;
|
|
36
|
+
/**
|
|
37
|
+
* Progress 组件默认值
|
|
38
|
+
*
|
|
39
|
+
* @belong Progress
|
|
40
|
+
* @defaults
|
|
41
|
+
*/
|
|
42
|
+
export declare const progressDefaultProps: {
|
|
43
|
+
percent: number;
|
|
44
|
+
showInfo: boolean;
|
|
45
|
+
borderRadius: number;
|
|
46
|
+
fontSize: number;
|
|
47
|
+
strokeWidth: number;
|
|
48
|
+
activeColor: string;
|
|
49
|
+
backgroundColor: string;
|
|
50
|
+
active: boolean;
|
|
51
|
+
activeMode: string;
|
|
52
|
+
};
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import createHostComponent from '../createHostComponent.js';
|
|
2
2
|
export const Progress = createHostComponent('progress');
|
|
3
|
+
/**
|
|
4
|
+
* Progress 组件默认值
|
|
5
|
+
*
|
|
6
|
+
* @belong Progress
|
|
7
|
+
* @defaults
|
|
8
|
+
*/
|
|
9
|
+
export const progressDefaultProps = {
|
|
10
|
+
percent: 0,
|
|
11
|
+
showInfo: false,
|
|
12
|
+
borderRadius: 0,
|
|
13
|
+
fontSize: 16,
|
|
14
|
+
strokeWidth: 6,
|
|
15
|
+
activeColor: '#007aff',
|
|
16
|
+
backgroundColor: 'rgba(0,0,0,0.04)',
|
|
17
|
+
active: false,
|
|
18
|
+
activeMode: 'backwards',
|
|
19
|
+
};
|
|
3
20
|
Progress.defaultProps = {
|
|
4
21
|
borderRadius: 0,
|
|
5
22
|
fontSize: 16,
|
|
6
23
|
strokeWidth: 6,
|
|
7
24
|
activeColor: '#007aff',
|
|
8
|
-
backgroundColor: 'rgba(0,0,0
|
|
25
|
+
backgroundColor: 'rgba(0,0,0,0.04)',
|
|
9
26
|
activeMode: 'backwards',
|
|
10
27
|
};
|
|
@@ -1,14 +1,57 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BaseProps } from '../../types/component
|
|
3
|
-
|
|
2
|
+
import { BaseEvent, BaseProps } from '../../types/component';
|
|
3
|
+
/** 富文本元素节点 */
|
|
4
|
+
export interface RichTextNode {
|
|
5
|
+
/** 标签名 */
|
|
4
6
|
name: string;
|
|
5
|
-
|
|
7
|
+
/** 节点属性 */
|
|
8
|
+
attrs?: Record<string, string>;
|
|
9
|
+
/** 子节点列表 */
|
|
6
10
|
children?: RichTextNode[];
|
|
7
|
-
}
|
|
11
|
+
}
|
|
12
|
+
/** 富文本文本节点 */
|
|
13
|
+
export interface RichTextTextNode {
|
|
14
|
+
/** 节点类型 */
|
|
15
|
+
type: 'text';
|
|
16
|
+
/** 文本内容,支持 entities */
|
|
17
|
+
text: string;
|
|
18
|
+
}
|
|
19
|
+
/** rich-text 选中标签事件数据 */
|
|
20
|
+
export interface RichTextSelectDetail {
|
|
21
|
+
/** 标签名 */
|
|
22
|
+
name: string;
|
|
23
|
+
/** 标签属性 */
|
|
24
|
+
attrs: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
/** rich-text 选中标签事件对象 */
|
|
27
|
+
export interface RichTextSelectEvent extends BaseEvent {
|
|
28
|
+
/** 事件类型 */
|
|
29
|
+
type: 'select';
|
|
30
|
+
/** 事件数据 */
|
|
31
|
+
detail: RichTextSelectDetail;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 富文本组件,用于渲染富文本内容。
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
* @alias RichText
|
|
38
|
+
* @since @ray-js/ray 0.5.10
|
|
39
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
40
|
+
* @example HTML String 格式 ./demos/html-string/index.tsx sandbox ide e2e
|
|
41
|
+
* @example 文本节点列表格式 ./demos/node-list/index.tsx sandbox ide e2e
|
|
42
|
+
* @example 点击标签事件 ./demos/tap-event/index.tsx sandbox ide e2e
|
|
43
|
+
*/
|
|
8
44
|
export interface RichTextProps extends BaseProps {
|
|
9
|
-
/**
|
|
45
|
+
/** 节点列表(元素/文本节点数组)或 HTML 字符串 */
|
|
10
46
|
nodes?: string | RichTextNode[];
|
|
11
|
-
|
|
47
|
+
/** 点击富文本内标签时触发 */
|
|
48
|
+
onSelect?: (event: RichTextSelectEvent) => void;
|
|
12
49
|
}
|
|
13
50
|
export declare const RichText: React.ComponentType<RichTextProps>;
|
|
14
|
-
|
|
51
|
+
/**
|
|
52
|
+
* RichText 组件默认值
|
|
53
|
+
*
|
|
54
|
+
* @belong RichText
|
|
55
|
+
* @defaults
|
|
56
|
+
*/
|
|
57
|
+
export declare const richTextDefaultProps: {};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import createHostComponent from '../createHostComponent.js';
|
|
2
2
|
export const RichText = createHostComponent('rich-text');
|
|
3
|
+
/**
|
|
4
|
+
* RichText 组件默认值
|
|
5
|
+
*
|
|
6
|
+
* @belong RichText
|
|
7
|
+
* @defaults
|
|
8
|
+
*/
|
|
9
|
+
export const richTextDefaultProps = {};
|
|
3
10
|
RichText.defaultProps = {};
|
|
@@ -1,75 +1,211 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseEvent, BaseProps } from '../../types/component';
|
|
3
|
+
export interface ScrollDetail {
|
|
4
|
+
/** 横向滚动位置 */
|
|
5
|
+
scrollLeft: number;
|
|
6
|
+
/** 纵向滚动位置 */
|
|
7
|
+
scrollTop: number;
|
|
8
|
+
/** 滚动内容高度 */
|
|
9
|
+
scrollHeight: number;
|
|
10
|
+
/** 滚动内容宽度 */
|
|
11
|
+
scrollWidth: number;
|
|
12
|
+
/** 横向滚动变化量 */
|
|
13
|
+
deltaX: number;
|
|
14
|
+
/** 纵向滚动变化量 */
|
|
15
|
+
deltaY: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 滚动事件对象
|
|
19
|
+
*/
|
|
20
|
+
export interface ScrollEvent extends BaseEvent, ScrollDetail {
|
|
21
|
+
/** 事件类型 */
|
|
22
|
+
type: 'scroll';
|
|
23
|
+
/** 滚动事件详情数据 */
|
|
24
|
+
detail: ScrollDetail;
|
|
25
|
+
}
|
|
26
|
+
export interface ScrollDirectionDetail {
|
|
27
|
+
/** 滚动方向 */
|
|
28
|
+
direction: 'top' | 'left' | 'bottom' | 'right';
|
|
29
|
+
}
|
|
30
|
+
export interface ScrolltoupperEvent extends BaseEvent {
|
|
31
|
+
/** 事件类型 */
|
|
32
|
+
type: 'scrolltoupper';
|
|
33
|
+
/** 滚动事件详情数据 */
|
|
34
|
+
detail: ScrollDirectionDetail;
|
|
35
|
+
}
|
|
36
|
+
export interface ScrolltolowerEvent extends BaseEvent {
|
|
37
|
+
/** 事件类型 */
|
|
38
|
+
type: 'scrolltolower';
|
|
39
|
+
/** 滚动事件详情数据 */
|
|
40
|
+
detail: ScrollDirectionDetail;
|
|
41
|
+
}
|
|
42
|
+
export interface RefresherPullingEvent extends BaseEvent {
|
|
43
|
+
/** 事件类型 */
|
|
44
|
+
type: 'refresherpulling';
|
|
45
|
+
}
|
|
46
|
+
export interface RefresherRefreshEvent extends BaseEvent {
|
|
47
|
+
/** 事件类型 */
|
|
48
|
+
type: 'refresherrefresh';
|
|
49
|
+
}
|
|
50
|
+
export interface RefresherRestoreEvent extends BaseEvent {
|
|
51
|
+
/** 事件类型 */
|
|
52
|
+
type: 'refresherrestore';
|
|
53
|
+
}
|
|
54
|
+
export interface RefresherAbortEvent extends BaseEvent {
|
|
55
|
+
/** 事件类型 */
|
|
56
|
+
type: 'refresherabort';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 可滚动视图容器,支持横向或纵向滚动,可配置下拉刷新、滚动事件监听等功能。
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
* @alias ScrollView
|
|
63
|
+
* @since @ray-js/ray 0.5.10
|
|
64
|
+
* @example 基础用法 ./demos/basic/index.tsx sandbox ide e2e
|
|
65
|
+
* @example 下拉刷新 ./demos/pull-refresh/index.tsx sandbox ide e2e
|
|
66
|
+
* @example 横向滚动 ./demos/horizontal-scroll/index.tsx sandbox ide e2e
|
|
67
|
+
* @example 滚动到指定位置 ./demos/scroll-to/index.tsx sandbox ide
|
|
68
|
+
*/
|
|
3
69
|
export interface ScrollViewProps extends BaseProps {
|
|
70
|
+
/** 允许横向滚动 */
|
|
4
71
|
scrollX?: boolean;
|
|
72
|
+
/** 允许纵向滚动 */
|
|
5
73
|
scrollY?: boolean;
|
|
74
|
+
/** 距顶部/左边多远时,触发 scrolltoupper 事件 */
|
|
6
75
|
upperThreshold?: number | string;
|
|
76
|
+
/** 距底部/右边多远时,触发 scrolltolower 事件 */
|
|
7
77
|
lowerThreshold?: number | string;
|
|
78
|
+
/** 设置竖向滚动条位置 */
|
|
8
79
|
scrollTop?: number | string;
|
|
80
|
+
/** 设置横向滚动条位置 */
|
|
9
81
|
scrollLeft?: number | string;
|
|
82
|
+
/** 值应为某子元素 id(id 不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素 */
|
|
10
83
|
scrollIntoView?: string;
|
|
84
|
+
/**
|
|
85
|
+
* 跳转到 scrollIntoView 目标节点时的额外偏移,单位 px
|
|
86
|
+
* @since 1.7.58
|
|
87
|
+
*/
|
|
11
88
|
scrollIntoViewOffset?: number;
|
|
89
|
+
/** 在设置滚动条位置时使用动画过渡 */
|
|
12
90
|
scrollWithAnimation?: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type: 'scrolltoupper';
|
|
25
|
-
direction: 'top' | 'left';
|
|
26
|
-
origin: any;
|
|
27
|
-
}) => void;
|
|
28
|
-
onScrollToLower?: (event: GenericEvent & {
|
|
29
|
-
type: 'scrolltolower';
|
|
30
|
-
direction: 'bottom' | 'right';
|
|
31
|
-
origin: any;
|
|
32
|
-
}) => void;
|
|
91
|
+
/** 滚动时触发 */
|
|
92
|
+
onScroll?: (event: ScrollEvent) => void;
|
|
93
|
+
/** 滚动到顶部/左边时触发 */
|
|
94
|
+
onScrollToUpper?: (event: ScrolltoupperEvent) => void;
|
|
95
|
+
/** 滚动到底部/右边时触发 */
|
|
96
|
+
onScrollToLower?: (event: ScrolltolowerEvent) => void;
|
|
97
|
+
/**
|
|
98
|
+
* iOS 点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向滚动
|
|
99
|
+
*
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
33
102
|
enableBackToTop?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* 启用 flexbox 布局。开启后,当前节点声明了 display:flex 就会成为 flex container,并作用于其孩子节点
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
34
108
|
enableFlex?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 开启自定义下拉刷新
|
|
111
|
+
* @since 0.9.3
|
|
112
|
+
*/
|
|
35
113
|
refresherEnabled?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* 设置自定义下拉刷新阈值
|
|
116
|
+
* @since 0.9.3
|
|
117
|
+
*/
|
|
36
118
|
refresherThreshold?: number;
|
|
37
|
-
|
|
119
|
+
/**
|
|
120
|
+
* 设置自定义下拉刷新默认样式,支持设置 black、white、none,none 表示不使用默认样式
|
|
121
|
+
* @since 0.9.3
|
|
122
|
+
*/
|
|
123
|
+
refresherDefaultStyle?: 'black' | 'white' | 'none' | 'auto';
|
|
124
|
+
/**
|
|
125
|
+
* 设置自定义下拉刷新区域背景颜色
|
|
126
|
+
* @since 0.9.3
|
|
127
|
+
*/
|
|
38
128
|
refresherBackground?: string;
|
|
129
|
+
/**
|
|
130
|
+
* 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
|
|
131
|
+
* @since 0.9.3
|
|
132
|
+
*/
|
|
39
133
|
refresherTriggered?: boolean;
|
|
134
|
+
/** 隐藏滚动条 */
|
|
40
135
|
hideScrollbar?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* 是否启用iOS滚动回弹效果(iOS 16.0+ 完全支持)
|
|
138
|
+
* @since 1.7.58
|
|
139
|
+
*/
|
|
41
140
|
bounces?: boolean;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onRefresherpulling?: (event:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
141
|
+
/**
|
|
142
|
+
* 自定义下拉刷新控件被下拉时触发
|
|
143
|
+
* @since 0.9.3
|
|
144
|
+
*/
|
|
145
|
+
onRefresherpulling?: (event: RefresherPullingEvent) => void;
|
|
146
|
+
/**
|
|
147
|
+
* 自定义下拉刷新控件被下拉时触发
|
|
148
|
+
*
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
|
+
onRefresherPulling?: (event: RefresherPullingEvent) => void;
|
|
152
|
+
/**
|
|
153
|
+
* 自定义下拉刷新被触发时触发
|
|
154
|
+
* @since 0.9.3
|
|
155
|
+
*/
|
|
156
|
+
onRefresherrefresh?: (event: RefresherRefreshEvent) => void;
|
|
157
|
+
/**
|
|
158
|
+
* 自定义下拉刷新被触发时触发
|
|
159
|
+
*
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
162
|
+
onRefresherRefresh?: (event: RefresherRefreshEvent) => void;
|
|
163
|
+
/**
|
|
164
|
+
* 自定义下拉刷新被复位时触发
|
|
165
|
+
* @since 0.9.3
|
|
166
|
+
*/
|
|
167
|
+
onRefresherrestore?: (event: RefresherRestoreEvent) => void;
|
|
168
|
+
/**
|
|
169
|
+
* 自定义下拉刷新被复位时触发
|
|
170
|
+
*
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
onRefresherRestore?: (event: RefresherRestoreEvent) => void;
|
|
174
|
+
/**
|
|
175
|
+
* 自定义下拉刷新被中止时触发
|
|
176
|
+
* @since 0.9.3
|
|
177
|
+
*/
|
|
178
|
+
onRefresherabort?: (event: RefresherAbortEvent) => void;
|
|
179
|
+
/**
|
|
180
|
+
* 自定义下拉刷新被中止
|
|
181
|
+
* @internal
|
|
182
|
+
* @deprecated 请使用 onRefresherabort
|
|
183
|
+
*/
|
|
184
|
+
onRefresherAbort?: (event: RefresherAbortEvent) => void;
|
|
74
185
|
}
|
|
75
186
|
export declare const ScrollView: React.ComponentType<ScrollViewProps>;
|
|
187
|
+
/**
|
|
188
|
+
* ScrollView 组件默认值
|
|
189
|
+
*
|
|
190
|
+
* @belong ScrollView
|
|
191
|
+
* @defaults
|
|
192
|
+
*/
|
|
193
|
+
export declare const scrollViewDefaultProps: {
|
|
194
|
+
scrollX: boolean;
|
|
195
|
+
scrollY: boolean;
|
|
196
|
+
scrollTop: number;
|
|
197
|
+
scrollLeft: number;
|
|
198
|
+
scrollIntoViewOffset: number;
|
|
199
|
+
scrollWithAnimation: boolean;
|
|
200
|
+
upperThreshold: number;
|
|
201
|
+
lowerThreshold: number;
|
|
202
|
+
enableBackToTop: boolean;
|
|
203
|
+
enableFlex: boolean;
|
|
204
|
+
hideScrollbar: boolean;
|
|
205
|
+
bounces: boolean;
|
|
206
|
+
refresherEnabled: boolean;
|
|
207
|
+
refresherThreshold: number;
|
|
208
|
+
refresherDefaultStyle: string;
|
|
209
|
+
refresherBackground: string;
|
|
210
|
+
refresherTriggered: boolean;
|
|
211
|
+
};
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import createHostComponent from '../createHostComponent.js';
|
|
2
2
|
export const ScrollView = createHostComponent('scroll-view');
|
|
3
|
+
/**
|
|
4
|
+
* ScrollView 组件默认值
|
|
5
|
+
*
|
|
6
|
+
* @belong ScrollView
|
|
7
|
+
* @defaults
|
|
8
|
+
*/
|
|
9
|
+
export const scrollViewDefaultProps = {
|
|
10
|
+
scrollX: false,
|
|
11
|
+
scrollY: false,
|
|
12
|
+
scrollTop: 0,
|
|
13
|
+
scrollLeft: 0,
|
|
14
|
+
scrollIntoViewOffset: 0,
|
|
15
|
+
scrollWithAnimation: false,
|
|
16
|
+
upperThreshold: 50,
|
|
17
|
+
lowerThreshold: 50,
|
|
18
|
+
enableBackToTop: false,
|
|
19
|
+
enableFlex: false,
|
|
20
|
+
hideScrollbar: true,
|
|
21
|
+
bounces: true,
|
|
22
|
+
refresherEnabled: false,
|
|
23
|
+
refresherThreshold: 45,
|
|
24
|
+
refresherDefaultStyle: 'black',
|
|
25
|
+
refresherBackground: '#FFF',
|
|
26
|
+
refresherTriggered: false,
|
|
27
|
+
};
|
|
3
28
|
ScrollView.defaultProps = {
|
|
4
29
|
upperThreshold: 50,
|
|
5
30
|
lowerThreshold: 50,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { universalAlias } from '../universal.js';
|
|
2
|
-
export const alias = Object.assign(Object.assign({}, universalAlias), { min: 'min', max: 'max', step: 'step', value: 'value', color: 'color', selectedColor: 'selected-color', activeColor: 'active-color', backgroundColor: 'background-color', blockColor: 'block-color', blockSize: 'block-size', showValue: 'show-value', onChange: 'bind:change', onChanging: 'bind:changing' });
|
|
2
|
+
export const alias = Object.assign(Object.assign({}, universalAlias), { disabled: 'disabled', min: 'min', max: 'max', step: 'step', value: 'value', color: 'color', selectedColor: 'selected-color', activeColor: 'active-color', backgroundColor: 'background-color', blockColor: 'block-color', blockSize: 'block-size', showValue: 'show-value', onChange: 'bind:change', onChanging: 'bind:changing' });
|
|
3
3
|
export const props = Object.values(alias);
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseProps } from '../../types/component.js';
|
|
3
|
+
/**
|
|
4
|
+
* SVG 源码渲染组件
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
3
8
|
export interface SvgRenderProps extends BaseProps {
|
|
4
|
-
|
|
9
|
+
/** SVG 源码字符串,须为完整的 `<svg>...</svg>` 片段 */
|
|
10
|
+
source?: string;
|
|
5
11
|
}
|
|
6
12
|
export declare const SvgRender: React.ComponentType<SvgRenderProps>;
|
|
13
|
+
/**
|
|
14
|
+
* SvgRender 组件默认值
|
|
15
|
+
*
|
|
16
|
+
* @belong SvgRender
|
|
17
|
+
* @defaults
|
|
18
|
+
*/
|
|
19
|
+
export declare const svgRenderDefaultProps: {
|
|
20
|
+
source: string;
|
|
21
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
import createHostComponent from '../createHostComponent.js';
|
|
2
2
|
export const SvgRender = createHostComponent('svg-render');
|
|
3
|
+
/**
|
|
4
|
+
* SvgRender 组件默认值
|
|
5
|
+
*
|
|
6
|
+
* @belong SvgRender
|
|
7
|
+
* @defaults
|
|
8
|
+
*/
|
|
9
|
+
export const svgRenderDefaultProps = {
|
|
10
|
+
source: '',
|
|
11
|
+
};
|
|
12
|
+
SvgRender.defaultProps = {
|
|
13
|
+
source: '',
|
|
14
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { universalAlias } from '../universal.js';
|
|
2
|
-
export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class', animation: 'animation', style: 'style', indicatorDots: 'indicator-dots', indicatorColor: 'indicator-color', indicatorActiveColor: 'indicator-active-color', autoplay: 'autoplay', current: 'current', interval: 'interval', duration: 'duration', circular: 'circular', vertical: 'vertical', previousMargin: 'previous-margin', nextMargin: 'next-margin', snapToEdge: 'snap-to-edge', displayMultipleItems: 'display-multiple-items', onChange: 'bind:change', onTransition: '
|
|
2
|
+
export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class', animation: 'animation', style: 'style', indicatorDots: 'indicator-dots', indicatorColor: 'indicator-color', indicatorActiveColor: 'indicator-active-color', autoplay: 'autoplay', current: 'current', interval: 'interval', duration: 'duration', circular: 'circular', vertical: 'vertical', previousMargin: 'previous-margin', nextMargin: 'next-margin', snapToEdge: 'snap-to-edge', displayMultipleItems: 'display-multiple-items', onChange: 'bind:change', onTransition: 'bind:transition', onAnimationFinish: 'bind:animationfinish', onTap: 'bind:tap', onClick: 'bind:tap' });
|
|
3
3
|
export const props = Object.values(alias);
|