@budibase/bbui 2.2.12-alpha.5 → 2.2.13
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": "2.2.
|
|
4
|
+
"version": "2.2.13",
|
|
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": "2.2.
|
|
41
|
+
"@budibase/string-templates": "^2.2.13",
|
|
42
42
|
"@spectrum-css/actionbutton": "1.0.1",
|
|
43
43
|
"@spectrum-css/actiongroup": "1.0.1",
|
|
44
44
|
"@spectrum-css/avatar": "3.0.2",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"resolutions": {
|
|
89
89
|
"loader-utils": "1.4.1"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "3d3c0d432f6be08367579f01c5142f9662981eee"
|
|
92
92
|
}
|
package/src/Badge/Badge.svelte
CHANGED
|
@@ -10,13 +10,10 @@
|
|
|
10
10
|
export let green = false
|
|
11
11
|
export let active = false
|
|
12
12
|
export let inactive = false
|
|
13
|
-
export let hoverable = false
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
15
|
<span
|
|
17
|
-
on:click
|
|
18
16
|
class="spectrum-Label"
|
|
19
|
-
class:hoverable
|
|
20
17
|
class:spectrum-Label--small={size === "S"}
|
|
21
18
|
class:spectrum-Label--large={size === "L"}
|
|
22
19
|
class:spectrum-Label--grey={grey}
|
|
@@ -30,13 +27,3 @@
|
|
|
30
27
|
>
|
|
31
28
|
<slot />
|
|
32
29
|
</span>
|
|
33
|
-
|
|
34
|
-
<style>
|
|
35
|
-
.spectrum-Label--grey {
|
|
36
|
-
background-color: var(--spectrum-global-color-gray-500);
|
|
37
|
-
font-weight: 600;
|
|
38
|
-
}
|
|
39
|
-
.hoverable:hover {
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
export let value = []
|
|
16
16
|
export let id = null
|
|
17
17
|
export let disabled = false
|
|
18
|
-
export let compact = false
|
|
19
18
|
export let fileSizeLimit = BYTES_IN_MB * 20
|
|
20
19
|
export let processFiles = null
|
|
21
20
|
export let deleteAttachments = null
|
|
@@ -240,72 +239,70 @@
|
|
|
240
239
|
bind:this={fileInput}
|
|
241
240
|
on:change={handleFile}
|
|
242
241
|
/>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
>
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
</h2>
|
|
308
|
-
{/if}
|
|
242
|
+
<svg
|
|
243
|
+
class="spectrum-IllustratedMessage-illustration"
|
|
244
|
+
width="125"
|
|
245
|
+
height="60"
|
|
246
|
+
viewBox="0 0 199 97.7"
|
|
247
|
+
>
|
|
248
|
+
<defs>
|
|
249
|
+
<style>
|
|
250
|
+
.cls-1,
|
|
251
|
+
.cls-2 {
|
|
252
|
+
fill: none;
|
|
253
|
+
stroke-linecap: round;
|
|
254
|
+
stroke-linejoin: round;
|
|
255
|
+
}
|
|
256
|
+
.cls-1 {
|
|
257
|
+
stroke-width: 3px;
|
|
258
|
+
}
|
|
259
|
+
.cls-2 {
|
|
260
|
+
stroke-width: 2px;
|
|
261
|
+
}
|
|
262
|
+
</style>
|
|
263
|
+
</defs>
|
|
264
|
+
<path
|
|
265
|
+
class="cls-1"
|
|
266
|
+
d="M110.53,85.66,100.26,95.89a1.09,1.09,0,0,1-1.52,0L88.47,85.66"
|
|
267
|
+
/>
|
|
268
|
+
<line class="cls-1" x1="99.5" y1="95.5" x2="99.5" y2="58.5" />
|
|
269
|
+
<path class="cls-1" d="M105.5,73.5h19a2,2,0,0,0,2-2v-43" />
|
|
270
|
+
<path
|
|
271
|
+
class="cls-1"
|
|
272
|
+
d="M126.5,22.5h-19a2,2,0,0,1-2-2V1.5h-31a2,2,0,0,0-2,2v68a2,2,0,0,0,2,2h19"
|
|
273
|
+
/>
|
|
274
|
+
<line class="cls-1" x1="105.5" y1="1.5" x2="126.5" y2="22.5" />
|
|
275
|
+
<path
|
|
276
|
+
class="cls-2"
|
|
277
|
+
d="M47.93,50.49a5,5,0,1,0-4.83-5A4.93,4.93,0,0,0,47.93,50.49Z"
|
|
278
|
+
/>
|
|
279
|
+
<path
|
|
280
|
+
class="cls-2"
|
|
281
|
+
d="M36.6,65.93,42.05,60A2.06,2.06,0,0,1,45,60l12.68,13.2"
|
|
282
|
+
/>
|
|
283
|
+
<path
|
|
284
|
+
class="cls-2"
|
|
285
|
+
d="M3.14,73.23,22.42,53.76a1.65,1.65,0,0,1,2.38,0l19.05,19.7"
|
|
286
|
+
/>
|
|
287
|
+
<path
|
|
288
|
+
class="cls-1"
|
|
289
|
+
d="M139.5,36.5H196A1.49,1.49,0,0,1,197.5,38V72A1.49,1.49,0,0,1,196,73.5H141A1.49,1.49,0,0,1,139.5,72V32A1.49,1.49,0,0,1,141,30.5H154a2.43,2.43,0,0,1,1.67.66l6,5.66"
|
|
290
|
+
/>
|
|
291
|
+
<rect
|
|
292
|
+
class="cls-1"
|
|
293
|
+
x="1.5"
|
|
294
|
+
y="34.5"
|
|
295
|
+
width="58"
|
|
296
|
+
height="39"
|
|
297
|
+
rx="2"
|
|
298
|
+
ry="2"
|
|
299
|
+
/>
|
|
300
|
+
</svg>
|
|
301
|
+
<h2
|
|
302
|
+
class="spectrum-Heading spectrum-Heading--sizeL spectrum-Heading--light spectrum-IllustratedMessage-heading"
|
|
303
|
+
>
|
|
304
|
+
Drag and drop your file
|
|
305
|
+
</h2>
|
|
309
306
|
{#if !disabled}
|
|
310
307
|
<p
|
|
311
308
|
class="spectrum-Body spectrum-Body--sizeS spectrum-IllustratedMessage-description"
|
|
@@ -313,10 +310,8 @@
|
|
|
313
310
|
<label for={fieldId} class="spectrum-Link">
|
|
314
311
|
Select a file to upload
|
|
315
312
|
</label>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
from your computer
|
|
319
|
-
{/if}
|
|
313
|
+
<br />
|
|
314
|
+
from your computer
|
|
320
315
|
</p>
|
|
321
316
|
{#if fileTags.length}
|
|
322
317
|
<Tags>
|
|
@@ -11,14 +11,31 @@
|
|
|
11
11
|
export let getOptionLabel = option => option
|
|
12
12
|
export let getOptionValue = option => option
|
|
13
13
|
export let getOptionTitle = option => option
|
|
14
|
+
export let sort = false
|
|
14
15
|
|
|
15
16
|
const dispatch = createEventDispatcher()
|
|
16
17
|
const onChange = e => dispatch("change", e.target.value)
|
|
18
|
+
|
|
19
|
+
const getSortedOptions = (options, getLabel, sort) => {
|
|
20
|
+
if (!options?.length || !Array.isArray(options)) {
|
|
21
|
+
return []
|
|
22
|
+
}
|
|
23
|
+
if (!sort) {
|
|
24
|
+
return options
|
|
25
|
+
}
|
|
26
|
+
return [...options].sort((a, b) => {
|
|
27
|
+
const labelA = getLabel(a)
|
|
28
|
+
const labelB = getLabel(b)
|
|
29
|
+
return labelA > labelB ? 1 : -1
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
$: parsedOptions = getSortedOptions(options, getOptionLabel, sort)
|
|
17
34
|
</script>
|
|
18
35
|
|
|
19
36
|
<div class={`spectrum-FieldGroup spectrum-FieldGroup--${direction}`}>
|
|
20
|
-
{#if
|
|
21
|
-
{#each
|
|
37
|
+
{#if parsedOptions && Array.isArray(parsedOptions)}
|
|
38
|
+
{#each parsedOptions as option}
|
|
22
39
|
<div
|
|
23
40
|
title={getOptionTitle(option)}
|
|
24
41
|
class="spectrum-Radio spectrum-FieldGroup-item spectrum-Radio--emphasized"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "@spectrum-css/label/dist/index-vars.css"
|
|
3
3
|
import { createEventDispatcher } from "svelte"
|
|
4
|
-
import Badge from "../Badge/Badge.svelte"
|
|
5
4
|
|
|
6
5
|
export let row
|
|
7
6
|
export let value
|
|
@@ -25,11 +24,17 @@
|
|
|
25
24
|
|
|
26
25
|
{#each relationships as relationship}
|
|
27
26
|
{#if relationship?.primaryDisplay}
|
|
28
|
-
<
|
|
27
|
+
<span class="spectrum-Label spectrum-Label--grey" on:click={onClick}>
|
|
29
28
|
{relationship.primaryDisplay}
|
|
30
|
-
</
|
|
29
|
+
</span>
|
|
31
30
|
{/if}
|
|
32
31
|
{/each}
|
|
33
32
|
{#if leftover}
|
|
34
33
|
<div>+{leftover} more</div>
|
|
35
34
|
{/if}
|
|
35
|
+
|
|
36
|
+
<style>
|
|
37
|
+
span:hover {
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
</style>
|