bitboss-ui 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BbTable/BbTable.vue.d.ts +3 -0
- package/dist/index105.js +4 -4
- package/dist/index105.js.map +1 -1
- 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/index122.js +1 -1
- package/dist/index128.js +1 -1
- package/dist/index16.js +2 -2
- package/dist/index18.js +8 -8
- package/dist/index199.js +158 -3
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +12 -12
- package/dist/index200.js +84 -35
- package/dist/index200.js.map +1 -1
- package/dist/index202.js +3 -7
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +35 -5
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +6 -126
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +7 -281
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -123
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +5 -19
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +16 -2
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +16 -2
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +17 -172
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +19 -42
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +30 -0
- package/dist/index212.js.map +1 -0
- package/dist/index213.js +8 -13
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -369
- package/dist/index214.js.map +1 -1
- package/dist/index216.js +1 -1
- package/dist/index218.js +3 -158
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +125 -83
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +5 -5
- package/dist/index220.js +126 -0
- package/dist/index220.js.map +1 -0
- package/dist/index221.js +2 -3
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +172 -14
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +42 -16
- package/dist/index223.js.map +1 -1
- package/dist/index225.js +13 -27
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +369 -8
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +1 -1
- package/dist/index234.js +1 -1
- package/dist/index237.js +3 -9
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +11 -8
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +9 -23
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index240.js +9 -6
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +16 -15
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +1 -1
- package/dist/index243.js +1 -1
- package/dist/index244.js +200 -5
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +9 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +23 -9
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -69
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +15 -199
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +9 -4
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +280 -5
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +6 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +2 -2
- package/dist/index254.js +2 -126
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +2 -3
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +5 -0
- package/dist/index256.js.map +1 -0
- package/dist/index257.js +2 -7
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +4 -3
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +224 -12
- package/dist/index259.js.map +1 -1
- package/dist/index26.js +2 -2
- package/dist/index260.js +3 -9
- package/dist/index260.js.map +1 -1
- package/dist/index262.js +6 -435
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +2 -127
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +69 -224
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +5 -2
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +2 -2
- package/dist/index267.js +126 -2
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +3 -2
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +1 -1
- package/dist/index270.js +211 -3
- package/dist/index270.js.map +1 -1
- package/dist/index272.js +439 -0
- package/dist/index272.js.map +1 -0
- package/dist/index273.js +125 -26
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +26 -13
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +15 -4
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +11 -4
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +4 -59
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +4 -2
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +58 -10
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +1 -1
- package/dist/index281.js +2 -47
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +50 -0
- package/dist/index282.js.map +1 -0
- package/dist/index284.js +416 -42
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +50 -0
- package/dist/index285.js.map +1 -0
- package/dist/index30.js +2 -2
- package/dist/index32.js +1 -1
- package/dist/index34.js +8 -8
- package/dist/index40.js +2 -2
- package/dist/index42.js +4 -4
- package/dist/index44.js +2 -2
- package/dist/index46.js +2 -2
- 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/package.json +2 -2
- package/dist/index201.js +0 -9
- package/dist/index201.js.map +0 -1
- package/dist/index224.js +0 -22
- package/dist/index224.js.map +0 -1
- package/dist/index261.js +0 -20
- package/dist/index261.js.map +0 -1
- package/dist/index271.js +0 -214
- package/dist/index271.js.map +0 -1
- package/dist/index283.js +0 -424
- package/dist/index283.js.map +0 -1
package/dist/index32.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as C, ref as g, computed as f, openBlock as i, createElementBlock as l, mergeProps as h, createElementVNode as r, renderSlot as p, Fragment as I, renderList as V, normalizeClass as B, toDisplayString as M } from "vue";
|
|
2
2
|
import { booleanishToBoolean as D } from "./index217.js";
|
|
3
|
-
import { identity as F } from "./
|
|
3
|
+
import { identity as F } from "./index221.js";
|
|
4
4
|
import { isCssColor as v } from "./index215.js";
|
|
5
5
|
import { isNotNil as T } from "./index129.js";
|
|
6
6
|
const $ = { class: "bb-base-rating__inner-container" }, q = { class: "bb-base-rating__label-text" }, x = ["id", "aria-describedby", "autofocus", "checked", "disabled", "name", "required", "value"], H = ["height", "width"], N = /* @__PURE__ */ r("path", {
|
package/dist/index34.js
CHANGED
|
@@ -5,23 +5,23 @@ import { useMobile as We } from "./index8.js";
|
|
|
5
5
|
import Re from "./index122.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { isNotNil as Je } from "./index129.js";
|
|
8
|
-
import { last as Ye } from "./
|
|
8
|
+
import { last as Ye } from "./index214.js";
|
|
9
9
|
import { matchAnyKey as j } from "./index228.js";
|
|
10
|
-
import { useFloating as je } from "./
|
|
10
|
+
import { useFloating as je } from "./index219.js";
|
|
11
11
|
import { useIntersectionObserver as Ge } from "./index127.js";
|
|
12
|
-
import { useLogger as Xe } from "./
|
|
13
|
-
import { useOptions as Ze } from "./
|
|
12
|
+
import { useLogger as Xe } from "./index206.js";
|
|
13
|
+
import { useOptions as Ze } from "./index199.js";
|
|
14
14
|
import { wait as T } from "./index126.js";
|
|
15
15
|
import { when as et } from "./index216.js";
|
|
16
16
|
import tt from "./index229.js";
|
|
17
17
|
/* empty css */
|
|
18
18
|
import ot from "./index231.js";
|
|
19
19
|
/* empty css */
|
|
20
|
-
import nt from "./
|
|
20
|
+
import nt from "./index223.js";
|
|
21
21
|
/* empty css */
|
|
22
|
-
import lt from "./
|
|
23
|
-
import { waitFor as at } from "./
|
|
24
|
-
import { autoUpdate as it, flip as rt, offset as st, shift as ut } from "./
|
|
22
|
+
import lt from "./index225.js";
|
|
23
|
+
import { waitFor as at } from "./index204.js";
|
|
24
|
+
import { autoUpdate as it, flip as rt, offset as st, shift as ut } from "./index226.js";
|
|
25
25
|
const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-controls", "aria-describedby", "aria-expanded", "autocomplete", "autofocus", "disabled", "inputmode", "placeholder", "readonly", "required", "onKeydown"], dt = /* @__PURE__ */ S("svg", {
|
|
26
26
|
class: "bb-base-select__chevron",
|
|
27
27
|
viewBox: "0 0 24 24",
|
package/dist/index40.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as $, ref as p, toRef as l, openBlock as w, createBlock as B, unref as f, withCtx as i, renderSlot as s, normalizeProps as b, guardReactiveProps as h, createVNode as O, mergeProps as v, createSlots as z } from "vue";
|
|
2
|
-
import { useOptions as F } from "./
|
|
2
|
+
import { useOptions as F } from "./index199.js";
|
|
3
3
|
import M from "./index38.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import S from "./
|
|
5
|
+
import S from "./index200.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
const I = /* @__PURE__ */ $({
|
|
8
8
|
__name: "BaseSwitchGroup",
|
package/dist/index42.js
CHANGED
|
@@ -3,15 +3,15 @@ import { defineComponent as Z, ref as r, computed as k, toRef as B, openBlock as
|
|
|
3
3
|
import ue from "./index122.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { isNotNil as se } from "./index129.js";
|
|
6
|
-
import { last as de } from "./
|
|
7
|
-
import { useOptions as pe } from "./
|
|
6
|
+
import { last as de } from "./index214.js";
|
|
7
|
+
import { useOptions as pe } from "./index199.js";
|
|
8
8
|
import ce from "./index229.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import me from "./index231.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import fe from "./
|
|
12
|
+
import fe from "./index223.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
import ve from "./
|
|
14
|
+
import ve from "./index225.js";
|
|
15
15
|
const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "placeholder", "readonly", "required", "onKeydown"], Ke = /* @__PURE__ */ Z({
|
|
16
16
|
__name: "BaseTag",
|
|
17
17
|
props: {
|
package/dist/index44.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as w, ref as g, computed as u, onMounted as y, watch as V, nextTick as k, openBlock as x, createBlock as B, normalizeClass as $, withCtx as r, renderSlot as t, createVNode as i, createElementVNode as C, mergeProps as T } from "vue";
|
|
2
|
-
import v from "./
|
|
3
|
-
import E from "./
|
|
2
|
+
import v from "./index225.js";
|
|
3
|
+
import E from "./index223.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import G from "./index122.js";
|
|
6
6
|
/* empty css */
|
package/dist/index46.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as i, computed as c, openBlock as m, createElementBlock as b, Fragment as f, createVNode as r, normalizeClass as y, withCtx as n, renderSlot as t, createElementVNode as p, mergeProps as h } from "vue";
|
|
2
|
-
import g from "./
|
|
2
|
+
import g from "./index223.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import B from "./
|
|
4
|
+
import B from "./index225.js";
|
|
5
5
|
const k = ["id", "aria-describedby", "aria-invalid", "autocomplete", "autofocus", "disabled", "name", "placeholder", "readonly", "required", "type", "value"], w = /* @__PURE__ */ p("span", null, null, -1), q = /* @__PURE__ */ i({
|
|
6
6
|
__name: "BaseTextInput",
|
|
7
7
|
props: {
|
package/dist/index70.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as Y, computed as M, ref as v, openBlock as D, createElementBlock as H, mergeProps as I, createElementVNode as $, renderSlot as _, normalizeProps as Z, guardReactiveProps as ee, unref as c, createBlock as te, Teleport as oe, normalizeClass as ne, normalizeStyle as z, Fragment as N, renderList as ae, createVNode as le, withCtx as se, createCommentVNode as ie } from "vue";
|
|
2
|
-
import { findRightIndex as S } from "./
|
|
3
|
-
import { useFloating as re, arrow as ue } from "./
|
|
2
|
+
import { findRightIndex as S } from "./index245.js";
|
|
3
|
+
import { useFloating as re, arrow as ue } from "./index219.js";
|
|
4
4
|
import { useId as de } from "./index7.js";
|
|
5
5
|
import { wait as U } from "./index126.js";
|
|
6
6
|
import { useIntersectionObserver as ce } from "./index127.js";
|
|
7
7
|
import fe from "./index12.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import V from "./
|
|
10
|
-
import { autoUpdate as pe, flip as be, offset as me, shift as ve } from "./
|
|
9
|
+
import V from "./index246.js";
|
|
10
|
+
import { autoUpdate as pe, flip as be, offset as me, shift as ve } from "./index226.js";
|
|
11
11
|
const we = ["id", "aria-labelledby"], ye = { class: "bb-dropdown__items-container" }, He = /* @__PURE__ */ Y({
|
|
12
12
|
__name: "BbDropdown",
|
|
13
13
|
props: {
|
package/dist/index74.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as j, ref as g, watch as x, computed as m, openBlock as V, createBlock as G, resolveDynamicComponent as K, normalizeClass as O, withCtx as M, createElementVNode as c, withModifiers as y, renderSlot as U, normalizeProps as Y, guardReactiveProps as Z, createTextVNode as J, unref as Q, createVNode as W, createElementBlock as F, Fragment as X, renderList as ee, toDisplayString as te } from "vue";
|
|
2
|
-
import { findInTree as ae } from "./
|
|
2
|
+
import { findInTree as ae } from "./index248.js";
|
|
3
3
|
import { useId as re } from "./index7.js";
|
|
4
4
|
import oe from "./index122.js";
|
|
5
5
|
/* empty css */
|
|
@@ -56,7 +56,7 @@ const le = ["accept", "autofocus", "disabled", "multiple"], se = {
|
|
|
56
56
|
const r = t.accept[a];
|
|
57
57
|
if (r.includes("/")) e.push(r);
|
|
58
58
|
else {
|
|
59
|
-
b || (b = (await import("./
|
|
59
|
+
b || (b = (await import("./index247.js")).default);
|
|
60
60
|
const o = b.getType(r);
|
|
61
61
|
if (!o)
|
|
62
62
|
throw new Error(
|
package/dist/index76.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
|
|
2
|
-
import { throttle as c } from "./
|
|
2
|
+
import { throttle as c } from "./index202.js";
|
|
3
3
|
const M = /* @__PURE__ */ h({
|
|
4
4
|
__name: "BbIntersection",
|
|
5
5
|
props: {
|
package/dist/index79.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as oe, ref as s, useAttrs as se, getCurrentInstance as ae, computed as v, nextTick as le, onBeforeUnmount as O, onMounted as ne, watch as ie, openBlock as _, createBlock as re, Teleport as ce, createElementVNode as a, mergeProps as S, createElementBlock as V, renderSlot as n, createTextVNode as ue, toDisplayString as z, createCommentVNode as T } from "vue";
|
|
2
|
-
import { useFocusTrap as de } from "./
|
|
2
|
+
import { useFocusTrap as de } from "./index203.js";
|
|
3
3
|
import { useId as A } from "./index7.js";
|
|
4
4
|
import { wait as E } from "./index126.js";
|
|
5
|
-
import { useModalsState as p } from "./
|
|
5
|
+
import { useModalsState as p } from "./index205.js";
|
|
6
6
|
const fe = ["inert"], ve = { class: "bb-offcanvas-close" }, pe = { class: "bb-offcanvas-close__content" }, be = { class: "bb-offcanvas-close__label" }, me = /* @__PURE__ */ a("span", { class: "bb-offcanvas-close__icon" }, [
|
|
7
7
|
/* @__PURE__ */ a("svg", {
|
|
8
8
|
fill: "none",
|
package/dist/index81.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as W, computed as y, ref as c, onMounted as w, onBeforeUnmount as R, openBlock as k, createElementBlock as V, normalizeClass as C, createElementVNode as o, createVNode as v, unref as g, withCtx as S, renderSlot as m, Fragment as F, renderList as L, toDisplayString as M, nextTick as N } from "vue";
|
|
2
|
-
import { debounce as T } from "./
|
|
2
|
+
import { debounce as T } from "./index249.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import $ from "./index12.js";
|
|
5
5
|
/* empty css */
|
package/dist/index83.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as W, ref as a, computed as _, openBlock as d, createElementBlock as g, mergeProps as D, createElementVNode as b, renderSlot as S, normalizeProps as I, guardReactiveProps as R, unref as y, createBlock as E, Teleport as U, normalizeClass as j, normalizeStyle as G, createCommentVNode as k, withCtx as J, nextTick as K, watch as Q } from "vue";
|
|
2
|
-
import { useFloating as X, arrow as Y } from "./
|
|
3
|
-
import { useFocusTrap as Z } from "./
|
|
2
|
+
import { useFloating as X, arrow as Y } from "./index219.js";
|
|
3
|
+
import { useFocusTrap as Z } from "./index203.js";
|
|
4
4
|
import { useId as ee } from "./index7.js";
|
|
5
5
|
import { wait as M } from "./index126.js";
|
|
6
6
|
import te from "./index12.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { autoUpdate as oe, flip as ae, offset as re, shift as ne, hide as le } from "./
|
|
8
|
+
import { autoUpdate as oe, flip as ae, offset as re, shift as ne, hide as le } from "./index226.js";
|
|
9
9
|
const se = ["id"], ie = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "bb-popover__bubble"
|
package/package.json
CHANGED
package/dist/index201.js
DELETED
package/dist/index201.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index201.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/index224.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as p, commonjsGlobal as s } from "./index250.js";
|
|
2
|
-
import { __module as n } from "./index267.js";
|
|
3
|
-
(function(u, l) {
|
|
4
|
-
(function(c, e) {
|
|
5
|
-
u.exports = e();
|
|
6
|
-
})(s, function() {
|
|
7
|
-
return function(c, e, r) {
|
|
8
|
-
r.updateLocale = function(f, o) {
|
|
9
|
-
var t = r.Ls[f];
|
|
10
|
-
if (t) return (o ? Object.keys(o) : []).forEach(function(a) {
|
|
11
|
-
t[a] = o[a];
|
|
12
|
-
}), t;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
})(n);
|
|
17
|
-
var i = n.exports;
|
|
18
|
-
const x = /* @__PURE__ */ p(i);
|
|
19
|
-
export {
|
|
20
|
-
x as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=index224.js.map
|
package/dist/index224.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index224.js","sources":["../node_modules/dayjs/plugin/updateLocale.js"],"sourcesContent":["!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_updateLocale=n()}(this,(function(){\"use strict\";return function(e,n,t){t.updateLocale=function(e,n){var o=t.Ls[e];if(o)return(n?Object.keys(n):[]).forEach((function(e){o[e]=n[e]})),o}}}));"],"names":["e","n","module","this","t","o"],"mappings":";;;AAAA,GAAC,SAASA,GAAEC,GAAE;AAAsD,IAAAC,EAAe,UAAAD,EAAuI;AAAA,EAAA,GAAEE,GAAM,WAAU;AAAc,WAAO,SAASH,GAAEC,GAAEG,GAAE;AAAC,MAAAA,EAAE,eAAa,SAASJ,GAAEC,GAAE;AAAC,YAAII,IAAED,EAAE,GAAGJ,CAAC;AAAE,YAAGK,EAAE,SAAOJ,IAAE,OAAO,KAAKA,CAAC,IAAE,CAAA,GAAI,QAAS,SAASD,GAAE;AAAC,UAAAK,EAAEL,CAAC,IAAEC,EAAED,CAAC;AAAA,QAAC,IAAIK;AAAA,MAAC;AAAA,IAAC;AAAA,EAAC;;;;","x_google_ignoreList":[0]}
|
package/dist/index261.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { get as t } from "./index279.js";
|
|
2
|
-
const o = () => ({
|
|
3
|
-
getItemText(r, n) {
|
|
4
|
-
if (typeof r == "string" && !n) return r;
|
|
5
|
-
if (n) {
|
|
6
|
-
if (typeof n == "function") {
|
|
7
|
-
let f = n(r);
|
|
8
|
-
return typeof f != "string" && (f = JSON.stringify(f)), f;
|
|
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
|
-
});
|
|
17
|
-
export {
|
|
18
|
-
o as useItemText
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=index261.js.map
|
package/dist/index261.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index261.js","sources":["../src/composables/useItemText.ts"],"sourcesContent":["import { get } from '@/utilities/functions/get';\n\ntype NestedKeyOf<ObjectType extends object> = {\n\t[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object\n\t\t? `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key]>}`\n\t\t: `${Key}`;\n}[keyof ObjectType & (string | number)];\n\nexport type Path<T> = T extends object\n\t?\n\t\t\t| NestedKeyOf<T>\n\t\t\t| ((item: T) => string | number)\n\t\t\t| undefined\n\t\t\t| (string & Record<never, never>)\n\t: undefined;\n\nexport const useItemText = () => ({\n\tgetItemText<T>(item: T, getter?: Path<T>): string {\n\t\tif (typeof item === 'string' && !getter) return item;\n\t\telse if (getter) {\n\t\t\tif (typeof getter === 'function') {\n\t\t\t\tlet found = getter(item);\n\t\t\t\tif (typeof found !== 'string') found = JSON.stringify(found);\n\t\t\t\treturn found;\n\t\t\t} else if (typeof getter === 'string') {\n\t\t\t\tconst found = get(item, getter as any);\n\t\t\t\tif (typeof found === 'string') return found;\n\t\t\t\telse return JSON.stringify(found);\n\t\t\t}\n\t\t}\n\t\treturn JSON.stringify(item);\n\t},\n});\n"],"names":["useItemText","item","getter","found","get"],"mappings":";AAgBO,MAAMA,IAAc,OAAO;AAAA,EACjC,YAAeC,GAASC,GAA0B;AACjD,QAAI,OAAOD,KAAS,YAAY,CAACC,EAAe,QAAAD;AAAA,QACvCC;AACJ,UAAA,OAAOA,KAAW,YAAY;AAC7B,YAAAC,IAAQD,EAAOD,CAAI;AACvB,eAAI,OAAOE,KAAU,aAAkBA,IAAA,KAAK,UAAUA,CAAK,IACpDA;AAAA,MAAA,WACG,OAAOD,KAAW,UAAU;AAChC,cAAAC,IAAQC,EAAIH,GAAMC,CAAa;AACjC,eAAA,OAAOC,KAAU,WAAiBA,IAC1B,KAAK,UAAUA,CAAK;AAAA,MACjC;AAAA;AAEM,WAAA,KAAK,UAAUF,CAAI;AAAA,EAC3B;AACD;"}
|
package/dist/index271.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { defineComponent as K, ref as h, computed as m, watch as N, openBlock as r, createElementBlock as c, normalizeClass as $, normalizeStyle as b, withModifiers as Q, createElementVNode as x, renderSlot as v, createTextVNode as D, toDisplayString as g, Fragment as U, renderList as X } from "vue";
|
|
2
|
-
import { isNil as f } from "./index124.js";
|
|
3
|
-
import { useVirtualizer as Z } from "./index281.js";
|
|
4
|
-
import { isNotNil as ee } from "./index129.js";
|
|
5
|
-
import { hash as H } from "./index234.js";
|
|
6
|
-
const te = { class: "bb-listbox__outer-container" }, oe = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "bb-listbox__loading"
|
|
9
|
-
}, ne = {
|
|
10
|
-
key: 1,
|
|
11
|
-
class: "bb-listbox__no-data"
|
|
12
|
-
}, le = ["aria-selected", "data-index"], ie = { class: "autocomplete-option__content" }, se = { class: "autocomplete-option__label" }, pe = /* @__PURE__ */ K({
|
|
13
|
-
__name: "ListBox",
|
|
14
|
-
props: {
|
|
15
|
-
options: {},
|
|
16
|
-
open: { type: Boolean },
|
|
17
|
-
loading: { type: Boolean },
|
|
18
|
-
transitionDuration: { default: 250 },
|
|
19
|
-
loadingText: { default: "Caricamento..." },
|
|
20
|
-
noDataText: { default: "Nessun elemento da visualizzare" }
|
|
21
|
-
},
|
|
22
|
-
emits: ["option:selected", "option:unselected"],
|
|
23
|
-
setup(T, { expose: V, emit: B }) {
|
|
24
|
-
const o = T, _ = B, s = h(null), C = (e) => "option_" + JSON.stringify(e).replace(/\W/g, "_"), i = m(
|
|
25
|
-
() => o.options.map((e) => ({ ...e, id: C(e.value) }))
|
|
26
|
-
), p = Z({
|
|
27
|
-
get count() {
|
|
28
|
-
return o.options.length;
|
|
29
|
-
},
|
|
30
|
-
getScrollElement: () => s.value,
|
|
31
|
-
estimateSize: () => 42,
|
|
32
|
-
overscan: 5
|
|
33
|
-
}), L = (e) => {
|
|
34
|
-
e && p.value.measureElement(e);
|
|
35
|
-
}, O = m(() => p.value.getVirtualItems()), F = m(() => p.value.getTotalSize()), n = h(null), a = m(
|
|
36
|
-
() => o.open && o.options.some((e) => !e.disabled)
|
|
37
|
-
), y = (e = 1) => {
|
|
38
|
-
const l = f(n.value) ? -1 : n.value;
|
|
39
|
-
let t = (l + e) % o.options.length;
|
|
40
|
-
for (; o.options[t].disabled && t !== l; )
|
|
41
|
-
t = y(e + 1);
|
|
42
|
-
return t;
|
|
43
|
-
}, M = () => {
|
|
44
|
-
if (!a.value) return;
|
|
45
|
-
const e = y();
|
|
46
|
-
n.value = e, u();
|
|
47
|
-
}, I = (e = 1) => {
|
|
48
|
-
const l = f(n.value) ? 0 : n.value;
|
|
49
|
-
let t = (l - e + o.options.length) % o.options.length;
|
|
50
|
-
for (; o.options[t].disabled && t !== l; )
|
|
51
|
-
t = I(e + 1);
|
|
52
|
-
return t;
|
|
53
|
-
}, A = async () => {
|
|
54
|
-
if (!a.value) return;
|
|
55
|
-
const e = I();
|
|
56
|
-
n.value = e, u();
|
|
57
|
-
}, P = () => {
|
|
58
|
-
if (!a.value) return;
|
|
59
|
-
let e = 0;
|
|
60
|
-
for (; o.options[e].disabled; )
|
|
61
|
-
e++;
|
|
62
|
-
n.value = e, u();
|
|
63
|
-
}, R = () => {
|
|
64
|
-
if (!a.value) return;
|
|
65
|
-
let e = o.options.length - 1;
|
|
66
|
-
for (; o.options[e].disabled && e !== 0; )
|
|
67
|
-
e--;
|
|
68
|
-
n.value = e, u();
|
|
69
|
-
}, q = () => {
|
|
70
|
-
if (!a.value) return;
|
|
71
|
-
let e = 0;
|
|
72
|
-
for (; o.options[e] && !o.options[e].selected && o.options.length !== e; )
|
|
73
|
-
e++;
|
|
74
|
-
n.value = e % o.options.length, u();
|
|
75
|
-
}, J = () => {
|
|
76
|
-
if (!a.value) return;
|
|
77
|
-
let e = o.options.length - 1;
|
|
78
|
-
for (; o.options[e].selected && e > 0; )
|
|
79
|
-
e--;
|
|
80
|
-
n.value = e === -1 ? o.options.length - 1 : e, u();
|
|
81
|
-
}, W = (e) => {
|
|
82
|
-
if (!a.value) return;
|
|
83
|
-
const l = o.options.findIndex(
|
|
84
|
-
(t) => t.valueHash === e
|
|
85
|
-
);
|
|
86
|
-
l >= 0 && (n.value = l), u();
|
|
87
|
-
}, S = () => {
|
|
88
|
-
n.value = null;
|
|
89
|
-
}, u = () => {
|
|
90
|
-
s.value && ee(n.value) && p.value.scrollToIndex(n.value, {
|
|
91
|
-
align: "center",
|
|
92
|
-
behavior: "smooth"
|
|
93
|
-
});
|
|
94
|
-
}, k = () => {
|
|
95
|
-
if (f(n.value) || !o.open) return;
|
|
96
|
-
const e = o.options[n.value];
|
|
97
|
-
e.selected ? _("option:unselected", e) : _("option:selected", e);
|
|
98
|
-
}, w = h(0), z = () => {
|
|
99
|
-
s.value && (w.value = s.value.scrollHeight);
|
|
100
|
-
}, Y = (e) => !e.disabled, j = (e) => {
|
|
101
|
-
if (e.preventDefault(), s.value && e.target && e.target instanceof HTMLElement) {
|
|
102
|
-
if (!s.value.querySelector('[role="listbox"]'))
|
|
103
|
-
throw new Error("Could not find listbox in DOM tree.");
|
|
104
|
-
let t = e.target, d = t.dataset.index;
|
|
105
|
-
for (; f(d) && t.parentElement; )
|
|
106
|
-
t = t.parentElement, d = t.dataset.index;
|
|
107
|
-
if (d) {
|
|
108
|
-
const E = o.options[+d];
|
|
109
|
-
E && Y(E) && (n.value = +d, k());
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, G = () => f(n.value) ? void 0 : o.options[n.value];
|
|
113
|
-
return N(
|
|
114
|
-
() => o.open,
|
|
115
|
-
() => {
|
|
116
|
-
z();
|
|
117
|
-
},
|
|
118
|
-
{ flush: "post" }
|
|
119
|
-
), N(
|
|
120
|
-
() => o.options,
|
|
121
|
-
(e, l) => {
|
|
122
|
-
H(e.map((t) => t.valueHash)) !== H(l.map((t) => t.valueHash)) && (p.value.calculateRange(), z(), S());
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
flush: "post"
|
|
126
|
-
}
|
|
127
|
-
), V({
|
|
128
|
-
focusNext: M,
|
|
129
|
-
focusPrevious: A,
|
|
130
|
-
focusFirst: P,
|
|
131
|
-
focusFirstSelected: q,
|
|
132
|
-
focusLast: R,
|
|
133
|
-
focusLastSelected: J,
|
|
134
|
-
blur: S,
|
|
135
|
-
confirmOption: k,
|
|
136
|
-
focusByHash: W,
|
|
137
|
-
getHighlighted: G
|
|
138
|
-
}), (e, l) => (r(), c("div", {
|
|
139
|
-
class: $(["bb-listbox", {
|
|
140
|
-
"bb-listbox--open": e.open,
|
|
141
|
-
"bb-listbox--loading": e.loading,
|
|
142
|
-
"bb-listbox--no-data": !i.value.length
|
|
143
|
-
}]),
|
|
144
|
-
style: b({
|
|
145
|
-
"--transition-duration": `${e.transitionDuration}ms`,
|
|
146
|
-
"--overlay-min-height": `${w.value}px`
|
|
147
|
-
}),
|
|
148
|
-
onClick: Q(j, ["stop"])
|
|
149
|
-
}, [
|
|
150
|
-
x("div", te, [
|
|
151
|
-
x("div", {
|
|
152
|
-
ref_key: "inner",
|
|
153
|
-
ref: s,
|
|
154
|
-
class: "bb-listbox__inner-container"
|
|
155
|
-
}, [
|
|
156
|
-
v(e.$slots, "options:prepend"),
|
|
157
|
-
e.loading && !e.options.length ? (r(), c("div", oe, [
|
|
158
|
-
v(e.$slots, "loading", {}, () => [
|
|
159
|
-
D(g(e.loadingText), 1)
|
|
160
|
-
])
|
|
161
|
-
])) : e.options.length ? (r(), c("div", {
|
|
162
|
-
key: 2,
|
|
163
|
-
role: "listbox",
|
|
164
|
-
style: b({
|
|
165
|
-
height: `${F.value}px`
|
|
166
|
-
}),
|
|
167
|
-
tabindex: "-1"
|
|
168
|
-
}, [
|
|
169
|
-
(r(!0), c(U, null, X(O.value, (t, d) => (r(), c("div", {
|
|
170
|
-
key: i.value[t.index].value,
|
|
171
|
-
ref_for: !0,
|
|
172
|
-
ref: L,
|
|
173
|
-
"aria-selected": n.value === d ? !0 : void 0,
|
|
174
|
-
class: $({
|
|
175
|
-
"bb-listbox__option autocomplete-option": !0,
|
|
176
|
-
"autocomplete-option--focused": n.value === t.index,
|
|
177
|
-
"autocomplete-option--selected": i.value[t.index].selected,
|
|
178
|
-
"autocomplete-option--disabled": i.value[t.index].disabled
|
|
179
|
-
}),
|
|
180
|
-
"data-index": t.index,
|
|
181
|
-
role: "option",
|
|
182
|
-
style: b({
|
|
183
|
-
transform: `translateY(${t.start}px)`
|
|
184
|
-
})
|
|
185
|
-
}, [
|
|
186
|
-
x("span", ie, [
|
|
187
|
-
v(e.$slots, "option", {
|
|
188
|
-
disabled: !!i.value[t.index].disabled,
|
|
189
|
-
focused: n.value === t.index,
|
|
190
|
-
index: t.index,
|
|
191
|
-
item: i.value[t.index].item,
|
|
192
|
-
selected: !!i.value[t.index].selected,
|
|
193
|
-
text: i.value[t.index].text,
|
|
194
|
-
value: i.value[t.index].value
|
|
195
|
-
}, () => [
|
|
196
|
-
x("span", se, g(i.value[t.index].text), 1)
|
|
197
|
-
])
|
|
198
|
-
])
|
|
199
|
-
], 14, le))), 128))
|
|
200
|
-
], 4)) : (r(), c("div", ne, [
|
|
201
|
-
v(e.$slots, "no-data", {}, () => [
|
|
202
|
-
D(g(e.noDataText), 1)
|
|
203
|
-
])
|
|
204
|
-
])),
|
|
205
|
-
v(e.$slots, "options:append")
|
|
206
|
-
], 512)
|
|
207
|
-
])
|
|
208
|
-
], 6));
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
export {
|
|
212
|
-
pe as default
|
|
213
|
-
};
|
|
214
|
-
//# sourceMappingURL=index271.js.map
|
package/dist/index271.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index271.js","sources":["../src/components/ListBox.vue"],"sourcesContent":["<template>\n\t<div\n\t\tclass=\"bb-listbox\"\n\t\t:class=\"{\n\t\t\t'bb-listbox--open': open,\n\t\t\t'bb-listbox--loading': loading,\n\t\t\t'bb-listbox--no-data': !mappedOptions.length,\n\t\t}\"\n\t\t:style=\"{\n\t\t\t'--transition-duration': `${transitionDuration}ms`,\n\t\t\t'--overlay-min-height': `${height}px`,\n\t\t}\"\n\t\t@click.stop=\"handleClick\"\n\t>\n\t\t<div class=\"bb-listbox__outer-container\">\n\t\t\t<div ref=\"inner\" class=\"bb-listbox__inner-container\">\n\t\t\t\t<slot name=\"options:prepend\"></slot>\n\t\t\t\t<div v-if=\"loading && !options.length\" class=\"bb-listbox__loading\">\n\t\t\t\t\t<slot :name=\"'loading'\">{{ loadingText }}</slot>\n\t\t\t\t</div>\n\t\t\t\t<div v-else-if=\"!options.length\" class=\"bb-listbox__no-data\">\n\t\t\t\t\t<slot :name=\"'no-data'\">{{ noDataText }}</slot>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tv-else\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t:style=\"{\n\t\t\t\t\t\theight: `${totalSize}px`,\n\t\t\t\t\t}\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"(row, index) in virtualRows\"\n\t\t\t\t\t\t:key=\"mappedOptions[row.index].value\"\n\t\t\t\t\t\t:ref=\"measureElement\"\n\t\t\t\t\t\t:aria-selected=\"focusedIndex === index ? true : undefined\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-listbox__option autocomplete-option': true,\n\t\t\t\t\t\t\t'autocomplete-option--focused': focusedIndex === row.index,\n\t\t\t\t\t\t\t'autocomplete-option--selected':\n\t\t\t\t\t\t\t\tmappedOptions[row.index].selected,\n\t\t\t\t\t\t\t'autocomplete-option--disabled':\n\t\t\t\t\t\t\t\tmappedOptions[row.index].disabled,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:data-index=\"row.index\"\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t:style=\"{\n\t\t\t\t\t\t\ttransform: `translateY(${row.start}px)`,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"autocomplete-option__content\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:disabled=\"!!mappedOptions[row.index].disabled\"\n\t\t\t\t\t\t\t\t:focused=\"focusedIndex === row.index\"\n\t\t\t\t\t\t\t\t:index=\"row.index\"\n\t\t\t\t\t\t\t\t:item=\"mappedOptions[row.index].item\"\n\t\t\t\t\t\t\t\tname=\"option\"\n\t\t\t\t\t\t\t\t:selected=\"!!mappedOptions[row.index].selected\"\n\t\t\t\t\t\t\t\t:text=\"mappedOptions[row.index].text\"\n\t\t\t\t\t\t\t\t:value=\"mappedOptions[row.index].value\"\n\t\t\t\t\t\t\t\t><span class=\"autocomplete-option__label\">{{\n\t\t\t\t\t\t\t\t\tmappedOptions[row.index].text\n\t\t\t\t\t\t\t\t}}</span></slot\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<slot name=\"options:append\"></slot>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { isNil } from '@/utilities/functions/isNil';\nimport { computed, ref, watch } from 'vue';\nimport { useVirtualizer } from '@tanstack/vue-virtual';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport type { Option } from '@/types/Option';\nimport { hash } from '@/utilities/functions/hash';\n\ntype Props = {\n\toptions: Option[];\n\topen?: boolean;\n\tloading?: boolean;\n\ttransitionDuration?: number;\n\tloadingText?: string;\n\tnoDataText?: string;\n};\n\nconst props = withDefaults(defineProps<Props>(), {\n\ttransitionDuration: 250,\n\tloadingText: 'Caricamento...',\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<{\n\t(e: 'option:selected', option: Option): void;\n\t(e: 'option:unselected', option: Option): void;\n}>();\n\nconst inner = ref<HTMLElement | null>(null);\n\nconst makeStringID = (arg: any) =>\n\t'option_' + JSON.stringify(arg).replace(/\\W/g, '_');\n\nconst mappedOptions = computed(() =>\n\tprops.options.map((o) => {\n\t\treturn { ...o, id: makeStringID(o.value) };\n\t})\n);\n\nconst rowVirtualizer = useVirtualizer({\n\tget count() {\n\t\treturn props.options.length;\n\t},\n\tgetScrollElement: () => inner.value,\n\testimateSize: () => 42,\n\toverscan: 5,\n});\n\nconst measureElement = (el: HTMLElement) => {\n\tif (!el) {\n\t\treturn;\n\t}\n\trowVirtualizer.value.measureElement(el);\n\treturn undefined;\n};\n\nconst virtualRows = computed(() => rowVirtualizer.value.getVirtualItems());\nconst totalSize = computed(() => rowVirtualizer.value.getTotalSize());\n\n/**\n * START FOCUS HANDLING\n */\n\nconst focusedIndex = ref<null | number>(null);\n\nconst canFocus = computed(\n\t() => props.open && props.options.some((o) => !o.disabled)\n);\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\tscrollSelectedIntoView();\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\tscrollSelectedIntoView();\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\tscrollSelectedIntoView();\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\tscrollSelectedIntoView();\n};\nconst focusFirstSelected = () => {\n\tif (!canFocus.value) return;\n\tlet newIndex = 0;\n\twhile (\n\t\tprops.options[newIndex] &&\n\t\t!props.options[newIndex].selected &&\n\t\tprops.options.length !== newIndex\n\t) {\n\t\tnewIndex++;\n\t}\n\tfocusedIndex.value = newIndex % props.options.length;\n\tscrollSelectedIntoView();\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 === -1 ? props.options.length - 1 : newIndex;\n\tscrollSelectedIntoView();\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\tscrollSelectedIntoView();\n};\n\nconst blur = () => {\n\tfocusedIndex.value = null;\n};\n\nconst scrollSelectedIntoView = () => {\n\tif (inner.value && isNotNil(focusedIndex.value)) {\n\t\trowVirtualizer.value.scrollToIndex(focusedIndex.value, {\n\t\t\talign: 'center',\n\t\t\tbehavior: 'smooth',\n\t\t});\n\t}\n};\n\n/**\n * END FOCUS HANDLING\n */\n\nconst confirmOption = () => {\n\tif (isNil(focusedIndex.value) || !props.open) return;\n\tconst option = props.options[focusedIndex.value!];\n\tif (option.selected) {\n\t\temit('option:unselected', option);\n\t} else {\n\t\temit('option:selected', option);\n\t}\n};\n\nconst height = ref(0);\nconst getScrollHeight = () => {\n\tif (inner.value) {\n\t\theight.value = inner.value.scrollHeight;\n\t}\n};\n\nconst canBeSelected = (option: Option) => {\n\treturn !option.disabled;\n};\n\nconst handleClick = (event: MouseEvent) => {\n\tevent.preventDefault();\n\tif (inner.value && event.target && event.target instanceof HTMLElement) {\n\t\tconst listbox = inner.value.querySelector<HTMLElement>('[role=\"listbox\"]');\n\t\tif (!listbox) {\n\t\t\tthrow new Error('Could not find listbox in DOM tree.');\n\t\t}\n\t\tlet node: HTMLElement = event.target;\n\t\tlet index = node.dataset['index'];\n\t\twhile (isNil(index) && node.parentElement) {\n\t\t\tnode = node.parentElement;\n\t\t\tindex = node.dataset['index'];\n\t\t}\n\t\tif (index) {\n\t\t\tconst option = props.options[+index];\n\t\t\tif (option && canBeSelected(option)) {\n\t\t\t\tfocusedIndex.value = +index;\n\t\t\t\tconfirmOption();\n\t\t\t}\n\t\t}\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.open,\n\t() => {\n\t\tgetScrollHeight();\n\t},\n\t{ flush: 'post' }\n);\n\nwatch(\n\t() => props.options,\n\t(value, previous) => {\n\t\tif (\n\t\t\thash(value.map((o) => o.valueHash)) !==\n\t\t\thash(previous.map((o) => o.valueHash))\n\t\t) {\n\t\t\trowVirtualizer.value.calculateRange();\n\t\t\tgetScrollHeight();\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/ListBox';\n</style>\n"],"names":["props","__props","emit","__emit","inner","ref","makeStringID","arg","mappedOptions","computed","o","rowVirtualizer","useVirtualizer","measureElement","el","virtualRows","totalSize","focusedIndex","canFocus","findNextAvailableIndex","offset","initialValue","isNil","newIndex","focusNext","scrollSelectedIntoView","findPreviousAvailableIndex","focusPrevious","focusFirst","focusLast","focusFirstSelected","focusLastSelected","focusByHash","hash","linkedOptionIndex","blur","isNotNil","confirmOption","option","height","getScrollHeight","canBeSelected","handleClick","event","node","index","getHighlighted","watch","value","previous","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0FA,UAAMA,IAAQC,GAMRC,IAAOC,GAKPC,IAAQC,EAAwB,IAAI,GAEpCC,IAAe,CAACC,MACr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