Options
All
  • Public
  • Public/Protected
  • All
Menu

JSON Forms Vanilla Renderers

Index

Classes

Interfaces

Variables

Functions

Object literals

Variables

Const JsonFormsStyleContext

JsonFormsStyleContext: Context<StyleContext> = React.createContext(defaultContext)

Const REGISTER_STYLE

REGISTER_STYLE: "REGISTER_STYLE" = "REGISTER_STYLE"

Const REGISTER_STYLES

REGISTER_STYLES: "REGISTER_STYLES" = "REGISTER_STYLES"

Const UNREGISTER_STYLE

UNREGISTER_STYLE: "UNREGISTER_STYLE" = "UNREGISTER_STYLE"

Const arrayControlTester

arrayControlTester: RankedTester = rankWith(2,isObjectArrayWithNesting)

Const booleanCellTester

booleanCellTester: RankedTester = rankWith(2, isBooleanControl)

Default tester for boolean controls.

type

{RankedTester}

Const categorizationTester

categorizationTester: RankedTester = rankWith(1,and(uiTypeIs('Categorization'), uischema => {const hasCategory = (element: Categorization): boolean => {if (isEmpty(element.elements)) {return false;}return element.elements.map(elem =>isCategorization(elem) ? hasCategory(elem) : elem.type === 'Category').reduce((prev, curr) => prev && curr, true);};return hasCategory(uischema as Categorization);}))

convertToValidClassName

convertToValidClassName: convertToValidClassName

createLabelDescriptionFrom

createLabelDescriptionFrom: createLabelDescriptionFrom

Const dateCellTester

dateCellTester: RankedTester = rankWith(2, isDateControl)

Default tester for date controls.

type

{RankedTester}

Const dateTimeCellTester

dateTimeCellTester: RankedTester = rankWith(2, isDateTimeControl)

Default tester for datetime controls.

type

{RankedTester}

Const enumCellTester

enumCellTester: RankedTester = rankWith(2, isEnumControl)

Default tester for enum controls.

type

{RankedTester}

Const groupTester

groupTester: RankedTester = rankWith(1, uiTypeIs('Group'))

Default tester for a group layout.

type

{RankedTester}

Const horizontalLayoutTester

horizontalLayoutTester: RankedTester = rankWith(1, uiTypeIs('HorizontalLayout'))

Default tester for a horizontal layout.

type

{RankedTester}

Const inputControlTester

inputControlTester: RankedTester = rankWith(1, isControl)

Const integerCellTester

integerCellTester: RankedTester = rankWith(2, isIntegerControl)

Default tester for integer controls.

type

{RankedTester}

isObjectArrayControl

isObjectArrayControl: function

Type declaration

    • (uischema: UISchemaElement, schema: JsonSchema): boolean
    • Parameters

      • uischema: UISchemaElement
      • schema: JsonSchema

      Returns boolean

isPrimitiveArrayControl

isPrimitiveArrayControl: function

Type declaration

    • (uischema: UISchemaElement, schema: JsonSchema): boolean
    • Parameters

      • uischema: UISchemaElement
      • schema: JsonSchema

      Returns boolean

Const labelRendererTester

labelRendererTester: RankedTester = rankWith(1, uiTypeIs('Label'))

Default tester for a label.

type

{RankedTester}

Const numberCellTester

numberCellTester: RankedTester = rankWith(2, isNumberControl)

Default tester for number controls.

type

{RankedTester}

Const numberFormatCellTester

numberFormatCellTester: RankedTester = rankWith(4, isNumberFormatControl)

Default tester for text-based/string controls.

type

{RankedTester}

or

or: function

Type declaration

    • (...testers: Tester[]): Tester
    • Parameters

      • Rest ...testers: Tester[]

      Returns Tester

rankWith

rankWith: function

