@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.
- package/es/CheckboxGroup/CheckBox/index.js +24 -16
- package/es/CheckboxGroup/hooks.d.ts +9 -3
- package/es/CheckboxGroup/hooks.js +115 -64
- package/es/CheckboxGroup/index.d.ts +6 -1
- package/es/CheckboxGroup/index.js +117 -56
- package/es/CheckboxGroup/modal.d.ts +9 -8
- package/es/Form/Context/FormConfigProvider.js +64 -19
- package/es/Form/Context/index.d.ts +4 -1
- package/es/Form/Context/index.js +3 -3
- package/es/Form/FormItem/BasicItem.js +80 -42
- package/es/Form/FormItem/Helper.d.ts +1 -1
- package/es/Form/FormItem/Helper.js +17 -9
- package/es/Form/FormItem/RegularFormItem.js +11 -8
- package/es/Form/FormItem/UpFormItem.d.ts +6 -1
- package/es/Form/FormItem/UpFormItem.js +27 -17
- package/es/Form/FormItem/hooks.d.ts +21 -4
- package/es/Form/FormItem/hooks.js +12 -9
- package/es/Form/FormItem/index.js +5 -5
- package/es/Form/HFormConnect.d.ts +9 -1
- package/es/Form/HFormConnect.js +94 -26
- package/es/Form/InitSet.d.ts +1 -1
- package/es/Form/InitSet.js +5 -5
- package/es/Form/Label.d.ts +4 -4
- package/es/Form/Label.js +36 -19
- package/es/Form/config.d.ts +100 -22
- package/es/Form/config.js +19 -19
- package/es/Form/hooks/index.d.ts +12 -5
- package/es/Form/hooks/index.js +65 -49
- package/es/Form/hooks/useHForm.js +233 -95
- package/es/Form/hooks/useInitConfigData.d.ts +4 -1
- package/es/Form/hooks/useInitConfigData.js +143 -61
- package/es/Form/index.d.ts +11 -1
- package/es/Form/index.js +71 -40
- package/es/Form/modal.d.ts +92 -51
- package/es/Input/ButtonInput.js +73 -51
- package/es/Input/InputNumber.js +21 -12
- package/es/Input/SelectInput.d.ts +16 -4
- package/es/Input/SelectInput.js +113 -56
- package/es/Input/defaultConfig.d.ts +3 -3
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.js +7 -7
- package/es/Input/modal.d.ts +15 -11
- package/es/PageHandler/ErrorComponent.js +47 -25
- package/es/PageHandler/LoadingComponent.js +17 -13
- package/es/PageHandler/index.js +7 -7
- package/es/PageHandler/modal.d.ts +4 -4
- package/es/RadioGroup/index.d.ts +12 -5
- package/es/RadioGroup/index.js +46 -33
- package/es/Select/components/AllSelect.d.ts +1 -1
- package/es/Select/components/AllSelect.js +40 -18
- package/es/Select/components/CheckBoxOption.d.ts +6 -3
- package/es/Select/components/CheckBoxOption.js +12 -7
- package/es/Select/components/DropdownComponent.d.ts +4 -4
- package/es/Select/components/DropdownComponent.js +30 -17
- package/es/Select/components/NoFindItem.d.ts +1 -1
- package/es/Select/components/NoFindItem.js +11 -7
- package/es/Select/components/NotFoundContent.d.ts +2 -2
- package/es/Select/components/NotFoundContent.js +49 -27
- package/es/Select/defaultConfig.d.ts +1 -1
- package/es/Select/defaultConfig.js +20 -16
- package/es/Select/hooks/changeHooks.d.ts +2 -2
- package/es/Select/hooks/changeHooks.js +147 -71
- package/es/Select/hooks/norHooks.d.ts +27 -9
- package/es/Select/hooks/norHooks.js +51 -39
- package/es/Select/index.d.ts +22 -1
- package/es/Select/index.js +124 -65
- package/es/Select/modal.d.ts +15 -15
- package/es/Select/utils.js +60 -15
- package/es/Submit/index.d.ts +9 -3
- package/es/Submit/index.js +18 -13
- package/es/Switch/index.d.ts +4 -4
- package/es/Switch/index.js +46 -20
- package/es/TDPicker/RangePicker.d.ts +8 -3
- package/es/TDPicker/RangePicker.js +138 -62
- package/es/TDPicker/TimePicker.d.ts +6 -1
- package/es/TDPicker/TimePicker.js +19 -13
- package/es/TDPicker/hooks.d.ts +42 -22
- package/es/TDPicker/hooks.js +106 -72
- package/es/TDPicker/index.d.ts +7 -1
- package/es/TDPicker/index.js +20 -14
- package/es/TDPicker/modal.d.ts +21 -16
- package/es/Upload/Btn.d.ts +5 -1
- package/es/Upload/Btn.js +35 -19
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +10 -5
- package/es/Upload/MediaTypeEle/TypeEle.js +31 -23
- package/es/Upload/MediaTypeEle/index.d.ts +5 -1
- package/es/Upload/MediaTypeEle/index.js +21 -18
- package/es/Upload/Preview/index.d.ts +5 -1
- package/es/Upload/Preview/index.js +17 -13
- package/es/Upload/UrlUpload/index.d.ts +7 -1
- package/es/Upload/UrlUpload/index.js +72 -51
- package/es/Upload/enums.d.ts +3 -3
- package/es/Upload/enums.js +3 -3
- package/es/Upload/hooks/change.d.ts +8 -1
- package/es/Upload/hooks/change.js +115 -58
- package/es/Upload/hooks/customRequest.d.ts +5 -1
- package/es/Upload/hooks/customRequest.js +63 -46
- package/es/Upload/hooks/propsMaker.d.ts +5 -1
- package/es/Upload/hooks/propsMaker.js +52 -13
- package/es/Upload/index.d.ts +3 -1
- package/es/Upload/index.js +131 -61
- package/es/Upload/modal.d.ts +17 -15
- package/es/Upload/util.d.ts +8 -2
- package/es/Upload/util.js +15 -7
- package/es/config.js +34 -31
- package/es/hooks/index.d.ts +14 -7
- package/es/hooks/index.js +124 -49
- package/es/index.d.ts +98 -16
- package/es/index.js +22 -5
- package/es/modal.d.ts +6 -6
- package/lib/CheckboxGroup/CheckBox/index.js +26 -18
- package/lib/CheckboxGroup/hooks.d.ts +9 -3
- package/lib/CheckboxGroup/hooks.js +116 -65
- package/lib/CheckboxGroup/index.d.ts +6 -1
- package/lib/CheckboxGroup/index.js +119 -58
- package/lib/CheckboxGroup/modal.d.ts +9 -8
- package/lib/Form/Context/FormConfigProvider.js +66 -21
- package/lib/Form/Context/index.d.ts +4 -1
- package/lib/Form/Context/index.js +4 -4
- package/lib/Form/FormItem/BasicItem.js +82 -44
- package/lib/Form/FormItem/Helper.d.ts +1 -1
- package/lib/Form/FormItem/Helper.js +19 -11
- package/lib/Form/FormItem/RegularFormItem.js +13 -10
- package/lib/Form/FormItem/UpFormItem.d.ts +6 -1
- package/lib/Form/FormItem/UpFormItem.js +29 -19
- package/lib/Form/FormItem/hooks.d.ts +21 -4
- package/lib/Form/FormItem/hooks.js +13 -10
- package/lib/Form/FormItem/index.js +7 -7
- package/lib/Form/HFormConnect.d.ts +9 -1
- package/lib/Form/HFormConnect.js +96 -28
- package/lib/Form/InitSet.d.ts +1 -1
- package/lib/Form/InitSet.js +7 -7
- package/lib/Form/Label.d.ts +4 -4
- package/lib/Form/Label.js +41 -21
- package/lib/Form/config.d.ts +100 -22
- package/lib/Form/config.js +21 -21
- package/lib/Form/hooks/index.d.ts +12 -5
- package/lib/Form/hooks/index.js +66 -50
- package/lib/Form/hooks/useHForm.js +235 -97
- package/lib/Form/hooks/useInitConfigData.d.ts +4 -1
- package/lib/Form/hooks/useInitConfigData.js +144 -63
- package/lib/Form/index.d.ts +11 -1
- package/lib/Form/index.js +73 -42
- package/lib/Form/modal.d.ts +92 -51
- package/lib/Input/ButtonInput.js +75 -53
- package/lib/Input/InputNumber.js +23 -14
- package/lib/Input/SelectInput.d.ts +16 -4
- package/lib/Input/SelectInput.js +125 -60
- package/lib/Input/defaultConfig.d.ts +3 -3
- package/lib/Input/defaultConfig.js +3 -3
- package/lib/Input/index.js +9 -9
- package/lib/Input/modal.d.ts +15 -11
- package/lib/PageHandler/ErrorComponent.js +49 -27
- package/lib/PageHandler/LoadingComponent.js +19 -15
- package/lib/PageHandler/index.js +9 -9
- package/lib/PageHandler/modal.d.ts +4 -4
- package/lib/RadioGroup/index.d.ts +12 -5
- package/lib/RadioGroup/index.js +48 -35
- package/lib/Select/components/AllSelect.d.ts +1 -1
- package/lib/Select/components/AllSelect.js +42 -20
- package/lib/Select/components/CheckBoxOption.d.ts +6 -3
- package/lib/Select/components/CheckBoxOption.js +14 -9
- package/lib/Select/components/DropdownComponent.d.ts +4 -4
- package/lib/Select/components/DropdownComponent.js +32 -19
- package/lib/Select/components/NoFindItem.d.ts +1 -1
- package/lib/Select/components/NoFindItem.js +13 -9
- package/lib/Select/components/NotFoundContent.d.ts +2 -2
- package/lib/Select/components/NotFoundContent.js +51 -29
- package/lib/Select/defaultConfig.d.ts +1 -1
- package/lib/Select/defaultConfig.js +21 -17
- package/lib/Select/hooks/changeHooks.d.ts +2 -2
- package/lib/Select/hooks/changeHooks.js +148 -72
- package/lib/Select/hooks/norHooks.d.ts +27 -9
- package/lib/Select/hooks/norHooks.js +52 -40
- package/lib/Select/index.d.ts +22 -1
- package/lib/Select/index.js +128 -67
- package/lib/Select/modal.d.ts +15 -15
- package/lib/Select/utils.js +61 -16
- package/lib/Submit/index.d.ts +9 -3
- package/lib/Submit/index.js +20 -15
- package/lib/Switch/index.d.ts +4 -4
- package/lib/Switch/index.js +48 -22
- package/lib/TDPicker/RangePicker.d.ts +8 -3
- package/lib/TDPicker/RangePicker.js +136 -64
- package/lib/TDPicker/TimePicker.d.ts +6 -1
- package/lib/TDPicker/TimePicker.js +21 -15
- package/lib/TDPicker/hooks.d.ts +42 -22
- package/lib/TDPicker/hooks.js +98 -72
- package/lib/TDPicker/index.d.ts +7 -1
- package/lib/TDPicker/index.js +22 -16
- package/lib/TDPicker/modal.d.ts +21 -16
- package/lib/Upload/Btn.d.ts +5 -1
- package/lib/Upload/Btn.js +37 -21
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +10 -5
- package/lib/Upload/MediaTypeEle/TypeEle.js +33 -25
- package/lib/Upload/MediaTypeEle/index.d.ts +5 -1
- package/lib/Upload/MediaTypeEle/index.js +23 -20
- package/lib/Upload/Preview/index.d.ts +5 -1
- package/lib/Upload/Preview/index.js +19 -15
- package/lib/Upload/UrlUpload/index.d.ts +7 -1
- package/lib/Upload/UrlUpload/index.js +74 -53
- package/lib/Upload/enums.d.ts +3 -3
- package/lib/Upload/enums.js +4 -4
- package/lib/Upload/hooks/change.d.ts +8 -1
- package/lib/Upload/hooks/change.js +116 -59
- package/lib/Upload/hooks/customRequest.d.ts +5 -1
- package/lib/Upload/hooks/customRequest.js +64 -47
- package/lib/Upload/hooks/propsMaker.d.ts +5 -1
- package/lib/Upload/hooks/propsMaker.js +55 -15
- package/lib/Upload/index.d.ts +3 -1
- package/lib/Upload/index.js +133 -63
- package/lib/Upload/modal.d.ts +17 -15
- package/lib/Upload/util.d.ts +8 -2
- package/lib/Upload/util.js +16 -8
- package/lib/config.js +35 -32
- package/lib/hooks/index.d.ts +14 -7
- package/lib/hooks/index.js +125 -50
- package/lib/index.d.ts +98 -16
- package/lib/index.js +5 -5
- package/lib/modal.d.ts +6 -6
- package/package.json +2 -2
- package/src/components/CheckboxGroup/index.tsx +2 -2
- package/src/components/Form/FormItem/Helper.tsx +3 -4
- package/src/components/Form/HFormConnect.tsx +6 -2
- package/src/components/Form/hooks/useHForm.ts +59 -10
- package/src/components/Form/modal.ts +12 -8
- package/src/components/TDPicker/RangePicker.tsx +7 -5
- package/src/components/TDPicker/modal.ts +1 -0
- package/src/pages/Form/index.tsx +2 -2
package/es/Input/SelectInput.js
CHANGED
|
@@ -1,30 +1,68 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import _Object$keys from
|
|
4
|
-
import _Object$getOwnPropertySymbols from
|
|
5
|
-
import _filterInstanceProperty from
|
|
6
|
-
import _Object$getOwnPropertyDescriptor from
|
|
7
|
-
import _Object$getOwnPropertyDescriptors from
|
|
8
|
-
import _Object$defineProperties from
|
|
9
|
-
import _Object$defineProperty from
|
|
10
|
-
import _extends from
|
|
11
|
-
import _defineProperty from
|
|
12
|
-
import _objectWithoutProperties from
|
|
13
|
-
import _forEachInstanceProperty from
|
|
14
|
-
import _Object$values from
|
|
15
|
-
import { Input } from
|
|
16
|
-
import HSelect from
|
|
17
|
-
import { defaultValueName, defaultSelectStyle } from
|
|
18
|
-
import HFormConnect from
|
|
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) {
|
|
23
|
-
|
|
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 =
|
|
84
|
+
style =
|
|
85
|
+
_selectProps$style === void 0 ? defaultSelectStyle : _selectProps$style,
|
|
47
86
|
_selectProps$placehol = selectProps.placeholder,
|
|
48
|
-
placeholder =
|
|
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
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
|
package/es/Input/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import _objectDestructuringEmpty from
|
|
4
|
-
import _extends from
|
|
5
|
-
import { Input } from
|
|
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 =
|
|
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
|
package/es/Input/modal.d.ts
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
8
|
+
input?: string;
|
|
9
|
+
select?: string;
|
|
10
10
|
}
|
|
11
|
-
export interface HSelectInputProps
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
+
onClick: (
|
|
21
|
+
value: string | readonly string[] | number | undefined,
|
|
22
|
+
e: HTMLElement
|
|
23
|
+
) => void;
|
|
20
24
|
}
|
|
21
25
|
export interface HButtonInputProps extends HInputProps {
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
3
|
-
import { Typography, Row, Space, Button } from
|
|
4
|
-
import { ExclamationCircleOutlined } from
|
|
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 =
|
|
7
|
+
var ErrorComponent = function (_ref) {
|
|
8
8
|
var error = _ref.error,
|
|
9
9
|
reload = _ref.reload;
|
|
10
|
-
return /*#__PURE__*/React.createElement(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
3
|
-
import { Row, Spin } from
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Row, Spin } from "antd";
|
|
4
4
|
|
|
5
|
-
var Loading =
|
|
6
|
-
return /*#__PURE__*/React.createElement(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
package/es/PageHandler/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import Loading from
|
|
4
|
-
import ErrorComponent from
|
|
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 };
|
package/es/RadioGroup/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { SelectProps, RadioGroupProps } from "antd/es";
|
|
3
|
-
export interface HRadioGroupProps
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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: ({
|
|
9
|
+
declare const _default: ({
|
|
10
|
+
value,
|
|
11
|
+
options,
|
|
12
|
+
onChange,
|
|
13
|
+
fieldNames: propsFieldNames,
|
|
14
|
+
...props
|
|
15
|
+
}: HRadioGroupProps) => JSX.Element;
|
|
9
16
|
export default _default;
|
package/es/RadioGroup/index.js
CHANGED
|
@@ -1,48 +1,61 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React, { useMemo } from
|
|
3
|
-
import _extends from
|
|
4
|
-
import _typeof from
|
|
5
|
-
import _objectWithoutProperties from
|
|
6
|
-
import _mapInstanceProperty from
|
|
7
|
-
import { Radio } from
|
|
8
|
-
import { useMatchConfigProps } from
|
|
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 =
|
|
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(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|