@salesforcedevs/dx-components 0.64.0 → 0.64.1
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": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.1",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@types/lodash.get": "^4.4.6",
|
|
26
26
|
"@types/vimeo__player": "^2.16.2"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "2a2f653d7f778950001eacf42053e0d6c5b823d3"
|
|
29
29
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PopperPlacement
|
|
6
6
|
} from "typings/custom";
|
|
7
7
|
|
|
8
|
-
import { computePosition, flip,
|
|
8
|
+
import { computePosition, flip, size, shift } from "@floating-ui/dom";
|
|
9
9
|
import cx from "classnames";
|
|
10
10
|
import debounce from "debounce";
|
|
11
11
|
import { isPrerender } from "dxUtils/seo";
|
|
@@ -124,6 +124,7 @@ export default class Popover extends LightningElement {
|
|
|
124
124
|
private get className() {
|
|
125
125
|
return cx(
|
|
126
126
|
"popover",
|
|
127
|
+
this.offset && `popover-offset-${this.offset}`,
|
|
127
128
|
this.small && "popover-small",
|
|
128
129
|
this.width && "popover-overridewidth",
|
|
129
130
|
this.fullWidth && "popover-fullwidth"
|
|
@@ -271,24 +272,30 @@ export default class Popover extends LightningElement {
|
|
|
271
272
|
|
|
272
273
|
private setPosition = async () => {
|
|
273
274
|
if (this.popover && this.control) {
|
|
274
|
-
|
|
275
|
+
const popoverEl = this.popover;
|
|
276
|
+
|
|
277
|
+
computePosition(this.control, popoverEl, {
|
|
275
278
|
placement: this.placement,
|
|
276
279
|
middleware: [
|
|
280
|
+
...(this.fullWidth
|
|
281
|
+
? [
|
|
282
|
+
size({
|
|
283
|
+
apply({ rects }) {
|
|
284
|
+
Object.assign(popoverEl.style, {
|
|
285
|
+
width: `${rects.reference.width}px`
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
: []),
|
|
277
291
|
flip(),
|
|
278
|
-
shift({ padding: this.pagePadding })
|
|
279
|
-
...(this.offset === "medium"
|
|
280
|
-
? [offset(16)]
|
|
281
|
-
: this.offset === "small"
|
|
282
|
-
? [offset(8)]
|
|
283
|
-
: [])
|
|
292
|
+
shift({ padding: this.pagePadding })
|
|
284
293
|
]
|
|
285
294
|
}).then(({ x, y }) => {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
});
|
|
291
|
-
}
|
|
295
|
+
Object.assign(popoverEl.style, {
|
|
296
|
+
left: `${x}px`,
|
|
297
|
+
top: `${y}px`
|
|
298
|
+
});
|
|
292
299
|
});
|
|
293
300
|
}
|
|
294
301
|
};
|