@budibase/bbui 0.9.185-alpha.18 → 0.9.185-alpha.21

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": "0.9.185-alpha.18",
4
+ "version": "0.9.185-alpha.21",
5
5
  "license": "AGPL-3.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": "aefc0a46953807c460bfb6ab11c5e541ef17a741"
85
+ "gitHead": "439c8cd3ef27c47e7a0a1ed4038ccbe964fddf77"
86
86
  }
@@ -6,6 +6,7 @@
6
6
  export let value = null
7
7
  export let label = undefined
8
8
  export let disabled = false
9
+ export let readonly = false
9
10
  export let labelPosition = "above"
10
11
  export let error = null
11
12
  export let placeholder = "Choose an option or type"
@@ -33,6 +34,7 @@
33
34
  {value}
34
35
  {options}
35
36
  {placeholder}
37
+ {readonly}
36
38
  {getOptionLabel}
37
39
  {getOptionValue}
38
40
  on:change={onChange}
@@ -9,6 +9,7 @@
9
9
  export let id = null
10
10
  export let placeholder = "Choose an option or type"
11
11
  export let disabled = false
12
+ export let readonly = false
12
13
  export let error = null
13
14
  export let options = []
14
15
  export let getOptionLabel = option => option
@@ -73,6 +74,7 @@
73
74
  value={value || ""}
74
75
  placeholder={placeholder || ""}
75
76
  {disabled}
77
+ {readonly}
76
78
  class="spectrum-Textfield-input spectrum-InputGroup-input"
77
79
  />
78
80
  </div>
@@ -16,15 +16,15 @@
16
16
  const dispatch = createEventDispatcher()
17
17
  let focus = false
18
18
 
19
- const updateValue = value => {
19
+ const updateValue = newValue => {
20
20
  if (readonly) {
21
21
  return
22
22
  }
23
23
  if (type === "number") {
24
- const float = parseFloat(value)
25
- value = isNaN(float) ? null : float
24
+ const float = parseFloat(newValue)
25
+ newValue = isNaN(float) ? null : float
26
26
  }
27
- dispatch("change", value)
27
+ dispatch("change", newValue)
28
28
  }
29
29
 
30
30
  const onFocus = () => {