@ray-js/components 0.3.26 → 0.3.29

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.
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["style", "className", "hoverClassName", "hoverStartTime", "hoverStayTime", "htmlType", "onClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "size", "loading", "disabled"];
5
+ var _excluded = ["style", "className", "hoverClassName", "hoverStartTime", "hoverStayTime", "formType", "type", "onClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "size", "loading", "disabled"];
6
6
  import * as React from 'react';
7
7
  import clsx from 'clsx';
8
8
  import { inlineStyle, useTouch } from '@ray-js/framework-shared';
@@ -16,7 +16,8 @@ var Button = function (props) {
16
16
  hoverClassName = _props$hoverClassName === void 0 ? styles["button-hover"] : _props$hoverClassName,
17
17
  hoverStartTime = props.hoverStartTime,
18
18
  hoverStayTime = props.hoverStayTime,
19
- htmlType = props.htmlType,
19
+ formType = props.formType,
20
+ type = props.type,
20
21
  onClick = props.onClick,
21
22
  onTouchCancel = props.onTouchCancel,
22
23
  onTouchEnd = props.onTouchEnd,
@@ -47,8 +48,9 @@ var Button = function (props) {
47
48
  if (disabled) return;
48
49
  if (loading) return;
49
50
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
50
- },
51
- type: htmlType
51
+ } // TODO 原生表单类型type 和 按钮主题类型type重合了
52
+ ,
53
+ type: formType || type
52
54
  }, handlers, restProps));
53
55
  };
54
56
 
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "children", "htmlType"];
3
+ var _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "formType"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { inlineStyle } from '@ray-js/framework-shared';
@@ -17,8 +17,7 @@ var Button = function (props) {
17
17
  hoverClassName = props.hoverClassName,
18
18
  _props$size = props.size,
19
19
  size = _props$size === void 0 ? 'default' : _props$size,
20
- children = props.children,
21
- htmlType = props.htmlType,
20
+ formType = props.formType,
22
21
  restProps = _objectWithoutProperties(props, _excluded);
23
22
 
24
23
  return /*#__PURE__*/React.createElement(RemaxButton, _extends({
@@ -34,8 +33,8 @@ var Button = function (props) {
34
33
  disabled: disabled,
35
34
  size: size,
36
35
  loading: loading,
37
- formType: htmlType
38
- }, restProps), children);
36
+ formType: formType
37
+ }, restProps));
39
38
  };
40
39
 
41
40
  Button.defaultProps = defaultButtonProps;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["style", "className", "hoverClassName", "hoverStartTime", "hoverStayTime", "htmlType", "onClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "size", "loading", "disabled"];
5
+ var _excluded = ["style", "className", "hoverClassName", "hoverStartTime", "hoverStayTime", "formType", "type", "onClick", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "size", "loading", "disabled"];
6
6
  import * as React from 'react';
7
7
  import clsx from 'clsx';
8
8
  import { inlineStyle, useTouch } from '@ray-js/framework-shared';
@@ -16,7 +16,8 @@ var Button = function (props) {
16
16
  hoverClassName = _props$hoverClassName === void 0 ? styles["button-hover"] : _props$hoverClassName,
17
17
  hoverStartTime = props.hoverStartTime,
18
18
  hoverStayTime = props.hoverStayTime,
19
- htmlType = props.htmlType,
19
+ formType = props.formType,
20
+ type = props.type,
20
21
  onClick = props.onClick,
21
22
  onTouchCancel = props.onTouchCancel,
22
23
  onTouchEnd = props.onTouchEnd,
@@ -47,8 +48,9 @@ var Button = function (props) {
47
48
  if (disabled) return;
48
49
  if (loading) return;
49
50
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
50
- },
51
- type: htmlType
51
+ } // TODO 原生表单类型type 和 按钮主题类型type重合了
52
+ ,
53
+ type: formType || type
52
54
  }, handlers, restProps));
