bitboss-ui 2.0.101 → 2.0.103
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/components/BaseSelect/BaseSelect.vue.d.ts +10 -16
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +109 -7
- package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -16
- package/dist/composables/useBaseOptions.d.ts +31 -0
- package/dist/composables/useCoherence.d.ts +20 -0
- package/dist/composables/useHashedWatcher.d.ts +2 -0
- package/dist/composables/useIndexById.d.ts +11 -0
- package/dist/composables/useItemsGetter.d.ts +12 -0
- package/dist/composables/usePrefill.d.ts +12 -0
- package/dist/index100.js +88 -60
- package/dist/index101.js +10 -13
- package/dist/index111.js +154 -126
- package/dist/index119.js +1 -1
- package/dist/index121.js +4 -4
- package/dist/index123.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.js +1 -1
- package/dist/index129.js +1 -1
- package/dist/index13.js +54 -45
- package/dist/index131.js +1 -1
- package/dist/index132.js +69 -65
- package/dist/index133.js +2 -2
- package/dist/index15.js +4 -4
- package/dist/index17.js +3 -3
- package/dist/index19.js +126 -82
- package/dist/index205.js +52 -80
- package/dist/index207.js +13 -5
- package/dist/index208.js +19 -124
- package/dist/index209.js +4 -19
- package/dist/index21.js +14 -14
- package/dist/index210.js +124 -14
- package/dist/index211.js +5 -16
- package/dist/index212.js +125 -2
- package/dist/index213.js +19 -2
- package/dist/index214.js +15 -40
- package/dist/index215.js +15 -19
- package/dist/index216.js +2 -6
- package/dist/index217.js +2 -53
- package/dist/index218.js +43 -0
- package/dist/index219.js +6 -13
- package/dist/index220.js +2 -2
- package/dist/index222.js +3 -3
- package/dist/index223.js +2 -4
- package/dist/index224.js +4 -3
- package/dist/index225.js +2 -8
- package/dist/index226.js +3 -2
- package/dist/index227.js +7 -4
- package/dist/index228.js +8 -2
- package/dist/index229.js +3 -2
- package/dist/index23.js +13 -13
- package/dist/index230.js +84 -19
- package/dist/index232.js +8 -3
- package/dist/index233.js +23 -248
- package/dist/index234.js +17 -52
- package/dist/index235.js +47 -43
- package/dist/index236.js +15 -5
- package/dist/index237.js +12 -60
- package/dist/index238.js +16 -3
- package/dist/index239.js +19 -7
- package/dist/index240.js +25 -166
- package/dist/index241.js +243 -77
- package/dist/index242.js +54 -0
- package/dist/index243.js +43 -7
- package/dist/index244.js +5 -2
- package/dist/index245.js +59 -17
- package/dist/index246.js +2 -106
- package/dist/index247.js +117 -0
- package/dist/index248.js +3 -100
- package/dist/index249.js +4 -0
- package/dist/index25.js +5 -5
- package/dist/index250.js +18 -2
- package/dist/index251.js +106 -2
- package/dist/index253.js +100 -3
- package/dist/index255.js +12 -23
- package/dist/index256.js +2 -89
- package/dist/index257.js +4 -0
- package/dist/index258.js +10 -6
- package/dist/index259.js +3 -16
- package/dist/index260.js +6 -3
- package/dist/index261.js +18 -0
- package/dist/index262.js +8 -6
- package/dist/index263.js +23 -176
- package/dist/index264.js +89 -9
- package/dist/index266.js +3 -281
- package/dist/index268.js +7 -2
- package/dist/index269.js +176 -2
- package/dist/index27.js +1 -1
- package/dist/index270.js +281 -2
- package/dist/index271.js +6 -2
- package/dist/index272.js +2 -2
- package/dist/index273.js +2 -126
- package/dist/index274.js +2 -431
- package/dist/index275.js +2 -22
- package/dist/index276.js +4 -0
- package/dist/index277.js +126 -2
- package/dist/index278.js +430 -3
- package/dist/index279.js +20 -7
- package/dist/index281.js +2 -2
- package/dist/index282.js +4 -2
- package/dist/index283.js +28 -2
- package/dist/index284.js +200 -2
- package/dist/index285.js +436 -2
- package/dist/index286.js +127 -2
- package/dist/index287.js +85 -24
- package/dist/index288.js +9 -22
- package/dist/{index302.js → index289.js} +1 -1
- package/dist/index29.js +3 -3
- package/dist/index290.js +6 -435
- package/dist/index291.js +10 -126
- package/dist/index292.js +14 -197
- package/dist/index293.js +9 -89
- package/dist/index294.js +8 -3
- package/dist/index295.js +2 -12
- package/dist/index296.js +2 -9
- package/dist/index297.js +2 -17
- package/dist/index298.js +2 -4
- package/dist/index299.js +2 -7
- package/dist/index300.js +2 -11
- package/dist/index301.js +22 -3
- package/dist/index303.js +224 -213
- package/dist/index304.js +3 -5
- package/dist/index305.js +3 -2
- package/dist/index306.js +206 -59
- package/dist/index307.js +2 -3
- package/dist/index308.js +5 -3
- package/dist/index309.js +66 -3
- package/dist/index31.js +2 -2
- package/dist/index310.js +3 -58
- package/dist/index311.js +3 -5
- package/dist/index312.js +57 -7
- package/dist/index313.js +1 -1
- package/dist/index314.js +4 -3
- package/dist/index315.js +7 -6
- package/dist/index316.js +3 -7
- package/dist/index317.js +3 -18
- package/dist/index320.js +6 -46
- package/dist/index321.js +19 -2
- package/dist/index322.js +9 -0
- package/dist/index323.js +47 -480
- package/dist/index324.js +2 -424
- package/dist/index326.js +480 -2
- package/dist/index327.js +426 -0
- package/dist/index329.js +4 -0
- package/dist/index33.js +102 -61
- package/dist/index35.js +3 -3
- package/dist/index37.js +284 -244
- package/dist/index39.js +5 -5
- package/dist/index41.js +2 -2
- package/dist/index43.js +129 -84
- package/dist/index45.js +122 -120
- package/dist/index47.js +2 -2
- package/dist/index49.js +2 -2
- package/dist/index55.js +1 -1
- package/dist/index57.js +2 -2
- package/dist/index61.js +13 -9
- package/dist/index75.js +3 -3
- package/dist/index79.js +2 -2
- package/dist/index81.js +1 -1
- package/dist/index84.js +2 -2
- package/dist/index86.js +1 -1
- package/dist/index88.js +4 -4
- package/dist/index90.js +1 -1
- package/package.json +1 -1
- package/dist/composables/useOptions.d.ts +0 -43
- package/dist/index206.js +0 -128
- package/dist/index231.js +0 -29
- package/dist/index252.js +0 -12
- package/dist/index254.js +0 -11
- package/dist/index265.js +0 -226
- package/dist/index267.js +0 -8
- package/dist/index280.js +0 -10
- /package/dist/{index325.js → index328.js} +0 -0
package/dist/index37.js
CHANGED
@@ -1,36 +1,40 @@
|
|
1
|
-
import { defineComponent as
|
1
|
+
import { defineComponent as Ue, defineAsyncComponent as Ge, ref as f, computed as y, toRef as x, openBlock as h, createBlock as T, normalizeClass as Z, withCtx as i, renderSlot as c, createVNode as K, unref as S, createElementVNode as H, createElementBlock as A, Fragment as ee, toDisplayString as Re, createCommentVNode as te, withDirectives as je, withModifiers as p, withKeys as g, vModelDynamic as Je, renderList as Qe, mergeProps as le, normalizeStyle as Xe, nextTick as _ } from "vue";
|
2
2
|
/* empty css */
|
3
3
|
/* empty css */
|
4
|
-
import { useId as
|
5
|
-
import { useMobile as
|
6
|
-
import
|
4
|
+
import { useId as Ye } from "./index8.js";
|
5
|
+
import { useMobile as Ze } from "./index9.js";
|
6
|
+
import et from "./index128.js";
|
7
7
|
/* empty css */
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import
|
15
|
-
import { wait as L } from "./index130.js";
|
16
|
-
import { when as et } from "./index227.js";
|
17
|
-
import tt from "./index246.js";
|
8
|
+
import { last as tt } from "./index217.js";
|
9
|
+
import { matchAnyKey as ae } from "./index250.js";
|
10
|
+
import { useFloating as lt } from "./index210.js";
|
11
|
+
import { useIntersectionObserver as at } from "./index132.js";
|
12
|
+
import { wait as E } from "./index130.js";
|
13
|
+
import { when as ot } from "./index224.js";
|
14
|
+
import nt from "./index251.js";
|
18
15
|
/* empty css */
|
19
|
-
import
|
16
|
+
import it from "./index253.js";
|
20
17
|
/* empty css */
|
21
|
-
import
|
18
|
+
import ut from "./index205.js";
|
22
19
|
/* empty css */
|
23
|
-
import
|
24
|
-
import { waitFor as
|
25
|
-
import
|
26
|
-
import {
|
27
|
-
|
20
|
+
import rt from "./index207.js";
|
21
|
+
import { waitFor as st } from "./index219.js";
|
22
|
+
import dt from "./index221.js";
|
23
|
+
import { useItemsGetter as ct } from "./index233.js";
|
24
|
+
import { usePrefill as pt } from "./index238.js";
|
25
|
+
import { useArray as mt } from "./index255.js";
|
26
|
+
import { useBaseOptions as ft } from "./index235.js";
|
27
|
+
import { useIndexById as oe } from "./index234.js";
|
28
|
+
import { useCoherence as vt } from "./index236.js";
|
29
|
+
import { hash as yt } from "./index229.js";
|
30
|
+
import { useHashedWatcher as ne } from "./index237.js";
|
31
|
+
import { autoUpdate as ht, flip as bt, offset as gt, shift as wt } from "./index222.js";
|
32
|
+
const Bt = { class: "bb-base-select__input-container" }, Vt = {
|
28
33
|
key: 1,
|
29
34
|
class: "bb-base-select__max-reached"
|
30
|
-
},
|
35
|
+
}, It = ["id", "aria-controls", "aria-describedby", "aria-expanded", "autocomplete", "autofocus", "disabled", "inputmode", "placeholder", "readonly", "required", "onKeydown"], tl = /* @__PURE__ */ Ue({
|
31
36
|
__name: "BaseSelect",
|
32
37
|
props: {
|
33
|
-
addOptions: { type: Boolean },
|
34
38
|
allowWriting: { type: [Boolean, String], default: !0 },
|
35
39
|
"append:icon": {},
|
36
40
|
ariaDescribedby: {},
|
@@ -63,281 +67,317 @@ const dt = { class: "bb-base-select__input-container" }, ct = {
|
|
63
67
|
queryDebounceTime: { default: 500 },
|
64
68
|
readonly: { type: Boolean },
|
65
69
|
required: { type: Boolean },
|
66
|
-
resetQueryOnOptionSelected: { type: Boolean },
|
67
70
|
stash: { type: Boolean },
|
68
71
|
transitionDuration: { default: 300 },
|
69
72
|
updateOnAnimationFrame: { type: Boolean, default: !1 }
|
70
73
|
},
|
71
|
-
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue"],
|
72
|
-
setup(
|
73
|
-
const t =
|
74
|
+
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue", "option:add"],
|
75
|
+
setup(ie, { emit: ue }) {
|
76
|
+
const t = ie, u = ue;
|
74
77
|
if (t.multiple && !Array.isArray(t.modelValue))
|
75
78
|
throw new Error('Multiple is set to "true" but modelValue is not an array.');
|
76
|
-
const
|
77
|
-
() => t.comma ?
|
78
|
-
), { isMobile:
|
79
|
-
() => t.allowWriting === "not-mobile" &&
|
80
|
-
),
|
81
|
-
|
82
|
-
|
79
|
+
const re = Ge(() => import("./index249.js")), F = f(null), V = f(null), n = f(null), U = f(null), G = f(null), r = y(
|
80
|
+
() => t.comma ? U.value : G.value
|
81
|
+
), { isMobile: se } = Ze(), de = y(
|
82
|
+
() => t.allowWriting === "not-mobile" && se.value ? "none" : void 0
|
83
|
+
), R = t.id || Ye().id.value;
|
84
|
+
at(
|
85
|
+
V,
|
83
86
|
([{ intersectionRatio: e }]) => {
|
84
|
-
e !== 1 &&
|
87
|
+
e !== 1 && k();
|
85
88
|
},
|
86
89
|
{ threshold: [0, 1] }
|
87
90
|
);
|
88
|
-
const { floatingStyles:
|
89
|
-
|
90
|
-
|
91
|
+
const { floatingStyles: ce } = lt(
|
92
|
+
V,
|
93
|
+
n,
|
91
94
|
{
|
92
95
|
placement: "bottom",
|
93
|
-
whileElementsMounted:
|
94
|
-
middleware: [
|
96
|
+
whileElementsMounted: ht,
|
97
|
+
middleware: [bt(), gt(5), wt()]
|
95
98
|
}
|
96
|
-
),
|
97
|
-
var
|
99
|
+
), pe = y(() => {
|
100
|
+
var l;
|
98
101
|
const e = {
|
99
|
-
...
|
102
|
+
...ce.value,
|
100
103
|
zIndex: "10"
|
101
104
|
};
|
102
|
-
return
|
103
|
-
}),
|
104
|
-
|
105
|
-
},
|
106
|
-
|
107
|
-
},
|
108
|
-
t.prefill === "focus" && !
|
109
|
-
},
|
110
|
-
|
111
|
-
},
|
112
|
-
var
|
113
|
-
|
114
|
-
},
|
115
|
-
if (e.target instanceof Node &&
|
116
|
-
|
105
|
+
return V.value && (e.width = `${(l = V.value) == null ? void 0 : l.$el.clientWidth}px`), e;
|
106
|
+
}), L = f(null), q = () => {
|
107
|
+
L.value instanceof HTMLInputElement && L.value.focus();
|
108
|
+
}, me = async (e) => {
|
109
|
+
u("focus", e), ze(), document.addEventListener("click", D), document.addEventListener("focusin", D);
|
110
|
+
}, fe = () => {
|
111
|
+
t.prefill === "focus" && !De.value && !J.value && $e();
|
112
|
+
}, ve = async (e) => {
|
113
|
+
u("blur", e);
|
114
|
+
}, ye = (e) => u("change", e), he = (e) => {
|
115
|
+
var l;
|
116
|
+
u("input", e), a.value === "" && (t.multiple || u("update:modelValue", null)), (l = r.value) == null || l.blur(), z.value && I(), Ce(a.value, !1, t.modelValue);
|
117
|
+
}, D = async (e) => {
|
118
|
+
if (e.target instanceof Node && F.value && n.value && !F.value.$el.contains(e.target) && !n.value.$el.contains(e.target)) {
|
119
|
+
k(), Ne(), document.removeEventListener("click", D), document.removeEventListener("focusin", D), await E(t.transitionDuration), b();
|
117
120
|
return;
|
118
121
|
}
|
119
|
-
}, w = y(() => !(t.readonly || t.disabled ||
|
120
|
-
var e,
|
121
|
-
w.value && ((e =
|
122
|
-
},
|
123
|
-
var e,
|
124
|
-
w.value && ((e =
|
125
|
-
},
|
126
|
-
var
|
127
|
-
if (!w.value || !t.multiple ||
|
128
|
-
(
|
129
|
-
const
|
130
|
-
|
131
|
-
},
|
132
|
-
var
|
133
|
-
if (!w.value || !t.multiple ||
|
134
|
-
(
|
135
|
-
const
|
136
|
-
|
137
|
-
},
|
138
|
-
var
|
139
|
-
if (w.value)
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
if (t.itemText || t.itemValue) {
|
146
|
-
const { error: s } = Xe();
|
147
|
-
s(
|
148
|
-
`Adding an option for mapped items is not supported. You can't create an option while passing "item-text" or "item-value".`
|
149
|
-
);
|
150
|
-
return;
|
151
|
-
}
|
152
|
-
const n = l.value.trim();
|
153
|
-
if (ke(n)) return;
|
154
|
-
he(), _(Ye(Ie.value));
|
122
|
+
}, w = y(() => !(t.readonly || t.disabled || O.value || !r.value && t.multiple)), be = async () => {
|
123
|
+
var e, l, o;
|
124
|
+
w.value && ((e = r.value) == null || e.blur(), m.value ? (l = n.value) == null || l.focusPrevious() : (await I(), await E(t.transitionDuration), (o = n.value) == null || o.focusLastSelected()));
|
125
|
+
}, ge = async () => {
|
126
|
+
var e, l, o;
|
127
|
+
w.value && ((e = r.value) == null || e.blur(), m.value ? (l = n.value) == null || l.focusNext() : (await I(), await E(t.transitionDuration), (o = n.value) == null || o.focusFirstSelected()));
|
128
|
+
}, we = (e) => {
|
129
|
+
var o, d, v, C;
|
130
|
+
if (!w.value || !t.multiple || a.value || (e.preventDefault(), (o = n.value) == null || o.blur(), !s.value.length)) return;
|
131
|
+
(d = r.value) == null || d.focusPrevious();
|
132
|
+
const l = (v = r.value) == null ? void 0 : v.getHighlighted();
|
133
|
+
l && ((C = n.value) == null || C.focusByHash(l.valueHash));
|
134
|
+
}, Be = (e) => {
|
135
|
+
var o, d, v, C;
|
136
|
+
if (!w.value || !t.multiple || a.value || (e.preventDefault(), (o = n.value) == null || o.blur(), !s.value.length)) return;
|
137
|
+
(d = r.value) == null || d.focusNext();
|
138
|
+
const l = (v = r.value) == null ? void 0 : v.getHighlighted();
|
139
|
+
l && ((C = n.value) == null || C.focusByHash(l.valueHash));
|
140
|
+
}, Ve = async () => {
|
141
|
+
var l, o;
|
142
|
+
if (!w.value)
|
143
|
+
return;
|
144
|
+
if (m.value) {
|
145
|
+
if ((o = n.value) != null && o.getHighlighted()) {
|
146
|
+
n.value.confirmOption();
|
147
|
+
return;
|
155
148
|
}
|
149
|
+
} else {
|
150
|
+
await I(), await E(t.transitionDuration), s.value.length && ((l = n.value) == null || l.focusFirstSelected());
|
151
|
+
return;
|
152
|
+
}
|
153
|
+
const e = a.value.trim();
|
154
|
+
Ee(e) || (u("option:add", e), a.value = "");
|
155
|
+
}, Ie = async () => {
|
156
|
+
m.value && await k();
|
157
|
+
}, ke = async () => {
|
158
|
+
var e, l;
|
159
|
+
!w.value || a.value || !s.value.length || ((e = r.value) != null && e.getHighlighted() && r.value.confirmOption(), await _(), (l = r.value) == null || l.focusPrevious());
|
160
|
+
}, a = f(""), {
|
161
|
+
getter: M,
|
162
|
+
debouncedGetter: Ce,
|
163
|
+
items: Se,
|
164
|
+
loading: j
|
165
|
+
} = ct({
|
166
|
+
items: x(t, "items"),
|
167
|
+
debounce: t.queryDebounceTime
|
168
|
+
}), P = () => {
|
169
|
+
var e, l;
|
170
|
+
t.enforceCoherence && !Y.value && (t.multiple ? u("update:modelValue", Me.value.coherent) : u("update:modelValue", null), (e = r.value) == null || e.blur(), (l = n.value) == null || l.blur());
|
171
|
+
}, {
|
172
|
+
hasPrefilled: J,
|
173
|
+
isPrefilling: De,
|
174
|
+
prefill: $e
|
175
|
+
} = pt({
|
176
|
+
onStart: t.prefill === !0,
|
177
|
+
currentValue: t.modelValue,
|
178
|
+
multiple: t.multiple,
|
179
|
+
fn: async ({ prefill: e }) => {
|
180
|
+
await M(a.value, e, t.modelValue), P(), b();
|
156
181
|
}
|
157
|
-
},
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
},
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
options: K,
|
168
|
-
selectedOptions: f,
|
169
|
-
selectOption: ge,
|
170
|
-
unselectOption: we,
|
171
|
-
prefillItems: Be,
|
172
|
-
isPrefilling: Oe,
|
173
|
-
hasPrefilled: Ce,
|
174
|
-
updateModelValue: De,
|
175
|
-
valueIsSelected: ke,
|
176
|
-
manualItems: Ie,
|
177
|
-
searchByQuery: Ve
|
178
|
-
} = Ze({
|
179
|
-
emit: h,
|
182
|
+
}), {
|
183
|
+
array: Oe,
|
184
|
+
add: xe,
|
185
|
+
remove: Te,
|
186
|
+
set: He
|
187
|
+
} = mt(), s = y(() => $.value.filter((e) => e.selected)), Ae = y(() => s.value.length ? "" : t.placeholder), { data: Q, get: Ee } = oe({
|
188
|
+
items: x(t, "modelValue")
|
189
|
+
}), { options: $ } = ft({
|
190
|
+
disabled: x(t, "disabled"),
|
191
|
+
items: y(() => [...Se.value, ...Oe.value]),
|
180
192
|
itemText: t.itemText,
|
181
193
|
itemValue: t.itemValue,
|
182
|
-
modelValue: V(t, "modelValue"),
|
183
194
|
max: t.max,
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
items: V(t, "items"),
|
188
|
-
enforceCoherence: t.enforceCoherence,
|
189
|
-
prefill: ye,
|
190
|
-
modelValueDebounceTime: t.modelValueDebounceTime,
|
191
|
-
dependencies: V(t, "dependencies"),
|
192
|
-
depsDebounceTime: t.depsDebounceTime,
|
193
|
-
queryDebounceTime: t.queryDebounceTime,
|
194
|
-
disabled: V(t, "disabled")
|
195
|
-
}), Se = y(() => f.value.length ? "" : t.placeholder), I = y(() => !!(Q.value || t.loading)), $e = y(() => {
|
195
|
+
selectable: !0,
|
196
|
+
selectedIndexedByHash: Q
|
197
|
+
}), O = y(() => !!(j.value || t.loading)), Fe = y(() => {
|
196
198
|
let e = [];
|
197
|
-
const
|
198
|
-
(
|
199
|
+
const l = s.value.some(
|
200
|
+
(d) => d.text === a.value
|
199
201
|
);
|
200
|
-
return (t.multiple &&
|
201
|
-
let
|
202
|
-
return typeof t.filterBy == "function" ?
|
203
|
-
}) : e =
|
204
|
-
}),
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
202
|
+
return (t.multiple && a.value || a.value && !l && !t.multiple) && t.filterBy ? e = $.value.filter((d) => {
|
203
|
+
let v = !1;
|
204
|
+
return typeof t.filterBy == "function" ? v = t.filterBy(d.value, d.item) : Array.isArray(t.filterBy) && t.filterBy.length && (v = v || ae(d.item, t.filterBy, a.value.trim())), v || ae(d, ["text"], a.value.trim());
|
205
|
+
}) : e = $.value, e;
|
206
|
+
}), b = () => {
|
207
|
+
if (t.multiple) {
|
208
|
+
a.value = "";
|
209
|
+
return;
|
210
|
+
}
|
211
|
+
let e;
|
212
|
+
s.value && (e = tt(s.value)), a.value = (e == null ? void 0 : e.text) || "";
|
213
|
+
}, Le = async (e) => {
|
214
|
+
t.multiple ? (u("update:modelValue", t.modelValue.concat(e.value)), t.stash && xe(e.item), b()) : (t.stash && He(e.item), u("update:modelValue", e.value), await _(), b()), q(), t.multiple || k();
|
215
|
+
}, X = async (e) => {
|
216
|
+
if (Te((l) => l.valueHash !== e.valueHash), t.multiple) {
|
217
|
+
const l = { ...Q.value };
|
218
|
+
delete l[e.valueHash], u("update:modelValue", Object.values(l));
|
219
|
+
} else
|
220
|
+
u("update:modelValue", null), await _(), b();
|
221
|
+
q();
|
222
|
+
}, { data: qe } = oe({
|
223
|
+
items: $,
|
224
|
+
key: "valueHash"
|
225
|
+
}), { coherent: Y, status: Me } = vt({
|
226
|
+
modelValue: x(t, "modelValue"),
|
227
|
+
multiple: t.multiple,
|
228
|
+
iteratee: (e) => !!qe.value[yt(e)]
|
229
|
+
});
|
230
|
+
let B = 0;
|
231
|
+
ne(
|
232
|
+
() => t.modelValue,
|
233
|
+
async () => {
|
234
|
+
B++, Y.value || (await M(a.value, !1, t.modelValue), P()), B === 1 && b(), B--;
|
235
|
+
},
|
236
|
+
{
|
237
|
+
debounce: t.modelValueDebounceTime
|
238
|
+
}
|
239
|
+
), ne(
|
240
|
+
() => [t.dependencies, t.items],
|
241
|
+
async () => {
|
242
|
+
J.value && (B++, await M(a.value, !1, t.modelValue), B === 1 && (P(), b()), B--);
|
243
|
+
},
|
244
|
+
{
|
245
|
+
debounce: t.depsDebounceTime
|
246
|
+
}
|
247
|
+
);
|
248
|
+
const m = f(!1), z = f(!0), N = f(!1), I = async () => {
|
249
|
+
N.value = !0, await st(() => !!n.value), z.value = !1, m.value = !0;
|
250
|
+
}, k = async () => {
|
211
251
|
var e;
|
212
|
-
|
213
|
-
},
|
214
|
-
|
215
|
-
},
|
216
|
-
|
217
|
-
},
|
218
|
-
e.preventDefault(),
|
219
|
-
},
|
252
|
+
m.value = !1, z.value = !0, (e = r.value) == null || e.blur();
|
253
|
+
}, Pe = () => m.value ? k() : I(), W = f(!1), ze = () => {
|
254
|
+
W.value = !0;
|
255
|
+
}, Ne = () => {
|
256
|
+
W.value = !1, u("inactive");
|
257
|
+
}, We = (e) => {
|
258
|
+
e.preventDefault(), u("click", e), !(t.disabled || t.readonly) && (q(), Pe());
|
259
|
+
}, Ke = ot(
|
220
260
|
(e) => typeof e != "string",
|
221
261
|
JSON.stringify
|
222
|
-
),
|
223
|
-
const
|
262
|
+
), _e = y(() => [].concat(t.modelValue).map((e) => {
|
263
|
+
const l = Ke(e);
|
224
264
|
return {
|
225
265
|
disabled: t.disabled,
|
226
266
|
name: t.name,
|
227
267
|
type: "hidden",
|
228
|
-
value:
|
268
|
+
value: l
|
229
269
|
};
|
230
270
|
}));
|
231
|
-
return (e,
|
271
|
+
return (e, l) => (h(), T(rt, {
|
232
272
|
ref_key: "outerContainer",
|
233
|
-
ref:
|
234
|
-
class:
|
273
|
+
ref: F,
|
274
|
+
class: Z({
|
235
275
|
"bb-base-select": !0,
|
236
|
-
"bb-base-select--active":
|
237
|
-
"bb-base-select--shown":
|
238
|
-
"bb-base-select--loading":
|
276
|
+
"bb-base-select--active": W.value,
|
277
|
+
"bb-base-select--shown": m.value,
|
278
|
+
"bb-base-select--loading": O.value,
|
239
279
|
"bb-base-select--disabled": e.disabled,
|
240
280
|
"bb-base-select--errors": e.hasErrors,
|
241
281
|
"bb-base-select--readonly": e.readonly,
|
242
282
|
"bb-base-select--compact": e.compact
|
243
283
|
}),
|
244
|
-
onClick:
|
284
|
+
onClick: We
|
245
285
|
}, {
|
246
|
-
"prepend-outer":
|
247
|
-
|
286
|
+
"prepend-outer": i(() => [
|
287
|
+
c(e.$slots, "prepend-outer", { query: a.value })
|
248
288
|
]),
|
249
|
-
"append-outer":
|
250
|
-
|
289
|
+
"append-outer": i(() => [
|
290
|
+
c(e.$slots, "append-outer", { query: a.value })
|
251
291
|
]),
|
252
|
-
default:
|
253
|
-
|
292
|
+
default: i(() => [
|
293
|
+
K(ut, {
|
254
294
|
ref_key: "innerContainer",
|
255
|
-
ref:
|
295
|
+
ref: V,
|
256
296
|
"append:icon": t["append:icon"],
|
257
297
|
"prepend:icon": t["prepend:icon"],
|
258
298
|
"prevent-focus": !0
|
259
299
|
}, {
|
260
|
-
prepend:
|
261
|
-
|
300
|
+
prepend: i(() => [
|
301
|
+
c(e.$slots, "prepend", { query: a.value })
|
262
302
|
]),
|
263
|
-
prefix:
|
264
|
-
|
303
|
+
prefix: i(() => [
|
304
|
+
c(e.$slots, "prefix")
|
265
305
|
]),
|
266
|
-
append:
|
267
|
-
|
306
|
+
append: i(() => [
|
307
|
+
c(e.$slots, "append", { query: a.value })
|
268
308
|
]),
|
269
|
-
suffix:
|
270
|
-
|
309
|
+
suffix: i(() => [
|
310
|
+
c(e.$slots, "suffix")
|
271
311
|
]),
|
272
|
-
default:
|
273
|
-
|
274
|
-
default:
|
275
|
-
|
276
|
-
e.multiple &&
|
277
|
-
e.comma ? (
|
312
|
+
default: i(() => [
|
313
|
+
K(S(et), { tag: "span" }, {
|
314
|
+
default: i(() => [
|
315
|
+
H("span", Bt, [
|
316
|
+
e.multiple && s.value.length <= e.maxSelectedLabels ? (h(), A(ee, { key: 0 }, [
|
317
|
+
e.comma ? (h(), T(it, {
|
278
318
|
key: 0,
|
279
319
|
ref_key: "commaBox",
|
280
|
-
ref:
|
281
|
-
options:
|
282
|
-
}, null, 8, ["options"])) : (
|
320
|
+
ref: U,
|
321
|
+
options: s.value
|
322
|
+
}, null, 8, ["options"])) : (h(), T(nt, {
|
283
323
|
key: 1,
|
284
324
|
ref_key: "chipsBox",
|
285
|
-
ref:
|
286
|
-
options:
|
287
|
-
"onOption:unselected":
|
325
|
+
ref: G,
|
326
|
+
options: s.value,
|
327
|
+
"onOption:unselected": X
|
288
328
|
}, null, 8, ["options"]))
|
289
|
-
], 64)) : e.multiple ? (
|
290
|
-
|
291
|
-
id:
|
329
|
+
], 64)) : e.multiple ? (h(), A("span", Vt, Re(s.value.length) + " elementi selezionati ", 1)) : te("", !0),
|
330
|
+
je(H("input", {
|
331
|
+
id: S(R),
|
292
332
|
ref_key: "input",
|
293
|
-
ref:
|
294
|
-
"onUpdate:modelValue":
|
333
|
+
ref: L,
|
334
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => a.value = o),
|
295
335
|
"aria-autocomplete": "list",
|
296
|
-
"aria-controls":
|
336
|
+
"aria-controls": N.value ? `${S(R)}_listbox` : void 0,
|
297
337
|
"aria-describedby": e.ariaDescribedby,
|
298
|
-
"aria-expanded":
|
338
|
+
"aria-expanded": m.value,
|
299
339
|
autocomplete: e.autocomplete,
|
300
340
|
autofocus: e.autofocus,
|
301
|
-
class:
|
341
|
+
class: Z("bb-base-select__text-input"),
|
302
342
|
disabled: e.disabled,
|
303
|
-
inputmode:
|
304
|
-
placeholder:
|
343
|
+
inputmode: de.value,
|
344
|
+
placeholder: Ae.value,
|
305
345
|
readonly: e.readonly || !e.allowWriting,
|
306
346
|
required: e.required && !e.multiple || e.multiple && !e.modelValue.length,
|
307
347
|
role: "combobox",
|
308
348
|
size: "1",
|
309
349
|
type: "text",
|
310
|
-
onBlur:
|
311
|
-
onChange:
|
312
|
-
onFocusOnce:
|
313
|
-
onFocus:
|
314
|
-
onInput:
|
350
|
+
onBlur: p(ve, ["stop"]),
|
351
|
+
onChange: p(ye, ["stop"]),
|
352
|
+
onFocusOnce: p(fe, ["stop"]),
|
353
|
+
onFocus: p(me, ["stop"]),
|
354
|
+
onInput: p(he, ["stop"]),
|
315
355
|
onKeydown: [
|
316
|
-
g(
|
317
|
-
g(
|
318
|
-
g(
|
319
|
-
g(
|
320
|
-
g(
|
321
|
-
g(
|
322
|
-
g(
|
356
|
+
g(p(ke, ["stop"]), ["delete"]),
|
357
|
+
g(p(we, ["stop"]), ["left"]),
|
358
|
+
g(p(ge, ["stop", "prevent"]), ["down"]),
|
359
|
+
g(p(Ve, ["stop", "prevent"]), ["enter"]),
|
360
|
+
g(p(Ie, ["stop", "prevent"]), ["esc"]),
|
361
|
+
g(p(be, ["stop", "prevent"]), ["up"]),
|
362
|
+
g(p(Be, ["stop"]), ["right"])
|
323
363
|
]
|
324
|
-
}, null, 40,
|
325
|
-
[
|
364
|
+
}, null, 40, It), [
|
365
|
+
[Je, a.value]
|
326
366
|
])
|
327
367
|
])
|
328
368
|
]),
|
329
369
|
_: 1
|
330
370
|
}),
|
331
|
-
|
332
|
-
loading: !!
|
333
|
-
shown:
|
371
|
+
c(e.$slots, "chevron", {
|
372
|
+
loading: !!S(j),
|
373
|
+
shown: m.value
|
334
374
|
}, () => [
|
335
|
-
|
375
|
+
l[1] || (l[1] = H("svg", {
|
336
376
|
class: "bb-base-select__chevron",
|
337
377
|
viewBox: "0 0 24 24",
|
338
378
|
xmlns: "http://www.w3.org/2000/svg"
|
339
379
|
}, [
|
340
|
-
|
380
|
+
H("path", {
|
341
381
|
d: "M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z",
|
342
382
|
fill: "currentColor"
|
343
383
|
})
|
@@ -346,53 +386,53 @@ const dt = { class: "bb-base-select__input-container" }, ct = {
|
|
346
386
|
]),
|
347
387
|
_: 3
|
348
388
|
}, 8, ["append:icon", "prepend:icon"]),
|
349
|
-
(
|
350
|
-
key:
|
389
|
+
(h(!0), A(ee, null, Qe(_e.value, (o) => (h(), A("input", le({
|
390
|
+
key: o.value,
|
351
391
|
ref_for: !0
|
352
|
-
},
|
353
|
-
|
354
|
-
default:
|
355
|
-
|
392
|
+
}, o), null, 16))), 128)),
|
393
|
+
N.value ? (h(), T(dt, { key: 0 }, {
|
394
|
+
default: i(() => [
|
395
|
+
K(S(re), {
|
356
396
|
ref_key: "optionsContainer",
|
357
|
-
ref:
|
397
|
+
ref: n,
|
358
398
|
compact: e.compact,
|
359
|
-
loading:
|
399
|
+
loading: O.value,
|
360
400
|
"loading-text": e.loadingText,
|
361
401
|
"no-data-text": e.noDataText,
|
362
|
-
open:
|
363
|
-
options:
|
364
|
-
style:
|
365
|
-
"onOption:selected":
|
366
|
-
"onOption:unselected":
|
402
|
+
open: m.value,
|
403
|
+
options: Fe.value,
|
404
|
+
style: Xe(pe.value),
|
405
|
+
"onOption:selected": Le,
|
406
|
+
"onOption:unselected": X
|
367
407
|
}, {
|
368
|
-
"options:prepend":
|
369
|
-
|
408
|
+
"options:prepend": i(() => [
|
409
|
+
c(e.$slots, "options:prepend")
|
370
410
|
]),
|
371
|
-
loading:
|
372
|
-
|
411
|
+
loading: i(() => [
|
412
|
+
c(e.$slots, "loading", { query: a.value })
|
373
413
|
]),
|
374
|
-
"no-data":
|
375
|
-
|
414
|
+
"no-data": i(() => [
|
415
|
+
c(e.$slots, "no-data", { query: a.value })
|
376
416
|
]),
|
377
|
-
"options:append":
|
378
|
-
|
417
|
+
"options:append": i(() => [
|
418
|
+
c(e.$slots, "options:append")
|
379
419
|
]),
|
380
|
-
option:
|
381
|
-
|
420
|
+
option: i((o) => [
|
421
|
+
c(e.$slots, "option", le({
|
382
422
|
hasErrors: e.hasErrors,
|
383
|
-
loading:
|
384
|
-
},
|
423
|
+
loading: O.value
|
424
|
+
}, o))
|
385
425
|
]),
|
386
426
|
_: 3
|
387
427
|
}, 8, ["compact", "loading", "loading-text", "no-data-text", "open", "options", "style"])
|
388
428
|
]),
|
389
429
|
_: 3
|
390
|
-
})) :
|
430
|
+
})) : te("", !0)
|
391
431
|
]),
|
392
432
|
_: 3
|
393
433
|
}, 8, ["class"]));
|
394
434
|
}
|
395
435
|
});
|
396
436
|
export {
|
397
|
-
|
437
|
+
tl as default
|
398
438
|
};
|