@hw-component/form 0.0.1-bate → 0.0.1-beta

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.
Files changed (229) hide show
  1. package/es/CheckboxGroup/CheckBox/index.js +24 -16
  2. package/es/CheckboxGroup/hooks.d.ts +9 -3
  3. package/es/CheckboxGroup/hooks.js +115 -64
  4. package/es/CheckboxGroup/index.d.ts +6 -1
  5. package/es/CheckboxGroup/index.js +117 -56
  6. package/es/CheckboxGroup/modal.d.ts +9 -8
  7. package/es/Form/Context/FormConfigProvider.js +64 -19
  8. package/es/Form/Context/index.d.ts +4 -1
  9. package/es/Form/Context/index.js +3 -3
  10. package/es/Form/FormItem/BasicItem.js +80 -42
  11. package/es/Form/FormItem/Helper.d.ts +1 -1
  12. package/es/Form/FormItem/Helper.js +17 -9
  13. package/es/Form/FormItem/RegularFormItem.js +11 -8
  14. package/es/Form/FormItem/UpFormItem.d.ts +6 -1
  15. package/es/Form/FormItem/UpFormItem.js +27 -17
  16. package/es/Form/FormItem/hooks.d.ts +21 -4
  17. package/es/Form/FormItem/hooks.js +12 -9
  18. package/es/Form/FormItem/index.js +5 -5
  19. package/es/Form/HFormConnect.d.ts +9 -1
  20. package/es/Form/HFormConnect.js +94 -26
  21. package/es/Form/InitSet.d.ts +1 -1
  22. package/es/Form/InitSet.js +5 -5
  23. package/es/Form/Label.d.ts +4 -4
  24. package/es/Form/Label.js +36 -19
  25. package/es/Form/config.d.ts +100 -22
  26. package/es/Form/config.js +19 -19
  27. package/es/Form/hooks/index.d.ts +12 -5
  28. package/es/Form/hooks/index.js +65 -49
  29. package/es/Form/hooks/useHForm.js +233 -95
  30. package/es/Form/hooks/useInitConfigData.d.ts +4 -1
  31. package/es/Form/hooks/useInitConfigData.js +143 -61
  32. package/es/Form/index.d.ts +11 -1
  33. package/es/Form/index.js +71 -40
  34. package/es/Form/modal.d.ts +92 -51
  35. package/es/Input/ButtonInput.js +73 -51
  36. package/es/Input/InputNumber.js +21 -12
  37. package/es/Input/SelectInput.d.ts +16 -4
  38. package/es/Input/SelectInput.js +113 -56
  39. package/es/Input/defaultConfig.d.ts +3 -3
  40. package/es/Input/defaultConfig.js +2 -2
  41. package/es/Input/index.js +7 -7
  42. package/es/Input/modal.d.ts +15 -11
  43. package/es/PageHandler/ErrorComponent.js +47 -25
  44. package/es/PageHandler/LoadingComponent.js +17 -13
  45. package/es/PageHandler/index.js +7 -7
  46. package/es/PageHandler/modal.d.ts +4 -4
  47. package/es/RadioGroup/index.d.ts +12 -5
  48. package/es/RadioGroup/index.js +46 -33
  49. package/es/Select/components/AllSelect.d.ts +1 -1
  50. package/es/Select/components/AllSelect.js +40 -18
  51. package/es/Select/components/CheckBoxOption.d.ts +6 -3
  52. package/es/Select/components/CheckBoxOption.js +12 -7
  53. package/es/Select/components/DropdownComponent.d.ts +4 -4
  54. package/es/Select/components/DropdownComponent.js +30 -17
  55. package/es/Select/components/NoFindItem.d.ts +1 -1
  56. package/es/Select/components/NoFindItem.js +11 -7
  57. package/es/Select/components/NotFoundContent.d.ts +2 -2
  58. package/es/Select/components/NotFoundContent.js +49 -27
  59. package/es/Select/defaultConfig.d.ts +1 -1
  60. package/es/Select/defaultConfig.js +20 -16
  61. package/es/Select/hooks/changeHooks.d.ts +2 -2
  62. package/es/Select/hooks/changeHooks.js +147 -71
  63. package/es/Select/hooks/norHooks.d.ts +27 -9
  64. package/es/Select/hooks/norHooks.js +51 -39
  65. package/es/Select/index.d.ts +22 -1
  66. package/es/Select/index.js +124 -65
  67. package/es/Select/modal.d.ts +15 -15
  68. package/es/Select/utils.js +60 -15
  69. package/es/Submit/index.d.ts +9 -3
  70. package/es/Submit/index.js +18 -13
  71. package/es/Switch/index.d.ts +4 -4
  72. package/es/Switch/index.js +46 -20
  73. package/es/TDPicker/RangePicker.d.ts +8 -3
  74. package/es/TDPicker/RangePicker.js +138 -62
  75. package/es/TDPicker/TimePicker.d.ts +6 -1
  76. package/es/TDPicker/TimePicker.js +19 -13
  77. package/es/TDPicker/hooks.d.ts +42 -22
  78. package/es/TDPicker/hooks.js +106 -72
  79. package/es/TDPicker/index.d.ts +7 -1
  80. package/es/TDPicker/index.js +20 -14
  81. package/es/TDPicker/modal.d.ts +21 -16
  82. package/es/Upload/Btn.d.ts +5 -1
  83. package/es/Upload/Btn.js +35 -19
  84. package/es/Upload/MediaTypeEle/TypeEle.d.ts +10 -5
  85. package/es/Upload/MediaTypeEle/TypeEle.js +31 -23
  86. package/es/Upload/MediaTypeEle/index.d.ts +5 -1
  87. package/es/Upload/MediaTypeEle/index.js +21 -18
  88. package/es/Upload/Preview/index.d.ts +5 -1
  89. package/es/Upload/Preview/index.js +17 -13
  90. package/es/Upload/UrlUpload/index.d.ts +7 -1
  91. package/es/Upload/UrlUpload/index.js +72 -51
  92. package/es/Upload/enums.d.ts +3 -3
  93. package/es/Upload/enums.js +3 -3
  94. package/es/Upload/hooks/change.d.ts +8 -1
  95. package/es/Upload/hooks/change.js +115 -58
  96. package/es/Upload/hooks/customRequest.d.ts +5 -1
  97. package/es/Upload/hooks/customRequest.js +63 -46
  98. package/es/Upload/hooks/propsMaker.d.ts +5 -1
  99. package/es/Upload/hooks/propsMaker.js +52 -13
  100. package/es/Upload/index.d.ts +3 -1
  101. package/es/Upload/index.js +131 -61
  102. package/es/Upload/modal.d.ts +17 -15
  103. package/es/Upload/util.d.ts +8 -2
  104. package/es/Upload/util.js +15 -7
  105. package/es/config.js +34 -31
  106. package/es/hooks/index.d.ts +14 -7
  107. package/es/hooks/index.js +124 -49
  108. package/es/index.d.ts +98 -16
  109. package/es/index.js +22 -5
  110. package/es/modal.d.ts +6 -6
  111. package/lib/CheckboxGroup/CheckBox/index.js +26 -18
  112. package/lib/CheckboxGroup/hooks.d.ts +9 -3
  113. package/lib/CheckboxGroup/hooks.js +116 -65
  114. package/lib/CheckboxGroup/index.d.ts +6 -1
  115. package/lib/CheckboxGroup/index.js +119 -58
  116. package/lib/CheckboxGroup/modal.d.ts +9 -8
  117. package/lib/Form/Context/FormConfigProvider.js +66 -21
  118. package/lib/Form/Context/index.d.ts +4 -1
  119. package/lib/Form/Context/index.js +4 -4
  120. package/lib/Form/FormItem/BasicItem.js +82 -44
  121. package/lib/Form/FormItem/Helper.d.ts +1 -1
  122. package/lib/Form/FormItem/Helper.js +19 -11
  123. package/lib/Form/FormItem/RegularFormItem.js +13 -10
  124. package/lib/Form/FormItem/UpFormItem.d.ts +6 -1
  125. package/lib/Form/FormItem/UpFormItem.js +29 -19
  126. package/lib/Form/FormItem/hooks.d.ts +21 -4
  127. package/lib/Form/FormItem/hooks.js +13 -10
  128. package/lib/Form/FormItem/index.js +7 -7
  129. package/lib/Form/HFormConnect.d.ts +9 -1
  130. package/lib/Form/HFormConnect.js +96 -28
  131. package/lib/Form/InitSet.d.ts +1 -1
  132. package/lib/Form/InitSet.js +7 -7
  133. package/lib/Form/Label.d.ts +4 -4
  134. package/lib/Form/Label.js +41 -21
  135. package/lib/Form/config.d.ts +100 -22
  136. package/lib/Form/config.js +21 -21
  137. package/lib/Form/hooks/index.d.ts +12 -5
  138. package/lib/Form/hooks/index.js +66 -50
  139. package/lib/Form/hooks/useHForm.js +235 -97
  140. package/lib/Form/hooks/useInitConfigData.d.ts +4 -1
  141. package/lib/Form/hooks/useInitConfigData.js +144 -63
  142. package/lib/Form/index.d.ts +11 -1
  143. package/lib/Form/index.js +73 -42
  144. package/lib/Form/modal.d.ts +92 -51
  145. package/lib/Input/ButtonInput.js +75 -53
  146. package/lib/Input/InputNumber.js +23 -14
  147. package/lib/Input/SelectInput.d.ts +16 -4
  148. package/lib/Input/SelectInput.js +125 -60
  149. package/lib/Input/defaultConfig.d.ts +3 -3
  150. package/lib/Input/defaultConfig.js +3 -3
  151. package/lib/Input/index.js +9 -9
  152. package/lib/Input/modal.d.ts +15 -11
  153. package/lib/PageHandler/ErrorComponent.js +49 -27
  154. package/lib/PageHandler/LoadingComponent.js +19 -15
  155. package/lib/PageHandler/index.js +9 -9
  156. package/lib/PageHandler/modal.d.ts +4 -4
  157. package/lib/RadioGroup/index.d.ts +12 -5
  158. package/lib/RadioGroup/index.js +48 -35
  159. package/lib/Select/components/AllSelect.d.ts +1 -1
  160. package/lib/Select/components/AllSelect.js +42 -20
  161. package/lib/Select/components/CheckBoxOption.d.ts +6 -3
  162. package/lib/Select/components/CheckBoxOption.js +14 -9
  163. package/lib/Select/components/DropdownComponent.d.ts +4 -4
  164. package/lib/Select/components/DropdownComponent.js +32 -19
  165. package/lib/Select/components/NoFindItem.d.ts +1 -1
  166. package/lib/Select/components/NoFindItem.js +13 -9
  167. package/lib/Select/components/NotFoundContent.d.ts +2 -2
  168. package/lib/Select/components/NotFoundContent.js +51 -29
  169. package/lib/Select/defaultConfig.d.ts +1 -1
  170. package/lib/Select/defaultConfig.js +21 -17
  171. package/lib/Select/hooks/changeHooks.d.ts +2 -2
  172. package/lib/Select/hooks/changeHooks.js +148 -72
  173. package/lib/Select/hooks/norHooks.d.ts +27 -9
  174. package/lib/Select/hooks/norHooks.js +52 -40
  175. package/lib/Select/index.d.ts +22 -1
  176. package/lib/Select/index.js +128 -67
  177. package/lib/Select/modal.d.ts +15 -15
  178. package/lib/Select/utils.js +61 -16
  179. package/lib/Submit/index.d.ts +9 -3
  180. package/lib/Submit/index.js +20 -15
  181. package/lib/Switch/index.d.ts +4 -4
  182. package/lib/Switch/index.js +48 -22
  183. package/lib/TDPicker/RangePicker.d.ts +8 -3
  184. package/lib/TDPicker/RangePicker.js +136 -64
  185. package/lib/TDPicker/TimePicker.d.ts +6 -1
  186. package/lib/TDPicker/TimePicker.js +21 -15
  187. package/lib/TDPicker/hooks.d.ts +42 -22
  188. package/lib/TDPicker/hooks.js +98 -72
  189. package/lib/TDPicker/index.d.ts +7 -1
  190. package/lib/TDPicker/index.js +22 -16
  191. package/lib/TDPicker/modal.d.ts +21 -16
  192. package/lib/Upload/Btn.d.ts +5 -1
  193. package/lib/Upload/Btn.js +37 -21
  194. package/lib/Upload/MediaTypeEle/TypeEle.d.ts +10 -5
  195. package/lib/Upload/MediaTypeEle/TypeEle.js +33 -25
  196. package/lib/Upload/MediaTypeEle/index.d.ts +5 -1
  197. package/lib/Upload/MediaTypeEle/index.js +23 -20
  198. package/lib/Upload/Preview/index.d.ts +5 -1
  199. package/lib/Upload/Preview/index.js +19 -15
  200. package/lib/Upload/UrlUpload/index.d.ts +7 -1
  201. package/lib/Upload/UrlUpload/index.js +74 -53
  202. package/lib/Upload/enums.d.ts +3 -3
  203. package/lib/Upload/enums.js +4 -4
  204. package/lib/Upload/hooks/change.d.ts +8 -1
  205. package/lib/Upload/hooks/change.js +116 -59
  206. package/lib/Upload/hooks/customRequest.d.ts +5 -1
  207. package/lib/Upload/hooks/customRequest.js +64 -47
  208. package/lib/Upload/hooks/propsMaker.d.ts +5 -1
  209. package/lib/Upload/hooks/propsMaker.js +55 -15
  210. package/lib/Upload/index.d.ts +3 -1
  211. package/lib/Upload/index.js +133 -63
  212. package/lib/Upload/modal.d.ts +17 -15
  213. package/lib/Upload/util.d.ts +8 -2
  214. package/lib/Upload/util.js +16 -8
  215. package/lib/config.js +35 -32
  216. package/lib/hooks/index.d.ts +14 -7
  217. package/lib/hooks/index.js +125 -50
  218. package/lib/index.d.ts +98 -16
  219. package/lib/index.js +5 -5
  220. package/lib/modal.d.ts +6 -6
  221. package/package.json +2 -2
  222. package/src/components/CheckboxGroup/index.tsx +2 -2
  223. package/src/components/Form/FormItem/Helper.tsx +3 -4
  224. package/src/components/Form/HFormConnect.tsx +6 -2
  225. package/src/components/Form/hooks/useHForm.ts +59 -10
  226. package/src/components/Form/modal.ts +12 -8
  227. package/src/components/TDPicker/RangePicker.tsx +7 -5
  228. package/src/components/TDPicker/modal.ts +1 -0
  229. package/src/pages/Form/index.tsx +2 -2
