@budibase/bbui 3.2.3 → 3.2.5

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": "3.2.3",
4
+ "version": "3.2.5",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -35,8 +35,8 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
38
- "@budibase/shared-core": "3.2.3",
39
- "@budibase/string-templates": "3.2.3",
38
+ "@budibase/shared-core": "3.2.5",
39
+ "@budibase/string-templates": "3.2.5",
40
40
  "@spectrum-css/accordion": "3.0.24",
41
41
  "@spectrum-css/actionbutton": "1.0.1",
42
42
  "@spectrum-css/actiongroup": "1.0.1",
@@ -81,6 +81,7 @@
81
81
  "@spectrum-css/typography": "3.0.1",
82
82
  "@spectrum-css/underlay": "2.0.9",
83
83
  "@spectrum-css/vars": "3.0.1",
84
+ "atrament": "^4.3.0",
84
85
  "dayjs": "^1.10.8",
85
86
  "easymde": "^2.16.1",
86
87
  "svelte-dnd-action": "^0.9.8",
@@ -104,5 +105,5 @@
104
105
  }
105
106
  }
106
107
  },
107
- "gitHead": "8f3bc76ea5c253dba658b505d1e12eb82a3e8a40"
108
+ "gitHead": "c1ee7b00e6687d588565b3d74ee24084a8d1ceab"
108
109
  }
@@ -8,6 +8,7 @@
8
8
  import Link from "../../Link/Link.svelte"
9
9
  import Tag from "../../Tags/Tag.svelte"
10
10
  import Tags from "../../Tags/Tags.svelte"
11
+ import ProgressCircle from "../../ProgressCircle/ProgressCircle.svelte"
11
12
 
12
13
  const BYTES_IN_KB = 1000
13
14
  const BYTES_IN_MB = 1000000
@@ -39,12 +40,14 @@
39
40
  "jfif",
40
41
  "webp",
41
42
  ]
42
-
43
43
  const fieldId = id || uuid()
44
+
44
45
  let selectedImageIdx = 0
45
46
  let fileDragged = false
46
47
  let selectedUrl
47
48
  let fileInput
49
+ let loading = false
50
+
48
51
  $: selectedImage = value?.[selectedImageIdx] ?? null
49
52
  $: fileCount = value?.length ?? 0
50
53
  $: isImage =
@@ -86,10 +89,15 @@
86
89
  }
87
90
 
88
91
  if (processFiles) {
89
- const processedFiles = await processFiles(fileList)
90
- const newValue = [...value, ...processedFiles]
91
- dispatch("change", newValue)
92
- selectedImageIdx = newValue.length - 1
92
+ loading = true
93
+ try {
94
+ const processedFiles = await processFiles(fileList)
95
+ const newValue = [...value, ...processedFiles]
96
+ dispatch("change", newValue)
97
+ selectedImageIdx = newValue.length - 1
98
+ } finally {
99
+ loading = false
100
+ }
93
101
  } else {
94
102
  dispatch("change", fileList)
95
103
  }
@@ -227,7 +235,7 @@
227
235
  {#if showDropzone}
228
236
  <div
229
237
  class="spectrum-Dropzone"
230
- class:disabled
238
+ class:disabled={disabled || loading}
231
239
  role="region"
232
240
  tabindex="0"
233
241
  on:dragover={handleDragOver}
@@ -241,7 +249,7 @@
241
249
  id={fieldId}
242
250
  {disabled}
243
251
  type="file"
244
- multiple
252
+ multiple={maximum !== 1}
245
253
  accept={extensions}
246
254
  bind:this={fileInput}
247
255
  on:change={handleFile}
@@ -339,6 +347,12 @@
339
347
  {/if}
340
348
  {/if}
341
349
  </div>
350
+
351
+ {#if loading}
352
+ <div class="loading">
353
+ <ProgressCircle size="M" />
354
+ </div>
355
+ {/if}
342
356
  </div>
343
357
  {/if}
344
358
  </div>
@@ -464,6 +478,7 @@
464
478
 
465
479
  .spectrum-Dropzone {
466
480
  height: 220px;
481
+ position: relative;
467
482
  }
468
483
  .compact .spectrum-Dropzone {
469
484
  height: 40px;
@@ -488,4 +503,14 @@
488
503
  .tag {
489
504
  margin-top: 8px;
490
505
  }
506
+
507
+ .loading {
508
+ position: absolute;
509
+ display: grid;
510
+ place-items: center;
511
+ height: 100%;
512
+ width: 100%;
513
+ top: 0;
514
+ left: 0;
515
+ }
491
516
  </style>