@budibase/bbui 3.23.48 → 3.24.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,13 +1,13 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "3.23.48",
4
+ "version": "3.24.0",
5
5
  "license": "MPL-2.0",
6
- "svelte": "src/index.ts",
7
6
  "module": "dist/bbui.mjs",
8
7
  "exports": {
9
8
  ".": {
10
- "import": "./dist/bbui.mjs"
9
+ "import": "./dist/bbui.mjs",
10
+ "svelte": "./src/index.ts"
11
11
  },
12
12
  "./package.json": "./package.json"
13
13
  },
@@ -16,7 +16,7 @@
16
16
  "dev": "vite build --watch --mode=dev"
17
17
  },
18
18
  "devDependencies": {
19
- "@sveltejs/vite-plugin-svelte": "1.4.0",
19
+ "@sveltejs/vite-plugin-svelte": "^6.1.3",
20
20
  "vite-plugin-css-injected-by-js": "3.5.2"
21
21
  },
22
22
  "keywords": [
@@ -107,5 +107,5 @@
107
107
  }
108
108
  }
109
109
  },
110
- "gitHead": "0a78faa2adbb8fb3b81de2b9b00352e60178f12f"
110
+ "gitHead": "7cfa950d39730aa88a1c26c60f8094d6f0b0606d"
111
111
  }
@@ -23,7 +23,7 @@
23
23
  // This is needed because display: contents is considered "invisible".
24
24
  // It should only ever be an action button, so should be fine.
25
25
  function getAnchor(node: HTMLDivElement) {
26
- anchor = (node.firstChild as HTMLElement) ?? undefined
26
+ anchor = (node.firstElementChild as HTMLElement) ?? undefined
27
27
  }
28
28
 