package/es/Form/Label.js CHANGED
@@ -1,15 +1,15 @@
1
1
  // welcome to hoo hoo hoo
2
- import React from 'react';
3
- import { QuestionCircleOutlined } from '@ant-design/icons';
4
- import { Tooltip } from 'antd';
5
- import { useClassName } from '../hooks/index.js';
2
+ import React from "react";
3
+ import { QuestionCircleOutlined } from "@ant-design/icons";
4
+ import { Tooltip } from "antd";
5
+ import { useClassName } from "../hooks/index.js";
6
6
 
7
7
  var useHover = function useHover(_ref) {
8
8
  var hover = _ref.hover;
9
9
  if (!hover || typeof hover === "string") {
10
10
  return {
11
11
  text: hover,
12
- icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)
12
+ icon: /*#__PURE__*/ React.createElement(QuestionCircleOutlined, null),
13
13
  };
14
14
  }
15
15
  return hover;
@@ -21,25 +21,42 @@ var Index = function Index(_ref2) {
21
21
  required = _ref2.required,
22
22
  hover = _ref2.hover;
23
23
  var _useHover = useHover({
24
- hover: hover
24
+ hover: hover,
25
25
  }),
26
26
  text = _useHover.text,
27
27
  icon = _useHover.icon;
28
- var array = [colon ? "hw-form-item-colon" : "", required ? "hw-form-item-required" : ""];
28
+ var array = [
29
+ colon ? "hw-form-item-colon" : "",
30
+ required ? "hw-form-item-required" : "",
31
+ ];
29
32
  var className = useClassName(array);
30
- return /*#__PURE__*/React.createElement("div", {
31
- style: {
32
- width: labelWidth
33
+ return /*#__PURE__*/ React.createElement(
34
+ "div",
35
+ {
36
+ style: {
37
+ width: labelWidth,
38
+ },
39
+ className: className,
33
40
  },
34
- className: className
35
- }, children, text && /*#__PURE__*/React.createElement("span", {
36
- style: {
37
- marginLeft: 4
38
- }
39
- }, /*#__PURE__*/React.createElement(Tooltip, {
40
- placement: "top",
41
- title: text
42
- }, icon)));
41
+ children,
42
+ text &&
43
+ /*#__PURE__*/ React.createElement(
44
+ "span",
45
+ {
46
+ style: {
47
+ marginLeft: 4,
48
+ },
49
+ },
50
+ /*#__PURE__*/ React.createElement(
51
+ Tooltip,
52
+ {
53
+ placement: "top",
54
+ title: text,
55
+ },
56
+ icon
57
+ )
58
+ )
59
+ );
43
60
  };
44
61
 
45
62
  export { Index as default };
@@ -1,28 +1,106 @@
1
1
  /// <reference types="react" />
2
2
  export declare const placeholderConfig: {
3
- inputType: string[];
4
- selectType: string[];
3
+ inputType: string[];
4
+ selectType: string[];
5
5
  };
6
6
  declare const _default: {
7
- select: ({ style, mode, options, modeConfig, value, onChange, fieldNames: propsFieldNames, request, manual, optionLabelProp, filterProvider, optionFilterProp, serviceSearch, onSearch: propsOnSearch, filterOption, showSearch, labelInValue, noMatchItemRender, allSelect, ...props }: import("../Select/modal").HSelectProps) => JSX.Element;
8
- inputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
9
- selectInput: ({ selectProps, value, onChange, valueName, ...props }: import("../Input/modal").HSelectInputProps) => JSX.Element;
10
- buttonInput: import("react").FC<import("../Input/modal").HButtonInputProps>;
11
- checkboxGroup: (props: import("./modal").HFormItemProps) => import("react").ReactElement<import("./modal").ConnectResultProps, string | import("react").JSXElementConstructor<any>>;
12
- checkBox: import("react").FC<import("../CheckboxGroup/modal").HCheckboxProps>;
13
- radioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("../RadioGroup").HRadioGroupProps) => JSX.Element;
14
- switch: import("react").FC<import("../Switch").HSwitchProps>;
15
- datePicker: ({ value, onChange, showTime, format, ...props }: import("../TDPicker/modal").HDatePickerProps) => JSX.Element;
16
- rangePicker: {
17
- Component: ({ value, onChange, showTime, format, valueMap, ranges, name, ...props }: import("../TDPicker/modal").HRangePickerProps) => JSX.Element;
18
- placeholder: ({ label }: import("./modal").HItemProps) => string[];
19
- requiredErrMsg: ({ label }: import("./modal").HItemProps) => string;
20
- };
21
- timePicker: ({ value, format, onChange, ...props }: import("../TDPicker/modal").HTimePickerProps) => JSX.Element;
22
- input: ({ ...props }: import("antd").InputProps) => JSX.Element;
23
- upload: import("react").ForwardRefExoticComponent<import("../Upload/modal").IUpLoadProps & import("react").RefAttributes<import("../Upload/modal").IUploadRefModal>>;
24
- urlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("../Upload/modal").IUrlUploadProps) => JSX.Element;
25
- submit: ({ text, type, form, loading, ...props }: import("../Submit").ISubmitProps) => JSX.Element;
26
- formConfigProvider: import("react").FC<import("./modal").IFormConfigContextProps>;
7
+ select: ({
8
+ style,
9
+ mode,
10
+ options,
11
+ modeConfig,
12
+ value,
13
+ onChange,
14
+ fieldNames: propsFieldNames,
15
+ request,
16
+ manual,
17
+ optionLabelProp,
18
+ filterProvider,
19
+ optionFilterProp,
20
+ serviceSearch,
21
+ onSearch: propsOnSearch,
22
+ filterOption,
23
+ showSearch,
24
+ labelInValue,
25
+ noMatchItemRender,
26
+ allSelect,
27
+ ...props
28
+ }: import("../Select/modal").HSelectProps) => JSX.Element;
29
+ inputNumber: ({
30
+ style,
31
+ ...props
32
+ }: import("antd").InputNumberProps<string | number>) => JSX.Element;
33
+ selectInput: ({
34
+ selectProps,
35
+ value,
36
+ onChange,
37
+ valueName,
38
+ ...props
39
+ }: import("../Input/modal").HSelectInputProps) => JSX.Element;
40
+ buttonInput: import("react").FC<import("../Input/modal").HButtonInputProps>;
41
+ checkboxGroup: (
42
+ props: import("./modal").HFormItemProps
43
+ ) => import("react").ReactElement<
44
+ import("./modal").ConnectResultProps,
45
+ string | import("react").JSXElementConstructor<any>
46
+ >;
47
+ checkBox: import("react").FC<import("../CheckboxGroup/modal").HCheckboxProps>;
48
+ radioGroup: ({
49
+ value,
50
+ options,
51
+ onChange,
52
+ fieldNames: propsFieldNames,
53
+ ...props
54
+ }: import("../RadioGroup").HRadioGroupProps) => JSX.Element;
55
+ switch: import("react").FC<import("../Switch").HSwitchProps>;
56
+ datePicker: ({
57
+ value,
58
+ onChange,
59
+ showTime,
60
+ format,
61
+ ...props
62
+ }: import("../TDPicker/modal").HDatePickerProps) => JSX.Element;
63
+ rangePicker: {
64
+ Component: ({
65
+ value,
66
+ onChange,
67
+ showTime,
68
+ format,
69
+ valueMap,
70
+ ranges,
71
+ name,
72
+ ...props
73
+ }: import("../TDPicker/modal").HRangePickerProps) => JSX.Element;
74
+ placeholder: ({ label }: import("./modal").HItemProps) => string[];
75
+ requiredErrMsg: ({ label }: import("./modal").HItemProps) => string;
76
+ };
77
+ timePicker: ({
78
+ value,
79
+ format,
80
+ onChange,
81
+ ...props
82
+ }: import("../TDPicker/modal").HTimePickerProps) => JSX.Element;
83
+ input: ({ ...props }: import("antd").InputProps) => JSX.Element;
84
+ upload: import("react").ForwardRefExoticComponent<
85
+ import("../Upload/modal").IUpLoadProps &
86
+ import("react").RefAttributes<import("../Upload/modal").IUploadRefModal>
87
+ >;
88
+ urlUpload: ({
89
+ placeholder,
90
+ value,
91
+ onChange,
92
+ mediaType,
93
+ ...props
94
+ }: import("../Upload/modal").IUrlUploadProps) => JSX.Element;
95
+ submit: ({
96
+ text,
97
+ type,
98
+ form,
99
+ loading,
100
+ ...props
101
+ }: import("../Submit").ISubmitProps) => JSX.Element;
102
+ formConfigProvider: import("react").FC<
103
+ import("./modal").IFormConfigContextProps
104
+ >;
27
105
  };
