@farm-investimentos/front-mfe-components 11.5.5 → 11.5.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "11.5.5",
3
+ "version": "11.5.6",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -27,7 +27,23 @@ export const Primary = () => ({
27
27
  v-bind="attrs"
28
28
  v-on="on"
29
29
  >
30
- toggle
30
+ open
31
+ </farm-btn>
32
+ </template>
33
+ </farm-contextmenu>
34
+ </div>`,
35
+ });
36
+
37
+ export const LongActivator = () => ({
38
+ template: `<div style="padding-left: 120px; padding-top: 80px; display: flex;">
39
+ <farm-contextmenu>
40
+ some text
41
+ <template v-slot:activator="{ on, attrs }">
42
+ <farm-btn
43
+ v-bind="attrs"
44
+ v-on="on"
45
+ >
46
+ Very long Activator
31
47
  </farm-btn>
32
48
  </template>
33
49
  </farm-contextmenu>
@@ -104,15 +104,23 @@ export default Vue.extend({
104
104
  window.scrollY +
105
105
  (!bottom.value ? 0 : activatorBoundingClientRect.height);
106
106
 
107
- const w = popupClientRect.width < 96 ? 96 : popupClientRect.width;
108
- let offsetLeft =
109
- activatorBoundingClientRect.left + activatorBoundingClientRect.width / 2 - w / 2;
107
+ //
108
+
109
+ let offsetLeft = activatorBoundingClientRect.left;
110
110
 
111
111
  styles.minWidth =
112
112
  (activatorBoundingClientRect.width > 96
113
113
  ? parseInt(activatorBoundingClientRect.width)
114
114
  : 96) + 'px';
115
115
 
116
+ if(activatorBoundingClientRect.width < 96) {
117
+ const w = popupClientRect.width < 96 ? 96 : popupClientRect.width;
118
+ offsetLeft =
119
+ activatorBoundingClientRect.left +
120
+ activatorBoundingClientRect.width / 2 -
121
+ w / 2;
122
+ }
123
+
116
124
  //Do not allow to open outside window
117
125
 
118
126
  const rightEdge = offsetLeft + popupClientRect.width;