@budibase/bbui 2.8.18-alpha.0 → 2.8.18-alpha.2

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": "2.8.18-alpha.0",
4
+ "version": "2.8.18-alpha.2",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,8 +38,8 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
41
- "@budibase/shared-core": "2.8.18-alpha.0",
42
- "@budibase/string-templates": "2.8.18-alpha.0",
41
+ "@budibase/shared-core": "2.8.18-alpha.2",
42
+ "@budibase/string-templates": "2.8.18-alpha.2",
43
43
  "@spectrum-css/accordion": "3.0.24",
44
44
  "@spectrum-css/actionbutton": "1.0.1",
45
45
  "@spectrum-css/actiongroup": "1.0.1",
@@ -104,5 +104,5 @@
104
104
  }
105
105
  }
106
106
  },
107
- "gitHead": "6e359b00d71205692a6e4edafa71fd6fecb66084"
107
+ "gitHead": "22cbe40b24df7635cd45c60f5f209d5542ce9686"
108
108
  }
@@ -12,23 +12,24 @@
12
12
  export let getOptionValue = option => option
13
13
 
14
14
  const dispatch = createEventDispatcher()
15
+
15
16
  const onChange = e => {
16
- let tempValue = value
17
- let isChecked = e.target.checked
18
- if (!tempValue.includes(e.target.value) && isChecked) {
19
- tempValue.push(e.target.value)
17
+ const optionValue = e.target.value
18
+ if (e.target.checked && !value.includes(optionValue)) {
19
+ dispatch("change", [...value, optionValue])
20
+ } else {
21
+ dispatch(
22
+ "change",
23
+ value.filter(x => x !== optionValue)
24
+ )
20
25
  }
21
- value = tempValue
22
- dispatch(
23
- "change",
24
- tempValue.filter(val => val !== e.target.value || isChecked)
25
- )
26
26
  }
27
27
  </script>
28
28
 
29
29
  <div class={`spectrum-FieldGroup spectrum-FieldGroup--${direction}`}>
30
30
  {#if options && Array.isArray(options)}
31
31
  {#each options as option}
32
+ {@const optionValue = getOptionValue(option)}
32
33
  <div
33
34
  title={getOptionLabel(option)}
34
35
  class="spectrum-Checkbox spectrum-FieldGroup-item"
@@ -39,11 +40,11 @@
39
40
  >
40
41
  <input
41
42
  on:change={onChange}
42
- value={getOptionValue(option)}
43
43
  type="checkbox"
44
44
  class="spectrum-Checkbox-input"
45
+ value={optionValue}
46
+ checked={value.includes(optionValue)}
45
47
  {disabled}
46
- checked={value.includes(getOptionValue(option))}
47
48
  />
48
49
  <span class="spectrum-Checkbox-box">
49
50
  <svg