53
55
  };
54
56
 
@@ -1,7 +1,7 @@
1
1
  import { Button as _Button } from "@remax/wechat/esm/hostComponents/Button/index";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "children", "htmlType"];
4
+ var _excluded = ["style", "id", "className", "disabled", "loading", "onClick", "hoverClassName", "size", "formType"];
5
5
  import * as React from 'react';
6
6
  import clsx from 'clsx';
7
7
  import { inlineStyle } from '@ray-js/framework-shared';
@@ -18,8 +18,7 @@ var Button = function (props) {
18
18
  hoverClassName = props.hoverClassName,
19
19
  _props$size = props.size,
20
20
  size = _props$size === void 0 ? 'default' : _props$size,
21
- children = props.children,
22
- htmlType = props.htmlType,
21
+ formType = props.formType,
23
22
  restProps = _objectWithoutProperties(props, _excluded);
24
23
 
25
24
  return /*#__PURE__*/React.createElement(_Button, _extends({
@@ -33,10 +32,10 @@ var Button = function (props) {
33
32
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
34
33
  },
35
34
  disabled: disabled,
36
- formType: htmlType,
35
+ formType: formType,
37
36
  loading: loading,
38
37
  size: size
39
- }, restProps), children);
38
+ }, restProps));
40
39
  };
41
40
 
42
41
  Button.defaultProps = defaultButtonProps;
@@ -14,5 +14,6 @@ export interface ButtonProps extends BaseProps {
14
14
  type: 'click';
15
15
  }) => void;
16
16
  children?: React.ReactNode;
17
+ formType?: 'submit' | 'reset';
17
18
  }
18
19
  export declare const defaultButtonProps: ButtonProps;
@@ -30,6 +30,7 @@ function Swiper(props) {
30
30
  React.useEffect(function () {
31
31
  if (bufferCurrent.current !== current) {
32
32
  setInternalCurrent(current);
33
+ bufferCurrent.current = current;
33
34
  }
34
35
  }, [current]);
35
36
  return /*#__PURE__*/React.createElement(RemaxSwiper, _extends({
@@ -31,6 +31,7 @@ function Swiper(props) {
31
31
  React.useEffect(function () {
32
32
  if (bufferCurrent.current !== current) {
33
33
  setInternalCurrent(current);
34
+ bufferCurrent.current = current;
34
35
  }
35
36
  }, [current]);
36
37
  return /*#__PURE__*/React.createElement(_Swiper, _extends({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/components",
3
- "version": "0.3.26",
3
+ "version": "0.3.29",
4
4
  "description": "Ray basic components",
5
5
  "keywords": [
6
6
  "ray"
@@ -24,8 +24,8 @@
24
24
  "watch": "ray start --type=component"
25
25
  },
26
26
  "dependencies": {
27
- "@ray-js/framework-shared": "^0.3.26",
28
- "@ray-js/remax-tuya": "^0.3.26",
27
+ "@ray-js/framework-shared": "^0.3.29",
28
+ "@ray-js/remax-tuya": "^0.3.29",
29
29
  "@remax/macro": "2.15.6",
30
30
  "@remax/wechat": "2.15.6",
31
31
  "antd-mobile": "^5.0.0-beta.17",
@@ -42,7 +42,7 @@
42
42
  "tuya-panel-switch": "^0.1.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@ray-js/cli": "^0.3.26"
45
+ "@ray-js/cli": "^0.3.29"
46
46
  },
47
47
  "maintainers": [
48
48
  {
@@ -50,6 +50,6 @@
50
50
  "email": "tuyafe@tuya.com"
51
51
  }
52
52
  ],
53
- "gitHead": "ba26f48be68337b418d7a607e4a15ad417b3b6a6",
53
+ "gitHead": "dca5dce8f3bd713ec20bb89c10fdc3a9fd3d5a29",
54
54
  "repository": {}
55
55
  }