forked from rjsf-team/react-jsonschema-form
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add generic type support to the bootstrap-4 theme (rjsf-team#3326)
* Generic support for Bootstrap 4 - Partially fix 3072 * Changes from code review * Changes from code review Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
- Loading branch information
1 parent
d13ee6a
commit f701ad3
Showing
27 changed files
with
440 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
import React from "react"; | ||
import { IconButtonProps } from "@rjsf/utils"; | ||
import { | ||
FormContextType, | ||
IconButtonProps, | ||
RJSFSchema, | ||
StrictRJSFSchema, | ||
} from "@rjsf/utils"; | ||
import Button from "react-bootstrap/Button"; | ||
import { BsPlus } from "@react-icons/all-files/bs/BsPlus"; | ||
|
||
const AddButton: React.ComponentType<IconButtonProps> = ({ | ||
uiSchema, | ||
registry, | ||
...props | ||
}) => ( | ||
<Button | ||
{...props} | ||
style={{ width: "100%" }} | ||
className={`ml-1 ${props.className}`} | ||
title="Add Item" | ||
> | ||
<BsPlus /> | ||
</Button> | ||
); | ||
|
||
export default AddButton; | ||
export default function AddButton< | ||
T = any, | ||
S extends StrictRJSFSchema = RJSFSchema, | ||
F extends FormContextType = any | ||
>({ uiSchema, registry, ...props }: IconButtonProps<T, S, F>) { | ||
return ( | ||
<Button | ||
{...props} | ||
style={{ width: "100%" }} | ||
className={`ml-1 ${props.className}`} | ||
title="Add Item" | ||
> | ||
<BsPlus /> | ||
</Button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
packages/bootstrap-4/src/FieldErrorTemplate/FieldErrorTemplate.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.