@ray-js/components 1.5.0-beta.12 → 1.5.0

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 (64) hide show
  1. package/lib/Button/Button.thing.js +1 -1
  2. package/lib/Button/Button.wechat.js +1 -1
  3. package/lib/Camera/Camera.js +1 -1
  4. package/lib/Camera/Camera.wechat.js +1 -1
  5. package/lib/CheckboxGroup/CheckboxGroup.js +3 -2
  6. package/lib/CheckboxGroup/props.d.ts +5 -2
  7. package/lib/CoverView/CoverView.js +1 -1
  8. package/lib/CoverView/CoverView.wechat.js +1 -1
  9. package/lib/Form/Form.wechat.js +1 -0
  10. package/lib/Icon/Icon.js +5 -4
  11. package/lib/Icon/Icon.thing.js +5 -4
  12. package/lib/Icon/Icon.wechat.js +5 -4
  13. package/lib/Icon/iconfont/iconfont.css +3 -3
  14. package/lib/Icon/iconfont/iconfont.json +1 -1
  15. package/lib/Iframe/Iframe.js +1 -1
  16. package/lib/Image/Image.js +2 -2
  17. package/lib/Image/Image.wechat.js +2 -1
  18. package/lib/Input/Input.js +10 -8
  19. package/lib/Input/Input.thing.js +3 -2
  20. package/lib/Input/Input.wechat.js +9 -7
  21. package/lib/Input/props.d.ts +13 -47
  22. package/lib/IpcPlayer/IpcPlayer.js +1 -1
  23. package/lib/IpcPlayer/IpcPlayer.wechat.js +1 -1
  24. package/lib/Map/Map.js +1 -1
  25. package/lib/MovableView/MovableView.js +2 -2
  26. package/lib/NativeVideo/NativeVideo.js +1 -1
  27. package/lib/NativeVideo/NativeVideo.wechat.js +1 -1
  28. package/lib/PageContainer/PageContainer.js +15 -14
  29. package/lib/PageContainer/props.d.ts +4 -6
  30. package/lib/Picker/Picker.js +6 -4
  31. package/lib/Picker/Picker.thing.js +8 -6
  32. package/lib/Picker/Picker.wechat.js +8 -6
  33. package/lib/PickerView/PickerView.js +3 -2
  34. package/lib/PickerView/PickerView.thing.js +7 -6
  35. package/lib/PickerView/PickerView.wechat.js +7 -6
  36. package/lib/RadioGroup/RadioGroup.js +3 -2
  37. package/lib/RadioGroup/props.d.ts +4 -14
  38. package/lib/ScrollView/ScrollView.js +3 -3
  39. package/lib/Slider/Slider.js +5 -4
  40. package/lib/Slider/Slider.thing.js +5 -4
  41. package/lib/Slider/Slider.wechat.js +5 -4
  42. package/lib/Slider/props.d.ts +7 -30
  43. package/lib/Swiper/Swiper.js +4 -2
  44. package/lib/Swiper/Swiper.thing.js +3 -2
  45. package/lib/Swiper/Swiper.wechat.js +3 -2
  46. package/lib/Swiper/props.d.ts +3 -0
  47. package/lib/Switch/Switch.js +1 -1
  48. package/lib/Switch/Switch.thing.js +3 -2
  49. package/lib/Switch/Switch.wechat.js +3 -2
  50. package/lib/Switch/props.d.ts +4 -15
  51. package/lib/Text/Text.wechat.js +1 -0
  52. package/lib/Textarea/Textarea.js +7 -6
  53. package/lib/Textarea/Textarea.thing.js +1 -1
  54. package/lib/Textarea/Textarea.wechat.js +1 -1
  55. package/lib/Textarea/props.d.ts +10 -3
  56. package/lib/Video/Video.js +1 -1
  57. package/lib/Video/Video.wechat.js +1 -1
  58. package/lib/View/View.js +1 -0
  59. package/lib/View/View.thing.js +1 -0
  60. package/lib/View/View.wechat.js +1 -0
  61. package/lib/WebView/WebView.js +1 -1
  62. package/lib/core/index.js +1 -1
  63. package/lib/utils/handleProps.js +2 -1
  64. package/package.json +9 -9
