Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
})
ngOnInit() {
this.value = common.getDefaultValue(this.required, this.schema, this.initialValue) as string
this.updateValue.emit({ value: this.value, isValid: true })
}
ngAfterViewInit() {
beforeMount() {
this.value = common.getDefaultValue(this.required, this.schema, this.initialValue) as boolean
this.$emit('update-value', { value: this.value, isValid: true })
}
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) {
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) {
toggleOptional = () => {
this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as string | undefined
this.updateValue.emit({ value: this.value, isValid: true })
}
}
toggleOptional() {
this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as boolean | undefined
this.updateValue.emit({ value: this.value, isValid: true })
}
get isReadOnly() {
toggleOptional = () => {
this.value = common.toggleOptional(this.value, this.schema, this.initialValue) as any
this.$emit('update-value', { value: this.value, isValid: true })
}
}
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() {
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() {