@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.63.1",
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
- "@popperjs/core": "2.9.1",
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": "68b83e9181604ceaadfda8f8466e5cee989f68eb"
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) {
@@ -273,7 +273,7 @@ footer.signup-variant-no-signup {
273
273
  @media screen and (min-width: 1400px) {
274
274
  .content-container_top_large {
275
275
  /* takes into account the background assets' h:w ratio */
276
- height: 32vw;
276
+ height: 38vw;
277
277
  }
278
278
  }
279
279
 
@@ -40,7 +40,6 @@
40
40
  <dx-dropdown
41
41
  options={suggestions}
42
42
  open={isDropdownOpen}
43
- placement="bottom-end"
44
43
  onrequestclose={onDropdownRequestClose}
45
44
  offset="small"
46
45
  full-width
@@ -9,7 +9,9 @@
9
9
  }
10
10
 
11
11
  .popover-container {
12
- position: fixed;
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;
@@ -5,7 +5,7 @@ import {
5
5
  PopperPlacement
6
6
  } from "typings/custom";
7
7
 
8
- import { createPopper } from "@popperjs/core";
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
- // awaiting .popover-container to receive 'visibility: visible;' in order to execute functions on it;
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
- await Promise.resolve();
282
- createPopper(this.control, this.popover, {
275
+ const popoverEl = this.popover;
276
+
277
+ computePosition(this.control, popoverEl, {
283
278
  placement: this.placement,
284
- modifiers: [
285
- {
286
- name: "preventOverflow",
287
- options: {
288
- boundary: document.documentElement,
289
- padding: this.pagePadding
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
- : {}
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
  };