28
106
  export default _default;
package/es/Form/config.js CHANGED
@@ -1,24 +1,24 @@
1
1
  // welcome to hoo hoo hoo
2
- import HSelect from '../Select/index.js';
3
- import HInput from '../Input/index.js';
4
- import HInputNumber from '../Input/InputNumber.js';
5
- import HSelectInput from '../Input/SelectInput.js';
6
- import Index from '../Input/ButtonInput.js';
7
- import HCheckboxGroup from '../CheckboxGroup/index.js';
8
- import Index$1 from '../CheckboxGroup/CheckBox/index.js';
9
- import HRadioGroup from '../RadioGroup/index.js';
10
- import Index$2 from '../Switch/index.js';
11
- import HDatePicker from '../TDPicker/index.js';
12
- import HRangePicker from '../TDPicker/RangePicker.js';
13
- import HTimePicker from '../TDPicker/TimePicker.js';
14
- import HUpload from '../Upload/index.js';
15
- import HUrlUpload from '../Upload/UrlUpload/index.js';
16
- import HSubmit from '../Submit/index.js';
17
- import Index$3 from './Context/FormConfigProvider.js';
2
+ import HSelect from "../Select/index.js";
3
+ import HInput from "../Input/index.js";
4
+ import HInputNumber from "../Input/InputNumber.js";
5
+ import HSelectInput from "../Input/SelectInput.js";
6
+ import Index from "../Input/ButtonInput.js";
7
+ import HCheckboxGroup from "../CheckboxGroup/index.js";
8
+ import Index$1 from "../CheckboxGroup/CheckBox/index.js";
9
+ import HRadioGroup from "../RadioGroup/index.js";
10
+ import Index$2 from "../Switch/index.js";
11
+ import HDatePicker from "../TDPicker/index.js";
12
+ import HRangePicker from "../TDPicker/RangePicker.js";
13
+ import HTimePicker from "../TDPicker/TimePicker.js";
14
+ import HUpload from "../Upload/index.js";
15
+ import HUrlUpload from "../Upload/UrlUpload/index.js";
16
+ import HSubmit from "../Submit/index.js";
17
+ import Index$3 from "./Context/FormConfigProvider.js";
18
18
 
