@salesforcedevs/dx-components 0.63.1 → 0.64.1-alpha.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.63.1",
3
+ "version": "0.64.1-alpha.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
- "@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",
@@ -24,6 +24,5 @@
24
24
  "@types/debounce": "^1.2.0",
25
25
  "@types/lodash.get": "^4.4.6",
26
26
  "@types/vimeo__player": "^2.16.2"
27
- },
28
- "gitHead": "68b83e9181604ceaadfda8f8466e5cee989f68eb"
27
+ }
29
28
  }
@@ -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";
@@ -70,9 +70,6 @@ export default class Popover extends LightningElement {
70
70
 
71
71
  this.dispatchEvent(new CustomEvent("open"));
72
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
73
  setTimeout(() => {
77
74
  this.setPosition();
78
75
  this.attachListenersTopopover();
@@ -279,34 +276,30 @@ export default class Popover extends LightningElement {
279
276
  private setPosition = async () => {
280
277
  if (this.popover && this.control) {
281
278
  await Promise.resolve();
282
- createPopper(this.control, this.popover, {
279
+ const popoverEl = this.popover;
280
+
281
+ computePosition(this.control, popoverEl, {
283
282
  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
- : {}
283
+ middleware: [
284
+ ...(this.fullWidth
285
+ ? [
286
+ size({
287
+ apply({ rects }) {
288
+ Object.assign(popoverEl.style, {
289
+ width: `${rects.reference.width}px`
290
+ });
291
+ }
292
+ })
293
+ ]
294
+ : []),
295
+ flip(),
296
+ shift({ padding: this.pagePadding })
309
297
  ]
298
+ }).then(({ x, y }) => {
299
+ Object.assign(popoverEl.style, {
300
+ left: `${x}px`,
301
+ top: `${y}px`
302
+ });
310
303
  });
311
304
  }
312
305
  };
package/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2020, Salesforce.com, Inc.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.