@budibase/bbui 1.3.12-alpha.2 → 1.3.13

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "1.3.12-alpha.2",
4
+ "version": "1.3.13",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "^1.2.1",
41
- "@budibase/string-templates": "1.3.12-alpha.2",
41
+ "@budibase/string-templates": "^1.3.13",
42
42
  "@spectrum-css/actionbutton": "^1.0.1",
43
43
  "@spectrum-css/actiongroup": "^1.0.1",
44
44
  "@spectrum-css/avatar": "^3.0.2",
@@ -85,5 +85,5 @@
85
85
  "svelte-flatpickr": "^3.2.3",
86
86
  "svelte-portal": "^1.0.0"
87
87
  },
88
- "gitHead": "76870217376710fa1a8bf554fdfcc5f446dbde6c"
88
+ "gitHead": "272a2ec7c7f2fabf74153fc8573ce6745134cdde"
89
89
  }
@@ -1,4 +1,4 @@
1
- export default function positionDropdown(element, { anchor, align, maxWidth }) {
1
+ export default function positionDropdown(element, { anchor, align }) {
2
2
  let positionSide = "top"
3
3
  let maxHeight = 0
4
4
  let dimensions = getDimensions(anchor)
@@ -34,24 +34,13 @@ export default function positionDropdown(element, { anchor, align, maxWidth }) {
34
34
  }
35
35
 
36
36
  function calcLeftPosition() {
37
- let left
38
-
39
- if (align == "right") {
40
- left = dimensions.left + dimensions.width - dimensions.containerWidth
41
- } else if (align == "right-side") {
42
- left = dimensions.left + dimensions.width
43
- } else {
44
- left = dimensions.left
45
- }
46
-
47
- return left
37
+ return align === "right"
38
+ ? dimensions.left + dimensions.width - dimensions.containerWidth
39
+ : dimensions.left
48
40
  }
49
41
 
50
42
  element.style.position = "absolute"
51
43
  element.style.zIndex = "9999"
52
- if (maxWidth) {
53
- element.style.maxWidth = `${maxWidth}px`
54
- }
55
44
  element.style.minWidth = `${dimensions.width}px`
56
45
  element.style.maxHeight = `${maxHeight.toFixed(0)}px`
57
46
  element.style.transformOrigin = `center ${positionSide}`
@@ -65,8 +54,10 @@ export default function positionDropdown(element, { anchor, align, maxWidth }) {
65
54
  element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px`
66
55
  })
67
56
  })
57
+
68
58
  resizeObserver.observe(anchor)
69
59
  resizeObserver.observe(element)
60
+
70
61
  return {
71
62
  destroy() {
72
63
  resizeObserver.disconnect()
@@ -11,7 +11,6 @@
11
11
  export let align = "right"
12
12
  export let portalTarget
13
13
  export let dataCy
14
- export let maxWidth
15
14
 
16
15
  export let direction = "bottom"
17
16
  export let showTip = false
@@ -46,7 +45,7 @@
46
45
  <Portal target={portalTarget}>
47
46
  <div
48
47
  tabindex="0"
49
- use:positionDropdown={{ anchor, align, maxWidth }}
48
+ use:positionDropdown={{ anchor, align }}
50
49
  use:clickOutside={hide}
51
50
  on:keydown={handleEscape}
52
51
  class={"spectrum-Popover is-open " + (tooltipClasses || "")}