@ray-js/components 0.9.8-beta-1 → 0.9.8-beta-3

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.
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { PickerProps } from '@ray-js/adapter';
2
+ import { PickerProps } from '@ray-js/adapter';
3
3
  declare const Picker: React.FC<PickerProps>;
4
4
  export default Picker;
@@ -1,17 +1,60 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style"];
4
+ var _excluded = ["className", "style", "id", "onChange", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
5
+ import clsx from 'clsx';
4
6
  import * as React from 'react';
5
- import { inlineStyle } from '@ray-js/framework-shared';
7
+ import { inlineStyle, useTouch } from '@ray-js/framework-shared';
6
8
  import { Picker as RemaxPicker } from '@ray-js/adapter';
7
9
 
8
10
  var Picker = function (props) {
9
- var style = props.style,
11
+ var className = props.className,
12
+ style = props.style,
13
+ id = props.id,
14
+ onChange = props.onChange,
15
+ onTouchStart = props.onTouchStart,
16
+ onTouchMove = props.onTouchMove,
17
+ onTouchEnd = props.onTouchEnd,
18
+ onTouchCancel = props.onTouchCancel,
19
+ onClick = props.onClick,
20
+ onCancel = props.onCancel,
10
21
  restProps = _objectWithoutProperties(props, _excluded);
11
22
 
23
+ var _useTouch = useTouch({
24
+ onTouchStart: onTouchStart,
25
+ onTouchMove: onTouchMove,
26
+ onTouchEnd: onTouchEnd,
27
+ onTouchCancel: onTouchCancel,
28
+ onClick: onClick
29
+ }),
30
+ _useTouch2 = _slicedToArray(_useTouch, 2),
31
+ touching = _useTouch2[0],
32
+ handlers = _useTouch2[1];
33
+
12
34
  return /*#__PURE__*/React.createElement(RemaxPicker, _extends({
13
- style: inlineStyle(style)
14
- }, restProps));
35
+ onChange: function handleChange(e) {
36
+ onChange === null || onChange === void 0 ? void 0 : onChange({
37
+ type: e.type,
38
+ value: e.detail.value,
39
+ origin: e
40
+ });
41
+ },
42
+ onCancel: function handleCancel(e) {
43
+ onCancel === null || onCancel === void 0 ? void 0 : onCancel({
44
+ type: e.type,
45
+ origin: e
46
+ });
47
+ },
48
+ onColumnChange: function handleColumnChange(e) {
49
+ onCancel === null || onCancel === void 0 ? void 0 : onCancel({
50
+ type: e.type,
51
+ value: e.detail.value,
52
+ origin: e
53
+ });
54
+ },
55
+ style: inlineStyle(style),
56
+ className: clsx(className)
57
+ }, restProps, handlers), props.children);
15
58
  };
16
59
 
17
60
  export default Picker;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { PickerProps } from '@ray-js/adapter';
2
+ import { PickerProps } from '@ray-js/adapter';
3
3
  declare const Picker: React.FC<PickerProps>;
4
4
  export default Picker;
@@ -1,17 +1,60 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style"];
4
+ var _excluded = ["className", "style", "id", "onChange", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
5
+ import clsx from 'clsx';
4
6
  import * as React from 'react';
5
- import { inlineStyle } from '@ray-js/framework-shared';
7
+ import { inlineStyle, useTouch } from '@ray-js/framework-shared';
6
8
  import { Picker as RemaxPicker } from '@ray-js/adapter';
7
9
 
8
10
  var Picker = function (props) {
9
- var style = props.style,
11
+ var className = props.className,
12
+ style = props.style,
13
+ id = props.id,
14
+ onChange = props.onChange,
15
+ onTouchStart = props.onTouchStart,
16
+ onTouchMove = props.onTouchMove,
17
+ onTouchEnd = props.onTouchEnd,
18
+ onTouchCancel = props.onTouchCancel,
19
+ onClick = props.onClick,
20
+ onCancel = props.onCancel,
10
21
  restProps = _objectWithoutProperties(props, _excluded);
11
22
 
23
+ var _useTouch = useTouch({
24
+ onTouchStart: onTouchStart,
25
+ onTouchMove: onTouchMove,
26
+ onTouchEnd: onTouchEnd,
27
+ onTouchCancel: onTouchCancel,
28
+ onClick: onClick
29
+ }),
30
+ _useTouch2 = _slicedToArray(_useTouch, 2),
31
+ touching = _useTouch2[0],
32
+ handlers = _useTouch2[1];
33
+
12
34
  return /*#__PURE__*/React.createElement(RemaxPicker, _extends({
13
- style: inlineStyle(style)
14
- }, restProps));
35
+ onChange: function handleChange(e) {
36
+ onChange === null || onChange === void 0 ? void 0 : onChange({
37
+ type: e.type,
38
+ value: e.detail.value,
39
+ origin: e
40
+ });
41
+ },
42
+ onCancel: function handleCancel(e) {
43
+ onCancel === null || onCancel === void 0 ? void 0 : onCancel({
44
+ type: e.type,
45
+ origin: e
46
+ });
47
+ },
48
+ onColumnChange: function handleColumnChange(e) {
49
+ onCancel === null || onCancel === void 0 ? void 0 : onCancel({
50
+ type: e.type,
51
+ value: e.detail.value,
52
+ origin: e
53
+ });
54
+ },
55
+ style: inlineStyle(style),
56
+ className: clsx(className)
57
+ }, restProps, handlers), props.children);
15
58
  };
