@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.
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
@@ -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 { SwiperItem as RemaxSwiperItem } from '@ray-js/adapter';
8
-
9
- var SwiperItem = function (props) {
10
- var className = props.className,
11
- style = props.style,
12
- id = props.id,
13
- restProps = _objectWithoutProperties(props, _excluded);
14
-
8
+ const SwiperItem = props => {
9
+ const {
10
+ className,
11
+ style,
12
+ id
13
+ } = props,
14
+ restProps = _objectWithoutProperties(props, _excluded);
15
15
  return /*#__PURE__*/React.createElement(RemaxSwiperItem, _extends({
16
16
  id: id,
17
17
  style: inlineStyle(style),
18
18
  className: clsx('ray-swiper', className)
19
19
  }, restProps));
20
20
  };
21
-
22
21
  export default SwiperItem;
@@ -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 { SwiperItem as RemaxSwiperItem } from '@ray-js/adapter';
8
-
9
- var SwiperItem = function (props) {
10
- var className = props.className,
11
- style = props.style,
12
- id = props.id,
13
- restProps = _objectWithoutProperties(props, _excluded);
14
-
8
+ const SwiperItem = props => {
9
+ const {
10
+ className,
11
+ style,
12
+ id
13
+ } = props,
14
+ restProps = _objectWithoutProperties(props, _excluded);
15
15
  return /*#__PURE__*/React.createElement(RemaxSwiperItem, _extends({
16
16
  id: id,
17
17
  style: inlineStyle(style),
18
18
  className: clsx('ray-swiper', className)
19
19
  }, restProps));
20
20
  };
21
-
22
21
  export default SwiperItem;
@@ -3,12 +3,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import * as React from 'react';
4
4
  import { useEventListener } from 'ahooks';
5
5
  import handleProps from '../utils/handleProps';
6
-
7
- var Switch = function (props) {
8
- var currentNode = React.useRef(null);
9
- useEventListener('change', function (e) {
6
+ const Switch = props => {
7
+ const currentNode = React.useRef(null);
8
+ useEventListener('change', e => {
10
9
  var _props$onChange;
11
-
12
10
  (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, _objectSpread(_objectSpread({
13
11
  type: 'change'
14
12
  }, e.detail), {}, {
@@ -16,12 +14,11 @@ var Switch = function (props) {
16
14
  }));
17
15
  }, {
18
16
  target: currentNode
19
- }); // @ts-ignore
20
-
17
+ });
18
+ // @ts-ignore
21
19
  return /*#__PURE__*/React.createElement("v-switch", _extends({}, handleProps(props), {
22
20
  ref: currentNode
23
21
  }));
24
22
  };
25
-
26
23
  Switch.displayName = 'Switch';
27
24
  export default Switch;
@@ -1,24 +1,23 @@
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", "onChange", "type", "color"];
3
+ const _excluded = ["className", "style", "id", "onChange", "type", "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 { Switch as RemaxSwitch } from '@ray-js/adapter';
8
-
9
- var Switch = function (props) {
10
- var className = props.className,
11
- style = props.style,
12
- id = props.id,
13
- onChange = props.onChange,
14
- _props$type = props.type,
15
- type = _props$type === void 0 ? 'switch' : _props$type,
16
- color = props.color,
17
- restProps = _objectWithoutProperties(props, _excluded);
18
-
8
+ const Switch = props => {
9
+ const {
10
+ className,
11
+ style,
12
+ id,
13
+ onChange,
14
+ type = 'switch',
15
+ color
16
+ } = props,
17
+ restProps = _objectWithoutProperties(props, _excluded);
19
18
  return /*#__PURE__*/React.createElement(RemaxSwitch, _extends({
20
19
  id: id,
21
- onChange: function handleChange(e) {
20
+ onChange: e => {
22
21
  onChange === null || onChange === void 0 ? void 0 : onChange({
23
22
  type: 'change',
24
23
  value: e.detail.value,
@@ -31,5 +30,4 @@ var Switch = function (props) {
31
30
  type: type
32
31
  }, restProps));
33
32
  };
34
-
35
33
  export default Switch;
@@ -1,25 +1,24 @@
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", "onChange", "type", "color"];
3
+ const _excluded = ["className", "style", "id", "onChange", "type", "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 { Switch as RemaxSwitch } from '@ray-core/wechat';
8
8
  import './index.module.less';
9
-
10
- var Switch = function (props) {
11
- var className = props.className,
12
- style = props.style,
13
- id = props.id,
14
- onChange = props.onChange,
15
- _props$type = props.type,
16
- type = _props$type === void 0 ? 'switch' : _props$type,
17
- color = props.color,
18
- restProps = _objectWithoutProperties(props, _excluded);
19
-
9
+ const Switch = props => {
10
+ const {
11
+ className,
12
+ style,
13
+ id,
14
+ onChange,
15
+ type = 'switch',
16
+ color
17
+ } = props,
18
+ restProps = _objectWithoutProperties(props, _excluded);
20
19
  return /*#__PURE__*/React.createElement(RemaxSwitch, _extends({
21
20
  id: id,
22
- onChange: function handleChange(e) {
21
+ onChange: e => {
23
22
  onChange === null || onChange === void 0 ? void 0 : onChange({
24
23
  type: 'change',
25
24
  value: e.detail.value,
@@ -32,5 +31,4 @@ var Switch = function (props) {
32
31
  color: color || '#007AFF'
33
32
  }, restProps));
34
33
  };
35
-
36
34
  export default Switch;
@@ -1,4 +1,4 @@
1
- export var defaultSwitchProps = {
1
+ export const defaultSwitchProps = {
2
2
  type: 'switch',
3
3
  color: '#007AFF',
4
4
  disabled: false
package/lib/Text/Text.js CHANGED
@@ -1,13 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import handleProps from '../utils/handleProps';
3
-
4
- var Text = function (props) {
3
+ const Text = props => {
5
4
  return (
6
5
  /*#__PURE__*/
7
6
  // @ts-ignore
8
7
  React.createElement("v-text", handleProps(props))
9
8
  );
10
9
  };
11
-
12
10
  Text.displayName = 'Text';
13
11
  export default Text;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Text as RemaxText } from '@ray-js/adapter';
3
-
4
- var Text = function (props) {
3
+ const Text = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxText, props);
6
5
  };
7
-
8
6
  export default Text;
@@ -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 { Text as RemaxText } from '@ray-core/wechat';
7
6
  import { useTouch } from '@ray-js/framework-shared';
8
-
9
- var Text = 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 Text = 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(RemaxText, _extends({}, restProps, handlers));
31
26
  };
32
-
33
27
  export default Text;
@@ -1,21 +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", "onInput", "onFocus", "onBlur"];
3
+ const _excluded = ["className", "onInput", "onFocus", "onBlur"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { useEventListener } from 'ahooks';
7
7
  import styles from './index.module.less';
8
8
  import handleProps from '../utils/handleProps';
9
-
10
- var Textarea = function (props) {
11
- var className = props.className,
12
- onInput = props.onInput,
13
- onFocus = props.onFocus,
14
- onBlur = props.onBlur,
15
- restProps = _objectWithoutProperties(props, _excluded);
16
-
17
- var currentNode = React.useRef(null);
18
- useEventListener('input', function (e) {
9
+ const Textarea = props => {
10
+ const {
11
+ className,
12
+ onInput,
13
+ onFocus,
14
+ onBlur
15
+ } = props,
16
+ restProps = _objectWithoutProperties(props, _excluded);
17
+ const currentNode = React.useRef(null);
18
+ useEventListener('input', e => {
19
19
  onInput === null || onInput === void 0 ? void 0 : onInput({
20
20
  type: 'input',
21
21
  value: e.detail.value,
@@ -24,7 +24,7 @@ var Textarea = function (props) {
24
24
  }, {
25
25
  target: currentNode
26
26
  });
27
- useEventListener('focus', function (e) {
27
+ useEventListener('focus', e => {
28
28
  onFocus === null || onFocus === void 0 ? void 0 : onFocus({
29
29
  type: 'focus',
30
30
  value: e.detail.value,
@@ -33,7 +33,7 @@ var Textarea = function (props) {
33
33
  }, {
34
34
  target: currentNode
35
35
  });
36
- useEventListener('blur', function (e) {
36
+ useEventListener('blur', e => {
37
37
  onBlur === null || onBlur === void 0 ? void 0 : onBlur({
38
38
  type: 'blur',
39
39
  value: e.detail.value,
@@ -51,6 +51,5 @@ var Textarea = function (props) {
51
51
  }))
52
52
  );
53
53
  };
54
-
55
54
  Textarea.displayName = 'Textarea';
56
55
  export default Textarea;
@@ -1,31 +1,32 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["id", "className", "style", "value", "placeholderStyle", "placeholder", "onInput", "onFocus", "onLinechange", "onBlur", "maxLength", "disabled", "name", "autoHeight"];
3
+ const _excluded = ["id", "className", "style", "value", "placeholderStyle", "placeholder", "onInput", "onFocus", "onLinechange", "onBlur", "maxLength", "disabled", "name", "autoHeight"];
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 { Textarea as RemaxTextarea } from '@ray-js/adapter';
8
8
  import styles from './index.module.less';
9
- var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
- var id = props.id,
11
- className = props.className,
12
- style = props.style,
13
- value = props.value,
14
- placeholderStyle = props.placeholderStyle,
15
- placeholder = props.placeholder,
16
- onInput = props.onInput,
17
- onFocus = props.onFocus,
18
- onLinechange = props.onLinechange,
19
- onBlur = props.onBlur,
20
- _props$maxLength = props.maxLength,
21
- maxLength = _props$maxLength === void 0 ? 140 : _props$maxLength,
22
- disabled = props.disabled,
23
- name = props.name,
24
- autoHeight = props.autoHeight,
25
- restProps = _objectWithoutProperties(props, _excluded);
26
-
9
+ const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const {
11
+ id,
12
+ className,
13
+ style,
14
+ value,
15
+ placeholderStyle,
16
+ placeholder,
17
+ onInput,
18
+ onFocus,
19
+ onLinechange,
20
+ onBlur,
21
+ maxLength = 140,
22
+ disabled,
23
+ name,
24
+ autoHeight
25
+ } = props,
26
+ restProps = _objectWithoutProperties(props, _excluded);
27
27
  return /*#__PURE__*/React.createElement(RemaxTextarea, _extends({
28
- name: name // @ts-ignore
28
+ name: name
29
+ // @ts-ignore
29
30
  ,
30
31
  ref: ref,
31
32
  id: id,
@@ -39,9 +40,11 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
39
40
  onLinechange: onLinechange,
40
41
  onFocus: onFocus,
41
42
  onInput: function (e) {
42
- var value = e.detail.value;
43
+ const {
44
+ value
45
+ } = e.detail;
43
46
  onInput === null || onInput === void 0 ? void 0 : onInput({
44
- value: value
47
+ value
45
48
  });
46
49
  },
47
50
  placeholder: placeholder,
@@ -1,31 +1,32 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["id", "className", "style", "value", "placeholderStyle", "placeholder", "onInput", "onFocus", "onBlur", "onLinechange", "maxLength", "disabled", "name", "autoHeight"];
3
+ const _excluded = ["id", "className", "style", "value", "placeholderStyle", "placeholder", "onInput", "onFocus", "onBlur", "onLinechange", "maxLength", "disabled", "name", "autoHeight"];
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 { Textarea as RemaxTextarea } from '@ray-core/wechat';
8
8
  import styles from './index.module.less';
9
- var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
- var id = props.id,
11
- className = props.className,
12
- style = props.style,
13
- value = props.value,
14
- placeholderStyle = props.placeholderStyle,
15
- placeholder = props.placeholder,
16
- onInput = props.onInput,
17
- onFocus = props.onFocus,
18
- onBlur = props.onBlur,
19
- onLinechange = props.onLinechange,
20
- _props$maxLength = props.maxLength,
21
- maxLength = _props$maxLength === void 0 ? 140 : _props$maxLength,
22
- disabled = props.disabled,
23
- name = props.name,
24
- autoHeight = props.autoHeight,
25
- restProps = _objectWithoutProperties(props, _excluded);
26
-
9
+ const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const {
11
+ id,
12
+ className,
13
+ style,
14
+ value,
15
+ placeholderStyle,
16
+ placeholder,
17
+ onInput,
18
+ onFocus,
19
+ onBlur,
20
+ onLinechange,
21
+ maxLength = 140,
22
+ disabled,
23
+ name,
24
+ autoHeight
25
+ } = props,
26
+ restProps = _objectWithoutProperties(props, _excluded);
27
27
  return /*#__PURE__*/React.createElement(RemaxTextarea, _extends({
28
- name: name // @ts-ignore
28
+ name: name
29
+ // @ts-ignore
29
30
  ,
30
31
  ref: ref,
31
32
  id: id,
@@ -38,9 +39,11 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
38
39
  onBlur: onBlur,
39
40
  onFocus: onFocus,
40
41
  onInput: function (e) {
41
- var value = e.detail.value;
42
+ const {
43
+ value
44
+ } = e.detail;
42
45
  onInput === null || onInput === void 0 ? void 0 : onInput({
43
- value: value
46
+ value
44
47
  });
45
48
  },
46
49
  onLinechange: onLinechange,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { BaseProps, FormEvent } from '../types';
3
- export declare type TextareaEvent = FormEvent<{
3
+ export type TextareaEvent = FormEvent<{
4
4
  value: string;
5
5
  }>;
6
6
  export interface TextareaProps extends BaseProps {
package/lib/View/View.js CHANGED
@@ -1,7 +1,6 @@
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 = ["id", "className", "style", "children", "hoverClassName", "hoverStartTime", "hoverStayTime", "hoverable", "onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onTransitionEnd"];
3
+ const _excluded = ["id", "className", "style", "children", "hoverClassName", "hoverStartTime", "hoverStayTime", "hoverable", "onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onTransitionEnd"];
5
4
  import * as React from 'react';
6
5
  import clsx from 'clsx';
7
6
  import PropTypes from 'prop-types';
@@ -9,38 +8,35 @@ import handleProps from '../utils/handleProps';
9
8
  import { filterProps, inlineStyle, useTouch } from '@ray-js/framework-shared';
10
9
  import { defaultViewProps } from './props';
11
10
  import styles from './index.module.less';
12
- var View = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
- var id = props.id,
14
- className = props.className,
15
- style = props.style,
16
- children = props.children,
17
- hoverClassName = props.hoverClassName,
18
- hoverStartTime = props.hoverStartTime,
19
- hoverStayTime = props.hoverStayTime,
20
- hoverable = props.hoverable,
21
- onClick = props.onClick,
22
- onLongClick = props.onLongClick,
23
- onTouchCancel = props.onTouchCancel,
24
- onTouchEnd = props.onTouchEnd,
25
- onTouchMove = props.onTouchMove,
26
- onTouchStart = props.onTouchStart,
27
- onTransitionEnd = props.onTransitionEnd,
28
- restProps = _objectWithoutProperties(props, _excluded);
29
-
30
- var _useTouch = useTouch({
11
+ const View = /*#__PURE__*/React.forwardRef((props, ref) => {
12
+ const {
13
+ id,
14
+ className,
15
+ style,
16
+ children,
17
+ hoverClassName,
18
+ hoverStartTime,
19
+ hoverStayTime,
20
+ hoverable,
21
+ onClick,
22
+ onLongClick,
23
+ onTouchCancel,
24
+ onTouchEnd,
25
+ onTouchMove,
26
+ onTouchStart,
27
+ onTransitionEnd
28
+ } = props,
29
+ restProps = _objectWithoutProperties(props, _excluded);
30
+ const [touching, handlers] = useTouch({
31
31
  hoverDelay: hoverStartTime,
32
32
  hoverDuration: hoverStayTime,
33
- onLongClick: onLongClick,
34
- onTouchStart: onTouchStart,
35
- onTouchMove: onTouchMove,
36
- onTouchEnd: onTouchEnd,
37
- onTouchCancel: onTouchCancel,
38
- onClick: onClick
39
- }),
40
- _useTouch2 = _slicedToArray(_useTouch, 2),
41
- touching = _useTouch2[0],
42
- handlers = _useTouch2[1];
43
-
33
+ onLongClick,
34
+ onTouchStart,
35
+ onTouchMove,
36
+ onTouchEnd,
37
+ onTouchCancel,
38
+ onClick
39
+ });
44
40
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("v-view", _extends({}, handleProps(props), {
45
41
  ref: ref,
46
42
  id: id,
@@ -1,53 +1,51 @@
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
- var _excluded = ["id", "className", "style", "hoverClassName", "hoverStartTime", "hoverStayTime", "children", "onLongClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "hoverable", "onTransitionEnd"];
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 PropTypes from 'prop-types';
9
7
  import { inlineStyle, useTouch } from '@ray-js/framework-shared';
10
8
  import { View as RemaxView } from '@ray-js/adapter';
11
9
  import styles from './index.module.less';
12
- var View = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
- var id = props.id,
14
- className = props.className,
15
- style = props.style,
16
- hoverClassName = props.hoverClassName,
17
- hoverStartTime = props.hoverStartTime,
18
- hoverStayTime = props.hoverStayTime,
19
- children = props.children,
20
- onLongClick = props.onLongClick,
21
- onTouchStart = props.onTouchStart,
22
- onTouchMove = props.onTouchMove,
23
- onTouchEnd = props.onTouchEnd,
24
- onTouchCancel = props.onTouchCancel,
25
- onClick = props.onClick,
26
- hoverable = props.hoverable,
27
- onTransitionEnd = props.onTransitionEnd,
28
- restProps = _objectWithoutProperties(props, _excluded);
29
-
30
- var _useTouch = useTouch({
10
+ const View = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const {
12
+ id,
13
+ className,
14
+ style,
15
+ hoverClassName,
16
+ hoverStartTime,
17
+ hoverStayTime,
18
+ children,
19
+ onLongClick,
20
+ onTouchStart,
21
+ onTouchMove,
22
+ onTouchEnd,
23
+ onTouchCancel,
24
+ onClick,
25
+ hoverable,
26
+ onTransitionEnd
27
+ } = props,
28
+ restProps = _objectWithoutProperties(props, _excluded);
29
+ const [touching, handlers] = useTouch({
31
30
  hoverDelay: hoverStartTime,
32
31
  hoverDuration: hoverStayTime,
33
- onLongClick: onLongClick,
34
- onTouchStart: onTouchStart,
35
- onTouchMove: onTouchMove,
36
- onTouchEnd: onTouchEnd,
37
- onTouchCancel: onTouchCancel,
38
- onClick: onClick
39
- }),
40
- _useTouch2 = _slicedToArray(_useTouch, 2),
41
- touching = _useTouch2[0],
42
- handlers = _useTouch2[1];
43
-
44
- return /*#__PURE__*/React.createElement(RemaxView // @ts-ignore
32
+ onLongClick,
33
+ onTouchStart,
34
+ onTouchMove,
35
+ onTouchEnd,
36
+ onTouchCancel,
37
+ onClick
38
+ });
39
+ return /*#__PURE__*/React.createElement(RemaxView
40
+ // @ts-ignore
45
41
  , _extends({
46
42
  ref: ref,
47
43
  id: id,
48
44
  className: className,
49
45
  style: inlineStyle(style),
50
- hoverClassName: clsx(_defineProperty({}, styles.hover, hoverable), hoverClassName),
46
+ hoverClassName: clsx({
47
+ [styles.hover]: hoverable
48
+ }, hoverClassName),
51
49
  hoverStartTime: hoverStartTime,
52
50
  hoverStayTime: hoverStayTime,
53
51
  onTransitionEnd: onTransitionEnd