@budibase/bbui 1.0.49-alpha.6 → 1.0.49

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": "1.0.49-alpha.6",
4
+ "version": "1.0.49",
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": "7f6bc74ccc8f66f1a44c045f47bdb6604dcbb0b8"
85
+ "gitHead": "80ae9a30b112c1abf794bdad73da9257ba80d9d5"
86
86
  }
@@ -22,7 +22,6 @@
22
22
  export let error = null
23
23
  export let fileTags = []
24
24
  export let maximum = null
25
- export let extensions = "*"
26
25
 
27
26
  const dispatch = createEventDispatcher()
28
27
  const imageExtensions = [
@@ -147,9 +146,7 @@
147
146
  <img alt="preview" src={selectedUrl} />
148
147
  {:else}
149
148
  <div class="placeholder">
150
- <div class="extension">
151
- {selectedImage.name || "Unknown file"}
152
- </div>
149
+ <div class="extension">{selectedImage.extension}</div>
153
150
  <div>Preview not supported</div>
154
151
  </div>
155
152
  {/if}
@@ -210,7 +207,6 @@
210
207
  {disabled}
211
208
  type="file"
212
209
  multiple
213
- accept={extensions}
214
210
  on:change={handleFile}
215
211
  />
216
212
  <svg
@@ -361,21 +357,18 @@
361
357
  white-space: nowrap;
362
358
  width: 0;
363
359
  margin-right: 10px;
364
- user-select: all;
365
360
  }
366
361
  .placeholder {
367
362
  display: flex;
368
363
  flex-direction: column;
369
364
  justify-content: center;
370
365
  align-items: center;
371
- text-align: center;
372
366
  }
373
367
  .extension {
374
368
  color: var(--spectrum-global-color-gray-600);
375
369
  text-transform: uppercase;
376
370
  font-weight: 600;
377
371
  margin-bottom: 5px;
378
- user-select: all;
379
372
  }
380
373
 