19
19
  var placeholderConfig = {
20
20
  inputType: ["input", "inputNumber", "selectInput", "buttonInput"],
21
- selectType: ["select", "datePicker", "timePicker"]
21
+ selectType: ["select", "datePicker", "timePicker"],
22
22
  };
23
23
  var FormConfig = {
24
24
  select: HSelect,
@@ -28,7 +28,7 @@ var FormConfig = {
28
28
  checkboxGroup: HCheckboxGroup,
29
29
  checkBox: Index$1,
30
30
  radioGroup: HRadioGroup,
31
- "switch": Index$2,
31
+ switch: Index$2,
32
32
  datePicker: HDatePicker,
33
33
  rangePicker: HRangePicker,
34
34
  timePicker: HTimePicker,
@@ -36,7 +36,7 @@ var FormConfig = {
36
36
  upload: HUpload,
37
37
  urlUpload: HUrlUpload,
38
38
  submit: HSubmit,
39
- formConfigProvider: Index$3
39
+ formConfigProvider: Index$3,
40
40
  };
41
41
 
42
42
  export { FormConfig as default, placeholderConfig };
@@ -2,11 +2,18 @@ import type { HFormProps } from "@/components/Form/modal";
2
2
  import type { HFormInstance } from "@/components/Form/modal";
3
3
  export declare const useCurrentForm: (form?: HFormInstance) => HFormInstance;
4
4
  type ParamsModal = Omit<HFormProps, "configData">;
5
- export declare const useSub: ({ request, onFinish, form }: ParamsModal) => import("@ahooksjs/use-request/lib/types").BaseResult<void, [value: any]>;
5
+ export declare const useSub: ({
6
+ request,
7
+ onFinish,
8
+ form,
9
+ }: ParamsModal) => import("@ahooksjs/use-request/lib/types").BaseResult<
10
+ void,
11
+ [value: any]
12
+ >;
6
13
  export declare const useInit: ({ infoRequest, initialValues }: ParamsModal) => {
7
- infoRun: () => Promise<any>;
8
- infoLoading: boolean;
9
- infoErr: Error | undefined;
10
- infoData: any;
14
+ infoRun: () => Promise<any>;
15
+ infoLoading: boolean;
16
+ infoErr: Error | undefined;
17
+ infoData: any;
11
18
  };
12
19
  export {};
@@ -1,8 +1,8 @@
1
1
  // welcome to hoo hoo hoo
2
- import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
3
- import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
4
- import { useRequest } from 'ahooks';
5
- import useHForm from './useHForm.js';
2
+ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
4
+ import { useRequest } from "ahooks";
5
+ import useHForm from "./useHForm.js";
6
6
 
7
7
  var useCurrentForm = function useCurrentForm(form) {
8
8
  var selfForm = useHForm();
@@ -12,55 +12,71 @@ var useSub = function useSub(_ref) {
12
12
  var request = _ref.request,
13
13
  onFinish = _ref.onFinish,
14
14
  form = _ref.form;
15
- return useRequest( /*#__PURE__*/function () {
16
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value) {
17
- var subVal;
18
- return _regeneratorRuntime.wrap(function _callee$(_context) {
19
- while (1) switch (_context.prev = _context.next) {
20
- case 0:
21
- subVal = form === null || form === void 0 ? void 0 : form.outputValues(value);
22
- if (!request) {
23
- _context.next = 4;
24
- break;
25
- }
26
- _context.next = 4;
27
- return request(subVal);
28
- case 4:
29
- onFinish === null || onFinish === void 0 ? void 0 : onFinish(subVal);
30
- case 5:
31
- case "end":
32
- return _context.stop();
33
- }
34
- }, _callee);
35
- }));
36
- return function (_x) {
37
- return _ref2.apply(this, arguments);
38
- };
39
- }(), {
40
- manual: true
41
- });
15
+ return useRequest(
16
+ /*#__PURE__*/ (function () {
17
+ var _ref2 = _asyncToGenerator(
18
+ /*#__PURE__*/ _regeneratorRuntime.mark(function _callee(value) {
19
+ var subVal;
20
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
21
+ while (1)
22
+ switch ((_context.prev = _context.next)) {
23
+ case 0:
24
+ subVal =
25
+ form === null || form === void 0
26
+ ? void 0
27
+ : form.outputValues(value);
28
+ if (!request) {
29
+ _context.next = 4;
30
+ break;
31
+ }
32
+ _context.next = 4;
33
+ return request(subVal);
34
+ case 4:
35
+ onFinish === null || onFinish === void 0
36
+ ? void 0
37
+ : onFinish(subVal);
38
+ case 5:
39
+ case "end":
40
+ return _context.stop();
41
+ }
42
+ }, _callee);
43
+ })
44
+ );
45
+ return function (_x) {
46
+ return _ref2.apply(this, arguments);
47
+ };
48
+ })(),
49
+ {
50
+ manual: true,
51
+ }
52
+ );
42
53
  };
