@budibase/bbui 1.0.76-alpha.3 → 1.0.76-alpha.6

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.76-alpha.3",
4
+ "version": "1.0.76-alpha.6",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -84,5 +84,5 @@
84
84
  "svelte-flatpickr": "^3.2.3",
85
85
  "svelte-portal": "^1.0.0"
86
86
  },
87
- "gitHead": "32491291e0e09abe788a7163b548925bbaf416a0"
87
+ "gitHead": "93eb042c4e107db9f1f035780a7fb3ff7791dcff"
88
88
  }
@@ -54,34 +54,43 @@
54
54
 
55
55
  <svelte:window on:keydown={handleKey} />
56
56
 
57
- <!-- These svelte if statements need to be defined like this. -->
58
- <!-- The modal transitions do not work if nested inside more than one "if" -->
59
- {#if visible && inline}
60
- <div use:focusFirstInput class="spectrum-Modal inline is-open">
61
- <slot />
62
- </div>
63
- {:else if visible}
57
+ {#if inline}
58
+ {#if visible}
59
+ <div use:focusFirstInput class="spectrum-Modal inline is-open">
60
+ <slot />
61
+ </div>
62
+ {/if}
63
+ {:else}
64
+ <!--
65
+ We cannot conditionally render the portal as this leads to a missing
66
+ insertion point when using nested modals. Therefore we just conditionally
67
+ render the content of the portal.
68
+ It still breaks the modal animation, but its better than soft bricking the
69
+ screen.
70
+ -->
64
71
  <Portal target=".modal-container">
65
- <div
66
- class="spectrum-Underlay is-open"
67
- in:fade={{ duration: 200 }}
68
- out:fade|local={{ duration: 200 }}
69
- on:mousedown|self={cancel}
70
- >
71
- <div class="modal-wrapper" on:mousedown|self={cancel}>
72
- <div class="modal-inner-wrapper" on:mousedown|self={cancel}>
73
- <slot name="outside" />
74
- <div
75
- use:focusFirstInput
76
- class="spectrum-Modal is-open"
77
- in:fly={{ y: 30, duration: 200 }}
78
- out:fly|local={{ y: 30, duration: 200 }}
79
- >
80
- <slot />
72
+ {#if visible}
73
+ <div
74
+ class="spectrum-Underlay is-open"
75
+ in:fade={{ duration: 200 }}
76
+ out:fade|local={{ duration: 200 }}
77
+ on:mousedown|self={cancel}
78
+ >
79
+ <div class="modal-wrapper" on:mousedown|self={cancel}>
80
+ <div class="modal-inner-wrapper" on:mousedown|self={cancel}>
81
+ <slot name="outside" />
82
+ <div
83
+ use:focusFirstInput
84
+ class="spectrum-Modal is-open"
85
+ in:fly={{ y: 30, duration: 200 }}
86
+ out:fly|local={{ y: 30, duration: 200 }}
87
+ >
88
+ <slot />
89
+ </div>
81
90
  </div>
82
91
  </div>
83
92
  </div>
84
- </div>
93
+ {/if}
85
94
  </Portal>
86
95
  {/if}
87
96