@budibase/bbui 1.0.15-alpha.0 → 1.0.17
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 +1 -1
- package/dist/bbui.es.js.map +1 -1
- package/package.json +2 -2
- package/src/Form/Core/Dropzone.svelte +94 -124
- package/src/Form/Dropzone.svelte +0 -4
- package/src/Modal/ModalContent.svelte +0 -25
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.0.
|
|
4
|
+
"version": "1.0.17",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"svelte-flatpickr": "^3.2.3",
|
|
83
83
|
"svelte-portal": "^1.0.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "212bd458435ba8e7a6eee4ac5ec988a2aeebefef"
|
|
86
86
|
}
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
import { generateID } from "../../utils/helpers"
|
|
7
7
|
import Icon from "../../Icon/Icon.svelte"
|
|
8
8
|
import Link from "../../Link/Link.svelte"
|
|
9
|
-
import Tag from "../../Tags/Tag.svelte"
|
|
10
|
-
import Tags from "../../Tags/Tags.svelte"
|
|
11
9
|
|
|
12
10
|
const BYTES_IN_KB = 1000
|
|
13
11
|
const BYTES_IN_MB = 1000000
|
|
@@ -20,8 +18,6 @@
|
|
|
20
18
|
export let handleFileTooLarge = null
|
|
21
19
|
export let gallery = true
|
|
22
20
|
export let error = null
|
|
23
|
-
export let fileTags = []
|
|
24
|
-
export let maximum = null
|
|
25
21
|
|
|
26
22
|
const dispatch = createEventDispatcher()
|
|
27
23
|
const imageExtensions = [
|
|
@@ -188,118 +184,103 @@
|
|
|
188
184
|
{/each}
|
|
189
185
|
{/if}
|
|
190
186
|
{/if}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
>
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
187
|
+
<div
|
|
188
|
+
class="spectrum-Dropzone"
|
|
189
|
+
class:is-invalid={!!error}
|
|
190
|
+
class:disabled
|
|
191
|
+
role="region"
|
|
192
|
+
tabindex="0"
|
|
193
|
+
on:dragover={handleDragOver}
|
|
194
|
+
on:dragleave={handleDragLeave}
|
|
195
|
+
on:dragenter={handleDragOver}
|
|
196
|
+
on:drop={handleDrop}
|
|
197
|
+
class:is-dragged={fileDragged}
|
|
198
|
+
>
|
|
199
|
+
<div class="spectrum-IllustratedMessage spectrum-IllustratedMessage--cta">
|
|
200
|
+
<input
|
|
201
|
+
id={fieldId}
|
|
202
|
+
{disabled}
|
|
203
|
+
type="file"
|
|
204
|
+
multiple
|
|
205
|
+
on:change={handleFile}
|
|
206
|
+
/>
|
|
207
|
+
<svg
|
|
208
|
+
class="spectrum-IllustratedMessage-illustration"
|
|
209
|
+
width="125"
|
|
210
|
+
height="60"
|
|
211
|
+
viewBox="0 0 199 97.7"
|
|
212
|
+
>
|
|
213
|
+
<defs>
|
|
214
|
+
<style>
|
|
215
|
+
.cls-1,
|
|
216
|
+
.cls-2 {
|
|
217
|
+
fill: none;
|
|
218
|
+
stroke-linecap: round;
|
|
219
|
+
stroke-linejoin: round;
|
|
220
|
+
}
|
|
221
|
+
.cls-1 {
|
|
222
|
+
stroke-width: 3px;
|
|
223
|
+
}
|
|
224
|
+
.cls-2 {
|
|
225
|
+
stroke-width: 2px;
|
|
226
|
+
}
|
|
227
|
+
</style>
|
|
228
|
+
</defs>
|
|
229
|
+
<path
|
|
230
|
+
class="cls-1"
|
|
231
|
+
d="M110.53,85.66,100.26,95.89a1.09,1.09,0,0,1-1.52,0L88.47,85.66"
|
|
211
232
|
/>
|
|
212
|
-
<
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
<path
|
|
254
|
-
class="cls-2"
|
|
255
|
-
d="M3.14,73.23,22.42,53.76a1.65,1.65,0,0,1,2.38,0l19.05,19.7"
|
|
256
|
-
/>
|
|
257
|
-
<path
|
|
258
|
-
class="cls-1"
|
|
259
|
-
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"
|
|
260
|
-
/>
|
|
261
|
-
<rect
|
|
262
|
-
class="cls-1"
|
|
263
|
-
x="1.5"
|
|
264
|
-
y="34.5"
|
|
265
|
-
width="58"
|
|
266
|
-
height="39"
|
|
267
|
-
rx="2"
|
|
268
|
-
ry="2"
|
|
269
|
-
/>
|
|
270
|
-
</svg>
|
|
271
|
-
<h2
|
|
272
|
-
class="spectrum-Heading spectrum-Heading--sizeL spectrum-Heading--light spectrum-IllustratedMessage-heading"
|
|
233
|
+
<line class="cls-1" x1="99.5" y1="95.5" x2="99.5" y2="58.5" />
|
|
234
|
+
<path class="cls-1" d="M105.5,73.5h19a2,2,0,0,0,2-2v-43" />
|
|
235
|
+
<path
|
|
236
|
+
class="cls-1"
|
|
237
|
+
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"
|
|
238
|
+
/>
|
|
239
|
+
<line class="cls-1" x1="105.5" y1="1.5" x2="126.5" y2="22.5" />
|
|
240
|
+
<path
|
|
241
|
+
class="cls-2"
|
|
242
|
+
d="M47.93,50.49a5,5,0,1,0-4.83-5A4.93,4.93,0,0,0,47.93,50.49Z"
|
|
243
|
+
/>
|
|
244
|
+
<path
|
|
245
|
+
class="cls-2"
|
|
246
|
+
d="M36.6,65.93,42.05,60A2.06,2.06,0,0,1,45,60l12.68,13.2"
|
|
247
|
+
/>
|
|
248
|
+
<path
|
|
249
|
+
class="cls-2"
|
|
250
|
+
d="M3.14,73.23,22.42,53.76a1.65,1.65,0,0,1,2.38,0l19.05,19.7"
|
|
251
|
+
/>
|
|
252
|
+
<path
|
|
253
|
+
class="cls-1"
|
|
254
|
+
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"
|
|
255
|
+
/>
|
|
256
|
+
<rect
|
|
257
|
+
class="cls-1"
|
|
258
|
+
x="1.5"
|
|
259
|
+
y="34.5"
|
|
260
|
+
width="58"
|
|
261
|
+
height="39"
|
|
262
|
+
rx="2"
|
|
263
|
+
ry="2"
|
|
264
|
+
/>
|
|
265
|
+
</svg>
|
|
266
|
+
<h2
|
|
267
|
+
class="spectrum-Heading spectrum-Heading--sizeL spectrum-Heading--light spectrum-IllustratedMessage-heading"
|
|
268
|
+
>
|
|
269
|
+
Drag and drop your file
|
|
270
|
+
</h2>
|
|
271
|
+
{#if !disabled}
|
|
272
|
+
<p
|
|
273
|
+
class="spectrum-Body spectrum-Body--sizeS spectrum-IllustratedMessage-description"
|
|
273
274
|
>
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
Select a file to upload
|
|
282
|
-
</label>
|
|
283
|
-
<br />
|
|
284
|
-
from your computer
|
|
285
|
-
</p>
|
|
286
|
-
{#if fileTags.length}
|
|
287
|
-
<Tags>
|
|
288
|
-
<div class="tags">
|
|
289
|
-
{#each fileTags as tag}
|
|
290
|
-
<div class="tag">
|
|
291
|
-
<Tag>
|
|
292
|
-
{tag}
|
|
293
|
-
</Tag>
|
|
294
|
-
</div>
|
|
295
|
-
{/each}
|
|
296
|
-
</div>
|
|
297
|
-
</Tags>
|
|
298
|
-
{/if}
|
|
299
|
-
{/if}
|
|
300
|
-
</div>
|
|
275
|
+
<label for={fieldId} class="spectrum-Link">
|
|
276
|
+
Select a file to upload
|
|
277
|
+
</label>
|
|
278
|
+
<br />
|
|
279
|
+
from your computer
|
|
280
|
+
</p>
|
|
281
|
+
{/if}
|
|
301
282
|
</div>
|
|
302
|
-
|
|
283
|
+
</div>
|
|
303
284
|
</div>
|
|
304
285
|
|
|
305
286
|
<style>
|
|
@@ -409,15 +390,4 @@
|
|
|
409
390
|
.disabled .spectrum-Heading--sizeL {
|
|
410
391
|
color: var(--spectrum-alias-text-color-disabled);
|
|
411
392
|
}
|
|
412
|
-
|
|
413
|
-
.tags {
|
|
414
|
-
margin-top: 20px;
|
|
415
|
-
display: flex;
|
|
416
|
-
flex-wrap: wrap;
|
|
417
|
-
justify-content: center;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.tag {
|
|
421
|
-
margin-top: 8px;
|
|
422
|
-
}
|
|
423
393
|
</style>
|
package/src/Form/Dropzone.svelte
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
export let processFiles = undefined
|
|
13
13
|
export let handleFileTooLarge = undefined
|
|
14
14
|
export let gallery = true
|
|
15
|
-
export let fileTags = []
|
|
16
|
-
export let maximum = undefined
|
|
17
15
|
|
|
18
16
|
const dispatch = createEventDispatcher()
|
|
19
17
|
const onChange = e => {
|
|
@@ -31,8 +29,6 @@
|
|
|
31
29
|
{processFiles}
|
|
32
30
|
{handleFileTooLarge}
|
|
33
31
|
{gallery}
|
|
34
|
-
{fileTags}
|
|
35
|
-
{maximum}
|
|
36
32
|
on:change={onChange}
|
|
37
33
|
/>
|
|
38
34
|
</Field>
|
|
@@ -18,22 +18,10 @@
|
|
|
18
18
|
export let disabled = false
|
|
19
19
|
export let showDivider = true
|
|
20
20
|
|
|
21
|
-
export let showSecondaryButton = false
|
|
22
|
-
export let secondaryButtonText = undefined
|
|
23
|
-
export let secondaryAction = undefined
|
|
24
|
-
|
|
25
21
|
const { hide, cancel } = getContext(Context.Modal)
|
|
26
22
|
let loading = false
|
|
27
23
|
$: confirmDisabled = disabled || loading
|
|
28
24
|
|
|
29
|
-
async function secondary() {
|
|
30
|
-
loading = true
|
|
31
|
-
if (!secondaryAction || (await secondaryAction()) !== false) {
|
|
32
|
-
hide()
|
|
33
|
-
}
|
|
34
|
-
loading = false
|
|
35
|
-
}
|
|
36
|
-
|
|
37
25
|
async function confirm() {
|
|
38
26
|
loading = true
|
|
39
27
|
if (!onConfirm || (await onConfirm()) !== false) {
|
|
@@ -85,15 +73,6 @@
|
|
|
85
73
|
class="spectrum-ButtonGroup spectrum-Dialog-buttonGroup spectrum-Dialog-buttonGroup--noFooter"
|
|
86
74
|
>
|
|
87
75
|
<slot name="footer" />
|
|
88
|
-
|
|
89
|
-
{#if showSecondaryButton && secondaryButtonText && secondaryAction}
|
|
90
|
-
<div class="secondary-action">
|
|
91
|
-
<Button group secondary on:click={secondary}
|
|
92
|
-
>{secondaryButtonText}</Button
|
|
93
|
-
>
|
|
94
|
-
</div>
|
|
95
|
-
{/if}
|
|
96
|
-
|
|
97
76
|
{#if showCancelButton}
|
|
98
77
|
<Button group secondary on:click={close}>{cancelText}</Button>
|
|
99
78
|
{/if}
|
|
@@ -157,8 +136,4 @@
|
|
|
157
136
|
display: flex;
|
|
158
137
|
justify-content: space-between;
|
|
159
138
|
}
|
|
160
|
-
|
|
161
|
-
.secondary-action {
|
|
162
|
-
margin-right: auto;
|
|
163
|
-
}
|
|
164
139
|
</style>
|