@ray-js/components 0.6.1 → 0.6.3-beta-1
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Image/props.d.ts +1 -2
- package/lib/Input/props.d.ts +3 -4
- package/lib/ScrollView/props.d.ts +3 -4
- package/lib/Switch/props.d.ts +1 -2
- package/lib/View/props.d.ts +0 -7
- package/package.json +5 -15
- package/lib/utils/index.d.ts +0 -9
- package/lib/utils/index.js +0 -90
- package/lib/utils/interface.d.ts +0 -20
- package/lib/utils/interface.js +0 -1
package/lib/Image/props.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { BaseProps } from '../types';
|
2
2
|
import { TouchEventHandler } from '@ray-js/framework-shared';
|
3
3
|
import { GenericEvent as WxEvent } from '@ray-core/wechat';
|
4
|
-
import { ImageLoadEventData as RnLoadEvent } from 'react-native';
|
5
4
|
export interface ImageProps extends BaseProps, TouchEventHandler {
|
6
5
|
/**
|
7
6
|
* @description.en image source uri
|
@@ -33,7 +32,7 @@ export interface ImageProps extends BaseProps, TouchEventHandler {
|
|
33
32
|
* @default undefined
|
34
33
|
*/
|
35
34
|
height: number;
|
36
|
-
origin:
|
35
|
+
origin: WxEvent;
|
37
36
|
}) => any;
|
38
37
|
/**
|
39
38
|
* @description.en Triggered when an error occurs
|
package/lib/Input/props.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { BaseProps } from '../types';
|
2
|
-
import { TextInputChangeEventData as RnInputChangeEvent, NativeSyntheticEvent, TextInputFocusEventData } from 'react-native';
|
3
2
|
import { GenericEvent as WxEvent } from '@ray-core/wechat';
|
4
3
|
export declare type InputType = 'text' | 'number' | 'digit' | 'idcard';
|
5
4
|
export interface InputProps extends BaseProps {
|
@@ -87,7 +86,7 @@ export interface InputProps extends BaseProps {
|
|
87
86
|
* @default undefined
|
88
87
|
*/
|
89
88
|
value: string;
|
90
|
-
origin:
|
89
|
+
origin: WxEvent | Event;
|
91
90
|
}) => void;
|
92
91
|
/**
|
93
92
|
* @description.en onConfirm
|
@@ -113,7 +112,7 @@ export interface InputProps extends BaseProps {
|
|
113
112
|
* @default undefined
|
114
113
|
*/
|
115
114
|
value: string;
|
116
|
-
origin:
|
115
|
+
origin: WxEvent | FocusEvent;
|
117
116
|
}) => void;
|
118
117
|
/**
|
119
118
|
* @description.en onBlur
|
@@ -133,7 +132,7 @@ export interface InputProps extends BaseProps {
|
|
133
132
|
* @default undefined
|
134
133
|
*/
|
135
134
|
value: string;
|
136
|
-
origin:
|
135
|
+
origin: WxEvent | FocusEvent;
|
137
136
|
}) => void;
|
138
137
|
}
|
139
138
|
export declare const defaultInputProps: Partial<InputProps>;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { BaseProps } from '../types';
|
2
|
-
import { NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
|
3
2
|
import { GenericEvent as WxScrollEvent } from '@ray-core/wechat';
|
4
3
|
export interface ScrollViewProps extends BaseProps {
|
5
4
|
/** (default: false) 允许横向滚动 1.0.0 */
|
@@ -80,7 +79,7 @@ export interface ScrollViewProps extends BaseProps {
|
|
80
79
|
scrollWidth: number;
|
81
80
|
deltaX: number;
|
82
81
|
deltaY: number;
|
83
|
-
origin:
|
82
|
+
origin: WxScrollEvent;
|
84
83
|
}) => any;
|
85
84
|
/**
|
86
85
|
* @description.en Trigger 1.0.0 when scrolling to the top/left
|
@@ -95,7 +94,7 @@ export interface ScrollViewProps extends BaseProps {
|
|
95
94
|
*/
|
96
95
|
type: 'scrolltoupper';
|
97
96
|
direction: 'top' | 'left';
|
98
|
-
origin:
|
97
|
+
origin: WxScrollEvent | Event;
|
99
98
|
}) => any;
|
100
99
|
/**
|
101
100
|
* @description.en Triggered when scrolling to the bottom/right
|
@@ -110,7 +109,7 @@ export interface ScrollViewProps extends BaseProps {
|
|
110
109
|
*/
|
111
110
|
type: 'scrolltolower';
|
112
111
|
direction: 'bottom' | 'right';
|
113
|
-
origin:
|
112
|
+
origin: WxScrollEvent | Event;
|
114
113
|
}) => any;
|
115
114
|
}
|
116
115
|
export declare const defaultScrollViewProps: ScrollViewProps;
|
package/lib/Switch/props.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
3
2
|
import { BaseProps } from '../types';
|
4
3
|
export interface SwitchProps extends BaseProps {
|
5
4
|
/**
|
@@ -51,7 +50,7 @@ export interface SwitchProps extends BaseProps {
|
|
51
50
|
* @description.zh 风格
|
52
51
|
* @default undefined
|
53
52
|
*/
|
54
|
-
style?: React.CSSProperties
|
53
|
+
style?: React.CSSProperties;
|
55
54
|
}
|
56
55
|
export declare const defaultSwitchProps: {
|
57
56
|
type: string;
|
package/lib/View/props.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import { ViewProps as ViewBaseProps, StyleProp } from 'react-native';
|
2
1
|
import { BaseProps, TouchEventHandler } from '../types';
|
3
2
|
export interface ViewProps extends BaseProps, TouchEventHandler {
|
4
3
|
/**
|
@@ -7,12 +6,6 @@ export interface ViewProps extends BaseProps, TouchEventHandler {
|
|
7
6
|
* @default undefined
|
8
7
|
*/
|
9
8
|
hoverClassName?: string;
|
10
|
-
/**
|
11
|
-
* @description.en hoverStyle
|
12
|
-
* @description.zh hover 样式名
|
13
|
-
* @default undefined
|
14
|
-
*/
|
15
|
-
hoverStyle?: StyleProp<ViewBaseProps>;
|
16
9
|
/**
|
17
10
|
* @description.en How long after the click appears in ms
|
18
11
|
* @description.zh 按住后多久出现点击态 单位 ms
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/components",
|
3
|
-
"version": "0.6.1",
|
3
|
+
"version": "0.6.3-beta-1",
|
4
4
|
"description": "Ray basic components",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -26,26 +26,16 @@
|
|
26
26
|
"dependencies": {
|
27
27
|
"@ray-core/macro": "^0.0.x",
|
28
28
|
"@ray-core/wechat": "^0.0.x",
|
29
|
-
"@ray-js/framework-shared": "^0.6.1",
|
30
|
-
"@ray-js/remax-tuya": "^0.5.7-beta-1",
|
31
|
-
"antd-mobile": "^5.0.0-beta.17",
|
32
|
-
"antd-mobile-icons": "^0.2.2",
|
29
|
+
"@ray-js/framework-shared": "^0.6.3-beta-1",
|
33
30
|
"clsx": "^1.1.1",
|
34
31
|
"core-js": "^3.19.1",
|
35
32
|
"hooks": "^0.3.2",
|
36
33
|
"param-case": "^3.0.4",
|
37
34
|
"react": "^17.0.2",
|
38
|
-
"
|
39
|
-
"react-native-swiper": "^1.6.0",
|
40
|
-
"shifty": "^2.15.2",
|
41
|
-
"style-to-object": "^0.3.0",
|
42
|
-
"tuya-panel-icon": "^0.1.1",
|
43
|
-
"tuya-panel-motion": "^0.0.2",
|
44
|
-
"tuya-panel-slider": "^0.1.1",
|
45
|
-
"tuya-panel-switch": "^0.1.1"
|
35
|
+
"style-to-object": "^0.3.0"
|
46
36
|
},
|
47
37
|
"devDependencies": {
|
48
|
-
"@ray-js/cli": "^0.6.1"
|
38
|
+
"@ray-js/cli": "^0.6.3-beta-1"
|
49
39
|
},
|
50
40
|
"maintainers": [
|
51
41
|
{
|
@@ -53,6 +43,6 @@
|
|
53
43
|
"email": "tuyafe@tuya.com"
|
54
44
|
}
|
55
45
|
],
|
56
|
-
"gitHead": "
|
46
|
+
"gitHead": "e75625995cfce207c177b38c242090cd0c199cb9",
|
57
47
|
"repository": {}
|
58
48
|
}
|
package/lib/utils/index.d.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
import { ClickEventRet, TouchEventRet } from './interface';
|
2
|
-
declare const omit: (obj?: any, fields?: string[]) => {
|
3
|
-
[key: string]: any;
|
4
|
-
};
|
5
|
-
declare const getClickEvent: (event: GestureResponderEvent, type: 'click' | 'longclick') => ClickEventRet;
|
6
|
-
declare const getTouchEvent: (event: GestureResponderEvent, type: 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel') => TouchEventRet;
|
7
|
-
declare const extracteTextStyle: (style?: any) => StyleProp<TextStyle>;
|
8
|
-
declare const isTwoArray: (array: any) => boolean;
|
9
|
-
export { omit, getClickEvent, getTouchEvent, extracteTextStyle, isTwoArray };
|
package/lib/utils/index.js
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
-
import "core-js/modules/es.object.to-string.js";
|
3
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
4
|
-
import "core-js/modules/es.array.map.js";
|
5
|
-
import "core-js/modules/es.object.keys.js";
|
6
|
-
import "core-js/modules/es.regexp.exec.js";
|
7
|
-
import "core-js/modules/es.regexp.test.js";
|
8
|
-
import { StyleSheet } from 'react-native';
|
9
|
-
var TEXT_STYLE_REGEX = /color|font.*|text.*|letterSpacing|lineHeight|includeFontPadding|writingDirection/;
|
10
|
-
|
11
|
-
var omit = function () {
|
12
|
-
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
13
|
-
var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
14
|
-
|
15
|
-
var shallowCopy = _objectSpread({}, obj);
|
16
|
-
|
17
|
-
fields.forEach(function (key) {
|
18
|
-
delete shallowCopy[key];
|
19
|
-
});
|
20
|
-
return shallowCopy;
|
21
|
-
};
|
22
|
-
|
23
|
-
var getClickEvent = function (event, type) {
|
24
|
-
var nativeEvent = event.nativeEvent;
|
25
|
-
var timestamp = nativeEvent.timestamp,
|
26
|
-
pageX = nativeEvent.pageX,
|
27
|
-
pageY = nativeEvent.pageY;
|
28
|
-
return {
|
29
|
-
type: type,
|
30
|
-
timeStamp: timestamp,
|
31
|
-
pageX: pageX,
|
32
|
-
pageY: pageY,
|
33
|
-
origin: event
|
34
|
-
};
|
35
|
-
};
|
36
|
-
|
37
|
-
var getTouchEvent = function (event, type) {
|
38
|
-
var nativeEvent = event.nativeEvent;
|
39
|
-
var timestamp = nativeEvent.timestamp,
|
40
|
-
_nativeEvent$touches = nativeEvent.touches,
|
41
|
-
touches = _nativeEvent$touches === void 0 ? [] : _nativeEvent$touches,
|
42
|
-
_nativeEvent$changedT = nativeEvent.changedTouches,
|
43
|
-
changedTouches = _nativeEvent$changedT === void 0 ? [] : _nativeEvent$changedT;
|
44
|
-
return {
|
45
|
-
type: type,
|
46
|
-
timeStamp: timestamp,
|
47
|
-
touches: touches.map(function (item) {
|
48
|
-
return {
|
49
|
-
identifier: item.identifier,
|
50
|
-
pageX: item.pageX,
|
51
|
-
pageY: item.pageY
|
52
|
-
};
|
53
|
-
}),
|
54
|
-
changedTouches: changedTouches.map(function (item) {
|
55
|
-
return {
|
56
|
-
identifier: item.identifier,
|
57
|
-
pageX: item.pageX,
|
58
|
-
pageY: item.pageY
|
59
|
-
};
|
60
|
-
}),
|
61
|
-
origin: event
|
62
|
-
};
|
63
|
-
};
|
64
|
-
|
65
|
-
var extracteTextStyle = function (style) {
|
66
|
-
var flattenStyle = StyleSheet.flatten(style);
|
67
|
-
var textStyle = {};
|
68
|
-
|
69
|
-
if (flattenStyle) {
|
70
|
-
Object.keys(flattenStyle).forEach(function (key) {
|
71
|
-
if (TEXT_STYLE_REGEX.test(key)) {
|
72
|
-
textStyle[key] = flattenStyle[key];
|
73
|
-
}
|
74
|
-
});
|
75
|
-
}
|
76
|
-
|
77
|
-
return textStyle;
|
78
|
-
};
|
79
|
-
|
80
|
-
var isTwoArray = function (array) {
|
81
|
-
var res = true;
|
82
|
-
array.some(function (items) {
|
83
|
-
if (!Array.isArray(items)) {
|
84
|
-
res = false;
|
85
|
-
}
|
86
|
-
});
|
87
|
-
return res;
|
88
|
-
};
|
89
|
-
|
90
|
-
export { omit, getClickEvent, getTouchEvent, extracteTextStyle, isTwoArray };
|
package/lib/utils/interface.d.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import { GestureResponderEvent } from 'react-native';
|
2
|
-
export declare type NativeEvent = {
|
3
|
-
identifier: string;
|
4
|
-
pageX: number;
|
5
|
-
pageY: number;
|
6
|
-
};
|
7
|
-
export declare type TouchEventRet = {
|
8
|
-
type: 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel';
|
9
|
-
timeStamp: number;
|
10
|
-
touches: NativeEvent[];
|
11
|
-
changedTouches: NativeEvent[];
|
12
|
-
origin: GestureResponderEvent;
|
13
|
-
};
|
14
|
-
export declare type ClickEventRet = {
|
15
|
-
type: 'click' | 'longclick';
|
16
|
-
timeStamp: number;
|
17
|
-
pageX: number;
|
18
|
-
pageY: number;
|
19
|
-
origin: GestureResponderEvent;
|
20
|
-
};
|
package/lib/utils/interface.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|