@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.
@@ -128,6 +128,7 @@ var Index = function Index(props) {
128
128
  rules: cuRules,
129
129
  noStyle: noStyle,
130
130
  hidden: disHide,
131
+ dependencies: dependencies,
131
132
  children: noStyle ? defaultRender(form) : jsx(Content, {
132
133
  helper: helper,
133
134
  children: defaultRender(form)
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.92",
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",
@@ -120,6 +120,7 @@ const Index: React.FC<HFormItemProps> = (props) => {
120
120
  rules={cuRules}
121
121
  noStyle={noStyle}
122
122
  hidden={disHide}
123
+ dependencies={dependencies}
123
124
  >
124
125
  {noStyle ? (
125
126
  defaultRender(form)
@@ -64,6 +64,9 @@
64
64
  border-color: #ff4d4f !important;
65
65
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
66
66
  }
67
+ .@{all-input-group}-addon-middle {
68
+ color: #ff4d4f;
69
+ }
67
70
  }
68
71
  .@{all-input-group}-number-body {
69
72
  background-color: #fff;
@@ -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} initialValues={{ ttim: "132123" }}>
153
- <Form.Item name="ttim" rules={[{ required: true }]}>
154
- <Input />
155
- </Form.Item>
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
- valueMap: {
195
- start: "start",
196
- end: "end",
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: [{ validator:(rule, value, callback)=>{
208
- console.log(rule, value, callback);
209
- } }],
210
- },
211
- {
212
- name: ["order", "name"],
213
- label: "time",
214
- type: "select",
215
- itemProps: {
216
- options: [{ value: "label", key: 1 }],
217
- mode: "multiple",
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}