43
54
  var useInit = function useInit(_ref3) {
44
55
  var infoRequest = _ref3.infoRequest,
45
56
  _ref3$initialValues = _ref3.initialValues,
46
57
  initialValues = _ref3$initialValues === void 0 ? {} : _ref3$initialValues;
47
- var _useRequest = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
48
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
49
- while (1) switch (_context2.prev = _context2.next) {
50
- case 0:
51
- if (!infoRequest) {
52
- _context2.next = 2;
53
- break;
54
- }
55
- return _context2.abrupt("return", infoRequest());
56
- case 2:
57
- return _context2.abrupt("return", initialValues);
58
- case 3:
59
- case "end":
60
- return _context2.stop();
61
- }
62
- }, _callee2);
63
- }))),
58
+ var _useRequest = useRequest(
59
+ /*#__PURE__*/ _asyncToGenerator(
60
+ /*#__PURE__*/ _regeneratorRuntime.mark(function _callee2() {
61
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
62
+ while (1)
63
+ switch ((_context2.prev = _context2.next)) {
64
+ case 0:
65
+ if (!infoRequest) {
66
+ _context2.next = 2;
67
+ break;
68
+ }
69
+ return _context2.abrupt("return", infoRequest());
70
+ case 2:
71
+ return _context2.abrupt("return", initialValues);
72
+ case 3:
73
+ case "end":
74
+ return _context2.stop();
75
+ }
76
+ }, _callee2);
77
+ })
78
+ )
79
+ ),
64
80
  infoRun = _useRequest.run,
65
81
  infoLoading = _useRequest.loading,
66
82
  infoErr = _useRequest.error,
@@ -69,7 +85,7 @@ var useInit = function useInit(_ref3) {
69
85
  infoRun: infoRun,
70
86
  infoLoading: infoLoading,
71
87
  infoErr: infoErr,
72
- infoData: infoData
88
+ infoData: infoData,
73
89
  };
74
90
  };
75
91