Type declaration

    • (rank: number, tester: Tester): function
    • Parameters

      • rank: number
      • tester: Tester

      Returns function

        • (uischema: UISchemaElement, schema: JsonSchema): number
        • Parameters

          • uischema: UISchemaElement
          • schema: JsonSchema

          Returns number

Const sliderCellTester

sliderCellTester: RankedTester = rankWith(4, isRangeControl)

Const tableArrayControlTester

tableArrayControlTester: RankedTester = rankWith(3,or(isObjectArrayControl, isPrimitiveArrayControl))

Alternative tester for an array that also checks whether the 'table' option is set.

type

{RankedTester}

Const textAreaCellTester

textAreaCellTester: RankedTester = rankWith(2, isMultiLineControl)

Tester for a multi-line string control.

type

{RankedTester}

Const textCellTester

textCellTester: RankedTester = rankWith(1, isStringControl)

Default tester for text-based/string controls.

type

{RankedTester}

Const timeCellTester

timeCellTester: RankedTester = rankWith(2, isTimeControl)

Default tester for date controls.

type

{RankedTester}

Const vanillaCells

vanillaCells: object[] = [{ tester: booleanCellTester, cell: BooleanCell },{ tester: dateCellTester, cell: DateCell },{ tester: dateTimeCellTester, cell: DateTimeCell },{ tester: enumCellTester, cell: EnumCell },{ tester: integerCellTester, cell: IntegerCell },{ tester: numberCellTester, cell: NumberCell },{ tester: sliderCellTester, cell: SliderCell },{ tester: textAreaCellTester, cell: TextAreaCell },{ tester: textCellTester, cell: TextCell },{ tester: timeCellTester, cell: TimeCell }]

Const vanillaRenderers

vanillaRenderers: object[] = [{ tester: inputControlTester, renderer: InputControl },{ tester: arrayControlTester, renderer: ArrayControl },{ tester: labelRendererTester, renderer: LabelRenderer },{ tester: categorizationTester, renderer: Categorization },{ tester: tableArrayControlTester, renderer: TableArrayControl },{ tester: groupTester, renderer: GroupLayout },{ tester: verticalLayoutTester, renderer: VerticalLayout },{ tester: horizontalLayoutTester, renderer: HorizontalLayout }]

Const vanillaStyles

vanillaStyles: StyleDef[] = [{name: 'control',classNames: ['control']},{name: 'control.trim',classNames: ['trim']},{name: 'control.input',classNames: ['input']},{name: 'control.select',classNames: ['select']},{name: 'control.validation.error',classNames: ['validation_error']},{name: 'control.validation',classNames: ['validation']},{name: 'categorization',classNames: ['categorization']},{name: 'categorization.master',classNames: ['categorization-master']},{name: 'categorization.detail',classNames: ['categorization-detail']},{name: 'category.group',classNames: ['category-group']},{name: 'array.layout',classNames: ['array-layout']},{name: 'array.children',classNames: ['children']},{name: 'group.layout',classNames: ['group-layout']},{name: 'horizontal.layout',classNames: ['horizontal-layout']},{name: 'horizontal.layout.item',classNames: ([size]: number[]) => [`horizontal-layout-${size}`]},{name: 'vertical.layout',classNames: ['vertical-layout']},{name: 'array.table.validation.error',classNames: ['validation_error']},{name: 'array.table.validation',classNames: ['validation']},{name: 'array.table',classNames: ['array-table-layout', 'control']},{name: 'input.description',classNames: ['input-description']}]

Pre-defined vanilla styles.

type

{{name: string; classNames: string[]}[]}

Const verticalLayoutTester

verticalLayoutTester: RankedTester = rankWith(1, uiTypeIs('VerticalLayout'))

Default tester for a vertical layout.

type

{RankedTester}

Const withVanillaCellProps

withVanillaCellProps: (Anonymous function) = withVanillaCellPropsForType('control.input')

Const withVanillaEnumCellProps

