@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
@@ -1,30 +1,68 @@
1
1
  // welcome to hoo hoo hoo
2
- import React from 'react';
3
- import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
4
- import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js/object/get-own-property-symbols';
5
- import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
6
- import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptor';
7
- import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js/object/get-own-property-descriptors';
8
- import _Object$defineProperties from '@babel/runtime-corejs3/core-js/object/define-properties';
9
- import _Object$defineProperty from '@babel/runtime-corejs3/core-js/object/define-property';
10
- import _extends from '@babel/runtime-corejs3/helpers/extends';
11
- import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
12
- import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
13
- import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js/instance/for-each';
14
- import _Object$values from '@babel/runtime-corejs3/core-js/object/values';
15
- import { Input } from 'antd';
16
- import HSelect from '../Select/index.js';
17
- import { defaultValueName, defaultSelectStyle } from './defaultConfig.js';
18
- import HFormConnect from '../Form/HFormConnect.js';
2
+ import React from "react";
3
+ import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
4
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js/object/get-own-property-symbols";
5
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
6
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptor";
7
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptors";
8
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js/object/define-properties";
9
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js/object/define-property";
10
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
11
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
12
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
13
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
14
+ import _Object$values from "@babel/runtime-corejs3/core-js/object/values";
15
+ import { Input } from "antd";
16
+ import HSelect from "../Select/index.js";
17
+ import { defaultValueName, defaultSelectStyle } from "./defaultConfig.js";
18
+ import HFormConnect from "../Form/HFormConnect.js";
19
19
 
20
20
  var _excluded = ["selectProps", "value", "onChange", "valueName", "addFormat"],
21
21
  _excluded2 = ["style", "placeholder"];
22
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
22
+ function ownKeys(object, enumerableOnly) {
23
+ var keys = _Object$keys(object);
24
+ if (_Object$getOwnPropertySymbols) {
25
+ var symbols = _Object$getOwnPropertySymbols(object);
26
+ enumerableOnly &&
27
+ (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
28
+ return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
29
+ })),
30
+ keys.push.apply(keys, symbols);
31
+ }
32
+ return keys;
33
+ }
34
+ function _objectSpread(target) {
35
+ for (var i = 1; i < arguments.length; i++) {
36
+ var _context2, _context3;
37
+ var source = null != arguments[i] ? arguments[i] : {};
38
+ i % 2
39
+ ? _forEachInstanceProperty(
40
+ (_context2 = ownKeys(Object(source), !0))
41
+ ).call(_context2, function (key) {
42
+ _defineProperty(target, key, source[key]);
43
+ })
44
+ : _Object$getOwnPropertyDescriptors
45
+ ? _Object$defineProperties(
46
+ target,
47
+ _Object$getOwnPropertyDescriptors(source)
48
+ )
49
+ : _forEachInstanceProperty((_context3 = ownKeys(Object(source)))).call(
50
+ _context3,
51
+ function (key) {
52
+ _Object$defineProperty(
53
+ target,
54
+ key,
55
+ _Object$getOwnPropertyDescriptor(source, key)
56
+ );
57
+ }
58
+ );
59
+ }
60
+ return target;
61
+ }
24
62
  var SelectInputType;
25
63
  (function (SelectInputType) {
26
- SelectInputType[SelectInputType["input"] = 0] = "input";
27
- SelectInputType[SelectInputType["select"] = 1] = "select";
64
+ SelectInputType[(SelectInputType["input"] = 0)] = "input";
65
+ SelectInputType[(SelectInputType["select"] = 1)] = "select";
28
66
  })(SelectInputType || (SelectInputType = {}));
