Skip to content

Implemented classNames in all themes where it was missing #3032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/bootstrap-4/src/FieldTemplate/WrapIfAdditional.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type WrapIfAdditionalProps = { children: React.ReactElement } & Pick<
>;

const WrapIfAdditional = ({
classNames,
children,
disabled,
id,
Expand All @@ -37,15 +38,15 @@ const WrapIfAdditional = ({
const additional = ADDITIONAL_PROPERTY_FLAG in schema;

if (!additional) {
return children;
return <div className={classNames}>{children}</div>;
}

const handleBlur = ({ target }: React.FocusEvent<HTMLInputElement>) =>
onKeyChange(target.value);
const keyId = `${id}-key`;

return (
<Row key={keyId}>
<Row className={classNames} key={keyId}>
<Col xs={5}>
<Form.Group>
<Form.Label htmlFor={keyId}>{keyLabel}</Form.Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,154 +7,158 @@ exports[`AdditionalProperties tests show add button and fields if additionalProp
onSubmit={[Function]}
>
<div
className="form-group"
className="form-group field field-undefined"
>

<div
className="p-0 container-fluid"
className="form-group"
>

<div
className="row"
style={
Object {
"marginBottom": "10px",
}
}
className="p-0 container-fluid"
>
<div
className="col-12"
className="row"
style={
Object {
"marginBottom": "10px",
}
}
>

<div
className="row"
className="col-12"
>

<div
className="col-5"
className="form-group field field-string row"
>
<div
className="form-group"
>
<label
className="form-label"
htmlFor="root-key"
>
additionalProperty Key
</label>
<input
className="form-control"
defaultValue="additionalProperty"
disabled={false}
id="root-key"
name="root-key"
onBlur={[Function]}
required={false}
type="text"
/>
</div>
</div>
<div
className="col-5"
>
<div
className="form-group"
className="col-5"
>
<div
className="mb-0 form-group"
className="form-group"
>
<label
className="form-label"
htmlFor="root"
htmlFor="root-key"
>
additionalProperty
additionalProperty Key
</label>
<input
autoFocus={false}
className="form-control"
defaultValue="additionalProperty"
disabled={false}
id="root"
id="root-key"
name="root-key"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
placeholder=""
readOnly={false}
required={false}
type="text"
value="should appear"
/>
</div>

</div>
</div>
<div
className="py-4 col-2"
>
<button
className="btn btn-danger btn-block btn-sm"
disabled={false}
onClick={[Function]}
title="Remove"
type="button"
<div
className="col-5"
>
<svg
fill="currentColor"
height="1em"
stroke="currentColor"
strokeWidth="0"
style={
Object {
"color": undefined,
}
}
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
<div
className="form-group"
>
<path
d="M368.5 240h-225c-8.8 0-16 7.2-16 16 0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7h225c8.8 0 16-7.2 16-16s-7.2-16-16-16z"
/>
</svg>
</button>
<div
className="mb-0 form-group"
>
<label
className="form-label"
htmlFor="root"
>
additionalProperty
</label>
<input
autoFocus={false}
className="form-control"
disabled={false}
id="root"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
placeholder=""
readOnly={false}
required={false}
type="text"
value="should appear"
/>
</div>

</div>
</div>
<div
className="py-4 col-2"
>
<button
className="btn btn-danger btn-block btn-sm"
disabled={false}
onClick={[Function]}
title="Remove"
type="button"
>
<svg
fill="currentColor"
height="1em"
stroke="currentColor"
strokeWidth="0"
style={
Object {
"color": undefined,
}
}
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M368.5 240h-225c-8.8 0-16 7.2-16 16 0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7h225c8.8 0 16-7.2 16-16s-7.2-16-16-16z"
/>
</svg>
</button>
</div>
</div>
</div>
</div>
</div>
<div
className="row"
>
<div
className="py-4 col-3 offset-9"
className="row"
>
<button
className="ml-1 object-property-expand btn btn-primary"
disabled={false}
onClick={[Function]}
style={
Object {
"width": "100%",
}
}
title="Add Item"
type="button"
<div
className="py-4 col-3 offset-9"
>
<svg
fill="currentColor"
height="1em"
stroke="currentColor"
strokeWidth="0"
<button
className="ml-1 object-property-expand btn btn-primary"
disabled={false}
onClick={[Function]}
style={
Object {
"color": undefined,
"width": "100%",
}
}
viewBox="0 0 16 16"
width="1em"
xmlns="http://www.w3.org/2000/svg"
title="Add Item"
type="button"
>
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"
/>
</svg>
</button>
<svg
fill="currentColor"
height="1em"
stroke="currentColor"
strokeWidth="0"
style={
Object {
"color": undefined,
}
}
viewBox="0 0 16 16"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"
/>
</svg>
</button>
</div>
</div>
</div>
</div>
Expand Down
Loading