@budibase/bbui 1.0.207-alpha.2 → 1.0.208

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": "1.0.207-alpha.2",
4
+ "version": "1.0.208",
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": "^1.0.207-alpha.2",
41
+ "@budibase/string-templates": "^1.0.208",
42
42
  "@spectrum-css/actionbutton": "^1.0.1",
43
43
  "@spectrum-css/actiongroup": "^1.0.1",
44
44
  "@spectrum-css/avatar": "^3.0.2",
@@ -84,5 +84,5 @@
84
84
  "svelte-flatpickr": "^3.2.3",
85
85
  "svelte-portal": "^1.0.0"
86
86
  },
87
- "gitHead": "2600c8407747ee26a2b3cea60e77651e14ffe5e3"
87
+ "gitHead": "e750e91b585fec658bd3dd7ba4ed1733360f0492"
88
88
  }
@@ -14,7 +14,6 @@
14
14
  export let active = false
15
15
  export let tooltip = undefined
16
16
  export let dataCy
17
- export let newStyles = false
18
17
 
19
18
  let showTooltip = false
20
19
  </script>
@@ -26,7 +25,6 @@
26
25
  class:spectrum-Button--warning={warning}
27
26
  class:spectrum-Button--overBackground={overBackground}
28
27
  class:spectrum-Button--quiet={quiet}
29
- class:new-styles={newStyles}
30
28
  class:active
31
29
  class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
32
30
  {disabled}
@@ -95,20 +93,4 @@
95
93
  padding-left: var(--spacing-m);
96
94
  line-height: 0;
97
95
  }
98
- .spectrum-Button--primary.new-styles {
99
- background: var(--spectrum-global-color-gray-800);
100
- border-color: transparent;
101
- color: var(--spectrum-global-color-gray-50);
102
- }
103
- .spectrum-Button--primary.new-styles:hover {
104
- background: var(--spectrum-global-color-gray-900);
105
- }
106
- .spectrum-Button--secondary.new-styles {
107
- background: var(--spectrum-global-color-gray-200);
108
- border-color: transparent;
109
- color: var(--spectrum-global-color-gray-900);
110
- }
111
- .spectrum-Button--secondary.new-styles:hover {
112
- background: var(--spectrum-global-color-gray-300);
113
- }
114
96
  </style>
@@ -18,6 +18,23 @@
18
18
  const dispatch = createEventDispatcher()
19
19
  let open = false
20
20
  let focus = false
21
+ $: fieldText = getFieldText(value, options, placeholder)
22
+
23
+ const getFieldText = (value, options, placeholder) => {
24
+ // Always use placeholder if no value
25
+ if (value == null || value === "") {
26
+ return placeholder || "Choose an option or type"
27
+ }
28
+
29
+ // Wait for options to load if there is a value but no options
30
+ if (!options?.length) {
31
+ return ""
32
+ }
33
+
34
+ // Render the label if the selected option is found, otherwise raw value
35
+ const selected = options.find(option => getOptionValue(option) === value)
36
+ return selected ? getOptionLabel(selected) : value
37
+ }
21
38
 
22
39
  const selectOption = value => {
23
40
  dispatch("change", value)
@@ -199,7 +199,6 @@
199
199
  }
200
200
  .spectrum-Picker {
201
201
  width: 100%;
202
- box-shadow: none;
203
202
  }
204
203
  .spectrum-Picker-label:not(.auto-width) {
205
204
  overflow: hidden;
@@ -112,8 +112,4 @@
112
112
  .spectrum-Textfield {
113
113
  width: 100%;
114
114
  }
115
- input:disabled {
116
- color: var(--spectrum-global-color-gray-600) !important;
117
- -webkit-text-fill-color: var(--spectrum-global-color-gray-600) !important;
118
- }
119
115
  </style>