How to use schema-based-json-editor - 10 common examples

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 / object-editor.component.ts View on Github external
ngOnInit() {
    this.collapsed = this.schema.collapsed
    this.value = common.getDefaultValue(this.required, this.schema, this.initialValue) as { [name: string]: common.ValueType }
    this.validate()
    if (this.value !== undefined) {
      for (const property in this.schema.properties) {
        if (this.schema.properties.hasOwnProperty(property)) {
          const schema = this.schema.properties[property]
          const propertyName = schema.propertyName || property
          if (this.isRequired(property) !== false) {
            const required = this.schema.required && this.schema.required.some(r => r === property)
            this.value[propertyName] = common.getDefaultValue(required, schema, this.value[propertyName]) as { [name: string]: common.ValueType }
          }

          this.properties.push({
            property,
            propertyName,
            schema
          })
github plantain-00 / schema-based-json-editor / packages / angular / src / any-editor.component.ts View on Github external
ngOnInit() {
    this.value = common.getDefaultValue(this.required, this.schema, this.initialValue) as string
    this.updateValue.emit({ value: this.value, isValid: true })
  }
  ngAfterViewInit() {
github plantain-00 / schema-based-json-editor / packages / vue / src / boolean-editor.ts View on Github external
beforeMount() {
    this.value = common.getDefaultValue(this.required, this.schema, this.initialValue) as boolean
    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
addItem() {
    this.value!.push(common.getDefaultValue(true, this.schema.items, undefined)!)
    this.updateValue.emit({ value: this.value, isValid: !this.errorMessage && this.invalidIndexes.length === 0 })
  }
  onDeleteFunction(i: number) {
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() {