@budibase/bbui 2.13.15 → 2.13.17
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 +3 -3
- package/dist/bbui.es.js.map +1 -1
- package/package.json +4 -4
- package/src/ButtonGroup/ButtonGroup.svelte +1 -1
- package/src/FancyForm/FancySelect.svelte +3 -0
- package/src/Form/Core/InputDropdown.svelte +51 -35
- package/src/Form/Core/Picker.svelte +5 -7
- package/src/Form/Core/Select.svelte +4 -2
- package/src/Form/InputDropdown.svelte +1 -0
- package/src/Form/Select.svelte +3 -1
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.13.
|
|
4
|
+
"version": "2.13.17",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
|
39
|
-
"@budibase/shared-core": "2.13.
|
|
40
|
-
"@budibase/string-templates": "2.13.
|
|
39
|
+
"@budibase/shared-core": "2.13.17",
|
|
40
|
+
"@budibase/string-templates": "2.13.17",
|
|
41
41
|
"@spectrum-css/accordion": "3.0.24",
|
|
42
42
|
"@spectrum-css/actionbutton": "1.0.1",
|
|
43
43
|
"@spectrum-css/actiongroup": "1.0.1",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "d700bb57d466691e2f0b4f8c6c1664a3c76efa81"
|
|
108
108
|
}
|
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
export let error = null
|
|
13
13
|
export let validate = null
|
|
14
14
|
export let options = []
|
|
15
|
+
export let footer = null
|
|
15
16
|
export let isOptionEnabled = () => true
|
|
16
17
|
export let getOptionLabel = option => extractProperty(option, "label")
|
|
17
18
|
export let getOptionValue = option => extractProperty(option, "value")
|
|
18
19
|
export let getOptionSubtitle = option => extractProperty(option, "subtitle")
|
|
19
20
|
export let getOptionColour = () => null
|
|
21
|
+
|
|
20
22
|
const dispatch = createEventDispatcher()
|
|
21
23
|
|
|
22
24
|
let open = false
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
{error}
|
|
101
103
|
{disabled}
|
|
102
104
|
{options}
|
|
105
|
+
{footer}
|
|
103
106
|
{getOptionLabel}
|
|
104
107
|
{getOptionValue}
|
|
105
108
|
{getOptionSubtitle}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
export let options = []
|
|
18
18
|
export let getOptionLabel = option => extractProperty(option, "label")
|
|
19
19
|
export let getOptionValue = option => extractProperty(option, "value")
|
|
20
|
-
|
|
20
|
+
export let getOptionSubtitle = option => option?.subtitle
|
|
21
21
|
export let isOptionSelected = () => false
|
|
22
22
|
|
|
23
23
|
const dispatch = createEventDispatcher()
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
class="spectrum-Textfield-input spectrum-InputGroup-input"
|
|
136
136
|
/>
|
|
137
137
|
</div>
|
|
138
|
-
<div style="width:
|
|
138
|
+
<div style="width: 40%">
|
|
139
139
|
<button
|
|
140
140
|
{id}
|
|
141
141
|
class="spectrum-Picker spectrum-Picker--sizeM override-borders"
|
|
@@ -157,38 +157,43 @@
|
|
|
157
157
|
<use xlink:href="#spectrum-css-icon-Chevron100" />
|
|
158
158
|
</svg>
|
|
159
159
|
</button>
|
|
160
|
-
{#if open}
|
|
161
|
-
<div
|
|
162
|
-
use:clickOutside={handleOutsideClick}
|
|
163
|
-
transition:fly|local={{ y: -20, duration: 200 }}
|
|
164
|
-
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
|
|
165
|
-
>
|
|
166
|
-
<ul class="spectrum-Menu" role="listbox">
|
|
167
|
-
{#each options as option, idx}
|
|
168
|
-
<li
|
|
169
|
-
class="spectrum-Menu-item"
|
|
170
|
-
class:is-selected={isOptionSelected(getOptionValue(option, idx))}
|
|
171
|
-
role="option"
|
|
172
|
-
aria-selected="true"
|
|
173
|
-
tabindex="0"
|
|
174
|
-
on:click={() => onPick(getOptionValue(option, idx))}
|
|
175
|
-
>
|
|
176
|
-
<span class="spectrum-Menu-itemLabel">
|
|
177
|
-
{getOptionLabel(option, idx)}
|
|
178
|
-
</span>
|
|
179
|
-
<svg
|
|
180
|
-
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"
|
|
181
|
-
focusable="false"
|
|
182
|
-
aria-hidden="true"
|
|
183
|
-
>
|
|
184
|
-
<use xlink:href="#spectrum-css-icon-Checkmark100" />
|
|
185
|
-
</svg>
|
|
186
|
-
</li>
|
|
187
|
-
{/each}
|
|
188
|
-
</ul>
|
|
189
|
-
</div>
|
|
190
|
-
{/if}
|
|
191
160
|
</div>
|
|
161
|
+
{#if open}
|
|
162
|
+
<div
|
|
163
|
+
use:clickOutside={handleOutsideClick}
|
|
164
|
+
transition:fly|local={{ y: -20, duration: 200 }}
|
|
165
|
+
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
|
|
166
|
+
>
|
|
167
|
+
<ul class="spectrum-Menu" role="listbox">
|
|
168
|
+
{#each options as option, idx}
|
|
169
|
+
<li
|
|
170
|
+
class="spectrum-Menu-item"
|
|
171
|
+
class:is-selected={isOptionSelected(getOptionValue(option, idx))}
|
|
172
|
+
role="option"
|
|
173
|
+
aria-selected="true"
|
|
174
|
+
tabindex="0"
|
|
175
|
+
on:click={() => onPick(getOptionValue(option, idx))}
|
|
176
|
+
>
|
|
177
|
+
<span class="spectrum-Menu-itemLabel">
|
|
178
|
+
{getOptionLabel(option, idx)}
|
|
179
|
+
{#if getOptionSubtitle(option, idx)}
|
|
180
|
+
<span class="subtitle-text">
|
|
181
|
+
{getOptionSubtitle(option, idx)}
|
|
182
|
+
</span>
|
|
183
|
+
{/if}
|
|
184
|
+
</span>
|
|
185
|
+
<svg
|
|
186
|
+
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"
|
|
187
|
+
focusable="false"
|
|
188
|
+
aria-hidden="true"
|
|
189
|
+
>
|
|
190
|
+
<use xlink:href="#spectrum-css-icon-Checkmark100" />
|
|
191
|
+
</svg>
|
|
192
|
+
</li>
|
|
193
|
+
{/each}
|
|
194
|
+
</ul>
|
|
195
|
+
</div>
|
|
196
|
+
{/if}
|
|
192
197
|
</div>
|
|
193
198
|
|
|
194
199
|
<style>
|
|
@@ -196,7 +201,6 @@
|
|
|
196
201
|
min-width: 0;
|
|
197
202
|
width: 100%;
|
|
198
203
|
}
|
|
199
|
-
|
|
200
204
|
.spectrum-InputGroup-input {
|
|
201
205
|
border-right-width: 1px;
|
|
202
206
|
}
|
|
@@ -206,7 +210,6 @@
|
|
|
206
210
|
.spectrum-Textfield-input {
|
|
207
211
|
width: 0;
|
|
208
212
|
}
|
|
209
|
-
|
|
210
213
|
.override-borders {
|
|
211
214
|
border-top-left-radius: 0px;
|
|
212
215
|
border-bottom-left-radius: 0px;
|
|
@@ -215,5 +218,18 @@
|
|
|
215
218
|
max-height: 240px;
|
|
216
219
|
z-index: 999;
|
|
217
220
|
top: 100%;
|
|
221
|
+
width: 100%;
|
|
222
|
+
}
|
|
223
|
+
.subtitle-text {
|
|
224
|
+
font-size: 12px;
|
|
225
|
+
line-height: 15px;
|
|
226
|
+
font-weight: 500;
|
|
227
|
+
color: var(--spectrum-global-color-gray-600);
|
|
228
|
+
display: block;
|
|
229
|
+
margin-top: var(--spacing-s);
|
|
230
|
+
}
|
|
231
|
+
.spectrum-Menu-checkmark {
|
|
232
|
+
align-self: center;
|
|
233
|
+
margin-top: 0;
|
|
218
234
|
}
|
|
219
235
|
</style>
|
|
@@ -224,13 +224,12 @@
|
|
|
224
224
|
</span>
|
|
225
225
|
{/if}
|
|
226
226
|
<span class="spectrum-Menu-itemLabel">
|
|
227
|
+
{getOptionLabel(option, idx)}
|
|
227
228
|
{#if getOptionSubtitle(option, idx)}
|
|
228
|
-
<span class="subtitle-text"
|
|
229
|
-
|
|
230
|
-
>
|
|
229
|
+
<span class="subtitle-text">
|
|
230
|
+
{getOptionSubtitle(option, idx)}
|
|
231
|
+
</span>
|
|
231
232
|
{/if}
|
|
232
|
-
|
|
233
|
-
{getOptionLabel(option, idx)}
|
|
234
233
|
</span>
|
|
235
234
|
{#if option.tag}
|
|
236
235
|
<span class="option-tag">
|
|
@@ -275,10 +274,9 @@
|
|
|
275
274
|
font-size: 12px;
|
|
276
275
|
line-height: 15px;
|
|
277
276
|
font-weight: 500;
|
|
278
|
-
top: 10px;
|
|
279
277
|
color: var(--spectrum-global-color-gray-600);
|
|
280
278
|
display: block;
|
|
281
|
-
margin-
|
|
279
|
+
margin-top: var(--spacing-s);
|
|
282
280
|
}
|
|
283
281
|
|
|
284
282
|
.spectrum-Picker-label.auto-width {
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
export let getOptionLabel = option => option
|
|
11
11
|
export let getOptionValue = option => option
|
|
12
12
|
export let getOptionIcon = () => null
|
|
13
|
-
export let useOptionIconImage = false
|
|
14
13
|
export let getOptionColour = () => null
|
|
14
|
+
export let getOptionSubtitle = () => null
|
|
15
|
+
export let useOptionIconImage = false
|
|
15
16
|
export let isOptionEnabled
|
|
16
17
|
export let readonly = false
|
|
17
18
|
export let quiet = false
|
|
@@ -82,8 +83,9 @@
|
|
|
82
83
|
{getOptionLabel}
|
|
83
84
|
{getOptionValue}
|
|
84
85
|
{getOptionIcon}
|
|
85
|
-
{useOptionIconImage}
|
|
86
86
|
{getOptionColour}
|
|
87
|
+
{getOptionSubtitle}
|
|
88
|
+
{useOptionIconImage}
|
|
87
89
|
{isOptionEnabled}
|
|
88
90
|
{autocomplete}
|
|
89
91
|
{sort}
|
package/src/Form/Select.svelte
CHANGED
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
export let options = []
|
|
14
14
|
export let getOptionLabel = option => extractProperty(option, "label")
|
|
15
15
|
export let getOptionValue = option => extractProperty(option, "value")
|
|
16
|
+
export let getOptionSubtitle = option => option?.subtitle
|
|
16
17
|
export let getOptionIcon = option => option?.icon
|
|
17
|
-
export let useOptionIconImage = false
|
|
18
18
|
export let getOptionColour = option => option?.colour
|
|
19
|
+
export let useOptionIconImage = false
|
|
19
20
|
export let isOptionEnabled
|
|
20
21
|
export let quiet = false
|
|
21
22
|
export let autoWidth = false
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
{getOptionValue}
|
|
59
60
|
{getOptionIcon}
|
|
60
61
|
{getOptionColour}
|
|
62
|
+
{getOptionSubtitle}
|
|
61
63
|
{useOptionIconImage}
|
|
62
64
|
{isOptionEnabled}
|
|
63
65
|
{autocomplete}
|