Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFarmer committed May 20, 2024
1 parent 5b5f29b commit 79a55a5
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/controls/BooleanControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export function BooleanControl({
const showTooltip =
!showDescription && !isDescriptionHidden(visible, description, true, true)
const uiSchema = uischema as ControlUISchema<unknown> | ControlElement
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const tooltip = showTooltip && description ? description : undefined

return (
Expand Down
3 changes: 2 additions & 1 deletion src/controls/NumericControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const NumericControl = (props: ControlProps & RendererProps) => {
]

const uiSchema = props.uischema as ControlUISchema<unknown> | ControlElement
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}

return (
<Form.Item
Expand Down
3 changes: 2 additions & 1 deletion src/controls/NumericSliderControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export const NumericSliderControl = (props: ControlProps & RendererProps) => {
]

const uiSchema = props.uischema as ControlUISchema<unknown> | ControlElement
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}

return (
<Form.Item
Expand Down
3 changes: 2 additions & 1 deletion src/controls/ObjectArrayControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export function ObjectArrayControl({
})

const uiSchema = uischema as ControlUISchema<unknown> | ControlElement
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}

const labelDescription = Helpers.createLabelDescriptionFrom(uischema, schema)
const label = labelDescription.show ? labelDescription.text : ""
Expand Down
3 changes: 2 additions & 1 deletion src/controls/PrimitiveArrayControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export function PrimitiveArrayControl({

const uiSchema = uischema as ControlUISchema<unknown> | ControlElement
const options: ArrayControlOptions = uiSchema.options ?? {}
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}

return (
<Form.Item
Expand Down
3 changes: 2 additions & 1 deletion src/controls/TextControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export function TextControl({
const ariaLabel = label || schema.description
const options: TextControlOptions =
(uiSchema.options as TextControlOptions) ?? {}
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const tooltip = options.tooltip ? options.tooltip : formItemProps?.tooltip
const placeholderText = options.placeholderText
const form = Form.useFormInstance()
Expand Down
3 changes: 2 additions & 1 deletion src/controls/combinators/AnyOfControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export function AnyOfControl({
const labelDescription = Helpers.createLabelDescriptionFrom(uischema, schema)

const uiSchema = uischema as ControlUISchema<unknown> | ControlElement
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}

return (
<Space direction="vertical" style={{ width: "100%" }} size="middle">
Expand Down
3 changes: 2 additions & 1 deletion src/controls/combinators/OneOfControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export function OneOfControl({
)

const uiSchema = uischema as ControlUISchema<unknown> | ControlElement
const formItemProps = "formItemProps" in uiSchema ? uiSchema.formItemProps : {}
const formItemProps =
"formItemProps" in uiSchema ? uiSchema.formItemProps : {}

return (
<Form.Item
Expand Down

0 comments on commit 79a55a5

Please sign in to comment.