bitboss-ui 2.1.96 → 2.1.98
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/README.md +138 -11
- package/dist/index108.js +9 -9
- 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 +4 -4
- 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/index144.js +1 -1
- package/dist/index145.js +2 -2
- package/dist/index16.js +4 -4
- package/dist/index18.js +3 -3
- package/dist/index20.js +8 -8
- package/dist/index217.js +2 -2
- package/dist/index218.js +2 -2
- package/dist/index219.js +5 -5
- package/dist/index22.js +14 -14
- package/dist/index220.js +5 -8
- package/dist/index221.js +5 -5
- package/dist/index222.js +5 -5
- package/dist/index223.js +3 -5
- package/dist/index224.js +2 -5
- package/dist/index225.js +6 -3
- package/dist/index226.js +8 -2
- package/dist/index227.js +268 -6
- package/dist/index228.js +50 -6
- package/dist/index229.js +44 -260
- package/dist/index230.js +25 -45
- package/dist/index231.js +48 -40
- package/dist/index232.js +12 -31
- package/dist/index233.js +5 -60
- package/dist/index234.js +5 -13
- package/dist/index235.js +5 -4
- package/dist/index236.js +2 -20
- package/dist/index237.js +3 -201
- package/dist/index238.js +22 -0
- package/dist/index239.js +6 -6
- package/dist/index24.js +10 -10
- package/dist/index241.js +86 -33
- package/dist/index243.js +31 -0
- package/dist/index244.js +17 -2
- package/dist/index245.js +51 -2
- package/dist/index246.js +12 -48
- package/dist/index247.js +11 -16
- package/dist/index248.js +16 -106
- package/dist/index249.js +4 -0
- package/dist/index250.js +2 -100
- package/dist/index251.js +5 -0
- package/dist/index252.js +5 -3
- package/dist/index253.js +8 -5
- package/dist/index254.js +33 -5
- package/dist/index255.js +28 -5
- package/dist/index257.js +2 -34
- package/dist/index258.js +188 -86
- package/dist/index259.js +5 -0
- package/dist/index26.js +3 -3
- package/dist/index260.js +11 -27
- package/dist/index261.js +4 -15
- package/dist/index262.js +22 -11
- package/dist/index263.js +12 -15
- package/dist/index264.js +8 -187
- package/dist/index265.js +7 -3
- package/dist/index266.js +3 -9
- package/dist/index267.js +33 -17
- package/dist/index268.js +4 -12
- package/dist/index269.js +201 -4
- package/dist/index271.js +8 -12
- package/dist/index272.js +23 -11
- package/dist/index273.js +33 -5
- package/dist/index274.js +11 -2
- package/dist/index275.js +10 -3
- package/dist/index276.js +3 -4
- package/dist/index277.js +105 -22
- package/dist/index279.js +100 -23
- package/dist/index28.js +1 -1
- package/dist/index281.js +17 -6
- package/dist/index282.js +12 -7
- package/dist/index283.js +4 -33
- package/dist/index284.js +103 -12
- package/dist/index285.js +3 -67
- package/dist/index286.js +67 -10
- package/dist/index287.js +6 -3
- package/dist/index288.js +16 -6
- package/dist/index289.js +2 -16
- package/dist/index290.js +7 -9
- package/dist/index291.js +6 -20
- package/dist/index292.js +11 -0
- package/dist/index293.js +53 -3
- package/dist/index294.js +21 -3
- package/dist/index295.js +5 -3
- package/dist/index296.js +2 -2
- package/dist/index297.js +3 -3
- package/dist/index298.js +17 -3
- package/dist/index299.js +28 -7
- package/dist/index30.js +3 -3
- package/dist/index301.js +3 -280
- package/dist/index302.js +280 -2
- package/dist/index303.js +2 -16
- package/dist/index304.js +16 -2
- package/dist/index305.js +2 -16
- package/dist/index306.js +16 -2
- package/dist/index307.js +2 -27
- package/dist/index308.js +27 -2
- package/dist/index309.js +2 -2
- package/dist/index310.js +1 -1
- package/dist/index311.js +1 -1
- package/dist/index312.js +1 -1
- package/dist/index313.js +2 -28
- package/dist/index314.js +1 -1
- package/dist/index315.js +1 -1
- package/dist/index316.js +125 -3
- package/dist/index317.js +2 -17
- package/dist/index318.js +15 -2
- package/dist/index319.js +2 -3
- package/dist/index32.js +2 -2
- package/dist/index320.js +16 -122
- package/dist/index321.js +2 -2
- package/dist/index322.js +2 -15
- package/dist/index323.js +5 -2
- package/dist/index324.js +3 -19
- package/dist/index325.js +2 -2
- package/dist/index326.js +3 -4
- package/dist/index327.js +3 -2
- package/dist/index328.js +5 -2
- package/dist/index329.js +719 -5
- package/dist/index330.js +366 -5
- package/dist/index331.js +57 -719
- package/dist/index332.js +2 -366
- package/dist/index333.js +4 -57
- package/dist/index334.js +3 -7
- package/dist/index335.js +5 -5
- package/dist/index336.js +7 -8
- package/dist/index337.js +5 -35
- package/dist/index338.js +35 -6
- package/dist/index339.js +6 -129
- package/dist/index34.js +8 -8
- package/dist/index340.js +113 -382
- package/dist/index341.js +396 -56
- package/dist/index342.js +33 -33
- package/dist/index343.js +58 -6
- package/dist/index344.js +6 -3
- package/dist/index345.js +19 -5
- package/dist/index346.js +8 -6
- package/dist/index347.js +13 -17
- package/dist/index348.js +7 -8
- package/dist/index349.js +5 -14
- package/dist/index350.js +8 -7
- package/dist/index351.js +89 -130
- package/dist/index354.js +226 -191
- package/dist/index355.js +133 -257
- package/dist/index356.js +191 -91
- package/dist/index357.js +256 -226
- 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 +19 -19
- 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 +5 -5
- 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 +4 -4
- package/dist/index98.js +1 -1
- package/package.json +13 -2
- package/dist/index242.js +0 -30
- package/dist/index256.js +0 -4
- package/dist/index270.js +0 -106
- package/dist/index278.js +0 -11
- package/dist/index280.js +0 -4
- package/dist/index300.js +0 -55
package/dist/index356.js
CHANGED
|
@@ -1,95 +1,195 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
import { defineComponent as K, useTemplateRef as $, computed as a, watch as v, ref as Q, createElementBlock as s, openBlock as i, withModifiers as U, normalizeStyle as b, normalizeClass as L, createElementVNode as p, renderSlot as r, createTextVNode as z, toDisplayString as f, unref as D, Fragment as W, renderList as X } from "vue";
|
|
2
|
+
import { isNil as E } from "./index257.js";
|
|
3
|
+
import { isNotNil as Z } from "./index146.js";
|
|
4
|
+
import { useVirtualizer as w } from "./index362.js";
|
|
5
|
+
import { hash as N } from "./index223.js";
|
|
6
|
+
import { useLocale as ee } from "./index232.js";
|
|
7
|
+
import { useListboxFocus as te } from "./index363.js";
|
|
8
|
+
import { indexBy as oe } from "./index294.js";
|
|
9
|
+
const le = { class: "bb-listbox__outer-container scrollbar-border" }, ne = {
|
|
10
|
+
ref: "inner",
|
|
11
|
+
class: "bb-listbox__inner-container",
|
|
12
|
+
tabindex: "-1"
|
|
13
|
+
}, ae = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "bb-listbox__loading"
|
|
16
|
+
}, se = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "bb-listbox__no-data"
|
|
19
|
+
}, ie = ["aria-selected", "data-index"], ue = { class: "autocomplete-option__label" }, xe = /* @__PURE__ */ K({
|
|
20
|
+
__name: "FlatListBox",
|
|
21
|
+
props: {
|
|
22
|
+
compact: { type: Boolean },
|
|
23
|
+
options: {},
|
|
24
|
+
open: { type: Boolean },
|
|
25
|
+
loading: { type: Boolean },
|
|
26
|
+
multiple: { type: Boolean },
|
|
27
|
+
transitionDuration: { default: 250 },
|
|
28
|
+
loadingText: {},
|
|
29
|
+
noDataText: {},
|
|
30
|
+
optionHeight: {}
|
|
31
|
+
},
|
|
32
|
+
emits: ["option:selected", "option:unselected"],
|
|
33
|
+
setup(F, { expose: M, emit: R }) {
|
|
34
|
+
const n = F, x = R, { t: h } = ee(), u = $("inner"), V = $("listbox"), g = a(() => n.optionHeight ? n.optionHeight : n.compact ? 32 : 40), c = w({
|
|
35
|
+
get count() {
|
|
36
|
+
return n.options.length;
|
|
37
|
+
},
|
|
38
|
+
getScrollElement: () => u.value ?? null,
|
|
39
|
+
estimateSize: () => g.value,
|
|
40
|
+
overscan: 5
|
|
41
|
+
}), y = a(() => c.value.getVirtualItems()), C = a(() => c.value.getTotalSize());
|
|
42
|
+
console.log(y.value);
|
|
43
|
+
const _ = a(
|
|
44
|
+
() => n.options.map((e, l) => ({
|
|
45
|
+
index: l,
|
|
46
|
+
text: e.text,
|
|
47
|
+
value: e.value,
|
|
48
|
+
valueHash: e.valueHash,
|
|
49
|
+
item: e.item,
|
|
50
|
+
selected: !!e.selected,
|
|
51
|
+
disabled: !!e.disabled,
|
|
52
|
+
focused: l === d.value
|
|
53
|
+
}))
|
|
54
|
+
), o = a(() => oe(_.value, "index")), m = a(() => _.value.length > 0), {
|
|
55
|
+
focusedIndex: d,
|
|
56
|
+
focusNext: I,
|
|
57
|
+
focusPrevious: O,
|
|
58
|
+
focusFirst: P,
|
|
59
|
+
focusLast: Y,
|
|
60
|
+
focusFirstSelected: j,
|
|
61
|
+
focusLastSelected: q,
|
|
62
|
+
focusByHash: A,
|
|
63
|
+
blur: H,
|
|
64
|
+
getHighlighted: G
|
|
65
|
+
} = te(() => n.options, { disabled: () => !n.open });
|
|
66
|
+
v(d, (e) => {
|
|
67
|
+
u.value && Z(e) && c.value.scrollToIndex(e, {
|
|
68
|
+
align: "center",
|
|
69
|
+
behavior: "smooth"
|
|
70
|
+
});
|
|
64
71
|
});
|
|
72
|
+
const k = () => {
|
|
73
|
+
if (E(d.value) || !n.open) return;
|
|
74
|
+
const e = o.value[d.value];
|
|
75
|
+
e.disabled || (e.selected ? x("option:unselected", e) : x("option:selected", e));
|
|
76
|
+
}, B = Q(0), T = () => {
|
|
77
|
+
u.value && (B.value = u.value.scrollHeight);
|
|
78
|
+
}, J = (e) => {
|
|
79
|
+
if (e.preventDefault(), u.value && e.target instanceof HTMLElement && V.value) {
|
|
80
|
+
let l = e.target, t = l.dataset.index;
|
|
81
|
+
for (; E(t) && l.parentElement; )
|
|
82
|
+
l = l.parentElement, t = l.dataset.index;
|
|
83
|
+
if (t) {
|
|
84
|
+
const S = o.value[+t];
|
|
85
|
+
S && !S.disabled && (d.value = +t, k());
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return v(
|
|
90
|
+
() => n.open,
|
|
91
|
+
() => {
|
|
92
|
+
T();
|
|
93
|
+
},
|
|
94
|
+
{ flush: "post" }
|
|
95
|
+
), v(
|
|
96
|
+
() => n.options,
|
|
97
|
+
(e, l) => {
|
|
98
|
+
N(e.map((t) => t.valueHash)) !== N(l.map((t) => t.valueHash)) && (c.value.calculateRange(), T(), H());
|
|
99
|
+
},
|
|
100
|
+
{ flush: "post" }
|
|
101
|
+
), M({
|
|
102
|
+
focusNext: I,
|
|
103
|
+
focusPrevious: O,
|
|
104
|
+
focusFirst: P,
|
|
105
|
+
focusFirstSelected: j,
|
|
106
|
+
focusLast: Y,
|
|
107
|
+
focusLastSelected: q,
|
|
108
|
+
blur: H,
|
|
109
|
+
confirmOption: k,
|
|
110
|
+
focusByHash: A,
|
|
111
|
+
getHighlighted: G
|
|
112
|
+
}), (e, l) => (i(), s("span", {
|
|
113
|
+
class: L(["bb-listbox", {
|
|
114
|
+
"bb-listbox--compact": e.compact,
|
|
115
|
+
"bb-listbox--loading": e.loading,
|
|
116
|
+
"bb-listbox--multiple": e.multiple,
|
|
117
|
+
"bb-listbox--no-data": !m.value,
|
|
118
|
+
"bb-listbox--open": e.open
|
|
119
|
+
}]),
|
|
120
|
+
style: b({
|
|
121
|
+
"--transition-duration": `${e.transitionDuration}ms`,
|
|
122
|
+
"--overlay-min-height": `${B.value}px`,
|
|
123
|
+
"--option-height": `${g.value}px`
|
|
124
|
+
}),
|
|
125
|
+
onClick: U(J, ["stop"])
|
|
126
|
+
}, [
|
|
127
|
+
p("span", le, [
|
|
128
|
+
p("span", ne, [
|
|
129
|
+
r(e.$slots, "options:prepend"),
|
|
130
|
+
e.loading && !m.value ? (i(), s("span", ae, [
|
|
131
|
+
r(e.$slots, "loading", {}, () => [
|
|
132
|
+
z(f(e.loadingText || D(h)("common.loadingText").value), 1)
|
|
133
|
+
])
|
|
134
|
+
])) : m.value ? (i(), s("span", {
|
|
135
|
+
key: 2,
|
|
136
|
+
role: "listbox",
|
|
137
|
+
ref: "listbox",
|
|
138
|
+
style: b({
|
|
139
|
+
height: `${C.value}px`
|
|
140
|
+
}),
|
|
141
|
+
tabindex: "-1"
|
|
142
|
+
}, [
|
|
143
|
+
(i(!0), s(W, null, X(y.value, (t) => (i(), s("span", {
|
|
144
|
+
key: o.value[t.index].valueHash,
|
|
145
|
+
"aria-selected": o.value[t.index].focused ? !0 : void 0,
|
|
146
|
+
class: L({
|
|
147
|
+
"bb-listbox__option autocomplete-option": !0,
|
|
148
|
+
"autocomplete-option--focused": o.value[t.index].focused,
|
|
149
|
+
"autocomplete-option--selected": o.value[t.index].selected,
|
|
150
|
+
"autocomplete-option--disabled": o.value[t.index].disabled
|
|
151
|
+
}),
|
|
152
|
+
"data-index": t.index,
|
|
153
|
+
role: "option",
|
|
154
|
+
style: b({
|
|
155
|
+
transform: `translateY(${t.start}px)`
|
|
156
|
+
})
|
|
157
|
+
}, [
|
|
158
|
+
r(e.$slots, "option", {
|
|
159
|
+
disabled: o.value[t.index].disabled,
|
|
160
|
+
focused: o.value[t.index].focused,
|
|
161
|
+
index: t.index,
|
|
162
|
+
item: o.value[t.index].item,
|
|
163
|
+
selected: o.value[t.index].selected,
|
|
164
|
+
text: o.value[t.index].text,
|
|
165
|
+
value: o.value[t.index].value
|
|
166
|
+
}, () => [
|
|
167
|
+
l[0] || (l[0] = p("svg", {
|
|
168
|
+
class: "autocomplete-option__checkbox",
|
|
169
|
+
role: "presentation",
|
|
170
|
+
viewBox: "276.411 158.834 114.971 114.97"
|
|
171
|
+
}, [
|
|
172
|
+
p("path", {
|
|
173
|
+
d: "M 297.574 224.786 L 318.309 243.134 L 371.568 189.232",
|
|
174
|
+
fill: "none",
|
|
175
|
+
"stroke-linecap": "round",
|
|
176
|
+
"stroke-width": "14px"
|
|
177
|
+
})
|
|
178
|
+
], -1)),
|
|
179
|
+
p("span", ue, f(o.value[t.index].text), 1)
|
|
180
|
+
])
|
|
181
|
+
], 14, ie))), 128))
|
|
182
|
+
], 4)) : (i(), s("span", se, [
|
|
183
|
+
r(e.$slots, "no-data", {}, () => [
|
|
184
|
+
z(f(e.noDataText || D(h)("common.noDataText").value), 1)
|
|
185
|
+
])
|
|
186
|
+
])),
|
|
187
|
+
r(e.$slots, "options:append")
|
|
188
|
+
], 512)
|
|
189
|
+
])
|
|
190
|
+
], 6));
|
|
65
191
|
}
|
|
66
|
-
|
|
67
|
-
var r = typeof e;
|
|
68
|
-
return !!e && (r == "object" || r == "function");
|
|
69
|
-
}
|
|
70
|
-
function X(e) {
|
|
71
|
-
return !!e && typeof e == "object";
|
|
72
|
-
}
|
|
73
|
-
function z(e) {
|
|
74
|
-
return typeof e == "symbol" || X(e) && G.call(e) == W;
|
|
75
|
-
}
|
|
76
|
-
function O(e) {
|
|
77
|
-
if (typeof e == "number")
|
|
78
|
-
return e;
|
|
79
|
-
if (z(e))
|
|
80
|
-
return I;
|
|
81
|
-
if (m(e)) {
|
|
82
|
-
var r = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
83
|
-
e = m(r) ? r + "" : r;
|
|
84
|
-
}
|
|
85
|
-
if (typeof e != "string")
|
|
86
|
-
return e === 0 ? e : +e;
|
|
87
|
-
e = e.replace(C, "");
|
|
88
|
-
var n = N.test(e);
|
|
89
|
-
return n || R.test(e) ? $(e.slice(2), n ? 2 : 8) : M.test(e) ? I : +e;
|
|
90
|
-
}
|
|
91
|
-
return p = U, p;
|
|
92
|
-
}
|
|
192
|
+
});
|
|
93
193
|
export {
|
|
94
|
-
|
|
194
|
+
xe as default
|
|
95
195
|
};
|