@zubra/runtime 5.11.0 → 5.12.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/dist/production/element.js +6 -1
- package/package.json +1 -1
- package/src/element.js +6 -1
|
@@ -848,7 +848,12 @@ function filledSignal(filled, name) {
|
|
|
848
848
|
* <zb-if test={hasFooter}><footer><zb-slot name="footer"></zb-slot></footer></zb-if>
|
|
849
849
|
*/
|
|
850
850
|
export function hasSlot(name = 'default') {
|
|
851
|
-
|
|
851
|
+
const component = hooks('hasSlot');
|
|
852
|
+
const filled = filledSignal(component.filled, name);
|
|
853
|
+
// The server rendered with this slot filled (`data-zb-filled`): start from that, so hydrating
|
|
854
|
+
// keeps the markup it wrapped around the slot. The slot's own content takes over once bound.
|
|
855
|
+
if (component.host?.getAttribute('data-zb-filled')?.split(' ').includes(name)) filled.set(true);
|
|
856
|
+
return filled;
|
|
852
857
|
}
|
|
853
858
|
|
|
854
859
|
/**
|
package/package.json
CHANGED
package/src/element.js
CHANGED
|
@@ -876,7 +876,12 @@ function filledSignal(filled, name) {
|
|
|
876
876
|
* <zb-if test={hasFooter}><footer><zb-slot name="footer"></zb-slot></footer></zb-if>
|
|
877
877
|
*/
|
|
878
878
|
export function hasSlot(name = 'default') {
|
|
879
|
-
|
|
879
|
+
const component = hooks('hasSlot');
|
|
880
|
+
const filled = filledSignal(component.filled, name);
|
|
881
|
+
// The server rendered with this slot filled (`data-zb-filled`): start from that, so hydrating
|
|
882
|
+
// keeps the markup it wrapped around the slot. The slot's own content takes over once bound.
|
|
883
|
+
if (component.host?.getAttribute('data-zb-filled')?.split(' ').includes(name)) filled.set(true);
|
|
884
|
+
return filled;
|
|
880
885
|
}
|
|
881
886
|
|
|
882
887
|
/**
|