@cccteam/ccc-lib 0.0.17 → 0.0.18
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/fesm2022/cccteam-ccc-lib-src-ccc-resource.mjs +26 -27
- package/fesm2022/cccteam-ccc-lib-src-ccc-resource.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-src-types.mjs +13 -2
- package/fesm2022/cccteam-ccc-lib-src-types.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib.mjs +37 -28
- package/fesm2022/cccteam-ccc-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/types/cccteam-ccc-lib-src-types.d.ts +14 -7
- package/types/cccteam-ccc-lib.d.ts +13 -7
|
@@ -2569,37 +2569,36 @@ class ResourceResolverComponent {
|
|
|
2569
2569
|
untracked(() => {
|
|
2570
2570
|
this.dynamicSlot().clear();
|
|
2571
2571
|
const component = config.component;
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
if (parentData) {
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
caseConfig.parentRelation.parentKey = '';
|
|
2584
|
-
}
|
|
2585
|
-
break;
|
|
2572
|
+
if (component === 'SwitchResolver') {
|
|
2573
|
+
let uuid = '';
|
|
2574
|
+
let caseConfig = {};
|
|
2575
|
+
for (const c of params.cases) {
|
|
2576
|
+
if (parentData) {
|
|
2577
|
+
if (parentData[c.parentField] === c.caseId) {
|
|
2578
|
+
uuid = String(parentData[c.childId]);
|
|
2579
|
+
caseConfig = c.config;
|
|
2580
|
+
if ('parentRelation' in caseConfig) {
|
|
2581
|
+
caseConfig.parentRelation.childKey = '';
|
|
2582
|
+
caseConfig.parentRelation.parentKey = '';
|
|
2586
2583
|
}
|
|
2584
|
+
break;
|
|
2587
2585
|
}
|
|
2588
2586
|
}
|
|
2589
|
-
if (uuid == '') {
|
|
2590
|
-
return;
|
|
2591
|
-
}
|
|
2592
|
-
// Use dynamic import to avoid circular dependency
|
|
2593
|
-
const primaryComponentRef = this.dynamicSlot().createComponent(this.compoundResourceComponent());
|
|
2594
|
-
primaryComponentRef.setInput('resourceConfig', caseConfig);
|
|
2595
|
-
primaryComponentRef.setInput('uuid', uuid);
|
|
2596
|
-
primaryComponentRef.setInput('parentData', parentData);
|
|
2597
|
-
break;
|
|
2598
2587
|
}
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2588
|
+
if (uuid == '') {
|
|
2589
|
+
return;
|
|
2590
|
+
}
|
|
2591
|
+
// Use dynamic import to avoid circular dependency
|
|
2592
|
+
const primaryComponentRef = this.dynamicSlot().createComponent(this.compoundResourceComponent());
|
|
2593
|
+
primaryComponentRef.setInput('resourceConfig', caseConfig);
|
|
2594
|
+
primaryComponentRef.setInput('uuid', uuid);
|
|
2595
|
+
primaryComponentRef.setInput('parentData', parentData);
|
|
2596
|
+
}
|
|
2597
|
+
else if (typeof component === 'function') {
|
|
2598
|
+
const primaryComponentRef = this.dynamicSlot().createComponent(component);
|
|
2599
|
+
primaryComponentRef.setInput('uuid', parentData['uuid'] || '');
|
|
2600
|
+
primaryComponentRef.setInput('config', config);
|
|
2601
|
+
primaryComponentRef.setInput('parentData', parentData);
|
|
2603
2602
|
}
|
|
2604
2603
|
});
|
|
2605
2604
|
});
|