@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/dist/bbui.es.js +1 -1
- package/dist/bbui.es.js.map +1 -1
- package/package.json +4 -4
- package/src/Form/Core/CheckboxGroup.svelte +12 -11
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.
|
|
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.
|
|
42
|
-
"@budibase/string-templates": "2.8.18-alpha.
|
|
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": "
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|