How to use the schema-based-json-editor.toggleOptional function in schema-based-json-editor

To help you get started, we’ve selected a few schema-based-json-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plantain-00 / schema-based-json-editor / packages / vue / src / object-editor.ts View on Github external
toggleOptional() {
    this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as { [name: string]: common.ValueType } | undefined
    this.validate()
    this.$emit('update-value', { value: this.value, isValid: this.invalidProperties.length === 0 })
  }
  onChange(property: string, { value, isValid }: common.ValidityValue) {
github plantain-00 / schema-based-json-editor / packages / angular / src / any-editor.component.ts View on Github external
toggleOptional = () => {
    this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as string | undefined
    this.updateValue.emit({ value: this.value, isValid: true })
  }
}
github plantain-00 / schema-based-json-editor / packages / angular / src / boolean-editor.component.ts View on Github external
toggleOptional() {
    this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as boolean | undefined
    this.updateValue.emit({ value: this.value, isValid: true })
  }
  get isReadOnly() {
github plantain-00 / schema-based-json-editor / packages / vue / src / any-editor.ts View on Github external
toggleOptional = () => {
    this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as any
    this.$emit('update-value', { value: this.value, isValid: true })
  }
}
github plantain-00 / schema-based-json-editor / packages / angular / src / array-editor.component.ts View on Github external
toggleOptional = () => {
    this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as common.ValueType[] | undefined
    this.validate()
    this.updateValue.emit({ value: this.value, isValid: !this.errorMessage && this.invalidIndexes.length === 0 })
  }
  addItem() {
github plantain-00 / schema-based-json-editor / packages / vue / src / string-editor.ts View on Github external
toggleOptional() {
    this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as string | undefined
    this.validate()
    this.$emit('update-value', { value: this.value, isValid: !this.errorMessage })
  }
  collapseOrExpand() {
github plantain-00 / schema-based-json-editor / packages / angular / src / object-editor.component.ts View on Github external
toggleOptional = () => {
    this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as { [name: string]: common.ValueType } | undefined
    this.validate()
    this.updateValue.emit({ value: this.value, isValid: this.invalidProperties.length === 0 })
  }
  onChange(property: string, { value, isValid }: common.ValidityValue<{ [name: string]: common.ValueType }>) {
github plantain-00 / schema-based-json-editor / packages / react / src / string-editor.tsx View on Github external
private toggleOptional = () => {
    this.value = common.toggleOptional(this.value, this.props.schema, this.props.initialValue) as string | undefined
    this.validate()
    this.willRender = true
    this.setState({ value: this.value })
    this.props.updateValue(this.value, !this.errorMessage)
  }
  private collapseOrExpand = () => {
github plantain-00 / schema-based-json-editor / packages / react / src / any-editor.tsx View on Github external
private toggleOptional = () => {
    this.value = common.toggleOptional(this.value, this.props.schema, this.props.initialValue) as string | undefined
    this.setState({ value: this.value })
    this.props.updateValue(this.value, true)
  }
}
github plantain-00 / schema-based-json-editor / packages / react / src / number-editor.tsx View on Github external
private toggleOptional = () => {
    this.value = common.toggleOptional(this.value, this.props.schema, this.props.initialValue) as number | undefined
    this.validate()
    this.willRender = true
    this.setState({ value: this.value })
    this.props.updateValue(this.value, !this.errorMessage)
  }
  private get useInput() {