381
374
  .nav {
@@ -6,12 +6,11 @@
6
6
  export let label = null
7
7
  export let labelPosition = "above"
8
8
  export let error = null
9
- export let tooltip = ""
10
9
  </script>
11
10
 
12
11
  <div class="spectrum-Form-item" class:above={labelPosition === "above"}>
13
12
  {#if label}
14
- <FieldLabel forId={id} {label} position={labelPosition} {tooltip} />
13
+ <FieldLabel forId={id} {label} position={labelPosition} />
15
14
  {/if}
16
15
  <div class="spectrum-Form-itemField">
17
16
  <slot />
@@ -1,24 +1,19 @@
1
1
  <script>
2
- import TooltipWrapper from "../Tooltip/TooltipWrapper.svelte"
3
-
4
2
  import "@spectrum-css/fieldlabel/dist/index-vars.css"
5
3
 
6
4
  export let forId
7
5
  export let label
8
6
  export let position = "above"
9
- export let tooltip = ""
10
7
 
11
8
  $: className = position === "above" ? "" : `spectrum-FieldLabel--${position}`
12
9
  </script>
13
10
 
14
- <TooltipWrapper {tooltip} size="S">
15
- <label
16
- for={forId}
17
- class={`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${className}`}
18
- >
19
- {label || ""}
20
- </label>
21
- </TooltipWrapper>
11
+ <label
12
+ for={forId}
13
+ class={`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${className}`}
14
+ >
15
+ {label || ""}
16
+ </label>
22
17
 
23
18
  <style>
24
19
  label {
@@ -17,7 +17,6 @@
17
17
  export let quiet = false
18
18
  export let autoWidth = false
19
19
  export let sort = false
20
- export let tooltip = ""
21
20
 
22
21
  const dispatch = createEventDispatcher()
23
22
  const onChange = e => {
@@ -33,7 +32,7 @@
33
32
  }
34
33
  </script>
35
34
 
36
- <Field {label} {labelPosition} {error} {tooltip}>
35
+ <Field {label} {labelPosition} {error}>
37
36
  <Select
38
37
  {quiet}
39
38
  {error}
@@ -1,20 +1,73 @@
1
1
  <script>
2
2
  import "@spectrum-css/fieldlabel/dist/index-vars.css"
3
- import TooltipWrapper from "../Tooltip/TooltipWrapper.svelte"
3
+ import Tooltip from "../Tooltip/Tooltip.svelte"
4
+ import Icon from "../Icon/Icon.svelte"
4
5
 
5
6
  export let size = "M"
6
7
  export let tooltip = ""
8
+ export let showTooltip = false
7
9
  </script>
8
10
 
9
- <TooltipWrapper {tooltip} {size}>
11
+ {#if tooltip}
12
+ <div class="container">
13
+ <label
14
+ for=""
15
+ class={`spectrum-FieldLabel spectrum-FieldLabel--size${size}`}
16
+ >
17
+ <slot />
18
+ </label>
19
+ <div class="icon-container">
20
+ <div
21
+ class="icon"
22
+ class:icon-small={size === "M" || size === "S"}
23
+ on:mouseover={() => (showTooltip = true)}
24
+ on:mouseleave={() => (showTooltip = false)}
25
+ >
26
+ <Icon name="InfoOutline" size="S" disabled={true} />
27
+ </div>
28
+ {#if showTooltip}
29
+ <div class="tooltip">
30
+ <Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
31
+ </div>
32
+ {/if}
33
+ </div>
34
+ </div>
35
+ {:else}
10
36
  <label for="" class={`spectrum-FieldLabel spectrum-FieldLabel--size${size}`}>
11
37
  <slot />
12
38
  </label>
13
- </TooltipWrapper>
39
+ {/if}
14
40
 
15
41
  <style>
16
42
  label {
17
43
  padding: 0;
18
44
  white-space: nowrap;
19
45
  }
46
+ .container {
47
+ display: flex;
48
+ align-items: center;
49
+ }
50
+ .icon-container {
51
+ position: relative;
52
+ display: flex;
53
+ justify-content: center;
54
+ margin-top: 1px;
55
+ margin-left: 5px;
56
+ margin-right: 5px;
57
+ }
58
+ .tooltip {
59
+ position: absolute;
60
+ display: flex;
61
+ justify-content: center;
62
+ top: 15px;
63
+ z-index: 1;
64
+ width: 160px;
65
+ }
66
+ .icon {
67
+ transform: scale(0.75);
68
+ }
69
+ .icon-small {
70
+ margin-top: -2px;
71
+ margin-bottom: -5px;
72
+ }
20
73
  </style>
@@ -1,60 +0,0 @@
1
- <script>
2
- import Tooltip from "./Tooltip.svelte"
3
- import Icon from "../Icon/Icon.svelte"
4
-
5
- export let tooltip = ""
6
- export let size = "M"
7
-
8
- let showTooltip = false
9
- </script>
10
-
11
- <div class:container={!!tooltip}>
12
- <slot />
13
- {#if tooltip}
14
- <div class="icon-container">
15
- <div
16
- class="icon"
17
- class:icon-small={size === "M" || size === "S"}
18
- on:mouseover={() => (showTooltip = true)}
19
- on:mouseleave={() => (showTooltip = false)}
20
- >
21
- <Icon name="InfoOutline" size="S" disabled={true} />
22
- </div>
23
- {#if showTooltip}
24
- <div class="tooltip">
25
- <Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
26
- </div>
27
- {/if}
28
- </div>
29
- {/if}
30
- </div>
31
-
32
- <style>
33
- .container {
34
- display: flex;
35
- align-items: center;
36
- }
37
- .icon-container {
38
- position: relative;
39
- display: flex;
40
- justify-content: center;
41
- margin-top: 1px;
42
- margin-left: 5px;
43
- margin-right: 5px;
44
- }
45
- .tooltip {
46
- position: absolute;
47
- display: flex;
48
- justify-content: center;
49
- top: 15px;
50
- z-index: 1;
51
- width: 160px;
52
- }
53
- .icon {
54
- transform: scale(0.75);
55
- }
56
- .icon-small {
57
- margin-top: -2px;
58
- margin-bottom: -5px;
59
- }
60
- </style>