@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.0",
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": "369ff728fbf7ea16a249785a16dbc73331456a9b"
28
+ "gitHead": "2a2f653d7f778950001eacf42053e0d6c5b823d3"
29
29
  }
@@ -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
@@ -52,6 +52,14 @@
52
52
  max-width: unset;
53
53
  }
54
54
 
55
+ .popover-offset-small {
56
+ margin-top: var(--dx-g-spacing-sm);
57
+ }
58
+
59
+ .popover-offset-medium {
60
+ margin-top: var(--dx-g-spacing-md);
61
+ }
62
+
55
63
  .popover-small {
56
64
  width: 136px;
57
65
  }
@@ -5,7 +5,7 @@ import {
5
5
  PopperPlacement
6
6
  } from "typings/custom";
7
7
 
8
- import { computePosition, flip, offset, shift } from "@floating-ui/dom";
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
- computePosition(this.control, this.popover, {
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
- if (this.popover) {
287
- Object.assign(this.popover.style, {
288
- left: `${x}px`,
289
- top: `${y}px`
290
- });
291
- }
295
+ Object.assign(popoverEl.style, {
296
+ left: `${x}px`,
297
+ top: `${y}px`
298
+ });
292
299
  });
293
300
  }
294
301
  };