@hw-component/form 1.5.3 → 1.5.5

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.
@@ -127,7 +127,7 @@ var ModalForm = (function (_ref) {
127
127
  destroyOnClose: true,
128
128
  footer: defaultFooter,
129
129
  children: jsx(Index, _objectSpread(_objectSpread({}, providerConfig), {}, {
130
- children: contentRender ? contentRender === null || contentRender === void 0 ? void 0 : contentRender(node, currentForm, params) : node
130
+ children: contentRender ? contentRender === null || contentRender === void 0 ? void 0 : contentRender(node, currentForm, formParams) : node
131
131
  }))
132
132
  }));
133
133
  });
@@ -1,6 +1,8 @@
1
+ import React from "react";
1
2
  import type { ISubmitProps, SubmitBarExtraType } from "@/components/Submit/index";
2
3
  interface ControlFooterProps extends ISubmitProps {
3
4
  action: SubmitBarExtraType;
5
+ style?: React.CSSProperties;
4
6
  }
5
7
  export declare const ControlFooter: ({ action, ...props }: ControlFooterProps) => JSX.Element;
6
8
  export {};
@@ -13,15 +13,20 @@ import { Button } from 'antd';
13
13
  import { useFormContext } from '../Form/Context/index.js';
14
14
  import React from 'react';
15
15
 
16
- var _excluded = ["form"],
17
- _excluded2 = ["type", "form", "text", "loading"],
16
+ var _excluded = ["form", "style"],
17
+ _excluded2 = ["type", "form", "text", "loading", "style"],
18
18
  _excluded3 = ["action"];
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
  function ResetBtn(_ref) {
22
22
  var form = _ref.form,
23
+ _ref$style = _ref.style,
24
+ style = _ref$style === void 0 ? {
25
+ borderRadius: 4
26
+ } : _ref$style,
23
27
  props = _objectWithoutProperties(_ref, _excluded);
24
28
  return jsx(Button, _objectSpread(_objectSpread({}, props), {}, {
29
+ style: style,
25
30
  onClick: function onClick() {
26
31
  form.resetFields();
27
32
  },
@@ -35,6 +40,10 @@ function SubBtn(_ref2) {
35
40
  _ref2$text = _ref2.text,
36
41
  text = _ref2$text === void 0 ? "提交" : _ref2$text,
37
42
  loading = _ref2.loading,
43
+ _ref2$style = _ref2.style,
44
+ style = _ref2$style === void 0 ? {
45
+ borderRadius: 4
46
+ } : _ref2$style,
38
47
  props = _objectWithoutProperties(_ref2, _excluded2);
39
48
  var _useFormContext = useFormContext(),
40
49
  _useFormContext$loadi = _useFormContext.loading,
@@ -43,6 +52,7 @@ function SubBtn(_ref2) {
43
52
  type: type,
44
53
  onClick: form.submit,
45
54
  loading: formSubLoading,
55
+ style: style,
46
56
  children: text
47
57
  }));
48
58
  }
@@ -130,7 +130,7 @@ var ModalForm = (function (_ref) {
130
130
  destroyOnClose: true,
131
131
  footer: defaultFooter,
132
132
  children: jsxRuntime.jsx(FormConfigProvider.default, _objectSpread(_objectSpread({}, providerConfig), {}, {
133
- children: contentRender ? contentRender === null || contentRender === void 0 ? void 0 : contentRender(node, currentForm, params) : node
133
+ children: contentRender ? contentRender === null || contentRender === void 0 ? void 0 : contentRender(node, currentForm, formParams) : node
134
134
  }))
135
135
  }));
136
136
  });
@@ -1,6 +1,8 @@
1
+ import React from "react";
1
2
  import type { ISubmitProps, SubmitBarExtraType } from "@/components/Submit/index";
2
3
  interface ControlFooterProps extends ISubmitProps {
3
4
  action: SubmitBarExtraType;
5
+ style?: React.CSSProperties;
4
6
  }
5
7
  export declare const ControlFooter: ({ action, ...props }: ControlFooterProps) => JSX.Element;
6
8
  export {};
