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