@budibase/bbui 3.4.3 → 3.4.4

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.mjs CHANGED
@@ -2027,14 +2027,17 @@ function instance$1_(f, u, p) {
2027
2027
  }, ee = () => {
2028
2028
  D || S || p(9, K = !0);
2029
2029
  }, te = (De) => {
2030
- D || S || (p(9, K = !1), $(De.target.value));
2030
+ var le;
2031
+ D || S || (p(9, K = !1), $((le = De == null ? void 0 : De.target) == null ? void 0 : le.value));
2031
2032
  }, pe = (De) => {
2032
- D || !R || S || $(De.target.value);
2033
+ var le;
2034
+ D || !R || S || $((le = De.target) == null ? void 0 : le.value);
2033
2035
  }, ge = (De) => {
2034
- D || S || De.key === "Enter" && $(De.target.value);
2036
+ var le;
2037
+ D || S || De.key === "Enter" && $((le = De.target) == null ? void 0 : le.value);
2035
2038
  }, oe = (De) => De === "bigint" ? "numeric" : De === "number" ? "decimal" : "text";
2036
2039
  onMount(async () => {
2037
- S || (p(9, K = N), K && (await tick(), Y.focus()));
2040
+ S || (p(9, K = N || !1), K && (await tick(), Y.focus()));
2038
2041
  });
2039
2042
  function Se(De) {
2040
2043
  bubble.call(this, f, De);
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.4.3",
4
+ "version": "3.4.4",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.ts",
7
7
  "module": "dist/bbui.mjs",
@@ -99,5 +99,5 @@
99
99
  }
100
100
  }
101
101
  },
102
- "gitHead": "2983095231e843a4d78238f2c167b5e01f9a40d1"
102
+ "gitHead": "5206c3baf1a9bc204b236a692cf22add10fcbb20"
103
103
  }
@@ -1,8 +1,9 @@
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 { UIEvent } from "@budibase/types"
4
5
 
5
- export let value = null
6
+ export let value: string | null = null
6
7
  export let placeholder: string | undefined = undefined
7
8
  export let type = "text"
8
9
  export let disabled = false
@@ -11,7 +12,7 @@
11
12
  export let updateOnChange = true
12
13
  export let quiet = false
13
14
  export let align: "left" | "right" | "center" | undefined = undefined
14
- export let autofocus = false
15
+ export let autofocus: boolean | null = false
15
16
  export let autocomplete: boolean | undefined
16
17
 
17
18
  const dispatch = createEventDispatcher()
@@ -24,7 +25,7 @@
24
25
  return
25
26
  }
26
27
  if (type === "number") {
27
- const float = parseFloat(newValue)
28
+ const float = parseFloat(newValue as string)
28
29
  newValue = isNaN(float) ? null : float
29
30
  }
30
31
  dispatch("change", newValue)
@@ -37,31 +38,31 @@
37
38
  focus = true
38
39
  }
39
40
 
40
- const onBlur = (event: any) => {
41
+ const onBlur = (event: UIEvent) => {
41
42
  if (readonly || disabled) {
42
43
  return
43
44
  }
44
45
  focus = false
45
- updateValue(event.target.value)
46
+ updateValue(event?.target?.value)
46
47
  }
47
48
 
48
- const onInput = (event: any) => {
49
+ const onInput = (event: UIEvent) => {
49
50
  if (readonly || !updateOnChange || disabled) {
50
51
  return
51
52
  }
52
- updateValue(event.target.value)
53
+ updateValue(event.target?.value)
53
54
  }
54
55
 
55
- const updateValueOnEnter = (event: any) => {
56
+ const updateValueOnEnter = (event: UIEvent) => {
56
57
  if (readonly || disabled) {
57
58
  return
58
59
  }
59
60
  if (event.key === "Enter") {
60
- updateValue(event.target.value)
61
+ updateValue(event.target?.value)
61
62
  }
62
63
  }
63
64
 
64
- const getInputMode = (type: any) => {
65
+ const getInputMode = (type: string) => {
65
66
  if (type === "bigint") {
66
67
  return "numeric"
67
68
  }
@@ -77,7 +78,7 @@
77
78
 
78
79
  onMount(async () => {
79
80
  if (disabled) return
80
- focus = autofocus
81
+ focus = autofocus || false
81
82
  if (focus) {
82
83
  await tick()
83
84
  field.focus()