docs: reduce demo cascader/checkbox/form/inputno (#25484)

This commit is contained in:
xrkffgg 2020-07-07 22:06:00 +08:00 committed by GitHub
parent 6f8e21b75f
commit 22d4dbbe99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 803 additions and 809 deletions

View File

@ -469,7 +469,7 @@ exports[`renders ./components/cascader/demo/search.md correctly 1`] = `
`;
exports[`renders ./components/cascader/demo/size.md correctly 1`] = `
<div>
Array [
<span
class="ant-cascader-picker ant-cascader-picker-large"
tabindex="0"
@ -506,9 +506,9 @@ exports[`renders ./components/cascader/demo/size.md correctly 1`] = `
/>
</svg>
</span>
</span>
<br />
<br />
</span>,
<br />,
<br />,
<span
class="ant-cascader-picker"
tabindex="0"
@ -545,9 +545,9 @@ exports[`renders ./components/cascader/demo/size.md correctly 1`] = `
/>
</svg>
</span>
</span>
<br />
<br />
</span>,
<br />,
<br />,
<span
class="ant-cascader-picker ant-cascader-picker-small"
tabindex="0"
@ -584,10 +584,10 @@ exports[`renders ./components/cascader/demo/size.md correctly 1`] = `
/>
</svg>
</span>
</span>
<br />
<br />
</div>
</span>,
<br />,
<br />,
]
`;
exports[`renders ./components/cascader/demo/suffix.md correctly 1`] = `

View File

