@ray-js/components 1.4.0-alpha.3 → 1.4.0-alpha.4

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.
Files changed (118) hide show
  1. package/lib/Button/Button.js +1 -3
  2. package/lib/Button/Button.thing.js +15 -17
  3. package/lib/Button/Button.wechat.js +15 -17
  4. package/lib/Button/props.js +1 -1
  5. package/lib/Camera/Camera.js +3 -3
  6. package/lib/Camera/Camera.thing.js +1 -3
  7. package/lib/Camera/Camera.wechat.js +2 -2
  8. package/lib/Checkbox/Checkbox.js +1 -3
  9. package/lib/Checkbox/Checkbox.thing.js +8 -9
  10. package/lib/Checkbox/Checkbox.wechat.js +9 -10
  11. package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
  12. package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
  13. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
  14. package/lib/CoverView/CoverView.js +1 -3
  15. package/lib/CoverView/CoverView.thing.js +1 -3
  16. package/lib/CoverView/CoverView.wechat.js +0 -2
  17. package/lib/CoverView/props.js +1 -1
  18. package/lib/Form/Form.js +12 -12
  19. package/lib/Form/Form.thing.js +1 -3
  20. package/lib/Form/Form.wechat.js +20 -25
  21. package/lib/Icon/Icon.js +7 -7
  22. package/lib/Icon/Icon.thing.js +7 -7
  23. package/lib/Icon/Icon.wechat.js +7 -7
  24. package/lib/Icon/iconfont/iconfont.js +13 -20
  25. package/lib/Icon/props.js +1 -1
  26. package/lib/Iframe/Iframe.js +3 -3
  27. package/lib/Iframe/Iframe.thing.js +1 -3
  28. package/lib/Iframe/Iframe.wechat.js +3 -3
  29. package/lib/Image/Image.js +6 -8
  30. package/lib/Image/Image.thing.js +8 -10
  31. package/lib/Image/Image.wechat.js +26 -32
  32. package/lib/Input/Input.js +29 -26
  33. package/lib/Input/Input.thing.js +36 -36
  34. package/lib/Input/Input.wechat.js +47 -47
  35. package/lib/Input/props.d.ts +6 -24
  36. package/lib/Input/props.js +1 -3
  37. package/lib/IpcPlayer/IpcPlayer.js +3 -3
  38. package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
  39. package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
  40. package/lib/Label/Label.js +7 -8
  41. package/lib/Label/Label.thing.js +8 -8
  42. package/lib/Label/Label.wechat.js +8 -8
  43. package/lib/Map/Map.js +1 -3
  44. package/lib/Map/Map.thing.js +1 -3
  45. package/lib/Map/Map.wechat.js +1 -3
  46. package/lib/Modal/index.js +4 -2
  47. package/lib/Modal/index.web.js +6 -4
  48. package/lib/MovableArea/MovableArea.js +5 -4
  49. package/lib/MovableArea/MovableArea.thing.js +1 -3
  50. package/lib/MovableArea/MovableArea.wechat.js +1 -3
  51. package/lib/MovableView/MovableView.js +12 -11
  52. package/lib/MovableView/MovableView.thing.js +1 -3
  53. package/lib/MovableView/MovableView.wechat.js +1 -3
  54. package/lib/NativeVideo/NativeVideo.js +3 -3
  55. package/lib/NativeVideo/NativeVideo.thing.js +1 -3
  56. package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
  57. package/lib/PageContainer/PageContainer.js +12 -19
  58. package/lib/PageContainer/PageContainer.thing.js +0 -2
  59. package/lib/PageContainer/PageContainer.wechat.js +0 -2
  60. package/lib/PageContainer/props.js +3 -3
  61. package/lib/Picker/Picker.js +23 -31
  62. package/lib/Picker/Picker.thing.js +26 -31
  63. package/lib/Picker/Picker.wechat.js +26 -31
  64. package/lib/PickerView/PickerView.js +23 -34
  65. package/lib/PickerView/PickerView.thing.js +16 -19
  66. package/lib/PickerView/PickerView.wechat.js +16 -19
  67. package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
  68. package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
  69. package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
  70. package/lib/Progress/Progress.js +1 -3
  71. package/lib/Progress/Progress.thing.js +6 -7
  72. package/lib/Progress/Progress.wechat.js +6 -7
  73. package/lib/Radio/Radio.js +1 -3
  74. package/lib/Radio/Radio.thing.js +8 -9
  75. package/lib/Radio/Radio.wechat.js +9 -10
  76. package/lib/RadioGroup/RadioGroup.js +12 -18
  77. package/lib/RadioGroup/RadioGroup.thing.js +15 -21
  78. package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
  79. package/lib/RichText/RichText.js +1 -1
  80. package/lib/RichText/RichText.thing.js +1 -3
  81. package/lib/RichText/RichText.wechat.js +1 -3
  82. package/lib/ScrollView/ScrollView.js +12 -13
  83. package/lib/ScrollView/ScrollView.thing.js +6 -7
  84. package/lib/ScrollView/ScrollView.wechat.js +6 -7
  85. package/lib/Slider/Slider.js +4 -8
  86. package/lib/Slider/Slider.thing.js +13 -14
  87. package/lib/Slider/Slider.wechat.js +14 -15
  88. package/lib/Slider/props.js +1 -1
  89. package/lib/Swiper/Swiper.js +24 -33
  90. package/lib/Swiper/Swiper.thing.js +18 -24
  91. package/lib/Swiper/Swiper.wechat.js +18 -24
  92. package/lib/Swiper/props.js +2 -2
  93. package/lib/SwiperItem/SwiperItem.js +4 -4
  94. package/lib/SwiperItem/SwiperItem.thing.js +8 -9
  95. package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
  96. package/lib/Switch/Switch.js +5 -8
  97. package/lib/Switch/Switch.thing.js +12 -14
  98. package/lib/Switch/Switch.wechat.js +12 -14
  99. package/lib/Switch/props.js +1 -1
  100. package/lib/Text/Text.js +1 -3
  101. package/lib/Text/Text.thing.js +1 -3
  102. package/lib/Text/Text.wechat.js +20 -25
  103. package/lib/Textarea/Textarea.js +13 -24
  104. package/lib/Textarea/Textarea.thing.js +26 -30
  105. package/lib/Textarea/Textarea.wechat.js +26 -30
  106. package/lib/Textarea/props.d.ts +3 -9
  107. package/lib/View/View.js +29 -32
  108. package/lib/View/View.thing.js +34 -35
  109. package/lib/View/View.wechat.js +34 -35
  110. package/lib/View/props.js +1 -1
  111. package/lib/WebView/WebView.js +1 -3
  112. package/lib/WebView/WebView.thing.js +1 -3
  113. package/lib/WebView/WebView.wechat.js +1 -3
  114. package/lib/assets/icons.js +1 -1
  115. package/lib/core/index.js +4 -11
  116. package/lib/types/index.js +1 -0
  117. package/lib/utils/handleProps.js +26 -40
  118. package/package.json +5 -5
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
-
3
- var WebView = function () {
2
+ const WebView = () => {
4
3
  return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
5
4
  };
6
-
7
5
  export default WebView;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { WebView as RemaxWebView } from '@ray-js/adapter';
3
-
4
- var WebView = function (props) {
3
+ const WebView = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxWebView, props);
6
5
  };
