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.
Files changed (284) hide show
  1. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +1 -0
  2. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +151 -0
  3. package/dist/components/BbPopover/BbPopover.vue.d.ts +96 -0
  4. package/dist/components/BbRatio/BbRatio.vue.d.ts +12 -0
  5. package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
  6. package/dist/index.d.ts +4 -0
  7. package/dist/index.js +104 -98
  8. package/dist/index.js.map +1 -1
  9. package/dist/index10.js +123 -95
  10. package/dist/index10.js.map +1 -1
  11. package/dist/index100.js +43 -3
  12. package/dist/index100.js.map +1 -1
  13. package/dist/index101.js +2 -2
  14. package/dist/index102.js +2 -2
  15. package/dist/index103.js +2 -2
  16. package/dist/index104.js +2 -2
  17. package/dist/index105.js +2 -2
  18. package/dist/index106.js +2 -2
  19. package/dist/index107.js +2 -2
  20. package/dist/index108.js +2 -2
  21. package/dist/index109.js +2 -2
  22. package/dist/index110.js +2 -2
  23. package/dist/index111.js +2 -2
  24. package/dist/index112.js +2 -2
  25. package/dist/index113.js +2 -2
  26. package/dist/index114.js +2 -2
  27. package/dist/index115.js +2 -2
  28. package/dist/index116.js +2 -2
  29. package/dist/index117.js +2 -2
  30. package/dist/index118.js +2 -2
  31. package/dist/index119.js +3 -2
  32. package/dist/index119.js.map +1 -1
  33. package/dist/index12.js +4 -4
  34. package/dist/index120.js +2 -2
  35. package/dist/index121.js +3 -2
  36. package/dist/index121.js.map +1 -1
  37. package/dist/index123.js +2 -2
  38. package/dist/index124.js +2 -3
  39. package/dist/index124.js.map +1 -1
  40. package/dist/index125.js +2 -2
  41. package/dist/index126.js +2 -3
  42. package/dist/index126.js.map +1 -1
  43. package/dist/index127.js +2 -2
  44. package/dist/index128.js +2 -2
  45. package/dist/index129.js +3 -2
  46. package/dist/index129.js.map +1 -1
  47. package/dist/index130.js +2 -2
  48. package/dist/index131.js +2 -2
  49. package/dist/index132.js +2 -2
  50. package/dist/index133.js +2 -2
  51. package/dist/index134.js +2 -3
  52. package/dist/index134.js.map +1 -1
  53. package/dist/index135.js +2 -2
  54. package/dist/index136.js +2 -2
  55. package/dist/index137.js +2 -2
  56. package/dist/index138.js +2 -2
  57. package/dist/index139.js +2 -2
  58. package/dist/index14.js +6 -6
  59. package/dist/index140.js +3 -2
  60. package/dist/index140.js.map +1 -1
  61. package/dist/index141.js +2 -2
  62. package/dist/index142.js +3 -2
  63. package/dist/index142.js.map +1 -1
  64. package/dist/index145.js +2 -2
  65. package/dist/index146.js +2 -3
  66. package/dist/index146.js.map +1 -1
  67. package/dist/index147.js +2 -2
  68. package/dist/index148.js +2 -3
  69. package/dist/index148.js.map +1 -1
  70. package/dist/index149.js +2 -2
  71. package/dist/index150.js +2 -2
  72. package/dist/index151.js +3 -2
  73. package/dist/index151.js.map +1 -1
  74. package/dist/index152.js +3 -4
  75. package/dist/index152.js.map +1 -1
  76. package/dist/index153.js +3 -8
  77. package/dist/index153.js.map +1 -1
  78. package/dist/index154.js +3 -2
  79. package/dist/index154.js.map +1 -1
  80. package/dist/index155.js +3 -2
  81. package/dist/index155.js.map +1 -1
  82. package/dist/index156.js +3 -5
  83. package/dist/index156.js.map +1 -1
  84. package/dist/index157.js +348 -17
  85. package/dist/index157.js.map +1 -1
  86. package/dist/index158.js +131 -17
  87. package/dist/index158.js.map +1 -1
  88. package/dist/index159.js +5 -29
  89. package/dist/index159.js.map +1 -1
  90. package/dist/index16.js +1 -1
  91. package/dist/index160.js +19 -2
  92. package/dist/index160.js.map +1 -1
  93. package/dist/index162.js +2 -2
  94. package/dist/index162.js.map +1 -1
  95. package/dist/index163.js +184 -14
  96. package/dist/index163.js.map +1 -1
  97. package/dist/index164.js +2 -13
  98. package/dist/index164.js.map +1 -1
  99. package/dist/index165.js +23 -2
  100. package/dist/index165.js.map +1 -1
  101. package/dist/index166.js +328 -3
  102. package/dist/index166.js.map +1 -1
  103. package/dist/index167.js +16 -2
  104. package/dist/index167.js.map +1 -1
  105. package/dist/index168.js +12 -5
  106. package/dist/index168.js.map +1 -1
  107. package/dist/index169.js +2 -350
  108. package/dist/index169.js.map +1 -1
  109. package/dist/index170.js +2 -134
  110. package/dist/index170.js.map +1 -1
  111. package/dist/index171.js +2 -186
  112. package/dist/index171.js.map +1 -1
  113. package/dist/index172.js +4 -23
  114. package/dist/index172.js.map +1 -1
  115. package/dist/index173.js +8 -328
  116. package/dist/index173.js.map +1 -1
  117. package/dist/index174.js +20 -2
  118. package/dist/index174.js.map +1 -1
  119. package/dist/index175.js +29 -21
  120. package/dist/index175.js.map +1 -1
  121. package/dist/index176.js +2 -3
  122. package/dist/index176.js.map +1 -1
  123. package/dist/index177.js +3 -3
  124. package/dist/index177.js.map +1 -1
  125. package/dist/index178.js +6 -38
  126. package/dist/index178.js.map +1 -1
  127. package/dist/index179.js +2 -28
  128. package/dist/index179.js.map +1 -1
  129. package/dist/index18.js +2 -2
  130. package/dist/index180.js +2 -13
  131. package/dist/index180.js.map +1 -1
  132. package/dist/index181.js +20 -8
  133. package/dist/index181.js.map +1 -1
  134. package/dist/index182.js +3 -96
  135. package/dist/index182.js.map +1 -1
  136. package/dist/index183.js +3 -4
  137. package/dist/index183.js.map +1 -1
  138. package/dist/index184.js +38 -295
  139. package/dist/index184.js.map +1 -1
  140. package/dist/index185.js +9 -6
  141. package/dist/index185.js.map +1 -1
  142. package/dist/index186.js +96 -2
  143. package/dist/index186.js.map +1 -1
  144. package/dist/index187.js +28 -2
  145. package/dist/index187.js.map +1 -1
  146. package/dist/index188.js +13 -2
  147. package/dist/index188.js.map +1 -1
  148. package/dist/index189.js +6 -2
  149. package/dist/index189.js.map +1 -1
  150. package/dist/index190.js +2 -235
  151. package/dist/index190.js.map +1 -1
  152. package/dist/index191.js +294 -88
  153. package/dist/index191.js.map +1 -1
  154. package/dist/index192.js +2 -2
  155. package/dist/index193.js +2 -117
  156. package/dist/index193.js.map +1 -1
  157. package/dist/index194.js +111 -100
  158. package/dist/index194.js.map +1 -1
  159. package/dist/index195.js +105 -78
  160. package/dist/index195.js.map +1 -1
  161. package/dist/index196.js +4 -224
  162. package/dist/index196.js.map +1 -1
  163. package/dist/index197.js +226 -249
  164. package/dist/index197.js.map +1 -1
  165. package/dist/index198.js +2 -38
  166. package/dist/index198.js.map +1 -1
  167. package/dist/index199.js +2 -2
  168. package/dist/index199.js.map +1 -1
  169. package/dist/index20.js +4 -4
  170. package/dist/index200.js +89 -2
  171. package/dist/index200.js.map +1 -1
  172. package/dist/index201.js +79 -2
  173. package/dist/index201.js.map +1 -1
  174. package/dist/index202.js +49 -8
  175. package/dist/index202.js.map +1 -1
  176. package/dist/index203.js +223 -5
  177. package/dist/index203.js.map +1 -1
  178. package/dist/index204.js +261 -0
  179. package/dist/index204.js.map +1 -0
  180. package/dist/index205.js +41 -0
  181. package/dist/index205.js.map +1 -0
  182. package/dist/index206.js +5 -0
  183. package/dist/index206.js.map +1 -0
  184. package/dist/index207.js +5 -0
  185. package/dist/index207.js.map +1 -0
  186. package/dist/index208.js +12 -0
  187. package/dist/index208.js.map +1 -0
  188. package/dist/index209.js +9 -0
  189. package/dist/index209.js.map +1 -0
  190. package/dist/index210.js +5 -0
  191. package/dist/index210.js.map +1 -0
  192. package/dist/index211.js +14 -0
  193. package/dist/index211.js.map +1 -0
  194. package/dist/index212.js +434 -0
  195. package/dist/index212.js.map +1 -0
  196. package/dist/index213.js +12 -0
  197. package/dist/index213.js.map +1 -0
  198. package/dist/index214.js +203 -0
  199. package/dist/index214.js.map +1 -0
  200. package/dist/index22.js +14 -14
  201. package/dist/index24.js +4 -4
  202. package/dist/index26.js +2 -2
  203. package/dist/index28.js +4 -4
  204. package/dist/index34.js +2 -2
  205. package/dist/index36.js +50 -37
  206. package/dist/index36.js.map +1 -1
  207. package/dist/index38.js +39 -39
  208. package/dist/index38.js.map +1 -1
  209. package/dist/index4.js +2 -2
  210. package/dist/index40.js +36 -82
  211. package/dist/index40.js.map +1 -1
  212. package/dist/index42.js +44 -57
  213. package/dist/index42.js.map +1 -1
  214. package/dist/index44.js +98 -79
  215. package/dist/index44.js.map +1 -1
  216. package/dist/index46.js +79 -81
  217. package/dist/index46.js.map +1 -1
  218. package/dist/index48.js +80 -40
  219. package/dist/index48.js.map +1 -1
  220. package/dist/index50.js +40 -283
  221. package/dist/index50.js.map +1 -1
  222. package/dist/index52.js +279 -95
  223. package/dist/index52.js.map +1 -1
  224. package/dist/index54.js +98 -212
  225. package/dist/index54.js.map +1 -1
  226. package/dist/index56.js +213 -44
  227. package/dist/index56.js.map +1 -1
  228. package/dist/index58.js +45 -40
  229. package/dist/index58.js.map +1 -1
  230. package/dist/index59.js +2 -96
  231. package/dist/index59.js.map +1 -1
  232. package/dist/index6.js +4 -4
  233. package/dist/index60.js +44 -2
  234. package/dist/index60.js.map +1 -1
  235. package/dist/index61.js +89 -211
  236. package/dist/index61.js.map +1 -1
  237. package/dist/index63.js +210 -130
  238. package/dist/index63.js.map +1 -1
  239. package/dist/index65.js +134 -18
  240. package/dist/index65.js.map +1 -1
  241. package/dist/index67.js +145 -74
  242. package/dist/index67.js.map +1 -1
  243. package/dist/index69.js +18 -98
  244. package/dist/index69.js.map +1 -1
  245. package/dist/index71.js +77 -17
  246. package/dist/index71.js.map +1 -1
  247. package/dist/index73.js +48 -66
  248. package/dist/index73.js.map +1 -1
  249. package/dist/index75.js +21 -78
  250. package/dist/index75.js.map +1 -1
  251. package/dist/index77.js +77 -46
  252. package/dist/index77.js.map +1 -1
  253. package/dist/index79.js +44 -61
  254. package/dist/index79.js.map +1 -1
  255. package/dist/index8.js +188 -181
  256. package/dist/index8.js.map +1 -1
  257. package/dist/index81.js +82 -106
  258. package/dist/index81.js.map +1 -1
  259. package/dist/index83.js +88 -370
  260. package/dist/index83.js.map +1 -1
  261. package/dist/index85.js +106 -74
  262. package/dist/index85.js.map +1 -1
  263. package/dist/index87.js +371 -68
  264. package/dist/index87.js.map +1 -1
  265. package/dist/index89.js +75 -111
  266. package/dist/index89.js.map +1 -1
  267. package/dist/index91.js +76 -87
  268. package/dist/index91.js.map +1 -1
  269. package/dist/index93.js +111 -32
  270. package/dist/index93.js.map +1 -1
  271. package/dist/index94.js +2 -37
  272. package/dist/index94.js.map +1 -1
  273. package/dist/index95.js +87 -42
  274. package/dist/index95.js.map +1 -1
  275. package/dist/index96.js +2 -43
  276. package/dist/index96.js.map +1 -1
  277. package/dist/index97.js +38 -3
  278. package/dist/index97.js.map +1 -1
  279. package/dist/index98.js +37 -3
  280. package/dist/index98.js.map +1 -1
  281. package/dist/index99.js +47 -3
  282. package/dist/index99.js.map +1 -1
  283. package/dist/style.css +1 -1
  284. package/package.json +1 -1
