@hw-component/form 1.1.8 → 1.1.9

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.
@@ -15,7 +15,7 @@ import { Input, Button } from 'antd';
15
15
  import { useRequest } from 'ahooks';
16
16
 
17
17
  var _excluded = ["buttonProps", "value", "onChange", "children", "request"],
18
- _excluded2 = ["onClick", "type"];
18
+ _excluded2 = ["onClick", "type", "loading"];
19
19
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
21
  var Index = function Index(_ref) {
@@ -29,6 +29,7 @@ var Index = function Index(_ref) {
29
29
  var onClick = buttonProps.onClick,
30
30
  _buttonProps$type = buttonProps.type,
31
31
  type = _buttonProps$type === void 0 ? "primary" : _buttonProps$type,
32
+ btnLoading = buttonProps.loading,
32
33
  oProps = _objectWithoutProperties(buttonProps, _excluded2);
33
34
  var _useRequest = useRequest(function (val) {
34
35
  return request === null || request === void 0 ? void 0 : request(val);
@@ -81,7 +82,7 @@ var Index = function Index(_ref) {
81
82
  })), jsx(Button, _objectSpread(_objectSpread({}, oProps), {}, {
82
83
  type: type,
83
84
  onClick: click,
84
- loading: loading,
85
+ loading: loading || btnLoading,
85
86
  style: {
86
87
  marginLeft: 4
87
88
  },
@@ -18,7 +18,7 @@ var antd = require('antd');
18
18
  var ahooks = require('ahooks');
19
19
 
20
20
  var _excluded = ["buttonProps", "value", "onChange", "children", "request"],
21
- _excluded2 = ["onClick", "type"];
21
+ _excluded2 = ["onClick", "type", "loading"];
22
22
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
23
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
24
24
  var Index = function Index(_ref) {
@@ -32,6 +32,7 @@ var Index = function Index(_ref) {
32
32
  var onClick = buttonProps.onClick,
33
33
  _buttonProps$type = buttonProps.type,
34
34
  type = _buttonProps$type === void 0 ? "primary" : _buttonProps$type,
35
+ btnLoading = buttonProps.loading,
35
36
  oProps = _objectWithoutProperties(buttonProps, _excluded2);
36
37
  var _useRequest = ahooks.useRequest(function (val) {
37
38
  return request === null || request === void 0 ? void 0 : request(val);
@@ -84,7 +85,7 @@ var Index = function Index(_ref) {
84
85
  })), jsxRuntime.jsx(antd.Button, _objectSpread(_objectSpread({}, oProps), {}, {
85
86
  type: type,
86
87
  onClick: click,
87
- loading: loading,
88
+ loading: loading || btnLoading,
88
89
  style: {
89
90
  marginLeft: 4
90
91
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@ const Index: React.FC<HButtonInputProps> = ({
11
11
  request,
12
12
  ...props
13
13
  }) => {
14
- const { onClick, type = "primary", ...oProps } = buttonProps;
14
+ const { onClick, type = "primary", loading:btnLoading,...oProps } = buttonProps;
15
15
  const { run, loading } = useRequest(
16
16
  (val) => {
17
17
  return request?.(val);
@@ -36,7 +36,7 @@ const Index: React.FC<HButtonInputProps> = ({
36
36
  {...oProps}
37
37
  type={type}
38
38
  onClick={click}
39
- loading={loading}
39
+ loading={loading||btnLoading}
40
40
  style={{ marginLeft: 4 }}
41
41
  >
42
42
  {children}
@@ -83,7 +83,11 @@ const formData = () => {
83
83
  },
84
84
  itemProps: {
85
85
  request:()=>{
86
- return Promise.resolve({});
86
+ return new Promise((resolve)=>{
87
+ setTimeout(()=>{
88
+ resolve({})
89
+ },4000);
90
+ })
87
91
  }
88
92
  },
89
93
  render:(item,node,form)=>{