@salesforcedevs/dx-components 0.63.1 → 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.
|
|
3
|
+
"version": "0.64.1",
|
|
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": "2a2f653d7f778950001eacf42053e0d6c5b823d3"
|
|
29
29
|
}
|
|
@@ -47,7 +47,6 @@ export default class DropdownOption extends LightningElement {
|
|
|
47
47
|
...this.analyticsBasePayload,
|
|
48
48
|
clickText: this.keyValue || undefined,
|
|
49
49
|
itemTitle: this.option.label || undefined,
|
|
50
|
-
pageLocation: window.location.pathname,
|
|
51
50
|
clickUrl: this.option.link?.href || undefined
|
|
52
51
|
};
|
|
53
52
|
|
|
@@ -58,6 +57,7 @@ export default class DropdownOption extends LightningElement {
|
|
|
58
57
|
if (!this.suppressGtmNavHeadings) {
|
|
59
58
|
payload.navHeading = navHeading;
|
|
60
59
|
payload.navSubHeading = navSubHeading;
|
|
60
|
+
payload.pageLocation = window.location.pathname;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if (this.analyticsEvent && e.currentTarget) {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PopperPlacement
|
|
6
6
|
} from "typings/custom";
|
|
7
7
|
|
|
8
|
-
import {
|
|
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";
|
|
@@ -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
|
|
|
@@ -278,35 +272,30 @@ export default class Popover extends LightningElement {
|
|
|
278
272
|
|
|
279
273
|
private setPosition = async () => {
|
|
280
274
|
if (this.popover && this.control) {
|
|
281
|
-
|
|
282
|
-
|
|
275
|
+
const popoverEl = this.popover;
|
|
276
|
+
|
|
277
|
+
computePosition(this.control, popoverEl, {
|
|
283
278
|
placement: this.placement,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
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
|
-
: {}
|
|
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
|
+
: []),
|
|
291
|
+
flip(),
|
|
292
|
+
shift({ padding: this.pagePadding })
|
|
309
293
|
]
|
|
294
|
+
}).then(({ x, y }) => {
|
|
295
|
+
Object.assign(popoverEl.style, {
|
|
296
|
+
left: `${x}px`,
|
|
297
|
+
top: `${y}px`
|
|
298
|
+
});
|
|
310
299
|
});
|
|
311
300
|
}
|
|
312
301
|
};
|