@ray-js/components 1.5.0-beta.11 → 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.
- package/lib/Button/Button.thing.js +1 -1
- package/lib/Button/Button.wechat.js +1 -1
- package/lib/Camera/Camera.d.ts +2 -1
- package/lib/Camera/Camera.js +1 -3
- package/lib/Camera/Camera.wechat.js +1 -1
- package/lib/CheckboxGroup/CheckboxGroup.js +3 -2
- package/lib/CheckboxGroup/props.d.ts +5 -2
- package/lib/CoverView/CoverView.js +1 -1
- package/lib/CoverView/CoverView.wechat.js +1 -1
- package/lib/Icon/Icon.js +3 -2
- package/lib/Icon/Icon.thing.js +3 -2
- package/lib/Icon/Icon.wechat.js +3 -2
- package/lib/Icon/iconfont/iconfont.css +3 -3
- package/lib/Icon/iconfont/iconfont.json +1 -1
- package/lib/Iframe/Iframe.js +1 -1
- package/lib/Image/Image.js +2 -2
- package/lib/Image/Image.wechat.js +1 -1
- package/lib/Input/Input.js +9 -8
- package/lib/Input/Input.thing.js +2 -2
- package/lib/Input/Input.wechat.js +8 -7
- package/lib/Input/props.d.ts +13 -47
- package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.js +1 -3
- package/lib/IpcPlayer/IpcPlayer.wechat.js +1 -1
- package/lib/Map/Map.js +1 -1
- package/lib/MovableView/MovableView.js +2 -2
- package/lib/NativeVideo/NativeVideo.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.js +1 -3
- package/lib/NativeVideo/NativeVideo.wechat.js +1 -1
- package/lib/PageContainer/PageContainer.js +15 -14
- package/lib/PageContainer/props.d.ts +4 -6
- package/lib/Picker/Picker.js +5 -4
- package/lib/Picker/Picker.thing.js +7 -6
- package/lib/Picker/Picker.wechat.js +7 -6
- package/lib/PickerView/PickerView.js +3 -2
- package/lib/PickerView/PickerView.thing.js +7 -6
- package/lib/PickerView/PickerView.wechat.js +7 -6
- package/lib/RadioGroup/RadioGroup.js +3 -2
- package/lib/RadioGroup/props.d.ts +4 -14
- package/lib/ScrollView/ScrollView.js +3 -3
- package/lib/Slider/Slider.js +5 -4
- package/lib/Slider/Slider.thing.js +5 -4
- package/lib/Slider/Slider.wechat.js +5 -4
- package/lib/Slider/props.d.ts +7 -30
- package/lib/Swiper/Swiper.js +3 -2
- package/lib/Swiper/Swiper.thing.js +2 -2
- package/lib/Swiper/Swiper.wechat.js +2 -2
- package/lib/Swiper/props.d.ts +3 -0
- package/lib/Switch/Switch.js +1 -1
- package/lib/Switch/Switch.thing.js +3 -2
- package/lib/Switch/Switch.wechat.js +3 -2
- package/lib/Switch/props.d.ts +4 -15
- package/lib/Textarea/Textarea.js +7 -6
- package/lib/Textarea/Textarea.thing.js +1 -1
- package/lib/Textarea/Textarea.wechat.js +1 -1
- package/lib/Textarea/props.d.ts +10 -3
- package/lib/Video/Video.js +1 -1
- package/lib/Video/Video.wechat.js +1 -1
- package/lib/WebView/WebView.js +1 -1
- package/package.json +9 -9
package/lib/Picker/Picker.js
CHANGED
@@ -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 "core-js/modules/web.dom-collections.iterator.js";
|
3
4
|
import * as React from 'react';
|
4
5
|
import { useTouch } from '@ray-js/framework-shared';
|
@@ -17,20 +18,20 @@ const Picker = props => {
|
|
17
18
|
const currentNode = React.useRef(null);
|
18
19
|
useEventListener('change', e => {
|
19
20
|
var _props$onChange;
|
20
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0
|
21
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, _objectSpread(_objectSpread({}, e), {}, {
|
21
22
|
type: 'change',
|
22
23
|
value: e.detail.value,
|
23
24
|
origin: e
|
24
|
-
});
|
25
|
+
}));
|
25
26
|
}, {
|
26
27
|
target: currentNode
|
27
28
|
});
|
28
29
|
useEventListener('cancel', e => {
|
29
30
|
var _props$onCancel;
|
30
|
-
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0
|
31
|
+
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 || _props$onCancel.call(props, _objectSpread(_objectSpread({}, e), {}, {
|
31
32
|
type: 'cancel',
|
32
33
|
origin: e
|
33
|
-
});
|
34
|
+
}));
|
34
35
|
}, {
|
35
36
|
target: currentNode
|
36
37
|
});
|
@@ -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", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
|
4
5
|
import "core-js/modules/web.dom-collections.iterator.js";
|
@@ -29,24 +30,24 @@ const Picker = props => {
|
|
29
30
|
});
|
30
31
|
return /*#__PURE__*/React.createElement(RemaxPicker, _extends({
|
31
32
|
onChange: e => {
|
32
|
-
onChange === null || onChange === void 0
|
33
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
|
33
34
|
type: e.type,
|
34
35
|
value: e.detail.value,
|
35
36
|
origin: e
|
36
|
-
});
|
37
|
+
}));
|
37
38
|
},
|
38
39
|
onCancel: e => {
|
39
|
-
onCancel === null || onCancel === void 0
|
40
|
+
onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
|
40
41
|
type: e.type,
|
41
42
|
origin: e
|
42
|
-
});
|
43
|
+
}));
|
43
44
|
},
|
44
45
|
onColumnChange: e => {
|
45
|
-
onCancel === null || onCancel === void 0
|
46
|
+
onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
|
46
47
|
type: e.type,
|
47
48
|
value: e.detail.value,
|
48
49
|
origin: e
|
49
|
-
});
|
50
|
+
}));
|
50
51
|
},
|
51
52
|
style: inlineStyle(style),
|
52
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 _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
4
|
const _excluded = ["className", "style", "id", "onChange", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
|
4
5
|
import "core-js/modules/web.dom-collections.iterator.js";
|
@@ -29,24 +30,24 @@ const Picker = props => {
|
|
29
30
|
});
|
30
31
|
return /*#__PURE__*/React.createElement(RemaxPicker, _extends({
|
31
32
|
onChange: e => {
|
32
|
-
onChange === null || onChange === void 0
|
33
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, e), {}, {
|
33
34
|
type: e.type,
|
34
35
|
value: e.detail.value,
|
35
36
|
origin: e
|
36
|
-
});
|
37
|
+
}));
|
37
38
|
},
|
38
39
|
onCancel: e => {
|
39
|
-
onCancel === null || onCancel === void 0
|
40
|
+
onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
|
40
41
|
type: e.type,
|
41
42
|
origin: e
|
42
|
-
});
|
43
|
+
}));
|
43
44
|
},
|
44
45
|
onColumnChange: e => {
|
45
|
-
onCancel === null || onCancel === void 0
|
46
|
+
onCancel === null || onCancel === void 0 || onCancel(_objectSpread(_objectSpread({}, e), {}, {
|
46
47
|
type: e.type,
|
47
48
|
value: e.detail.value,
|
48
49
|
origin: e
|
49
|
-
});
|
50
|
+
}));
|
50
51
|
},
|
51
52
|
style: inlineStyle(style),
|
52
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
|
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
|
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
|
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
|
36
|
+
onScrollToLower === null || onScrollToLower === void 0 || onScrollToLower(_objectSpread(_objectSpread(_objectSpread({}, e), {}, {
|
37
37
|
type: 'scrolltolower'
|
38
38
|
}, e.detail), {}, {
|
39
39
|
origin: e
|
package/lib/Slider/Slider.js
CHANGED
@@ -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
|
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
|
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
|
package/lib/Slider/props.d.ts
CHANGED
@@ -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
|
-
|
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
|
-
|
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;
|
package/lib/Swiper/Swiper.js
CHANGED
@@ -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", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
|
4
5
|
import "core-js/modules/web.dom-collections.iterator.js";
|
@@ -29,10 +30,10 @@ function Swiper(props) {
|
|
29
30
|
}
|
30
31
|
}, [current]);
|
31
32
|
function handleChange(event) {
|
32
|
-
onChange === null || onChange === void 0
|
33
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.detail), event));
|
33
34
|
}
|
34
35
|
function handleAfterChange(event) {
|
35
|
-
onAfterChange === null || onAfterChange === void 0
|
36
|
+
onAfterChange === null || onAfterChange === void 0 || onAfterChange(_objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.detail), event));
|
36
37
|
}
|
37
38
|
useEventListener('change', e => {
|
38
39
|
handleChange(e);
|
@@ -34,10 +34,10 @@ function Swiper(props) {
|
|
34
34
|
style: inlineStyle(style),
|
35
35
|
className: clsx('ray-swiper', className),
|
36
36
|
onChange: function (event) {
|
37
|
-
onChange === null || onChange === void 0
|
37
|
+
onChange === null || onChange === void 0 || onChange(event);
|
38
38
|
},
|
39
39
|
onAnimationFinish: function (event) {
|
40
|
-
onAfterChange === null || onAfterChange === void 0
|
40
|
+
onAfterChange === null || onAfterChange === void 0 || onAfterChange(event);
|
41
41
|
},
|
42
42
|
current: internalCurrent
|
43
43
|
}, propsAlias(restProps, SwiperPropsAlias)), function () {
|
@@ -34,10 +34,10 @@ function Swiper(props) {
|
|
34
34
|
style: inlineStyle(style),
|
35
35
|
className: clsx('ray-swiper', className),
|
36
36
|
onChange: function (event) {
|
37
|
-
onChange === null || onChange === void 0
|
37
|
+
onChange === null || onChange === void 0 || onChange(event);
|
38
38
|
},
|
39
39
|
onAnimationFinish: function (event) {
|
40
|
-
onAfterChange === null || onAfterChange === void 0
|
40
|
+
onAfterChange === null || onAfterChange === void 0 || onAfterChange(event);
|
41
41
|
},
|
42
42
|
current: internalCurrent
|
43
43
|
}, propsAlias(restProps, SwiperPropsAlias)), function () {
|
package/lib/Swiper/props.d.ts
CHANGED
@@ -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 事件 */
|
package/lib/Switch/Switch.js
CHANGED
@@ -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
|
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
|
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
|
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),
|
package/lib/Switch/props.d.ts
CHANGED
@@ -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
|
-
|
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 当前是否选中
|
package/lib/Textarea/Textarea.js
CHANGED
@@ -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
|
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
|
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
|
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
|
});
|