@budibase/bbui 2.8.3-alpha.2 → 2.8.4
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/dist/bbui.es.js +3 -3
- package/dist/bbui.es.js.map +1 -1
- package/package.json +4 -4
- package/src/Button/Button.svelte +23 -7
- package/src/FancyForm/FancyButtonRadio.svelte +2 -0
- package/src/Form/Core/EnvDropdown.svelte +1 -1
- package/src/Form/Core/TextField.svelte +1 -8
- package/src/Link/Link.svelte +2 -46
- package/src/Modal/ModalContent.svelte +3 -7
- package/src/Popover/Popover.svelte +1 -1
- package/src/Table/CellRenderer.svelte +1 -0
- package/src/Table/Table.svelte +1 -1
- package/src/index.js +1 -1
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.
|
|
4
|
+
"version": "2.8.4",
|
|
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.
|
|
42
|
-
"@budibase/string-templates": "2.8.
|
|
41
|
+
"@budibase/shared-core": "2.8.4",
|
|
42
|
+
"@budibase/string-templates": "2.8.4",
|
|
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": "
|
|
107
|
+
"gitHead": "aa31749f40ba5bfc2cfb24ad6bf83ec58cff8929"
|
|
108
108
|
}
|
package/src/Button/Button.svelte
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
export let tooltip = undefined
|
|
17
17
|
export let newStyles = true
|
|
18
18
|
export let id
|
|
19
|
+
|
|
20
|
+
let showTooltip = false
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
23
|
<button
|
|
@@ -33,6 +35,9 @@
|
|
|
33
35
|
class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
|
|
34
36
|
{disabled}
|
|
35
37
|
on:click|preventDefault
|
|
38
|
+
on:mouseover={() => (showTooltip = true)}
|
|
39
|
+
on:focus={() => (showTooltip = true)}
|
|
40
|
+
on:mouseleave={() => (showTooltip = false)}
|
|
36
41
|
>
|
|
37
42
|
{#if icon}
|
|
38
43
|
<svg
|
|
@@ -47,7 +52,19 @@
|
|
|
47
52
|
{#if $$slots}
|
|
48
53
|
<span class="spectrum-Button-label"><slot /></span>
|
|
49
54
|
{/if}
|
|
50
|
-
{#if tooltip}
|
|
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}
|
|
51
68
|
<div class="tooltip">
|
|
52
69
|
<Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
|
|
53
70
|
</div>
|
|
@@ -58,6 +75,7 @@
|
|
|
58
75
|
button {
|
|
59
76
|
position: relative;
|
|
60
77
|
}
|
|
78
|
+
|
|
61
79
|
.spectrum-Button-label {
|
|
62
80
|
white-space: nowrap;
|
|
63
81
|
overflow: hidden;
|
|
@@ -75,13 +93,11 @@
|
|
|
75
93
|
text-align: center;
|
|
76
94
|
transform: translateX(-50%);
|
|
77
95
|
left: 50%;
|
|
78
|
-
top: 100
|
|
79
|
-
opacity: 0;
|
|
80
|
-
transition: opacity 130ms ease-out;
|
|
81
|
-
pointer-events: none;
|
|
96
|
+
top: calc(100% - 3px);
|
|
82
97
|
}
|
|
83
|
-
|
|
84
|
-
|
|
98
|
+
.tooltip-icon {
|
|
99
|
+
padding-left: var(--spacing-m);
|
|
100
|
+
line-height: 0;
|
|
85
101
|
}
|
|
86
102
|
.spectrum-Button--primary.new-styles {
|
|
87
103
|
background: var(--spectrum-global-color-gray-800);
|
|
@@ -62,13 +62,6 @@
|
|
|
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
|
-
|
|
72
65
|
onMount(() => {
|
|
73
66
|
focus = autofocus
|
|
74
67
|
if (focus) field.focus()
|
|
@@ -110,7 +103,7 @@
|
|
|
110
103
|
{type}
|
|
111
104
|
class="spectrum-Textfield-input"
|
|
112
105
|
style={align ? `text-align: ${align};` : ""}
|
|
113
|
-
inputmode={
|
|
106
|
+
inputmode={type === "number" ? "decimal" : "text"}
|
|
114
107
|
{autocomplete}
|
|
115
108
|
/>
|
|
116
109
|
</div>
|
package/src/Link/Link.svelte
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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"
|
|
5
4
|
|
|
6
5
|
export let href = "#"
|
|
7
6
|
export let size = "M"
|
|
@@ -11,61 +10,18 @@
|
|
|
11
10
|
export let overBackground = false
|
|
12
11
|
export let target
|
|
13
12
|
export let download
|
|
14
|
-
export let disabled = false
|
|
15
|
-
export let tooltip = null
|
|
16
13
|
|
|
17
14
|
const dispatch = createEventDispatcher()
|
|
18
|
-
|
|
19
|
-
const onClick = e => {
|
|
20
|
-
if (!disabled) {
|
|
21
|
-
dispatch("click")
|
|
22
|
-
e.stopPropagation()
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
15
|
</script>
|
|
26
16
|
|
|
27
17
|
<a
|
|
28
|
-
on:click={
|
|
18
|
+
on:click={e => dispatch("click") && e.stopPropagation()}
|
|
29
19
|
{href}
|
|
30
20
|
{target}
|
|
31
21
|
{download}
|
|
32
|
-
class:disabled
|
|
33
22
|
class:spectrum-Link--primary={primary}
|
|
34
23
|
class:spectrum-Link--secondary={secondary}
|
|
35
24
|
class:spectrum-Link--overBackground={overBackground}
|
|
36
25
|
class:spectrum-Link--quiet={quiet}
|
|
37
|
-
class="spectrum-Link spectrum-Link--size{size}"
|
|
26
|
+
class="spectrum-Link spectrum-Link--size{size}"><slot /></a
|
|
38
27
|
>
|
|
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,7 +1,3 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
export const keepOpen = Symbol("keepOpen")
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
1
|
<script>
|
|
6
2
|
import "@spectrum-css/dialog/dist/index-vars.css"
|
|
7
3
|
import { getContext } from "svelte"
|
|
@@ -34,7 +30,7 @@
|
|
|
34
30
|
|
|
35
31
|
async function secondary(e) {
|
|
36
32
|
loading = true
|
|
37
|
-
if (!secondaryAction || (await secondaryAction(e)) !==
|
|
33
|
+
if (!secondaryAction || (await secondaryAction(e)) !== false) {
|
|
38
34
|
hide()
|
|
39
35
|
}
|
|
40
36
|
loading = false
|
|
@@ -42,7 +38,7 @@
|
|
|
42
38
|
|
|
43
39
|
async function confirm() {
|
|
44
40
|
loading = true
|
|
45
|
-
if (!onConfirm || (await onConfirm()) !==
|
|
41
|
+
if (!onConfirm || (await onConfirm()) !== false) {
|
|
46
42
|
hide()
|
|
47
43
|
}
|
|
48
44
|
loading = false
|
|
@@ -50,7 +46,7 @@
|
|
|
50
46
|
|
|
51
47
|
async function close() {
|
|
52
48
|
loading = true
|
|
53
|
-
if (!onCancel || (await onCancel()) !==
|
|
49
|
+
if (!onCancel || (await onCancel()) !== false) {
|
|
54
50
|
cancel()
|
|
55
51
|
}
|
|
56
52
|
loading = false
|
|
@@ -29,6 +29,7 @@
|
|
|
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"
|
|
32
33
|
$: cellValue = getCellValue(value, schema.template)
|
|
33
34
|
|
|
34
35
|
const getType = schema => {
|
package/src/Table/Table.svelte
CHANGED
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
|
|
45
|
+
export { default as ModalContent } 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"
|