bitboss-ui 2.1.106 → 2.1.108
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/BaseButton/BaseButton.vue.d.ts +8 -9
- package/dist/components/BbRows/BbRows.vue.d.ts +3 -53
- package/dist/components/BbRows/types.d.ts +21 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +153 -150
- package/dist/index109.js +9 -9
- package/dist/index11.js +1 -1
- package/dist/index110.js +502 -163
- package/dist/index112.js +130 -55
- package/dist/index114.js +106 -48
- package/dist/index116.js +52 -34
- package/dist/index118.js +33 -93
- package/dist/index12.js +2 -2
- package/dist/index120.js +56 -92
- package/dist/index122.js +120 -352
- package/dist/index124.js +344 -531
- package/dist/index126.js +535 -104
- package/dist/index128.js +52 -46
- package/dist/index13.js +6 -6
- package/dist/index130.js +36 -41
- package/dist/index132.js +117 -22
- package/dist/index134.js +23 -160
- package/dist/index136.js +158 -115
- package/dist/index138.js +115 -64
- package/dist/index14.js +2 -2
- package/dist/index140.js +68 -12
- package/dist/index142.js +13 -2
- package/dist/index143.js +11 -419
- package/dist/index144.js +2 -9
- package/dist/index145.js +419 -9
- package/dist/index146.js +9 -25
- package/dist/index147.js +9 -2
- package/dist/index148.js +25 -5
- package/dist/index149.js +2 -6
- package/dist/index150.js +5 -5
- package/dist/index151.js +6 -3
- package/dist/index152.js +5 -3
- package/dist/index153.js +1 -1
- package/dist/index154.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.js +1 -1
- package/dist/index159.js +1 -1
- package/dist/index16.js +5 -5
- package/dist/index160.js +1 -1
- package/dist/index161.js +1 -1
- package/dist/index162.js +1 -1
- package/dist/index163.js +1 -1
- package/dist/index164.js +1 -1
- package/dist/index165.js +1 -1
- package/dist/index166.js +1 -1
- package/dist/index167.js +1 -1
- package/dist/index168.js +1 -1
- package/dist/index169.js +1 -1
- package/dist/index170.js +1 -1
- package/dist/index171.js +1 -1
- package/dist/index172.js +1 -1
- package/dist/index173.js +1 -1
- package/dist/index174.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.js +1 -1
- package/dist/index178.js +1 -1
- package/dist/index179.js +1 -1
- package/dist/index18.js +3 -3
- package/dist/index180.js +1 -1
- package/dist/index181.js +3 -2
- package/dist/index182.js +1 -1
- package/dist/index183.js +1 -1
- package/dist/index184.js +1 -1
- package/dist/index185.js +2 -3
- package/dist/index186.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index188.js +1 -1
- package/dist/index189.js +1 -1
- package/dist/index190.js +3 -2
- package/dist/index191.js +1 -1
- package/dist/index192.js +2 -3
- package/dist/index193.js +1 -1
- package/dist/index194.js +1 -1
- package/dist/index195.js +2 -2
- package/dist/index196.js +2 -2
- package/dist/index197.js +1 -1
- package/dist/index198.js +1 -1
- package/dist/index199.js +1 -1
- package/dist/index20.js +8 -8
- package/dist/index200.js +3 -2
- package/dist/index201.js +1 -1
- package/dist/index202.js +2 -3
- package/dist/index203.js +1 -1
- package/dist/index204.js +1 -1
- package/dist/index205.js +1 -1
- package/dist/index206.js +1 -1
- package/dist/index207.js +1 -1
- package/dist/index208.js +1 -1
- package/dist/index209.js +1 -1
- package/dist/index210.js +1 -1
- package/dist/index211.js +1 -1
- package/dist/index212.js +1 -1
- package/dist/index213.js +1 -1
- package/dist/index214.js +1 -1
- package/dist/index215.js +1 -1
- package/dist/index216.js +5 -0
- package/dist/index217.js +3 -7
- package/dist/index218.js +3 -2
- package/dist/index22.js +13 -13
- package/dist/index220.js +7 -2
- package/dist/index221.js +137 -4
- package/dist/index222.js +2 -8
- package/dist/index223.js +2 -33
- package/dist/index224.js +33 -28
- package/dist/index225.js +30 -0
- package/dist/index227.js +5 -5
- package/dist/index228.js +8 -5
- package/dist/index229.js +34 -5
- package/dist/index230.js +86 -3
- package/dist/index232.js +30 -6
- package/dist/index233.js +17 -8
- package/dist/index234.js +49 -266
- package/dist/index235.js +18 -52
- package/dist/index236.js +3 -52
- package/dist/index237.js +12 -32
- package/dist/index238.js +18 -60
- package/dist/index239.js +2 -2
- package/dist/index24.js +11 -11
- package/dist/index240.js +25 -86
- package/dist/index241.js +11 -0
- package/dist/index242.js +2 -30
- package/dist/index243.js +20 -16
- package/dist/index244.js +5 -51
- package/dist/index245.js +5 -18
- package/dist/index246.js +5 -12
- package/dist/index247.js +5 -18
- package/dist/index248.js +5 -13
- package/dist/index249.js +5 -13
- package/dist/index250.js +3 -3
- package/dist/index251.js +8 -4
- package/dist/index252.js +133 -18
- package/dist/index254.js +2 -2
- package/dist/index255.js +4 -2
- package/dist/index256.js +188 -3
- package/dist/index257.js +3 -135
- package/dist/index258.js +6 -0
- package/dist/index259.js +20 -4
- package/dist/index26.js +3 -3
- package/dist/index260.js +8 -22
- package/dist/index261.js +5 -4
- package/dist/index262.js +5 -3
- package/dist/index263.js +2 -18
- package/dist/index264.js +6 -12
- package/dist/index265.js +263 -101
- package/dist/index266.js +54 -0
- package/dist/index267.js +48 -96
- package/dist/index268.js +34 -0
- package/dist/index269.js +56 -103
- package/dist/index270.js +13 -2
- package/dist/index271.js +13 -11
- package/dist/index272.js +2 -7
- package/dist/index273.js +3 -6
- package/dist/index274.js +10 -16
- package/dist/index275.js +3 -3
- package/dist/index276.js +4 -9
- package/dist/index277.js +16 -51
- package/dist/index278.js +11 -9
- package/dist/index279.js +106 -3
- package/dist/index28.js +2 -2
- package/dist/index281.js +102 -0
- package/dist/index283.js +107 -23
- package/dist/index284.js +11 -5
- package/dist/index285.js +2 -67
- package/dist/index286.js +23 -5
- package/dist/index287.js +6 -5
- package/dist/index288.js +2 -5
- package/dist/index289.js +7 -2
- package/dist/index290.js +7 -7
- package/dist/index291.js +3 -7
- package/dist/index292.js +7 -25
- package/dist/index293.js +32 -187
- package/dist/index294.js +373 -3
- package/dist/index296.js +3 -21
- package/dist/index297.js +51 -31
- package/dist/index298.js +6 -9
- package/dist/index299.js +18 -0
- package/dist/index30.js +6 -6
- package/dist/index300.js +67 -3
- package/dist/index301.js +9 -280
- package/dist/index302.js +23 -2
- package/dist/index304.js +3 -2
- package/dist/index305.js +2 -16
- package/dist/index306.js +28 -2
- package/dist/index307.js +17 -27
- package/dist/index308.js +7 -2
- package/dist/index309.js +280 -2
- package/dist/index310.js +2 -2
- package/dist/index311.js +16 -2
- package/dist/index312.js +2 -2
- package/dist/index313.js +15 -27
- package/dist/index314.js +2 -2
- package/dist/index315.js +27 -7
- package/dist/index316.js +2 -3
- package/dist/index317.js +2 -17
- package/dist/index318.js +2 -4
- package/dist/index319.js +2 -5
- package/dist/index32.js +2 -2
- package/dist/index320.js +2 -3
- package/dist/index321.js +2 -5
- package/dist/index322.js +1 -1
- package/dist/index323.js +4 -3
- package/dist/index324.js +3 -2
- package/dist/index325.js +3 -719
- package/dist/index326.js +3 -366
- package/dist/index327.js +2 -57
- package/dist/index328.js +125 -3
- package/dist/index329.js +2 -2
- package/dist/index330.js +13 -123
- package/dist/index331.js +2 -2
- package/dist/index332.js +16 -12
- package/dist/index334.js +5 -19
- package/dist/index335.js +5 -2
- package/dist/index336.js +3 -6
- package/dist/index337.js +5 -3
- package/dist/index338.js +4 -2
- package/dist/index339.js +2 -2
- package/dist/index34.js +8 -8
- package/dist/index340.js +6 -6
- package/dist/index341.js +2 -19
- package/dist/index342.js +67 -9
- package/dist/index343.js +66 -14
- package/dist/index344.js +719 -93
- package/dist/index345.js +366 -7
- package/dist/index346.js +56 -66
- package/dist/index347.js +7 -67
- package/dist/index348.js +18 -34
- package/dist/index349.js +9 -6
- package/dist/index350.js +12 -126
- package/dist/index351.js +198 -396
- package/dist/index352.js +208 -149
- package/dist/index353.js +34 -258
- package/dist/index354.js +123 -222
- package/dist/index355.js +398 -22
- package/dist/index356.js +230 -0
- package/dist/index357.js +21 -1
- package/dist/index359.js +2 -134
- package/dist/index36.js +4 -4
- package/dist/index360.js +2 -441
- package/dist/index361.js +91 -126
- package/dist/index362.js +131 -44
- package/dist/index363.js +44 -67
- package/dist/index364.js +66 -516
- package/dist/index365.js +435 -44
- package/dist/index366.js +130 -0
- package/dist/index367.js +522 -0
- package/dist/index368.js +52 -0
- package/dist/index38.js +24 -24
- package/dist/index40.js +8 -8
- package/dist/index42.js +2 -2
- package/dist/index44.js +8 -8
- package/dist/index46.js +9 -9
- package/dist/index48.js +4 -4
- package/dist/index50.js +4 -4
- package/dist/index56.js +2 -2
- package/dist/index58.js +2 -2
- package/dist/index60.js +2 -2
- package/dist/index62.js +6 -6
- package/dist/index7.js +2 -2
- package/dist/index74.js +3 -3
- package/dist/index75.js +1 -1
- package/dist/index82.js +8 -8
- package/dist/index84.js +1 -1
- package/dist/index86.js +3 -3
- package/dist/index88.js +3 -3
- package/dist/index9.js +1 -1
- package/dist/index90.js +1 -1
- package/dist/index93.js +3 -3
- package/dist/index95.js +2 -2
- package/dist/index97.js +5 -5
- package/dist/index99.js +2 -2
- package/package.json +1 -1
- package/dist/index141.js +0 -13
- package/dist/index219.js +0 -140
- package/dist/index226.js +0 -7
- package/dist/index231.js +0 -4
- package/dist/index253.js +0 -4
- package/dist/index280.js +0 -375
- package/dist/index282.js +0 -11
- package/dist/index295.js +0 -36
- package/dist/index303.js +0 -18
- package/dist/index358.js +0 -4
package/dist/index110.js
CHANGED
|
@@ -1,191 +1,530 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { defineComponent as at, ref as f, computed as l, watch as Q, toRef as X, onBeforeUnmount as rt, createElementBlock as Y, openBlock as Z, Fragment as nt, renderSlot as m, createCommentVNode as it, createVNode as F, normalizeProps as ye, mergeProps as ge, normalizeStyle as lt, normalizeClass as st, withCtx as g, createElementVNode as L, withDirectives as ut, withKeys as h, withModifiers as d, unref as I, vModelDynamic as ct, guardReactiveProps as dt, nextTick as we } from "vue";
|
|
2
|
+
import { extractDomContainer as pt } from "./index276.js";
|
|
3
|
+
import { get as vt } from "./index284.js";
|
|
4
|
+
import { hash as ee } from "./index236.js";
|
|
5
|
+
import { isNil as ft } from "./index242.js";
|
|
6
|
+
import { matchAnyKey as Be } from "./index277.js";
|
|
7
|
+
import { parseWidthString as mt } from "./index286.js";
|
|
8
|
+
import { useArray as ht } from "./index278.js";
|
|
9
|
+
import { useBaseOptions as bt } from "./index234.js";
|
|
10
|
+
import { useCoherence as yt } from "./index235.js";
|
|
11
|
+
import { useElementSize as gt, useIntersectionObserver as wt } from "./index145.js";
|
|
12
|
+
import { useHashedWatcher as Ae } from "./index237.js";
|
|
13
|
+
import { useId as Bt } from "./index8.js";
|
|
14
|
+
import { useIndexById as Ie } from "./index233.js";
|
|
15
|
+
import { useItemsGetter as At } from "./index232.js";
|
|
16
|
+
import { useMobile as It } from "./index9.js";
|
|
17
|
+
import { usePrefill as Vt } from "./index238.js";
|
|
18
|
+
import { useUntil as xt } from "./index271.js";
|
|
19
|
+
import { wait as C } from "./index144.js";
|
|
20
|
+
/* empty css */
|
|
21
|
+
/* empty css */
|
|
22
|
+
import Et from "./index118.js";
|
|
23
|
+
/* empty css */
|
|
24
|
+
import St from "./index252.js";
|
|
25
|
+
/* empty css */
|
|
26
|
+
import kt from "./index224.js";
|
|
27
|
+
import Dt from "./index283.js";
|
|
28
|
+
import { waitFor as Lt } from "./index287.js";
|
|
29
|
+
const Ct = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "bb-select-popover__search-container"
|
|
32
|
+
}, Ht = ["id", "aria-activedescendant", "aria-controls", "aria-describedby", "aria-invalid", "aria-label", "autocomplete", "inputmode", "tabindex", "onKeydown"], Pt = ["aria-controls", "aria-describedby", "aria-invalid", "aria-label", "onKeydown"], $t = ["aria-hidden", "inert"], Ft = ["aria-hidden", "inert"], co = /* @__PURE__ */ at({
|
|
33
|
+
__name: "BbSelectPopover",
|
|
8
34
|
props: {
|
|
35
|
+
activator: {},
|
|
9
36
|
allowWriting: { type: [Boolean, String], default: !0 },
|
|
10
|
-
|
|
11
|
-
autocomplete: {},
|
|
12
|
-
autofocus: {},
|
|
13
|
-
clearable: { type: Boolean },
|
|
14
|
-
comma: { type: Boolean },
|
|
37
|
+
autocomplete: { default: "off" },
|
|
15
38
|
compact: { type: Boolean },
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
39
|
+
arrowPadding: { default: 10 },
|
|
40
|
+
boundary: {},
|
|
41
|
+
dependencies: { default: () => [] },
|
|
42
|
+
depsDebounceTime: { default: 0 },
|
|
19
43
|
disabled: { type: Boolean },
|
|
44
|
+
hasErrors: { type: Boolean },
|
|
45
|
+
ariaInvalid: { type: Boolean },
|
|
46
|
+
ariaDescribedby: {},
|
|
47
|
+
flip: { type: Boolean, default: !0 },
|
|
48
|
+
hideArrow: { type: Boolean, default: !0 },
|
|
20
49
|
enforceCoherence: { type: Boolean },
|
|
21
|
-
errors: {},
|
|
22
50
|
filterBy: { type: [String, Array, Boolean, Function, null], default: () => [] },
|
|
23
51
|
groupBy: {},
|
|
24
|
-
|
|
25
|
-
hideLabel: { type: Boolean },
|
|
26
|
-
hint: {},
|
|
52
|
+
headerHeight: {},
|
|
27
53
|
id: {},
|
|
28
54
|
items: {},
|
|
29
|
-
headerHeight: {},
|
|
30
55
|
itemHeight: {},
|
|
31
56
|
itemText: {},
|
|
32
57
|
itemValue: {},
|
|
33
|
-
label: {},
|
|
34
|
-
labelPosition: {},
|
|
35
58
|
loading: { type: Boolean },
|
|
36
59
|
loadingText: {},
|
|
37
|
-
max: {},
|
|
38
|
-
maxSelectedLabels: {},
|
|
60
|
+
max: { default: 1 / 0 },
|
|
39
61
|
modelValue: {},
|
|
40
|
-
modelValueDebounceTime: {},
|
|
62
|
+
modelValueDebounceTime: { default: 0 },
|
|
41
63
|
multiple: { type: Boolean },
|
|
42
|
-
name: {},
|
|
43
64
|
noDataText: {},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
queryDebounceTime: {},
|
|
65
|
+
offset: { default: 4 },
|
|
66
|
+
padding: { default: 10 },
|
|
67
|
+
placement: { default: "bottom" },
|
|
68
|
+
prefill: { type: [Boolean, String], default: "interaction" },
|
|
69
|
+
queryDebounceTime: { default: 500 },
|
|
50
70
|
readonly: { type: Boolean },
|
|
51
|
-
|
|
52
|
-
selectedLabelsFn: {},
|
|
53
|
-
showChevron: { type: Boolean, default: !0 },
|
|
71
|
+
searchInputAriaLabel: {},
|
|
54
72
|
stash: { type: Boolean },
|
|
55
|
-
transitionDuration: {},
|
|
56
|
-
|
|
73
|
+
transitionDuration: { default: 300 },
|
|
74
|
+
width: { default: "200" }
|
|
57
75
|
},
|
|
58
76
|
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue", "option:add"],
|
|
59
|
-
setup(
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
setup(Ve, { emit: xe }) {
|
|
78
|
+
const t = Ve, s = xe;
|
|
79
|
+
if (t.multiple && !Array.isArray(t.modelValue))
|
|
80
|
+
throw new Error('Multiple is set to "true" but modelValue is not an array.');
|
|
81
|
+
const v = f(), c = f(null), O = f(null), T = f(null), H = f(), { width: w } = gt(
|
|
82
|
+
v,
|
|
83
|
+
{ width: 0, height: 0 },
|
|
84
|
+
{
|
|
85
|
+
box: "border-box"
|
|
86
|
+
}
|
|
87
|
+
), Ee = l(() => t.activator != null), te = (e) => {
|
|
88
|
+
const o = pt(e);
|
|
89
|
+
o && (v.value = o);
|
|
90
|
+
};
|
|
91
|
+
Q(
|
|
92
|
+
() => t.activator,
|
|
93
|
+
(e) => {
|
|
94
|
+
e && te(e);
|
|
67
95
|
},
|
|
68
|
-
|
|
69
|
-
|
|
96
|
+
{ immediate: !0 }
|
|
97
|
+
);
|
|
98
|
+
const { isMobile: oe } = It(), b = l(() => t.allowWriting === "not-mobile" ? !oe.value : !!t.allowWriting), Se = l(
|
|
99
|
+
() => t.allowWriting === "not-mobile" && oe.value ? "none" : void 0
|
|
100
|
+
), ae = l(
|
|
101
|
+
() => t.searchInputAriaLabel ?? "Search options"
|
|
102
|
+
), V = t.id || Bt().id.value, _ = l(() => t.ariaInvalid ?? !!t.hasErrors ? "true" : void 0), z = l(() => {
|
|
103
|
+
const e = t.ariaDescribedby;
|
|
104
|
+
if (Array.isArray(e))
|
|
105
|
+
return e.map((r) => r.trim()).filter(Boolean).join(" ") || void 0;
|
|
106
|
+
if (typeof e == "string")
|
|
107
|
+
return e.trim() || void 0;
|
|
108
|
+
}), { resume: ke, pause: De } = wt(
|
|
109
|
+
v,
|
|
110
|
+
async ([{ intersectionRatio: e }]) => {
|
|
111
|
+
e !== 1 && a.value && await A();
|
|
70
112
|
},
|
|
71
|
-
|
|
72
|
-
|
|
113
|
+
{ threshold: [0, 1], immediate: !1 }
|
|
114
|
+
), Le = l(() => {
|
|
115
|
+
if (t.width === "auto") return "auto";
|
|
116
|
+
if (t.width == null || t.width === "")
|
|
117
|
+
return w.value ? `${w.value}px` : "320px";
|
|
118
|
+
try {
|
|
119
|
+
const { value: e, unit: o } = mt(t.width);
|
|
120
|
+
return o === "%" ? w.value ? `${w.value * (e / 100)}px` : "320px" : `${e}${o}`;
|
|
121
|
+
} catch {
|
|
122
|
+
return typeof t.width == "string" ? t.width.trim() : w.value ? `${w.value}px` : "320px";
|
|
123
|
+
}
|
|
124
|
+
}), Ce = l(() => ({
|
|
125
|
+
"--bb-select-popover-width": Le.value
|
|
126
|
+
})), W = () => {
|
|
127
|
+
v.value?.focus();
|
|
128
|
+
}, x = () => {
|
|
129
|
+
O.value instanceof HTMLInputElement && O.value.focus();
|
|
130
|
+
}, K = () => {
|
|
131
|
+
T.value instanceof HTMLButtonElement && T.value.focus();
|
|
132
|
+
}, E = () => {
|
|
133
|
+
if (b.value) {
|
|
134
|
+
x();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
K();
|
|
138
|
+
}, He = (e) => {
|
|
139
|
+
s("focus", e), $();
|
|
140
|
+
}, Pe = (e) => {
|
|
141
|
+
s("blur", e), be();
|
|
142
|
+
}, $e = (e) => {
|
|
143
|
+
s("change", e);
|
|
144
|
+
}, Fe = (e) => {
|
|
145
|
+
$();
|
|
146
|
+
}, Oe = (e) => {
|
|
147
|
+
s("input", e), ze(i.value, !1, t.modelValue);
|
|
148
|
+
}, Te = (e) => {
|
|
149
|
+
H.value = e;
|
|
150
|
+
}, B = async (e) => {
|
|
151
|
+
const o = e.target instanceof Element ? e.target : e.target instanceof Text ? e.target.parentElement : null;
|
|
152
|
+
if (!o) return;
|
|
153
|
+
const r = v.value?.contains(o), n = !!o.closest(".bb-common-popover");
|
|
154
|
+
r || n || (await A(), he());
|
|
155
|
+
}, M = l(() => !(t.readonly || t.disabled || S.value)), q = async () => Lt(() => !!c.value, 100), re = () => {
|
|
156
|
+
const e = y.value[0];
|
|
157
|
+
if (e?.valueHash) {
|
|
158
|
+
c.value?.focusByHash(e.valueHash);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
c.value?.focusFirstSelected();
|
|
162
|
+
}, _e = () => {
|
|
163
|
+
const e = y.value[y.value.length - 1];
|
|
164
|
+
if (e?.valueHash) {
|
|
165
|
+
c.value?.focusByHash(e.valueHash);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
c.value?.focusLastSelected();
|
|
169
|
+
}, U = async () => {
|
|
170
|
+
M.value && (a.value ? c.value?.focusPrevious() : (await k({ focusPopoverContent: !1 }), await q(), await C(t.transitionDuration), _e()));
|
|
171
|
+
}, N = async () => {
|
|
172
|
+
M.value && (a.value ? c.value?.focusNext() : (await k({ focusPopoverContent: !1 }), await q(), await C(t.transitionDuration), re()));
|
|
173
|
+
}, j = async () => {
|
|
174
|
+
if (!M.value)
|
|
175
|
+
return;
|
|
176
|
+
if (a.value) {
|
|
177
|
+
if (c.value?.getHighlighted()) {
|
|
178
|
+
c.value.confirmOption();
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
await k({ focusPopoverContent: !1 }), await q(), await C(t.transitionDuration), y.value.length ? re() : b.value ? x() : K();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (!b.value) return;
|
|
186
|
+
const e = i.value.trim();
|
|
187
|
+
Ge(e) || (s("option:add", e), i.value = "");
|
|
188
|
+
}, G = async () => {
|
|
189
|
+
a.value && (await A(), W());
|
|
190
|
+
}, i = f(""), ne = f(!1), {
|
|
191
|
+
getter: R,
|
|
192
|
+
debouncedGetter: ze,
|
|
193
|
+
items: We,
|
|
194
|
+
loading: Ke
|
|
195
|
+
} = At({
|
|
196
|
+
items: X(t, "items"),
|
|
197
|
+
debounce: t.queryDebounceTime
|
|
198
|
+
}), {
|
|
199
|
+
array: ie,
|
|
200
|
+
add: le,
|
|
201
|
+
remove: Me,
|
|
202
|
+
set: qe
|
|
203
|
+
} = ht(), {
|
|
204
|
+
hasPrefilled: Ue,
|
|
205
|
+
isPrefilling: Ne,
|
|
206
|
+
canLoad: se,
|
|
207
|
+
prefill: je
|
|
208
|
+
} = Vt({
|
|
209
|
+
trigger: l(
|
|
210
|
+
() => t.prefill === !0 || t.prefill === "interaction" && ne.value
|
|
211
|
+
),
|
|
212
|
+
currentValue: void 0,
|
|
213
|
+
multiple: !1,
|
|
214
|
+
fn: async (e) => {
|
|
215
|
+
await R(i.value, e, t.modelValue), t.stash && le(...P.value.map((o) => o.item));
|
|
216
|
+
}
|
|
217
|
+
}), { data: ue, get: Ge } = Ie({
|
|
218
|
+
items: l(() => [].concat(t.modelValue))
|
|
219
|
+
}), { options: P } = bt({
|
|
220
|
+
disabled: X(t, "disabled"),
|
|
221
|
+
items: l(() => [...We.value, ...ie.value]),
|
|
222
|
+
itemText: t.itemText,
|
|
223
|
+
itemValue: t.itemValue,
|
|
224
|
+
max: t.max,
|
|
225
|
+
selectable: !0,
|
|
226
|
+
selectedIndexedByHash: ue
|
|
227
|
+
}), { data: ce } = Ie({
|
|
228
|
+
items: P,
|
|
229
|
+
key: "valueHash"
|
|
230
|
+
}), { coherent: de, coherentValue: pe } = yt({
|
|
231
|
+
modelValue: X(t, "modelValue"),
|
|
232
|
+
multiple: t.multiple,
|
|
233
|
+
iteratee: (e) => !!ce.value[ee(e)]
|
|
234
|
+
}), y = l(
|
|
235
|
+
() => [].concat(t.modelValue).map((e) => ce.value[ee(e)]).filter(Boolean)
|
|
236
|
+
), S = l(() => !!(Ke.value || t.loading)), Re = l(() => !!t.hasErrors), Je = l(() => t.multiple ? "" : y.value[0]?.text ?? "");
|
|
237
|
+
Ae(
|
|
238
|
+
() => t.modelValue,
|
|
239
|
+
async () => {
|
|
240
|
+
se.value && (de.value || (await R(i.value, !0, t.modelValue), t.enforceCoherence && (s("update:modelValue", pe.value), c.value?.blur())));
|
|
241
|
+
},
|
|
242
|
+
{ debounce: t.modelValueDebounceTime }
|
|
243
|
+
), Ae(
|
|
244
|
+
() => [t.dependencies, t.items],
|
|
245
|
+
async () => {
|
|
246
|
+
se.value && (await R(i.value, !0, t.modelValue), t.enforceCoherence && !de.value && (s("update:modelValue", pe.value), c.value?.blur()));
|
|
247
|
+
},
|
|
248
|
+
{ debounce: t.depsDebounceTime }
|
|
249
|
+
);
|
|
250
|
+
const Qe = async (e) => {
|
|
251
|
+
t.multiple ? (s("update:modelValue", t.modelValue.concat(e.value)), t.stash && le(e.item)) : (t.stash && qe(e.item), s("update:modelValue", e.value), await we()), t.multiple && b.value && a.value ? x() : W(), t.multiple || A();
|
|
252
|
+
}, Xe = async (e) => {
|
|
253
|
+
if (Me((o) => o.valueHash !== e.valueHash), t.multiple) {
|
|
254
|
+
const o = { ...ue.value };
|
|
255
|
+
delete o[e.valueHash], s("update:modelValue", Object.values(o));
|
|
256
|
+
} else
|
|
257
|
+
s("update:modelValue", null);
|
|
258
|
+
t.multiple && b.value && a.value ? x() : W();
|
|
259
|
+
}, ve = l(() => {
|
|
260
|
+
const e = y.value.some(
|
|
261
|
+
(n) => n.text === i.value
|
|
262
|
+
);
|
|
263
|
+
if (!(t.multiple && i.value || t.filterBy === "not_stashed" && i.value || i.value && !e && !t.multiple) || !t.filterBy) return P.value;
|
|
264
|
+
const r = t.filterBy === "not_stashed" ? new Set(ie.value.map((n) => n.valueHash)) : null;
|
|
265
|
+
return P.value.filter((n) => {
|
|
266
|
+
let p = !1;
|
|
267
|
+
return typeof t.filterBy == "function" ? p = t.filterBy(n.value, n.item, i.value) : t.filterBy === "not_stashed" && i.value ? p = !r.has(n.valueHash) : Array.isArray(t.filterBy) && t.filterBy.length && (p = Be(
|
|
268
|
+
n.item,
|
|
269
|
+
t.filterBy,
|
|
270
|
+
i.value.trim()
|
|
271
|
+
)), p || Be(n, ["text"], i.value.trim());
|
|
272
|
+
});
|
|
273
|
+
}), Ye = Symbol("default"), Ze = (e) => ft(t.groupBy) ? Ye : typeof t.groupBy == "function" ? t.groupBy(e.item) : vt(e.item, t.groupBy), et = l(() => {
|
|
274
|
+
const e = {};
|
|
275
|
+
for (const o of ve.value) {
|
|
276
|
+
const r = Ze(o), n = ee(r);
|
|
277
|
+
e[n] || (e[n] = {
|
|
278
|
+
id: n,
|
|
279
|
+
data: r ?? null,
|
|
280
|
+
options: []
|
|
281
|
+
}), e[n].options.push(o);
|
|
282
|
+
}
|
|
283
|
+
return Object.values(e).filter((o) => o.options.length);
|
|
284
|
+
}), a = f(!1), fe = xt(a), k = async ({
|
|
285
|
+
focusPopoverContent: e = !0
|
|
286
|
+
} = {}) => {
|
|
287
|
+
t.disabled || t.readonly || a.value || (ne.value = !0, ke(), a.value = !0, !Ue.value && !Ne.value && await je(), await we(), document.addEventListener("click", B), document.addEventListener("focusin", B), e && (b.value ? (await C(0), x()) : (await C(0), K())));
|
|
288
|
+
}, A = async () => {
|
|
289
|
+
a.value && (a.value = !1, c.value?.blur(), H.value = void 0, De(), document.removeEventListener("click", B), document.removeEventListener("focusin", B), i.value = "");
|
|
290
|
+
}, me = () => a.value ? A() : k(), J = f(!1), $ = () => {
|
|
291
|
+
J.value = !0;
|
|
292
|
+
}, he = () => {
|
|
293
|
+
J.value && (J.value = !1, s("inactive"));
|
|
294
|
+
}, tt = (e) => {
|
|
295
|
+
if (!(e instanceof Node)) return !1;
|
|
296
|
+
const o = !!v.value?.contains(e), r = !!c.value?.$el?.closest(".bb-common-popover")?.contains(e);
|
|
297
|
+
return o || r;
|
|
298
|
+
}, be = () => {
|
|
299
|
+
setTimeout(() => {
|
|
300
|
+
if (tt(document.activeElement)) {
|
|
301
|
+
$();
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
he();
|
|
305
|
+
}, 0);
|
|
306
|
+
}, ot = () => {
|
|
307
|
+
s("update:modelValue", t.multiple ? [] : null);
|
|
73
308
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
309
|
+
let D = null;
|
|
310
|
+
return Q(
|
|
311
|
+
v,
|
|
312
|
+
(e) => {
|
|
313
|
+
if (D && (D(), D = null), !e) return;
|
|
314
|
+
e.setAttribute("role", "combobox"), e.setAttribute("aria-haspopup", "listbox");
|
|
315
|
+
const o = (u) => {
|
|
316
|
+
s("click", u), !(t.disabled || t.readonly) && (u.preventDefault(), me());
|
|
317
|
+
}, r = (u) => {
|
|
318
|
+
switch (u.key) {
|
|
319
|
+
case "ArrowDown":
|
|
320
|
+
u.preventDefault(), N();
|
|
321
|
+
break;
|
|
322
|
+
case "ArrowUp":
|
|
323
|
+
u.preventDefault(), U();
|
|
324
|
+
break;
|
|
325
|
+
case "Enter":
|
|
326
|
+
u.preventDefault(), j();
|
|
327
|
+
break;
|
|
328
|
+
case "Escape":
|
|
329
|
+
a.value && (u.preventDefault(), G());
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
}, n = (u) => {
|
|
333
|
+
s("focus", u), $();
|
|
334
|
+
}, p = (u) => {
|
|
335
|
+
s("blur", u), be();
|
|
336
|
+
};
|
|
337
|
+
e.addEventListener("click", o), e.addEventListener("keydown", r), e.addEventListener("focus", n), e.addEventListener("blur", p), D = () => {
|
|
338
|
+
e.removeEventListener("click", o), e.removeEventListener("keydown", r), e.removeEventListener("focus", n), e.removeEventListener("blur", p), e.removeAttribute("role"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), e.removeAttribute("aria-activedescendant");
|
|
339
|
+
};
|
|
340
|
+
},
|
|
341
|
+
{ immediate: !0 }
|
|
342
|
+
), Q(
|
|
343
|
+
[
|
|
344
|
+
v,
|
|
345
|
+
a,
|
|
346
|
+
fe,
|
|
347
|
+
_,
|
|
348
|
+
z,
|
|
349
|
+
H
|
|
350
|
+
],
|
|
351
|
+
([e, o, r, n, p, u]) => {
|
|
352
|
+
e && (e.setAttribute("aria-expanded", String(o)), n != null ? e.setAttribute("aria-invalid", n) : e.removeAttribute("aria-invalid"), r ? e.setAttribute("aria-controls", `${V}_listbox`) : e.removeAttribute("aria-controls"), p != null ? e.setAttribute("aria-describedby", p) : e.removeAttribute("aria-describedby"), o && u ? e.setAttribute("aria-activedescendant", u) : e.removeAttribute("aria-activedescendant"));
|
|
353
|
+
},
|
|
354
|
+
{ immediate: !0 }
|
|
355
|
+
), rt(() => {
|
|
356
|
+
D?.(), document.removeEventListener("click", B), document.removeEventListener("focusin", B);
|
|
357
|
+
}), (e, o) => (Z(), Y(nt, null, [
|
|
358
|
+
Ee.value ? it("", !0) : m(e.$slots, "activator", ye(ge({ key: 0 }, {
|
|
359
|
+
props: {
|
|
360
|
+
ref: te
|
|
361
|
+
},
|
|
362
|
+
shown: a.value,
|
|
363
|
+
disabled: e.disabled,
|
|
364
|
+
readonly: e.readonly,
|
|
365
|
+
loading: S.value,
|
|
366
|
+
query: i.value,
|
|
367
|
+
selectedOptions: y.value,
|
|
368
|
+
text: Je.value,
|
|
369
|
+
clear: ot,
|
|
370
|
+
open: k,
|
|
371
|
+
close: A,
|
|
372
|
+
toggle: me
|
|
373
|
+
}))),
|
|
374
|
+
F(St, {
|
|
375
|
+
modelValue: a.value,
|
|
376
|
+
"onUpdate:modelValue": o[1] || (o[1] = (r) => a.value = r),
|
|
377
|
+
anchor: v.value,
|
|
378
|
+
"arrow-padding": e.arrowPadding,
|
|
379
|
+
boundary: e.boundary,
|
|
380
|
+
class: st(["bb-select-popover", {
|
|
381
|
+
"bb-select-popover--errors": Re.value,
|
|
382
|
+
"bb-select-popover--loading": S.value
|
|
383
|
+
}]),
|
|
384
|
+
flip: e.flip,
|
|
385
|
+
placement: e.placement,
|
|
386
|
+
offset: e.offset,
|
|
387
|
+
padding: e.padding,
|
|
388
|
+
"transition-duration": e.transitionDuration,
|
|
389
|
+
"hide-arrow": e.hideArrow,
|
|
390
|
+
style: lt(Ce.value)
|
|
391
|
+
}, {
|
|
392
|
+
default: g(() => [
|
|
393
|
+
b.value ? (Z(), Y("div", Ct, [
|
|
394
|
+
ut(L("input", {
|
|
395
|
+
id: `${I(V)}_search`,
|
|
396
|
+
ref_key: "searchInput",
|
|
397
|
+
ref: O,
|
|
398
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => i.value = r),
|
|
399
|
+
"aria-activedescendant": H.value,
|
|
400
|
+
"aria-controls": I(fe) ? `${I(V)}_listbox` : void 0,
|
|
401
|
+
"aria-describedby": z.value,
|
|
402
|
+
"aria-invalid": _.value,
|
|
403
|
+
"aria-label": ae.value,
|
|
404
|
+
autocomplete: e.autocomplete,
|
|
405
|
+
class: "bb-select-popover__search-input",
|
|
406
|
+
inputmode: Se.value,
|
|
407
|
+
tabindex: a.value ? 0 : -1,
|
|
408
|
+
role: "searchbox",
|
|
409
|
+
type: "text",
|
|
410
|
+
onBlur: d(Pe, ["stop"]),
|
|
411
|
+
onChange: d($e, ["stop"]),
|
|
412
|
+
onFocus: d(He, ["stop"]),
|
|
413
|
+
onInput: d(Oe, ["stop"]),
|
|
414
|
+
onKeydown: [
|
|
415
|
+
h(d(N, ["stop", "prevent"]), ["down"]),
|
|
416
|
+
h(d(j, ["stop", "prevent"]), ["enter"]),
|
|
417
|
+
h(d(G, ["stop", "prevent"]), ["esc"]),
|
|
418
|
+
h(d(U, ["stop", "prevent"]), ["up"])
|
|
419
|
+
]
|
|
420
|
+
}, null, 40, Ht), [
|
|
421
|
+
[ct, i.value]
|
|
422
|
+
]),
|
|
423
|
+
F(kt, {
|
|
424
|
+
"aria-hidden": "true",
|
|
425
|
+
class: "bb-select-popover__search-error-icon",
|
|
426
|
+
focusable: "false"
|
|
427
|
+
}),
|
|
428
|
+
F(I(Et), {
|
|
429
|
+
"aria-hidden": "true",
|
|
430
|
+
class: "bb-select-popover__search-spinner",
|
|
431
|
+
focusable: "false"
|
|
432
|
+
}),
|
|
433
|
+
o[2] || (o[2] = L("svg", {
|
|
434
|
+
class: "bb-select-popover__search-icon",
|
|
435
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
436
|
+
viewBox: "0 0 24 24",
|
|
437
|
+
"aria-hidden": "true"
|
|
438
|
+
}, [
|
|
439
|
+
L("path", {
|
|
440
|
+
fill: "none",
|
|
441
|
+
stroke: "currentColor",
|
|
442
|
+
"stroke-linecap": "round",
|
|
443
|
+
"stroke-linejoin": "round",
|
|
444
|
+
"stroke-width": "2",
|
|
445
|
+
d: "m21 21-4.343-4.343m0 0A8 8 0 1 0 5.343 5.343a8 8 0 0 0 11.314 11.314"
|
|
446
|
+
})
|
|
447
|
+
], -1))
|
|
448
|
+
])) : (Z(), Y("button", {
|
|
449
|
+
key: 1,
|
|
450
|
+
ref_key: "popoverFocusProxy",
|
|
451
|
+
ref: T,
|
|
452
|
+
class: "bb-select-popover__focus-proxy sr-only",
|
|
453
|
+
type: "button",
|
|
454
|
+
"aria-controls": `${I(V)}_listbox`,
|
|
455
|
+
"aria-describedby": z.value,
|
|
456
|
+
"aria-invalid": _.value,
|
|
457
|
+
"aria-label": ae.value,
|
|
458
|
+
tabindex: "-1",
|
|
459
|
+
onFocus: Fe,
|
|
460
|
+
onKeydown: [
|
|
461
|
+
h(d(N, ["stop", "prevent"]), ["down"]),
|
|
462
|
+
h(d(U, ["stop", "prevent"]), ["up"]),
|
|
463
|
+
h(d(j, ["stop", "prevent"]), ["enter"]),
|
|
464
|
+
h(d(G, ["stop", "prevent"]), ["esc"])
|
|
465
|
+
]
|
|
466
|
+
}, " Focus options ", 40, Pt)),
|
|
467
|
+
L("div", {
|
|
468
|
+
class: "bb-select-popover__options-outer",
|
|
469
|
+
"aria-hidden": a.value ? void 0 : "true",
|
|
470
|
+
inert: !a.value
|
|
471
|
+
}, [
|
|
472
|
+
m(e.$slots, "options:prepend:outer", { focus: E })
|
|
473
|
+
], 8, $t),
|
|
474
|
+
F(Dt, {
|
|
475
|
+
id: `${I(V)}_listbox`,
|
|
476
|
+
ref_key: "optionsContainer",
|
|
477
|
+
ref: c,
|
|
478
|
+
compact: e.compact,
|
|
479
|
+
loading: S.value,
|
|
480
|
+
"loading-text": e.loadingText,
|
|
481
|
+
multiple: e.multiple,
|
|
482
|
+
"no-data-text": e.noDataText,
|
|
483
|
+
open: a.value,
|
|
484
|
+
options: e.groupBy ? void 0 : ve.value,
|
|
485
|
+
groups: e.groupBy ? et.value : void 0,
|
|
486
|
+
"header-height": e.headerHeight,
|
|
487
|
+
"option-height": e.itemHeight,
|
|
488
|
+
"onFocused:change": Te,
|
|
489
|
+
"onOption:selected": Qe,
|
|
490
|
+
"onOption:unselected": Xe
|
|
491
|
+
}, {
|
|
492
|
+
"options:prepend": g(() => [
|
|
493
|
+
m(e.$slots, "options:prepend", { focus: E })
|
|
494
|
+
]),
|
|
495
|
+
loading: g(() => [
|
|
496
|
+
m(e.$slots, "loading", { query: i.value })
|
|
497
|
+
]),
|
|
498
|
+
"no-data": g(() => [
|
|
499
|
+
m(e.$slots, "no-data", {
|
|
500
|
+
query: i.value,
|
|
501
|
+
focus: E
|
|
502
|
+
})
|
|
503
|
+
]),
|
|
504
|
+
"options:append": g(() => [
|
|
505
|
+
m(e.$slots, "options:append", { focus: E })
|
|
506
|
+
]),
|
|
507
|
+
option: g((r) => [
|
|
508
|
+
m(e.$slots, "option", ge({ loading: S.value }, r))
|
|
509
|
+
]),
|
|
510
|
+
group: g((r) => [
|
|
511
|
+
m(e.$slots, "group", ye(dt(r)))
|
|
512
|
+
]),
|
|
513
|
+
_: 3
|
|
514
|
+
}, 8, ["id", "compact", "loading", "loading-text", "multiple", "no-data-text", "open", "options", "groups", "header-height", "option-height"]),
|
|
515
|
+
L("div", {
|
|
516
|
+
class: "bb-select-popover__options-outer",
|
|
517
|
+
"aria-hidden": a.value ? void 0 : "true",
|
|
518
|
+
inert: !a.value
|
|
519
|
+
}, [
|
|
520
|
+
m(e.$slots, "options:append:outer", { focus: E })
|
|
521
|
+
], 8, Ft)
|
|
522
|
+
]),
|
|
523
|
+
_: 3
|
|
524
|
+
}, 8, ["modelValue", "anchor", "arrow-padding", "boundary", "class", "flip", "placement", "offset", "padding", "transition-duration", "hide-arrow", "style"])
|
|
525
|
+
], 64));
|
|
187
526
|
}
|
|
188
527
|
});
|
|
189
528
|
export {
|
|
190
|
-
|
|
529
|
+
co as default
|
|
191
530
|
};
|