bitboss-ui 0.2.21 → 0.2.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/components/BbDropzone/BbDropzone.vue.d.ts +2 -0
- package/dist/index101.js +3 -3
- package/dist/index103.js +2 -2
- package/dist/index109.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index111.js +4 -4
- package/dist/index113.js +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.js +1 -1
- package/dist/index121.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index131.js +2 -2
- package/dist/index15.js +7 -7
- package/dist/index17.js +8 -8
- package/dist/index19.js +3 -3
- package/dist/index196.js +378 -5
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +131 -13
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +5 -16
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +3 -3
- package/dist/index200.js +2 -20
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -29
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +174 -8
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +23 -2
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +373 -2
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +16 -4
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +16 -10
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +20 -2
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +27 -376
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +8 -134
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +2 -2
- package/dist/index210.js +3 -2
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +3 -174
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +2 -23
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +4 -373
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -3
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +235 -3
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +2 -235
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +2 -3
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +6 -35
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +10 -6
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +3 -9
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +32 -118
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +9 -2
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +121 -2
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +1 -1
- package/dist/index226.js +1 -1
- package/dist/index227.js +5 -294
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +2 -6
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +295 -2
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +1 -1
- package/dist/index230.js +2 -2
- package/dist/index232.js +117 -2
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +106 -2
- package/dist/index233.js.map +1 -1
- package/dist/index235.js +2 -2
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -4
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +2 -224
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +19 -53
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +258 -2
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +2 -117
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +4 -106
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +153 -426
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +2 -89
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +68 -199
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +2 -162
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +435 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +89 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +199 -68
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +2 -15
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +2 -2
- package/dist/index253.js +15 -2
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +2 -3
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +3 -2
- package/dist/index255.js.map +1 -1
- package/dist/index29.js +3 -3
- package/dist/index31.js +6 -6
- package/dist/index33.js +2 -2
- package/dist/index35.js +2 -2
- package/dist/index47.js +1 -1
- package/dist/index49.js +1 -1
- package/dist/index65.js +5 -5
- package/dist/index69.js +109 -103
- package/dist/index69.js.map +1 -1
- package/dist/index72.js +1 -1
- package/dist/index75.js +1 -1
- package/dist/index79.js +79 -67
- package/dist/index79.js.map +1 -1
- package/dist/index81.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index79.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { defineComponent as V, ref as a, computed as
|
|
2
|
-
import { useFloating as K, arrow as Q } from "./
|
|
3
|
-
import { useFocusTrap as X } from "./
|
|
1
|
+
import { defineComponent as V, ref as a, computed as _, openBlock as p, createElementBlock as h, mergeProps as B, createElementVNode as d, renderSlot as P, normalizeProps as I, guardReactiveProps as R, unref as g, createBlock as D, Teleport as U, normalizeClass as W, normalizeStyle as j, createCommentVNode as y, withCtx as G, nextTick as J } from "vue";
|
|
2
|
+
import { useFloating as K, arrow as Q } from "./index223.js";
|
|
3
|
+
import { useFocusTrap as X } from "./index221.js";
|
|
4
4
|
import { useId as Y } from "./index7.js";
|
|
5
5
|
import { wait as E } from "./index122.js";
|
|
6
6
|
import Z from "./index9.js";
|
|
7
7
|
import "./index10.js";
|
|
8
|
-
import { autoUpdate as ee, flip as oe, shift as te } from "./
|
|
9
|
-
import { offset as ae } from "./
|
|
10
|
-
const re = ["id"], ne = {
|
|
8
|
+
import { autoUpdate as ee, flip as oe, shift as te } from "./index196.js";
|
|
9
|
+
import { offset as ae } from "./index204.js";
|
|
10
|
+
const re = ["id"], ne = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "bb-popover__bubble"
|
|
13
|
+
}, se = /* @__PURE__ */ d("span", { class: "bb-popover__close-label" }, "Chiudi", -1), le = /* @__PURE__ */ d("svg", {
|
|
11
14
|
viewBox: "0 0 24 24",
|
|
12
15
|
fill: "none",
|
|
13
16
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14
17
|
}, [
|
|
15
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ d("path", {
|
|
16
19
|
d: "M23 23L1 1M23 1L1 23",
|
|
17
20
|
stroke: "currentColor",
|
|
18
21
|
"stroke-width": "2",
|
|
@@ -36,7 +39,7 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
36
39
|
},
|
|
37
40
|
emits: ["shown", "hidden"],
|
|
38
41
|
setup(M, { emit: N }) {
|
|
39
|
-
const o = M, i = N, { id: S } = Y(),
|
|
42
|
+
const o = M, i = N, { id: S } = Y(), b = `bbp_${S.value}`, s = a(), u = a(), k = a(), { activate: L, deactivate: O } = X(u, {
|
|
40
43
|
/**
|
|
41
44
|
* This traps all clicks outside so we are pressing
|
|
42
45
|
* the trigger we just allow and process that in its
|
|
@@ -45,21 +48,21 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
45
48
|
* close the popover and be done
|
|
46
49
|
*/
|
|
47
50
|
clickOutsideDeactivates: (e) => {
|
|
48
|
-
var
|
|
51
|
+
var T;
|
|
49
52
|
const t = e.target;
|
|
50
|
-
return t instanceof HTMLElement && (
|
|
53
|
+
return t instanceof HTMLElement && (T = s.value) != null && T.contains(t) || (f(), i("hidden")), !0;
|
|
51
54
|
},
|
|
52
55
|
escapeDeactivates: () => (J(async () => {
|
|
53
|
-
await
|
|
56
|
+
await f(), w(), i("hidden");
|
|
54
57
|
}), !0),
|
|
55
58
|
/* We don't return focus so that when
|
|
56
59
|
* we press a button on tyhe page we can focus
|
|
57
60
|
* THAT button and not the current trigger
|
|
58
61
|
*/
|
|
59
62
|
returnFocusOnDeactivate: !1
|
|
60
|
-
}), { floatingStyles:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
}), { floatingStyles: z, placement: v, middlewareData: $ } = K(
|
|
64
|
+
s,
|
|
65
|
+
u,
|
|
63
66
|
{
|
|
64
67
|
placement: o.placement,
|
|
65
68
|
whileElementsMounted: ee,
|
|
@@ -68,19 +71,19 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
68
71
|
ae(o.offset),
|
|
69
72
|
te({ padding: o.padding }),
|
|
70
73
|
Q({
|
|
71
|
-
element:
|
|
74
|
+
element: k,
|
|
72
75
|
padding: o.arrowPadding
|
|
73
76
|
})
|
|
74
77
|
]
|
|
75
78
|
}
|
|
76
|
-
),
|
|
79
|
+
), F = _(() => ({
|
|
77
80
|
class: {
|
|
78
81
|
"bb-popover--block": o.block,
|
|
79
82
|
[`bb-popover--theme-${o.theme}`]: o.theme
|
|
80
83
|
}
|
|
81
|
-
})), r = a(!1), n = a(!1),
|
|
82
|
-
if (
|
|
83
|
-
const { x: e, y: t } =
|
|
84
|
+
})), r = a(!1), n = a(!1), l = a(!1), c = a(!0), H = _(() => {
|
|
85
|
+
if ($.value.arrow) {
|
|
86
|
+
const { x: e, y: t } = $.value.arrow;
|
|
84
87
|
return {
|
|
85
88
|
style: {
|
|
86
89
|
left: `${e}px`,
|
|
@@ -88,110 +91,119 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
88
91
|
}
|
|
89
92
|
};
|
|
90
93
|
}
|
|
91
|
-
}),
|
|
94
|
+
}), q = _(() => {
|
|
92
95
|
const e = {
|
|
93
|
-
...
|
|
96
|
+
...z.value,
|
|
94
97
|
transitionDuration: `${o.transitionDuration}ms`
|
|
95
98
|
};
|
|
96
99
|
if (o.width) {
|
|
97
100
|
let t;
|
|
98
|
-
typeof o.width == "string" && Number.isNaN(Number(o.width))
|
|
101
|
+
if (typeof o.width == "string" && Number.isNaN(Number(o.width)))
|
|
102
|
+
if (o.width.includes("%")) {
|
|
103
|
+
if (!s.value)
|
|
104
|
+
return;
|
|
105
|
+
t = `${s.value.clientWidth * (+o.width.replace("%", "") / 100)}px`;
|
|
106
|
+
} else
|
|
107
|
+
t = o.width;
|
|
108
|
+
else
|
|
109
|
+
t = `${o.width}px`;
|
|
110
|
+
e.width = t;
|
|
99
111
|
}
|
|
100
112
|
return e;
|
|
101
|
-
}),
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
n.value = !1, r.value = !1,
|
|
105
|
-
},
|
|
113
|
+
}), x = async () => {
|
|
114
|
+
c.value = !1, l.value = !1, r.value = !0, await E(50), n.value = !0, r.value = !1;
|
|
115
|
+
}, f = async () => {
|
|
116
|
+
n.value = !1, r.value = !1, l.value = !0, await E(o.transitionDuration), l.value = !1, c.value = !0;
|
|
117
|
+
}, m = a(!1), A = async () => {
|
|
106
118
|
if (n.value) {
|
|
107
|
-
await
|
|
119
|
+
await f(), w(), i("hidden");
|
|
108
120
|
return;
|
|
109
121
|
}
|
|
110
122
|
if (r.value || o.disabled)
|
|
111
123
|
return;
|
|
112
|
-
|
|
124
|
+
m.value = !0, await x();
|
|
113
125
|
let e = o.focusTarget ?? ".bb-popover__close";
|
|
114
126
|
L({
|
|
115
127
|
onPostActivate: () => {
|
|
116
|
-
if (
|
|
117
|
-
const t =
|
|
128
|
+
if (u.value) {
|
|
129
|
+
const t = u.value.querySelector(e);
|
|
118
130
|
t instanceof HTMLElement && (t.focus(), i("shown"));
|
|
119
131
|
}
|
|
120
132
|
}
|
|
121
133
|
});
|
|
122
|
-
},
|
|
134
|
+
}, w = () => {
|
|
123
135
|
var t;
|
|
124
|
-
const e = (t =
|
|
136
|
+
const e = (t = s.value) == null ? void 0 : t.querySelector(`[aria-controls=popover_${b}]`);
|
|
125
137
|
e instanceof HTMLElement && e.focus();
|
|
126
|
-
},
|
|
127
|
-
O(), await
|
|
138
|
+
}, C = async () => {
|
|
139
|
+
O(), await f(), w(), i("hidden");
|
|
128
140
|
};
|
|
129
|
-
return (e, t) => (
|
|
130
|
-
|
|
141
|
+
return (e, t) => (p(), h("span", B({ class: "bb-popover" }, F.value), [
|
|
142
|
+
d("span", {
|
|
131
143
|
class: "bb-popover__wrapper",
|
|
132
144
|
ref_key: "wrapper",
|
|
133
|
-
ref:
|
|
145
|
+
ref: s
|
|
134
146
|
}, [
|
|
135
|
-
|
|
147
|
+
P(e.$slots, "activator", I(R({
|
|
136
148
|
props: {
|
|
137
|
-
"aria-controls": `popover_${
|
|
149
|
+
"aria-controls": `popover_${b}`,
|
|
138
150
|
"aria-expanded": n.value,
|
|
139
151
|
onClick: A,
|
|
140
|
-
id:
|
|
152
|
+
id: b,
|
|
141
153
|
disabled: !!e.disabled
|
|
142
154
|
},
|
|
143
|
-
closed:
|
|
144
|
-
closing:
|
|
155
|
+
closed: c.value,
|
|
156
|
+
closing: l.value,
|
|
145
157
|
disabled: !!e.disabled,
|
|
146
158
|
open: n.value,
|
|
147
159
|
opening: r.value,
|
|
148
|
-
placement:
|
|
160
|
+
placement: g(v)
|
|
149
161
|
})))
|
|
150
162
|
], 512),
|
|
151
|
-
(
|
|
152
|
-
|
|
153
|
-
key: 0,
|
|
163
|
+
(p(), D(U, { to: "body" }, [
|
|
164
|
+
d("span", {
|
|
154
165
|
class: W(["bb-popover__bubble-container", {
|
|
155
|
-
[`bb-popover__bubble-container--${
|
|
166
|
+
[`bb-popover__bubble-container--${g(v)}`]: !0,
|
|
156
167
|
[`bb-popover__bubble-container--${e.theme}`]: e.theme,
|
|
157
|
-
"bb-popover__bubble-container--hidden":
|
|
158
|
-
"bb-popover__bubble-container--closing":
|
|
168
|
+
"bb-popover__bubble-container--hidden": c.value,
|
|
169
|
+
"bb-popover__bubble-container--closing": l.value,
|
|
159
170
|
"bb-popover__bubble-container--opening": r.value,
|
|
160
171
|
"bb-popover__bubble-container--open": n.value
|
|
161
172
|
}]),
|
|
162
173
|
ref_key: "content",
|
|
163
|
-
ref:
|
|
164
|
-
style: j(
|
|
165
|
-
id: `popover_${
|
|
174
|
+
ref: u,
|
|
175
|
+
style: j(q.value),
|
|
176
|
+
id: `popover_${b}`
|
|
166
177
|
}, [
|
|
167
|
-
|
|
178
|
+
m.value || e.eager ? (p(), h("span", B({
|
|
179
|
+
key: 0,
|
|
168
180
|
class: "bb-popover__arrow",
|
|
169
181
|
ref_key: "bubblearrow",
|
|
170
|
-
ref:
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
e.showClose ? (
|
|
182
|
+
ref: k
|
|
183
|
+
}, H.value), null, 16)) : y("", !0),
|
|
184
|
+
m.value || e.eager ? (p(), h("span", ne, [
|
|
185
|
+
e.showClose ? (p(), D(Z, {
|
|
174
186
|
key: 0,
|
|
175
187
|
class: "bb-popover__close",
|
|
176
|
-
onClick:
|
|
188
|
+
onClick: C
|
|
177
189
|
}, {
|
|
178
190
|
default: G(() => [
|
|
179
191
|
se,
|
|
180
192
|
le
|
|
181
193
|
]),
|
|
182
194
|
_: 1
|
|
183
|
-
})) :
|
|
184
|
-
|
|
185
|
-
close:
|
|
186
|
-
closed:
|
|
187
|
-
closing:
|
|
195
|
+
})) : y("", !0),
|
|
196
|
+
P(e.$slots, "default", {
|
|
197
|
+
close: C,
|
|
198
|
+
closed: c.value,
|
|
199
|
+
closing: l.value,
|
|
188
200
|
disabled: !!e.disabled,
|
|
189
201
|
open: n.value,
|
|
190
202
|
opening: r.value,
|
|
191
|
-
placement:
|
|
203
|
+
placement: g(v)
|
|
192
204
|
})
|
|
193
|
-
])
|
|
194
|
-
], 14, re)
|
|
205
|
+
])) : y("", !0)
|
|
206
|
+
], 14, re)
|
|
195
207
|
]))
|
|
196
208
|
], 16));
|
|
197
209
|
}
|
package/dist/index79.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index79.js","sources":["../src/components/BbPopover/BbPopover.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport } from \"vue\"\n\nconst _hoisted_1 = [\"id\"]\nconst _hoisted_2 = { class: \"bb-popover__bubble\" }\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-popover__close-label\" }, \"Chiudi\", -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n], -1)\n\nimport { computed, nextTick, ref } from \"vue\";\nimport {\n useFloating,\n autoUpdate,\n flip,\n shift,\n offset,\n arrow,\n} from \"@floating-ui/vue\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\nimport type { Placement } from \"@floating-ui/vue\";\n\nexport type BbPopoverProps = Pick<\n CommonProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"offset\"\n | \"padding\"\n | \"placement\"\n | \"showClose\"\n | \"theme\"\n | \"transitionDuration\"\n> & {\n /**\n * Elements that obtains focus immediately after opening the popover.\n * By default it's the first tabbable item.\n */\n focusTarget?: string;\n /**\n * Width of the dropdown in pixels.\n */\n width?: number | string;\n};\n\nexport type BbPopoverEvents = {\n (e: \"shown\"): void;\n (e: \"hidden\"): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbPopover',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n offset: { default: 3 },\n padding: { default: 10 },\n placement: { default: \"bottom\" },\n showClose: { type: Boolean, default: true },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 },\n focusTarget: {},\n width: {}\n },\n emits: [\"shown\", \"hidden\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst { id: _id } = useId();\nconst id = `bbp_${_id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { activate, deactivate } = useFocusTrap(content, {\n /**\n * This traps all clicks outside so we are pressing\n * the trigger we just allow and process that in its\n * own click handler.\n * If we are pressing anything random on the page\n * close the popover and be done\n */\n clickOutsideDeactivates: (event) => {\n const target = event.target;\n if (target instanceof HTMLElement) {\n if (wrapper.value?.contains(target)) {\n return true;\n }\n }\n closePopover();\n emit(\"hidden\");\n return true;\n },\n escapeDeactivates: () => {\n nextTick(async () => {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n });\n return true;\n },\n /* We don't return focus so that when\n * we press a button on tyhe page we can focus\n * THAT button and not the current trigger\n */\n returnFocusOnDeactivate: false,\n});\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n wrapper,\n content,\n {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [\n flip(),\n offset(props.offset),\n shift({ padding: props.padding }),\n arrow({\n element: bubblearrow,\n padding: props.arrowPadding,\n }),\n ],\n }\n);\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-popover--block\": props.block,\n [`bb-popover--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n if (middlewareData.value.arrow) {\n const { x, y } = middlewareData.value.arrow;\n return {\n style: {\n left: `${x}px`,\n top: `${y}px`,\n },\n };\n }\n});\n\nconst containerStyle = computed(() => {\n const base: Record<string, any> = {\n ...floatingStyles.value,\n transitionDuration: `${props.transitionDuration}ms`,\n };\n if (props.width) {\n let width: string;\n // If the width is a css unit string use it, if it is a number or number string add px\n if (typeof props.width === \"string\" && Number.isNaN(Number(props.width))) {\n if (props.width.includes(\"%\")) {\n width = `${\n wrapper.value!.clientWidth * (+props.width.replace(\"%\", \"\") / 100)\n }px`;\n } else {\n width = props.width;\n }\n } else {\n width = `${props.width}px`;\n }\n base.width = width;\n }\n return base;\n});\n\nconst openPopover = async () => {\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n};\n\nconst closePopover = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n};\nconst hasOpenedOnce = ref(false);\nconst onTriggerClick = async () => {\n if (open.value) {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n return;\n }\n if (opening.value || props.disabled) return;\n hasOpenedOnce.value = true;\n await openPopover();\n let focusTarget = props.focusTarget ?? \".bb-popover__close\";\n\n activate({\n onPostActivate: () => {\n if (content.value) {\n const target = content.value.querySelector(focusTarget);\n if (target instanceof HTMLElement) {\n target.focus();\n emit(\"shown\");\n }\n }\n },\n });\n};\n\nconst focusTrigger = () => {\n const trigger = wrapper.value?.querySelector(`[aria-controls=popover_${id}]`);\n if (trigger instanceof HTMLElement) {\n trigger.focus();\n }\n};\n\nconst onClickClose = async () => {\n deactivate();\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-popover\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-popover__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-controls': `popover_${id}`,\n 'aria-expanded': open.value,\n onClick: onTriggerClick,\n id: id,\n disabled: !!_ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: _normalizeClass([\"bb-popover__bubble-container\", {\n [`bb-popover__bubble-container--${_unref(placement)}`]: true,\n [`bb-popover__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-popover__bubble-container--hidden': closed.value,\n 'bb-popover__bubble-container--closing': closing.value,\n 'bb-popover__bubble-container--opening': opening.value,\n 'bb-popover__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle(containerStyle.value),\n id: `popover_${id}`\n }, [\n _createElementVNode(\"span\", _mergeProps({\n class: \"bb-popover__arrow\",\n ref_key: \"bubblearrow\",\n ref: bubblearrow\n }, arrowAttributes.value), null, 16),\n _createElementVNode(\"span\", _hoisted_2, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n class: \"bb-popover__close\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_3,\n _hoisted_4\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\", {\n close: onClickClose,\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement)\n })\n ])\n ], 14, _hoisted_1))\n : _createCommentVNode(\"\", true)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","_id","useId","id","wrapper","ref","content","bubblearrow","activate","deactivate","useFocusTrap","event","target","_a","closePopover","nextTick","focusTrigger","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","offset","shift","arrow","attributes","computed","opening","open","closing","closed","arrowAttributes","x","y","containerStyle","base","width","openPopover","wait","hasOpenedOnce","onTriggerClick","focusTarget","trigger","onClickClose","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","BaseButton","_withCtx","_createCommentVNode"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,CAAC,IAAI,GAClBC,KAAa,EAAE,OAAO,wBACtBC,uBAA8C,QAAQ,EAAE,OAAO,6BAA6B,UAAU,EAAE,GACxGC,uBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EAAA,CACnB;AACH,GAAG,EAAE,GAgDuBC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,GAAG;AAAA,IAC5B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,QAAQ,EAAE,SAAS,EAAE;AAAA,IACrB,SAAS,EAAE,SAAS,GAAG;AAAA,IACvB,WAAW,EAAE,SAAS,SAAS;AAAA,IAC/B,WAAW,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC1C,OAAO,EAAE,SAAS,UAAU;AAAA,IAC5B,oBAAoB,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;AAAA,cAClC,OAAOD;AAAA,cACP,QAAQb,EAAO;AAAA,cACf,SAASD,EAAQ;AAAA,cACjB,UAAU,CAAC,CAACe,EAAK;AAAA,cACjB,MAAMhB,EAAK;AAAA,cACX,SAASD,EAAQ;AAAA,cACjB,WAAW0B,EAAOpC,CAAS;AAAA,YAAA,CAC5B;AAAA,UAAA,CACF;AAAA,WACA,IAAI3B,EAAU,KACjBsE,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index79.js","sources":["../src/components/BbPopover/BbPopover.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, withCtx as _withCtx, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport } from \"vue\"\n\nconst _hoisted_1 = [\"id\"]\nconst _hoisted_2 = {\n key: 1,\n class: \"bb-popover__bubble\"\n}\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-popover__close-label\" }, \"Chiudi\", -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n], -1)\n\nimport { computed, nextTick, ref } from \"vue\";\nimport {\n useFloating,\n autoUpdate,\n flip,\n shift,\n offset,\n arrow,\n} from \"@floating-ui/vue\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\nimport type { Placement } from \"@floating-ui/vue\";\n\nexport type BbPopoverProps = Pick<\n CommonProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"offset\"\n | \"padding\"\n | \"placement\"\n | \"showClose\"\n | \"theme\"\n | \"transitionDuration\"\n> & {\n /**\n * Elements that obtains focus immediately after opening the popover.\n * By default it's the first tabbable item.\n */\n focusTarget?: string;\n /**\n * Width of the dropdown in pixels.\n */\n width?: number | string;\n};\n\nexport type BbPopoverEvents = {\n (e: \"shown\"): void;\n (e: \"hidden\"): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbPopover',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n offset: { default: 3 },\n padding: { default: 10 },\n placement: { default: \"bottom\" },\n showClose: { type: Boolean, default: true },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 },\n focusTarget: {},\n width: {}\n },\n emits: [\"shown\", \"hidden\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst { id: _id } = useId();\nconst id = `bbp_${_id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { activate, deactivate } = useFocusTrap(content, {\n /**\n * This traps all clicks outside so we are pressing\n * the trigger we just allow and process that in its\n * own click handler.\n * If we are pressing anything random on the page\n * close the popover and be done\n */\n clickOutsideDeactivates: (event) => {\n const target = event.target;\n if (target instanceof HTMLElement) {\n if (wrapper.value?.contains(target)) {\n return true;\n }\n }\n closePopover();\n emit(\"hidden\");\n return true;\n },\n escapeDeactivates: () => {\n nextTick(async () => {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n });\n return true;\n },\n /* We don't return focus so that when\n * we press a button on tyhe page we can focus\n * THAT button and not the current trigger\n */\n returnFocusOnDeactivate: false,\n});\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n wrapper,\n content,\n {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [\n flip(),\n offset(props.offset),\n shift({ padding: props.padding }),\n arrow({\n element: bubblearrow,\n padding: props.arrowPadding,\n }),\n ],\n }\n);\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-popover--block\": props.block,\n [`bb-popover--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n if (middlewareData.value.arrow) {\n const { x, y } = middlewareData.value.arrow;\n return {\n style: {\n left: `${x}px`,\n top: `${y}px`,\n },\n };\n }\n});\n\nconst containerStyle = computed(() => {\n const base: Record<string, any> = {\n ...floatingStyles.value,\n transitionDuration: `${props.transitionDuration}ms`,\n };\n if (props.width) {\n let width: string;\n // If the width is a css unit string use it, if it is a number or number string add px\n if (typeof props.width === \"string\" && Number.isNaN(Number(props.width))) {\n if (props.width.includes(\"%\")) {\n if (!wrapper.value) return;\n width = `${\n wrapper.value.clientWidth * (+props.width.replace(\"%\", \"\") / 100)\n }px`;\n } else {\n width = props.width;\n }\n } else {\n width = `${props.width}px`;\n }\n base.width = width;\n }\n return base;\n});\n\nconst openPopover = async () => {\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n};\n\nconst closePopover = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n};\nconst hasOpenedOnce = ref(false);\nconst onTriggerClick = async () => {\n if (open.value) {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n return;\n }\n if (opening.value || props.disabled) return;\n hasOpenedOnce.value = true;\n await openPopover();\n let focusTarget = props.focusTarget ?? \".bb-popover__close\";\n\n activate({\n onPostActivate: () => {\n if (content.value) {\n const target = content.value.querySelector(focusTarget);\n if (target instanceof HTMLElement) {\n target.focus();\n emit(\"shown\");\n }\n }\n },\n });\n};\n\nconst focusTrigger = () => {\n const trigger = wrapper.value?.querySelector(`[aria-controls=popover_${id}]`);\n if (trigger instanceof HTMLElement) {\n trigger.focus();\n }\n};\n\nconst onClickClose = async () => {\n deactivate();\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-popover\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-popover__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-controls': `popover_${id}`,\n 'aria-expanded': open.value,\n onClick: onTriggerClick,\n id: id,\n disabled: !!_ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bb-popover__bubble-container\", {\n [`bb-popover__bubble-container--${_unref(placement)}`]: true,\n [`bb-popover__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-popover__bubble-container--hidden': closed.value,\n 'bb-popover__bubble-container--closing': closing.value,\n 'bb-popover__bubble-container--opening': opening.value,\n 'bb-popover__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle(containerStyle.value),\n id: `popover_${id}`\n }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", _mergeProps({\n key: 0,\n class: \"bb-popover__arrow\",\n ref_key: \"bubblearrow\",\n ref: bubblearrow\n }, arrowAttributes.value), null, 16))\n : _createCommentVNode(\"\", true),\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_2, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n class: \"bb-popover__close\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_3,\n _hoisted_4\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\", {\n close: onClickClose,\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement)\n })\n ]))\n : _createCommentVNode(\"\", true)\n ], 14, _hoisted_1)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","_id","useId","id","wrapper","ref","content","bubblearrow","activate","deactivate","useFocusTrap","event","target","_a","closePopover","nextTick","focusTrigger","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","offset","shift","arrow","attributes","computed","opening","open","closing","closed","arrowAttributes","x","y","containerStyle","base","width","openPopover","wait","hasOpenedOnce","onTriggerClick","focusTarget","trigger","onClickClose","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","_createCommentVNode","BaseButton","_withCtx"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,CAAC,IAAI,GAClBC,KAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,uBAA8C,QAAQ,EAAE,OAAO,6BAA6B,UAAU,EAAE,GACxGC,uBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,gBAA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,KAAK;AAAA,UAC3C,IAAI,WAAWhC,CAAE;AAAA,QAAA,GAChB;AAAA,UACAqC,EAAc,SAASK,EAAK,SACxBE,KAAcC,EAAoB,QAAQC,EAAY;AAAA,YACrD,KAAK;AAAA,YACL,OAAO;AAAA,YACP,SAAS;AAAA,YACT,KAAK1C;AAAA,UAAA,GACJyB,EAAgB,KAAK,GAAG,MAAM,EAAE,KACnC2B,EAAoB,IAAI,EAAI;AAAA,UAC/BnB,EAAc,SAASK,EAAK,SACxBE,KAAcC,EAAoB,QAAQxD,IAAY;AAAA,YACpDqD,EAAK,aACDE,KAAcQ,EAAaK,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,OAAO;AAAA,cACP,SAAShB;AAAA,YAAA,GACR;AAAA,cACD,SAASiB,EAAS,MAAM;AAAA,gBACtBpE;AAAA,gBACAC;AAAA,cAAA,CACD;AAAA,cACD,GAAG;AAAA,YAAA,CACJ,KACDiE,EAAoB,IAAI,EAAI;AAAA,YAChCR,EAAYN,EAAK,QAAQ,WAAW;AAAA,cAClC,OAAOD;AAAA,cACP,QAAQb,EAAO;AAAA,cACf,SAASD,EAAQ;AAAA,cACjB,UAAU,CAAC,CAACe,EAAK;AAAA,cACjB,MAAMhB,EAAK;AAAA,cACX,SAASD,EAAQ;AAAA,cACjB,WAAW0B,EAAOpC,CAAS;AAAA,YAAA,CAC5B;AAAA,UAAA,CACF,KACDyC,EAAoB,IAAI,EAAI;AAAA,QAAA,GAC/B,IAAIpE,EAAU;AAAA,MAAA,CAClB;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
|
package/dist/index81.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as a, computed as l, openBlock as s, createElementBlock as n, normalizeClass as m, createElementVNode as i, normalizeStyle as c } from "vue";
|
|
2
|
-
import { clamp as p } from "./
|
|
2
|
+
import { clamp as p } from "./index214.js";
|
|
3
3
|
import { getAsPercentageBetween as d } from "./index121.js";
|
|
4
4
|
const v = /* @__PURE__ */ a({
|
|
5
5
|
__name: "BbProgress",
|