@@ -14,15 +14,20 @@ var antd = require('antd');
14
14
  var index = require('../Form/Context/index.js');
15
15
  var React = require('react');
16
16
 
17
- var _excluded = ["form"],
18
- _excluded2 = ["type", "form", "text", "loading"],
17
+ var _excluded = ["form", "style"],
18
+ _excluded2 = ["type", "form", "text", "loading", "style"],
19
19
  _excluded3 = ["action"];
20
20
  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; }
21
21
  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; }
22
22
  function ResetBtn(_ref) {
23
23
  var form = _ref.form,
24
+ _ref$style = _ref.style,
25
+ style = _ref$style === void 0 ? {
26
+ borderRadius: 4
27
+ } : _ref$style,
24
28
  props = _objectWithoutProperties(_ref, _excluded);
25
29
  return jsxRuntime.jsx(antd.Button, _objectSpread(_objectSpread({}, props), {}, {
30
+ style: style,
26
31
  onClick: function onClick() {
27
32
  form.resetFields();
28
33
  },
@@ -36,6 +41,10 @@ function SubBtn(_ref2) {
36
41
  _ref2$text = _ref2.text,
37
42
  text = _ref2$text === void 0 ? "提交" : _ref2$text,
38
43
  loading = _ref2.loading,
44
+ _ref2$style = _ref2.style,
45
+ style = _ref2$style === void 0 ? {
46
+ borderRadius: 4
47
+ } : _ref2$style,
39
48
  props = _objectWithoutProperties(_ref2, _excluded2);
40
49
  var _useFormContext = index.useFormContext(),
41
50
  _useFormContext$loadi = _useFormContext.loading,
@@ -44,6 +53,7 @@ function SubBtn(_ref2) {
44
53
  type: type,
45
54
  onClick: form.submit,
46
55
  loading: formSubLoading,
56
+ style: style,
47
57
  children: text
48
58
  }));
49
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.5.3",
3
+ "version": "1.5.5",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -98,7 +98,7 @@ export default ({
98
98
  footer={defaultFooter}
99
99
  >
100
100
  <FormConfigProvider {...providerConfig}>
101
- {contentRender ? contentRender?.(node, currentForm,params) : node}
101
+ {contentRender ? contentRender?.(node, currentForm,formParams) : node}
102
102
  </FormConfigProvider>
103
103
  </Modal>
104
104
  );
@@ -7,11 +7,13 @@ import type {
7
7
  } from "@/components/Submit/index";
8
8
  interface ControlFooterProps extends ISubmitProps {
9
9
  action: SubmitBarExtraType;
10
+ style?:React.CSSProperties
10
11
  }
11
- function ResetBtn({ form, ...props }) {
12
+ function ResetBtn({ form, style={borderRadius:4},...props }:Omit<ControlFooterProps, 'action'>) {
12
13
  return (
13
14
  <Button
14
15
  {...props}
16
+ style={style}
15
17
  onClick={() => {
16
18
  form.resetFields();
17
19
  }}
@@ -26,6 +28,7 @@ function SubBtn({
26
28
  form,
27
29
  text = "提交",
28
30
  loading,
31
+ style={borderRadius:4},
29
32
  ...props
30
33
  }: ISubmitProps) {
31
34
  const { loading: formSubLoading = loading } = useFormContext();
@@ -36,6 +39,7 @@ function SubBtn({
36
39
  type={type as any}
37
40
  onClick={form.submit}
38
41
  loading={formSubLoading}
42
+ style={style}
39
43
  >
40
44
  {text}
41
45
  </Button>
@@ -65,6 +65,9 @@ const formData = (options) => {
65
65
  className: "hdjd",
66
66
  name: "test123",
67
67
  },
68
+ {
69
+ type: "submit"
70
+ },
68
71
  ];
69
72
  };
70
73
  function Ttta({ form }) {
@@ -99,11 +102,6 @@ export default () => {
99
102
  defaultComponent={{
100
103
  test: Test,
101
104
  }}
102
- itemProps={{
103
- style: {
104
- borderRadius: 10,
105
- },
106
- }}
107
105
  fieldNames={{
108
106
  label: "value",
109
107
  value: "key",