@thinkpixellab-public/px-vue 3.0.42 → 3.0.43
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/components/PxFloat.vue +10 -2
- package/package.json +1 -1
package/components/PxFloat.vue
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
...popupStyle,
|
|
56
56
|
}"
|
|
57
57
|
>
|
|
58
|
-
<slot />
|
|
58
|
+
<slot :isFlipped="isFlipped" />
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
61
|
</transition>
|
|
@@ -203,6 +203,9 @@ export default {
|
|
|
203
203
|
|
|
204
204
|
// z offset of the current layer
|
|
205
205
|
currentLayerIndex: 0,
|
|
206
|
+
|
|
207
|
+
// true when the popup has been flipped (pass to the default slot to adjust styling if needed)
|
|
208
|
+
isFlipped: false,
|
|
206
209
|
};
|
|
207
210
|
},
|
|
208
211
|
computed: {
|
|
@@ -491,7 +494,12 @@ export default {
|
|
|
491
494
|
placement: this.placement,
|
|
492
495
|
strategy: this.strategy,
|
|
493
496
|
middleware: middleware,
|
|
494
|
-
}).then(({ x, y }) => {
|
|
497
|
+
}).then(({ x, y, middlewareData }) => {
|
|
498
|
+
this.isFlipped = !!(
|
|
499
|
+
middlewareData?.flip && Object.keys(middlewareData.flip).length
|
|
500
|
+
);
|
|
501
|
+
|
|
502
|
+
console.log(`middlewareData: 👉 ${JSON.stringify(middlewareData, null, 4)}`);
|
|
495
503
|
if (this.useTranslate) {
|
|
496
504
|
this.positionCss = {
|
|
497
505
|
transform: `translate(${this.cssPx(x)},${this.cssPx(y)})`,
|