@budibase/bbui 1.3.13 → 1.3.15-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/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.3.
|
|
4
|
+
"version": "1.3.15-alpha.1",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
|
|
41
|
-
"@budibase/string-templates": "
|
|
41
|
+
"@budibase/string-templates": "1.3.15-alpha.1",
|
|
42
42
|
"@spectrum-css/actionbutton": "^1.0.1",
|
|
43
43
|
"@spectrum-css/actiongroup": "^1.0.1",
|
|
44
44
|
"@spectrum-css/avatar": "^3.0.2",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"svelte-flatpickr": "^3.2.3",
|
|
86
86
|
"svelte-portal": "^1.0.0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "a92a8ed882cde62db5903d495112e202173defc7"
|
|
89
89
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function positionDropdown(element, { anchor, align }) {
|
|
1
|
+
export default function positionDropdown(element, { anchor, align, maxWidth }) {
|
|
2
2
|
let positionSide = "top"
|
|
3
3
|
let maxHeight = 0
|
|
4
4
|
let dimensions = getDimensions(anchor)
|
|
@@ -34,13 +34,24 @@ export default function positionDropdown(element, { anchor, align }) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function calcLeftPosition() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
let left
|
|
38
|
+
|
|
39
|
+
if (align == "right") {
|
|
40
|
+
left = dimensions.left + dimensions.width - dimensions.containerWidth
|
|
41
|
+
} else if (align == "right-side") {
|
|
42
|
+
left = dimensions.left + dimensions.width
|
|
43
|
+
} else {
|
|
44
|
+
left = dimensions.left
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return left
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
element.style.position = "absolute"
|
|
43
51
|
element.style.zIndex = "9999"
|
|
52
|
+
if (maxWidth) {
|
|
53
|
+
element.style.maxWidth = `${maxWidth}px`
|
|
54
|
+
}
|
|
44
55
|
element.style.minWidth = `${dimensions.width}px`
|
|
45
56
|
element.style.maxHeight = `${maxHeight.toFixed(0)}px`
|
|
46
57
|
element.style.transformOrigin = `center ${positionSide}`
|
|
@@ -54,10 +65,8 @@ export default function positionDropdown(element, { anchor, align }) {
|
|
|
54
65
|
element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px`
|
|
55
66
|
})
|
|
56
67
|
})
|
|
57
|
-
|
|
58
68
|
resizeObserver.observe(anchor)
|
|
59
69
|
resizeObserver.observe(element)
|
|
60
|
-
|
|
61
70
|
return {
|
|
62
71
|
destroy() {
|
|
63
72
|
resizeObserver.disconnect()
|
package/src/Label/Label.svelte
CHANGED
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
export let size = "M"
|
|
6
6
|
export let tooltip = ""
|
|
7
|
+
export let muted
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<TooltipWrapper {tooltip} {size}>
|
|
10
|
-
<label
|
|
11
|
+
<label
|
|
12
|
+
class:muted
|
|
13
|
+
for=""
|
|
14
|
+
class={`spectrum-FieldLabel spectrum-FieldLabel--size${size}`}
|
|
15
|
+
>
|
|
11
16
|
<slot />
|
|
12
17
|
</label>
|
|
13
18
|
</TooltipWrapper>
|
|
@@ -17,4 +22,8 @@
|
|
|
17
22
|
padding: 0;
|
|
18
23
|
white-space: nowrap;
|
|
19
24
|
}
|
|
25
|
+
|
|
26
|
+
.muted {
|
|
27
|
+
opacity: 0.5;
|
|
28
|
+
}
|
|
20
29
|
</style>
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
export let secondaryAction = undefined
|
|
25
25
|
export let secondaryButtonWarning = false
|
|
26
26
|
export let dataCy = null
|
|
27
|
-
|
|
28
27
|
const { hide, cancel } = getContext(Context.Modal)
|
|
29
28
|
let loading = false
|
|
30
29
|
$: confirmDisabled = disabled || loading
|
|
@@ -88,12 +87,11 @@
|
|
|
88
87
|
<section class="spectrum-Dialog-content content-grid">
|
|
89
88
|
<slot />
|
|
90
89
|
</section>
|
|
91
|
-
{#if showCancelButton || showConfirmButton}
|
|
90
|
+
{#if showCancelButton || showConfirmButton || $$slots.footer}
|
|
92
91
|
<div
|
|
93
92
|
class="spectrum-ButtonGroup spectrum-Dialog-buttonGroup spectrum-Dialog-buttonGroup--noFooter"
|
|
94
93
|
>
|
|
95
94
|
<slot name="footer" />
|
|
96
|
-
|
|
97
95
|
{#if showSecondaryButton && secondaryButtonText && secondaryAction}
|
|
98
96
|
<div class="secondary-action">
|
|
99
97
|
<Button
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
export let align = "right"
|
|
12
12
|
export let portalTarget
|
|
13
13
|
export let dataCy
|
|
14
|
+
export let maxWidth
|
|
14
15
|
|
|
15
16
|
export let direction = "bottom"
|
|
16
17
|
export let showTip = false
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
<Portal target={portalTarget}>
|
|
46
47
|
<div
|
|
47
48
|
tabindex="0"
|
|
48
|
-
use:positionDropdown={{ anchor, align }}
|
|
49
|
+
use:positionDropdown={{ anchor, align, maxWidth }}
|
|
49
50
|
use:clickOutside={hide}
|
|
50
51
|
on:keydown={handleEscape}
|
|
51
52
|
class={"spectrum-Popover is-open " + (tooltipClasses || "")}
|
package/src/Tabs/Tabs.svelte
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
export let noHorizPadding = false
|
|
11
11
|
export let quiet = false
|
|
12
12
|
export let emphasized = false
|
|
13
|
+
export let onTop = false
|
|
13
14
|
export let size = "M"
|
|
14
15
|
|
|
15
16
|
let thisSelected = undefined
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
bind:this={container}
|
|
76
77
|
class:spectrum-Tabs--quiet={quiet}
|
|
77
78
|
class:noHorizPadding
|
|
79
|
+
class:onTop
|
|
78
80
|
class:spectrum-Tabs--vertical={vertical}
|
|
79
81
|
class:spectrum-Tabs--horizontal={!vertical}
|
|
80
82
|
class="spectrum-Tabs spectrum-Tabs--size{size}"
|
|
@@ -122,4 +124,7 @@
|
|
|
122
124
|
.noPadding {
|
|
123
125
|
margin: 0;
|
|
124
126
|
}
|
|
127
|
+
.onTop {
|
|
128
|
+
z-index: 100;
|
|
129
|
+
}
|
|
125
130
|
</style>
|