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

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 (66) 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.d.ts +3 -3
  16. package/lib/Iframe/Iframe.js +1 -1
  17. package/lib/Image/Image.js +2 -2
  18. package/lib/Image/Image.wechat.js +2 -1
  19. package/lib/Input/Input.js +10 -8
  20. package/lib/Input/Input.thing.js +3 -2
  21. package/lib/Input/Input.wechat.js +9 -7
  22. package/lib/Input/props.d.ts +13 -47
  23. package/lib/IpcPlayer/IpcPlayer.js +1 -1
  24. package/lib/IpcPlayer/IpcPlayer.wechat.js +1 -1
  25. package/lib/Map/Map.js +1 -1
  26. package/lib/MovableView/MovableView.js +2 -2
  27. package/lib/NativeVideo/NativeVideo.js +1 -1
  28. package/lib/NativeVideo/NativeVideo.wechat.js +1 -1
  29. package/lib/PageContainer/PageContainer.js +15 -14
  30. package/lib/PageContainer/props.d.ts +4 -6
  31. package/lib/Picker/Picker.js +6 -4
  32. package/lib/Picker/Picker.thing.js +8 -6
  33. package/lib/Picker/Picker.wechat.js +8 -6
  34. package/lib/PickerView/PickerView.js +3 -2
  35. package/lib/PickerView/PickerView.thing.js +7 -6
  36. package/lib/PickerView/PickerView.wechat.js +7 -6
  37. package/lib/RadioGroup/RadioGroup.js +3 -2
  38. package/lib/RadioGroup/props.d.ts +4 -14
  39. package/lib/ScrollView/ScrollView.js +3 -3
  40. package/lib/Slider/Slider.js +5 -4
  41. package/lib/Slider/Slider.thing.js +5 -4
  42. package/lib/Slider/Slider.wechat.js +5 -4
  43. package/lib/Slider/props.d.ts +7 -30
  44. package/lib/Swiper/Swiper.js +4 -2
  45. package/lib/Swiper/Swiper.thing.js +3 -2
  46. package/lib/Swiper/Swiper.wechat.js +3 -2
  47. package/lib/Swiper/props.d.ts +3 -0
  48. package/lib/Switch/Switch.js +1 -1
  49. package/lib/Switch/Switch.thing.js +3 -2
  50. package/lib/Switch/Switch.wechat.js +3 -2
  51. package/lib/Switch/props.d.ts +4 -15
  52. package/lib/Text/Text.wechat.js +1 -0
  53. package/lib/Textarea/Textarea.js +7 -6
  54. package/lib/Textarea/Textarea.thing.js +1 -1
  55. package/lib/Textarea/Textarea.wechat.js +1 -1
  56. package/lib/Textarea/props.d.ts +10 -3
  57. package/lib/Video/Video.js +1 -1
  58. package/lib/Video/Video.wechat.js +1 -1
  59. package/lib/View/View.js +1 -0
  60. package/lib/View/View.thing.js +1 -0
  61. package/lib/View/View.wechat.js +1 -0
  62. package/lib/WebView/WebView.js +1 -1
  63. package/lib/core/index.js +1 -1
  64. package/lib/utils/handleProps.js +2 -1
  65. package/package.json +9 -9
  66. package/lib/Modal/index.web.d.ts +0 -2
@@ -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
  });
@@ -43,7 +43,7 @@ const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
43
43
  const {
44
44
  value
45
45
  } = e.detail;
