@budibase/bbui 2.8.2 → 2.8.3-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,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.8.2",
4
+ "version": "2.8.3-alpha.0",
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.8.2",
42
- "@budibase/string-templates": "2.8.2",
41
+ "@budibase/shared-core": "2.8.3-alpha.0",
42
+ "@budibase/string-templates": "2.8.3-alpha.0",
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": "d82aae5c757facafd523e57d19a62048cf1ee57e"
107
+ "gitHead": "88d19e6b9246a72e515777c8d60e192f7d9c9d1c"
108
108
  }
@@ -16,8 +16,6 @@
16
16
  export let tooltip = undefined
17
17
  export let newStyles = true
18
18
  export let id
19
-
20
- let showTooltip = false
21
19
  </script>
22
20
 
23
21
  <button
@@ -35,9 +33,6 @@
35
33
  class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
36
34
  {disabled}
37
35
  on:click|preventDefault
38
- on:mouseover={() => (showTooltip = true)}
39
- on:focus={() => (showTooltip = true)}
40
- on:mouseleave={() => (showTooltip = false)}
41
36
  >
42
37
  {#if icon}
43
38
  <svg
@@ -52,19 +47,7 @@
52
47
  {#if $$slots}
53
48
  <span class="spectrum-Button-label"><slot /></span>
54
49
  {/if}
55
- {#if !disabled && tooltip}
56
- <div class="tooltip-icon">
57
- <svg
58
- class="spectrum-Icon spectrum-Icon--size{size.toUpperCase()}"
59
- focusable="false"
60
- aria-hidden="true"
61
- aria-label="Info"
62
- >
63
- <use xlink:href="#spectrum-icon-18-InfoOutline" />
64
- </svg>
65
- </div>
66
- {/if}
67
- {#if showTooltip && tooltip}
50
+ {#if tooltip}
68
51
  <div class="tooltip">
69
52
  <Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
70
53
  </div>
@@ -75,7 +58,6 @@
75
58
  button {
76
59
  position: relative;
77
60
  }
78
-
79
61
  .spectrum-Button-label {
80
62
  white-space: nowrap;
81
63
  overflow: hidden;
@@ -93,11 +75,13 @@
93
75
  text-align: center;
94
76
  transform: translateX(-50%);
95
77
  left: 50%;
96
- top: calc(100% - 3px);
78
+ top: 100%;
79
+ opacity: 0;
80
+ transition: opacity 130ms ease-out;
81
+ pointer-events: none;
97
82
  }
98
- .tooltip-icon {
99
- padding-left: var(--spacing-m);
100
- line-height: 0;
83
+ button:hover .tooltip {
84
+ opacity: 1;
101
85
  }
102
86
  .spectrum-Button--primary.new-styles {
103
87
  background: var(--spectrum-global-color-gray-800);
@@ -15,8 +15,6 @@
15
15
 
16
16
  const dispatch = createEventDispatcher()
17
17
 
18
- $: placeholder = !value
19
-
20
18
  const extractProperty = (value, property) => {
21
19
  if (value && typeof value === "object") {
22
20
  return value[property]
@@ -150,7 +150,7 @@
150
150
  </div>
151
151
  {:else if variables.length}
152
152
  <div style="max-height: 100px">
153
- {#each variables as variable, idx}
153
+ {#each variables as variable}
154
154
  <li
155
155
  class="spectrum-Menu-item"
156
156
  role="option"
@@ -62,6 +62,13 @@
62
62
  }
63
63
  }
64
64
 
65
+ const getInputMode = type => {
66
+ if (type === "bigint") {
67
+ return "numeric"
68
+ }
69
+ return type === "number" ? "decimal" : "text"
70
+ }
71
+
65
72
  onMount(() => {
66
73
  focus = autofocus
67
74
  if (focus) field.focus()
@@ -103,7 +110,7 @@
103
110
  {type}
104
111
  class="spectrum-Textfield-input"
105
112
  style={align ? `text-align: ${align};` : ""}
106
- inputmode={type === "number" ? "decimal" : "text"}
113
+ inputmode={getInputMode(type)}
107
114
  {autocomplete}
108
115
  />
109
116
  </div>
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import "@spectrum-css/link/dist/index-vars.css"
3
3
  import { createEventDispatcher } from "svelte"
4
+ import Tooltip from "../Tooltip/Tooltip.svelte"
4
5
 
5
6
  export let href = "#"
6
7
  export let size = "M"
@@ -10,18 +11,61 @@
10
11
  export let overBackground = false
11
12
  export let target
12
13
  export let download
14
+ export let disabled = false
15
+ export let tooltip = null
13
16
 
14
17
  const dispatch = createEventDispatcher()
18
+
19
+ const onClick = e => {
20
+ if (!disabled) {
21
+ dispatch("click")
22
+ e.stopPropagation()
23
+ }
24
+ }
15
25
  </script>
16
26
 
17
27
  <a
18
- on:click={e => dispatch("click") && e.stopPropagation()}
28
+ on:click={onClick}
19
29
  {href}
20
30
  {target}
21
31
  {download}
32
+ class:disabled
22
33
  class:spectrum-Link--primary={primary}
23
34
  class:spectrum-Link--secondary={secondary}
24
35
  class:spectrum-Link--overBackground={overBackground}
25
36
  class:spectrum-Link--quiet={quiet}
26
- class="spectrum-Link spectrum-Link--size{size}"><slot /></a
37
+ class="spectrum-Link spectrum-Link--size{size}"
27
38
  >
39
+ <slot />
40
+ {#if tooltip}
41
+ <div class="tooltip">
42
+ <Tooltip textWrapping direction="bottom" text={tooltip} />
43
+ </div>
44
+ {/if}
45
+ </a>
46
+
47
+ <style>
48
+ a {
49
+ position: relative;
50
+ }
51
+ a.disabled {
52
+ color: var(--spectrum-global-color-gray-500);
53
+ }
54
+ a.disabled:hover {
55
+ text-decoration: none;
56
+ cursor: default;
57
+ }
58
+ .tooltip {
59
+ position: absolute;
60
+ left: 50%;
61
+ top: 100%;
62
+ transform: translateX(-50%);
63
+ opacity: 0;
64
+ transition: 130ms ease-out;
65
+ pointer-events: none;
66
+ z-index: 100;
67
+ }
68
+ a:hover .tooltip {
69
+ opacity: 1;
70
+ }
71
+ </style>
@@ -1,3 +1,7 @@
1
+ <script context="module">
2
+ export const keepOpen = Symbol("keepOpen")
3
+ </script>
4
+
1
5
  <script>
2
6
  import "@spectrum-css/dialog/dist/index-vars.css"
3
7
  import { getContext } from "svelte"
@@ -30,7 +34,7 @@
30
34
 
31
35
  async function secondary(e) {
32
36
  loading = true
33
- if (!secondaryAction || (await secondaryAction(e)) !== false) {
37
+ if (!secondaryAction || (await secondaryAction(e)) !== keepOpen) {
34
38
  hide()
35
39
  }
36
40
  loading = false
@@ -38,7 +42,7 @@
38
42
 
39
43
  async function confirm() {
40
44
  loading = true
41
- if (!onConfirm || (await onConfirm()) !== false) {
45
+ if (!onConfirm || (await onConfirm()) !== keepOpen) {
42
46
  hide()
43
47
  }
44
48
  loading = false
@@ -46,7 +50,7 @@
46
50
 
47
51
  async function close() {
48
52
  loading = true
49
- if (!onCancel || (await onCancel()) !== false) {
53
+ if (!onCancel || (await onCancel()) !== keepOpen) {
50
54
  cancel()
51
55
  }
52
56
  loading = false
@@ -90,6 +90,6 @@
90
90
  .spectrum-Popover {
91
91
  min-width: var(--spectrum-global-dimension-size-2000);
92
92
  border-color: var(--spectrum-global-color-gray-300);
93
- overflow: auto;
93
+ overflow: visible;
94
94
  }
95
95
  </style>
@@ -29,7 +29,6 @@
29
29
  $: type = getType(schema)
30
30
  $: customRenderer = customRenderers?.find(x => x.column === schema?.name)
31
31
  $: renderer = customRenderer?.component ?? typeMap[type] ?? StringRenderer
32
- $: width = schema?.width || "150px"
33
32
  $: cellValue = getCellValue(value, schema.template)
34
33
 
35
34
  const getType = schema => {
@@ -379,7 +379,7 @@
379
379
  </div>
380
380
  {/if}
381
381
  {#if sortedRows?.length}
382
- {#each sortedRows as row, idx}
382
+ {#each sortedRows as row}
383
383
  <div class="spectrum-Table-row" class:clickable={allowClickRows}>
384
384
  {#if showEditColumn}
385
385
  <div
package/src/index.js CHANGED
@@ -42,7 +42,7 @@ export { default as MenuSection } from "./Menu/Section.svelte"
42
42
  export { default as MenuSeparator } from "./Menu/Separator.svelte"
43
43
  export { default as MenuItem } from "./Menu/Item.svelte"
44
44
  export { default as Modal } from "./Modal/Modal.svelte"
45
- export { default as ModalContent } from "./Modal/ModalContent.svelte"
45
+ export { default as ModalContent, keepOpen } from "./Modal/ModalContent.svelte"
46
46
  export { default as NotificationDisplay } from "./Notification/NotificationDisplay.svelte"
47
47
  export { default as Notification } from "./Notification/Notification.svelte"
48
48
  export { default as SideNavigation } from "./SideNavigation/Navigation.svelte"