bitboss-ui 0.1.2 → 0.1.4
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/BaseDatePicker/BaseDatePicker.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +151 -0
- package/dist/components/BbPopover/BbPopover.vue.d.ts +96 -0
- package/dist/components/BbRatio/BbRatio.vue.d.ts +12 -0
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +104 -98
- package/dist/index.js.map +1 -1
- package/dist/index10.js +123 -95
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +43 -3
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +2 -2
- package/dist/index102.js +2 -2
- package/dist/index103.js +2 -2
- package/dist/index104.js +2 -2
- package/dist/index105.js +2 -2
- package/dist/index106.js +2 -2
- package/dist/index107.js +2 -2
- package/dist/index108.js +2 -2
- package/dist/index109.js +2 -2
- package/dist/index110.js +2 -2
- package/dist/index111.js +2 -2
- package/dist/index112.js +2 -2
- package/dist/index113.js +2 -2
- package/dist/index114.js +2 -2
- package/dist/index115.js +2 -2
- package/dist/index116.js +2 -2
- package/dist/index117.js +2 -2
- package/dist/index118.js +2 -2
- package/dist/index119.js +3 -2
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +4 -4
- package/dist/index120.js +2 -2
- package/dist/index121.js +3 -2
- package/dist/index121.js.map +1 -1
- package/dist/index123.js +2 -2
- package/dist/index124.js +2 -3
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index126.js +2 -3
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index128.js +2 -2
- package/dist/index129.js +3 -2
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +2 -2
- package/dist/index131.js +2 -2
- package/dist/index132.js +2 -2
- package/dist/index133.js +2 -2
- package/dist/index134.js +2 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index136.js +2 -2
- package/dist/index137.js +2 -2
- package/dist/index138.js +2 -2
- package/dist/index139.js +2 -2
- package/dist/index14.js +6 -6
- package/dist/index140.js +3 -2
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +2 -2
- package/dist/index142.js +3 -2
- package/dist/index142.js.map +1 -1
- package/dist/index145.js +2 -2
- package/dist/index146.js +2 -3
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +2 -2
- package/dist/index148.js +2 -3
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +2 -2
- package/dist/index150.js +2 -2
- package/dist/index151.js +3 -2
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +3 -4
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +3 -8
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +3 -2
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +3 -2
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +3 -5
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +348 -17
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +131 -17
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +5 -29
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +1 -1
- package/dist/index160.js +19 -2
- package/dist/index160.js.map +1 -1
- package/dist/index162.js +2 -2
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +184 -14
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +2 -13
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +23 -2
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +328 -3
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +16 -2
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +12 -5
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +2 -350
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +2 -134
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +2 -186
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +4 -23
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +8 -328
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +20 -2
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +29 -21
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +2 -3
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +3 -3
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +6 -38
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +2 -28
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +2 -2
- package/dist/index180.js +2 -13
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +20 -8
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +3 -96
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +3 -4
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +38 -295
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +9 -6
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +96 -2
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +28 -2
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +13 -2
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +6 -2
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +2 -235
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +294 -88
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +2 -2
- package/dist/index193.js +2 -117
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +111 -100
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +105 -78
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +4 -224
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +226 -249
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +2 -38
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +2 -2
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +4 -4
- package/dist/index200.js +89 -2
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +79 -2
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +49 -8
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +223 -5
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +261 -0
- package/dist/index204.js.map +1 -0
- package/dist/index205.js +41 -0
- package/dist/index205.js.map +1 -0
- package/dist/index206.js +5 -0
- package/dist/index206.js.map +1 -0
- package/dist/index207.js +5 -0
- package/dist/index207.js.map +1 -0
- package/dist/index208.js +12 -0
- package/dist/index208.js.map +1 -0
- package/dist/index209.js +9 -0
- package/dist/index209.js.map +1 -0
- package/dist/index210.js +5 -0
- package/dist/index210.js.map +1 -0
- package/dist/index211.js +14 -0
- package/dist/index211.js.map +1 -0
- package/dist/index212.js +434 -0
- package/dist/index212.js.map +1 -0
- package/dist/index213.js +12 -0
- package/dist/index213.js.map +1 -0
- package/dist/index214.js +203 -0
- package/dist/index214.js.map +1 -0
- package/dist/index22.js +14 -14
- package/dist/index24.js +4 -4
- package/dist/index26.js +2 -2
- package/dist/index28.js +4 -4
- package/dist/index34.js +2 -2
- package/dist/index36.js +50 -37
- package/dist/index36.js.map +1 -1
- package/dist/index38.js +39 -39
- package/dist/index38.js.map +1 -1
- package/dist/index4.js +2 -2
- package/dist/index40.js +36 -82
- package/dist/index40.js.map +1 -1
- package/dist/index42.js +44 -57
- package/dist/index42.js.map +1 -1
- package/dist/index44.js +98 -79
- package/dist/index44.js.map +1 -1
- package/dist/index46.js +79 -81
- package/dist/index46.js.map +1 -1
- package/dist/index48.js +80 -40
- package/dist/index48.js.map +1 -1
- package/dist/index50.js +40 -283
- package/dist/index50.js.map +1 -1
- package/dist/index52.js +279 -95
- package/dist/index52.js.map +1 -1
- package/dist/index54.js +98 -212
- package/dist/index54.js.map +1 -1
- package/dist/index56.js +213 -44
- package/dist/index56.js.map +1 -1
- package/dist/index58.js +45 -40
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +2 -96
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +4 -4
- package/dist/index60.js +44 -2
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +89 -211
- package/dist/index61.js.map +1 -1
- package/dist/index63.js +210 -130
- package/dist/index63.js.map +1 -1
- package/dist/index65.js +134 -18
- package/dist/index65.js.map +1 -1
- package/dist/index67.js +145 -74
- package/dist/index67.js.map +1 -1
- package/dist/index69.js +18 -98
- package/dist/index69.js.map +1 -1
- package/dist/index71.js +77 -17
- package/dist/index71.js.map +1 -1
- package/dist/index73.js +48 -66
- package/dist/index73.js.map +1 -1
- package/dist/index75.js +21 -78
- package/dist/index75.js.map +1 -1
- package/dist/index77.js +77 -46
- package/dist/index77.js.map +1 -1
- package/dist/index79.js +44 -61
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +188 -181
- package/dist/index8.js.map +1 -1
- package/dist/index81.js +82 -106
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +88 -370
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +106 -74
- package/dist/index85.js.map +1 -1
- package/dist/index87.js +371 -68
- package/dist/index87.js.map +1 -1
- package/dist/index89.js +75 -111
- package/dist/index89.js.map +1 -1
- package/dist/index91.js +76 -87
- package/dist/index91.js.map +1 -1
- package/dist/index93.js +111 -32
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +2 -37
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +87 -42
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +2 -43
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +38 -3
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +37 -3
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +47 -3
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index10.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { autoUpdate as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { identity as
|
|
7
|
-
import { last as
|
|
8
|
-
import { vMaska as
|
|
9
|
-
import { wait as
|
|
10
|
-
import
|
|
1
|
+
import { defineComponent as q, ref as o, computed as S, watch as z, onMounted as N, onBeforeUnmount as R, openBlock as Y, createElementBlock as J, normalizeClass as $, renderSlot as u, createElementVNode as v, withDirectives as Q, mergeProps as B, unref as X, toDisplayString as Z, createBlock as x, Teleport as ee, createVNode as ae, createSlots as te, renderList as ne, withCtx as oe, normalizeProps as le, guardReactiveProps as re } from "vue";
|
|
2
|
+
import { autoUpdate as se, computePosition as ie } from "./index157.js";
|
|
3
|
+
import ue from "./index158.js";
|
|
4
|
+
import d from "./index159.js";
|
|
5
|
+
import de from "./index160.js";
|
|
6
|
+
import { identity as ce } from "./index161.js";
|
|
7
|
+
import { last as fe } from "./index162.js";
|
|
8
|
+
import { vMaska as pe } from "./index163.js";
|
|
9
|
+
import { wait as C } from "./index164.js";
|
|
10
|
+
import me from "./index8.js";
|
|
11
11
|
import "./index9.js";
|
|
12
|
-
import
|
|
13
|
-
import { offset as
|
|
14
|
-
const
|
|
12
|
+
import T from "./index165.js";
|
|
13
|
+
import { offset as be, flip as ve, shift as ye } from "./index166.js";
|
|
14
|
+
const ke = ["autocomplete", "autofocus", "disabled", "id", "name", "placeholder", "readonly", "value", "aria-describedby"], ge = ["id"], Ce = /* @__PURE__ */ q({
|
|
15
15
|
__name: "BaseDatePickerInput",
|
|
16
16
|
props: {
|
|
17
17
|
autocomplete: { default: "off" },
|
|
@@ -28,92 +28,111 @@ const fe = ["autocomplete", "autofocus", "disabled", "id", "name", "placeholder"
|
|
|
28
28
|
width: { default: 290 }
|
|
29
29
|
},
|
|
30
30
|
emits: ["update:modelValue", "inactive"],
|
|
31
|
-
setup(
|
|
32
|
-
const l =
|
|
33
|
-
|
|
34
|
-
const
|
|
31
|
+
setup(O, { emit: i }) {
|
|
32
|
+
const l = O;
|
|
33
|
+
d.extend(ue), d.locale(de);
|
|
34
|
+
const t = o(null), y = o(null), s = o(null), w = o(null), c = o(null), D = o(), P = S(() => ({
|
|
35
35
|
"bb-base-date-picker-input": !0,
|
|
36
36
|
"bb-base-date-picker-input--errors": l.hasErrors,
|
|
37
37
|
"bb-base-date-picker-input--readonly": l.readonly,
|
|
38
38
|
"bb-base-date-picker-input--disabled": l.disabled
|
|
39
|
-
})),
|
|
39
|
+
})), F = {
|
|
40
40
|
onInput: (e) => {
|
|
41
|
-
l.range || e.target instanceof HTMLInputElement && (
|
|
41
|
+
l.range || e.target instanceof HTMLInputElement && (c.value = e.target.value, /\d{2}\/\d{2}\/\d{4}/.test(e.target.value) ? i(
|
|
42
42
|
"update:modelValue",
|
|
43
|
-
|
|
44
|
-
) : e.target.value === "" &&
|
|
43
|
+
d(e.target.value, "DD/MM/YYYY").toISOString()
|
|
44
|
+
) : e.target.value === "" && i("update:modelValue", null));
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, k = o(!1), A = (e) => {
|
|
47
47
|
if (e)
|
|
48
48
|
if (Array.isArray(e)) {
|
|
49
|
-
let
|
|
50
|
-
return e.length && (
|
|
49
|
+
let a, n;
|
|
50
|
+
return e.length && (a = e[0]), e.length > 1 && (n = fe(e)), [a, n].filter(ce).map((r) => d(r).format("DD/MM/YYYY")).join(" - ");
|
|
51
51
|
} else
|
|
52
|
-
return
|
|
52
|
+
return d(e).format("DD/MM/YYYY");
|
|
53
53
|
return null;
|
|
54
|
-
},
|
|
55
|
-
|
|
54
|
+
}, G = S(() => c.value ? c.value : A(l.modelValue));
|
|
55
|
+
z(
|
|
56
56
|
() => l.modelValue,
|
|
57
57
|
(e) => {
|
|
58
|
-
|
|
58
|
+
c.value = A(e);
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
|
-
const
|
|
62
|
-
|
|
61
|
+
const I = () => {
|
|
62
|
+
s.value && t.value && ie(s.value, t.value, {
|
|
63
63
|
placement: "bottom-start",
|
|
64
|
-
middleware: [
|
|
64
|
+
middleware: [be(6), ve(), ye()]
|
|
65
65
|
}).then((e) => {
|
|
66
|
-
var
|
|
67
|
-
|
|
66
|
+
var a;
|
|
67
|
+
t.value && (t.value.style.left = `${e.x}px`, t.value.style.top = `${e.y}px`, t.value.style.width = `${(a = s.value) == null ? void 0 : a.offsetWidth}px`);
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
let _;
|
|
71
|
+
N(async () => {
|
|
72
|
+
s.value && t.value && (_ = se(
|
|
73
|
+
s.value,
|
|
74
|
+
t.value,
|
|
75
|
+
I
|
|
76
76
|
));
|
|
77
|
-
}),
|
|
78
|
-
|
|
77
|
+
}), R(() => {
|
|
78
|
+
_();
|
|
79
79
|
});
|
|
80
|
-
const
|
|
81
|
-
p.value = !1,
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
80
|
+
const f = o(!1), g = o(!1), h = o(!1), p = o(!0), H = async () => {
|
|
81
|
+
p.value = !1, g.value = !0, await C(500), g.value = !1, p.value = !1, f.value = !0;
|
|
82
|
+
}, L = async () => {
|
|
83
|
+
var e;
|
|
84
|
+
f.value = !1, h.value = !0, await C(500), h.value = !1, f.value = !1, p.value = !0, (e = D.value) == null || e.setSelectionModeToDay();
|
|
85
|
+
}, K = (e) => {
|
|
86
|
+
if (e.key === "Tab" && !e.shiftKey && (e.preventDefault(), t.value)) {
|
|
87
|
+
const n = t.value.querySelectorAll(
|
|
88
|
+
T.join()
|
|
89
|
+
)[0];
|
|
90
|
+
n instanceof HTMLElement && n.focus();
|
|
92
91
|
}
|
|
93
|
-
}, U = () => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
}, U = (e) => {
|
|
93
|
+
var a;
|
|
94
|
+
if (e.key === "Tab" && t.value) {
|
|
95
|
+
const n = T.join(", "), r = t.value.querySelectorAll(
|
|
96
|
+
n
|
|
97
|
+
);
|
|
98
|
+
if (e.target === r[r.length - 1]) {
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
const m = Array.from(
|
|
101
|
+
document.body.querySelectorAll(n)
|
|
102
|
+
), V = m.findIndex(
|
|
103
|
+
(b) => b.id === l.id
|
|
104
|
+
);
|
|
105
|
+
if (V > -1) {
|
|
106
|
+
const b = m[V + 1];
|
|
107
|
+
b instanceof HTMLElement && b.focus();
|
|
108
|
+
}
|
|
109
|
+
} else
|
|
110
|
+
e.target === r[0] && e.shiftKey && (e.preventDefault(), (a = w.value) == null || a.focus());
|
|
111
|
+
}
|
|
112
|
+
}, W = () => {
|
|
113
|
+
H(), document.addEventListener("focusin", E), document.addEventListener("click", M);
|
|
114
|
+
}, E = (e) => {
|
|
115
|
+
var a, n;
|
|
116
|
+
e.target instanceof HTMLElement && ((a = y.value) != null && a.contains(e.target) || (n = t.value) != null && n.contains(e.target) || (L(), k.value = !1, document.removeEventListener("click", M), document.removeEventListener("focusin", E), i("inactive")));
|
|
117
|
+
}, M = (e) => {
|
|
118
|
+
var a, n;
|
|
119
|
+
e.target instanceof HTMLElement && ((a = y.value) != null && a.contains(e.target) || (n = t.value) != null && n.contains(e.target) || (L(), k.value = !1, document.removeEventListener("click", M), document.removeEventListener("focusin", E), i("inactive")));
|
|
120
|
+
}, j = {
|
|
121
|
+
"onUpdate:modelValue": (e) => i("update:modelValue", e)
|
|
103
122
|
};
|
|
104
|
-
return (e,
|
|
105
|
-
class:
|
|
123
|
+
return (e, a) => (Y(), J("span", {
|
|
124
|
+
class: $([P.value, "bb-base-date-picker-input__container"]),
|
|
106
125
|
ref_key: "outerContainer",
|
|
107
|
-
ref:
|
|
126
|
+
ref: y
|
|
108
127
|
}, [
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
u(e.$slots, "prepend-outer"),
|
|
129
|
+
v("span", {
|
|
111
130
|
class: "bb-base-date-picker-input__inner-container",
|
|
112
131
|
ref_key: "innerContainer",
|
|
113
|
-
ref:
|
|
132
|
+
ref: s
|
|
114
133
|
}, [
|
|
115
|
-
|
|
116
|
-
|
|
134
|
+
u(e.$slots, "prepend"),
|
|
135
|
+
Q(v("input", B({
|
|
117
136
|
autocomplete: e.autocomplete,
|
|
118
137
|
autofocus: e.autofocus,
|
|
119
138
|
"data-maska": "##/##/#### - ##/##/####",
|
|
@@ -123,30 +142,36 @@ const fe = ["autocomplete", "autofocus", "disabled", "id", "name", "placeholder"
|
|
|
123
142
|
placeholder: e.placeholder,
|
|
124
143
|
readonly: e.readonly || e.range,
|
|
125
144
|
type: "text",
|
|
126
|
-
value:
|
|
127
|
-
onFocus:
|
|
128
|
-
onKeydown:
|
|
145
|
+
value: G.value,
|
|
146
|
+
onFocus: W,
|
|
147
|
+
onKeydown: K,
|
|
148
|
+
"aria-describedby": `bdpi_description_${e.id}`,
|
|
129
149
|
ref_key: "input",
|
|
130
|
-
ref:
|
|
131
|
-
},
|
|
132
|
-
[
|
|
150
|
+
ref: w
|
|
151
|
+
}, F), null, 16, ke), [
|
|
152
|
+
[X(pe)]
|
|
133
153
|
]),
|
|
134
|
-
|
|
154
|
+
u(e.$slots, "append"),
|
|
155
|
+
v("span", {
|
|
156
|
+
class: "bb-base-date-picker-input__accessible-description",
|
|
157
|
+
id: `bdpi_description_${e.id}`
|
|
158
|
+
}, "Formato della data " + Z(l.range ? "GG/MM/AAAA - GG/MM/AAAA" : "GG/MM/AAAA"), 9, ge)
|
|
135
159
|
], 512),
|
|
136
|
-
|
|
137
|
-
(
|
|
138
|
-
|
|
139
|
-
class:
|
|
140
|
-
"bb-base-date-picker-input__calendar--active":
|
|
141
|
-
"bb-base-date-picker-input__calendar--shown":
|
|
142
|
-
"bb-base-date-picker-input__calendar--showing":
|
|
143
|
-
"bb-base-date-picker-input__calendar--hiding":
|
|
160
|
+
u(e.$slots, "append-outer"),
|
|
161
|
+
(Y(), x(ee, { to: "body" }, [
|
|
162
|
+
v("span", {
|
|
163
|
+
class: $(["bb-base-date-picker-input__calendar", {
|
|
164
|
+
"bb-base-date-picker-input__calendar--active": k.value,
|
|
165
|
+
"bb-base-date-picker-input__calendar--shown": f.value,
|
|
166
|
+
"bb-base-date-picker-input__calendar--showing": g.value,
|
|
167
|
+
"bb-base-date-picker-input__calendar--hiding": h.value,
|
|
144
168
|
"bb-base-date-picker-input__calendar--hidden": p.value
|
|
145
169
|
}]),
|
|
146
170
|
ref_key: "calendar",
|
|
147
|
-
ref:
|
|
171
|
+
ref: t,
|
|
172
|
+
onKeydown: U
|
|
148
173
|
}, [
|
|
149
|
-
|
|
174
|
+
ae(me, B({
|
|
150
175
|
disabled: e.disabled,
|
|
151
176
|
firstDayOfWeek: e.firstDayOfWeek,
|
|
152
177
|
id: e.id,
|
|
@@ -154,20 +179,23 @@ const fe = ["autocomplete", "autofocus", "disabled", "id", "name", "placeholder"
|
|
|
154
179
|
range: e.range,
|
|
155
180
|
readonly: e.readonly,
|
|
156
181
|
width: e.width
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
182
|
+
}, j, {
|
|
183
|
+
ref_key: "basedatepicker",
|
|
184
|
+
ref: D
|
|
185
|
+
}), te({ _: 2 }, [
|
|
186
|
+
ne(e.$slots, (n, r) => ({
|
|
187
|
+
name: r,
|
|
188
|
+
fn: oe((m) => [
|
|
189
|
+
u(e.$slots, r, le(re(m)))
|
|
162
190
|
])
|
|
163
191
|
}))
|
|
164
192
|
]), 1040, ["disabled", "firstDayOfWeek", "id", "model-value", "range", "readonly", "width"])
|
|
165
|
-
],
|
|
193
|
+
], 34)
|
|
166
194
|
]))
|
|
167
195
|
], 2));
|
|
168
196
|
}
|
|
169
197
|
});
|
|
170
198
|
export {
|
|
171
|
-
|
|
199
|
+
Ce as default
|
|
172
200
|
};
|
|
173
201
|
//# sourceMappingURL=index10.js.map
|
package/dist/index10.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index10.js","sources":["../src/components/BaseDatePickerInput/BaseDatePickerInput.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, mergeProps as _mergeProps, unref as _unref, createElementVNode as _createElementVNode, withDirectives as _withDirectives, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, createVNode as _createVNode, normalizeClass as _normalizeClass, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"autocomplete\", \"autofocus\", \"disabled\", \"id\", \"name\", \"placeholder\", \"readonly\", \"value\"]\n\nimport {\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from \"@floating-ui/dom\";\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from \"vue\";\nimport { default as customParseFormat } from \"dayjs/plugin/customParseFormat\";\nimport { default as dayjs } from \"dayjs\";\nimport { default as it } from \"dayjs/locale/it\";\nimport { identity } from \"@/utilities/functions/identity\";\nimport { last } from \"@/utilities/functions/last\";\nimport { vMaska } from \"maska\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseDatePicker from \"../BaseDatePicker/BaseDatePicker.vue\";\nimport selectors from \"focusable-selectors\";\nimport { findInTree } from \"@/utilities/functions/findInTree\";\n\nexport interface BaseDatePickerInputProps {\n autocomplete?: string;\n autofocus?: boolean;\n disabled?: boolean;\n firstDayOfWeek?: number;\n hasErrors?: boolean;\n id?: string;\n modelValue: string | string[] | null;\n name?: string;\n placeholder?: string;\n range?: boolean;\n readonly?: boolean;\n width?: number | string;\n}\n\nexport type BaseDatePickerInputEvents = {\n (e: \"update:modelValue\", value: BaseDatePickerInputProps[\"modelValue\"]): void;\n (e: \"inactive\"): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseDatePickerInput',\n props: {\n autocomplete: { default: \"off\" },\n autofocus: { type: Boolean },\n disabled: { type: Boolean },\n firstDayOfWeek: {},\n hasErrors: { type: Boolean },\n id: {},\n modelValue: {},\n name: {},\n placeholder: {},\n range: { type: Boolean },\n readonly: { type: Boolean },\n width: { default: 290 }\n },\n emits: [\"update:modelValue\", \"inactive\"],\n setup(__props: any, { emit }) {\n\nconst props = __props;\n\ndayjs.extend(customParseFormat);\ndayjs.locale(it);\n\n\n\n\n\nconst calendar = ref<HTMLElement | null>(null);\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst inputValue = ref<string | null>(null);\n\nconst classes = computed(() => ({\n \"bb-base-date-picker-input\": true,\n \"bb-base-date-picker-input--errors\": props.hasErrors,\n \"bb-base-date-picker-input--readonly\": props.readonly,\n \"bb-base-date-picker-input--disabled\": props.disabled,\n}));\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n onInput: (event: Event) => {\n if (props.range) return;\n if (event.target instanceof HTMLInputElement) {\n inputValue.value = event.target.value;\n if (/\\d{2}\\/\\d{2}\\/\\d{4}/.test(event.target.value)) {\n emit(\n \"update:modelValue\",\n dayjs(event.target.value, \"DD/MM/YYYY\").toISOString()\n );\n } else if (event.target.value === \"\") {\n emit(\"update:modelValue\", null);\n }\n }\n },\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the calendar so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst getStringFromModelValue = (value: typeof props.modelValue) => {\n if (value) {\n if (Array.isArray(value)) {\n let head;\n let tail;\n if (value.length) head = value[0];\n if (value.length > 1) tail = last(value);\n return [head, tail]\n .filter(identity)\n .map((el) => dayjs(el).format(\"DD/MM/YYYY\"))\n .join(\" - \");\n } else {\n return dayjs(value).format(\"DD/MM/YYYY\");\n }\n }\n return null;\n};\nconst displayValue = computed(() => {\n if (inputValue.value) return inputValue.value;\n return getStringFromModelValue(props.modelValue);\n});\n\nwatch(\n () => props.modelValue,\n (value) => {\n inputValue.value = getStringFromModelValue(value);\n }\n);\n\n/**\n * This is used to position the calendar container.\n * When the linked item (outerContainer) updates its position\n * this is rerun by floating-UI\n */\nconst displayOptions = () => {\n if (innerContainer.value && calendar.value) {\n computePosition(innerContainer.value, calendar.value, {\n placement: \"bottom-start\",\n middleware: [offset(6), flip(), shift()],\n }).then((data) => {\n if (calendar.value) {\n calendar.value.style.left = `${data.x}px`;\n calendar.value.style.top = `${data.y}px`;\n calendar.value.style.width = `${innerContainer.value?.offsetWidth}px`;\n }\n });\n }\n};\n\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n if (innerContainer.value && calendar.value) {\n cleanUpPositioning = autoUpdate(\n innerContainer.value,\n calendar.value,\n displayOptions\n );\n }\n});\nonBeforeUnmount(() => {\n cleanUpPositioning();\n});\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n hidden.value = false;\n showing.value = true;\n await wait(500);\n showing.value = false;\n\n hidden.value = false;\n shown.value = true;\n};\n\nconst close = async () => {\n shown.value = false;\n hiding.value = true;\n await wait(500);\n hiding.value = false;\n shown.value = false;\n hidden.value = true;\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n if (event.key === \"Tab\") {\n if (event.shiftKey) {\n } else {\n event.preventDefault();\n if (calendar.value) {\n const focusableElements = calendar.value.querySelectorAll(\n selectors.join()\n );\n const firstFocusableElement = focusableElements[0];\n if (firstFocusableElement instanceof HTMLElement) {\n firstFocusableElement.focus();\n }\n }\n }\n }\n};\n\nconst onFocus = () => {\n open();\n document.addEventListener(\"focusin\", onDocumentFocus);\n document.addEventListener(\"click\", onDocumentClick);\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n if (event.target instanceof HTMLElement) {\n if (\n !(\n outerContainer.value?.contains(event.target) ||\n calendar.value?.contains(event.target)\n )\n ) {\n console.log('closing because focus is ourside', document.activeElement)\n close();\n active.value = false;\n document.removeEventListener(\"click\", onDocumentClick);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n emit('inactive')\n }\n }\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n if (event.target instanceof HTMLElement) {\n if (\n !(\n outerContainer.value?.contains(event.target) ||\n calendar.value?.contains(event.target)\n )\n ) {\n console.log('closing because clicked outside',calendar.value, event.target)\n close();\n active.value = false;\n document.removeEventListener(\"click\", onDocumentClick);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n emit('inactive')\n }\n }\n\n}\n\n/**\n * These events are just propagated\n */\nconst calendarEventListeners = {\n \"onUpdate:modelValue\": (value: string | string[] | null) =>\n emit(\"update:modelValue\", value),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass([classes.value, \"bb-base-date-picker-input__container\"]),\n ref_key: \"outerContainer\",\n ref: outerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n class: \"bb-base-date-picker-input__inner-container\",\n ref_key: \"innerContainer\",\n ref: innerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _withDirectives(_createElementVNode(\"input\", _mergeProps({\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n \"data-maska\": '##/##/#### - ##/##/####',\n disabled: _ctx.disabled,\n id: _ctx.id,\n name: _ctx.name,\n placeholder: _ctx.placeholder,\n readonly: _ctx.readonly || _ctx.range,\n type: 'text',\n value: displayValue.value,\n onFocus: onFocus,\n onKeydown: onKeydown,\n ref_key: \"input\",\n ref: input\n }, eventListeners), null, 16, _hoisted_1), [\n [_unref(vMaska)]\n ]),\n _renderSlot(_ctx.$slots, \"append\")\n ], 512),\n _renderSlot(_ctx.$slots, \"append-outer\"),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bb-base-date-picker-input__calendar\", {\n 'bb-base-date-picker-input__calendar--active': active.value,\n 'bb-base-date-picker-input__calendar--shown': shown.value,\n 'bb-base-date-picker-input__calendar--showing': showing.value,\n 'bb-base-date-picker-input__calendar--hiding': hiding.value,\n 'bb-base-date-picker-input__calendar--hidden': hidden.value,\n }]),\n ref_key: \"calendar\",\n ref: calendar\n }, [\n _createVNode(BaseDatePicker, _mergeProps({\n disabled: _ctx.disabled,\n firstDayOfWeek: _ctx.firstDayOfWeek,\n id: _ctx.id,\n \"model-value\": _ctx.modelValue,\n range: _ctx.range,\n readonly: _ctx.readonly,\n width: _ctx.width\n }, calendarEventListeners), _createSlots({ _: 2 }, [\n _renderList(_ctx.$slots, (_, name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1040, [\"disabled\", \"firstDayOfWeek\", \"id\", \"model-value\", \"range\", \"readonly\", \"width\"])\n ], 2)\n ]))\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_sfc_main","_defineComponent","__props","emit","props","dayjs","customParseFormat","it","calendar","ref","outerContainer","innerContainer","input","inputValue","classes","computed","eventListeners","event","active","getStringFromModelValue","value","head","tail","last","identity","el","displayValue","watch","displayOptions","computePosition","offset","flip","shift","data","_a","cleanUpPositioning","onMounted","autoUpdate","onBeforeUnmount","shown","showing","hiding","hidden","open","wait","close","onKeydown","firstFocusableElement","selectors","onFocus","onDocumentFocus","onDocumentClick","_b","calendarEventListeners","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_withDirectives","_mergeProps","_unref","vMaska","_createBlock","_Teleport","_createVNode","BaseDatePicker","_createSlots","_renderList","_","name","_withCtx","_norm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AAO,CAAC;AAAA,WAC1F,CAAC;AAAA,MAAA,CACL;AAAA,OACA,CAAC;AAAA,EAEN;AAEA,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index10.js","sources":["../src/components/BaseDatePickerInput/BaseDatePickerInput.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, mergeProps as _mergeProps, unref as _unref, createElementVNode as _createElementVNode, withDirectives as _withDirectives, toDisplayString as _toDisplayString, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, createVNode as _createVNode, normalizeClass as _normalizeClass, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"autocomplete\", \"autofocus\", \"disabled\", \"id\", \"name\", \"placeholder\", \"readonly\", \"value\", \"aria-describedby\"]\nconst _hoisted_2 = [\"id\"]\n\nimport {\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from \"@floating-ui/dom\";\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from \"vue\";\nimport { default as customParseFormat } from \"dayjs/plugin/customParseFormat\";\nimport { default as dayjs } from \"dayjs\";\nimport { default as it } from \"dayjs/locale/it\";\nimport { identity } from \"@/utilities/functions/identity\";\nimport { last } from \"@/utilities/functions/last\";\nimport { vMaska } from \"maska\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseDatePicker from \"../BaseDatePicker/BaseDatePicker.vue\";\nimport selectors from \"focusable-selectors\";\nimport focusableSelectors from \"focusable-selectors\";\n\nexport interface BaseDatePickerInputProps {\n autocomplete?: string;\n autofocus?: boolean;\n disabled?: boolean;\n firstDayOfWeek?: number;\n hasErrors?: boolean;\n id?: string;\n modelValue: string | string[] | null;\n name?: string;\n placeholder?: string;\n range?: boolean;\n readonly?: boolean;\n width?: number | string;\n}\n\nexport type BaseDatePickerInputEvents = {\n (e: \"update:modelValue\", value: BaseDatePickerInputProps[\"modelValue\"]): void;\n (e: \"inactive\"): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseDatePickerInput',\n props: {\n autocomplete: { default: \"off\" },\n autofocus: { type: Boolean },\n disabled: { type: Boolean },\n firstDayOfWeek: {},\n hasErrors: { type: Boolean },\n id: {},\n modelValue: {},\n name: {},\n placeholder: {},\n range: { type: Boolean },\n readonly: { type: Boolean },\n width: { default: 290 }\n },\n emits: [\"update:modelValue\", \"inactive\"],\n setup(__props: any, { emit }) {\n\nconst props = __props;\n\ndayjs.extend(customParseFormat);\ndayjs.locale(it);\n\n\n\n\n\nconst calendar = ref<HTMLElement | null>(null);\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst inputValue = ref<string | null>(null);\nconst basedatepicker = ref();\n\nconst classes = computed(() => ({\n \"bb-base-date-picker-input\": true,\n \"bb-base-date-picker-input--errors\": props.hasErrors,\n \"bb-base-date-picker-input--readonly\": props.readonly,\n \"bb-base-date-picker-input--disabled\": props.disabled,\n}));\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n onInput: (event: Event) => {\n if (props.range) return;\n if (event.target instanceof HTMLInputElement) {\n inputValue.value = event.target.value;\n if (/\\d{2}\\/\\d{2}\\/\\d{4}/.test(event.target.value)) {\n emit(\n \"update:modelValue\",\n dayjs(event.target.value, \"DD/MM/YYYY\").toISOString()\n );\n } else if (event.target.value === \"\") {\n emit(\"update:modelValue\", null);\n }\n }\n },\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the calendar so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst getStringFromModelValue = (value: typeof props.modelValue) => {\n if (value) {\n if (Array.isArray(value)) {\n let head;\n let tail;\n if (value.length) head = value[0];\n if (value.length > 1) tail = last(value);\n return [head, tail]\n .filter(identity)\n .map((el) => dayjs(el).format(\"DD/MM/YYYY\"))\n .join(\" - \");\n } else {\n return dayjs(value).format(\"DD/MM/YYYY\");\n }\n }\n return null;\n};\n\nconst displayValue = computed(() => {\n if (inputValue.value) return inputValue.value;\n return getStringFromModelValue(props.modelValue);\n});\n\nwatch(\n () => props.modelValue,\n (value) => {\n inputValue.value = getStringFromModelValue(value);\n }\n);\n\n/**\n * This is used to position the calendar container.\n * When the linked item (outerContainer) updates its position\n * this is rerun by floating-UI\n */\nconst displayOptions = () => {\n if (innerContainer.value && calendar.value) {\n computePosition(innerContainer.value, calendar.value, {\n placement: \"bottom-start\",\n middleware: [offset(6), flip(), shift()],\n }).then((data) => {\n if (calendar.value) {\n calendar.value.style.left = `${data.x}px`;\n calendar.value.style.top = `${data.y}px`;\n calendar.value.style.width = `${innerContainer.value?.offsetWidth}px`;\n }\n });\n }\n};\n\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n if (innerContainer.value && calendar.value) {\n cleanUpPositioning = autoUpdate(\n innerContainer.value,\n calendar.value,\n displayOptions\n );\n }\n});\nonBeforeUnmount(() => {\n cleanUpPositioning();\n});\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n hidden.value = false;\n showing.value = true;\n await wait(500);\n showing.value = false;\n\n hidden.value = false;\n shown.value = true;\n};\n\nconst close = async () => {\n shown.value = false;\n hiding.value = true;\n await wait(500);\n hiding.value = false;\n shown.value = false;\n hidden.value = true;\n basedatepicker.value?.setSelectionModeToDay()\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n if (event.key === \"Tab\") {\n if (!event.shiftKey) {\n event.preventDefault();\n if (calendar.value) {\n const focusableElements = calendar.value.querySelectorAll(\n selectors.join()\n );\n const firstFocusableElement = focusableElements[0];\n if (firstFocusableElement instanceof HTMLElement) {\n firstFocusableElement.focus();\n }\n }\n }\n }\n};\n\nconst onCalendarKeydown = (event: KeyboardEvent) => {\n if (event.key === \"Tab\") {\n if (calendar.value) {\n const focusableSelectorsString = focusableSelectors.join(\", \");\n const focusableElements = calendar.value.querySelectorAll(\n focusableSelectorsString\n );\n /* When the user tabs on the last tabbable elem */\n if (event.target === focusableElements[focusableElements.length - 1]) {\n event.preventDefault();\n const focusableElements = Array.from(\n document.body.querySelectorAll(focusableSelectorsString)\n );\n const indexOfInput = focusableElements.findIndex(\n (el) => el.id === props.id\n );\n if (indexOfInput > -1) {\n const nextElement = focusableElements[indexOfInput + 1];\n if (nextElement instanceof HTMLElement) {\n nextElement.focus();\n }\n }\n } else if (event.target === focusableElements[0]) {\n if(event.shiftKey) {\n event.preventDefault();\n input.value?.focus()\n }\n }\n }\n }\n};\n\nconst onFocus = () => {\n open();\n document.addEventListener(\"focusin\", onDocumentFocus);\n document.addEventListener(\"click\", onDocumentClick);\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n if (event.target instanceof HTMLElement) {\n if (\n !(\n outerContainer.value?.contains(event.target) ||\n calendar.value?.contains(event.target)\n )\n ) {\n close();\n active.value = false;\n document.removeEventListener(\"click\", onDocumentClick);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n emit(\"inactive\");\n }\n }\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n if (event.target instanceof HTMLElement) {\n if (\n !(\n outerContainer.value?.contains(event.target) ||\n calendar.value?.contains(event.target)\n )\n ) {\n close();\n active.value = false;\n document.removeEventListener(\"click\", onDocumentClick);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n emit(\"inactive\");\n }\n }\n};\n\n/**\n * These events are just propagated\n */\nconst calendarEventListeners = {\n \"onUpdate:modelValue\": (value: string | string[] | null) =>\n emit(\"update:modelValue\", value),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass([classes.value, \"bb-base-date-picker-input__container\"]),\n ref_key: \"outerContainer\",\n ref: outerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n class: \"bb-base-date-picker-input__inner-container\",\n ref_key: \"innerContainer\",\n ref: innerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _withDirectives(_createElementVNode(\"input\", _mergeProps({\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n \"data-maska\": '##/##/#### - ##/##/####',\n disabled: _ctx.disabled,\n id: _ctx.id,\n name: _ctx.name,\n placeholder: _ctx.placeholder,\n readonly: _ctx.readonly || _ctx.range,\n type: 'text',\n value: displayValue.value,\n onFocus: onFocus,\n onKeydown: onKeydown,\n \"aria-describedby\": `bdpi_description_${_ctx.id}`,\n ref_key: \"input\",\n ref: input\n }, eventListeners), null, 16, _hoisted_1), [\n [_unref(vMaska)]\n ]),\n _renderSlot(_ctx.$slots, \"append\"),\n _createElementVNode(\"span\", {\n class: \"bb-base-date-picker-input__accessible-description\",\n id: `bdpi_description_${_ctx.id}`\n }, \"Formato della data \" + _toDisplayString(props.range ? 'GG/MM/AAAA - GG/MM/AAAA' : 'GG/MM/AAAA'), 9, _hoisted_2)\n ], 512),\n _renderSlot(_ctx.$slots, \"append-outer\"),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bb-base-date-picker-input__calendar\", {\n 'bb-base-date-picker-input__calendar--active': active.value,\n 'bb-base-date-picker-input__calendar--shown': shown.value,\n 'bb-base-date-picker-input__calendar--showing': showing.value,\n 'bb-base-date-picker-input__calendar--hiding': hiding.value,\n 'bb-base-date-picker-input__calendar--hidden': hidden.value,\n }]),\n ref_key: \"calendar\",\n ref: calendar,\n onKeydown: onCalendarKeydown\n }, [\n _createVNode(BaseDatePicker, _mergeProps({\n disabled: _ctx.disabled,\n firstDayOfWeek: _ctx.firstDayOfWeek,\n id: _ctx.id,\n \"model-value\": _ctx.modelValue,\n range: _ctx.range,\n readonly: _ctx.readonly,\n width: _ctx.width\n }, calendarEventListeners, {\n ref_key: \"basedatepicker\",\n ref: basedatepicker\n }), _createSlots({ _: 2 }, [\n _renderList(_ctx.$slots, (_, name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1040, [\"disabled\", \"firstDayOfWeek\", \"id\", \"model-value\", \"range\", \"readonly\", \"width\"])\n ], 34)\n ]))\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","emit","props","dayjs","customParseFormat","it","calendar","ref","outerContainer","innerContainer","input","inputValue","basedatepicker","classes","computed","eventListeners","event","active","getStringFromModelValue","value","head","tail","last","identity","el","displayValue","watch","displayOptions","computePosition","offset","flip","shift","data","_a","cleanUpPositioning","onMounted","autoUpdate","onBeforeUnmount","shown","showing","hiding","hidden","open","wait","close","onKeydown","firstFocusableElement","selectors","onCalendarKeydown","focusableSelectorsString","focusableSelectors","focusableElements","indexOfInput","nextElement","onFocus","onDocumentFocus","onDocumentClick","_b","calendarEventListeners","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_withDirectives","_mergeProps","_unref","vMaska","_toDisplayString","_createBlock","_Teleport","_createVNode","BaseDatePicker","_createSlots","_renderList","_","name","_withCtx","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;;;;;;;AAGA,MAAMA,KAAa,CAAC,gBAAgB,aAAa,YAAY,MAAM,QAAQ,eAAe,YAAY,SAAS,kBAAkB,GAC3HC,KAAa,CAAC,IAAI,GA0CIC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,MAAM;AAAA,IAC/B,WAAW,EAAE,M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AC;AAAA,UACF,SAAS;AAAA,UACT,KAAKnC;AAAA,UACL,WAAW0C;AAAA,QAAA,GACV;AAAA,UACDyB,GAAaC,IAAgBP,EAAY;AAAA,YACvC,UAAUR,EAAK;AAAA,YACf,gBAAgBA,EAAK;AAAA,YACrB,IAAIA,EAAK;AAAA,YACT,eAAeA,EAAK;AAAA,YACpB,OAAOA,EAAK;AAAA,YACZ,UAAUA,EAAK;AAAA,YACf,OAAOA,EAAK;AAAA,aACXD,GAAwB;AAAA,YACzB,SAAS;AAAA,YACT,KAAK9C;AAAA,UACN,CAAA,GAAG+D,GAAa,EAAE,GAAG,KAAK;AAAA,YACzBC,GAAYjB,EAAK,QAAQ,CAACkB,GAAGC,OACpB;AAAA,cACL,MAAAA;AAAA,cACA,IAAIC,GAAS,CAAC/C,MAAS;AAAA,gBACrBgC,EAAYL,EAAK,QAAQmB,GAAME,GAAgBC,GAAoBjD,CAAI,CAAC,CAAC;AAAA,cAAA,CAC1E;AAAA,YAAA,EAEJ;AAAA,UAAA,CACF,GAAG,MAAM,CAAC,YAAY,kBAAkB,MAAM,eAAe,SAAS,YAAY,OAAO,CAAC;AAAA,WAC1F,EAAE;AAAA,MAAA,CACN;AAAA,OACA,CAAC;AAAA,EAEN;AAEA,CAAC;"}
|
package/dist/index100.js
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
1
|
+
import { defineComponent as m, computed as r, openBlock as a, createElementBlock as d, mergeProps as u, createElementVNode as c } from "vue";
|
|
2
|
+
import { isCssColor as z } from "./index171.js";
|
|
3
|
+
const f = /* @__PURE__ */ c("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
viewBox: "0 0 512 512"
|
|
6
|
+
}, [
|
|
7
|
+
/* @__PURE__ */ c("path", {
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
d: "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"
|
|
10
|
+
})
|
|
11
|
+
], -1), x = [
|
|
12
|
+
f
|
|
13
|
+
], w = /* @__PURE__ */ m({
|
|
14
|
+
__name: "BbSpinner",
|
|
15
|
+
props: {
|
|
16
|
+
color: {},
|
|
17
|
+
size: { default: "md" }
|
|
18
|
+
},
|
|
19
|
+
setup(n) {
|
|
20
|
+
const e = n, l = {
|
|
21
|
+
xs: 12,
|
|
22
|
+
sm: 16,
|
|
23
|
+
md: 24,
|
|
24
|
+
lg: 28,
|
|
25
|
+
xl: 36,
|
|
26
|
+
xxl: 40
|
|
27
|
+
}, i = r(() => {
|
|
28
|
+
const s = {
|
|
29
|
+
"bb-spinner": !0
|
|
30
|
+
};
|
|
31
|
+
let o = { width: r(() => {
|
|
32
|
+
let t;
|
|
33
|
+
return typeof e.size == "string" ? t = l[e.size] ?? parseInt(e.size, 10) : t = e.size, t + "px";
|
|
34
|
+
}).value };
|
|
35
|
+
return e.color && (z(e.color) ? o.color = e.color : s[`text-${e.color}`] = !0), {
|
|
36
|
+
class: s,
|
|
37
|
+
style: o
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
return (s, p) => (a(), d("span", u({ class: "bb-spinner" }, i.value), x, 16));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
3
43
|
export {
|
|
4
|
-
|
|
44
|
+
w as default
|
|
5
45
|
};
|
|
6
46
|
//# sourceMappingURL=index100.js.map
|
package/dist/index100.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index100.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
1
|
+
{"version":3,"file":"index100.js","sources":["../src/components/BbSpinner/BbSpinner.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = /*#__PURE__*/_createElementVNode(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 512 512\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z\"\n })\n], -1)\nconst _hoisted_2 = [\n _hoisted_1\n]\n\nimport BbIcon from \"../BbIcon/BbIcon.vue\";\nimport { Classes } from \"@/types/Classes\";\nimport { isCssColor } from \"@/utilities/functions/isCssColor\";\nimport { computed } from \"vue\";\n\nexport type Size = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"xxl\" | string | number;\n\nexport interface BbSpinnerProps {\n color?: string;\n size?: Size;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbSpinner',\n props: {\n color: {},\n size: { default: \"md\" }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\n\nconst sizeMap: Record<Size, number> = {\n xs: 12,\n sm: 16,\n md: 24,\n lg: 28,\n xl: 36,\n xxl: 40,\n};\n\nconst iconAttributes = computed(() => {\n const classes: Classes = {\n \"bb-spinner\": true,\n };\n const width = computed(() => {\n let dimension: number;\n if (typeof props.size === \"string\") {\n dimension = sizeMap[props.size as Size] ?? parseInt(props.size, 10);\n } else {\n dimension = props.size;\n }\n return dimension + `px`;\n });\n let style: { [key: string]: any } = { width: width.value };\n\n if (props.color) {\n if (isCssColor(props.color)) {\n style.color = props.color;\n } else {\n classes[`text-${props.color}`] = true;\n }\n }\n return {\n class: classes,\n style,\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-spinner\" }, iconAttributes.value), _hoisted_2, 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps"],"mappings":";;AAGA,MAAMA,sBAA8C,OAAO;AAAA,EACzD,OAAO;AAAA,EACP,SAAS;AACX,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,MAAM;AAAA,IACN,GAAG;AAAA,EAAA,CACJ;AACH,GAAG,EAAE,GACCC,IAAa;AAAA,EACjBD;AACF,GAe4BE,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,CAAC;AAAA,IACR,MAAM,EAAE,SAAS,KAAK;AAAA,EACxB;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAKRE,IAAgC;AAAA,MACpC,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGDC,IAAiBC,EAAS,MAAM;AACpC,YAAMC,IAAmB;AAAA,QACvB,cAAc;AAAA,MAAA;AAWhB,UAAIC,IAAgC,EAAE,OATxBF,EAAS,MAAM;AACvB,YAAAG;AACA,eAAA,OAAON,EAAM,QAAS,WACxBM,IAAYL,EAAQD,EAAM,IAAY,KAAK,SAASA,EAAM,MAAM,EAAE,IAElEM,IAAYN,EAAM,MAEbM,IAAY;AAAA,MAAA,CACpB,EACkD,MAAM;AAEzD,aAAIN,EAAM,UACJO,EAAWP,EAAM,KAAK,IACxBK,EAAM,QAAQL,EAAM,QAEpBI,EAAQ,QAAQJ,EAAM,KAAK,EAAE,IAAI,KAG9B;AAAA,QACL,OAAOI;AAAA,QACP,OAAAC;AAAA,MAAA;AAAA,IACF,CACD;AAEM,WAAA,CAACG,GAAUC,OACRC,EAAW,GAAGC,EAAoB,QAAQC,EAAY,EAAE,OAAO,aAAA,GAAgBV,EAAe,KAAK,GAAGN,GAAY,EAAE;AAAA,EAE9H;AAEA,CAAC;"}
|
package/dist/index101.js
CHANGED
package/dist/index102.js
CHANGED
package/dist/index103.js
CHANGED
package/dist/index104.js
CHANGED
package/dist/index105.js
CHANGED
package/dist/index106.js
CHANGED
package/dist/index107.js
CHANGED
package/dist/index108.js
CHANGED
package/dist/index109.js
CHANGED
package/dist/index110.js
CHANGED
package/dist/index111.js
CHANGED
package/dist/index112.js
CHANGED
package/dist/index113.js
CHANGED
package/dist/index114.js
CHANGED
package/dist/index115.js
CHANGED
package/dist/index116.js
CHANGED
package/dist/index117.js
CHANGED
package/dist/index118.js
CHANGED
package/dist/index119.js
CHANGED