Skip to content

Commit c83f568

Browse files
authoredMay 26, 2022
fix(SearchTree): 组件验证样式问题 (#846)
1 parent 704cd7a commit c83f568

File tree

6 files changed

+26
-10
lines changed

6 files changed

+26
-10
lines changed
 

‎packages/react-form/src/style/form-item.less

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
@w-form:~ "w-form";
1+
@w-form: ~'w-form';
22

33
.@{w-form} {
44
&-item {
55
margin-bottom: 10px;
66
}
7+
78
&-item-error {
89
.@{w-form}-help,
910
.@{w-form}-label {
1011
color: #dc3545;
1112
}
13+
1214
.w-input-inner,
1315
.w-select,
1416
.w-select-default,
@@ -18,24 +20,33 @@
1820
.w-input-inner:focus.w-input-inner:hover,
1921
.w-textarea,
2022
.w-textarea:hover,
23+
.w-search-tree-inner,
2124
.w-textarea:focus.w-textarea:hover {
2225
box-shadow: 0 0 0 1px #dc3545, 0 0 0 3px rgba(220, 53, 69, 0.17), inset 0 1px 1px rgba(16, 22, 26, 0.2);
2326
}
27+
28+
.w-search-tree-inner .w-input .w-input-inner {
29+
box-shadow: none !important;
30+
}
2431
}
32+
2533
&-label {
2634
line-height: 32px;
2735
min-height: 32px;
2836
font-weight: 600;
2937
font-size: 14px;
3038
padding-right: 5px;
39+
3140
label {
3241
display: inline-block;
3342
}
3443
}
44+
3545
&-row {
3646
align-items: center;
3747
display: flex;
3848
}
49+
3950
&-help {
4051
color: #c2c2c2;
4152
font-size: 12px;

‎packages/react-search-tree/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ ReactDOM.render(<Demo />, _mount_);
191191
```jsx
192192
import React, { useState, useEffect, useRef } from 'react';
193193
import ReactDOM from 'react-dom';
194-
import { Form, Button, SearchTree, Card, Row, Col } from 'uiw';;
195-
196-
194+
import { Notify, Form, Button, SearchTree, Card, Row, Col,Select } from 'uiw';
197195
const Demo = () => {
198196
const form=useRef()
199197

@@ -258,7 +256,7 @@ const form=useRef()
258256
}}
259257
onSubmit={({initial, current}) => {
260258
const errorObj = {};
261-
if (!current.searchTree) {
259+
if (!current.searchTree || current.searchTree.length === 0) {
262260
errorObj.searchTree = '默认需要选择内容,选择入内容';
263261
}
264262
if(Object.keys(errorObj).length > 0) {

‎packages/react-steps/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function Demo() {
209209
<Steps.Step title="步骤一" description="这里是步骤一的说明,可以很长很长哦。" />
210210
<Steps.Step title="步骤二" description="这里是步骤一的说明,可以很长很长哦。" />
211211
<Steps.Step title="步骤三" description="这里是步骤一的说明,可以很长很长哦。" />
212-
<Steps.Step title="步骤四" description="这里是步骤一的说明,可以很长很长哦。" />
212+
<Steps.Step icon={<Icon type="user"/>} title="步骤四" description="这里是步骤一的说明,可以很长很长哦。" />
213213
</Steps>
214214
</Col>
215215
</Row>

‎packages/react-steps/src/Step.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function Step(props: StepProps) {
5050
}
5151
}
5252
let iconNode = null;
53-
if (progressDot) {
53+
if (progressDot && !icon) {
5454
iconNode = <span className={`${prefixCls}-dot`} />;
5555
} else if (icon && typeof icon !== 'string') {
5656
iconNode = <span className={`${prefixCls}-icon`}>{icon}</span>;
@@ -82,7 +82,7 @@ export default function Step(props: StepProps) {
8282
{iconNode}
8383
</div>
8484
</div>
85-
<div className={`${prefixCls}-item-main`}>
85+
<div className={[`${prefixCls}-item-main`, !!icon && 'is-icon-main'].filter(Boolean).join(' ').trim()}>
8686
<div className={`${prefixCls}-item-title`}>{title}</div>
8787
{description && <div className={`${prefixCls}-item-description`}>{description}</div>}
8888
</div>

‎packages/react-steps/src/style/index.less

+7
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@
223223
.@{w-steps}-item-head {
224224
background: transparent;
225225
margin-top: -4px;
226+
.is-icon {
227+
margin-left: -10px !important;
228+
background-color: transparent;
229+
}
226230
}
227231
&.@{w-steps}-vertical {
228232
.@{w-steps}-item {
@@ -244,6 +248,9 @@
244248
padding-bottom: 24px;
245249
margin-top: -21px;
246250
}
251+
.is-icon-main {
252+
margin-top: -35px;
253+
}
247254
.@{w-steps}-next-error {
248255
.w-steps-item-tail i:after {
249256
background-color: #f04134;

‎website/src/routes/components/search-tree/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useState, useRef } from 'react';
2-
import { Form, Button, TreeChecked, SearchTree, Row, Col, Card, Icon } from 'uiw';
2+
import { Form, Button, TreeChecked, SearchTree, Row, Col, Card, Icon, Notify } from 'uiw';
33
import Markdown from '../../../components/Markdown';
44

55
export default () => (
66
<Markdown
77
path="https://github.com/uiwjs/uiw/tree/master/packages/react-search-tree/README.md"
8-
dependencies={{ Form, Button, TreeChecked, SearchTree, Row, Col, Card, Icon, useRef, useState, React }}
8+
dependencies={{ Form, Button, TreeChecked, SearchTree, Row, Col, Card, Icon, Notify, useRef, useState, React }}
99
renderPage={async () => {
1010
const md = await import('uiw/node_modules/@uiw/react-search-tree/README.md');
1111
return md.default || md;

0 commit comments

Comments
 (0)
Please sign in to comment.