bitboss-ui 2.0.3 → 2.0.5

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 (261) hide show
  1. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +10 -99
  2. package/dist/components/BaseDatePicker/BaseDatePickerHeader.vue.d.ts +24 -0
  3. package/dist/components/BaseDatePicker/BaseDatePickerInputDaySelector.vue.d.ts +56 -0
  4. package/dist/components/BaseDatePicker/BaseDatePickerMonthSelector.vue.d.ts +21 -0
  5. package/dist/components/BaseDatePicker/BaseDatePickerYearSelector.vue.d.ts +21 -0
  6. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +1 -46
  7. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -47
  8. package/dist/components/BbTab/BbTab.vue.d.ts +9 -0
  9. package/dist/components/Transitions/Slide.vue.d.ts +43 -0
  10. package/dist/components/Transitions/SlideBack.vue.d.ts +43 -0
  11. package/dist/composables/useLogger.d.ts +1 -0
  12. package/dist/index103.js +150 -126
  13. package/dist/index103.js.map +1 -1
  14. package/dist/index105.js +5 -5
  15. package/dist/index113.js +1 -1
  16. package/dist/index115.js +5 -5
  17. package/dist/index115.js.map +1 -1
  18. package/dist/index117.js +1 -1
  19. package/dist/index12.js +1 -1
  20. package/dist/index121.js +1 -1
  21. package/dist/index122.js +1 -1
  22. package/dist/index123.js +1 -1
  23. package/dist/index125.js +1 -1
  24. package/dist/index128.js +1 -1
  25. package/dist/index14.js +3 -3
  26. package/dist/index16.js +2 -2
  27. package/dist/index18.js +176 -482
  28. package/dist/index18.js.map +1 -1
  29. package/dist/index198.js +3 -5
  30. package/dist/index198.js.map +1 -1
  31. package/dist/index199.js +5 -158
  32. package/dist/index199.js.map +1 -1
  33. package/dist/index20.js +199 -190
  34. package/dist/index20.js.map +1 -1
  35. package/dist/index200.js +16 -84
  36. package/dist/index200.js.map +1 -1
  37. package/dist/{index223.js → index201.js} +3 -3
  38. package/dist/{index223.js.map → index201.js.map} +1 -1
  39. package/dist/index202.js +19 -3
  40. package/dist/index202.js.map +1 -1
  41. package/dist/index203.js +19 -3
  42. package/dist/index203.js.map +1 -1
  43. package/dist/index204.js +26 -34
  44. package/dist/index204.js.map +1 -1
  45. package/dist/index205.js +3 -6
  46. package/dist/index205.js.map +1 -1
  47. package/dist/index206.js +2 -7
  48. package/dist/index206.js.map +1 -1
  49. package/dist/index207.js +8 -2
  50. package/dist/index207.js.map +1 -1
  51. package/dist/index208.js +245 -122
  52. package/dist/index208.js.map +1 -1
  53. package/dist/index210.js +51 -122
  54. package/dist/index210.js.map +1 -1
  55. package/dist/index211.js +37 -19
  56. package/dist/index211.js.map +1 -1
  57. package/dist/index212.js +5 -2
  58. package/dist/index212.js.map +1 -1
  59. package/dist/index213.js +41 -2
  60. package/dist/index213.js.map +1 -1
  61. package/dist/index214.js +2 -174
  62. package/dist/index214.js.map +1 -1
  63. package/dist/index215.js +4 -42
  64. package/dist/index215.js.map +1 -1
  65. package/dist/index216.js +5 -0
  66. package/dist/index216.js.map +1 -0
  67. package/dist/index217.js +2 -13
  68. package/dist/index217.js.map +1 -1
  69. package/dist/index218.js +42 -369
  70. package/dist/index218.js.map +1 -1
  71. package/dist/index22.js +5 -5
  72. package/dist/index220.js +13 -4
  73. package/dist/index220.js.map +1 -1
  74. package/dist/index221.js +158 -2
  75. package/dist/index221.js.map +1 -1
  76. package/dist/index222.js +84 -16
  77. package/dist/index222.js.map +1 -1
  78. package/dist/index224.js +3 -19
  79. package/dist/index224.js.map +1 -1
  80. package/dist/index225.js +34 -26
  81. package/dist/index225.js.map +1 -1
  82. package/dist/index226.js +6 -8
  83. package/dist/index226.js.map +1 -1
  84. package/dist/index227.js +7 -2
  85. package/dist/index227.js.map +1 -1
  86. package/dist/index228.js +126 -3
  87. package/dist/index228.js.map +1 -1
  88. package/dist/index229.js +123 -3
  89. package/dist/index229.js.map +1 -1
  90. package/dist/index230.js +2 -18
  91. package/dist/index230.js.map +1 -1
  92. package/dist/index231.js +173 -105
  93. package/dist/index231.js.map +1 -1
  94. package/dist/index232.js +8 -0
  95. package/dist/index232.js.map +1 -0
  96. package/dist/index233.js +367 -98
  97. package/dist/index233.js.map +1 -1
  98. package/dist/index234.js +6 -0
  99. package/dist/index234.js.map +1 -0
  100. package/dist/index235.js +17 -9
  101. package/dist/index235.js.map +1 -1
  102. package/dist/index236.js +106 -3
  103. package/dist/index236.js.map +1 -1
  104. package/dist/index238.js +100 -23
  105. package/dist/index238.js.map +1 -1
  106. package/dist/index24.js +1 -1
  107. package/dist/index240.js +2 -16
  108. package/dist/index240.js.map +1 -1
  109. package/dist/index241.js +10 -9
  110. package/dist/index241.js.map +1 -1
  111. package/dist/index242.js +3 -3
  112. package/dist/index242.js.map +1 -1
  113. package/dist/index243.js +224 -12
  114. package/dist/index243.js.map +1 -1
  115. package/dist/index244.js +280 -8
  116. package/dist/index244.js.map +1 -1
  117. package/dist/index245.js +6 -9
  118. package/dist/index245.js.map +1 -1
  119. package/dist/index246.js +2 -17
  120. package/dist/index246.js.map +1 -1
  121. package/dist/index247.js +2 -224
  122. package/dist/index247.js.map +1 -1
  123. package/dist/index248.js +2 -431
  124. package/dist/index248.js.map +1 -1
  125. package/dist/index249.js +2 -89
  126. package/dist/index249.js.map +1 -1
  127. package/dist/index250.js +2 -281
  128. package/dist/index250.js.map +1 -1
  129. package/dist/index251.js +2 -6
  130. package/dist/index251.js.map +1 -1
  131. package/dist/index252.js +3 -2
  132. package/dist/index252.js.map +1 -1
  133. package/dist/index253.js +2 -2
  134. package/dist/index254.js +2 -2
  135. package/dist/index255.js +2 -126
  136. package/dist/index255.js.map +1 -1
  137. package/dist/index256.js +28 -3
  138. package/dist/index256.js.map +1 -1
  139. package/dist/index257.js +25 -0
  140. package/dist/index257.js.map +1 -0
  141. package/dist/index259.js +6 -3
  142. package/dist/index259.js.map +1 -1
  143. package/dist/index26.js +3 -3
  144. package/dist/index260.js +4 -2
  145. package/dist/index260.js.map +1 -1
  146. package/dist/index261.js +8 -68
  147. package/dist/index261.js.map +1 -1
  148. package/dist/index262.js +23 -200
  149. package/dist/index262.js.map +1 -1
  150. package/dist/index263.js +3 -5
  151. package/dist/index263.js.map +1 -1
  152. package/dist/index265.js +6 -127
  153. package/dist/index265.js.map +1 -1
  154. package/dist/index266.js +16 -2
  155. package/dist/index266.js.map +1 -1
  156. package/dist/index267.js +9 -2
  157. package/dist/index267.js.map +1 -1
  158. package/dist/index268.js +3 -2
  159. package/dist/index268.js.map +1 -1
  160. package/dist/index269.js +12 -2
  161. package/dist/index269.js.map +1 -1
  162. package/dist/index270.js +7 -26
  163. package/dist/index270.js.map +1 -1
  164. package/dist/index271.js +9 -3
  165. package/dist/index271.js.map +1 -1
  166. package/dist/index272.js +17 -3
  167. package/dist/index272.js.map +1 -1
  168. package/dist/index273.js +426 -206
  169. package/dist/index273.js.map +1 -1
  170. package/dist/index274.js +92 -0
  171. package/dist/index274.js.map +1 -0
  172. package/dist/index275.js +2 -4
  173. package/dist/index275.js.map +1 -1
  174. package/dist/index276.js +69 -4
  175. package/dist/index276.js.map +1 -1
  176. package/dist/index277.js +5 -59
  177. package/dist/index277.js.map +1 -1
  178. package/dist/index278.js +200 -15
  179. package/dist/index278.js.map +1 -1
  180. package/dist/index279.js +2 -35
  181. package/dist/index279.js.map +1 -1
  182. package/dist/index28.js +2 -2
  183. package/dist/index280.js +125 -10
  184. package/dist/index280.js.map +1 -1
  185. package/dist/index281.js +21 -1
  186. package/dist/index281.js.map +1 -1
  187. package/dist/{index264.js → index283.js} +2 -2
  188. package/dist/{index264.js.map → index283.js.map} +1 -1
  189. package/dist/index284.js +123 -417
  190. package/dist/index284.js.map +1 -1
  191. package/dist/index285.js +3 -47
  192. package/dist/index285.js.map +1 -1
  193. package/dist/index286.js +6 -0
  194. package/dist/index286.js.map +1 -0
  195. package/dist/index287.js +214 -0
  196. package/dist/index287.js.map +1 -0
  197. package/dist/index289.js +18 -0
  198. package/dist/index289.js.map +1 -0
  199. package/dist/index290.js +10 -0
  200. package/dist/index290.js.map +1 -0
  201. package/dist/index291.js +22 -0
  202. package/dist/index291.js.map +1 -0
  203. package/dist/index292.js +10 -0
  204. package/dist/index292.js.map +1 -0
  205. package/dist/index293.js +7 -0
  206. package/dist/index293.js.map +1 -0
  207. package/dist/index294.js +7 -0
  208. package/dist/index294.js.map +1 -0
  209. package/dist/index295.js +62 -0
  210. package/dist/index295.js.map +1 -0
  211. package/dist/index296.js +38 -0
  212. package/dist/index296.js.map +1 -0
  213. package/dist/index297.js +14 -0
  214. package/dist/index297.js.map +1 -0
  215. package/dist/index298.js +5 -0
  216. package/dist/index298.js.map +1 -0
  217. package/dist/{index282.js → index299.js} +3 -3
  218. package/dist/{index282.js.map → index299.js.map} +1 -1
  219. package/dist/index30.js +2 -2
  220. package/dist/index301.js +424 -0
  221. package/dist/index301.js.map +1 -0
  222. package/dist/index302.js +50 -0
  223. package/dist/index302.js.map +1 -0
  224. package/dist/index32.js +3 -3
  225. package/dist/index34.js +44 -42
  226. package/dist/index34.js.map +1 -1
  227. package/dist/index36.js +4 -4
  228. package/dist/index38.js +2 -2
  229. package/dist/index40.js +2 -2
  230. package/dist/index42.js +6 -6
  231. package/dist/index44.js +2 -2
  232. package/dist/index46.js +2 -2
  233. package/dist/index52.js +1 -1
  234. package/dist/index54.js +1 -1
  235. package/dist/index58.js +2 -2
  236. package/dist/index66.js +16 -23
  237. package/dist/index66.js.map +1 -1
  238. package/dist/index70.js +4 -4
  239. package/dist/index74.js +2 -2
  240. package/dist/index76.js +1 -1
  241. package/dist/index79.js +2 -2
  242. package/dist/index81.js +1 -1
  243. package/dist/index83.js +3 -3
  244. package/dist/index85.js +1 -1
  245. package/dist/style.css +1 -1
  246. package/dist/utilities/functions/chunk.d.ts +1 -0
  247. package/dist/utilities/functions/negative.d.ts +1 -0
  248. package/dist/utilities/functions/pipe.d.ts +3 -0
  249. package/dist/utilities/functions/range.d.ts +1 -0
  250. package/dist/utilities/functions/sort.d.ts +6 -0
  251. package/package.json +2 -2
  252. package/dist/index209.js +0 -8
  253. package/dist/index209.js.map +0 -1
  254. package/dist/index219.js +0 -5
  255. package/dist/index219.js.map +0 -1
  256. package/dist/index237.js +0 -12
  257. package/dist/index237.js.map +0 -1
  258. package/dist/index239.js +0 -9
  259. package/dist/index239.js.map +0 -1
  260. package/dist/index258.js +0 -10
  261. package/dist/index258.js.map +0 -1
