@ray-js/components 1.4.0-alpha.3 → 1.4.0-alpha.4

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 (118) 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.js +3 -3
  6. package/lib/Camera/Camera.thing.js +1 -3
  7. package/lib/Camera/Camera.wechat.js +2 -2
  8. package/lib/Checkbox/Checkbox.js +1 -3
  9. package/lib/Checkbox/Checkbox.thing.js +8 -9
  10. package/lib/Checkbox/Checkbox.wechat.js +9 -10
  11. package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
  12. package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
  13. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
  14. package/lib/CoverView/CoverView.js +1 -3
  15. package/lib/CoverView/CoverView.thing.js +1 -3
  16. package/lib/CoverView/CoverView.wechat.js +0 -2
  17. package/lib/CoverView/props.js +1 -1
  18. package/lib/Form/Form.js +12 -12
  19. package/lib/Form/Form.thing.js +1 -3
  20. package/lib/Form/Form.wechat.js +20 -25
  21. package/lib/Icon/Icon.js +7 -7
  22. package/lib/Icon/Icon.thing.js +7 -7
  23. package/lib/Icon/Icon.wechat.js +7 -7
  24. package/lib/Icon/iconfont/iconfont.js +13 -20
  25. package/lib/Icon/props.js +1 -1
  26. package/lib/Iframe/Iframe.js +3 -3
  27. package/lib/Iframe/Iframe.thing.js +1 -3
  28. package/lib/Iframe/Iframe.wechat.js +3 -3
  29. package/lib/Image/Image.js +6 -8
  30. package/lib/Image/Image.thing.js +8 -10
  31. package/lib/Image/Image.wechat.js +26 -32
  32. package/lib/Input/Input.js +29 -26
  33. package/lib/Input/Input.thing.js +36 -36
  34. package/lib/Input/Input.wechat.js +47 -47
  35. package/lib/Input/props.d.ts +6 -24
  36. package/lib/Input/props.js +1 -3
  37. package/lib/IpcPlayer/IpcPlayer.js +3 -3
  38. package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
  39. package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
  40. package/lib/Label/Label.js +7 -8
  41. package/lib/Label/Label.thing.js +8 -8
  42. package/lib/Label/Label.wechat.js +8 -8
  43. package/lib/Map/Map.js +1 -3
  44. package/lib/Map/Map.thing.js +1 -3
  45. package/lib/Map/Map.wechat.js +1 -3
  46. package/lib/Modal/index.js +4 -2
  47. package/lib/Modal/index.web.js +6 -4
  48. package/lib/MovableArea/MovableArea.js +5 -4
  49. package/lib/MovableArea/MovableArea.thing.js +1 -3
  50. package/lib/MovableArea/MovableArea.wechat.js +1 -3
  51. package/lib/MovableView/MovableView.js +12 -11
  52. package/lib/MovableView/MovableView.thing.js +1 -3
  53. package/lib/MovableView/MovableView.wechat.js +1 -3
  54. package/lib/NativeVideo/NativeVideo.js +3 -3
  55. package/lib/NativeVideo/NativeVideo.thing.js +1 -3
  56. package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
  57. package/lib/PageContainer/PageContainer.js +12 -19
  58. package/lib/PageContainer/PageContainer.thing.js +0 -2
  59. package/lib/PageContainer/PageContainer.wechat.js +0 -2
  60. package/lib/PageContainer/props.js +3 -3
  61. package/lib/Picker/Picker.js +23 -31
  62. package/lib/Picker/Picker.thing.js +26 -31
  63. package/lib/Picker/Picker.wechat.js +26 -31
  64. package/lib/PickerView/PickerView.js +23 -34
  65. package/lib/PickerView/PickerView.thing.js +16 -19
  66. package/lib/PickerView/PickerView.wechat.js +16 -19
  67. package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
  68. package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
  69. package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
  70. package/lib/Progress/Progress.js +1 -3
  71. package/lib/Progress/Progress.thing.js +6 -7
  72. package/lib/Progress/Progress.wechat.js +6 -7
  73. package/lib/Radio/Radio.js +1 -3
  74. package/lib/Radio/Radio.thing.js +8 -9
  75. package/lib/Radio/Radio.wechat.js +9 -10
  76. package/lib/RadioGroup/RadioGroup.js +12 -18
  77. package/lib/RadioGroup/RadioGroup.thing.js +15 -21
  78. package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
  79. package/lib/RichText/RichText.js +1 -1
  80. package/lib/RichText/RichText.thing.js +1 -3
  81. package/lib/RichText/RichText.wechat.js +1 -3
  82. package/lib/ScrollView/ScrollView.js +12 -13
  83. package/lib/ScrollView/ScrollView.thing.js +6 -7
  84. package/lib/ScrollView/ScrollView.wechat.js +6 -7
  85. package/lib/Slider/Slider.js +4 -8
  86. package/lib/Slider/Slider.thing.js +13 -14
  87. package/lib/Slider/Slider.wechat.js +14 -15
  88. package/lib/Slider/props.js +1 -1
  89. package/lib/Swiper/Swiper.js +24 -33
  90. package/lib/Swiper/Swiper.thing.js +18 -24
  91. package/lib/Swiper/Swiper.wechat.js +18 -24
  92. package/lib/Swiper/props.js +2 -2
  93. package/lib/SwiperItem/SwiperItem.js +4 -4
  94. package/lib/SwiperItem/SwiperItem.thing.js +8 -9
  95. package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
  96. package/lib/Switch/Switch.js +5 -8
  97. package/lib/Switch/Switch.thing.js +12 -14
  98. package/lib/Switch/Switch.wechat.js +12 -14
  99. package/lib/Switch/props.js +1 -1
  100. package/lib/Text/Text.js +1 -3
  101. package/lib/Text/Text.thing.js +1 -3
  102. package/lib/Text/Text.wechat.js +20 -25
  103. package/lib/Textarea/Textarea.js +13 -24
  104. package/lib/Textarea/Textarea.thing.js +26 -30
  105. package/lib/Textarea/Textarea.wechat.js +26 -30
  106. package/lib/Textarea/props.d.ts +3 -9
  107. package/lib/View/View.js +29 -32
  108. package/lib/View/View.thing.js +34 -35
  109. package/lib/View/View.wechat.js +34 -35
  110. package/lib/View/props.js +1 -1
  111. package/lib/WebView/WebView.js +1 -3
  112. package/lib/WebView/WebView.thing.js +1 -3
  113. package/lib/WebView/WebView.wechat.js +1 -3
  114. package/lib/assets/icons.js +1 -1
  115. package/lib/core/index.js +4 -11
  116. package/lib/types/index.js +1 -0
  117. package/lib/utils/handleProps.js +26 -40
  118. package/package.json +5 -5
