@thinkpixellab-public/px-vue 3.0.41 → 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.
@@ -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)})`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "3.0.41",
3
+ "version": "3.0.43",
4
4
  "description": "General purpose Vue components and helpers that can be used across projects.",
5
5
  "author": "Pixel Lab",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  export default val => {
2
- if (!process.server) {
2
+ if (val && !process.server) {
3
3
  val = val.replace(/<\/p>/g, '</p> ');
4
4
  val = val.replace(/<\/li>/g, '</li> ');
5
5
  val = val.replace(/<\/div>/g, '</div> ');