7
-
8
6
  export default WebView;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { WebView as RemaxWebView } from '@ray-js/adapter';
3
-
4
- var WebView = function (props) {
3
+ const WebView = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxWebView, props);
6
5
  };
7
-
8
6
  export default WebView;
@@ -1,4 +1,4 @@
1
- export var iconList = {
1
+ export const iconList = {
2
2
  success_no_circle: require('./success_no_circle.png'),
3
3
  loading: require('./loading.png'),
4
4
  loading_warn: require('./loading-warn.png'),
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(function (resolve) {
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(function (key) {
20
- var targetName = alias[key];
12
+ Object.keys(alias).forEach(key => {
13
+ const targetName = alias[key];
21
14
  props[targetName] = props[key];
22
15
  delete props[key];
23
16
  });
@@ -5,5 +5,6 @@
5
5
  /**
6
6
  * 通用回调事件
7
7
  */
8
+
8
9
  export * from './event';
9
10
  export {};
@@ -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
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
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"];
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
- var transformStyle = function (originStyle) {
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
- return Object.entries(inlineStyle(tempStyle)).map(function (_ref) {
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
- var handleProps = function (props) {
37
- var className = props.className,
38
- hoverClassName = props.hoverClassName,
39
- hoverStyle = props.hoverStyle,
40
- refresherDefaultStyle = props.refresherDefaultStyle,
41
- overlayStyle = props.overlayStyle,
42
- customStyle = props.customStyle,
43
- indicatorStyle = props.indicatorStyle,
44
- maskStyle = props.maskStyle,
45
- placeholderStyle = props.placeholderStyle,
46
- borderStyle = props.borderStyle,
47
- style = props.style,
48
- children = props.children,
49
- tempProps = _objectWithoutProperties(props, _excluded);
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 (_typeof(tempProps[key]) === 'object') {
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: 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",
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.3",
30
- "@ray-js/framework-shared": "^1.4.0-alpha.3",
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.3"
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": "438a6262377009a49dd569adab1079542e4e857a",
48
+ "gitHead": "ae3621a47944287771e18e926c76ea92d0516097",
49
49
  "repository": {}
50
50
  }