@ray-js/components 1.7.38-beta.1 → 1.7.39

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,10 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- const _excluded = ["id", "className", "style", "children", "hoverable", "hoverClassName"];
3
+ const _excluded = ["id", "className", "style", "hoverClassName", "hoverStartTime", "hoverStayTime", "children", "onLongClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "hoverable", "onTransitionEnd"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import PropTypes from 'prop-types';
7
- import { inlineStyle } from '@ray-js/framework-shared';
7
+ import { inlineStyle, useTouch } from '@ray-js/framework-shared';
8
8
  import { View as RemaxView } from '@ray-js/adapter';
9
9
  import styles from './index.module.less';
10
10
  const View = /*#__PURE__*/React.forwardRef((props, ref) => {
@@ -12,11 +12,30 @@ const View = /*#__PURE__*/React.forwardRef((props, ref) => {
12
12
  id,
13
13
  className,
14
14
  style,
15
+ hoverClassName,
16
+ hoverStartTime,
17
+ hoverStayTime,
15
18
  children,
19
+ onLongClick,
20
+ onTouchStart,
21
+ onTouchMove,
22
+ onTouchEnd,
23
+ onTouchCancel,
24
+ onClick,
16
25
  hoverable,
17
- hoverClassName
26
+ onTransitionEnd
18
27
  } = props,
19
28
  restProps = _objectWithoutProperties(props, _excluded);
29
+ const [touching, handlers] = useTouch({
30
+ hoverDelay: hoverStartTime,
31
+ hoverDuration: hoverStayTime,
32
+ onLongClick,
33
+ onTouchStart,
34
+ onTouchMove,
35
+ onTouchEnd,
36
+ onTouchCancel,
37
+ onClick
38
+ });
20
39
  return /*#__PURE__*/React.createElement(RemaxView
21
40
  // @ts-ignore
22
41
  , _extends({
@@ -26,8 +45,11 @@ const View = /*#__PURE__*/React.forwardRef((props, ref) => {
26
45
  style: inlineStyle(style),
27
46
  hoverClassName: clsx({
28
47
  [styles.hover]: hoverable
29
- }, hoverClassName)
30
- }, restProps), children);
48
+ }, hoverClassName),
49
+ hoverStartTime: hoverStartTime,
50
+ hoverStayTime: hoverStayTime,
51
+ onTransitionEnd: onTransitionEnd
52
+ }, handlers, restProps), children);
31
53
  });
32
54
  View.displayName = 'View';
33
55
  export default View;
@@ -44,5 +66,7 @@ View.propTypes = {
44
66
  onTouchMove: PropTypes.func,
45
67
  onTouchEnd: PropTypes.func,
46
68
  onTouchCancel: PropTypes.func,
47
- onClick: PropTypes.func
69
+ onClick: PropTypes.func,
70
+ hoverable: PropTypes.bool,
71
+ onTransitionEnd: PropTypes.func
48
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/components",
3
- "version": "1.7.38-beta.1",
3
+ "version": "1.7.39",
4
4
  "description": "Ray basic components",
5
5
  "keywords": [
6
6
  "ray"
@@ -29,8 +29,8 @@
29
29
  "dependencies": {
30
30
  "@ray-core/macro": "^0.4.9",
31
31
  "@ray-core/wechat": "^0.4.9",
32
- "@ray-js/adapter": "^1.7.38-beta.1",
33
- "@ray-js/framework-shared": "^1.7.38-beta.1",
32
+ "@ray-js/adapter": "1.7.39",
33
+ "@ray-js/framework-shared": "1.7.39",
34
34
  "ahooks": "^3.8.5",
35
35
  "clsx": "^1.2.1",
36
36
  "core-js": "^3.43.0",
@@ -40,11 +40,11 @@
40
40
  "style-to-object": "^0.3.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@ray-js/cli": "^1.7.38-beta.1"
43
+ "@ray-js/cli": "1.7.39"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.org"
48
48
  },
49
- "gitHead": "0299e5080deb00f3a3a81593fb321c6ecedf86b8"
49
+ "gitHead": "29022302e7f940eed314d4deb15214fcfe389e2e"
50
50
  }