@budibase/bbui 3.39.27 → 3.39.28
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.mjs +9 -18
- package/package.json +2 -2
- package/src/Form/Core/InputDropdown.svelte +1 -1
- package/src/Form/InputDropdown.svelte +22 -17
package/dist/bbui.mjs
CHANGED
|
@@ -49944,7 +49944,7 @@ function CollapsibleSearch(l, u) {
|
|
|
49944
49944
|
var root_3$13 = /* @__PURE__ */ from_html("<span class=\"subtitle-text svelte-1jm7byl\"> </span>"), root_2$15 = /* @__PURE__ */ from_html("<li role=\"option\" aria-selected=\"true\" tabindex=\"0\"><span class=\"spectrum-Menu-itemLabel\"> <!></span> <div class=\"check svelte-1jm7byl\"><!></div></li>"), root_1$28 = /* @__PURE__ */ from_html("<div class=\"spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open svelte-1jm7byl\"><ul class=\"spectrum-Menu\" role=\"listbox\"></ul></div>"), root$50 = /* @__PURE__ */ from_html("<div><div><input class=\"spectrum-Textfield-input spectrum-InputGroup-input svelte-1jm7byl\"/></div> <div style=\"width: 40%\"><button aria-haspopup=\"listbox\"><span class=\"spectrum-Picker-label\"><div> </div></span> <!></button></div> <!></div>");
|
|
49945
49945
|
function InputDropdown(l, u) {
|
|
49946
49946
|
push$1(u, !1);
|
|
49947
|
-
let f = /* @__PURE__ */ mutable_source(), p = prop(u, "inputValue", 8), m = prop(u, "dropdownValue", 8), v = prop(u, "id", 8, null), y = prop(u, "inputType", 8, "text"), b = prop(u, "placeholder", 8, "Choose an option or type"), x = prop(u, "disabled", 8, !1), S = prop(u, "readonly", 8, !1), w = prop(u, "updateOnChange", 8, !0), T = prop(u, "options", 24, () => []), E = prop(u, "getOptionLabel", 8, (l) => U(l, "label")), D = prop(u, "getOptionValue", 8, (l) => U(l, "value")), O = prop(u, "getOptionSubtitle", 8, (l) => l?.subtitle), k = prop(u, "isOptionSelected", 8, () => !1), j = createEventDispatcher(), M = /* @__PURE__ */ mutable_source(!1), N = /* @__PURE__ */ mutable_source(!1), P = (l, u, f) => {
|
|
49947
|
+
let f = /* @__PURE__ */ mutable_source(), p = prop(u, "inputValue", 8), m = prop(u, "dropdownValue", 8), v = prop(u, "id", 8, null), y = prop(u, "inputType", 8, "text"), b = prop(u, "placeholder", 8, "Choose an option or type"), x = prop(u, "disabled", 8, !1), S = prop(u, "readonly", 8, !1), w = prop(u, "updateOnChange", 8, !0), T = prop(u, "options", 24, () => []), E = prop(u, "getOptionLabel", 8, (l) => U(l, "label")), D = prop(u, "getOptionValue", 8, (l) => U(l, "value")), O = prop(u, "getOptionSubtitle", 8, (l) => l?.subtitle), k = prop(u, "isOptionSelected", 8, (l) => !1), j = createEventDispatcher(), M = /* @__PURE__ */ mutable_source(!1), N = /* @__PURE__ */ mutable_source(!1), P = (l, u, f) => {
|
|
49948
49948
|
if (l == null || l === "") return f || "Choose an option or type";
|
|
49949
49949
|
if (!u?.length) return "";
|
|
49950
49950
|
let p = u.find((u) => D()(u) === l);
|
|
@@ -50035,14 +50035,14 @@ function InputDropdown(l, u) {
|
|
|
50035
50035
|
//#region src/Form/InputDropdown.svelte
|
|
50036
50036
|
function InputDropdown_1(l, u) {
|
|
50037
50037
|
push$1(u, !1);
|
|
50038
|
-
let f = prop(u, "inputValue", 12, null), p = prop(u, "dropdownValue", 12, null), m = prop(u, "inputType", 8, "text"), v = prop(u, "label",
|
|
50039
|
-
p(l.detail),
|
|
50040
|
-
},
|
|
50041
|
-
f(l.detail),
|
|
50038
|
+
let f = prop(u, "inputValue", 12, null), p = prop(u, "dropdownValue", 12, null), m = prop(u, "inputType", 8, "text"), v = prop(u, "label", 24, () => void 0), y = prop(u, "labelPosition", 8, "above"), b = prop(u, "placeholder", 24, () => void 0), x = prop(u, "disabled", 8, !1), S = prop(u, "readonly", 8, !1), w = prop(u, "error", 24, () => void 0), T = prop(u, "updateOnChange", 8, !0), E = prop(u, "helpText", 24, () => void 0), D = prop(u, "options", 24, () => []), O = createEventDispatcher(), k = (l) => {
|
|
50039
|
+
p(l.detail), O("pick", l.detail);
|
|
50040
|
+
}, j = (l) => {
|
|
50041
|
+
f(l.detail), O("change", l.detail);
|
|
50042
50042
|
};
|
|
50043
50043
|
init$1(), Field(l, {
|
|
50044
50044
|
get helpText() {
|
|
50045
|
-
return
|
|
50045
|
+
return E();
|
|
50046
50046
|
},
|
|
50047
50047
|
get label() {
|
|
50048
50048
|
return v();
|
|
@@ -50058,9 +50058,6 @@ function InputDropdown_1(l, u) {
|
|
|
50058
50058
|
get updateOnChange() {
|
|
50059
50059
|
return T();
|
|
50060
50060
|
},
|
|
50061
|
-
get error() {
|
|
50062
|
-
return w();
|
|
50063
|
-
},
|
|
50064
50061
|
get disabled() {
|
|
50065
50062
|
return x();
|
|
50066
50063
|
},
|
|
@@ -50079,19 +50076,13 @@ function InputDropdown_1(l, u) {
|
|
|
50079
50076
|
get inputType() {
|
|
50080
50077
|
return m();
|
|
50081
50078
|
},
|
|
50082
|
-
get quiet() {
|
|
50083
|
-
return E();
|
|
50084
|
-
},
|
|
50085
|
-
get autofocus() {
|
|
50086
|
-
return D();
|
|
50087
|
-
},
|
|
50088
50079
|
get options() {
|
|
50089
|
-
return
|
|
50080
|
+
return D();
|
|
50090
50081
|
},
|
|
50091
50082
|
isOptionSelected: (l) => l === p(),
|
|
50092
50083
|
$$events: {
|
|
50093
|
-
change:
|
|
50094
|
-
pick:
|
|
50084
|
+
change: j,
|
|
50085
|
+
pick: k,
|
|
50095
50086
|
click(l) {
|
|
50096
50087
|
bubble_event.call(this, u, l);
|
|
50097
50088
|
},
|
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": "3.39.
|
|
4
|
+
"version": "3.39.28",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"module": "dist/bbui.mjs",
|
|
7
7
|
"exports": {
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "1ad76cd4e4a5dc308900e2a7db331e20a013f65c"
|
|
109
109
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
export let getOptionLabel = option => extractProperty(option, "label")
|
|
20
20
|
export let getOptionValue = option => extractProperty(option, "value")
|
|
21
21
|
export let getOptionSubtitle = option => option?.subtitle
|
|
22
|
-
export let isOptionSelected =
|
|
22
|
+
export let isOptionSelected = _option => false
|
|
23
23
|
|
|
24
24
|
const dispatch = createEventDispatcher()
|
|
25
25
|
let open = false
|
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
import Field from "./Field.svelte"
|
|
3
3
|
import InputDropdown from "./Core/InputDropdown.svelte"
|
|
4
4
|
import { createEventDispatcher } from "svelte"
|
|
5
|
+
import type { LabelPosition } from "../types"
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
interface Option {
|
|
8
|
+
label?: string
|
|
9
|
+
value?: string
|
|
10
|
+
subtitle?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export let inputValue: string | null = null
|
|
14
|
+
export let dropdownValue: string | null = null
|
|
8
15
|
export let inputType = "text"
|
|
9
|
-
export let label =
|
|
10
|
-
export let labelPosition = "above"
|
|
11
|
-
export let placeholder =
|
|
16
|
+
export let label: string | undefined = undefined
|
|
17
|
+
export let labelPosition: LabelPosition = "above"
|
|
18
|
+
export let placeholder: string | undefined = undefined
|
|
12
19
|
export let disabled = false
|
|
13
20
|
export let readonly = false
|
|
14
|
-
export let error =
|
|
21
|
+
export let error: string | undefined = undefined
|
|
15
22
|
export let updateOnChange = true
|
|
16
|
-
export let
|
|
17
|
-
export let
|
|
18
|
-
export let helpText = null
|
|
19
|
-
export let options = []
|
|
23
|
+
export let helpText: string | undefined = undefined
|
|
24
|
+
export let options: Option[] = []
|
|
20
25
|
|
|
21
|
-
const dispatch = createEventDispatcher
|
|
26
|
+
const dispatch = createEventDispatcher<{
|
|
27
|
+
pick: string | null
|
|
28
|
+
change: string
|
|
29
|
+
}>()
|
|
22
30
|
|
|
23
|
-
const onPick = e => {
|
|
31
|
+
const onPick = (e: CustomEvent<string | null>) => {
|
|
24
32
|
dropdownValue = e.detail
|
|
25
33
|
dispatch("pick", e.detail)
|
|
26
34
|
}
|
|
27
|
-
const onChange = e => {
|
|
35
|
+
const onChange = (e: CustomEvent<string>) => {
|
|
28
36
|
inputValue = e.detail
|
|
29
37
|
dispatch("change", e.detail)
|
|
30
38
|
}
|
|
@@ -33,15 +41,12 @@
|
|
|
33
41
|
<Field {helpText} {label} {labelPosition} {error}>
|
|
34
42
|
<InputDropdown
|
|
35
43
|
{updateOnChange}
|
|
36
|
-
{error}
|
|
37
44
|
{disabled}
|
|
38
45
|
{readonly}
|
|
39
46
|
{inputValue}
|
|
40
47
|
{dropdownValue}
|
|
41
48
|
{placeholder}
|
|
42
49
|
{inputType}
|
|
43
|
-
{quiet}
|
|
44
|
-
{autofocus}
|
|
45
50
|
{options}
|
|
46
51
|
isOptionSelected={option => option === dropdownValue}
|
|
47
52
|
on:change={onChange}
|