Skip to content

Commit e156483

Browse files
bpas247kyletsang
authored andcommitted
feat(v5): drop form row support
Drops support for the Form Row component, and removes any doc references associated with it.
1 parent 20eda6c commit e156483

File tree

14 files changed

+39
-71
lines changed

14 files changed

+39
-71
lines changed

src/Form.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ import FormSelect from './FormSelect';
1111
import FormText from './FormText';
1212
import Switch from './Switch';
1313
import { useBootstrapPrefix } from './ThemeProvider';
14-
import createWithBsPrefix from './createWithBsPrefix';
1514
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
1615

17-
const FormRow = createWithBsPrefix('form-row');
18-
1916
export interface FormProps
2017
extends React.HTMLAttributes<HTMLElement>,
2118
BsPrefixProps {
@@ -24,7 +21,6 @@ export interface FormProps
2421
}
2522

2623
type Form = BsPrefixRefForwardingComponent<'form', FormProps> & {
27-
Row: typeof FormRow;
2824
Group: typeof FormGroup;
2925
Control: typeof FormControl;
3026
Check: typeof FormCheck;
@@ -102,7 +98,6 @@ FormImpl.displayName = 'Form';
10298
FormImpl.propTypes = propTypes;
10399
FormImpl.defaultProps = defaultProps;
104100

105-
FormImpl.Row = FormRow;
106101
FormImpl.Group = FormGroup;
107102
FormImpl.Control = FormControl;
108103
FormImpl.Check = FormCheck;

tests/simple-types-test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ const MegaComponent = () => (
365365
validated
366366
bsPrefix="form"
367367
>
368-
<Form.Row as="div" bsPrefix="formrow" style={style} />
369368
<Form.Group
370369
ref={React.createRef<HTMLDivElement>()}
371370
as="div"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<Form.Group>
2-
<Form.Row>
2+
<Row>
33
<Form.Label column="lg" lg={2}>
44
Large Text
55
</Form.Label>
66
<Col>
77
<Form.Control size="lg" type="text" placeholder="Large text" />
88
</Col>
9-
</Form.Row>
9+
</Row>
1010
<br />
11-
<Form.Row>
11+
<Row>
1212
<Form.Label column lg={2}>
1313
Normal Text
1414
</Form.Label>
1515
<Col>
1616
<Form.Control type="text" placeholder="Normal text" />
1717
</Col>
18-
</Form.Row>
18+
</Row>
1919
<br />
20-
<Form.Row>
20+
<Row>
2121
<Form.Label column="sm" lg={2}>
2222
Small Text
2323
</Form.Label>
2424
<Col>
2525
<Form.Control size="sm" type="text" placeholder="Small text" />
2626
</Col>
27-
</Form.Row>
27+
</Row>
2828
</Form.Group>;

www/src/examples/Form/FormRow.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

www/src/examples/Form/GridAutoSizing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Form>
2-
<Form.Row className="align-items-center">
2+
<Row className="align-items-center">
33
<Col xs="auto">
44
<Form.Label htmlFor="inlineFormInput" srOnly>
55
Name
@@ -34,5 +34,5 @@
3434
Submit
3535
</Button>
3636
</Col>
37-
</Form.Row>
37+
</Row>
3838
</Form>;

www/src/examples/Form/GridAutoSizingColMix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Form>
2-
<Form.Row className="align-items-center">
2+
<Row className="align-items-center">
33
<Col sm={3} className="my-1">
44
<Form.Label htmlFor="inlineFormInputName" srOnly>
55
Name
@@ -23,5 +23,5 @@
2323
<Col xs="auto" className="my-1">
2424
<Button type="submit">Submit</Button>
2525
</Col>
26-
</Form.Row>
26+
</Row>
2727
</Form>;

www/src/examples/Form/GridAutoSizingCustom.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Form>
2-
<Form.Row className="align-items-center">
2+
<Row className="align-items-center">
33
<Col xs="auto" className="my-1">
44
<Form.Label className="mr-sm-2" htmlFor="inlineFormCustomSelect" srOnly>
55
Preference
@@ -22,5 +22,5 @@
2222
<Col xs="auto" className="my-1">
2323
<Button type="submit">Submit</Button>
2424
</Col>
25-
</Form.Row>
25+
</Row>
2626
</Form>;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Form>
2-
<Form.Row>
2+
<Row>
33
<Col xs={7}>
44
<Form.Control placeholder="City" />
55
</Col>
@@ -9,5 +9,5 @@
99
<Col>
1010
<Form.Control placeholder="Zip" />
1111
</Col>
12-
</Form.Row>
12+
</Row>
1313
</Form>;

www/src/examples/Form/GridComplex.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Form>
2-
<Form.Row>
2+
<Row>
33
<Form.Group as={Col} controlId="formGridEmail">
44
<Form.Label>Email</Form.Label>
55
<Form.Control type="email" placeholder="Enter email" />
@@ -9,7 +9,7 @@
99
<Form.Label>Password</Form.Label>
1010
<Form.Control type="password" placeholder="Password" />
1111
</Form.Group>
12-
</Form.Row>
12+
</Row>
1313

1414
<Form.Group controlId="formGridAddress1">
1515
<Form.Label>Address</Form.Label>
@@ -21,7 +21,7 @@
2121
<Form.Control placeholder="Apartment, studio, or floor" />
2222
</Form.Group>
2323

24-
<Form.Row>
24+
<Row>
2525
<Form.Group as={Col} controlId="formGridCity">
2626
<Form.Label>City</Form.Label>
2727
<Form.Control />
@@ -39,7 +39,7 @@
3939
<Form.Label>Zip</Form.Label>
4040
<Form.Control />
4141
</Form.Group>
42-
</Form.Row>
42+
</Row>
4343

4444
<Form.Group id="formGridCheckbox">
4545
<Form.Check type="checkbox" label="Check me out" />

www/src/examples/Form/ValidationFormik.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function FormExample() {
3030
errors,
3131
}) => (
3232
<Form noValidate onSubmit={handleSubmit}>
33-
<Form.Row>
33+
<Row>
3434
<Form.Group as={Col} md="4" controlId="validationFormik01">
3535
<Form.Label>First name</Form.Label>
3636
<Form.Control
@@ -74,8 +74,8 @@ function FormExample() {
7474
</Form.Control.Feedback>
7575
</InputGroup>
7676
</Form.Group>
77-
</Form.Row>
78-
<Form.Row>
77+
</Row>
78+
<Row>
7979
<Form.Group as={Col} md="6" controlId="validationFormik03">
8080
<Form.Label>City</Form.Label>
8181
<Form.Control
@@ -120,7 +120,7 @@ function FormExample() {
120120
{errors.zip}
121121
</Form.Control.Feedback>
122122
</Form.Group>
123-
</Form.Row>
123+
</Row>
124124
<Form.Group>
125125
<Form.Check
126126
required

0 commit comments

Comments
 (0)