bitboss-ui 2.0.22 → 2.0.23
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/index107.js +5 -5
- package/dist/index115.js +1 -1
- package/dist/index117.js +5 -5
- package/dist/index119.js +1 -1
- package/dist/index123.js +1 -1
- package/dist/index124.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index129.js +2 -2
- package/dist/index130.js +1 -1
- package/dist/index14.js +1 -1
- package/dist/index16.js +3 -3
- package/dist/index18.js +2 -2
- package/dist/index199.js +2 -81
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +12 -12
- package/dist/index200.js +80 -7
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +44 -3
- package/dist/index201.js.map +1 -1
- package/dist/index203.js +12 -43
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +6 -0
- package/dist/index204.js.map +1 -0
- package/dist/index205.js +3 -13
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +33 -156
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +5 -83
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +10 -0
- package/dist/index208.js.map +1 -0
- package/dist/index209.js +8 -3
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +123 -32
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +5 -6
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +123 -7
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +18 -280
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -2
- package/dist/index215.js +2 -2
- package/dist/index216.js +2 -19
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +2 -19
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +172 -25
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +5 -3
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +13 -13
- package/dist/index220.js +369 -2
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +17 -247
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +26 -51
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +3 -44
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +249 -5
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +43 -40
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +44 -2
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +5 -4
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +49 -2
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +151 -119
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +84 -123
- package/dist/index230.js.map +1 -1
- package/dist/index232.js +2 -174
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +4 -5
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -369
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +2 -2
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +18 -2
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +105 -17
- package/dist/index237.js.map +1 -1
- package/dist/{index240.js → index239.js} +2 -2
- package/dist/{index240.js.map → index239.js.map} +1 -1
- package/dist/index24.js +5 -5
- package/dist/index241.js +5 -0
- package/dist/index241.js.map +1 -0
- package/dist/index244.js +3 -6
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +8 -15
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +23 -9
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +9 -3
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +6 -9
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +16 -23
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +1 -1
- package/dist/index251.js +1 -1
- package/dist/index254.js +431 -3
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +88 -11
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +280 -8
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +6 -9
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +2 -17
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +2 -2
- package/dist/index259.js.map +1 -1
- package/dist/index26.js +1 -1
- package/dist/index260.js +2 -66
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +2 -5
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +2 -431
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +119 -82
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +22 -6
- package/dist/index264.js.map +1 -1
- package/dist/index266.js +200 -2
- package/dist/index266.js.map +1 -1
- package/dist/index269.js +2 -2
- package/dist/index270.js +2 -2
- package/dist/index271.js +1 -1
- package/dist/index272.js +1 -1
- package/dist/index273.js +28 -2
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +21 -1
- package/dist/index274.js.map +1 -1
- package/dist/index276.js +435 -21
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +130 -0
- package/dist/index277.js.map +1 -0
- package/dist/index278.js +2 -200
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +9 -4
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +3 -3
- package/dist/index280.js +3 -2
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +12 -126
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +8 -21
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +20 -0
- package/dist/index283.js.map +1 -0
- package/dist/index284.js +64 -434
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +5 -127
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +4 -3
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +1 -1
- package/dist/index288.js +3 -211
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +211 -15
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +15 -4
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +79 -4
- package/dist/index291.js.map +1 -1
- package/dist/index293.js +4 -79
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +7 -0
- package/dist/index294.js.map +1 -0
- package/dist/index295.js +59 -2
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +34 -10
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +2 -35
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +10 -6
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +5 -17
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +2 -2
- package/dist/index300.js +6 -46
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +17 -5
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +47 -480
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +483 -0
- package/dist/index303.js.map +1 -0
- package/dist/index305.js +416 -42
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +47 -2
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +5 -0
- package/dist/index307.js.map +1 -0
- package/dist/index32.js +2 -2
- package/dist/index34.js +3 -3
- package/dist/index36.js +13 -13
- package/dist/index38.js +4 -4
- package/dist/index40.js +2 -2
- package/dist/index42.js +2 -2
- package/dist/index44.js +6 -6
- package/dist/index46.js +2 -2
- package/dist/index48.js +2 -2
- package/dist/index54.js +1 -1
- package/dist/index56.js +1 -1
- package/dist/index72.js +3 -3
- package/dist/index76.js +2 -2
- package/dist/index78.js +1 -1
- package/dist/index81.js +2 -2
- package/dist/index83.js +1 -1
- package/dist/index85.js +3 -3
- package/dist/index87.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/index202.js +0 -5
- package/dist/index202.js.map +0 -1
- package/dist/index231.js +0 -5
- package/dist/index231.js.map +0 -1
- package/dist/index238.js +0 -109
- package/dist/index238.js.map +0 -1
- package/dist/index265.js +0 -5
- package/dist/index265.js.map +0 -1
- package/dist/index275.js +0 -31
- package/dist/index275.js.map +0 -1
- package/dist/index292.js +0 -62
- package/dist/index292.js.map +0 -1
- package/dist/index304.js +0 -424
- package/dist/index304.js.map +0 -1
package/dist/index201.js
CHANGED
@@ -1,6 +1,47 @@
|
|
1
|
-
import r from "
|
2
|
-
|
1
|
+
import { defineComponent as c, openBlock as o, createElementBlock as a, renderSlot as e, createElementVNode as r, createBlock as t, unref as p, createCommentVNode as i, createVNode as s } from "vue";
|
2
|
+
/* empty css */
|
3
|
+
/* empty css */
|
4
|
+
/* empty css */
|
5
|
+
import m from "./index123.js";
|
6
|
+
/* empty css */
|
7
|
+
import l from "./index125.js";
|
8
|
+
/* empty css */
|
9
|
+
import d from "./index296.js";
|
10
|
+
const u = { class: "bb-common-input-inner-container" }, f = { class: "bb-common-input-inner-container__prefix" }, _ = { class: "bb-common-input-inner-container__suffix" }, S = /* @__PURE__ */ c({
|
11
|
+
__name: "CommonInputInnerContainer",
|
12
|
+
props: {
|
13
|
+
"append:icon": {},
|
14
|
+
"prepend:icon": {}
|
15
|
+
},
|
16
|
+
setup($) {
|
17
|
+
return (n, b) => (o(), a("span", u, [
|
18
|
+
e(n.$slots, "prepend", {}, () => [
|
19
|
+
r("span", f, [
|
20
|
+
e(n.$slots, "prefix")
|
21
|
+
])
|
22
|
+
]),
|
23
|
+
n.$props["prepend:icon"] ? (o(), t(p(m), {
|
24
|
+
key: 0,
|
25
|
+
class: "bb-common-input-inner-container__prepend-icon",
|
26
|
+
type: n.$props["prepend:icon"]
|
27
|
+
}, null, 8, ["type"])) : i("", !0),
|
28
|
+
e(n.$slots, "default"),
|
29
|
+
n.$props["append:icon"] ? (o(), t(p(m), {
|
30
|
+
key: 1,
|
31
|
+
class: "bb-common-input-inner-container__append-icon",
|
32
|
+
type: n.$props["append:icon"]
|
33
|
+
}, null, 8, ["type"])) : i("", !0),
|
34
|
+
s(p(l)),
|
35
|
+
s(d),
|
36
|
+
e(n.$slots, "append", {}, () => [
|
37
|
+
r("span", _, [
|
38
|
+
e(n.$slots, "suffix")
|
39
|
+
])
|
40
|
+
])
|
41
|
+
]));
|
42
|
+
}
|
43
|
+
});
|
3
44
|
export {
|
4
|
-
|
45
|
+
S as default
|
5
46
|
};
|
6
47
|
//# sourceMappingURL=index201.js.map
|
package/dist/index201.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index201.js","sources":[
|
1
|
+
{"version":3,"file":"index201.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index203.js
CHANGED
@@ -1,47 +1,16 @@
|
|
1
|
-
import {
|
2
|
-
/* empty css */
|
3
|
-
/* empty css */
|
4
|
-
/* empty css */
|
5
|
-
import m from "./index123.js";
|
1
|
+
import { openBlock as t, createElementBlock as n, renderSlot as e } from "vue";
|
6
2
|
/* empty css */
|
7
|
-
import
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"append
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
return (n, b) => (o(), a("span", u, [
|
18
|
-
e(n.$slots, "prepend", {}, () => [
|
19
|
-
r("span", f, [
|
20
|
-
e(n.$slots, "prefix")
|
21
|
-
])
|
22
|
-
]),
|
23
|
-
n.$props["prepend:icon"] ? (o(), t(p(m), {
|
24
|
-
key: 0,
|
25
|
-
class: "bb-common-input-inner-container__prepend-icon",
|
26
|
-
type: n.$props["prepend:icon"]
|
27
|
-
}, null, 8, ["type"])) : i("", !0),
|
28
|
-
e(n.$slots, "default"),
|
29
|
-
n.$props["append:icon"] ? (o(), t(p(m), {
|
30
|
-
key: 1,
|
31
|
-
class: "bb-common-input-inner-container__append-icon",
|
32
|
-
type: n.$props["append:icon"]
|
33
|
-
}, null, 8, ["type"])) : i("", !0),
|
34
|
-
s(p(l)),
|
35
|
-
s(d),
|
36
|
-
e(n.$slots, "append", {}, () => [
|
37
|
-
r("span", _, [
|
38
|
-
e(n.$slots, "suffix")
|
39
|
-
])
|
40
|
-
])
|
41
|
-
]));
|
42
|
-
}
|
43
|
-
});
|
3
|
+
import r from "./index253.js";
|
4
|
+
const s = {}, c = { class: "bb-common-input-outer-container" };
|
5
|
+
function p(o, a) {
|
6
|
+
return t(), n("span", c, [
|
7
|
+
e(o.$slots, "prepend-outer"),
|
8
|
+
e(o.$slots, "default"),
|
9
|
+
e(o.$slots, "append-outer")
|
10
|
+
]);
|
11
|
+
}
|
12
|
+
const i = /* @__PURE__ */ r(s, [["render", p]]);
|
44
13
|
export {
|
45
|
-
|
14
|
+
i as default
|
46
15
|
};
|
47
16
|
//# sourceMappingURL=index203.js.map
|
package/dist/index203.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index203.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index203.js","sources":["../src/components/CommonInputOuterContainer.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-common-input-outer-container\">\n\t\t<slot name=\"prepend-outer\" />\n\t\t<slot />\n\t\t<slot name=\"append-outer\" />\n\t</span>\n</template>\n\n<script setup lang=\"ts\"></script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/CommonInputInnerContainer';\n</style>\n"],"names":["_sfc_render","_ctx","_cache","_openBlock","_createElementBlock","_hoisted_1","_renderSlot"],"mappings":";;;;AACC,SAAAA,EAAAC,GAAAC,GAAA;SAC8BC,EAAA,GAAAC,EAAA,QAAAC,GAAA;AAAA,IAC7BC,EAAQL,EAAA,QAAA,eAAA;AAAA,IACRK,EAA4BL,EAAA,QAAA,SAAA;AAAA;;;;"}
|
package/dist/index204.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index204.js","sources":["../src/utilities/functions/deburr.ts"],"sourcesContent":["import d from 'lodash.deburr';\n\nexport const deburr = d;\n"],"names":["deburr","d"],"mappings":";AAEO,MAAMA,IAASC;"}
|
package/dist/index205.js
CHANGED
@@ -1,16 +1,6 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
import r from "./index253.js";
|
4
|
-
const s = {}, c = { class: "bb-common-input-outer-container" };
|
5
|
-
function p(o, a) {
|
6
|
-
return t(), n("span", c, [
|
7
|
-
e(o.$slots, "prepend-outer"),
|
8
|
-
e(o.$slots, "default"),
|
9
|
-
e(o.$slots, "append-outer")
|
10
|
-
]);
|
11
|
-
}
|
12
|
-
const i = /* @__PURE__ */ r(s, [["render", p]]);
|
1
|
+
import t from "./index255.js";
|
2
|
+
const r = t;
|
13
3
|
export {
|
14
|
-
|
4
|
+
r as throttle
|
15
5
|
};
|
16
6
|
//# sourceMappingURL=index205.js.map
|
package/dist/index205.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index205.js","sources":["../src/
|
1
|
+
{"version":3,"file":"index205.js","sources":["../src/utilities/functions/throttle.ts"],"sourcesContent":["import t from 'lodash.throttle';\n\nexport const throttle = t;\n"],"names":["throttle"],"mappings":";AAEO,MAAMA,IAAW;"}
|
package/dist/index206.js
CHANGED
@@ -1,161 +1,38 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
const he = (l) => {
|
12
|
-
const i = a(""), F = a(), u = (e) => {
|
13
|
-
F.value = e, l.emit("update:modelValue", e);
|
14
|
-
}, d = a([]), {
|
15
|
-
array: k,
|
16
|
-
add: E,
|
17
|
-
remove: P,
|
18
|
-
set: y
|
19
|
-
} = Q(), {
|
20
|
-
array: S,
|
21
|
-
add: j,
|
22
|
-
remove: J
|
23
|
-
} = Q(), { getItemText: L } = te(), { getItemValue: U } = ee(), O = (e) => {
|
24
|
-
const t = !!(l.disabled.value || e.disabled), o = L(e, l.itemText), n = U(e, l.itemValue);
|
25
|
-
if (n === void 0)
|
26
|
-
throw new Error(
|
27
|
-
'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(e) + " please check itemValue property is correct."
|
28
|
-
);
|
29
|
-
const X = v(n);
|
30
|
-
return {
|
31
|
-
item: e,
|
32
|
-
text: o,
|
33
|
-
value: n,
|
34
|
-
valueHash: X,
|
35
|
-
disabled: t,
|
36
|
-
selected: !1
|
37
|
-
};
|
38
|
-
}, T = (e) => (e.selected = q(b.value[e.valueHash]), e), V = r(() => {
|
39
|
-
const e = [].concat(
|
40
|
-
d.value.map((t) => T(O(t))),
|
41
|
-
S.value.map(T),
|
42
|
-
k.value.map(T)
|
43
|
-
);
|
44
|
-
return $(e, (t) => t.valueHash);
|
45
|
-
}), z = (e) => {
|
46
|
-
l.multiple ? (u(l.modelValue.value.concat(e.value)), l.stash && E(e), l.resetQueryOnOptionSelected && s()) : (l.stash && y(e), u(e.value), N(() => s()));
|
47
|
-
}, G = async (e) => {
|
48
|
-
if (J((t) => t.valueHash !== e.valueHash), P((t) => t.valueHash !== e.valueHash), l.multiple) {
|
49
|
-
const t = { ...b.value };
|
50
|
-
delete t[e.valueHash], u(Object.values(t));
|
51
|
-
} else
|
52
|
-
u(null), await N(), s();
|
53
|
-
}, b = r(() => {
|
54
|
-
const e = {}, t = [].concat(l.modelValue.value);
|
55
|
-
for (let o = 0; o < t.length; o++) {
|
56
|
-
const n = t[o];
|
57
|
-
e[v(n)] = n;
|
58
|
-
}
|
59
|
-
return e;
|
60
|
-
}), g = async ({ prefill: e = !1 }) => {
|
61
|
-
let t = [];
|
62
|
-
if (Array.isArray(l.items.value))
|
63
|
-
t = l.items.value;
|
64
|
-
else if (typeof l.items.value == "function") {
|
65
|
-
const o = ++c.value;
|
66
|
-
try {
|
67
|
-
t = await l.items.value(
|
68
|
-
i.value,
|
69
|
-
e,
|
70
|
-
l.modelValue.value
|
71
|
-
), o < c.value && (await le(() => o === c.value), t = d.value);
|
72
|
-
} catch (n) {
|
73
|
-
console.error(n);
|
74
|
-
}
|
75
|
-
c.value--;
|
76
|
-
}
|
77
|
-
d.value = t;
|
78
|
-
}, B = r(() => {
|
79
|
-
const e = {};
|
80
|
-
for (let t = 0; t < V.value.length; t++) {
|
81
|
-
const o = V.value[t], { valueHash: n } = o;
|
82
|
-
e[n] = o;
|
83
|
-
}
|
84
|
-
return {
|
85
|
-
get: (t) => e[v(t)]
|
86
|
-
};
|
87
|
-
}), f = r(() => [].concat(l.modelValue.value).reduce((e, t) => {
|
88
|
-
const o = B.value.get(t);
|
89
|
-
return o && e.push(o), e;
|
90
|
-
}, [])), C = (e) => q(B.value.get(e)), s = () => {
|
91
|
-
if (l.multiple) {
|
92
|
-
i.value = "";
|
93
|
-
return;
|
94
|
-
}
|
95
|
-
let e;
|
96
|
-
f.value && (e = _(f.value)), i.value = (e == null ? void 0 : e.text) || "";
|
97
|
-
}, K = () => {
|
98
|
-
const e = i.value.trim(), t = O(e);
|
99
|
-
j(t), s();
|
100
|
-
}, c = a(0), M = r(() => [].concat(l.modelValue.value).reduce(
|
101
|
-
(e, t) => (C(t) ? e.coherent.push(t) : e.incoherent.push(t), e),
|
102
|
-
{ coherent: [], incoherent: [] }
|
103
|
-
)), A = r(() => l.multiple && !l.modelValue.value.length || !l.multiple && oe(l.modelValue.value) ? !0 : !M.value.incoherent.length), R = () => {
|
104
|
-
l.enforceCoherence && !A.value && (l.multiple ? u(M.value.coherent) : u(null));
|
105
|
-
}, p = a(!1), I = a(!1), m = async () => {
|
106
|
-
I.value = !0, await g({ prefill: !0 }), R(), s(), p.value = !0, I.value = !1;
|
1
|
+
import { unrefElement as m } from "./index129.js";
|
2
|
+
import { ref as u, watch as l } from "vue";
|
3
|
+
import { createFocusTrap as d } from "./index254.js";
|
4
|
+
import { tryOnScopeDispose as D } from "./index200.js";
|
5
|
+
function O(i, a = {}) {
|
6
|
+
let e;
|
7
|
+
const { immediate: f, ...n } = a, c = u(!1), s = u(!1), o = (t) => e && e.activate(t), r = (t) => e && e.deactivate(t), v = () => {
|
8
|
+
e && (e.pause(), s.value = !0);
|
9
|
+
}, p = () => {
|
10
|
+
e && (e.unpause(), s.value = !1);
|
107
11
|
};
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
12
|
+
return l(
|
13
|
+
() => m(i),
|
14
|
+
(t) => {
|
15
|
+
t && (e = d(t, {
|
16
|
+
...n,
|
17
|
+
onActivate() {
|
18
|
+
c.value = !0, a.onActivate && a.onActivate();
|
19
|
+
},
|
20
|
+
onDeactivate() {
|
21
|
+
c.value = !1, a.onDeactivate && a.onDeactivate();
|
22
|
+
}
|
23
|
+
}), f && o());
|
24
|
+
},
|
25
|
+
{ flush: "post" }
|
26
|
+
), D(() => r()), {
|
27
|
+
hasFocus: c,
|
28
|
+
isPaused: s,
|
29
|
+
activate: o,
|
30
|
+
deactivate: r,
|
31
|
+
pause: v,
|
32
|
+
unpause: p
|
120
33
|
};
|
121
|
-
|
122
|
-
let x;
|
123
|
-
H(
|
124
|
-
() => l.modelValue.value,
|
125
|
-
() => {
|
126
|
-
A.value || (x && clearTimeout(x), x = setTimeout(async () => {
|
127
|
-
m();
|
128
|
-
}, l.modelValueDebounceTime));
|
129
|
-
}
|
130
|
-
);
|
131
|
-
let w;
|
132
|
-
const D = async (e, t) => {
|
133
|
-
v(t) !== v(e) && p.value && (w && clearTimeout(w), w = setTimeout(async () => {
|
134
|
-
await m();
|
135
|
-
}, l.depsDebounceTime));
|
136
|
-
};
|
137
|
-
return H(() => l.items.value, D), H(() => l.dependencies.value, D), {
|
138
|
-
addCurrentQueryToManualItems: K,
|
139
|
-
alignQueryToState: s,
|
140
|
-
getOptions: g,
|
141
|
-
hasPrefilled: p,
|
142
|
-
innerLoading: c,
|
143
|
-
isPrefilling: I,
|
144
|
-
manualItems: S,
|
145
|
-
options: V,
|
146
|
-
prefillItems: m,
|
147
|
-
query: i,
|
148
|
-
searchByQuery: W,
|
149
|
-
selectedOptions: f,
|
150
|
-
selectOption: z,
|
151
|
-
setStash: y,
|
152
|
-
unselectOption: G,
|
153
|
-
updateModelValue: u,
|
154
|
-
valueIsSelected: C,
|
155
|
-
internalItems: d
|
156
|
-
};
|
157
|
-
};
|
34
|
+
}
|
158
35
|
export {
|
159
|
-
|
36
|
+
O as useFocusTrap
|
160
37
|
};
|
161
38
|
//# sourceMappingURL=index206.js.map
|
package/dist/index206.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index206.js","sources":["../src/composables/useOptions.ts"],"sourcesContent":["import {\n\tcomputed,\n\tnextTick,\n\tonBeforeMount,\n\tonBeforeUnmount,\n\tref,\n\twatch,\n\ttype Ref,\n} from 'vue';\nimport type { Option as BaseOption } from '@/types/Option';\nimport { last } from '@/utilities/functions/last';\nimport { useArray } from './useArray';\nimport { uniqBy } from '@/utilities/functions/uniqBy';\nimport { useItemValue } from './useItemValue';\nimport { useItemText } from './useItemText';\nimport { hash } from '@/utilities/functions/hash';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport { isNil } from '@/utilities/functions/isNil';\n\ntype Options = {\n\tmultiple: boolean;\n\tstash: boolean;\n\titemText: string | ((item: any) => string) | undefined;\n\titemValue: string | ((item: any) => string) | undefined;\n\tmodelValue: Ref<any>;\n\tresetQueryOnOptionSelected: boolean;\n\temit: any;\n\titems: Ref<any>;\n\tenforceCoherence: boolean;\n\tprefill: boolean;\n\tmodelValueDebounceTime: number;\n\tdepsDebounceTime: number;\n\tdependencies: Ref<any[]>;\n\tqueryDebounceTime: number;\n\tdisabled: Ref<boolean>;\n};\n\nexport const useOptions = (params: Options) => {\n\tconst query = ref<string>('');\n\n\tconst lastEmittedValue = ref();\n\tconst updateModelValue = (value: any) => {\n\t\tlastEmittedValue.value = value;\n\t\tparams.emit('update:modelValue', value);\n\t};\n\n\tconst internalItems = ref<any[]>([]);\n\tconst {\n\t\tarray: innerStash,\n\t\tadd: addToStash,\n\t\tremove: removeFromStash,\n\t\tset: setStash,\n\t} = useArray<BaseOption>();\n\n\tconst {\n\t\tarray: manualItems,\n\t\tadd: addToManualItems,\n\t\tremove: removeFromManualItems,\n\t} = useArray<BaseOption>();\n\n\tconst { getItemText } = useItemText();\n\tconst { getItemValue } = useItemValue();\n\tconst createOption = (item: any): BaseOption => {\n\t\tconst disabled = !!(params.disabled.value || item.disabled);\n\t\tconst text = getItemText(item, params.itemText);\n\t\tconst value = getItemValue(item, params.itemValue);\n\n\t\t// Undefined is not supported\n\t\tif (value === undefined)\n\t\t\tthrow new Error(\n\t\t\t\t'The result of extracting \"value\" from option was undefined. Affected item is ' +\n\t\t\t\t\tJSON.stringify(item) +\n\t\t\t\t\t' please check itemValue property is correct.'\n\t\t\t);\n\t\tconst valueHash = hash(value);\n\t\tconst selected = false;\n\t\treturn {\n\t\t\titem,\n\t\t\ttext,\n\t\t\tvalue,\n\t\t\tvalueHash,\n\t\t\tdisabled,\n\t\t\tselected,\n\t\t};\n\t};\n\n\tconst setSelected = (o: BaseOption) => {\n\t\to.selected = isNotNil(modelValueIndexedByHash.value[o.valueHash]);\n\t\treturn o;\n\t};\n\tconst options = computed<BaseOption[]>(() => {\n\t\tconst base = ([] as BaseOption[]).concat(\n\t\t\tinternalItems.value.map((item) => {\n\t\t\t\treturn setSelected(createOption(item));\n\t\t\t}),\n\t\t\tmanualItems.value.map(setSelected),\n\t\t\tinnerStash.value.map(setSelected)\n\t\t);\n\t\treturn uniqBy(base, (o) => o.valueHash);\n\t});\n\n\tconst selectOption = (option: BaseOption) => {\n\t\tif (params.multiple) {\n\t\t\tupdateModelValue(params.modelValue.value.concat(option.value));\n\t\t\tif (params.stash) {\n\t\t\t\taddToStash(option);\n\t\t\t}\n\n\t\t\tif (params.resetQueryOnOptionSelected) {\n\t\t\t\talignQueryToState();\n\t\t\t}\n\t\t} else {\n\t\t\tif (params.stash) {\n\t\t\t\tsetStash(option);\n\t\t\t}\n\t\t\tupdateModelValue(option.value);\n\t\t\tnextTick(() => alignQueryToState());\n\t\t}\n\t};\n\tconst unselectOption = async (option: BaseOption) => {\n\t\tremoveFromManualItems((o) => o.valueHash !== option.valueHash);\n\t\tremoveFromStash((o) => o.valueHash !== option.valueHash);\n\t\tif (params.multiple) {\n\t\t\tconst copy = { ...modelValueIndexedByHash.value };\n\t\t\tdelete copy[option.valueHash];\n\t\t\tupdateModelValue(Object.values(copy));\n\t\t} else {\n\t\t\tupdateModelValue(null);\n\t\t\tawait nextTick();\n\t\t\talignQueryToState();\n\t\t}\n\t};\n\n\t/**\n\t * Indexes modelValue to a map of hash - value pairs so we can easily track which values are selected\n\t */\n\tconst modelValueIndexedByHash = computed(() => {\n\t\tconst map: Record<string, any> = {};\n\t\tconst arr = [].concat(params.modelValue.value);\n\t\tfor (let index = 0; index < arr.length; index++) {\n\t\t\tconst element = arr[index];\n\t\t\tmap[hash(element)] = element;\n\t\t}\n\t\treturn map;\n\t});\n\n\tconst getOptions = async ({ prefill = false }) => {\n\t\tlet items: any[] = [];\n\t\tif (Array.isArray(params.items.value)) {\n\t\t\titems = params.items.value;\n\t\t} else {\n\t\t\tif (typeof params.items.value === 'function') {\n\t\t\t\tconst order = ++innerLoading.value;\n\t\t\t\ttry {\n\t\t\t\t\titems = await params.items.value(\n\t\t\t\t\t\tquery.value,\n\t\t\t\t\t\tprefill,\n\t\t\t\t\t\tparams.modelValue.value\n\t\t\t\t\t);\n\t\t\t\t\t// If by the time this resolves another call has already been made discard this result\n\t\t\t\t\tif (order < innerLoading.value) {\n\t\t\t\t\t\tawait waitFor(() => order === innerLoading.value);\n\t\t\t\t\t\titems = internalItems.value;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error(error);\n\t\t\t\t}\n\t\t\t\tinnerLoading.value--;\n\t\t\t}\n\t\t}\n\t\tinternalItems.value = items as any;\n\t};\n\n\t/**\n\t * Indexes options by their hash so they can be retrieved\n\t */\n\tconst optionsIndexedByHash = computed(() => {\n\t\tconst map: Record<string, BaseOption> = {};\n\t\tfor (let index = 0; index < options.value.length; index++) {\n\t\t\tconst element = options.value[index];\n\t\t\tconst { valueHash } = element;\n\t\t\tmap[valueHash] = element;\n\t\t}\n\t\treturn {\n\t\t\tget: (value: any) => {\n\t\t\t\treturn map[hash(value)];\n\t\t\t},\n\t\t};\n\t});\n\n\t/**\n\t * For every item in modelValue find the linked option if it exists.\n\t * This is used to display chips.\n\t */\n\tconst selectedOptions = computed(() => {\n\t\treturn [].concat(params.modelValue.value).reduce((acc, h) => {\n\t\t\tconst found = optionsIndexedByHash.value.get(h);\n\t\t\tif (found) {\n\t\t\t\tacc.push(found);\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, [] as BaseOption[]);\n\t});\n\n\tconst valueIsSelected = (value: any) =>\n\t\tisNotNil(optionsIndexedByHash.value.get(value));\n\n\tconst alignQueryToState = () => {\n\t\tif (params.multiple) {\n\t\t\tquery.value = '';\n\t\t\treturn;\n\t\t}\n\t\tlet option: BaseOption | undefined;\n\t\tif (selectedOptions.value) {\n\t\t\toption = last(selectedOptions.value);\n\t\t}\n\t\tquery.value = option?.text || '';\n\t};\n\n\t/**\n\t * Add an option to the manual items and then reset the query\n\t */\n\tconst addCurrentQueryToManualItems = () => {\n\t\tconst text = query.value.trim();\n\t\tconst option = createOption(text);\n\t\taddToManualItems(option);\n\t\talignQueryToState();\n\t};\n\n\t/**\n\t * Use a number accumulator because if the fn takes 5 seconds\n\t * and after 2 seconds another search is run\n\t * When the first returns the second is still out for 2 seconds\n\t * and we want to track them both.\n\t * Debounce will not be enough.\n\t */\n\tconst innerLoading = ref(0);\n\n\t/**\n\t * Coherent values are values that have an option they can be linked to.\n\t * Divide coherent and incoherent values.\n\t */\n\n\tconst coherenceStatus = computed(() => {\n\t\treturn [].concat(params.modelValue.value).reduce(\n\t\t\t(acc, curr) => {\n\t\t\t\tif (valueIsSelected(curr)) {\n\t\t\t\t\tacc.coherent.push(curr);\n\t\t\t\t} else {\n\t\t\t\t\tacc.incoherent.push(curr);\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{ coherent: [], incoherent: [] }\n\t\t);\n\t});\n\n\t/**\n\t * Model value is considered coherent when:\n\t * - multiple mode is empty\n\t * - single mode is null\n\t */\n\tconst modelValueIsCoherent = computed(() => {\n\t\tif (params.multiple && !params.modelValue.value.length) return true;\n\t\telse if (!params.multiple && isNil(params.modelValue.value)) return true;\n\t\treturn !coherenceStatus.value.incoherent.length;\n\t});\n\n\t/**\n\t * Realign selection state to the passed settings.\n\t * If modelValue has any value that is not coherent while\n\t * coherence is enforced the value should be removed\n\t */\n\tconst alignToCoherenceSettings = () => {\n\t\tif (params.enforceCoherence && !modelValueIsCoherent.value) {\n\t\t\tif (!params.multiple) updateModelValue(null);\n\t\t\telse updateModelValue(coherenceStatus.value.coherent);\n\t\t}\n\t};\n\n\t/**\n\t * Prefilling is the phase where the component understands it needs\n\t * to update its inner items due to a change in state, whether dependencies have changed, items or modelValue have changed.\n\t * It can be intended as the component aligning itself to what state is passed to it.\n\t */\n\tconst hasPrefilled = ref(false);\n\tconst isPrefilling = ref(false);\n\tconst prefillItems = async () => {\n\t\tisPrefilling.value = true;\n\t\tawait getOptions({ prefill: true });\n\t\talignToCoherenceSettings();\n\t\talignQueryToState();\n\t\thasPrefilled.value = true;\n\t\tisPrefilling.value = false;\n\t};\n\n\tonBeforeMount(async () => {\n\t\tif (params.prefill) {\n\t\t\tawait prefillItems();\n\t\t\tif (params.stash) {\n\t\t\t\tsetStash(...selectedOptions.value);\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * Triggered on input when items is a function.\n\t */\n\n\tlet timeout: ReturnType<typeof setTimeout>;\n\tconst searchByQuery = () => {\n\t\tif (timeout) clearTimeout(timeout);\n\t\ttimeout = setTimeout(async () => {\n\t\t\ttry {\n\t\t\t\tawait getOptions({ prefill: false });\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}, params.queryDebounceTime);\n\t};\n\tonBeforeUnmount(() => clearTimeout(timeout));\n\n\t/**\n\t * When modelValue changes split behavior for single and multiple selection:\n\t */\n\tlet modelValueTimeout: ReturnType<typeof setTimeout>;\n\twatch(\n\t\t() => params.modelValue.value,\n\t\t() => {\n\t\t\tif (modelValueIsCoherent.value) return;\n\t\t\tif (modelValueTimeout) clearTimeout(modelValueTimeout);\n\t\t\tmodelValueTimeout = setTimeout(async () => {\n\t\t\t\tprefillItems();\n\t\t\t}, params.modelValueDebounceTime);\n\t\t}\n\t);\n\n\t/**\n\t * START DEPENDENCY HANDLING\n\t * Explicit dependencies (props.dependencies) and implicit dependencies (props.items)\n\t * need to trigger a pipeline of realignment whenever they change\n\t */\n\tlet depsTimeout: ReturnType<typeof setTimeout>;\n\n\tconst handleDependencyChange = async (current: any, previous: any) => {\n\t\t// Circumvent arrays defined in the template by the parent triggering the watcher\n\t\tif (hash(previous) === hash(current)) return;\n\t\t// Do not track until prefill completes\n\t\tif (!hasPrefilled.value) return;\n\t\tif (depsTimeout) clearTimeout(depsTimeout);\n\t\tdepsTimeout = setTimeout(async () => {\n\t\t\tawait prefillItems();\n\t\t}, params.depsDebounceTime);\n\t};\n\n\t/**\n\t * This is triggered to refresh static items whenever the passed array changes.\n\t * If the parent defines an array in the template this is triggered\n\t * at every render so we take counter measures\n\t * Even if the entire array changes all the previously selected values are still in the stash.\n\t */\n\twatch(() => params.items.value, handleDependencyChange);\n\n\t/**\n\t * When dependencies change\n\t * If the input has not been prefilled yet just return\n\t * Check dependencies are the same by value and not reference\n\t * Otherwise we search again for options as they might be different base on dependencies.\n\t * If coherence is enforced we set the state accordingly\n\t */\n\twatch(() => params.dependencies.value, handleDependencyChange);\n\n\t/**\n\t * END DEPENDENCIES HANDLING\n\t */\n\n\treturn {\n\t\taddCurrentQueryToManualItems,\n\t\talignQueryToState,\n\t\tgetOptions,\n\t\thasPrefilled,\n\t\tinnerLoading,\n\t\tisPrefilling,\n\t\tmanualItems,\n\t\toptions,\n\t\tprefillItems,\n\t\tquery,\n\t\tsearchByQuery,\n\t\tselectedOptions,\n\t\tselectOption,\n\t\tsetStash,\n\t\tunselectOption,\n\t\tupdateModelValue,\n\t\tvalueIsSelected,\n\t\tinternalItems,\n\t};\n};\n"],"names":["useOptions","params","query","ref","lastEmittedValue","updateModelValue","value","internalItems","innerStash","addToStash","removeFromStash","setStash","useArray","manualItems","addToManualItems","removeFromManualItems","getItemText","useItemText","getItemValue","useItemValue","createOption","item","disabled","text","valueHash","hash","setSelected","o","isNotNil","modelValueIndexedByHash","options","computed","base","uniqBy","selectOption","option","alignQueryToState","nextTick","unselectOption","copy","map","arr","index","element","getOptions","prefill","items","order","innerLoading","waitFor","error","optionsIndexedByHash","selectedOptions","acc","h","found","valueIsSelected","last","addCurrentQueryToManualItems","coherenceStatus","curr","modelValueIsCoherent","isNil","alignToCoherenceSettings","hasPrefilled","isPrefilling","prefillItems","onBeforeMount","timeout","searchByQuery","onBeforeUnmount","modelValueTimeout","watch","depsTimeout","handleDependencyChange","current","previous"],"mappings":";;;;;;;;;;AAsCa,MAAAA,KAAa,CAACC,MAAoB;AACxC,QAAAC,IAAQC,EAAY,EAAE,GAEtBC,IAAmBD,KACnBE,IAAmB,CAACC,MAAe;AACxC,IAAAF,EAAiB,QAAQE,GAClBL,EAAA,KAAK,qBAAqBK,CAAK;AAAA,EAAA,GAGjCC,IAAgBJ,EAAW,CAAA,CAAE,GAC7B;AAAA,IACL,OAAOK;AAAA,IACP,KAAKC;AAAA,IACL,QAAQC;AAAA,IACR,KAAKC;AAAA,MACFC,EAAqB,GAEnB;AAAA,IACL,OAAOC;AAAA,IACP,KAAKC;AAAA,IACL,QAAQC;AAAA,MACLH,EAAqB,GAEnB,EAAE,aAAAI,MAAgBC,MAClB,EAAE,cAAAC,MAAiBC,MACnBC,IAAe,CAACC,MAA0B;AAC/C,UAAMC,IAAW,CAAC,EAAErB,EAAO,SAAS,SAASoB,EAAK,WAC5CE,IAAOP,EAAYK,GAAMpB,EAAO,QAAQ,GACxCK,IAAQY,EAAaG,GAAMpB,EAAO,SAAS;AAGjD,QAAIK,MAAU;AACb,YAAM,IAAI;AAAA,QACT,kFACC,KAAK,UAAUe,CAAI,IACnB;AAAA,MAAA;AAEG,UAAAG,IAAYC,EAAKnB,CAAK;AAErB,WAAA;AAAA,MACN,MAAAe;A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A,cAAAiB;AAAA,IACA,aAAApD;AAAA,IACA,SAAAiB;AAAA,IACA,cAAAoC;AAAA,IACA,OAAAhE;AAAA,IACA,eAAAmE;AAAA,IACA,iBAAAjB;AAAA,IACA,cAAAlB;AAAA,IACA,UAAAvB;AAAA,IACA,gBAAA2B;AAAA,IACA,kBAAAjC;AAAA,IACA,iBAAAmD;AAAA,IACA,eAAAjD;AAAA,EAAA;AAEF;"}
|
1
|
+
{"version":3,"file":"index206.js","sources":["../node_modules/@vueuse/integrations/useFocusTrap.mjs"],"sourcesContent":["import { unrefElement, tryOnScopeDispose } from '@vueuse/core';\nimport { ref, watch } from 'vue-demi';\nimport { createFocusTrap } from 'focus-trap';\n\nfunction useFocusTrap(target, options = {}) {\n let trap;\n const { immediate, ...focusTrapOptions } = options;\n const hasFocus = ref(false);\n const isPaused = ref(false);\n const activate = (opts) => trap && trap.activate(opts);\n const deactivate = (opts) => trap && trap.deactivate(opts);\n const pause = () => {\n if (trap) {\n trap.pause();\n isPaused.value = true;\n }\n };\n const unpause = () => {\n if (trap) {\n trap.unpause();\n isPaused.value = false;\n }\n };\n watch(\n () => unrefElement(target),\n (el) => {\n if (!el)\n return;\n trap = createFocusTrap(el, {\n ...focusTrapOptions,\n onActivate() {\n hasFocus.value = true;\n if (options.onActivate)\n options.onActivate();\n },\n onDeactivate() {\n hasFocus.value = false;\n if (options.onDeactivate)\n options.onDeactivate();\n }\n });\n if (immediate)\n activate();\n },\n { flush: \"post\" }\n );\n tryOnScopeDispose(() => deactivate());\n return {\n hasFocus,\n isPaused,\n activate,\n deactivate,\n pause,\n unpause\n };\n}\n\nexport { useFocusTrap };\n"],"names":["useFocusTrap","target","options","trap","immediate","focusTrapOptions","hasFocus","ref","isPaused","activate","opts","deactivate","pause","unpause","watch","unrefElement","el","createFocusTrap","tryOnScopeDispose"],"mappings":";;;;AAIA,SAASA,EAAaC,GAAQC,IAAU,IAAI;AAC1C,MAAIC;AACJ,QAAM,EAAE,WAAAC,GAAW,GAAGC,EAAgB,IAAKH,GACrCI,IAAWC,EAAI,EAAK,GACpBC,IAAWD,EAAI,EAAK,GACpBE,IAAW,CAACC,MAASP,KAAQA,EAAK,SAASO,CAAI,GAC/CC,IAAa,CAACD,MAASP,KAAQA,EAAK,WAAWO,CAAI,GACnDE,IAAQ,MAAM;AAClB,IAAIT,MACFA,EAAK,MAAK,GACVK,EAAS,QAAQ;AAAA,EAEvB,GACQK,IAAU,MAAM;AACpB,IAAIV,MACFA,EAAK,QAAO,GACZK,EAAS,QAAQ;AAAA,EAEvB;AACE,SAAAM;AAAA,IACE,MAAMC,EAAad,CAAM;AAAA,IACzB,CAACe,MAAO;AACN,MAAKA,MAELb,IAAOc,EAAgBD,GAAI;AAAA,QACzB,GAAGX;AAAA,QACH,aAAa;AACX,UAAAC,EAAS,QAAQ,IACbJ,EAAQ,cACVA,EAAQ,WAAU;AAAA,QACrB;AAAA,QACD,eAAe;AACb,UAAAI,EAAS,QAAQ,IACbJ,EAAQ,gBACVA,EAAQ,aAAY;AAAA,QACvB;AAAA,MACT,CAAO,GACGE,KACFK;IACH;AAAA,IACD,EAAE,OAAO,OAAQ;AAAA,EACrB,GACES,EAAkB,MAAMP,EAAU,CAAE,GAC7B;AAAA,IACL,UAAAL;AAAA,IACA,UAAAE;AAAA,IACA,UAAAC;AAAA,IACA,YAAAE;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,EACJ;AACA;","x_google_ignoreList":[0]}
|
package/dist/index207.js
CHANGED
@@ -1,87 +1,9 @@
|
|
1
|
-
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
}, g = {
|
6
|
-
key: 1,
|
7
|
-
class: "bb-cr-container__no-data-container"
|
8
|
-
}, _ = /* @__PURE__ */ b({
|
9
|
-
__name: "OptionsContainer",
|
10
|
-
props: {
|
11
|
-
direction: {},
|
12
|
-
hasErrors: { type: Boolean },
|
13
|
-
hideLabel: { type: Boolean },
|
14
|
-
loadingText: {},
|
15
|
-
loading: { type: Boolean },
|
16
|
-
noDataText: {},
|
17
|
-
options: {}
|
18
|
-
},
|
19
|
-
setup(k) {
|
20
|
-
return (a, $) => (n(), s("span", {
|
21
|
-
ref: "container",
|
22
|
-
class: r(["bb-cr-container", {
|
23
|
-
"bb-cr-container--errors": a.hasErrors,
|
24
|
-
"bb-cr-container--horizontal": a.direction === "horizontal",
|
25
|
-
"bb-cr-container--vertical": a.direction === "vertical"
|
26
|
-
}])
|
27
|
-
}, [
|
28
|
-
l("span", p, [
|
29
|
-
t(a.$slots, "prepend"),
|
30
|
-
!a.options.length && a.loading ? (n(), s("span", u, [
|
31
|
-
t(a.$slots, "loading", {}, () => [
|
32
|
-
o(d(a.loadingText), 1)
|
33
|
-
])
|
34
|
-
])) : a.options.length ? h("", !0) : (n(), s("span", g, [
|
35
|
-
t(a.$slots, "no-data", {}, () => [
|
36
|
-
o(d(a.noDataText), 1)
|
37
|
-
])
|
38
|
-
])),
|
39
|
-
(n(!0), s(c, null, m(a.options, (e, i) => (n(), s(c, {
|
40
|
-
key: (e == null ? void 0 : e.id) || i
|
41
|
-
}, [
|
42
|
-
t(a.$slots, "option:prepend", {
|
43
|
-
id: e.valueHash,
|
44
|
-
checked: !!e.selected,
|
45
|
-
disabled: !!e.disabled,
|
46
|
-
item: e.item,
|
47
|
-
text: e.text
|
48
|
-
}),
|
49
|
-
l("label", {
|
50
|
-
class: r(["bb-cr-container-option", { "bb-base-radio-selected": e.selected }])
|
51
|
-
}, [
|
52
|
-
t(a.$slots, "input", {
|
53
|
-
index: i,
|
54
|
-
option: e
|
55
|
-
}),
|
56
|
-
l("span", {
|
57
|
-
class: r({
|
58
|
-
"bb-cr-container-option__text": !0,
|
59
|
-
"bb-cr-container-option__text--hidden": a.hideLabel
|
60
|
-
})
|
61
|
-
}, [
|
62
|
-
t(a.$slots, "label", {
|
63
|
-
checked: !!e.selected,
|
64
|
-
item: e.item,
|
65
|
-
text: e.text
|
66
|
-
}, () => [
|
67
|
-
o(d(e.text), 1)
|
68
|
-
])
|
69
|
-
], 2)
|
70
|
-
], 2),
|
71
|
-
t(a.$slots, "option:append", {
|
72
|
-
id: e.valueHash,
|
73
|
-
checked: !!e.selected,
|
74
|
-
disabled: !!e.disabled,
|
75
|
-
item: e.item,
|
76
|
-
text: e.text
|
77
|
-
})
|
78
|
-
], 64))), 128)),
|
79
|
-
t(a.$slots, "append")
|
80
|
-
])
|
81
|
-
], 2));
|
82
|
-
}
|
1
|
+
const o = (e, t = 50) => new Promise((r) => {
|
2
|
+
const n = setInterval(() => {
|
3
|
+
e() && (clearInterval(n), r());
|
4
|
+
}, t);
|
83
5
|
});
|
84
6
|
export {
|
85
|
-
|
7
|
+
o as waitFor
|
86
8
|
};
|
87
9
|
//# sourceMappingURL=index207.js.map
|
package/dist/index207.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index207.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index207.js","sources":["../src/utilities/functions/waitFor.ts"],"sourcesContent":["/** Wait until iteratee returns true to resolve the promise */\nexport const waitFor: (\n\titeratee: () => boolean,\n\tinterval?: number\n) => Promise<void> = (iteratee, interval = 50) =>\n\tnew Promise((resolve) => {\n\t\tconst i = setInterval(() => {\n\t\t\tif (iteratee()) {\n\t\t\t\tclearInterval(i);\n\t\t\t\tresolve();\n\t\t\t}\n\t\t}, interval);\n\t});\n"],"names":["waitFor","iteratee","interval","resolve","i"],"mappings":"AACa,MAAAA,IAGQ,CAACC,GAAUC,IAAW,OAC1C,IAAI,QAAQ,CAACC,MAAY;AAClB,QAAAC,IAAI,YAAY,MAAM;AAC3B,IAAIH,QACH,cAAcG,CAAC,GACPD;KAEPD,CAAQ;AACZ,CAAC;"}
|
package/dist/index208.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index208.js","sources":["../src/composables/useModalsState.ts"],"sourcesContent":["import { ref } from 'vue';\n\nconst openedModals = ref(0);\n\nconst modalHasOpened = () => {\n\topenedModals.value++;\n};\n\nconst modalHasClosed = () => {\n\topenedModals.value--;\n};\nexport const useModalsState = () => {\n\treturn { openedModals, modalHasOpened, modalHasClosed };\n};\n"],"names":["openedModals","ref","modalHasOpened","modalHasClosed","useModalsState"],"mappings":";AAEA,MAAMA,IAAeC,EAAI,CAAC,GAEpBC,IAAiB,MAAM;AACf,EAAAF,EAAA;AACd,GAEMG,IAAiB,MAAM;AACf,EAAAH,EAAA;AACd,GACaI,IAAiB,OACtB,EAAE,cAAAJ,GAAc,gBAAAE,GAAgB,gBAAAC;"}
|
package/dist/index209.js
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
const o = "bitboss-ui | ", e = () => ({
|
2
|
+
warn: (r) => console.warn(`${o}${r}`),
|
3
|
+
error: (r) => console.error(`${o}${r}`),
|
4
|
+
throw: (r) => {
|
5
|
+
throw new Error(`${o}${r}`);
|
6
|
+
}
|
7
|
+
});
|
3
8
|
export {
|
4
|
-
|
9
|
+
e as useLogger
|
5
10
|
};
|
6
11
|
//# sourceMappingURL=index209.js.map
|
package/dist/index209.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index209.js","sources":["../src/
|
1
|
+
{"version":3,"file":"index209.js","sources":["../src/composables/useLogger.ts"],"sourcesContent":["const prefix = `bitboss-ui | `;\n\nexport const useLogger = () => {\n\treturn {\n\t\twarn: (message: string) => console.warn(`${prefix}${message}`),\n\t\terror: (message: string) => console.error(`${prefix}${message}`),\n\t\tthrow: (message: string) => {\n\t\t\tthrow new Error(`${prefix}${message}`);\n\t\t},\n\t};\n};\n"],"names":["prefix","useLogger","message"],"mappings":"AAAA,MAAMA,IAAS,iBAEFC,IAAY,OACjB;AAAA,EACN,MAAM,CAACC,MAAoB,QAAQ,KAAK,GAAGF,CAAM,GAAGE,CAAO,EAAE;AAAA,EAC7D,OAAO,CAACA,MAAoB,QAAQ,MAAM,GAAGF,CAAM,GAAGE,CAAO,EAAE;AAAA,EAC/D,OAAO,CAACA,MAAoB;AAC3B,UAAM,IAAI,MAAM,GAAGF,CAAM,GAAGE,CAAO,EAAE;AAAA,EACtC;AAAA;"}
|