How to use the schema-based-json-editor.toNumber 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 / angular / src / number-editor.component.ts View on Github external
updateSelection(value: any) {
    this.value = this.schema.type === 'integer' ? common.toInteger(value) : common.toNumber(value)
    this.validate()
    this.updateValue.emit({ value: this.value, isValid: !this.errorMessage })
  }
  trackByFunction = (index: number) => {
github plantain-00 / schema-based-json-editor / packages / vue / src / number-editor.ts View on Github external
onChange(e: { target: { value: string } }) {
    this.value = this.schema.type === 'integer' ? common.toInteger(e.target.value) : common.toNumber(e.target.value)
    this.validate()
    this.$emit('update-value', { value: this.value, isValid: !this.errorMessage })
  }
github plantain-00 / schema-based-json-editor / packages / react / src / number-editor.tsx View on Github external
private onChange = (e: React.FormEvent<{ value: string }>) => {
    this.value = this.props.schema.type === 'integer' ? common.toInteger(e.currentTarget.value) : common.toNumber(e.currentTarget.value)
    this.validate()
    this.setState({ value: this.value })
    this.props.updateValue(this.value, !this.errorMessage)
  }
  private validate() {