@budibase/bbui 1.0.62 → 1.0.66-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 +1 -1
- package/dist/bbui.es.js.map +1 -1
- package/package.json +2 -2
- package/src/Button/Button.svelte +40 -50
- package/src/Drawer/Drawer.svelte +13 -0
- package/src/Table/Table.svelte +1 -2
- package/src/helpers.js +8 -0
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": "1.0.
|
|
4
|
+
"version": "1.0.66-alpha.0",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"svelte-flatpickr": "^3.2.3",
|
|
84
84
|
"svelte-portal": "^1.0.0"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "59a2e0c10892551d07b947b8b919d883e0303f2b"
|
|
87
87
|
}
|
package/src/Button/Button.svelte
CHANGED
|
@@ -17,61 +17,55 @@
|
|
|
17
17
|
let showTooltip = false
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
<button
|
|
21
|
+
class:spectrum-Button--cta={cta}
|
|
22
|
+
class:spectrum-Button--primary={primary}
|
|
23
|
+
class:spectrum-Button--secondary={secondary}
|
|
24
|
+
class:spectrum-Button--warning={warning}
|
|
25
|
+
class:spectrum-Button--overBackground={overBackground}
|
|
26
|
+
class:spectrum-Button--quiet={quiet}
|
|
27
|
+
class:active
|
|
28
|
+
class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
|
|
29
|
+
{disabled}
|
|
30
|
+
on:click|preventDefault
|
|
31
|
+
on:mouseover={() => (showTooltip = true)}
|
|
32
|
+
on:mouseleave={() => (showTooltip = false)}
|
|
33
|
+
>
|
|
34
|
+
{#if icon}
|
|
35
|
+
<svg
|
|
36
|
+
class="spectrum-Icon spectrum-Icon--size{size.toUpperCase()}"
|
|
37
|
+
focusable="false"
|
|
38
|
+
aria-hidden="true"
|
|
39
|
+
aria-label={icon}
|
|
40
|
+
>
|
|
41
|
+
<use xlink:href="#spectrum-icon-18-{icon}" />
|
|
42
|
+
</svg>
|
|
43
|
+
{/if}
|
|
44
|
+
{#if $$slots}
|
|
45
|
+
<span class="spectrum-Button-label"><slot /></span>
|
|
46
|
+
{/if}
|
|
47
|
+
{#if !disabled && tooltip}
|
|
48
|
+
<div class="tooltip-icon">
|
|
36
49
|
<svg
|
|
37
50
|
class="spectrum-Icon spectrum-Icon--size{size.toUpperCase()}"
|
|
38
51
|
focusable="false"
|
|
39
52
|
aria-hidden="true"
|
|
40
|
-
aria-label=
|
|
53
|
+
aria-label="Info"
|
|
41
54
|
>
|
|
42
|
-
<use xlink:href="#spectrum-icon-18-
|
|
55
|
+
<use xlink:href="#spectrum-icon-18-InfoOutline" />
|
|
43
56
|
</svg>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<span class="spectrum-Button-label"><slot /></span>
|
|
47
|
-
{/if}
|
|
48
|
-
{#if !disabled && tooltip}
|
|
49
|
-
<div class="tooltip-icon">
|
|
50
|
-
<svg
|
|
51
|
-
class="spectrum-Icon spectrum-Icon--size{size.toUpperCase()}"
|
|
52
|
-
focusable="false"
|
|
53
|
-
aria-hidden="true"
|
|
54
|
-
aria-label="Info"
|
|
55
|
-
>
|
|
56
|
-
<use xlink:href="#spectrum-icon-18-InfoOutline" />
|
|
57
|
-
</svg>
|
|
58
|
-
</div>
|
|
59
|
-
{/if}
|
|
60
|
-
</button>
|
|
57
|
+
</div>
|
|
58
|
+
{/if}
|
|
61
59
|
{#if showTooltip && tooltip}
|
|
62
|
-
<div class="
|
|
63
|
-
<
|
|
64
|
-
<Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
|
|
65
|
-
</div>
|
|
60
|
+
<div class="tooltip">
|
|
61
|
+
<Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
|
|
66
62
|
</div>
|
|
67
63
|
{/if}
|
|
68
|
-
</
|
|
64
|
+
</button>
|
|
69
65
|
|
|
70
66
|
<style>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
align-items: center;
|
|
74
|
-
flex-direction: column;
|
|
67
|
+
button {
|
|
68
|
+
position: relative;
|
|
75
69
|
}
|
|
76
70
|
.spectrum-Button-label {
|
|
77
71
|
white-space: nowrap;
|
|
@@ -89,12 +83,8 @@
|
|
|
89
83
|
width: 160px;
|
|
90
84
|
text-align: center;
|
|
91
85
|
transform: translateX(-50%);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.position {
|
|
95
|
-
position: relative;
|
|
96
|
-
width: 0;
|
|
97
|
-
height: 0;
|
|
86
|
+
left: 50%;
|
|
87
|
+
top: calc(100% - 3px);
|
|
98
88
|
}
|
|
99
89
|
.tooltip-icon {
|
|
100
90
|
padding-left: var(--spacing-m);
|
package/src/Drawer/Drawer.svelte
CHANGED
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
{/if}
|
|
45
45
|
|
|
46
46
|
<style>
|
|
47
|
+
.buttons {
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: var(--spacing-m);
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
.drawer {
|
|
48
53
|
position: absolute;
|
|
49
54
|
bottom: 0;
|
|
@@ -74,4 +79,12 @@
|
|
|
74
79
|
align-items: flex-start;
|
|
75
80
|
gap: var(--spacing-xs);
|
|
76
81
|
}
|
|
82
|
+
|
|
83
|
+
.buttons {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: row;
|
|
86
|
+
justify-content: flex-start;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: var(--spacing-m);
|
|
89
|
+
}
|
|
77
90
|
</style>
|
package/src/Table/Table.svelte
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
import "@spectrum-css/table/dist/index-vars.css"
|
|
4
4
|
import CellRenderer from "./CellRenderer.svelte"
|
|
5
5
|
import SelectEditRenderer from "./SelectEditRenderer.svelte"
|
|
6
|
-
import { cloneDeep } from "
|
|
7
|
-
import { deepGet } from "../helpers"
|
|
6
|
+
import { cloneDeep, deepGet } from "../helpers"
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* The expected schema is our normal couch schemas for our tables.
|
package/src/helpers.js
CHANGED
|
@@ -98,3 +98,11 @@ export const deepSet = (obj, key, value) => {
|
|
|
98
98
|
}
|
|
99
99
|
obj[split[split.length - 1]] = value
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Deeply clones an object. Functions are not supported.
|
|
104
|
+
* @param obj the object to clone
|
|
105
|
+
*/
|
|
106
|
+
export const cloneDeep = obj => {
|
|
107
|
+
return JSON.parse(JSON.stringify(obj))
|
|
108
|
+
}
|