@budibase/bbui 1.0.46 → 1.0.49-alpha.1
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/Form/Core/Dropzone.svelte +8 -1
- package/src/Form/Field.svelte +2 -1
- package/src/Form/FieldLabel.svelte +11 -6
- package/src/Form/Select.svelte +2 -1
- package/src/Label/Label.svelte +3 -56
- package/src/Tooltip/TooltipWrapper.svelte +60 -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.49-alpha.1",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"svelte-flatpickr": "^3.2.3",
|
|
83
83
|
"svelte-portal": "^1.0.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "3f8d81837dd8ba0ebf17dbd8106c3a5d3bec3e46"
|
|
86
86
|
}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
export let error = null
|
|
23
23
|
export let fileTags = []
|
|
24
24
|
export let maximum = null
|
|
25
|
+
export let extensions = "*"
|
|
25
26
|
|
|
26
27
|
const dispatch = createEventDispatcher()
|
|
27
28
|
const imageExtensions = [
|
|
@@ -146,7 +147,9 @@
|
|
|
146
147
|
<img alt="preview" src={selectedUrl} />
|
|
147
148
|
{:else}
|
|
148
149
|
<div class="placeholder">
|
|
149
|
-
<div class="extension">
|
|
150
|
+
<div class="extension">
|
|
151
|
+
{selectedImage.name || "Unknown file"}
|
|
152
|
+
</div>
|
|
150
153
|
<div>Preview not supported</div>
|
|
151
154
|
</div>
|
|
152
155
|
{/if}
|
|
@@ -207,6 +210,7 @@
|
|
|
207
210
|
{disabled}
|
|
208
211
|
type="file"
|
|
209
212
|
multiple
|
|
213
|
+
accept={extensions}
|
|
210
214
|
on:change={handleFile}
|
|
211
215
|
/>
|
|
212
216
|
<svg
|
|
@@ -357,18 +361,21 @@
|
|
|
357
361
|
white-space: nowrap;
|
|
358
362
|
width: 0;
|
|
359
363
|
margin-right: 10px;
|
|
364
|
+
user-select: all;
|
|
360
365
|
}
|
|
361
366
|
.placeholder {
|
|
362
367
|
display: flex;
|
|
363
368
|
flex-direction: column;
|
|
364
369
|
justify-content: center;
|
|
365
370
|
align-items: center;
|
|
371
|
+
text-align: center;
|
|
366
372
|
}
|
|
367
373
|
.extension {
|
|
368
374
|
color: var(--spectrum-global-color-gray-600);
|
|
369
375
|
text-transform: uppercase;
|
|
370
376
|
font-weight: 600;
|
|
371
377
|
margin-bottom: 5px;
|
|
378
|
+
user-select: all;
|
|
372
379
|
}
|
|
373
380
|
|
|
374
381
|
.nav {
|
package/src/Form/Field.svelte
CHANGED
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
export let label = null
|
|
7
7
|
export let labelPosition = "above"
|
|
8
8
|
export let error = null
|
|
9
|
+
export let tooltip = ""
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<div class="spectrum-Form-item" class:above={labelPosition === "above"}>
|
|
12
13
|
{#if label}
|
|
13
|
-
<FieldLabel forId={id} {label} position={labelPosition} />
|
|
14
|
+
<FieldLabel forId={id} {label} position={labelPosition} {tooltip} />
|
|
14
15
|
{/if}
|
|
15
16
|
<div class="spectrum-Form-itemField">
|
|
16
17
|
<slot />
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import TooltipWrapper from "../Tooltip/TooltipWrapper.svelte"
|
|
3
|
+
|
|
2
4
|
import "@spectrum-css/fieldlabel/dist/index-vars.css"
|
|
3
5
|
|
|
4
6
|
export let forId
|
|
5
7
|
export let label
|
|
6
8
|
export let position = "above"
|
|
9
|
+
export let tooltip = ""
|
|
7
10
|
|
|
8
11
|
$: className = position === "above" ? "" : `spectrum-FieldLabel--${position}`
|
|
9
12
|
</script>
|
|
10
13
|
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<TooltipWrapper {tooltip} size="S">
|
|
15
|
+
<label
|
|
16
|
+
for={forId}
|
|
17
|
+
class={`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${className}`}
|
|
18
|
+
>
|
|
19
|
+
{label || ""}
|
|
20
|
+
</label>
|
|
21
|
+
</TooltipWrapper>
|
|
17
22
|
|
|
18
23
|
<style>
|
|
19
24
|
label {
|
package/src/Form/Select.svelte
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
export let quiet = false
|
|
18
18
|
export let autoWidth = false
|
|
19
19
|
export let sort = false
|
|
20
|
+
export let tooltip = ""
|
|
20
21
|
|
|
21
22
|
const dispatch = createEventDispatcher()
|
|
22
23
|
const onChange = e => {
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
}
|
|
33
34
|
</script>
|
|
34
35
|
|
|
35
|
-
<Field {label} {labelPosition} {error}>
|
|
36
|
+
<Field {label} {labelPosition} {error} {tooltip}>
|
|
36
37
|
<Select
|
|
37
38
|
{quiet}
|
|
38
39
|
{error}
|
package/src/Label/Label.svelte
CHANGED
|
@@ -1,73 +1,20 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "@spectrum-css/fieldlabel/dist/index-vars.css"
|
|
3
|
-
import
|
|
4
|
-
import Icon from "../Icon/Icon.svelte"
|
|
3
|
+
import TooltipWrapper from "../Tooltip/TooltipWrapper.svelte"
|
|
5
4
|
|
|
6
5
|
export let size = "M"
|
|
7
6
|
export let tooltip = ""
|
|
8
|
-
export let showTooltip = false
|
|
9
7
|
</script>
|
|
10
8
|
|
|
11
|
-
{
|
|
12
|
-
<div class="container">
|
|
13
|
-
<label
|
|
14
|
-
for=""
|
|
15
|
-
class={`spectrum-FieldLabel spectrum-FieldLabel--size${size}`}
|
|
16
|
-
>
|
|
17
|
-
<slot />
|
|
18
|
-
</label>
|
|
19
|
-
<div class="icon-container">
|
|
20
|
-
<div
|
|
21
|
-
class="icon"
|
|
22
|
-
class:icon-small={size === "M" || size === "S"}
|
|
23
|
-
on:mouseover={() => (showTooltip = true)}
|
|
24
|
-
on:mouseleave={() => (showTooltip = false)}
|
|
25
|
-
>
|
|
26
|
-
<Icon name="InfoOutline" size="S" disabled={true} />
|
|
27
|
-
</div>
|
|
28
|
-
{#if showTooltip}
|
|
29
|
-
<div class="tooltip">
|
|
30
|
-
<Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
|
|
31
|
-
</div>
|
|
32
|
-
{/if}
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
{:else}
|
|
9
|
+
<TooltipWrapper {tooltip} {size}>
|
|
36
10
|
<label for="" class={`spectrum-FieldLabel spectrum-FieldLabel--size${size}`}>
|
|
37
11
|
<slot />
|
|
38
12
|
</label>
|
|
39
|
-
|
|
13
|
+
</TooltipWrapper>
|
|
40
14
|
|
|
41
15
|
<style>
|
|
42
16
|
label {
|
|
43
17
|
padding: 0;
|
|
44
18
|
white-space: nowrap;
|
|
45
19
|
}
|
|
46
|
-
.container {
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
}
|
|
50
|
-
.icon-container {
|
|
51
|
-
position: relative;
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
margin-top: 1px;
|
|
55
|
-
margin-left: 5px;
|
|
56
|
-
margin-right: 5px;
|
|
57
|
-
}
|
|
58
|
-
.tooltip {
|
|
59
|
-
position: absolute;
|
|
60
|
-
display: flex;
|
|
61
|
-
justify-content: center;
|
|
62
|
-
top: 15px;
|
|
63
|
-
z-index: 1;
|
|
64
|
-
width: 160px;
|
|
65
|
-
}
|
|
66
|
-
.icon {
|
|
67
|
-
transform: scale(0.75);
|
|
68
|
-
}
|
|
69
|
-
.icon-small {
|
|
70
|
-
margin-top: -2px;
|
|
71
|
-
margin-bottom: -5px;
|
|
72
|
-
}
|
|
73
20
|
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Tooltip from "./Tooltip.svelte"
|
|
3
|
+
import Icon from "../Icon/Icon.svelte"
|
|
4
|
+
|
|
5
|
+
export let tooltip = ""
|
|
6
|
+
export let size = "M"
|
|
7
|
+
|
|
8
|
+
let showTooltip = false
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class:container={!!tooltip}>
|
|
12
|
+
<slot />
|
|
13
|
+
{#if tooltip}
|
|
14
|
+
<div class="icon-container">
|
|
15
|
+
<div
|
|
16
|
+
class="icon"
|
|
17
|
+
class:icon-small={size === "M" || size === "S"}
|
|
18
|
+
on:mouseover={() => (showTooltip = true)}
|
|
19
|
+
on:mouseleave={() => (showTooltip = false)}
|
|
20
|
+
>
|
|
21
|
+
<Icon name="InfoOutline" size="S" disabled={true} />
|
|
22
|
+
</div>
|
|
23
|
+
{#if showTooltip}
|
|
24
|
+
<div class="tooltip">
|
|
25
|
+
<Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
28
|
+
</div>
|
|
29
|
+
{/if}
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<style>
|
|
33
|
+
.container {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
}
|
|
37
|
+
.icon-container {
|
|
38
|
+
position: relative;
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
margin-top: 1px;
|
|
42
|
+
margin-left: 5px;
|
|
43
|
+
margin-right: 5px;
|
|
44
|
+
}
|
|
45
|
+
.tooltip {
|
|
46
|
+
position: absolute;
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
top: 15px;
|
|
50
|
+
z-index: 1;
|
|
51
|
+
width: 160px;
|
|
52
|
+
}
|
|
53
|
+
.icon {
|
|
54
|
+
transform: scale(0.75);
|
|
55
|
+
}
|
|
56
|
+
.icon-small {
|
|
57
|
+
margin-top: -2px;
|
|
58
|
+
margin-bottom: -5px;
|
|
59
|
+
}
|
|
60
|
+
</style>
|