@budibase/bbui 2.2.12-alpha.51 → 2.2.12-alpha.53

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": "2.2.12-alpha.51",
4
+ "version": "2.2.12-alpha.53",
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": "2.2.12-alpha.51",
41
+ "@budibase/string-templates": "2.2.12-alpha.53",
42
42
  "@spectrum-css/accordion": "3.0.24",
43
43
  "@spectrum-css/actionbutton": "1.0.1",
44
44
  "@spectrum-css/actiongroup": "1.0.1",
@@ -89,5 +89,5 @@
89
89
  "resolutions": {
90
90
  "loader-utils": "1.4.1"
91
91
  },
92
- "gitHead": "70bd5e3f4b13b1a5f41f1309f3944cbeca51535e"
92
+ "gitHead": "d8667feccf14869cffcd4570c9a4d45c3f647621"
93
93
  }
@@ -86,7 +86,7 @@
86
86
  margin-left: 0;
87
87
  transition: color ease-out 130ms;
88
88
  }
89
- .is-selected:not(.spectrum-ActionButton--emphasized) {
89
+ .is-selected:not(.spectrum-ActionButton--emphasized):not(.spectrum-ActionButton--quiet) {
90
90
  background: var(--spectrum-global-color-gray-300);
91
91
  border-color: var(--spectrum-global-color-gray-700);
92
92
  }
@@ -16,10 +16,10 @@ export default function positionDropdown(
16
16
  top: null,
17
17
  }
18
18
 
19
- let popoverLeftPad = 20
20
-
21
19
  // Determine vertical styles
22
- if (window.innerHeight - anchorBounds.bottom < 100) {
20
+ if (align === "right-outside") {
21
+ styles.top = anchorBounds.top
22
+ } else if (window.innerHeight - anchorBounds.bottom < 100) {
23
23
  styles.top = anchorBounds.top - elementBounds.height - 5
24
24
  } else {
25
25
  styles.top = anchorBounds.bottom + 5
@@ -34,15 +34,9 @@ export default function positionDropdown(
34
34
  styles.minWidth = anchorBounds.width
35
35
  }
36
36
  if (align === "right") {
37
- let left =
38
- anchorBounds.left + anchorBounds.width / 2 - elementBounds.width
39
- // Accommodate margin on popover: 1.25rem; ~20px
40
- if (left + elementBounds.width + popoverLeftPad > window.innerWidth) {
41
- left -= 20
42
- }
43
- styles.left = left
44
- } else if (align === "right-side") {
45
- styles.left = anchorBounds.left + anchorBounds.width
37
+ styles.left = anchorBounds.left + anchorBounds.width - elementBounds.width
38
+ } else if (align === "right-outside") {
39
+ styles.left = anchorBounds.right + 10
46
40
  } else {
47
41
  styles.left = anchorBounds.left
48
42
  }
@@ -247,10 +247,6 @@
247
247
  width: 100%;
248
248
  }
249
249
 
250
- .no-variables-height {
251
- height: 100px;
252
- }
253
-
254
250
  .no-variables-text {
255
251
  padding: var(--spacing-m);
256
252
  color: var(--spectrum-global-color-gray-600);
@@ -15,15 +15,10 @@
15
15
  export let portalTarget
16
16
  export let dataCy
17
17
  export let maxWidth
18
- export let direction = "bottom"
19
- export let showTip = false
20
18
  export let open = false
21
19
  export let useAnchorWidth = false
22
20
  export let dismissible = true
23
21
 
24
- $: tooltipClasses = showTip
25
- ? `spectrum-Popover--withTip spectrum-Popover--${direction}`
26
- : ""
27
22
  $: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
28
23
 
29
24
  export const show = () => {
@@ -62,29 +57,31 @@
62
57
  </script>
63
58
 
64
59
  {#if open}
65
- <Portal {target}>
66
- <div
67
- tabindex="0"
68
- use:positionDropdown={{
69
- anchor,
70
- align,
71
- maxWidth,
72
- useAnchorWidth,
73
- showTip: false,
74
- }}
75
- use:clickOutside={{
76
- callback: dismissible ? handleOutsideClick : () => {},
77
- anchor,
78
- }}
79
- on:keydown={handleEscape}
80
- class={"spectrum-Popover is-open " + (tooltipClasses || "")}
81
- role="presentation"
82
- data-cy={dataCy}
83
- transition:fly|local={{ y: -20, duration: 200 }}
84
- >
85
- <slot />
86
- </div>
87
- </Portal>
60
+ {#key anchor}
61
+ <Portal {target}>
62
+ <div
63
+ tabindex="0"
64
+ use:positionDropdown={{
65
+ anchor,
66
+ align,
67
+ maxWidth,
68
+ useAnchorWidth,
69
+ showTip: false,
70
+ }}
71
+ use:clickOutside={{
72
+ callback: dismissible ? handleOutsideClick : () => {},
73
+ anchor,
74
+ }}
75
+ on:keydown={handleEscape}
76
+ class="spectrum-Popover is-open"
77
+ role="presentation"
78
+ data-cy={dataCy}
79
+ transition:fly|local={{ y: -20, duration: 200 }}
80
+ >
81
+ <slot />
82
+ </div>
83
+ </Portal>
84
+ {/key}
88
85
  {/if}
89
86
 
90
87
  <style>
@@ -93,13 +90,4 @@
93
90
  border-color: var(--spectrum-global-color-gray-300);
94
91
  overflow: auto;
95
92
  }
96
- .spectrum-Popover.is-open.spectrum-Popover--withTip {
97
- margin-top: var(--spacing-xs);
98
- margin-left: var(--spacing-xl);
99
- }
100
- :global(.spectrum-Popover--bottom .spectrum-Popover-tip),
101
- :global(.spectrum-Popover--top .spectrum-Popover-tip) {
102
- left: 90%;
103
- margin-left: calc(var(--spectrum-global-dimension-size-150) * -1);
104
- }
105
93
  </style>