16
59
 
17
60
  export default Picker;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { PickerViewProps } from '@ray-js/adapter';
3
- declare const PickerView: React.FC<PickerViewProps>;
4
- export default PickerView;
2
+ import { PickerViewProps } from '@ray-js/adapter';
3
+ declare const Picker: React.FC<PickerViewProps>;
4
+ export default Picker;
@@ -1,17 +1,33 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style"];
3
+ var _excluded = ["className", "style", "id", "onChange", "children"];
4
+ import clsx from 'clsx';
4
5
  import * as React from 'react';
5
6
  import { inlineStyle } from '@ray-js/framework-shared';
6
7
  import { PickerView as RemaxPickerView } from '@ray-js/adapter';
8
+ import styles from './index.module.less';
7
9
 
8
- var PickerView = function (props) {
9
- var style = props.style,
10
+ var Picker = function (props) {
11
+ var className = props.className,
12
+ style = props.style,
13
+ id = props.id,
14
+ onChange = props.onChange,
15
+ children = props.children,
10
16
  restProps = _objectWithoutProperties(props, _excluded);
11
17
 
12
18
  return /*#__PURE__*/React.createElement(RemaxPickerView, _extends({
13
- style: inlineStyle(style)
14
- }, restProps));
19
+ onChange: function handleChange(e) {
20
+ onChange === null || onChange === void 0 ? void 0 : onChange({
21
+ type: 'change',
22
+ value: e.detail.value,
23
+ origin: e
24
+ });
25
+ },
26
+ style: inlineStyle(style),
27
+ className: clsx(styles.pickerViewWrp, className)
28
+ }, restProps), function renderChildren() {
29
+ return children;
30
+ }());
15
31
  };
16
32
 
17
- export default PickerView;
33
+ export default Picker;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { PickerViewProps } from '@ray-js/adapter';
3
- declare const PickerView: React.FC<PickerViewProps>;
4
- export default PickerView;
2
+ import { PickerViewProps } from '@ray-js/adapter';
3
+ declare const Picker: React.FC<PickerViewProps>;
4
+ export default Picker;
@@ -1,17 +1,33 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style"];
3
+ var _excluded = ["className", "style", "id", "onChange", "children"];
4
+ import clsx from 'clsx';
4
5
  import * as React from 'react';
5
6
  import { inlineStyle } from '@ray-js/framework-shared';
6
7
  import { PickerView as RemaxPickerView } from '@ray-js/adapter';
8
+ import styles from './index.module.less';
7
9
 
8
- var PickerView = function (props) {
9
- var style = props.style,
10
+ var Picker = function (props) {
11
+ var className = props.className,
12
+ style = props.style,
13
+ id = props.id,
14
+ onChange = props.onChange,
15
+ children = props.children,
10
16
  restProps = _objectWithoutProperties(props, _excluded);
11
17
 
12
18
  return /*#__PURE__*/React.createElement(RemaxPickerView, _extends({
13
- style: inlineStyle(style)
14
- }, restProps));
19
+ onChange: function handleChange(e) {
20
+ onChange === null || onChange === void 0 ? void 0 : onChange({
21
+ type: 'change',
22
+ value: e.detail.value,
23
+ origin: e
24
+ });
25
+ },
26
+ style: inlineStyle(style),
27
+ className: clsx(styles.pickerViewWrp, className)
28
+ }, restProps), function renderChildren() {
29
+ return children;
30
+ }());
15
31
  };
16
32
 
17
- export default PickerView;
33
+ export default Picker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/components",
3
- "version": "0.9.8-beta-1",
3
+ "version": "0.9.8-beta-3",
4
4
  "description": "Ray basic components",
5
5
  "keywords": [
6
6
  "ray"
@@ -26,8 +26,8 @@
26
26
  "dependencies": {
27
27
  "@ray-core/macro": "^0.1.3",
28
28
  "@ray-core/wechat": "^0.1.3",
29
- "@ray-js/adapter": "^0.9.8-beta-1",
30
- "@ray-js/framework-shared": "^0.9.8-beta-1",
29
+ "@ray-js/adapter": "^0.9.8-beta-3",
30
+ "@ray-js/framework-shared": "^0.9.8-beta-3",
31
31
  "ahooks": "^3.7.1",
32
32
  "clsx": "^1.1.1",
33
33
  "core-js": "^3.19.1",
@@ -37,7 +37,7 @@
37
37
  "style-to-object": "^0.3.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@ray-js/cli": "^0.9.8-beta-1"
40
+ "@ray-js/cli": "^0.9.8-beta-3"
41
41
  },
42
42
  "maintainers": [
43
43
  {
@@ -45,6 +45,6 @@
45
45
  "email": "tuyafe@tuya.com"
46
46
  }
47
47
  ],
48
- "gitHead": "88e12687d171d5a58e08c1ea0c9655ec0ea725c1",
48
+ "gitHead": "3b223dc2b6fe9c484f0bf326d4640781b9f31b89",
49
49
  "repository": {}
50
50
  }