Skip to content

Commit 6869a81

Browse files
authored
Merge pull request #10365 from Budibase/spreadsheet-integration
Grid in data section (2)
2 parents 289c109 + e2909c4 commit 6869a81

File tree

125 files changed

+6324
-562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+6324
-562
lines changed

packages/bbui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"@spectrum-css/vars": "3.0.1",
8585
"dayjs": "^1.10.4",
8686
"easymde": "^2.16.1",
87-
"svelte-flatpickr": "^3.2.3",
87+
"svelte-flatpickr": "^3.3.2",
8888
"svelte-portal": "^1.0.0"
8989
},
9090
"resolutions": {

packages/bbui/src/ActionButton/ActionButton.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
{/if}
7272
{#if icon}
7373
<svg
74-
class="spectrum-Icon spectrum-Icon--size{size}"
74+
class="spectrum-Icon spectrum-Icon--sizeS"
7575
focusable="false"
7676
aria-hidden="true"
7777
aria-label={icon}

packages/bbui/src/Actions/click_outside.js

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ let clickHandlers = []
66
*/
77
const handleClick = event => {
88
// Ignore click if this is an ignored class
9+
if (event.target.closest('[data-ignore-click-outside="true"]')) {
10+
return
11+
}
912
for (let className of ignoredClasses) {
1013
if (event.target.closest(className)) {
1114
return
@@ -29,6 +32,7 @@ const handleClick = event => {
2932
})
3033
}
3134
document.documentElement.addEventListener("click", handleClick, true)
35+
document.documentElement.addEventListener("contextmenu", handleClick, true)
3236

3337
/**
3438
* Adds or updates a click handler

packages/bbui/src/Form/Core/Dropzone.svelte

+22-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
}
139139
</script>
140140
141-
<div class="container">
141+
<div class="container" class:compact>
142142
{#if selectedImage}
143143
{#if gallery}
144144
<div class="gallery">
@@ -355,6 +355,9 @@
355355
input[type="file"] {
356356
display: none;
357357
}
358+
.compact .spectrum-Dropzone {
359+
padding: 6px 0 !important;
360+
}
358361
359362
.gallery {
360363
display: flex;
@@ -379,6 +382,17 @@
379382
object-fit: contain;
380383
margin: 20px 30px;
381384
}
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+
}
382396
.title {
383397
display: flex;
384398
flex-direction: row;
@@ -447,6 +461,13 @@
447461
.disabled .spectrum-Heading--sizeL {
448462
color: var(--spectrum-alias-text-color-disabled);
449463
}
464+
.compact .spectrum-Dropzone {
465+
padding-top: 8px;
466+
padding-bottom: 8px;
467+
}
468+
.compact .spectrum-IllustratedMessage-description {
469+
margin: 0;
470+
}
450471
451472
.tags {
452473
margin-top: 20px;

packages/bbui/src/Form/Core/Multiselect.svelte

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
2121
const dispatch = createEventDispatcher()
2222
23-
$: selectedLookupMap = getSelectedLookupMap(value)
23+
$: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
24+
$: selectedLookupMap = getSelectedLookupMap(arrayValue)
2425
$: optionLookupMap = getOptionLookupMap(options)
2526
26-
$: fieldText = getFieldText(value, optionLookupMap, placeholder)
27+
$: fieldText = getFieldText(arrayValue, optionLookupMap, placeholder)
2728
$: isOptionSelected = optionValue => selectedLookupMap[optionValue] === true
28-
$: toggleOption = makeToggleOption(selectedLookupMap, value)
29+
$: toggleOption = makeToggleOption(selectedLookupMap, arrayValue)
2930
3031
const getFieldText = (value, map, placeholder) => {
3132
if (Array.isArray(value) && value.length > 0) {
@@ -84,7 +85,7 @@
8485
{readonly}
8586
{fieldText}
8687
{options}
87-
isPlaceholder={!value?.length}
88+
isPlaceholder={!arrayValue.length}
8889
{autocomplete}
8990
bind:fetchTerm
9091
{useFetch}

packages/bbui/src/Form/Dropzone.svelte

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
export let gallery = true
1717
export let fileTags = []
1818
export let maximum = undefined
19+
export let compact = false
1920
2021
const dispatch = createEventDispatcher()
2122
const onChange = e => {
@@ -37,6 +38,7 @@
3738
{gallery}
3839
{fileTags}
3940
{maximum}
41+
{compact}
4042
on:change={onChange}
4143
/>
4244
</Field>

packages/bbui/src/Popover/Popover.svelte

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
export let dismissible = true
2121
export let offset = 5
2222
export let customHeight
23+
export let animate = true
2324
2425
$: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
2526
@@ -78,7 +79,7 @@
7879
class="spectrum-Popover is-open"
7980
role="presentation"
8081
style="height: {customHeight}"
81-
transition:fly|local={{ y: -20, duration: 200 }}
82+
transition:fly|local={{ y: -20, duration: animate ? 200 : 0 }}
8283
>
8384
<slot />
8485
</div>

packages/bbui/src/Table/ArrayRenderer.svelte

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
66
const displayLimit = 5
77
8-
$: badges = Array.isArray(value) ? value.slice(0, displayLimit) : []
9-
$: leftover = (value?.length ?? 0) - badges.length
8+
$: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
9+
$: badges = arrayValue.slice(0, displayLimit)
10+
$: leftover = arrayValue.length - badges.length
1011
</script>
1112

1213
{#each badges as badge}

packages/bbui/src/Table/Table.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
}
144144
fields?.forEach(field => {
145145
const fieldSchema = schema[field]
146-
if (fieldSchema.width) {
146+
if (fieldSchema.width && typeof fieldSchema.width === "string") {
147147
style += ` ${fieldSchema.width}`
148148
} else {
149149
style += " minmax(auto, 1fr)"

packages/bbui/src/bbui.css

+19-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,22 @@
9797

9898
a {
9999
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+
}

0 commit comments

Comments
 (0)