@ray-js/components 1.3.22 → 1.3.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. package/LICENSE.md +9 -0
  2. package/lib/Button/Button.js +1 -3
  3. package/lib/Button/Button.thing.js +15 -17
  4. package/lib/Button/Button.wechat.js +15 -17
  5. package/lib/Button/props.js +1 -1
  6. package/lib/Camera/Camera.d.ts +2 -1
  7. package/lib/Camera/Camera.js +3 -3
  8. package/lib/Camera/Camera.thing.js +1 -3
  9. package/lib/Camera/Camera.wechat.d.ts +2 -1
  10. package/lib/Camera/Camera.wechat.js +2 -2
  11. package/lib/Checkbox/Checkbox.js +1 -3
  12. package/lib/Checkbox/Checkbox.thing.js +8 -9
  13. package/lib/Checkbox/Checkbox.wechat.js +9 -10
  14. package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
  15. package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
  16. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
  17. package/lib/CheckboxGroup/props.d.ts +1 -1
  18. package/lib/CoverView/CoverView.js +1 -3
  19. package/lib/CoverView/CoverView.thing.js +1 -3
  20. package/lib/CoverView/CoverView.wechat.d.ts +2 -1
  21. package/lib/CoverView/CoverView.wechat.js +0 -2
  22. package/lib/CoverView/props.d.ts +1 -1
  23. package/lib/CoverView/props.js +1 -1
  24. package/lib/Form/Form.js +12 -12
  25. package/lib/Form/Form.thing.js +1 -3
  26. package/lib/Form/Form.wechat.js +19 -25
  27. package/lib/Form/props.d.ts +1 -1
  28. package/lib/Icon/Icon.js +10 -10
  29. package/lib/Icon/Icon.thing.js +10 -10
  30. package/lib/Icon/Icon.wechat.js +10 -10
  31. package/lib/Icon/iconfont/iconfont.js +13 -20
  32. package/lib/Icon/props.d.ts +1 -1
  33. package/lib/Icon/props.js +1 -1
  34. package/lib/Iframe/Iframe.d.ts +2 -1
  35. package/lib/Iframe/Iframe.js +3 -3
  36. package/lib/Iframe/Iframe.thing.js +1 -3
  37. package/lib/Iframe/Iframe.wechat.d.ts +2 -1
  38. package/lib/Iframe/Iframe.wechat.js +3 -3
  39. package/lib/Image/Image.js +6 -8
  40. package/lib/Image/Image.thing.js +8 -10
  41. package/lib/Image/Image.wechat.js +25 -32
  42. package/lib/Input/Input.js +28 -26
  43. package/lib/Input/Input.thing.js +35 -36
  44. package/lib/Input/Input.wechat.js +46 -47
  45. package/lib/Input/props.d.ts +1 -1
  46. package/lib/Input/props.js +1 -1
  47. package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
  48. package/lib/IpcPlayer/IpcPlayer.js +3 -3
  49. package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
  50. package/lib/IpcPlayer/IpcPlayer.wechat.d.ts +2 -1
  51. package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
  52. package/lib/Label/Label.js +7 -8
  53. package/lib/Label/Label.thing.js +8 -8
  54. package/lib/Label/Label.wechat.js +8 -8
  55. package/lib/Map/Map.js +1 -3
  56. package/lib/Map/Map.thing.js +1 -3
  57. package/lib/Map/Map.wechat.js +1 -3
  58. package/lib/Modal/index.js +4 -2
  59. package/lib/Modal/index.web.js +6 -4
  60. package/lib/MovableArea/MovableArea.js +5 -4
  61. package/lib/MovableArea/MovableArea.thing.js +1 -3
  62. package/lib/MovableArea/MovableArea.wechat.js +1 -3
  63. package/lib/MovableView/MovableView.js +12 -11
  64. package/lib/MovableView/MovableView.thing.js +1 -3
  65. package/lib/MovableView/MovableView.wechat.js +1 -3
  66. package/lib/NativeVideo/NativeVideo.d.ts +2 -1
  67. package/lib/NativeVideo/NativeVideo.js +3 -3
  68. package/lib/NativeVideo/NativeVideo.thing.js +1 -3
  69. package/lib/NativeVideo/NativeVideo.wechat.d.ts +2 -1
  70. package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
  71. package/lib/PageContainer/PageContainer.js +12 -19
  72. package/lib/PageContainer/PageContainer.thing.d.ts +2 -1
  73. package/lib/PageContainer/PageContainer.thing.js +0 -2
  74. package/lib/PageContainer/PageContainer.wechat.d.ts +2 -1
  75. package/lib/PageContainer/PageContainer.wechat.js +0 -2
  76. package/lib/PageContainer/props.d.ts +2 -2
  77. package/lib/PageContainer/props.js +3 -3
  78. package/lib/Picker/Picker.js +22 -31
  79. package/lib/Picker/Picker.thing.js +25 -31
  80. package/lib/Picker/Picker.wechat.js +25 -31
  81. package/lib/PickerView/PickerView.js +23 -34
  82. package/lib/PickerView/PickerView.thing.js +16 -19
  83. package/lib/PickerView/PickerView.wechat.js +16 -19
  84. package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
  85. package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
  86. package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
  87. package/lib/Progress/Progress.js +1 -3
  88. package/lib/Progress/Progress.thing.js +6 -7
  89. package/lib/Progress/Progress.wechat.js +6 -7
  90. package/lib/Radio/Radio.js +1 -3
  91. package/lib/Radio/Radio.thing.js +8 -9
  92. package/lib/Radio/Radio.wechat.js +9 -10
  93. package/lib/RadioGroup/RadioGroup.js +12 -18
  94. package/lib/RadioGroup/RadioGroup.thing.js +15 -21
  95. package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
  96. package/lib/RadioGroup/props.d.ts +1 -1
  97. package/lib/RichText/RichText.js +1 -1
  98. package/lib/RichText/RichText.thing.js +1 -3
  99. package/lib/RichText/RichText.wechat.js +1 -3
  100. package/lib/ScrollView/ScrollView.js +12 -13
  101. package/lib/ScrollView/ScrollView.thing.js +6 -7
  102. package/lib/ScrollView/ScrollView.wechat.js +6 -7
  103. package/lib/Slider/Slider.js +4 -8
  104. package/lib/Slider/Slider.thing.js +13 -14
  105. package/lib/Slider/Slider.wechat.js +14 -15
  106. package/lib/Slider/props.js +1 -1
  107. package/lib/Swiper/Swiper.d.ts +1 -1
  108. package/lib/Swiper/Swiper.js +23 -33
  109. package/lib/Swiper/Swiper.thing.d.ts +1 -1
  110. package/lib/Swiper/Swiper.thing.js +17 -24
  111. package/lib/Swiper/Swiper.wechat.d.ts +1 -1
  112. package/lib/Swiper/Swiper.wechat.js +17 -24
  113. package/lib/Swiper/props.d.ts +1 -1
  114. package/lib/Swiper/props.js +2 -2
  115. package/lib/SwiperItem/SwiperItem.js +4 -4
  116. package/lib/SwiperItem/SwiperItem.thing.js +8 -9
  117. package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
  118. package/lib/Switch/Switch.js +5 -8
  119. package/lib/Switch/Switch.thing.js +12 -14
  120. package/lib/Switch/Switch.wechat.js +12 -14
  121. package/lib/Switch/props.js +1 -1
  122. package/lib/Text/Text.js +1 -3
  123. package/lib/Text/Text.thing.js +1 -3
  124. package/lib/Text/Text.wechat.js +19 -25
  125. package/lib/Textarea/Textarea.js +13 -14
  126. package/lib/Textarea/Textarea.thing.js +25 -22
  127. package/lib/Textarea/Textarea.wechat.js +25 -22
  128. package/lib/Textarea/props.d.ts +1 -1
  129. package/lib/View/View.js +28 -32
  130. package/lib/View/View.thing.js +33 -35
  131. package/lib/View/View.wechat.js +33 -35
  132. package/lib/View/props.js +1 -1
  133. package/lib/WebView/WebView.js +1 -3
  134. package/lib/WebView/WebView.thing.js +1 -3
  135. package/lib/WebView/WebView.wechat.js +1 -3
  136. package/lib/assets/icons.js +1 -1
  137. package/lib/core/index.js +5 -12
  138. package/lib/types/event.d.ts +1 -1
  139. package/lib/types/index.js +1 -0
  140. package/lib/utils/handleProps.js +26 -41
  141. package/package.json +7 -7
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ Copyright © 2014-2022 Tuya.inc
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,15 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { defaultButtonProps } from './props';
3
3
  import handleProps from '../utils/handleProps';
