qdadm 0.45.1 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -495,9 +495,36 @@ export function useFormPageBuilder(config = {}) {
|
|
|
495
495
|
fieldOrder.value.push(name)
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
+
// Auto-resolve reference options (async, non-blocking)
|
|
499
|
+
resolveReferences()
|
|
500
|
+
|
|
498
501
|
return builderApi
|
|
499
502
|
}
|
|
500
503
|
|
|
504
|
+
/**
|
|
505
|
+
* Resolve reference options for all fields with reference config
|
|
506
|
+
*
|
|
507
|
+
* Called automatically by generateFields(). Loads options from
|
|
508
|
+
* referenced entities and updates field configs reactively.
|
|
509
|
+
*
|
|
510
|
+
* @returns {Promise<void>}
|
|
511
|
+
*/
|
|
512
|
+
async function resolveReferences() {
|
|
513
|
+
for (const [name, config] of fieldsMap.value.entries()) {
|
|
514
|
+
// Skip if field has static options or no reference
|
|
515
|
+
if (config.options || !config.reference) continue
|
|
516
|
+
|
|
517
|
+
try {
|
|
518
|
+
const options = await manager.resolveReferenceOptions(name)
|
|
519
|
+
// Update field config reactively
|
|
520
|
+
const updatedConfig = { ...config, options }
|
|
521
|
+
fieldsMap.value.set(name, updatedConfig)
|
|
522
|
+
} catch (error) {
|
|
523
|
+
console.warn(`[useFormPageBuilder] Failed to resolve options for field '${name}':`, error)
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
501
528
|
/**
|
|
502
529
|
* Resolve field configuration from schema definition
|
|
503
530
|
*
|
|
@@ -1108,6 +1135,7 @@ export function useFormPageBuilder(config = {}) {
|
|
|
1108
1135
|
// Field management
|
|
1109
1136
|
fields,
|
|
1110
1137
|
generateFields,
|
|
1138
|
+
resolveReferences,
|
|
1111
1139
|
addField,
|
|
1112
1140
|
removeField,
|
|
1113
1141
|
excludeField,
|