@hw-component/form 1.9.26 → 1.9.27

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/index.css CHANGED
@@ -125,6 +125,17 @@
125
125
  .ant-hw-form-form-item .ant-form-item-label {
126
126
  overflow: visible;
127
127
  }
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
+ }
128
139
  .ant-hw-input-group {
129
140
  display: -webkit-box !important;
130
141
  display: -webkit-flex !important;
package/lib/index.css CHANGED
@@ -125,6 +125,17 @@
125
125
  .ant-hw-form-form-item .ant-form-item-label {
126
126
  overflow: visible;
127
127
  }
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
+ }
128
139
  .ant-hw-input-group {
129
140
  display: -webkit-box !important;
130
141
  display: -webkit-flex !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.9.26",
3
+ "version": "1.9.27",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,18 @@
1
1
  @import "../styles/local.less";
2
2
  @all-input-group: ~"@{ant-prefix}-hw-input-group";
3
-
3
+ .@{ant-prefix}-form-item-has-error {
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
+ }
4
16
  .@{all-input-group} {
5
17
  display: flex !important;
6
18
  width: 100%;
@@ -70,18 +70,34 @@ const formData = (options) => {
70
70
  {
71
71
  name: "name",
72
72
  label: "输入框",
73
+ rules:[{validator:()=>{
74
+ return Promise.reject(new Error("错误"))
75
+ }}],
73
76
  itemProps: {
74
-
77
+ addonBefore:"前面",
78
+ addonAfter:"后面"
75
79
  }
76
80
  },
81
+ {
82
+ name: "inputNumberGroup",
83
+ label: "输入框",
84
+ rules:[{validator:()=>{
85
+ return Promise.reject(new Error("错误"))
86
+ }}],
87
+ type: "inputNumberGroup",
88
+ itemProps: {
89
+ addonBefore:"前面",
90
+ addonAfter:"后面"
91
+ }
92
+ },
77
93
  {
78
94
  name: "url",
79
95
  type: "urlUpload",
80
96
  label: "文本",
81
- itemSpan:{
82
- span:24
83
- },
84
97
  hideLabel:true,
98
+ rules:[{validator:()=>{
99
+ return Promise.reject(new Error("错误"))
100
+ }}],
85
101
  itemProps: {
86
102
  initValueProvider:(props,val)=>{
87
103
  console.log(props,val,"fff")
@@ -162,9 +178,6 @@ export default () => {
162
178
  configData={formData(options)}
163
179
  dismissOnPressEnter={false}
164
180
  labelWidth={88}
165
- itemSpan={{
166
- span:12
167
- }}
168
181
  form={form}
169
182
  labelAlign={"left"}
170
183
  onFinish={(value) => {
@@ -195,7 +208,7 @@ export default () => {
195
208
  </div>
196
209
  <div
197
210
  onClick={() => {
198
- console.log(form.formatValues());
211
+ form.submit()
199
212
  }}
200
213
  >
201
214
  提交