@budibase/bbui 2.1.6 → 2.1.8

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.1.6",
4
+ "version": "2.1.8",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "^1.2.1",
41
- "@budibase/string-templates": "^2.1.6",
41
+ "@budibase/string-templates": "^2.1.8",
42
42
  "@spectrum-css/actionbutton": "^1.0.1",
43
43
  "@spectrum-css/actiongroup": "^1.0.1",
44
44
  "@spectrum-css/avatar": "^3.0.2",
@@ -85,5 +85,5 @@
85
85
  "svelte-flatpickr": "^3.2.3",
86
86
  "svelte-portal": "^1.0.0"
87
87
  },
88
- "gitHead": "9e9ab30b91df5e297ff418ea75fb6e796feb1c4f"
88
+ "gitHead": "0bc417587c0d4b325d58a35abfe5150014432273"
89
89
  }
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import Picker from "./Picker.svelte"
3
- import { createEventDispatcher, onMount } from "svelte"
3
+ import { createEventDispatcher } from "svelte"
4
4
 
5
5
  export let value = []
6
6
  export let id = null
@@ -16,29 +16,6 @@
16
16
  export let autoWidth = false
17
17
 
18
18
  const dispatch = createEventDispatcher()
19
- const parseValues = value => {
20
- return Array.isArray(value)
21
- ? value.reduce((acc, entry) => {
22
- if (typeof ele === "string" && entry.trim() === "") {
23
- return acc
24
- }
25
- let processedOption = String(entry)
26
- if (options.indexOf(processedOption) > -1) {
27
- acc.push(processedOption)
28
- }
29
- return acc
30
- }, [])
31
- : []
32
- }
33
- let loaded = false
34
-
35
- $: combinedValues = value ? [...value].concat(options) : []
36
- $: superSet = new Set(combinedValues)
37
-
38
- $: if (loaded && options.length != superSet.size) {
39
- // ensure that the values being pushed in are valid.
40
- dispatch("change", parseValues(value))
41
- }
42
19
 
43
20
  $: selectedLookupMap = getSelectedLookupMap(value)
44
21
  $: optionLookupMap = getOptionLookupMap(options)
@@ -95,10 +72,6 @@
95
72
  }
96
73
  }
97
74
  }
98
-
99
- onMount(() => {
100
- loaded = true
101
- })
102
75
  </script>
103
76
 
104
77
  <Picker
@@ -61,6 +61,7 @@
61
61
  const onPickPrimary = newValue => {
62
62
  dispatch("pickprimary", newValue)
63
63
  primaryOpen = false
64
+ dispatch("closed")
64
65
  }
65
66
 
66
67
  const onClearPrimary = () => {
@@ -92,6 +93,7 @@
92
93
  if (primaryOpen) {
93
94
  event.stopPropagation()
94
95
  primaryOpen = false
96
+ dispatch("closed")
95
97
  }
96
98
  }
97
99
 
@@ -128,5 +128,6 @@
128
128
  on:blur
129
129
  on:focus
130
130
  on:keyup
131
+ on:closed
131
132
  />
132
133
  </Field>