package/lib/Icon/props.js CHANGED
@@ -1,4 +1,4 @@
1
- export var defaultIconProps = {
1
+ export const defaultIconProps = {
2
2
  size: 16,
3
3
  type: 'icon-warning',
4
4
  color: '#333333'
@@ -1,7 +1,7 @@
1
- import React from 'react'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1
+ import React from 'react';
2
2
 
3
- var Iframe = function () {
3
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
+ const Iframe = () => {
4
5
  return /*#__PURE__*/React.createElement("div", null, "web \u7AEF\u6682\u672A\u5B9E\u73B0");
5
6
  };
6
-
7
7
  export default Iframe;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Iframe as RemaxIframe } from '@ray-js/adapter';
3
-
4
- var Iframe = function (props) {
3
+ const Iframe = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxIframe, props);
6
5
  };
7
-
8
6
  export default Iframe;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { View as RemaxView } from '@ray-core/wechat'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
2
+ import { View as RemaxView } from '@ray-core/wechat';
3
3
 
4
- var Iframe = function () {
4
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
5
+ const Iframe = () => {
5
6
  return /*#__PURE__*/React.createElement(RemaxView, null, "wechat \u7AEF\u4E0D\u652F\u6301");
6
7
  };
7
-
8
8
  export default Iframe;
@@ -3,26 +3,24 @@ 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
- var Image = /*#__PURE__*/React.forwardRef(function (props, ref) {
7
- var currentNode = ref || React.useRef(null);
8
- useEventListener('load', function (e) {
6
+ const Image = /*#__PURE__*/React.forwardRef((props, ref) => {
7
+ const currentNode = ref || React.useRef(null);
8
+ useEventListener('load', e => {
9
9
  var _props$onLoad;
10
-
11
10
  (_props$onLoad = props.onLoad) === null || _props$onLoad === void 0 ? void 0 : _props$onLoad.call(props, _objectSpread(_objectSpread({
12
11
  type: e.type
13
12
  }, e.detail), {}, {
14
- origin: origin
13
+ origin
15
14
  }));
16
15
  }, {
17
16
  target: currentNode
18
17
  });
19
- useEventListener('error', function (e) {
18
+ useEventListener('error', e => {
20
19
  var _props$onError;
21
-
22
20
  (_props$onError = props.onError) === null || _props$onError === void 0 ? void 0 : _props$onError.call(props, _objectSpread(_objectSpread({
23
21
  type: e.type
24
22
  }, e.detail), {}, {
25
- origin: origin
23
+ origin
26
24
  }));
27
25
  }, {
28
26
  target: currentNode
@@ -1,23 +1,21 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style", "className", "mode"];
3
+ const _excluded = ["style", "className", "mode"];
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 { Image as RemaxImage } from '@ray-js/adapter';
8
-
9
- var Image = function (props) {
10
- var style = props.style,
11
- className = props.className,
12
- _props$mode = props.mode,
13
- mode = _props$mode === void 0 ? 'scaleToFill' : _props$mode,
14
- restProps = _objectWithoutProperties(props, _excluded);
15
-
8
+ const Image = props => {
9
+ const {
10
+ style,
11
+ className,
12
+ mode = 'scaleToFill'
13
+ } = props,
14
+ restProps = _objectWithoutProperties(props, _excluded);
16
15
  return /*#__PURE__*/React.createElement(RemaxImage, _extends({
17
16
  style: inlineStyle(style),
18
17
  className: clsx('ray-image', className),
19
18
  mode: mode
20
19
  }, restProps));
21
20
  };
22
-
23
21
  export default Image;
@@ -1,44 +1,39 @@
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 = ["style", "className", "onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onLoad", "onError", "mode"];
3
+ const _excluded = ["style", "className", "onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onLoad", "onError", "mode"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
5
5
  import clsx from 'clsx';
6
6
  import * as React from 'react';
7
7
  import { inlineStyle, useTouch } from '@ray-js/framework-shared';
8
8
  import { Image as RemaxImage } from '@ray-core/wechat';
9
-
10
- var Image = function (props) {
11
- var style = props.style,
12
- className = props.className,
13
- onClick = props.onClick,
14
- onLongClick = props.onLongClick,
15
- onTouchCancel = props.onTouchCancel,
16
- onTouchEnd = props.onTouchEnd,
17
- onTouchMove = props.onTouchMove,
18
- onTouchStart = props.onTouchStart,
19
- onLoad = props.onLoad,
20
- onError = props.onError,
21
- _props$mode = props.mode,
22
- mode = _props$mode === void 0 ? 'scaleToFill' : _props$mode,
23
- restProps = _objectWithoutProperties(props, _excluded);
24
-
25
- var _useTouch = useTouch({
26
- onLongClick: onLongClick,
27
- onTouchStart: onTouchStart,
28
- onTouchMove: onTouchMove,
29
- onTouchEnd: onTouchEnd,
30
- onTouchCancel: onTouchCancel,
31
- onClick: onClick
32
- }),
33
- _useTouch2 = _slicedToArray(_useTouch, 2),
34
- touching = _useTouch2[0],
35
- handlers = _useTouch2[1];
36
-
9
+ const Image = props => {
10
+ const {
11
+ style,
12
+ className,
13
+ onClick,
14
+ onLongClick,
15
+ onTouchCancel,
16
+ onTouchEnd,
17
+ onTouchMove,
18
+ onTouchStart,
19
+ onLoad,
20
+ onError,
21
+ mode = 'scaleToFill'
22
+ } = props,
23
+ restProps = _objectWithoutProperties(props, _excluded);
24
+ const [touching, handlers] = useTouch({
25
+ onLongClick,
26
+ onTouchStart,
27
+ onTouchMove,
28
+ onTouchEnd,
29
+ onTouchCancel,
30
+ onClick
31
+ });
37
32
  return /*#__PURE__*/React.createElement(RemaxImage, _extends({
38
33
  style: inlineStyle(style),
39
34
  className: clsx('ray-image', className),
40
35
  mode: mode,
41
- onLoad: function handleOnload(e) {
36
+ onLoad: e => {
42
37
  onLoad === null || onLoad === void 0 ? void 0 : onLoad({
43
38
  width: e.detail.width,
44
39
  height: e.detail.height,
@@ -47,5 +42,4 @@ var Image = function (props) {
47
42
  }
48
43
  }, handlers, restProps));
49
44
  };
50
-
51
45
  export default Image;
@@ -1,7 +1,7 @@
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 = ["placeholderStyle", "className", "maxLength", "onBlur", "onFocus", "onConfirm"];
3
+ const _excluded = ["placeholderStyle", "className", "maxLength", "onBlur", "onFocus", "onConfirm"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
5
5
  import * as React from 'react';
6
6
  import clsx from 'clsx';
7
7
  import { useEventListener } from 'ahooks';
@@ -9,21 +9,19 @@ import { inlineStyle, useStylesheet } from '@ray-js/framework-shared';
9
9
  import { defaultInputProps } from './props';
10
10
  import styles from './index.module.less';
11
11
  import handleProps from '../utils/handleProps';
12
- var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
- var placeholderStyle = props.placeholderStyle,
14
- className = props.className,
15
- maxLength = props.maxLength,
16
- onBlur = props.onBlur,
17
- onFocus = props.onFocus,
18
- onConfirm = props.onConfirm,
19
- restProps = _objectWithoutProperties(props, _excluded);
20
-
21
- var _useStylesheet = useStylesheet(inlineStyle(placeholderStyle)),
22
- _useStylesheet2 = _slicedToArray(_useStylesheet, 1),
23
- placeholderStyleClassName = _useStylesheet2[0];
24
-
25
- var currentNode = ref || React.useRef(null);
26
- useEventListener('focus', function (e) {
12
+ const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
13
+ const {
14
+ placeholderStyle,
15
+ className,
16
+ maxLength,
17
+ onBlur,
18
+ onFocus,
19
+ onConfirm
20
+ } = props,
21
+ restProps = _objectWithoutProperties(props, _excluded);
22
+ const [placeholderStyleClassName] = useStylesheet(inlineStyle(placeholderStyle));
23
+ const currentNode = ref || React.useRef(null);
24
+ useEventListener('focus', e => {
27
25
  onFocus === null || onFocus === void 0 ? void 0 : onFocus({
28
26
  type: 'focus',
29
27
  value: e.detail.value,
@@ -32,21 +30,25 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
32
30
  }, {
33
31
  target: currentNode
34
32
  });
35
- useEventListener('blur', function (e) {
36
- var value = e.target.value;
33
+ useEventListener('blur', e => {
34
+ const {
35
+ value
36
+ } = e.target;
37
37
  onBlur === null || onBlur === void 0 ? void 0 : onBlur({
38
38
  type: 'blur',
39
- value: value,
39
+ value,
40
40
  origin: e
41
41
  });
42
42
  }, {
43
43
  target: currentNode
44
44
  });
45
- useEventListener('confirm', function (e) {
46
- var value = e.target.value;
45
+ useEventListener('confirm', e => {
46
+ const {
47
+ value
48
+ } = e.target;
47
49
  onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm({
48
50
  type: 'confirm',
49
- value: value,
51
+ value,
50
52
  origin: e
51
53
  });
52
54
  }, {
@@ -59,11 +61,12 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
59
61
  maxlength: maxLength,
60
62
  onInput: function (e) {
61
63
  var _props$onInput;
62
-
63
- var value = e.target.value;
64
+ const {
65
+ value
66
+ } = e.target;
64
67
  (_props$onInput = props.onInput) === null || _props$onInput === void 0 ? void 0 : _props$onInput.call(props, {
65
68
  type: 'input',
66
- value: value,
69
+ value,
67
70
  origin: e
68
71
  });
69
72
  },
@@ -1,55 +1,52 @@
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 = ["name", "id", "className", "style", "disabled", "type", "value", "focus", "maxLength", "onBlur", "onConfirm", "onFocus", "onInput", "password", "placeholder", "placeholderStyle"];
3
+ const _excluded = ["name", "id", "className", "style", "disabled", "type", "value", "focus", "maxLength", "onBlur", "onConfirm", "onFocus", "onInput", "password", "placeholder", "placeholderStyle"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
5
5
  import * as React from 'react';
6
6
  import clsx from 'clsx';
7
7
  import { Input as RemaxInput } from '@ray-js/adapter';
8
8
  import { inlineStyle } from '@ray-js/framework-shared';
9
9
  import { nextFrame } from '../core';
10
10
  import styles from './index.module.less';
11
- var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
12
- var name = props.name,
13
- id = props.id,
14
- className = props.className,
15
- style = props.style,
16
- disabled = props.disabled,
17
- _props$type = props.type,
18
- type = _props$type === void 0 ? 'text' : _props$type,
19
- value = props.value,
20
- focus = props.focus,
21
- maxLength = props.maxLength,
22
- onBlur = props.onBlur,
23
- onConfirm = props.onConfirm,
24
- onFocus = props.onFocus,
25
- onInput = props.onInput,
26
- password = props.password,
27
- placeholder = props.placeholder,
28
- placeholderStyle = props.placeholderStyle,
29
- restProps = _objectWithoutProperties(props, _excluded);
30
-
31
- var _React$useState = React.useState(value),
32
- _React$useState2 = _slicedToArray(_React$useState, 2),
33
- internalValue = _React$useState2[0],
34
- setInternalValue = _React$useState2[1];
35
-
36
- var bufferValue = React.useRef(value);
37
- React.useEffect(function () {
11
+ const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
12
+ const {
13
+ name,
14
+ id,
15
+ className,
16
+ style,
17
+ disabled,
18
+ type = 'text',
19
+ value,
20
+ focus,
21
+ maxLength,
22
+ onBlur,
23
+ onConfirm,
24
+ onFocus,
25
+ onInput,
26
+ password,
27
+ placeholder,
28
+ placeholderStyle
29
+ } = props,
30
+ restProps = _objectWithoutProperties(props, _excluded);
31
+ const [internalValue, setInternalValue] = React.useState(value);
32
+ const bufferValue = React.useRef(value);
33
+ React.useEffect(() => {
38
34
  if (value !== bufferValue.current) {
39
35
  // HACK: 避免重复设置相同 value 不渲染的问题
40
36
  setInternalValue(bufferValue.current);
41
- nextFrame(1).then(function () {
37
+ nextFrame(1).then(() => {
42
38
  bufferValue.current = value;
43
39
  setInternalValue(value);
44
40
  });
45
41
  }
46
42
  }, [value]);
47
- var selection = focus ? {
43
+ const selection = focus ? {
48
44
  selectionStart: (internalValue === null || internalValue === void 0 ? void 0 : internalValue.length) || -1,
49
45
  selectionEnd: (internalValue === null || internalValue === void 0 ? void 0 : internalValue.length) || -1
50
46
  } : undefined;
51
47
  return /*#__PURE__*/React.createElement(RemaxInput, _extends({
52
- name: name //@ts-ignore
48
+ name: name
49
+ //@ts-ignore
53
50
  ,
54
51
  ref: ref,
55
52
  id: id,
@@ -63,16 +60,19 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
63
60
  placeholderStyle: inlineStyle(placeholderStyle),
64
61
  maxlength: maxLength,
65
62
  onInput: function (event) {
66
- var value = event.detail.value; // 内部 value 管控
67
-
63
+ const {
64
+ value
65
+ } = event.detail;
66
+ // 内部 value 管控
68
67
  bufferValue.current = value;
69
68
  event.value = value;
70
69
  onInput === null || onInput === void 0 ? void 0 : onInput(event);
71
70
  },
72
71
  onBlur: onBlur,
73
72
  onConfirm: function (event) {
74
- var _event$detail$value = event.detail.value,
75
- value = _event$detail$value === void 0 ? '' : _event$detail$value;
73
+ const {
74
+ value = ''
75
+ } = event.detail;
76
76
  setInternalValue(value);
77
77
  onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(event);
78
78
  },
@@ -1,7 +1,7 @@
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 = ["name", "id", "className", "style", "disabled", "type", "value", "focus", "maxLength", "onBlur", "onConfirm", "onFocus", "onInput", "password", "placeholder", "placeholderStyle"];
3
+ const _excluded = ["name", "id", "className", "style", "disabled", "type", "value", "focus", "maxLength", "onBlur", "onConfirm", "onFocus", "onInput", "password", "placeholder", "placeholderStyle"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
5
5
  import * as React from 'react';
6
6
  import clsx from 'clsx';
7
7
  import { Input as RemaxInput } from '@ray-core/wechat';
@@ -9,48 +9,45 @@ import { inlineStyle } from '@ray-js/framework-shared';
9
9
  import { defaultInputProps } from './props';
10
10
  import { nextFrame } from '../core';
11
11
  import styles from './index.module.less';
12
- var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
- var name = props.name,
14
- id = props.id,
15
- className = props.className,
16
- style = props.style,
17
- disabled = props.disabled,
18
- _props$type = props.type,
19
- type = _props$type === void 0 ? 'text' : _props$type,
20
- value = props.value,
21
- focus = props.focus,
22
- maxLength = props.maxLength,
23
- onBlur = props.onBlur,
24
- onConfirm = props.onConfirm,
25
- onFocus = props.onFocus,
26
- onInput = props.onInput,
27
- password = props.password,
28
- placeholder = props.placeholder,
29
- placeholderStyle = props.placeholderStyle,
30
- restProps = _objectWithoutProperties(props, _excluded);
31
-
32
- var _React$useState = React.useState(value),
33
- _React$useState2 = _slicedToArray(_React$useState, 2),
34
- internalValue = _React$useState2[0],
35
- setInternalValue = _React$useState2[1];
36
-
37
- var bufferValue = React.useRef(value);
38
- React.useEffect(function () {
12
+ const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
13
+ const {
14
+ name,
15
+ id,
16
+ className,
17
+ style,
18
+ disabled,
19
+ type = 'text',
20
+ value,
21
+ focus,
22
+ maxLength,
23
+ onBlur,
24
+ onConfirm,
25
+ onFocus,
26
+ onInput,
27
+ password,
28
+ placeholder,
29
+ placeholderStyle
30
+ } = props,
31
+ restProps = _objectWithoutProperties(props, _excluded);
32
+ const [internalValue, setInternalValue] = React.useState(value);
33
+ const bufferValue = React.useRef(value);
34
+ React.useEffect(() => {
39
35
  if (value !== bufferValue.current) {
40
36
  // HACK: 避免重复设置相同 value 不渲染的问题
41
37
  setInternalValue(bufferValue.current);
42
- nextFrame(1).then(function () {
38
+ nextFrame(1).then(() => {
43
39
  bufferValue.current = value;
44
40
  setInternalValue(value);
45
41
  });
46
42
  }
47
43
  }, [value]);
48
- var selection = focus ? {
44
+ const selection = focus ? {
49
45
  selectionStart: (internalValue === null || internalValue === void 0 ? void 0 : internalValue.length) || -1,
50
46
  selectionEnd: (internalValue === null || internalValue === void 0 ? void 0 : internalValue.length) || -1
51
47
  } : undefined;
52
48
  return /*#__PURE__*/React.createElement(RemaxInput, _extends({
53
- name: name //@ts-ignore
49
+ name: name
50
+ //@ts-ignore
54
51
  ,
55
52
  ref: ref,
56
53
  id: id,
@@ -64,41 +61,44 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
64
61
  placeholderStyle: inlineStyle(placeholderStyle),
65
62
  maxlength: maxLength,
66
63
  onInput: function (event) {
67
- var value = event.detail.value; // 内部 value 管控
68
-
64
+ const {
65
+ value
66
+ } = event.detail;
67
+ // 内部 value 管控
69
68
  bufferValue.current = value;
70
69
  onInput === null || onInput === void 0 ? void 0 : onInput({
71
70
  type: 'input',
72
- value: value,
71
+ value,
73
72
  origin: event
74
73
  });
75
74
  },
76
75
  onBlur: function (event) {
77
- var _event$detail$value3 = event.detail.value,
78
- value = _event$detail$value3 === void 0 ? '' : _event$detail$value3;
76
+ const {
77
+ value = ''
78
+ } = event.detail;
79
79
  onBlur === null || onBlur === void 0 ? void 0 : onBlur({
80
80
  type: 'blur',
81
- value: value,
81
+ value,
82
82
  origin: event
83
83
  });
84
84
  },
85
85
  onConfirm: function (event) {
86
- var _event$detail$value = event.detail.value,
87
- value = _event$detail$value === void 0 ? '' : _event$detail$value;
86
+ const {
87
+ value = ''
88
+ } = event.detail;
88
89
  setInternalValue(value);
89
90
  onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(event);
90
91
  },
91
92
  onFocus: function (event) {
92
- var _event$detail = event.detail,
93
- _event$detail$value2 = _event$detail.value,
94
- value = _event$detail$value2 === void 0 ? '' : _event$detail$value2,
95
- _event$detail$height = _event$detail.height,
96
- height = _event$detail$height === void 0 ? 0 : _event$detail$height;
93
+ const {
94
+ value = '',
95
+ height = 0
96
+ } = event.detail;
97
97
  setInternalValue(value);
98
98
  onFocus === null || onFocus === void 0 ? void 0 : onFocus({
99
99
  type: 'focus',
100
- value: value,
101
- height: height,
100
+ value,
101
+ height,
102
102
  origin: event
103
103
  });
104
104
  },
@@ -26,6 +26,12 @@ export interface InputProps extends BaseProps {
26
26
  * @default undefined
27
27
  */
28
28
  placeholder?: string;
29
+ /**
30
+ * @description.en placeholder
31
+ * @description.zh 占位符的样式
32
+ * @default undefined
33
+ */
34
+ placeholderStyle?: string;
29
35
  /**
30
36
  * @description.en disabled
31
37
  * @description.zh 是否禁用
@@ -38,36 +44,12 @@ export interface InputProps extends BaseProps {
38
44
  * @default undefined
39
45
  */
40
46
  maxLength?: number;
41
- /**
42
- * @description.en 获Get focus取焦点
43
- * @description.zh 获取焦点
44
- * @default false
45
- */
46
- focus?: boolean;
47
47
  /**
48
48
  * @description.en Set the text of the button in the lower right corner of the keyboard, effective only when type='text'
49
49
  * @description.zh 设置键盘右下角按钮的文字,仅在type='text'时生效
50
50
  * @default done
51
51
  */
52
52
  confirmType?: 'send' | 'search' | 'next' | 'go' | 'done';
53
- /**
54
- * @description.en Start position of the cursor. This parameter is valid for automatic clustering and must be used with Selection End
55
- * @description.zh 光标起始位置,自动聚集时有效,需与 selectionEnd 搭配使用
56
- * @default -1
57
- */
58
- selectionStart?: number;
59
- /**
60
- * @description.en End cursor position. This parameter is valid for automatic clustering and must be used with Selection Start
61
- * @description.zh 光标结束位置,自动聚集时有效,需与 selectionStart 搭配使用
62
- * @default -1
63
- */
64
- selectionEnd?: number;
65
- /**
66
- * @description.en Specifies the cursor position for focus
67
- * @description.zh 指定 focus 时的光标位置
68
- * @default false
69
- */
70
- cursor?: number;
71
53
  /**
72
54
  * @description.en Input events
73
55
  * @description.zh 输入事件
@@ -1,6 +1,4 @@
1
- export var defaultInputProps = {
2
- selectionEnd: -1,
3
- selectionStart: -1,
1
+ export const defaultInputProps = {
4
2
  type: 'text',
5
3
  maxLength: 140,
6
4
  confirmType: 'done'
@@ -1,7 +1,7 @@
1
- import React from 'react'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1
+ import React from 'react';
2
2
 
3
- var IpcPlayer = function () {
3
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
+ const IpcPlayer = () => {
4
5
  return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
5
6
  };
6
-
7
7
  export default IpcPlayer;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { IpcPlayer as RemaxIpcPlayer } from '@ray-js/adapter';
3
-
4
- var IpcPlayer = function (props) {
3
+ const IpcPlayer = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxIpcPlayer, props);
6
5
  };
7
-
8
6
  export default IpcPlayer;
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { View } from '@ray-js/components'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
2
+ import { View } from '@ray-js/components';
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
5
  function IpcPlayer() {
5
6
  return /*#__PURE__*/React.createElement(View, null, "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u7AEF\u6682\u672A\u5B9E\u73B0");
6
7
  }
7
-
8
8
  export default IpcPlayer;
@@ -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 = ["htmlFor"];
3
+ const _excluded = ["htmlFor"];
4
4
  import * as React from 'react';
5
5
  import handleProps from '../utils/handleProps';
6
-
7
- var Label = function (props) {
8
- var htmlFor = props.htmlFor,
9
- restProps = _objectWithoutProperties(props, _excluded); // @ts-ignore
10
-
11
-
6
+ const Label = props => {
7
+ const {
8
+ htmlFor
9
+ } = props,
10
+ restProps = _objectWithoutProperties(props, _excluded);
11
+ // @ts-ignore
12
12
  return /*#__PURE__*/React.createElement("v-label", _extends({
13
13
  for: htmlFor
14
14
  }, handleProps(restProps)));
15
15
  };
16
-
17
16
  export default Label;