@ray-js/components 1.4.0-alpha.1 → 1.4.0-alpha.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) 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.d.ts +2 -1
  6. package/lib/Camera/Camera.js +3 -3
  7. package/lib/Camera/Camera.thing.js +1 -3
  8. package/lib/Camera/Camera.wechat.d.ts +2 -1
  9. package/lib/Camera/Camera.wechat.js +2 -2
  10. package/lib/Checkbox/Checkbox.js +1 -3
  11. package/lib/Checkbox/Checkbox.thing.js +8 -9
  12. package/lib/Checkbox/Checkbox.wechat.js +9 -10
  13. package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
  14. package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
  15. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
  16. package/lib/CheckboxGroup/props.d.ts +1 -1
  17. package/lib/CoverView/CoverView.js +1 -3
  18. package/lib/CoverView/CoverView.thing.js +1 -3
  19. package/lib/CoverView/CoverView.wechat.d.ts +2 -1
  20. package/lib/CoverView/CoverView.wechat.js +0 -2
  21. package/lib/CoverView/props.d.ts +1 -1
  22. package/lib/CoverView/props.js +1 -1
  23. package/lib/Form/Form.js +12 -12
  24. package/lib/Form/Form.thing.js +1 -3
  25. package/lib/Form/Form.wechat.js +20 -25
  26. package/lib/Form/props.d.ts +1 -1
  27. package/lib/Icon/Icon.js +7 -7
  28. package/lib/Icon/Icon.thing.js +7 -7
  29. package/lib/Icon/Icon.wechat.js +7 -7
  30. package/lib/Icon/iconfont/iconfont.js +13 -20
  31. package/lib/Icon/props.d.ts +1 -1
  32. package/lib/Icon/props.js +1 -1
  33. package/lib/Iframe/Iframe.d.ts +2 -1
  34. package/lib/Iframe/Iframe.js +3 -3
  35. package/lib/Iframe/Iframe.thing.js +1 -3
  36. package/lib/Iframe/Iframe.wechat.d.ts +2 -1
  37. package/lib/Iframe/Iframe.wechat.js +3 -3
  38. package/lib/Image/Image.js +6 -8
  39. package/lib/Image/Image.thing.js +8 -10
  40. package/lib/Image/Image.wechat.js +26 -32
  41. package/lib/Input/Input.js +29 -26
  42. package/lib/Input/Input.thing.js +36 -36
  43. package/lib/Input/Input.wechat.js +47 -47
  44. package/lib/Input/props.d.ts +11 -21
  45. package/lib/Input/props.js +1 -3
  46. package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
  47. package/lib/IpcPlayer/IpcPlayer.js +3 -3
  48. package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
  49. package/lib/IpcPlayer/IpcPlayer.wechat.d.ts +2 -1
  50. package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
  51. package/lib/Label/Label.js +7 -8
  52. package/lib/Label/Label.thing.js +8 -8
  53. package/lib/Label/Label.wechat.js +8 -8
  54. package/lib/Map/Map.js +1 -3
  55. package/lib/Map/Map.thing.js +1 -3
  56. package/lib/Map/Map.wechat.js +1 -3
  57. package/lib/Modal/index.js +4 -2
  58. package/lib/Modal/index.web.js +6 -4
  59. package/lib/MovableArea/MovableArea.js +5 -4
  60. package/lib/MovableArea/MovableArea.thing.js +1 -3
  61. package/lib/MovableArea/MovableArea.wechat.js +1 -3
  62. package/lib/MovableView/MovableView.js +12 -11
  63. package/lib/MovableView/MovableView.thing.js +1 -3
  64. package/lib/MovableView/MovableView.wechat.js +1 -3
  65. package/lib/NativeVideo/NativeVideo.d.ts +2 -1
  66. package/lib/NativeVideo/NativeVideo.js +3 -3
  67. package/lib/NativeVideo/NativeVideo.thing.js +1 -3
  68. package/lib/NativeVideo/NativeVideo.wechat.d.ts +2 -1
  69. package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
  70. package/lib/PageContainer/PageContainer.js +12 -19
  71. package/lib/PageContainer/PageContainer.thing.d.ts +2 -1
  72. package/lib/PageContainer/PageContainer.thing.js +0 -2
  73. package/lib/PageContainer/PageContainer.wechat.d.ts +2 -1
  74. package/lib/PageContainer/PageContainer.wechat.js +0 -2
  75. package/lib/PageContainer/props.d.ts +2 -2
  76. package/lib/PageContainer/props.js +3 -3
  77. package/lib/Picker/Picker.js +23 -31
  78. package/lib/Picker/Picker.thing.js +26 -31
  79. package/lib/Picker/Picker.wechat.js +26 -31
  80. package/lib/PickerView/PickerView.js +23 -34
  81. package/lib/PickerView/PickerView.thing.js +16 -19
  82. package/lib/PickerView/PickerView.wechat.js +16 -19
  83. package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
  84. package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
  85. package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
  86. package/lib/Progress/Progress.js +1 -3
  87. package/lib/Progress/Progress.thing.js +6 -7
  88. package/lib/Progress/Progress.wechat.js +6 -7
  89. package/lib/Radio/Radio.js +1 -3
  90. package/lib/Radio/Radio.thing.js +8 -9
  91. package/lib/Radio/Radio.wechat.js +9 -10
  92. package/lib/RadioGroup/RadioGroup.js +12 -18
  93. package/lib/RadioGroup/RadioGroup.thing.js +15 -21
  94. package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
  95. package/lib/RadioGroup/props.d.ts +1 -1
  96. package/lib/RichText/RichText.js +1 -1
  97. package/lib/RichText/RichText.thing.js +1 -3
  98. package/lib/RichText/RichText.wechat.js +1 -3
  99. package/lib/ScrollView/ScrollView.js +12 -13
  100. package/lib/ScrollView/ScrollView.thing.js +6 -7
  101. package/lib/ScrollView/ScrollView.wechat.js +6 -7
  102. package/lib/Slider/Slider.js +4 -8
  103. package/lib/Slider/Slider.thing.js +13 -14
  104. package/lib/Slider/Slider.wechat.js +14 -15
  105. package/lib/Slider/props.js +1 -1
  106. package/lib/Swiper/Swiper.d.ts +1 -1
  107. package/lib/Swiper/Swiper.js +24 -33
  108. package/lib/Swiper/Swiper.thing.d.ts +1 -1
  109. package/lib/Swiper/Swiper.thing.js +18 -24
  110. package/lib/Swiper/Swiper.wechat.d.ts +1 -1
  111. package/lib/Swiper/Swiper.wechat.js +18 -24
  112. package/lib/Swiper/props.d.ts +1 -1
  113. package/lib/Swiper/props.js +2 -2
  114. package/lib/SwiperItem/SwiperItem.js +4 -4
  115. package/lib/SwiperItem/SwiperItem.thing.js +8 -9
  116. package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
  117. package/lib/Switch/Switch.js +5 -8
  118. package/lib/Switch/Switch.thing.js +12 -14
  119. package/lib/Switch/Switch.wechat.js +12 -14
  120. package/lib/Switch/props.js +1 -1
  121. package/lib/Text/Text.js +1 -3
  122. package/lib/Text/Text.thing.js +1 -3
  123. package/lib/Text/Text.wechat.js +20 -25
  124. package/lib/Textarea/Textarea.js +13 -24
  125. package/lib/Textarea/Textarea.thing.js +26 -30
  126. package/lib/Textarea/Textarea.wechat.js +26 -30
  127. package/lib/Textarea/props.d.ts +4 -10
  128. package/lib/View/View.js +29 -32
  129. package/lib/View/View.thing.js +34 -35
  130. package/lib/View/View.wechat.js +34 -35
  131. package/lib/View/props.js +1 -1
  132. package/lib/WebView/WebView.js +1 -3
  133. package/lib/WebView/WebView.thing.js +1 -3
  134. package/lib/WebView/WebView.wechat.js +1 -3
  135. package/lib/assets/icons.js +1 -1
  136. package/lib/core/index.js +4 -11
  137. package/lib/types/event.d.ts +1 -1
  138. package/lib/types/index.js +1 -0
  139. package/lib/utils/handleProps.js +26 -40
  140. package/package.json +25 -25
  141. package/lib/Modal/index.web.d.ts +0 -2