withVanillaEnumCellProps: (Anonymous function) = withVanillaCellPropsForType('control.select')

Functions

Const ArrayControl

  • ArrayControl(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • addItem: addItem
      • classNames: object
        • [className: string]: string
      • data: any
      • label: string | Labels
      • path: string
      • renderers: JsonFormsRendererRegistryEntry[]
      • schema: JsonSchema4 | JsonSchema7
      • uischema: ControlElement
      • uischemas: JsonFormsUISchemaRegistryEntry[]

    Returns Element

Const ArrayControlRenderer

  • ArrayControlRenderer(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • addItem: addItem
      • data: any
      • enabled: boolean
      • errors: string
      • getStyle: getStyle
      • getStyleAsClassName: getStyleAsClassName
      • id: string
      • path: string
      • removeItems: removeItems
      • rootSchema: JsonSchema4 | JsonSchema7
      • schema: JsonSchema4 | JsonSchema7
      • uischema: ControlElement
      • uischemas: JsonFormsUISchemaRegistryEntry[]
      • visible: boolean

    Returns Element

Const BooleanCell

  • Parameters

    Returns Element

Const CategorizationList

  • CategorizationList(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • categorization: Categorization
      • depth: number
      • groupClassName: string
      • onSelect: any
      • selectedCategory: Category
      • subcategoriesClassName: string

    Returns Element

Const DateCell

  • Parameters

    Returns Element

Const DateTimeCell

  • Parameters

    Returns Element

Const EnumCell

  • Parameters

    Returns Element

Const GroupLayoutRenderer

  • GroupLayoutRenderer(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • getStyle: getStyle
      • getStyleAsClassName: getStyleAsClassName
      • path: string
      • schema: JsonSchema4 | JsonSchema7
      • uischema: UISchemaElement
      • visible: boolean

    Returns Element

Const HorizontalLayoutRenderer

  • HorizontalLayoutRenderer(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • enabled: boolean
      • getStyle: getStyle
      • getStyleAsClassName: getStyleAsClassName
      • path: string
      • schema: JsonSchema4 | JsonSchema7
      • uischema: UISchemaElement
      • visible: boolean

    Returns Element

Const IntegerCell

  • Parameters

    Returns Element

Const JsonFormsLayout

  • JsonFormsLayout(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • children: any
      • className: string
      • visible: boolean

    Returns Element

Const LabelRenderer

  • LabelRenderer(__namedParameters: object): Element
  • Default renderer for a label.

    Parameters

    • __namedParameters: object

    Returns Element

Const NumberCell

  • Parameters

    Returns Element

Const NumberFormatCell

  • Parameters

    Returns Element

Const SingleCategory

  • SingleCategory(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • category: Category
      • path: string
      • schema: JsonSchema4 | JsonSchema7

    Returns Element

Const SliderCell

  • Parameters

    Returns Element

Const TextAreaCell

  • Parameters

    Returns Element

Const TextCell

  • Parameters

    Returns Element

Const TimeCell

  • Parameters

    Returns Element

Const VerticalLayoutRenderer

  • VerticalLayoutRenderer(__namedParameters: object): Element
  • Parameters

    • __namedParameters: object
      • enabled: boolean
      • getStyle: getStyle
      • getStyleAsClassName: getStyleAsClassName
      • path: string
      • schema: JsonSchema4 | JsonSchema7
      • uischema: UISchemaElement
      • visible: boolean

    Returns Element

Const addVanillaCellProps

  • addVanillaCellProps(mapStateToCellsProps: function): (Anonymous function)
  • Parameters

    • mapStateToCellsProps: function
        • (s: JsonFormsState, p: OwnPropsOfCell): StatePropsOfCell
        • Parameters

          • s: JsonFormsState
          • p: OwnPropsOfCell

          Returns StatePropsOfCell

    Returns (Anonymous function)

Const addVanillaControlProps

  • addVanillaControlProps<P>(mapStateToProps: function): (Anonymous function)
  • Add vanilla props to the return value of calling the given mapStateToProps function.

    Type parameters

    • P: StatePropsOfControl

    Parameters

    • mapStateToProps: function

      existing mapStateToProps function

        • (s: JsonFormsState, p: OwnPropsOfControl): P
        • Parameters

          • s: JsonFormsState
          • p: OwnPropsOfControl

          Returns P

    Returns (Anonymous function)

    vanilla-specific control props

Const addVanillaLayoutProps

  • addVanillaLayoutProps(mapStateToProps: function): (Anonymous function)
  • Add vanilla props to the return value of calling the given mapStateToProps function.

    Parameters

    • mapStateToProps: function

      an existing mapStateToProps function for retrieving layout props

        • (s: JsonFormsState, p: OwnPropsOfRenderer): RendererProps
        • Parameters

          • s: JsonFormsState
          • p: OwnPropsOfRenderer

          Returns RendererProps

    Returns (Anonymous function)

    vanilla specific layout props

Const findStyle

  • findStyle(styles: StyleDef[]): (Anonymous function)
  • Parameters

    Returns (Anonymous function)

Const findStyleAsClassName

  • findStyleAsClassName(styles: StyleDef[]): (Anonymous function)
  • Parameters

    Returns (Anonymous function)

Const getCategoryClassName

  • getCategoryClassName(category: Category, selectedCategory: Category): string
  • Parameters

    • category: Category
    • selectedCategory: Category

    Returns string

Const getStyle

  • getStyle(state: JsonFormsState): (Anonymous function)
  • Parameters

    • state: JsonFormsState

    Returns (Anonymous function)

Const getStyleAsClassName

  • getStyleAsClassName(state: JsonFormsState): (Anonymous function)
  • Parameters

    • state: JsonFormsState

    Returns (Anonymous function)

Const isCategorization

  • isCategorization(category: Category | Categorization): category is Categorization
  • Parameters

    • category: Category | Categorization

    Returns category is Categorization

Const registerStyle

  • registerStyle(styleName: string, classNames: string[]): object
  • registerStyle(styles: StyleDef[], __namedParameters: object): StyleDef[]
  • Parameters

    • styleName: string
    • classNames: string[]

    Returns object

    • classNames: string[]
    • name: string
    • type: string
  • Parameters

    • styles: StyleDef[]
    • __namedParameters: object
      • classNames: string[] | function
      • name: string

    Returns StyleDef[]

Const registerStyles

  • registerStyles(styleDefs: object[]): object
  • Parameters

    • styleDefs: object[]

    Returns object

    • styles: object[]
    • type: string

Const removeStyle

  • Parameters

    Returns StyleDef[]

Const renderChildren

  • renderChildren(layout: Layout, schema: JsonSchema, className: string, path: string): Element[]
  • Parameters

    • layout: Layout
    • schema: JsonSchema
    • className: string
    • path: string

    Returns Element[]

Const stylingReducer

  • stylingReducer(state?: StyleDef[], action: any): any
  • Parameters

    • Default value state: StyleDef[] = []
    • action: any

    Returns any

Const unregisterStyle

  • unregisterStyle(styleName: string): object
  • Parameters

    • styleName: string

    Returns object

    • name: string
    • type: string

Const useStyleContext

  • Returns StyleContext

Const useStyles

  • Returns StyleDef[]

Const withVanillaCellPropsForType

  • withVanillaCellPropsForType(type: string): (Anonymous function)
  • Parameters

    • type: string

    Returns (Anonymous function)

Const withVanillaControlProps

  • withVanillaControlProps(Component: ComponentType<any>): (Anonymous function)
  • Parameters

    • Component: ComponentType<any>

    Returns (Anonymous function)

Object literals

Const defaultContext

defaultContext: object

styles

styles: StyleDef[] = vanillaStyles

Generated using TypeDoc