@@ -1,4 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import "core-js/modules/web.dom-collections.iterator.js";
2
4
  import * as React from 'react';
3
5
  import { useTouch } from '@ray-js/framework-shared';
4
6
  import { useEventListener } from 'ahooks';
@@ -16,20 +18,20 @@ const Picker = props => {
16
18
  const currentNode = React.useRef(null);
17
19
  useEventListener('change', e => {
18
20
  var _props$onChange;
19
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
21
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, _objectSpread(_objectSpread({}, e), {}, {
20
22
  type: 'change',
21
23
  value: e.detail.value,
22
24
  origin: e
23
- });
25
+ }));
24
26
  }, {
25
27
  target: currentNode
26
28
  });
27
29
  useEventListener('cancel', e => {
28
30
  var _props$onCancel;
29
- (_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 ? void 0 : _props$onCancel.call(props, {
31
+ (_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 || _props$onCancel.call(props, _objectSpread(_objectSpread({}, e), {}, {
30
32
  type: 'cancel',
31
33
  origin: e
32
- });
34
+ }));
33
35
  }, {
34
36
  target: currentNode
35
37
  });
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["className", "style", "id", "onChange", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
5
+ import "core-js/modules/web.dom-collections.iterator.js";
4
6
  import clsx from 'clsx';
5
7
  import * as React from 'react';
6
8
  import { inlineStyle, useTouch } from '@ray-js/framework-shared';
@@ -28,24 +30,24 @@ const Picker = props => {
28
30
  });
29
31
  return /*#__PURE__*/React.createElement(RemaxPicker, _extends({
30
32
  onChange: e => {
31
- onChange === null || onChange === void 0 ? void 0 : onChange({
33
+ onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
32
34
  type: e.type,
33
35
  value: e.detail.value,
34
36
  origin: e
35
- });
37
+ }));
36
38
  },
37
39
  onCancel: e => {
38
- onCancel === null || onCancel === void 0 ? void 0 : onCancel({
40
+ onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
39
41
  type: e.type,
40
42
  origin: e
41
- });
43
+ }));
42
44
  },
43
45
  onColumnChange: e => {
44
- onCancel === null || onCancel === void 0 ? void 0 : onCancel({
46
+ onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
45
47
  type: e.type,
46
48
  value: e.detail.value,
47
49
  origin: e
48
- });
50
+ }));
49
51
  },
50
52
  style: inlineStyle(style),
51
53
  className: clsx(className)
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["className", "style", "id", "onChange", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
5
+ import "core-js/modules/web.dom-collections.iterator.js";
4
6
  import clsx from 'clsx';
5
7
  import * as React from 'react';
6
8
  import { inlineStyle, useTouch } from '@ray-js/framework-shared';
@@ -28,24 +30,24 @@ const Picker = props => {
28
30
  });
29
31
  return /*#__PURE__*/React.createElement(RemaxPicker, _extends({
30
32
  onChange: e => {
31
- onChange === null || onChange === void 0 ? void 0 : onChange({
33
+ onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
32
34
  type: e.type,
33
35
  value: e.detail.value,
34
36
  origin: e
35
- });
37
+ }));
36
38
  },
37
39
  onCancel: e => {
38
- onCancel === null || onCancel === void 0 ? void 0 : onCancel({
40
+ onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
39
41
  type: e.type,
40
42
  origin: e
41
- });
43
+ }));
42
44
  },
43
45
  onColumnChange: e => {
44
- onCancel === null || onCancel === void 0 ? void 0 : onCancel({
46
+ onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
45
47
  type: e.type,
46
48
  value: e.detail.value,
47
49
  origin: e
48
- });
50
+ }));
49
51
  },