package/dist/index10.js CHANGED
@@ -1,17 +1,17 @@
1
- import { defineComponent as I, ref as n, computed as V, watch as j, onMounted as A, onBeforeUnmount as z, openBlock as L, createElementBlock as K, normalizeClass as M, renderSlot as i, createElementVNode as h, withDirectives as N, mergeProps as Y, unref as q, createBlock as R, Teleport as G, createVNode as J, createSlots as Q, renderList as X, withCtx as Z, normalizeProps as x, guardReactiveProps as ee } from "vue";
2
- import { autoUpdate as ae, computePosition as te } from "./index169.js";
3
- import oe from "./index170.js";
4
- import u from "./index156.js";
5
- import ne from "./index157.js";
6
- import { identity as le } from "./index161.js";
7
- import { last as re } from "./index155.js";
8
- import { vMaska as se } from "./index171.js";
9
- import { wait as _ } from "./index167.js";
10
- import ie from "./index8.js";
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 ue from "./index172.js";
13
- import { offset as de, flip as ce, shift as pe } from "./index173.js";
14
- const fe = ["autocomplete", "autofocus", "disabled", "id", "name", "placeholder", "readonly", "value"], Ye = /* @__PURE__ */ I({
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(B, { emit: s }) {
32
- const l = B;
33
- u.extend(oe), u.locale(ne);
34
- const a = n(null), m = n(null), r = n(null), $ = n(null), d = n(null), C = V(() => ({
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
- })), P = {
39
+ })), F = {
40
40
  onInput: (e) => {
41
- l.range || e.target instanceof HTMLInputElement && (d.value = e.target.value, /\d{2}\/\d{2}\/\d{4}/.test(e.target.value) ? s(
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
- u(e.target.value, "DD/MM/YYYY").toISOString()
44
- ) : e.target.value === "" && s("update:modelValue", null));
43
+ d(e.target.value, "DD/MM/YYYY").toISOString()
44
+ ) : e.target.value === "" && i("update:modelValue", null));
45
45
  }
