@hw-component/form 1.9.42 → 1.9.43
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/Input/InputNumberGroup.js +1 -1
- package/es/Select/index.js +65 -48
- package/es/Select/modal.d.ts +2 -0
- package/es/index.css +59 -24
- package/lib/Input/InputNumberGroup.js +1 -1
- package/lib/Select/index.js +64 -47
- package/lib/Select/modal.d.ts +2 -0
- package/lib/index.css +59 -24
- package/package.json +1 -1
- package/src/components/Input/InputNumberGroup.tsx +1 -1
- package/src/components/Input/index.less +10 -20
- package/src/components/Select/index.less +35 -0
- package/src/components/Select/index.tsx +76 -61
- package/src/components/Select/modal.ts +2 -0
- package/src/components/styles/index.less +14 -0
- package/src/pages/Form/index.tsx +67 -32
- package/src/pages/Select/index.tsx +1 -0
|
@@ -26,7 +26,7 @@ var Addon = function Addon(_ref) {
|
|
|
26
26
|
var children = _ref.children,
|
|
27
27
|
value = _ref.value,
|
|
28
28
|
onChange = _ref.onChange;
|
|
29
|
-
var addonClassname = useClassName(["hw-
|
|
29
|
+
var addonClassname = useClassName(["hw-addon"]);
|
|
30
30
|
if (!children) {
|
|
31
31
|
return jsx(Fragment, {});
|
|
32
32
|
}
|
package/es/Select/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
2
|
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
4
|
import { createElement } from 'react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { Select } from 'antd';
|
|
7
7
|
import { useFilterOption, useSelectReq } from './hooks/norHooks.js';
|
|
8
8
|
import { useValueChange } from './hooks/changeHooks.js';
|
|
9
9
|
import { defaultModeConfig, defaultSelectConfig } from './defaultConfig.js';
|
|
10
10
|
import Index$1 from './components/DropdownComponent.js';
|
|
11
11
|
import Index$2 from './components/AllSelect.js';
|
|
12
|
-
import { useMatchConfigProps, useChangeOptions } from '../hooks/index.js';
|
|
12
|
+
import { useMatchConfigProps, useChangeOptions, useClassName } from '../hooks/index.js';
|
|
13
13
|
import HFormConnect from '../Form/HFormConnect.js';
|
|
14
14
|
|
|
15
|
-
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll"],
|
|
15
|
+
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll", "addonBefore", "addonAfter"],
|
|
16
16
|
_excluded2 = ["value", "label"];
|
|
17
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -49,6 +49,8 @@ var Index = function Index(_ref) {
|
|
|
49
49
|
var dispatch = _ref.dispatch,
|
|
50
50
|
isList = _ref.isList,
|
|
51
51
|
propsOnPopupScroll = _ref.onPopupScroll,
|
|
52
|
+
addonBefore = _ref.addonBefore,
|
|
53
|
+
addonAfter = _ref.addonAfter,
|
|
52
54
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
53
55
|
var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
|
|
54
56
|
icon = _ref2.icon,
|
|
@@ -84,6 +86,12 @@ var Index = function Index(_ref) {
|
|
|
84
86
|
options: resultData,
|
|
85
87
|
fieldNames: fieldNames
|
|
86
88
|
});
|
|
89
|
+
var boxClassName = useClassName("hw-select-box");
|
|
90
|
+
var addonBeforeClassName = useClassName("hw-group-addon-before");
|
|
91
|
+
var addonBeforeBoxClassName = useClassName("hw-select-box-addon-before");
|
|
92
|
+
var addonAfterClassName = useClassName("hw-group-addon-after");
|
|
93
|
+
var addonAfterBoxClassName = useClassName("hw-select-box-addon-after");
|
|
94
|
+
var addonClassname = useClassName(["hw-addon"]);
|
|
87
95
|
var _useValueChange = useValueChange({
|
|
88
96
|
labelInValue: labelInValue,
|
|
89
97
|
onChange: onChange,
|
|
@@ -96,53 +104,62 @@ var Index = function Index(_ref) {
|
|
|
96
104
|
val = _useValueChange.val,
|
|
97
105
|
change = _useValueChange.change;
|
|
98
106
|
addDispatchListener === null || addDispatchListener === void 0 || addDispatchListener("reload", reload);
|
|
99
|
-
return
|
|
107
|
+
return jsxs("div", {
|
|
108
|
+
className: "".concat(boxClassName, " ").concat(addonBefore ? addonBeforeBoxClassName : "", " ").concat(addonAfter ? addonAfterBoxClassName : ""),
|
|
100
109
|
style: style,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
children: [addonBefore && jsx("div", {
|
|
111
|
+
className: "".concat(addonClassname, " ").concat(addonBeforeClassName),
|
|
112
|
+
children: addonBefore
|
|
113
|
+
}), jsx(Select, _objectSpread(_objectSpread({
|
|
114
|
+
mode: mode,
|
|
115
|
+
loading: loading,
|
|
116
|
+
value: val,
|
|
117
|
+
onSearch: onSearch,
|
|
118
|
+
onChange: change,
|
|
119
|
+
dropdownRender: function dropdownRender(node) {
|
|
120
|
+
return jsx(Index$1, {
|
|
121
|
+
loading: loading,
|
|
122
|
+
reload: run,
|
|
123
|
+
error: error,
|
|
114
124
|
options: data,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
125
|
+
children: jsx(Index$2, {
|
|
126
|
+
allSelect: allSelect,
|
|
127
|
+
options: data,
|
|
128
|
+
mode: mode,
|
|
129
|
+
value: val,
|
|
130
|
+
onChange: change,
|
|
131
|
+
fieldNames: fieldNames,
|
|
132
|
+
children: node
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
optionLabelProp: optionLabelProp,
|
|
137
|
+
menuItemSelectedIcon: icon,
|
|
138
|
+
optionFilterProp: optionFilterProp,
|
|
139
|
+
filterOption: selfFilterOption,
|
|
140
|
+
showSearch: mathShowSearch,
|
|
141
|
+
labelInValue: true,
|
|
142
|
+
onPopupScroll: propsOnPopupScroll || onPopupScroll
|
|
143
|
+
}, props), {}, {
|
|
144
|
+
children: data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
145
|
+
var optionValue = item.value,
|
|
146
|
+
label = item.label,
|
|
147
|
+
oItem = _objectWithoutProperties(item, _excluded2);
|
|
148
|
+
var filterKey = filterProvider || "label";
|
|
149
|
+
var result = typeof filterProvider === "function" ? filterProvider === null || filterProvider === void 0 ? void 0 : filterProvider(item) : item[filterKey];
|
|
150
|
+
var filter = _defineProperty({}, optionFilterProp, result);
|
|
151
|
+
return /*#__PURE__*/createElement(Option, _objectSpread(_objectSpread({}, oItem), {}, {
|
|
152
|
+
value: optionValue,
|
|
153
|
+
key: optionValue,
|
|
154
|
+
label: label,
|
|
155
|
+
mode: mode
|
|
156
|
+
}, filter), render ? render(item, val) : label);
|
|
157
|
+
})
|
|
158
|
+
})), addonAfter && jsx("div", {
|
|
159
|
+
className: "".concat(addonClassname, " ").concat(addonAfterClassName),
|
|
160
|
+
children: addonAfter
|
|
161
|
+
})]
|
|
162
|
+
});
|
|
146
163
|
};
|
|
147
164
|
var HSelect = HFormConnect(Index);
|
|
148
165
|
|
package/es/Select/modal.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export interface HSelectProps extends Omit<SelectProps, "options" | "placeholder
|
|
|
36
36
|
placeholder?: string;
|
|
37
37
|
dispatch?: DispatchModal;
|
|
38
38
|
isList?: boolean;
|
|
39
|
+
addonBefore?: React.ReactNode;
|
|
40
|
+
addonAfter?: React.ReactNode;
|
|
39
41
|
}
|
|
40
42
|
export interface FilterDataModal {
|
|
41
43
|
value: any;
|
package/es/index.css
CHANGED
|
@@ -7,6 +7,41 @@
|
|
|
7
7
|
.ant-hw-all-check-box .ant-select-item-option:not( .ant-select-item-option-selected):hover {
|
|
8
8
|
background-color: #f5f5f5;
|
|
9
9
|
}
|
|
10
|
+
.ant-hw-select-box {
|
|
11
|
+
display: -webkit-box;
|
|
12
|
+
display: -webkit-flex;
|
|
13
|
+
display: -ms-flexbox;
|
|
14
|
+
display: flex;
|
|
15
|
+
-webkit-box-orient: horizontal;
|
|
16
|
+
-webkit-box-direction: normal;
|
|
17
|
+
-webkit-flex-direction: row;
|
|
18
|
+
-ms-flex-direction: row;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
}
|
|
21
|
+
.ant-hw-select-box .ant-hw-group-addon-before {
|
|
22
|
+
border-bottom-left-radius: 2px;
|
|
23
|
+
border-top-left-radius: 2px;
|
|
24
|
+
border-right: 0px;
|
|
25
|
+
}
|
|
26
|
+
.ant-hw-select-box .ant-select {
|
|
27
|
+
-webkit-box-flex: 1;
|
|
28
|
+
-webkit-flex: 1;
|
|
29
|
+
-ms-flex: 1;
|
|
30
|
+
flex: 1;
|
|
31
|
+
}
|
|
32
|
+
.ant-hw-select-box .ant-hw-group-addon-after {
|
|
33
|
+
border-bottom-right-radius: 2px;
|
|
34
|
+
border-top-right-radius: 2px;
|
|
35
|
+
border-left: 0px;
|
|
36
|
+
}
|
|
37
|
+
.ant-hw-select-box-addon-before .ant-select .ant-select-selector {
|
|
38
|
+
border-bottom-left-radius: 0px !important;
|
|
39
|
+
border-top-left-radius: 0px !important;
|
|
40
|
+
}
|
|
41
|
+
.ant-hw-select-box-addon-after .ant-select .ant-select-selector {
|
|
42
|
+
border-bottom-right-radius: 0px !important;
|
|
43
|
+
border-top-right-radius: 0px !important;
|
|
44
|
+
}
|
|
10
45
|
.ant-hw-form-item-colon:after {
|
|
11
46
|
position: relative;
|
|
12
47
|
top: -0.5px;
|
|
@@ -125,17 +160,6 @@
|
|
|
125
160
|
.ant-hw-form-form-item .ant-form-item-label {
|
|
126
161
|
overflow: visible;
|
|
127
162
|
}
|
|
128
|
-
.ant-form-item-has-error .ant-hw-input-group-body {
|
|
129
|
-
border-color: #ff4d4f !important;
|
|
130
|
-
}
|
|
131
|
-
.ant-form-item-has-error .ant-hw-input-group-active {
|
|
132
|
-
border-color: #ff4d4f !important;
|
|
133
|
-
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
134
|
-
}
|
|
135
|
-
.ant-form-item-has-error .ant-hw-input-group-addon {
|
|
136
|
-
color: #ff4d4f;
|
|
137
|
-
border-color: #ff4d4f !important;
|
|
138
|
-
}
|
|
139
163
|
.ant-hw-input-group {
|
|
140
164
|
display: -webkit-box !important;
|
|
141
165
|
display: -webkit-flex !important;
|
|
@@ -201,19 +225,6 @@
|
|
|
201
225
|
border-color: #40a9ff;
|
|
202
226
|
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
203
227
|
}
|
|
204
|
-
.ant-hw-input-group .ant-hw-input-group-addon {
|
|
205
|
-
display: -webkit-box !important;
|
|
206
|
-
display: -webkit-flex !important;
|
|
207
|
-
display: -ms-flexbox !important;
|
|
208
|
-
display: flex !important;
|
|
209
|
-
-webkit-box-align: center;
|
|
210
|
-
-webkit-align-items: center;
|
|
211
|
-
-ms-flex-align: center;
|
|
212
|
-
align-items: center;
|
|
213
|
-
padding: 0 11px;
|
|
214
|
-
background-color: #fafafa;
|
|
215
|
-
border: 1px solid #d9d9d9;
|
|
216
|
-
}
|
|
217
228
|
.ant-hw-color-box {
|
|
218
229
|
width: 22px;
|
|
219
230
|
height: 22px;
|
|
@@ -223,6 +234,13 @@
|
|
|
223
234
|
.ant-hw-color-input-picker {
|
|
224
235
|
box-shadow: 0 0 0 0 !important;
|
|
225
236
|
}
|
|
237
|
+
.ant-form-item-has-error .ant-hw-input-group-body {
|
|
238
|
+
border-color: #ff4d4f !important;
|
|
239
|
+
}
|
|
240
|
+
.ant-form-item-has-error .ant-hw-input-group-active {
|
|
241
|
+
border-color: #ff4d4f !important;
|
|
242
|
+
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
243
|
+
}
|
|
226
244
|
.ant-hw-switch {
|
|
227
245
|
display: -webkit-box;
|
|
228
246
|
display: -webkit-flex;
|
|
@@ -244,3 +262,20 @@
|
|
|
244
262
|
.ant-hw-switch .ant-hw-switch-after {
|
|
245
263
|
margin-left: 4px;
|
|
246
264
|
}
|
|
265
|
+
.ant-hw-addon {
|
|
266
|
+
display: -webkit-box !important;
|
|
267
|
+
display: -webkit-flex !important;
|
|
268
|
+
display: -ms-flexbox !important;
|
|
269
|
+
display: flex !important;
|
|
270
|
+
-webkit-box-align: center;
|
|
271
|
+
-webkit-align-items: center;
|
|
272
|
+
-ms-flex-align: center;
|
|
273
|
+
align-items: center;
|
|
274
|
+
padding: 0 11px;
|
|
275
|
+
background-color: #fafafa;
|
|
276
|
+
border: 1px solid #d9d9d9;
|
|
277
|
+
}
|
|
278
|
+
.ant-form-item-has-error .ant-hw-addon {
|
|
279
|
+
color: #ff4d4f;
|
|
280
|
+
border-color: #ff4d4f !important;
|
|
281
|
+
}
|
|
@@ -29,7 +29,7 @@ var Addon = function Addon(_ref) {
|
|
|
29
29
|
var children = _ref.children,
|
|
30
30
|
value = _ref.value,
|
|
31
31
|
onChange = _ref.onChange;
|
|
32
|
-
var addonClassname = index.useClassName(["hw-
|
|
32
|
+
var addonClassname = index.useClassName(["hw-addon"]);
|
|
33
33
|
if (!children) {
|
|
34
34
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
35
35
|
}
|
package/lib/Select/index.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var React = require('react');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var antd = require('antd');
|
|
10
10
|
var norHooks = require('./hooks/norHooks.js');
|
|
11
11
|
var changeHooks = require('./hooks/changeHooks.js');
|
|
@@ -15,7 +15,7 @@ var AllSelect = require('./components/AllSelect.js');
|
|
|
15
15
|
var index = require('../hooks/index.js');
|
|
16
16
|
var HFormConnect = require('../Form/HFormConnect.js');
|
|
17
17
|
|
|
18
|
-
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll"],
|
|
18
|
+
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll", "addonBefore", "addonAfter"],
|
|
19
19
|
_excluded2 = ["value", "label"];
|
|
20
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -52,6 +52,8 @@ var Index = function Index(_ref) {
|
|
|
52
52
|
var dispatch = _ref.dispatch,
|
|
53
53
|
isList = _ref.isList,
|
|
54
54
|
propsOnPopupScroll = _ref.onPopupScroll,
|
|
55
|
+
addonBefore = _ref.addonBefore,
|
|
56
|
+
addonAfter = _ref.addonAfter,
|
|
55
57
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
56
58
|
var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
|
|
57
59
|
icon = _ref2.icon,
|
|
@@ -87,6 +89,12 @@ var Index = function Index(_ref) {
|
|
|
87
89
|
options: resultData,
|
|
88
90
|
fieldNames: fieldNames
|
|
89
91
|
});
|
|
92
|
+
var boxClassName = index.useClassName("hw-select-box");
|
|
93
|
+
var addonBeforeClassName = index.useClassName("hw-group-addon-before");
|
|
94
|
+
var addonBeforeBoxClassName = index.useClassName("hw-select-box-addon-before");
|
|
95
|
+
var addonAfterClassName = index.useClassName("hw-group-addon-after");
|
|
96
|
+
var addonAfterBoxClassName = index.useClassName("hw-select-box-addon-after");
|
|
97
|
+
var addonClassname = index.useClassName(["hw-addon"]);
|
|
90
98
|
var _useValueChange = changeHooks.useValueChange({
|
|
91
99
|
labelInValue: labelInValue,
|
|
92
100
|
onChange: onChange,
|
|
@@ -99,53 +107,62 @@ var Index = function Index(_ref) {
|
|
|
99
107
|
val = _useValueChange.val,
|
|
100
108
|
change = _useValueChange.change;
|
|
101
109
|
addDispatchListener === null || addDispatchListener === void 0 || addDispatchListener("reload", reload);
|
|
102
|
-
return jsxRuntime.
|
|
110
|
+
return jsxRuntime.jsxs("div", {
|
|
111
|
+
className: "".concat(boxClassName, " ").concat(addonBefore ? addonBeforeBoxClassName : "", " ").concat(addonAfter ? addonAfterBoxClassName : ""),
|
|
103
112
|
style: style,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
children: [addonBefore && jsxRuntime.jsx("div", {
|
|
114
|
+
className: "".concat(addonClassname, " ").concat(addonBeforeClassName),
|
|
115
|
+
children: addonBefore
|
|
116
|
+
}), jsxRuntime.jsx(antd.Select, _objectSpread(_objectSpread({
|
|
117
|
+
mode: mode,
|
|
118
|
+
loading: loading,
|
|
119
|
+
value: val,
|
|
120
|
+
onSearch: onSearch,
|
|
121
|
+
onChange: change,
|
|
122
|
+
dropdownRender: function dropdownRender(node) {
|
|
123
|
+
return jsxRuntime.jsx(DropdownComponent.default, {
|
|
124
|
+
loading: loading,
|
|
125
|
+
reload: run,
|
|
126
|
+
error: error,
|
|
117
127
|
options: data,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
128
|
+
children: jsxRuntime.jsx(AllSelect.default, {
|
|
129
|
+
allSelect: allSelect,
|
|
130
|
+
options: data,
|
|
131
|
+
mode: mode,
|
|
132
|
+
value: val,
|
|
133
|
+
onChange: change,
|
|
134
|
+
fieldNames: fieldNames,
|
|
135
|
+
children: node
|
|
136
|
+
})
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
optionLabelProp: optionLabelProp,
|
|
140
|
+
menuItemSelectedIcon: icon,
|
|
141
|
+
optionFilterProp: optionFilterProp,
|
|
142
|
+
filterOption: selfFilterOption,
|
|
143
|
+
showSearch: mathShowSearch,
|
|
144
|
+
labelInValue: true,
|
|
145
|
+
onPopupScroll: propsOnPopupScroll || onPopupScroll
|
|
146
|
+
}, props), {}, {
|
|
147
|
+
children: data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
148
|
+
var optionValue = item.value,
|
|
149
|
+
label = item.label,
|
|
150
|
+
oItem = _objectWithoutProperties(item, _excluded2);
|
|
151
|
+
var filterKey = filterProvider || "label";
|
|
152
|
+
var result = typeof filterProvider === "function" ? filterProvider === null || filterProvider === void 0 ? void 0 : filterProvider(item) : item[filterKey];
|
|
153
|
+
var filter = _defineProperty({}, optionFilterProp, result);
|
|
154
|
+
return /*#__PURE__*/React.createElement(Option, _objectSpread(_objectSpread({}, oItem), {}, {
|
|
155
|
+
value: optionValue,
|
|
156
|
+
key: optionValue,
|
|
157
|
+
label: label,
|
|
158
|
+
mode: mode
|
|
159
|
+
}, filter), render ? render(item, val) : label);
|
|
160
|
+
})
|
|
161
|
+
})), addonAfter && jsxRuntime.jsx("div", {
|
|
162
|
+
className: "".concat(addonClassname, " ").concat(addonAfterClassName),
|
|
163
|
+
children: addonAfter
|
|
164
|
+
})]
|
|
165
|
+
});
|
|
149
166
|
};
|
|
150
167
|
var HSelect = HFormConnect.default(Index);
|
|
151
168
|
|
package/lib/Select/modal.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export interface HSelectProps extends Omit<SelectProps, "options" | "placeholder
|
|
|
36
36
|
placeholder?: string;
|
|
37
37
|
dispatch?: DispatchModal;
|
|
38
38
|
isList?: boolean;
|
|
39
|
+
addonBefore?: React.ReactNode;
|
|
40
|
+
addonAfter?: React.ReactNode;
|
|
39
41
|
}
|
|
40
42
|
export interface FilterDataModal {
|
|
41
43
|
value: any;
|
package/lib/index.css
CHANGED
|
@@ -7,6 +7,41 @@
|
|
|
7
7
|
.ant-hw-all-check-box .ant-select-item-option:not( .ant-select-item-option-selected):hover {
|
|
8
8
|
background-color: #f5f5f5;
|
|
9
9
|
}
|
|
10
|
+
.ant-hw-select-box {
|
|
11
|
+
display: -webkit-box;
|
|
12
|
+
display: -webkit-flex;
|
|
13
|
+
display: -ms-flexbox;
|
|
14
|
+
display: flex;
|
|
15
|
+
-webkit-box-orient: horizontal;
|
|
16
|
+
-webkit-box-direction: normal;
|
|
17
|
+
-webkit-flex-direction: row;
|
|
18
|
+
-ms-flex-direction: row;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
}
|
|
21
|
+
.ant-hw-select-box .ant-hw-group-addon-before {
|
|
22
|
+
border-bottom-left-radius: 2px;
|
|
23
|
+
border-top-left-radius: 2px;
|
|
24
|
+
border-right: 0px;
|
|
25
|
+
}
|
|
26
|
+
.ant-hw-select-box .ant-select {
|
|
27
|
+
-webkit-box-flex: 1;
|
|
28
|
+
-webkit-flex: 1;
|
|
29
|
+
-ms-flex: 1;
|
|
30
|
+
flex: 1;
|
|
31
|
+
}
|
|
32
|
+
.ant-hw-select-box .ant-hw-group-addon-after {
|
|
33
|
+
border-bottom-right-radius: 2px;
|
|
34
|
+
border-top-right-radius: 2px;
|
|
35
|
+
border-left: 0px;
|
|
36
|
+
}
|
|
37
|
+
.ant-hw-select-box-addon-before .ant-select .ant-select-selector {
|
|
38
|
+
border-bottom-left-radius: 0px !important;
|
|
39
|
+
border-top-left-radius: 0px !important;
|
|
40
|
+
}
|
|
41
|
+
.ant-hw-select-box-addon-after .ant-select .ant-select-selector {
|
|
42
|
+
border-bottom-right-radius: 0px !important;
|
|
43
|
+
border-top-right-radius: 0px !important;
|
|
44
|
+
}
|
|
10
45
|
.ant-hw-form-item-colon:after {
|
|
11
46
|
position: relative;
|
|
12
47
|
top: -0.5px;
|
|
@@ -125,17 +160,6 @@
|
|
|
125
160
|
.ant-hw-form-form-item .ant-form-item-label {
|
|
126
161
|
overflow: visible;
|
|
127
162
|
}
|
|
128
|
-
.ant-form-item-has-error .ant-hw-input-group-body {
|
|
129
|
-
border-color: #ff4d4f !important;
|
|
130
|
-
}
|
|
131
|
-
.ant-form-item-has-error .ant-hw-input-group-active {
|
|
132
|
-
border-color: #ff4d4f !important;
|
|
133
|
-
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
134
|
-
}
|
|
135
|
-
.ant-form-item-has-error .ant-hw-input-group-addon {
|
|
136
|
-
color: #ff4d4f;
|
|
137
|
-
border-color: #ff4d4f !important;
|
|
138
|
-
}
|
|
139
163
|
.ant-hw-input-group {
|
|
140
164
|
display: -webkit-box !important;
|
|
141
165
|
display: -webkit-flex !important;
|
|
@@ -201,19 +225,6 @@
|
|
|
201
225
|
border-color: #40a9ff;
|
|
202
226
|
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
203
227
|
}
|
|
204
|
-
.ant-hw-input-group .ant-hw-input-group-addon {
|
|
205
|
-
display: -webkit-box !important;
|
|
206
|
-
display: -webkit-flex !important;
|
|
207
|
-
display: -ms-flexbox !important;
|
|
208
|
-
display: flex !important;
|
|
209
|
-
-webkit-box-align: center;
|
|
210
|
-
-webkit-align-items: center;
|
|
211
|
-
-ms-flex-align: center;
|
|
212
|
-
align-items: center;
|
|
213
|
-
padding: 0 11px;
|
|
214
|
-
background-color: #fafafa;
|
|
215
|
-
border: 1px solid #d9d9d9;
|
|
216
|
-
}
|
|
217
228
|
.ant-hw-color-box {
|
|
218
229
|
width: 22px;
|
|
219
230
|
height: 22px;
|
|
@@ -223,6 +234,13 @@
|
|
|
223
234
|
.ant-hw-color-input-picker {
|
|
224
235
|
box-shadow: 0 0 0 0 !important;
|
|
225
236
|
}
|
|
237
|
+
.ant-form-item-has-error .ant-hw-input-group-body {
|
|
238
|
+
border-color: #ff4d4f !important;
|
|
239
|
+
}
|
|
240
|
+
.ant-form-item-has-error .ant-hw-input-group-active {
|
|
241
|
+
border-color: #ff4d4f !important;
|
|
242
|
+
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
243
|
+
}
|
|
226
244
|
.ant-hw-switch {
|
|
227
245
|
display: -webkit-box;
|
|
228
246
|
display: -webkit-flex;
|
|
@@ -244,3 +262,20 @@
|
|
|
244
262
|
.ant-hw-switch .ant-hw-switch-after {
|
|
245
263
|
margin-left: 4px;
|
|
246
264
|
}
|
|
265
|
+
.ant-hw-addon {
|
|
266
|
+
display: -webkit-box !important;
|
|
267
|
+
display: -webkit-flex !important;
|
|
268
|
+
display: -ms-flexbox !important;
|
|
269
|
+
display: flex !important;
|
|
270
|
+
-webkit-box-align: center;
|
|
271
|
+
-webkit-align-items: center;
|
|
272
|
+
-ms-flex-align: center;
|
|
273
|
+
align-items: center;
|
|
274
|
+
padding: 0 11px;
|
|
275
|
+
background-color: #fafafa;
|
|
276
|
+
border: 1px solid #d9d9d9;
|
|
277
|
+
}
|
|
278
|
+
.ant-form-item-has-error .ant-hw-addon {
|
|
279
|
+
color: #ff4d4f;
|
|
280
|
+
border-color: #ff4d4f !important;
|
|
281
|
+
}
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ const useArrayProps = (props: any) => {
|
|
|
32
32
|
}, [props]);
|
|
33
33
|
};
|
|
34
34
|
const Addon: React.FC<IProps> = ({ children, value, onChange }) => {
|
|
35
|
-
const addonClassname = useClassName(["hw-
|
|
35
|
+
const addonClassname = useClassName(["hw-addon"]);
|
|
36
36
|
if (!children) {
|
|
37
37
|
return <></>;
|
|
38
38
|
}
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
@import "../styles/local.less";
|
|
2
2
|
@all-input-group: ~"@{ant-prefix}-hw-input-group";
|
|
3
|
-
|
|
4
|
-
.@{all-input-group}-body {
|
|
5
|
-
border-color: #ff4d4f !important;
|
|
6
|
-
}
|
|
7
|
-
.@{all-input-group}-active {
|
|
8
|
-
border-color: #ff4d4f !important;
|
|
9
|
-
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
10
|
-
}
|
|
11
|
-
.@{all-input-group}-addon {
|
|
12
|
-
color: #ff4d4f;
|
|
13
|
-
border-color: #ff4d4f !important;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
3
|
+
|
|
16
4
|
.@{all-input-group} {
|
|
17
5
|
display: flex !important;
|
|
18
6
|
width: 100%;
|
|
@@ -63,13 +51,6 @@
|
|
|
63
51
|
border-color: #40a9ff;
|
|
64
52
|
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
65
53
|
}
|
|
66
|
-
.@{all-input-group}-addon {
|
|
67
|
-
display: flex !important;
|
|
68
|
-
align-items: center;
|
|
69
|
-
padding: 0 11px;
|
|
70
|
-
background-color: #fafafa;
|
|
71
|
-
border: 1px solid #d9d9d9;
|
|
72
|
-
}
|
|
73
54
|
}
|
|
74
55
|
|
|
75
56
|
.@{ant-prefix}-hw-color-box {
|
|
@@ -81,3 +62,12 @@
|
|
|
81
62
|
.@{ant-prefix}-hw-color-input-picker {
|
|
82
63
|
box-shadow: 0 0 0 0 !important;
|
|
83
64
|
}
|
|
65
|
+
.@{ant-prefix}-form-item-has-error {
|
|
66
|
+
.@{all-input-group}-body {
|
|
67
|
+
border-color: #ff4d4f !important;
|
|
68
|
+
}
|
|
69
|
+
.@{all-input-group}-active {
|
|
70
|
+
border-color: #ff4d4f !important;
|
|
71
|
+
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -20,3 +20,38 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
.@{ant-prefix}-hw-select-box{
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
|
|
27
|
+
.@{ant-prefix}-hw-group-addon-before{
|
|
28
|
+
border-bottom-left-radius: 2px;
|
|
29
|
+
border-top-left-radius: 2px;
|
|
30
|
+
border-right: 0px;
|
|
31
|
+
}
|
|
32
|
+
.@{ant-prefix}-select{
|
|
33
|
+
flex: 1;
|
|
34
|
+
}
|
|
35
|
+
.@{ant-prefix}-hw-group-addon-after{
|
|
36
|
+
border-bottom-right-radius: 2px;
|
|
37
|
+
border-top-right-radius: 2px;
|
|
38
|
+
border-left: 0px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.@{ant-prefix}-hw-select-box-addon-before{
|
|
42
|
+
.@{ant-prefix}-select{
|
|
43
|
+
.@{ant-prefix}-select-selector{
|
|
44
|
+
border-bottom-left-radius: 0px !important;
|
|
45
|
+
border-top-left-radius: 0px !important;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.@{ant-prefix}-hw-select-box-addon-after{
|
|
51
|
+
.@{ant-prefix}-select{
|
|
52
|
+
.@{ant-prefix}-select-selector{
|
|
53
|
+
border-bottom-right-radius: 0px !important;
|
|
54
|
+
border-top-right-radius: 0px !important;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select
|
|
1
|
+
import { Select} from "antd";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useFilterOption, useSelectReq } from "./hooks/norHooks";
|
|
4
4
|
import { useValueChange } from "./hooks/changeHooks";
|
|
@@ -6,7 +6,7 @@ import type { HSelectProps } from "./modal";
|
|
|
6
6
|
import { defaultModeConfig, defaultSelectConfig } from "./defaultConfig";
|
|
7
7
|
import DropdownComponent from "./components/DropdownComponent";
|
|
8
8
|
import AllSelect from "./components/AllSelect";
|
|
9
|
-
import {
|
|
9
|
+
import {useChangeOptions, useClassName, useMatchConfigProps} from "../hooks";
|
|
10
10
|
import HFormConnect from "../Form/HFormConnect";
|
|
11
11
|
const { Option } = Select;
|
|
12
12
|
|
|
@@ -35,7 +35,8 @@ const Index: React.FC<HSelectProps> = ({
|
|
|
35
35
|
dispatch,
|
|
36
36
|
isList,
|
|
37
37
|
onPopupScroll: propsOnPopupScroll,
|
|
38
|
-
|
|
38
|
+
addonBefore,
|
|
39
|
+
addonAfter,
|
|
39
40
|
...props
|
|
40
41
|
}) => {
|
|
41
42
|
const { icon, render } = modeConfig?.[mode || ""] || {};
|
|
@@ -63,6 +64,13 @@ const Index: React.FC<HSelectProps> = ({
|
|
|
63
64
|
}); //options
|
|
64
65
|
|
|
65
66
|
const data = useChangeOptions({ options: resultData, fieldNames });
|
|
67
|
+
const boxClassName=useClassName("hw-select-box");
|
|
68
|
+
const addonBeforeClassName=useClassName("hw-group-addon-before");
|
|
69
|
+
const addonBeforeBoxClassName=useClassName("hw-select-box-addon-before");
|
|
70
|
+
const addonAfterClassName=useClassName("hw-group-addon-after");
|
|
71
|
+
const addonAfterBoxClassName=useClassName("hw-select-box-addon-after");
|
|
72
|
+
const addonClassname = useClassName(["hw-addon"]);
|
|
73
|
+
|
|
66
74
|
const { val, change } = useValueChange({
|
|
67
75
|
labelInValue,
|
|
68
76
|
onChange,
|
|
@@ -74,65 +82,72 @@ const Index: React.FC<HSelectProps> = ({
|
|
|
74
82
|
});
|
|
75
83
|
addDispatchListener?.("reload", reload);
|
|
76
84
|
return (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
onSearch={onSearch}
|
|
83
|
-
onChange={change}
|
|
84
|
-
dropdownRender={(node) => {
|
|
85
|
-
return (
|
|
86
|
-
<DropdownComponent
|
|
87
|
-
loading={loading}
|
|
88
|
-
reload={run}
|
|
89
|
-
error={error}
|
|
90
|
-
options={data}
|
|
91
|
-
>
|
|
92
|
-
<AllSelect
|
|
93
|
-
allSelect={allSelect}
|
|
94
|
-
options={data}
|
|
95
|
-
mode={mode}
|
|
96
|
-
value={val}
|
|
97
|
-
onChange={change}
|
|
98
|
-
fieldNames={fieldNames}
|
|
99
|
-
>
|
|
100
|
-
{node}
|
|
101
|
-
</AllSelect>
|
|
102
|
-
</DropdownComponent> //全选
|
|
103
|
-
);
|
|
104
|
-
}}
|
|
105
|
-
optionLabelProp={optionLabelProp}
|
|
106
|
-
menuItemSelectedIcon={icon}
|
|
107
|
-
optionFilterProp={optionFilterProp}
|
|
108
|
-
filterOption={selfFilterOption}
|
|
109
|
-
showSearch={mathShowSearch}
|
|
110
|
-
labelInValue={true}
|
|
111
|
-
onPopupScroll={propsOnPopupScroll || onPopupScroll}
|
|
112
|
-
{...props}
|
|
113
|
-
>
|
|
114
|
-
{data?.map((item) => {
|
|
115
|
-
const { value: optionValue, label, ...oItem } = item;
|
|
116
|
-
const filterKey = filterProvider || "label";
|
|
117
|
-
const result =
|
|
118
|
-
typeof filterProvider === "function"
|
|
119
|
-
? filterProvider?.(item)
|
|
120
|
-
: item[filterKey as string];
|
|
121
|
-
const filter = { [optionFilterProp]: result };
|
|
122
|
-
return (
|
|
123
|
-
<Option
|
|
124
|
-
{...oItem}
|
|
125
|
-
value={optionValue}
|
|
126
|
-
key={optionValue}
|
|
127
|
-
label={label}
|
|
85
|
+
<div className={`${boxClassName} ${addonBefore?addonBeforeBoxClassName:""} ${addonAfter?addonAfterBoxClassName:""}`} style={style}>
|
|
86
|
+
{addonBefore&& <div className={`${addonClassname} ${addonBeforeClassName}`}>
|
|
87
|
+
{addonBefore}
|
|
88
|
+
</div>}
|
|
89
|
+
<Select
|
|
128
90
|
mode={mode}
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
91
|
+
loading={loading}
|
|
92
|
+
value={val}
|
|
93
|
+
onSearch={onSearch}
|
|
94
|
+
onChange={change}
|
|
95
|
+
dropdownRender={(node) => {
|
|
96
|
+
return (
|
|
97
|
+
<DropdownComponent
|
|
98
|
+
loading={loading}
|
|
99
|
+
reload={run}
|
|
100
|
+
error={error}
|
|
101
|
+
options={data}
|
|
102
|
+
>
|
|
103
|
+
<AllSelect
|
|
104
|
+
allSelect={allSelect}
|
|
105
|
+
options={data}
|
|
106
|
+
mode={mode}
|
|
107
|
+
value={val}
|
|
108
|
+
onChange={change}
|
|
109
|
+
fieldNames={fieldNames}
|
|
110
|
+
>
|
|
111
|
+
{node}
|
|
112
|
+
</AllSelect>
|
|
113
|
+
</DropdownComponent> //全选
|
|
114
|
+
);
|
|
115
|
+
}}
|
|
116
|
+
optionLabelProp={optionLabelProp}
|
|
117
|
+
menuItemSelectedIcon={icon}
|
|
118
|
+
optionFilterProp={optionFilterProp}
|
|
119
|
+
filterOption={selfFilterOption}
|
|
120
|
+
showSearch={mathShowSearch}
|
|
121
|
+
labelInValue={true}
|
|
122
|
+
onPopupScroll={propsOnPopupScroll || onPopupScroll}
|
|
123
|
+
{...props}
|
|
124
|
+
>
|
|
125
|
+
{data?.map((item) => {
|
|
126
|
+
const { value: optionValue, label, ...oItem } = item;
|
|
127
|
+
const filterKey = filterProvider || "label";
|
|
128
|
+
const result =
|
|
129
|
+
typeof filterProvider === "function"
|
|
130
|
+
? filterProvider?.(item)
|
|
131
|
+
: item[filterKey as string];
|
|
132
|
+
const filter = { [optionFilterProp]: result };
|
|
133
|
+
return (
|
|
134
|
+
<Option
|
|
135
|
+
{...oItem}
|
|
136
|
+
value={optionValue}
|
|
137
|
+
key={optionValue}
|
|
138
|
+
label={label}
|
|
139
|
+
mode={mode}
|
|
140
|
+
{...filter}
|
|
141
|
+
>
|
|
142
|
+
{render ? render(item, val) : label}
|
|
143
|
+
</Option>
|
|
144
|
+
);
|
|
145
|
+
})}
|
|
146
|
+
</Select>
|
|
147
|
+
{addonAfter&&<div className={`${addonClassname} ${addonAfterClassName}`}>
|
|
148
|
+
{addonAfter}
|
|
149
|
+
</div>}
|
|
150
|
+
</div>
|
|
136
151
|
);
|
|
137
152
|
};
|
|
138
153
|
export default HFormConnect(Index);
|
|
@@ -2,3 +2,17 @@
|
|
|
2
2
|
@import "../Form/index.less";
|
|
3
3
|
@import "../Input/index.less";
|
|
4
4
|
@import "../Switch/index.less";
|
|
5
|
+
|
|
6
|
+
.@{ant-prefix}-hw-addon{
|
|
7
|
+
display: flex !important;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: 0 11px;
|
|
10
|
+
background-color: #fafafa;
|
|
11
|
+
border: 1px solid #d9d9d9;
|
|
12
|
+
}
|
|
13
|
+
.@{ant-prefix}-form-item-has-error {
|
|
14
|
+
.@{ant-prefix}-hw-addon {
|
|
15
|
+
color: #ff4d4f;
|
|
16
|
+
border-color: #ff4d4f !important;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -80,8 +80,25 @@ const formData = (options) => {
|
|
|
80
80
|
itemProps: {
|
|
81
81
|
addonBefore: "前面",
|
|
82
82
|
addonAfter: "后面",
|
|
83
|
+
disabled:true
|
|
83
84
|
},
|
|
84
85
|
},
|
|
86
|
+
{
|
|
87
|
+
name: "inputNumberGroup",
|
|
88
|
+
label: "inputNumber",
|
|
89
|
+
type:"inputNumberGroup",
|
|
90
|
+
rules: [
|
|
91
|
+
{
|
|
92
|
+
validator: () => {
|
|
93
|
+
return Promise.reject(new Error("错误"));
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
itemProps: {
|
|
98
|
+
addonBefore: "前面",
|
|
99
|
+
addonAfter: "后面",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
85
102
|
{
|
|
86
103
|
label:"时间",
|
|
87
104
|
name:"time",
|
|
@@ -90,6 +107,22 @@ const formData = (options) => {
|
|
|
90
107
|
picker: 'month',
|
|
91
108
|
placeholder: '请选择月份',
|
|
92
109
|
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label:"下拉",
|
|
113
|
+
name:"select",
|
|
114
|
+
type:'select',
|
|
115
|
+
rules: [
|
|
116
|
+
{
|
|
117
|
+
validator: () => {
|
|
118
|
+
return Promise.reject(new Error("错误"));
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
itemProps: {
|
|
123
|
+
addonBefore: "前面",
|
|
124
|
+
addonAfter: "后面",
|
|
125
|
+
},
|
|
93
126
|
}
|
|
94
127
|
];
|
|
95
128
|
};
|
|
@@ -136,39 +169,41 @@ export default () => {
|
|
|
136
169
|
}}>
|
|
137
170
|
点我
|
|
138
171
|
</div>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
172
|
+
<div style={{width:1000}}>
|
|
173
|
+
<HForm
|
|
174
|
+
configData={formData(options)}
|
|
175
|
+
dismissOnPressEnter={false}
|
|
176
|
+
labelWidth={88}
|
|
177
|
+
form={form}
|
|
178
|
+
infoRequest={{
|
|
179
|
+
request:async ()=>{
|
|
180
|
+
if (id===1){
|
|
181
|
+
return {
|
|
182
|
+
name:"你好"
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
152
186
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
refreshDeps:[id]
|
|
190
|
+
}}
|
|
191
|
+
labelAlign={"left"}
|
|
192
|
+
onFinish={(value) => {
|
|
193
|
+
console.log(value, "onFinish");
|
|
194
|
+
}}
|
|
195
|
+
onValuesChange={(val) => {
|
|
196
|
+
console.log(val, "onValuesChange");
|
|
197
|
+
}}
|
|
198
|
+
request={(params) => {
|
|
199
|
+
return new Promise<any>((resolve) => {
|
|
200
|
+
setTimeout(() => {
|
|
201
|
+
resolve(params);
|
|
202
|
+
}, 3000);
|
|
203
|
+
});
|
|
204
|
+
}}
|
|
205
|
+
/>
|
|
206
|
+
</div>
|
|
172
207
|
</HFormConfigProvider>
|
|
173
208
|
<div
|
|
174
209
|
onClick={async () => {
|