@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.
- package/LICENSE.md +9 -0
- package/lib/Button/Button.js +1 -3
- package/lib/Button/Button.thing.js +15 -17
- package/lib/Button/Button.wechat.js +15 -17
- package/lib/Button/props.js +1 -1
- package/lib/Camera/Camera.d.ts +2 -1
- package/lib/Camera/Camera.js +3 -3
- package/lib/Camera/Camera.thing.js +1 -3
- package/lib/Camera/Camera.wechat.d.ts +2 -1
- package/lib/Camera/Camera.wechat.js +2 -2
- package/lib/Checkbox/Checkbox.js +1 -3
- package/lib/Checkbox/Checkbox.thing.js +8 -9
- package/lib/Checkbox/Checkbox.wechat.js +9 -10
- package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
- package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
- package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
- package/lib/CheckboxGroup/props.d.ts +1 -1
- package/lib/CoverView/CoverView.js +1 -3
- package/lib/CoverView/CoverView.thing.js +1 -3
- package/lib/CoverView/CoverView.wechat.d.ts +2 -1
- package/lib/CoverView/CoverView.wechat.js +0 -2
- package/lib/CoverView/props.d.ts +1 -1
- package/lib/CoverView/props.js +1 -1
- package/lib/Form/Form.js +12 -12
- package/lib/Form/Form.thing.js +1 -3
- package/lib/Form/Form.wechat.js +19 -25
- package/lib/Form/props.d.ts +1 -1
- package/lib/Icon/Icon.js +10 -10
- package/lib/Icon/Icon.thing.js +10 -10
- package/lib/Icon/Icon.wechat.js +10 -10
- package/lib/Icon/iconfont/iconfont.js +13 -20
- package/lib/Icon/props.d.ts +1 -1
- package/lib/Icon/props.js +1 -1
- package/lib/Iframe/Iframe.d.ts +2 -1
- package/lib/Iframe/Iframe.js +3 -3
- package/lib/Iframe/Iframe.thing.js +1 -3
- package/lib/Iframe/Iframe.wechat.d.ts +2 -1
- package/lib/Iframe/Iframe.wechat.js +3 -3
- package/lib/Image/Image.js +6 -8
- package/lib/Image/Image.thing.js +8 -10
- package/lib/Image/Image.wechat.js +25 -32
- package/lib/Input/Input.js +28 -26
- package/lib/Input/Input.thing.js +35 -36
- package/lib/Input/Input.wechat.js +46 -47
- package/lib/Input/props.d.ts +1 -1
- package/lib/Input/props.js +1 -1
- package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.js +3 -3
- package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
- package/lib/IpcPlayer/IpcPlayer.wechat.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
- package/lib/Label/Label.js +7 -8
- package/lib/Label/Label.thing.js +8 -8
- package/lib/Label/Label.wechat.js +8 -8
- package/lib/Map/Map.js +1 -3
- package/lib/Map/Map.thing.js +1 -3
- package/lib/Map/Map.wechat.js +1 -3
- package/lib/Modal/index.js +4 -2
- package/lib/Modal/index.web.js +6 -4
- package/lib/MovableArea/MovableArea.js +5 -4
- package/lib/MovableArea/MovableArea.thing.js +1 -3
- package/lib/MovableArea/MovableArea.wechat.js +1 -3
- package/lib/MovableView/MovableView.js +12 -11
- package/lib/MovableView/MovableView.thing.js +1 -3
- package/lib/MovableView/MovableView.wechat.js +1 -3
- package/lib/NativeVideo/NativeVideo.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.js +3 -3
- package/lib/NativeVideo/NativeVideo.thing.js +1 -3
- package/lib/NativeVideo/NativeVideo.wechat.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
- package/lib/PageContainer/PageContainer.js +12 -19
- package/lib/PageContainer/PageContainer.thing.d.ts +2 -1
- package/lib/PageContainer/PageContainer.thing.js +0 -2
- package/lib/PageContainer/PageContainer.wechat.d.ts +2 -1
- package/lib/PageContainer/PageContainer.wechat.js +0 -2
- package/lib/PageContainer/props.d.ts +2 -2
- package/lib/PageContainer/props.js +3 -3
- package/lib/Picker/Picker.js +22 -31
- package/lib/Picker/Picker.thing.js +25 -31
- package/lib/Picker/Picker.wechat.js +25 -31
- package/lib/PickerView/PickerView.js +23 -34
- package/lib/PickerView/PickerView.thing.js +16 -19
- package/lib/PickerView/PickerView.wechat.js +16 -19
- package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
- package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
- package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
- package/lib/Progress/Progress.js +1 -3
- package/lib/Progress/Progress.thing.js +6 -7
- package/lib/Progress/Progress.wechat.js +6 -7
- package/lib/Radio/Radio.js +1 -3
- package/lib/Radio/Radio.thing.js +8 -9
- package/lib/Radio/Radio.wechat.js +9 -10
- package/lib/RadioGroup/RadioGroup.js +12 -18
- package/lib/RadioGroup/RadioGroup.thing.js +15 -21
- package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
- package/lib/RadioGroup/props.d.ts +1 -1
- package/lib/RichText/RichText.js +1 -1
- package/lib/RichText/RichText.thing.js +1 -3
- package/lib/RichText/RichText.wechat.js +1 -3
- package/lib/ScrollView/ScrollView.js +12 -13
- package/lib/ScrollView/ScrollView.thing.js +6 -7
- package/lib/ScrollView/ScrollView.wechat.js +6 -7
- package/lib/Slider/Slider.js +4 -8
- package/lib/Slider/Slider.thing.js +13 -14
- package/lib/Slider/Slider.wechat.js +14 -15
- package/lib/Slider/props.js +1 -1
- package/lib/Swiper/Swiper.d.ts +1 -1
- package/lib/Swiper/Swiper.js +23 -33
- package/lib/Swiper/Swiper.thing.d.ts +1 -1
- package/lib/Swiper/Swiper.thing.js +17 -24
- package/lib/Swiper/Swiper.wechat.d.ts +1 -1
- package/lib/Swiper/Swiper.wechat.js +17 -24
- package/lib/Swiper/props.d.ts +1 -1
- package/lib/Swiper/props.js +2 -2
- package/lib/SwiperItem/SwiperItem.js +4 -4
- package/lib/SwiperItem/SwiperItem.thing.js +8 -9
- package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
- package/lib/Switch/Switch.js +5 -8
- package/lib/Switch/Switch.thing.js +12 -14
- package/lib/Switch/Switch.wechat.js +12 -14
- package/lib/Switch/props.js +1 -1
- package/lib/Text/Text.js +1 -3
- package/lib/Text/Text.thing.js +1 -3
- package/lib/Text/Text.wechat.js +19 -25
- package/lib/Textarea/Textarea.js +13 -14
- package/lib/Textarea/Textarea.thing.js +25 -22
- package/lib/Textarea/Textarea.wechat.js +25 -22
- package/lib/Textarea/props.d.ts +1 -1
- package/lib/View/View.js +28 -32
- package/lib/View/View.thing.js +33 -35
- package/lib/View/View.wechat.js +33 -35
- package/lib/View/props.js +1 -1
- package/lib/WebView/WebView.js +1 -3
- package/lib/WebView/WebView.thing.js +1 -3
- package/lib/WebView/WebView.wechat.js +1 -3
- package/lib/assets/icons.js +1 -1
- package/lib/core/index.js +5 -12
- package/lib/types/event.d.ts +1 -1
- package/lib/types/index.js +1 -0
- package/lib/utils/handleProps.js +26 -41
- 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
|
-
|
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
|
-
|
10
|
-
|
11
|
-
style
|
12
|
-
id
|
13
|
-
|
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
|
-
|
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
|
-
|
10
|
-
|
11
|
-
style
|
12
|
-
id
|
13
|
-
|
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;
|
package/lib/Switch/Switch.js
CHANGED
@@ -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
|
-
|
8
|
-
|
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
|
-
});
|
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
|
-
|
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
|
-
|
10
|
-
|
11
|
-
style
|
12
|
-
id
|
13
|
-
onChange
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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:
|
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
|
-
|
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
|
-
|
11
|
-
|
12
|
-
style
|
13
|
-
id
|
14
|
-
onChange
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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:
|
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;
|
package/lib/Switch/props.js
CHANGED
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;
|
package/lib/Text/Text.thing.js
CHANGED
package/lib/Text/Text.wechat.js
CHANGED
@@ -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
|
-
|
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
|
-
|
10
|
-
|
11
|
-
onLongClick
|
12
|
-
onTouchCancel
|
13
|
-
onTouchEnd
|
14
|
-
onTouchMove
|
15
|
-
onTouchStart
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
onLongClick
|
20
|
-
onTouchStart
|
21
|
-
onTouchMove
|
22
|
-
onTouchEnd
|
23
|
-
onTouchCancel
|
24
|
-
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;
|
package/lib/Textarea/Textarea.js
CHANGED
@@ -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
|
-
|
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
|
-
|
11
|
-
|
12
|
-
onInput
|
13
|
-
onFocus
|
14
|
-
onBlur
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
useEventListener('input',
|
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',
|
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',
|
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
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
maxLength =
|
22
|
-
disabled
|
23
|
-
name
|
24
|
-
autoHeight
|
25
|
-
|
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
|
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
|
-
|
43
|
+
const {
|
44
|
+
value
|
45
|
+
} = e.detail;
|
43
46
|
onInput === null || onInput === void 0 ? void 0 : onInput({
|
44
|
-
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
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
maxLength =
|
22
|
-
disabled
|
23
|
-
name
|
24
|
-
autoHeight
|
25
|
-
|
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
|
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
|
-
|
42
|
+
const {
|
43
|
+
value
|
44
|
+
} = e.detail;
|
42
45
|
onInput === null || onInput === void 0 ? void 0 : onInput({
|
43
|
-
value
|
46
|
+
value
|
44
47
|
});
|
45
48
|
},
|
46
49
|
onLinechange: onLinechange,
|
package/lib/Textarea/props.d.ts
CHANGED
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
|
-
|
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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
34
|
-
onTouchStart
|
35
|
-
onTouchMove
|
36
|
-
onTouchEnd
|
37
|
-
onTouchCancel
|
38
|
-
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,
|
package/lib/View/View.thing.js
CHANGED
@@ -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
|
-
|
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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
34
|
-
onTouchStart
|
35
|
-
onTouchMove
|
36
|
-
onTouchEnd
|
37
|
-
onTouchCancel
|
38
|
-
onClick
|
39
|
-
})
|
40
|
-
|
41
|
-
|
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(
|
46
|
+
hoverClassName: clsx({
|
47
|
+
[styles.hover]: hoverable
|
48
|
+
}, hoverClassName),
|
51
49
|
hoverStartTime: hoverStartTime,
|
52
50
|
hoverStayTime: hoverStayTime,
|
53
51
|
onTransitionEnd: onTransitionEnd
|