@budibase/bbui 2.2.12-alpha.37 → 2.2.12-alpha.38

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.2.12-alpha.37",
4
+ "version": "2.2.12-alpha.38",
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.2.12-alpha.37",
41
+ "@budibase/string-templates": "2.2.12-alpha.38",
42
42
  "@spectrum-css/accordion": "3.0.24",
43
43
  "@spectrum-css/actionbutton": "1.0.1",
44
44
  "@spectrum-css/actiongroup": "1.0.1",
@@ -89,5 +89,5 @@
89
89
  "resolutions": {
90
90
  "loader-utils": "1.4.1"
91
91
  },
92
- "gitHead": "e8c4a6f60f81169a15114398c84d9948a9871bda"
92
+ "gitHead": "593ce49bfcdfd8bcede737459807643f4304d1dc"
93
93
  }
@@ -21,6 +21,7 @@
21
21
  let wrapper
22
22
 
23
23
  $: placeholder = !value
24
+ $: selectedLabel = getSelectedLabel(value)
24
25
 
25
26
  const extractProperty = (value, property) => {
26
27
  if (value && typeof value === "object") {
@@ -37,6 +38,17 @@
37
38
  }
38
39
  open = false
39
40
  }
41
+
42
+ const getSelectedLabel = value => {
43
+ if (!value || !options?.length) {
44
+ return ""
45
+ }
46
+ const selectedOption = options.find(x => getOptionValue(x) === value)
47
+ if (!selectedOption) {
48
+ return value
49
+ }
50
+ return getOptionLabel(selectedOption)
51
+ }
40
52
  </script>
41
53
 
42
54
  <FancyField
@@ -53,7 +65,7 @@
53
65
  {/if}
54
66
 
55
67
  <div class="value" class:placeholder>
56
- {value || ""}
68
+ {selectedLabel || ""}
57
69
  </div>
58
70
 
59
71
  <div class="arrow">