vona-core 5.0.26 → 5.0.28
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { evaluateExpressions } from '@cabloy/utils';
|
|
1
|
+
import { evaluateExpressions, isNilOrEmptyString } from '@cabloy/utils';
|
|
2
2
|
import { appMetadata } from "../../core/metadata.js";
|
|
3
3
|
import { appResource } from "../../core/resource.js";
|
|
4
4
|
export function Use(options) {
|
|
@@ -44,6 +44,10 @@ export function __prepareInjectSelectorInfo(beanInstance, useOptions) {
|
|
|
44
44
|
if (!selectorInfo) {
|
|
45
45
|
selectorInfo = __prepareInjectSelectorInfo_init(beanInstance, useOptions);
|
|
46
46
|
}
|
|
47
|
+
if (!selectorInfo && !isNilOrEmptyString(useOptions.selector)) {
|
|
48
|
+
const selector = evaluateExpressions(useOptions.selector, beanInstance);
|
|
49
|
+
return { withSelector: true, args: [selector] };
|
|
50
|
+
}
|
|
47
51
|
return selectorInfo ?? { withSelector: false, args: [] };
|
|
48
52
|
}
|
|
49
53
|
function __prepareInjectSelectorInfo_descriptor(beanInstance, useOptions) {
|
|
@@ -54,7 +58,7 @@ function __prepareInjectSelectorInfo_descriptor(beanInstance, useOptions) {
|
|
|
54
58
|
if (!res)
|
|
55
59
|
return;
|
|
56
60
|
const withSelector = res.withSelector ?? false;
|
|
57
|
-
const args = res.args.map(arg => arg());
|
|
61
|
+
const args = res.args.map(arg => typeof arg === 'function' ? arg() : arg);
|
|
58
62
|
return { withSelector, args };
|
|
59
63
|
}
|
|
60
64
|
function __prepareInjectSelectorInfo_init(beanInstance, useOptions) {
|