bitboss-ui 2.0.2 → 2.0.3
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/index105.js +4 -4
- package/dist/index113.js +1 -1
- package/dist/index115.js +4 -4
- package/dist/index117.js +1 -1
- package/dist/index12.js +1 -1
- package/dist/index121.js +1 -1
- package/dist/index122.js +1 -1
- package/dist/index123.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index128.js +1 -1
- package/dist/index14.js +3 -3
- package/dist/index18.js +8 -8
- package/dist/index198.js +5 -2
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +7 -7
- package/dist/index20.js +12 -12
- package/dist/index202.js +3 -3
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +3 -35
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +35 -6
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +6 -7
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +7 -5
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +2 -5
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +124 -14
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +5 -16
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +121 -17
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +18 -18
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +2 -27
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +2 -8
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +174 -2
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +42 -2
- package/dist/index215.js.map +1 -1
- package/dist/index217.js +13 -2
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +369 -3
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +2 -126
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +5 -5
- package/dist/index220.js +4 -123
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +2 -2
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +14 -172
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +16 -42
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +22 -0
- package/dist/index224.js.map +1 -0
- package/dist/index225.js +27 -13
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +8 -369
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +2 -3
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +3 -18
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +2 -105
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +21 -0
- package/dist/index230.js.map +1 -0
- package/dist/index231.js +53 -47
- package/dist/index231.js.map +1 -1
- package/dist/index233.js +100 -2
- package/dist/index233.js.map +1 -1
- package/dist/index237.js +9 -3
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +23 -12
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +6 -9
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index240.js +15 -8
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +9 -17
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +3 -431
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +11 -88
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +8 -199
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +8 -8
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +17 -23
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +224 -6
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +430 -15
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +88 -8
- package/dist/index249.js.map +1 -1
- package/dist/index253.js +2 -2
- package/dist/index255.js +126 -2
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +3 -2
- package/dist/index256.js.map +1 -1
- package/dist/index258.js +6 -3
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +4 -224
- package/dist/index259.js.map +1 -1
- package/dist/index26.js +3 -3
- package/dist/index260.js +2 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +72 -0
- package/dist/index261.js.map +1 -0
- package/dist/index262.js +199 -6
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +5 -2
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +434 -67
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +127 -5
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +2 -2
- package/dist/index267.js +2 -126
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +2 -3
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +2 -3
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +26 -209
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +6 -0
- package/dist/index271.js.map +1 -0
- package/dist/index272.js +3 -436
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +210 -126
- package/dist/index273.js.map +1 -1
- package/dist/index275.js +4 -15
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +4 -11
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +59 -4
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +15 -4
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +34 -58
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +2 -2
- package/dist/index280.js +10 -34
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +1 -1
- package/dist/index32.js +3 -3
- package/dist/index34.js +12 -12
- package/dist/index36.js +4 -4
- package/dist/index38.js +2 -2
- package/dist/index42.js +5 -5
- package/dist/index44.js +2 -2
- package/dist/index46.js +2 -2
- package/dist/index52.js +1 -1
- package/dist/index54.js +1 -1
- package/dist/index70.js +4 -4
- package/dist/index74.js +2 -2
- package/dist/index76.js +1 -1
- package/dist/index79.js +2 -2
- package/dist/index81.js +1 -1
- package/dist/index83.js +3 -3
- package/dist/index85.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/index216.js +0 -7
- package/dist/index216.js.map +0 -1
- package/dist/index234.js +0 -6
- package/dist/index234.js.map +0 -1
- package/dist/index257.js +0 -5
- package/dist/index257.js.map +0 -1
- package/dist/index274.js +0 -31
- package/dist/index274.js.map +0 -1
package/dist/index230.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isNil as c } from "./index124.js";
|
|
2
|
+
const a = (t, r) => {
|
|
3
|
+
if (!Object.prototype.hasOwnProperty.call(t, r))
|
|
4
|
+
throw new Error(
|
|
5
|
+
`Object ${JSON.stringify(t, null, 2)} has no property named "${r.toString()}"`
|
|
6
|
+
);
|
|
7
|
+
}, l = (t) => typeof t == "string" ? t.toLocaleLowerCase() : JSON.stringify(t).toLowerCase(), y = (t, r, s) => {
|
|
8
|
+
const i = s.toLocaleLowerCase();
|
|
9
|
+
for (let e = 0; e < r.length; e++) {
|
|
10
|
+
const n = r[e];
|
|
11
|
+
a(t, n);
|
|
12
|
+
const o = t[n];
|
|
13
|
+
if (c(o)) continue;
|
|
14
|
+
if (l(o).includes(i)) return !0;
|
|
15
|
+
}
|
|
16
|
+
return !1;
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
y as matchAnyKey
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index230.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index230.js","sources":["../src/utilities/functions/matchAnyKey.ts"],"sourcesContent":["import { isNil } from './isNil';\n\nconst ensureKeyExists = <T extends object>(item: T, key: keyof T) => {\n\tif (!Object.prototype.hasOwnProperty.call(item, key)) {\n\t\tthrow new Error(\n\t\t\t`Object ${JSON.stringify(item, null, 2)} has no property named \"${key.toString()}\"`\n\t\t);\n\t}\n};\nconst asString = (value: any) => {\n\tif (typeof value === 'string') return value.toLocaleLowerCase();\n\treturn JSON.stringify(value).toLowerCase();\n};\n\n/**\n * Return true or false based on whether the query is included in the passed keys\n * @param item The object to test\n * @param keys The keys to be tested as haystack\n * @param query The query to searched as needle\n * @returns boolean\n */\nexport const matchAnyKey = <T extends object>(\n\titem: T,\n\tkeys: (keyof T)[],\n\tquery: string\n) => {\n\tconst lcQuery = query.toLocaleLowerCase();\n\tfor (let index = 0; index < keys.length; index++) {\n\t\tconst key = keys[index];\n\t\tensureKeyExists(item, key);\n\t\tconst value = item[key];\n\t\tif (isNil(value)) continue;\n\t\tconst valueAsString = asString(value);\n\t\tif (valueAsString.includes(lcQuery)) return true;\n\t}\n\treturn false;\n};\n"],"names":["ensureKeyExists","item","key","asString","value","matchAnyKey","keys","query","lcQuery","index","isNil"],"mappings":";AAEA,MAAMA,IAAkB,CAAmBC,GAASC,MAAiB;AACpE,MAAI,CAAC,OAAO,UAAU,eAAe,KAAKD,GAAMC,CAAG;AAClD,UAAM,IAAI;AAAA,MACT,UAAU,KAAK,UAAUD,GAAM,MAAM,CAAC,CAAC,2BAA2BC,EAAI,SAAA,CAAU;AAAA,IAAA;AAGnF,GACMC,IAAW,CAACC,MACb,OAAOA,KAAU,WAAiBA,EAAM,kBAAkB,IACvD,KAAK,UAAUA,CAAK,EAAE,YAAY,GAU7BC,IAAc,CAC1BJ,GACAK,GACAC,MACI;AACE,QAAAC,IAAUD,EAAM;AACtB,WAASE,IAAQ,GAAGA,IAAQH,EAAK,QAAQG,KAAS;AAC3C,UAAAP,IAAMI,EAAKG,CAAK;AACtB,IAAAT,EAAgBC,GAAMC,CAAG;AACnB,UAAAE,IAAQH,EAAKC,CAAG;AAClB,QAAAQ,EAAMN,CAAK,EAAG;AAElB,QADsBD,EAASC,CAAK,EAClB,SAASI,CAAO,EAAU,QAAA;AAAA,EAC7C;AACO,SAAA;AACR;"}
|
package/dist/index231.js
CHANGED
|
@@ -1,103 +1,109 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { hash as
|
|
3
|
-
import { isNil as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent as y, ref as F, computed as H, watch as N, openBlock as p, createElementBlock as L, Fragment as S, renderList as V, createBlock as A, normalizeClass as O, withModifiers as P, withCtx as $, createTextVNode as z, toDisplayString as D } from "vue";
|
|
2
|
+
import { hash as d } from "./index228.js";
|
|
3
|
+
import { isNil as l } from "./index124.js";
|
|
4
|
+
import E from "./index119.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const K = /* @__PURE__ */ y({
|
|
7
|
+
__name: "ChipsBox",
|
|
6
8
|
props: {
|
|
7
9
|
options: {}
|
|
8
10
|
},
|
|
9
11
|
emits: ["option:unselected"],
|
|
10
|
-
setup(
|
|
11
|
-
const t =
|
|
12
|
-
const s =
|
|
12
|
+
setup(f, { expose: v, emit: h }) {
|
|
13
|
+
const t = f, u = h, n = F(null), i = H(() => t.options.some((e) => !e.disabled)), a = (e = 1) => {
|
|
14
|
+
const s = l(n.value) ? -1 : n.value;
|
|
13
15
|
let o = (s + e) % t.options.length;
|
|
14
16
|
for (; t.options[o].disabled && o !== s; )
|
|
15
|
-
o =
|
|
17
|
+
o = a(e + 1);
|
|
16
18
|
return o;
|
|
17
|
-
},
|
|
18
|
-
if (!
|
|
19
|
-
const e =
|
|
19
|
+
}, x = () => {
|
|
20
|
+
if (!i.value) return;
|
|
21
|
+
const e = a();
|
|
20
22
|
n.value = e;
|
|
21
23
|
}, c = (e = 1) => {
|
|
22
|
-
const s =
|
|
24
|
+
const s = l(n.value) ? 0 : n.value;
|
|
23
25
|
let o = (s - e + t.options.length) % t.options.length;
|
|
24
26
|
for (; t.options[o].disabled && o !== s; )
|
|
25
27
|
o = c(e + 1);
|
|
26
28
|
return o;
|
|
27
|
-
},
|
|
28
|
-
if (!
|
|
29
|
+
}, m = async () => {
|
|
30
|
+
if (!i.value) return;
|
|
29
31
|
const e = c();
|
|
30
32
|
n.value = e;
|
|
31
|
-
},
|
|
32
|
-
if (!
|
|
33
|
+
}, w = () => {
|
|
34
|
+
if (!i.value) return;
|
|
33
35
|
let e = 0;
|
|
34
36
|
for (; t.options[e].disabled; )
|
|
35
37
|
e++;
|
|
36
38
|
n.value = e;
|
|
37
|
-
},
|
|
38
|
-
if (!
|
|
39
|
+
}, b = () => {
|
|
40
|
+
if (!i.value) return;
|
|
39
41
|
let e = t.options.length - 1;
|
|
40
42
|
for (; t.options[e].disabled && e !== 0; )
|
|
41
43
|
e--;
|
|
42
44
|
n.value = e;
|
|
43
|
-
},
|
|
44
|
-
if (!
|
|
45
|
+
}, I = () => {
|
|
46
|
+
if (!i.value) return;
|
|
45
47
|
let e = 0;
|
|
46
48
|
for (; !t.options[e].selected && t.options.length !== e; )
|
|
47
49
|
e++;
|
|
48
50
|
n.value = e;
|
|
49
|
-
},
|
|
50
|
-
if (!
|
|
51
|
+
}, g = () => {
|
|
52
|
+
if (!i.value) return;
|
|
51
53
|
let e = t.options.length - 1;
|
|
52
54
|
for (; t.options[e].selected && e !== 0; )
|
|
53
55
|
e--;
|
|
54
56
|
n.value = e;
|
|
55
|
-
},
|
|
56
|
-
if (!
|
|
57
|
+
}, _ = (e) => {
|
|
58
|
+
if (!i.value) return;
|
|
57
59
|
const s = t.options.findIndex(
|
|
58
60
|
(o) => o.valueHash === e
|
|
59
61
|
);
|
|
60
62
|
s >= 0 && (n.value = s);
|
|
61
63
|
}, r = () => {
|
|
62
64
|
n.value = null;
|
|
63
|
-
},
|
|
64
|
-
if (
|
|
65
|
+
}, k = () => {
|
|
66
|
+
if (l(n.value)) return;
|
|
65
67
|
const e = t.options[n.value];
|
|
66
|
-
e.selected &&
|
|
67
|
-
},
|
|
68
|
+
e.selected && u("option:unselected", e);
|
|
69
|
+
}, C = () => l(n.value) ? void 0 : t.options[n.value];
|
|
68
70
|
return N(
|
|
69
71
|
() => t.options,
|
|
70
72
|
(e, s) => {
|
|
71
|
-
|
|
73
|
+
d(e) !== d(s) && r();
|
|
72
74
|
},
|
|
73
75
|
{
|
|
74
76
|
flush: "post"
|
|
75
77
|
}
|
|
76
|
-
),
|
|
77
|
-
focusNext:
|
|
78
|
-
focusPrevious:
|
|
79
|
-
focusFirst:
|
|
80
|
-
focusFirstSelected:
|
|
81
|
-
focusLast:
|
|
82
|
-
focusLastSelected:
|
|
78
|
+
), v({
|
|
79
|
+
focusNext: x,
|
|
80
|
+
focusPrevious: m,
|
|
81
|
+
focusFirst: w,
|
|
82
|
+
focusFirstSelected: I,
|
|
83
|
+
focusLast: b,
|
|
84
|
+
focusLastSelected: g,
|
|
83
85
|
blur: r,
|
|
84
|
-
confirmOption:
|
|
85
|
-
focusByHash:
|
|
86
|
-
getHighlighted:
|
|
87
|
-
}), (e, s) => (
|
|
86
|
+
confirmOption: k,
|
|
87
|
+
focusByHash: _,
|
|
88
|
+
getHighlighted: C
|
|
89
|
+
}), (e, s) => (p(!0), L(S, null, V(e.options, (o, B) => (p(), A(E, {
|
|
88
90
|
key: o.valueHash,
|
|
89
91
|
class: O({
|
|
90
|
-
"bb-
|
|
91
|
-
"bb-
|
|
92
|
-
"bb-commabox-item--has-comma": p !== e.options.length - 1
|
|
92
|
+
"bb-chipsbox-item": !0,
|
|
93
|
+
"bb-chipsbox-item--focused": B === n.value
|
|
93
94
|
}),
|
|
94
95
|
clearable: !0,
|
|
95
96
|
text: o.text,
|
|
96
|
-
"onClick:clear": P((
|
|
97
|
-
},
|
|
97
|
+
"onClick:clear": P((M) => u("option:unselected", o), ["stop"])
|
|
98
|
+
}, {
|
|
99
|
+
default: $(() => [
|
|
100
|
+
z(D(o.text), 1)
|
|
101
|
+
]),
|
|
102
|
+
_: 2
|
|
103
|
+
}, 1032, ["class", "text", "onClick:clear"]))), 128));
|
|
98
104
|
}
|
|
99
105
|
});
|
|
100
106
|
export {
|
|
101
|
-
|
|
107
|
+
K as default
|
|
102
108
|
};
|
|
103
109
|
//# sourceMappingURL=index231.js.map
|
package/dist/index231.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index231.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index231.js","sources":["../src/components/ChipsBox.vue"],"sourcesContent":["<template>\n\t<BbChip\n\t\tv-for=\"(item, index) in options\"\n\t\t:key=\"item.valueHash\"\n\t\t:class=\"{\n\t\t\t'bb-chipsbox-item': true,\n\t\t\t'bb-chipsbox-item--focused': index === focusedIndex,\n\t\t}\"\n\t\t:clearable=\"true\"\n\t\t:text=\"item.text\"\n\t\t@click:clear.stop=\"emit('option:unselected', item)\"\n\t\t>{{ item.text }}</BbChip\n\t>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { hash } from '@/utilities/functions/hash';\nimport { isNil } from '@/utilities/functions/isNil';\nimport { ref } from 'vue';\nimport { watch } from 'vue';\nimport BbChip from './BbChip/BbChip.vue';\nimport type { Option } from '@/types/Option';\n\ntype Props = {\n\toptions: Option[];\n};\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n\t(e: 'option:unselected', option: Option): void;\n}>();\n\n/**\n * START FOCUS HANDLING\n */\n\nconst focusedIndex = ref<null | number>(null);\n\nconst canFocus = computed(() => props.options.some((o) => !o.disabled));\n\nconst findNextAvailableIndex = (offset = 1) => {\n\tconst initialValue = isNil(focusedIndex.value) ? -1 : focusedIndex.value!;\n\tlet newIndex = (initialValue + offset) % props.options.length;\n\twhile (props.options[newIndex].disabled && newIndex !== initialValue) {\n\t\tnewIndex = findNextAvailableIndex(offset + 1);\n\t}\n\treturn newIndex;\n};\n\nconst focusNext = () => {\n\tif (!canFocus.value) return;\n\tconst newIndex = findNextAvailableIndex();\n\tfocusedIndex.value = newIndex;\n};\nconst findPreviousAvailableIndex = (offset = 1) => {\n\tconst initialValue = isNil(focusedIndex.value) ? 0 : focusedIndex.value!;\n\tlet newIndex =\n\t\t(initialValue - offset + props.options.length) % props.options.length;\n\twhile (props.options[newIndex].disabled && newIndex !== initialValue) {\n\t\tnewIndex = findPreviousAvailableIndex(offset + 1);\n\t}\n\treturn newIndex;\n};\nconst focusPrevious = async () => {\n\tif (!canFocus.value) return;\n\tconst newIndex = findPreviousAvailableIndex();\n\tfocusedIndex.value = newIndex;\n};\n\nconst focusFirst = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = 0;\n\twhile (props.options[newIndex].disabled) {\n\t\tnewIndex++;\n\t}\n\tfocusedIndex.value = newIndex;\n};\n\nconst focusLast = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = props.options.length - 1;\n\twhile (props.options[newIndex].disabled && newIndex !== 0) {\n\t\tnewIndex--;\n\t}\n\tfocusedIndex.value = newIndex;\n};\nconst focusFirstSelected = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = 0;\n\twhile (\n\t\t!props.options[newIndex].selected &&\n\t\tprops.options.length !== newIndex\n\t) {\n\t\tnewIndex++;\n\t}\n\tfocusedIndex.value = newIndex;\n};\nconst focusLastSelected = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = props.options.length - 1;\n\twhile (props.options[newIndex].selected && newIndex !== 0) {\n\t\tnewIndex--;\n\t}\n\tfocusedIndex.value = newIndex;\n};\n\nconst focusByHash = (hash: Option['valueHash']) => {\n\tif (!canFocus.value) return;\n\tconst linkedOptionIndex = props.options.findIndex(\n\t\t(o) => o.valueHash === hash\n\t);\n\tif (linkedOptionIndex >= 0) {\n\t\tfocusedIndex.value = linkedOptionIndex;\n\t}\n};\n\nconst blur = () => {\n\tfocusedIndex.value = null;\n};\n\n/**\n * END FOCUS HANDLING\n */\n\nconst confirmOption = () => {\n\tif (isNil(focusedIndex.value)) return;\n\tconst option = props.options[focusedIndex.value!];\n\tif (option.selected) {\n\t\temit('option:unselected', option);\n\t}\n};\n\nconst getHighlighted = () => {\n\tif (isNil(focusedIndex.value)) return;\n\tconst option = props.options[focusedIndex.value!];\n\treturn option;\n};\n\nwatch(\n\t() => props.options,\n\t(value, previous) => {\n\t\tif (hash(value) !== hash(previous)) {\n\t\t\tblur();\n\t\t}\n\t},\n\t{\n\t\tflush: 'post',\n\t}\n);\n\ndefineExpose({\n\tfocusNext,\n\tfocusPrevious,\n\tfocusFirst,\n\tfocusFirstSelected,\n\tfocusLast,\n\tfocusLastSelected,\n\tblur,\n\tconfirmOption,\n\tfocusByHash,\n\tgetHighlighted,\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/ChipsBox';\n</style>\n"],"names":["props","__props","emit","__emit","focusedIndex","ref","canFocus","computed","o","findNextAvailableIndex","offset","initialValue","isNil","newIndex","focusNext","findPreviousAvailableIndex","focusPrevious","focusFirst","focusLast","focusFirstSelected","focusLastSelected","focusByHash","hash","linkedOptionIndex","blur","confirmOption","option","getHighlighted","watch","value","previous","__expose"],"mappings":";;;;;;;;;;;;AA2BA,UAAMA,IAAQC,GAERC,IAAOC,GAQPC,IAAeC,EAAmB,IAAI,GAEtCC,IAAWC,EAAS,MAAMP,EAAM,QAAQ,KAAK,CAACQ,MAAM,CAACA,EAAE,QAAQ,CAAC,GAEhEC,IAAyB,CAACC,IAAS,MAAM;AAC9C,YAAMC,IAAeC,EAAMR,EAAa,KAAK,IAAI,KAAKA,EAAa;AACnE,UAAIS,KAAYF,IAAeD,KAAUV,EAAM,QAAQ;AACvD,aAAOA,EAAM,QAAQa,CAAQ,EAAE,YAAYA,MAAaF;AAC5C,QAAAE,IAAAJ,EAAuBC,IAAS,CAAC;AAEtC,aAAAG;AAAA,IAAA,GAGFC,IAAY,MAAM;AACnB,UAAA,CAACR,EAAS,MAAO;AACrB,YAAMO,IAAWJ;AACjB,MAAAL,EAAa,QAAQS;AAAA,IAAA,GAEhBE,IAA6B,CAACL,IAAS,MAAM;AAClD,YAAMC,IAAeC,EAAMR,EAAa,KAAK,IAAI,IAAIA,EAAa;AAClE,UAAIS,KACFF,IAAeD,IAASV,EAAM,QAAQ,UAAUA,EAAM,QAAQ;AAChE,aAAOA,EAAM,QAAQa,CAAQ,EAAE,YAAYA,MAAaF;AAC5C,QAAAE,IAAAE,EAA2BL,IAAS,CAAC;AAE1C,aAAAG;AAAA,IAAA,GAEFG,IAAgB,YAAY;AAC7B,UAAA,CAACV,EAAS,MAAO;AACrB,YAAMO,IAAWE;AACjB,MAAAX,EAAa,QAAQS;AAAA,IAAA,GAGhBI,IAAa,MAAM;AACpB,UAAA,CAACX,EAAS,MAAO;AACrB,UAAIO,IA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EAAM;AAAA,MACZ,CAAC6B,GAAOC,MAAa;AACpB,QAAIR,EAAKO,CAAK,MAAMP,EAAKQ,CAAQ,KAC3BN;MAEP;AAAA,MACA;AAAA,QACC,OAAO;AAAA,MACR;AAAA,IAAA,GAGYO,EAAA;AAAA,MACZ,WAAAjB;AAAA,MACA,eAAAE;AAAA,MACA,YAAAC;AAAA,MACA,oBAAAE;AAAA,MACA,WAAAD;AAAA,MACA,mBAAAE;AAAA,MACA,MAAAI;AAAA,MACA,eAAAC;AAAA,MACA,aAAAJ;AAAA,MACA,gBAAAM;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;"}
|
package/dist/index233.js
CHANGED
|
@@ -1,5 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as F, ref as H, computed as L, watch as N, openBlock as d, createElementBlock as v, Fragment as S, renderList as A, normalizeClass as O, withModifiers as P, toDisplayString as V } from "vue";
|
|
2
|
+
import { hash as f } from "./index228.js";
|
|
3
|
+
import { isNil as i } from "./index124.js";
|
|
4
|
+
const z = ["text", "onClick:clear"], j = /* @__PURE__ */ F({
|
|
5
|
+
__name: "CommaBox",
|
|
6
|
+
props: {
|
|
7
|
+
options: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["option:unselected"],
|
|
10
|
+
setup(m, { expose: h, emit: x }) {
|
|
11
|
+
const t = m, a = x, n = H(null), l = L(() => t.options.some((e) => !e.disabled)), u = (e = 1) => {
|
|
12
|
+
const s = i(n.value) ? -1 : n.value;
|
|
13
|
+
let o = (s + e) % t.options.length;
|
|
14
|
+
for (; t.options[o].disabled && o !== s; )
|
|
15
|
+
o = u(e + 1);
|
|
16
|
+
return o;
|
|
17
|
+
}, b = () => {
|
|
18
|
+
if (!l.value) return;
|
|
19
|
+
const e = u();
|
|
20
|
+
n.value = e;
|
|
21
|
+
}, c = (e = 1) => {
|
|
22
|
+
const s = i(n.value) ? 0 : n.value;
|
|
23
|
+
let o = (s - e + t.options.length) % t.options.length;
|
|
24
|
+
for (; t.options[o].disabled && o !== s; )
|
|
25
|
+
o = c(e + 1);
|
|
26
|
+
return o;
|
|
27
|
+
}, w = async () => {
|
|
28
|
+
if (!l.value) return;
|
|
29
|
+
const e = c();
|
|
30
|
+
n.value = e;
|
|
31
|
+
}, I = () => {
|
|
32
|
+
if (!l.value) return;
|
|
33
|
+
let e = 0;
|
|
34
|
+
for (; t.options[e].disabled; )
|
|
35
|
+
e++;
|
|
36
|
+
n.value = e;
|
|
37
|
+
}, g = () => {
|
|
38
|
+
if (!l.value) return;
|
|
39
|
+
let e = t.options.length - 1;
|
|
40
|
+
for (; t.options[e].disabled && e !== 0; )
|
|
41
|
+
e--;
|
|
42
|
+
n.value = e;
|
|
43
|
+
}, k = () => {
|
|
44
|
+
if (!l.value) return;
|
|
45
|
+
let e = 0;
|
|
46
|
+
for (; !t.options[e].selected && t.options.length !== e; )
|
|
47
|
+
e++;
|
|
48
|
+
n.value = e;
|
|
49
|
+
}, _ = () => {
|
|
50
|
+
if (!l.value) return;
|
|
51
|
+
let e = t.options.length - 1;
|
|
52
|
+
for (; t.options[e].selected && e !== 0; )
|
|
53
|
+
e--;
|
|
54
|
+
n.value = e;
|
|
55
|
+
}, C = (e) => {
|
|
56
|
+
if (!l.value) return;
|
|
57
|
+
const s = t.options.findIndex(
|
|
58
|
+
(o) => o.valueHash === e
|
|
59
|
+
);
|
|
60
|
+
s >= 0 && (n.value = s);
|
|
61
|
+
}, r = () => {
|
|
62
|
+
n.value = null;
|
|
63
|
+
}, y = () => {
|
|
64
|
+
if (!n.value) return;
|
|
65
|
+
const e = t.options[n.value];
|
|
66
|
+
e.selected && a("option:unselected", e);
|
|
67
|
+
}, B = () => i(n.value) ? void 0 : t.options[n.value];
|
|
68
|
+
return N(
|
|
69
|
+
() => t.options,
|
|
70
|
+
(e, s) => {
|
|
71
|
+
f(e) !== f(s) && r();
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
flush: "post"
|
|
75
|
+
}
|
|
76
|
+
), h({
|
|
77
|
+
focusNext: b,
|
|
78
|
+
focusPrevious: w,
|
|
79
|
+
focusFirst: I,
|
|
80
|
+
focusFirstSelected: k,
|
|
81
|
+
focusLast: g,
|
|
82
|
+
focusLastSelected: _,
|
|
83
|
+
blur: r,
|
|
84
|
+
confirmOption: y,
|
|
85
|
+
focusByHash: C,
|
|
86
|
+
getHighlighted: B
|
|
87
|
+
}), (e, s) => (d(!0), v(S, null, A(e.options, (o, p) => (d(), v("span", {
|
|
88
|
+
key: o.valueHash,
|
|
89
|
+
class: O({
|
|
90
|
+
"bb-commabox-item": !0,
|
|
91
|
+
"bb-commabox-item--focused": p === n.value,
|
|
92
|
+
"bb-commabox-item--has-comma": p !== e.options.length - 1
|
|
93
|
+
}),
|
|
94
|
+
clearable: !0,
|
|
95
|
+
text: o.text,
|
|
96
|
+
"onClick:clear": P((D) => a("option:unselected", o), ["stop"])
|
|
97
|
+
}, V(o.text), 43, z))), 128));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
2
100
|
export {
|
|
3
|
-
|
|
101
|
+
j as default
|
|
4
102
|
};
|
|
5
103
|
//# sourceMappingURL=index233.js.map
|
package/dist/index233.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index233.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index233.js","sources":["../src/components/CommaBox.vue"],"sourcesContent":["<template>\n\t<span\n\t\tv-for=\"(item, index) in options\"\n\t\t:key=\"item.valueHash\"\n\t\t:class=\"{\n\t\t\t'bb-commabox-item': true,\n\t\t\t'bb-commabox-item--focused': index === focusedIndex,\n\t\t\t'bb-commabox-item--has-comma': index !== options.length - 1,\n\t\t}\"\n\t\t:clearable=\"true\"\n\t\t:text=\"item.text\"\n\t\t@click:clear.stop=\"emit('option:unselected', item)\"\n\t\t>{{ item.text }}</span\n\t>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { hash } from '@/utilities/functions/hash';\nimport { isNil } from '@/utilities/functions/isNil';\nimport { ref } from 'vue';\nimport { watch } from 'vue';\nimport type { Option } from '@/types/Option';\n\ntype Props = {\n\toptions: Option[];\n};\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n\t(e: 'option:unselected', option: Option): void;\n}>();\n\n/**\n * START FOCUS HANDLING\n */\n\nconst focusedIndex = ref<null | number>(null);\n\nconst canFocus = computed(() => props.options.some((o) => !o.disabled));\n\nconst findNextAvailableIndex = (offset = 1) => {\n\tconst initialValue = isNil(focusedIndex.value) ? -1 : focusedIndex.value!;\n\tlet newIndex = (initialValue + offset) % props.options.length;\n\twhile (props.options[newIndex].disabled && newIndex !== initialValue) {\n\t\tnewIndex = findNextAvailableIndex(offset + 1);\n\t}\n\treturn newIndex;\n};\n\nconst focusNext = () => {\n\tif (!canFocus.value) return;\n\tconst newIndex = findNextAvailableIndex();\n\tfocusedIndex.value = newIndex;\n};\nconst findPreviousAvailableIndex = (offset = 1) => {\n\tconst initialValue = isNil(focusedIndex.value) ? 0 : focusedIndex.value!;\n\tlet newIndex =\n\t\t(initialValue - offset + props.options.length) % props.options.length;\n\twhile (props.options[newIndex].disabled && newIndex !== initialValue) {\n\t\tnewIndex = findPreviousAvailableIndex(offset + 1);\n\t}\n\treturn newIndex;\n};\nconst focusPrevious = async () => {\n\tif (!canFocus.value) return;\n\tconst newIndex = findPreviousAvailableIndex();\n\tfocusedIndex.value = newIndex;\n};\n\nconst focusFirst = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = 0;\n\twhile (props.options[newIndex].disabled) {\n\t\tnewIndex++;\n\t}\n\tfocusedIndex.value = newIndex;\n};\n\nconst focusLast = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = props.options.length - 1;\n\twhile (props.options[newIndex].disabled && newIndex !== 0) {\n\t\tnewIndex--;\n\t}\n\tfocusedIndex.value = newIndex;\n};\nconst focusFirstSelected = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = 0;\n\twhile (\n\t\t!props.options[newIndex].selected &&\n\t\tprops.options.length !== newIndex\n\t) {\n\t\tnewIndex++;\n\t}\n\tfocusedIndex.value = newIndex;\n};\nconst focusLastSelected = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = props.options.length - 1;\n\twhile (props.options[newIndex].selected && newIndex !== 0) {\n\t\tnewIndex--;\n\t}\n\tfocusedIndex.value = newIndex;\n};\n\nconst focusByHash = (hash: Option['valueHash']) => {\n\tif (!canFocus.value) return;\n\tconst linkedOptionIndex = props.options.findIndex(\n\t\t(o) => o.valueHash === hash\n\t);\n\tif (linkedOptionIndex >= 0) {\n\t\tfocusedIndex.value = linkedOptionIndex;\n\t}\n};\n\nconst blur = () => {\n\tfocusedIndex.value = null;\n};\n\n/**\n * END FOCUS HANDLING\n */\n\nconst confirmOption = () => {\n\tif (!focusedIndex.value) return;\n\tconst option = props.options[focusedIndex.value];\n\tif (option.selected) {\n\t\temit('option:unselected', option);\n\t}\n};\n\nconst getHighlighted = () => {\n\tif (isNil(focusedIndex.value)) return;\n\tconst option = props.options[focusedIndex.value!];\n\treturn option;\n};\n\nwatch(\n\t() => props.options,\n\t(value, previous) => {\n\t\tif (hash(value) !== hash(previous)) {\n\t\t\tblur();\n\t\t}\n\t},\n\t{\n\t\tflush: 'post',\n\t}\n);\n\ndefineExpose({\n\tfocusNext,\n\tfocusPrevious,\n\tfocusFirst,\n\tfocusFirstSelected,\n\tfocusLast,\n\tfocusLastSelected,\n\tblur,\n\tconfirmOption,\n\tfocusByHash,\n\tgetHighlighted,\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/CommaBox';\n</style>\n"],"names":["props","__props","emit","__emit","focusedIndex","ref","canFocus","computed","o","findNextAvailableIndex","offset","initialValue","isNil","newIndex","focusNext","findPreviousAvailableIndex","focusPrevious","focusFirst","focusLast","focusFirstSelected","focusLastSelected","focusByHash","hash","linkedOptionIndex","blur","confirmOption","option","getHighlighted","watch","value","previous","__expose"],"mappings":";;;;;;;;;;AA2BA,UAAMA,IAAQC,GAERC,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A,MACA,MAAAI;AAAA,MACA,eAAAC;AAAA,MACA,aAAAJ;AAAA,MACA,gBAAAM;AAAA,IAAA,CACA;;;;;;;;;;;;;"}
|
package/dist/index237.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const o = (n, t) => {
|
|
2
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
3
|
+
const i = n[e];
|
|
4
|
+
if (t(i, e, n))
|
|
5
|
+
return e;
|
|
6
|
+
}
|
|
7
|
+
return -1;
|
|
8
|
+
};
|
|
3
9
|
export {
|
|
4
|
-
o as
|
|
10
|
+
o as findRightIndex
|
|
5
11
|
};
|
|
6
12
|
//# sourceMappingURL=index237.js.map
|
package/dist/index237.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index237.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index237.js","sources":["../src/utilities/functions/findRightIndex.ts"],"sourcesContent":["/**\n * Same as find but from the end of an array\n */\nexport const findRightIndex = <T>(\n\tarr: T[],\n\titeratee: (value: T, index: number, arr: T[]) => boolean\n) => {\n\tfor (let index = arr.length - 1; index >= 0; index--) {\n\t\tconst element = arr[index];\n\t\tif (iteratee(element, index, arr)) {\n\t\t\treturn index;\n\t\t}\n\t}\n\treturn -1;\n};\n"],"names":["findRightIndex","arr","iteratee","index","element"],"mappings":"AAGa,MAAAA,IAAiB,CAC7BC,GACAC,MACI;AACJ,WAASC,IAAQF,EAAI,SAAS,GAAGE,KAAS,GAAGA,KAAS;AAC/C,UAAAC,IAAUH,EAAIE,CAAK;AACzB,QAAID,EAASE,GAASD,GAAOF,CAAG;AACxB,aAAAE;AAAA,EAET;AACO,SAAA;AACR;"}
|
package/dist/index238.js
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
const e = {
|
|
2
|
+
inert: ":not([inert]):not([inert] *)",
|
|
3
|
+
negTabIndex: ':not([tabindex^="-"])',
|
|
4
|
+
disabled: ":not(:disabled)"
|
|
5
|
+
}, n = [
|
|
6
|
+
`a[href]${e.inert}${e.negTabIndex}`,
|
|
7
|
+
`area[href]${e.inert}${e.negTabIndex}`,
|
|
8
|
+
`input:not([type="hidden"]):not([type="radio"])${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
9
|
+
`input[type="radio"]${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
10
|
+
`select${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
11
|
+
`textarea${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
12
|
+
`button${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
13
|
+
`details${e.inert} > summary:first-of-type${e.negTabIndex}`,
|
|
14
|
+
// Discard until Firefox supports `:has()`
|
|
15
|
+
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
16
|
+
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
17
|
+
`iframe${e.inert}${e.negTabIndex}`,
|
|
18
|
+
`audio[controls]${e.inert}${e.negTabIndex}`,
|
|
19
|
+
`video[controls]${e.inert}${e.negTabIndex}`,
|
|
20
|
+
`[contenteditable]${e.inert}${e.negTabIndex}`,
|
|
21
|
+
`[tabindex]${e.inert}${e.negTabIndex}`
|
|
22
|
+
];
|
|
12
23
|
export {
|
|
13
|
-
n as
|
|
24
|
+
n as default
|
|
14
25
|
};
|
|
15
26
|
//# sourceMappingURL=index238.js.map
|
package/dist/index238.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index238.js","sources":["../
|
|
1
|
+
{"version":3,"file":"index238.js","sources":["../node_modules/focusable-selectors/index.js"],"sourcesContent":["const not = {\n inert: ':not([inert]):not([inert] *)',\n negTabIndex: ':not([tabindex^=\"-\"])',\n disabled: ':not(:disabled)',\n}\n\nexport default [\n `a[href]${not.inert}${not.negTabIndex}`,\n `area[href]${not.inert}${not.negTabIndex}`,\n `input:not([type=\"hidden\"]):not([type=\"radio\"])${not.inert}${not.negTabIndex}${not.disabled}`,\n `input[type=\"radio\"]${not.inert}${not.negTabIndex}${not.disabled}`,\n `select${not.inert}${not.negTabIndex}${not.disabled}`,\n `textarea${not.inert}${not.negTabIndex}${not.disabled}`,\n `button${not.inert}${not.negTabIndex}${not.disabled}`,\n `details${not.inert} > summary:first-of-type${not.negTabIndex}`,\n // Discard until Firefox supports `:has()`\n // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12\n // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,\n `iframe${not.inert}${not.negTabIndex}`,\n `audio[controls]${not.inert}${not.negTabIndex}`,\n `video[controls]${not.inert}${not.negTabIndex}`,\n `[contenteditable]${not.inert}${not.negTabIndex}`,\n `[tabindex]${not.inert}${not.negTabIndex}`,\n]\n"],"names":["not","selectors"],"mappings":"AAAA,MAAMA,IAAM;AAAA,EACV,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AACZ,GAEeC,IAAA;AAAA,EACb,UAAUD,EAAI,KAAK,GAAGA,EAAI,WAAW;AAAA,EACrC,aAAaA,EAAI,KAAK,GAAGA,EAAI,WAAW;AAAA,EACxC,iDAAiDA,EAAI,KAAK,GAAGA,EAAI,WAAW,GAAGA,EAAI,QAAQ;AAAA,EAC3F,sBAAsBA,EAAI,KAAK,GAAGA,EAAI,WAAW,GAAGA,EAAI,QAAQ;AAAA,EAChE,SAASA,EAAI,KAAK,GAAGA,EAAI,WAAW,GAAGA,EAAI,QAAQ;AAAA,EACnD,WAAWA,EAAI,KAAK,GAAGA,EAAI,WAAW,GAAGA,EAAI,QAAQ;AAAA,EACrD,SAASA,EAAI,KAAK,GAAGA,EAAI,WAAW,GAAGA,EAAI,QAAQ;AAAA,EACnD,UAAUA,EAAI,KAAK,2BAA2BA,EAAI,WAAW;AAAA;AAAA;AAAA;AAAA,EAI7D,SAASA,EAAI,KAAK,GAAGA,EAAI,WAAW;AAAA,EACpC,kBAAkBA,EAAI,KAAK,GAAGA,EAAI,WAAW;AAAA,EAC7C,kBAAkBA,EAAI,KAAK,GAAGA,EAAI,WAAW;AAAA,EAC7C,oBAAoBA,EAAI,KAAK,GAAGA,EAAI,WAAW;AAAA,EAC/C,aAAaA,EAAI,KAAK,GAAGA,EAAI,WAAW;AAC1C;","x_google_ignoreList":[0]}
|
package/dist/index239.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
n.has(c) || (n.add(c), s.push(o));
|
|
6
|
-
}
|
|
7
|
-
return s;
|
|
8
|
-
}
|
|
1
|
+
import e from "./index275.js";
|
|
2
|
+
import r from "./index276.js";
|
|
3
|
+
import o from "./index277.js";
|
|
4
|
+
const f = new o(r, e)._freeze();
|
|
9
5
|
export {
|
|
10
|
-
|
|
6
|
+
o as Mime,
|
|
7
|
+
f as default
|
|
11
8
|
};
|
|
12
9
|
//# sourceMappingURL=index239.js.map
|
package/dist/index239.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index239.js","sources":["../
|
|
1
|
+
{"version":3,"file":"index239.js","sources":["../node_modules/mime/dist/src/index.js"],"sourcesContent":["import otherTypes from '../types/other.js';\nimport standardTypes from '../types/standard.js';\nimport Mime from './Mime.js';\nexport { default as Mime } from './Mime.js';\nexport default new Mime(standardTypes, otherTypes)._freeze();\n//# sourceMappingURL=index.js.map"],"names":["index","Mime","standardTypes","otherTypes"],"mappings":";;;AAIA,MAAeA,IAAA,IAAIC,EAAKC,GAAeC,CAAU,EAAE,QAAS;","x_google_ignoreList":[0]}
|
package/dist/index24.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as S, computed as n, openBlock as r, createElementBlock as c, normalizeClass as T, createBlock as y, resolveDynamicComponent as B, normalizeProps as o, guardReactiveProps as l, withCtx as b, renderSlot as E, createTextVNode as V, toDisplayString as p, createElementVNode as d, unref as m, createVNode as P, Fragment as D, renderList as I } from "vue";
|
|
2
|
-
import { deburr as N } from "./
|
|
2
|
+
import { deburr as N } from "./index202.js";
|
|
3
3
|
import { getAsPercentage as $ } from "./index125.js";
|
|
4
4
|
import { useId as F } from "./index7.js";
|
|
5
5
|
import R from "./index120.js";
|
package/dist/index240.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const e = (o, r, f) => o.reduce((t, n) => {
|
|
2
|
+
if (t) return t;
|
|
3
|
+
if (f(n))
|
|
4
|
+
return n;
|
|
5
|
+
if (r in n) {
|
|
6
|
+
const i = e(
|
|
7
|
+
[].concat(n[r]),
|
|
8
|
+
r,
|
|
9
|
+
f
|
|
10
|
+
);
|
|
11
|
+
if (i)
|
|
12
|
+
return i;
|
|
7
13
|
}
|
|
8
|
-
|
|
14
|
+
return t;
|
|
15
|
+
}, null);
|
|
9
16
|
export {
|
|
10
|
-
e as
|
|
17
|
+
e as findInTree
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=index240.js.map
|
package/dist/index240.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index240.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index240.js","sources":["../src/utilities/functions/findInTree.ts"],"sourcesContent":["/**\n * Find the eleemnt for which iteratee rfeturns true in a tree like structure\n */\nexport const findInTree = <T extends Record<string, any>>(\n\titems: T[],\n\tkeyName: keyof T,\n\titeratee: (item: T) => boolean\n): null | T => {\n\treturn items.reduce((acc: null | T, curr) => {\n\t\tif (acc) return acc;\n\t\tif (iteratee(curr)) {\n\t\t\treturn curr;\n\t\t}\n\n\t\tif (keyName in curr) {\n\t\t\tconst fromChildren = findInTree(\n\t\t\t\t[].concat(curr[keyName]),\n\t\t\t\tkeyName,\n\t\t\t\titeratee\n\t\t\t);\n\t\t\tif (fromChildren) {\n\t\t\t\treturn fromChildren;\n\t\t\t}\n\t\t}\n\t\treturn acc;\n\t}, null);\n};\n"],"names":["findInTree","items","keyName","iteratee","acc","curr","fromChildren"],"mappings":"AAGO,MAAMA,IAAa,CACzBC,GACAC,GACAC,MAEOF,EAAM,OAAO,CAACG,GAAeC,MAAS;AAC5C,MAAID,EAAY,QAAAA;AACZ,MAAAD,EAASE,CAAI;AACT,WAAAA;AAGR,MAAIH,KAAWG,GAAM;AACpB,UAAMC,IAAeN;AAAA,MACpB,CAAA,EAAG,OAAOK,EAAKH,CAAO,CAAC;AAAA,MACvBA;AAAA,MACAC;AAAA,IAAA;AAED,QAAIG;AACI,aAAAA;AAAA,EAET;AACO,SAAAF;GACL,IAAI;"}
|
package/dist/index241.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} else if (typeof n == "string") {
|
|
10
|
-
const f = t(r, n);
|
|
11
|
-
return typeof f == "string" ? f : JSON.stringify(f);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return JSON.stringify(r);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
1
|
+
function u(e, i) {
|
|
2
|
+
let t;
|
|
3
|
+
return function(...o) {
|
|
4
|
+
t !== void 0 && clearTimeout(t), t = setTimeout(() => {
|
|
5
|
+
e.apply(this, o);
|
|
6
|
+
}, i);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
17
9
|
export {
|
|
18
|
-
|
|
10
|
+
u as debounce
|
|
19
11
|
};
|
|
20
12
|
//# sourceMappingURL=index241.js.map
|
package/dist/index241.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index241.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index241.js","sources":["../src/utilities/functions/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => any>(\n\tfunc: T,\n\twait: number\n): (...args: Parameters<T>) => void {\n\tlet timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n\treturn function (this: any, ...args: Parameters<T>) {\n\t\tif (timeoutId !== undefined) {\n\t\t\tclearTimeout(timeoutId);\n\t\t}\n\n\t\ttimeoutId = setTimeout(() => {\n\t\t\tfunc.apply(this, args);\n\t\t}, wait);\n\t};\n}\n"],"names":["debounce","func","wait","timeoutId","args"],"mappings":"AAAgB,SAAAA,EACfC,GACAC,GACmC;AAC/B,MAAAC;AAEJ,SAAO,YAAwBC,GAAqB;AACnD,IAAID,MAAc,UACjB,aAAaA,CAAS,GAGvBA,IAAY,WAAW,MAAM;AACvB,MAAAF,EAAA,MAAM,MAAMG,CAAI;AAAA,OACnBF,CAAI;AAAA,EAAA;AAET;"}
|