@@ -1,17 +1,16 @@
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 { useEventListener } from 'ahooks';
5
4
  import handleProps from '../utils/handleProps';
6
-
7
- var RadioGroup = function (props) {
8
- var options = props.options,
9
- disabled = props.disabled,
10
- children = props.children;
11
- var currentNode = React.useRef(null);
12
- useEventListener('change', function (e) {
5
+ const RadioGroup = props => {
6
+ const {
7
+ options,
8
+ disabled,
9
+ children
10
+ } = props;
11
+ const currentNode = React.useRef(null);
12
+ useEventListener('change', e => {
13
13
  var _props$onChange;
14
-
15
14
  !disabled && ((_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
16
15
  type: 'change',
17
16
  value: e.detail.value
@@ -24,23 +23,19 @@ var RadioGroup = function (props) {
24
23
  // @ts-ignore
25
24
  React.createElement("v-radio-group", _extends({}, handleProps(props), {
26
25
  ref: currentNode
27
- }), children || function renderOptions() {
28
- return options.map(function (item, index) {
26
+ }), children || (() => {
27
+ return options.map((item, index) => {
29
28
  var _item$checked;
30
-
31
- var radioProps = {
29
+ const radioProps = {
32
30
  value: item.value,
33
31
  color: item.color
34
32
  };
35
-
36
33
  if ((_item$checked = item.checked) !== null && _item$checked !== void 0 ? _item$checked : false) {
37
34
  radioProps.checked = true;
38
35
  }
39
-
40
36
  if (disabled || item.disabled || false) {
41
37
  radioProps.disabled = true;
42
38
  }
43
-
44
39
  return (
45
40
  /*#__PURE__*/
46
41
  // @ts-ignore
@@ -49,9 +44,8 @@ var RadioGroup = function (props) {
49
44
  }, /*#__PURE__*/React.createElement("v-radio", radioProps), item.label)
50
45
  );
51
46
  });
52
- }())
47
+ })())
53
48
  );
54
49
  };
55
-
56
50
  RadioGroup.displayName = 'RadioGroup';
57
51
  export default RadioGroup;
@@ -1,39 +1,34 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["options", "name", "disabled", "onChange", "children", "style"];
4
- import "core-js/modules/es.array.map.js";
3
+ const _excluded = ["options", "name", "disabled", "onChange", "children", "style"];
5
4
  import * as React from 'react';
6
5
  import { RadioGroup as RemaxRadioGroup } from '@ray-js/adapter';
7
6
  import Radio from '../Radio';
8
7
  import Label from '../Label';
9
8
  import { inlineStyle } from '@ray-js/framework-shared';
10
-
11
- var RadioGroup = function (props) {
9
+ const RadioGroup = props => {
12
10
  // eslint-disable-next-line @typescript-eslint/no-empty-function
13
- var options = props.options,
14
- name = props.name,
15
- disabled = props.disabled,
16
- _props$onChange = props.onChange,
17
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
18
- children = props.children,
19
- style = props.style,
20
- restProps = _objectWithoutProperties(props, _excluded);
21
-
11
+ const {
12
+ options,
13
+ name,
14
+ disabled,
15
+ onChange = () => {},
16
+ children,
17
+ style
18
+ } = props,
19
+ restProps = _objectWithoutProperties(props, _excluded);
22
20
  return (
23
21
  /*#__PURE__*/
24
22
  // @ts-ignore
25
23
  React.createElement(RemaxRadioGroup, _extends({
26
24
  style: inlineStyle(style),
27
25
  name: name,
28
- onChange: function handleOnChange(e) {
26
+ onChange: e => {
29
27
  !disabled && onChange(e);
30
28
  }
31
- }, restProps), function renderChildren() {
32
- return children;
33
- }() || function renderOptions() {
34
- return options.map(function (item, index) {
29
+ }, restProps), (() => children)() || (() => {
30
+ return options.map((item, index) => {
35
31
  var _item$checked;
36
-
37
32
  return /*#__PURE__*/React.createElement(Label, {
38
33
  key: index + '_' + item.value
39
34
  }, /*#__PURE__*/React.createElement(Radio, {
@@ -43,8 +38,7 @@ var RadioGroup = function (props) {
43
38
  color: item.color
44
39
  }), item.label);
45
40
  });
46
- }())
41
+ })())
47
42
  );
48
43
  };
49
-
50
44
  export default RadioGroup;
@@ -1,27 +1,23 @@
1
- import "core-js/modules/es.array.map.js";
2
1
  import * as React from 'react';
3
2
  import { RadioGroup as RemaxRadioGroup } from '@ray-core/wechat';
4
3
  import Radio from '../Radio';
5
4
  import Label from '../Label';
6
-
7
- var RadioGroup = 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 RadioGroup = props => {
6
+ const {
7
+ options,
8
+ name,
9
+ disabled,
10
+ onChange = () => {},
11
+ children
12
+ } = props;
14
13
  return /*#__PURE__*/React.createElement(RemaxRadioGroup, {
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(Radio, {
@@ -31,7 +27,6 @@ var RadioGroup = function (props) {
31
27
  color: item.color
32
28
  }), item.label);
33
29
  });
34
- }());
30
+ })());
35
31
  };
36
-
37
32
  export default RadioGroup;
@@ -1,6 +1,6 @@
1
1
  import { BaseProps } from '../types';
2
2
  import { RadioProps } from '../Radio/props';
3
- export declare type RadioGroupOption = RadioProps & {
3
+ export type RadioGroupOption = RadioProps & {
4
4
  label: string;
5
5
  };
6
6
  export interface RadioGroupProps extends BaseProps {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import handleProps from '../utils/handleProps';
3
- export var RichText = function (props) {
3
+ export const RichText = props => {
4
4
  // @ts-ignore
5
5
  return /*#__PURE__*/React.createElement("v-rich-text", handleProps(props));
6
6
  };
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { RichText as RemaxRichText } from '@ray-js/adapter';
3
-
4
- var RichText = function (props) {
3
+ const RichText = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxRichText, props);
6
5
  };
7
-
8
6
  export default RichText;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { RichText as RemaxRichText } from '@ray-js/adapter';
3
-
4
- var RichText = function (props) {
3
+ const RichText = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxRichText, props);
6
5
  };
7
-
8
6
  export default RichText;
@@ -1,20 +1,20 @@
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 = ["onScroll", "onScrollToUpper", "onScrollToLower"];
4
+ const _excluded = ["onScroll", "onScrollToUpper", "onScrollToLower"];
5
5
  import React from 'react';
6
6
  import { useEventListener } from 'ahooks';
7
7
  import { ScrollView as ScrollViewDef } from '@ray-js/adapter';
8
8
  import handleProps from '../utils/handleProps';
9
-
10
- var ScrollView = function (props) {
11
- var onScroll = props.onScroll,
12
- onScrollToUpper = props.onScrollToUpper,
13
- onScrollToLower = props.onScrollToLower,
14
- restProps = _objectWithoutProperties(props, _excluded);
15
-
16
- var currentNode = React.useRef(null);
17
- useEventListener('scroll', function (e) {
9
+ const ScrollView = props => {
10
+ const {
11
+ onScroll,
12
+ onScrollToUpper,
13
+ onScrollToLower
14
+ } = props,
15
+ restProps = _objectWithoutProperties(props, _excluded);
16
+ const currentNode = React.useRef(null);
17
+ useEventListener('scroll', e => {
18
18
  onScroll === null || onScroll === void 0 ? void 0 : onScroll(_objectSpread(_objectSpread({
19
19
  type: 'scroll'
20
20
  }, e.detail), {}, {
@@ -23,7 +23,7 @@ var ScrollView = function (props) {
23
23
  }, {
24
24
  target: currentNode
25
25
  });
26
- useEventListener('scrolltoupper', function (e) {
26
+ useEventListener('scrolltoupper', e => {
27
27
  onScrollToUpper === null || onScrollToUpper === void 0 ? void 0 : onScrollToUpper(_objectSpread(_objectSpread({
28
28
  type: 'scrolltoupper'
29
29
  }, e.detail), {}, {
@@ -32,7 +32,7 @@ var ScrollView = function (props) {
32
32
  }, {
33
33
  target: currentNode
34
34
  });
35
- useEventListener('scrolltolower', function (e) {
35
+ useEventListener('scrolltolower', e => {
36
36
  onScrollToLower === null || onScrollToLower === void 0 ? void 0 : onScrollToLower(_objectSpread(_objectSpread({
37
37
  type: 'scrolltolower'
38
38
  }, e.detail), {}, {
@@ -49,6 +49,5 @@ var ScrollView = function (props) {
49
49
  }), props.children)
50
50
  );
51
51
  };
52
-
53
52
  ScrollView.defaultProps = ScrollViewDef.defaultProps;
54
53
  export default ScrollView;
@@ -1,17 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style"];
3
+ const _excluded = ["style"];
4
4
  import * as React from 'react';
5
5
  import { inlineStyle } from '@ray-js/framework-shared';
6
6
  import { ScrollView as RemaxScrollView } from '@ray-js/adapter';
7
-
8
- var ScrollView = function (props) {
9
- var style = props.style,
10
- restProps = _objectWithoutProperties(props, _excluded);
11
-
7
+ const ScrollView = props => {
8
+ const {
9
+ style
10
+ } = props,
11
+ restProps = _objectWithoutProperties(props, _excluded);
12
12
  return /*#__PURE__*/React.createElement(RemaxScrollView, _extends({
13
13
  style: inlineStyle(style)
14
14
  }, restProps));
15
15
  };
16
-
17
16
  export default ScrollView;
@@ -1,20 +1,19 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style"];
3
+ const _excluded = ["style"];
4
4
  import * as React from 'react';
5
5
  import { inlineStyle } from '@ray-js/framework-shared';
6
6
  import { ScrollView as RemaxScrollView } from '@ray-core/wechat';
7
7
  import { ScrollView as ScrollViewDef } from '@ray-js/adapter';
8
-
9
- var ScrollView = function (props) {
10
- var style = props.style,
11
- restProps = _objectWithoutProperties(props, _excluded);
12
-
8
+ const ScrollView = props => {
9
+ const {
10
+ style
11
+ } = props,
12
+ restProps = _objectWithoutProperties(props, _excluded);
13
13
  return /*#__PURE__*/React.createElement(RemaxScrollView, _extends({
14
14
  style: inlineStyle(style),
15
15
  enhanced: true
16
16
  }, restProps));
17
17
  };
18
-
19
18
  ScrollView.defaultProps = ScrollViewDef.defaultProps;
20
19
  export default ScrollView;
@@ -2,12 +2,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useEventListener } from 'ahooks';
4
4
  import handleProps from '../utils/handleProps';
5
-
6
- var Slider = function (props) {
7
- var currentNode = React.useRef(null);
8
- useEventListener('change', function (e) {
5
+ const Slider = props => {
6
+ const currentNode = React.useRef(null);
7
+ useEventListener('change', e => {
9
8
  var _props$onChange;
10
-
11
9
  (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
12
10
  type: 'change',
13
11
  value: e.detail.value,
@@ -16,9 +14,8 @@ var Slider = function (props) {
16
14
  }, {
17
15
  target: currentNode
18
16
  });
19
- useEventListener('changing', function (e) {
17
+ useEventListener('changing', e => {
20
18
  var _props$onChanging;
21
-
22
19
  (_props$onChanging = props.onChanging) === null || _props$onChanging === void 0 ? void 0 : _props$onChanging.call(props, {
23
20
  type: 'changing',
24
21
  value: e.detail.value,
@@ -35,5 +32,4 @@ var Slider = function (props) {
35
32
  }))
36
33
  );
37
34
  };
38
-
39
35
  export default Slider;
@@ -1,30 +1,30 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["id", "style", "className", "children", "onChange", "onChanging"];
3
+ const _excluded = ["id", "style", "className", "children", "onChange", "onChanging"];
4
4
  import * as React from 'react';
5
5
  import { inlineStyle } from '@ray-js/framework-shared';
6
6
  import { Slider as RemaxSlider } from '@ray-js/adapter';
7
-
8
- var Slider = function (props) {
9
- var id = props.id,
10
- style = props.style,
11
- className = props.className,
12
- children = props.children,
13
- onChange = props.onChange,
14
- onChanging = props.onChanging,
15
- restProps = _objectWithoutProperties(props, _excluded);
16
-
7
+ const Slider = props => {
8
+ const {
9
+ id,
10
+ style,
11
+ className,
12
+ children,
13
+ onChange,
14
+ onChanging
15
+ } = props,
16
+ restProps = _objectWithoutProperties(props, _excluded);
17
17
  return /*#__PURE__*/React.createElement(RemaxSlider, _extends({
18
18
  id: id,
19
19
  style: inlineStyle(style),
20
- onChange: function handleChange(e) {
20
+ onChange: e => {
21
21
  typeof onChange === 'function' && onChange({
22
22
  type: 'change',
23
23
  value: e.detail.value,
24
24
  origin: e
25
25
  });
26
26
  },
27
- onChanging: function handleChanging(e) {
27
+ onChanging: e => {
28
28
  typeof onChanging === 'function' && onChanging({
29
29
  type: 'changing',
30
30
  value: e.detail.value,
@@ -33,5 +33,4 @@ var Slider = function (props) {
33
33
  }
34
34
  }, restProps));
35
35
  };
36
-
37
36
  export default Slider;
@@ -1,31 +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 = ["id", "style", "className", "children", "onChange", "onChanging", "activeColor"];
3
+ const _excluded = ["id", "style", "className", "children", "onChange", "onChanging", "activeColor"];
4
4
  import * as React from 'react';
5
5
  import { inlineStyle } from '@ray-js/framework-shared';
6
6
  import { Slider as RemaxSlider } from '@ray-core/wechat';
7
-
8
- var Slider = function (props) {
9
- var id = props.id,
10
- style = props.style,
11
- className = props.className,
12
- children = props.children,
13
- onChange = props.onChange,
14
- onChanging = props.onChanging,
15
- activeColor = props.activeColor,
16
- restProps = _objectWithoutProperties(props, _excluded);
17
-
7
+ const Slider = props => {
8
+ const {
9
+ id,
10
+ style,
11
+ className,
12
+ children,
13
+ onChange,
14
+ onChanging,
15
+ activeColor
16
+ } = props,
17
+ restProps = _objectWithoutProperties(props, _excluded);
18
18
  return /*#__PURE__*/React.createElement(RemaxSlider, _extends({
19
19
  id: id,
20
20
  style: inlineStyle(style),
21
- onChange: function handleChange(e) {
21
+ onChange: e => {
22
22
  typeof onChange === 'function' && onChange({
23
23
  type: 'change',
24
24
  value: e.detail.value,
25
25
  origin: e
26
26
  });
27
27
  },
28
- onChanging: function handleChanging(e) {
28
+ onChanging: e => {
29
29
  typeof onChanging === 'function' && onChanging({
30
30
  type: 'changing',
31
31
  value: e.detail.value,
@@ -36,5 +36,4 @@ var Slider = function (props) {
36
36
  activeColor: '#007aff' || activeColor
37
37
  }, restProps));
38
38
  };
39
-
40
39
  export default Slider;
@@ -1,4 +1,4 @@
1
- export var sliderDefault = {
1
+ export const sliderDefault = {
2
2
  blockSize: 28,
3
3
  activeColor: '#007AFF',
4
4
  backgroundColor: 'rgba(0, 0, 0, 0.2)',
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { SwiperProps } from './props';
3
- declare function Swiper<I, C extends React.FC>(props: SwiperProps<I>): JSX.Element;
3
+ declare function Swiper<I, C extends React.FC>(props: SwiperProps<I>): React.JSX.Element;
4
4
  declare namespace Swiper {
5
5
  var defaultProps: Partial<SwiperProps<any>>;
6
6
  }
@@ -1,53 +1,45 @@
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", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
5
- import "core-js/modules/es.array.map.js";
3
+ const _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
6
5
  // import clsx from 'clsx';
7
6
  import * as React from 'react';
8
7
  import handleProps from '../utils/handleProps';
9
8
  import { defaultSwiperProps } from './props';
10
9
  import { useEventListener } from 'ahooks';
11
-
12
10
  function Swiper(props) {
13
- var id = props.id,
14
- style = props.style,
15
- className = props.className,
16
- current = props.current,
17
- dataSource = props.dataSource,
18
- onAfterChange = props.onAfterChange,
19
- onChange = props.onChange,
20
- renderItem = props.renderItem,
21
- children = props.children,
22
- restProps = _objectWithoutProperties(props, _excluded);
23
-
24
- var _React$useState = React.useState(current),
25
- _React$useState2 = _slicedToArray(_React$useState, 2),
26
- internalCurrent = _React$useState2[0],
27
- setInternalCurrent = _React$useState2[1];
28
-
29
- var bufferCurrent = React.useRef(current);
30
- var currentNode = React.useRef(null);
31
- React.useEffect(function () {
11
+ const {
12
+ id,
13
+ style,
14
+ className,
15
+ current,
16
+ dataSource,
17
+ onAfterChange,
18
+ onChange,
19
+ renderItem,
20
+ children
21
+ } = props,
22
+ restProps = _objectWithoutProperties(props, _excluded);
23
+ const [internalCurrent, setInternalCurrent] = React.useState(current);
24
+ const bufferCurrent = React.useRef(current);
25
+ const currentNode = React.useRef(null);
26
+ React.useEffect(() => {
32
27
  if (bufferCurrent.current !== current) {
33
28
  setInternalCurrent(current);
34
29
  }
35
30
  }, [current]);
36
-
37
31
  function handleChange(event) {
38
32
  onChange === null || onChange === void 0 ? void 0 : onChange(event === null || event === void 0 ? void 0 : event.detail);
39
33
  }
40
-
41
34
  function handleAfterChange(event) {
42
35
  onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(event === null || event === void 0 ? void 0 : event.detail);
43
36
  }
44
-
45
- useEventListener('change', function (e) {
37
+ useEventListener('change', e => {
46
38
  handleChange(e);
47
39
  }, {
48
40
  target: currentNode
49
41
  });
50
- useEventListener('onanimationend', function (e) {
42
+ useEventListener('onanimationend', e => {
51
43
  handleAfterChange(e);
52
44
  }, {
53
45
  target: currentNode
@@ -57,18 +49,17 @@ function Swiper(props) {
57
49
  // @ts-ignore
58
50
  React.createElement("v-swiper", _extends({
59
51
  ref: currentNode
60
- }, handleProps(restProps)), function renderChildren() {
52
+ }, handleProps(restProps)), (() => {
61
53
  return children;
62
- }() || function renderSwiperItem() {
63
- return dataSource.map(function (item, index) {
54
+ })() || (() => {
55
+ return dataSource.map((item, index) => {
64
56
  // @ts-ignore
65
57
  return /*#__PURE__*/React.createElement("v-swiper-item", {
66
58
  key: index
67
59
  }, renderItem(item, index));
68
60
  });
69
- }())
61
+ })())
70
62
  );
71
63
  }
72
-
73
64
  Swiper.defaultProps = defaultSwiperProps;
74
65
  export default Swiper;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { SwiperProps } from './props';
3
- declare function Swiper<I, C extends React.FC>(props: SwiperProps<I>): JSX.Element;
3
+ declare function Swiper<I, C extends React.FC>(props: SwiperProps<I>): React.JSX.Element;
4
4
  export default Swiper;
@@ -1,34 +1,29 @@
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", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
5
- import "core-js/modules/es.array.map.js";
3
+ const _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
6
5
  import clsx from 'clsx';
7
6
  import * as React from 'react';
8
7
  import { inlineStyle } from '@ray-js/framework-shared';
9
8
  import { Swiper as RemaxSwiper, SwiperItem as RemaxSwiperItem } from '@ray-js/adapter';
10
9
  import { propsAlias } from '../core';
11
10
  import { SwiperPropsAlias } from './props';
12
-
13
11
  function Swiper(props) {
14
- var id = props.id,
15
- style = props.style,
16
- className = props.className,
17
- current = props.current,
18
- dataSource = props.dataSource,
19
- onAfterChange = props.onAfterChange,
20
- onChange = props.onChange,
21
- renderItem = props.renderItem,
22
- children = props.children,
23
- restProps = _objectWithoutProperties(props, _excluded);
24
-
25
- var _React$useState = React.useState(current),
26
- _React$useState2 = _slicedToArray(_React$useState, 2),
27
- internalCurrent = _React$useState2[0],
28
- setInternalCurrent = _React$useState2[1];
29
-
30
- var bufferCurrent = React.useRef(current);
31
- React.useEffect(function () {
12
+ const {
13
+ id,
14
+ style,
15
+ className,
16
+ current,
17
+ dataSource,
18
+ onAfterChange,
19
+ onChange,
20
+ renderItem,
21
+ children
22
+ } = props,
23
+ restProps = _objectWithoutProperties(props, _excluded);
24
+ const [internalCurrent, setInternalCurrent] = React.useState(current);
25
+ const bufferCurrent = React.useRef(current);
26
+ React.useEffect(() => {
32
27
  if (bufferCurrent.current !== current) {
33
28
  setInternalCurrent(current);
34
29
  bufferCurrent.current = current;
@@ -48,12 +43,11 @@ function Swiper(props) {
48
43
  }, propsAlias(restProps, SwiperPropsAlias)), function () {
49
44
  return children;
50
45
  }() || function () {
51
- return dataSource.map(function (item, index) {
46
+ return dataSource.map((item, index) => {
52
47
  return /*#__PURE__*/React.createElement(RemaxSwiperItem, {
53
48
  key: index
54
49
  }, renderItem(item, index));
55
50
  });
56
51
  }());
57
52
  }
58
-
59
53
  export default Swiper;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { SwiperProps } from './props';
3
- declare function Swiper<I, C extends React.FC>(props: SwiperProps<I>): JSX.Element;
3
+ declare function Swiper<I, C extends React.FC>(props: SwiperProps<I>): React.JSX.Element;
4
4
  declare namespace Swiper {
5
5
  var defaultProps: Partial<SwiperProps<any>>;
6
6
  }