@ -56,7 +56,7 @@ function onChange(value) {
}
ReactDOM.render(
<div>
<>
<Cascader size="large" options={options} onChange={onChange} />
<br />
<br />
@ -66,7 +66,7 @@ ReactDOM.render(
<Cascader size="small" options={options} onChange={onChange} />
<br />
<br />
</div>,
</>,
mountNode,
);
```

View File

@ -22,7 +22,7 @@ exports[`renders ./components/checkbox/demo/basic.md correctly 1`] = `
`;
exports[`renders ./components/checkbox/demo/check-all.md correctly 1`] = `
<div>
Array [
<div
class="site-checkbox-all-wrapper"
>
@ -44,8 +44,8 @@ exports[`renders ./components/checkbox/demo/check-all.md correctly 1`] = `
Check all
</span>
</label>
</div>
<br />
</div>,
<br />,
<div
class="ant-checkbox-group"
>
@ -108,12 +108,12 @@ exports[`renders ./components/checkbox/demo/check-all.md correctly 1`] = `
Orange
</span>
</label>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/checkbox/demo/controller.md correctly 1`] = `
<div>
Array [
<p
style="margin-bottom:20px"
>
@ -136,7 +136,7 @@ exports[`renders ./components/checkbox/demo/controller.md correctly 1`] = `
Checked-Enabled
</span>
</label>
</p>
</p>,
<p>
<button
class="ant-btn ant-btn-primary ant-btn-sm"
@ -155,12 +155,12 @@ exports[`renders ./components/checkbox/demo/controller.md correctly 1`] = `
Disable
</span>
</button>
</p>
</div>
</p>,
]
`;
exports[`renders ./components/checkbox/demo/disabled.md correctly 1`] = `
<div>
Array [
<label
class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"
>
@ -176,8 +176,8 @@ exports[`renders ./components/checkbox/demo/disabled.md correctly 1`] = `
class="ant-checkbox-inner"
/>
</span>
</label>
<br />
</label>,
<br />,
<label
class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"
>
@ -194,12 +194,12 @@ exports[`renders ./components/checkbox/demo/disabled.md correctly 1`] = `
class="ant-checkbox-inner"
/>
</span>
</label>
</div>
</label>,
]
`;
exports[`renders ./components/checkbox/demo/group.md correctly 1`] = `
<div>
Array [
<div
class="ant-checkbox-group"
>
@ -261,9 +261,9 @@ exports[`renders ./components/checkbox/demo/group.md correctly 1`] = `
Orange
</span>
</label>
</div>
<br />
<br />
</div>,
<br />,
<br />,
<div
class="ant-checkbox-group"
>
@ -325,9 +325,9 @@ exports[`renders ./components/checkbox/demo/group.md correctly 1`] = `
Orange
</span>
</label>
</div>
<br />
<br />
</div>,
<br />,
<br />,
<div
class="ant-checkbox-group"
>
@ -392,8 +392,8 @@ exports[`renders ./components/checkbox/demo/group.md correctly 1`] = `
Orange
</span>
</label>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/checkbox/demo/layout.md correctly 1`] = `

View File

@ -46,7 +46,7 @@ class App extends React.Component {
render() {
return (
<div>
<>
<div className="site-checkbox-all-wrapper">
<Checkbox
indeterminate={this.state.indeterminate}
@ -62,7 +62,7 @@ class App extends React.Component {
value={this.state.checkedList}
onChange={this.onChange}
/>
</div>
</>
);
}
}

View File

@ -42,7 +42,7 @@ class App extends React.Component {
this.state.disabled ? 'Disabled' : 'Enabled'
}`;
return (
<div>
<>
<p style={{ marginBottom: '20px' }}>
<Checkbox
checked={this.state.checked}
@ -65,7 +65,7 @@ class App extends React.Component {
{!this.state.disabled ? 'Disable' : 'Enable'}
</Button>
</p>
</div>
</>
);
}
}

View File

@ -17,11 +17,11 @@ Disabled checkbox.
import { Checkbox } from 'antd';
ReactDOM.render(
<div>
<>
<Checkbox defaultChecked={false} disabled />
<br />
<Checkbox defaultChecked disabled />
</div>,
</>,
mountNode,
);
```

View File

@ -33,7 +33,7 @@ const optionsWithDisabled = [
];
ReactDOM.render(
<div>
<>
<Checkbox.Group options={plainOptions} defaultValue={['Apple']} onChange={onChange} />
<br />
<br />
@ -46,7 +46,7 @@ ReactDOM.render(
defaultValue={['Apple']}
onChange={onChange}
/>
</div>,
</>,
mountNode,
);
```

File diff suppressed because it is too large Load Diff

View File

@ -88,7 +88,7 @@ const Demo = () => {
};
return (
<div>
<>
<Form.Provider
onFormFinish={(name, { values, forms }) => {
if (name === 'userForm') {
@ -137,7 +137,7 @@ const Demo = () => {
<ModalForm visible={visible} onCancel={hideUserModal} />
</Form.Provider>
</div>
</>
);
};

View File

@ -59,7 +59,7 @@ const Demo = () => {
const [fields, setFields] = useState([{ name: ['username'], value: 'Ant Design' }]);
return (
<div>
<>
<CustomizedForm
fields={fields}
onChange={newFields => {
@ -67,7 +67,7 @@ const Demo = () => {
}}
/>
<pre className="language-bash">{JSON.stringify(fields, null, 2)}</pre>
</div>
</>
);
};

View File

@ -41,7 +41,7 @@ const FormLayoutDemo = () => {
: null;
return (
<div>
<>
<Form
{...formItemLayout}
layout={formLayout}
@ -66,7 +66,7 @@ const FormLayoutDemo = () => {
<Button type="primary">Submit</Button>
</Form.Item>
</Form>
</div>
</>
);
};

View File

@ -33,7 +33,7 @@ const FormSizeDemo = () => {
setComponentSize(size);
};
return (
<div>
<>
<Form
labelCol={{ span: 4 }}
wrapperCol={{ span: 14 }}
@ -93,7 +93,7 @@ const FormSizeDemo = () => {
<Button>Button</Button>
</Form.Item>
</Form>
</div>
</>
);
};
ReactDOM.render(<FormSizeDemo />, mountNode);

View File

@ -162,7 +162,7 @@ exports[`renders ./components/input-number/demo/digit.md correctly 1`] = `
`;
exports[`renders ./components/input-number/demo/disabled.md correctly 1`] = `
<div>
Array [
<div
class="ant-input-number ant-input-number-disabled"
>
@ -243,7 +243,7 @@ exports[`renders ./components/input-number/demo/disabled.md correctly 1`] = `
value="3"
/>
</div>
</div>
</div>,
<div
style="margin-top:20px"
>
@ -255,12 +255,12 @@ exports[`renders ./components/input-number/demo/disabled.md correctly 1`] = `
Toggle disabled
</span>
</button>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/input-number/demo/formatter.md correctly 1`] = `
<div>
Array [
<div
class="ant-input-number"
>
@ -338,7 +338,7 @@ exports[`renders ./components/input-number/demo/formatter.md correctly 1`] = `
value="$ 1,000"
/>
</div>
</div>
</div>,
<div
class="ant-input-number"
>
@ -417,8 +417,8 @@ exports[`renders ./components/input-number/demo/formatter.md correctly 1`] = `
value="100%"
/>
</div>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/input-number/demo/size.md correctly 1`] = `

View File

@ -29,14 +29,14 @@ class App extends React.Component {
render() {
return (
<div>
<>
<InputNumber min={1} max={10} disabled={this.state.disabled} defaultValue={3} />
<div style={{ marginTop: 20 }}>
<Button onClick={this.toggle} type="primary">
Toggle disabled
</Button>
</div>
</div>
</>
);
}
}

View File

@ -21,7 +21,7 @@ function onChange(value) {
}
ReactDOM.render(
<div>
<>
<InputNumber
defaultValue={1000}
formatter={value => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
@ -36,7 +36,7 @@ ReactDOM.render(
parser={value => value.replace('%', '')}
onChange={onChange}
/>
</div>,
</>,
mountNode,
);
```