@ray-js/components 1.3.21 → 1.3.23
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/LICENSE.md +9 -0
- package/lib/Button/Button.js +1 -3
- package/lib/Button/Button.thing.js +15 -17
- package/lib/Button/Button.wechat.js +15 -17
- package/lib/Button/props.js +1 -1
- package/lib/Camera/Camera.d.ts +2 -1
- package/lib/Camera/Camera.js +3 -3
- package/lib/Camera/Camera.thing.js +1 -3
- package/lib/Camera/Camera.wechat.d.ts +2 -1
- package/lib/Camera/Camera.wechat.js +2 -2
- package/lib/Checkbox/Checkbox.js +1 -3
- package/lib/Checkbox/Checkbox.thing.js +8 -9
- package/lib/Checkbox/Checkbox.wechat.js +9 -10
- package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
- package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
- package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
- package/lib/CheckboxGroup/props.d.ts +1 -1
- package/lib/CoverView/CoverView.js +1 -3
- package/lib/CoverView/CoverView.thing.js +1 -3
- package/lib/CoverView/CoverView.wechat.d.ts +2 -1
- package/lib/CoverView/CoverView.wechat.js +0 -2
- package/lib/CoverView/props.d.ts +1 -1
- package/lib/CoverView/props.js +1 -1
- package/lib/Form/Form.js +12 -12
- package/lib/Form/Form.thing.js +1 -3
- package/lib/Form/Form.wechat.js +19 -25
- package/lib/Form/props.d.ts +1 -1
- package/lib/Icon/Icon.js +10 -10
- package/lib/Icon/Icon.thing.js +10 -10
- package/lib/Icon/Icon.wechat.js +10 -10
- package/lib/Icon/iconfont/iconfont.js +13 -20
- package/lib/Icon/props.d.ts +1 -1
- package/lib/Icon/props.js +1 -1
- package/lib/Iframe/Iframe.d.ts +2 -1
- package/lib/Iframe/Iframe.js +3 -3
- package/lib/Iframe/Iframe.thing.js +1 -3
- package/lib/Iframe/Iframe.wechat.d.ts +2 -1
- package/lib/Iframe/Iframe.wechat.js +3 -3
- package/lib/Image/Image.js +6 -8
- package/lib/Image/Image.thing.js +8 -10
- package/lib/Image/Image.wechat.js +25 -32
- package/lib/Input/Input.js +28 -26
- package/lib/Input/Input.thing.js +35 -36
- package/lib/Input/Input.wechat.js +46 -47
- package/lib/Input/props.d.ts +1 -1
- package/lib/Input/props.js +1 -1
- package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.js +3 -3
- package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
- package/lib/IpcPlayer/IpcPlayer.wechat.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
- package/lib/Label/Label.js +7 -8
- package/lib/Label/Label.thing.js +8 -8
- package/lib/Label/Label.wechat.js +8 -8
- package/lib/Map/Map.js +1 -3
- package/lib/Map/Map.thing.js +1 -3
- package/lib/Map/Map.wechat.js +1 -3
- package/lib/Modal/index.js +4 -2
- package/lib/Modal/index.web.js +6 -4
- package/lib/MovableArea/MovableArea.js +5 -4
- package/lib/MovableArea/MovableArea.thing.js +1 -3
- package/lib/MovableArea/MovableArea.wechat.js +1 -3
- package/lib/MovableView/MovableView.js +12 -11
- package/lib/MovableView/MovableView.thing.js +1 -3
- package/lib/MovableView/MovableView.wechat.js +1 -3
- package/lib/NativeVideo/NativeVideo.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.js +3 -3
- package/lib/NativeVideo/NativeVideo.thing.js +1 -3
- package/lib/NativeVideo/NativeVideo.wechat.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
- package/lib/PageContainer/PageContainer.js +12 -19
- package/lib/PageContainer/PageContainer.thing.d.ts +2 -1
- package/lib/PageContainer/PageContainer.thing.js +0 -2
- package/lib/PageContainer/PageContainer.wechat.d.ts +2 -1
- package/lib/PageContainer/PageContainer.wechat.js +0 -2
- package/lib/PageContainer/props.d.ts +2 -2
- package/lib/PageContainer/props.js +3 -3
- package/lib/Picker/Picker.js +22 -31
- package/lib/Picker/Picker.thing.js +25 -31
- package/lib/Picker/Picker.wechat.js +25 -31
- package/lib/PickerView/PickerView.js +23 -34
- package/lib/PickerView/PickerView.thing.js +16 -19
- package/lib/PickerView/PickerView.wechat.js +16 -19
- package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
- package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
- package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
- package/lib/Progress/Progress.js +1 -3
- package/lib/Progress/Progress.thing.js +6 -7
- package/lib/Progress/Progress.wechat.js +6 -7
- package/lib/Radio/Radio.js +1 -3
- package/lib/Radio/Radio.thing.js +8 -9
- package/lib/Radio/Radio.wechat.js +9 -10
- package/lib/RadioGroup/RadioGroup.js +12 -18
- package/lib/RadioGroup/RadioGroup.thing.js +15 -21
- package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
- package/lib/RadioGroup/props.d.ts +1 -1
- package/lib/RichText/RichText.js +1 -1
- package/lib/RichText/RichText.thing.js +1 -3
- package/lib/RichText/RichText.wechat.js +1 -3
- package/lib/ScrollView/ScrollView.js +12 -13
- package/lib/ScrollView/ScrollView.thing.js +6 -7
- package/lib/ScrollView/ScrollView.wechat.js +6 -7
- package/lib/Slider/Slider.js +4 -8
- package/lib/Slider/Slider.thing.js +13 -14
- package/lib/Slider/Slider.wechat.js +14 -15
- package/lib/Slider/props.js +1 -1
- package/lib/Swiper/Swiper.d.ts +1 -1
- package/lib/Swiper/Swiper.js +23 -33
- package/lib/Swiper/Swiper.thing.d.ts +1 -1
- package/lib/Swiper/Swiper.thing.js +17 -24
- package/lib/Swiper/Swiper.wechat.d.ts +1 -1
- package/lib/Swiper/Swiper.wechat.js +17 -24
- package/lib/Swiper/props.d.ts +1 -1
- package/lib/Swiper/props.js +2 -2
- package/lib/SwiperItem/SwiperItem.js +4 -4
- package/lib/SwiperItem/SwiperItem.thing.js +8 -9
- package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
- package/lib/Switch/Switch.js +5 -8
- package/lib/Switch/Switch.thing.js +12 -14
- package/lib/Switch/Switch.wechat.js +12 -14
- package/lib/Switch/props.js +1 -1
- package/lib/Text/Text.js +1 -3
- package/lib/Text/Text.thing.js +1 -3
- package/lib/Text/Text.wechat.js +19 -25
- package/lib/Textarea/Textarea.js +13 -14
- package/lib/Textarea/Textarea.thing.js +25 -22
- package/lib/Textarea/Textarea.wechat.js +25 -22
- package/lib/Textarea/props.d.ts +1 -1
- package/lib/View/View.js +28 -32
- package/lib/View/View.thing.js +33 -35
- package/lib/View/View.wechat.js +33 -35
- package/lib/View/props.js +1 -1
- package/lib/WebView/WebView.js +1 -3
- package/lib/WebView/WebView.thing.js +1 -3
- package/lib/WebView/WebView.wechat.js +1 -3
- package/lib/assets/icons.js +1 -1
- package/lib/core/index.js +5 -12
- package/lib/types/event.d.ts +1 -1
- package/lib/types/index.js +1 -0
- package/lib/utils/handleProps.js +26 -41
- package/package.json +7 -7
package/lib/View/View.wechat.js
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
4
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
-
|
3
|
+
const _excluded = ["id", "className", "style", "hoverClassName", "hoverStartTime", "hoverStayTime", "children", "onLongClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "hoverable", "onTransitionEnd"];
|
6
4
|
import * as React from 'react';
|
7
5
|
import clsx from 'clsx';
|
8
6
|
import { inlineStyle, useTouch } from '@ray-js/framework-shared';
|
@@ -10,45 +8,45 @@ import { View as RemaxView } from '@ray-core/wechat';
|
|
10
8
|
import PropTypes from 'prop-types';
|
11
9
|
import { defaultViewProps } from './props';
|
12
10
|
import styles from './index.module.less';
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
11
|
+
const View = /*#__PURE__*/React.forwardRef((props, ref) => {
|
12
|
+
const {
|
13
|
+
id,
|
14
|
+
className,
|
15
|
+
style,
|
16
|
+
hoverClassName,
|
17
|
+
hoverStartTime,
|
18
|
+
hoverStayTime,
|
19
|
+
children,
|
20
|
+
onLongClick,
|
21
|
+
onTouchStart,
|
22
|
+
onTouchMove,
|
23
|
+
onTouchEnd,
|
24
|
+
onTouchCancel,
|
25
|
+
onClick,
|
26
|
+
hoverable,
|
27
|
+
onTransitionEnd
|
28
|
+
} = props,
|
29
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
30
|
+
const [touching, handlers] = useTouch({
|
32
31
|
hoverDelay: hoverStartTime,
|
33
32
|
hoverDuration: hoverStayTime,
|
34
|
-
onLongClick
|
35
|
-
onTouchStart
|
36
|
-
onTouchMove
|
37
|
-
onTouchEnd
|
38
|
-
onTouchCancel
|
39
|
-
onClick
|
40
|
-
})
|
41
|
-
|
42
|
-
|
43
|
-
handlers = _useTouch2[1];
|
44
|
-
|
45
|
-
return /*#__PURE__*/React.createElement(RemaxView // @ts-ignore
|
33
|
+
onLongClick,
|
34
|
+
onTouchStart,
|
35
|
+
onTouchMove,
|
36
|
+
onTouchEnd,
|
37
|
+
onTouchCancel,
|
38
|
+
onClick
|
39
|
+
});
|
40
|
+
return /*#__PURE__*/React.createElement(RemaxView
|
41
|
+
// @ts-ignore
|
46
42
|
, _extends({
|
47
43
|
ref: ref,
|
48
44
|
id: id,
|
49
45
|
className: className,
|
50
46
|
style: inlineStyle(style),
|
51
|
-
hoverClassName: clsx(
|
47
|
+
hoverClassName: clsx({
|
48
|
+
[styles.hover]: hoverable
|
49
|
+
}, hoverClassName),
|
52
50
|
hoverStartTime: hoverStartTime,
|
53
51
|
hoverStayTime: hoverStayTime,
|
54
52
|
onTransitionEnd: onTransitionEnd
|
package/lib/View/props.js
CHANGED
package/lib/WebView/WebView.js
CHANGED
package/lib/assets/icons.js
CHANGED
package/lib/core/index.js
CHANGED
@@ -1,23 +1,16 @@
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
2
|
-
import "core-js/modules/es.regexp.to-string.js";
|
3
|
-
import "core-js/modules/es.promise.js";
|
4
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
5
|
-
import "core-js/modules/es.object.keys.js";
|
6
1
|
export function generateId() {
|
7
|
-
return
|
2
|
+
return `V${Math.random().toString(32).substr(2, 6).toUpperCase()}`;
|
8
3
|
}
|
9
4
|
export function nextFrame(duration) {
|
10
|
-
return new Promise(
|
11
|
-
return setTimeout(resolve, duration !== null && duration !== void 0 ? duration : 1000 / 30);
|
12
|
-
});
|
5
|
+
return new Promise(resolve => setTimeout(resolve, duration !== null && duration !== void 0 ? duration : 1000 / 30));
|
13
6
|
}
|
7
|
+
|
14
8
|
/**
|
15
9
|
* props 的 alias 替换
|
16
10
|
*/
|
17
|
-
|
18
11
|
export function propsAlias(props, alias) {
|
19
|
-
Object.keys(alias).forEach(
|
20
|
-
|
12
|
+
Object.keys(alias).forEach(key => {
|
13
|
+
const targetName = alias[key];
|
21
14
|
props[targetName] = props[key];
|
22
15
|
delete props[key];
|
23
16
|
});
|
package/lib/types/event.d.ts
CHANGED
package/lib/types/index.js
CHANGED
package/lib/utils/handleProps.js
CHANGED
@@ -1,63 +1,49 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
|
5
|
-
var _excluded = ["className", "hoverClassName", "hoverStyle", "refresherDefaultStyle", "overlayStyle", "customStyle", "indicatorStyle", "maskStyle", "placeholderStyle", "borderStyle", "style", "children"];
|
6
|
-
import "core-js/modules/es.array.map.js";
|
7
|
-
import "core-js/modules/es.object.entries.js";
|
8
|
-
import "core-js/modules/es.array.concat.js";
|
9
|
-
import "core-js/modules/es.json.stringify.js";
|
3
|
+
const _excluded = ["className", "hoverClassName", "hoverStyle", "refresherDefaultStyle", "overlayStyle", "customStyle", "indicatorStyle", "maskStyle", "placeholderStyle", "borderStyle", "style", "children"];
|
10
4
|
import { inlineStyle } from '@ray-js/framework-shared';
|
11
5
|
import { paramCase } from 'param-case';
|
12
6
|
import s2o from 'style-to-object';
|
13
|
-
|
14
|
-
|
15
|
-
var tempStyle;
|
16
|
-
|
7
|
+
const transformStyle = originStyle => {
|
8
|
+
let tempStyle;
|
17
9
|
if (typeof originStyle === 'string') {
|
18
10
|
tempStyle = s2o(originStyle);
|
19
11
|
} else {
|
20
12
|
tempStyle = originStyle;
|
21
13
|
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
k = _ref2[0],
|
26
|
-
v = _ref2[1];
|
27
|
-
|
28
|
-
return "".concat(k, ":").concat(v);
|
14
|
+
return Object.entries(inlineStyle(tempStyle)).map(_ref => {
|
15
|
+
let [k, v] = _ref;
|
16
|
+
return `${k}:${v}`;
|
29
17
|
}).join(';');
|
30
18
|
};
|
19
|
+
|
31
20
|
/**
|
32
21
|
* 处理 web 端 props
|
33
22
|
*/
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
for (var key in tempProps) {
|
23
|
+
const handleProps = props => {
|
24
|
+
const {
|
25
|
+
className,
|
26
|
+
hoverClassName,
|
27
|
+
hoverStyle,
|
28
|
+
refresherDefaultStyle,
|
29
|
+
overlayStyle,
|
30
|
+
customStyle,
|
31
|
+
indicatorStyle,
|
32
|
+
maskStyle,
|
33
|
+
placeholderStyle,
|
34
|
+
borderStyle,
|
35
|
+
style,
|
36
|
+
children
|
37
|
+
} = props,
|
38
|
+
tempProps = _objectWithoutProperties(props, _excluded);
|
39
|
+
for (const key in tempProps) {
|
52
40
|
if (tempProps[key] === false) {
|
53
41
|
delete tempProps[key];
|
54
|
-
} else if (
|
42
|
+
} else if (typeof tempProps[key] === 'object') {
|
55
43
|
tempProps[key] = JSON.stringify(tempProps[key]);
|
56
44
|
}
|
57
|
-
|
58
45
|
tempProps[paramCase(key)] = tempProps[key];
|
59
46
|
}
|
60
|
-
|
61
47
|
return _objectSpread({
|
62
48
|
class: className,
|
63
49
|
style: style && inlineStyle(style),
|
@@ -70,8 +56,7 @@ var handleProps = function (props) {
|
|
70
56
|
'mask-style': maskStyle && transformStyle(maskStyle),
|
71
57
|
'placeholder-style': placeholderStyle && transformStyle(placeholderStyle),
|
72
58
|
'border-style': borderStyle && transformStyle(borderStyle),
|
73
|
-
children
|
59
|
+
children
|
74
60
|
}, tempProps);
|
75
61
|
};
|
76
|
-
|
77
62
|
export default handleProps;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/components",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.23",
|
4
4
|
"description": "Ray basic components",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -24,10 +24,10 @@
|
|
24
24
|
"watch": "ray start --type=component"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@ray-core/macro": "^0.3.
|
28
|
-
"@ray-core/wechat": "^0.3.
|
29
|
-
"@ray-js/adapter": "1.3.
|
30
|
-
"@ray-js/framework-shared": "1.3.
|
27
|
+
"@ray-core/macro": "^0.3.9",
|
28
|
+
"@ray-core/wechat": "^0.3.9",
|
29
|
+
"@ray-js/adapter": "1.3.23",
|
30
|
+
"@ray-js/framework-shared": "1.3.23",
|
31
31
|
"ahooks": "^3.7.1",
|
32
32
|
"clsx": "^1.1.1",
|
33
33
|
"core-js": "^3.19.1",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
"style-to-object": "^0.3.0"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@ray-js/cli": "1.3.
|
40
|
+
"@ray-js/cli": "1.3.23"
|
41
41
|
},
|
42
42
|
"maintainers": [
|
43
43
|
{
|
@@ -45,6 +45,6 @@
|
|
45
45
|
"email": "tuyafe@tuya.com"
|
46
46
|
}
|
47
47
|
],
|
48
|
-
"gitHead": "
|
48
|
+
"gitHead": "04708bb394d817a7a522fcde178f19f170d5d364",
|
49
49
|
"repository": {}
|
50
50
|
}
|