46
- onInput === null || onInput === void 0 ? void 0 : onInput({
46
+ onInput === null || onInput === void 0 || onInput({
47
47
  value
48
48
  });
49
49
  },
@@ -42,7 +42,7 @@ const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
42
42
  const {
43
43
  value
44
44
  } = e.detail;
45
- onInput === null || onInput === void 0 ? void 0 : onInput({
45
+ onInput === null || onInput === void 0 || onInput({
46
46
  value
47
47
  });
48
48
  },
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { BaseProps, FormEvent } from '../types';
3
+ import { GenericEvent } from '@ray-js/adapter';
3
4
  export type TextareaEvent = FormEvent<{
4
5
  value: string;
5
6
  }>;
@@ -57,17 +58,23 @@ export interface TextareaProps extends BaseProps {
57
58
  * @description.zh 输入框聚焦时触发
58
59
  * @default null
59
60
  */
60
- onFocus?: (event: any) => void;
61
+ onFocus?: (event: GenericEvent<{
62
+ value: any;
63
+ }>) => void;
61
64
  /**
62
65
  * @description.en Triggered when the input box loses focus
63
66
  * @description.zh 输入框失去焦点时触发
64
67
  * @default null
65
68
  */
66
- onBlur?: (event: any) => void;
69
+ onBlur?: (event: GenericEvent<{
70
+ value: any;
71
+ }>) => void;
67
72
  /**
68
73
  * @description.en Called when the number of lines in the input box changes, event.detail = {height: 0, lineCount: 0}
69
74
  * @description.zh 输入框行数变化时调用,event.detail = {height: 0, lineCount: 0}
70
75
  * @default null
71
76
  */
72
- onLinechange?: (event: any) => void;
77
+ onLinechange?: (event: GenericEvent<{
78
+ value: any;
79
+ }>) => void;
73
80
  }
@@ -2,6 +2,6 @@ import React from 'react';
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
4
  const Video = () => {
5
- return /*#__PURE__*/React.createElement("div", null, "Web\u7AEF\u6682\u672A\u5B9E\u73B0");
5
+ return /*#__PURE__*/React.createElement("div", null, "The web side is not implemented yet.");
6
6
  };
7
7
  export default Video;
@@ -3,6 +3,6 @@ import { View } from '@ray-js/components';
3
3
 
4
4
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
5
5
  function Video() {
6
- return /*#__PURE__*/React.createElement(View, null, "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u7AEF\u6682\u672A\u5B9E\u73B0");
6
+ return /*#__PURE__*/React.createElement(View, null, "Wechat mini program side has not been implemented");
7
7
  }
8
8
  export default Video;
package/lib/View/View.js CHANGED
@@ -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", "className", "style", "children", "hoverClassName", "hoverStartTime", "hoverStayTime", "hoverable", "onClick", "onLongClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onTransitionEnd"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
4
5
  import * as React from 'react';
5
6
  import clsx from 'clsx';
6
7
  import PropTypes from 'prop-types';
@@ -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", "className", "style", "hoverClassName", "hoverStartTime", "hoverStayTime", "children", "onLongClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "hoverable", "onTransitionEnd"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
4
5
  import * as React from 'react';
5
6
  import clsx from 'clsx';
6
7
  import PropTypes from 'prop-types';
@@ -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", "className", "style", "hoverClassName", "hoverStartTime", "hoverStayTime", "children", "onLongClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "hoverable", "onTransitionEnd"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
4
5
  import * as React from 'react';
5
6
  import clsx from 'clsx';
6
7
  import { inlineStyle, useTouch } from '@ray-js/framework-shared';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  const WebView = () => {
3
- return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
3
+ return /*#__PURE__*/React.createElement("div", null, "The web side is not implemented yet.");
4
4
  };
5
5
  export default WebView;
package/lib/core/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export function generateId() {
2
- return `V${Math.random().toString(32).substr(2, 6).toUpperCase()}`;
2
+ return "V".concat(Math.random().toString(32).substr(2, 6).toUpperCase());
3
3
  }
4
4
  export function nextFrame(duration) {
5
5
  return new Promise(resolve => setTimeout(resolve, duration !== null && duration !== void 0 ? duration : 1000 / 30));
@@ -1,6 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["className", "hoverClassName", "hoverStyle", "refresherDefaultStyle", "overlayStyle", "customStyle", "indicatorStyle", "maskStyle", "placeholderStyle", "borderStyle", "style", "children"];
4
+ import "core-js/modules/web.dom-collections.iterator.js";
4
5
  import { inlineStyle } from '@ray-js/framework-shared';
5
6
  import { paramCase } from 'param-case';
6
7
  import s2o from 'style-to-object';
@@ -13,7 +14,7 @@ const transformStyle = originStyle => {
13
14
  }
14
15
  return Object.entries(inlineStyle(tempStyle)).map(_ref => {
15
16
  let [k, v] = _ref;
16
- return `${k}:${v}`;
17
+ return "".concat(k, ":").concat(v);
17
18
  }).join(';');
18
19
  };
19
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/components",
3
- "version": "1.5.0-beta.12",
3
+ "version": "1.5.1",
4
4
  "description": "Ray basic components",
5
5
  "keywords": [
6
6
  "ray"
@@ -27,24 +27,24 @@
27
27
  "watch": "ray start --type=component"
28
28
  },
29
29
  "dependencies": {
30
- "@ray-core/macro": "^0.3.9",
31
- "@ray-core/wechat": "^0.3.9",
32
- "@ray-js/adapter": "^1.5.0-beta.12",
33
- "@ray-js/framework-shared": "^1.5.0-beta.12",
34
- "ahooks": "^3.7.8",
30
+ "@ray-core/macro": "^0.4.5",
31
+ "@ray-core/wechat": "^0.4.5",
32
+ "@ray-js/adapter": "1.5.1",
33
+ "@ray-js/framework-shared": "1.5.1",
34
+ "ahooks": "^3.7.11",
35
35
  "clsx": "^1.2.1",
36
- "core-js": "^3.35.0",
36
+ "core-js": "^3.37.0",
37
37
  "hooks": "^0.3.2",
38
38
  "param-case": "^3.0.4",
39
39
  "react": "^17.0.2",
40
40
  "style-to-object": "^0.3.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@ray-js/cli": "^1.5.0-beta.12"
43
+ "@ray-js/cli": "1.5.1"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.org"
48
48
  },
49
- "gitHead": "7fb9ae94b8896c81a6b6556099107cb2daab9c9b"
49
+ "gitHead": "c72417d2eda79e7cb4a0ae547e0483eb72d6330f"
50
50
  }
@@ -1,2 +0,0 @@
1
- import * as React from 'react';
2
- export default function Modal({ children }: React.PropsWithChildren<Record<string, any>>): React.ReactPortal;