50
52
  style: inlineStyle(style),
51
53
  className: clsx(className)
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import * as React from 'react';
3
4
  import clsx from 'clsx';
4
5
  import { useEventListener } from 'ahooks';
@@ -14,12 +15,12 @@ const PickerView = props => {
14
15
  const currentNode = React.useRef(null);
15
16
  useEventListener('change', e => {
16
17
  var _props$onChange;
17
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
18
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, _objectSpread(_objectSpread({}, e), {}, {
18
19
  type: 'change',
19
20
  // @ts-ignore
20
21
  value: e.detail.value,
21
22
  origin: e
22
- });
23
+ }));
23
24
  }, {
24
25
  target: currentNode
25
26
  });
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["className", "style", "id", "onChange", "onPickstart", "onPickend", "children"];
4
5
  import clsx from 'clsx';
@@ -19,25 +20,25 @@ const Picker = props => {
19
20
  restProps = _objectWithoutProperties(props, _excluded);
20
21
  return /*#__PURE__*/React.createElement(RemaxPickerView, _extends({
21
22
  onChange: e => {
22
- onChange === null || onChange === void 0 ? void 0 : onChange({
23
+ onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
23
24
  type: 'change',
24
25
  value: e.detail.value,
25
26
  origin: e
26
- });
27
+ }));
27
28
  },
28
29
  onPickstart: e => {
29
- onPickstart === null || onPickstart === void 0 ? void 0 : onPickstart({
30
+ onPickstart === null || onPickstart === void 0 || onPickstart(_objectSpread(_objectSpread({}, e), {}, {
30
31
  type: 'pickstart',
31
32
  value: e.detail.value,
32
33
  origin: e
33
- });
34
+ }));
34
35
  },
35
36
  onPickend: e => {
36
- onPickend === null || onPickend === void 0 ? void 0 : onPickend({
37
+ onPickend === null || onPickend === void 0 || onPickend(_objectSpread(_objectSpread({}, e), {}, {
37
38
  type: 'pickend',
38
39
  value: e.detail.value,
39
40
  origin: e
40
- });
41
+ }));
41
42
  },
42
43
  style: inlineStyle(style),
43
44
  className: clsx(styles.pickerViewWrp, className)
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["className", "style", "id", "onChange", "onPickstart", "onPickend", "children"];
4
5
  import clsx from 'clsx';
@@ -19,25 +20,25 @@ const Picker = props => {
19
20
  restProps = _objectWithoutProperties(props, _excluded);
20
21
  return /*#__PURE__*/React.createElement(RemaxPickerView, _extends({
21
22
  onChange: e => {
22
- onChange === null || onChange === void 0 ? void 0 : onChange({
23
+ onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
23
24
  type: 'change',
24
25
  value: e.detail.value,
25
26
  origin: e
26
- });
27
+ }));
27
28
  },
28
29
  onPickstart: e => {
29
- onPickstart === null || onPickstart === void 0 ? void 0 : onPickstart({
30
+ onPickstart === null || onPickstart === void 0 || onPickstart(_objectSpread(_objectSpread({}, e), {}, {
30
31
  type: 'pickstart',
31
32
  value: e.detail.value,
32
33
  origin: e
33
- });
34
+ }));
34
35
  },
35
36
  onPickend: e => {
36
- onPickend === null || onPickend === void 0 ? void 0 : onPickend({
37
+ onPickend === null || onPickend === void 0 || onPickend(_objectSpread(_objectSpread({}, e), {}, {
37
38
  type: 'pickend',
38
39
  value: e.detail.value,
39
40
  origin: e
40
- });
41
+ }));
41
42
  },
42
43
  style: inlineStyle(style),
43
44
  className: clsx(styles.pickerViewWrp, className)
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import * as React from 'react';
3
4
  import { useEventListener } from 'ahooks';
4
5
  import handleProps from '../utils/handleProps';
@@ -11,10 +12,10 @@ const RadioGroup = props => {
11
12
  const currentNode = React.useRef(null);
12
13
  useEventListener('change', e => {
13
14
  var _props$onChange;
14
- !disabled && ((_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
15
+ !disabled && ((_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, _objectSpread(_objectSpread({}, e), {}, {
15
16
  type: 'change',
16
17
  value: e.detail.value
17
- }));
18
+ })));
18
19
  }, {
19
20
  target: currentNode
20
21
  });
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseProps } from '../types';
3
3
  import { RadioProps } from '../Radio/props';
4
+ import { GenericEvent } from '@ray-js/adapter';
4
5
  export type RadioGroupOption = RadioProps & {
5
6
  label: string;
6
7
  };
@@ -31,18 +32,7 @@ export interface BaseRadioGroupProps extends Omit<BaseProps, 'children'> {
31
32
  * @description.zh 选中项发生改变时触发 change 事件
32
33
  * @default undefined
33
34
  */
34
- onChange?: (event: {
35
- /**
36
- * @description.en type
37
- * @description.zh 类型
38
- * @default undefined
39
- */
40
- type: 'change';
41
- /**
42
- * @description.en value
43
- * @description.zh 价值
44
- * @default undefined
45
- */
46
- value: string[];
47
- }) => void;
35
+ onChange?: (event: GenericEvent<{
36
+ value: any;
37
+ }>) => void;
48
38
  }
@@ -15,7 +15,7 @@ const ScrollView = props => {
15
15
  restProps = _objectWithoutProperties(props, _excluded);
16
16
  const currentNode = React.useRef(null);
17
17
  useEventListener('scroll', e => {
18
- onScroll === null || onScroll === void 0 ? void 0 : onScroll(_objectSpread(_objectSpread({
18
+ onScroll === null || onScroll === void 0 || onScroll(_objectSpread(_objectSpread(_objectSpread({}, e), {}, {
19
19
  type: 'scroll'
20
20
  }, e.detail), {}, {
21
21
  origin: e
@@ -24,7 +24,7 @@ const ScrollView = props => {
24
24
  target: currentNode
25
25
  });
26
26
  useEventListener('scrolltoupper', e => {
27
- onScrollToUpper === null || onScrollToUpper === void 0 ? void 0 : onScrollToUpper(_objectSpread(_objectSpread({
27
+ onScrollToUpper === null || onScrollToUpper === void 0 || onScrollToUpper(_objectSpread(_objectSpread(_objectSpread({}, e), {}, {
28
28
  type: 'scrolltoupper'
29
29
  }, e.detail), {}, {
30
30
  origin: e
@@ -33,7 +33,7 @@ const ScrollView = props => {
33
33
  target: currentNode
34
34
  });
35
35
  useEventListener('scrolltolower', e => {
36
- onScrollToLower === null || onScrollToLower === void 0 ? void 0 : onScrollToLower(_objectSpread(_objectSpread({
36
+ onScrollToLower === null || onScrollToLower === void 0 || onScrollToLower(_objectSpread(_objectSpread(_objectSpread({}, e), {}, {
37
37
  type: 'scrolltolower'
38
38
  }, e.detail), {}, {
39
39
  origin: e
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import * as React from 'react';
3
4
  import { useEventListener } from 'ahooks';
4
5
  import handleProps from '../utils/handleProps';
@@ -6,21 +7,21 @@ const Slider = props => {
6
7
  const currentNode = React.useRef(null);
7
8
  useEventListener('change', e => {
8
9
  var _props$onChange;
9
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
10
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, _objectSpread(_objectSpread({}, e), {}, {
10
11
  type: 'change',
11
12
  value: e.detail.value,
12
13
  origin: e
13
- });
14
+ }));
14
15
  }, {
15
16
  target: currentNode
16
17
  });
17
18
  useEventListener('changing', e => {
18
19
  var _props$onChanging;
19
- (_props$onChanging = props.onChanging) === null || _props$onChanging === void 0 ? void 0 : _props$onChanging.call(props, {
20
+ (_props$onChanging = props.onChanging) === null || _props$onChanging === void 0 || _props$onChanging.call(props, _objectSpread(_objectSpread({}, e), {}, {
20
21
  type: 'changing',
21
22
  value: e.detail.value,
22
23
  origin: e
23
- });
24
+ }));
24
25
  }, {
25
26
  target: currentNode
26
27
  });
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["id", "style", "className", "children", "onChange", "onChanging"];
4
5
  import * as React from 'react';
@@ -18,18 +19,18 @@ const Slider = props => {
18
19
  id: id,
19
20
  style: inlineStyle(style),
20
21
  onChange: e => {
21
- typeof onChange === 'function' && onChange({
22
+ typeof onChange === 'function' && onChange(_objectSpread(_objectSpread({}, e), {}, {
22
23
  type: 'change',
23
24
  value: e.detail.value,
24
25
  origin: e
25
- });
26
+ }));
26
27
  },
27
28
  onChanging: e => {
28
- typeof onChanging === 'function' && onChanging({
29
+ typeof onChanging === 'function' && onChanging(_objectSpread(_objectSpread({}, e), {}, {
29
30
  type: 'changing',
30
31
  value: e.detail.value,
31
32
  origin: e
32
- });
33
+ }));
33
34
  }
34
35
  }, restProps));
35
36
  };
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["id", "style", "className", "children", "onChange", "onChanging", "activeColor"];
4
5
  import * as React from 'react';
@@ -19,18 +20,18 @@ const Slider = props => {
19
20
  id: id,
20
21
  style: inlineStyle(style),
21
22
  onChange: e => {
22
- typeof onChange === 'function' && onChange({
23
+ typeof onChange === 'function' && onChange(_objectSpread(_objectSpread({}, e), {}, {
23
24
  type: 'change',
24
25
  value: e.detail.value,
25
26
  origin: e
26
- });
27
+ }));
27
28
  },
28
29
  onChanging: e => {
29
- typeof onChanging === 'function' && onChanging({
30
+ typeof onChanging === 'function' && onChanging(_objectSpread(_objectSpread({}, e), {}, {
30
31
  type: 'changing',
31
32
  value: e.detail.value,
32
33
  origin: e
33
- });
34
+ }));
34
35
  },
35
36
  step: 2,
36
37
  activeColor: '#007aff' || activeColor
@@ -1,3 +1,4 @@
1
+ import { GenericEvent } from '@ray-js/adapter';
1
2
  import { BaseProps } from '../types';
2
3
  export interface SliderProps extends BaseProps {
3
4
  /**
@@ -65,41 +66,17 @@ export interface SliderProps extends BaseProps {
65
66
  * @description.zh 完成一次拖动后触发的事件,event.detail = {value}
66
67
  * @default undefined
67
68
  */
68
- onChange?: (event: {
69
- /**
70
- * @description.en type
71
- * @description.zh 类型
72
- * @default undefined
73
- */
74
- type: string;
75
- /**
76
- * @description.en value
77
- * @description.zh value
78
- * @default undefined
79
- */
80
- value: number;
81
- origin: any;
82
- }) => void;
69
+ onChange?: (event: GenericEvent<{
70
+ value: any;
71
+ }>) => void;
83
72
  /**
84
73
  * @description.en onChanging
85
74
  * @description.zh 拖动过程中触发的事件,event.detail = {value}
86
75
  * @default undefined
87
76
  */
88
- onChanging?: (event: {
89
- /**
90
- * @description.en type
91
- * @description.zh 类型
92
- * @default undefined
93
- */
94
- type: string;
95
- /**
96
- * @description.en value
97
- * @description.zh 价值
98
- * @default undefined
99
- */
100
- value: number;
101
- origin: any;
102
- }) => void;
77
+ onChanging?: (event: GenericEvent<{
78
+ value: any;
79
+ }>) => void;
103
80
  }
104
81
  export declare const sliderDefault: {
105
82
  blockSize: number;
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
5
+ import "core-js/modules/web.dom-collections.iterator.js";
4
6
  // import clsx from 'clsx';
5
7
  import * as React from 'react';
6
8
  import handleProps from '../utils/handleProps';
@@ -28,10 +30,10 @@ function Swiper(props) {
28
30
  }
29
31
  }, [current]);
30
32
  function handleChange(event) {
31
- onChange === null || onChange === void 0 ? void 0 : onChange(event === null || event === void 0 ? void 0 : event.detail);
33
+ onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.detail), event));
32
34
  }
33
35
  function handleAfterChange(event) {
34
- onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(event === null || event === void 0 ? void 0 : event.detail);
36
+ onAfterChange === null || onAfterChange === void 0 || onAfterChange(_objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.detail), event));
35
37
  }
36
38
  useEventListener('change', e => {
37
39
  handleChange(e);
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
4
5
  import clsx from 'clsx';
5
6
  import * as React from 'react';
6
7
  import { inlineStyle } from '@ray-js/framework-shared';
@@ -33,10 +34,10 @@ function Swiper(props) {
33
34
  style: inlineStyle(style),
34
35
  className: clsx('ray-swiper', className),
35
36
  onChange: function (event) {
36
- onChange === null || onChange === void 0 ? void 0 : onChange(event);
37
+ onChange === null || onChange === void 0 || onChange(event);
37
38
  },
38
39
  onAnimationFinish: function (event) {
39
- onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(event);
40
+ onAfterChange === null || onAfterChange === void 0 || onAfterChange(event);
40
41
  },
41
42
  current: internalCurrent
42
43
  }, propsAlias(restProps, SwiperPropsAlias)), function () {
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
4
5
  import clsx from 'clsx';
5
6
  import * as React from 'react';
6
7
  import { inlineStyle } from '@ray-js/framework-shared';
@@ -33,10 +34,10 @@ function Swiper(props) {
33
34
  style: inlineStyle(style),
34
35
  className: clsx('ray-swiper', className),
35
36
  onChange: function (event) {
36
- onChange === null || onChange === void 0 ? void 0 : onChange(event);
37
+ onChange === null || onChange === void 0 || onChange(event);
37
38
  },
38
39
  onAnimationFinish: function (event) {
39
- onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(event);
40
+ onAfterChange === null || onAfterChange === void 0 || onAfterChange(event);
40
41
  },
41
42
  current: internalCurrent
42
43
  }, propsAlias(restProps, SwiperPropsAlias)), function () {
@@ -63,6 +63,9 @@ export type SwiperProps<I> = BaseProps & {
63
63
  current: number;
64
64
  source: '' | 'autoplay' | 'touch';
65
65
  origin?: WxEvent;
66
+ detail: {
67
+ value: any;
68
+ };
66
69
  }) => void;
67
70
  /** swiper-item 的位置发生改变时会触发 transition 事件,event.detail = {dx: dx, dy: dy} 2.4.3 */
68
71
  /** 动画结束时会触发 onAfterChange 事件 */
@@ -7,7 +7,7 @@ const Switch = props => {
7
7
  const currentNode = React.useRef(null);
8
8
  useEventListener('change', e => {
9
9
  var _props$onChange;
10
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, _objectSpread(_objectSpread({
10
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, _objectSpread(_objectSpread(_objectSpread({}, e), {}, {
11
11
  type: 'change'
12
12
  }, e.detail), {}, {
13
13
  origin: e
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["className", "style", "id", "onChange", "type", "color"];
4
5
  import clsx from 'clsx';
@@ -18,11 +19,11 @@ const Switch = props => {
18
19
  return /*#__PURE__*/React.createElement(RemaxSwitch, _extends({
19
20
  id: id,
20
21
  onChange: e => {
21
- onChange === null || onChange === void 0 ? void 0 : onChange({
22
+ onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
22
23
  type: 'change',
23
24
  value: e.detail.value,
24
25
  origin: e
25
- });
26
+ }));
26
27
  },
27
28
  style: inlineStyle(style),
28
29
  className: clsx(className),
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["className", "style", "id", "onChange", "type", "color"];
4
5
  import clsx from 'clsx';
@@ -19,11 +20,11 @@ const Switch = props => {
19
20
  return /*#__PURE__*/React.createElement(RemaxSwitch, _extends({
20
21
  id: id,
21
22
  onChange: e => {
22
- onChange === null || onChange === void 0 ? void 0 : onChange({
23
+ onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
23
24
  type: 'change',
24
25
  value: e.detail.value,
25
26
  origin: e
26
- });
27
+ }));
27
28
  },
28
29
  style: inlineStyle(style),
29
30
  className: clsx('raySwitch', className),
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { GenericEvent } from '@ray-js/adapter';
2
3
  import { BaseProps } from '../types';
3
4
  export interface SwitchProps extends BaseProps {
4
5
  /**
@@ -6,21 +7,9 @@ export interface SwitchProps extends BaseProps {
6
7
  * @description.zh checked 改变时触发 change 事件,event.detail={ value}
7
8
  * @default undefined
8
9
  */
9
- onChange?: (event: {
10
- /**
11
- * @description.en type
12
- * @description.zh 类型
13
- * @default undefined
14
- */
15
- type: 'change';
16
- /**
17
- * @description.en value
18
- * @description.zh 价值
19
- * @default undefined
20
- */
21
- value: boolean;
22
- origin: any;
23
- }) => void;
10
+ onChange?: (event: GenericEvent<{
11
+ value: any;
12
+ }>) => void;
24
13
  /**
25
14
  * @description.en checked
26
15
  * @description.zh 当前是否选中
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
4
5
  import * as React from 'react';
5
6
  import { Text as RemaxText } from '@ray-core/wechat';
6
7
  import { useTouch } from '@ray-js/framework-shared';
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  const _excluded = ["className", "onInput", "onFocus", "onBlur"];
4
5
  import * as React from 'react';
@@ -16,29 +17,29 @@ const Textarea = props => {
16
17
  restProps = _objectWithoutProperties(props, _excluded);
17
18
  const currentNode = React.useRef(null);
18
19
  useEventListener('input', e => {
19
- onInput === null || onInput === void 0 ? void 0 : onInput({
20
+ onInput === null || onInput === void 0 || onInput(_objectSpread(_objectSpread({}, e), {}, {
20
21
  type: 'input',
21
22
  value: e.detail.value,
22
23
  origin: e
23
- });
24
+ }));
24
25
  }, {
25
26
  target: currentNode
26
27
  });
27
28
  useEventListener('focus', e => {
28
- onFocus === null || onFocus === void 0 ? void 0 : onFocus({
29
+ onFocus === null || onFocus === void 0 || onFocus(_objectSpread(_objectSpread({}, e), {}, {
29
30
  type: 'focus',
30
31
  value: e.detail.value,
31
32
  origin: e
32
- });
33
+ }));
33
34
  }, {
34
35
  target: currentNode
35
36
  });
36
37
  useEventListener('blur', e => {
37
- onBlur === null || onBlur === void 0 ? void 0 : onBlur({
38
+ onBlur === null || onBlur === void 0 || onBlur(_objectSpread(_objectSpread({}, e), {}, {
38
39
  type: 'blur',
39
40
  value: e.detail.value,
40
41
  origin: e
41
- });
42
+ }));
42
43
  }, {
43
44
  target: currentNode
44
45
  });