@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/dist/bbui.es.js +3 -3
- package/dist/bbui.es.js.map +1 -1
- package/package.json +4 -4
- package/src/Button/Button.svelte +7 -23
- package/src/FancyForm/FancyButtonRadio.svelte +0 -2
- package/src/Form/Core/EnvDropdown.svelte +1 -1
- package/src/Form/Core/TextField.svelte +8 -1
- package/src/Link/Link.svelte +46 -2
- package/src/Modal/ModalContent.svelte +7 -3
- package/src/Popover/Popover.svelte +1 -1
- package/src/Table/CellRenderer.svelte +0 -1
- 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.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.
|
|
42
|
-
"@budibase/string-templates": "2.8.
|
|
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": "
|
|
107
|
+
"gitHead": "88d19e6b9246a72e515777c8d60e192f7d9c9d1c"
|
|
108
108
|
}
|
package/src/Button/Button.svelte
CHANGED
|
@@ -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
|
|
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:
|
|
78
|
+
top: 100%;
|
|
79
|
+
opacity: 0;
|
|
80
|
+
transition: opacity 130ms ease-out;
|
|
81
|
+
pointer-events: none;
|
|
97
82
|
}
|
|
98
|
-
.tooltip
|
|
99
|
-
|
|
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);
|
|
@@ -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
|
|
113
|
+
inputmode={getInputMode(type)}
|
|
107
114
|
{autocomplete}
|
|
108
115
|
/>
|
|
109
116
|
</div>
|
package/src/Link/Link.svelte
CHANGED
|
@@ -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={
|
|
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}"
|
|
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)) !==
|
|
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()) !==
|
|
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()) !==
|
|
53
|
+
if (!onCancel || (await onCancel()) !== keepOpen) {
|
|
50
54
|
cancel()
|
|
51
55
|
}
|
|
52
56
|
loading = false
|
|
@@ -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 => {
|
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 } 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"
|