46
- }, v = n(!1), E = (e) => {
46
+ }, k = o(!1), A = (e) => {
47
47
  if (e)
48
48
  if (Array.isArray(e)) {
49
- let t, o;
50
- return e.length && (t = e[0]), e.length > 1 && (o = re(e)), [t, o].filter(le).map((f) => u(f).format("DD/MM/YYYY")).join(" - ");
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 u(e).format("DD/MM/YYYY");
52
+ return d(e).format("DD/MM/YYYY");
53
53
  return null;
54
- }, O = V(() => d.value ? d.value : E(l.modelValue));
55
- j(
54
+ }, G = S(() => c.value ? c.value : A(l.modelValue));
55
+ z(
56
56
  () => l.modelValue,
57
57
  (e) => {
58
- d.value = E(e);
58
+ c.value = A(e);
59
59
  }
60
60
  );
61
- const S = () => {
62
- r.value && a.value && te(r.value, a.value, {
61
+ const I = () => {
62
+ s.value && t.value && ie(s.value, t.value, {
63
63
  placement: "bottom-start",
64
- middleware: [de(6), ce(), pe()]
64
+ middleware: [be(6), ve(), ye()]
65
65
  }).then((e) => {
66
- var t;
67
- a.value && (a.value.style.left = `${e.x}px`, a.value.style.top = `${e.y}px`, a.value.style.width = `${(t = r.value) == null ? void 0 : t.offsetWidth}px`);
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 w;
71
- A(async () => {
72
- r.value && a.value && (w = ae(
73
- r.value,
74
- a.value,
75
- S
70
+ let _;
71
+ N(async () => {
72
+ s.value && t.value && (_ = se(
73
+ s.value,
74
+ t.value,
75
+ I
76
76
  ));
77
- }), z(() => {
78
- w();
77
+ }), R(() => {
78
+ _();
79
79
  });
80
- const c = n(!1), b = n(!1), y = n(!1), p = n(!0), T = async () => {
81
- p.value = !1, b.value = !0, await _(500), b.value = !1, p.value = !1, c.value = !0;
82
- }, D = async () => {
83
- c.value = !1, y.value = !0, await _(500), y.value = !1, c.value = !1, p.value = !0;
84
- }, F = (e) => {
85
- if (e.key === "Tab" && !e.shiftKey) {
86
- if (e.preventDefault(), a.value) {
87
- const o = a.value.querySelectorAll(
88
- ue.join()
89
- )[0];
90
- o instanceof HTMLElement && o.focus();
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
- T(), document.addEventListener("focusin", g), document.addEventListener("click", k);
95
- }, g = (e) => {
96
- var t, o;
97
- e.target instanceof HTMLElement && ((t = m.value) != null && t.contains(e.target) || (o = a.value) != null && o.contains(e.target) || (console.log("closing because focus is ourside", document.activeElement), D(), v.value = !1, document.removeEventListener("click", k), document.removeEventListener("focusin", g), s("inactive")));
98
- }, k = (e) => {
99
- var t, o;
100
- e.target instanceof HTMLElement && ((t = m.value) != null && t.contains(e.target) || (o = a.value) != null && o.contains(e.target) || (console.log("closing because clicked outside", a.value, e.target), D(), v.value = !1, document.removeEventListener("click", k), document.removeEventListener("focusin", g), s("inactive")));
101
- }, W = {
102
- "onUpdate:modelValue": (e) => s("update:modelValue", e)
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, t) => (L(), K("span", {
105
- class: M([C.value, "bb-base-date-picker-input__container"]),
123
+ return (e, a) => (Y(), J("span", {
124
+ class: $([P.value, "bb-base-date-picker-input__container"]),
106
125
  ref_key: "outerContainer",
107
- ref: m
126
+ ref: y
108
127
  }, [
109
- i(e.$slots, "prepend-outer"),
110
- h("span", {
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: r
132
+ ref: s
114
133
  }, [
115
- i(e.$slots, "prepend"),
116
- N(h("input", Y({
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: O.value,
127
- onFocus: U,
128
- onKeydown: F,
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
- }, P), null, 16, fe), [
132
- [q(se)]
150
+ ref: w
151
+ }, F), null, 16, ke), [
152
+ [X(pe)]
133
153
  ]),
134
- i(e.$slots, "append")
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
- i(e.$slots, "append-outer"),
137
- (L(), R(G, { to: "body" }, [
138
- h("span", {
139
- class: M(["bb-base-date-picker-input__calendar", {
140
- "bb-base-date-picker-input__calendar--active": v.value,
141
- "bb-base-date-picker-input__calendar--shown": c.value,
142
- "bb-base-date-picker-input__calendar--showing": b.value,
143
- "bb-base-date-picker-input__calendar--hiding": y.value,
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: a
171
+ ref: t,
172
+ onKeydown: U
148
173
  }, [
149
- J(ie, Y({
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
- }, W), Q({ _: 2 }, [
158
- X(e.$slots, (o, f) => ({
159
- name: f,
160
- fn: Z((H) => [
161
- i(e.$slots, f, x(ee(H)))
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
- ], 2)
193
+ ], 34)
166
194
  ]))
167
195
  ], 2));
168
196
  }
169
197
  });
170
198
  export {
171
- Ye as default
199
+ Ce as default
172
200
  };
173
201
  //# sourceMappingURL=index10.js.map
@@ -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","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;;;;;;;AAGA,MAAMA,KAAa,CAAC,gBAAgB,aAAa,YAAY,MAAM,QAAQ,eAAe,YAAY,OAAO,GA0CjFC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,MAAM;AAAA,IAC/B,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,gBAAgB,CAAC;AAAA,IACjB,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,YAAY,CAAC;AAAA,IACb,MAAM,CAAC;AAAA,IACP,aAAa,CAAC;AAAA,IACd,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,SAAS,IAAI;AAAA,EACxB;AAAA,EACA,OAAO,CAAC,qBAAqB,UAAU;AAAA,EACvC,MAAMC,GAAc,EAAE,MAAAC,KAAQ;AAEhC,UAAMC,IAA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aC,IAAgBN,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,CAAsB,GAAGgB,EAAa,EAAE,GAAG,KAAK;AAAA,YACjDC,EAAYhB,EAAK,QAAQ,CAACiB,GAAGC,OACpB;AAAA,cACL,MAAAA;AAAA,cACA,IAAIC,EAAS,CAACxC,MAAS;AAAA,gBACrB0B,EAAYL,EAAK,QAAQkB,GAAME,EAAgBC,GAAoB1C,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,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,MAAM,QAAQ;AAAA,IAC3B,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,gBAAgB,CAAC;AAAA,IACjB,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,YAAY,CAAC;AAAA,IACb,MAAM,CAAC;AAAA,IACP,aAAa,CAAC;AAAA,IACd,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,SAAS,IAAI;AAAA,EACxB;AAAA,EACA,OAAO,CAAC,qBAAqB,UAAU;AAAA,EACvC,MAAMC,GAAc,EAAE,MAAAC,KAAQ;AAEhC,UAAMC,IAAQF;AAEd,IAAAG,EAAM,OAAOC,EAAiB,GAC9BD,EAAM,OAAOE,EAAE;AAMT,UAAAC,IAAWC,EAAwB,IAAI,GACvCC,IAAiBD,EAAwB,IAAI,GAC7CE,IAAiBF,EAAwB,IAAI,GAC7CG,IAAQH,EAAwB,IAAI,GACpCI,IAAaJ,EAAmB,IAAI,GACpCK,IAAiBL,KAEjBM,IAAUC,EAAS,OAAO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AAY,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 o from "./index8.js";
2
- import "./index9.js";
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
- o as default
44
+ w as default
5
45
  };
6
46
  //# sourceMappingURL=index100.js.map
@@ -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
@@ -1,5 +1,5 @@
1
- import o from "./index10.js";
2
- import "./index11.js";
1
+ import o from "./index2.js";
2
+ import "./index3.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index102.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index12.js";
2
- import "./index13.js";
1
+ import o from "./index4.js";
2
+ import "./index5.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index103.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index14.js";
2
- import "./index15.js";
1
+ import o from "./index6.js";
2
+ import "./index7.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index104.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index16.js";
2
- import "./index17.js";
1
+ import o from "./index8.js";
2
+ import "./index9.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index105.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index18.js";
2
- import "./index19.js";
1
+ import o from "./index10.js";
2
+ import "./index11.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index106.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index20.js";
2
- import "./index21.js";
1
+ import o from "./index12.js";
2
+ import "./index13.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index107.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index22.js";
2
- import "./index23.js";
1
+ import o from "./index14.js";
2
+ import "./index15.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index108.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index24.js";
2
- import "./index25.js";
1
+ import o from "./index16.js";
2
+ import "./index17.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index109.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index26.js";
2
- import "./index27.js";
1
+ import o from "./index18.js";
2
+ import "./index19.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index110.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index28.js";
2
- import "./index29.js";
1
+ import o from "./index20.js";
2
+ import "./index21.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index111.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index30.js";
2
- import "./index31.js";
1
+ import o from "./index22.js";
2
+ import "./index23.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index112.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index32.js";
2
- import "./index33.js";
1
+ import o from "./index24.js";
2
+ import "./index25.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index113.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index34.js";
2
- import "./index35.js";
1
+ import o from "./index26.js";
2
+ import "./index27.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index114.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index36.js";
2
- import "./index37.js";
1
+ import o from "./index28.js";
2
+ import "./index29.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index115.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index38.js";
2
- import "./index39.js";
1
+ import o from "./index30.js";
2
+ import "./index31.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index116.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index40.js";
2
- import "./index41.js";
1
+ import o from "./index32.js";
2
+ import "./index33.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index117.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index42.js";
2
- import "./index43.js";
1
+ import o from "./index34.js";
2
+ import "./index35.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index118.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index93.js";
2
- import "./index119.js";
1
+ import o from "./index36.js";
2
+ import "./index37.js";
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index119.js CHANGED
@@ -1,5 +1,6 @@
1
- const e = "";
1
+ import o from "./index38.js";
2
+ import "./index39.js";
2
3
  export {
3
- e as default
4
+ o as default
4
5
  };
5
6
  //# sourceMappingURL=index119.js.map