package/dist/index20.js CHANGED
@@ -1,24 +1,27 @@
1
- import { defineComponent as re, ref as n, computed as b, watch as le, openBlock as L, createBlock as F, normalizeClass as z, withCtx as l, renderSlot as d, createVNode as P, withDirectives as ie, createElementVNode as r, mergeProps as W, unref as v, toDisplayString as j, Teleport as se, normalizeStyle as ue, createSlots as de, renderList as ce, normalizeProps as pe, guardReactiveProps as fe, createCommentVNode as me } from "vue";
2
- import { useFloating as be } from "./index208.js";
3
- import o from "./index209.js";
4
- import ve from "./index210.js";
5
- import ge from "./index211.js";
6
- import { identity as ye } from "./index212.js";
7
- import { last as ke } from "./index213.js";
8
- import { useFocusTrap as he } from "./index204.js";
9
- import { useId as Me } from "./index7.js";
10
- import { useIntersectionObserver as we } from "./index127.js";
11
- import { useMobile as Ve } from "./index8.js";
12
- import { vMaska as Ce } from "./index214.js";
13
- import { wait as S } from "./index126.js";
14
- import { waitFor as _e } from "./index205.js";
15
- import Ye from "./index18.js";
1
+ import { defineComponent as ae, ref as o, computed as v, watch as oe, openBlock as w, createBlock as V, normalizeClass as B, withCtx as i, renderSlot as d, createVNode as E, withDirectives as ne, createElementVNode as r, mergeProps as I, unref as c, toDisplayString as F, Teleport as re, normalizeStyle as le, KeepAlive as ie, createCommentVNode as L } from "vue";
2
+ import { useFloating as se } from "./index228.js";
3
+ import n from "./index199.js";
4
+ import ue from "./index229.js";
5
+ import de from "./index202.js";
6
+ import ce from "./index200.js";
7
+ import pe from "./index201.js";
8
+ import { identity as me } from "./index230.js";
9
+ import { last as fe } from "./index206.js";
10
+ import { useFocusTrap as be } from "./index225.js";
11
+ import { useId as ve } from "./index7.js";
12
+ import { useIntersectionObserver as ye } from "./index127.js";
13
+ import { useMobile as ge } from "./index8.js";
14
+ import { vMaska as ke } from "./index231.js";
15
+ import { wait as he } from "./index126.js";
16
+ import { waitFor as Me } from "./index226.js";
17
+ import we from "./index18.js";
16
18
  /* empty css */
17
- import De from "./index215.js";
19
+ import Ve from "./index218.js";
18
20
  /* empty css */
19
- import Ae from "./index217.js";
20
- import { autoUpdate as Se, flip as $e, offset as Oe, shift as Be, hide as Ee } from "./index218.js";
21
- const Ie = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska", "disabled", "inputmode", "name", "placeholder", "readonly", "required", "value"], Le = ["disabled"], Fe = /* @__PURE__ */ r("svg", {
21
+ import Ce from "./index220.js";
22
+ import Ye from "./index232.js";
23
+ import { autoUpdate as Ae, flip as De, offset as Se, shift as _e, hide as $e } from "./index233.js";
24
+ const Oe = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska", "disabled", "inputmode", "name", "placeholder", "readonly", "required", "value"], Be = ["disabled"], Ee = /* @__PURE__ */ r("svg", {
22
25
  fill: "none",
23
26
  viewBox: "0 0 16 16",
24
27
  xmlns: "http://www.w3.org/2000/svg"
@@ -47,7 +50,7 @@ const Ie = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska",
47
50
  "stroke-linecap": "round",
48
51
  "stroke-linejoin": "round"
49
52
  })
