🌊
jsf
  • About KalmiaJSF
  • Setup
  • Architecture
  • Contributing
  • Changelog
  • Guides
    • Cheat Sheet
  • Examples
    • Demo example
    • Basic examples
    • Kitchen Sink example
    • Charts example
  • Schema
    • Intro to Schema
    • Prop types
      • String
      • Boolean
      • Number & Integer
      • Object
      • Array
      • Date
      • Id
      • Null
      • Ref
      • Binary
    • Prop options
      • Disabling property
      • On prop init actions
      • Persist
      • On value change
      • On user value change
    • Handlers
      • Color picker
    • Creating custom handler
      • Working with arrays
    • Value provider
  • Validation
    • Custom validation
    • Eval
  • LAYOUT
    • Intro to Layout
    • Layout options
      • Show & hide
      • On click action
  • INTERFACES
    • Value Options
  • Form
    • Form data
  • OTHER
    • Events
    • Lifecycle hooks
    • Notifications support
  • PAGES & COMPONENTS
    • Page
    • Component
  • THEMING
    • Creating new theme variant
  • BUILDER
    • Shortcuts
  • Help
    • FAQ
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Schema

Intro to Schema

The schema contains JSF props, that together form a model definition of document. Because JSF is written in JSON format, it supports all JSON types and some extra. Each prop can define the following properties:

  • Type (string, number, array, object, ...).

  • Validation rules.

  • Enabled conditions.

  • If it's array or object type children props.

  • Handler.

Exported TypeScript type JsfPropTypes describes all possible prop types. JsfProp type describes all possible prop definitions. JsfPropValue type describes all possible values that props can return.

In order to check what type is prop you can use one of the following functions:

  • isPropNull check if prop type is null.

  • isPropObject check if prop type is object.

  • isPropArray check if prop type is array.

  • isPropString check if prop type is string.

  • isPropNumber check if prop type is number.

  • isPropInteger check if prop type is integer.

  • isPropBoolean check if prop type is boolean.

  • isPropBinary check if prop type is binary.

  • isPropId check if prop type is ID compatible with Mongo Object ID.

  • isPropRef check if prop type is reference.

  • isPropDate check if prop type is date.

Schema property is required and it must contain one of props. Usually, first level (root) prop is object.

PreviousCharts exampleNextProp types

Last updated 4 years ago

Was this helpful?