29
67
  var Index = function Index(_ref) {
30
68
  var _ref$selectProps = _ref.selectProps,
@@ -43,9 +81,11 @@ var Index = function Index(_ref) {
43
81
  var inputVal = value[input],
44
82
  selectVal = value[select];
45
83
  var _selectProps$style = selectProps.style,
46
- style = _selectProps$style === void 0 ? defaultSelectStyle : _selectProps$style,
84
+ style =
85
+ _selectProps$style === void 0 ? defaultSelectStyle : _selectProps$style,
47
86
  _selectProps$placehol = selectProps.placeholder,
48
- placeholder = _selectProps$placehol === void 0 ? "请选择" : _selectProps$placehol,
87
+ placeholder =
88
+ _selectProps$placehol === void 0 ? "请选择" : _selectProps$placehol,
49
89
  sProps = _objectWithoutProperties(selectProps, _excluded2);
50
90
  var change = function change(val, key) {
51
91
  var newVal = _objectSpread({}, value);
@@ -53,40 +93,57 @@ var Index = function Index(_ref) {
53
93
  var type = key === input ? SelectInputType.input : SelectInputType.select;
54
94
  onChange === null || onChange === void 0 ? void 0 : onChange(newVal, type);
55
95
  };
56
- addFormat === null || addFormat === void 0 ? void 0 : addFormat({
57
- "float": {
58
- inputValue: function inputValue(item, initValue) {
59
- var _context;
60
- var name = item.name;
61
- var resultObj = {};
62
- _forEachInstanceProperty(_context = _Object$values(valueName)).call(_context, function (key) {
63
- resultObj[key] = initValue[key];
64
- });
65
- return _defineProperty({}, name, resultObj);
96
+ addFormat === null || addFormat === void 0
97
+ ? void 0
98
+ : addFormat({
99
+ float: {
100
+ inputValue: function inputValue(item, initValue) {
101
+ var _context;
102
+ var name = item.name;
103
+ var resultObj = {};
104
+ _forEachInstanceProperty(
105
+ (_context = _Object$values(valueName))
106
+ ).call(_context, function (key) {
107
+ resultObj[key] = initValue[key];
108
+ });
109
+ return _defineProperty({}, name, resultObj);
110
+ },
111
+ outputValue: function outputValue(item, _outputValue) {
112
+ var name = item.name;
113
+ var _outputValue$name = _outputValue[name],
114
+ itemVal = _outputValue$name === void 0 ? {} : _outputValue$name;
115
+ var newItemVal = _defineProperty(
116
+ {},
117
+ itemVal[select],
118
+ itemVal[input]
119
+ );
120
+ return _objectSpread({}, newItemVal);
121
+ },
122
+ },
123
+ });
124
+ return /*#__PURE__*/ React.createElement(
125
+ Input,
126
+ _extends(
127
+ {
128
+ value: inputVal,
129
+ onChange: function onChange(e) {
130
+ change(e.target.value, input);
131
+ },
132
+ addonBefore: /*#__PURE__*/ React.createElement(
133
+ HSelect,
134
+ _extends({}, sProps, {
135
+ style: style,
136
+ placeholder: placeholder,
137
+ value: selectVal,
138
+ onChange: function onChange(val) {
139
+ change(val, select);
140
+ },
141
+ })
142
+ ),
66
143
  },
67
- outputValue: function outputValue(item, _outputValue) {
68
- var name = item.name;
69
- var _outputValue$name = _outputValue[name],
70
- itemVal = _outputValue$name === void 0 ? {} : _outputValue$name;
71
- var newItemVal = _defineProperty({}, itemVal[select], itemVal[input]);
72
- return _objectSpread({}, newItemVal);
73
- }
74
- }
75
- });
76
- return /*#__PURE__*/React.createElement(Input, _extends({
77
- value: inputVal,
78
- onChange: function onChange(e) {
79
- change(e.target.value, input);
80
- },
81
- addonBefore: /*#__PURE__*/React.createElement(HSelect, _extends({}, sProps, {
82
- style: style,
83
- placeholder: placeholder,
84
- value: selectVal,
85
- onChange: function onChange(val) {
86
- change(val, select);
87
- }
88
- }))
89
- }, props));
144
+ props
145
+ )
146
+ );
90
147
  };
91
148
  var HSelectInput = HFormConnect(Index);
92
149
 
@@ -1,7 +1,7 @@
1
1
  export declare const defaultSelectStyle: {
2
- width: number;
2
+ width: number;
3
3
  };
4
4
  export declare const defaultValueName: {
5
- input: string;
6
- select: string;
5
+ input: string;
6
+ select: string;
7
7
  };
@@ -1,10 +1,10 @@
1
1
  // welcome to hoo hoo hoo
2
2
  var defaultSelectStyle = {
3
- width: 128
3
+ width: 128,
4
4
  };
5
5
  var defaultValueName = {
6
6
  input: "input",
7
- select: "select"
7
+ select: "select",
8
8
  };
9
9
 
10
10
  export { defaultSelectStyle, defaultValueName };
package/es/Input/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  // welcome to hoo hoo hoo
2
- import React from 'react';
3
- import _objectDestructuringEmpty from '@babel/runtime-corejs3/helpers/objectDestructuringEmpty';
4
- import _extends from '@babel/runtime-corejs3/helpers/extends';
5
- import { Input } from 'antd';
2
+ import React from "react";
3
+ import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/objectDestructuringEmpty";
4
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
5
+ import { Input } from "antd";
6
6
 
7
- var HInput = (function (_ref) {
7
+ var HInput = function (_ref) {
8
8
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
9
- return /*#__PURE__*/React.createElement(Input, props);
10
- });
9
+ return /*#__PURE__*/ React.createElement(Input, props);
10
+ };
11
11
 
12
12
  export { HInput as default };
13
13
  // powered by hdj
@@ -5,21 +5,25 @@ import type { PromiseFnResult } from "../modal";
5
5
  import type { addFormatItemModal } from "../Form/modal";
6
6
  export type HInputProps = InputProps;
7
7
  interface ValueNameModal {
8
- input?: string;
9
- select?: string;
8
+ input?: string;
9
+ select?: string;
10
10
  }
11
- export interface HSelectInputProps extends Omit<HInputProps, "value" | "onChange"> {
12
- selectProps?: HSelectProps;
13
- value?: Record<string, any>;
14
- onChange?: (value: Record<string, any>, type: SelectInputType) => void;
15
- valueName?: ValueNameModal;
16
- addFormat?: (config: Record<string, addFormatItemModal>) => void;
11
+ export interface HSelectInputProps
12
+ extends Omit<HInputProps, "value" | "onChange"> {
13
+ selectProps?: HSelectProps;
14
+ value?: Record<string, any>;
15
+ onChange?: (value: Record<string, any>, type: SelectInputType) => void;
16
+ valueName?: ValueNameModal;
17
+ addFormat?: (config: Record<string, addFormatItemModal>) => void;
17
18
  }
18
19
  export interface HButtonProps extends Omit<ButtonProps, "onClick"> {
19
- onClick: (value: string | readonly string[] | number | undefined, e: HTMLElement) => void;
20
+ onClick: (
21
+ value: string | readonly string[] | number | undefined,
22
+ e: HTMLElement
23
+ ) => void;
20
24
  }
21
25
  export interface HButtonInputProps extends HInputProps {
22
- buttonProps?: HButtonProps;
23
- request?: PromiseFnResult;
26
+ buttonProps?: HButtonProps;
27
+ request?: PromiseFnResult;
24
28
  }
25
29
  export {};
@@ -1,33 +1,55 @@
1
1
  // welcome to hoo hoo hoo
2
- import React from 'react';
3
- import { Typography, Row, Space, Button } from 'antd';
4
- import { ExclamationCircleOutlined } from '@ant-design/icons';
2
+ import React from "react";
3
+ import { Typography, Row, Space, Button } from "antd";
4
+ import { ExclamationCircleOutlined } from "@ant-design/icons";
5
5
 
6
6
  var Text = Typography.Text;
7
- var ErrorComponent = (function (_ref) {
7
+ var ErrorComponent = function (_ref) {
8
8
  var error = _ref.error,
9
9
  reload = _ref.reload;
10
- return /*#__PURE__*/React.createElement(Row, {
11
- justify: "center",
12
- align: "middle",
13
- style: {
14
- height: 125
15
- }
16
- }, /*#__PURE__*/React.createElement(Space, {
17
- align: "center",
18
- direction: "vertical"
19
- }, /*#__PURE__*/React.createElement(Text, {
20
- type: "danger"
21
- }, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, {
22
- size: 24
23
- })), /*#__PURE__*/React.createElement(Text, {
24
- type: "danger"
25
- }, error === null || error === void 0 ? void 0 : error.message), /*#__PURE__*/React.createElement(Button, {
26
- type: "primary",
27
- size: "small",
28
- onClick: reload
29
- }, "\u91CD\u65B0\u52A0\u8F7D")));
30
- });
10
+ return /*#__PURE__*/ React.createElement(
11
+ Row,
12
+ {
13
+ justify: "center",
14
+ align: "middle",
15
+ style: {
16
+ height: 125,
17
+ },
18
+ },
19
+ /*#__PURE__*/ React.createElement(
20
+ Space,
21
+ {
22
+ align: "center",
23
+ direction: "vertical",
24
+ },
25
+ /*#__PURE__*/ React.createElement(
26
+ Text,
27
+ {
28
+ type: "danger",
29
+ },
30
+ /*#__PURE__*/ React.createElement(ExclamationCircleOutlined, {
31
+ size: 24,
32
+ })
33
+ ),
34
+ /*#__PURE__*/ React.createElement(
35
+ Text,
36
+ {
37
+ type: "danger",
38
+ },
39
+ error === null || error === void 0 ? void 0 : error.message
40
+ ),
41
+ /*#__PURE__*/ React.createElement(
42
+ Button,
43
+ {
44
+ type: "primary",
45
+ size: "small",
46
+ onClick: reload,
47
+ },
48
+ "\u91CD\u65B0\u52A0\u8F7D"
49
+ )
50
+ )
51
+ );
52
+ };
31
53
 
32
54
  export { ErrorComponent as default };
33
55
  // powered by hdj
@@ -1,18 +1,22 @@
1
1
  // welcome to hoo hoo hoo
2
- import React from 'react';
3
- import { Row, Spin } from 'antd';
2
+ import React from "react";
3
+ import { Row, Spin } from "antd";
4
4
 
5
- var Loading = (function () {
6
- return /*#__PURE__*/React.createElement(Row, {
7
- justify: "center",
8
- align: "middle",
9
- style: {
10
- height: 125
11
- }
12
- }, /*#__PURE__*/React.createElement(Spin, {
13
- size: "large"
14
- }));
15
- });
5
+ var Loading = function () {
6
+ return /*#__PURE__*/ React.createElement(
7
+ Row,
8
+ {
9
+ justify: "center",
10
+ align: "middle",
11
+ style: {
12
+ height: 125,
13
+ },
14
+ },
15
+ /*#__PURE__*/ React.createElement(Spin, {
16
+ size: "large",
17
+ })
18
+ );
19
+ };
16
20
 
17
21
  export { Loading as default };
18
22
  // powered by hdj
@@ -1,7 +1,7 @@
1
1
  // welcome to hoo hoo hoo
2
- import React from 'react';
3
- import Loading from './LoadingComponent.js';
4
- import ErrorComponent from './ErrorComponent.js';
2
+ import React from "react";
3
+ import Loading from "./LoadingComponent.js";
4
+ import ErrorComponent from "./ErrorComponent.js";
5
5
 
6
6
  var Index = function Index(_ref) {
7
7
  var error = _ref.error,
@@ -9,15 +9,15 @@ var Index = function Index(_ref) {
9
9
  reload = _ref.reload,
10
10
  children = _ref.children;
11
11
  if (error) {
12
- return /*#__PURE__*/React.createElement(ErrorComponent, {
12
+ return /*#__PURE__*/ React.createElement(ErrorComponent, {
13
13
  error: error,
14
- reload: reload
14
+ reload: reload,
15
15
  });
16
16
  }
17
17
  if (data) {
18
- return /*#__PURE__*/React.createElement(React.Fragment, null, children);
18
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
19
19
  }
20
- return /*#__PURE__*/React.createElement(Loading, null);
20
+ return /*#__PURE__*/ React.createElement(Loading, null);
21
21
  };
22
22
 
23
23
  export { Index as default };
@@ -1,6 +1,6 @@
1
1
  export interface IHPageHandler<T = any> {
2
- loading?: boolean;
3
- error?: Error;
4
- reload: VoidFunction;
5
- data?: T;
2
+ loading?: boolean;
3
+ error?: Error;
4
+ reload: VoidFunction;
5
+ data?: T;
6
6
  }
@@ -1,9 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import type { SelectProps, RadioGroupProps } from "antd/es";
3
- export interface HRadioGroupProps extends Omit<RadioGroupProps, "onChange" | "options"> {
4
- onChange?: (value: any) => void;
5
- fieldNames?: SelectProps["fieldNames"];
6
- options?: (Record<string, any> | string | number)[];
3
+ export interface HRadioGroupProps
4
+ extends Omit<RadioGroupProps, "onChange" | "options"> {
5
+ onChange?: (value: any) => void;
6
+ fieldNames?: SelectProps["fieldNames"];
7
+ options?: (Record<string, any> | string | number)[];
7
8
  }
8
- declare const _default: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: HRadioGroupProps) => JSX.Element;
9
+ declare const _default: ({
10
+ value,
11
+ options,
12
+ onChange,
13
+ fieldNames: propsFieldNames,
14
+ ...props
15
+ }: HRadioGroupProps) => JSX.Element;
9
16
  export default _default;
@@ -1,48 +1,61 @@
1
1
  // welcome to hoo hoo hoo
2
- import React, { useMemo } from 'react';
3
- import _extends from '@babel/runtime-corejs3/helpers/extends';
4
- import _typeof from '@babel/runtime-corejs3/helpers/typeof';
5
- import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
6
- import _mapInstanceProperty from '@babel/runtime-corejs3/core-js/instance/map';
7
- import { Radio } from 'antd';
8
- import { useMatchConfigProps } from '../hooks/index.js';
2
+ import React, { useMemo } from "react";
3
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
4
+ import _typeof from "@babel/runtime-corejs3/helpers/typeof";
5
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
6
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
7
+ import { Radio } from "antd";
8
+ import { useMatchConfigProps } from "../hooks/index.js";
9
9
 
10
10
  var _excluded = ["value", "options", "onChange", "fieldNames"];
11
- var HRadioGroup = (function (_ref) {
11
+ var HRadioGroup = function (_ref) {
12
12
  var value = _ref.value,
13
13
  options = _ref.options,
14
14
  _onChange = _ref.onChange,
15
15
  propsFieldNames = _ref.fieldNames,
16
16
  props = _objectWithoutProperties(_ref, _excluded);
17
17
  var _useMatchConfigProps = useMatchConfigProps({
18
- fieldNames: propsFieldNames
18
+ fieldNames: propsFieldNames,
19
19
  }),
20
20
  _useMatchConfigProps$ = _useMatchConfigProps.fieldNames,
21
21
  fieldNames = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
22
- var relOptions = useMemo(function () {
23
- return options === null || options === void 0 ? void 0 : _mapInstanceProperty(options).call(options, function (item) {
24
- var type = _typeof(item);
25
- if (type === "string" || type === "number") {
26
- return item;
27
- }
28
- var _fieldNames$label = fieldNames.label,
29
- labelKey = _fieldNames$label === void 0 ? "" : _fieldNames$label,
30
- _fieldNames$value = fieldNames.value,
31
- valueKey = _fieldNames$value === void 0 ? "" : _fieldNames$value;
32
- return {
33
- label: item[labelKey],
34
- value: item[valueKey]
35
- };
36
- });
37
- }, [options, fieldNames]);
38
- return /*#__PURE__*/React.createElement(Radio.Group, _extends({
39
- options: relOptions,
40
- value: value,
41
- onChange: function onChange(e) {
42
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
43
- }
44
- }, props));
45
- });
22
+ var relOptions = useMemo(
23
+ function () {
24
+ return options === null || options === void 0
25
+ ? void 0
26
+ : _mapInstanceProperty(options).call(options, function (item) {
27
+ var type = _typeof(item);
28
+ if (type === "string" || type === "number") {
29
+ return item;
30
+ }
31
+ var _fieldNames$label = fieldNames.label,
32
+ labelKey = _fieldNames$label === void 0 ? "" : _fieldNames$label,
33
+ _fieldNames$value = fieldNames.value,
34
+ valueKey = _fieldNames$value === void 0 ? "" : _fieldNames$value;
35
+ return {
36
+ label: item[labelKey],
37
+ value: item[valueKey],
38
+ };
39
+ });
40
+ },
41
+ [options, fieldNames]
42
+ );
43
+ return /*#__PURE__*/ React.createElement(
44
+ Radio.Group,
45
+ _extends(
46
+ {
47
+ options: relOptions,
48
+ value: value,
49
+ onChange: function onChange(e) {
50
+ _onChange === null || _onChange === void 0
51
+ ? void 0
52
+ : _onChange(e.target.value);
53
+ },
54
+ },
55
+ props
56
+ )
57
+ );
58
+ };
46
59
 
47
60
  export { HRadioGroup as default };
48
61
  // powered by hdj
@@ -1,7 +1,7 @@
1
1
  import type { HSelectProps } from "@/components/Select/modal";
2
2
  import React from "react";
3
3
  interface IProps extends HSelectProps {
4
- checked?: boolean;
4
+ checked?: boolean;
5
5
  }
6
6
  declare const Index: React.FC<IProps>;
7
7
  export default Index;