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