@koumoul/vjsf 3.25.2 → 3.25.3
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
|
@@ -21,6 +21,11 @@ export default {
|
|
|
21
21
|
type: Object,
|
|
22
22
|
required: true
|
|
23
23
|
},
|
|
24
|
+
initialContext: {
|
|
25
|
+
/** @type import('vue').PropType<Record<string, any>> */
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => {}
|
|
28
|
+
},
|
|
24
29
|
tag: {
|
|
25
30
|
/** @type import('vue').PropType<string> */
|
|
26
31
|
type: String,
|
|
@@ -41,10 +46,11 @@ export default {
|
|
|
41
46
|
console.error(`vjsf: layout references a code slot "${this.layoutSlot.name}" that was not provided.`)
|
|
42
47
|
} else {
|
|
43
48
|
const slotContext = {
|
|
49
|
+
...this.initialContext,
|
|
50
|
+
...this.layoutSlot.props,
|
|
44
51
|
node: this.node,
|
|
45
52
|
statefulLayout: this.statefulLayout
|
|
46
53
|
}
|
|
47
|
-
if (this.layoutSlot.props) Object.assign(slotContext, this.layoutSlot.props)
|
|
48
54
|
return h(renderTag, this.statefulLayout.options.vjsfSlots[this.layoutSlot.name](slotContext))
|
|
49
55
|
}
|
|
50
56
|
}
|
|
@@ -128,7 +128,7 @@ export default function (nodeRef, statefulLayout, opts = {}) {
|
|
|
128
128
|
/** @type {Record<string, any>} */
|
|
129
129
|
const slots = {}
|
|
130
130
|
for (const [key, layoutSlot] of Object.entries(layout.value.slots)) {
|
|
131
|
-
slots[key] = () => h(NodeSlot, { layoutSlot, node: nodeRef.value, statefulLayout })
|
|
131
|
+
slots[key] = (/** @type {Record<string, any>} */ initialContext) => h(NodeSlot, { layoutSlot, node: nodeRef.value, statefulLayout, initialContext })
|
|
132
132
|
}
|
|
133
133
|
return slots
|
|
134
134
|
})
|
|
@@ -14,6 +14,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
14
14
|
type: import('vue').PropType<import('../../types.js').VjsfStatefulLayout>;
|
|
15
15
|
required: true;
|
|
16
16
|
};
|
|
17
|
+
initialContext: {
|
|
18
|
+
/** @type import('vue').PropType<Record<string, any>> */
|
|
19
|
+
type: import('vue').PropType<Record<string, any>>;
|
|
20
|
+
default: () => void;
|
|
21
|
+
};
|
|
17
22
|
tag: {
|
|
18
23
|
/** @type import('vue').PropType<string> */
|
|
19
24
|
type: import('vue').PropType<string>;
|
|
@@ -35,6 +40,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
35
40
|
type: import('vue').PropType<import('../../types.js').VjsfStatefulLayout>;
|
|
36
41
|
required: true;
|
|
37
42
|
};
|
|
43
|
+
initialContext: {
|
|
44
|
+
/** @type import('vue').PropType<Record<string, any>> */
|
|
45
|
+
type: import('vue').PropType<Record<string, any>>;
|
|
46
|
+
default: () => void;
|
|
47
|
+
};
|
|
38
48
|
tag: {
|
|
39
49
|
/** @type import('vue').PropType<string> */
|
|
40
50
|
type: import('vue').PropType<string>;
|
|
@@ -42,6 +52,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
42
52
|
};
|
|
43
53
|
}>> & Readonly<{}>, {
|
|
44
54
|
tag: string;
|
|
55
|
+
initialContext: Record<string, any>;
|
|
45
56
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
46
57
|
export default _default;
|
|
47
58
|
//# sourceMappingURL=node-slot.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-slot.vue.d.ts","sourceRoot":"","sources":["../../../src/components/fragments/node-slot.vue.js"],"names":[],"mappings":";;QAUM,2EAA2E;cAAjE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,yBAAyB,EAAE,IAAI,CAAC;;;;QAKxE,sEAAsE;cAA5D,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,QAAQ,CAAC;;;;QAKnE,gFAAgF;cAAtE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