@hw-component/form 1.9.41 → 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/Form/HFormConnect.js +9 -10
- package/es/Form/config.d.ts +2 -5
- package/es/Form/config.js +3 -1
- package/es/Input/InputNumberGroup.js +1 -1
- package/es/Select/TreeSelect.d.ts +2 -2
- package/es/Select/index.js +65 -48
- package/es/Select/modal.d.ts +2 -0
- package/es/Text/index.d.ts +3 -0
- package/es/Text/index.js +13 -0
- package/es/index.css +59 -24
- package/lib/Form/HFormConnect.js +9 -10
- package/lib/Form/config.d.ts +2 -5
- package/lib/Form/config.js +3 -1
- package/lib/Input/InputNumberGroup.js +1 -1
- package/lib/Select/TreeSelect.d.ts +2 -2
- package/lib/Select/index.js +64 -47
- package/lib/Select/modal.d.ts +2 -0
- package/lib/Text/index.d.ts +3 -0
- package/lib/Text/index.js +16 -0
- package/lib/index.css +59 -24
- package/package.json +1 -1
- package/src/components/CheckboxGroup/index.tsx +3 -3
- package/src/components/Form/HFormConnect.tsx +9 -10
- package/src/components/Form/config.ts +2 -0
- package/src/components/Input/InputNumberGroup.tsx +5 -5
- package/src/components/Input/SelectInput.tsx +2 -2
- package/src/components/Input/TrimInput.tsx +3 -3
- package/src/components/Input/index.less +10 -20
- package/src/components/Select/TreeSelect.tsx +2 -2
- 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/Switch/index.tsx +3 -3
- package/src/components/TDPicker/RangePicker.tsx +2 -2
- package/src/components/Text/index.tsx +6 -0
- package/src/components/TextArea/TrimTextArea.tsx +3 -3
- package/src/components/Upload/index.tsx +4 -4
- package/src/components/styles/index.less +14 -0
- package/src/pages/Form/index.tsx +67 -32
- package/src/pages/Select/index.tsx +1 -0
|
@@ -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 () => {
|