@budibase/bbui 3.18.14 → 3.19.0

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.18.14",
4
+ "version": "3.19.0",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.ts",
7
7
  "module": "dist/bbui.mjs",
@@ -106,5 +106,5 @@
106
106
  }
107
107
  }
108
108
  },
109
- "gitHead": "da28258ca1bcc8260d29f82069545761429eeea7"
109
+ "gitHead": "72863c719173848d3128cbef9556a0af09708c20"
110
110
  }
@@ -42,7 +42,7 @@
42
42
  }
43
43
 
44
44
  function clearFile() {
45
- dispatch("change", undefined)
45
+ if (!disabled) dispatch("change", undefined)
46
46
  }
47
47
  </script>
48
48
 
@@ -59,7 +59,7 @@
59
59
  <!-- svelte-ignore a11y-click-events-have-key-events -->
60
60
  <div class="field">
61
61
  {#if statusText}
62
- <div class="file-view status">
62
+ <div class="file-view status" class:disabled>
63
63
  <div class="filename">{statusText}</div>
64
64
  {#if !disabled || (allowClear === true && disabled)}
65
65
  <div class="delete-button" on:click={clearFile}>
@@ -68,7 +68,7 @@
68
68
  {/if}
69
69
  </div>
70
70
  {:else if value}
71
- <div class="file-view">
71
+ <div class="file-view" class:disabled>
72
72
  {#if previewUrl}
73
73
  <img class="preview" alt="" src={previewUrl} />
74
74
  {/if}
@@ -84,7 +84,7 @@
84
84
  {/if}
85
85
  {#if !disabled || (allowClear === true && disabled)}
86
86
  <div class="delete-button" on:click={clearFile}>
87
- <Icon name="x" size="XS" />
87
+ <Icon name="x" size="XS" {disabled} />
88
88
  </div>
89
89
  {/if}
90
90
  </div>
@@ -107,6 +107,9 @@
107
107
  border-radius: var(--spectrum-global-dimension-size-50);
108
108
  padding: 0px var(--spectrum-alias-item-padding-m);
109
109
  }
110
+ .file-view.disabled {
111
+ color: var(--spectrum-alias-text-color-disabled);
112
+ }
110
113
  .file-view.status {
111
114
  background-color: var(--spectrum-global-color-gray-100);
112
115
  }
@@ -5,7 +5,7 @@
5
5
 
6
6
  export let value: any = undefined
7
7
  export let label: string | undefined = undefined
8
- export let labelPosition: "above" = "above"
8
+ export let labelPosition: "above" | "left" = "above"
9
9
  export let placeholder: string | undefined = undefined
10
10
  export let type = "text"
11
11
  export let disabled = false
@@ -15,6 +15,7 @@
15
15
  import Portal from "svelte-portal"
16
16
  import Context from "../context"
17
17
  import { ModalCancelFrom } from "../constants"
18
+ import { generate } from "shortid"
18
19
 
19
20
  export let fixed: boolean = false
20
21
  export let inline: boolean = false
@@ -23,7 +24,9 @@
23
24
  export let zIndex: number = 1001
24
25
 
25
26
  // Ensure any popovers inside this modal are rendered inside this modal
26
- setContext(Context.PopoverRoot, ".spectrum-Modal")
27
+ // Unique ids are required to ensure nested modals are parented correctly
28
+ const uniqueId = generate()
29
+ setContext(Context.PopoverRoot, `.spectrum-Modal-${uniqueId}`)
27
30
 
28
31
  const dispatch = createEventDispatcher<{
29
32
  show: void
@@ -108,7 +111,11 @@
108
111
 
109
112
  {#if inline}
110
113
  {#if visible}
111
- <div use:focusModal bind:this={modal} class="spectrum-Modal inline is-open">
114
+ <div
115
+ use:focusModal
116
+ bind:this={modal}
117
+ class={`spectrum-Modal spectrum-Modal-${uniqueId} inline is-open`}
118
+ >
112
119
  <slot />
113
120
  </div>
114
121
  {/if}
@@ -146,7 +153,7 @@
146
153
  <div
147
154
  use:focusModal
148
155
  bind:this={modal}
149
- class="spectrum-Modal is-open"
156
+ class={`spectrum-Modal spectrum-Modal-${uniqueId} is-open`}
150
157
  in:fly={{ y: 30, duration: 200 }}
151
158
  out:fly|local={{ y: 30, duration: 200 }}
152
159
  >
@@ -172,12 +179,12 @@
172
179
  }
173
180
  .background {
174
181
  background: var(--modal-background, rgba(0, 0, 0, 0.75));
182
+ opacity: 0.65;
175
183
  position: fixed;
176
184
  top: 0;
177
185
  left: 0;
178
186
  height: 100vh;
179
187
  width: 100vw;
180
- opacity: 0.65;
181
188
  pointer-events: none;
182
189
  }
183
190