50
- ], -1), ze = ["id"], oa = /* @__PURE__ */ re({
53
+ ], -1), Ie = ["id"], nt = /* @__PURE__ */ ae({
51
54
  __name: "BaseDatePickerInput",
52
55
  props: {
53
56
  allowWriting: { type: [Boolean, String], default: !0 },
@@ -66,231 +69,237 @@ const Ie = ["id", "aria-describedby", "autocomplete", "autofocus", "data-maska",
66
69
  placeholder: {},
67
70
  "prepend:icon": {},
68
71
  range: { type: Boolean },
69
- readonly: {},
72
+ readonly: { type: Boolean },
70
73
  required: { type: Boolean },
71
74
  selectable: {},
72
75
  width: { default: 290 }
73
76
  },
74
77
  emits: ["active", "error", "focus", "inactive", "update:modelValue"],
75
- setup(q, { emit: G }) {
76
- o.extend(ve), o.locale(ge);
77
- const a = q, i = G, s = n(null), _ = n(null), c = n(null), H = n(null), g = n(null), Y = n(), y = a.id || `bdpi_${Me().id.value}`, { isMobile: $ } = Ve(), T = b(
78
- () => a.allowWriting === "not-mobile" && $.value ? "none" : "numeric"
79
- ), D = n(!0);
80
- we(
81
- c,
78
+ setup(W, { emit: j }) {
79
+ n.extend(ue), n.extend(ce), n.extend(pe), n.locale(de);
80
+ const t = W, s = j, u = o(null), C = o(null), p = o(null), z = o(null), y = o(null), A = o(), g = t.id || `bdpi_${ve().id.value}`, { isMobile: D } = ge(), q = v(
81
+ () => t.allowWriting === "not-mobile" && D.value ? "none" : "numeric"
82
+ ), Y = o(!0);
83
+ ye(
84
+ p,
82
85
  ([{ intersectionRatio: e }]) => {
83
- e === 1 ? D.value = !0 : (D.value = !1, (h.value || M.value) && (I(), c.value && c.value.$el.querySelector(
86
+ e === 1 ? Y.value = !0 : (Y.value = !1, m.value && (O(), p.value && p.value.$el.querySelector(
84
87
  ".bb-base-date-picker-input__calendar-btn"
85
- ).focus(), V()));
88
+ ).focus(), M()));
86
89
  },
87
90
  { threshold: [0, 1] }
88
91
  );
89
- const N = b(() => ({
92
+ const G = v(() => ({
90
93
  "bb-base-date-picker-input": !0,
91
- "bb-base-date-picker-input--active": p.value,
92
- "bb-base-date-picker-input--errors": a.hasErrors,
93
- "bb-base-date-picker-input--loading": a.loading,
94
- "bb-base-date-picker-input--readonly": a.readonly,
95
- "bb-base-date-picker-input--disabled": a.disabled
96
- })), R = {
94
+ "bb-base-date-picker-input--active": k.value,
95
+ "bb-base-date-picker-input--errors": t.hasErrors,
96
+ "bb-base-date-picker-input--loading": t.loading,
97
+ "bb-base-date-picker-input--readonly": t.readonly,
98
+ "bb-base-date-picker-input--disabled": t.disabled
99
+ })), P = {
97
100
  onInput: (e) => {
98
- if (!a.range && e.target instanceof HTMLInputElement)
99
- if (g.value = e.target.value, /\d{2}\/\d{2}\/\d{4}/.test(e.target.value)) {
100
- const t = o(e.target.value, "DD/MM/YYYY");
101
- ne(t) ? i("error", "invalid_date_typed") : i("update:modelValue", t.toISOString());
102
- } else e.target.value === "" && i("update:modelValue", null);
101
+ if (!t.range && e.target instanceof HTMLInputElement)
102
+ if (y.value = e.target.value, /\d{2}\/\d{2}\/\d{4}/.test(e.target.value)) {
103
+ const a = n(e.target.value, "DD/MM/YYYY");
104
+ ee(a) ? (e.target.value = "", s("update:modelValue", null), s("error", "invalid_date_typed")) : s("update:modelValue", a.toISOString());
105
+ } else e.target.value === "" && s("update:modelValue", null);
103
106
  }
104
- }, p = n(!1), U = () => {
105
- p.value || (i("active"), p.value = !0, document.addEventListener("focusin", k), document.addEventListener("click", k));
106
- }, k = (e) => {
107
- var t, u;
108
- f.value || e.target instanceof HTMLElement && (t = _.value) != null && t.$el && !_.value.$el.contains(e.target) && !((u = s.value) != null && u.contains(e.target)) && (p.value = !1, i("inactive"), document.removeEventListener("focusin", k), document.removeEventListener("click", k));
109
- }, O = (e) => {
107
+ }, k = o(!1), H = () => {
108
+ k.value || (s("active"), k.value = !0, document.addEventListener("focusin", h), document.addEventListener("click", h));
109
+ }, h = (e) => {
110
+ var a, l;
111
+ f.value || e.target instanceof HTMLElement && (a = C.value) != null && a.$el && !C.value.$el.contains(e.target) && !((l = u.value) != null && l.contains(e.target)) && (k.value = !1, s("inactive"), document.removeEventListener("focusin", h), document.removeEventListener("click", h));
112
+ }, S = (e) => {
110
113
  if (e)
111
114
  if (Array.isArray(e)) {
112
- let t, u;
113
- return e.length && (t = e[0]), e.length > 1 && (u = ke(e)), [t, u].filter(ye).map((C) => o(C).format("DD/MM/YYYY")).join(" - ");
115
+ let a, l;
116
+ return e.length && (a = e[0]), e.length > 1 && (l = fe(e)), [a, l].filter(me).map((te) => n(te).format("DD/MM/YYYY")).join(" - ");
114
117
  } else
115
- return o(e).format("DD/MM/YYYY");
118
+ return n(e).format("DD/MM/YYYY");
116
119
  return null;
117
- }, Z = b(() => g.value ? g.value : O(a.modelValue));
118
- le(
119
- () => a.modelValue,
120
+ }, T = v(() => y.value ? y.value : S(t.modelValue));
121
+ oe(
122
+ () => t.modelValue,
120
123
  (e) => {
121
- g.value = O(e);
124
+ y.value = S(e);
122
125
  }
123
126
  );
124
- const { floatingStyles: J } = be(c, s, {
127
+ const { floatingStyles: N, placement: U } = se(p, u, {
125
128
  placement: "bottom",
126
- whileElementsMounted: Se,
127
- middleware: [$e(), Oe(5), Be({ padding: 6 }), Ee()]
128
- }), K = b(() => {
129
+ whileElementsMounted: Ae,
130
+ middleware: [De(), Se(5), _e({ padding: 6 }), $e()]
131
+ }), K = v(() => {
129
132
  const e = {
130
- ...J.value
133
+ ...N.value
131
134
  };
132
- return s.value, e;
133
- }), h = n(!1), M = n(!1), A = n(!1), w = n(!0), Q = async () => {
134
- w.value = !1, M.value = !0, await S(350), M.value = !1, w.value = !1, h.value = !0;
135
- }, V = async () => {
136
- var e, t;
137
- h.value = !1, A.value = !0, await S(350), w.value = !0, A.value = !1, (e = Y.value) == null || e.setSelectionModeToDay(), (t = Y.value) == null || t.setCursor(a.modelValue);
138
- }, B = n(!1), E = async () => {
139
- f.value || (B.value = !0, await _e(() => !!s.value), await Q(), X());
140
- }, f = n(!1), { activate: X, deactivate: I } = he(s, {
135
+ return u.value, e;
136
+ }), m = o(!1), R = async () => {
137
+ m.value = !0;
138
+ }, M = async () => {
139
+ var e;
140
+ m.value = !1, (e = A.value) == null || e.resetStatus();
141
+ }, _ = o(!1), $ = async () => {
142
+ f.value || (_.value = !0, await Me(() => !!u.value), await R(), Z());
143
+ }, f = o(!1), { activate: Z, deactivate: O } = be(u, {
141
144
  onActivate: () => f.value = !0,
142
145
  // On post activation focus on current date
143
146
  onPostActivate: () => {
144
147
  var e;
145
- (e = s.value.querySelector(
148
+ (e = u.value.querySelector(
146
149
  ".bb-base-date-picker-date--current button"
147
150
  )) == null || e.focus();
148
151
  },
149
152
  onPostDeactivate: async () => {
150
- await S(200), f.value = !1;
153
+ await he(200), f.value = !1;
151
154
  },
152
155
  /* On esc deactivate the trap, return focus and then close the modal */
153
- escapeDeactivates: () => (m.value = !1, V(), !0),
154
- clickOutsideDeactivates: () => (m.value = !1, V(), !0),
156
+ escapeDeactivates: () => (b.value = !1, M(), !0),
157
+ clickOutsideDeactivates: () => (b.value = !1, M(), !0),
155
158
  allowOutsideClick: !0,
156
159
  preventScroll: !0
157
- }), m = n(!a.allowWriting || a.range), x = async (e) => {
158
- i("focus", e), m.value && E(), m.value = !a.allowWriting || a.allowWriting === "not-mobile" && $.value || a.range;
159
- }, ee = (e) => a.range && Array.isArray(e) && e.length === 2 || !a.range && !!e, ae = {
160
+ }), b = o(!t.allowWriting || t.range), J = async (e) => {
161
+ s("focus", e), b.value && $(), b.value = !t.allowWriting || t.allowWriting === "not-mobile" && D.value || t.range;
162
+ }, Q = (e) => t.range && Array.isArray(e) && e.length === 2 || !t.range && !!e, X = {
160
163
  "onUpdate:modelValue": (e) => {
161
- i("update:modelValue", e), ee(e) && (m.value = !1, I({
164
+ s("update:modelValue", e), Q(e) && (b.value = !1, O({
162
165
  onPostDeactivate: () => {
163
- f.value = !1, V();
166
+ f.value = !1, M();
164
167
  }
165
168
  }));
166
169
  }
167
- }, te = b(() => {
168
- if (a.range) {
169
- if (!a.modelValue || a.modelValue.length < 2)
170
+ }, x = v(() => {
171
+ if (t.range) {
172
+ if (!t.modelValue || t.modelValue.length < 2)
170
173
  return "Seleziona un range";
171
- const e = o(a.modelValue[0]).format("D MMMM YYYY"), t = o(a.modelValue[1]).format("D MMMM YYYY");
172
- if (a.range && a.modelValue.length === 2)
173
- return `Cambia selezione, da ${e} a ${t}`;
174
- } else if (typeof a.modelValue == "string")
175
- return `Cambia selezione, ${o(a.modelValue).format("D MMMM YYYY")}`;
174
+ const e = n(t.modelValue[0]).format("D MMMM YYYY"), a = n(t.modelValue[1]).format("D MMMM YYYY");
175
+ if (t.range && t.modelValue.length === 2)
176
+ return `Cambia selezione, da ${e} a ${a}`;
177
+ } else if (typeof t.modelValue == "string")
178
+ return `Cambia selezione, ${n(t.modelValue).format("D MMMM YYYY")}`;
176
179
  return "Seleziona una data";
177
- }), ne = (e) => {
178
- let t = !0;
179
- return a.min && t && (t = e.isSameOrAfter(o(a.min).startOf("day"))), a.max && t && (t = e.isSameOrBefore(o(a.max).startOf("day"))), typeof a.selectable == "function" && t && (t = a.selectable(e.toDate())), !t;
180
+ }), ee = (e) => {
181
+ console.log(e);
182
+ let a = !0;
183
+ return t.min && a && (a = e.isSameOrAfter(n(t.min).startOf("day"))), t.max && a && (a = e.isSameOrBefore(n(t.max).startOf("day"))), typeof t.selectable == "function" && a && (a = t.selectable(e.toDate())), !a;
180
184
  };
181
- return (e, t) => (L(), F(Ae, {
185
+ return (e, a) => (w(), V(Ce, {
182
186
  ref_key: "outerContainer",
183
- ref: _,
184
- class: z(N.value),
185
- onFocusin: U
187
+ ref: C,
188
+ class: B(G.value),
189
+ onFocusin: H
186
190
  }, {
187
- "prepend-outer": l(() => [
191
+ "prepend-outer": i(() => [
188
192
  d(e.$slots, "prepend-outer")
189
193
  ]),
190
- "append-outer": l(() => [
194
+ "append-outer": i(() => [
191
195
  d(e.$slots, "append-outer")
192
196
  ]),
193
- default: l(() => [
194
- P(De, {
195
- ref_key: "innerContainer",
196
- ref: c,
197
- "append:icon": a["append:icon"],
198
- "prepend:icon": a["prepend:icon"]
199
- }, {
200
- prepend: l(() => [
201
- d(e.$slots, "prepend")
202
- ]),
203
- prefix: l(() => [
204
- d(e.$slots, "prefix")
205
- ]),
206
- append: l(() => [
207
- d(e.$slots, "append")
208
- ]),
209
- suffix: l(() => [
210
- d(e.$slots, "suffix")
211
- ]),
212
- default: l(() => [
213
- ie(r("input", W({
214
- id: v(y),
215
- ref_key: "input",
216
- ref: H,
217
- "aria-describedby": `bdpi_description_${v(y)}`,
218
- autocomplete: e.autocomplete,
219
- autofocus: e.autofocus,
220
- "data-maska": a.range ? "##/##/#### - ##/##/####" : "##/##/####",
221
- disabled: e.disabled,
222
- inputmode: T.value,
223
- name: e.name,
224
- placeholder: e.placeholder,
225
- readonly: e.readonly || e.range || !e.allowWriting,
226
- required: e.required
227
- }, R, {
228
- size: "1",
229
- type: "text",
230
- value: Z.value,
231
- onFocus: x
232
- }), null, 16, Ie), [
233
- [v(Ce)]
197
+ default: i(() => {
198
+ var l;
199
+ return [
200
+ E(Ve, {
201
+ ref_key: "innerContainer",
202
+ ref: p,
203
+ "append:icon": t["append:icon"],
204
+ "prepend:icon": t["prepend:icon"]
205
+ }, {
206
+ prepend: i(() => [
207
+ d(e.$slots, "prepend")
234
208
  ]),
235
- r("button", {
236
- class: "bb-base-date-picker-input__calendar-btn",
237
- disabled: e.disabled || e.readonly || !D.value,
238
- type: "button",
239
- onClick: E
240
- }, [
241
- Fe,
242
- r("span", null, j(te.value), 1)
243
- ], 8, Le),
244
- r("span", {
245
- id: `bdpi_description_${v(y)}`,
246
- class: "bb-base-date-picker-input__accessible-description"
247
- }, "Formato della data " + j(a.range ? "GG/MM/AAAA - GG/MM/AAAA" : "GG/MM/AAAA"), 9, ze)
248
- ]),
249
- _: 3
250
- }, 8, ["append:icon", "prepend:icon"]),
251
- B.value ? (L(), F(se, {
252
- key: 0,
253
- to: "body"
254
- }, [
255
- r("span", {
256
- ref_key: "calendar",
257
- ref: s,
258
- class: z(["bb-base-date-picker-input__calendar", {
259
- "bb-base-date-picker-input__calendar--active": p.value,
260
- "bb-base-date-picker-input__calendar--shown": h.value,
261
- "bb-base-date-picker-input__calendar--showing": M.value,
262
- "bb-base-date-picker-input__calendar--hiding": A.value,
263
- "bb-base-date-picker-input__calendar--hidden": w.value
264
- }]),
265
- style: ue(K.value)
209
+ prefix: i(() => [
210
+ d(e.$slots, "prefix")
211
+ ]),
212
+ append: i(() => [
213
+ d(e.$slots, "append")
214
+ ]),
215
+ suffix: i(() => [
216
+ d(e.$slots, "suffix")
217
+ ]),
218
+ default: i(() => [
219
+ ne(r("input", I({
220
+ id: c(g),
221
+ ref_key: "input",
222
+ ref: z,
223
+ "aria-describedby": `bdpi_description_${c(g)}`,
224
+ autocomplete: e.autocomplete,
225
+ autofocus: e.autofocus,
226
+ "data-maska": t.range ? "##/##/#### - ##/##/####" : "##/##/####",
227
+ disabled: e.disabled,
228
+ inputmode: q.value,
229
+ name: e.name,
230
+ placeholder: e.placeholder,
231
+ readonly: e.readonly || e.range || !e.allowWriting,
232
+ required: e.required
233
+ }, P, {
234
+ size: "1",
235
+ type: "text",
236
+ value: T.value,
237
+ onFocus: J
238
+ }), null, 16, Oe), [
239
+ [c(ke)]
240
+ ]),
241
+ r("button", {
242
+ class: "bb-base-date-picker-input__calendar-btn",
243
+ disabled: e.disabled || e.readonly || !Y.value,
244
+ type: "button",
245
+ onClick: $
246
+ }, [
247
+ Ee,
248
+ r("span", null, F(x.value), 1)
249
+ ], 8, Be),
250
+ r("span", {
251
+ id: `bdpi_description_${c(g)}`,
252
+ class: "bb-base-date-picker-input__accessible-description"
253
+ }, "Formato della data " + F(t.range ? "GG/MM/AAAA - GG/MM/AAAA" : "GG/MM/AAAA"), 9, Ie)
254
+ ]),
255
+ _: 3
256
+ }, 8, ["append:icon", "prepend:icon"]),
257
+ _.value ? (w(), V(re, {
258
+ key: 0,
259
+ to: "body"
266
260
  }, [
267
- P(Ye, W({ id: v(y) }, ae, {
268
- ref_key: "basedatepicker",
269
- ref: Y,
270
- disabled: e.disabled,
271
- "first-day-of-week": e.firstDayOfWeek,
272
- max: e.max,
273
- min: e.min,
274
- "model-value": e.modelValue,
275
- range: e.range,
276
- readonly: e.readonly,
277
- selectable: e.selectable
278
- }), de({ _: 2 }, [
279
- ce(e.$slots, (u, C) => ({
280
- name: C,
281
- fn: l((oe) => [
282
- d(e.$slots, C, pe(fe(oe)))
283
- ])
284
- }))
285
- ]), 1040, ["id", "disabled", "first-day-of-week", "max", "min", "model-value", "range", "readonly", "selectable"])
286
- ], 6)
287
- ])) : me("", !0)
288
- ]),
261
+ r("span", {
262
+ ref_key: "calendar",
263
+ ref: u,
264
+ class: B(["bb-base-date-picker-input__calendar", {
265
+ "bb-base-date-picker-input__calendar--shown": m.value
266
+ }]),
267
+ style: le(K.value)
268
+ }, [
269
+ E(Ye, {
270
+ direction: (l = c(U)) != null && l.includes("top") ? "bottom" : "top",
271
+ duration: 300
272
+ }, {
273
+ default: i(() => [
274
+ (w(), V(ie, null, [
275
+ m.value ? (w(), V(we, I({
276
+ key: 0,
277
+ id: c(g)
278
+ }, X, {
279
+ ref_key: "basedatepicker",
280
+ ref: A,
281
+ disabled: e.disabled,
282
+ "first-day-of-week": e.firstDayOfWeek,
283
+ max: e.max,
284
+ min: e.min,
285
+ "model-value": e.modelValue,
286
+ range: e.range,
287
+ readonly: e.readonly,
288
+ selectable: e.selectable
289
+ }), null, 16, ["id", "disabled", "first-day-of-week", "max", "min", "model-value", "range", "readonly", "selectable"])) : L("", !0)
290
+ ], 1024))
291
+ ]),
292
+ _: 1
293
+ }, 8, ["direction"])
294
+ ], 6)
295
+ ])) : L("", !0)
296
+ ];
297
+ }),
289
298
  _: 3
290
299
  }, 8, ["class"]));
291
300
  }
292
301
  });
293
302
  export {
294
- oa as default
303
+ nt as default
295
304
  };
296
305
  //# sourceMappingURL=index20.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index20.js","sources":["../src/components/BaseDatePickerInput/BaseDatePickerInput.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer\n\t\tref=\"outerContainer\"\n\t\t:class=\"classes\"\n\t\t@focusin=\"onFocusIn\"\n\t>\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\tref=\"innerContainer\"\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\n\t\t\t<input\n\t\t\t\t:id=\"id\"\n\t\t\t\tref=\"input\"\n\t\t\t\tv-maska\n\t\t\t\t:aria-describedby=\"`bdpi_description_${id}`\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:data-maska=\"props.range ? '##/##/#### - ##/##/####' : '##/##/####'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:inputmode=\"inputmode\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly || range || !allowWriting\"\n\t\t\t\t:required=\"required\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\tsize=\"1\"\n\t\t\t\t:type=\"'text'\"\n\t\t\t\t:value=\"displayValue\"\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t/>\n\t\t\t<button\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar-btn\"\n\t\t\t\t:disabled=\"disabled || readonly || !canOpenCalendar\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t@click=\"onOpenCalendar\"\n\t\t\t>\n\t\t\t\t<svg fill=\"none\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M12.6667 2.66667H3.33333C2.59695 2.66667 2 3.26363 2 4.00001V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4.00001C14 3.26363 13.403 2.66667 12.6667 2.66667Z\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10.6667 1.33333V3.99999\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M5.33333 1.33333V3.99999\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M2 6.66667H14\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\n\t\t\t\t<span>{{ accessibleButtonLabel }}</span>\n\t\t\t</button>\n\t\t\t<span\n\t\t\t\t:id=\"`bdpi_description_${id}`\"\n\t\t\t\tclass=\"bb-base-date-picker-input__accessible-description\"\n\t\t\t\t>Formato della data\n\t\t\t\t{{ props.range ? 'GG/MM/AAAA - GG/MM/AAAA' : 'GG/MM/AAAA' }}</span\n\t\t\t>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\n\t\t<teleport v-if=\"shouldRenderCalendar\" to=\"body\">\n\t\t\t<span\n\t\t\t\tref=\"calendar\"\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-date-picker-input__calendar--active': active,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--shown': shown,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--showing': showing,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hiding': hiding,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hidden': hidden,\n\t\t\t\t}\"\n\t\t\t\t:style=\"calendarStyles\"\n\t\t\t>\n\t\t\t\t<BaseDatePicker\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tv-bind=\"calendarEventListeners\"\n\t\t\t\t\tref=\"basedatepicker\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:first-day-of-week=\"firstDayOfWeek\"\n\t\t\t\t\t:max=\"max\"\n\t\t\t\t\t:min=\"min\"\n\t\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t\t:range=\"range\"\n\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t:selectable=\"selectable\"\n\t\t\t\t>\n\t\t\t\t\t<template v-for=\"(_, name) in $slots\" #[name]=\"data\">\n\t\t\t\t\t\t<slot :name=\"name\" v-bind=\"data\" />\n\t\t\t\t\t</template>\n\t\t\t\t</BaseDatePicker>\n\t\t\t</span>\n\t\t</teleport>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n\tautoUpdate,\n\tflip,\n\thide,\n\toffset,\n\tshift,\n\tuseFloating,\n} from '@floating-ui/vue';\nimport { computed, ref, watch } from 'vue';\nimport { Dayjs, default as dayjs } from 'dayjs';\nimport { default as customParseFormat } from 'dayjs/plugin/customParseFormat';\nimport { default as it } from 'dayjs/locale/it';\nimport { identity } from '@/utilities/functions/identity';\nimport { last } from '@/utilities/functions/last';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { useIntersectionObserver } from '@vueuse/core';\nimport { useMobile } from '@/composables/useMobile';\nimport { vMaska } from 'maska';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport BaseDatePicker from '../BaseDatePicker/BaseDatePicker.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { BaseDatePickerSlots } from '../BaseDatePicker/BaseDatePicker.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\ndayjs.extend(customParseFormat);\ndayjs.locale(it);\n\nexport type BaseDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean | 'not-mobile';\n\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Defines the first day of the week with `0` meaning Sunday and `6` meaning Saturday\n\t */\n\tfirstDayOfWeek?: (typeof it)['weekStart'];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Maximum selectable date\n\t */\n\tmax?: Date | string | number;\n\n\t/**\n\t * Minimum selectable date\n\t */\n\tmin?: Date | string | number;\n\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | string[] | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Selects a range of dates between two dates. It selects all of the days between start and end\n\t */\n\trange?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Function that accepts a `Date` object and returns a boolean. `false` meaning the date cannot be selected\n\t * @param date\n\t */\n\tselectable?: (date: Date) => boolean;\n\n\t/**\n\t * Width of the calendar\n\t */\n\twidth?: number | string;\n};\n\nconst props = withDefaults(defineProps<BaseDatePickerInputProps>(), {\n\tallowWriting: true,\n\tautocomplete: 'off',\n\twidth: 290,\n});\n\nexport type BaseDatePickerInputEvents = {\n\t(e: 'active'): void;\n\t(e: 'error', message: string): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'update:modelValue', value: BaseDatePickerInputProps['modelValue']): void;\n};\n\nconst emit = defineEmits<BaseDatePickerInputEvents>();\n\ndefineSlots<\n\t{\n\t\t'prepend-outer'?: (props: object) => any;\n\t\tprepend?: (props: object) => any;\n\t\tprefix?: (props: object) => any;\n\t\tappend?: (props: object) => any;\n\t\t'append-outer'?: (props: object) => any;\n\t\tsuffix?: (props: object) => any;\n\t} & BaseDatePickerSlots\n>();\n\nconst calendar = ref<HTMLElement | null>(null);\nconst outerContainer = ref<InstanceType<\n\ttypeof CommonInputOuterContainer\n> | null>(null);\nconst innerContainer = ref<InstanceType<\n\ttypeof CommonInputInnerContainer\n> | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst inputValue = ref<string | null>(null);\nconst basedatepicker = ref();\nconst id = props.id || `bdpi_${useId().id.value}`;\n\nconst { isMobile } = useMobile();\nconst inputmode = computed(() =>\n\tprops.allowWriting === 'not-mobile' && isMobile.value ? 'none' : 'numeric'\n);\n\nconst canOpenCalendar = ref(true);\nuseIntersectionObserver(\n\tinnerContainer,\n\t([{ intersectionRatio }]) => {\n\t\tif (intersectionRatio === 1) canOpenCalendar.value = true;\n\t\telse {\n\t\t\tcanOpenCalendar.value = false;\n\t\t\tif (shown.value || showing.value) {\n\t\t\t\tdeactivate();\n\t\t\t\tif (innerContainer.value) {\n\t\t\t\t\tconst ic = innerContainer.value.$el;\n\t\t\t\t\tconst button: HTMLElement = ic.querySelector(\n\t\t\t\t\t\t'.bb-base-date-picker-input__calendar-btn'\n\t\t\t\t\t);\n\t\t\t\t\tbutton.focus();\n\t\t\t\t}\n\t\t\t\tclose();\n\t\t\t}\n\t\t}\n\t},\n\t{ threshold: [0, 1] }\n);\n\nconst classes = computed(() => ({\n\t'bb-base-date-picker-input': true,\n\t'bb-base-date-picker-input--active': active.value,\n\t'bb-base-date-picker-input--errors': props.hasErrors,\n\t'bb-base-date-picker-input--loading': props.loading,\n\t'bb-base-date-picker-input--readonly': props.readonly,\n\t'bb-base-date-picker-input--disabled': props.disabled,\n}));\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonInput: (event: Event) => {\n\t\tif (props.range) return;\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tinputValue.value = event.target.value;\n\t\t\tif (/\\d{2}\\/\\d{2}\\/\\d{4}/.test(event.target.value)) {\n\t\t\t\tconst date = dayjs(event.target.value, 'DD/MM/YYYY');\n\t\t\t\tif (!isDateDisabled(date)) {\n\t\t\t\t\temit('update:modelValue', date.toISOString());\n\t\t\t\t} else {\n\t\t\t\t\temit('error', 'invalid_date_typed');\n\t\t\t\t}\n\t\t\t} else if (event.target.value === '') {\n\t\t\t\temit('update:modelValue', null);\n\t\t\t}\n\t\t}\n\t},\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 onFocusIn = () => {\n\tif (active.value) return;\n\temit('active');\n\tactive.value = true;\n\tdocument.addEventListener('focusin', onDocumentInteraction);\n\tdocument.addEventListener('click', onDocumentInteraction);\n};\n\nconst onDocumentInteraction = (event: FocusEvent) => {\n\tif (trapIsActive.value) return;\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\touterContainer.value?.$el &&\n\t\t\t!outerContainer.value.$el.contains(event.target) &&\n\t\t\t!calendar.value?.contains(event.target)\n\t\t) {\n\t\t\tactive.value = false;\n\t\t\temit('inactive');\n\t\t\tdocument.removeEventListener('focusin', onDocumentInteraction);\n\t\t\tdocument.removeEventListener('click', onDocumentInteraction);\n\t\t}\n\t}\n};\n\nconst getStringFromModelValue = (value: typeof props.modelValue) => {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tlet head;\n\t\t\tlet tail;\n\t\t\tif (value.length) head = value[0];\n\t\t\tif (value.length > 1) tail = last(value);\n\t\t\treturn [head, tail]\n\t\t\t\t.filter(identity)\n\t\t\t\t.map((el) => dayjs(el).format('DD/MM/YYYY'))\n\t\t\t\t.join(' - ');\n\t\t} else {\n\t\t\treturn dayjs(value).format('DD/MM/YYYY');\n\t\t}\n\t}\n\treturn null;\n};\n\nconst displayValue = computed(() => {\n\tif (inputValue.value) return inputValue.value;\n\treturn getStringFromModelValue(props.modelValue);\n});\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tinputValue.value = getStringFromModelValue(value);\n\t}\n);\n\nconst { floatingStyles } = useFloating(innerContainer, calendar, {\n\tplacement: 'bottom',\n\twhileElementsMounted: autoUpdate,\n\tmiddleware: [flip(), offset(5), shift({ padding: 6 }), hide()],\n});\n\nconst calendarStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t};\n\tif (!calendar.value) return base;\n\n\treturn base;\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\thidden.value = false;\n\tshowing.value = true;\n\tawait wait(350);\n\tshowing.value = false;\n\n\thidden.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thiding.value = true;\n\tawait wait(350);\n\thidden.value = true;\n\thiding.value = false;\n\tbasedatepicker.value?.setSelectionModeToDay();\n\tbasedatepicker.value?.setCursor(props.modelValue);\n};\n\nconst shouldRenderCalendar = ref(false);\nconst onOpenCalendar = async () => {\n\tif (trapIsActive.value) return;\n\tshouldRenderCalendar.value = true;\n\tawait waitFor(() => !!calendar.value);\n\tawait open();\n\tactivate();\n};\n\nconst trapIsActive = ref(false);\nconst { activate, deactivate } = useFocusTrap(calendar, {\n\tonActivate: () => (trapIsActive.value = true),\n\t// On post activation focus on current date\n\tonPostActivate: () => {\n\t\tcalendar\n\t\t\t.value!.querySelector<HTMLButtonElement>(\n\t\t\t\t'.bb-base-date-picker-date--current button'\n\t\t\t)\n\t\t\t?.focus();\n\t},\n\tonPostDeactivate: async () => {\n\t\t// Wait for transition to end and for focus to return before\n\t\tawait wait(200);\n\t\ttrapIsActive.value = false;\n\t},\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tclickOutsideDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tallowOutsideClick: true,\n\tpreventScroll: true,\n});\n\nconst shouldOpen = ref(!props.allowWriting || props.range);\nconst onFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tif (shouldOpen.value) onOpenCalendar();\n\tshouldOpen.value =\n\t\t!props.allowWriting ||\n\t\t(props.allowWriting === 'not-mobile' && isMobile.value) ||\n\t\tprops.range;\n};\n\nconst satisfiesSelection = (value: typeof props.modelValue) => {\n\treturn (\n\t\t(props.range && Array.isArray(value) && value.length === 2) ||\n\t\t(!props.range && !!value)\n\t);\n};\n\n/**\n * These events are just propagated\n */\nconst calendarEventListeners = {\n\t'onUpdate:modelValue': (value: string | string[] | null) => {\n\t\temit('update:modelValue', value);\n\t\tif (satisfiesSelection(value)) {\n\t\t\tshouldOpen.value = false;\n\t\t\tdeactivate({\n\t\t\t\tonPostDeactivate: () => {\n\t\t\t\t\ttrapIsActive.value = false;\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t},\n};\n\nconst accessibleButtonLabel = computed(() => {\n\tif (props.range) {\n\t\tif (!props.modelValue || props.modelValue.length < 2)\n\t\t\treturn `Seleziona un range`;\n\t\tconst start = dayjs(props.modelValue[0]).format('D MMMM YYYY');\n\t\tconst end = dayjs(props.modelValue[1]).format('D MMMM YYYY');\n\t\tif (props.range && props.modelValue.length === 2)\n\t\t\treturn `Cambia selezione, da ${start} a ${end}`;\n\t} else if (typeof props.modelValue === 'string') {\n\t\tconst selected = dayjs(props.modelValue).format('D MMMM YYYY');\n\t\treturn `Cambia selezione, ${selected}`;\n\t}\n\treturn 'Seleziona una data';\n});\n\nconst isDateDisabled = (date: Dayjs) => {\n\tlet passing = true;\n\tif (props.min) {\n\t\tpassing &&= date.isSameOrAfter(dayjs(props.min).startOf('day'));\n\t}\n\tif (props.max) {\n\t\tpassing &&= date.isSameOrBefore(dayjs(props.max).startOf('day'));\n\t}\n\tif (typeof props.selectable === 'function') {\n\t\tpassing &&= props.selectable(date.toDate());\n\t}\n\treturn !passing;\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseDatePickerInput';\n</style>\n"],"names":["dayjs","customParseFormat","it","props","__props","emit","__emit","calendar","ref","outerContainer","innerContainer","input","inputValue","basedatepicker","id","useId","isMobile","useMobile","inputmode","computed","canOpenCalendar","useIntersectionObserver","intersectionRatio","shown","showing","deactivate","close","classes","active","eventListeners","event","date","isDateDisabled","onFocusIn","onDocumentInteraction","trapIsActive","_a","_b","getStringFromModelValue","value","head","tail","last","identity","el","displayValue","watch","floatingStyles","useFloating","autoUpdate","flip","offset","shift","hide","calendarStyles","base","hiding","hidden","open","wait","shouldRenderCalendar","onOpenCalendar","waitFor","activate","useFocusTrap","shouldOpen","onFocus","satisfiesSelection","calendarEventListeners","accessibleButtonLabel","start","end","passing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,EAAE,OAAO,aAAa,GACvDoE,IAAMvE,EAAMG,EAAM,WAAW,CAAC,CAAC,EAAE,OAAO,aAAa;AAC3D,YAAIA,EAAM,SAASA,EAAM,WAAW,WAAW;AACvC,iBAAA,wBAAwBmE,CAAK,MAAMC,CAAG;AAAA,MACpC,WAAA,OAAOpE,EAAM,cAAe;AAEtC,eAAO,qBADUH,EAAMG,EAAM,UAAU,EAAE,OAAO,aAAa,CACzB;AAE9B,aAAA;AAAA,IAAA,CACP,GAEK6B,KAAiB,CAACD,MAAgB;AACvC,UAAIyC,IAAU;AACd,aAAIrE,EAAM,OACGqE,UAAAzC,EAAK,cAAc/B,EAAMG,EAAM,GAAG,EAAE,QAAQ,KAAK,CAAC,IAE3DA,EAAM,OACGqE,UAAAzC,EAAK,eAAe/B,EAAMG,EAAM,GAAG,EAAE,QAAQ,KAAK,CAAC,IAE5D,OAAOA,EAAM,cAAe,cAC/BqE,UAAYrE,EAAM,WAAW4B,EAAK,OAAQ,CAAA,IAEpC,CAACyC;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index20.js","sources":["../src/components/BaseDatePickerInput/BaseDatePickerInput.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer\n\t\tref=\"outerContainer\"\n\t\t:class=\"classes\"\n\t\t@focusin=\"onFocusIn\"\n\t>\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\tref=\"innerContainer\"\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\n\t\t\t<input\n\t\t\t\t:id=\"id\"\n\t\t\t\tref=\"input\"\n\t\t\t\tv-maska\n\t\t\t\t:aria-describedby=\"`bdpi_description_${id}`\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:data-maska=\"props.range ? '##/##/#### - ##/##/####' : '##/##/####'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:inputmode=\"inputmode\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly || range || !allowWriting\"\n\t\t\t\t:required=\"required\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\tsize=\"1\"\n\t\t\t\t:type=\"'text'\"\n\t\t\t\t:value=\"displayValue\"\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t/>\n\t\t\t<button\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar-btn\"\n\t\t\t\t:disabled=\"disabled || readonly || !canOpenCalendar\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t@click=\"onOpenCalendar\"\n\t\t\t>\n\t\t\t\t<svg fill=\"none\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M12.6667 2.66667H3.33333C2.59695 2.66667 2 3.26363 2 4.00001V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4.00001C14 3.26363 13.403 2.66667 12.6667 2.66667Z\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10.6667 1.33333V3.99999\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M5.33333 1.33333V3.99999\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M2 6.66667H14\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\n\t\t\t\t<span>{{ accessibleButtonLabel }}</span>\n\t\t\t</button>\n\t\t\t<span\n\t\t\t\t:id=\"`bdpi_description_${id}`\"\n\t\t\t\tclass=\"bb-base-date-picker-input__accessible-description\"\n\t\t\t\t>Formato della data\n\t\t\t\t{{ props.range ? 'GG/MM/AAAA - GG/MM/AAAA' : 'GG/MM/AAAA' }}</span\n\t\t\t>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\n\t\t<teleport v-if=\"shouldRenderCalendar\" to=\"body\">\n\t\t\t<span\n\t\t\t\tref=\"calendar\"\n\t\t\t\tclass=\"bb-base-date-picker-input__calendar\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-date-picker-input__calendar--shown': shown,\n\t\t\t\t}\"\n\t\t\t\t:style=\"calendarStyles\"\n\t\t\t>\n\t\t\t\t<SlideBack\n\t\t\t\t\t:direction=\"placement?.includes('top') ? 'bottom' : 'top'\"\n\t\t\t\t\t:duration=\"300\"\n\t\t\t\t>\n\t\t\t\t\t<KeepAlive>\n\t\t\t\t\t\t<BaseDatePicker\n\t\t\t\t\t\t\tv-if=\"shown\"\n\t\t\t\t\t\t\t:id=\"id\"\n\t\t\t\t\t\t\tv-bind=\"calendarEventListeners\"\n\t\t\t\t\t\t\tref=\"basedatepicker\"\n\t\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\t\t:first-day-of-week=\"firstDayOfWeek\"\n\t\t\t\t\t\t\t:max=\"max\"\n\t\t\t\t\t\t\t:min=\"min\"\n\t\t\t\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t\t\t\t:range=\"range\"\n\t\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t\t:selectable=\"selectable\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</KeepAlive>\n\t\t\t\t</SlideBack>\n\t\t\t</span>\n\t\t</teleport>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n\tautoUpdate,\n\tflip,\n\thide,\n\toffset,\n\tshift,\n\tuseFloating,\n} from '@floating-ui/vue';\nimport { computed, ref, watch } from 'vue';\nimport { Dayjs, default as dayjs } from 'dayjs';\nimport { default as customParseFormat } from 'dayjs/plugin/customParseFormat';\nimport { default as it } from 'dayjs/locale/it';\nimport { default as isSameOrAfter } from 'dayjs/plugin/isSameOrAfter';\nimport { default as isSameOrBefore } from 'dayjs/plugin/isSameOrBefore';\nimport { identity } from '@/utilities/functions/identity';\nimport { last } from '@/utilities/functions/last';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { useIntersectionObserver } from '@vueuse/core';\nimport { useMobile } from '@/composables/useMobile';\nimport { vMaska } from 'maska';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport BaseDatePicker from '../BaseDatePicker/BaseDatePicker.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport SlideBack from '../Transitions/SlideBack.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\ndayjs.extend(customParseFormat);\ndayjs.extend(isSameOrAfter);\ndayjs.extend(isSameOrBefore);\ndayjs.locale(it);\n\nexport type BaseDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean | 'not-mobile';\n\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Defines the first day of the week with `0` meaning Sunday and `6` meaning Saturday\n\t */\n\tfirstDayOfWeek?: (typeof it)['weekStart'];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Maximum selectable date\n\t */\n\tmax?: Date | string | number;\n\n\t/**\n\t * Minimum selectable date\n\t */\n\tmin?: Date | string | number;\n\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | string[] | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Selects a range of dates between two dates. It selects all of the days between start and end\n\t */\n\trange?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: boolean;\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Function that accepts a `Date` object and returns a boolean. `false` meaning the date cannot be selected\n\t * @param date\n\t */\n\tselectable?: (date: Date) => boolean;\n\n\t/**\n\t * Width of the calendar\n\t */\n\twidth?: number | string;\n};\n\nconst props = withDefaults(defineProps<BaseDatePickerInputProps>(), {\n\tallowWriting: true,\n\tautocomplete: 'off',\n\twidth: 290,\n});\n\nexport type BaseDatePickerInputEvents = {\n\t(e: 'active'): void;\n\t(e: 'error', message: string): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'update:modelValue', value: BaseDatePickerInputProps['modelValue']): void;\n};\n\nconst emit = defineEmits<BaseDatePickerInputEvents>();\n\ndefineSlots<{\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n}>();\n\nconst calendar = ref<HTMLElement | null>(null);\nconst outerContainer = ref<InstanceType<\n\ttypeof CommonInputOuterContainer\n> | null>(null);\nconst innerContainer = ref<InstanceType<\n\ttypeof CommonInputInnerContainer\n> | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst inputValue = ref<string | null>(null);\nconst basedatepicker = ref();\nconst id = props.id || `bdpi_${useId().id.value}`;\n\nconst { isMobile } = useMobile();\nconst inputmode = computed(() =>\n\tprops.allowWriting === 'not-mobile' && isMobile.value ? 'none' : 'numeric'\n);\n\nconst canOpenCalendar = ref(true);\nuseIntersectionObserver(\n\tinnerContainer,\n\t([{ intersectionRatio }]) => {\n\t\tif (intersectionRatio === 1) canOpenCalendar.value = true;\n\t\telse {\n\t\t\tcanOpenCalendar.value = false;\n\t\t\tif (shown.value) {\n\t\t\t\tdeactivate();\n\t\t\t\tif (innerContainer.value) {\n\t\t\t\t\tconst ic = innerContainer.value.$el;\n\t\t\t\t\tconst button: HTMLElement = ic.querySelector(\n\t\t\t\t\t\t'.bb-base-date-picker-input__calendar-btn'\n\t\t\t\t\t);\n\t\t\t\t\tbutton.focus();\n\t\t\t\t}\n\t\t\t\tclose();\n\t\t\t}\n\t\t}\n\t},\n\t{ threshold: [0, 1] }\n);\n\nconst classes = computed(() => ({\n\t'bb-base-date-picker-input': true,\n\t'bb-base-date-picker-input--active': active.value,\n\t'bb-base-date-picker-input--errors': props.hasErrors,\n\t'bb-base-date-picker-input--loading': props.loading,\n\t'bb-base-date-picker-input--readonly': props.readonly,\n\t'bb-base-date-picker-input--disabled': props.disabled,\n}));\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonInput: (event: Event) => {\n\t\tif (props.range) return;\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tinputValue.value = event.target.value;\n\t\t\tif (/\\d{2}\\/\\d{2}\\/\\d{4}/.test(event.target.value)) {\n\t\t\t\tconst date = dayjs(event.target.value, 'DD/MM/YYYY');\n\t\t\t\tif (!isDateDisabled(date)) {\n\t\t\t\t\temit('update:modelValue', date.toISOString());\n\t\t\t\t} else {\n\t\t\t\t\tevent.target.value = '';\n\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t\temit('error', 'invalid_date_typed');\n\t\t\t\t}\n\t\t\t} else if (event.target.value === '') {\n\t\t\t\temit('update:modelValue', null);\n\t\t\t}\n\t\t}\n\t},\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 physically move focus to the calendar so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst onFocusIn = () => {\n\tif (active.value) return;\n\temit('active');\n\tactive.value = true;\n\tdocument.addEventListener('focusin', onDocumentInteraction);\n\tdocument.addEventListener('click', onDocumentInteraction);\n};\n\nconst onDocumentInteraction = (event: FocusEvent) => {\n\tif (trapIsActive.value) return;\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\touterContainer.value?.$el &&\n\t\t\t!outerContainer.value.$el.contains(event.target) &&\n\t\t\t!calendar.value?.contains(event.target)\n\t\t) {\n\t\t\tactive.value = false;\n\t\t\temit('inactive');\n\t\t\tdocument.removeEventListener('focusin', onDocumentInteraction);\n\t\t\tdocument.removeEventListener('click', onDocumentInteraction);\n\t\t}\n\t}\n};\n\nconst getStringFromModelValue = (value: typeof props.modelValue) => {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tlet head;\n\t\t\tlet tail;\n\t\t\tif (value.length) head = value[0];\n\t\t\tif (value.length > 1) tail = last(value);\n\t\t\treturn [head, tail]\n\t\t\t\t.filter(identity)\n\t\t\t\t.map((el) => dayjs(el).format('DD/MM/YYYY'))\n\t\t\t\t.join(' - ');\n\t\t} else {\n\t\t\treturn dayjs(value).format('DD/MM/YYYY');\n\t\t}\n\t}\n\treturn null;\n};\n\nconst displayValue = computed(() => {\n\tif (inputValue.value) return inputValue.value;\n\treturn getStringFromModelValue(props.modelValue);\n});\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tinputValue.value = getStringFromModelValue(value);\n\t}\n);\n\nconst { floatingStyles, placement } = useFloating(innerContainer, calendar, {\n\tplacement: 'bottom',\n\twhileElementsMounted: autoUpdate,\n\tmiddleware: [flip(), offset(5), shift({ padding: 6 }), hide()],\n});\n\nconst calendarStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t};\n\tif (!calendar.value) return base;\n\n\treturn base;\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\nconst open = async () => {\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\tbasedatepicker.value?.resetStatus();\n};\n\nconst shouldRenderCalendar = ref(false);\nconst onOpenCalendar = async () => {\n\tif (trapIsActive.value) return;\n\tshouldRenderCalendar.value = true;\n\tawait waitFor(() => !!calendar.value);\n\tawait open();\n\tactivate();\n};\n\nconst trapIsActive = ref(false);\nconst { activate, deactivate } = useFocusTrap(calendar, {\n\tonActivate: () => (trapIsActive.value = true),\n\t// On post activation focus on current date\n\tonPostActivate: () => {\n\t\tcalendar\n\t\t\t.value!.querySelector<HTMLButtonElement>(\n\t\t\t\t'.bb-base-date-picker-date--current button'\n\t\t\t)\n\t\t\t?.focus();\n\t},\n\tonPostDeactivate: async () => {\n\t\t// Wait for transition to end and for focus to return before\n\t\tawait wait(200);\n\t\ttrapIsActive.value = false;\n\t},\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tclickOutsideDeactivates: () => {\n\t\tshouldOpen.value = false;\n\t\tclose();\n\t\treturn true;\n\t},\n\tallowOutsideClick: true,\n\tpreventScroll: true,\n});\n\nconst shouldOpen = ref(!props.allowWriting || props.range);\nconst onFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tif (shouldOpen.value) onOpenCalendar();\n\tshouldOpen.value =\n\t\t!props.allowWriting ||\n\t\t(props.allowWriting === 'not-mobile' && isMobile.value) ||\n\t\tprops.range;\n};\n\nconst satisfiesSelection = (value: typeof props.modelValue) => {\n\treturn (\n\t\t(props.range && Array.isArray(value) && value.length === 2) ||\n\t\t(!props.range && !!value)\n\t);\n};\n\n/**\n * These events are just propagated\n */\nconst calendarEventListeners = {\n\t'onUpdate:modelValue': (value: string | string[] | null) => {\n\t\temit('update:modelValue', value);\n\t\tif (satisfiesSelection(value)) {\n\t\t\tshouldOpen.value = false;\n\t\t\tdeactivate({\n\t\t\t\tonPostDeactivate: () => {\n\t\t\t\t\ttrapIsActive.value = false;\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t},\n};\n\nconst accessibleButtonLabel = computed(() => {\n\tif (props.range) {\n\t\tif (!props.modelValue || props.modelValue.length < 2)\n\t\t\treturn `Seleziona un range`;\n\t\tconst start = dayjs(props.modelValue[0]).format('D MMMM YYYY');\n\t\tconst end = dayjs(props.modelValue[1]).format('D MMMM YYYY');\n\t\tif (props.range && props.modelValue.length === 2)\n\t\t\treturn `Cambia selezione, da ${start} a ${end}`;\n\t} else if (typeof props.modelValue === 'string') {\n\t\tconst selected = dayjs(props.modelValue).format('D MMMM YYYY');\n\t\treturn `Cambia selezione, ${selected}`;\n\t}\n\treturn 'Seleziona una data';\n});\n\nconst isDateDisabled = (date: Dayjs) => {\n\tconsole.log(date);\n\tlet passing = true;\n\tif (props.min) {\n\t\tpassing &&= date.isSameOrAfter(dayjs(props.min).startOf('day'));\n\t}\n\tif (props.max) {\n\t\tpassing &&= date.isSameOrBefore(dayjs(props.max).startOf('day'));\n\t}\n\tif (typeof props.selectable === 'function') {\n\t\tpassing &&= props.selectable(date.toDate());\n\t}\n\treturn !passing;\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseDatePickerInput';\n</style>\n"],"names":["dayjs","customParseFormat","isSameOrAfter","isSameOrBefore","it","props","__props","emit","__emit","calendar","ref","outerContainer","innerContainer","input","inputValue","basedatepicker","id","useId","isMobile","useMobile","inputmode","computed","canOpenCalendar","useIntersectionObserver","intersectionRatio","shown","deactivate","close","classes","active","eventListeners","event","date","isDateDisabled","onFocusIn","onDocumentInteraction","trapIsActive","_a","_b","getStringFromModelValue","value","head","tail","last","identity","el","displayValue","watch","floatingStyles","placement","useFloating","autoUpdate","flip","offset","shift","hide","calendarStyles","base","open","shouldRenderCalendar","onOpenCalendar","waitFor","activate","useFocusTrap","wait","shouldOpen","onFocus","satisfiesSelection","calendarEventListeners","accessibleButtonLabel","start","end","passing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkJA,IAAAA,EAAM,OAAOC,EAAiB,GAC9BD,EAAM,OAAOE,EAAa,GAC1BF,EAAM,OAAOG,EAAc,GAC3BH,EAAM,OAAOI,EAAE;AA4Gf,UAAMC,IAAQC,GAcRC,IAAOC,GAWPC,IAAWC,EAAwB,IAAI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