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