4
-
5
- var Button = function (props) {
4
+ const Button = props => {
6
5
  return (
7
6
  /*#__PURE__*/
8
7
  // @ts-ignore
9
8
  React.createElement("v-button", handleProps(props), props.children)
10
9
  );
11
10
  };
12
-
13
11
  Button.defaultProps = defaultButtonProps;
14
12
  Button.displayName = 'Button';
15
13
  export default Button;
@@ -1,30 +1,29 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "formType"];
3
+ const _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "formType"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { inlineStyle } from '@ray-js/framework-shared';
7
7
  import { Button as RemaxButton } from '@ray-js/adapter';
8
-
9
- var Button = function (props) {
10
- var style = props.style,
11
- id = props.id,
12
- className = props.className,
13
- disabled = props.disabled,
14
- loading = props.loading,
15
- onClick = props.onClick,
16
- hoverClassName = props.hoverClassName,
17
- _props$size = props.size,
18
- size = _props$size === void 0 ? 'default' : _props$size,
19
- formType = props.formType,
20
- restProps = _objectWithoutProperties(props, _excluded);
21
-
8
+ const Button = props => {
9
+ const {
10
+ style,
11
+ id,
12
+ className,
13
+ disabled,
14
+ loading,
15
+ onClick,
16
+ hoverClassName,
17
+ size = 'default',
18
+ formType
19
+ } = props,
20
+ restProps = _objectWithoutProperties(props, _excluded);
22
21
  return /*#__PURE__*/React.createElement(RemaxButton, _extends({
23
22
  id: id,
24
23
  style: inlineStyle(style),
25
24
  className: clsx(className),
26
25
  hoverClassName: hoverClassName,
27
- onClick: function handleTap(event) {
26
+ onClick: event => {
28
27
  if (disabled) return;
29
28
  if (loading) return;
30
29
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
@@ -35,6 +34,5 @@ var Button = function (props) {
35
34
  formType: formType
36
35
  }, restProps));
37
36
  };
38
-
39
37
  Button.displayName = 'Button';
40
38
  export default Button;
@@ -1,32 +1,31 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "formType"];
3
+ const _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "formType"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { inlineStyle } from '@ray-js/framework-shared';
7
7
  import { Button as RemaxButton } from '@ray-core/wechat';
8
8
  import { defaultButtonProps } from './props';
9
9
  import styles from './index.module.less';
10
-
11
- var Button = function (props) {
12
- var style = props.style,
13
- id = props.id,
14
- className = props.className,
15
- disabled = props.disabled,
16
- loading = props.loading,
17
- onClick = props.onClick,
18
- hoverClassName = props.hoverClassName,
19
- _props$size = props.size,
20
- size = _props$size === void 0 ? 'default' : _props$size,
21
- formType = props.formType,
22
- restProps = _objectWithoutProperties(props, _excluded);
23
-
10
+ const Button = props => {
11
+ const {
12
+ style,
13
+ id,
14
+ className,
15
+ disabled,
16
+ loading,
17
+ onClick,
18
+ hoverClassName,
19
+ size = 'default',
20
+ formType
21
+ } = props,
22
+ restProps = _objectWithoutProperties(props, _excluded);
24
23
  return /*#__PURE__*/React.createElement(RemaxButton, _extends({
25
24
  id: id,
26
25
  style: inlineStyle(style),
27
26
  className: clsx('ray-button', styles.button, className),
28
27
  hoverClassName: clsx(styles['button-hover'], hoverClassName),
29
- onClick: function handleTap(event) {
28
+ onClick: event => {
30
29
  if (disabled) return;
31
30
  if (loading) return;
32
31
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
@@ -37,7 +36,6 @@ var Button = function (props) {
37
36
  size: size
38
37
  }, restProps));
39
38
  };
40
-
41
39
  Button.defaultProps = defaultButtonProps;
42
40
  Button.displayName = 'Button';
43
41
  export default Button;
@@ -1,4 +1,4 @@
1
- export var defaultButtonProps = {
1
+ export const defaultButtonProps = {
2
2
  size: 'default',
3
3
  type: 'default',
4
4
  hoverStyle: {
@@ -1,2 +1,3 @@
1
- declare const Camera: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const Camera: () => React.JSX.Element;
2
3
  export default Camera;
@@ -1,7 +1,7 @@
1
- import React from 'react'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1
+ import React from 'react';
2
2
 
3
- var Camera = function () {
3
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
+ const Camera = () => {
4
5
  return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
5
6
  };
6
-
7
7
  export default Camera;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Camera as RemaxCamera } from '@ray-js/adapter';
3
-
4
- var Camera = function (props) {
3
+ const Camera = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxCamera, props);
6
5
  };
7
-
8
6
  export default Camera;
@@ -1,2 +1,3 @@
1
- declare function Camera(): JSX.Element;
1
+ import * as React from 'react';
2
+ declare function Camera(): React.JSX.Element;
2
3
  export default Camera;
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { View } from '@ray-js/components'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
2
+ import { View } from '@ray-js/components';
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
5
  function Camera() {
5
6
  return /*#__PURE__*/React.createElement(View, null, "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u7AEF\u6682\u672A\u5B9E\u73B0");
6
7
  }
7
-
8
8
  export default Camera;
@@ -1,10 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import handleProps from '../utils/handleProps';
3
-
4
- var Checkbox = function (props) {
3
+ const Checkbox = props => {
5
4
  // @ts-ignore
6
5
  return /*#__PURE__*/React.createElement("v-checkbox", handleProps(props));
7
6
  };
8
-
9
7
  Checkbox.displayName = 'Checkbox';
10
8
  export default Checkbox;
@@ -1,22 +1,21 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["className", "style", "id"];
3
+ const _excluded = ["className", "style", "id"];
4
4
  import clsx from 'clsx';
5
5
  import * as React from 'react';
6
6
  import { inlineStyle } from '@ray-js/framework-shared';
7
7
  import { Checkbox as RemaxCheckbox } from '@ray-js/adapter';
8
-
9
- var Checkbox = function (props) {
10
- var className = props.className,
11
- style = props.style,
12
- id = props.id,
13
- restProps = _objectWithoutProperties(props, _excluded);
14
-
8
+ const Checkbox = props => {
9
+ const {
10
+ className,
11
+ style,
12
+ id
13
+ } = props,
14
+ restProps = _objectWithoutProperties(props, _excluded);
15
15
  return /*#__PURE__*/React.createElement(RemaxCheckbox, _extends({
16
16
  id: id,
17
17
  style: inlineStyle(style),
18
18
  className: clsx('ray-checkbox', className)
19
19
  }, restProps));
20
20
  };
21
-
22
21
  export default Checkbox;
@@ -1,18 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["className", "style", "id", "color"];
3
+ const _excluded = ["className", "style", "id", "color"];
4
4
  import clsx from 'clsx';
5
5
  import * as React from 'react';
6
6
  import { inlineStyle } from '@ray-js/framework-shared';
7
7
  import { Checkbox as RemaxCheckbox } from '@ray-core/wechat';
8
-
9
- var Checkbox = function (props) {
10
- var className = props.className,
11
- style = props.style,
12
- id = props.id,
13
- color = props.color,
14
- restProps = _objectWithoutProperties(props, _excluded);
15
-
8
+ const Checkbox = props => {
9
+ const {
10
+ className,
11
+ style,
12
+ id,
13
+ color
14
+ } = props,
15
+ restProps = _objectWithoutProperties(props, _excluded);
16
16
  return /*#__PURE__*/React.createElement(RemaxCheckbox, _extends({
17
17
  id: id,
18
18
  style: inlineStyle(style),
@@ -20,5 +20,4 @@ var Checkbox = function (props) {
20
20
  className: clsx('ray-checkbox', className)
21
21
  }, restProps));
22
22
  };
23
-
24
23
  export default Checkbox;
@@ -1,23 +1,21 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import "core-js/modules/es.array.map.js";
3
2
  import * as React from 'react';
4
3
  import handleProps from '../utils/handleProps';
5
4
  import Label from '../Label';
6
5
  import CheckBox from '../Checkbox';
7
6
  import { useEventListener } from 'ahooks';
8
-
9
- var CheckboxGroup = function (props) {
10
- var options = props.options,
11
- name = props.name,
12
- disabled = props.disabled,
13
- _props$onChange = props.onChange,
14
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
15
- children = props.children;
16
- var currentNode = React.useRef(null);
17
- useEventListener('clickoverlay', function (e) {
18
- var _props$onChange2;
19
-
20
- (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 ? void 0 : _props$onChange2.call(props, {
7
+ const CheckboxGroup = props => {
8
+ const {
9
+ options,
10
+ name,
11
+ disabled,
12
+ onChange = () => {},
13
+ children
14
+ } = props;
15
+ const currentNode = React.useRef(null);
16
+ useEventListener('clickoverlay', e => {
17
+ var _props$onChange;
18
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
21
19
  type: e.type,
22
20
  value: e.detail.value,
23
21
  origin: e
@@ -30,10 +28,9 @@ var CheckboxGroup = function (props) {
30
28
  // @ts-ignore
31
29
  React.createElement("v-checkbox-group", _extends({
32
30
  ref: currentNode
33
- }, handleProps(props)), children || function renderOptions() {
34
- return options.map(function (item, index) {
31
+ }, handleProps(props)), children || (() => {
32
+ return options.map((item, index) => {
35
33
  var _item$checked;
36
-
37
34
  return /*#__PURE__*/React.createElement(Label, {
38
35
  key: index + '_' + item.value
39
36
  }, /*#__PURE__*/React.createElement(CheckBox, {
@@ -43,9 +40,8 @@ var CheckboxGroup = function (props) {
43
40
  color: item.color
44
41
  }), item.label);
45
42
  });
46
- }())
43
+ })())
47
44
  );
48
45
  };
49
-
50
46
  CheckboxGroup.displayName = 'CheckboxGroup';
51
47
  export default CheckboxGroup;
@@ -1,27 +1,23 @@
1
- import "core-js/modules/es.array.map.js";
2
1
  import * as React from 'react';
3
2
  import { CheckboxGroup as RemaxCheckboxGroup } from '@ray-js/adapter';
4
3
  import Checkbox from '../Checkbox';
5
4
  import Label from '../Label';
6
-
7
- var CheckboxGroup = function (props) {
8
- var options = props.options,
9
- name = props.name,
10
- disabled = props.disabled,
11
- _props$onChange = props.onChange,
12
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
13
- children = props.children;
5
+ const CheckboxGroup = props => {
6
+ const {
7
+ options,
8
+ name,
9
+ disabled,
10
+ onChange = () => {},
11
+ children
12
+ } = props;
14
13
  return /*#__PURE__*/React.createElement(RemaxCheckboxGroup, {
15
14
  name: name,
16
- onChange: function handleOnChange(e) {
15
+ onChange: e => {
17
16
  !disabled && onChange(e);
18
17
  }
19
- }, function renderChildren() {
20
- return children;
21
- }() || function renderOptions() {
22
- return options.map(function (item, index) {
18
+ }, (() => children)() || (() => {
19
+ return options.map((item, index) => {
23
20
  var _item$checked;
24
-
25
21
  return /*#__PURE__*/React.createElement(Label, {
26
22
  key: index + '_' + item.value
27
23
  }, /*#__PURE__*/React.createElement(Checkbox, {
@@ -31,7 +27,6 @@ var CheckboxGroup = function (props) {
31
27
  color: item.color
32
28
  }), item.label);
33
29
  });
34
- }());
30
+ })());
35
31
  };
36
-
37
32
  export default CheckboxGroup;
@@ -1,27 +1,23 @@
1
- import "core-js/modules/es.array.map.js";
2
1
  import * as React from 'react';
3
2
  import { CheckboxGroup as RemaxCheckboxGroup } from '@ray-core/wechat';
4
3
  import Checkbox from '../Checkbox';
5
4
  import Label from '../Label';
6
-
7
- var CheckboxGroup = function (props) {
8
- var options = props.options,
9
- name = props.name,
10
- disabled = props.disabled,
11
- _props$onChange = props.onChange,
12
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
13
- children = props.children;
5
+ const CheckboxGroup = props => {
6
+ const {
7
+ options,
8
+ name,
9
+ disabled,
10
+ onChange = () => {},
11
+ children
12
+ } = props;
14
13
  return /*#__PURE__*/React.createElement(RemaxCheckboxGroup, {
15
14
  name: name,
16
- onChange: function handleOnChange(e) {
15
+ onChange: e => {
17
16
  !disabled && onChange(e);
18
17
  }
19
- }, function renderChildren() {
20
- return children;
21
- }() || function renderOptions() {
22
- return options.map(function (item, index) {
18
+ }, (() => children)() || (() => {
19
+ return options.map((item, index) => {
23
20
  var _item$checked;
24
-
25
21
  return /*#__PURE__*/React.createElement(Label, {
26
22
  key: index + '_' + item.value
27
23
  }, /*#__PURE__*/React.createElement(Checkbox, {
@@ -31,7 +27,6 @@ var CheckboxGroup = function (props) {
31
27
  color: item.color
32
28
  }), item.label);
33
29
  });
34
- }());
30
+ })());
35
31
  };
36
-
37
32
  export default CheckboxGroup;
@@ -1,6 +1,6 @@
1
1
  import { BaseProps } from '../types';
2
2
  import { CheckboxProps } from '../Checkbox/props';
3
- export declare type CheckboxGroupOption = CheckboxProps & {
3
+ export type CheckboxGroupOption = CheckboxProps & {
4
4
  label: string;
5
5
  };
6
6
  export interface CheckboxGroupProps extends BaseProps {
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
-
3
- var CoverView = function () {
2
+ const CoverView = () => {
4
3
  return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
5
4
  };
6
-
7
5
  export default CoverView;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { CoverView as RemaxCoverView } from '@ray-js/adapter';
3
-
4
- var CoverView = function (props) {
3
+ const CoverView = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxCoverView, props, props.children);
6
5
  };
7
-
8
6
  export default CoverView;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { CoverViewProps } from './props';
2
- declare function CoverView(props: CoverViewProps): JSX.Element;
3
+ declare function CoverView(props: CoverViewProps): React.JSX.Element;
3
4
  export default CoverView;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { View } from '@ray-js/components';
3
-
4
3
  function CoverView() {
5
4
  return /*#__PURE__*/React.createElement(View, null, "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u7AEF\u6682\u672A\u5B9E\u73B0");
6
5
  }
7
-
8
6
  export default CoverView;
@@ -1,5 +1,5 @@
1
1
  import { BaseProps } from '../types';
2
- export declare type CoverViewProps = BaseProps & {
2
+ export type CoverViewProps = BaseProps & {
3
3
  children?: any;
4
4
  };
5
5
  export declare const defaultCoverViewProps: Partial<CoverViewProps>;
@@ -1 +1 @@
1
- export var defaultCoverViewProps = {};
1
+ export const defaultCoverViewProps = {};
package/lib/Form/Form.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["onSubmit", "onReset"];
4
+ const _excluded = ["onSubmit", "onReset"];
5
5
  import * as React from 'react';
6
6
  import handleProps from '../utils/handleProps';
7
7
  import { useEventListener } from 'ahooks';
8
-
9
- var Form = function (props) {
10
- var onSubmit = props.onSubmit,
11
- onReset = props.onReset,
12
- restProps = _objectWithoutProperties(props, _excluded);
13
-
14
- var currentNode = React.useRef(null);
15
- useEventListener('submit', function (e) {
8
+ const Form = props => {
9
+ const {
10
+ onSubmit,
11
+ onReset
12
+ } = props,
13
+ restProps = _objectWithoutProperties(props, _excluded);
14
+ const currentNode = React.useRef(null);
15
+ useEventListener('submit', e => {
16
16
  onSubmit(_objectSpread(_objectSpread({}, e.detail || {}), {}, {
17
17
  origin: e,
18
18
  type: 'submit'
@@ -20,18 +20,18 @@ var Form = function (props) {
20
20
  }, {
21
21
  target: currentNode
22
22
  });
23
- useEventListener('reset', function (e) {
23
+ useEventListener('reset', e => {
24
24
  onReset(_objectSpread(_objectSpread({}, e.detail || {}), {}, {
25
25
  origin: e,
26
26
  type: 'reset'
27
27
  }));
28
28
  }, {
29
29
  target: currentNode
30
- }); // @ts-ignore
30
+ });
31
31
 
32
+ // @ts-ignore
32
33
  return /*#__PURE__*/React.createElement("v-form", _extends({
33
34
  ref: currentNode
34
35
  }, handleProps(restProps)));
35
36
  };
36
-
37
37
  export default Form;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Form as RemaxForm } from '@ray-js/adapter';
3
-
4
- var Form = function (props) {
3
+ const Form = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxForm, props);
6
5
  };
7
-
8
6
  export default Form;
@@ -1,33 +1,27 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart"];
3
+ const _excluded = ["onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart"];
5
4
  import * as React from 'react';
6
5
  import { Form as RemaxForm } from '@ray-core/wechat';
7
6
  import { useTouch } from '@ray-js/framework-shared';
8
-
9
- var Form = function (props) {
10
- var onClick = props.onClick,
11
- onLongClick = props.onLongClick,
12
- onTouchCancel = props.onTouchCancel,
13
- onTouchEnd = props.onTouchEnd,
14
- onTouchMove = props.onTouchMove,
15
- onTouchStart = props.onTouchStart,
16
- restProps = _objectWithoutProperties(props, _excluded);
17
-
18
- var _useTouch = useTouch({
19
- onLongClick: onLongClick,
20
- onTouchStart: onTouchStart,
21
- onTouchMove: onTouchMove,
22
- onTouchEnd: onTouchEnd,
23
- onTouchCancel: onTouchCancel,
24
- onClick: onClick
25
- }),
26
- _useTouch2 = _slicedToArray(_useTouch, 2),
27
- touching = _useTouch2[0],
28
- handlers = _useTouch2[1];
29
-
7
+ const Form = props => {
8
+ const {
9
+ onClick,
10
+ onLongClick,
11
+ onTouchCancel,
12
+ onTouchEnd,
13
+ onTouchMove,
14
+ onTouchStart
15
+ } = props,
16
+ restProps = _objectWithoutProperties(props, _excluded);
17
+ const [touching, handlers] = useTouch({
18
+ onLongClick,
19
+ onTouchStart,
20
+ onTouchMove,
21
+ onTouchEnd,
22
+ onTouchCancel,
23
+ onClick
24
+ });
30
25
  return /*#__PURE__*/React.createElement(RemaxForm, _extends({}, restProps, handlers));
31
26
  };
32
-
33
27
  export default Form;
@@ -1,5 +1,5 @@
1
1
  import { BaseProps } from '../types';
2
- export declare type FormProps = BaseProps & {
2
+ export type FormProps = BaseProps & {
3
3
  /**
4
4
  * @description.en Trigger the Submit event with the data in the form
5
5
  * @description.zh 携带 form 中的数据触发 submit 事件
package/lib/Icon/Icon.js CHANGED
@@ -3,21 +3,21 @@ import * as React from 'react';
3
3
  import { Text } from '@ray-js/components';
4
4
  import { defaultIconProps } from './props';
5
5
  import './index.less';
6
-
7
- var Icon = function (props) {
8
- var type = props.type,
9
- size = props.size,
10
- color = props.color,
11
- style = props.style;
6
+ const Icon = props => {
7
+ const {
8
+ type,
9
+ size,
10
+ color,
11
+ style
12
+ } = props;
12
13
  return /*#__PURE__*/React.createElement(Text, {
13
- className: "iconfont ".concat(type),
14
+ className: `iconfont ${type}`,
14
15
  style: _objectSpread(_objectSpread({}, style), {}, {
15
- color: "".concat(color),
16
- fontSize: "".concat(size, "px")
16
+ color: `${color}`,
17
+ fontSize: `${size}px`
17
18
  })
18
19
  });
19
20
  };
20
-
21
21
  Icon.defaultProps = defaultIconProps;
22
22
  Icon.displayName = 'Icon';
23
23
  export default Icon;