handle better appschemaform initialization

This commit is contained in:
Ruben Fiszel
2025-03-19 13:03:39 +01:00
parent 6ed2c6c908
commit a6fe26af3d
4 changed files with 11 additions and 4 deletions
@@ -173,7 +173,6 @@
}
if ((value == undefined || value == null) && !ignoreValueUndefined) {
value = structuredClone(defaultValue)
console.log('computeDefaultValue', value, defaultValue)
if (defaultValue === undefined || defaultValue === null) {
if (inputCat === 'string') {
value = nullable ? null : ''
@@ -185,7 +184,6 @@
value = []
}
} else if (inputCat === 'object') {
console.log('computeDefaultValue object', value)
evalValueToRaw()
}
}
@@ -50,7 +50,7 @@
})
let result: Schema | undefined = undefined
let args: Record<string, unknown> = {}
let args: Record<string, unknown> = outputs?.values?.peak() ?? {}
function handleArgsChange() {
const newArgs: Record<string, unknown> = {}
@@ -76,6 +76,7 @@
$componentControl[id] = {
setValue(nvalue: any) {
args = nvalue
outputs.values.set(nvalue, false)
},
invalidate(key: string, error: string) {
schemaForm?.invalidate(key, error)
@@ -75,7 +75,9 @@
function handleDefault(defaultValue: string | undefined) {
if (initialHandleDefault) {
initialHandleDefault = false
return
if (value != undefined && value != '') {
return
}
}
value = defaultValue
}
+6
View File
@@ -0,0 +1,6 @@
{
"name": "windmill",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}