@salesforcedevs/dx-components 0.63.2 → 0.64.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@coveo/headless": "^1.32.0",
|
|
14
|
-
"@
|
|
14
|
+
"@floating-ui/dom": "^0.5.3",
|
|
15
15
|
"@sfdocs-internal/wires": "^0.6.3",
|
|
16
16
|
"@vimeo/player": "^2.16.4",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
@@ -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": "369ff728fbf7ea16a249785a16dbc73331456a9b"
|
|
29
29
|
}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.popover-container {
|
|
12
|
-
position:
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
13
15
|
z-index: var(--dx-c-popover-z-index, var(--dx-g-z-index-max));
|
|
14
16
|
visibility: hidden;
|
|
15
17
|
pointer-events: none;
|
|
@@ -50,14 +52,6 @@
|
|
|
50
52
|
max-width: unset;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
.popover-offset-small {
|
|
54
|
-
margin-top: var(--dx-g-spacing-sm);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.popover-offset-medium {
|
|
58
|
-
margin-top: var(--dx-g-spacing-md);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
55
|
.popover-small {
|
|
62
56
|
width: 136px;
|
|
63
57
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PopperPlacement
|
|
6
6
|
} from "typings/custom";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { computePosition, flip, offset, shift } from "@floating-ui/dom";
|
|
9
9
|
import cx from "classnames";
|
|
10
10
|
import debounce from "debounce";
|
|
11
11
|
import { isPrerender } from "dxUtils/seo";
|
|
@@ -69,14 +69,8 @@ export default class Popover extends LightningElement {
|
|
|
69
69
|
this.control.setAttribute("aria-expanded", "true");
|
|
70
70
|
|
|
71
71
|
this.dispatchEvent(new CustomEvent("open"));
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// another approach would be to use IntersectionObserver to determine exactly when the visiblity
|
|
75
|
-
// is applied before running
|
|
76
|
-
setTimeout(() => {
|
|
77
|
-
this.setPosition();
|
|
78
|
-
this.attachListenersTopopover();
|
|
79
|
-
});
|
|
72
|
+
this.setPosition();
|
|
73
|
+
this.attachListenersTopopover();
|
|
80
74
|
}
|
|
81
75
|
}
|
|
82
76
|
|
|
@@ -130,7 +124,6 @@ export default class Popover extends LightningElement {
|
|
|
130
124
|
private get className() {
|
|
131
125
|
return cx(
|
|
132
126
|
"popover",
|
|
133
|
-
this.offset && `popover-offset-${this.offset}`,
|
|
134
127
|
this.small && "popover-small",
|
|
135
128
|
this.width && "popover-overridewidth",
|
|
136
129
|
this.fullWidth && "popover-fullwidth"
|
|
@@ -278,35 +271,24 @@ export default class Popover extends LightningElement {
|
|
|
278
271
|
|
|
279
272
|
private setPosition = async () => {
|
|
280
273
|
if (this.popover && this.control) {
|
|
281
|
-
|
|
282
|
-
createPopper(this.control, this.popover, {
|
|
274
|
+
computePosition(this.control, this.popover, {
|
|
283
275
|
placement: this.placement,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
{
|
|
293
|
-
name: "flip",
|
|
294
|
-
options: {
|
|
295
|
-
fallbackPlacements: []
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
this.fullWidth
|
|
299
|
-
? {
|
|
300
|
-
name: "fullWidth",
|
|
301
|
-
enabled: true,
|
|
302
|
-
fn: ({ state }) => {
|
|
303
|
-
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
304
|
-
},
|
|
305
|
-
phase: "beforeWrite",
|
|
306
|
-
requires: ["computeStyles"]
|
|
307
|
-
}
|
|
308
|
-
: {}
|
|
276
|
+
middleware: [
|
|
277
|
+
flip(),
|
|
278
|
+
shift({ padding: this.pagePadding }),
|
|
279
|
+
...(this.offset === "medium"
|
|
280
|
+
? [offset(16)]
|
|
281
|
+
: this.offset === "small"
|
|
282
|
+
? [offset(8)]
|
|
283
|
+
: [])
|
|
309
284
|
]
|
|
285
|
+
}).then(({ x, y }) => {
|
|
286
|
+
if (this.popover) {
|
|
287
|
+
Object.assign(this.popover.style, {
|
|
288
|
+
left: `${x}px`,
|
|
289
|
+
top: `${y}px`
|
|
290
|
+
});
|
|
291
|
+
}
|
|
310
292
|
});
|
|
311
293
|
}
|
|
312
294
|
};
|