@budibase/bbui 2.6.19-alpha.39 → 2.6.19-alpha.40

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.6.19-alpha.39",
4
+ "version": "2.6.19-alpha.40",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,8 +38,8 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
41
- "@budibase/shared-core": "2.6.19-alpha.39",
42
- "@budibase/string-templates": "2.6.19-alpha.39",
41
+ "@budibase/shared-core": "2.6.19-alpha.40",
42
+ "@budibase/string-templates": "2.6.19-alpha.40",
43
43
  "@spectrum-css/accordion": "3.0.24",
44
44
  "@spectrum-css/actionbutton": "1.0.1",
45
45
  "@spectrum-css/actiongroup": "1.0.1",
@@ -104,5 +104,5 @@
104
104
  }
105
105
  }
106
106
  },
107
- "gitHead": "8d4d2b1e79361f182c0575a41d8173a03fae982e"
107
+ "gitHead": "fe1bec2ecc31ef52be7181ac6baff2cd49f5f423"
108
108
  }
@@ -56,6 +56,8 @@ export default function positionDropdown(element, opts) {
56
56
  styles.left = anchorBounds.left + anchorBounds.width - elementBounds.width
57
57
  } else if (align === "right-outside") {
58
58
  styles.left = anchorBounds.right + offset
59
+ } else if (align === "left-outside") {
60
+ styles.left = anchorBounds.left - elementBounds.width - offset
59
61
  } else {
60
62
  styles.left = anchorBounds.left
61
63
  }
@@ -3,11 +3,13 @@
3
3
  import Button from "../Button/Button.svelte"
4
4
  import Body from "../Typography/Body.svelte"
5
5
  import Heading from "../Typography/Heading.svelte"
6
+ import { setContext } from "svelte"
6
7
 
7
8
  export let title
8
9
  export let fillWidth
9
10
  export let left = "314px"
10
11
  export let width = "calc(100% - 626px)"
12
+ export let headless = false
11
13
 
12
14
  let visible = false
13
15
 
@@ -25,6 +27,11 @@
25
27
  visible = false
26
28
  }
27
29
 
30
+ setContext("drawer-actions", {
31
+ hide,
32
+ show,
33
+ })
34
+
28
35
  const easeInOutQuad = x => {
29
36
  return x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2
30
37
  }
@@ -50,18 +57,20 @@
50
57
  transition:slide|local
51
58
  style={`width: ${width}; left: ${left};`}
52
59
  >
53
- <header>
54
- <div class="text">
55
- <Heading size="XS">{title}</Heading>
56
- <Body size="S">
57
- <slot name="description" />
58
- </Body>
59
- </div>
60
- <div class="buttons">
61
- <Button secondary quiet on:click={hide}>Cancel</Button>
62
- <slot name="buttons" />
63
- </div>
64
- </header>
60
+ {#if !headless}
61
+ <header>
62
+ <div class="text">
63
+ <Heading size="XS">{title}</Heading>
64
+ <Body size="S">
65
+ <slot name="description" />
66
+ </Body>
67
+ </div>
68
+ <div class="buttons">
69
+ <Button secondary quiet on:click={hide}>Cancel</Button>
70
+ <slot name="buttons" />
71
+ </div>
72
+ </header>
73
+ {/if}
65
74
  <slot name="body" />
66
75
  </section>
67
76
  </Portal>
@@ -12,6 +12,7 @@
12
12
  export let emphasized = false
13
13
  export let onTop = false
14
14
  export let size = "M"
15
+ export let beforeSwitch = null
15
16
 
16
17
  let thisSelected = undefined
17
18
 
@@ -28,9 +29,14 @@
28
29
  thisSelected = selected
29
30
  dispatch("select", thisSelected)
30
31
  } else if ($tab.title !== thisSelected) {
31
- thisSelected = $tab.title
32
- selected = $tab.title
33
- dispatch("select", thisSelected)
32
+ if (typeof beforeSwitch == "function") {
33
+ const proceed = beforeSwitch($tab.title)
34
+ if (proceed) {
35
+ thisSelected = $tab.title
36
+ selected = $tab.title
37
+ dispatch("select", thisSelected)
38
+ }
39
+ }
34
40
  }
35
41
  if ($tab.title !== thisSelected) {
36
42
  tab.update(state => {