@budibase/bbui 2.5.5 → 2.5.6-alpha.10
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 +2 -8
- package/dist/bbui.es.js.map +1 -1
- package/package.json +5 -5
- package/src/ActionButton/ActionButton.svelte +1 -1
- package/src/Actions/click_outside.js +4 -0
- package/src/Actions/position_dropdown.js +11 -3
- package/src/Form/Core/Dropzone.svelte +22 -1
- package/src/Form/Core/Multiselect.svelte +5 -4
- package/src/Form/Dropzone.svelte +2 -0
- package/src/Label/Label.svelte +1 -0
- package/src/Popover/Popover.svelte +4 -1
- package/src/Table/ArrayRenderer.svelte +3 -2
- package/src/Table/Table.svelte +1 -1
- package/src/Typography/Body.svelte +1 -0
- package/src/Typography/Heading.svelte +1 -0
- package/src/bbui.css +19 -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.5.
|
|
4
|
+
"version": "2.5.6-alpha.10",
|
|
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": "
|
|
42
|
-
"@budibase/string-templates": "
|
|
41
|
+
"@budibase/shared-core": "2.5.6-alpha.10",
|
|
42
|
+
"@budibase/string-templates": "2.5.6-alpha.10",
|
|
43
43
|
"@spectrum-css/accordion": "3.0.24",
|
|
44
44
|
"@spectrum-css/actionbutton": "1.0.1",
|
|
45
45
|
"@spectrum-css/actiongroup": "1.0.1",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"@spectrum-css/vars": "3.0.1",
|
|
85
85
|
"dayjs": "^1.10.4",
|
|
86
86
|
"easymde": "^2.16.1",
|
|
87
|
-
"svelte-flatpickr": "^3.2
|
|
87
|
+
"svelte-flatpickr": "^3.3.2",
|
|
88
88
|
"svelte-portal": "^1.0.0"
|
|
89
89
|
},
|
|
90
90
|
"resolutions": {
|
|
91
91
|
"loader-utils": "1.4.1"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "5cd18e57d5c371d2dc375e20469f123e81aaec13"
|
|
94
94
|
}
|
|
@@ -6,6 +6,9 @@ let clickHandlers = []
|
|
|
6
6
|
*/
|
|
7
7
|
const handleClick = event => {
|
|
8
8
|
// Ignore click if this is an ignored class
|
|
9
|
+
if (event.target.closest('[data-ignore-click-outside="true"]')) {
|
|
10
|
+
return
|
|
11
|
+
}
|
|
9
12
|
for (let className of ignoredClasses) {
|
|
10
13
|
if (event.target.closest(className)) {
|
|
11
14
|
return
|
|
@@ -29,6 +32,7 @@ const handleClick = event => {
|
|
|
29
32
|
})
|
|
30
33
|
}
|
|
31
34
|
document.documentElement.addEventListener("click", handleClick, true)
|
|
35
|
+
document.documentElement.addEventListener("contextmenu", handleClick, true)
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
38
|
* Adds or updates a click handler
|
|
@@ -10,7 +10,14 @@ export default function positionDropdown(element, opts) {
|
|
|
10
10
|
|
|
11
11
|
// Updates the position of the dropdown
|
|
12
12
|
const updatePosition = opts => {
|
|
13
|
-
const {
|
|
13
|
+
const {
|
|
14
|
+
anchor,
|
|
15
|
+
align,
|
|
16
|
+
maxHeight,
|
|
17
|
+
maxWidth,
|
|
18
|
+
useAnchorWidth,
|
|
19
|
+
offset = 5,
|
|
20
|
+
} = opts
|
|
14
21
|
if (!anchor) {
|
|
15
22
|
return
|
|
16
23
|
}
|
|
@@ -31,10 +38,11 @@ export default function positionDropdown(element, opts) {
|
|
|
31
38
|
styles.top = anchorBounds.top
|
|
32
39
|
} else if (window.innerHeight - anchorBounds.bottom < 100) {
|
|
33
40
|
styles.top = anchorBounds.top - elementBounds.height - offset
|
|
34
|
-
styles.maxHeight = 240
|
|
41
|
+
styles.maxHeight = maxHeight || 240
|
|
35
42
|
} else {
|
|
36
43
|
styles.top = anchorBounds.bottom + offset
|
|
37
|
-
styles.maxHeight =
|
|
44
|
+
styles.maxHeight =
|
|
45
|
+
maxHeight || window.innerHeight - anchorBounds.bottom - 20
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
// Determine horizontal styles
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
}
|
|
139
139
|
</script>
|
|
140
140
|
|
|
141
|
-
<div class="container">
|
|
141
|
+
<div class="container" class:compact>
|
|
142
142
|
{#if selectedImage}
|
|
143
143
|
{#if gallery}
|
|
144
144
|
<div class="gallery">
|
|
@@ -355,6 +355,9 @@
|
|
|
355
355
|
input[type="file"] {
|
|
356
356
|
display: none;
|
|
357
357
|
}
|
|
358
|
+
.compact .spectrum-Dropzone {
|
|
359
|
+
padding: 6px 0 !important;
|
|
360
|
+
}
|
|
358
361
|
|
|
359
362
|
.gallery {
|
|
360
363
|
display: flex;
|
|
@@ -379,6 +382,17 @@
|
|
|
379
382
|
object-fit: contain;
|
|
380
383
|
margin: 20px 30px;
|
|
381
384
|
}
|
|
385
|
+
.compact .placeholder,
|
|
386
|
+
.compact img {
|
|
387
|
+
margin: 10px 16px;
|
|
388
|
+
}
|
|
389
|
+
.compact img {
|
|
390
|
+
height: 90px;
|
|
391
|
+
}
|
|
392
|
+
.compact .gallery {
|
|
393
|
+
padding: 6px 10px;
|
|
394
|
+
margin-bottom: 8px;
|
|
395
|
+
}
|
|
382
396
|
.title {
|
|
383
397
|
display: flex;
|
|
384
398
|
flex-direction: row;
|
|
@@ -447,6 +461,13 @@
|
|
|
447
461
|
.disabled .spectrum-Heading--sizeL {
|
|
448
462
|
color: var(--spectrum-alias-text-color-disabled);
|
|
449
463
|
}
|
|
464
|
+
.compact .spectrum-Dropzone {
|
|
465
|
+
padding-top: 8px;
|
|
466
|
+
padding-bottom: 8px;
|
|
467
|
+
}
|
|
468
|
+
.compact .spectrum-IllustratedMessage-description {
|
|
469
|
+
margin: 0;
|
|
470
|
+
}
|
|
450
471
|
|
|
451
472
|
.tags {
|
|
452
473
|
margin-top: 20px;
|
|
@@ -20,12 +20,13 @@
|
|
|
20
20
|
|
|
21
21
|
const dispatch = createEventDispatcher()
|
|
22
22
|
|
|
23
|
-
$:
|
|
23
|
+
$: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
|
|
24
|
+
$: selectedLookupMap = getSelectedLookupMap(arrayValue)
|
|
24
25
|
$: optionLookupMap = getOptionLookupMap(options)
|
|
25
26
|
|
|
26
|
-
$: fieldText = getFieldText(
|
|
27
|
+
$: fieldText = getFieldText(arrayValue, optionLookupMap, placeholder)
|
|
27
28
|
$: isOptionSelected = optionValue => selectedLookupMap[optionValue] === true
|
|
28
|
-
$: toggleOption = makeToggleOption(selectedLookupMap,
|
|
29
|
+
$: toggleOption = makeToggleOption(selectedLookupMap, arrayValue)
|
|
29
30
|
|
|
30
31
|
const getFieldText = (value, map, placeholder) => {
|
|
31
32
|
if (Array.isArray(value) && value.length > 0) {
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
{readonly}
|
|
85
86
|
{fieldText}
|
|
86
87
|
{options}
|
|
87
|
-
isPlaceholder={!
|
|
88
|
+
isPlaceholder={!arrayValue.length}
|
|
88
89
|
{autocomplete}
|
|
89
90
|
bind:fetchTerm
|
|
90
91
|
{useFetch}
|
package/src/Form/Dropzone.svelte
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
export let gallery = true
|
|
17
17
|
export let fileTags = []
|
|
18
18
|
export let maximum = undefined
|
|
19
|
+
export let compact = false
|
|
19
20
|
|
|
20
21
|
const dispatch = createEventDispatcher()
|
|
21
22
|
const onChange = e => {
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
{gallery}
|
|
38
39
|
{fileTags}
|
|
39
40
|
{maximum}
|
|
41
|
+
{compact}
|
|
40
42
|
on:change={onChange}
|
|
41
43
|
/>
|
|
42
44
|
</Field>
|
package/src/Label/Label.svelte
CHANGED
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
export let align = "right"
|
|
15
15
|
export let portalTarget
|
|
16
16
|
export let maxWidth
|
|
17
|
+
export let maxHeight
|
|
17
18
|
export let open = false
|
|
18
19
|
export let useAnchorWidth = false
|
|
19
20
|
export let dismissible = true
|
|
20
21
|
export let offset = 5
|
|
21
22
|
export let customHeight
|
|
23
|
+
export let animate = true
|
|
22
24
|
|
|
23
25
|
$: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
|
|
24
26
|
|
|
@@ -64,6 +66,7 @@
|
|
|
64
66
|
use:positionDropdown={{
|
|
65
67
|
anchor,
|
|
66
68
|
align,
|
|
69
|
+
maxHeight,
|
|
67
70
|
maxWidth,
|
|
68
71
|
useAnchorWidth,
|
|
69
72
|
offset,
|
|
@@ -76,7 +79,7 @@
|
|
|
76
79
|
class="spectrum-Popover is-open"
|
|
77
80
|
role="presentation"
|
|
78
81
|
style="height: {customHeight}"
|
|
79
|
-
transition:fly|local={{ y: -20, duration: 200 }}
|
|
82
|
+
transition:fly|local={{ y: -20, duration: animate ? 200 : 0 }}
|
|
80
83
|
>
|
|
81
84
|
<slot />
|
|
82
85
|
</div>
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
const displayLimit = 5
|
|
7
7
|
|
|
8
|
-
$:
|
|
9
|
-
$:
|
|
8
|
+
$: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
|
|
9
|
+
$: badges = arrayValue.slice(0, displayLimit)
|
|
10
|
+
$: leftover = arrayValue.length - badges.length
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
13
|
{#each badges as badge}
|
package/src/Table/Table.svelte
CHANGED
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
}
|
|
144
144
|
fields?.forEach(field => {
|
|
145
145
|
const fieldSchema = schema[field]
|
|
146
|
-
if (fieldSchema.width) {
|
|
146
|
+
if (fieldSchema.width && typeof fieldSchema.width === "string") {
|
|
147
147
|
style += ` ${fieldSchema.width}`
|
|
148
148
|
} else {
|
|
149
149
|
style += " minmax(auto, 1fr)"
|
package/src/bbui.css
CHANGED
|
@@ -97,4 +97,22 @@
|
|
|
97
97
|
|
|
98
98
|
a {
|
|
99
99
|
text-decoration: none;
|
|
100
|
-
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Custom theme additions */
|
|
103
|
+
.spectrum--darkest {
|
|
104
|
+
--drop-shadow: rgba(0, 0, 0, 0.6);
|
|
105
|
+
--spectrum-global-color-blue-100: rgb(28, 33, 43);
|
|
106
|
+
}
|
|
107
|
+
.spectrum--dark {
|
|
108
|
+
--drop-shadow: rgba(0, 0, 0, 0.3);
|
|
109
|
+
--spectrum-global-color-blue-100: rgb(42, 47, 57);
|
|
110
|
+
}
|
|
111
|
+
.spectrum--light {
|
|
112
|
+
--drop-shadow: rgba(0, 0, 0, 0.075);
|
|
113
|
+
--spectrum-global-color-blue-100: rgb(240, 245, 255);
|
|
114
|
+
}
|
|
115
|
+
.spectrum--lightest {
|
|
116
|
+
--drop-shadow: rgba(0, 0, 0, 0.05);
|
|
117
|
+
--spectrum-global-color-blue-100: rgb(240, 244, 255);
|
|
118
|
+
}
|