29
29
  export const show = () => {
@@ -81,8 +81,16 @@
81
81
  borderRadius={roundedPopover ? "12px" : undefined}
82
82
  on:open
83
83
  on:close
84
- on:mouseenter={openOnHover ? cancelHide : null}
85
- on:mouseleave={openOnHover ? queueHide : null}
84
+ on:mouseenter={() => {
85
+ if (openOnHover) {
86
+ cancelHide()
87
+ }
88
+ }}
89
+ on:mouseleave={() => {
90
+ if (openOnHover) {
91
+ queueHide()
92
+ }
93
+ }}
86
94
  bind:open
87
95
  >
88
96
  <Menu>
@@ -196,7 +196,7 @@
196
196
  class="fill {themeClasses}"
197
197
  style={value ? `background: ${value};` : ""}
198
198
  class:placeholder={!value}
199
- />
199
+ ></div>
200
200
  </div>
201
201
 
202
202
  <!-- svelte-ignore a11y-no-static-element-interactions -->
@@ -178,7 +178,7 @@
178
178
  class="underlay"
179
179
  class:hidden={!$modal}
180
180
  transition:drawerFade|local
181
- />
181
+ ></div>
182
182
  <div
183
183
  class="drawer"
184
184
  class:stacked={depth > 0}
@@ -211,7 +211,7 @@
211
211
  </div>
212
212
  </header>
213
213
  <slot name="body" />
214
- <div class="overlay" class:hidden={$modal || depth === 0} />
214
+ <div class="overlay" class:hidden={$modal || depth === 0}></div>
215
215
  </div>
216
216
  </div>
217
217
  </Portal>
@@ -1,9 +1,9 @@
1
1
  <script lang="ts">
2
- import { Icon } from "@budibase/bbui"
3
2
  import "@spectrum-css/checkbox/dist/index-vars.css"
4
3
  import "@spectrum-css/fieldgroup/dist/index-vars.css"
5
4
  import { createEventDispatcher } from "svelte"
6
5
  import type { ChangeEventHandler } from "svelte/elements"
6
+ import Icon from "../../Icon/Icon.svelte"
7
7
 
8
8
  export let value = false
9
9
  export let id: string | undefined = undefined
@@ -7,7 +7,7 @@
7
7
  import "@spectrum-css/fieldgroup/dist/index-vars.css"
8
8
  import "@spectrum-css/radio/dist/index-vars.css"
9
9
  import { createEventDispatcher } from "svelte"
10
- import { Icon } from "@budibase/bbui"
10
+ import Icon from "../../Icon/Icon.svelte"
11
11
 
12
12
  export let direction: "horizontal" | "vertical" = "vertical"
13
13
  export let value: V[] = []
@@ -154,7 +154,7 @@
154
154
  <div class="spectrum-Menu-itemLabel">
155
155
  <div class="primary-text">
156
156
  {variable.name}
157
- <span />
157
+ <span></span>
158
158
  </div>
159
159
  </div>
160
160
  </li>
@@ -83,7 +83,6 @@
83
83
 
84
84
  let button: HTMLButtonElement | null = null
85
85
  let component: HTMLUListElement | null = null
86
- let optionIconDescriptor: ResolvedIcon | null = null
87
86
  let virtualizedOptions: Array<{ option: O; idx: number }> = []
88
87
  let virtualPaddingTop = 0
89
88
  let virtualPaddingBottom = 0
@@ -337,9 +336,10 @@
337
336
  class="virtual-spacer"
338
337
  aria-hidden="true"
339
338
  style={`height:${virtualPaddingTop}px`}
340
- />
339
+ ></li>
341
340
  {/if}
342
341
  {#each virtualizedOptions as { option, idx } (getOptionValue(option, idx) ?? idx)}
342
+ {@const optionIcon = resolveIcon(getOptionIcon(option, idx))}
343
343
  <li
344
344
  class="spectrum-Menu-item"
345
345
  class:is-selected={isOptionSelected(getOptionValue(option, idx))}
@@ -351,9 +351,9 @@
351
351
  on:mouseleave={e => onOptionMouseleave(e, option)}
352
352
  class:is-disabled={!isOptionEnabled(option)}
353
353
  >
354
- {#if (optionIconDescriptor = resolveIcon(getOptionIcon(option, idx)))}
354
+ {#if optionIcon}
355
355
  <span class="option-extra icon">
356
- <PickerIcon icon={optionIconDescriptor} {useOptionIconImage} />
356
+ <PickerIcon icon={optionIcon} {useOptionIconImage} />
357
357
  </span>
358
358
  {/if}
359
359
  {#if getOptionColour(option, idx)}
@@ -396,7 +396,7 @@
396
396
  class="virtual-spacer"
397
397
  aria-hidden="true"
398
398
  style={`height:${virtualPaddingBottom}px`}
399
- />
399
+ ></li>
400
400
  {/if}
401
401
  {/if}
402
402
  </ul>
@@ -49,7 +49,7 @@
49
49
  class="spectrum-Radio-input"
50
50
  {disabled}
51
51
  />
52
- <span class="spectrum-Radio-button" />
52
+ <span class="spectrum-Radio-button"></span>
53
53
  <label for="" class="spectrum-Radio-label">
54
54
  {getOptionLabel(option)}
55
55
  </label>
@@ -188,7 +188,7 @@
188
188
  id="signature-canvas"
189
189
  bind:this={canvasRef}
190
190
  style="--max-sig-width: {width}px; --max-sig-height: {height}px"
191
- />
191
+ ></canvas>
192
192
  {#if editable}
193
193
  <div class="indicator-overlay">
194
194
  <div class="sign-here">
@@ -26,7 +26,7 @@
26
26
  type="checkbox"
27
27
  class="spectrum-Switch-input"
28
28
  />
29
- <span class="spectrum-Switch-switch" />
29
+ <span class="spectrum-Switch-switch"></span>
30
30
  {#if text}
31
31
  <label class="spectrum-Switch-label" for={id}>{text}</label>
32
32
  {/if}
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import "@spectrum-css/textfield/dist/index-vars.css"
3
3
  import { createEventDispatcher, onMount, tick } from "svelte"
4
+ import type { FullAutoFill } from "svelte/elements"
4
5
  import type { UIEvent } from "@budibase/types"
5
6
 
6
7
  export let value: string | null = null
@@ -13,7 +14,7 @@
13
14
  export let quiet = false
14
15
  export let align: "left" | "right" | "center" | undefined = undefined
15
16
  export let autofocus: boolean | null = false
16
- export let autocomplete: boolean | string | undefined
17
+ export let autocomplete: FullAutoFill | boolean | null | undefined = undefined
17
18
 
18
19
  const dispatch = createEventDispatcher()
19
20
 
@@ -69,12 +70,16 @@
69
70
  return type === "number" ? "decimal" : "text"
70
71
  }
71
72
 
73
+ let autocompleteValue: FullAutoFill | null | undefined
74
+
72
75
  $: autocompleteValue =
73
76
  typeof autocomplete === "boolean"
74
77
  ? autocomplete
75
78
  ? "on"
76
79
  : "off"
77
- : undefined
80
+ : autocomplete === null
81
+ ? null
82
+ : autocomplete
78
83
 
79
84
  onMount(async () => {
80
85
  if (disabled) return
@@ -2,6 +2,7 @@
2
2
  import Field from "./Field.svelte"
3
3
  import TextField from "./Core/TextField.svelte"
4
4
  import { createEventDispatcher } from "svelte"
5
+ import type { FullAutoFill } from "svelte/elements"
5
6
 
6
7
  export let value: any = undefined
7
8
  export let label: string | undefined = undefined
@@ -14,7 +15,7 @@
14
15
  export let updateOnChange = true
15
16
  export let quiet = false
16
17
  export let autofocus: boolean | undefined = undefined
17
- export let autocomplete: boolean | string | undefined = undefined
18
+ export let autocomplete: FullAutoFill | boolean | null | undefined = undefined
18
19
  export let helpText: string | undefined = undefined
19
20
 
20
21
  const dispatch = createEventDispatcher<{
@@ -55,7 +55,7 @@
55
55
  aria-hidden={hidden ? "true" : "false"}
56
56
  aria-label={tooltip || name}
57
57
  title={tooltip}
58
- />
58
+ ></i>
59
59
 
60
60
  <style>
61
61
  i {
@@ -19,7 +19,7 @@
19
19
  <div class="main">
20
20
  <div class="content" class:wide class:noPadding class:narrow class:narrower>
21
21
  <slot />
22
- <div class="fix-scroll-padding" />
22
+ <div class="fix-scroll-padding"></div>
23
23
  </div>
24
24
  </div>
25
25
  <div
@@ -23,7 +23,7 @@
23
23
  }
24
24
  </script>
25
25
 
26
- <div class="markdown-viewer" style="height:{height};" bind:this={ref} />
26
+ <div class="markdown-viewer" style="height:{height};" bind:this={ref}></div>
27
27
 
28
28
  <style>
29
29
  .markdown-viewer {
@@ -42,7 +42,7 @@
42
42
  </script>
43
43
 
44
44
  <div class:disabled style={styleString}>
45
- <textarea disabled {id} bind:this={element} />
45
+ <textarea disabled {id} bind:this={element}></textarea>
46
46
  </div>
47
47
 
48
48
  <style>
@@ -1 +1 @@
1
- <li class="spectrum-Menu-divider" role="separator" />
1
+ <li class="spectrum-Menu-divider" role="separator"></li>
@@ -147,7 +147,7 @@
147
147
  class="background"
148
148
  in:fade={{ duration: 200 }}
149
149
  out:fade|local={{ duration: 200 }}
150
- />
150
+ ></div>
151
151
  <div class="modal-wrapper" on:mousedown|self={handleOutsideClick}>
152
152
  <div
153
153
  class="modal-inner-wrapper"
@@ -4,8 +4,10 @@
4
4
  import { createEventDispatcher } from "svelte"
5
5
  import { PhosphorIcons } from "./icons"
6
6
  import TextField from "../Form/Core/TextField.svelte"
7
- import { ActionButton, Body, PopoverAlignment } from "@budibase/bbui"
7
+ import ActionButton from "../ActionButton/ActionButton.svelte"
8
+ import Body from "../Typography/Body.svelte"
8
9
  import Popover from "../Popover/Popover.svelte"
10
+ import { PopoverAlignment } from "../constants"
9
11
 
10
12
  export let value: string | undefined
11
13
 
@@ -42,9 +42,9 @@
42
42
  style="width: {typeof value === 'number'
43
43
  ? value
44
44
  : 0}%; --duration: {duration}ms;"
45
- />
45
+ ></div>
46
46
  </div>
47
- <div class="spectrum-ProgressBar-label" hidden={false} />
47
+ <div class="spectrum-ProgressBar-label" hidden={false}></div>
48
48
  </div>
49
49
 
50
50
  <style>
@@ -48,16 +48,16 @@
48
48
  class:spectrum-ProgressCircle--overBackground={overBackground}
49
49
  class="spectrum-ProgressCircle spectrum-ProgressCircle--{convertSize(size)}"
50
50
  >
51
- <div class="spectrum-ProgressCircle-track" />
51
+ <div class="spectrum-ProgressCircle-track"></div>
52
52
  <div class="spectrum-ProgressCircle-fills">
53
53
  <div class="spectrum-ProgressCircle-fillMask1">
54
54
  <div class="spectrum-ProgressCircle-fillSubMask1" style={subMask1Style}>
55
- <div class="spectrum-ProgressCircle-fill" />
55
+ <div class="spectrum-ProgressCircle-fill"></div>
56
56
  </div>
57
57
  </div>
58
58
  <div class="spectrum-ProgressCircle-fillMask2">
59
59
  <div class="spectrum-ProgressCircle-fillSubMask2" style={subMask2Style}>
60
- <div class="spectrum-ProgressCircle-fill" />
60
+ <div class="spectrum-ProgressCircle-fill"></div>
61
61
  </div>
62
62
  </div>
63
63
  </div>
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { createEventDispatcher } from "svelte"
3
- import { AbsTooltip, ActionButton } from "@budibase/bbui"
3
+ import AbsTooltip from "../Tooltip/AbsTooltip.svelte"
4
+ import ActionButton from "../ActionButton/ActionButton.svelte"
4
5
 
5
6
  export let leftIcon: string
6
7
  export let leftNotificationTooltip: string | undefined = undefined
@@ -123,14 +123,14 @@
123
123
  class="spectrum-Tabs-selectionIndicator"
124
124
  class:emphasized
125
125
  style="width: {width}; height: {height}; left: {left}; top: {top};"
126
- />
126
+ ></div>
127
127
  {/if}
128
128
  </div>
129
129
 
130
130
  <div
131
131
  class="spectrum-Tabs-content spectrum-Tabs-content-{_id}"
132
132
  class:noPadding
133
- />
133
+ ></div>
134
134
 
135
135
  <style>
136
136
  .spectrum-Tabs--quiet {
@@ -97,7 +97,7 @@
97
97
  transition:fade|local={{ duration: 130 }}
98
98
  >
99
99
  <span class="spectrum-Tooltip-label">{text}</span>
100
- <span class="spectrum-Tooltip-tip" style={tipStyle} />
100
+ <span class="spectrum-Tooltip-tip" style={tipStyle}></span>
101
101
  </span>
102
102
  </Portal>
103
103
  {/if}
@@ -10,7 +10,7 @@
10
10
  {#if textWrapping}
11
11
  <span class="spectrum-Tooltip spectrum-Tooltip--{direction} is-open tooltip">
12
12
  <span class="spectrum-Tooltip-label">{text}</span>
13
- <span class="spectrum-Tooltip-tip" />
13
+ <span class="spectrum-Tooltip-tip"></span>
14
14
  </span>
15
15
  {:else}
16
16
  <!-- The default show on hover tooltip does not support text wrapping -->
@@ -18,7 +18,7 @@
18
18
  <slot />
19
19
  <div class={`spectrum-Tooltip spectrum-Tooltip--${direction}`}>
20
20
  <span class="spectrum-Tooltip-label">{text}</span>
21
- <span class="spectrum-Tooltip-tip" />
21
+ <span class="spectrum-Tooltip-tip"></span>
22
22
  </div>
23
23
  </span>
24
24
  {/if}