@ray-js/components 1.4.0-alpha.2 → 1.4.0-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- 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.js +3 -3
- package/lib/Camera/Camera.thing.js +1 -3
- 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/CoverView/CoverView.js +1 -3
- package/lib/CoverView/CoverView.thing.js +1 -3
- package/lib/CoverView/CoverView.wechat.js +0 -2
- 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 +20 -25
- package/lib/Icon/Icon.js +7 -7
- package/lib/Icon/Icon.thing.js +7 -7
- package/lib/Icon/Icon.wechat.js +7 -7
- package/lib/Icon/iconfont/iconfont.js +13 -20
- package/lib/Icon/props.js +1 -1
- package/lib/Iframe/Iframe.js +3 -3
- package/lib/Iframe/Iframe.thing.js +1 -3
- 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 +26 -32
- package/lib/Input/Input.js +29 -26
- package/lib/Input/Input.thing.js +36 -36
- package/lib/Input/Input.wechat.js +47 -47
- package/lib/Input/props.d.ts +6 -24
- package/lib/Input/props.js +1 -3
- package/lib/IpcPlayer/IpcPlayer.js +3 -3
- package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
- 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.js +3 -3
- package/lib/NativeVideo/NativeVideo.thing.js +1 -3
- package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
- package/lib/PageContainer/PageContainer.js +12 -19
- package/lib/PageContainer/PageContainer.thing.js +0 -2
- package/lib/PageContainer/PageContainer.wechat.js +0 -2
- package/lib/PageContainer/props.js +3 -3
- package/lib/Picker/Picker.js +23 -31
- package/lib/Picker/Picker.thing.js +26 -31
- package/lib/Picker/Picker.wechat.js +26 -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/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.js +24 -33
- package/lib/Swiper/Swiper.thing.js +18 -24
- package/lib/Swiper/Swiper.wechat.js +18 -24
- 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 +20 -25
- package/lib/Textarea/Textarea.js +13 -24
- package/lib/Textarea/Textarea.thing.js +26 -30
- package/lib/Textarea/Textarea.wechat.js +26 -30
- package/lib/Textarea/props.d.ts +3 -9
- package/lib/View/View.js +29 -32
- package/lib/View/View.thing.js +34 -35
- package/lib/View/View.wechat.js +34 -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 +4 -11
- package/lib/types/index.js +1 -0
- package/lib/utils/handleProps.js +26 -40
- package/package.json +5 -5
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
2
|
return "V".concat(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/index.js
CHANGED
package/lib/utils/handleProps.js
CHANGED
@@ -1,63 +1,50 @@
|
|
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
|
-
|
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"];
|
4
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
10
5
|
import { inlineStyle } from '@ray-js/framework-shared';
|
11
6
|
import { paramCase } from 'param-case';
|
12
7
|
import s2o from 'style-to-object';
|
13
|
-
|
14
|
-
|
15
|
-
var tempStyle;
|
16
|
-
|
8
|
+
const transformStyle = originStyle => {
|
9
|
+
let tempStyle;
|
17
10
|
if (typeof originStyle === 'string') {
|
18
11
|
tempStyle = s2o(originStyle);
|
19
12
|
} else {
|
20
13
|
tempStyle = originStyle;
|
21
14
|
}
|
22
|
-
|
23
|
-
|
24
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
25
|
-
k = _ref2[0],
|
26
|
-
v = _ref2[1];
|
27
|
-
|
15
|
+
return Object.entries(inlineStyle(tempStyle)).map(_ref => {
|
16
|
+
let [k, v] = _ref;
|
28
17
|
return "".concat(k, ":").concat(v);
|
29
18
|
}).join(';');
|
30
19
|
};
|
20
|
+
|
31
21
|
/**
|
32
22
|
* 处理 web 端 props
|
33
23
|
*/
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
for (var key in tempProps) {
|
24
|
+
const handleProps = props => {
|
25
|
+
const {
|
26
|
+
className,
|
27
|
+
hoverClassName,
|
28
|
+
hoverStyle,
|
29
|
+
refresherDefaultStyle,
|
30
|
+
overlayStyle,
|
31
|
+
customStyle,
|
32
|
+
indicatorStyle,
|
33
|
+
maskStyle,
|
34
|
+
placeholderStyle,
|
35
|
+
borderStyle,
|
36
|
+
style,
|
37
|
+
children
|
38
|
+
} = props,
|
39
|
+
tempProps = _objectWithoutProperties(props, _excluded);
|
40
|
+
for (const key in tempProps) {
|
52
41
|
if (tempProps[key] === false) {
|
53
42
|
delete tempProps[key];
|
54
|
-
} else if (
|
43
|
+
} else if (typeof tempProps[key] === 'object') {
|
55
44
|
tempProps[key] = JSON.stringify(tempProps[key]);
|
56
45
|
}
|
57
|
-
|
58
46
|
tempProps[paramCase(key)] = tempProps[key];
|
59
47
|
}
|
60
|
-
|
61
48
|
return _objectSpread({
|
62
49
|
class: className,
|
63
50
|
style: style && inlineStyle(style),
|
@@ -70,8 +57,7 @@ var handleProps = function (props) {
|
|
70
57
|
'mask-style': maskStyle && transformStyle(maskStyle),
|
71
58
|
'placeholder-style': placeholderStyle && transformStyle(placeholderStyle),
|
72
59
|
'border-style': borderStyle && transformStyle(borderStyle),
|
73
|
-
children
|
60
|
+
children
|
74
61
|
}, tempProps);
|
75
62
|
};
|
76
|
-
|
77
63
|
export default handleProps;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/components",
|
3
|
-
"version": "1.4.0-alpha.
|
3
|
+
"version": "1.4.0-alpha.4",
|
4
4
|
"description": "Ray basic components",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -26,8 +26,8 @@
|
|
26
26
|
"dependencies": {
|
27
27
|
"@ray-core/macro": "^0.3.5",
|
28
28
|
"@ray-core/wechat": "^0.3.5",
|
29
|
-
"@ray-js/adapter": "^1.4.0-alpha.
|
30
|
-
"@ray-js/framework-shared": "^1.4.0-alpha.
|
29
|
+
"@ray-js/adapter": "^1.4.0-alpha.4",
|
30
|
+
"@ray-js/framework-shared": "^1.4.0-alpha.4",
|
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.4.0-alpha.
|
40
|
+
"@ray-js/cli": "^1.4.0-alpha.4"
|
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": "ae3621a47944287771e18e926c76ea92d0516097",
|
49
49
|
"repository": {}
|
50
50
|
}
|