-
-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,117 additions
and
200 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import { JsonEditor as Editor } from 'jsoneditor-react'; | ||
import 'jsoneditor-react/es/editor.min.css'; | ||
import React, { HTMLProps } from 'react'; | ||
import { JsonEditor } from '../../JsonEditor/JsonEditor'; | ||
import { Field } from '../Field/Field'; | ||
|
||
interface JsonFieldProps extends HTMLProps<any> { | ||
label?: string; | ||
value?: any; | ||
onChange?: (v: any) => void; | ||
interface JsonFieldProps extends Omit<HTMLProps<HTMLInputElement>, 'value' | 'ref'> { | ||
value?: Record<any, any>; | ||
schema?: Record<string, any>; | ||
} | ||
|
||
export const JsonField = ({ label, id, ...props }: JsonFieldProps) => ( | ||
export const JsonField = ({ label, id, value, ...rest }: JsonFieldProps) => ( | ||
<Field label={label} id={id}> | ||
<Editor mode="code" {...props} /> | ||
<JsonEditor doc={value || {}} id={id} {...rest} /> | ||
</Field> | ||
); |
File renamed without changes.
Oops, something went wrong.