@hw-component/form 1.10.92 → 1.10.94
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/FormItem/BasicItem.js +1 -0
- package/es/index.css +3 -0
- package/lib/Form/FormItem/BasicItem.js +1 -0
- package/lib/index.css +3 -0
- package/package.json +2 -1
- package/src/components/Form/FormItem/BasicItem.tsx +1 -0
- package/src/components/Input/index.less +3 -0
- package/src/pages/Form/index.tsx +54 -39
package/es/index.css
CHANGED
|
@@ -279,6 +279,9 @@
|
|
|
279
279
|
border-color: #ff4d4f !important;
|
|
280
280
|
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
281
281
|
}
|
|
282
|
+
.ant-form-item-has-error .ant-hw-input-group-addon-middle {
|
|
283
|
+
color: #ff4d4f;
|
|
284
|
+
}
|
|
282
285
|
.ant-hw-input-group-number-body {
|
|
283
286
|
background-color: #fff;
|
|
284
287
|
}
|
|
@@ -131,6 +131,7 @@ var Index = function Index(props) {
|
|
|
131
131
|
rules: cuRules,
|
|
132
132
|
noStyle: noStyle,
|
|
133
133
|
hidden: disHide,
|
|
134
|
+
dependencies: dependencies,
|
|
134
135
|
children: noStyle ? defaultRender(form) : jsxRuntime.jsx(Content, {
|
|
135
136
|
helper: helper,
|
|
136
137
|
children: defaultRender(form)
|
package/lib/index.css
CHANGED
|
@@ -279,6 +279,9 @@
|
|
|
279
279
|
border-color: #ff4d4f !important;
|
|
280
280
|
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
281
281
|
}
|
|
282
|
+
.ant-form-item-has-error .ant-hw-input-group-addon-middle {
|
|
283
|
+
color: #ff4d4f;
|
|
284
|
+
}
|
|
282
285
|
.ant-hw-input-group-number-body {
|
|
283
286
|
background-color: #fff;
|
|
284
287
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hw-component/form",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.94",
|
|
4
4
|
"description": "基于antd二次开发",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"react-color": "2.19.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"ahooks": "2.10.9",
|
|
43
44
|
"@ant-design/icons": "4.6.2",
|
|
44
45
|
"@babel/core": "^7.21.8",
|
|
45
46
|
"@babel/plugin-transform-runtime": "^7.23.2",
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from "../../components";
|
|
10
10
|
import { useEffect, useState } from "react";
|
|
11
11
|
import { Button, Col, Form, Input, Row, Space } from "antd";
|
|
12
|
+
|
|
12
13
|
const Test3 = ({ value = {}, onChange }) => {
|
|
13
14
|
const { fs, end } = value;
|
|
14
15
|
return (
|
|
@@ -149,10 +150,39 @@ export default () => {
|
|
|
149
150
|
const [aForm] = Form.useForm();
|
|
150
151
|
return (
|
|
151
152
|
<div style={{ overflow: "auto", height: "90vh" }}>
|
|
152
|
-
<Form form={aForm}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
<Form form={aForm}>
|
|
154
|
+
<Form.Item
|
|
155
|
+
name="password"
|
|
156
|
+
label="Password"
|
|
157
|
+
rules={[
|
|
158
|
+
{
|
|
159
|
+
required: true,
|
|
160
|
+
message: 'Please input your password!',
|
|
161
|
+
},
|
|
162
|
+
]}
|
|
163
|
+
hasFeedback
|
|
164
|
+
>
|
|
165
|
+
<Input />
|
|
166
|
+
</Form.Item>
|
|
167
|
+
<Form.Item
|
|
168
|
+
name="confirm"
|
|
169
|
+
label="Confirm Password"
|
|
170
|
+
dependencies={['password']}
|
|
171
|
+
rules={[
|
|
172
|
+
{
|
|
173
|
+
required: true,
|
|
174
|
+
message: 'Please confirm your password!',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
validator(_, value) {
|
|
178
|
+
console.log("ffff")
|
|
179
|
+
return Promise.reject(new Error('The two passwords that you entered do not match!'));
|
|
180
|
+
},
|
|
181
|
+
}
|
|
182
|
+
]}
|
|
183
|
+
>
|
|
184
|
+
<Input/>
|
|
185
|
+
</Form.Item>
|
|
156
186
|
</Form>
|
|
157
187
|
<HFormConfigProvider
|
|
158
188
|
valueSwitchMap={{ open: 1, close: 2 }}
|
|
@@ -188,14 +218,14 @@ export default () => {
|
|
|
188
218
|
{
|
|
189
219
|
name: "num",
|
|
190
220
|
label: "你好啊",
|
|
191
|
-
type: "rangePicker",
|
|
192
|
-
hover: ["123123213", "22222"],
|
|
193
|
-
itemProps: {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
},
|
|
221
|
+
// type: "rangePicker",
|
|
222
|
+
// hover: ["123123213", "22222"],
|
|
223
|
+
// itemProps: {
|
|
224
|
+
// valueMap: {
|
|
225
|
+
// start: "start",
|
|
226
|
+
// end: "end",
|
|
227
|
+
// },
|
|
228
|
+
// },
|
|
199
229
|
},
|
|
200
230
|
{
|
|
201
231
|
name: "num1",
|
|
@@ -204,33 +234,18 @@ export default () => {
|
|
|
204
234
|
// hidden: () => {
|
|
205
235
|
// return !form.getFieldValue("num");
|
|
206
236
|
// },
|
|
207
|
-
rules: [
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
name: "tt",
|
|
222
|
-
label: "time1",
|
|
223
|
-
type: "rangePicker",
|
|
224
|
-
render: () => {
|
|
225
|
-
return <TestItem />;
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
name: "selectInput",
|
|
230
|
-
label: "selectInput",
|
|
231
|
-
render: () => {
|
|
232
|
-
return <TestItem1 />;
|
|
233
|
-
},
|
|
237
|
+
rules: [
|
|
238
|
+
{
|
|
239
|
+
required: true,
|
|
240
|
+
message: 'Please confirm your password!',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
validator(_, value) {
|
|
244
|
+
console.log("ffff")
|
|
245
|
+
return Promise.reject(new Error('The two passwords that you entered do not match!'));
|
|
246
|
+
},
|
|
247
|
+
}
|
|
248
|
+
]
|
|
234
249
|
},
|
|
235
250
|
]}
|
|
236
251
|
dismissOnPressEnter={false}
|